@cu-mkp/editioncrafter 1.1.0-beta.1 → 1.2.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (118) hide show
  1. package/dist/editioncrafter.js +20709 -18672
  2. package/dist/es/src/{action → EditionCrafter/action}/DocumentActions.js +8 -0
  3. package/dist/es/src/{action → EditionCrafter/action}/initialState/documentInitialState.js +7 -0
  4. package/dist/es/src/{component → EditionCrafter/component}/DiploMatic.js +17 -14
  5. package/dist/es/src/{component → EditionCrafter/component}/DocumentView.js +16 -6
  6. package/dist/es/src/EditionCrafter/component/Navigation.js +446 -0
  7. package/dist/es/src/{component → EditionCrafter/component}/RouteListener.js +3 -3
  8. package/dist/es/src/EditionCrafter/component/TagToolbar.jsx +57 -0
  9. package/dist/es/src/{component → EditionCrafter/component}/TranscriptionView.js +27 -7
  10. package/dist/es/src/EditionCrafter/context/TagFilter.jsx +61 -0
  11. package/dist/es/src/EditionCrafter/context/TagFilterContext.js +8 -0
  12. package/dist/es/src/EditionCrafter/icons/DocumentPagesIcon.jsx +18 -0
  13. package/dist/es/src/{model → EditionCrafter/model}/Folio.js +27 -1
  14. package/dist/es/src/{model → EditionCrafter/model}/folioLayout.js +6 -5
  15. package/dist/es/src/{saga → EditionCrafter/saga}/RouteListenerSaga.js +44 -3
  16. package/dist/es/src/{scss → EditionCrafter/scss}/_base.scss +11 -1
  17. package/dist/es/src/{scss → EditionCrafter/scss}/_diplomatic.scss +15 -24
  18. package/dist/es/src/EditionCrafter/scss/_navigation.scss +468 -0
  19. package/dist/es/src/{scss → EditionCrafter/scss}/_transcriptView.scss +50 -41
  20. package/dist/es/src/{scss → EditionCrafter/scss}/editioncrafter.scss +2 -1
  21. package/dist/es/src/RecordList/component/CollapsibleMenu.jsx +22 -0
  22. package/dist/es/src/RecordList/component/Loading.jsx +12 -0
  23. package/dist/es/src/RecordList/component/Pill.jsx +10 -0
  24. package/dist/es/src/RecordList/component/Record.jsx +82 -0
  25. package/dist/es/src/RecordList/component/RecordListView.jsx +109 -0
  26. package/dist/es/src/RecordList/component/Sidebar.jsx +83 -0
  27. package/dist/es/src/RecordList/component/SidebarTagList.jsx +38 -0
  28. package/dist/es/src/RecordList/context/FilterContext.jsx +8 -0
  29. package/dist/es/src/RecordList/index.jsx +92 -0
  30. package/dist/es/src/RecordList/lib/sql.js +9 -0
  31. package/dist/es/src/RecordList/styles/base.css +78 -0
  32. package/dist/es/src/RecordList/styles/record.css +84 -0
  33. package/dist/es/src/RecordList/styles/sidebar.css +39 -0
  34. package/dist/es/src/{index.js → index.jsx} +6 -3
  35. package/package.json +6 -3
  36. package/dist/es/src/component/Navigation.js +0 -402
  37. package/dist/es/src/hooks/useIsWidthUp.js +0 -9
  38. package/dist/es/src/lib/registerServiceWorker.js +0 -111
  39. package/dist/es/src/scss/_navigation.scss +0 -209
  40. /package/dist/es/src/{action → EditionCrafter/action}/DiplomaticActions.js +0 -0
  41. /package/dist/es/src/{action → EditionCrafter/action}/GlossaryActions.js +0 -0
  42. /package/dist/es/src/{action → EditionCrafter/action}/initialState/diplomaticInitialState.js +0 -0
  43. /package/dist/es/src/{action → EditionCrafter/action}/initialState/glossaryInitialState.js +0 -0
  44. /package/dist/es/src/{action → EditionCrafter/action}/rootReducer.js +0 -0
  45. /package/dist/es/src/{component → EditionCrafter/component}/AlphabetLinks.js +0 -0
  46. /package/dist/es/src/{component → EditionCrafter/component}/CustomizedTooltops.js +0 -0
  47. /package/dist/es/src/{component → EditionCrafter/component}/EditorComment.js +0 -0
  48. /package/dist/es/src/{component → EditionCrafter/component}/ErrorBoundary.js +0 -0
  49. /package/dist/es/src/{component → EditionCrafter/component}/FigureImage.js +0 -0
  50. /package/dist/es/src/{component → EditionCrafter/component}/GlossaryView.js +0 -0
  51. /package/dist/es/src/{component → EditionCrafter/component}/HelpPopper.js +0 -0
  52. /package/dist/es/src/{component → EditionCrafter/component}/ImageGridView.js +0 -0
  53. /package/dist/es/src/{component → EditionCrafter/component}/ImageView.js +0 -0
  54. /package/dist/es/src/{component → EditionCrafter/component}/ImageZoomControl.js +0 -0
  55. /package/dist/es/src/{component → EditionCrafter/component}/JumpToFolio.js +0 -0
  56. /package/dist/es/src/{component → EditionCrafter/component}/Pagination.js +0 -0
  57. /package/dist/es/src/{component → EditionCrafter/component}/Parser.js +0 -0
  58. /package/dist/es/src/{component → EditionCrafter/component}/RingSpinner.js +0 -0
  59. /package/dist/es/src/{component → EditionCrafter/component}/SeaDragonComponent.js +0 -0
  60. /package/dist/es/src/{component → EditionCrafter/component}/SinglePaneView.js +0 -0
  61. /package/dist/es/src/{component → EditionCrafter/component}/SplitPaneView.js +0 -0
  62. /package/dist/es/src/{component → EditionCrafter/component}/Watermark.js +0 -0
  63. /package/dist/es/src/{component → EditionCrafter/component}/XMLView.js +0 -0
  64. /package/dist/es/src/{icons → EditionCrafter/icons}/ByIcon.js +0 -0
  65. /package/dist/es/src/{icons → EditionCrafter/icons}/CcIcon.js +0 -0
  66. /package/dist/es/src/{icons → EditionCrafter/icons}/NcIcon.js +0 -0
  67. /package/dist/es/src/{icons → EditionCrafter/icons}/SaIcon.js +0 -0
  68. /package/dist/es/src/{icons → EditionCrafter/icons}/SideMenuIconLeft.js +0 -0
  69. /package/dist/es/src/{icons → EditionCrafter/icons}/SideMenuIconRight.js +0 -0
  70. /package/dist/es/src/{icons → EditionCrafter/icons}/howtouse-asterisk.png +0 -0
  71. /package/dist/es/src/{icons → EditionCrafter/icons}/howtouse-curly.png +0 -0
  72. /package/dist/es/src/{icons → EditionCrafter/icons}/howtouse-square.png +0 -0
  73. /package/dist/es/src/{icons → EditionCrafter/icons}/howtouse-ups.png +0 -0
  74. /package/dist/es/src/{img → EditionCrafter/img}/banner-about.png +0 -0
  75. /package/dist/es/src/{img → EditionCrafter/img}/banner-essays.jpg +0 -0
  76. /package/dist/es/src/{img → EditionCrafter/img}/banner-essays.png +0 -0
  77. /package/dist/es/src/{img → EditionCrafter/img}/banner-how-to.png +0 -0
  78. /package/dist/es/src/{img → EditionCrafter/img}/banner-resources.png +0 -0
  79. /package/dist/es/src/{img → EditionCrafter/img}/book-open-cropped.png +0 -0
  80. /package/dist/es/src/{img → EditionCrafter/img}/book-open.png +0 -0
  81. /package/dist/es/src/{img → EditionCrafter/img}/book-spine.png +0 -0
  82. /package/dist/es/src/{img → EditionCrafter/img}/bookcover-cropped.png +0 -0
  83. /package/dist/es/src/{img → EditionCrafter/img}/cropped-MKLizardFilled-32x32.jpg +0 -0
  84. /package/dist/es/src/{img → EditionCrafter/img}/editioncrafterlogo.png +0 -0
  85. /package/dist/es/src/{img → EditionCrafter/img}/folio48r-drawing.png +0 -0
  86. /package/dist/es/src/{img → EditionCrafter/img}/howtouse-asterisk.png +0 -0
  87. /package/dist/es/src/{img → EditionCrafter/img}/howtouse-beaker.png +0 -0
  88. /package/dist/es/src/{img → EditionCrafter/img}/howtouse-curly.png +0 -0
  89. /package/dist/es/src/{img → EditionCrafter/img}/howtouse-square.png +0 -0
  90. /package/dist/es/src/{img → EditionCrafter/img}/howtouse-ups.png +0 -0
  91. /package/dist/es/src/{img → EditionCrafter/img}/lizard-no-bg.png +0 -0
  92. /package/dist/es/src/{img → EditionCrafter/img}/logo_center_multi_line.png +0 -0
  93. /package/dist/es/src/{img → EditionCrafter/img}/logo_center_single_line.png +0 -0
  94. /package/dist/es/src/{img → EditionCrafter/img}/logo_columbia.png +0 -0
  95. /package/dist/es/src/{img → EditionCrafter/img}/mk-banner-logo.png +0 -0
  96. /package/dist/es/src/{img → EditionCrafter/img}/mk-homepage-logo.png +0 -0
  97. /package/dist/es/src/{img → EditionCrafter/img}/spinner.gif +0 -0
  98. /package/dist/es/src/{img → EditionCrafter/img}/text-bg.png +0 -0
  99. /package/dist/es/src/{img → EditionCrafter/img}/watermark.png +0 -0
  100. /package/dist/es/src/{lib → EditionCrafter/lib}/copyObject.js +0 -0
  101. /package/dist/es/src/{model → EditionCrafter/model}/DocumentHelper.js +0 -0
  102. /package/dist/es/src/{model → EditionCrafter/model}/ReduxStore.js +0 -0
  103. /package/dist/es/src/{saga → EditionCrafter/saga}/rootSaga.js +0 -0
  104. /package/dist/es/src/{scss → EditionCrafter/scss}/_CETEIcean.scss +0 -0
  105. /package/dist/es/src/{scss → EditionCrafter/scss}/_globalNavigation.scss +0 -0
  106. /package/dist/es/src/{scss → EditionCrafter/scss}/_glossary.scss +0 -0
  107. /package/dist/es/src/{scss → EditionCrafter/scss}/_imageGridView.scss +0 -0
  108. /package/dist/es/src/{scss → EditionCrafter/scss}/_imageView.scss +0 -0
  109. /package/dist/es/src/{scss → EditionCrafter/scss}/_imageZoomControl.scss +0 -0
  110. /package/dist/es/src/{scss → EditionCrafter/scss}/_jumpbox.scss +0 -0
  111. /package/dist/es/src/{scss → EditionCrafter/scss}/_pagination.scss +0 -0
  112. /package/dist/es/src/{scss → EditionCrafter/scss}/_ringSpinner.scss +0 -0
  113. /package/dist/es/src/{scss → EditionCrafter/scss}/_singlePaneView.scss +0 -0
  114. /package/dist/es/src/{scss → EditionCrafter/scss}/_spinner.scss +0 -0
  115. /package/dist/es/src/{scss → EditionCrafter/scss}/_splitPaneView.scss +0 -0
  116. /package/dist/es/src/{scss → EditionCrafter/scss}/_thumbnails.scss +0 -0
  117. /package/dist/es/src/{scss → EditionCrafter/scss}/_watermark.scss +0 -0
  118. /package/dist/es/src/{scss → EditionCrafter/scss}/_xmlView.scss +0 -0
