@jbrowse/core 2.17.0 → 3.0.0
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/BaseFeatureWidget/BaseFeatureDetail/ArrayValue.d.ts +1 -2
- package/BaseFeatureWidget/BaseFeatureDetail/ArrayValue.js +7 -13
- package/BaseFeatureWidget/BaseFeatureDetail/Attributes.d.ts +1 -2
- package/BaseFeatureWidget/BaseFeatureDetail/Attributes.js +20 -25
- package/BaseFeatureWidget/BaseFeatureDetail/BaseCard.d.ts +2 -3
- package/BaseFeatureWidget/BaseFeatureDetail/BaseCard.js +3 -7
- package/BaseFeatureWidget/BaseFeatureDetail/BasicValue.d.ts +1 -2
- package/BaseFeatureWidget/BaseFeatureDetail/BasicValue.js +5 -8
- package/BaseFeatureWidget/BaseFeatureDetail/CoreDetails.d.ts +2 -3
- package/BaseFeatureWidget/BaseFeatureDetail/CoreDetails.js +7 -10
- package/BaseFeatureWidget/BaseFeatureDetail/DataGridDetails.d.ts +1 -2
- package/BaseFeatureWidget/BaseFeatureDetail/DataGridDetails.js +25 -55
- package/BaseFeatureWidget/BaseFeatureDetail/FeatureDetails.d.ts +3 -4
- package/BaseFeatureWidget/BaseFeatureDetail/FeatureDetails.js +16 -34
- package/BaseFeatureWidget/BaseFeatureDetail/FieldName.d.ts +1 -2
- package/BaseFeatureWidget/BaseFeatureDetail/FieldName.js +2 -6
- package/BaseFeatureWidget/BaseFeatureDetail/Position.d.ts +2 -3
- package/BaseFeatureWidget/BaseFeatureDetail/Position.js +2 -5
- package/BaseFeatureWidget/BaseFeatureDetail/SimpleField.d.ts +1 -2
- package/BaseFeatureWidget/BaseFeatureDetail/SimpleField.js +3 -5
- package/BaseFeatureWidget/BaseFeatureDetail/UriField.d.ts +1 -2
- package/BaseFeatureWidget/BaseFeatureDetail/UriField.js +3 -5
- package/BaseFeatureWidget/BaseFeatureDetail/index.d.ts +4 -5
- package/BaseFeatureWidget/BaseFeatureDetail/index.js +6 -14
- package/BaseFeatureWidget/BaseFeatureDetail/util.js +4 -13
- package/BaseFeatureWidget/SequenceFeatureDetails/SequenceContents.d.ts +10 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/SequenceContents.js +48 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeatureDetails.d.ts +3 -4
- package/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeatureDetails.js +33 -41
- package/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeaturePanel.d.ts +3 -4
- package/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeaturePanel.js +30 -29
- package/BaseFeatureWidget/SequenceFeatureDetails/SequenceName.d.ts +8 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/SequenceName.js +28 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/SequencePanel.d.ts +2 -10
- package/BaseFeatureWidget/SequenceFeatureDetails/SequencePanel.js +11 -85
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/HelpDialog.d.ts +1 -2
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/HelpDialog.js +6 -25
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceDialog.d.ts +3 -4
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceDialog.js +11 -46
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceFeatureMenu.d.ts +3 -4
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceFeatureMenu.js +101 -96
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceTypeSelector.d.ts +2 -3
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceTypeSelector.js +49 -53
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SettingsDialog.d.ts +2 -3
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SettingsDialog.js +20 -55
- package/BaseFeatureWidget/SequenceFeatureDetails/hooks.d.ts +2 -2
- package/BaseFeatureWidget/SequenceFeatureDetails/hooks.js +1 -2
- package/BaseFeatureWidget/SequenceFeatureDetails/model.d.ts +2 -56
- package/BaseFeatureWidget/SequenceFeatureDetails/model.js +4 -66
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/CDNASequence.d.ts +4 -5
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/CDNASequence.js +6 -9
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/CDSSequence.d.ts +3 -4
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/CDSSequence.js +6 -7
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/GenomicSequence.d.ts +3 -4
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/GenomicSequence.js +5 -9
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/ProteinSequence.d.ts +3 -4
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/ProteinSequence.js +2 -4
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/SequenceDisplay.d.ts +2 -3
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/SequenceDisplay.js +3 -10
- package/BaseFeatureWidget/SequenceFeatureDetails/types.d.ts +8 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/types.js +2 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/util.js +1 -5
- package/BaseFeatureWidget/stateModelFactory.d.ts +2 -93
- package/BaseFeatureWidget/stateModelFactory.js +3 -73
- package/BaseFeatureWidget/types.d.ts +3 -3
- package/BaseFeatureWidget/util.js +0 -4
- package/CorePlugin.d.ts +1 -1
- package/CorePlugin.js +19 -12
- package/Plugin.d.ts +2 -5
- package/Plugin.js +0 -3
- package/PluginLoader.d.ts +1 -1
- package/PluginLoader.js +2 -19
- package/PluginManager.d.ts +17 -32
- package/PluginManager.js +15 -41
- package/ReExports/DataGrid.js +0 -1
- package/ReExports/list.d.ts +0 -5
- package/ReExports/list.js +3 -5
- package/ReExports/modules.d.ts +26 -22
- package/ReExports/modules.js +45 -44
- package/TextSearch/BaseResults.d.ts +4 -4
- package/TextSearch/TextSearchManager.d.ts +4 -16
- package/TextSearch/TextSearchManager.js +1 -13
- package/assemblyManager/assembly.d.ts +5 -100
- package/assemblyManager/assembly.js +30 -146
- package/assemblyManager/assemblyConfigSchema.d.ts +1 -34
- package/assemblyManager/assemblyConfigSchema.js +12 -46
- package/assemblyManager/assemblyManager.d.ts +7 -57
- package/assemblyManager/assemblyManager.js +2 -57
- package/configuration/configurationSchema.d.ts +4 -4
- package/configuration/configurationSchema.js +2 -14
- package/configuration/configurationSlot.d.ts +2 -13
- package/configuration/configurationSlot.js +2 -32
- package/configuration/index.d.ts +2 -2
- package/configuration/index.js +2 -2
- package/configuration/types.d.ts +2 -3
- package/configuration/util.d.ts +1 -25
- package/configuration/util.js +19 -56
- package/data_adapters/BaseAdapter/BaseAdapter.d.ts +4 -14
- package/data_adapters/BaseAdapter/BaseAdapter.js +1 -10
- package/data_adapters/BaseAdapter/BaseFeatureDataAdapter.d.ts +5 -114
- package/data_adapters/BaseAdapter/BaseFeatureDataAdapter.js +3 -79
- package/data_adapters/BaseAdapter/BaseOptions.d.ts +2 -2
- package/data_adapters/BaseAdapter/BaseRefNameAliasAdapter.d.ts +2 -2
- package/data_adapters/BaseAdapter/BaseSequenceAdapter.d.ts +3 -6
- package/data_adapters/BaseAdapter/BaseTextSearchAdapter.d.ts +3 -3
- package/data_adapters/BaseAdapter/RegionsAdapter.d.ts +3 -3
- package/data_adapters/BaseAdapter/index.d.ts +4 -4
- package/data_adapters/BaseAdapter/types.d.ts +2 -2
- package/data_adapters/BaseAdapter/util.d.ts +6 -6
- package/data_adapters/CytobandAdapter/CytobandAdapter.d.ts +1 -1
- package/data_adapters/CytobandAdapter/CytobandAdapter.js +2 -6
- package/data_adapters/CytobandAdapter/configSchema.d.ts +0 -3
- package/data_adapters/CytobandAdapter/configSchema.js +1 -7
- package/data_adapters/CytobandAdapter/index.d.ts +1 -1
- package/data_adapters/CytobandAdapter/index.js +21 -8
- package/data_adapters/dataAdapterCache.d.ts +4 -22
- package/data_adapters/dataAdapterCache.js +2 -28
- package/data_adapters/util.d.ts +1 -0
- package/data_adapters/util.js +10 -0
- package/package.json +8 -11
- package/pluggableElementTypes/AdapterType.d.ts +2 -2
- package/pluggableElementTypes/AddTrackWorkflowType.d.ts +2 -2
- package/pluggableElementTypes/ConnectionType.d.ts +3 -3
- package/pluggableElementTypes/DisplayType.d.ts +3 -9
- package/pluggableElementTypes/InternetAccountType.d.ts +2 -2
- package/pluggableElementTypes/PluggableElementBase.d.ts +1 -1
- package/pluggableElementTypes/PluggableElementBase.js +2 -2
- package/pluggableElementTypes/RpcMethodType.d.ts +5 -11
- package/pluggableElementTypes/RpcMethodType.js +7 -19
- package/pluggableElementTypes/RpcMethodTypeWithFiltersAndRenameRegions.d.ts +9 -0
- package/pluggableElementTypes/RpcMethodTypeWithFiltersAndRenameRegions.js +35 -0
- package/pluggableElementTypes/TextSearchAdapterType.d.ts +2 -2
- package/pluggableElementTypes/TrackType.d.ts +3 -3
- package/pluggableElementTypes/ViewType.d.ts +3 -3
- package/pluggableElementTypes/WidgetType.d.ts +4 -3
- package/pluggableElementTypes/index.d.ts +11 -11
- package/pluggableElementTypes/models/BaseConnectionModelFactory.d.ts +2 -29
- package/pluggableElementTypes/models/BaseConnectionModelFactory.js +1 -28
- package/pluggableElementTypes/models/BaseDisplayModel.d.ts +3 -83
- package/pluggableElementTypes/models/BaseDisplayModel.js +2 -69
- package/pluggableElementTypes/models/BaseTrackModel.d.ts +4 -46
- package/pluggableElementTypes/models/BaseTrackModel.js +9 -63
- package/pluggableElementTypes/models/BaseViewModel.d.ts +2 -42
- package/pluggableElementTypes/models/BaseViewModel.js +2 -38
- package/pluggableElementTypes/models/InternetAccountModel.d.ts +3 -119
- package/pluggableElementTypes/models/InternetAccountModel.js +3 -123
- package/pluggableElementTypes/models/baseConnectionConfig.d.ts +0 -6
- package/pluggableElementTypes/models/baseConnectionConfig.js +1 -13
- package/pluggableElementTypes/models/baseInternetAccountConfig.d.ts +0 -15
- package/pluggableElementTypes/models/baseInternetAccountConfig.js +1 -23
- package/pluggableElementTypes/models/baseTrackConfig.d.ts +2 -53
- package/pluggableElementTypes/models/baseTrackConfig.js +1 -58
- package/pluggableElementTypes/renderers/BoxRendererType.d.ts +7 -15
- package/pluggableElementTypes/renderers/BoxRendererType.js +3 -14
- package/pluggableElementTypes/renderers/CircularChordRendererType.d.ts +4 -4
- package/pluggableElementTypes/renderers/CircularChordRendererType.js +3 -8
- package/pluggableElementTypes/renderers/ComparativeServerSideRendererType.d.ts +6 -21
- package/pluggableElementTypes/renderers/ComparativeServerSideRendererType.js +2 -25
- package/pluggableElementTypes/renderers/FeatureRendererType.d.ts +5 -47
- package/pluggableElementTypes/renderers/FeatureRendererType.js +15 -68
- package/pluggableElementTypes/renderers/RendererType.d.ts +5 -9
- package/pluggableElementTypes/renderers/RendererType.js +3 -7
- package/pluggableElementTypes/renderers/RpcRenderedSvgGroup.d.ts +3 -4
- package/pluggableElementTypes/renderers/RpcRenderedSvgGroup.js +11 -76
- package/pluggableElementTypes/renderers/ServerSideRenderedContent.d.ts +2 -3
- package/pluggableElementTypes/renderers/ServerSideRenderedContent.js +10 -74
- package/pluggableElementTypes/renderers/ServerSideRendererType.d.ts +9 -49
- package/pluggableElementTypes/renderers/ServerSideRendererType.js +10 -60
- package/pluggableElementTypes/renderers/index.d.ts +1 -1
- package/pluggableElementTypes/renderers/util/serializableFilterChain.js +1 -3
- package/rpc/BaseRpcDriver.d.ts +3 -4
- package/rpc/BaseRpcDriver.js +20 -80
- package/rpc/MainThreadRpcDriver.d.ts +3 -7
- package/rpc/MainThreadRpcDriver.js +0 -5
- package/rpc/RpcManager.d.ts +3 -3
- package/rpc/RpcManager.js +2 -4
- package/rpc/WebWorkerRpcDriver.d.ts +3 -2
- package/rpc/WebWorkerRpcDriver.js +2 -13
- package/rpc/baseRpcConfig.d.ts +0 -3
- package/rpc/baseRpcConfig.js +1 -7
- package/rpc/configSchema.d.ts +0 -6
- package/rpc/configSchema.js +2 -11
- package/rpc/mainThreadRpcConfig.js +1 -7
- package/rpc/methods/CoreFreeResources.d.ts +0 -6
- package/rpc/methods/CoreFreeResources.js +2 -9
- package/rpc/methods/CoreGetFeatureDensityStats.d.ts +4 -5
- package/rpc/methods/CoreGetFeatureDensityStats.js +1 -1
- package/rpc/methods/CoreGetFeatureDetails.d.ts +2 -7
- package/rpc/methods/CoreGetFeatureDetails.js +0 -5
- package/rpc/methods/CoreGetFeatures.d.ts +5 -5
- package/rpc/methods/CoreGetFeatures.js +4 -5
- package/rpc/methods/CoreGetFileInfo.d.ts +1 -2
- package/rpc/methods/CoreGetFileInfo.js +1 -1
- package/rpc/methods/CoreGetMetadata.d.ts +1 -2
- package/rpc/methods/CoreGetMetadata.js +1 -1
- package/rpc/methods/CoreGetRefNames.d.ts +1 -2
- package/rpc/methods/CoreGetRefNames.js +1 -1
- package/rpc/methods/CoreRender.d.ts +2 -6
- package/rpc/methods/CoreRender.js +5 -7
- package/rpc/methods/util.d.ts +3 -3
- package/rpc/methods/util.js +0 -1
- package/rpc/webWorkerRpcConfig.js +1 -7
- package/stories/JBrowseCore.stories.d.ts +1 -1
- package/stories/JBrowseCore.stories.js +3 -3
- package/stories/examples/WithSequencePanel.d.ts +6 -7
- package/stories/examples/WithSequencePanel.js +9 -9
- package/tsconfig.build.tsbuildinfo +1 -1
- package/ui/AppLogo.d.ts +2 -3
- package/ui/AppLogo.js +2 -7
- package/ui/AssemblySelector.d.ts +5 -5
- package/ui/AssemblySelector.js +11 -36
- package/ui/BaseTooltip.d.ts +1 -2
- package/ui/BaseTooltip.js +10 -17
- package/ui/CascadingMenu.d.ts +3 -4
- package/ui/CascadingMenu.js +18 -57
- package/ui/CascadingMenuButton.d.ts +2 -3
- package/ui/CascadingMenuButton.js +18 -42
- package/ui/ColorPicker.d.ts +3 -4
- package/ui/ColorPicker.js +33 -37
- package/ui/Dialog.d.ts +2 -3
- package/ui/Dialog.js +15 -27
- package/ui/DraggableDialog.d.ts +5 -0
- package/ui/DraggableDialog.js +32 -0
- package/ui/DropDownMenu.d.ts +2 -3
- package/ui/DropDownMenu.js +10 -36
- package/ui/EditableTypography.d.ts +2 -3
- package/ui/EditableTypography.js +30 -59
- package/ui/ErrorBoundary.d.ts +3 -2
- package/ui/ErrorBoundary.js +3 -25
- package/ui/ErrorMessage.d.ts +1 -2
- package/ui/ErrorMessage.js +27 -34
- package/ui/ErrorMessageStackTraceDialog.d.ts +1 -2
- package/ui/ErrorMessageStackTraceDialog.js +13 -54
- package/ui/FactoryResetDialog.d.ts +1 -2
- package/ui/FactoryResetDialog.js +8 -13
- package/ui/FatalErrorDialog.d.ts +1 -2
- package/ui/FatalErrorDialog.js +11 -42
- package/ui/FileSelector/FileSelector.d.ts +5 -5
- package/ui/FileSelector/FileSelector.js +41 -80
- package/ui/FileSelector/LocalFileChooser.d.ts +2 -3
- package/ui/FileSelector/LocalFileChooser.js +17 -29
- package/ui/FileSelector/UrlChooser.d.ts +5 -5
- package/ui/FileSelector/UrlChooser.js +6 -7
- package/ui/Icons.d.ts +10 -11
- package/ui/Icons.js +10 -25
- package/ui/LoadingEllipses.d.ts +2 -3
- package/ui/LoadingEllipses.js +4 -7
- package/ui/Logo.d.ts +2 -3
- package/ui/Logo.js +5 -23
- package/ui/Menu.d.ts +3 -4
- package/ui/Menu.js +85 -122
- package/ui/MenuButton.d.ts +2 -3
- package/ui/MenuButton.js +11 -35
- package/ui/PrerenderedCanvas.d.ts +1 -2
- package/ui/PrerenderedCanvas.js +3 -25
- package/ui/RedErrorMessageBox.d.ts +1 -2
- package/ui/RedErrorMessageBox.js +2 -5
- package/ui/ResizeHandle.d.ts +1 -2
- package/ui/ResizeHandle.js +5 -27
- package/ui/ReturnToImportFormDialog.d.ts +1 -2
- package/ui/ReturnToImportFormDialog.js +8 -13
- package/ui/SanitizedHTML.d.ts +2 -3
- package/ui/SanitizedHTML.js +4 -24
- package/ui/Snackbar.d.ts +3 -4
- package/ui/Snackbar.js +41 -21
- package/ui/SnackbarContents.d.ts +5 -0
- package/ui/SnackbarContents.js +16 -0
- package/ui/SnackbarModel.d.ts +1 -26
- package/ui/SnackbarModel.js +22 -39
- package/ui/colors.d.ts +1 -1
- package/ui/colors.js +2 -2
- package/ui/index.d.ts +0 -2
- package/ui/index.js +1 -5
- package/ui/react-colorful.js +17 -10
- package/ui/theme.d.ts +1 -1
- package/ui/theme.js +7 -40
- package/util/Base1DUtils.d.ts +1 -1
- package/util/Base1DUtils.js +0 -12
- package/util/Base1DViewModel.d.ts +4 -81
- package/util/Base1DViewModel.js +4 -108
- package/util/QuickLRU.js +0 -9
- package/util/TimeTraveller.js +0 -4
- package/util/aborting.d.ts +0 -20
- package/util/aborting.js +0 -31
- package/util/analytics.js +1 -12
- package/util/blockTypes.d.ts +0 -11
- package/util/blockTypes.js +0 -13
- package/util/calculateDynamicBlocks.d.ts +1 -20
- package/util/calculateDynamicBlocks.js +1 -22
- package/util/calculateStaticBlocks.d.ts +2 -2
- package/util/calculateStaticBlocks.js +0 -2
- package/util/color/cssColorsLevel4.js +0 -1
- package/util/color/index.d.ts +0 -19
- package/util/color/index.js +0 -30
- package/util/compositeMap.js +0 -2
- package/util/dedupe.js +0 -1
- package/util/formatFastaStrings.d.ts +0 -13
- package/util/formatFastaStrings.js +0 -13
- package/util/idMaker.d.ts +1 -1
- package/util/idMaker.js +16 -12
- package/util/index.d.ts +27 -173
- package/util/index.js +53 -293
- package/util/io/RemoteFileWithRangeCache.d.ts +4 -5
- package/util/io/RemoteFileWithRangeCache.js +12 -14
- package/util/io/index.d.ts +3 -4
- package/util/io/index.js +5 -19
- package/util/jexl.js +3 -13
- package/util/jexlStrings.d.ts +0 -6
- package/util/jexlStrings.js +0 -8
- package/util/layouts/BaseLayout.d.ts +1 -1
- package/util/layouts/GranularRectLayout.d.ts +1 -17
- package/util/layouts/GranularRectLayout.js +4 -81
- package/util/layouts/MultiLayout.d.ts +1 -6
- package/util/layouts/MultiLayout.js +0 -6
- package/util/layouts/PrecomputedLayout.d.ts +1 -4
- package/util/layouts/PrecomputedLayout.js +0 -5
- package/util/layouts/PrecomputedMultiLayout.js +0 -2
- package/util/layouts/SceneGraph.d.ts +0 -12
- package/util/layouts/SceneGraph.js +0 -13
- package/util/makeAbortableReaction.d.ts +2 -0
- package/util/makeAbortableReaction.js +50 -0
- package/util/map-obj.js +0 -4
- package/util/mst-reflection.d.ts +1 -14
- package/util/mst-reflection.js +1 -28
- package/util/nanoid.d.ts +1 -1
- package/util/nanoid.js +0 -31
- package/util/nextTick.d.ts +1 -0
- package/util/nextTick.js +6 -0
- package/util/offscreenCanvasPonyfill.d.ts +0 -1
- package/util/offscreenCanvasPonyfill.js +1 -9
- package/util/offscreenCanvasUtils.d.ts +2 -3
- package/util/offscreenCanvasUtils.js +22 -21
- package/util/range.d.ts +0 -25
- package/util/range.js +0 -34
- package/util/rxjs.d.ts +3 -7
- package/util/rxjs.js +2 -9
- package/util/simpleFeature.d.ts +0 -50
- package/util/simpleFeature.js +0 -35
- package/util/stats.d.ts +3 -26
- package/util/stats.js +0 -25
- package/util/stopToken.d.ts +3 -0
- package/util/stopToken.js +29 -0
- package/util/tracks.d.ts +4 -26
- package/util/tracks.js +8 -33
- package/util/types/index.d.ts +14 -30
- package/util/types/index.js +5 -14
- package/util/types/mst.js +0 -9
- package/util/types/util.d.ts +2 -9
- package/util/useMeasure.d.ts +1 -1
- package/util/useMeasure.js +0 -1
- package/util/when.d.ts +1 -15
- package/util/when.js +3 -70
- package/rpc/remoteAbortSignals.d.ts +0 -36
- package/rpc/remoteAbortSignals.js +0 -79
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
class SceneGraph {
|
|
4
|
-
/**
|
|
5
|
-
* note: all coordinates are inter-base or inter-pixel coordinates
|
|
6
|
-
*/
|
|
7
4
|
constructor(name, left, top, width, height, data) {
|
|
8
5
|
this.name = name;
|
|
9
6
|
this.left = left;
|
|
@@ -24,7 +21,6 @@ class SceneGraph {
|
|
|
24
21
|
if (this.children.has(child.name)) {
|
|
25
22
|
throw new Error(`child named "${child.name}" already exists`);
|
|
26
23
|
}
|
|
27
|
-
// update the bounds to match the child
|
|
28
24
|
child.parent = this;
|
|
29
25
|
const { left: childLeft, right: childRight, top: childTop, bottom: childBottom, } = child.absolute;
|
|
30
26
|
if (childLeft !== undefined &&
|
|
@@ -39,15 +35,6 @@ class SceneGraph {
|
|
|
39
35
|
getSubRecord(name) {
|
|
40
36
|
return this.children.get(name);
|
|
41
37
|
}
|
|
42
|
-
/**
|
|
43
|
-
* if the record does not already cover the given absolute extents, extend it
|
|
44
|
-
* to cover them
|
|
45
|
-
*
|
|
46
|
-
* @param left -
|
|
47
|
-
* @param right -
|
|
48
|
-
* @param top -
|
|
49
|
-
* @param bottom -
|
|
50
|
-
*/
|
|
51
38
|
expand(newLeft, newRight, newTop, newBottom) {
|
|
52
39
|
const { left, right, top, bottom } = this.absolute;
|
|
53
40
|
if (left !== undefined && newLeft < left) {
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import type { IReactionOptions, IReactionPublic } from 'mobx';
|
|
2
|
+
export declare function makeAbortableReaction<T, U, V>(self: T, dataFunction: (arg: T) => U, asyncReactionFunction: (arg: U | undefined, stopToken: string, model: T, handle: IReactionPublic) => Promise<V>, reactionOptions: IReactionOptions, startedFunction: (stopToken: string) => void, successFunction: (arg: V) => void, errorFunction: (err: unknown) => void): void;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.makeAbortableReaction = makeAbortableReaction;
|
|
4
|
+
const mobx_1 = require("mobx");
|
|
5
|
+
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
6
|
+
const aborting_1 = require("./aborting");
|
|
7
|
+
const stopToken_1 = require("./stopToken");
|
|
8
|
+
function makeAbortableReaction(self, dataFunction, asyncReactionFunction, reactionOptions, startedFunction, successFunction, errorFunction) {
|
|
9
|
+
let inProgress;
|
|
10
|
+
function handleError(error) {
|
|
11
|
+
if (!(0, aborting_1.isAbortException)(error)) {
|
|
12
|
+
console.error(error);
|
|
13
|
+
if ((0, mobx_state_tree_1.isAlive)(self)) {
|
|
14
|
+
errorFunction(error);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
(0, mobx_state_tree_1.addDisposer)(self, (0, mobx_1.reaction)(() => {
|
|
19
|
+
try {
|
|
20
|
+
return dataFunction(self);
|
|
21
|
+
}
|
|
22
|
+
catch (e) {
|
|
23
|
+
handleError(e);
|
|
24
|
+
return undefined;
|
|
25
|
+
}
|
|
26
|
+
}, async (data, mobxReactionHandle) => {
|
|
27
|
+
if (inProgress) {
|
|
28
|
+
(0, stopToken_1.stopStopToken)(inProgress);
|
|
29
|
+
}
|
|
30
|
+
if (!(0, mobx_state_tree_1.isAlive)(self)) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
inProgress = (0, stopToken_1.createStopToken)();
|
|
34
|
+
startedFunction(inProgress);
|
|
35
|
+
try {
|
|
36
|
+
const result = await asyncReactionFunction(data, inProgress, self, mobxReactionHandle);
|
|
37
|
+
if ((0, mobx_state_tree_1.isAlive)(self)) {
|
|
38
|
+
successFunction(result);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
catch (e) {
|
|
42
|
+
handleError(e);
|
|
43
|
+
}
|
|
44
|
+
}, reactionOptions));
|
|
45
|
+
(0, mobx_state_tree_1.addDisposer)(self, () => {
|
|
46
|
+
if (inProgress) {
|
|
47
|
+
(0, stopToken_1.stopStopToken)(inProgress);
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
}
|
package/util/map-obj.js
CHANGED
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.default = map;
|
|
4
|
-
// adapted from map-obj (MIT), with modifications to pass the "whole object"
|
|
5
|
-
// from an array of objects into itself
|
|
6
4
|
const isObject = (value) => typeof value === 'object' && value !== null;
|
|
7
|
-
// Customized for this use-case
|
|
8
5
|
const isObjectCustom = (value) => isObject(value) &&
|
|
9
6
|
!(value instanceof RegExp) &&
|
|
10
7
|
!(value instanceof Error) &&
|
|
11
8
|
!(value instanceof Date) &&
|
|
12
|
-
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
13
9
|
!(globalThis.Blob && value instanceof globalThis.Blob);
|
|
14
10
|
function map(object, mapper, isSeen = new WeakSet()) {
|
|
15
11
|
if (isSeen.has(object)) {
|
package/util/mst-reflection.d.ts
CHANGED
|
@@ -1,24 +1,11 @@
|
|
|
1
|
-
import { IAnyType, IModelReflectionPropertiesData,
|
|
1
|
+
import type { IAnyComplexType, IAnyType, IModelReflectionPropertiesData, ISimpleType, UnionStringArray } from 'mobx-state-tree';
|
|
2
2
|
export interface ILiteralType<T> extends ISimpleType<T> {
|
|
3
3
|
value: T;
|
|
4
4
|
}
|
|
5
|
-
/**
|
|
6
|
-
* get the inner type of an MST optional, array, or late type object
|
|
7
|
-
*/
|
|
8
5
|
export declare function getSubType(type: IAnyType): IAnyType;
|
|
9
|
-
/**
|
|
10
|
-
* get the array of the subtypes in a union
|
|
11
|
-
*/
|
|
12
6
|
export declare function getUnionSubTypes(unionType: IAnyType): IAnyType[];
|
|
13
|
-
/**
|
|
14
|
-
* get the type of one of the properties of the given MST model type
|
|
15
|
-
*/
|
|
16
7
|
export declare function getPropertyType(type: IModelReflectionPropertiesData, propertyName: string): IAnyType;
|
|
17
|
-
/**
|
|
18
|
-
* get the base type from inside an MST optional type
|
|
19
|
-
*/
|
|
20
8
|
export declare function getDefaultValue(type: IAnyType): any;
|
|
21
9
|
export type IEnumerationType<T extends string> = ISimpleType<UnionStringArray<T[]>>;
|
|
22
|
-
/** get the string values of an MST enumeration type */
|
|
23
10
|
export declare function getEnumerationValues(type: IAnyComplexType): string[];
|
|
24
11
|
export declare function resolveLateType(maybeLate: IAnyType): any;
|
package/util/mst-reflection.js
CHANGED
|
@@ -7,82 +7,55 @@ exports.getDefaultValue = getDefaultValue;
|
|
|
7
7
|
exports.getEnumerationValues = getEnumerationValues;
|
|
8
8
|
exports.resolveLateType = resolveLateType;
|
|
9
9
|
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
10
|
-
/**
|
|
11
|
-
* get the inner type of an MST optional, array, or late type object
|
|
12
|
-
*/
|
|
13
10
|
function getSubType(type) {
|
|
14
11
|
let t;
|
|
15
12
|
if ((0, mobx_state_tree_1.isOptionalType)(type)) {
|
|
16
|
-
// @ts-expect-error
|
|
17
13
|
t = type._subtype || type.type;
|
|
18
14
|
}
|
|
19
15
|
else if ((0, mobx_state_tree_1.isArrayType)(type) || (0, mobx_state_tree_1.isMapType)(type)) {
|
|
20
|
-
// @ts-expect-error
|
|
21
16
|
t = type._subtype || type._subType || type.subType;
|
|
22
|
-
// @ts-expect-error
|
|
23
17
|
}
|
|
24
18
|
else if (typeof type.getSubType === 'function') {
|
|
25
|
-
// @ts-expect-error
|
|
26
19
|
return type.getSubType();
|
|
27
20
|
}
|
|
28
21
|
else {
|
|
29
22
|
throw new TypeError('unsupported mst type');
|
|
30
23
|
}
|
|
31
|
-
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
32
24
|
if (!t) {
|
|
33
25
|
throw new Error('failed to get subtype');
|
|
34
26
|
}
|
|
35
27
|
return t;
|
|
36
28
|
}
|
|
37
|
-
/**
|
|
38
|
-
* get the array of the subtypes in a union
|
|
39
|
-
*/
|
|
40
29
|
function getUnionSubTypes(unionType) {
|
|
41
30
|
if (!(0, mobx_state_tree_1.isUnionType)(unionType)) {
|
|
42
31
|
throw new TypeError('not an MST union type');
|
|
43
32
|
}
|
|
44
|
-
const t =
|
|
45
|
-
// @ts-expect-error
|
|
46
|
-
unionType._types ||
|
|
47
|
-
// @ts-expect-error
|
|
33
|
+
const t = unionType._types ||
|
|
48
34
|
unionType.types ||
|
|
49
|
-
// @ts-expect-error
|
|
50
35
|
getSubType(unionType)._types ||
|
|
51
|
-
// @ts-expect-error
|
|
52
36
|
getSubType(unionType).types;
|
|
53
37
|
if (!t) {
|
|
54
|
-
// debugger
|
|
55
38
|
throw new Error('failed to extract subtypes from mst union');
|
|
56
39
|
}
|
|
57
40
|
return t;
|
|
58
41
|
}
|
|
59
|
-
/**
|
|
60
|
-
* get the type of one of the properties of the given MST model type
|
|
61
|
-
*/
|
|
62
42
|
function getPropertyType(type, propertyName) {
|
|
63
43
|
return type.properties[propertyName];
|
|
64
44
|
}
|
|
65
|
-
/**
|
|
66
|
-
* get the base type from inside an MST optional type
|
|
67
|
-
*/
|
|
68
45
|
function getDefaultValue(type) {
|
|
69
46
|
if (!(0, mobx_state_tree_1.isOptionalType)(type)) {
|
|
70
47
|
throw new TypeError('type must be an optional type');
|
|
71
48
|
}
|
|
72
|
-
// @ts-expect-error
|
|
73
49
|
return type._defaultValue || type.defaultValue;
|
|
74
50
|
}
|
|
75
|
-
/** get the string values of an MST enumeration type */
|
|
76
51
|
function getEnumerationValues(type) {
|
|
77
52
|
const subtypes = getUnionSubTypes(type);
|
|
78
|
-
// the subtypes should all be literals with a value member
|
|
79
53
|
return subtypes.map(t => t.value);
|
|
80
54
|
}
|
|
81
55
|
function resolveLateType(maybeLate) {
|
|
82
56
|
if (!(0, mobx_state_tree_1.isUnionType)(maybeLate) &&
|
|
83
57
|
!(0, mobx_state_tree_1.isArrayType)(maybeLate) &&
|
|
84
58
|
(0, mobx_state_tree_1.isLateType)(maybeLate)) {
|
|
85
|
-
// @ts-expect-error
|
|
86
59
|
return maybeLate.getSubType();
|
|
87
60
|
}
|
|
88
61
|
return maybeLate;
|
package/util/nanoid.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export const urlAlphabet: "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
2
|
-
export function random(bytes: any): Uint8Array
|
|
2
|
+
export function random(bytes: any): Uint8Array<any>;
|
|
3
3
|
export function customRandom(alphabet: any, defaultSize: any, getRandom: any): (size?: any) => string;
|
|
4
4
|
export function customAlphabet(alphabet: any, size?: number): (size?: any) => string;
|
|
5
5
|
export function nanoid(size?: number): string;
|
package/util/nanoid.js
CHANGED
|
@@ -1,42 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// This file replaces `index.js` in bundlers like webpack or Rollup,
|
|
3
|
-
// according to `browser` config in `package.json`.
|
|
4
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
3
|
exports.nanoid = exports.customAlphabet = exports.customRandom = exports.random = exports.urlAlphabet = void 0;
|
|
6
|
-
// This alphabet uses `A-Za-z0-9_-` symbols.
|
|
7
|
-
// The order of characters is optimized for better gzip and brotli compression.
|
|
8
|
-
// Same as in non-secure/index.js
|
|
9
4
|
exports.urlAlphabet = 'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict';
|
|
10
5
|
const random = bytes => crypto.getRandomValues(new Uint8Array(bytes));
|
|
11
6
|
exports.random = random;
|
|
12
7
|
const customRandom = (alphabet, defaultSize, getRandom) => {
|
|
13
|
-
// First, a bitmask is necessary to generate the ID. The bitmask makes bytes
|
|
14
|
-
// values closer to the alphabet size. The bitmask calculates the closest
|
|
15
|
-
// `2^31 - 1` number, which exceeds the alphabet size.
|
|
16
|
-
// For example, the bitmask for the alphabet size 30 is 31 (00011111).
|
|
17
|
-
// `Math.clz32` is not used, because it is not available in browsers.
|
|
18
8
|
const mask = (2 << (Math.log(alphabet.length - 1) / Math.LN2)) - 1;
|
|
19
|
-
// Though, the bitmask solution is not perfect since the bytes exceeding
|
|
20
|
-
// the alphabet size are refused. Therefore, to reliably generate the ID,
|
|
21
|
-
// the random bytes redundancy has to be satisfied.
|
|
22
|
-
// Note: every hardware random generator call is performance expensive,
|
|
23
|
-
// because the system call for entropy collection takes a lot of time.
|
|
24
|
-
// So, to avoid additional system calls, extra bytes are requested in advance.
|
|
25
|
-
// Next, a step determines how many random bytes to generate.
|
|
26
|
-
// The number of random bytes gets decided upon the ID size, mask,
|
|
27
|
-
// alphabet size, and magic number 1.6 (using 1.6 peaks at performance
|
|
28
|
-
// according to benchmarks).
|
|
29
|
-
// `-~f => Math.ceil(f)` if f is a float
|
|
30
|
-
// `-~i => i + 1` if i is an integer
|
|
31
9
|
const step = -~((1.6 * mask * defaultSize) / alphabet.length);
|
|
32
10
|
return (size = defaultSize) => {
|
|
33
11
|
let id = '';
|
|
34
12
|
while (true) {
|
|
35
13
|
const bytes = getRandom(step);
|
|
36
|
-
// A compact alternative for `for (var i = 0; i < step; i++)`.
|
|
37
14
|
let j = step;
|
|
38
15
|
while (j--) {
|
|
39
|
-
// Adding `|| ''` refuses a random byte that exceeds the alphabet size.
|
|
40
16
|
id += alphabet[bytes[j] & mask] || '';
|
|
41
17
|
if (id.length === size) {
|
|
42
18
|
return id;
|
|
@@ -49,18 +25,11 @@ exports.customRandom = customRandom;
|
|
|
49
25
|
const customAlphabet = (alphabet, size = 21) => (0, exports.customRandom)(alphabet, size, exports.random);
|
|
50
26
|
exports.customAlphabet = customAlphabet;
|
|
51
27
|
const nanoid = (size = 21) => crypto.getRandomValues(new Uint8Array(size)).reduce((id, byte) => {
|
|
52
|
-
// It is incorrect to use bytes exceeding the alphabet size.
|
|
53
|
-
// The following mask reduces the random byte in the 0-255 value
|
|
54
|
-
// range to the 0-63 value range. Therefore, adding hacks, such
|
|
55
|
-
// as empty string fallback or magic numbers, is unnecessary because
|
|
56
|
-
// the bitmask trims bytes down to the alphabet size.
|
|
57
28
|
byte &= 63;
|
|
58
29
|
if (byte < 36) {
|
|
59
|
-
// `0-9a-z`
|
|
60
30
|
id += byte.toString(36);
|
|
61
31
|
}
|
|
62
32
|
else if (byte < 62) {
|
|
63
|
-
// `A-Z`
|
|
64
33
|
id += (byte - 26).toString(36).toUpperCase();
|
|
65
34
|
}
|
|
66
35
|
else if (byte > 62) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function nextTickMod(): Promise<unknown>;
|
package/util/nextTick.js
ADDED
|
@@ -2,7 +2,6 @@ type AbstractCanvas = any;
|
|
|
2
2
|
type AbstractImageBitmap = any;
|
|
3
3
|
export declare let createCanvas: (width: number, height: number) => AbstractCanvas;
|
|
4
4
|
export declare let createImageBitmap: (canvas: AbstractCanvas) => Promise<AbstractImageBitmap>;
|
|
5
|
-
/** the JS class (constructor) for offscreen-generated image bitmap data */
|
|
6
5
|
export declare let ImageBitmapType: unknown;
|
|
7
6
|
export declare function drawImageOntoCanvasContext(imageData: any, context: CanvasRenderingContext2D): void;
|
|
8
7
|
export {};
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/* eslint-disable react-refresh/only-export-components */
|
|
3
|
-
// This file is a ponyfill for the HTML5 OffscreenCanvas API.
|
|
4
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
5
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
6
4
|
};
|
|
7
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
6
|
exports.ImageBitmapType = exports.createImageBitmap = exports.createCanvas = void 0;
|
|
9
7
|
exports.drawImageOntoCanvasContext = drawImageOntoCanvasContext;
|
|
10
|
-
const detect_node_1 = __importDefault(require("detect-node"));
|
|
11
8
|
const canvas_sequencer_1 = require("canvas-sequencer");
|
|
9
|
+
const detect_node_1 = __importDefault(require("detect-node"));
|
|
12
10
|
function drawImageOntoCanvasContext(imageData, context) {
|
|
13
11
|
if (imageData.serializedCommands) {
|
|
14
12
|
const seq = new canvas_sequencer_1.CanvasSequence(imageData.serializedCommands);
|
|
@@ -24,23 +22,17 @@ const weHave = {
|
|
|
24
22
|
};
|
|
25
23
|
if (weHave.realOffscreenCanvas) {
|
|
26
24
|
exports.createCanvas = (width, height) => new OffscreenCanvas(width, height);
|
|
27
|
-
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
28
25
|
exports.createImageBitmap = window.createImageBitmap || self.createImageBitmap;
|
|
29
|
-
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
30
26
|
exports.ImageBitmapType = window.ImageBitmap || self.ImageBitmap;
|
|
31
27
|
}
|
|
32
28
|
else if (weHave.node) {
|
|
33
|
-
// use node-canvas if we are running in node (i.e. automated tests)
|
|
34
29
|
exports.createCanvas = (...args) => {
|
|
35
|
-
// @ts-expect-error
|
|
36
30
|
return nodeCreateCanvas(...args);
|
|
37
31
|
};
|
|
38
32
|
exports.createImageBitmap = async (canvas) => {
|
|
39
33
|
const dataUri = canvas.toDataURL();
|
|
40
|
-
// @ts-expect-error
|
|
41
34
|
const img = new nodeImage();
|
|
42
35
|
return new Promise((resolve, reject) => {
|
|
43
|
-
// need onload for jest
|
|
44
36
|
img.onload = () => {
|
|
45
37
|
resolve(img);
|
|
46
38
|
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
export type RenderReturn = Record<string, unknown> | undefined;
|
|
3
2
|
type RendererRet = Promise<RenderReturn> | RenderReturn;
|
|
4
3
|
export declare function renderToAbstractCanvas(width: number, height: number, opts: {
|
|
@@ -10,7 +9,7 @@ export declare function renderToAbstractCanvas(width: number, height: number, op
|
|
|
10
9
|
}, cb: (ctx: CanvasRenderingContext2D) => RendererRet): Promise<{
|
|
11
10
|
canvasRecordedData: any;
|
|
12
11
|
} | {
|
|
13
|
-
reactElement:
|
|
12
|
+
reactElement: import("react/jsx-runtime").JSX.Element;
|
|
14
13
|
} | {
|
|
15
14
|
imageData: any;
|
|
16
15
|
}>;
|
|
@@ -24,5 +23,5 @@ export declare function ReactRendering({ rendering, }: {
|
|
|
24
23
|
reactElement?: React.ReactNode;
|
|
25
24
|
html?: string;
|
|
26
25
|
};
|
|
27
|
-
}):
|
|
26
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
28
27
|
export {};
|
|
@@ -15,26 +15,32 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
28
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
36
|
exports.renderToAbstractCanvas = renderToAbstractCanvas;
|
|
30
37
|
exports.getSerializedSvg = getSerializedSvg;
|
|
31
38
|
exports.ReactRendering = ReactRendering;
|
|
32
|
-
|
|
33
|
-
const react_1 =
|
|
39
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
40
|
+
const react_1 = require("react");
|
|
34
41
|
const canvas_sequencer_1 = require("canvas-sequencer");
|
|
35
|
-
// locals
|
|
36
|
-
const offscreenCanvasPonyfill_1 = require("./offscreenCanvasPonyfill");
|
|
37
42
|
const blobToDataURL_1 = require("./blobToDataURL");
|
|
43
|
+
const offscreenCanvasPonyfill_1 = require("./offscreenCanvasPonyfill");
|
|
38
44
|
async function renderToAbstractCanvas(width, height, opts, cb) {
|
|
39
45
|
const { exportSVG, highResolutionScaling = 1 } = opts;
|
|
40
46
|
if (exportSVG) {
|
|
@@ -55,11 +61,9 @@ async function renderToAbstractCanvas(width, height, opts, cb) {
|
|
|
55
61
|
}
|
|
56
62
|
ctx.scale(s, s);
|
|
57
63
|
const result = await cb(ctx);
|
|
58
|
-
// two methods needed for converting canvas to PNG, one for webworker
|
|
59
|
-
// offscreen canvas, one for main thread
|
|
60
64
|
return {
|
|
61
65
|
...result,
|
|
62
|
-
reactElement: (
|
|
66
|
+
reactElement: ((0, jsx_runtime_1.jsx)("image", { width: width, height: height, xlinkHref: 'convertToBlob' in canvas
|
|
63
67
|
? await (0, blobToDataURL_1.blobToDataURL)(await canvas.convertToBlob({
|
|
64
68
|
type: 'image/png',
|
|
65
69
|
}))
|
|
@@ -81,15 +85,12 @@ async function renderToAbstractCanvas(width, height, opts, cb) {
|
|
|
81
85
|
}
|
|
82
86
|
async function getSerializedSvg(results) {
|
|
83
87
|
const { width, height, canvasRecordedData } = results;
|
|
84
|
-
// @ts-ignore needs to be ignore not expect error, produces error in build step
|
|
85
88
|
const C2S = await Promise.resolve().then(() => __importStar(require('canvas2svg')));
|
|
86
89
|
const ctx = new C2S.default(width, height);
|
|
87
90
|
const seq = new canvas_sequencer_1.CanvasSequence(canvasRecordedData);
|
|
88
91
|
seq.execute(ctx);
|
|
89
|
-
// innerHTML strips the outer <svg> element from returned data, we add
|
|
90
|
-
// our own <svg> element in the view's SVG export
|
|
91
92
|
return ctx.getSvg().innerHTML;
|
|
92
93
|
}
|
|
93
94
|
function ReactRendering({ rendering, }) {
|
|
94
|
-
return react_1.
|
|
95
|
+
return (0, react_1.isValidElement)(rendering.reactElement) ? (rendering.reactElement) : ((0, jsx_runtime_1.jsx)("g", { dangerouslySetInnerHTML: { __html: rendering.html || '' } }));
|
|
95
96
|
}
|
package/util/range.d.ts
CHANGED
|
@@ -1,28 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* fast low-level intersection of 2 coordinate ranges. assumes interbase coordinates.
|
|
3
|
-
*
|
|
4
|
-
* assumes `left <= right` for both ranges
|
|
5
|
-
*
|
|
6
|
-
* @returns array of [left, right], or [] if the ranges do not intersect. the choice of [] is because it allows destructuring array assignment without check for undefined return
|
|
7
|
-
*/
|
|
8
1
|
export declare function intersection2(left1: number, right1: number, left2: number, right2: number): [number, number] | [];
|
|
9
|
-
/**
|
|
10
|
-
* Return whether 2 interbase coordinate ranges intersect.
|
|
11
|
-
*
|
|
12
|
-
* @param left1 -
|
|
13
|
-
* @param right1 -
|
|
14
|
-
* @param left2 -
|
|
15
|
-
* @param right2 -
|
|
16
|
-
*
|
|
17
|
-
* @returns true if the two ranges intersect
|
|
18
|
-
*/
|
|
19
2
|
export declare function doesIntersect2(left1: number, right1: number, left2: number, right2: number): boolean;
|
|
20
|
-
/**
|
|
21
|
-
* Return whether the first region is completely contained within the second region
|
|
22
|
-
*
|
|
23
|
-
* @param left1 - candidate inner region left
|
|
24
|
-
* @param right1 - candidate inner region right
|
|
25
|
-
* @param left2 - candidate outer region left
|
|
26
|
-
* @param right2 - candidate outer region right
|
|
27
|
-
*/
|
|
28
3
|
export declare function isContainedWithin(left1: number, right1: number, left2: number, right2: number): boolean;
|
package/util/range.js
CHANGED
|
@@ -3,58 +3,24 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.intersection2 = intersection2;
|
|
4
4
|
exports.doesIntersect2 = doesIntersect2;
|
|
5
5
|
exports.isContainedWithin = isContainedWithin;
|
|
6
|
-
/**
|
|
7
|
-
* fast low-level intersection of 2 coordinate ranges. assumes interbase coordinates.
|
|
8
|
-
*
|
|
9
|
-
* assumes `left <= right` for both ranges
|
|
10
|
-
*
|
|
11
|
-
* @returns array of [left, right], or [] if the ranges do not intersect. the choice of [] is because it allows destructuring array assignment without check for undefined return
|
|
12
|
-
*/
|
|
13
6
|
function intersection2(left1, right1, left2, right2) {
|
|
14
|
-
// this code is verbose because "if" statements are faster than Math.min and Math.max
|
|
15
7
|
if (right1 > left2 && left1 < right2 && right2 - left2 && right1 - left1) {
|
|
16
8
|
if (left1 > left2) {
|
|
17
9
|
if (right1 < right2) {
|
|
18
|
-
// 1 |-------|
|
|
19
|
-
// |------------|
|
|
20
10
|
return [left1, right1];
|
|
21
11
|
}
|
|
22
|
-
// 2 |----|
|
|
23
|
-
// |------|
|
|
24
12
|
return [left1, right2];
|
|
25
13
|
}
|
|
26
14
|
if (right1 < right2) {
|
|
27
|
-
// 3 |-----|
|
|
28
|
-
// |------|
|
|
29
15
|
return [left2, right1];
|
|
30
16
|
}
|
|
31
|
-
// 4 |------------|
|
|
32
|
-
// |-------|
|
|
33
17
|
return [left2, right2];
|
|
34
18
|
}
|
|
35
19
|
return [];
|
|
36
20
|
}
|
|
37
|
-
/**
|
|
38
|
-
* Return whether 2 interbase coordinate ranges intersect.
|
|
39
|
-
*
|
|
40
|
-
* @param left1 -
|
|
41
|
-
* @param right1 -
|
|
42
|
-
* @param left2 -
|
|
43
|
-
* @param right2 -
|
|
44
|
-
*
|
|
45
|
-
* @returns true if the two ranges intersect
|
|
46
|
-
*/
|
|
47
21
|
function doesIntersect2(left1, right1, left2, right2) {
|
|
48
22
|
return right1 > left2 && left1 < right2;
|
|
49
23
|
}
|
|
50
|
-
/**
|
|
51
|
-
* Return whether the first region is completely contained within the second region
|
|
52
|
-
*
|
|
53
|
-
* @param left1 - candidate inner region left
|
|
54
|
-
* @param right1 - candidate inner region right
|
|
55
|
-
* @param left2 - candidate outer region left
|
|
56
|
-
* @param right2 - candidate outer region right
|
|
57
|
-
*/
|
|
58
24
|
function isContainedWithin(left1, right1, left2, right2) {
|
|
59
25
|
return left2 <= left1 && right2 >= right1;
|
|
60
26
|
}
|
package/util/rxjs.d.ts
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import { Observable
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
* aborting support
|
|
5
|
-
* @param func - observer function, could be async
|
|
6
|
-
*/
|
|
7
|
-
export declare function ObservableCreate<T>(func: (arg: Observer<T>) => void | Promise<void>, signal?: AbortSignal): Observable<T>;
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
import type { Observer } from 'rxjs';
|
|
3
|
+
export declare function ObservableCreate<T>(func: (arg: Observer<T>) => void | Promise<void>, _stopToken?: string): Observable<T>;
|
package/util/rxjs.js
CHANGED
|
@@ -2,14 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ObservableCreate = ObservableCreate;
|
|
4
4
|
const rxjs_1 = require("rxjs");
|
|
5
|
-
|
|
6
|
-
const _1 = require(".");
|
|
7
|
-
/**
|
|
8
|
-
* Wrapper for rxjs Observable.create with improved error handling and
|
|
9
|
-
* aborting support
|
|
10
|
-
* @param func - observer function, could be async
|
|
11
|
-
*/
|
|
12
|
-
function ObservableCreate(func, signal) {
|
|
5
|
+
function ObservableCreate(func, _stopToken) {
|
|
13
6
|
return new rxjs_1.Observable((observer) => {
|
|
14
7
|
try {
|
|
15
8
|
const ret = func(observer);
|
|
@@ -22,5 +15,5 @@ function ObservableCreate(func, signal) {
|
|
|
22
15
|
catch (error) {
|
|
23
16
|
observer.error(error);
|
|
24
17
|
}
|
|
25
|
-
})
|
|
18
|
+
});
|
|
26
19
|
}
|
package/util/simpleFeature.d.ts
CHANGED
|
@@ -1,39 +1,17 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Abstract feature object
|
|
3
|
-
*/
|
|
4
1
|
export interface Feature {
|
|
5
|
-
/**
|
|
6
|
-
* Get a piece of data about the feature. All features must have
|
|
7
|
-
* 'start' and 'end', but everything else is optional.
|
|
8
|
-
*/
|
|
9
2
|
get(name: 'refName'): string;
|
|
10
3
|
get(name: 'start' | 'end'): number;
|
|
11
4
|
get(name: 'subfeatures'): Feature[] | undefined;
|
|
12
5
|
get(name: string): any;
|
|
13
|
-
/**
|
|
14
|
-
* Get the unique ID of this feature.
|
|
15
|
-
*/
|
|
16
6
|
id(): string;
|
|
17
|
-
/**
|
|
18
|
-
* Get this feature's parent feature, or undefined if none.
|
|
19
|
-
*/
|
|
20
7
|
parent(): Feature | undefined;
|
|
21
|
-
/**
|
|
22
|
-
* Get an array of child features, or undefined if none.
|
|
23
|
-
*/
|
|
24
8
|
children(): Feature[] | undefined;
|
|
25
|
-
/**
|
|
26
|
-
* Convert to JSON
|
|
27
|
-
*/
|
|
28
9
|
toJSON(): SimpleFeatureSerialized;
|
|
29
10
|
}
|
|
30
11
|
export declare function isFeature(thing: unknown): thing is Feature;
|
|
31
12
|
export interface SimpleFeatureArgs {
|
|
32
|
-
/** key-value data, must include 'start' and 'end' */
|
|
33
13
|
data: Record<string, unknown>;
|
|
34
|
-
/** optional parent feature */
|
|
35
14
|
parent?: Feature;
|
|
36
|
-
/** unique identifier. can also be in data.uniqueId */
|
|
37
15
|
id: string | number;
|
|
38
16
|
}
|
|
39
17
|
export interface SimpleFeatureSerializedNoId {
|
|
@@ -49,45 +27,17 @@ export interface SimpleFeatureSerialized extends SimpleFeatureSerializedNoId {
|
|
|
49
27
|
subfeatures?: SimpleFeatureSerializedNoId[];
|
|
50
28
|
uniqueId: string;
|
|
51
29
|
}
|
|
52
|
-
/**
|
|
53
|
-
* Simple implementation of a feature object.
|
|
54
|
-
*/
|
|
55
30
|
export default class SimpleFeature implements Feature {
|
|
56
31
|
private data;
|
|
57
32
|
private subfeatures?;
|
|
58
33
|
private parentHandle?;
|
|
59
34
|
private uniqueId;
|
|
60
|
-
/**
|
|
61
|
-
* @param args - SimpleFeature args
|
|
62
|
-
*
|
|
63
|
-
* Note: args.data.subfeatures can be an array of these same args,
|
|
64
|
-
* which will be inflated to more instances of this class.
|
|
65
|
-
*/
|
|
66
35
|
constructor(args: SimpleFeatureArgs | SimpleFeatureSerialized);
|
|
67
|
-
/**
|
|
68
|
-
* Get a piece of data about the feature. All features must have
|
|
69
|
-
* 'start' and 'end', but everything else is optional.
|
|
70
|
-
*/
|
|
71
36
|
get(name: string): any;
|
|
72
|
-
/**
|
|
73
|
-
* Set an item of data.
|
|
74
|
-
*/
|
|
75
37
|
set(name: string, val: any): void;
|
|
76
|
-
/**
|
|
77
|
-
* Get an array listing which data keys are present in this feature.
|
|
78
|
-
*/
|
|
79
38
|
tags(): string[];
|
|
80
|
-
/**
|
|
81
|
-
* Get the unique ID of this feature.
|
|
82
|
-
*/
|
|
83
39
|
id(): string;
|
|
84
|
-
/**
|
|
85
|
-
* Get this feature's parent feature, or undefined if none.
|
|
86
|
-
*/
|
|
87
40
|
parent(): Feature | undefined;
|
|
88
|
-
/**
|
|
89
|
-
* Get an array of child features, or undefined if none.
|
|
90
|
-
*/
|
|
91
41
|
children(): Feature[] | undefined;
|
|
92
42
|
toJSON(): SimpleFeatureSerialized;
|
|
93
43
|
static fromJSON(json: SimpleFeatureSerialized): SimpleFeature;
|