web-signature 0.2.1 → 0.2.2
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 +55 -33
- package/bundle/index.js +0 -2
- package/bundle/index.min.js +1 -1
- package/dist/Signature.js +0 -2
- package/package.json +1 -1
- package/src/Signature.ts +2 -2
package/README.MD
CHANGED
|
@@ -29,23 +29,33 @@ npm install
|
|
|
29
29
|
npm run dev
|
|
30
30
|
```
|
|
31
31
|
|
|
32
|
+
* [Signature](#signature)
|
|
33
|
+
* [Quick Start](#quick-start)
|
|
34
|
+
* [Introduction](#introduction)
|
|
35
|
+
* [Briefly about Signature](#briefly-about-signature)
|
|
36
|
+
* [About Component](#about-component)
|
|
37
|
+
* [Quick about the Library](#quick-about-the-library)
|
|
38
|
+
* [See more here](#see-more-here)
|
|
39
|
+
|
|
32
40
|
# Introduction
|
|
33
41
|
|
|
34
42
|
Signature uses four classes as its basis:
|
|
35
43
|
|
|
36
|
-
- [Signature](
|
|
37
|
-
- [Component](
|
|
38
|
-
|
|
39
|
-
- [
|
|
44
|
+
- [Signature](https://github.com/Pinbib/Signature/docs/Signature.md) - which processes the entire page and components.
|
|
45
|
+
- [Component](https://github.com/Pinbib/Signature/docs/Component.md) - which defines a standard structure for any
|
|
46
|
+
element.
|
|
47
|
+
- [Prop](https://github.com/Pinbib/Signature/docs/Prop.md) - which defines properties for components.
|
|
48
|
+
- [Library](https://github.com/Pinbib/Signature/docs/Library.md) - which defines a set of components.
|
|
40
49
|
|
|
41
50
|
In short, Signature allows you to create a website using simple and straightforward components that are easy to
|
|
42
51
|
customize and extend.
|
|
43
52
|
|
|
44
|
-
## Briefly about [Signature](
|
|
53
|
+
## Briefly about [Signature](https://github.com/Pinbib/Signature/docs/Signature.md)
|
|
45
54
|
|
|
46
|
-
The [signature](
|
|
47
|
-
|
|
48
|
-
|
|
55
|
+
The [signature](https://github.com/Pinbib/Signature/docs/Signature.md) is the main class that is responsible for
|
|
56
|
+
processing the entire page. It is used to
|
|
57
|
+
add [components](https://github.com/Pinbib/Signature/docs/Component.md),
|
|
58
|
+
register [libraries](https://github.com/Pinbib/Signature/docs/Library.md), and essentially render the page.
|
|
49
59
|
|
|
50
60
|
```ts
|
|
51
61
|
// Creating a Signature instance
|
|
@@ -56,9 +66,11 @@ const si = new Signature();
|
|
|
56
66
|
```
|
|
57
67
|
|
|
58
68
|
To add a component, use the
|
|
59
|
-
[
|
|
69
|
+
[
|
|
70
|
+
`Signature.add(component: ComponentConstructor, name?: string)`](https://github.com/Pinbib/Signature/docs/Signature.md#signatureadd)
|
|
71
|
+
method, which takes
|
|
60
72
|
the
|
|
61
|
-
[component](
|
|
73
|
+
[component](https://github.com/Pinbib/Signature/docs/Component.md) class and its name. For example:
|
|
62
74
|
|
|
63
75
|
```ts
|
|
64
76
|
import {Signature, Component} from 'web-signature';
|
|
@@ -73,13 +85,13 @@ si.add(MyComponent, 'my-component');
|
|
|
73
85
|
// The <my-component> tag will be processed by this class.
|
|
74
86
|
```
|
|
75
87
|
|
|
76
|
-
**Although the [component](
|
|
88
|
+
**Although the [component](https://github.com/Pinbib/Signature/docs/Component.md) name is not required,
|
|
77
89
|
it is recommended to specify it to avoid problems when building the project.**
|
|
78
90
|
|
|
79
|
-
To register a [library](
|
|
80
|
-
`Signature.register(library: Library)`](
|
|
91
|
+
To register a [library](https://github.com/Pinbib/Signature/docs/Library.md), the [
|
|
92
|
+
`Signature.register(library: Library)`](https://github.com/Pinbib/Signature/docs/Signature.md#signatureregister)
|
|
81
93
|
method is used, which takes an
|
|
82
|
-
instance of the [Library](
|
|
94
|
+
instance of the [Library](https://github.com/Pinbib/Signature/docs/Library.md).
|
|
83
95
|
For example:
|
|
84
96
|
|
|
85
97
|
```ts
|
|
@@ -91,7 +103,7 @@ si.register(new MyLibrary());
|
|
|
91
103
|
```
|
|
92
104
|
|
|
93
105
|
For rendering the page there is a [
|
|
94
|
-
`Signature.contact(selector: string, callback?)`](
|
|
106
|
+
`Signature.contact(selector: string, callback?)`](https://github.com/Pinbib/Signature/docs/Signature.md#signaturecontact)
|
|
95
107
|
method. For example:
|
|
96
108
|
|
|
97
109
|
```ts
|
|
@@ -104,15 +116,17 @@ si.contact('#app', () => {
|
|
|
104
116
|
});
|
|
105
117
|
```
|
|
106
118
|
|
|
107
|
-
## About [Component](
|
|
119
|
+
## About [Component](https://github.com/Pinbib/Signature/docs/Component.md)
|
|
108
120
|
|
|
109
121
|
This is an abstract class from which all components inherit. It defines a standard structure for any element.
|
|
110
|
-
It has a main method [`Component.render()`](
|
|
122
|
+
It has a main method [`Component.render()`](https://github.com/Pinbib/Signature/docs/Component.md#componentrender), and
|
|
123
|
+
component lifecycle hooks such
|
|
111
124
|
as [
|
|
112
|
-
`Component.onMount()`](
|
|
125
|
+
`Component.onMount()`](https://github.com/Pinbib/Signature/docs/Component.md#componentonmount).
|
|
113
126
|
|
|
114
|
-
To create a component, you need to inherit the [`Component`](
|
|
115
|
-
|
|
127
|
+
To create a component, you need to inherit the [`Component`](https://github.com/Pinbib/Signature/docs/Component.md)
|
|
128
|
+
class and implement the
|
|
129
|
+
[`Component.render(): string`](https://github.com/Pinbib/Signature/docs/Component.md#componentrender) method
|
|
116
130
|
and the
|
|
117
131
|
`name` field.
|
|
118
132
|
Let's create a simple component that simply displays text:
|
|
@@ -141,8 +155,10 @@ we will need to update it somehow and track events.
|
|
|
141
155
|
For a component to be able to update, it must have its own ref. Ref - allows you to associate a
|
|
142
156
|
component instance with
|
|
143
157
|
its DOM
|
|
144
|
-
element, if the ref is not specified, the [Signature](
|
|
145
|
-
|
|
158
|
+
element, if the ref is not specified, the [Signature](https://github.com/Pinbib/Signature/docs/Signature.md) will not
|
|
159
|
+
remember the component instance.
|
|
160
|
+
And to track events, we will use the [
|
|
161
|
+
`Component.onMount(el: Element)`](https://github.com/Pinbib/Signature/docs/Component.md#componentonmount) hook,
|
|
146
162
|
which is
|
|
147
163
|
called after the component has been
|
|
148
164
|
added to
|
|
@@ -208,7 +224,8 @@ class Counter extends Component {
|
|
|
208
224
|
```
|
|
209
225
|
|
|
210
226
|
Let's make it possible to set the number of steps to increment the counter,
|
|
211
|
-
using [Props](
|
|
227
|
+
using [Props](https://github.com/Pinbib/Signature/docs/Prop.md). We need to create
|
|
228
|
+
a [Prop](https://github.com/Pinbib/Signature/docs/Prop.md) `step` with type `number`.
|
|
212
229
|
|
|
213
230
|
```ts
|
|
214
231
|
import {Signature, Component, Prop, html} from 'web-signature';
|
|
@@ -264,14 +281,17 @@ Now, when you click the button, the counter will increase by the specified numbe
|
|
|
264
281
|
|
|
265
282
|
## Quick about the Library
|
|
266
283
|
|
|
267
|
-
The [Library](
|
|
284
|
+
The [Library](https://github.com/Pinbib/Signature/docs/Library.md) class allows you to create a set
|
|
285
|
+
of [components](https://github.com/Pinbib/Signature/docs/Component.md) that can be used
|
|
268
286
|
in a
|
|
269
287
|
project.
|
|
270
|
-
It has no other purpose than to facilitate the registration
|
|
271
|
-
|
|
272
|
-
|
|
288
|
+
It has no other purpose than to facilitate the registration
|
|
289
|
+
of [components](https://github.com/Pinbib/Signature/docs/Component.md)
|
|
290
|
+
in [Signature](https://github.com/Pinbib/Signature/docs/Signature.md),
|
|
291
|
+
and avoiding [component](https://github.com/Pinbib/Signature/docs/Component.md) name collisions by grouping them.
|
|
273
292
|
|
|
274
|
-
Let's create a [library](
|
|
293
|
+
Let's create a [library](https://github.com/Pinbib/Signature/docs/Library.md) that will contain our `Counter` and
|
|
294
|
+
`StepCounter` components:
|
|
275
295
|
|
|
276
296
|
```ts
|
|
277
297
|
import {Library} from 'web-signature';
|
|
@@ -290,8 +310,8 @@ myLibrary.add(StepCounter, "Step-counter");
|
|
|
290
310
|
export default myLibrary;
|
|
291
311
|
```
|
|
292
312
|
|
|
293
|
-
To register the library in [Signature](
|
|
294
|
-
[`Signature.register(library: Library)`](
|
|
313
|
+
To register the library in [Signature](https://github.com/Pinbib/Signature/docs/Signature.md#signatureregister), use the
|
|
314
|
+
[`Signature.register(library: Library)`](https://github.com/Pinbib/Signature/docs/Signature.md#signatureregister)
|
|
295
315
|
method:
|
|
296
316
|
|
|
297
317
|
```ts
|
|
@@ -308,11 +328,13 @@ si.register(myLibrary);
|
|
|
308
328
|
si.contact('#app');
|
|
309
329
|
```
|
|
310
330
|
|
|
311
|
-
Now you can use the components from the [library](
|
|
331
|
+
Now you can use the components from the [library](https://github.com/Pinbib/Signature/docs/Library.md) in your HTML, but
|
|
332
|
+
all components will be available
|
|
312
333
|
with
|
|
313
334
|
the prefix
|
|
314
335
|
`ML-`, i.e. `ML-counter` and `ML-step-counter`, the pattern is the library name
|
|
315
|
-
is used as a prefix for the [component](
|
|
336
|
+
is used as a prefix for the [component](https://github.com/Pinbib/Signature/docs/Component.md) name
|
|
337
|
+
`[libName]-[componentName]`.
|
|
316
338
|
|
|
317
339
|
```html
|
|
318
340
|
|
|
@@ -322,4 +344,4 @@ is used as a prefix for the [component](./docs/Component.md) name `[libName]-[co
|
|
|
322
344
|
</div>
|
|
323
345
|
```
|
|
324
346
|
|
|
325
|
-
## [See more here](
|
|
347
|
+
## [See more here](https://github.com/Pinbib/Signature/docs)
|
package/bundle/index.js
CHANGED
|
@@ -214,7 +214,6 @@ class Signature {
|
|
|
214
214
|
body += `<!--si-mark-${i}-->`;
|
|
215
215
|
}
|
|
216
216
|
}
|
|
217
|
-
console.log(body, template);
|
|
218
217
|
return body;
|
|
219
218
|
}
|
|
220
219
|
fillTemplate(template, markup) {
|
|
@@ -413,7 +412,6 @@ class Signature {
|
|
|
413
412
|
};
|
|
414
413
|
}
|
|
415
414
|
el.replaceWith(body.firstElementChild);
|
|
416
|
-
console.log(el, body);
|
|
417
415
|
renderer.onMount?.(mountEl); // lifecycle hook
|
|
418
416
|
});
|
|
419
417
|
}
|
package/bundle/index.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
class e{element;instance;constructor(e,t){this.instance=e,this.element=t}}const t={"element-not-found":"Element not found for selector: #selector","prop-is-required":"Property '#prop' in component '#component' is required but not provided.","unsupported-type-for-property":"Unsupported type for property '#prop' in component '#component': #type","invalid-value-for-property":"Invalid value for property '#prop' in component '#component': #value (value: #attr)","multiple-root-elements":"Component '#component' must render a single root element. \n\t#elements","ref-collision":"Ref collision detected for ref '#ref' in component '#component'.",unknown:"An unknown error occurred.","unknown-from":"An unknown error occurred in component '#from'.","stack-overflow":"Stack Overflow detected: possible recursive component rendering.","render-async-failed":"Error during asynchronous rendering of the component #component."};let n=0;class r{components={};refs={};libs={};constructor(){}add(e,t){const n="string"==typeof t?t:e.name;this.components[n]&&console.warn(new Error(`Component with name ${n} already exists.`)),this.components[n]=e}register(e,...t){this.libs[e.name]&&console.warn(new Error(`Library with name ${e.name} already exists.`));const n=e.list().filter(e=>!(e.name in t));this.libs[e.name]={name:e.name,version:e.version,author:e.author,components:n.map(e=>e.name),dependencies:e.libs};for(const t of n)this.add(t.component,`${e.name}-${t.name}`)}lib(e){return this.libs[e]}libraries(){const e=e=>{let t=e.name;return e.version&&(t+=`@${e.version}`),e.author&&(t+=`#${e.author}`),t},t=(n,r=new Set)=>{const o={};for(const[s,i]of Object.entries(n)){const n=e(i);r.has(n)||(r.add(n),o[n]={components:i.components,dependencies:t(i.dependencies,r)})}return o};return t(this.libs)}contactWith(e,...t){const n=this.refs[e];if(!n)throw new Error(`Ref with name ${e} does not exist.`);const r=n.instance;return r.onContact?.(...t)}updateRef(e){const t=this.refs[e];if(!t)throw new Error(`Ref with name ${e} does not exist.`);const n=t.instance;let r={strings:Object.assign([],{raw:[]}),values:[]};try{r=n.render()}catch(e){if(e instanceof Error)throw{id:"unknown-from",from:n.name,err:e}}const o=document.createElement("template");(e=>{r instanceof Promise?r.then(t=>{o.content.appendChild(this.templateToElement(t)),e()}).catch(e=>{throw{id:"unknown-from",from:n.name,err:e}}):"object"==typeof r&&(o.content.appendChild(this.templateToElement(r)),e())})(()=>{if(1!==o.content.children.length)throw new Error(`Component '${n.name}' must render a single root element.`);const e=o.content.firstElementChild;this.render(o.content),n.onRender?.(),t.element.replaceWith(e),t.element=e,n.onMount?.(e)})}contact(e,n){new Promise((t,r)=>{try{const t=document.querySelector(e);if(!t)return void r({id:"element-not-found",selector:e});const o=document.createElement("div");o.innerHTML=t.innerHTML,this.render(o),t.replaceChildren(...Array.from(o.childNodes)),n&&n()}catch(e){e instanceof Error?e instanceof RangeError&&e.message.includes("stack")?r({id:"stack-overflow",err:e}):r({id:"unknown",err:e}):r(e)}}).catch(e=>{let n=t[e.id];throw Object.keys(e).filter(e=>!(e in["id","err"])).forEach(t=>{n=n.replace(new RegExp(`#${t}`,"gm"),String(e[t]))}),e.id in["unknown","unknown-from","render-async-failed"]?console.error(`[${e.id}] ${n}`,e.err):console.error(`[${e.id}] ${n}`),"Page rendering was interrupted by Signature due to the above error."})}templateToString(e){let t="";for(let n=0;n<e.strings.length;n++)t+=e.strings[n],n<e.values.length&&(t+=`\x3c!--si-mark-${n}--\x3e`);return
|
|
1
|
+
class e{element;instance;constructor(e,t){this.instance=e,this.element=t}}const t={"element-not-found":"Element not found for selector: #selector","prop-is-required":"Property '#prop' in component '#component' is required but not provided.","unsupported-type-for-property":"Unsupported type for property '#prop' in component '#component': #type","invalid-value-for-property":"Invalid value for property '#prop' in component '#component': #value (value: #attr)","multiple-root-elements":"Component '#component' must render a single root element. \n\t#elements","ref-collision":"Ref collision detected for ref '#ref' in component '#component'.",unknown:"An unknown error occurred.","unknown-from":"An unknown error occurred in component '#from'.","stack-overflow":"Stack Overflow detected: possible recursive component rendering.","render-async-failed":"Error during asynchronous rendering of the component #component."};let n=0;class r{components={};refs={};libs={};constructor(){}add(e,t){const n="string"==typeof t?t:e.name;this.components[n]&&console.warn(new Error(`Component with name ${n} already exists.`)),this.components[n]=e}register(e,...t){this.libs[e.name]&&console.warn(new Error(`Library with name ${e.name} already exists.`));const n=e.list().filter(e=>!(e.name in t));this.libs[e.name]={name:e.name,version:e.version,author:e.author,components:n.map(e=>e.name),dependencies:e.libs};for(const t of n)this.add(t.component,`${e.name}-${t.name}`)}lib(e){return this.libs[e]}libraries(){const e=e=>{let t=e.name;return e.version&&(t+=`@${e.version}`),e.author&&(t+=`#${e.author}`),t},t=(n,r=new Set)=>{const o={};for(const[s,i]of Object.entries(n)){const n=e(i);r.has(n)||(r.add(n),o[n]={components:i.components,dependencies:t(i.dependencies,r)})}return o};return t(this.libs)}contactWith(e,...t){const n=this.refs[e];if(!n)throw new Error(`Ref with name ${e} does not exist.`);const r=n.instance;return r.onContact?.(...t)}updateRef(e){const t=this.refs[e];if(!t)throw new Error(`Ref with name ${e} does not exist.`);const n=t.instance;let r={strings:Object.assign([],{raw:[]}),values:[]};try{r=n.render()}catch(e){if(e instanceof Error)throw{id:"unknown-from",from:n.name,err:e}}const o=document.createElement("template");(e=>{r instanceof Promise?r.then(t=>{o.content.appendChild(this.templateToElement(t)),e()}).catch(e=>{throw{id:"unknown-from",from:n.name,err:e}}):"object"==typeof r&&(o.content.appendChild(this.templateToElement(r)),e())})(()=>{if(1!==o.content.children.length)throw new Error(`Component '${n.name}' must render a single root element.`);const e=o.content.firstElementChild;this.render(o.content),n.onRender?.(),t.element.replaceWith(e),t.element=e,n.onMount?.(e)})}contact(e,n){new Promise((t,r)=>{try{const t=document.querySelector(e);if(!t)return void r({id:"element-not-found",selector:e});const o=document.createElement("div");o.innerHTML=t.innerHTML,this.render(o),t.replaceChildren(...Array.from(o.childNodes)),n&&n()}catch(e){e instanceof Error?e instanceof RangeError&&e.message.includes("stack")?r({id:"stack-overflow",err:e}):r({id:"unknown",err:e}):r(e)}}).catch(e=>{let n=t[e.id];throw Object.keys(e).filter(e=>!(e in["id","err"])).forEach(t=>{n=n.replace(new RegExp(`#${t}`,"gm"),String(e[t]))}),e.id in["unknown","unknown-from","render-async-failed"]?console.error(`[${e.id}] ${n}`,e.err):console.error(`[${e.id}] ${n}`),"Page rendering was interrupted by Signature due to the above error."})}templateToString(e){let t="";for(let n=0;n<e.strings.length;n++)t+=e.strings[n],n<e.values.length&&(t+=`\x3c!--si-mark-${n}--\x3e`);return t}fillTemplate(e,t){let n=document.createElement("template");return n.innerHTML=t,(()=>{let t,r=document.createTreeWalker(n.content,NodeFilter.SHOW_COMMENT),o=[];for(;t=r.nextNode();)/si-mark-\d+/gm.test(t.nodeValue??"")&&o.push(t);for(const t of o)t.replaceWith(document.createTextNode(String(e.values[Number((t.nodeValue??"").match(/si-mark-(\d+)/m)[1])])))})(),(()=>{let t,r=document.createTreeWalker(n.content,NodeFilter.SHOW_ELEMENT);for(;t=r.nextNode();)for(const n of Array.from(t.attributes))if(/<!--si-mark-\d+-->/gm.test(n.value)){const r=n.value.match(/si-mark-(\d+)/m);r&&t.setAttribute(n.name,String(e.values[Number(r[1])]))}})(),n}templateToElement(e){const t=this.templateToString(e),n=this.fillTemplate(e,t);if(1!==n.content.children.length)throw{id:"multiple-root-elements",elements:n.innerHTML};return n.content.firstElementChild}render(t){for(const r of Object.keys(this.components)){const o=this.components[r];for(const s of Array.from(t.querySelectorAll(r)).concat(Array.from(t.querySelectorAll(`[si-component="${r}"]`)))){const t=new o;if(t.onInit?.(),s instanceof HTMLElement){t.content=s.innerHTML.trim();for(const e of Object.keys(t.props)){const n=s.getAttribute(e);if(null===n){if(t.props[e].required)throw{id:"prop-is-required",component:r,prop:e};t.data[e]=null}else if(""===n){if(t.props[e].required)throw{id:"prop-is-required",component:r,prop:e};t.props[e].isValid(n)&&(t.data[e]=null)}else{let o;switch(t.props[e].type){case"boolean":o=Boolean(n);break;case"number":o=Number(n);break;case"string":o=String(n);break;case"array":try{o=JSON.parse(n)}catch(t){throw{id:"invalid-value-for-property",component:r,prop:e,value:n,attr:n}}break;default:if(t.props[e].required)throw{id:"unsupported-type-for-property",component:r,prop:e,type:t.props[e].type}}if(void 0!==o){if(!t.props[e].isValid(o))throw{id:"invalid-value-for-property",component:r,prop:e,value:o,attr:n};if(t.props[e].validate&&!t.props[e].validate(o))throw{id:"invalid-value-for-property",component:r,prop:e,value:o,attr:n};t.data[e]=o,t.onPropParsed?.(t.props[e],o)}}}t.onPropsParsed?.()}const i=document.createElement("template");let a={strings:Object.assign([],{raw:[]}),values:[]};try{a=t.render()}catch(e){if(e instanceof Error)throw{id:"unknown-from",from:t.name,err:e}}(e=>{if(a instanceof Promise)try{a.then(t=>{i.appendChild(this.templateToElement(t)),e()}).catch(e=>{throw{id:"unknown-from",from:t.name,err:e}})}catch(e){throw{id:"render-async-failed",component:r,err:e}}else"object"==typeof a&&(i.appendChild(this.templateToElement(a)),e())})(()=>{this.render(i.content),t.onRender?.();const o=i.firstElementChild;if(s.hasAttribute("ref")||t.options.generateRefIfNotSpecified){let i=s.getAttribute("ref");if(null===i&&(i=""),n++,""===i&&(i=`r${n}${Math.random().toString(36).substring(2,15)}${n}`),this.refs[i])throw{id:"ref-collision",ref:i,component:r};this.refs[i]=new e(t,o),o.setAttribute("ref",i),t.ref={id:i,contact:(...e)=>this.contactWith(i,...e),update:()=>this.updateRef(i)}}s.replaceWith(i.firstElementChild),t.onMount?.(o)})}}}}class o{content;options={generateRefIfNotSpecified:!1};ref;props={};data={};onInit(){}onRender(){}onMount(e){}onContact(...e){}onPropsParsed(){}onPropParsed(e,t){}}class s{type;required=!0;validate;constructor(e,t=!0,n){this.type=e,this.required=t,this.validate=n||(()=>!0)}isValid(e){switch(this.type){case"boolean":return"boolean"==typeof e;case"number":return"number"==typeof e&&!isNaN(e);case"string":return"string"==typeof e;case"array":return Array.isArray(e);case"null":return null===e;default:return!1}}}class i{name;version;author;libs={};components={};constructor(e,t,n){this.name=e,this.author=t,this.version=n}add(e,t){const n="string"==typeof t?t:e.name;this.components[n]&&console.warn(new Error(`Component with name ${n} already exists.`)),this.components[n]=e}register(e,...t){this.libs[e.name]&&console.warn(new Error(`Library with name ${e.name} already exists in ${this.name}.`));const n=e.list().filter(e=>!(e.name in t));this.libs[e.name]={name:e.name,version:e.version,author:e.author,components:n.map(e=>e.name),dependencies:e.libs};for(const t of n)this.add(t.component,`${e.name}-${t.name}`)}get(e){return this.components[e]}lib(e){return this.libs[e]}list(){return Object.entries(this.components).map(([e,t])=>({component:t,name:e}))}}function a(e,...t){return{strings:e,values:t}}function c(){return new r}export{o as Component,i as Library,s as Prop,r as Signature,c as default,a as html};
|
package/dist/Signature.js
CHANGED
|
@@ -194,7 +194,6 @@ export default class Signature {
|
|
|
194
194
|
body += `<!--si-mark-${i}-->`;
|
|
195
195
|
}
|
|
196
196
|
}
|
|
197
|
-
console.log(body, template);
|
|
198
197
|
return body;
|
|
199
198
|
}
|
|
200
199
|
fillTemplate(template, markup) {
|
|
@@ -393,7 +392,6 @@ export default class Signature {
|
|
|
393
392
|
};
|
|
394
393
|
}
|
|
395
394
|
el.replaceWith(body.firstElementChild);
|
|
396
|
-
console.log(el, body);
|
|
397
395
|
renderer.onMount?.(mountEl); // lifecycle hook
|
|
398
396
|
});
|
|
399
397
|
}
|
package/package.json
CHANGED
package/src/Signature.ts
CHANGED
|
@@ -245,7 +245,7 @@ export default class Signature {
|
|
|
245
245
|
body += `<!--si-mark-${i}-->`
|
|
246
246
|
}
|
|
247
247
|
}
|
|
248
|
-
|
|
248
|
+
|
|
249
249
|
return body;
|
|
250
250
|
}
|
|
251
251
|
|
|
@@ -488,7 +488,7 @@ export default class Signature {
|
|
|
488
488
|
}
|
|
489
489
|
|
|
490
490
|
el.replaceWith(body.firstElementChild as Element);
|
|
491
|
-
|
|
491
|
+
|
|
492
492
|
renderer.onMount?.(mountEl); // lifecycle hook
|
|
493
493
|
});
|
|
494
494
|
}
|