@@ -1,6 +1,7 @@
1
- import React from 'react'
1
+ import React, { useContext } from 'react'
2
2
  import { connect } from 'react-redux'
3
3
  import { useSearchParams } from 'react-router-dom'
4
+ import TagFilterContext from '../context/TagFilterContext'
4
5
  import EditorComment from './EditorComment'
5
6
  import ErrorBoundary from './ErrorBoundary'
6
7
  import Navigation from './Navigation'
@@ -34,10 +35,30 @@ function setUpForZoneHighlighting(selectedZone, domNode) {
34
35
  return domNode
35
36
  }
36
37
 
37
- function htmlToReactParserOptions(selectedZone) {
38
+ function handleTags(domNode, selectedTags) {
39
+ const ana = domNode.attribs?.ana
40
+
41
+ if (ana) {
42
+ const truncated = ana.split(' ').map(t => t.slice(1))
43
+ if (truncated.some(tag => selectedTags.includes(tag))) {
44
+ domNode.attribs.class = 'active'
45
+ }
46
+ }
47
+
48
+ return domNode
49
+ }
50
+
51
+ function htmlToReactParserOptions(selectedZone, selectedTags) {
38
52
  const parserOptions = {
39
53
  replace(domNode) {
40
54
  switch (domNode.name) {
55
+ case 'div': {
56
+ domNode = handleTags(domNode, selectedTags)
57
+ return setUpForZoneHighlighting(selectedZone, domNode)
58
+ }
59
+ case 'tei-seg': {
60
+ return handleTags(domNode, selectedTags)
61
+ }
41
62
  case 'tei-line': {
42
63
  return setUpForZoneHighlighting(selectedZone, domNode)
43
64
  }
@@ -74,10 +95,6 @@ function htmlToReactParserOptions(selectedZone) {
74
95
  )
75
96
  }
76
97
 
77
- case 'div': {
78
- return setUpForZoneHighlighting(selectedZone, domNode)
79
- }
80
-
81
98
  default:
82
99
  /* Otherwise, Just pass through */
83
100
  return domNode
@@ -90,6 +107,8 @@ function htmlToReactParserOptions(selectedZone) {
90
107
  function TranscriptionView(props) {
91
108
  const [searchParams] = useSearchParams()
92
109
 
110
+ const { tags } = useContext(TagFilterContext)
111
+
93
112
  const {
94
113
  side,
95
114
  folioID,
@@ -120,6 +139,7 @@ function TranscriptionView(props) {
120
139
  />
121
140
  )
122
141
  }
142
+
123
143
  const transcriptionData = folio && folio.transcription && folio.transcription[transcriptionType]
124
144
 
125
145
  if (folio && !folio.loading && !transcriptionData) {
@@ -133,7 +153,7 @@ function TranscriptionView(props) {
133
153
  }
134
154
 
135
155
  // Configure parser to replace certain tags with components
136
- const htmlToReactParserOptionsSide = htmlToReactParserOptions(searchParams.get('zone'))
156
+ const htmlToReactParserOptionsSide = htmlToReactParserOptions(searchParams.get('zone'), tags)
137
157
  const html = transcriptionData && transcriptionData.html
138
158
  const layout = transcriptionData && transcriptionData.layout
139
159
 
@@ -0,0 +1,61 @@
1
+ import { useEffect, useMemo, useState } from 'react'
2
+ import {
3
+ createSearchParams,
4
+ useLocation,
5
+ useNavigate,
6
+ useSearchParams,
7
+ } from 'react-router-dom'
8
+ import TagFilterContext from './TagFilterContext'
9
+
10
+ function getTagsFromParams(val) {
11
+ if (val) {
12
+ return val.split(',')
13
+ }
14
+
15
+ return []
16
+ }
17
+
18
+ function TagFilterProvider(props) {
19
+ const [searchParams] = useSearchParams()
20
+ const location = useLocation()
21
+ const navigate = useNavigate()
22
+
23
+ const [tags, setTags] = useState(getTagsFromParams(searchParams.get('tags')))
24
+
25
+ const tagParams = searchParams.get('tags')
26
+
27
+ useEffect(() => {
28
+ const newTags = getTagsFromParams(tagParams)
29
+ setTags(newTags)
30
+ }, [tagParams])
31
+
32
+ const ctxValue = useMemo(() => {
33
+ const toggleTag = (xmlId) => {
34
+ if (tags.includes(xmlId)) {
35
+ const oldTags = getTagsFromParams(tagParams)
36
+ const newTags = oldTags.filter(t => t !== xmlId)
37
+ searchParams.set('tags', newTags.join(','))
38
+ setTags(newTags)
39
+ navigate(`${location.pathname}?${createSearchParams(searchParams.toString())}`)
40
+ }
41
+ else {
42
+ searchParams.set('tags', `${tagParams},${xmlId}`)
43
+ setTags([...tags, xmlId])
44
+ navigate(`${location.pathname}?${createSearchParams(searchParams.toString())}`)
45
+ }
46
+ }
47
+
48
+ return {
49
+ tags,
50
+ toggleTag,
51
+ }
52
+ }, [location.pathname, navigate, searchParams, tagParams, tags])
53
+
54
+ return (
55
+ <TagFilterContext.Provider value={ctxValue}>
56
+ {props.children}
57
+ </TagFilterContext.Provider>
58
+ )
59
+ }
60
+
61
+ export default TagFilterProvider
@@ -0,0 +1,8 @@
1
+ import { createContext } from 'react'
2
+
3
+ const TagFilterContext = createContext({
4
+ tags: [],
5
+ toggleTag: () => null,
6
+ })
7
+
8
+ export default TagFilterContext
@@ -0,0 +1,18 @@
1
+ function DocumentPagesIcon() {
2
+ return (
3
+ <svg className="document-pages-icon" width="22" height="16" viewBox="0 0 22 16" fill="none" xmlns="http://www.w3.org/2000/svg">
4
+ <g id="fluent:document-one-page-20-regular" clipPath="url(#clip0_288_13990)">
5
+ <path id="Vector" d="M2.16667 0H8.83333C9.27536 0 9.69928 0.210714 10.0118 0.585786C10.3244 0.960859 10.5 1.46957 10.5 2V14C10.5 14.5304 10.3244 15.0391 10.0118 15.4142C9.69928 15.7893 9.27536 16 8.83333 16H2.16667C1.72464 16 1.30072 15.7893 0.988155 15.4142C0.675595 15.0391 0.5 14.5304 0.5 14V2C0.5 1.46957 0.675595 0.960859 0.988155 0.585786C1.30072 0.210714 1.72464 0 2.16667 0ZM2.16667 1C1.94565 1 1.73369 1.10536 1.57741 1.29289C1.42113 1.48043 1.33333 1.73478 1.33333 2V14C1.33333 14.2652 1.42113 14.5196 1.57741 14.7071C1.73369 14.8946 1.94565 15 2.16667 15H8.83333C9.05435 15 9.26631 14.8946 9.42259 14.7071C9.57887 14.5196 9.66667 14.2652 9.66667 14V2C9.66667 1.73478 9.57887 1.48043 9.42259 1.29289C9.26631 1.10536 9.05435 1 8.83333 1H2.16667ZM8 4.5C8.00003 4.61703 7.96586 4.73036 7.90343 4.82026C7.84099 4.91016 7.75426 4.97094 7.65833 4.992L7.58333 5H3.41667C3.31255 5.00023 3.21212 4.95367 3.13518 4.86949C3.05824 4.78531 3.01035 4.66961 3.00094 4.54518C2.99153 4.42074 3.02129 4.29659 3.08435 4.19717C3.14741 4.09775 3.23921 4.03026 3.34167 4.008L3.41667 4H7.58333C7.69384 4 7.79982 4.05268 7.87796 4.14645C7.9561 4.24021 8 4.36739 8 4.5ZM8 8C8.00003 8.11703 7.96586 8.23036 7.90343 8.32026C7.84099 8.41016 7.75426 8.47093 7.65833 8.492L7.58333 8.5H3.41667C3.31255 8.50023 3.21212 8.45367 3.13518 8.36949C3.05824 8.28531 3.01035 8.16961 3.00094 8.04518C2.99153 7.92074 3.02129 7.79659 3.08435 7.69717C3.14741 7.59775 3.23921 7.53026 3.34167 7.508L3.41667 7.5H7.58333C7.69384 7.5 7.79982 7.55268 7.87796 7.64645C7.9561 7.74021 8 7.86739 8 8ZM8 11.5C8.00003 11.617 7.96586 11.7304 7.90343 11.8203C7.84099 11.9102 7.75426 11.9709 7.65833 11.992L7.58333 12H3.41667C3.31255 12.0002 3.21212 11.9537 3.13518 11.8695C3.05824 11.7853 3.01035 11.6696 3.00094 11.5452C2.99153 11.4207 3.02129 11.2966 3.08435 11.1972C3.14741 11.0977 3.23921 11.0303 3.34167 11.008L3.41667 11H7.58333C7.69384 11 7.79982 11.0527 7.87796 11.1464C7.9561 11.2402 8 11.3674 8 11.5Z" />
6
+ <path id="Vector_2" d="M13.1667 0H19.8333C20.2754 0 20.6993 0.210714 21.0118 0.585786C21.3244 0.960859 21.5 1.46957 21.5 2V14C21.5 14.5304 21.3244 15.0391 21.0118 15.4142C20.6993 15.7893 20.2754 16 19.8333 16H13.1667C12.7246 16 12.3007 15.7893 11.9882 15.4142C11.6756 15.0391 11.5 14.5304 11.5 14V2C11.5 1.46957 11.6756 0.960859 11.9882 0.585786C12.3007 0.210714 12.7246 0 13.1667 0ZM13.1667 1C12.9457 1 12.7337 1.10536 12.5774 1.29289C12.4211 1.48043 12.3333 1.73478 12.3333 2V14C12.3333 14.2652 12.4211 14.5196 12.5774 14.7071C12.7337 14.8946 12.9457 15 13.1667 15H19.8333C20.0543 15 20.2663 14.8946 20.4226 14.7071C20.5789 14.5196 20.6667 14.2652 20.6667 14V2C20.6667 1.73478 20.5789 1.48043 20.4226 1.29289C20.2663 1.10536 20.0543 1 19.8333 1H13.1667ZM19 4.5C19 4.61703 18.9659 4.73036 18.9034 4.82026C18.841 4.91016 18.7543 4.97094 18.6583 4.992L18.5833 5H14.4167C14.3125 5.00023 14.2121 4.95367 14.1352 4.86949C14.0582 4.78531 14.0103 4.66961 14.0009 4.54518C13.9915 4.42074 14.0213 4.29659 14.0843 4.19717C14.1474 4.09775 14.2392 4.03026 14.3417 4.008L14.4167 4H18.5833C18.6938 4 18.7998 4.05268 18.878 4.14645C18.9561 4.24021 19 4.36739 19 4.5ZM19 8C19 8.11703 18.9659 8.23036 18.9034 8.32026C18.841 8.41016 18.7543 8.47093 18.6583 8.492L18.5833 8.5H14.4167C14.3125 8.50023 14.2121 8.45367 14.1352 8.36949C14.0582 8.28531 14.0103 8.16961 14.0009 8.04518C13.9915 7.92074 14.0213 7.79659 14.0843 7.69717C14.1474 7.59775 14.2392 7.53026 14.3417 7.508L14.4167 7.5H18.5833C18.6938 7.5 18.7998 7.55268 18.878 7.64645C18.9561 7.74021 19 7.86739 19 8ZM19 11.5C19 11.617 18.9659 11.7304 18.9034 11.8203C18.841 11.9102 18.7543 11.9709 18.6583 11.992L18.5833 12H14.4167C14.3125 12.0002 14.2121 11.9537 14.1352 11.8695C14.0582 11.7853 14.0103 11.6696 14.0009 11.5452C13.9915 11.4207 14.0213 11.2966 14.0843 11.1972C14.1474 11.0977 14.2392 11.0303 14.3417 11.008L14.4167 11H18.5833C18.6938 11 18.7998 11.0527 18.878 11.1464C18.9561 11.2402 19 11.3674 19 11.5Z" />
7
+ </g>
8
+ <defs>
9
+ <clipPath id="clip0_288_13990">
10
+ <rect width="21" height="16" transform="translate(0.5)" />
11
+ </clipPath>
12
+ </defs>
13
+ </svg>
14
+
15
+ )
16
+ }
17
+
18
+ export default DocumentPagesIcon
@@ -1,6 +1,29 @@
1
1
  import OpenSeadragon from 'openseadragon'
2
2
  import { layoutMargin3 } from './folioLayout'
3
3
 
4
+ function getTagIds(html) {
5
+ const tagIds = []
6
+ const doc = new DOMParser().parseFromString(html, 'text/html')
7
+
8
+ const tagEls = doc.querySelectorAll('tei-div[ana], tei-seg[ana]')
9
+
10
+ for (const tagEl of tagEls) {
11
+ const ana = tagEl.getAttribute('ana')
12
+
13
+ if (ana) {
14
+ const split = ana.split(' ').map(t => t.slice(1))
15
+
16
+ for (const tag of split) {
17
+ if (!tagIds.includes(tag)) {
18
+ tagIds.push(tag)
19
+ }
20
+ }
21
+ }
22
+ }
23
+
24
+ return tagIds
25
+ }
26
+
4
27
  export async function loadFolio(folioData) {
5
28
  if (folioData.loading) {
6
29
  return folioData
@@ -18,7 +41,8 @@ export async function loadFolio(folioData) {
18
41
  const imageServerResponse = await response.json()
19
42
  // Handle the image server response
20
43
  folio.tileSource = new OpenSeadragon.IIIFTileSource(imageServerResponse)
21
- } else {
44
+ }
45
+ else {
22
46
  folio.tileSource = new OpenSeadragon.ImageTileSource({
23
47
  type: 'image',
24
48
  url: folio.image_zoom_url,
@@ -37,12 +61,14 @@ export async function loadFolio(folioData) {
37
61
  const xmlURLResponse = await fetch(xmlURL)
38
62
  const html = await htmlURLResponse.text()
39
63
  const xml = await xmlURLResponse.text()
64
+ const tagIds = getTagIds(html)
40
65
  const transcription = parseTranscription(html, xml)
41
66
  if (!transcription) {
42
67
  throw new Error(`Unable to load transcription: ${htmlURL}`)
43
68
  }
44
69
  else {
45
70
  folio.transcription[transcriptionType] = transcription
71
+ folio.tagIds = tagIds
46
72
  folio.loading = false
47
73
  transcriptionTypeTracker[transcriptionType] = true
48
74
  }
@@ -231,6 +231,7 @@ function layoutMargin(html, emptyZoneFrame, layoutDecoder) {
231
231
  const entryID = zone.id
232
232
  const blocks = zone.children
233
233
  const facs = zone.getAttribute('facs')
234
+ const tags = zone.getAttribute('ana')
234
235
 
235
236
  for (const block of blocks) {
236
237
  const layoutCode = validLayoutCode(block)
@@ -254,7 +255,7 @@ function layoutMargin(html, emptyZoneFrame, layoutDecoder) {
254
255
 
255
256
  for (const blockSet of Object.values(marginFrame)) {
256
257
  if (blockSet) {
257
- gridContent = gridContent.concat(renderBlockSet(blockSet, facs))
258
+ gridContent = gridContent.concat(renderBlockSet(blockSet, facs, tags))
258
259
  }
259
260
  }
260
261
 
@@ -266,7 +267,7 @@ function layoutMargin(html, emptyZoneFrame, layoutDecoder) {
266
267
  }
267
268
  }
268
269
  catch (error) {
269
- console.log(error)
270
+ console.error(error)
270
271
  }
271
272
 
272
273
  const gridLayout = zoneGridToLayout(zoneGrid)
@@ -295,7 +296,7 @@ function zoneGridToLayout(zoneGrid) {
295
296
  return gridLayout
296
297
  }
297
298
 
298
- function renderBlockSet(blockSet, facs) {
299
+ function renderBlockSet(blockSet, facs, tags) {
299
300
  // use ID and class from the first block in the set
300
301
  const firstBlock = blockSet[0]
301
302
  const elementID = firstBlock.id
@@ -307,7 +308,7 @@ function renderBlockSet(blockSet, facs) {
307
308
 
308
309
  // combine the blocks in the block set. divs are all merged into a single div
309
310
  // other element types become children of the single div.
310
- let el = `<div id="${elementID}" className="${classStr}" data-entry-id="${entryID}" data-facs="${facs || ''}">`
311
+ let el = `<div id="${elementID}" className="${classStr}" ana="${tags}" data-entry-id="${entryID}" data-facs="${facs || ''}">`
311
312
  for (const block of blockSet) {
312
313
  if (block.getAttribute('facs')) {
313
314
  block.setAttribute('data-facs', block.getAttribute('facs'))
@@ -382,7 +383,7 @@ export function layoutGrid(html) {
382
383
  }
383
384
  }
384
385
  catch (error) {
385
- console.log(error)
386
+ console.error(error)
386
387
  }
387
388
 
388
389
  const gridLayout = zoneGridToLayout(zoneGrid)
@@ -6,15 +6,47 @@ import { putResolveAction } from '../model/ReduxStore'
6
6
  const justDocument = state => state.document
7
7
  const justGlossary = state => state.glossary
8
8
 
9
+ function* parseTags(headerUrl) {
10
+ const tags = {}
11
+
12
+ const res = yield fetch(headerUrl)
13
+
14
+ if (!res.ok) {
15
+ yield putResolveAction('DocumentActions.loadTags', tags)
16
+ return null
17
+ }
18
+
19
+ const html = yield res.text()
20
+
21
+ const headerDoc = new DOMParser().parseFromString(html, 'text/html')
22
+
23
+ const categoryEls = headerDoc.querySelectorAll('tei-category')
24
+
25
+ for (const categoryEl of categoryEls) {
26
+ const xmlId = categoryEl.getAttribute('id')
27
+
28
+ if (xmlId) {
29
+ const desc = categoryEl.querySelector('tei-catdesc')
30
+ if (desc) {
31
+ const name = desc.textContent
32
+ tags[xmlId] = name
33
+ }
34
+ }
35
+ }
36
+
37
+ yield putResolveAction('DocumentActions.loadTags', tags)
38
+ }
39
+
9
40
  function* userNavigation(action) {
10
- const { pathname } = action.payload.params[0]
41
+ const pathname = action.payload.params[0]
11
42
  const pathSegments = pathname.split('/')
12
43
 
13
44
  if (pathSegments.length > 1) {
14
45
  switch (pathSegments[1]) {
15
46
  case 'ec':
16
47
  {
17
- const manifest = yield resolveDocumentManifest()
48
+ yield resolveDocumentManifest()
49
+ yield resolveDocumentTags()
18
50
  yield resolveGlossary()
19
51
  yield resolveFolio(pathSegments)
20
52
  break
@@ -24,8 +56,17 @@ function* userNavigation(action) {
24
56
  }
25
57
  }
26
58
 
59
+ function* resolveDocumentTags() {
60
+ const document = yield select(justDocument)
61
+
62
+ if (!document.tags) {
63
+ yield parseTags(document.headerUrl)
64
+ }
65
+ }
66
+
27
67
  function* resolveDocumentManifest() {
28
68
  const document = yield select(justDocument)
69
+
29
70
  if (!document.loaded) {
30
71
  // handle the case where we've passed in an array of manifest URLs, in which case the `variorum` parameter should be set to `true`
31
72
  if (document.variorum) {
@@ -94,5 +135,5 @@ function* resolveGlossary() {
94
135
  }
95
136
 
96
137
  export default function* routeListenerSaga() {
97
- yield takeEvery('RouteListenerSaga.userNavigatation', userNavigation)
138
+ yield takeEvery('RouteListenerSaga.userNavigation', userNavigation)
98
139
  }
@@ -5,6 +5,10 @@ $dark-maroon: #460C0A;
5
5
 
6
6
  .editioncrafter {
7
7
 
8
+ .MuiInputBase-root {
9
+ font-family: 'Inter', sans-serif;
10
+ }
11
+
8
12
  *{
9
13
  box-sizing: border-box;
10
14
  }
@@ -45,6 +49,12 @@ $dark-maroon: #460C0A;
45
49
  .fa.fa-lock-open {
46
50
  border-radius: max(2rem, 32px) 0 0 max(2rem, 32px);
47
51
  }
52
+
53
+ .vertical-separator {
54
+ height: 100%;
55
+ border-right: 1px solid #6F747C;
56
+ margin: 10px 0;
57
+ }
48
58
 
49
59
  .line-clamp {
50
60
  display: -webkit-box;
@@ -129,7 +139,7 @@ $dark-maroon: #460C0A;
129
139
  }
130
140
 
131
141
  .invisible{
132
- opacity:0;
142
+ display: none;
133
143
  }
134
144
 
135
145
  .disabled{
@@ -1,7 +1,7 @@
1
1
  #diplomatic.editioncrafter {
2
2
  container-type: inline-size;
3
3
  container-name: diplomatic;
4
- #content-view, .header-wrapper, #entry-list-view, #annotation-list-view {
4
+ #content-view, .header-wrapper, #annotation-list-view {
5
5
  h1,
6
6
  h2,
7
7
  h3,
@@ -11,29 +11,29 @@
11
11
  padding: 0;
12
12
  margin: 0;
13
13
  }
14
-
14
+
15
15
  h1{
16
16
  font-family: 'Taviraj', serif;
17
17
  font-size: 32px;
18
18
  }
19
-
19
+
20
20
  h2,h3{
21
21
  font-weight: 700;
22
22
  }
23
-
23
+
24
24
  h2{
25
25
  font-size: 22px;
26
26
  }
27
-
27
+
28
28
  h3{
29
29
  font-size: 18px;
30
30
  }
31
-
31
+
32
32
  h4{
33
33
  font-size: 18px;
34
34
  font-weight: 700;
35
35
  }
36
-
36
+
37
37
  p {
38
38
  font-family: "Martel", serif;
39
39
  line-height: 1.25;
@@ -43,17 +43,17 @@
43
43
  line-height: 1.25;
44
44
  margin: 0;
45
45
  }
46
-
46
+
47
47
  a.MuiButton-containedPrimary.cta-button {
48
48
  color: white;
49
49
  padding: 10px 70px;
50
50
  border-radius: 0;
51
51
  .MuiButton-label span{
52
52
  font-family: 'Lato', sans-serif;
53
- font-size: 20px;
53
+ font-size: 20px;
54
54
  }
55
55
  }
56
-
56
+
57
57
  a{
58
58
  color: $maroon;
59
59
  &:hover{
@@ -77,15 +77,6 @@
77
77
  @include md {
78
78
  font-size: 18px;
79
79
  }
80
- &.with-icon{
81
- &:after{
82
- font-family: "Font Awesome 5 Free";
83
- margin-left: 7px;
84
- font-weight: 600;
85
- content: "\f054";
86
- font-size: 15px;
87
- }
88
- }
89
80
  &:before{
90
81
  position: absolute;
91
82
  content: "";
@@ -109,7 +100,7 @@
109
100
  }
110
101
  }
111
102
  }
112
-
103
+
113
104
  a.cta-link.active{
114
105
  &:before{
115
106
  background-color: $maroon;
@@ -122,7 +113,7 @@
122
113
  color: $maroon;
123
114
  }
124
115
  }
125
-
116
+
126
117
  a.cta-link.light{
127
118
  color: #444444;
128
119
  &:before{
@@ -134,7 +125,7 @@
134
125
  }
135
126
  }
136
127
  }
137
-
128
+
138
129
  a.cta-link.video-link{
139
130
  &:after{
140
131
  content: "\f04b";
@@ -142,7 +133,7 @@
142
133
  margin-bottom: -2px;
143
134
  }
144
135
  }
145
-
136
+
146
137
  a.cta-link.search-link{
147
138
  &:after{
148
139
  font-family: 'Material Icons';
@@ -287,7 +278,7 @@
287
278
  }
288
279
  @include sm {
289
280
  width: 250px;
290
- }
281
+ }
291
282
  }
292
283
  }
293
284
  .footer-links {