Commit 977e31bb authored by rockyl's avatar rockyl

去除原有的Component的逻辑代码

修改过程属性的链接方式
parent 672906ea
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
/**
* Created by rockyl on 2019-11-07.
*/
declare const engine: any;
export default class ZoomButton {
static id = 'zoom-button';
host;
zoomTo = 1.1;
mounted() {
this.host.anchorX = this.host.width / 2;
this.host.anchorY = this.host.height / 2;
this.host.addEventListener(engine.MouseEvent.MOUSE_DOWN, this._onMouseDown, this);
this.host.addEventListener(engine.MouseEvent.MOUSE_UP, this._onMouseUp, this);
}
_onMouseDown(e) {
this.host.scaleX = this.host.scaleY = this.zoomTo;
}
_onMouseUp(e) {
this.host.scaleX = this.host.scaleY = 1;
}
}
......@@ -35,7 +35,7 @@
<body>
<script type="text/javascript" src="./build/render.min.js"></script>
<script type="text/javascript" src="./dist/index.js"></script>
<div id="cusEngine" style="line-height:0;font-size:0"></div>
<script>
......
......@@ -5,26 +5,32 @@
"main": "index.js",
"types": "index.d.ts",
"dependencies": {
"glob": "^7.1.6",
"rollup-plugin-typescript": "^1.0.1"
},
"devDependencies": {
"dts-bundle": "^0.7.3",
"protobufjs": "^6.8.0",
"rollup-plugin-commonjs": "^10.1.0",
"rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-progress": "^1.1.1",
"rollup-plugin-typescript": "^1.0.1",
"rollup-plugin-typescript2": "^0.25.2",
"rollup-plugin-uglify": "^6.0.3",
"ts-loader": "^4.0.0",
"typescript": "^2.7.2",
"uglifyjs-webpack-plugin": "^2.1.2",
"webpack": "^4.1.0",
"webpack-cli": "^3.3.2",
"webpack-dev-server": "^3.1.0"
},
"devDependencies": {
"protobufjs": "^6.8.0",
"webpack-cli": "^3.3.2"
},
"scripts": {
"build": "webpack",
"rollup": "rollup -c",
"ts": "dts-bundle --name engine --main types/src/index.d.ts --out ../../dist/index.d.ts",
"test": "echo \"Error: no test specified\" && exit 1",
"dev": "webpack -w",
"watch": "webpack --watch"
"watch": "webpack --watch",
"mergeDts": "node scripts/mergeDts.js"
},
"author": "",
"license": "ISC"
......
......@@ -23,7 +23,9 @@ export default {
resolve({
//only: [/^\.{0,2}\//],
}),
typescript(),
typescript({
//useTsconfigDeclarationDir: true,
}),
commonjs(),
//uglify({}),
],
......
/**
* Created by rockyl on 2019-11-16.
*/
const fs = require('fs');
const glob = require("glob");
const regLine = /(export|declare)((?!from).)*/g;
glob('types/src/**/*.d.ts', function (err, files) {
const exports = [];
for (let file of files) {
const fileContent = fs.readFileSync(file, 'utf-8');
const result = fileContent.match(regLine);
for (let line of result) {
if(line.match(/export (default)? \w+;/)){
continue;
}
if(line.endsWith(';')){
if(!line.startsWith('_') && !line.startsWith('export default function')){
exports.push(line);
}
}else {
if(line.endsWith('{')){
let start = fileContent.indexOf(line);
const block = fileContent.substring(start, fileContent.indexOf('\n}', start) + 2);
if(!block.startsWith('_')){
exports.push(block);
}
}
}
}
}
let allExports = exports.join('\n\n')
.replace(/export default _default;/g, '')
.replace(/export declare/g, 'export ')
.replace(/export default/g, 'export ')
.replace(/declare /g, 'export ')
;
const content = `
declare const args: any;
declare const props: any;
declare const target: engine.Container;
declare const global: any;
declare function next(type: string, payload?: any);
declare module engine{
${allExports}
}
`;
fs.writeFileSync('dist/types.d.ts', content);
});
/**
* Created by rockyl on 2018/11/5.
*/
import {HashObject} from "../HashObject";
import {DisplayObject} from "../display/DisplayObject";
/**
* 组件基类
*/
export class Component extends HashObject {
/**
* 所依附的显示对象
*/
entity: DisplayObject;
/**
* 是否有效
*/
protected _enabled: boolean
constructor() {
super();
this._instanceType = "Component";
this.onCreate();
}
/**
* 是否有效状态
*/
get enabled(): boolean {
return this._enabled;
}
set enabled(value: boolean) {
if (this._enabled !== value) {
this._enabled = value;
if (this._enabled) {
this.onEnable();
} else {
this.onDisable();
}
}
}
/**
* 装配实体
* @param entity
*/
_setup(entity: DisplayObject) {
this.entity = entity;
}
/**
* 卸载实体
*/
_unSetup() {
this.entity = null;
}
/**
* 当组件被创建时
*/
onCreate() {
}
/**
* 当组件生效时
*/
onEnable() {
}
/**
* 当组件失效时
*/
onDisable() {
}
/**
* 更新
*/
onUpdate() {
}
/**
* 当组件被销毁时
*/
onDestroy() {
}
destroy() {
this.onDestroy();
}
}
......@@ -3,7 +3,6 @@ import Transform from '../math/Transform';
import { Rectangle } from '../math/Rectangle';
import { Point } from "../math/Point";
import { Event } from "../events/Event";
import { Component } from '../component/Component';
import Graphics from '../graphics/Graphics';
import { DEG_TO_RAD, RAD_TO_DEG } from '../const';
......@@ -605,89 +604,10 @@ export class DisplayObject extends EventDispatcher {
this._height = value;
}
/**
* 组件数组
*/
private _components: Component[] = [];
/**
* 更新方法,帧循环的监听事件放在这
*/
public update(deltaTime: number) {
//更新组件方法
for (var i = 0; i < this._components.length; i++) {
if (this._components[i].enabled) {
this._components[i].onUpdate()
}
}
//监听的
if (this.hasEventListener(Event.ENTER_FRAME)) {
this.dispatchEvent(Event.ENTER_FRAME, deltaTime);
}
}
//组件相关方法,添加移除等
/**
* 增加组件
* @param component
*/
addComponent(component: Component) {
this.onAddComponent(component);
this._components.push(component);
}
/**
* 在指定索引增加组件,重复添加可作为顺序交换
* @param component
* @param index
*/
addComponentAt(component: Component, index: number) {
const currentIndex = this._components.indexOf(component);
if (currentIndex == index) {
return;
}
if (currentIndex >= 0) {
this._components.splice(currentIndex, 1);
}
this._components.splice(index, 0, component);
this.onAddComponent(component);
}
/**
* 移除组件
* @param component
*/
removeComponent(component: Component) {
this.onRemoveComponent(component);
const index = this._components.indexOf(component);
if (index >= 0) {
this._components.splice(index, 1);
}
}
/**
* 移除所有组件
*/
removeAllComponents() {
while (this._components.length > 0) {
this.removeComponent(this._components[0]);
}
}
/**
* 当添加组件时
* @param component
*/
onAddComponent(component: Component) {
component._setup(this);
component.enabled = true;
}
/**
* 当移除组件时
* @param component
*/
onRemoveComponent(component: Component) {
component._unSetup();
component.enabled = false;
}
}
/**
......
......@@ -52,7 +52,7 @@ export class Loader extends EventDispatcher {
}, url)
}
loadRaw(callback: Function, url: string, type: 'text'|'json') {
httpRequest(callback: Function, url: string, method: string = 'get',type: 'text'|'json' = 'text'){
//每次都要new
let _req;
if (window["XMLHttpRequest"]) {
......@@ -78,6 +78,10 @@ export class Loader extends EventDispatcher {
}
}
loadRaw(callback: Function, url: string, type: 'text'|'json') {
this.httpRequest(callback, url, 'get', type);
}
loadJson(callback: Function, url: string) {
this.loadRaw(callback, url, 'json');
}
......
export class Ease {
/**
* @version
* @platform Web,Native
*/
constructor() {
}
/**
* get.See example.
* @version
* @platform Web,Native
* @language en_US
*/
/**
* get。请查看示例
* @version
* @platform Web,Native
* @language zh_CN
*/
public static get(amount: number) {
if (amount < -1) {
amount = -1;
}
if (amount > 1) {
amount = 1;
}
return function (t: number) {
if (amount == 0) {
return t;
}
if (amount < 0) {
return t * (t * -amount + 1 + amount);
}
return t * ((2 - t) * amount + (1 - amount));
}
}
/**
* get pow in.See example.
* @version
* @platform Web,Native
* @language en_US
*/
/**
* get pow in。请查看示例
* @version
* @platform Web,Native
* @language zh_CN
*/
public static getPowIn(pow: number) {
return function (t: number) {
return Math.pow(t, pow);
}
}
/**
* get pow out.See example.
* @version
* @platform Web,Native
* @language en_US
*/
/**
* get pow out。请查看示例
* @version
* @platform Web,Native
* @language zh_CN
*/
public static getPowOut(pow: number) {
return function (t: number) {
return 1 - Math.pow(1 - t, pow);
}
}
/**
* get pow in out.See example.
* @version
* @platform Web,Native
* @language en_US
*/
/**
* get pow in out。请查看示例
* @version
* @platform Web,Native
* @language zh_CN
*/
public static getPowInOut(pow: number) {
return function (t: number) {
if ((t *= 2) < 1) return 0.5 * Math.pow(t, pow);
return 1 - 0.5 * Math.abs(Math.pow(2 - t, pow));
}
}
/**
* quad in.See example.
* @version
* @platform Web,Native
* @language en_US
*/
/**
* quad in。请查看示例
* @version
* @platform Web,Native
* @language zh_CN
*/
public static quadIn = Ease.getPowIn(2);
/**
* quad out.See example.
* @version
* @platform Web,Native
* @language en_US
*/
/**
* quad out。请查看示例
* @version
* @platform Web,Native
* @language zh_CN
*/
public static quadOut = Ease.getPowOut(2);
/**
* quad in out.See example.
* @version
* @platform Web,Native
* @language en_US
*/
/**
* quad in out。请查看示例
* @version
* @platform Web,Native
* @language zh_CN
*/
public static quadInOut = Ease.getPowInOut(2);
/**
* cubic in.See example.
* @version
* @platform Web,Native
* @language en_US
*/
/**
* cubic in。请查看示例
* @version
* @platform Web,Native
* @language zh_CN
*/
public static cubicIn = Ease.getPowIn(3);
/**
* cubic out.See example.
* @version
* @platform Web,Native
* @language en_US
*/
/**
* cubic out。请查看示例
* @version
* @platform Web,Native
* @language zh_CN
*/
public static cubicOut = Ease.getPowOut(3);
/**
* cubic in out.See example.
* @version
* @platform Web,Native
* @language en_US
*/
/**
* cubic in out。请查看示例
* @version
* @platform Web,Native
* @language zh_CN
*/
public static cubicInOut = Ease.getPowInOut(3);
/**
* quart in.See example.
* @version
* @platform Web,Native
* @language en_US
*/
/**
* quart in。请查看示例
* @version
* @platform Web,Native
* @language zh_CN
*/
public static quartIn = Ease.getPowIn(4);
/**
* quart out.See example.
* @version
* @platform Web,Native
* @language en_US
*/
/**
* quart out。请查看示例
* @version
* @platform Web,Native
* @language zh_CN
*/
public static quartOut = Ease.getPowOut(4);
/**
* quart in out.See example.
* @version
* @platform Web,Native
* @language en_US
*/
/**
* quart in out。请查看示例
* @version
* @platform Web,Native
* @language zh_CN
*/
public static quartInOut = Ease.getPowInOut(4);
/**
* quint in.See example.
* @version
* @platform Web,Native
* @language en_US
*/
/**
* quint in。请查看示例
* @version
* @platform Web,Native
* @language zh_CN
*/
public static quintIn = Ease.getPowIn(5);
/**
* quint out.See example.
* @version
* @platform Web,Native
* @language en_US
*/
/**
* quint out。请查看示例
* @version
* @platform Web,Native
* @language zh_CN
*/
public static quintOut = Ease.getPowOut(5);
/**
* quint in out.See example.
* @version
* @platform Web,Native
* @language en_US
*/
/**
* quint in out。请查看示例
* @version
* @platform Web,Native
* @language zh_CN
*/
public static quintInOut = Ease.getPowInOut(5);
/**
* sine in.See example.
* @version
* @platform Web,Native
* @language en_US
*/
/**
* sine in。请查看示例
* @version
* @platform Web,Native
* @language zh_CN
*/
public static sineIn(t: number) {
return 1 - Math.cos(t * Math.PI / 2);
}
/**
* sine out.See example.
* @version
* @platform Web,Native
* @language en_US
*/
/**
* sine out。请查看示例
* @version
* @platform Web,Native
* @language zh_CN
*/
public static sineOut(t: number) {
return Math.sin(t * Math.PI / 2);
}
/**
* sine in out.See example.
* @version
* @platform Web,Native
* @language en_US
*/
/**
* sine in out。请查看示例
* @version
* @platform Web,Native
* @language zh_CN
*/
public static sineInOut(t: number) {
return -0.5 * (Math.cos(Math.PI * t) - 1)
}
/**
* get back in.See example.
* @version
* @platform Web,Native
* @language en_US
*/
/**
* get back in。请查看示例
* @version
* @platform Web,Native
* @language zh_CN
*/
public static getBackIn(amount: number) {
return function (t: number) {
return t * t * ((amount + 1) * t - amount);
}
}
/**
* back in.See example.
* @version
* @platform Web,Native
* @language en_US
*/
/**
* back in。请查看示例
* @version
* @platform Web,Native
* @language zh_CN
*/
public static backIn = Ease.getBackIn(1.7);
/**
* get back out.See example.
* @version
* @platform Web,Native
* @language en_US
*/
/**
* get back out。请查看示例
* @version
* @platform Web,Native
* @language zh_CN
*/
public static getBackOut(amount: number) {
return function (t) {
return (--t * t * ((amount + 1) * t + amount) + 1);
}
}
/**
* back out.See example.
* @version
* @platform Web,Native
* @language en_US
*/
/**
* back out。请查看示例
* @version
* @platform Web,Native
* @language zh_CN
*/
public static backOut = Ease.getBackOut(1.7);
/**
* get back in out.See example.
* @version
* @platform Web,Native
* @language en_US
*/
/**
* get back in out。请查看示例
* @version
* @platform Web,Native
* @language zh_CN
*/
public static getBackInOut(amount: number) {
amount *= 1.525;
return function (t: number) {
if ((t *= 2) < 1) return 0.5 * (t * t * ((amount + 1) * t - amount));
return 0.5 * ((t -= 2) * t * ((amount + 1) * t + amount) + 2);
}
}
/**
* back in out.See example.
* @version
* @platform Web,Native
* @language en_US
*/
/**
* back in out。请查看示例
* @version
* @platform Web,Native
* @language zh_CN
*/
public static backInOut = Ease.getBackInOut(1.7);
/**
* circ in.See example.
* @version
* @platform Web,Native
* @language en_US
*/
/**
* circ in。请查看示例
* @version
* @platform Web,Native
* @language zh_CN
*/
public static circIn(t: number) {
return -(Math.sqrt(1 - t * t) - 1);
}
/**
* circ out.See example.
* @version
* @platform Web,Native
* @language en_US
*/
/**
* circ out。请查看示例
* @version
* @platform Web,Native
* @language zh_CN
*/
public static circOut(t: number) {
return Math.sqrt(1 - (--t) * t);
}
/**
* circ in out.See example.
* @version
* @platform Web,Native
* @language en_US
*/
/**
* circ in out。请查看示例
* @version
* @platform Web,Native
* @language zh_CN
*/
public static circInOut(t: number) {
if ((t *= 2) < 1) {
return -0.5 * (Math.sqrt(1 - t * t) - 1);
}
return 0.5 * (Math.sqrt(1 - (t -= 2) * t) + 1);
}
/**
* bounce in.See example.
* @version
* @platform Web,Native
* @language en_US
*/
/**
* bounce in。请查看示例
* @version
* @platform Web,Native
* @language zh_CN
*/
public static bounceIn(t: number) {
return 1 - Ease.bounceOut(1 - t);
}
/**
* bounce out.See example.
* @version
* @platform Web,Native
* @language en_US
*/
/**
* bounce out。请查看示例
* @version
* @platform Web,Native
* @language zh_CN
*/
public static bounceOut(t: number) {
if (t < 1 / 2.75) {
return (7.5625 * t * t);
} else if (t < 2 / 2.75) {
return (7.5625 * (t -= 1.5 / 2.75) * t + 0.75);
} else if (t < 2.5 / 2.75) {
return (7.5625 * (t -= 2.25 / 2.75) * t + 0.9375);
} else {
return (7.5625 * (t -= 2.625 / 2.75) * t + 0.984375);
}
}
/**
* bounce in out.See example.
* @version
* @platform Web,Native
* @language en_US
*/
/**
* bounce in out。请查看示例
* @version
* @platform Web,Native
* @language zh_CN
*/
public static bounceInOut(t: number) {
if (t < 0.5) return Ease.bounceIn(t * 2) * .5;
return Ease.bounceOut(t * 2 - 1) * 0.5 + 0.5;
}
/**
* get elastic in.See example.
* @version
* @platform Web,Native
* @language en_US
*/
/**
* get elastic in。请查看示例
* @version
* @platform Web,Native
* @language zh_CN
*/
public static getElasticIn(amplitude: number, period: number) {
let pi2 = Math.PI * 2;
return function (t: number) {
if (t == 0 || t == 1) return t;
let s = period / pi2 * Math.asin(1 / amplitude);
return -(amplitude * Math.pow(2, 10 * (t -= 1)) * Math.sin((t - s) * pi2 / period));
}
}
/**
* elastic in.See example.
* @version
* @platform Web,Native
* @language en_US
*/
/**
* elastic in。请查看示例
* @version
* @platform Web,Native
* @language zh_CN
*/
public static elasticIn = Ease.getElasticIn(1, 0.3);
/**
* get elastic out.See example.
* @version
* @platform Web,Native
* @language en_US
*/
/**
* get elastic out。请查看示例
* @version
* @platform Web,Native
* @language zh_CN
*/
public static getElasticOut(amplitude: number, period: number) {
let pi2 = Math.PI * 2;
return function (t: number) {
if (t == 0 || t == 1) return t;
let s = period / pi2 * Math.asin(1 / amplitude);
return (amplitude * Math.pow(2, -10 * t) * Math.sin((t - s) * pi2 / period) + 1);
}
}
/**
* elastic out.See example.
* @version
* @platform Web,Native
* @language en_US
*/
/**
* elastic out。请查看示例
* @version
* @platform Web,Native
* @language zh_CN
*/
public static elasticOut = Ease.getElasticOut(1, 0.3);
/**
* get elastic in out.See example.
* @version
* @platform Web,Native
* @language en_US
*/
/**
* get elastic in out。请查看示例
* @version
* @platform Web,Native
* @language zh_CN
*/
public static getElasticInOut(amplitude: number, period: number) {
let pi2 = Math.PI * 2;
return function (t: number) {
let s = period / pi2 * Math.asin(1 / amplitude);
if ((t *= 2) < 1) return -0.5 * (amplitude * Math.pow(2, 10 * (t -= 1)) * Math.sin((t - s) * pi2 / period));
return amplitude * Math.pow(2, -10 * (t -= 1)) * Math.sin((t - s) * pi2 / period) * 0.5 + 1;
}
}
/**
* elastic in out.See example.
* @version
* @platform Web,Native
* @language en_US
*/
/**
* elastic in out。请查看示例
* @version
* @platform Web,Native
* @language zh_CN
*/
public static elasticInOut = Ease.getElasticInOut(1, 0.3 * 1.5);
}
// import EventDispatcher from "../core/EventDispatcher"
/**
* 只用到一个onChange监听
* //做了锁步时间,尽量用这个
*/
export class Tween /*extends EventDispatcher*/ {
/**
* 不做特殊处理
* @constant {number} Tween.NONE
* @private
*/
private static NONE = 0;
/**
* 循环
* @constant {number} Tween.LOOP
* @private
*/
private static LOOP = 1;
/**
* 倒序
* @constant {number} Tween.REVERSE
* @private
*/
private static REVERSE = 2;
/**
* @private
*/
private static _tweens: Tween[] = [];
/**
* @private
*/
private static IGNORE = {};
/**
* @private
*/
private static _plugins = {};
/**
* @private
*/
private static _inited = false;
/**
* @private
*/
private _target: any = null;
/**
* @private
*/
private _useTicks: boolean = false;
/**
* @private
*/
private ignoreGlobalPause: boolean = false;
/**
* @private
*/
private loop: boolean = false;
/**
* @private
*/
private pluginData = null;
/**
* @private
*/
private _curQueueProps;
/**
* @private
*/
private _initQueueProps;
/**
* @private
*/
private _steps: any[] = null;
/**
* @private
*/
private paused: boolean = false;
/**
* @private
*/
private duration: number = 0;
/**
* @private
*/
private _prevPos: number = -1;
/**
* @private
*/
private position: number = null;
/**
* @private
*/
private _prevPosition: number = 0;
/**
* @private
*/
private _stepPosition: number = 0;
/**
* @private
*/
private passive: boolean = false;
/**
* Activate an object and add a Tween animation to the object
* @param target {any} The object to be activated
* @param props {any} Parameters, support loop onChange onChangeObj
* @param pluginData {any} Write realized
* @param override {boolean} Whether to remove the object before adding a tween, the default value false
* Not recommended, you can use Tween.removeTweens(target) instead.
* @version
* @platform Web,Native
* @language en_US
*/
/**
* 激活一个对象,对其添加 Tween 动画
* @param target {any} 要激活 Tween 的对象
* @param props {any} 参数,支持loop(循环播放) onChange(变化函数) onChangeObj(变化函数作用域)
* @param pluginData {any} 暂未实现
* @param override {boolean} 是否移除对象之前添加的tween,默认值false。
* 不建议使用,可使用 Tween.removeTweens(target) 代替。
* @version
* @platform Web,Native
* @language zh_CN
*/
public static get(target: any, props?: { loop?: boolean, onChange?: Function, onChangeObj?: any }, pluginData: any = null, override: boolean = false): Tween {
if (override) {
Tween.removeTweens(target);
}
return new Tween(target, props, pluginData);
}
/**
* Delete all Tween animations from an object
* @param target The object whose Tween to be deleted
* @version
* @platform Web,Native
* @language en_US
*/
/**
* 删除一个对象上的全部 Tween 动画
* @param target 需要移除 Tween 的对象
* @version
* @platform Web,Native
* @language zh_CN
*/
public static removeTweens(target: any): void {
if (!target.tween_count) {
return;
}
let tweens: Tween[] = Tween._tweens;
for (let i = tweens.length - 1; i >= 0; i--) {
if (tweens[i]._target == target) {
tweens[i].paused = true;
tweens.splice(i, 1);
}
}
target.tween_count = 0;
}
/**
* Pause all Tween animations of a certain object
* @param target The object whose Tween to be paused
* @version
* @platform Web,Native
* @language en_US
*/
/**
* 暂停某个对象的所有 Tween
* @param target 要暂停 Tween 的对象
* @version
* @platform Web,Native
* @language zh_CN
*/
public static pauseTweens(target: any): void {
if (!target.tween_count) {
return;
}
let tweens: Tween[] = Tween._tweens;
for (let i = tweens.length - 1; i >= 0; i--) {
if (tweens[i]._target == target) {
tweens[i].paused = true;
}
}
}
/**
* Resume playing all easing of a certain object
* @param target The object whose Tween to be resumed
* @version
* @platform Web,Native
* @language en_US
*/
/**
* 继续播放某个对象的所有缓动
* @param target 要继续播放 Tween 的对象
* @version
* @platform Web,Native
* @language zh_CN
*/
public static resumeTweens(target: any): void {
if (!target.tween_count) {
return;
}
let tweens: Tween[] = Tween._tweens;
for (let i = tweens.length - 1; i >= 0; i--) {
if (tweens[i]._target == target) {
tweens[i].paused = false;
}
}
}
/**
* @private
*
* @param delta
* @param paused
*/
private static tick(timeStamp: number, paused = false): boolean {
let delta = timeStamp - Tween._lastTime;
Tween._lastTime = timeStamp;
let tweens: Tween[] = Tween._tweens.concat();
for (let i = tweens.length - 1; i >= 0; i--) {
let tween: Tween = tweens[i];
if ((paused && !tween.ignoreGlobalPause) || tween.paused) {
continue;
}
tween.$tick(tween._useTicks ? 1 : delta);
}
return false;
}
/**
* flush方法,为了能加入总循环
* 默认是锁步的
* @param delta
* @param paused ,暂时不用,全局禁止
*/
public static flush(/*paused = false*/): void {
let timeStamp = Date.now()
let delta = Tween._lastTime ? (timeStamp - Tween._lastTime) : 16.67;;
Tween._lastTime = timeStamp;
let tweens: Tween[] = Tween._tweens.concat();
for (let i = tweens.length - 1; i >= 0; i--) {
let tween: Tween = tweens[i];
if (/*(paused && !tween.ignoreGlobalPause) ||*/ tween.paused) {
continue;
}
tween.$tick(tween._useTicks ? 1 : delta);
}
}
private static _lastTime: number = 0;
/**
* @private
*
* @param tween
* @param value
*/
private static _register(tween: Tween, value: boolean): void {
let target: any = tween._target;
let tweens: Tween[] = Tween._tweens;
if (value) {
if (target) {
target.tween_count = target.tween_count > 0 ? target.tween_count + 1 : 1;
}
tweens.push(tween);
if (!Tween._inited) {
// Tween._lastTime = Date.now();
//开始加入循环暂时从简,最后实际使用,最好加入Stage总循环中
// let aaa = () => {
// Tween.tick(Date.now())
// requestAnimationFrame(aaa)
// }
//必须做延时
// setTimeout(aaa, 16.7)
// aaa();
// ticker.$startTick(Tween.tick, null);
Tween._inited = true;
}
} else {
if (target) {
target.tween_count--;
}
let i = tweens.length;
while (i--) {
if (tweens[i] == tween) {
tweens.splice(i, 1);
return;
}
}
}
}
/**
* Delete all Tween
* @version
* @platform Web,Native
* @language en_US
*/
/**
* 删除所有 Tween
* @version
* @platform Web,Native
* @language zh_CN
*/
public static removeAllTweens(): void {
let tweens: Tween[] = Tween._tweens;
for (let i = 0, l = tweens.length; i < l; i++) {
let tween: Tween = tweens[i];
tween.paused = true;
tween._target.tween_count = 0;
}
tweens.length = 0;
}
/**
* 创建一个 Tween 对象
* @private
* @version
* @platform Web,Native
*/
constructor(target: any, props: any, pluginData: any) {
// super();
this.initialize(target, props, pluginData);
}
onChange: Function
/**
* @private
*
* @param target
* @param props
* @param pluginData
*/
private initialize(target: any, props: any, pluginData: any): void {
this._target = target;
if (props) {
this._useTicks = props.useTicks;
this.ignoreGlobalPause = props.ignoreGlobalPause;
this.loop = props.loop;
if (props.onChange) {
this.onChange = props.onChange.bind(props.onChangeObj)
} else {
this.onChange = null
}
// && this.addEventListener("change", props.onChange.bind(props.onChangeObj));
if (props.override) {
Tween.removeTweens(target);
}
}
this.pluginData = pluginData || {};
this._curQueueProps = {};
this._initQueueProps = {};
this._steps = [];
if (props && props.paused) {
this.paused = true;
}
else {
Tween._register(this, true);
}
if (props && props.position != null) {
this.setPosition(props.position, Tween.NONE);
}
}
/**
* @private
*
* @param value
* @param actionsMode
* @returns
*/
public setPosition(value: number, actionsMode: number = 1): boolean {
if (value < 0) {
value = 0;
}
//正常化位置
let t: number = value;
let end: boolean = false;
if (t >= this.duration) {
if (this.loop) {
var newTime = t % this.duration;
if (t > 0 && newTime === 0) {
t = this.duration;
} else {
t = newTime;
}
}
else {
t = this.duration;
end = true;
}
}
if (t == this._prevPos) {
return end;
}
if (end) {
this.setPaused(true);
}
let prevPos = this._prevPos;
this.position = this._prevPos = t;
this._prevPosition = value;
if (this._target) {
if (this._steps.length > 0) {
// 找到新的tween
let l = this._steps.length;
let stepIndex = -1;
for (let i = 0; i < l; i++) {
if (this._steps[i].type == "step") {
stepIndex = i;
if (this._steps[i].t <= t && this._steps[i].t + this._steps[i].d >= t) {
break;
}
}
}
for (let i = 0; i < l; i++) {
if (this._steps[i].type == "action") {
//执行actions
if (actionsMode != 0) {
if (this._useTicks) {
this._runAction(this._steps[i], t, t);
}
else if (actionsMode == 1 && t < prevPos) {
if (prevPos != this.duration) {
this._runAction(this._steps[i], prevPos, this.duration);
}
this._runAction(this._steps[i], 0, t, true);
}
else {
this._runAction(this._steps[i], prevPos, t);
}
}
}
else if (this._steps[i].type == "step") {
if (stepIndex == i) {
let step = this._steps[stepIndex];
this._updateTargetProps(step, Math.min((this._stepPosition = t - step.t) / step.d, 1));
}
}
}
}
}
this.onChange && this.onChange()
// this.dispatchEvent("change");
return end;
}
/**
* @private
*
* @param startPos
* @param endPos
* @param includeStart
*/
private _runAction(action: any, startPos: number, endPos: number, includeStart: boolean = false) {
let sPos: number = startPos;
let ePos: number = endPos;
if (startPos > endPos) {
//把所有的倒置
sPos = endPos;
ePos = startPos;
}
let pos = action.t;
if (pos == ePos || (pos > sPos && pos < ePos) || (includeStart && pos == startPos)) {
action.f.apply(action.o, action.p);
}
}
/**
* @private
*
* @param step
* @param ratio
*/
private _updateTargetProps(step: any, ratio: number) {
let p0, p1, v, v0, v1, arr;
if (!step && ratio == 1) {
this.passive = false;
p0 = p1 = this._curQueueProps;
} else {
this.passive = !!step.v;
//不更新props.
if (this.passive) {
return;
}
//使用ease
if (step.e) {
ratio = step.e(ratio, 0, 1, 1);
}
p0 = step.p0;
p1 = step.p1;
}
for (let n in this._initQueueProps) {
if ((v0 = p0[n]) == null) {
p0[n] = v0 = this._initQueueProps[n];
}
if ((v1 = p1[n]) == null) {
p1[n] = v1 = v0;
}
if (v0 == v1 || ratio == 0 || ratio == 1 || (typeof (v0) != "number")) {
v = ratio == 1 ? v1 : v0;
} else {
v = v0 + (v1 - v0) * ratio;
}
let ignore = false;
if (arr = Tween._plugins[n]) {
for (let i = 0, l = arr.length; i < l; i++) {
let v2 = arr[i].tween(this, n, v, p0, p1, ratio, !!step && p0 == p1, !step);
if (v2 == Tween.IGNORE) {
ignore = true;
}
else {
v = v2;
}
}
}
if (!ignore) {
this._target[n] = v;
}
}
}
/**
* Whether setting is paused
* @param value {boolean} Whether to pause
* @returns Tween object itself
* @version
* @platform Web,Native
* @language en_US
*/
/**
* 设置是否暂停
* @param value {boolean} 是否暂停
* @returns Tween对象本身
* @version
* @platform Web,Native
* @language zh_CN
*/
public setPaused(value: boolean): Tween {
if (this.paused == value) {
return this;
}
this.paused = value;
Tween._register(this, !value);
return this;
}
/**
* @private
*
* @param props
* @returns
*/
private _cloneProps(props: any): any {
let o = {};
for (let n in props) {
o[n] = props[n];
}
return o;
}
/**
* @private
*
* @param o
* @returns
*/
private _addStep(o): Tween {
if (o.d > 0) {
o.type = "step";
this._steps.push(o);
o.t = this.duration;
this.duration += o.d;
}
return this;
}
/**
* @private
*
* @param o
* @returns
*/
private _appendQueueProps(o): any {
let arr, oldValue, i, l, injectProps;
for (let n in o) {
if (this._initQueueProps[n] === undefined) {
oldValue = this._target[n];
//设置plugins
if (arr = Tween._plugins[n]) {
for (i = 0, l = arr.length; i < l; i++) {
oldValue = arr[i].init(this, n, oldValue);
}
}
this._initQueueProps[n] = this._curQueueProps[n] = (oldValue === undefined) ? null : oldValue;
} else {
oldValue = this._curQueueProps[n];
}
}
for (let n in o) {
oldValue = this._curQueueProps[n];
if (arr = Tween._plugins[n]) {
injectProps = injectProps || {};
for (i = 0, l = arr.length; i < l; i++) {
if (arr[i].step) {
arr[i].step(this, n, oldValue, o[n], injectProps);
}
}
}
this._curQueueProps[n] = o[n];
}
if (injectProps) {
this._appendQueueProps(injectProps);
}
return this._curQueueProps;
}
/**
* @private
*
* @param o
* @returns
*/
private _addAction(o): Tween {
o.t = this.duration;
o.type = "action";
this._steps.push(o);
return this;
}
/**
* @private
*
* @param props
* @param o
*/
private _set(props: any, o): void {
for (let n in props) {
o[n] = props[n];
}
}
/**
* Wait the specified milliseconds before the execution of the next animation
* @param duration {number} Waiting time, in milliseconds
* @param passive {boolean} Whether properties are updated during the waiting time
* @returns Tween object itself
* @version
* @platform Web,Native
* @language en_US
*/
/**
* 等待指定毫秒后执行下一个动画
* @param duration {number} 要等待的时间,以毫秒为单位
* @param passive {boolean} 等待期间属性是否会更新
* @returns Tween对象本身
* @version
* @platform Web,Native
* @language zh_CN
*/
public wait(duration: number, passive?: boolean): Tween {
if (duration == null || duration <= 0) {
return this;
}
let o = this._cloneProps(this._curQueueProps);
return this._addStep({ d: duration, p0: o, p1: o, v: passive });
}
/**
* Modify the property of the specified object to a specified value
* @param props {Object} Property set of an object
* @param duration {number} Duration
* @param ease {Ease} Easing algorithm
* @returns {Tween} Tween object itself
* @version
* @platform Web,Native
* @language en_US
*/
/**
* 将指定对象的属性修改为指定值
* @param props {Object} 对象的属性集合
* @param duration {number} 持续时间
* @param ease {Ease} 缓动算法
* @returns {Tween} Tween对象本身
* @version
* @platform Web,Native
* @language zh_CN
*/
public to(props: any, duration?: number, ease: Function = undefined) {
if (isNaN(duration) || duration < 0) {
duration = 0;
}
this._addStep({ d: duration || 0, p0: this._cloneProps(this._curQueueProps), e: ease, p1: this._cloneProps(this._appendQueueProps(props)) });
//加入一步set,防止游戏极其卡顿时候,to后面的call取到的属性值不对
return this.set(props);
}
/**
* Execute callback function
* @param callback {Function} Callback method
* @param thisObj {any} this action scope of the callback method
* @param params {any[]} Parameter of the callback method
* @returns {Tween} Tween object itself
* @version
* @platform Web,Native
* @example
* <pre>
* Tween.get(display).call(function (a:number, b:string) {
* console.log("a: " + a); // the first parameter passed 233
* console.log("b: " + b); // the second parameter passed “hello”
* }, this, [233, "hello"]);
* </pre>
* @language en_US
*/
/**
* 执行回调函数
* @param callback {Function} 回调方法
* @param thisObj {any} 回调方法this作用域
* @param params {any[]} 回调方法参数
* @returns {Tween} Tween对象本身
* @version
* @platform Web,Native
* @example
* <pre>
* Tween.get(display).call(function (a:number, b:string) {
* console.log("a: " + a); //对应传入的第一个参数 233
* console.log("b: " + b); //对应传入的第二个参数 “hello”
* }, this, [233, "hello"]);
* </pre>
* @language zh_CN
*/
public call(callback: Function, thisObj: any = undefined, params: any[] = undefined): Tween {
return this._addAction({ f: callback, p: params ? params : [], o: thisObj ? thisObj : this._target });
}
/**
* Now modify the properties of the specified object to the specified value
* @param props {Object} Property set of an object
* @param target The object whose Tween to be resumed
* @returns {Tween} Tween object itself
* @version
* @platform Web,Native
*/
/**
* 立即将指定对象的属性修改为指定值
* @param props {Object} 对象的属性集合
* @param target 要继续播放 Tween 的对象
* @returns {Tween} Tween对象本身
* @version
* @platform Web,Native
*/
public set(props: any, target = null): Tween {
//更新当前数据,保证缓动流畅性
this._appendQueueProps(props);
// console.log(this._target.x)
return this._addAction({ f: this._set, o: this, p: [props, target ? target : this._target] });
}
/**
* Execute
* @param tween {Tween} The Tween object to be operated. Default: this
* @returns {Tween} Tween object itself
* @version
* @platform Web,Native
* @language en_US
*/
/**
* 执行
* @param tween {Tween} 需要操作的 Tween 对象,默认this
* @returns {Tween} Tween对象本身
* @version
* @platform Web,Native
* @language zh_CN
*/
public play(tween?: Tween): Tween {
if (!tween) {
tween = this;
}
return this.call(tween.setPaused, tween, [false]);
}
/**
* Pause
* @param tween {Tween} The Tween object to be operated. Default: this
* @returns {Tween} Tween object itself
* @version
* @platform Web,Native
* @language en_US
*/
/**
* 暂停
* @param tween {Tween} 需要操作的 Tween 对象,默认this
* @returns {Tween} Tween对象本身
* @version
* @platform Web,Native
* @language zh_CN
*/
public pause(tween?: Tween): Tween {
if (!tween) {
tween = this;
}
return this.call(tween.setPaused, tween, [true]);
}
/**
* @method Tween#tick
* @param delta {number}
* @private
* @version
* @platform Web,Native
*/
public $tick(delta: number): void {
if (this.paused) {
return;
}
this.setPosition(this._prevPosition + delta);
}
}
/**
* Created by rockyl on 2019-11-14.
*/
export * from './Tween'
export * from './Ease'
import * as constant from './2d/const';
//具体导出哪些,看情况
export { Component } from "./2d/component/Component";
export * from "./2d/display";
export * from "./2d/events";
......@@ -10,7 +8,7 @@ export { default as Graphics } from "./2d/graphics/Graphics";
export { Shape } from "./2d/graphics/Shape";
export { Loader } from "./2d/loader/Loader";
export { Loader, globalLoader } from "./2d/loader/Loader";
export { Matrix } from "./2d/math/Matrix";
export { Point } from "./2d/math/Point";
......@@ -25,6 +23,7 @@ export * from "./2d/texture";
export * from "./2d/ui";
export * from './2d/tween'
export { default as toDisplayDataURL } from "./2d/utils/toDisplayDataURL";
......
......@@ -3,7 +3,7 @@
*/
import {Event, MouseEvent} from "../../2d/events";
import {Event, EventDispatcher, MouseEvent} from "../../2d/events";
import {HashObject} from "../../2d/HashObject";
import {executeBehavior} from "../behavior-runtime";
......@@ -16,6 +16,10 @@ const eventsMapping = {
[MouseEvent.MOUSE_UP]: 'touchend',
};
export const globalEvent = new EventDispatcher();
export const DATA_CENTER_EVENT: string = 'DATA_CENTER_EVENT';
/**
* 应用事件委托
* @param ctor
......@@ -27,7 +31,7 @@ export function applyEvents(ctor: Function) {
this.addEventListener(k, eventsProxy.onEvent, eventsProxy);
}
eventsProxy.invoke('init', this);
globalEvent.addEventListener(DATA_CENTER_EVENT, eventsProxy.onDateCenterEvent, eventsProxy);
};
}
......@@ -38,7 +42,11 @@ class EventsProxy extends HashObject {
super();
}
invoke(name, target) {
start() {
this.invoke('init', this);
}
invoke(name, target, payload?) {
if (this.eventsConfig) {
const eventConfig = this.eventsConfig[name];
if (eventConfig) {
......@@ -52,8 +60,12 @@ class EventsProxy extends HashObject {
onEvent(e) {
let eventName = eventsMapping[e.type];
if (eventName) {
this.invoke(eventName, e.target);
this.invoke(eventName, e.target, e.data);
}
}
onDateCenterEvent(e) {
this.invoke('datacenter', this, e.data);
}
destroy(): void {
......
......@@ -9,6 +9,8 @@ import {instantiate} from "./view-interpreter";
import {dataCenter, DataCenter} from "./data-center";
import {setProcessMetaLibs} from "../behavior-runtime";
import {registerScripts} from "..";
import {Tween} from "../../2d/tween";
import {Rect} from "./nodes";
/**
* 游戏舞台
......@@ -16,6 +18,7 @@ import {registerScripts} from "..";
export class GameStage extends Container {
private _sceneContainer: StackContainer; //场景容器
private _popupContainer: StackContainer; //弹层容器
private _blackLayer: Rect;
private _stage;
private _dataCenter: DataCenter;
......@@ -33,11 +36,22 @@ export class GameStage extends Container {
this['percentHeight'] = 100;
this.mouseEnabled = false;
this.addChild(this._sceneContainer = new StackContainer());
let blackLayer = this._blackLayer = new Rect();
this.addChild(this._sceneContainer = new StackContainer(false));
this.addChild(blackLayer);
this.addChild(this._popupContainer = new StackContainer());
blackLayer['percentWidth'] = 100;
blackLayer['percentHeight'] = 100;
blackLayer.visible = false;
blackLayer.fillColor = 0;
blackLayer.alpha = 0.7;
this._sceneContainer.name = 'scene-container';
this._popupContainer.name = 'popup-container';
this._popupContainer.addEventListener('change', this.onPopupContainerChange, this);
}
/**
......@@ -83,6 +97,9 @@ export class GameStage extends Container {
*/
start() {
const {options, dataMapping, processes, builtinProcesses, scripts} = this._config;
Stage.addUpdateObj(Tween);
registerScripts(scripts);
this.dataCenter.registerDataMapping(dataMapping);
setProcessMetaLibs(processes, builtinProcesses);
......@@ -103,4 +120,29 @@ export class GameStage extends Container {
getViewConfigByName(name) {
return this._config.views.find(view => view.name === name);
}
/**
* 设置半透明层是否可见
* @param visible
*/
setBlackLayerVisible(visible) {
this._blackLayer.visible = visible;
}
onPopupContainerChange(e) {
const {action, view, options} = e.data;
switch (action) {
case 'push':
case 'replace':
case 'popAll':
if(options.center){
view.horizonCenter = 0;
view.verticalCenter = 0;
}
break;
}
this.setBlackLayerVisible(this._popupContainer.children.length > 0);
}
}
......@@ -8,9 +8,13 @@ import {Container, DisplayObject} from "../../2d/display";
* 栈式视图容器
*/
export class StackContainer extends Container {
constructor(){
private _mutex: boolean;
constructor(mutex = true) {
super();
this._mutex = mutex;
this['percentWidth'] = 100;
this['percentHeight'] = 100;
this.mouseEnabled = false;
......@@ -19,18 +23,29 @@ export class StackContainer extends Container {
/**
* 推入视图
* @param view
* @param options
* @param dispatch
*/
push(view: DisplayObject) {
push(view: DisplayObject, options?, dispatch = true) {
if(this._mutex){
this.removeChildren();
}
this.addChild(view);
if (dispatch) {
this.dispatchEvent('change', {action: 'push', view, options});
}
}
/**
* 替换顶层视图
* @param view
* @param options
*/
replace(view: DisplayObject) {
replace(view: DisplayObject, options?) {
if (this.pop()) {
this.push(view);
this.dispatchEvent('change', {action: 'replace', view, options});
this.push(view, options, false);
}
}
......@@ -43,15 +58,20 @@ export class StackContainer extends Container {
return false;
}
this.removeChildAt(len - 1);
this.dispatchEvent('change', {action: 'pop'});
return true;
}
/**
* 撤出全部视图
* @param view
* @param options
*/
popAll(view: DisplayObject) {
popAll(view?: DisplayObject, options?) {
this.removeChildren();
this.push(view);
this.dispatchEvent('change', {action: 'popAll', view, options});
if(view){
this.push(view, options, false);
}
}
}
......@@ -5,6 +5,7 @@
*/
import {EventDispatcher} from "../../2d/events";
import {arrayFind} from "../utils";
import {DATA_CENTER_EVENT, globalEvent} from "../decorators/events";
/**
* 数据中心
......@@ -22,7 +23,7 @@ export class DataCenter extends EventDispatcher {
* @param name
* @param origin
*/
registerGroup(name, origin) {
registerGroup(name, origin?) {
this.store[name] = origin || {};
}
......@@ -52,7 +53,7 @@ export class DataCenter extends EventDispatcher {
try {
return func(this.store);
} catch (e) {
console.warn(e);
//console.warn(e);
if (throwException) {
throw e;
}
......@@ -89,7 +90,7 @@ export class DataCenter extends EventDispatcher {
let group = this.getGroup(name);
if (!group) {
return;
this.registerGroup(name);
}
if (data) {
if (path) {
......@@ -115,6 +116,12 @@ export class DataCenter extends EventDispatcher {
}
}
}
globalEvent.dispatchEvent(DATA_CENTER_EVENT, {
name,
path,
data,
})
}
/**
......
......@@ -41,6 +41,7 @@ function instantiateView(config) {
if (events) {
node.eventsProxy.eventsConfig = events;
}
node.eventsProxy.start();
if (children && children.length > 0) {
for (let childConfig of children) {
......
......@@ -4,3 +4,8 @@
export * from './launcher'
export * from './decorators/scripts'
import {instantiate} from './game-warpper/view-interpreter'
export {
instantiate
}
......@@ -8,6 +8,8 @@ import {GameStage} from "./game-warpper";
import {setGlobalContext} from "./behavior-runtime";
import {globalLoader} from "../2d/loader/Loader";
export let gameStage;
export function launch(url, onAssetsProgress, onAssetsComplete) {
return new Promise((resolve, reject) => {
globalLoader.loadJson((s, payload) => {
......@@ -38,7 +40,7 @@ export function launchWithConfig(config, onAssetsProgress, onAssetsComplete) {
);
Stage.flushAll();
let gameStage = new GameStage(stage);
gameStage = new GameStage(stage);
setGlobalContext({
gameStage
});
......
{
"compilerOptions": {
"module": "commonjs",
"module": "ES2015",
"target": "es5",
"noImplicitAny": false,
"sourceMap": true,
"removeComments": true,
"noEmitOnError": true,
// "declarationDir": "types",
//"declaration": true,
"declarationDir": "types",
"declaration": true,
"experimentalDecorators": true,
"outDir": "dist",
"outDir": "dist-m",
"lib": [
"es5",
"dom",
......
......@@ -5,11 +5,11 @@ var webpack = require('webpack')
module.exports = {
entry: {
"render.min": "./src/index.ts",
"index": "./src/index.ts",
},
output: {
path: __dirname,
filename: "build/[name].js",
filename: "dist/[name].js",
libraryTarget: 'umd',
library: 'render',
},
......
......@@ -71,6 +71,11 @@
resolved "https://registry.npm.taobao.org/@protobufjs/utf8/download/@protobufjs/utf8-1.1.0.tgz#a777360b5b39a1a2e5106f8e858f2fd2d060c570"
integrity sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA=
"@types/detect-indent@0.1.30":
version "0.1.30"
resolved "https://registry.npm.taobao.org/@types/detect-indent/download/@types/detect-indent-0.1.30.tgz#dc682bb412b4e65ba098e70edad73b4833fb910d"
integrity sha1-3GgrtBK05lugmOcO2tc7SDP7kQ0=
"@types/estree@0.0.39":
version "0.0.39"
resolved "https://registry.npm.taobao.org/@types/estree/download/@types/estree-0.0.39.tgz?cache=0&sync_timestamp=1572461973040&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40types%2Festree%2Fdownload%2F%40types%2Festree-0.0.39.tgz#e177e699ee1b8c22d23174caaa7422644389509f"
......@@ -81,6 +86,14 @@
resolved "https://registry.npm.taobao.org/@types/events/download/@types/events-3.0.0.tgz#2862f3f58a9a7f7c3e78d79f130dd4d71c25c2a7"
integrity sha1-KGLz9Yqaf3w+eNefEw3U1xwlwqc=
"@types/glob@5.0.30":
version "5.0.30"
resolved "https://registry.npm.taobao.org/@types/glob/download/@types/glob-5.0.30.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40types%2Fglob%2Fdownload%2F%40types%2Fglob-5.0.30.tgz#1026409c5625a8689074602808d082b2867b8a51"
integrity sha1-ECZAnFYlqGiQdGAoCNCCsoZ7ilE=
dependencies:
"@types/minimatch" "*"
"@types/node" "*"
"@types/glob@^7.1.1":
version "7.1.1"
resolved "https://registry.npm.taobao.org/@types/glob/download/@types/glob-7.1.1.tgz#aa59a1c6e3fbc421e07ccd31a944c30eba521575"
......@@ -100,11 +113,21 @@
resolved "https://registry.npm.taobao.org/@types/minimatch/download/@types/minimatch-3.0.3.tgz#3dca0e3f33b200fc7d1139c0cd96c1268cadfd9d"
integrity sha1-PcoOPzOyAPx9ETnAzZbBJoyt/Z0=
"@types/mkdirp@0.3.29":
version "0.3.29"
resolved "https://registry.npm.taobao.org/@types/mkdirp/download/@types/mkdirp-0.3.29.tgz#7f2ad7ec55f914482fc9b1ec4bb1ae6028d46066"
integrity sha1-fyrX7FX5FEgvybHsS7GuYCjUYGY=
"@types/node@*":
version "12.12.6"
resolved "https://registry.npm.taobao.org/@types/node/download/@types/node-12.12.6.tgz?cache=0&sync_timestamp=1572988029041&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40types%2Fnode%2Fdownload%2F%40types%2Fnode-12.12.6.tgz#a47240c10d86a9a57bb0c633f0b2e0aea9ce9253"
integrity sha1-pHJAwQ2GqaV7sMYz8LLgrqnOklM=
"@types/node@8.0.0":
version "8.0.0"
resolved "https://registry.npm.taobao.org/@types/node/download/@types/node-8.0.0.tgz?cache=0&sync_timestamp=1573849692043&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40types%2Fnode%2Fdownload%2F%40types%2Fnode-8.0.0.tgz#acaa89247afddc7967e9902fd11761dadea1a555"
integrity sha1-rKqJJHr93Hln6ZAv0Rdh2t6hpVU=
"@types/node@^10.1.0":
version "10.17.4"
resolved "https://registry.npm.taobao.org/@types/node/download/@types/node-10.17.4.tgz?cache=0&sync_timestamp=1572988029041&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40types%2Fnode%2Fdownload%2F%40types%2Fnode-10.17.4.tgz#8993a4fe3c4022fda66bf4ea660d615fc5659c6f"
......@@ -800,7 +823,7 @@ color-name@1.1.3:
resolved "https://registry.npm.taobao.org/color-name/download/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25"
integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=
commander@^2.20.0, commander@~2.20.3:
commander@^2.20.0, commander@^2.9.0, commander@~2.20.3:
version "2.20.3"
resolved "https://registry.npm.taobao.org/commander/download/commander-2.20.3.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcommander%2Fdownload%2Fcommander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33"
integrity sha1-/UhehMA+tIgcIHIrpIA16FMa6zM=
......@@ -1104,6 +1127,14 @@ detect-file@^1.0.0:
resolved "https://registry.npm.taobao.org/detect-file/download/detect-file-1.0.0.tgz#f0d66d03672a825cb1b73bdb3fe62310c8e552b7"
integrity sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc=
detect-indent@^0.2.0:
version "0.2.0"
resolved "https://registry.npm.taobao.org/detect-indent/download/detect-indent-0.2.0.tgz#042914498979ac2d9f3c73e4ff3e6877d3bc92b6"
integrity sha1-BCkUSYl5rC2fPHPk/z5od9O8krY=
dependencies:
get-stdin "^0.1.0"
minimist "^0.1.0"
detect-libc@^1.0.2:
version "1.0.3"
resolved "https://registry.npm.taobao.org/detect-libc/download/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b"
......@@ -1148,6 +1179,20 @@ domain-browser@^1.1.1:
resolved "https://registry.npm.taobao.org/domain-browser/download/domain-browser-1.2.0.tgz#3d31f50191a6749dd1375a7f522e823d42e54eda"
integrity sha1-PTH1AZGmdJ3RN1p/Ui6CPULlTto=
dts-bundle@^0.7.3:
version "0.7.3"
resolved "https://registry.npm.taobao.org/dts-bundle/download/dts-bundle-0.7.3.tgz#372b7bb69c820782e6382f400739a69dced3d59a"
integrity sha1-Nyt7tpyCB4LmOC9ABzmmnc7T1Zo=
dependencies:
"@types/detect-indent" "0.1.30"
"@types/glob" "5.0.30"
"@types/mkdirp" "0.3.29"
"@types/node" "8.0.0"
commander "^2.9.0"
detect-indent "^0.2.0"
glob "^6.0.4"
mkdirp "^0.5.0"
duplexify@^3.4.2, duplexify@^3.6.0:
version "3.7.1"
resolved "https://registry.npm.taobao.org/duplexify/download/duplexify-3.7.1.tgz#2a4df5317f6ccfd91f86d6fd25d8d8a103b88309"
......@@ -1452,6 +1497,15 @@ find-cache-dir@^2.1.0:
make-dir "^2.0.0"
pkg-dir "^3.0.0"
find-cache-dir@^3.0.0:
version "3.1.0"
resolved "https://registry.npm.taobao.org/find-cache-dir/download/find-cache-dir-3.1.0.tgz?cache=0&sync_timestamp=1573277838864&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ffind-cache-dir%2Fdownload%2Ffind-cache-dir-3.1.0.tgz#9935894999debef4cf9f677fdf646d002c4cdecb"
integrity sha1-mTWJSZnevvTPn2d/32RtACxM3ss=
dependencies:
commondir "^1.0.1"
make-dir "^3.0.0"
pkg-dir "^4.1.0"
find-up@^3.0.0:
version "3.0.0"
resolved "https://registry.npm.taobao.org/find-up/download/find-up-3.0.0.tgz#49169f1d7993430646da61ecc5ae355c21c97b73"
......@@ -1459,6 +1513,14 @@ find-up@^3.0.0:
dependencies:
locate-path "^3.0.0"
find-up@^4.0.0:
version "4.1.0"
resolved "https://registry.npm.taobao.org/find-up/download/find-up-4.1.0.tgz#97afe7d6cdc0bc5928584b7c8d7b16e8a9aa5d19"
integrity sha1-l6/n1s3AvFkoWEt8jXsW6KmqXRk=
dependencies:
locate-path "^5.0.0"
path-exists "^4.0.0"
findup-sync@3.0.0:
version "3.0.0"
resolved "https://registry.npm.taobao.org/findup-sync/download/findup-sync-3.0.0.tgz#17b108f9ee512dfb7a5c7f3c8b27ea9e1a9c08d1"
......@@ -1514,6 +1576,15 @@ from2@^2.1.0:
inherits "^2.0.1"
readable-stream "^2.0.0"
fs-extra@8.1.0:
version "8.1.0"
resolved "https://registry.npm.taobao.org/fs-extra/download/fs-extra-8.1.0.tgz#49d43c45a88cd9677668cb7be1b46efdb8d2e1c0"
integrity sha1-SdQ8RaiM2Wd2aMt74bRu/bjS4cA=
dependencies:
graceful-fs "^4.2.0"
jsonfile "^4.0.0"
universalify "^0.1.0"
fs-minipass@^1.2.5:
version "1.2.7"
resolved "https://registry.npm.taobao.org/fs-minipass/download/fs-minipass-1.2.7.tgz#ccff8570841e7fe4265693da88936c55aed7f7c7"
......@@ -1573,6 +1644,11 @@ get-caller-file@^2.0.1:
resolved "https://registry.npm.taobao.org/get-caller-file/download/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e"
integrity sha1-T5RBKoLbMvNuOwuXQfipf+sDH34=
get-stdin@^0.1.0:
version "0.1.0"
resolved "https://registry.npm.taobao.org/get-stdin/download/get-stdin-0.1.0.tgz#5998af24aafc802d15c82c685657eeb8b10d4a91"
integrity sha1-WZivJKr8gC0VyCxoVlfuuLENSpE=
get-stream@^4.0.0:
version "4.1.0"
resolved "https://registry.npm.taobao.org/get-stream/download/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5"
......@@ -1593,6 +1669,17 @@ glob-parent@^3.1.0:
is-glob "^3.1.0"
path-dirname "^1.0.0"
glob@^6.0.4:
version "6.0.4"
resolved "https://registry.npm.taobao.org/glob/download/glob-6.0.4.tgz?cache=0&sync_timestamp=1573078079496&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fglob%2Fdownload%2Fglob-6.0.4.tgz#0f08860f6a155127b2fadd4f9ce24b1aab6e4d22"
integrity sha1-DwiGD2oVUSey+t1PnOJLGqtuTSI=
dependencies:
inflight "^1.0.4"
inherits "2"
minimatch "2 || 3"
once "^1.3.0"
path-is-absolute "^1.0.0"
glob@^7.0.3, glob@^7.1.3, glob@^7.1.4:
version "7.1.5"
resolved "https://registry.npm.taobao.org/glob/download/glob-7.1.5.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fglob%2Fdownload%2Fglob-7.1.5.tgz#6714c69bee20f3c3e64c4dd905553e532b40cdc0"
......@@ -1605,6 +1692,18 @@ glob@^7.0.3, glob@^7.1.3, glob@^7.1.4:
once "^1.3.0"
path-is-absolute "^1.0.0"
glob@^7.1.6:
version "7.1.6"
resolved "https://registry.npm.taobao.org/glob/download/glob-7.1.6.tgz?cache=0&sync_timestamp=1573078121947&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fglob%2Fdownload%2Fglob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6"
integrity sha1-FB8zuBp8JJLhJVlDB0gMRmeSeKY=
dependencies:
fs.realpath "^1.0.0"
inflight "^1.0.4"
inherits "2"
minimatch "^3.0.4"
once "^1.3.0"
path-is-absolute "^1.0.0"
global-modules@2.0.0:
version "2.0.0"
resolved "https://registry.npm.taobao.org/global-modules/download/global-modules-2.0.0.tgz#997605ad2345f27f51539bea26574421215c7780"
......@@ -1652,7 +1751,7 @@ globby@^6.1.0:
pify "^2.0.0"
pinkie-promise "^2.0.0"
graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2:
graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0:
version "4.2.3"
resolved "https://registry.npm.taobao.org/graceful-fs/download/graceful-fs-4.2.3.tgz#4a12ff1b60376ef09862c2093edd908328be8423"
integrity sha1-ShL/G2A3bvCYYsIJPt2Qgyi+hCM=
......@@ -2171,6 +2270,13 @@ json5@^1.0.1:
dependencies:
minimist "^1.2.0"
jsonfile@^4.0.0:
version "4.0.0"
resolved "https://registry.npm.taobao.org/jsonfile/download/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb"
integrity sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=
optionalDependencies:
graceful-fs "^4.1.6"
killable@^1.0.1:
version "1.0.1"
resolved "https://registry.npm.taobao.org/killable/download/killable-1.0.1.tgz#4c8ce441187a061c7474fb87ca08e2a638194892"
......@@ -2229,6 +2335,13 @@ locate-path@^3.0.0:
p-locate "^3.0.0"
path-exists "^3.0.0"
locate-path@^5.0.0:
version "5.0.0"
resolved "https://registry.npm.taobao.org/locate-path/download/locate-path-5.0.0.tgz#1afba396afd676a6d42504d0a67a3a7eb9f62aa0"
integrity sha1-Gvujlq/WdqbUJQTQpno6frn2KqA=
dependencies:
p-locate "^4.1.0"
lodash@^4.17.11, lodash@^4.17.14:
version "4.17.15"
resolved "https://registry.npm.taobao.org/lodash/download/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548"
......@@ -2266,6 +2379,13 @@ make-dir@^2.0.0:
pify "^4.0.1"
semver "^5.6.0"
make-dir@^3.0.0:
version "3.0.0"
resolved "https://registry.npm.taobao.org/make-dir/download/make-dir-3.0.0.tgz#1b5f39f6b9270ed33f9f054c5c0f84304989f801"
integrity sha1-G1859rknDtM/nwVMXA+EMEmJ+AE=
dependencies:
semver "^6.0.0"
mamacro@^0.0.3:
version "0.0.3"
resolved "https://registry.npm.taobao.org/mamacro/download/mamacro-0.0.3.tgz#ad2c9576197c9f1abf308d0787865bd975a3f3e4"
......@@ -2413,7 +2533,7 @@ minimalistic-crypto-utils@^1.0.0, minimalistic-crypto-utils@^1.0.1:
resolved "https://registry.npm.taobao.org/minimalistic-crypto-utils/download/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a"
integrity sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=
minimatch@^3.0.4:
"minimatch@2 || 3", minimatch@^3.0.4:
version "3.0.4"
resolved "https://registry.npm.taobao.org/minimatch/download/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083"
integrity sha1-UWbihkV/AzBgZL5Ul+jbsMPTIIM=
......@@ -2425,6 +2545,11 @@ minimist@0.0.8:
resolved "https://registry.npm.taobao.org/minimist/download/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d"
integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=
minimist@^0.1.0:
version "0.1.0"
resolved "https://registry.npm.taobao.org/minimist/download/minimist-0.1.0.tgz#99df657a52574c21c9057497df742790b2b4c0de"
integrity sha1-md9lelJXTCHJBXSX33QnkLK0wN4=
minimist@^1.2.0:
version "1.2.0"
resolved "https://registry.npm.taobao.org/minimist/download/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284"
......@@ -2790,7 +2915,7 @@ p-is-promise@^2.0.0:
resolved "https://registry.npm.taobao.org/p-is-promise/download/p-is-promise-2.1.0.tgz#918cebaea248a62cf7ffab8e3bca8c5f882fc42e"
integrity sha1-kYzrrqJIpiz3/6uOO8qMX4gvxC4=
p-limit@^2.0.0:
p-limit@^2.0.0, p-limit@^2.2.0:
version "2.2.1"
resolved "https://registry.npm.taobao.org/p-limit/download/p-limit-2.2.1.tgz#aa07a788cc3151c939b5131f63570f0dd2009537"
integrity sha1-qgeniMwxUck5tRMfY1cPDdIAlTc=
......@@ -2804,6 +2929,13 @@ p-locate@^3.0.0:
dependencies:
p-limit "^2.0.0"
p-locate@^4.1.0:
version "4.1.0"
resolved "https://registry.npm.taobao.org/p-locate/download/p-locate-4.1.0.tgz#a3428bb7088b3a60292f66919278b7c297ad4f07"
integrity sha1-o0KLtwiLOmApL2aRkni3wpetTwc=
dependencies:
p-limit "^2.2.0"
p-map@^2.0.0:
version "2.1.0"
resolved "https://registry.npm.taobao.org/p-map/download/p-map-2.1.0.tgz#310928feef9c9ecc65b68b17693018a665cea175"
......@@ -2877,6 +3009,11 @@ path-exists@^3.0.0:
resolved "https://registry.npm.taobao.org/path-exists/download/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515"
integrity sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=
path-exists@^4.0.0:
version "4.0.0"
resolved "https://registry.npm.taobao.org/path-exists/download/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3"
integrity sha1-UTvb4tO5XXdi6METfvoZXGxhtbM=
path-is-absolute@^1.0.0:
version "1.0.1"
resolved "https://registry.npm.taobao.org/path-is-absolute/download/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f"
......@@ -2942,6 +3079,13 @@ pkg-dir@^3.0.0:
dependencies:
find-up "^3.0.0"
pkg-dir@^4.1.0:
version "4.2.0"
resolved "https://registry.npm.taobao.org/pkg-dir/download/pkg-dir-4.2.0.tgz#f099133df7ede422e81d1d8448270eeb3e4261f3"
integrity sha1-8JkTPfft5CLoHR2ESCcO6z5CYfM=
dependencies:
find-up "^4.0.0"
portfinder@^1.0.25:
version "1.0.25"
resolved "https://registry.npm.taobao.org/portfinder/download/portfinder-1.0.25.tgz#254fd337ffba869f4b9d37edc298059cb4d35eca"
......@@ -3221,7 +3365,7 @@ resolve-url@^0.2.1:
resolved "https://registry.npm.taobao.org/resolve-url/download/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a"
integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=
resolve@^1.10.0, resolve@^1.11.0, resolve@^1.11.1:
resolve@1.12.0, resolve@^1.10.0, resolve@^1.11.0, resolve@^1.11.1:
version "1.12.0"
resolved "https://registry.npm.taobao.org/resolve/download/resolve-1.12.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fresolve%2Fdownload%2Fresolve-1.12.0.tgz#3fc644a35c84a48554609ff26ec52b66fa577df6"
integrity sha1-P8ZEo1yEpIVUYJ/ybsUrZvpXffY=
......@@ -3282,6 +3426,17 @@ rollup-plugin-progress@^1.1.1:
dependencies:
chalk "^2.4.2"
rollup-plugin-typescript2@^0.25.2:
version "0.25.2"
resolved "https://registry.npm.taobao.org/rollup-plugin-typescript2/download/rollup-plugin-typescript2-0.25.2.tgz?cache=0&sync_timestamp=1573000524262&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Frollup-plugin-typescript2%2Fdownload%2Frollup-plugin-typescript2-0.25.2.tgz#1a165df08560902da45b355413464caca1765d3a"
integrity sha1-GhZd8IVgkC2kWzVUE0ZMrKF2XTo=
dependencies:
find-cache-dir "^3.0.0"
fs-extra "8.1.0"
resolve "1.12.0"
rollup-pluginutils "2.8.1"
tslib "1.10.0"
rollup-plugin-typescript@^1.0.1:
version "1.0.1"
resolved "https://registry.npm.taobao.org/rollup-plugin-typescript/download/rollup-plugin-typescript-1.0.1.tgz#86565033b714c3d1f3aba510aad3dc519f7091e9"
......@@ -3300,6 +3455,13 @@ rollup-plugin-uglify@^6.0.3:
serialize-javascript "^1.9.0"
uglify-js "^3.4.9"
rollup-pluginutils@2.8.1:
version "2.8.1"
resolved "https://registry.npm.taobao.org/rollup-pluginutils/download/rollup-pluginutils-2.8.1.tgz#8fa6dd0697344938ef26c2c09d2488ce9e33ce97"
integrity sha1-j6bdBpc0STjvJsLAnSSIzp4zzpc=
dependencies:
estree-walker "^0.6.1"
rollup-pluginutils@^2.5.0, rollup-pluginutils@^2.8.1:
version "2.8.2"
resolved "https://registry.npm.taobao.org/rollup-pluginutils/download/rollup-pluginutils-2.8.2.tgz#72f2af0748b592364dbd3389e600e5a9444a351e"
......@@ -3367,7 +3529,7 @@ semver@^5.0.1, semver@^5.3.0, semver@^5.5.0, semver@^5.6.0:
resolved "https://registry.npm.taobao.org/semver/download/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7"
integrity sha1-qVT5Ma66UI0we78Gnv8MAclhFvc=
semver@^6.3.0:
semver@^6.0.0, semver@^6.3.0:
version "6.3.0"
resolved "https://registry.npm.taobao.org/semver/download/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d"
integrity sha1-7gpkyK9ejO6mdoexM3YeG+y9HT0=
......@@ -3843,7 +4005,7 @@ ts-loader@^4.0.0:
micromatch "^3.1.4"
semver "^5.0.1"
tslib@^1.9.0:
tslib@1.10.0, tslib@^1.9.0:
version "1.10.0"
resolved "https://registry.npm.taobao.org/tslib/download/tslib-1.10.0.tgz#c3c19f95973fb0a62973fb09d90d961ee43e5c8a"
integrity sha1-w8GflZc/sKYpc/sJ2Q2WHuQ+XIo=
......@@ -3926,6 +4088,11 @@ unique-slug@^2.0.0:
dependencies:
imurmurhash "^0.1.4"
universalify@^0.1.0:
version "0.1.2"
resolved "https://registry.npm.taobao.org/universalify/download/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66"
integrity sha1-tkb2m+OULavOzJ1mOcgNwQXvqmY=
unpipe@1.0.0, unpipe@~1.0.0:
version "1.0.0"
resolved "https://registry.npm.taobao.org/unpipe/download/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment