create-gramstax 0.2.2 → 0.3.0
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/src/templates/package.json +1 -1
- package/dist/src/templates/src/base/page.ts +5 -1
- package/dist/src/templates/src/components/keyboard.ts +29 -0
- package/dist/src/templates/src/data/keyboard.ts +19 -0
- package/dist/src/templates/src/pages/general-error-input-notfound.ts +1 -2
- package/dist/src/templates/src/pages/general-error.ts +2 -4
- package/dist/src/templates/src/pages/help.ts +1 -1
- package/dist/src/templates/src/pages/start.ts +5 -16
- package/dist/src/templates/src/pages/username-notfound.ts +1 -1
- package/package.json +1 -1
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import { KeyboardComponent } from "~/components/keyboard"
|
|
1
2
|
import { CtxCore } from "~/core/ctx"
|
|
2
3
|
|
|
3
|
-
export abstract class PageBase extends CtxCore {
|
|
4
|
+
export abstract class PageBase extends CtxCore {
|
|
5
|
+
public static KbCom = KeyboardComponent
|
|
6
|
+
public static KbData = this.KbCom.data
|
|
7
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { KeyboardData } from "~/data/keyboard"
|
|
2
|
+
import { ComponentKeyboard } from "gramstax"
|
|
3
|
+
|
|
4
|
+
export class KeyboardComponent extends ComponentKeyboard {
|
|
5
|
+
public static data = KeyboardData
|
|
6
|
+
public static home(lang?: string, type?: string) {
|
|
7
|
+
return this._build(`home`, lang, type)
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
public static back(lang?: string, type?: string) {
|
|
11
|
+
return this._build(`back`, lang, type)
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
public static cancel(lang?: string, type?: string) {
|
|
15
|
+
return this._build(`cancel`, lang, type)
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
public static refresh(lang?: string, type?: string) {
|
|
19
|
+
return this._build(`refresh`, lang, type)
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
public static refreshBack(lang?: string, type?: string) {
|
|
23
|
+
return this._build(`refreshBack`, lang, type)
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
public static backRefresh(lang?: string, type?: string) {
|
|
27
|
+
return this._build(`backRefresh`, lang, type)
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { DataKeyboard } from "gramstax"
|
|
2
|
+
|
|
3
|
+
export class KeyboardData extends DataKeyboard {
|
|
4
|
+
public static home(lang?: string) {
|
|
5
|
+
return this._build(lang, false, {
|
|
6
|
+
default: `Home`,
|
|
7
|
+
it: `Casa`,
|
|
8
|
+
id: `Beranda`
|
|
9
|
+
})
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
public static back(lang?: string) {
|
|
13
|
+
return this._build(lang, false, {
|
|
14
|
+
default: `.. Back`,
|
|
15
|
+
it: `.. Ritorno`,
|
|
16
|
+
id: `.. Kembali`
|
|
17
|
+
})
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -14,8 +14,7 @@ export class GeneralErrorInputNotFoundPage extends PageBase {
|
|
|
14
14
|
|
|
15
15
|
public static template = /*jsx*/ `
|
|
16
16
|
<base>
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
${this.KbCom.home()}
|
|
19
18
|
<message><b>❌ Not Found</b></message>
|
|
20
19
|
<message lang="it"><b>❌ Non Trovato</b></message>
|
|
21
20
|
<message lang="id"><b>❌ Tidak Ditemukan</b></message>
|
|
@@ -23,22 +23,20 @@ export class GeneralErrorPage extends PageBase {
|
|
|
23
23
|
|
|
24
24
|
public static template = /*jsx*/ `
|
|
25
25
|
<base>
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
${this.KbCom.home()}
|
|
27
|
+
|
|
28
28
|
<message>
|
|
29
29
|
<b>❌ Error</b>
|
|
30
30
|
|
|
31
31
|
An unexpected error occurred.
|
|
32
32
|
Please try again later.
|
|
33
33
|
</message>
|
|
34
|
-
|
|
35
34
|
<message lang="it">
|
|
36
35
|
<b>❌ Errore</b>
|
|
37
36
|
|
|
38
37
|
Si è verificato un errore imprevisto.
|
|
39
38
|
Riprova più tardi.
|
|
40
39
|
</message>
|
|
41
|
-
|
|
42
40
|
<message lang="id">
|
|
43
41
|
<b>❌ Kesalahan</b>
|
|
44
42
|
|
|
@@ -27,35 +27,24 @@ export class StartPage extends PageBase {
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
public static template = /*jsx*/ `
|
|
30
|
-
<base id="
|
|
31
|
-
<keyboard
|
|
32
|
-
<keyboard lang="it"
|
|
33
|
-
<keyboard lang="id"
|
|
34
|
-
</base>
|
|
35
|
-
|
|
36
|
-
<base id="ikb-back">
|
|
37
|
-
<keyboard type="inline">.. Back</keyboard>
|
|
38
|
-
<keyboard lang="it" type="inline">.. Ritorno</keyboard>
|
|
39
|
-
<keyboard lang="id" type="inline">.. Kembali</keyboard>
|
|
30
|
+
<base id="with-import-and-you-can-use-components">
|
|
31
|
+
<keyboard>❓ Help</keyboard>
|
|
32
|
+
<keyboard lang="it">❓ Aiuto</keyboard>
|
|
33
|
+
<keyboard lang="id">❓ Bantuan</keyboard>
|
|
40
34
|
</base>
|
|
41
35
|
|
|
42
36
|
<base>
|
|
43
|
-
<
|
|
44
|
-
<keyboard lang="it" type="inline">❓ Aiuto</keyboard>
|
|
45
|
-
<keyboard lang="id" type="inline">❓ Bantuan</keyboard>
|
|
46
|
-
|
|
37
|
+
<import src="start" base="with-import-and-you-can-use-components" />
|
|
47
38
|
<message>
|
|
48
39
|
<b>Welcome to the bot {{userName}}</b>
|
|
49
40
|
|
|
50
41
|
<b>❓ Help</b> - View help
|
|
51
42
|
</message>
|
|
52
|
-
|
|
53
43
|
<message lang="it">
|
|
54
44
|
<b>Benvenuto nel Bot di {{userName}}</b>
|
|
55
45
|
|
|
56
46
|
<b>❓ Aiuto</b> - Ottieni assistenza e informazioni
|
|
57
47
|
</message>
|
|
58
|
-
|
|
59
48
|
<message lang="id">
|
|
60
49
|
<b>Selamat datang di bot {{userName}}</b>
|
|
61
50
|
|
|
@@ -19,7 +19,7 @@ export class UserNameNotFoundPage extends PageBase {
|
|
|
19
19
|
|
|
20
20
|
public static template = /*jsx*/ `
|
|
21
21
|
<base>
|
|
22
|
-
|
|
22
|
+
${this.KbCom.home()}
|
|
23
23
|
|
|
24
24
|
<message>Please set the username first before using the bot.</message>
|
|
25
25
|
<message lang="it">Prima di utilizzare il bot, imposta prima il nome utente.</message>
|