levix-bot 4.6.0 → 4.8.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/views/setup.ejs CHANGED
@@ -1,25 +1,26 @@
1
1
  <!DOCTYPE html>
2
- <html lang="en" data-theme="dark">
2
+ <html data-brand="<%= brand.name %>">
3
3
  <head>
4
+ <script src="/ui-boot.js"></script>
4
5
  <meta charset="UTF-8" />
5
6
  <meta name="viewport" content="width=device-width, initial-scale=1" />
6
- <title><%= brand.name %> · First run</title>
7
+ <title data-i18n="titleSetup"><%= brand.name %> · First run</title>
7
8
  <link rel="icon" type="image/png" sizes="32x32" href="/brand/icon-32.png" />
8
9
  <link rel="apple-touch-icon" href="/brand/apple-touch-icon.png" />
9
10
  <link rel="stylesheet" href="/dashboard.css" />
10
11
  </head>
11
12
  <body class="gateway-page">
12
13
  <main class="gateway-shell">
13
- <section class="gateway-story" aria-label="About <%= brand.name %>">
14
+ <section class="gateway-story" aria-label="About <%= brand.name %>" data-i18n-aria-label="storyAbout">
14
15
  <div class="brand-lockup" aria-label="<%= brand.name %>">
15
16
  <img src="/brand/mark.svg" alt="" />
16
- <span><strong><%= brand.name %></strong><small><%= brand.tagline %></small></span>
17
+ <span><strong><%= brand.name %></strong><small data-i18n="tagline"><%= brand.tagline %></small></span>
17
18
  </div>
18
19
 
19
20
  <div class="gateway-copy">
20
- <span class="eyebrow">Your first minute</span>
21
- <h2>Make the workspace yours.</h2>
22
- <p>Choose one strong password, then manage the assistant from a single private control room.</p>
21
+ <span class="eyebrow" data-i18n="firstMinute">Your first minute</span>
22
+ <h2 data-i18n="setupHeadline">Make the workspace yours.</h2>
23
+ <p data-i18n="setupLede">Choose one strong password, then manage the assistant from a single private control room.</p>
23
24
  </div>
24
25
 
25
26
  <div class="gateway-mark" aria-hidden="true">
@@ -27,7 +28,7 @@
27
28
  <img src="/brand/mark.svg" alt="" />
28
29
  </div>
29
30
 
30
- <p class="gateway-trust"><span></span> One setup · no configuration files</p>
31
+ <p class="gateway-trust" data-i18n-html="setupTrust"><span></span> One setup · no configuration files</p>
31
32
  </section>
32
33
 
33
34
  <section class="gateway-panel">
@@ -35,30 +36,33 @@
35
36
  <form class="card auth-card setup-card" action="/setup" method="post">
36
37
  <button type="button" class="gateway-back-btn" id="setup-back-app" hidden>
37
38
  <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M19 12H5M12 19l-7-7 7-7"/></svg>
38
- <span>Back to app</span>
39
+ <span data-i18n="backToApp">Back to app</span>
39
40
  </button>
40
41
  <div class="auth-head">
41
- <span class="eyebrow">Create your workspace</span>
42
- <h1>Welcome to <%= brand.name %></h1>
43
- <p class="sub">Protect the linked WhatsApp account with at least <%= minLength %> characters.</p>
42
+ <span class="eyebrow" data-i18n="createWorkspace">Create your workspace</span>
43
+ <h1 data-i18n="setupWelcome">Welcome to <%= brand.name %></h1>
44
+ <p class="sub" data-i18n="setupSub">Protect the linked WhatsApp account with at least <%= minLength %> characters.</p>
44
45
  </div>
45
46
 
46
47
  <% if (needsCode) { %>
47
48
  <label class="field">
48
- <span>Setup code</span>
49
+ <span data-i18n="setupCodeLabel">Setup code</span>
49
50
  <input type="text" name="code" autocomplete="off" autofocus required
50
- placeholder="Printed in the bot's terminal" />
51
- <small>Confirms you can access the server running Levix.</small>
51
+ placeholder="Printed in the bot's terminal"
52
+ data-i18n-placeholder="setupCodePlaceholder" />
53
+ <small data-i18n="setupCodeHint">Confirms you can access the server running Levix.</small>
52
54
  </label>
53
55
  <% } %>
54
56
 
55
57
  <label class="field">
56
- <span>Password</span>
58
+ <span data-i18n="setupPasswordLabel">Password</span>
57
59
  <div class="input-wrap">
58
- <input type="password" name="password" autocomplete="new-password"
60
+ <input type="password" dir="ltr" spellcheck="false" autocapitalize="off" autocorrect="off" name="password" autocomplete="new-password"
59
61
  placeholder="At least <%= minLength %> characters"
