plainscript-lang 1.0.35 → 1.0.361

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.
Files changed (92) hide show
  1. package/README.md +1052 -201
  2. package/compiler/bundler.js +4 -4
  3. package/compiler/cli.js +82 -18
  4. package/compiler/dependency-detector.js +34 -22
  5. package/compiler/generator.js +587 -172
  6. package/compiler/lexer.js +61 -39
  7. package/compiler/parser.js +685 -182
  8. package/compiler/sourcemap.js +1 -1
  9. package/compiler/version.js +1 -1
  10. package/docs/CAPABILITY_GAP_AUDIT.md +25 -4
  11. package/docs/FB-PROMPT.md +524 -0
  12. package/docs/GAME-PROMPT.md +916 -0
  13. package/docs/PLAINSCRIPT-SPEC.md +135 -5
  14. package/docs/index.html +28 -14
  15. package/docs/website/script.js +1 -1
  16. package/docs/website/style.css +162 -195
  17. package/examples/ai-providers.pln +1 -1
  18. package/examples/arrays.pln +1 -1
  19. package/examples/async-errors.pln +2 -1
  20. package/examples/auth-api.pln +1 -1
  21. package/examples/auth-sessions.pln +1 -1
  22. package/examples/basics.pln +1 -1
  23. package/examples/bots.pln +1 -1
  24. package/examples/browser-interactive/README.md +29 -0
  25. package/examples/browser-interactive/public/index.html +83 -0
  26. package/examples/browser-interactive/public/interactive.js +27 -0
  27. package/examples/browser-interactive/src/interactive.pln +34 -0
  28. package/examples/cache-and-jobs.pln +1 -1
  29. package/examples/cache-schedule.pln +1 -1
  30. package/examples/canvas-game/README.md +34 -0
  31. package/examples/canvas-game/public/game.js +131 -0
  32. package/examples/canvas-game/public/index.html +48 -0
  33. package/examples/canvas-game/src/game.pln +139 -0
  34. package/examples/collections.pln +1 -1
  35. package/examples/concurrency.pln +1 -1
  36. package/examples/conditions.pln +1 -1
  37. package/examples/database.pln +1 -1
  38. package/examples/day2.pln +1 -1
  39. package/examples/day3.pln +1 -1
  40. package/examples/deployment.pln +1 -1
  41. package/examples/email-send.pln +1 -1
  42. package/examples/error-handling.pln +3 -2
  43. package/examples/expressions.pln +1 -1
  44. package/examples/file-uploads.pln +1 -1
  45. package/examples/files-and-config.pln +1 -1
  46. package/examples/files.pln +1 -1
  47. package/examples/football-backend/app.pln +1 -1
  48. package/examples/functions.pln +1 -1
  49. package/examples/hello.pln +1 -1
  50. package/examples/http-client.pln +1 -1
  51. package/examples/http.pln +1 -1
  52. package/examples/id-verification/app.pln +1 -1
  53. package/examples/javascript-library/README.md +54 -0
  54. package/examples/javascript-library/package-lock.json +21 -0
  55. package/examples/javascript-library/package.json +8 -0
  56. package/examples/javascript-library/public/config.json +4 -0
  57. package/examples/javascript-library/public/index.html +40 -0
  58. package/examples/javascript-library/src/interop.pln +53 -0
  59. package/examples/json.pln +1 -1
  60. package/examples/loops.pln +1 -1
  61. package/examples/modules/app.pln +1 -1
  62. package/examples/modules/main.pln +1 -1
  63. package/examples/modules/math.pln +1 -1
  64. package/examples/mongo.pln +1 -1
  65. package/examples/objects.pln +1 -1
  66. package/examples/ocr.pln +1 -1
  67. package/examples/packages.pln +1 -1
  68. package/examples/record-kinds.pln +1 -1
  69. package/examples/records.pln +1 -1
  70. package/examples/rest-api-fetch.pln +1 -1
  71. package/examples/rest-api.pln +1 -1
  72. package/examples/scheduled-tasks.pln +1 -1
  73. package/examples/search-and-filter.pln +1 -1
  74. package/examples/server.pln +1 -1
  75. package/examples/sessions-and-cookies.pln +1 -1
  76. package/examples/sqlite.pln +1 -1
  77. package/examples/start.pln +1 -1
  78. package/examples/stdlib.pln +1 -1
  79. package/examples/string-verbs.pln +1 -1
  80. package/examples/telegram-ai-bot.pln +1 -1
  81. package/examples/telegram-bot.pln +1 -1
  82. package/examples/testing.pln +1 -1
  83. package/examples/three-dimensional/README.md +51 -0
  84. package/examples/three-dimensional/public/index.html +33 -0
  85. package/examples/three-dimensional/src/scene.pln +34 -0
  86. package/examples/web-api.pln +1 -1
  87. package/examples/web-app.pln +1 -1
  88. package/examples/websocket-server.pln +1 -1
  89. package/examples/websocket.pln +1 -1
  90. package/examples/whatsapp-bot/pairing.pln +2 -2
  91. package/examples/whatsapp-bot/qr.pln +2 -2
  92. package/package.json +9 -10
