🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@ivi/tpl

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ivi/tpl - npm Package Compare versions

Comparing version
3.0.0-rc.0
to
3.0.0
+4
-3
dist/index.d.ts

@@ -17,5 +17,5 @@ import { type VAny } from "ivi";

* - `div =${expr}` - Text Content `element.textContent = expr`
* - `div $${directive}` - Directive `directive(element)`
* - `div $=${expr}` - Element Directive `directive(element, hydrate)`
* - `div $:ssr=${expr}` - Element Directive `directive(element, hydrate)`
*
*
* @example

@@ -47,3 +47,4 @@ *

* - `div =${expr}` - Text Content `element.textContent = expr`
* - `div $${directive}` - Directive `directive(element)`
* - `div $=${expr}` - Element Directive `directive(element, hydrate)`
* - `div $:ssr=${expr}` - Element Directive `directive(element, hydrate)`
*

@@ -50,0 +51,0 @@ * @example

@@ -1,1 +0,1 @@

{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,EACoB,KAAK,IAAI,EAEnC,MAAM,KAAK,CAAC;AAOb;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,eAAO,MAAM,GAAG,YAAa,oBAAoB,YAAY,GAAG,EAAE,SA6BjE,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,eAAO,MAAM,GAAG,YAAa,oBAAoB,YAAY,GAAG,EAAE,SA6BjE,CAAC"}
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,EACoB,KAAK,IAAI,EAEnC,MAAM,KAAK,CAAC;AAOb;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,eAAO,MAAM,GAAG,YAAa,oBAAoB,YAAY,GAAG,EAAE,SA6BjE,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,eAAO,MAAM,GAAG,YAAa,oBAAoB,YAAY,GAAG,EAAE,SA6BjE,CAAC"}

@@ -22,5 +22,5 @@ import { compileTemplate, } from "ivi/template/client";

* - `div =${expr}` - Text Content `element.textContent = expr`
* - `div $${directive}` - Directive `directive(element)`
* - `div $=${expr}` - Element Directive `directive(element, hydrate)`
* - `div $:ssr=${expr}` - Element Directive `directive(element, hydrate)`
*
*
* @example

@@ -79,3 +79,4 @@ *

* - `div =${expr}` - Text Content `element.textContent = expr`
* - `div $${directive}` - Directive `directive(element)`
* - `div $=${expr}` - Element Directive `directive(element, hydrate)`
* - `div $:ssr=${expr}` - Element Directive `directive(element, hydrate)`
*

@@ -82,0 +83,0 @@ * @example

@@ -1,1 +0,1 @@

{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACgC,eAAe,GACrD,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAEL,EAAE,EAAO,GAAG,EAAE,EAAE,EAAO,GAAG,EAAE,GAAG,EAAE,EAAE,GACpC,MAAM,KAAK,CAAC;AACb,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,MAAM,YAAY,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,KAAK,CAAC;AAE1C,MAAM,WAAW,GAAG,IAAI,OAAO,EAAgD,CAAC;AAEhF;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,CAAC,MAAM,GAAG,GAAG,CAAC,OAA6B,EAAE,GAAG,KAAY,EAAE,EAAE;IACpE,IAAI,EAAE,GAAG,WAAW,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IAClC,IAAI,EAAE,KAAK,KAAK,CAAC,EAAE;QACjB,IAAI,MAAM,CAAC;QACX,IAAI;YACF,MAAM,GAAG,GAAG,aAAa,CAAC,OAAO,6BAAqB,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AC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;KACrD;IACD,IAAI,OAAO,CAAC,KAAK,QAAQ,EAAE;QACzB,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC;KACjB;IACD,OAAO,CAAC,CAAC;AACX,CAAC,CAAC"}
{
"name": "@ivi/tpl",
"version": "3.0.0-rc.0",
"version": "3.0.0",
"type": "module",
"exports": {
".": "./dist/index.js",
"./parser": "./dist/parser.js"
"./parser": "./dist/parser.js",
"./package.json": "./package.json"
},

@@ -19,6 +20,6 @@ "sideEffects": false,

"peerDependencies": {
"ivi": "3.0.0-rc.0"
"ivi": "3.0.0"
},
"devDependencies": {
"ivi": "3.0.0-rc.0",
"ivi": "3.0.0",
"@ivi/mock-dom": "0.1.0"

@@ -25,0 +26,0 @@ },

+27
-41
# [ivi](https://github.com/localvoid/ivi) Template Language
`@ivi/tpl` module provides an interface for creating templates with
[tagged templates](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#tagged_templates):
`@ivi/tpl` module provides an interface for creating ivi templates with [templates literals](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#tagged_templates):

@@ -18,5 +17,3 @@ - `htm` creates a template with [HTMLElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement) nodes.

In this example we are creating a root element `<div id="app">` with two
children: `<h1>TemplateExample</h1>` and `<div class="content">{..}</div>`.
In an HTML it could look something like that:
In this example we are creating a root element `<div id="app">` with two children: `<h1>TemplateExample</h1>` and `<div class="content">{..}</div>`. In an HTML it could look something like that:

@@ -32,5 +29,3 @@ ```html

As we can see from this example, indentation level is used for children nesting.
Also, children node can be nested by declaring them on the same line as their
parent. E.g.
As we can see from this example, indentation level is used for children nesting. Also, children node can be nested by declaring them on the same line as their parent. E.g.

@@ -76,4 +71,3 @@ ```js

Static text nodes are declared either with `'text'`, `"text"` or a `#'text'#`
syntax.
Static text nodes are declared either with `'text'`, `"text"` or `#'text'#` syntax.

@@ -116,8 +110,8 @@ Text nodes are escaped automatically:

- [`div =${expr}`](#text-content) - Text Content `element.textContent = expr`.
- [`div &=${directive}`](#directives) - Client-Side Directive `directive(element)`.
- [`div &:ssr=${directive}`](#directives) - Server-Side Directive `directive(element, hydrate)`.
- [`div &=${directive}`](#directives) - Client-Side Element Directive `directive(element)`.
- [`div &:ssr=${directive}`](#directives) - Element Directive that works during Client-Side and Server-Side Rendering `directive(element, hydrate)`.
Element properties can be declared on the same line as element or with an
indentation level.
Element properties can be declared on the same line as element or with an indentation level.
```js

@@ -134,4 +128,3 @@ htm`

Static class names are declared with a `.` character immediately after a tag
name:
Static class names are declared with a `.` character immediately after a tag name:

@@ -148,4 +141,3 @@ ```js

Dynamic class names are declared with an expression immediately after a tag
name:
Dynamic class names are declared with an expression immediately after a tag name:

@@ -172,4 +164,3 @@ ```js

When dynamic attribute has an `undefined` value, it will be removed from the
DOM element with `Element.removeAttribute(..)` method.
When dynamic attribute has an `undefined`, `null` or `false` value, it will be removed from the DOM element with `Element.removeAttribute(..)` method.

@@ -195,4 +186,3 @@ Attribute values are escaped automatically:

Diffing with a DOM value is useful in use cases when we use `<input>` values to
avoid triggering unnecessary `change` events.
Diffing with a DOM value is useful in use cases when we use `<input>` values to avoid triggering unnecessary `input` events.

@@ -202,36 +192,30 @@ ### Styles

- `div ~name='value'` - Static style `<div style="value">`.
- `div ~name=${expr}` - Dynamic style `element.style.setProperty(name, expr)`
- `div ~name=${expr}` - Dynamic style `element.style.setProperty(name, expr)`.
Static styles are automatically merged with `:style="value"` attribute.
Dynamic styles are assigned with a `CSSStyleDeclaration.setProperty(..)`
method.
Dynamic styles are assigned with a `CSSStyleDeclaration.setProperty(..)` method.
When style has an `undefined` value, it will be removed with a
`CSSStyleDeclaration.removeProperty(..)` method.
When style has an `undefined`, `null` or `false` value, it will be removed with `CSSStyleDeclaration.removeProperty(..)` method.
### Events
- `div @name=${expr}` - Event `element.addEventListener(name, expr)`
- `div @name=${expr}` - Event `element.addEventListener(name, expr)`.
Events are assigned with an `EventTarget.addEventListener(..)` method.
When event has an `undefined` value, it will be removed with an
`EventTarget.removeEventListener(..)` method.
When event has an `undefined`, `null` or `false` value, it will be removed with `EventTarget.removeEventListener(..)` method.
### Text Content
- `div =${expr}` - Text Content `element.textContent = expr`
- `div =${expr}` - Text Content `element.textContent = expr`.
Text content property can be used as an optimization that slightly reduces
[memory overhead](#ui-tree-data-structures) for elements with a text child. It
will create a text node with a [`Node.textContent`](https://developer.mozilla.org/en-US/docs/Web/API/Node/textContent)
property and won't have any stateful nodes associated with a text node.
Text content property can be used as an optimization that slightly reduces memory consumption for elements with a text child. It will create a text node with a [`Node.textContent`](https://developer.mozilla.org/en-US/docs/Web/API/Node/textContent) property and won't have any stateful nodes associated with a text node.
Text content value should have a string or a number type.
Text content value should have an `undefined`, `null`, `false`, `string` or a `number` type.
### Directives
- `div &=${directive}` - Client-Side Directive `directive(element)`
- `div &:ssr=${directive}` - Server-Side Directive `directive(element, hydrate)`
- `div &=${directive}` - Client-Side Element Directive `directive(element)`.
- `div &:ssr=${directive}` - Element Directive that works during Client-Side and Server-Side Rendering `directive(element, hydrate)`.

@@ -242,3 +226,6 @@ Directive is a function that is invoked each time template is updated and

```ts
type ElementDirective = <E extends Element>(element: E, hydrate?: true) => void;
type ElementDirective = <E extends Element>(
element: E,
hydrate?: boolean,
) => void | string | { a?: string, c?: string; };
```

@@ -262,4 +249,3 @@

Directives can be used not just as a simple DOM created callbacks, but also as
a stateful directives. E.g.
Directives can be used not just as a simple DOM created callbacks, but also as stateful directives. E.g.

@@ -266,0 +252,0 @@ ```js

@@ -31,5 +31,5 @@ import {

* - `div =${expr}` - Text Content `element.textContent = expr`
* - `div $${directive}` - Directive `directive(element)`
* - `div $=${expr}` - Element Directive `directive(element, hydrate)`
* - `div $:ssr=${expr}` - Element Directive `directive(element, hydrate)`
*
*
* @example

@@ -91,3 +91,4 @@ *

* - `div =${expr}` - Text Content `element.textContent = expr`
* - `div $${directive}` - Directive `directive(element)`
* - `div $=${expr}` - Element Directive `directive(element, hydrate)`
* - `div $:ssr=${expr}` - Element Directive `directive(element, hydrate)`
*

@@ -94,0 +95,0 @@ * @example