From 062af384a9e1fdcb9d7a6099cb5bbcfe934e1d64 Mon Sep 17 00:00:00 2001 From: Edward Silverton Date: Wed, 15 Nov 2023 10:57:39 +0000 Subject: [PATCH] rm old files --- src/IUVData.ts | 4 +- src/content-handlers/iiif/BaseConfig.ts | 88 ++- src/content-handlers/iiif/BaseConfig2.ts | 130 ---- .../uv-openseadragon-extension/Extension.ts | 4 +- .../config/Config.ts | 90 +-- .../config/Config2.ts | 565 ------------------ .../modules/uv-shared-module/BaseExtension.ts | 4 +- 7 files changed, 93 insertions(+), 792 deletions(-) delete mode 100644 src/content-handlers/iiif/BaseConfig2.ts delete mode 100644 src/content-handlers/iiif/extensions/uv-openseadragon-extension/config/Config2.ts diff --git a/src/IUVData.ts b/src/IUVData.ts index 0b2cca647..acec02715 100644 --- a/src/IUVData.ts +++ b/src/IUVData.ts @@ -2,10 +2,10 @@ import { EPubData } from "./content-handlers/iiif/EPubData"; import { IIIFData } from "./content-handlers/iiif/IIIFData"; import { YouTubeData } from "./content-handlers/youtube/YouTubeData"; import { ILocale } from "./content-handlers/iiif/modules/uv-shared-module/ILocale"; -import { BaseConfig2 } from "./content-handlers/iiif/BaseConfig2"; +import { BaseConfig } from "./content-handlers/iiif/BaseConfig"; export interface IUVData extends IIIFData, EPubData, YouTubeData { - config?: BaseConfig2; // do not pass this on initialisation, internal use only + config?: BaseConfig; // do not pass this on initialisation, internal use only debug?: boolean; embedded?: boolean; isReload?: boolean; diff --git a/src/content-handlers/iiif/BaseConfig.ts b/src/content-handlers/iiif/BaseConfig.ts index 2a4bb79c7..5324a149f 100644 --- a/src/content-handlers/iiif/BaseConfig.ts +++ b/src/content-handlers/iiif/BaseConfig.ts @@ -2,7 +2,7 @@ import { StorageType } from "@edsilv/utils"; export { StorageType } from "@edsilv/utils"; -export type MetricType = "sm" | "md" | "lg" | "xl"; +export type MetricType = string | "sm" | "md" | "lg" | "xl"; export class Metric { constructor(public type: MetricType, public minWidth: number) {} @@ -88,7 +88,7 @@ export type Options = { theme: string; /** Storage for tokens */ - tokenStorage: StorageType; + tokenStorage: string | StorageType; /** Determines if arrow keys can be used to navigate */ useArrowKeysToNavigate: boolean; @@ -110,6 +110,80 @@ export type Localisation = { locales: Locale[]; }; +type DialogueContent = { + close: string; +}; + +type Dialogue = { + topCloseButtonEnabled: boolean; + content: DialogueContent; +}; + +/** + * Type for Download Dialogue Options + */ +type DownloadDialogueOptions = { + /** Size of the confined image */ + confinedImageSize: number; + /** Percentage of the current view that is disabled */ + currentViewDisabledPercentage: number; + /** Determines if download of current view is enabled */ + downloadCurrentViewEnabled: boolean; + /** Determines if download of whole image in high resolution is enabled */ + downloadWholeImageHighResEnabled: boolean; + /** Determines if download of whole image in low resolution is enabled */ + downloadWholeImageLowResEnabled: boolean; + /** Maximum width of the image */ + maxImageWidth: number; + /** Determines if explanatory text for options is enabled */ + optionsExplanatoryTextEnabled: boolean; + /** Determines if selection is enabled */ + selectionEnabled: boolean; +}; + +type DownloadDialogueContent = { + allPages: string; + currentViewAsJpg: string; + currentViewAsJpgExplanation: string; + download: string; + downloadSelection: string; + downloadSelectionExplanation: string; + editSettings: string; + entireDocument: string; + entireFileAsOriginal: string; + individualPages: string; + noneAvailable: string; + pagingNote: string; + preview: string; + selection: string; + termsOfUse: string; + title: string; + wholeImageHighRes: string; + wholeImageHighResExplanation: string; + wholeImageLowResAsJpg: string; + wholeImageLowResAsJpgExplanation: string; + wholeImagesHighRes: string; + wholeImagesHighResExplanation: string; +}; + +type DownloadDialogue = { + options: DownloadDialogueOptions; + content: DownloadDialogueContent; +}; + +type GenericDialogueContent = { + emptyValue: string; + invalidNumber: string; + noMatches: string; + ok: string; + pageNotFound: string; + refresh: string; +}; + +type GenericDialogue = { + content: GenericDialogueContent; +}; + export type Content = { authCORSError: string; authorisationFailedMessage: string; @@ -122,8 +196,14 @@ export type Content = { termsOfUse: string; }; -export default interface BaseConfig { +export type BaseConfig = { + uri?: string; options: Options; + modules: { + dialogue: Dialogue; + downloadDialogue: DownloadDialogue; + genericDialogue: GenericDialogue; + }; localisation: Localisation; content: Content; -} +}; diff --git a/src/content-handlers/iiif/BaseConfig2.ts b/src/content-handlers/iiif/BaseConfig2.ts deleted file mode 100644 index 408fb5f06..000000000 --- a/src/content-handlers/iiif/BaseConfig2.ts +++ /dev/null @@ -1,130 +0,0 @@ -import { StorageType } from "@edsilv/utils"; - -export { StorageType } from "@edsilv/utils"; - -export type MetricType = string | "sm" | "md" | "lg" | "xl"; - -export class Metric { - constructor(public type: MetricType, public minWidth: number) {} -} - -export type Options = { - /** Determines if the focus can be stolen */ - allowStealFocus: boolean; - - /** Version of the authentication API */ - authAPIVersion: number; - - /** Height of the bookmark thumbnail */ - bookmarkThumbHeight: number; - - /** Width of the bookmark thumbnail */ - bookmarkThumbWidth: number; - - /** Determines if drop is enabled */ - dropEnabled: boolean; - - /** Determines if the footer panel is enabled */ - footerPanelEnabled: boolean; - - /** Determines if the header panel is enabled */ - headerPanelEnabled: boolean; - - /** Determines if the left panel is enabled */ - leftPanelEnabled: boolean; - - /** Determines if locales are limited */ - limitLocales: boolean; - - /** Determines if double click annotation is enabled */ - doubleClickAnnotationEnabled: boolean; - - /** Metrics array */ - metrics: Metric[]; - - /** MIME type for multi selection */ - multiSelectionMimeType: string; - - /** Determines if the navigator is enabled */ - navigatorEnabled: boolean; - - /** Template for opening */ - openTemplate: string; - - /** Determines if full screen is overridden */ - overrideFullScreen: boolean; - - /** Determines if paging is enabled */ - pagingEnabled: boolean; - - /** Determines if paging option is enabled */ - pagingOptionEnabled: boolean; - - /** Determines if access control is pessimistic */ - pessimisticAccessControl: boolean; - - /** Determines if viewport is preserved */ - preserveViewport: boolean; - - /** Determines if the right panel is enabled */ - rightPanelEnabled: boolean; - - /** Determines if user settings are saved */ - saveUserSettings: boolean; - - /** Determines if click to zoom is enabled */ - clickToZoomEnabled: boolean; - - /** Determines if search within is enabled */ - searchWithinEnabled: boolean; - - /** Determines if seealso content is enabled */ - seeAlsoEnabled: boolean; - - /** Determines if terms of use are enabled */ - termsOfUseEnabled: boolean; - - /** Theme string */ - theme: string; - - /** Storage for tokens */ - tokenStorage: string | StorageType; - - /** Determines if arrow keys can be used to navigate */ - useArrowKeysToNavigate: boolean; - - /** Determines if zoom to search result is enabled */ - zoomToSearchResultEnabled: boolean; - - /** Determines if zoom to bounds is enabled */ - zoomToBoundsEnabled: boolean; -}; - -type Locale = { - name: string; - label: string; -}; - -export type Localisation = { - label: string; - locales: Locale[]; -}; - -export type Content = { - authCORSError: string; - authorisationFailedMessage: string; - canvasIndexOutOfRange: string; - fallbackDegradedLabel: string; - fallbackDegradedMessage: string; - forbiddenResourceMessage: string; - mediaViewer: string; - skipToDownload: string; - termsOfUse: string; -}; - -export type BaseConfig2 = { - options: Options; - modules: {}; - localisation: Localisation; - content: Content; -}; diff --git a/src/content-handlers/iiif/extensions/uv-openseadragon-extension/Extension.ts b/src/content-handlers/iiif/extensions/uv-openseadragon-extension/Extension.ts index 641787fa2..699e87a16 100644 --- a/src/content-handlers/iiif/extensions/uv-openseadragon-extension/Extension.ts +++ b/src/content-handlers/iiif/extensions/uv-openseadragon-extension/Extension.ts @@ -53,7 +53,7 @@ import { createElement } from "react"; import { createStore, OpenSeadragonExtensionState } from "./Store"; import { merge } from "../../../../Utils"; import defaultConfig from "./config/config.json"; -import { Config2 } from "./config/Config2"; +import { Config } from "./config/Config"; export default class OpenSeadragonExtension extends BaseExtension { $downloadDialogue: JQuery; @@ -81,7 +81,7 @@ export default class OpenSeadragonExtension extends BaseExtension { rightPanel: MoreInfoRightPanel; settingsDialogue: SettingsDialogue; shareDialogue: ShareDialogue; - defaultConfig: Config2 = defaultConfig; + defaultConfig: Config = defaultConfig; locales = { "en-GB": defaultConfig, }; diff --git a/src/content-handlers/iiif/extensions/uv-openseadragon-extension/config/Config.ts b/src/content-handlers/iiif/extensions/uv-openseadragon-extension/config/Config.ts index e3cedc1cb..289db1ccb 100644 --- a/src/content-handlers/iiif/extensions/uv-openseadragon-extension/config/Config.ts +++ b/src/content-handlers/iiif/extensions/uv-openseadragon-extension/config/Config.ts @@ -1,8 +1,4 @@ -import BaseConfig, { - Content, - Localisation, - Options, -} from "@/content-handlers/iiif/BaseConfig"; +import { BaseConfig } from "@/content-handlers/iiif/BaseConfig"; /** * Type for Thumbs Cache Invalidation @@ -97,67 +93,6 @@ type ContentLeftPanel = { content: ContentLeftPanelContent; }; -type DialogueContent = { - close: string; -}; - -type Dialogue = { - topCloseButtonEnabled: boolean; - content: DialogueContent; -}; - -/** - * Type for Download Dialogue Options - */ -type DownloadDialogueOptions = { - /** Size of the confined image */ - confinedImageSize: number; - /** Percentage of the current view that is disabled */ - currentViewDisabledPercentage: number; - /** Determines if download of current view is enabled */ - downloadCurrentViewEnabled: boolean; - /** Determines if download of whole image in high resolution is enabled */ - downloadWholeImageHighResEnabled: boolean; - /** Determines if download of whole image in low resolution is enabled */ - downloadWholeImageLowResEnabled: boolean; - /** Maximum width of the image */ - maxImageWidth: number; - /** Determines if explanatory text for options is enabled */ - optionsExplanatoryTextEnabled: boolean; - /** Determines if selection is enabled */ - selectionEnabled: boolean; -}; - -type DownloadDialogueContent = { - allPages: string; - currentViewAsJpg: string; - currentViewAsJpgExplanation: string; - download: string; - downloadSelection: string; - downloadSelectionExplanation: string; - editSettings: string; - entireDocument: string; - entireFileAsOriginal: string; - individualPages: string; - noneAvailable: string; - pagingNote: string; - preview: string; - selection: string; - termsOfUse: string; - title: string; - wholeImageHighRes: string; - wholeImageHighResExplanation: string; - wholeImageLowResAsJpg: string; - wholeImageLowResAsJpgExplanation: string; - wholeImagesHighRes: string; - wholeImagesHighResExplanation: string; -}; - -type DownloadDialogue = { - options: DownloadDialogueOptions; - content: DownloadDialogueContent; -}; - type FooterPanelOptions = { /** Determines if autocomplete for words is allowed */ autocompleteAllowWords: boolean; @@ -200,19 +135,6 @@ type FooterPanel = { content: FooterPanelContent; }; -type GenericDialogueContent = { - emptyValue: string; - invalidNumber: string; - noMatches: string; - ok: string; - pageNotFound: string; - refresh: string; -}; - -type GenericDialogue = { - content: GenericDialogueContent; -}; - type HeaderPanelOptions = { /** Determines if center options are enabled */ centerOptionsEnabled: boolean; @@ -544,10 +466,7 @@ type RestrictedDialogue = { type Modules = { contentLeftPanel: ContentLeftPanel; - dialogue: Dialogue; - downloadDialogue: DownloadDialogue; footerPanel: FooterPanel; - genericDialogue: GenericDialogue; headerPanel: HeaderPanel; helpDialogue: HelpDialogue; moreInfoRightPanel: MoreInfoRightPanel; @@ -564,9 +483,6 @@ type Modules = { restrictedDialogue: RestrictedDialogue; }; -export default interface Config extends BaseConfig { - options: Options; - localisation: Localisation; - content: Content; +export type Config = BaseConfig & { modules: Modules; -} +}; diff --git a/src/content-handlers/iiif/extensions/uv-openseadragon-extension/config/Config2.ts b/src/content-handlers/iiif/extensions/uv-openseadragon-extension/config/Config2.ts deleted file mode 100644 index de57b966a..000000000 --- a/src/content-handlers/iiif/extensions/uv-openseadragon-extension/config/Config2.ts +++ /dev/null @@ -1,565 +0,0 @@ -import { BaseConfig2 } from "@/content-handlers/iiif/BaseConfig2"; - -/** - * Type for Thumbs Cache Invalidation - */ -type ThumbsCacheInvalidation = { - /** Determines if cache invalidation is enabled */ - enabled: boolean; - /** Type of the parameter for cache invalidation */ - paramType: string; -}; - -/** - * Type for Content Left Panel Options - */ -type ContentLeftPanelOptions = { - /** Determines if tree should expand automatically */ - autoExpandTreeEnabled: boolean; - /** Number of items to auto expand tree */ - autoExpandTreeIfFewerThan: number; - /** Determines if branch nodes expand on click */ - branchNodesExpandOnClick: boolean; - /** Determines if branch nodes are selectable */ - branchNodesSelectable: boolean; - /** Determines if tree is the default view */ - defaultToTreeEnabled: boolean; - /** Number of items to default to tree view */ - defaultToTreeIfGreaterThan: number; - /** Number of items to elide */ - elideCount: number; - /** Determines if full expansion is enabled */ - expandFullEnabled: boolean; - /** Threshold for gallery thumb chunked resizing */ - galleryThumbChunkedResizingThreshold: number; - /** Height of the gallery thumbnail */ - galleryThumbHeight: number; - /** Padding for gallery thumb load */ - galleryThumbLoadPadding: number; - /** Width of the gallery thumbnail */ - galleryThumbWidth: number; - /** Height of the one column thumbnail */ - oneColThumbHeight: number; - /** Width of the one column thumbnail */ - oneColThumbWidth: number; - /** Determines if page mode is enabled */ - pageModeEnabled: boolean; - /** Duration of the panel animation */ - panelAnimationDuration: number; - /** Width of the collapsed panel */ - panelCollapsedWidth: number; - /** Width of the expanded panel */ - panelExpandedWidth: number; - /** Determines if the panel is open */ - panelOpen: boolean; - /** Order of the tabs */ - tabOrder: string; - /** Configuration for thumbs cache invalidation */ - thumbsCacheInvalidation: ThumbsCacheInvalidation; - /** Determines if thumbnails are enabled */ - thumbsEnabled: boolean; - /** Extra height for thumbnails */ - thumbsExtraHeight: number; - /** Duration for thumbnails image fade in */ - thumbsImageFadeInDuration: number; - /** Load range for thumbnails */ - thumbsLoadRange: number; - /** Determines if tree is enabled */ - treeEnabled: boolean; - /** Height of the two column thumbnail */ - twoColThumbHeight: number; - /** Width of the two column thumbnail */ - twoColThumbWidth: number; -}; - -type ContentLeftPanelContent = { - collapse: string; - collapseFull: string; - date: string; - expand: string; - expandFull: string; - index: string; - manifestRanges: string; - searchResult: string; - searchResults: string; - sortBy: string; - thumbnails: string; - title: string; - volume: string; -}; - -type ContentLeftPanel = { - options: ContentLeftPanelOptions; - content: ContentLeftPanelContent; -}; - -type DialogueContent = { - close: string; -}; - -type Dialogue = { - topCloseButtonEnabled: boolean; - content: DialogueContent; -}; - -/** - * Type for Download Dialogue Options - */ -type DownloadDialogueOptions = { - /** Size of the confined image */ - confinedImageSize: number; - /** Percentage of the current view that is disabled */ - currentViewDisabledPercentage: number; - /** Determines if download of current view is enabled */ - downloadCurrentViewEnabled: boolean; - /** Determines if download of whole image in high resolution is enabled */ - downloadWholeImageHighResEnabled: boolean; - /** Determines if download of whole image in low resolution is enabled */ - downloadWholeImageLowResEnabled: boolean; - /** Maximum width of the image */ - maxImageWidth: number; - /** Determines if explanatory text for options is enabled */ - optionsExplanatoryTextEnabled: boolean; - /** Determines if selection is enabled */ - selectionEnabled: boolean; -}; - -type DownloadDialogueContent = { - allPages: string; - currentViewAsJpg: string; - currentViewAsJpgExplanation: string; - download: string; - downloadSelection: string; - downloadSelectionExplanation: string; - editSettings: string; - entireDocument: string; - entireFileAsOriginal: string; - individualPages: string; - noneAvailable: string; - pagingNote: string; - preview: string; - selection: string; - termsOfUse: string; - title: string; - wholeImageHighRes: string; - wholeImageHighResExplanation: string; - wholeImageLowResAsJpg: string; - wholeImageLowResAsJpgExplanation: string; - wholeImagesHighRes: string; - wholeImagesHighResExplanation: string; -}; - -type DownloadDialogue = { - options: DownloadDialogueOptions; - content: DownloadDialogueContent; -}; - -type FooterPanelOptions = { - /** Determines if autocomplete for words is allowed */ - autocompleteAllowWords: boolean; - /** Determines if bookmarking is enabled */ - bookmarkEnabled: boolean; - /** Determines if downloading is enabled */ - downloadEnabled: boolean; - /** Determines if embedding is enabled */ - embedEnabled: boolean; - /** Determines if feedback is enabled */ - feedbackEnabled: boolean; - /** Determines if fullscreen mode is enabled */ - fullscreenEnabled: boolean; - /** Determines if buttons are minimised */ - minimiseButtons: boolean; - /** Determines if more information is enabled */ - moreInfoEnabled: boolean; - /** Determines if opening is enabled */ - openEnabled: boolean; - /** Determines if printing is enabled */ - printEnabled: boolean; - /** Determines if sharing is enabled */ - shareEnabled: boolean; -}; - -type FooterPanelContent = { - bookmark: string; - download: string; - embed: string; - exitFullScreen: string; - feedback: string; - fullScreen: string; - moreInfo: string; - open: string; - share: string; -}; - -type FooterPanel = { - options: FooterPanelOptions; - content: FooterPanelContent; -}; - -type GenericDialogueContent = { - emptyValue: string; - invalidNumber: string; - noMatches: string; - ok: string; - pageNotFound: string; - refresh: string; -}; - -type GenericDialogue = { - content: GenericDialogueContent; -}; - -type HeaderPanelOptions = { - /** Determines if center options are enabled */ - centerOptionsEnabled: boolean; - /** Determines if locale toggle is enabled */ - localeToggleEnabled: boolean; - /** Determines if settings button is enabled */ - settingsButtonEnabled: boolean; -}; - -type HeaderPanel = { - options: HeaderPanelOptions; -}; - -type HelpDialogueContent = { - text: string; - title: string; -}; - -type HelpDialogue = { - content: HelpDialogueContent; -}; - -type MoreInfoRightPanelOptions = { - /** Order in which canvases are displayed */ - canvasDisplayOrder: string; - /** Canvases to exclude from display */ - canvasExclude: string; - /** Determines if copying to clipboard is enabled */ - copyToClipboardEnabled: boolean; - /** Order in which manifests are displayed */ - manifestDisplayOrder: string; - /** Manifests to exclude from display */ - manifestExclude: string; - /** Duration of the panel animation */ - panelAnimationDuration: number; - /** Width of the collapsed panel */ - panelCollapsedWidth: number; - /** Width of the expanded panel */ - panelExpandedWidth: number; - /** Determines if the panel is open */ - panelOpen: boolean; - /** Language codes for right-to-left languages */ - rtlLanguageCodes: string; - /** Determines if all languages should be shown */ - showAllLanguages: boolean; - /** Limit for the text */ - textLimit: number; - /** Type of the text limit */ - textLimitType: string; -}; - -type MoreInfoRightPanelContent = { - attribution: string; - canvasHeader: string; - collapse: string; - collapseFull: string; - copiedToClipboard: string; - copyToClipboard: string; - description: string; - expand: string; - expandFull: string; - holdingText: string; - less: string; - license: string; - logo: string; - manifestHeader: string; - more: string; - noData: string; - page: string; - rangeHeader: string; - title: string; -}; - -type MoreInfoRightPanel = { - options: MoreInfoRightPanelOptions; - content: MoreInfoRightPanelContent; -}; - -type MultiSelectDialogueOptions = { - /** Determines if chunked resizing is enabled for gallery thumbnails */ - galleryThumbChunkedResizingEnabled: boolean; - /** Threshold for chunked resizing of gallery thumbnails */ - galleryThumbChunkedResizingThreshold: number; - /** Height of the gallery thumbnail */ - galleryThumbHeight: number; - /** Padding for loading gallery thumbnails */ - galleryThumbLoadPadding: number; - /** Width of the gallery thumbnail */ - galleryThumbWidth: number; - /** Determines if page mode is enabled */ - pageModeEnabled: boolean; -}; - -type MultiSelectDialogueContent = { - select: string; - selectAll: string; - title: string; -}; - -type MultiSelectDialogue = { - options: MultiSelectDialogueOptions; - content: MultiSelectDialogueContent; -}; - -type PagingHeaderPanelOptions = { - /** Determines if autocomplete box is enabled */ - autoCompleteBoxEnabled: boolean; - /** Determines if autocomplete for words is allowed */ - autocompleteAllowWords: boolean; - /** Determines if gallery button is enabled */ - galleryButtonEnabled: boolean; - /** Determines if image selection box is enabled */ - imageSelectionBoxEnabled: boolean; - /** Determines if page mode is enabled */ - pageModeEnabled: boolean; - /** Determines if paging toggle is enabled */ - pagingToggleEnabled: boolean; -}; - -type PagingHeaderPanelContent = { - close: string; - emptyValue: string; - first: string; - firstImage: string; - firstPage: string; - folio: string; - gallery: string; - go: string; - help: string; - image: string; - last: string; - lastImage: string; - lastPage: string; - next: string; - nextImage: string; - nextPage: string; - of: string; - oneUp: string; - page: string; - pageSearchLabel: string; - previous: string; - previousImage: string; - previousPage: string; - settings: string; - twoUp: string; -}; - -type PagingHeaderPanel = { - options: PagingHeaderPanelOptions; - content: PagingHeaderPanelContent; -}; - -type OpenSeadragonCenterPanelOptions = { - /** Duration of the animation */ - animationTime: number; - /** Determines if controls are hidden automatically */ - autoHideControls: boolean; - /** Determines if required statement is enabled */ - requiredStatementEnabled: boolean; - /** Time taken to blend images */ - blendTime: number; - /** Determines if panning is constrained */ - constrainDuringPan: boolean; - /** Time after which controls fade after inactivity */ - controlsFadeAfterInactive: number; - /** Delay before controls start to fade */ - controlsFadeDelay: number; - /** Duration of controls fade */ - controlsFadeLength: number; - /** Default zoom level */ - defaultZoomLevel: number; - /** Determines if rendering is immediate */ - immediateRender: boolean; - /** Maximum pixel ratio for zoom */ - maxZoomPixelRatio: number; - /** Position of the navigator */ - navigatorPosition: string; - /** Gap between pages */ - pageGap: number; - /** Determines if home control is shown */ - showHomeControl: boolean; - /** Number of attributions to trim */ - trimAttributionCount: number; - /** Ratio of visibility */ - visibilityRatio: number; -}; - -type OpenSeadragonCenterPanelContent = { - attribution: string; - goHome: string; - imageUnavailable: string; - next: string; - previous: string; - rotateRight: string; - zoomIn: string; - zoomOut: string; -}; - -type OpenSeadragonCenterPanel = { - options: OpenSeadragonCenterPanelOptions; - content: OpenSeadragonCenterPanelContent; -}; - -type SearchFooterPanelOptions = { - /** Number of terms to elide in details */ - elideDetailsTermsCount: number; - /** Number of terms to elide in results */ - elideResultsTermsCount: number; - /** Determines if image mode is forced */ - forceImageMode: boolean; - /** Determines if page mode is enabled */ - pageModeEnabled: boolean; - /** Determines if position marker is enabled */ - positionMarkerEnabled: boolean; -}; - -type SearchFooterPanelContent = { - clearSearch: string; - defaultLabel: string; - displaying: string; - enterKeyword: string; - image: string; - imageCaps: string; - instanceFound: string; - instancesFound: string; - nextResult: string; - page: string; - pageCaps: string; - previousResult: string; - print: string; - resultFoundFor: string; - resultsFoundFor: string; - searchWithin: string; -}; - -type SearchFooterPanel = { - options: SearchFooterPanelOptions; - content: SearchFooterPanelContent; -}; - -type SettingsDialogueContent = { - locale: string; - navigatorEnabled: string; - clickToZoomEnabled: string; - pagingEnabled: string; - reducedMotion: string; - preserveViewport: string; - title: string; - website: string; -}; - -type SettingsDialogue = { - content: SettingsDialogueContent; -}; - -type ShareDialogueOptions = { - /** Template for embedding */ - embedTemplate: string; - /** Determines if instructions are enabled */ - instructionsEnabled: boolean; - /** Determines if sharing frame is enabled */ - shareFrameEnabled: boolean; - /** Determines if sharing manifests is enabled */ - shareManifestsEnabled: boolean; -}; - -type ShareDialogueContent = { - customSize: string; - embed: string; - embedInstructions: string; - height: string; - iiif: string; - share: string; - shareInstructions: string; - size: string; - width: string; -}; - -type ShareDialogue = { - options: ShareDialogueOptions; - content: ShareDialogueContent; -}; - -type AuthDialogueContent = { - cancel: string; - confirm: string; -}; - -type AuthDialogue = { - content: AuthDialogueContent; -}; - -type ClickThroughDialogueContent = { - viewTerms: string; -}; - -type ClickThroughDialogue = { - content: ClickThroughDialogueContent; -}; - -type LoginDialogueContent = { - login: string; - logout: string; - cancel: string; -}; - -type LoginDialogue = { - content: LoginDialogueContent; -}; - -type MobileFooterPanelContent = { - rotateRight: string; - moreInfo: string; - zoomIn: string; - zoomOut: string; -}; - -type MobileFooterPanel = { - content: MobileFooterPanelContent; -}; - -type RestrictedDialogueContent = { - cancel: string; -}; - -type RestrictedDialogue = { - content: RestrictedDialogueContent; -}; - -type Modules = { - contentLeftPanel: ContentLeftPanel; - dialogue: Dialogue; - downloadDialogue: DownloadDialogue; - footerPanel: FooterPanel; - genericDialogue: GenericDialogue; - headerPanel: HeaderPanel; - helpDialogue: HelpDialogue; - moreInfoRightPanel: MoreInfoRightPanel; - multiSelectDialogue: MultiSelectDialogue; - pagingHeaderPanel: PagingHeaderPanel; - openSeadragonCenterPanel: OpenSeadragonCenterPanel; - searchFooterPanel: SearchFooterPanel; - settingsDialogue: SettingsDialogue; - shareDialogue: ShareDialogue; - authDialogue: AuthDialogue; - clickThroughDialogue: ClickThroughDialogue; - loginDialogue: LoginDialogue; - mobileFooterPanel: MobileFooterPanel; - restrictedDialogue: RestrictedDialogue; -}; - -export type Config2 = BaseConfig2 & { - modules: Modules; -}; diff --git a/src/content-handlers/iiif/modules/uv-shared-module/BaseExtension.ts b/src/content-handlers/iiif/modules/uv-shared-module/BaseExtension.ts index 160a61245..bab84dce9 100644 --- a/src/content-handlers/iiif/modules/uv-shared-module/BaseExtension.ts +++ b/src/content-handlers/iiif/modules/uv-shared-module/BaseExtension.ts @@ -47,7 +47,7 @@ import { IIIFEvents } from "../../IIIFEvents"; import { Events } from "../../../../Events"; import { StoreApi } from "zustand/vanilla"; import { ExtensionState } from "./ExtensionState"; -import { BaseConfig2, Metric, MetricType } from "../../BaseConfig2"; +import { BaseConfig, Metric, MetricType } from "../../BaseConfig"; export class BaseExtension implements IExtension { $authDialogue: JQuery; @@ -79,7 +79,7 @@ export class BaseExtension implements IExtension { tabbing: boolean = false; browserDetect: BrowserDetect; locales = {}; - defaultConfig: BaseConfig2; + defaultConfig: BaseConfig; public create(): void { const that = this;