@rxdi/lit-html 0.7.137 → 0.7.140

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -69,7 +69,7 @@ export class MyModifier extends LitElement {
69
69
  }
70
70
  }
71
71
 
72
- public static html(template: TemplateResult) {
72
+ public static modifier(template: TemplateResult) {
73
73
  return html`<my-modifier>${template}</my-modifier>`;
74
74
  }
75
75
  }
@@ -6,7 +6,7 @@ export interface CustomElementConfig<T> {
6
6
  style?: CSSResult;
7
7
  styles?: CSSResult[];
8
8
  extends?: string;
9
- directives?: (Function | {
9
+ modifiers?: (Function | {
10
10
  html(template: TemplateResult): TemplateResult;
11
11
  })[];
12
12
  /**
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Component = void 0;
4
4
  const lit_html_1 = require("../lit-html/lit-html");
5
- const helpers_1 = require("./helpers");
6
5
  const legacyCustomElement = (tagName, clazz, options) => {
7
6
  window.customElements.define(tagName, clazz, options);
8
7
  return clazz;
@@ -73,8 +72,9 @@ const customElement = (tag, config = {}) => (Base) => {
73
72
  }
74
73
  render() {
75
74
  var _a;
76
- if ((_a = config.directives) === null || _a === void 0 ? void 0 : _a.length) {
77
- return (0, helpers_1.pipe)(...(config.directives.map(v => v['html'])))(config.template.call(this));
75
+ if ((_a = config.modifiers) === null || _a === void 0 ? void 0 : _a.length) {
76
+ const pipe = (...fns) => (x) => fns.reduce((v, f) => f.call(this, v), x);
77
+ return pipe(...(config.modifiers.map(v => v['modifier'])))(config.template.call(this));
78
78
  }
79
79
  return config.template.call(this);
80
80
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rxdi/lit-html",
3
- "version": "0.7.137",
3
+ "version": "0.7.140",
4
4
  "main": "./dist/index.js",
5
5
  "author": "Kristiyan Tachev",
6
6
  "license": "MIT",
@@ -1,2 +0,0 @@
1
- import { TemplateResult } from '../../lit-html/lit-html';
2
- export declare const pipe: (...fns: Function[]) => (x: TemplateResult) => any;
@@ -1,5 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.pipe = void 0;
4
- const pipe = (...fns) => (x) => fns.reduce((v, f) => f(v), x);
5
- exports.pipe = pipe;