@@ -1,19 +1,17 @@
1
1
  :root {
2
- --bg: #031004;
3
- --bg-elev: #061b08;
4
- --panel: rgba(8, 31, 11, .9);
5
- --panel-solid: #0a260e;
6
- --line: rgba(122, 190, 127, .18);
7
- --line-strong: rgba(153, 213, 157, .36);
8
- --text: #ebf5eb;
9
- --muted: #a0b7a2;
10
- --accent: #32ad3c;
11
- --accent-bright: #4fc458;
12
- --accent-glow: rgba(50, 173, 60, .2);
13
- --accent-dim: #103b16;
14
- --haze: rgba(50, 173, 60, .07);
15
- --radius: 14px;
16
- font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
2
+ --bg: #0e1210;
3
+ --bg-elev: #141a17;
4
+ --panel: #131916;
5
+ --line: #233026;
6
+ --line-strong: #34472f;
7
+ --text: #edefea;
8
+ --muted: #7c9186;
9
+ --accent: #35c773;
10
+ --accent-bright: #4fe08a;
11
+ --accent-glow: rgba(53, 199, 115, .16);
12
+ --accent-dim: #17301f;
13
+ --radius: 0px;
14
+ font-family: "Public Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
17
15
  color: var(--text);
18
16
  background: var(--bg);
19
17
  }
@@ -22,26 +20,21 @@
22
20
  html { scroll-behavior: smooth; overflow-x: hidden; }
23
21
  body { margin: 0; line-height: 1.6; overflow-x: hidden; }
24
22
  a { color: var(--accent); }
