exb-camviewer 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,3 +1,8 @@
1
+ [![npm version][npm-img]][npm-url]
2
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://raw.githubusercontent.com/SunshineLuke90/widgets/master/CamViewer/LICENSE.md)
3
+
4
+ [npm-img]: https://img.shields.io/npm/v/exb-camviewer.svg?style=flat
5
+ [npm-url]: https://www.npmjs.com/package/exb-camviewer
1
6
  # CamViewer Widget
2
7
 
3
8
  This is a simple widget to view .m3u8 streams using a url field in a feature layer. The widget appears as a button, which when clicked will turn on the "camera" layer, and when a camera is clicked a popup video stream will appear to start streaming the live camera feed.
package/manifest.json CHANGED
@@ -6,7 +6,6 @@
6
6
  "exbVersion": "1.18.0",
7
7
  "author": "Lucius Creamer",
8
8
  "description": "This widget allows users to view and interact with camera feeds in a map context.",
9
- "copyright": "",
10
9
  "dependency": [
11
10
  "jimu-arcgis"
12
11
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "exb-camviewer",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "A camera viewer, to view .m3u8 streams via a url in a feature layer.",
5
5
  "license": "MIT",
6
6
  "author": "Lucius Creamer",
@@ -3,6 +3,7 @@ import type { IMConfig } from '../config'
3
3
  import defaultMessages from './translations/default'
4
4
  import { JimuMapViewComponent, type JimuMapView, type JimuLayerView } from 'jimu-arcgis'
5
5
  import { Button, Icon } from 'jimu-ui'
6
+ // @ts-expect-error - No types available for this package
6
7
  import './style.css'
7
8
  import { useCallback, useState } from 'react'
8
9
  import { createPortal } from 'react-dom'
@@ -11,7 +12,7 @@ import { createPortal } from 'react-dom'
11
12
  // Run npm install hls.js in your client directory to install.
12
13
  import Hls from 'hls.js'
13
14
 
14
- export default function Widget(props: AllWidgetProps<IMConfig>) {
15
+ export default function Widget (props: AllWidgetProps<IMConfig>) {
15
16
  const { useDataSources, useMapWidgetIds } = props
16
17
  const [jimuMapView, setJimuMapView] = React.useState<JimuMapView>(null)
17
18
 
@@ -42,11 +43,10 @@ export default function Widget(props: AllWidgetProps<IMConfig>) {
42
43
  setCurrentURL(url)
43
44
  setShowVideo(true)
44
45
  }
45
- return null
46
46
  }
47
47
 
48
48
  // Draggable, resizable, closable video portal
49
- const handleMouseMove = (e) => {
49
+ const handleMouseMove = (e: MouseEvent) => {
50
50
  if (dragging) {
51
51
  setVideoPos({ x: e.clientX - dragOffset.x, y: e.clientY - dragOffset.y })
52
52
  } else if (resizing) {
@@ -18,7 +18,7 @@ import {
18
18
  } from "jimu-ui/advanced/data-source-selector"
19
19
  import { IconPicker } from "jimu-ui/advanced/resource-selector"
20
20
 
21
- export default function Setting(props: AllWidgetSettingProps<IMConfig>) {
21
+ export default function Setting (props: AllWidgetSettingProps<IMConfig>) {
22
22
  const onMapSelected = (useMapWidgetIds: string[]) => {
23
23
  props.onSettingChange({
24
24
  id: props.id,
@@ -47,7 +47,7 @@ export default function Setting(props: AllWidgetSettingProps<IMConfig>) {
47
47
  })
48
48
  }
49
49
 
50
- const onIconChange = (icon) => {
50
+ const onIconChange = (icon: any) => {
51
51
  props.onSettingChange({
52
52
  id: props.id,
53
53
  config: {
@@ -77,7 +77,7 @@ export default function Setting(props: AllWidgetSettingProps<IMConfig>) {
77
77
  </SettingRow>
78
78
  <SettingRow>
79
79
  <DataSourceSelector
80
- types={Immutable([DataSourceTypes.FeatureLayer])}
80
+ types={Immutable.from([DataSourceTypes.FeatureLayer])}
81
81
  mustUseDataSource={true}
82
82
  useDataSources={props.useDataSources}
83
83
  useDataSourcesEnabled={props.useDataSourcesEnabled}