Skip to content

Commit

Permalink
build: 0.10.0-alpha.5
Browse files Browse the repository at this point in the history
  • Loading branch information
toxic-johann committed May 9, 2018
1 parent d380e39 commit 96d2e71
Show file tree
Hide file tree
Showing 9 changed files with 855 additions and 1,825 deletions.
2 changes: 1 addition & 1 deletion bundle-size/common.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bundle-size/es.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bundle-size/min.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bundle-size/umd.html

Large diffs are not rendered by default.

2,540 changes: 753 additions & 1,787 deletions lib/index.browser.js

Large diffs are not rendered by default.

64 changes: 48 additions & 16 deletions lib/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

/**
* chimee v0.10.0-alpha.4
* chimee v0.10.0-alpha.5
* (c) 2017-2018 toxic-johann
* Released under MIT
*/
Expand All @@ -27,9 +27,9 @@ var _defineProperty = _interopDefault(require('babel-runtime/helpers/definePrope
var _toConsumableArray = _interopDefault(require('babel-runtime/helpers/toConsumableArray'));
var _Promise = _interopDefault(require('babel-runtime/core-js/promise'));
var _get = _interopDefault(require('babel-runtime/helpers/get'));
var _slicedToArray = _interopDefault(require('babel-runtime/helpers/slicedToArray'));
var esFullscreen = _interopDefault(require('es-fullscreen'));
var _Map = _interopDefault(require('babel-runtime/core-js/map'));
var _slicedToArray = _interopDefault(require('babel-runtime/helpers/slicedToArray'));
var _getIterator = _interopDefault(require('babel-runtime/core-js/get-iterator'));
var _Object$entries = _interopDefault(require('babel-runtime/core-js/object/entries'));
var global = _interopDefault(require('core-js/es7/global'));
Expand Down Expand Up @@ -708,10 +708,6 @@ function _applyDecoratedDescriptor$1(target, property, decorators, descriptor, c

return desc;
}
function propertyAccessibilityWarn(property) {
/* istanbul ignore else */
if (process.env.NODE_ENV !== 'production') chimeeHelper.Log.warn('chimee', 'You are trying to obtain ' + property + ', we will return you the DOM node. It\'s not a good idea to handle this by yourself. If you have some requirement, you can tell use by https://github.com/Chimeejs/chimee/issues');
}
var VideoWrapper = (_dec$1 = toxicDecorators.autobindClass(), _dec2$1 = toxicDecorators.alias('silentLoad'), _dec3 = toxicDecorators.alias('fullScreen'), _dec4 = toxicDecorators.alias('$fullScreen'), _dec5 = toxicDecorators.alias('fullscreen'), _dec6 = toxicDecorators.alias('emit'), _dec7 = toxicDecorators.alias('emitSync'), _dec8 = toxicDecorators.alias('on'), _dec9 = toxicDecorators.alias('addEventListener'), _dec10 = toxicDecorators.before(eventBinderCheck), _dec11 = toxicDecorators.alias('off'), _dec12 = toxicDecorators.alias('removeEventListener'), _dec13 = toxicDecorators.before(eventBinderCheck), _dec14 = toxicDecorators.alias('once'), _dec15 = toxicDecorators.before(eventBinderCheck), _dec16 = toxicDecorators.alias('css'), _dec17 = toxicDecorators.before(attrAndStyleCheck), _dec18 = toxicDecorators.alias('attr'), _dec19 = toxicDecorators.before(attrAndStyleCheck), _dec$1(_class$1 = (_class2 = function () {
function VideoWrapper() {
_classCallCheck(this, VideoWrapper);
Expand Down Expand Up @@ -1181,19 +1177,16 @@ var VideoWrapper = (_dec$1 = toxicDecorators.autobindClass(), _dec2$1 = toxicDec
}, {
key: '$wrapper',
get: function get() {
propertyAccessibilityWarn('wrapper');
return this.__dispatcher.dom.wrapper;
}
}, {
key: '$container',
get: function get() {
propertyAccessibilityWarn('container');
return this.__dispatcher.dom.container;
}
}, {
key: '$video',
get: function get() {
propertyAccessibilityWarn('video');
return this.__dispatcher.dom.videoElement;
}
}, {
Expand All @@ -1218,6 +1211,11 @@ var VideoWrapper = (_dec$1 = toxicDecorators.autobindClass(), _dec2$1 = toxicDec
chimeeHelper.deepAssign(this.__dispatcher.containerConfig, config);
return this.__dispatcher.container;
}
}, {
key: 'videoRequireGuardedAttributes',
get: function get() {
return this.__dispatcher.dom.videoRequireGuardedAttributes;
}
}]);

return VideoWrapper;
Expand Down Expand Up @@ -1298,7 +1296,7 @@ var Plugin = (_dec$2 = toxicDecorators.autobindClass(), _dec$2(_class$2 = functi
var _this = _possibleConstructorReturn(this, (Plugin.__proto__ || _Object$getPrototypeOf(Plugin)).call(this));

_this.destroyed = false;
_this.VERSION = '0.10.0-alpha.4';
_this.VERSION = '0.10.0-alpha.5';
_this.__operable = true;
_this.__level = 0;

Expand Down Expand Up @@ -1616,7 +1614,7 @@ var Dom = (_dec$3 = toxicDecorators.waituntil('__dispatcher.videoConfigReady'),
}
}]);

function Dom(wrapper, dispatcher) {
function Dom(config, dispatcher) {
_classCallCheck(this, Dom);

this.plugins = {};
Expand All @@ -1627,6 +1625,9 @@ var Dom = (_dec$3 = toxicDecorators.waituntil('__dispatcher.videoConfigReady'),
this.isFullscreen = false;
this.fullscreenElement = undefined;

var _ref = config || {},
wrapper = _ref.wrapper;

this.__dispatcher = dispatcher;
if (!chimeeHelper.isElement(wrapper) && !chimeeHelper.isString(wrapper)) throw new TypeError('Wrapper can only be string or HTMLElement, but not ' + (typeof wrapper === 'undefined' ? 'undefined' : _typeof(wrapper)));
var $wrapper = chimeeHelper.$(wrapper);
Expand Down Expand Up @@ -1655,6 +1656,14 @@ var Dom = (_dec$3 = toxicDecorators.waituntil('__dispatcher.videoConfigReady'),
this.installVideo(videoElement);
this._fullscreenMonitor();
esFullscreen.on('fullscreenchange', this._fullscreenMonitor);
// As some video attributes will missed when we switch kernel
// we set a guarder for it
// and we must make sure style be guarded
var videoRequiredGuardedAttributes = chimeeHelper.isArray(config.videoRequiredGuardedAttributes) ? config.videoRequiredGuardedAttributes : [];
if (videoRequiredGuardedAttributes.indexOf('style') < 0) {
videoRequiredGuardedAttributes.unshift('style');
}
this.videoRequireGuardedAttributes = videoRequiredGuardedAttributes;
}

_createClass(Dom, [{
Expand Down Expand Up @@ -1777,9 +1786,9 @@ var Dom = (_dec$3 = toxicDecorators.waituntil('__dispatcher.videoConfigReady'),
this._autoFocusToVideo(dom, true);
}

var _ref = Dispatcher.getPluginConfig(id) || {},
_ref$penetrate = _ref.penetrate,
penetrate = _ref$penetrate === undefined ? false : _ref$penetrate;
var _ref2 = Dispatcher.getPluginConfig(id) || {},
_ref2$penetrate = _ref2.penetrate,
penetrate = _ref2$penetrate === undefined ? false : _ref2$penetrate;

if (penetrate) this.__dispatcher.binder.bindEventOnPenetrateNode(dom, true);
delete this.plugins[id];
Expand Down Expand Up @@ -1867,6 +1876,22 @@ var Dom = (_dec$3 = toxicDecorators.waituntil('__dispatcher.videoConfigReady'),
return chimeeHelper.isPosterityNode(video, node);
}, false);
}
}, {
key: 'migrateVideoRequiredGuardedAttributes',
value: function migrateVideoRequiredGuardedAttributes(video) {
var _this2 = this;

var guardedAttributesAndValue = this.videoRequireGuardedAttributes.map(function (attr) {
return [attr, chimeeHelper.getAttr(_this2.videoElement, attr)];
});
guardedAttributesAndValue.forEach(function (_ref3) {
var _ref4 = _slicedToArray(_ref3, 2),
attr = _ref4[0],
value = _ref4[1];

return chimeeHelper.setAttr(video, attr, value);
});
}

/**
* function called when we distory
Expand Down Expand Up @@ -3107,7 +3132,7 @@ var Dispatcher = (_dec$6 = toxicDecorators.before(convertNameIntoId), _dec2$5 =
* dom Manager
* @type {Dom}
*/
this.dom = new Dom(config.wrapper, this);
this.dom = new Dom(config, this);
/**
* Chimee's referrence
* @type {[type]}
Expand Down Expand Up @@ -3165,6 +3190,7 @@ var Dispatcher = (_dec$6 = toxicDecorators.before(convertNameIntoId), _dec2$5 =
});
if (this.readySync) this._autoloadVideoSrcAtFirst();
}

/**
* use a plugin, which means we will new a plugin instance and include int this Chimee instance
* @param {Object|string} option you can just set a plugin name or plugin config
Expand Down Expand Up @@ -3222,6 +3248,7 @@ var Dispatcher = (_dec$6 = toxicDecorators.before(convertNameIntoId), _dec2$5 =
if (this.videoConfigReady) plugin.__inited();
return plugin.ready;
}

/**
* unuse an plugin, we will destroy the plugin instance and exlude it
* @param {string} name plugin's name
Expand Down Expand Up @@ -3442,6 +3469,7 @@ var Dispatcher = (_dec$6 = toxicDecorators.before(convertNameIntoId), _dec2$5 =

var oldKernel = this.kernel;
var originVideoConfig = chimeeHelper.deepClone(this.videoConfig);
this.dom.migrateVideoRequiredGuardedAttributes(video);
this.dom.removeVideo();
this.dom.installVideo(video);
// as we will reset the currentVideoConfig on the new video
Expand Down Expand Up @@ -3472,6 +3500,7 @@ var Dispatcher = (_dec$6 = toxicDecorators.before(convertNameIntoId), _dec2$5 =
return _this3.binder.bindEventOnVideo(video);
});
}

/**
* destroy function called when dispatcher destroyed
*/
Expand All @@ -3492,6 +3521,7 @@ var Dispatcher = (_dec$6 = toxicDecorators.before(convertNameIntoId), _dec2$5 =
delete this.plugins;
delete this.order;
}

/**
* use a set of plugin
* @param {Array<UserPluginConfig>} configs a set of plugin config
Expand All @@ -3514,6 +3544,7 @@ var Dispatcher = (_dec$6 = toxicDecorators.before(convertNameIntoId), _dec2$5 =
return _this4.use(config);
});
}

/**
* sort zIndex of plugins to make plugin display in order
*/
Expand Down Expand Up @@ -3546,6 +3577,7 @@ var Dispatcher = (_dec$6 = toxicDecorators.before(convertNameIntoId), _dec2$5 =
this.zIndexMap.inner = innerOrderArr;
this.zIndexMap.outer = outerOrderArr;
}

/**
* get the top element's level
* @param {boolean} inner get the inner array or the outer array
Expand Down Expand Up @@ -4012,7 +4044,7 @@ var Chimee = (_dec$7 = toxicDecorators.autobindClass(), _dec$7(_class$8 = (_clas
}), _descriptor2$1 = _applyDecoratedDescriptor$7(_class2$1.prototype, 'version', [toxicDecorators.frozen], {
enumerable: true,
initializer: function initializer() {
return '0.10.0-alpha.4';
return '0.10.0-alpha.5';
}
}), _descriptor3$1 = _applyDecoratedDescriptor$7(_class2$1.prototype, 'config', [toxicDecorators.frozen], {
enumerable: true,
Expand Down
2 changes: 1 addition & 1 deletion lib/index.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit 96d2e71

Please sign in to comment.