albio
Advanced tools
Comparing version 1.0.52 to 1.0.53
@@ -14,2 +14,7 @@ 'use strict'; | ||
function $$setAttrData(el, attr, data) { | ||
data = '' + data; | ||
el[attr] = data; | ||
} | ||
function $$text(data) { | ||
@@ -60,2 +65,3 @@ return document.createTextNode(data); | ||
exports.$$invalidate = $$invalidate; | ||
exports.$$setAttrData = $$setAttrData; | ||
exports.$$setData = $$setData; | ||
@@ -62,0 +68,0 @@ exports.$$text = $$text; |
{ | ||
"name": "albio", | ||
"version": "1.0.52", | ||
"version": "1.0.53", | ||
"description": "๐ Tiny compiler-powered reactivity library for sensible web apps", | ||
@@ -5,0 +5,0 @@ "main": "index", |
@@ -1,3 +0,3 @@ | ||
import { Expression } from 'estree'; | ||
import { ASTNode, Binding, Listener } from '../interfaces'; | ||
import { Node, Expression } from 'estree'; | ||
import { ASTNode, Binding, Listener, Reference } from '../interfaces'; | ||
import { CompilerParams } from '../interfaces'; | ||
@@ -10,6 +10,8 @@ export default abstract class Component { | ||
listeners: Listener[]; | ||
references: Reference[]; | ||
identifiers: string[]; | ||
constructor(parsed: CompilerParams); | ||
abstract populateDeps(...args: any): void; | ||
abstract render_handler_func(...args: any): Node[]; | ||
dirty(names: string[], props: string[]): Expression; | ||
} |
@@ -1,2 +0,2 @@ | ||
import { ASTNode, Binding, EachBlock, IterableKey } from '../interfaces'; | ||
import { ASTNode, Binding, EachBlock, IterableKey, Props, Reference } from '../interfaces'; | ||
import { Node } from 'estree'; | ||
@@ -16,2 +16,3 @@ import BlockComponent from './Block'; | ||
render_each_for(reset: boolean, node: Node | Node[]): Node[]; | ||
render_handler_func(identifier: string, ref: Reference, event: string[], props: Props): Node[]; | ||
render_each_populate(): Node; | ||
@@ -105,3 +106,3 @@ render_each_create(): Node; | ||
render(props: string[]): Node; | ||
populateDeps(bindings: Binding[], keys: IterableKey[], iterable: string): void; | ||
populateDeps(bindings: Binding[] | Reference[], keys: IterableKey[], iterable: string): void; | ||
} |
import { Node, Statement } from 'estree'; | ||
import { Binding, CompilerParams, Props } from '../interfaces'; | ||
import { Binding, CompilerParams, Props, Reference } from '../interfaces'; | ||
import Component from './Component'; | ||
@@ -10,7 +10,7 @@ import BlockComponent from './Block'; | ||
ast: Node[]; | ||
ctx: any[]; | ||
constructor(parsed: CompilerParams); | ||
invalidateResiduals(ast: Node): void; | ||
render_fragment(blocks: BlockComponent[]): Node[]; | ||
populateDeps(bindings: Binding[]): void; | ||
render_handler_func(identifier: string, ref: Reference, event: string[]): Node[]; | ||
populateDeps(bindings: Binding[] | Reference[]): void; | ||
} |
@@ -68,5 +68,13 @@ import { AnyNode } from 'domhandler'; | ||
} | ||
export interface Reference { | ||
index: number; | ||
var: string; | ||
ref: string; | ||
assoc_events?: string[]; | ||
deps?: string[]; | ||
} | ||
export interface CompilerParams { | ||
nodes: ASTNode[]; | ||
listeners: Listener[]; | ||
references: Reference[]; | ||
props?: Props; | ||
@@ -73,0 +81,0 @@ reactives?: Statement[]; |
@@ -1,8 +0,8 @@ | ||
import { Listener, type ASTNode } from '../interfaces'; | ||
import { Listener, type ASTNode, Reference } from '../interfaces'; | ||
import { Text, Element, Comment, type AnyNode } from 'domhandler'; | ||
export declare function parseTags(nodes: ASTNode[], listeners: Listener[], index: number, tags: AnyNode[], parent?: ASTNode): number; | ||
export declare function parseTags(nodes: ASTNode[], listeners: Listener[], references: Reference[], index: number, tags: AnyNode[], parent?: ASTNode): number; | ||
export declare function parseText(nodes: ASTNode[], index: number, tag: Text, parent?: ASTNode): number; | ||
export declare function addText(nodes: ASTNode[], index: number, value: string, tag: Text, parent?: ASTNode): number; | ||
export declare function addBinding(nodes: ASTNode[], index: number, data: string, tag: AnyNode, parent?: ASTNode): number; | ||
export declare function parseElement(nodes: ASTNode[], listeners: Listener[], index: number, tag: Element, parent?: ASTNode): number; | ||
export declare function parseElement(nodes: ASTNode[], listeners: Listener[], references: Reference[], index: number, tag: Element, parent?: ASTNode): number; | ||
export declare function parseComment(nodes: ASTNode[], index: number, tag: Comment, parent?: ASTNode): number; | ||
@@ -13,2 +13,3 @@ export declare function pruneTrailingWhitespace(nodes: ASTNode[]): void; | ||
listeners: Listener[]; | ||
references: Reference[]; | ||
}; |
import { Node, Identifier } from 'estree'; | ||
import { ASTNode } from './interfaces'; | ||
import { ASTNode, Binding, Reference } from './interfaces'; | ||
export declare const parse: (source: string) => Node; | ||
export declare function isReference(item: Reference | Binding): item is Reference; | ||
export declare function get_associated_events(bound: string): string[]; | ||
export declare function fetchObject(node: Node): Identifier; | ||
@@ -5,0 +7,0 @@ export declare function destringify(str: string): string; |
export declare function $$element(node: any): any; | ||
export declare function $$setData(text: Text, data: any): void; | ||
export declare function $$setAttrData(el: any, attr: string, data: any): void; | ||
export declare function $$text(data: any): Text; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
3899127
33436