|
|
@@ -5,31 +5,44 @@ import {
|
|
|
} from '@/constant'
|
|
|
import { WidgetType } from './constant'
|
|
|
import widgetCanvas from './config-json/canvas'
|
|
|
-import widgetText from './config-json/text'
|
|
|
-import widgetMarquee from './config-json/marquee'
|
|
|
import widgetMedia from './config-json/media'
|
|
|
import widgetImage from './config-json/image'
|
|
|
import widgetVideo from './config-json/video'
|
|
|
+import widgetLive from './config-json/live'
|
|
|
+import widgetText from './config-json/text'
|
|
|
+import widgetMarquee from './config-json/marquee'
|
|
|
import widgetTime from './config-json/time'
|
|
|
import widgetWeather from './config-json/weather'
|
|
|
import widgetWeb from './config-json/web'
|
|
|
-import widgetLive from './config-json/live'
|
|
|
|
|
|
export const widgets = Object.freeze([
|
|
|
widgetMedia,
|
|
|
+ widgetLive,
|
|
|
widgetText,
|
|
|
widgetMarquee,
|
|
|
widgetTime,
|
|
|
__STAGING__ ? widgetWeather : null,
|
|
|
- widgetWeb,
|
|
|
- widgetLive
|
|
|
+ widgetWeb
|
|
|
].filter(Boolean))
|
|
|
|
|
|
+export function isMediaWidget (type) {
|
|
|
+ switch (type) {
|
|
|
+ case WidgetType.MEDIA:
|
|
|
+ case WidgetType.IMAGE:
|
|
|
+ case WidgetType.VIDEO:
|
|
|
+ case WidgetType.LIVE:
|
|
|
+ case WidgetType.WEB:
|
|
|
+ return true
|
|
|
+ default:
|
|
|
+ return false
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
const supportWidgets = Object.freeze([
|
|
|
...widgets,
|
|
|
widgetImage,
|
|
|
widgetVideo
|
|
|
-].filter(Boolean))
|
|
|
+])
|
|
|
|
|
|
let scale = null
|
|
|
export function create (node) {
|