Skip to content

Commit

Permalink
Merge pull request #3 from InDIOS/development
Browse files Browse the repository at this point in the history
Bump to version 0.0.3
  • Loading branch information
InDIOS authored Oct 29, 2018
2 parents f12c6ee + 38e0ba3 commit 84e0ca0
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 22 deletions.
7 changes: 7 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.eslintrc.json
.gitignore
src/
package-lock.json
tsconfig.json
tslint.json
rollup.config.js
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 16 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,28 @@
{
"name": "trebor-tools",
"version": "0.0.2",
"version": "0.0.3",
"description": "",
"main": "index.js",
"scripts": {
"compile": "tsc -p . -w",
"build": "tsc -p . && rollup -c rollup.config.js"
},
"keywords": [],
"author": "InDIOS",
"license": "MIT",
"dependencies": {},
"devDependencies": {
"rollup": "^0.66.2",
"typescript": "^3.1.1"
}
"rollup": "^0.66.6",
"typescript": "^3.1.3"
},
"author": "InDIOS",
"repository": {
"type": "git",
"url": "git+https://github.com/InDIOS/trebor-tools.git"
},
"license": "MIT",
"contributors": [
{
"email": "[email protected]",
"name": "Roberto Asiel Guevara Castañeda"
}
]
}
5 changes: 2 additions & 3 deletions src/baseComp.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { _$List } from './list';
import { _$getValue } from './dom';
import { _$each, _$define, PROP_MAP, TPS, _$assign, _$isType, _$isString, _$isFunction, _$hasProp, _$toType, _$directive, _$isArray, _$toPlainObject, _$accesor, _$subscribers, _$isValueAttr, _$toString, _$extends } from './utilities';

const PROPS = ['$slots', '$refs', '$filters', '$directives', '_events', '_watchers'];
import { PROPS, PROP_MAP, TPS } from './constants';
import { _$each, _$define, _$assign, _$isType, _$isString, _$isFunction, _$hasProp, _$toType, _$directive, _$isArray, _$toPlainObject, _$accesor, _$subscribers, _$isValueAttr, _$toString, _$extends } from './utilities';

function _$BaseComponent(attrs: AttrParams, template: TemplateFn, options: ComponentOptions, parent: Component) {
const self = this;
Expand Down
5 changes: 5 additions & 0 deletions src/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export const PROPS = ['$slots', '$refs', '$filters', '$directives', '_events', '_watchers'];

export const PROP_MAP = { p: '__TP__', v: 'value', _: '_value', s: '_subscribers', e: '_events', w: '_watchers', h: 'prototype' };

export const TPS: { options: ObjectLike<any>, fn: PluginFn }[] = window[PROP_MAP.p] || (window[PROP_MAP.p] = []);
3 changes: 2 additions & 1 deletion src/dom.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { _$List } from './list';
import { _$toString, _$isString, _$isType, _$isValueAttr, PROP_MAP, _$hasProp } from './utilities';
import { PROP_MAP } from './constants';
import { _$toString, _$isString, _$isType, _$isValueAttr, _$hasProp } from './utilities';

export function _$select(selector: string | Element, parent?: Element): HTMLElement {
return _$isString(selector) ? (parent || document).querySelector(<string>selector) : <HTMLElement>selector;
Expand Down
3 changes: 2 additions & 1 deletion src/list.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { PROP_MAP, _$isType, _$isArray, _$define, _$assign, _$extends, _$dispatch } from './utilities';
import { PROP_MAP } from './constants';
import { _$isType, _$isArray, _$define, _$assign, _$extends, _$dispatch } from './utilities';

const array = Array[PROP_MAP.h];
export function _$toArgs(args: IArguments, start: number = 0): any[] {
Expand Down
17 changes: 7 additions & 10 deletions src/utilities.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { PROP_MAP } from './constants';
import { _$toArgs, _$List } from './list';
import { _$el, _$getAttr, _$setAttr, _$select, _$assignEl, _$removeEl } from './dom';

Expand All @@ -8,16 +9,12 @@ function _$toLowerCase(str: string) {
export function devlog(type: 'info' | 'warn' | 'error', ...msgs: any[]) {
console[type](...msgs);
}

export const PROP_MAP = { p: '__TP__', v: 'value', _: '_value', s: '_subscribers', e: '_events', w: '_watchers', h: 'prototype' };
export const TPS: { options: ObjectLike<any>, fn: PluginFn }[] = window[PROP_MAP.p] || (window[PROP_MAP.p] = []);

export const _$assign = Object['assign'] || function (t: Object) {
for (let s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (const p in s) if (_$hasProp(s, p)) t[p] = s[p];
}
return t;
for (let s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (const p in s) if (_$hasProp(s, p)) t[p] = s[p];
}
return t;
};
export function _$apply(callee: Function, args: any[], globs: any[], thisArg: any = null) {
return callee.apply(thisArg, args.concat(globs));
Expand Down Expand Up @@ -252,7 +249,7 @@ export function _$componentUpdate(parent: Component, Ctor: ComponentConstructor,
if (inst) {
inst = _$addChild(parent, Ctor, attrs);
inst.$create();
inst.$mount(el, sibling);
inst.$mount(el || parent.$parentEl, sibling);
}
}
return [inst, Ctor];
Expand Down

0 comments on commit 84e0ca0

Please sign in to comment.