-
Notifications
You must be signed in to change notification settings - Fork 256
/
settings.js
581 lines (579 loc) · 18.1 KB
/
settings.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
import { v4 as uuid } from 'uuid';
export default {
state: {
// slice: 'mirador' // Configure the top-level slice of state for mirador selectors
},
canvasNavigation: { // Set the height and width of canvas thumbnails in the CanvasNavigation companion window
height: 50,
width: 50,
},
selectedTheme: 'light', // dark also available
themes: {
dark: {
palette: {
mode: 'dark',
primary: {
main: '#4db6ac',
},
secondary: {
main: '#4db6ac',
},
shades: {
dark: '#000000',
main: '#424242',
light: '#616161',
}
}
},
light: {
palette: {
mode: 'light',
}
}
},
theme: { // Sets up a MaterialUI theme. See https://material-ui.com/customization/default-theme/
palette: {
mode: 'light',
primary: {
main: '#1967d2', // Controls the color of the Add button and current window indicator
},
secondary: {
main: '#1967d2', // Controls the color of Selects and FormControls
},
shades: { // Shades that can be used to offset color areas of the Workspace / Window
dark: '#eeeeee',
main: '#ffffff',
light: '#f5f5f5',
},
error: {
main: '#b00020',
},
notification: { // Color used in MUI Badge dots
main: '#ffa224'
},
hitCounter: {
default: '#bdbdbd',
},
highlights: {
primary: '#ffff00',
secondary: '#00BFFF',
},
section_divider: 'rgba(0, 0, 0, 0.25)',
annotations: {
chipBackground: '#e0e0e0',
hidden: { globalAlpha: 0 },
default: { strokeStyle: '#00BFFF', globalAlpha: 1 },
hovered: { strokeStyle: '#BF00FF', globalAlpha: 1 },
selected: { strokeStyle: '#ffff00', globalAlpha: 1 },
},
search: {
default: { fillStyle: '#00BFFF', globalAlpha: 0.3 },
hovered: { fillStyle: '#00FFFF', globalAlpha: 0.3 },
selected: { fillStyle: '#ffff00', globalAlpha: 0.3 },
}
},
typography: {
body1: {
fontSize: "1rem",
letterSpacing: "0em",
lineHeight: "1.6em",
},
body2: {
fontSize: "0.878rem",
letterSpacing: "0.015em",
lineHeight: "1.6em",
},
button: {
fontSize: "0.878rem",
letterSpacing: "0.09em",
lineHeight: "2.25rem",
textTransform: "uppercase",
},
caption: {
fontSize: "0.772rem",
letterSpacing: "0.033em",
lineHeight: "1.6rem",
},
body1Next: {
fontSize: "1rem",
letterSpacing: "0em",
lineHeight: "1.6em",
},
body2Next: {
fontSize: "0.878rem",
letterSpacing: "0.015em",
lineHeight: "1.6em",
},
buttonNext: {
fontSize: "0.878rem",
letterSpacing: "0.09em",
lineHeight: "2.25rem",
},
captionNext: {
fontSize: "0.772rem",
letterSpacing: "0.33em",
lineHeight: "1.6rem",
},
overline: {
fontSize: "0.678rem",
fontWeight: 500,
letterSpacing: "0.166em",
lineHeight: "2em",
textTransform: "uppercase",
},
h1: {
fontSize: "2.822rem",
letterSpacing: "-0.015em",
lineHeight: "1.2em",
},
h2: {
fontSize: "1.575rem",
letterSpacing: "0em",
lineHeight: "1.33em",
},
h3: {
fontSize: "1.383rem",
fontWeight: 300,
letterSpacing: "0em",
lineHeight: "1.33em",
},
h4: {
fontSize: "1.215rem",
letterSpacing: "0.007em",
lineHeight: "1.45em",
},
h5: {
fontSize: "1.138rem",
letterSpacing: "0.005em",
lineHeight: "1.55em",
},
h6: {
fontSize: "1.067rem",
fontWeight: 400,
letterSpacing: "0.01em",
lineHeight: "1.6em",
},
subtitle1: {
fontSize: "0.937rem",
letterSpacing: "0.015em",
lineHeight: "1.6em",
fontWeight: 300,
},
subtitle2: {
fontSize: "0.878rem",
fontWeight: 500,
letterSpacing: "0.02em",
lineHeight: "1.75em",
},
useNextVariants: true // set so that console deprecation warning is removed
},
components: {
MuiMenuItem: {
variants: [
{
props: { variant: 'multiline' },
style: { whiteSpace: 'normal' }
},
]
},
CompanionWindow: {
styleOverrides: {
closeButton: {
order: 4,
},
contents: {
overflowY: 'auto',
wordBreak: 'break-word',
},
controls: ({ ownerState }) => ({
alignItems: 'center',
display: 'flex',
flexFlow: 'row wrap',
flexGrow: 1,
justifyContent: (ownerState?.position === 'bottom' || ownerState?.position === 'far-bottom') ? 'flex-end' : 'flex-start',
minHeight: 48,
order: 3
}),
positionButton: {
marginLeft: -16,
order: -100,
width: 24,
},
resize: ({ ownerState }) => ({
display: 'flex',
flexDirection: 'column',
minHeight: 50,
minWidth: (ownerState?.position === 'left') ? 235 : 100,
position: 'relative',
}),
root: ({ ownerState }) => ({
boxShadow: 'none',
boxSizing: 'border-box',
display: 'flex',
flexDirection: 'column',
minHeight: 0,
...(ownerState?.position === 'right' && {
borderLeft: '0.5px solid rgba(0, 0, 0, 0.125)'
}),
...(ownerState?.position === 'left' && {
borderRight: '0.5px solid rgba(0, 0, 0, 0.125)'
}),
...(ownerState?.position === 'bottom' && {
borderTop: '0.5px solid rgba(0, 0, 0, 0.125)'
}),
}),
title: ({ theme }) => ({
...theme.typography.subtitle1,
alignSelf: 'center',
flexGrow: 1,
width: 160
}),
toolbar: ({ theme }) => ({
alignItems: 'flex-start',
backgroundColor: theme.palette.shades.light,
flexWrap: 'wrap',
justifyContent: 'space-between',
minHeight: 'max-content',
paddingInlineStart: '1rem',
}),
},
},
CompanionWindowSection: {
styleOverrides: {
root: {
borderBlockEnd: '.5px solid rgba(0, 0, 0, 0.25)'
},
},
},
IIIFHtmlContent: {
styleOverrides: {
root: ({ theme }) => ({
'& a': {
color: theme.palette.primary.main,
textDecoration: 'underline',
},
}),
},
},
IIIFThumbnail: {
styleOverrides: {
root: ({ ownerState }) => ({
...(ownerState?.variant === 'inside' && {
display: 'inline-block',
height: 'inherit',
position: 'relative',
}),
}),
label: ({ ownerState }) => ({
overflow: 'hidden',
textOverflow: 'ellipsis',
lineHeight: '1.5em',
wordBreak: 'break-word',
...(ownerState?.variant === 'inside' && {
color: '#ffffff',
WebkitLineClamp: 1,
whiteSpace: 'nowrap',
}),
...(ownerState?.variant === 'outside' && {
display: '-webkit-box',
maxHeight: '3em',
MozBoxOrient: 'vertical',
WebkitLineClamp: 2,
}),
...(ownerState?.variant === 'inside' && {
background: 'linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.3) 70%, rgba(0,0,0,0) 100%)',
bottom: '5px',
boxSizing: 'border-box',
left: '0px',
padding: '4px',
position: 'absolute',
width: '100%',
}),
}),
image: ({ ownerState }) => ({
...(ownerState?.border && {
border: '1px solid rgba(0, 0, 0, 0.125)',
}),
})
}
},
ThemeIcon: {
styleOverrides: {
icon: ({ ownerState }) => ({
color: (ownerState?.value === 'dark' ? '#000000' : undefined)
}),
},
},
MuiAccordion: {
variants: [
{
props: { variant: 'compact' },
style: {
'& .MuiAccordionSummary-root': {
minHeight: 'unset',
padding: 0,
},
'& .MuiAccordionSummary-content': {
margin: 0,
},
'& .MuiAccordionDetails-root': {
padding: 0,
},
},
},
],
},
MuiButton: {
styleOverrides: {
inlineText: {
lineHeight: '1.5em',
padding: 0,
textAlign: 'inherit',
textTransform: 'none',
},
inlineTextSecondary: ({ theme }) => ({
color: theme.palette.secondary.main,
}),
}
},
MuiButtonBase: {
defaultProps: {
disableTouchRipple: true,
},
},
MuiDialog: {
variants: [
{
props: { variant: 'contained' },
style: {
position: 'absolute',
'& .MuiBackdrop-root': {
position: 'absolute'
}
},
}
]
},
MuiFab: {
styleOverrides: {
root: {
transition: 'none',
}
},
},
MuiLink: {
defaultProps: {
underline: 'always'
},
},
MuiListSubheader: {
styleOverrides: {
root: {
'&[role="presentation"]:focus': {
outline: 0,
},
},
},
},
MuiTooltip: { // Overridden from https://github.com/mui-org/material-ui/blob/master/packages/material-ui/src/Tooltip/Tooltip.js#L40-L70
styleOverrides: {
tooltipPlacementLeft: {
['@media (min-width:600px)']: {
margin: '0 !important',
},
},
tooltipPlacementRight: {
['@media (min-width:600px)']: {
margin: '0 !important',
},
},
tooltipPlacementTop: {
['@media (min-width:600px)']: {
margin: '0 !important',
},
},
tooltipPlacementBottom: {
['@media (min-width:600px)']: {
margin: '0 !important',
},
},
},
},
MuiTouchRipple: {
styleOverrides: {
childPulsate: {
animation: 'none',
},
rippleVisible: {
animation: 'none',
},
},
},
},
},
language: 'en', // The default language set in the application
availableLanguages: { // All the languages available in the language switcher
ar: 'العربية',
de: 'Deutsch',
en: 'English',
et: 'Eesti',
fa: 'فارسی',
fr: 'Français',
hr: 'Hrvatski',
ja: '日本語',
kr: '한국어',
lt: 'Lietuvių',
nl: 'Nederlands',
'nb-NO': 'Norwegian Bokmål',
pl: 'Polski',
'pt-BR': 'Português do Brasil',
vi:'Tiếng Việt',
'zh-CN': '中文(简体)',
'zh-TW': '中文(繁體)',
it: "Italiano",
sr: 'Српски',
sv: 'Svenska',
bg: 'Български'
},
annotations: {
htmlSanitizationRuleSet: 'iiif', // See src/lib/htmlRules.js for acceptable values
filteredMotivations: ['oa:commenting', 'oa:tagging', 'sc:painting', 'commenting', 'tagging'],
},
createGenerateClassNameOptions: { // Options passed directly to createGenerateClassName in Material-UI https://material-ui.com/styles/api/#creategenerateclassname-options-class-name-generator
productionPrefix: 'mirador',
},
requests: {
preprocessors: [ // Functions that receive HTTP requests and manipulate them (e.g. to add headers)
// (url, options) => (url.match('info.json') && { ...options, myCustomThing: 'blah' })
],
postprocessors: [ // Functions that receive HTTP responses and manipulates them before adding to store
// An example of manipulating the response for an annotation request
// (url, action) => {
// if (action.annotationId) {
// action.annotationJson = {};
// }
// }
]
},
translations: { // Translations can be added to inject new languages or override existing labels
},
window: { //global window defaults
allowClose: true, // Configure if windows can be closed or not
allowFullscreen: false, // Configure to show a "fullscreen" button in the WindowTopBar
allowMaximize: true, // Configure if windows can be maximized or not
allowTopMenuButton: true, // Configure if window view and thumbnail display menu are visible or not
allowWindowSideBar: true, // Configure if side bar menu is visible or not
authNewWindowCenter: 'parent', // Configure how to center a new window created by the authentication flow. Options: parent, screen
sideBarPanel: 'info', // Configure which sidebar is selected by default. Options: info, attribution, canvas, annotations, search
defaultSidebarPanelHeight: 201, // Configure default sidebar height in pixels
defaultSidebarPanelWidth: 235, // Configure default sidebar width in pixels
defaultView: 'single', // Configure which viewing mode (e.g. single, book, gallery) for windows to be opened in
forceDrawAnnotations: false,
hideWindowTitle: false, // Configure if the window title is shown in the window title bar or not
highlightAllAnnotations: false, // Configure whether to display annotations on the canvas by default
showLocalePicker: false, // Configure locale picker for multi-lingual metadata
sideBarOpen: false, // Configure if the sidebar (and its content panel) is open by default
switchCanvasOnSearch: true, // Configure if Mirador should automatically switch to the canvas of the first search result
panels: { // Configure which panels are visible in WindowSideBarButtons
info: true,
attribution: true,
canvas: true,
annotations: true,
search: true,
layers: true,
},
views: [
{ key: 'single', behaviors: ['individuals'] },
{ key: 'book', behaviors: ['paged'] },
{ key: 'scroll', behaviors: ['continuous'] },
{ key: 'gallery' },
],
elastic: {
height: 400,
width: 480
}
},
windows: [ // Array of windows to be open when mirador initializes (each object should at least provide a manifestId key with the value of the IIIF presentation manifest to load)
/**
Example Window:
{
manifestId: 'https://iiif.harvardartmuseums.org/manifests/object/299843',
canvasId: 'https://iiif.harvardartmuseums.org/manifests/object/299843/page_2',
thumbnailNavigationPosition: 'far-bottom',
maximized: false,
}
// ../state/actions/window.js `defaultOptions`
// ../lib/MiradorViewer.js `windowAction`
*/
],
thumbnails: {
preferredFormats: ['jpg', 'png', 'webp', 'tif'],
},
thumbnailNavigation: {
defaultPosition: 'off', // Which position for the thumbnail navigation to be be displayed. Other possible values are "far-bottom" or "far-right"
displaySettings: true, // Display the settings for this in WindowTopMenu
height: 130, // height of entire ThumbnailNavigation area when position is "far-bottom"
width: 100, // width of one canvas (doubled for book view) in ThumbnailNavigation area when position is "far-right"
},
workspace: {
draggingEnabled: true,
allowNewWindows: true,
id: uuid(),
isWorkspaceAddVisible: false, // Catalog/Workspace add window feature visible by default
exposeModeOn: false, // unused?
height: 5000, // height of the elastic mode's virtual canvas
showZoomControls: false, // Configure if zoom controls should be displayed by default
type: 'mosaic', // Which workspace type to load by default. Other possible values are "elastic". If "mosaic" or "elastic" are not selected no worksapce type will be used.
viewportPosition: { // center coordinates for the elastic mode workspace
x: 0,
y: 0,
},
width: 5000, // width of the elastic mode's virtual canvas
},
workspaceControlPanel: {
enabled: true, // Configure if the control panel should be rendered. Useful if you want to lock the viewer down to only the configured manifests
},
galleryView: {
height: 120, // height of gallery view thumbnails
width: null, // width of gallery view thumbnails (or null, to auto-calculate an aspect-ratio appropriate size)
},
osdConfig: { // Default config used for OpenSeadragon
alwaysBlend: false,
blendTime: 0.1,
preserveImageSizeOnResize: true,
preserveViewport: true,
showNavigationControl: false,
},
export: {
catalog: true,
companionWindows: true,
config: true,
elasticLayout: true,
layers: true,
// filter out anything re-retrievable:
manifests: { filter: ([id, value]) => !id.startsWith('http') },
viewers: true,
windows: true,
workspace: true,
},
audioOptions: { // Additional props passed to <audio> element
controls: true,
crossOrigin: 'anonymous',
},
videoOptions: { // Additional props passed to <audio> element
controls: true,
crossOrigin: 'anonymous',
},
auth: {
serviceProfiles: [
{ profile: 'http://iiif.io/api/auth/1/external', external: true },
{ profile: 'http://iiif.io/api/auth/1/kiosk', kiosk: true },
{ profile: 'http://iiif.io/api/auth/1/clickthrough' },
{ profile: 'http://iiif.io/api/auth/1/login' },
{ profile: 'http://iiif.io/api/auth/0/external', external: true },
{ profile: 'http://iiif.io/api/auth/0/kiosk', kiosk: true },
{ profile: 'http://iiif.io/api/auth/0/clickthrough' },
{ profile: 'http://iiif.io/api/auth/0/login' }
]
}
};