@social-mail/social-mail-client 1.2.141 → 1.2.142
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/dist/admin/AdminAppIndex.pack.js +10 -7
- package/dist/admin/AdminAppIndex.pack.js.map +1 -1
- package/dist/admin/AdminAppIndex.pack.min.js +2 -2
- package/dist/admin/AdminAppIndex.pack.min.js.map +1 -1
- package/dist/site-editor/blocks/Components.d.ts +7 -0
- package/dist/site-editor/blocks/Components.d.ts.map +1 -1
- package/dist/site-editor/blocks/Components.js +1 -7
- package/dist/site-editor/blocks/Components.js.map +1 -1
- package/dist/site-editor/editor/WebSitePageEditor.d.ts.map +1 -1
- package/dist/site-editor/editor/WebSitePageEditor.js +9 -0
- package/dist/site-editor/editor/WebSitePageEditor.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/web/AppIndex.pack.js +10 -7
- package/dist/web/AppIndex.pack.js.map +1 -1
- package/dist/web/AppIndex.pack.min.js +2 -2
- package/dist/web/AppIndex.pack.min.js.map +1 -1
- package/package.json +1 -1
- package/src/site-editor/blocks/Components.tsx +14 -7
- package/src/site-editor/editor/WebSitePageEditor.tsx +9 -0
- package/dist/public/components/typewriter/TypeWriter.d.ts +0 -9
- package/dist/public/components/typewriter/TypeWriter.d.ts.map +0 -1
- package/dist/public/components/typewriter/TypeWriter.js +0 -86
- package/dist/public/components/typewriter/TypeWriter.js.map +0 -1
- package/dist/public/components/typewriter/TypeWriter.pack.js +0 -12667
- package/dist/public/components/typewriter/TypeWriter.pack.js.map +0 -1
- package/dist/public/components/typewriter/TypeWriter.pack.min.js +0 -279
- package/dist/public/components/typewriter/TypeWriter.pack.min.js.map +0 -1
- package/src/public/components/typewriter/TypeWriter.tsx +0 -80
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import Pack from "@web-atoms/core/dist/Pack";
|
|
2
|
-
import Bind from "@web-atoms/core/dist/core/Bind";
|
|
3
|
-
import XNode from "@web-atoms/core/dist/core/XNode";
|
|
4
|
-
import sleep from "@web-atoms/core/dist/core/sleep";
|
|
5
|
-
import styled from "@web-atoms/core/dist/style/styled";
|
|
6
|
-
import { AtomControl } from "@web-atoms/core/dist/web/controls/AtomControl";
|
|
7
|
-
|
|
8
|
-
styled.css `
|
|
9
|
-
display: inline-flex;
|
|
10
|
-
align-items: center;
|
|
11
|
-
justify-content: start;
|
|
12
|
-
& > span {
|
|
13
|
-
display: inline-flex;
|
|
14
|
-
padding-right: 1px;
|
|
15
|
-
border-right-style: solid;
|
|
16
|
-
border-right-width: 2px;
|
|
17
|
-
border-right-color: currentColor;
|
|
18
|
-
}
|
|
19
|
-
`.installGlobal("[data-component=type-writer]");
|
|
20
|
-
|
|
21
|
-
@Pack
|
|
22
|
-
export default class TypeWriter extends AtomControl {
|
|
23
|
-
|
|
24
|
-
public currentText = "";
|
|
25
|
-
|
|
26
|
-
private stop = false;
|
|
27
|
-
|
|
28
|
-
constructor(app, e) {
|
|
29
|
-
super(app, e);
|
|
30
|
-
this.element.setAttribute("data-component","type-writer");
|
|
31
|
-
this.runAfterInit(() => this.app.runAsync(() => this.init()));
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
async init() {
|
|
35
|
-
this.render(<div>
|
|
36
|
-
<span text={Bind.oneWay(() => this.currentText)}/>
|
|
37
|
-
</div>);
|
|
38
|
-
|
|
39
|
-
await this.loop();
|
|
40
|
-
this.registerDisposable({
|
|
41
|
-
dispose: () => this.stop = true
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
async loop() {
|
|
46
|
-
|
|
47
|
-
const textList = JSON.parse(this.element.getAttribute("data-json-args") || `["I am typing"]`) as string[];
|
|
48
|
-
|
|
49
|
-
let index = 0;
|
|
50
|
-
const max = textList.length;
|
|
51
|
-
|
|
52
|
-
while(!this.stop) {
|
|
53
|
-
|
|
54
|
-
const current = textList[index];
|
|
55
|
-
|
|
56
|
-
let length = 0;
|
|
57
|
-
|
|
58
|
-
// forward...
|
|
59
|
-
while(length < current.length) {
|
|
60
|
-
this.currentText = current.substring(0, ++length);
|
|
61
|
-
await sleep(180);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
await sleep(700);
|
|
65
|
-
|
|
66
|
-
while(length) {
|
|
67
|
-
this.currentText = current.substring(0, --length);
|
|
68
|
-
await sleep(100);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
await sleep(100);
|
|
72
|
-
|
|
73
|
-
index++;
|
|
74
|
-
if (index === max) {
|
|
75
|
-
index = 0;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
}
|