@dolphinweex/weex-vue-render 0.2.6 → 0.2.8

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.
@@ -3985,7 +3985,7 @@ function initEnv (viewportInfo, envInfo) {
3985
3985
  osName: osName,
3986
3986
  osVersion: osVersion,
3987
3987
 
3988
- deviceModel: device_display.deviceModel || null,
3988
+ deviceModel: device_display.deviceModel || "",
3989
3989
  appEnv: device_display.appEnv,
3990
3990
  versionCode: device_display.versionCode,
3991
3991
  idfa: device_display.idfa,
@@ -3994,7 +3994,7 @@ function initEnv (viewportInfo, envInfo) {
3994
3994
  osName: device_display.osName,
3995
3995
  statusBarHeight: device_display.statusBarHeight,
3996
3996
  safeAreaBottomHeight: device_display.safeAreaBottomHeight,
3997
- isImmersion: device_display.isImmersion,
3997
+ isImmersion: device_display.isImmersion ? "true" : "false",
3998
3998
 
3999
3999
  };
4000
4000
  /**
@@ -6281,6 +6281,67 @@ var scroller = {
6281
6281
  }
6282
6282
  };
6283
6283
 
6284
+ function getGCanvas (weex) {
6285
+ var extractComponentStyle = weex.extractComponentStyle;
6286
+ var ref = weex.utils;
6287
+ var dispatchNativeEvent = ref.dispatchNativeEvent;
6288
+
6289
+ return {
6290
+ name: 'weex-gcanvas',
6291
+ mounted: function mounted() {
6292
+ var wrapper = this.$refs.gcanvas;
6293
+ var rate = 750 / document.documentElement.clientWidth
6294
+ wrapper.width = wrapper.clientWidth * rate;
6295
+ wrapper.height = wrapper.clientWidth * rate;
6296
+
6297
+ var context = wrapper.getContext(type || '2d')
6298
+ context.scale(rate, rate)
6299
+ },
6300
+ methods:{
6301
+ getContext: function (type) {
6302
+ var wrapper = this.$refs.gcanvas;
6303
+ var context = wrapper.getContext(type || '2d')
6304
+ return context
6305
+ },
6306
+
6307
+ getContextAsyn: function (type, callback) {
6308
+ var wrapper = this.$refs.gcanvas;
6309
+ var context = wrapper.getContext(type || '2d')
6310
+ callback(context)
6311
+ },
6312
+
6313
+ drawImage: function (url) {
6314
+ var wrapper = this.$refs.gcanvas;
6315
+ var context = wrapper.getContext(type || '2d')
6316
+
6317
+ var img = new Image();
6318
+ img.src = url
6319
+ arguments[0] = img
6320
+ return context.drawImage.apply(context, arguments)
6321
+ }
6322
+ },
6323
+ render: function render (createElement) {
6324
+ var attrs = this.$vnode.data.attrs;
6325
+ return createElement('canvas', {
6326
+ attrs: {
6327
+ 'weex-type': 'gcanvas'
6328
+ },
6329
+ ref: 'gcanvas',
6330
+ staticClass: 'weex-gcanvas weex-ct',
6331
+ staticStyle: extractComponentStyle(this)
6332
+ })
6333
+ }
6334
+ }
6335
+ }
6336
+
6337
+ var gcanvas = {
6338
+ init: function (Weex) {
6339
+ Weex.registerComponent('gcanvas', getGCanvas(Weex))
6340
+ }
6341
+ };
6342
+
6343
+
6344
+
6284
6345
  /*
6285
6346
  * Licensed to the Apache Software Foundation (ASF) under one
6286
6347
  * or more contributor license agreements. See the NOTICE file
@@ -7236,6 +7297,7 @@ var modules = [
7236
7297
  waterfall,
7237
7298
  // cell,
7238
7299
  header,
7300
+ gcanvas,
7239
7301
  loading,
7240
7302
  refresh,
7241
7303
  loadingIndicator$1,
@@ -9999,7 +10061,9 @@ var dom = {
9999
10061
  if (ct && el) {
10000
10062
  var dSuffix = ({
10001
10063
  horizontal: 'Left',
10002
- vertical: 'Top'
10064
+ vertical: 'Top',
10065
+ column: 'Top',
10066
+ row: 'Left'
10003
10067
  })[scrollDirection];
10004
10068
  var ctRect = ct.getBoundingClientRect();
10005
10069
  var elRect = el.getBoundingClientRect();
package/package.json CHANGED
@@ -49,5 +49,5 @@
49
49
  "type": "git",
50
50
  "url": "git+ssh://git@github.com/weexteam/weex-vue-render.git"
51
51
  },
52
- "version": "0.2.6"
52
+ "version": "0.2.8"
53
53
  }