62
+ data-i18n-placeholder="minLengthPlaceholder"
63
+ data-i18n-n="<%= minLength %>"
60
64
  minlength="<%= minLength %>" <%= needsCode ? "" : "autofocus" %> required />
61
- <button type="button" class="eye-btn" aria-label="Show password">
65
+ <button type="button" class="eye-btn" aria-label="Show password" data-i18n-aria-label="showPassword" aria-pressed="false">
62
66
  <svg class="eye-on" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7-10-7-10-7Z"/><circle cx="12" cy="12" r="3"/></svg>
63
67
  <svg class="eye-off" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" style="display:none"><path d="M9.88 9.88a3 3 0 1 0 4.24 4.24"/><path d="M10.73 5.08A10.43 10.43 0 0 1 12 5c6.5 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68"/><path d="M6.61 6.61A13.526 13.526 0 0 0 2 12s3.5 7 10 7a9.74 9.74 0 0 0 5.39-1.61"/><line x1="2" x2="22" y1="2" y2="22"/></svg>
64
68
  </button>
@@ -66,11 +70,13 @@
66
70
  </label>
67
71
 
68
72
  <label class="field">
69
- <span>Repeat password</span>
73
+ <span data-i18n="repeatPassword">Repeat password</span>
70
74
  <div class="input-wrap">
71
- <input type="password" name="confirm" autocomplete="new-password"
72
- placeholder="Type it again" minlength="<%= minLength %>" required />
73
- <button type="button" class="eye-btn" aria-label="Show password">
75
+ <input type="password" dir="ltr" spellcheck="false" autocapitalize="off" autocorrect="off" name="confirm" autocomplete="new-password"
76
+ placeholder="Type it again"
77
+ data-i18n-placeholder="repeatPlaceholder"
78
+ minlength="<%= minLength %>" required />
79
+ <button type="button" class="eye-btn" aria-label="Show password" data-i18n-aria-label="showPassword" aria-pressed="false">
74
80
  <svg class="eye-on" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7-10-7-10-7Z"/><circle cx="12" cy="12" r="3"/></svg>
75
81
  <svg class="eye-off" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" style="display:none"><path d="M9.88 9.88a3 3 0 1 0 4.24 4.24"/><path d="M10.73 5.08A10.43 10.43 0 0 1 12 5c6.5 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68"/><path d="M6.61 6.61A13.526 13.526 0 0 0 2 12s3.5 7 10 7a9.74 9.74 0 0 0 5.39-1.61"/><line x1="2" x2="22" y1="2" y2="22"/></svg>
76
82
  </button>
@@ -78,33 +84,31 @@
78
84
  </label>
79
85
 
80
86
  <button type="submit" class="btn btn-primary auth-submit">
81
- Create workspace
87
+ <span data-i18n="createWorkspaceBtn">Create workspace</span>
82
88
  <svg viewBox="0 0 24 24" aria-hidden="true"><path d="M5 12h14M13 6l6 6-6 6"/></svg>
83
89
  </button>
84
90
 
85
91
  <% if (error) { %>
86
- <div class="error" role="alert"><%= error %></div>
92
+ <div class="error" role="alert" data-i18n-error="<%= errorCode %>" data-i18n-n="<%= minLength %>"><%= error %></div>
87
93
  <% } %>
88
94
  </form>
89
95
 
90
- <div class="foot"><%= brand.name %> by <%= brand.developer %> · <%= brand.studio %></div>
96
+ <div class="foot"><%= brand.name %> <span data-i18n="by">by</span> <%= brand.developer %> · <%= brand.studio %></div>
91
97
  </div>
92
98
  </section>
93
99
  </main>
94
100
 
101
+ <script src="/gateway-i18n.js"></script>
95
102
  <script src="/gateway.js"></script>
96
103
  <script>
97
104
  (function () {
105
+ // Android app: show the back-to-app button. Its label is already in
106
+ // whichever language the page loaded in.
98
107
  var inApp = typeof window.LevixHost !== "undefined" && typeof window.LevixHost.closePanel === "function";
99
108
  if (inApp) {
100
- var isAr = false;
101
- try { isAr = localStorage.getItem("levix_lang") === "ar"; } catch(e) {}
102
- var backLabel = isAr ? "العودة للتطبيق" : "Back to app";
103
109
  var btn = document.getElementById("setup-back-app");
104
110
  if (btn) {
105
111
  btn.hidden = false;
106
- btn.querySelector("span").textContent = backLabel;
107
- if (isAr) { btn.dir = "rtl"; btn.style.direction = "rtl"; }
108
112
  btn.addEventListener("click", function() { window.LevixHost.closePanel(); });
109
113
  }
110
114
  }