react-msaview 5.0.1 → 5.0.3
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.
- package/bundle/index.js +79 -79
- package/bundle/index.js.LICENSE.txt +0 -15
- package/bundle/index.js.map +1 -1
- package/dist/colorSchemes.js +1 -1
- package/dist/colorSchemes.js.map +1 -1
- package/dist/components/ConservationTrack.d.ts +2 -2
- package/dist/components/Loading.d.ts +1 -1
- package/dist/components/Loading.js +2 -2
- package/dist/components/Loading.js.map +1 -1
- package/dist/components/MSAView.d.ts +1 -1
- package/dist/components/MSAView.js +8 -8
- package/dist/components/MSAView.js.map +1 -1
- package/dist/components/ResizeHandles.d.ts +1 -1
- package/dist/components/SequenceTextArea.js +2 -2
- package/dist/components/SequenceTextArea.js.map +1 -1
- package/dist/components/TextTrack.d.ts +2 -2
- package/dist/components/TextTrack.js +1 -1
- package/dist/components/TextTrack.js.map +1 -1
- package/dist/components/Track.d.ts +1 -1
- package/dist/components/Track.js +1 -1
- package/dist/components/Track.js.map +1 -1
- package/dist/components/VerticalScrollbar.d.ts +1 -1
- package/dist/components/dialogs/AboutDialog.js +1 -1
- package/dist/components/dialogs/AboutDialog.js.map +1 -1
- package/dist/components/dialogs/AddTrackDialog.d.ts +1 -1
- package/dist/components/dialogs/DomainDialog.d.ts +1 -1
- package/dist/components/dialogs/DomainDialog.js +3 -3
- package/dist/components/dialogs/DomainDialog.js.map +1 -1
- package/dist/components/dialogs/ExportSVGDialog.d.ts +1 -1
- package/dist/components/dialogs/ExportSVGDialog.js +1 -1
- package/dist/components/dialogs/ExportSVGDialog.js.map +1 -1
- package/dist/components/dialogs/FeatureDialog.d.ts +1 -1
- package/dist/components/dialogs/FeatureDialog.js +1 -1
- package/dist/components/dialogs/FeatureDialog.js.map +1 -1
- package/dist/components/dialogs/InterProScanDialog.d.ts +1 -1
- package/dist/components/dialogs/InterProScanDialog.js +1 -1
- package/dist/components/dialogs/InterProScanDialog.js.map +1 -1
- package/dist/components/dialogs/MetadataDialog.d.ts +1 -1
- package/dist/components/dialogs/MetadataDialog.js +1 -1
- package/dist/components/dialogs/MetadataDialog.js.map +1 -1
- package/dist/components/dialogs/SettingsDialog.d.ts +1 -1
- package/dist/components/dialogs/SettingsDialog.js +2 -2
- package/dist/components/dialogs/SettingsDialog.js.map +1 -1
- package/dist/components/dialogs/TrackInfoDialog.js +1 -1
- package/dist/components/dialogs/TrackInfoDialog.js.map +1 -1
- package/dist/components/dialogs/UserProvidedDomainsDialog.d.ts +1 -1
- package/dist/components/dialogs/UserProvidedDomainsDialog.js +1 -1
- package/dist/components/dialogs/UserProvidedDomainsDialog.js.map +1 -1
- package/dist/components/header/GappynessSlider.d.ts +1 -1
- package/dist/components/header/Header.d.ts +1 -1
- package/dist/components/header/Header.js +10 -10
- package/dist/components/header/Header.js.map +1 -1
- package/dist/components/header/HeaderInfoArea.d.ts +1 -1
- package/dist/components/header/HeaderMenu.d.ts +1 -1
- package/dist/components/header/HeaderMenu.js +6 -6
- package/dist/components/header/HeaderMenu.js.map +1 -1
- package/dist/components/header/HeaderStatusArea.d.ts +1 -1
- package/dist/components/header/MultiAlignmentSelector.d.ts +1 -1
- package/dist/components/header/SettingsMenu.d.ts +1 -1
- package/dist/components/header/SettingsMenu.js +1 -1
- package/dist/components/header/SettingsMenu.js.map +1 -1
- package/dist/components/header/ZoomControls.d.ts +1 -1
- package/dist/components/header/ZoomMenu.d.ts +1 -1
- package/dist/components/header/ZoomStar.d.ts +1 -1
- package/dist/components/import/ImportForm.d.ts +1 -1
- package/dist/components/import/ImportForm.js +2 -2
- package/dist/components/import/ImportForm.js.map +1 -1
- package/dist/components/import/ImportFormExamples.d.ts +1 -1
- package/dist/components/import/ImportFormExamples.js +2 -2
- package/dist/components/import/ImportFormExamples.js.map +1 -1
- package/dist/components/import/util.d.ts +1 -1
- package/dist/components/minimap/Minimap.d.ts +1 -1
- package/dist/components/minimap/MinimapSVG.d.ts +1 -1
- package/dist/components/msa/MSACanvas.d.ts +1 -1
- package/dist/components/msa/MSACanvas.js +2 -2
- package/dist/components/msa/MSACanvas.js.map +1 -1
- package/dist/components/msa/MSACanvasBlock.d.ts +1 -1
- package/dist/components/msa/MSACanvasBlock.js +3 -3
- package/dist/components/msa/MSACanvasBlock.js.map +1 -1
- package/dist/components/msa/MSAMouseoverCanvas.d.ts +1 -1
- package/dist/components/msa/MSAMouseoverCanvas.js +1 -1
- package/dist/components/msa/MSAMouseoverCanvas.js.map +1 -1
- package/dist/components/msa/MSAPanel.d.ts +1 -1
- package/dist/components/msa/MSAPanel.js +2 -2
- package/dist/components/msa/MSAPanel.js.map +1 -1
- package/dist/components/msa/renderBoxFeatureCanvasBlock.d.ts +1 -1
- package/dist/components/msa/renderMSABlock.d.ts +1 -1
- package/dist/components/msa/renderMSAMouseover.d.ts +1 -1
- package/dist/components/tracks/renderTracksSvg.d.ts +2 -2
- package/dist/components/tree/TreeBranchMenu.d.ts +1 -1
- package/dist/components/tree/TreeCanvas.d.ts +1 -1
- package/dist/components/tree/TreeCanvas.js +2 -2
- package/dist/components/tree/TreeCanvas.js.map +1 -1
- package/dist/components/tree/TreeCanvasBlock.d.ts +1 -1
- package/dist/components/tree/TreeCanvasBlock.js +3 -3
- package/dist/components/tree/TreeCanvasBlock.js.map +1 -1
- package/dist/components/tree/TreeNodeMenu.d.ts +1 -1
- package/dist/components/tree/TreeNodeMenu.js +1 -1
- package/dist/components/tree/TreeNodeMenu.js.map +1 -1
- package/dist/components/tree/TreePanel.d.ts +1 -1
- package/dist/components/tree/TreePanel.js +1 -1
- package/dist/components/tree/TreePanel.js.map +1 -1
- package/dist/components/tree/TreeRuler.d.ts +1 -1
- package/dist/components/tree/dialogs/TreeNodeInfoDialog.d.ts +1 -1
- package/dist/components/tree/dialogs/TreeNodeInfoDialog.js +1 -1
- package/dist/components/tree/dialogs/TreeNodeInfoDialog.js.map +1 -1
- package/dist/components/tree/renderTreeCanvas.d.ts +1 -1
- package/dist/createPaletteMap.d.ts +7 -0
- package/dist/createPaletteMap.js +11 -0
- package/dist/createPaletteMap.js.map +1 -0
- package/dist/createPaletteMap.test.d.ts +1 -0
- package/dist/createPaletteMap.test.js +49 -0
- package/dist/createPaletteMap.test.js.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/launchInterProScan.d.ts +1 -1
- package/dist/launchInterProScan.js +1 -1
- package/dist/launchInterProScan.js.map +1 -1
- package/dist/model/msaModel.js +1 -1
- package/dist/model/msaModel.js.map +1 -1
- package/dist/model/treeModel.js +1 -1
- package/dist/model/treeModel.js.map +1 -1
- package/dist/model.d.ts +11 -3
- package/dist/model.js +54 -35
- package/dist/model.js.map +1 -1
- package/dist/neighborJoining.test.js +1 -1
- package/dist/neighborJoining.test.js.map +1 -1
- package/dist/parseAsn1.test.js +1 -1
- package/dist/parseAsn1.test.js.map +1 -1
- package/dist/renderToSvg.d.ts +1 -1
- package/dist/renderToSvg.js +10 -10
- package/dist/renderToSvg.js.map +1 -1
- package/dist/reparseTree.d.ts +1 -1
- package/dist/rowCoordinateCalculations.js +1 -1
- package/dist/rowCoordinateCalculations.js.map +1 -1
- package/dist/rowCoordinateCalculations.test.js +1 -1
- package/dist/rowCoordinateCalculations.test.js.map +1 -1
- package/dist/seqPosToGlobalCol.js +1 -1
- package/dist/seqPosToGlobalCol.js.map +1 -1
- package/dist/seqPosToGlobalCol.test.js +1 -1
- package/dist/seqPosToGlobalCol.test.js.map +1 -1
- package/dist/util.d.ts +1 -1
- package/dist/vendor/copyToClipboard.d.ts +10 -0
- package/dist/vendor/copyToClipboard.js +113 -0
- package/dist/vendor/copyToClipboard.js.map +1 -0
- package/dist/vendor/fileSaver.d.ts +11 -0
- package/dist/vendor/fileSaver.js +80 -0
- package/dist/vendor/fileSaver.js.map +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/webpack.d.ts +2 -2
- package/dist/webpack.js +2 -2
- package/dist/webpack.js.map +1 -1
- package/package.json +25 -22
- package/src/colorSchemes.ts +1 -1
- package/src/components/ConservationTrack.tsx +2 -2
- package/src/components/Loading.tsx +3 -3
- package/src/components/MSAView.tsx +12 -9
- package/src/components/ResizeHandles.tsx +1 -1
- package/src/components/SequenceTextArea.tsx +2 -2
- package/src/components/TextTrack.tsx +3 -3
- package/src/components/Track.tsx +2 -2
- package/src/components/VerticalScrollbar.tsx +1 -1
- package/src/components/dialogs/AboutDialog.tsx +1 -1
- package/src/components/dialogs/AddTrackDialog.tsx +1 -1
- package/src/components/dialogs/DomainDialog.tsx +4 -4
- package/src/components/dialogs/ExportSVGDialog.tsx +2 -2
- package/src/components/dialogs/FeatureDialog.tsx +2 -2
- package/src/components/dialogs/InterProScanDialog.tsx +2 -2
- package/src/components/dialogs/MetadataDialog.tsx +2 -2
- package/src/components/dialogs/SettingsDialog.tsx +3 -3
- package/src/components/dialogs/TrackInfoDialog.tsx +2 -1
- package/src/components/dialogs/UserProvidedDomainsDialog.tsx +3 -3
- package/src/components/header/GappynessSlider.tsx +1 -1
- package/src/components/header/Header.tsx +11 -11
- package/src/components/header/HeaderInfoArea.tsx +1 -1
- package/src/components/header/HeaderMenu.tsx +9 -7
- package/src/components/header/HeaderStatusArea.tsx +1 -1
- package/src/components/header/MultiAlignmentSelector.tsx +1 -1
- package/src/components/header/SettingsMenu.tsx +2 -2
- package/src/components/header/ZoomControls.tsx +1 -1
- package/src/components/header/ZoomMenu.tsx +1 -1
- package/src/components/header/ZoomStar.tsx +1 -1
- package/src/components/import/ImportForm.tsx +3 -3
- package/src/components/import/ImportFormExamples.tsx +3 -3
- package/src/components/import/util.ts +1 -1
- package/src/components/minimap/Minimap.tsx +1 -1
- package/src/components/minimap/MinimapSVG.tsx +1 -1
- package/src/components/msa/MSACanvas.tsx +3 -3
- package/src/components/msa/MSACanvasBlock.tsx +4 -4
- package/src/components/msa/MSAMouseoverCanvas.tsx +2 -2
- package/src/components/msa/MSAPanel.tsx +3 -3
- package/src/components/msa/renderBoxFeatureCanvasBlock.ts +2 -2
- package/src/components/msa/renderMSABlock.ts +2 -2
- package/src/components/msa/renderMSAMouseover.ts +1 -1
- package/src/components/tracks/renderTracksSvg.ts +2 -2
- package/src/components/tree/TreeBranchMenu.tsx +1 -1
- package/src/components/tree/TreeCanvas.tsx +3 -3
- package/src/components/tree/TreeCanvasBlock.tsx +4 -4
- package/src/components/tree/TreeNodeMenu.tsx +4 -2
- package/src/components/tree/TreePanel.tsx +2 -2
- package/src/components/tree/TreeRuler.tsx +1 -1
- package/src/components/tree/dialogs/TreeNodeInfoDialog.tsx +2 -2
- package/src/components/tree/renderTreeCanvas.ts +1 -1
- package/src/createPaletteMap.test.ts +57 -0
- package/src/createPaletteMap.ts +11 -0
- package/src/index.ts +2 -2
- package/src/launchInterProScan.ts +2 -2
- package/src/model/msaModel.ts +1 -1
- package/src/model/treeModel.ts +1 -1
- package/src/model.ts +57 -37
- package/src/neighborJoining.test.ts +1 -1
- package/src/parseAsn1.test.ts +1 -1
- package/src/renderToSvg.tsx +17 -19
- package/src/reparseTree.ts +1 -1
- package/src/rowCoordinateCalculations.test.ts +1 -1
- package/src/rowCoordinateCalculations.ts +1 -1
- package/src/seqPosToGlobalCol.test.ts +1 -1
- package/src/seqPosToGlobalCol.ts +1 -1
- package/src/util.ts +1 -1
- package/src/vendor/copyToClipboard.ts +125 -0
- package/src/vendor/fileSaver.ts +107 -0
- package/src/version.ts +1 -1
- package/src/webpack.ts +2 -2
- package/src/declare.d.ts +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { describe, expect, test } from 'vitest'
|
|
2
2
|
|
|
3
|
-
import { seqPosToGlobalCol } from './seqPosToGlobalCol'
|
|
3
|
+
import { seqPosToGlobalCol } from './seqPosToGlobalCol.ts'
|
|
4
4
|
|
|
5
5
|
describe('seqPosToGlobalCol', () => {
|
|
6
6
|
test('converts sequence position to global column with no gaps', () => {
|
package/src/seqPosToGlobalCol.ts
CHANGED
package/src/util.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { colord, extend } from 'colord'
|
|
|
2
2
|
import namesPlugin from 'colord/plugins/names'
|
|
3
3
|
import { max } from 'd3-array'
|
|
4
4
|
|
|
5
|
-
import type { NodeWithIds } from './types'
|
|
5
|
+
import type { NodeWithIds } from './types.ts'
|
|
6
6
|
import type { Theme } from '@mui/material'
|
|
7
7
|
import type { HierarchyNode } from 'd3-hierarchy'
|
|
8
8
|
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copy text to clipboard utility.
|
|
3
|
+
* Uses modern Clipboard API with fallback to execCommand.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
function deselectCurrent() {
|
|
7
|
+
const selection = document.getSelection()
|
|
8
|
+
if (!selection?.rangeCount) {
|
|
9
|
+
return () => {}
|
|
10
|
+
}
|
|
11
|
+
const active = document.activeElement as HTMLElement | null
|
|
12
|
+
|
|
13
|
+
const ranges: Range[] = []
|
|
14
|
+
for (let i = 0; i < selection.rangeCount; i++) {
|
|
15
|
+
ranges.push(selection.getRangeAt(i))
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const tagName = active?.tagName.toUpperCase()
|
|
19
|
+
if (tagName === 'INPUT' || tagName === 'TEXTAREA') {
|
|
20
|
+
active?.blur()
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
selection.removeAllRanges()
|
|
24
|
+
return () => {
|
|
25
|
+
if (selection.type === 'Caret') {
|
|
26
|
+
selection.removeAllRanges()
|
|
27
|
+
}
|
|
28
|
+
if (!selection.rangeCount) {
|
|
29
|
+
for (const range of ranges) {
|
|
30
|
+
selection.addRange(range)
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
active?.focus()
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface CopyOptions {
|
|
38
|
+
debug?: boolean
|
|
39
|
+
format?: string
|
|
40
|
+
onCopy?: (clipboardData: DataTransfer) => void
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export default function copy(text: string, options?: CopyOptions): boolean {
|
|
44
|
+
const debug = options?.debug || false
|
|
45
|
+
let success = false
|
|
46
|
+
let reselectPrevious: (() => void) | undefined
|
|
47
|
+
let range: Range | undefined
|
|
48
|
+
let selection: Selection | null = null
|
|
49
|
+
let mark: HTMLSpanElement | undefined
|
|
50
|
+
|
|
51
|
+
try {
|
|
52
|
+
reselectPrevious = deselectCurrent()
|
|
53
|
+
range = document.createRange()
|
|
54
|
+
selection = document.getSelection()
|
|
55
|
+
|
|
56
|
+
mark = document.createElement('span')
|
|
57
|
+
mark.textContent = text
|
|
58
|
+
mark.ariaHidden = 'true'
|
|
59
|
+
mark.style.all = 'unset'
|
|
60
|
+
mark.style.position = 'fixed'
|
|
61
|
+
mark.style.top = '0'
|
|
62
|
+
mark.style.clip = 'rect(0, 0, 0, 0)'
|
|
63
|
+
mark.style.whiteSpace = 'pre'
|
|
64
|
+
mark.style.webkitUserSelect = 'text'
|
|
65
|
+
;(mark.style as unknown as Record<string, string>).MozUserSelect = 'text'
|
|
66
|
+
;(mark.style as unknown as Record<string, string>).msUserSelect = 'text'
|
|
67
|
+
mark.style.userSelect = 'text'
|
|
68
|
+
|
|
69
|
+
mark.addEventListener('copy', e => {
|
|
70
|
+
e.stopPropagation()
|
|
71
|
+
if (options?.format) {
|
|
72
|
+
e.preventDefault()
|
|
73
|
+
if (e.clipboardData) {
|
|
74
|
+
e.clipboardData.clearData()
|
|
75
|
+
e.clipboardData.setData(options.format, text)
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
if (options?.onCopy && e.clipboardData) {
|
|
79
|
+
e.preventDefault()
|
|
80
|
+
options.onCopy(e.clipboardData)
|
|
81
|
+
}
|
|
82
|
+
})
|
|
83
|
+
|
|
84
|
+
document.body.append(mark)
|
|
85
|
+
range.selectNodeContents(mark)
|
|
86
|
+
selection?.addRange(range)
|
|
87
|
+
|
|
88
|
+
const successful = document.execCommand('copy')
|
|
89
|
+
if (!successful) {
|
|
90
|
+
throw new Error('copy command was unsuccessful')
|
|
91
|
+
}
|
|
92
|
+
success = true
|
|
93
|
+
} catch (err) {
|
|
94
|
+
if (debug) {
|
|
95
|
+
console.error('unable to copy using execCommand:', err)
|
|
96
|
+
}
|
|
97
|
+
try {
|
|
98
|
+
const clipboardData = (window as unknown as Record<string, DataTransfer>)
|
|
99
|
+
.clipboardData
|
|
100
|
+
if (clipboardData) {
|
|
101
|
+
clipboardData.setData(options?.format || 'text', text)
|
|
102
|
+
options?.onCopy?.(clipboardData)
|
|
103
|
+
success = true
|
|
104
|
+
}
|
|
105
|
+
} catch (err2) {
|
|
106
|
+
if (debug) {
|
|
107
|
+
console.error('unable to copy using clipboardData:', err2)
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
} finally {
|
|
111
|
+
if (selection) {
|
|
112
|
+
if (typeof selection.removeRange === 'function' && range) {
|
|
113
|
+
selection.removeRange(range)
|
|
114
|
+
} else {
|
|
115
|
+
selection.removeAllRanges()
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
if (mark) {
|
|
119
|
+
mark.remove()
|
|
120
|
+
}
|
|
121
|
+
reselectPrevious?.()
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
return success
|
|
125
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FileSaver.js
|
|
3
|
+
* A saveAs() FileSaver implementation.
|
|
4
|
+
*
|
|
5
|
+
* By Eli Grey, http://eligrey.com
|
|
6
|
+
* License: MIT
|
|
7
|
+
* source: http://purl.eligrey.com/github/FileSaver.js
|
|
8
|
+
*
|
|
9
|
+
* Vendored and converted to ESM/TypeScript for pure ESM compatibility.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
function click(node: HTMLAnchorElement) {
|
|
13
|
+
try {
|
|
14
|
+
node.dispatchEvent(new MouseEvent('click'))
|
|
15
|
+
} catch {
|
|
16
|
+
const evt = document.createEvent('MouseEvents')
|
|
17
|
+
evt.initMouseEvent(
|
|
18
|
+
'click',
|
|
19
|
+
true,
|
|
20
|
+
true,
|
|
21
|
+
window,
|
|
22
|
+
0,
|
|
23
|
+
0,
|
|
24
|
+
0,
|
|
25
|
+
80,
|
|
26
|
+
20,
|
|
27
|
+
false,
|
|
28
|
+
false,
|
|
29
|
+
false,
|
|
30
|
+
false,
|
|
31
|
+
0,
|
|
32
|
+
null,
|
|
33
|
+
)
|
|
34
|
+
node.dispatchEvent(evt)
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Detect WebView inside a native macOS app by ruling out all browsers
|
|
39
|
+
const isMacOSWebView =
|
|
40
|
+
typeof navigator !== 'undefined' &&
|
|
41
|
+
navigator.userAgent.includes('Macintosh') &&
|
|
42
|
+
navigator.userAgent.includes('AppleWebKit') &&
|
|
43
|
+
!navigator.userAgent.includes('Safari')
|
|
44
|
+
|
|
45
|
+
export function saveAs(blob: Blob | string, name?: string) {
|
|
46
|
+
if (typeof window === 'undefined') {
|
|
47
|
+
return
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const URL = window.URL
|
|
51
|
+
const a = document.createElement('a')
|
|
52
|
+
name = name || (blob instanceof Blob ? 'download' : 'download')
|
|
53
|
+
|
|
54
|
+
// Use download attribute if available and not macOS WebView
|
|
55
|
+
if ('download' in HTMLAnchorElement.prototype && !isMacOSWebView) {
|
|
56
|
+
a.download = name
|
|
57
|
+
a.rel = 'noopener'
|
|
58
|
+
|
|
59
|
+
if (typeof blob === 'string') {
|
|
60
|
+
a.href = blob
|
|
61
|
+
click(a)
|
|
62
|
+
} else {
|
|
63
|
+
a.href = URL.createObjectURL(blob)
|
|
64
|
+
setTimeout(() => {
|
|
65
|
+
URL.revokeObjectURL(a.href)
|
|
66
|
+
}, 40000)
|
|
67
|
+
setTimeout(() => {
|
|
68
|
+
click(a)
|
|
69
|
+
}, 0)
|
|
70
|
+
}
|
|
71
|
+
return
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// Fallback for browsers without download attribute support
|
|
75
|
+
if (typeof blob === 'string') {
|
|
76
|
+
window.open(blob, '_blank')
|
|
77
|
+
return
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
const isSafari =
|
|
81
|
+
/constructor/i.test(
|
|
82
|
+
(window as unknown as { HTMLElement: unknown }).HTMLElement?.toString() ??
|
|
83
|
+
'',
|
|
84
|
+
) || !!(window as unknown as { safari?: unknown }).safari
|
|
85
|
+
const isChromeIOS = /CriOS\/[\d]+/.test(navigator.userAgent)
|
|
86
|
+
|
|
87
|
+
if (
|
|
88
|
+
(isChromeIOS || isSafari || isMacOSWebView) &&
|
|
89
|
+
typeof FileReader !== 'undefined'
|
|
90
|
+
) {
|
|
91
|
+
const reader = new FileReader()
|
|
92
|
+
reader.onloadend = () => {
|
|
93
|
+
let url = reader.result as string
|
|
94
|
+
url = isChromeIOS
|
|
95
|
+
? url
|
|
96
|
+
: url.replace(/^data:[^;]*;/, 'data:attachment/file;')
|
|
97
|
+
window.open(url, '_blank')
|
|
98
|
+
}
|
|
99
|
+
reader.readAsDataURL(blob)
|
|
100
|
+
} else {
|
|
101
|
+
const url = URL.createObjectURL(blob)
|
|
102
|
+
window.open(url, '_blank')
|
|
103
|
+
setTimeout(() => {
|
|
104
|
+
URL.revokeObjectURL(url)
|
|
105
|
+
}, 40000)
|
|
106
|
+
}
|
|
107
|
+
}
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '5.0.
|
|
1
|
+
export const version = '5.0.3'
|
package/src/webpack.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react'
|
|
2
2
|
|
|
3
|
-
export { default as MSAView } from './components/Loading'
|
|
4
|
-
export { type MsaViewModel, default as MSAModelF } from './model'
|
|
3
|
+
export { default as MSAView } from './components/Loading.tsx'
|
|
4
|
+
export { type MsaViewModel, default as MSAModelF } from './model.ts'
|
|
5
5
|
|
|
6
6
|
export * from 'react-dom/client'
|
|
7
7
|
|
package/src/declare.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
declare module 'svgcanvas'
|