25
- a:hover { color: #79d77f; }
26
- code, pre { font-family: "Roboto Mono", "SFMono-Regular", Consolas, "Liberation Mono", ui-monospace, monospace; }
27
- code { font-size: .92em; color: #b6e0ba; }
23
+ a:hover { color: var(--accent-bright); }
24
+ code, pre { font-family: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", ui-monospace, monospace; }
25
+ code { font-size: .92em; color: #b9e6c7; }
28
26
 
29
27
  .container { width: min(1120px, calc(100% - 40px)); margin: 0 auto; }
30
28
 
31
- /* Full-bleed animated background */
29
+ /* Full-bleed animated background - flat, no glow */
32
30
  .bg-scrim, #bg-canvas {
33
31
  position: fixed;
34
32
  inset: 0;
35
33
  width: 100%;
36
34
  height: 100%;
37
35
  }
38
- .bg-scrim {
39
- z-index: -2;
40
- background:
41
- radial-gradient(900px 520px at 82% -12%, rgba(50, 173, 60, .08), transparent 64%),
42
- linear-gradient(180deg, #031004 0%, #061b08 55%, #031004 100%);
43
- }
44
- #bg-canvas { z-index: -1; opacity: .22; }
36
+ .bg-scrim { z-index: -2; background: var(--bg); }
37
+ #bg-canvas { z-index: -1; opacity: .18; }
45
38
 
46
39
  /* Nav */
47
40
  .site-nav {
@@ -49,29 +42,28 @@ code { font-size: .92em; color: #b6e0ba; }
49
42
  top: 0;
50
43
  z-index: 6;
51
44
  border-bottom: 1px solid transparent;
52
- background: rgba(3, 16, 4, .9);
45
+ background: rgba(14, 18, 16, .92);
53
46
  backdrop-filter: blur(8px);
54
47
  transition: background .3s ease, border-color .3s ease;
55
48
  }
56
- .site-nav.is-scrolled { background: rgba(3, 16, 4, .96); border-color: var(--line); }
57
- .nav-inner, .nav-logo, .nav-links, .hero-actions, .footer-bottom, .library-toolbar { display: flex; align-items: center; }
58
- .nav-inner { min-height: 72px; justify-content: space-between; gap: 24px; }
59
- .nav-logo { gap: 10px; color: var(--text); font-weight: 800; text-decoration: none; letter-spacing: -.01em; }
49
+ .site-nav.is-scrolled { background: rgba(14, 18, 16, .98); border-color: var(--line); }
50
+ .nav-inner, .nav-logo, .nav-links, .footer-bottom, .library-toolbar { display: flex; align-items: center; }
51
+ .nav-inner { min-height: 64px; justify-content: space-between; gap: 24px; }
52
+ .nav-logo { gap: 10px; color: var(--text); font-weight: 500; text-decoration: none; letter-spacing: -.01em; }
60
53
  .nav-logo-image {
61
54
  display: inline-grid;
62
55
  place-items: center;
63
- width: 30px;
64
- height: 30px;
65
- border-radius: 8px;
56
+ width: 26px;
57
+ height: 26px;
58
+ border-radius: 0;
66
59
  object-fit: cover;
67
- box-shadow: 0 3px 10px rgba(0, 0, 0, .28);
68
60
  }
69
- .logo-ver { padding: 3px 8px; border-radius: 99px; color: var(--accent); border: 1px solid var(--line-strong); background: var(--accent-dim); font-size: .72rem; font-weight: 600; }
61
+ .logo-ver { padding: 0; color: var(--muted); font-family: "JetBrains Mono", monospace; font-size: .76rem; font-weight: 400; }
70
62
  .nav-links { gap: 22px; }
71
63
  .nav-links a { color: var(--muted); font-size: .9rem; text-decoration: none; transition: color .2s; }
72
64
  .nav-links a:hover { color: var(--accent); }
73
65
 
74
- /* Hamburger toggle — hidden on desktop */
66
+ /* Hamburger toggle */
75
67
  .nav-toggle {
76
68
  display: none;
77
69
  flex-direction: column;
@@ -81,57 +73,86 @@ code { font-size: .92em; color: #b6e0ba; }
81
73
  height: 44px;
82
74
  padding: 10px;
83
75
  border: none;
84
- border-radius: 8px;
76
+ border-radius: 0;
85
77
  background: transparent;
86
78
  cursor: pointer;
87
79
  -webkit-tap-highlight-color: transparent;
88
80
  }
89
81
  .nav-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
90
- .nav-toggle-bar {
91
- display: block;
92
- width: 100%;
93
- height: 2px;
94
- border-radius: 2px;
95
- background: var(--text);
96
- transition: transform .3s ease, opacity .3s ease;
97
- }
82
+ .nav-toggle-bar { display: block; width: 100%; height: 2px; background: var(--text); transition: transform .3s ease, opacity .3s ease; }
98
83
  .nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
99
84
  .nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
100
85
  .nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
101
86
 
102
- /* Hero */
103
- .hero { position: relative; padding: 108px 0 92px; }
104
- .hero-content { max-width: 840px; position: relative; z-index: 1; }
105
- .hero-badge, .section-tag { color: var(--accent); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; font-size: .76rem; }
87
+ /* Hero - asymmetric, the headline is the demo */
88
+ .hero { position: relative; border-bottom: 1px solid var(--line); }
89
+ .hero-content { position: relative; z-index: 1; padding: 0; }
90
+ .hero-grid {
91
+ display: grid;
92
+ grid-template-columns: 1.1fr 1fr;
93
+ }
94
+ .hero-headline-block {
95
+ padding: 56px 40px 48px 0;
96
+ border-right: 1px solid var(--line);
97
+ }
98
+ .hero-badge {
99
+ display: block;
100
+ margin: 0 0 18px;
101
+ color: var(--muted);
102
+ font-family: "JetBrains Mono", monospace;
103
+ font-size: .84rem;
104
+ font-weight: 400;
105
+ }
106
106
  .hero-title {
107
- max-width: 780px;
108
- margin: 14px 0 16px;
107
+ margin: 0 0 22px;
108
+ color: var(--text);
109
+ font-family: "Newsreader", Georgia, serif;
110
+ font-weight: 500;
111
+ font-size: clamp(1.7rem, 3vw, 2.3rem);
112
+ line-height: 1.55;
113
+ letter-spacing: -.01em;
114
+ }
115
+ .hero-title .kw { color: var(--accent); font-family: "JetBrains Mono", monospace; font-size: .85em; }
116
+ .hero-lead { max-width: 420px; margin: 0 0 26px; color: var(--muted); font-size: 1rem; line-height: 1.75; }
117
+ .hero-actions { display: block; margin: 0; }
118
+ .hero-install-label { display: block; color: var(--muted); font-family: "JetBrains Mono", monospace; font-size: .76rem; margin-bottom: 6px; }
119
+ .hero-actions .button {
120
+ display: inline-block;
121
+ padding: 0;
122
+ border: none;
123
+ border-radius: 0;
124
+ background: none;
109
125
  color: var(--text);
110
- font-size: clamp(2.7rem, 7vw, 5.6rem);
111
- line-height: .98;
112
- letter-spacing: -.055em;
113
- text-wrap: balance;
126
+ font-family: "JetBrains Mono", monospace;
127
+ font-size: .95rem;
128
+ font-weight: 500;
129
+ text-decoration: none;
130
+ border-bottom: 1px solid var(--line-strong);
131
+ transition: border-color .2s, color .2s;
132
+ }
133
+ .hero-actions .button:hover { color: var(--accent); border-color: var(--accent); transform: none; }
134
+ .hero-panel { padding: 0; display: flex; flex-direction: column; }
135
+ .hero-panel-label {
136
+ padding: 12px 24px;
137
+ border-bottom: 1px solid var(--line);
138
+ color: var(--muted);
139
+ font-family: "JetBrains Mono", monospace;
140
+ font-size: .74rem;
114
141
  }
115
- .hero-title > span { display: inline-block; }
116
- .hero-lead { max-width: 660px; color: var(--muted); font-size: 1.2rem; }
117
- .hero-actions { gap: 12px; margin: 30px 0; flex-wrap: wrap; }
118
- .button { display: inline-block; padding: 11px 18px; border-radius: 9px; font-weight: 750; text-decoration: none; transition: transform .2s ease, box-shadow .2s ease, background .2s ease; }
119
- .button-primary { color: #031004; background: var(--accent); }
120
- .button-primary:hover { color: #031004; background: var(--accent-bright); transform: translateY(-2px); }
121
- .button-secondary { color: var(--text); background: var(--panel); border: 1px solid var(--line-strong); backdrop-filter: blur(8px); }
122
- .button-secondary:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-2px); }
123
- .reference-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 24px 0; }
142
+ .button { display: inline-block; padding: 11px 18px; border: 1px solid var(--line-strong); border-radius: 0; font-weight: 500; text-decoration: none; transition: border-color .2s ease, color .2s ease, background .2s ease; }
143
+ .button-primary { color: var(--bg); background: var(--accent); border-color: var(--accent); }
144
+ .button-primary:hover { background: var(--accent-bright); border-color: var(--accent-bright); }
145
+ .button-secondary { color: var(--text); background: transparent; }
146
+ .button-secondary:hover { color: var(--accent); border-color: var(--accent); }
147
+ .reference-actions { display: flex; gap: 0; flex-wrap: wrap; margin: 24px 0; }
124
148
  .button-reference {
125
149
  color: var(--text);
126
150
  border: 1px solid var(--line-strong);
127
- background: var(--accent-dim);
128
- }
129
- .button-reference:hover {
130
- color: var(--text);
131
- border-color: var(--accent-bright);
132
- background: #17551d;
133
- transform: translateY(-2px);
151
+ border-radius: 0;
152
+ margin: 0 -1px -1px 0;
153
+ background: transparent;
134
154
  }
155
+ .button-reference:hover { color: var(--accent); border-color: var(--accent); }
135
156
 
136
157
  /* Code windows */
137
158
  .code-window {
@@ -141,51 +162,43 @@ code { font-size: .92em; color: #b6e0ba; }
141
162
  min-width: 0;
142
163
  overflow: hidden;
143
164
  margin: 28px 0 0;
144
- padding: 26px 24px 24px;
145
- border: 1px solid var(--line-strong);
146
- border-radius: var(--radius);
165
+ padding: 20px 24px;
166
+ border: 1px solid var(--line);
167
+ border-radius: 0;
147
168
  color: #d6ead7;
148
- background: #061b08;
149
- box-shadow: 0 12px 28px rgba(0, 0, 0, .28);
150
- }
151
- .code-window::before {
152
- content: "";
153
- display: block;
154
- width: 46px;
155
- height: 10px;
156
- margin: -8px 0 18px;
157
- border-radius: 99px;
158
- background: var(--line-strong);
169
+ background: var(--panel);
159
170
  }
171
+ .hero-panel .code-window { margin: 0; border: none; flex: 1; }
172
+ .code-window::before { content: none; }
160
173
  .code-window code { color: inherit; }
161
174
  pre code {
162
175
  display: block;
163
176
  max-width: 100%;
164
177
  color: #d6ead7;
165
178
  font-size: .86rem;
166
- font-weight: 500;
167
- letter-spacing: -.012em;
179
+ font-weight: 400;
180
+ letter-spacing: -.006em;
168
181
  line-height: 1.7;
169
182
  white-space: pre-wrap;
170
183
  overflow-wrap: anywhere;
171
184
  word-break: break-word;
172
185
  }
173
- .code-token--keyword { color: #C678DD; font-weight: 500; }
174
- .code-token--declaration { color: #C678DD; font-weight: 600; font-style: italic; }
186
+ .code-token--keyword { color: var(--accent); font-weight: 500; }
187
+ .code-token--declaration { color: var(--accent); font-weight: 500; font-style: normal; }
175
188
  .code-token--comparison,
176
- .code-token--operator { color: #56B6C2; }
189
+ .code-token--operator { color: #7fc8d6; }
177
190
  .code-token--assignment,
178
191
  .code-token--web,
179
- .code-token--error { color: #E06C75; }
192
+ .code-token--error { color: #e0847e; }
180
193
  .code-token--string,
181
194
  .code-token--template,
182
- .code-token--test { color: #98C379; }
195
+ .code-token--test { color: #b9e6c7; }
183
196
  .code-token--number,
184
- .code-token--constant { color: #D19E66; }
185
- .code-token--comment { color: #5C6370; font-style: italic; }
186
- .code-token--function { color: #61AFEF; font-weight: 600; }
197
+ .code-token--constant { color: #d4b483; }
198
+ .code-token--comment { color: #5c6a61; font-style: italic; }
199
+ .code-token--function { color: #7fb0e0; font-weight: 500; }
187
200
  .code-token--builtin,
188
- .code-token--database { color: #E5C07B; }
201
+ .code-token--database { color: #d6c27f; }
189
202
  .copy-button {
190
203
  position: absolute;
191
204
  top: 10px;
@@ -193,56 +206,49 @@ pre code {
193
206
  min-height: 30px;
194
207
  padding: 4px 9px;
195
208
  border: 1px solid var(--line-strong);
196
- border-radius: 6px;
209
+ border-radius: 0;
197
210
  color: var(--muted);
198
- background: rgba(3, 16, 4, .92);
211
+ background: var(--bg);
199
212
  cursor: pointer;
200
213
  font: inherit;
201
214
  font-size: .72rem;
202
215
  line-height: 1.2;
203
216
  transition: color .2s, border-color .2s, background .2s;
204
217
  }
205
- .copy-button:hover, .copy-button:focus-visible {
206
- color: var(--accent);
207
- border-color: var(--accent);
208
- background: var(--accent-dim);
209
- }
218
+ .copy-button:hover, .copy-button:focus-visible { color: var(--accent); border-color: var(--accent); background: var(--accent-dim); }
210
219
  .copy-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
211
- .copy-button.is-copied { color: #04140f; border-color: var(--accent); background: var(--accent); }
220
+ .copy-button.is-copied { color: var(--bg); border-color: var(--accent); background: var(--accent); }
212
221
 
213
- .section { padding: 84px 0; }
214
- .section--alt { background: linear-gradient(180deg, var(--haze), transparent 42%), rgba(12, 19, 33, .55); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
215
- .section-title { max-width: 720px; margin: 8px 0 34px; color: var(--text); font-size: clamp(2rem, 4vw, 3.2rem); line-height: 1.05; letter-spacing: -.035em; text-wrap: balance; }
222
+ .section { padding: 72px 0; border-bottom: 1px solid var(--line); }
223
+ .section--alt { background: var(--bg-elev); }
224
+ .section-tag { margin: 0 0 8px; color: var(--muted); font-family: "JetBrains Mono", monospace; font-size: .8rem; font-weight: 400; }
225
+ .section-title { max-width: 640px; margin: 0 0 34px; color: var(--text); font-family: "Newsreader", Georgia, serif; font-weight: 500; font-size: clamp(1.6rem, 3.4vw, 2.4rem); line-height: 1.3; letter-spacing: -.01em; }
216
226
  .section-lead { color: var(--muted); }
217
- .three-column, .feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
227
+ .three-column, .feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
218
228
 
219
- /* Cards */
229
+ /* Cards - flat, hairline-separated, no shadow */
220
230
  .info-card, .feature-card, .library-card {
221
231
  padding: 24px;
222
- border: 1px solid var(--line);
223
- border-radius: var(--radius);
232
+ border: none;
233
+ border-radius: 0;
224
234
  background: var(--panel);
225
- backdrop-filter: blur(10px);
226
- transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
227
- }
228
- .info-card:hover, .feature-card:hover, .library-card:hover {
229
- transform: translateY(-4px);
230
- border-color: var(--line-strong);
231
- box-shadow: 0 12px 28px rgba(0, 0, 0, .28);
235
+ transition: background .2s ease;
232
236
  }
233
- .info-card h3, .feature-card h3, .library-card h3 { margin: 8px 0 6px; color: var(--text); }
237
+ .info-card:hover, .feature-card:hover, .library-card:hover { transform: none; background: var(--bg-elev); box-shadow: none; }
238
+ .info-card h3, .feature-card h3, .library-card h3 { margin: 8px 0 6px; color: var(--text); font-weight: 500; }
234
239
  .info-card p, .feature-card p, .library-card p { margin: 0; color: var(--muted); }
235
- .card-number { color: var(--accent-bright); font-size: .8rem; font-weight: 850; letter-spacing: .08em; }
240
+ .card-number { color: var(--accent); font-family: "JetBrains Mono", monospace; font-size: .8rem; font-weight: 400; }
236
241
 
237
- .capability-list { display: flex; gap: 10px; flex-wrap: wrap; }
242
+ .capability-list { display: flex; gap: 0; flex-wrap: wrap; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
238
243
  .capability-list span, .library-category {
239
- padding: 8px 12px;
240
- border-radius: 99px;
241
- color: var(--accent);
242
- border: 1px solid var(--line-strong);
243
- background: var(--accent-dim);
244
+ padding: 8px 14px;
245
+ border-radius: 0;
246
+ color: var(--muted);
247
+ border-right: 1px solid var(--line);
248
+ border-bottom: 1px solid var(--line);
249
+ background: transparent;
244
250
  font-size: .84rem;
245
- font-weight: 700;
251
+ font-weight: 400;
246
252
  }
247
253
 
248
254
  /* Library */
@@ -251,20 +257,21 @@ pre code {
251
257
  min-width: 240px;
252
258
  padding: 12px 14px;
253
259
  border: 1px solid var(--line-strong);
254
- border-radius: 9px;
260
+ border-radius: 0;
255
261
  font: inherit;
256
262
  color: var(--text);
257
- background: #0c1524;
263
+ background: var(--panel);
258
264
  outline: none;
259
265
  transition: border-color .2s, box-shadow .2s;
260
266
  }
261
267
  .lib-search-input::placeholder { color: var(--muted); }
262
- .lib-search-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
263
- .lib-filters { display: flex; gap: 8px; flex-wrap: wrap; }
268
+ .lib-search-input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-glow); }
269
+ .lib-filters { display: flex; gap: 0; flex-wrap: wrap; }
264
270
  .lib-filter {
265
271
  padding: 8px 12px;
266
272
  border: 1px solid var(--line-strong);
267
- border-radius: 99px;
273
+ border-radius: 0;
274
+ margin: 0 -1px -1px 0;
268
275
  color: var(--muted);
269
276
  background: transparent;
270
277
  cursor: pointer;
@@ -273,8 +280,8 @@ pre code {
273
280
  text-transform: capitalize;
274
281
  transition: all .2s;
275
282
  }
276
- .lib-filter.is-active, .lib-filter:hover { color: #04140f; border-color: var(--accent); background: var(--accent); box-shadow: 0 6px 18px var(--accent-glow); }
277
- .lib-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
283
+ .lib-filter.is-active, .lib-filter:hover { color: var(--bg); border-color: var(--accent); background: var(--accent); box-shadow: none; }
284
+ .lib-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
278
285
  .library-card-top { min-height: 102px; }
279
286
  .library-card pre {
280
287
  position: relative;
@@ -284,101 +291,61 @@ pre code {
284
291
  overflow: hidden;
285
292
  margin: 18px 0 -8px;
286
293
  padding: 44px 16px 16px;
287
- border-radius: 9px;
288
- color: #d6ead7;
289
- background: #061b08;
294
+ border-radius: 0;
295
+ color: #d6ead7;
296
+ background: var(--bg);
290
297
  border: 1px solid var(--line);
291
298
  font-size: .82rem;
292
299
  }
293
300
  .lib-empty { color: var(--muted); }
294
301
 
295
302
  .split { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
296
- .site-footer { padding: 28px 0; color: var(--muted); border-top: 1px solid var(--line); background: rgba(7, 12, 22, .8); }
297
- .footer-bottom { justify-content: space-between; gap: 16px; }
303
+ .site-footer { padding: 24px 0; color: var(--muted); border-top: 1px solid var(--line); background: var(--bg); }
304
+ .footer-bottom { justify-content: space-between; gap: 16px; font-family: "JetBrains Mono", monospace; font-size: .8rem; }
298
305
  .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
299
306
 
300
- ::selection { color: #04140f; background: var(--accent); }
307
+ ::selection { color: var(--bg); background: var(--accent); }
301
308
  textarea, input { caret-color: var(--accent); }
302
309
 
303
310
  @media (prefers-reduced-motion: reduce) {
304
311
  html { scroll-behavior: auto; }
305
312
  * { animation: none !important; transition: none !important; }
306
- .info-card:hover, .feature-card:hover, .library-card:hover { transform: none; }
307
313
  }
308
314
 
309
315
  /* ──────────────────────────────────────────────────────────────────────
310
316
  MOBILE LAYOUT (≤ 760px)
311
317
  ────────────────────────────────────────────────────────────────────── */
312
318
  @media (max-width: 760px) {
313
-
314
- /* --- Nav: hamburger + collapsible menu --- */
315
319
  .nav-toggle { display: flex; }
316
320
  .nav-inner { flex-wrap: wrap; padding: 12px 0; }
317
- .nav-links {
318
- display: none;
319
- flex-basis: 100%;
320
- flex-direction: column;
321
- gap: 0;
322
- padding: 8px 0 4px;
323
- }
321
+ .nav-links { display: none; flex-basis: 100%; flex-direction: column; gap: 0; padding: 8px 0 4px; }
324
322
  .nav-links.is-open { display: flex; }
325
- .nav-links a {
326
- display: flex;
327
- align-items: center;
328
- min-height: 44px;
329
- padding: 6px 0;
330
- font-size: 1rem;
331
- color: var(--muted);
332
- border-bottom: 1px solid var(--line);
333
- }
323
+ .nav-links a { display: flex; align-items: center; min-height: 44px; padding: 6px 0; font-size: 1rem; color: var(--muted); border-bottom: 1px solid var(--line); }
334
324
  .nav-links a:last-child { border-bottom: none; }
335
325
 
336
- /* --- Hero --- */
337
- .hero { padding: 56px 0 48px; }
338
- .hero-title { font-size: clamp(2rem, 8vw, 3rem); line-height: 1.05; }
339
- .hero-lead { font-size: 1.05rem; line-height: 1.55; }
340
- .hero-actions { gap: 10px; margin: 22px 0 24px; }
326
+ .hero-grid { grid-template-columns: 1fr; }
327
+ .hero-headline-block { padding: 40px 0 32px; border-right: none; border-bottom: 1px solid var(--line); }
328
+ .hero-title { font-size: 1.5rem; line-height: 1.5; }
329
+ .hero-lead { font-size: .98rem; line-height: 1.65; max-width: 100%; }
330
+ .hero-panel { border-top: none; }
341
331
 
342
- /* --- Buttons: touch-friendly --- */
343
332
  .button { padding: 12px 20px; font-size: .95rem; min-height: 44px; }
333
+ .code-window { padding: 16px 14px; font-size: .82rem; }
344
334
 
345
- /* --- Code windows: full-width, no overflow tricks --- */
346
- .code-window {
347
- padding: 18px 14px 16px;
348
- font-size: .82rem;
349
- border-radius: 10px;
350
- }
335
+ .section { padding: 44px 0; }
336
+ .section-title { font-size: clamp(1.4rem, 6vw, 1.9rem); margin-bottom: 22px; }
351
337
 
352
- /* --- Sections --- */
353
- .section { padding: 48px 0; }
354
- .section-title { font-size: clamp(1.6rem, 6vw, 2.2rem); margin-bottom: 24px; }
338
+ .three-column, .feature-grid, .lib-grid, .split { grid-template-columns: 1fr; }
355
339
 
356
- /* --- Grids: single column --- */
357
- .three-column,
358
- .feature-grid,
359
- .lib-grid,
360
- .split { grid-template-columns: 1fr; gap: 14px; }
361
-
362
- /* --- Cards: touch-friendly tap targets --- */
363
- .info-card,
364
- .feature-card,
365
- .library-card { padding: 20px 18px; }
366
-
367
- /* --- Capability list --- */
340
+ .info-card, .feature-card, .library-card { padding: 20px 18px; }
368
341
  .capability-list span { font-size: .8rem; padding: 7px 10px; }
369
342
 
370
- /* --- Library search & filters --- */
371
343
  .library-toolbar { flex-direction: column; gap: 12px; }
372
- .lib-search-input { width: 100%; min-width: 0; font-size: 1rem; }
344
+ .lib-search-input { width: 100%; min-width: 0; font-size: 1rem; }
373
345
  .lib-filters { width: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
374
346
  .lib-filter { white-space: nowrap; min-height: 40px; font-size: .84rem; }
375
347
 
376
- /* --- Split (reference section) --- */
377
348
  .split { gap: 24px; }
378
-
379
- /* --- Footer --- */
380
349
  .footer-bottom { flex-direction: column; align-items: center; text-align: center; gap: 6px; }
381
-
382
- /* --- Canvas background: prevent horizontal scroll --- */
383
350
  #bg-canvas { width: 100vw; height: 100vh; pointer-events: none; }
384
- }
351
+ }
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.35: provider-backed AI works in ordinary programs.
1
+ // PlainScript 1.0.361: provider-backed AI works in ordinary programs.
2
2
 
3
3
  remember answer as chatWith("groq", "llama-3.3-70b-versatile", "Explain PlainScript in one sentence")
4
4
  show answer
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.35: array literals and indexing.
1
+ // PlainScript 1.0.361: array literals and indexing.
2
2
  remember values as [1, 2, 3]
3
3
  show values[0]
4
4
  show length(values)
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.35: asynchronous work and error recovery.
1
+ // PlainScript 1.0.361: asynchronous work and error recovery.
2
2
 
3
3
  make loadProfile(id)
4
4
  wait for sleep(10)
@@ -12,6 +12,7 @@ recover as err
12
12
  show message of err
13
13
  finally
14
14
  show "request complete"
15
+ done
15
16
 
16
17
  retry 3 times every 2 seconds
17
18
  show "retrying"
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.35: protected API route.
1
+ // PlainScript 1.0.361: protected API route.
2
2
  web app
3
3
  require api key from env("API_KEY")
4
4
  route get "/private"
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.35: API keys, sessions, cookies, and auth helpers.
1
+ // PlainScript 1.0.361: API keys, sessions, cookies, and auth helpers.
2
2
 
3
3
  web app
4
4
  enable sessions "development-only-session-secret"
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.35: variables, values, and output.
1
+ // PlainScript 1.0.361: variables, values, and output.
2
2
 
3
3
  remember name as "Ada"
4
4
  remember visitCount as 3
package/examples/bots.pln CHANGED
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.35: Telegram bot handlers.
1
+ // PlainScript 1.0.361: Telegram bot handlers.
2
2
 
3
3
  bot env("TELEGRAM_BOT_TOKEN")
4
4
 
@@ -0,0 +1,29 @@
1
+ # DOM-first interactive clicker
2
+
3
+ A small dashboard built with PlainScript that talks to the DOM directly -
4
+ no canvas, no library, no bundler. Click **+10 points** and the score span
5
+ updates; click **Log entry** to append a line to the run log; press **R** to
6
+ reset both.
7
+
8
+ It demonstrates the v1.0.361 browser API:
9
+
10
+ - `document.querySelector` + `.innerHTML becomes` / `.textContent becomes`.
11
+ - `when clickButton "click" happens` DOM event handlers.
12
+ - `document.createElement("li")` + `historyEl.appendChild(item)`.
13
+ - Reading state back out of the DOM (`parseInt(scoreEl.textContent)`) instead
14
+ of keeping a parallel variable.
15
+ - `document.addEventListener("keydown", ...)` via `when document "keydown" happens as e`
16
+ and `classList.add` / `classList.remove`.
17
+ - The DOM-overlay UI pattern: a plain HTML dashboard driving game-style logic.
18
+
19
+ ## Run
20
+
21
+ Build the compiled script and serve the folder (any static file server works -
22
+ `npx serve public` is one option):
23
+
24
+ ```bash
25
+ npx plainscript build src/interactive.pln -o public/interactive.js
26
+ npx serve public
27
+ ```
28
+
29
+ Then open http://localhost:3000.