trebol 0.1.0 → 0.1.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.
Files changed (160) hide show
  1. package/README.md +18 -3
  2. package/dist/cli.js +13790 -11417
  3. package/dist/fonts/OFL.txt +93 -0
  4. package/dist/fonts/inter-cyrillic-ext.woff2 +0 -0
  5. package/dist/fonts/inter-cyrillic.woff2 +0 -0
  6. package/dist/fonts/inter-greek-ext.woff2 +0 -0
  7. package/dist/fonts/inter-greek.woff2 +0 -0
  8. package/dist/fonts/inter-latin-ext.woff2 +0 -0
  9. package/dist/fonts/inter-latin.woff2 +0 -0
  10. package/dist/fonts/inter-vietnamese.woff2 +0 -0
  11. package/dist/lib/core/access.d.ts +10 -0
  12. package/dist/lib/core/access.js +210 -0
  13. package/dist/lib/core/base.d.ts +4 -0
  14. package/dist/lib/core/base.js +50 -0
  15. package/dist/lib/core/bitset.d.ts +9 -0
  16. package/dist/lib/core/bitset.js +75 -0
  17. package/dist/lib/core/boot.d.ts +18 -0
  18. package/dist/lib/core/boot.js +73 -0
  19. package/dist/lib/core/compare.d.ts +9 -0
  20. package/dist/lib/core/compare.js +156 -0
  21. package/dist/lib/core/ctx.d.ts +36 -0
  22. package/dist/lib/core/ctx.js +251 -0
  23. package/dist/lib/core/dec.d.ts +28 -0
  24. package/dist/lib/core/dec.js +158 -0
  25. package/dist/lib/core/errors.d.ts +15 -0
  26. package/dist/lib/core/errors.js +44 -0
  27. package/dist/lib/core/escapes.d.ts +14 -0
  28. package/dist/lib/core/escapes.js +80 -0
  29. package/dist/lib/core/eval.d.ts +220 -0
  30. package/dist/lib/core/eval.js +666 -0
  31. package/dist/lib/core/func.d.ts +68 -0
  32. package/dist/lib/core/func.js +129 -0
  33. package/dist/lib/core/hash.d.ts +5 -0
  34. package/dist/lib/core/hash.js +155 -0
  35. package/dist/lib/core/index.d.ts +18 -0
  36. package/dist/lib/core/index.js +20 -0
  37. package/dist/lib/core/int64.d.ts +22 -0
  38. package/dist/lib/core/int64.js +113 -0
  39. package/dist/lib/core/kinds.d.ts +67 -0
  40. package/dist/lib/core/kinds.js +134 -0
  41. package/dist/lib/core/lexer.d.ts +13 -0
  42. package/dist/lib/core/lexer.js +702 -0
  43. package/dist/lib/core/mezz.d.ts +1 -0
  44. package/dist/lib/core/mezz.js +360 -0
  45. package/dist/lib/core/mold.d.ts +20 -0
  46. package/dist/lib/core/mold.js +434 -0
  47. package/dist/lib/core/natives/control.d.ts +1 -0
  48. package/dist/lib/core/natives/control.js +374 -0
  49. package/dist/lib/core/natives/csv.d.ts +15 -0
  50. package/dist/lib/core/natives/csv.js +315 -0
  51. package/dist/lib/core/natives/data.d.ts +11 -0
  52. package/dist/lib/core/natives/data.js +367 -0
  53. package/dist/lib/core/natives/define.d.ts +17 -0
  54. package/dist/lib/core/natives/define.js +47 -0
  55. package/dist/lib/core/natives/encode.d.ts +3 -0
  56. package/dist/lib/core/natives/encode.js +187 -0
  57. package/dist/lib/core/natives/json.d.ts +5 -0
  58. package/dist/lib/core/natives/json.js +273 -0
  59. package/dist/lib/core/natives/math.d.ts +3 -0
  60. package/dist/lib/core/natives/math.js +500 -0
  61. package/dist/lib/core/natives/parse.d.ts +1 -0
  62. package/dist/lib/core/natives/parse.js +600 -0
  63. package/dist/lib/core/natives/series.d.ts +4 -0
  64. package/dist/lib/core/natives/series.js +519 -0
  65. package/dist/lib/core/natives/text.d.ts +1 -0
  66. package/dist/lib/core/natives/text.js +487 -0
  67. package/dist/lib/core/natives/xml.d.ts +9 -0
  68. package/dist/lib/core/natives/xml.js +242 -0
  69. package/dist/lib/core/series.d.ts +26 -0
  70. package/dist/lib/core/series.js +73 -0
  71. package/dist/lib/core/symbols.d.ts +9 -0
  72. package/dist/lib/core/symbols.js +44 -0
  73. package/dist/lib/core/values.d.ts +206 -0
  74. package/dist/lib/core/values.js +223 -0
  75. package/dist/lib/host/browser.d.ts +4 -0
  76. package/dist/lib/host/browser.js +4974 -0
  77. package/dist/lib/host/chart.d.ts +26 -0
  78. package/dist/lib/host/chart.js +158 -0
  79. package/dist/lib/host/compress.d.ts +1 -0
  80. package/dist/lib/host/compress.js +37 -0
  81. package/dist/lib/host/devlog.d.ts +11 -0
  82. package/dist/lib/host/devlog.js +13 -0
  83. package/dist/lib/host/devtools.d.ts +23 -0
  84. package/dist/lib/host/devtools.js +626 -0
  85. package/dist/lib/host/draw.d.ts +31 -0
  86. package/dist/lib/host/draw.js +348 -0
  87. package/dist/lib/host/fonts/OFL.txt +93 -0
  88. package/dist/lib/host/fonts/inter-cyrillic-ext.woff2 +0 -0
  89. package/dist/lib/host/fonts/inter-cyrillic.woff2 +0 -0
  90. package/dist/lib/host/fonts/inter-greek-ext.woff2 +0 -0
  91. package/dist/lib/host/fonts/inter-greek.woff2 +0 -0
  92. package/dist/lib/host/fonts/inter-latin-ext.woff2 +0 -0
  93. package/dist/lib/host/fonts/inter-latin.woff2 +0 -0
  94. package/dist/lib/host/fonts/inter-vietnamese.woff2 +0 -0
  95. package/dist/lib/host/fonts.d.ts +11 -0
  96. package/dist/lib/host/fonts.js +29 -0
  97. package/dist/lib/host/icons.d.ts +3 -0
  98. package/dist/lib/host/icons.js +97 -0
  99. package/dist/lib/host/index.d.ts +40 -0
  100. package/dist/lib/host/index.js +192 -0
  101. package/dist/lib/host/js.d.ts +5 -0
  102. package/dist/lib/host/js.js +130 -0
  103. package/dist/lib/host/locale.d.ts +40 -0
  104. package/dist/lib/host/locale.js +241 -0
  105. package/dist/lib/host/markdown.d.ts +30 -0
  106. package/dist/lib/host/markdown.js +161 -0
  107. package/dist/lib/host/modules.d.ts +14 -0
  108. package/dist/lib/host/modules.js +300 -0
  109. package/dist/lib/host/natives.d.ts +6 -0
  110. package/dist/lib/host/natives.js +98 -0
  111. package/dist/lib/host/net.d.ts +12 -0
  112. package/dist/lib/host/net.js +549 -0
  113. package/dist/lib/host/orbit.d.ts +121 -0
  114. package/dist/lib/host/orbit.js +374 -0
  115. package/dist/lib/host/page.d.ts +9 -0
  116. package/dist/lib/host/page.js +55 -0
  117. package/dist/lib/host/rows.d.ts +29 -0
  118. package/dist/lib/host/rows.js +109 -0
  119. package/dist/lib/host/scheduler.d.ts +51 -0
  120. package/dist/lib/host/scheduler.js +197 -0
  121. package/dist/lib/host/theme.d.ts +58 -0
  122. package/dist/lib/host/theme.js +1667 -0
  123. package/dist/lib/ui/i18n.trb +117 -0
  124. package/dist/lib/ui/test.trb +565 -0
  125. package/dist/lib/ui/ui.trb +1678 -0
  126. package/dist/trebol.js +1427 -138
  127. package/editors/vscode/README.md +15 -0
  128. package/editors/vscode/language-configuration.json +28 -0
  129. package/editors/vscode/package.json +42 -0
  130. package/editors/vscode/syntaxes/trebol.tmLanguage.json +237 -0
  131. package/package.json +23 -7
  132. package/src/core/boot.ts +1 -1
  133. package/src/core/func.ts +4 -0
  134. package/src/core/natives/control.ts +1 -1
  135. package/src/core/natives/series.ts +9 -1
  136. package/src/core/natives/text.ts +2 -0
  137. package/src/host/browser.ts +1235 -83
  138. package/src/host/devlog.ts +16 -0
  139. package/src/host/devtools.ts +641 -0
  140. package/src/host/fonts/OFL.txt +93 -0
  141. package/src/host/fonts/inter-cyrillic-ext.woff2 +0 -0
  142. package/src/host/fonts/inter-cyrillic.woff2 +0 -0
  143. package/src/host/fonts/inter-greek-ext.woff2 +0 -0
  144. package/src/host/fonts/inter-greek.woff2 +0 -0
  145. package/src/host/fonts/inter-latin-ext.woff2 +0 -0
  146. package/src/host/fonts/inter-latin.woff2 +0 -0
  147. package/src/host/fonts/inter-vietnamese.woff2 +0 -0
  148. package/src/host/fonts.ts +39 -0
  149. package/src/host/index.ts +5 -3
  150. package/src/host/js.ts +127 -0
  151. package/src/host/markdown.ts +9 -0
  152. package/src/host/modules.ts +41 -2
  153. package/src/host/net.ts +9 -1
  154. package/src/host/orbit.ts +432 -0
  155. package/src/host/rows.ts +30 -0
  156. package/src/host/scheduler.ts +62 -36
  157. package/src/host/theme.ts +270 -6
  158. package/src/ui/i18n.trb +10 -0
  159. package/src/ui/test.trb +565 -0
  160. package/src/ui/ui.trb +564 -90
package/src/host/theme.ts CHANGED
@@ -213,6 +213,34 @@ export function contrast(x: Oklch, y: Oklch): number {
213
213
  return (Math.max(a, b) + 0.05) / (Math.min(a, b) + 0.05);
214
214
  }
215
215
 
216
+ const encode = (x: number): number => (x <= 0.0031308 ? 12.92 * x : 1.055 * x ** (1 / 2.4) - 0.055);
217
+ const decode = (x: number): number => (x <= 0.04045 ? x / 12.92 : ((x + 0.055) / 1.055) ** 2.4);
218
+
219
+ /** Luminance of `c` at `alpha` over a pixel of gray `px` (0 black, 1 white), blended as browsers do. */
220
+ export function luminanceOver(c: Oklch, alpha: number, px: number): number {
221
+ const [r, g, b] = toLinearRgb(c).map(x => decode(alpha * encode(x) + (1 - alpha) * px)) as [number, number, number];
222
+ return 0.2126 * r + 0.7152 * g + 0.0722 * b;
223
+ }
224
+
225
+ /** The worst contrast of `fg` on the background at `alpha` over any image: a black or a white one. */
226
+ export function contrastOverImage(fg: Oklch, bg: Oklch, alpha: number): number {
227
+ const t = luminance(fg);
228
+ return Math.min(...[0, 1].map(px => {
229
+ const b = luminanceOver(bg, alpha, px);
230
+ return (Math.max(t, b) + 0.05) / (Math.min(t, b) + 0.05);
231
+ }));
232
+ }
233
+
234
+ /**
235
+ * The alpha of the veil over a backdrop: the least that keeps text AA on any image. Muted text would
236
+ * need a veil almost opaque, so on a backdrop it takes the color of the text.
237
+ */
238
+ export function scrimAlpha(p: Record<Role, Oklch>): number {
239
+ let alpha = 0.5;
240
+ while (alpha < 1 && contrastOverImage(p.text, p.bg, alpha) < 4.6) alpha = Math.round((alpha + 0.01) * 100) / 100;
241
+ return alpha;
242
+ }
243
+
216
244
  const css = (c: Oklch, alpha?: number): string =>
217
245
  `oklch(${(c.l * 100).toFixed(1)}% ${c.c.toFixed(3)} ${c.h.toFixed(1)}${alpha === undefined ? '' : ` / ${alpha}`})`;
218
246
 
@@ -245,6 +273,7 @@ function colorVars(t: ThemeParams, dark: boolean): string {
245
273
  lines.push(` --tb-danger-soft: ${css(p.danger, dark ? 0.16 : 0.08)};`);
246
274
  lines.push(` --tb-primary-soft: ${css(p.primary, dark ? 0.16 : 0.08)};`);
247
275
  lines.push(` --tb-overlay: ${css(n0(p), dark ? 0.6 : 0.4)};`);
276
+ lines.push(` --tb-scrim: ${css(p.bg, scrimAlpha(p))};`);
248
277
  const shadow = dark ? '0 0 0 1px oklch(100% 0 0 / 0.06)' : `0 1px 2px ${css(n0(p), 0.06)}`;
249
278
  const k = t.depth === 'lifted' ? 2 : 1;
250
279
  // a flat look has no shadows, but what floats over the page still needs one
@@ -363,6 +392,12 @@ body {
363
392
  background-size: cover;
364
393
  background-position: center;
365
394
  }
395
+ /* an image behind what holds it, under a veil that keeps text on it AA; muted text needs the text's color there */
396
+ :has(> .tb-backdrop) { position: relative; isolation: isolate; --tb-muted: var(--tb-text); }
397
+ .tb-backdrop { position: absolute; inset: 0; z-index: -1; border-radius: inherit; background-size: cover; background-position: center; pointer-events: none; }
398
+ .tb-backdrop::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--tb-scrim); }
399
+ /* the backdrop of the view or of a screen is the window's */
400
+ :is(.tb-view, .tb-screen) > .tb-backdrop { position: fixed; border-radius: 0; }
366
401
  .tb-tile {
367
402
  font: inherit;
368
403
  font-size: 13px;
@@ -692,7 +727,15 @@ button.tb-crumb:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--tb-fo
692
727
  .tb-scroll.tb-large { max-height: 640px; }
693
728
  .tb-scroll:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--tb-focus-ring); }
694
729
 
695
- .tb-image { display: block; max-width: 100%; height: auto; border-radius: var(--tb-radius); }
730
+ .tb-image { display: block; max-width: 100%; height: auto; border-radius: var(--tb-radius); object-fit: cover; }
731
+ .tb-image.tb-round { aspect-ratio: 1; border-radius: 50%; }
732
+ .tb-video { display: block; width: 100%; max-width: 100%; height: auto; aspect-ratio: auto 16 / 9; border-radius: var(--tb-radius); }
733
+ .tb-audio { display: block; width: 100%; max-width: 480px; }
734
+ :is(.tb-video, .tb-audio).tb-small { width: 320px; }
735
+ :is(.tb-video, .tb-audio).tb-medium { width: 480px; }
736
+ .tb-video.tb-large { width: 720px; }
737
+ :is(.tb-video, .tb-audio).tb-fill { max-width: none; }
738
+ :is(.tb-video, .tb-audio):focus-visible { outline: none; box-shadow: 0 0 0 3px var(--tb-focus-ring); }
696
739
  .tb-canvas { display: block; max-width: 100%; }
697
740
  .tb-canvas > svg { display: block; max-width: 100%; height: auto; overflow: visible; }
698
741
  .tb-canvas.tb-fill > svg { width: 100%; }
@@ -705,6 +748,41 @@ button.tb-crumb:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--tb-fo
705
748
  .tb-chart-swatch { width: 12px; height: 12px; border-radius: 3px; background: var(--tb-swatch); }
706
749
  .tb-chart-empty { margin: 0; color: var(--tb-muted); }
707
750
  .tb-chart-caption[hidden], .tb-chart-plot[hidden], .tb-chart-legend[hidden], .tb-chart-empty[hidden] { display: none; }
751
+ .tb-orbit { position: relative; align-self: stretch; width: 100%; min-width: 0; height: 480px; border-radius: var(--tb-radius);
752
+ background: radial-gradient(ellipse at 50% 45%, color-mix(in oklch, var(--tb-primary) 7%, transparent) 0%, transparent 70%); }
753
+ .tb-orbit.tb-small { height: 320px; }
754
+ .tb-orbit.tb-large { height: 640px; }
755
+ .tb-orbit.tb-fit { height: auto; min-height: 320px; }
756
+ .tb-orbit > svg { display: block; position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; user-select: none; touch-action: none; outline: none; }
757
+ .tb-orbit > svg.tb-orbit-panning { cursor: grabbing; }
758
+ .tb-orbit > svg:focus-visible { box-shadow: inset 0 0 0 3px var(--tb-focus-ring); border-radius: var(--tb-radius); }
759
+ .tb-orbit-node { cursor: pointer; outline: none; }
760
+ .tb-orbit-focus { cursor: default; }
761
+ .tb-orbit-body { vector-effect: non-scaling-stroke; transition: stroke-width .2s; }
762
+ .tb-orbit-node:hover .tb-orbit-body, .tb-orbit-node:focus-visible .tb-orbit-body { stroke-width: 3; }
763
+ .tb-orbit-node:focus-visible .tb-orbit-body { stroke: var(--tb-focus); }
764
+ .tb-orbit-halo { opacity: .55; transition: opacity .25s; pointer-events: none; }
765
+ .tb-orbit-node:hover .tb-orbit-halo, .tb-orbit-node:focus-visible .tb-orbit-halo { opacity: 1; }
766
+ .tb-orbit-node text { pointer-events: none; fill: var(--tb-text); text-anchor: middle; dominant-baseline: middle; font-family: var(--tb-font); }
767
+ .tb-orbit-node .tb-orbit-count { fill: var(--tb-muted); }
768
+ .tb-orbit-line, .tb-orbit-step { fill: none; vector-effect: non-scaling-stroke; pointer-events: none; }
769
+ .tb-orbit-line { stroke-width: 1; }
770
+ .tb-orbit-step { stroke-linecap: round; }
771
+ .tb-orbit-spin { animation: tb-orbit-spin 60s linear infinite; }
772
+ .tb-orbit-spin.tb-orbit-rev { animation-direction: reverse; animation-duration: 90s; }
773
+ .tb-orbit-spin.tb-orbit-fast { animation-duration: 24s; }
774
+ @keyframes tb-orbit-spin { to { transform: rotate(360deg); } }
775
+ .tb-orbit-now { animation: tb-orbit-pulse 1.8s ease-in-out infinite; }
776
+ @keyframes tb-orbit-pulse { 50% { opacity: .35; } }
777
+ .tb-orbit-edge { fill: none; pointer-events: none; }
778
+ .tb-orbit-edge-solid, .tb-orbit-edge-dashed { stroke: var(--tb-accent); stroke-width: 1.4; stroke-opacity: .7; }
779
+ .tb-orbit-edge-dashed { stroke-dasharray: 5 5; }
780
+ .tb-orbit-edge-faint { stroke: var(--tb-muted); stroke-width: 1; stroke-opacity: .35; }
781
+ .tb-orbit-edge-trail { stroke: var(--tb-muted); stroke-width: 1; stroke-opacity: .5; stroke-dasharray: 2 6; }
782
+ .tb-orbit-label { font-size: 11px; font-family: var(--tb-font); fill: var(--tb-muted); text-anchor: middle; pointer-events: none;
783
+ paint-order: stroke; stroke: var(--tb-bg); stroke-width: 3px; letter-spacing: .02em; }
784
+ .tb-orbit-label.tb-orbit-later { visibility: hidden; }
785
+ .tb-orbit-label.tb-orbit-later.tb-orbit-shown { visibility: visible; }
708
786
  .tb-image.tb-small { width: 96px; }
709
787
  .tb-image.tb-medium { width: 240px; }
710
788
  .tb-image.tb-large { width: 480px; }
@@ -715,6 +793,17 @@ button.tb-crumb:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--tb-fo
715
793
  .tb-progress-label[hidden] { display: none; }
716
794
  .tb-progress { height: 8px; border-radius: 4px; background: var(--tb-border); overflow: hidden; }
717
795
  .tb-upload-progress { height: 6px; }
796
+ .tb-widget { display: block; width: 100%; min-width: 0; }
797
+ .tb-photo { display: flex; flex-wrap: wrap; align-items: center; gap: var(--tb-space-4); margin: calc(-1 * var(--tb-space-2)); padding: var(--tb-space-2); border: 1px dashed transparent; border-radius: var(--tb-radius-lg); transition: border-color var(--tb-fast) var(--tb-ease), background var(--tb-fast) var(--tb-ease); }
798
+ .tb-photo.tb-drop-over { border-color: var(--tb-primary); background: var(--tb-primary-soft); }
799
+ .tb-photo-frame { flex: none; width: 96px; height: 96px; display: grid; place-items: center; overflow: hidden; border: var(--tb-line) solid var(--tb-border); border-radius: var(--tb-radius-lg); background: var(--tb-bg); color: var(--tb-muted); }
800
+ .tb-photo-frame.tb-photo-pick { cursor: pointer; }
801
+ .tb-photo-frame.tb-round { border-radius: 50%; }
802
+ .tb-photo-frame > img { display: block; width: 100%; height: 100%; object-fit: cover; }
803
+ .tb-photo-frame > .tb-icon { width: 32px; height: 32px; }
804
+ .tb-invalid .tb-photo-frame { border-color: var(--tb-danger); }
805
+ .tb-photo-actions { display: flex; flex-wrap: wrap; gap: var(--tb-space-2); }
806
+ .tb-photo-actions[hidden], .tb-photo-remove[hidden] { display: none; }
718
807
  .tb-upload-progress[hidden] { display: none; }
719
808
  .tb-progress-bar { height: 100%; width: 0; border-radius: inherit; background: var(--tb-primary); transition: width 300ms var(--tb-ease); }
720
809
  .tb-success .tb-progress-bar { background: var(--tb-success); }
@@ -748,6 +837,10 @@ button.tb-crumb:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--tb-fo
748
837
  .tb-table tbody tr:last-child td { border-bottom: 0; }
749
838
  .tb-table .tb-num { text-align: right; font-variant-numeric: tabular-nums; }
750
839
  .tb-table-wrap:has(tbody:empty) thead { display: none; }
840
+ /* the room of the rows a long table does not draw */
841
+ .tb-table .tb-room[hidden] { display: none; }
842
+ .tb-table.tb-fixed { table-layout: fixed; }
843
+ .tb-table .tb-room :is(tr, td) { padding: 0; border: 0; margin: 0; background: none; box-shadow: none; }
751
844
  .tb-table th:has(> .tb-sort) { padding: 0; }
752
845
  .tb-sort {
753
846
  display: flex;
@@ -775,8 +868,8 @@ button.tb-crumb:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--tb-fo
775
868
  border-top: var(--tb-line) solid var(--tb-border);
776
869
  border-bottom: 0;
777
870
  }
778
- .tb-selectable tbody tr:not(.tb-group-head, .tb-group-foot), .tb-selectable .tb-list > li:not(.tb-group-head, .tb-group-foot) { cursor: pointer; transition: background var(--tb-fast) var(--tb-ease); }
779
- .tb-selectable tbody tr:not(.tb-group-head, .tb-group-foot):hover, .tb-selectable .tb-list > li:not(.tb-group-head, .tb-group-foot):hover { background: var(--tb-bg); }
871
+ .tb-selectable tbody:not(.tb-room) tr:not(.tb-group-head, .tb-group-foot), .tb-selectable .tb-list > li:not(.tb-group-head, .tb-group-foot) { cursor: pointer; transition: background var(--tb-fast) var(--tb-ease); }
872
+ .tb-selectable tbody:not(.tb-room) tr:not(.tb-group-head, .tb-group-foot):hover, .tb-selectable .tb-list > li:not(.tb-group-head, .tb-group-foot):hover { background: var(--tb-bg); }
780
873
  .tb-selectable tbody tr:focus-visible, .tb-selectable .tb-list > li:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--tb-focus); }
781
874
  .tb-table tr.tb-selected, .tb-list > li.tb-selected { background: var(--tb-primary-soft); }
782
875
  /* the head and foot of a group in the rows: a title the width of the row, and its subtotals */
@@ -802,15 +895,19 @@ button.tb-crumb:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--tb-fo
802
895
  .tb-list:empty { display: none; }
803
896
  .tb-list > li {
804
897
  display: flex;
805
- flex-direction: column;
806
- justify-content: center;
807
- gap: 2px;
898
+ align-items: center;
899
+ gap: var(--tb-space-3);
808
900
  min-height: var(--tb-control);
809
901
  padding: var(--tb-space-3) var(--tb-space-4);
810
902
  border-bottom: var(--tb-line) solid var(--tb-border);
811
903
  }
812
904
  .tb-list > li:last-child { border-bottom: 0; }
905
+ .tb-list-texts { display: flex; flex-direction: column; justify-content: center; gap: 2px; min-width: 0; }
813
906
  .tb-list-primary { font-weight: 550; }
907
+ /* the picture of a row, in a column of images or at the start of a list's item */
908
+ .tb-thumb { display: block; flex: none; width: 40px; height: 40px; object-fit: cover; border-radius: var(--tb-radius); background: var(--tb-bg); }
909
+ .tb-thumb.tb-round { border-radius: 50%; }
910
+ .tb-table td.tb-thumb-cell { width: 1%; padding-top: var(--tb-space-1); padding-bottom: var(--tb-space-1); }
814
911
  .tb-list-secondary { color: var(--tb-muted); font-size: 13px; }
815
912
  .tb-list-secondary:empty { display: none; }
816
913
 
@@ -1075,6 +1172,171 @@ button.tb-crumb:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--tb-fo
1075
1172
  .tb-toast.tb-warning::before { background: var(--tb-warning); }
1076
1173
  .tb-toast.tb-danger { background: var(--tb-danger); color: var(--tb-on-danger); }
1077
1174
 
1175
+ /* under trebol dev, the errors the app does not catch */
1176
+ .tb-dev-errors {
1177
+ position: fixed;
1178
+ inset: var(--tb-space-4) var(--tb-space-4) auto;
1179
+ width: auto;
1180
+ max-width: 960px;
1181
+ max-height: calc(100vh - 2 * var(--tb-space-4));
1182
+ margin: 0 auto;
1183
+ overflow: auto;
1184
+ box-sizing: border-box;
1185
+ padding: var(--tb-space-4) var(--tb-space-5);
1186
+ border: 1px solid var(--tb-border);
1187
+ border-left: 4px solid var(--tb-danger);
1188
+ border-radius: var(--tb-radius);
1189
+ background: var(--tb-surface);
1190
+ color: var(--tb-text);
1191
+ box-shadow: var(--tb-shadow-3);
1192
+ font-family: var(--tb-font);
1193
+ }
1194
+ .tb-dev-errors header {
1195
+ display: flex;
1196
+ align-items: center;
1197
+ justify-content: space-between;
1198
+ gap: var(--tb-space-3);
1199
+ margin-bottom: var(--tb-space-3);
1200
+ font-weight: 600;
1201
+ }
1202
+ .tb-dev-errors pre {
1203
+ margin: 0 0 var(--tb-space-3);
1204
+ white-space: pre-wrap;
1205
+ overflow-wrap: anywhere;
1206
+ font: 13px/1.6 ui-monospace, Menlo, Consolas, monospace;
1207
+ }
1208
+
1209
+ /* under trebol dev, the dev tools: Faces, Console, Log */
1210
+ .tb-dev-tools {
1211
+ position: fixed;
1212
+ inset: auto 0 0 0;
1213
+ width: 100%;
1214
+ max-width: none;
1215
+ margin: 0;
1216
+ padding: 0;
1217
+ box-sizing: border-box;
1218
+ flex-direction: column;
1219
+ border: 0;
1220
+ border-top: 1px solid var(--tb-border-strong);
1221
+ background: var(--tb-surface);
1222
+ color: var(--tb-text);
1223
+ box-shadow: var(--tb-shadow-3);
1224
+ font: 13px/1.5 var(--tb-font);
1225
+ }
1226
+ .tb-dev-tools:popover-open { display: flex; }
1227
+ .tb-dev-tools :is(pre, code, .tb-dev-in, .tb-dev-node, .tb-dev-detail dd, .tb-dev-text) {
1228
+ font-family: ui-monospace, Menlo, Consolas, monospace;
1229
+ font-size: 12px;
1230
+ }
1231
+ .tb-dev-grip { height: 6px; margin-top: -3px; cursor: ns-resize; flex: none; touch-action: none; }
1232
+ .tb-dev-tools header {
1233
+ display: flex;
1234
+ align-items: center;
1235
+ gap: var(--tb-space-2);
1236
+ padding: 0 var(--tb-space-3) 0 0;
1237
+ border-bottom: 1px solid var(--tb-border);
1238
+ flex: none;
1239
+ }
1240
+ .tb-dev-tabs { display: flex; }
1241
+ .tb-dev-space { flex: 1; }
1242
+ .tb-dev-tab, .tb-dev-button, .tb-dev-node, .tb-dev-opener {
1243
+ font: inherit;
1244
+ color: inherit;
1245
+ cursor: pointer;
1246
+ }
1247
+ .tb-dev-tab {
1248
+ padding: var(--tb-space-2) var(--tb-space-4);
1249
+ border: 0;
1250
+ border-bottom: 2px solid transparent;
1251
+ background: transparent;
1252
+ color: var(--tb-muted);
1253
+ }
1254
+ .tb-dev-tab[aria-selected="true"] { color: var(--tb-text); border-bottom-color: var(--tb-primary); font-weight: 600; }
1255
+ .tb-dev-button {
1256
+ padding: 2px var(--tb-space-3);
1257
+ border: 1px solid var(--tb-border-strong);
1258
+ border-radius: var(--tb-radius);
1259
+ background: var(--tb-bg);
1260
+ }
1261
+ .tb-dev-button[aria-pressed="true"] { background: var(--tb-primary); color: var(--tb-on-primary); border-color: var(--tb-primary); }
1262
+ .tb-dev-tools :is(button, a, textarea):focus-visible { outline: 2px solid var(--tb-focus); outline-offset: -2px; }
1263
+ .tb-dev-body { flex: 1; min-height: 0; display: flex; }
1264
+ .tb-dev-pane { flex: 1; min-width: 0; min-height: 0; }
1265
+ .tb-dev-pane[hidden] { display: none; }
1266
+ .tb-dev-faces { display: grid; grid-template-columns: minmax(200px, 2fr) 3fr; }
1267
+ .tb-dev-tree { overflow: auto; border-right: 1px solid var(--tb-border); padding: var(--tb-space-1) 0; }
1268
+ .tb-dev-node {
1269
+ display: block;
1270
+ width: 100%;
1271
+ padding: 1px var(--tb-space-2);
1272
+ border: 0;
1273
+ background: transparent;
1274
+ text-align: left;
1275
+ white-space: nowrap;
1276
+ overflow: hidden;
1277
+ text-overflow: ellipsis;
1278
+ }
1279
+ .tb-dev-node:hover { background: var(--tb-primary-soft); }
1280
+ .tb-dev-node[aria-current="true"] { background: var(--tb-primary); color: var(--tb-on-primary); }
1281
+ .tb-dev-unseen { color: var(--tb-muted); }
1282
+ .tb-dev-detail { overflow: auto; padding: var(--tb-space-3) var(--tb-space-4); }
1283
+ .tb-dev-detail h3 { margin: 0 0 var(--tb-space-1); font-size: 14px; }
1284
+ .tb-dev-detail dl { display: grid; grid-template-columns: max-content 1fr; gap: 2px var(--tb-space-4); margin: var(--tb-space-3) 0 0; }
1285
+ .tb-dev-detail dt { color: var(--tb-muted); }
1286
+ .tb-dev-detail dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
1287
+ .tb-dev-place { margin: 0; }
1288
+ .tb-dev-place a { color: var(--tb-primary); }
1289
+ .tb-dev-hint { margin: 0; color: var(--tb-muted); }
1290
+ .tb-dev-console { display: flex; flex-direction: column; }
1291
+ .tb-dev-out { flex: 1; overflow: auto; padding: var(--tb-space-2) var(--tb-space-3); }
1292
+ .tb-dev-out pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
1293
+ .tb-dev-said-in { color: var(--tb-muted); }
1294
+ .tb-dev-said-error { color: var(--tb-danger); }
1295
+ .tb-dev-face { padding: 2px var(--tb-space-3); color: var(--tb-muted); border-top: 1px solid var(--tb-border); }
1296
+ .tb-dev-prompt { display: flex; align-items: flex-start; gap: var(--tb-space-2); padding: var(--tb-space-1) var(--tb-space-3) var(--tb-space-2); }
1297
+ .tb-dev-sign { font: 12px/20px ui-monospace, Menlo, Consolas, monospace; color: var(--tb-primary); }
1298
+ textarea.tb-dev-in { flex: 1; resize: none; border: 0; padding: 0; background: transparent; color: var(--tb-text); line-height: 20px; outline: none; }
1299
+ .tb-dev-log { display: flex; flex-direction: column; }
1300
+ .tb-dev-bar { display: flex; justify-content: flex-end; padding: var(--tb-space-1) var(--tb-space-3); flex: none; }
1301
+ ol.tb-dev-entries { flex: 1; margin: 0; overflow: auto; list-style: none; padding: 0 var(--tb-space-3) var(--tb-space-2); }
1302
+ ol.tb-dev-entries li { display: grid; grid-template-columns: max-content 5.5em 1fr; gap: var(--tb-space-3); padding: 1px 0; border-bottom: 1px solid var(--tb-border); }
1303
+ ol.tb-dev-entries time { color: var(--tb-muted); font-variant-numeric: tabular-nums; }
1304
+ .tb-dev-kind { color: var(--tb-muted); }
1305
+ ol.tb-dev-entries .tb-dev-text { overflow-wrap: anywhere; }
1306
+ ol.tb-dev-entries :is(.tb-dev-error, .tb-dev-failed) .tb-dev-kind, ol.tb-dev-entries :is(.tb-dev-error, .tb-dev-failed) .tb-dev-text { color: var(--tb-danger); }
1307
+ ol.tb-dev-entries .tb-dev-warning .tb-dev-kind { color: var(--tb-warning); }
1308
+ .tb-dev-opener {
1309
+ position: fixed;
1310
+ inset: auto var(--tb-space-3) var(--tb-space-3) auto;
1311
+ margin: 0;
1312
+ padding: 2px var(--tb-space-3);
1313
+ border: 1px solid var(--tb-border-strong);
1314
+ border-radius: 999px;
1315
+ background: var(--tb-surface);
1316
+ box-shadow: var(--tb-shadow-1);
1317
+ font: 600 12px/1.6 var(--tb-font);
1318
+ opacity: 0.7;
1319
+ }
1320
+ .tb-dev-opener:hover, .tb-dev-opener:focus-visible { opacity: 1; }
1321
+ .tb-dev-outline {
1322
+ position: fixed;
1323
+ margin: 0;
1324
+ padding: 0;
1325
+ box-sizing: border-box;
1326
+ border: 2px solid var(--tb-primary);
1327
+ border-radius: 2px;
1328
+ background: transparent;
1329
+ pointer-events: none;
1330
+ }
1331
+ .tb-dev-outline.tb-dev-pointed { border-style: dashed; background: color-mix(in srgb, var(--tb-primary) 12%, transparent); }
1332
+ .tb-dev-picking, .tb-dev-picking * { cursor: crosshair !important; }
1333
+ @media (max-width: 640px) {
1334
+ .tb-dev-faces { grid-template-columns: 1fr; grid-template-rows: 2fr 3fr; }
1335
+ .tb-dev-tree { border-right: 0; border-bottom: 1px solid var(--tb-border); }
1336
+ ol.tb-dev-entries li { grid-template-columns: max-content 1fr; }
1337
+ ol.tb-dev-entries time { display: none; }
1338
+ }
1339
+
1078
1340
  @media (max-width: 640px) {
1079
1341
  .tb-wide-only { display: none !important; }
1080
1342
  .tb-view:has(.tb-fit) { height: auto; }
@@ -1121,6 +1383,8 @@ button.tb-crumb:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--tb-fo
1121
1383
  text-align: right;
1122
1384
  }
1123
1385
  .tb-table td::before { content: attr(data-label); color: var(--tb-muted); font-weight: 500; text-align: left; }
1386
+ .tb-table td.tb-thumb-cell { width: auto; justify-content: flex-start; }
1387
+ .tb-table td.tb-thumb-cell::before { content: none; }
1124
1388
  .tb-table tr.tb-group-head { padding: var(--tb-space-3) 0 0; background: none; border: 0; box-shadow: none; }
1125
1389
  .tb-table .tb-group-head > th, .tb-table .tb-group-head.tb-level-2 > th { display: block; padding: 0; background: none; border: 0; }
1126
1390
  .tb-table .tb-level-2 > :first-child { padding-left: 0; }
package/src/ui/i18n.trb CHANGED
@@ -22,6 +22,7 @@ i18n: make object! [
22
22
  amount #(en: "Enter an amount" es: "Introduce un importe")
23
23
  date #(en: "Enter a valid date" es: "Introduce una fecha válida")
24
24
  accept #(en: "Only #1 files" es: "Solo archivos #1")
25
+ images #(en: "Only images" es: "Solo imágenes")
25
26
  min #(en: "Must be at least #1" es: "Debe ser como mínimo #1")
26
27
  max #(en: "Must be at most #1" es: "Debe ser como máximo #1")
27
28
  length #(en: "Must be between #1 and #2 characters" es: "Debe tener entre #1 y #2 caracteres")
@@ -42,6 +43,9 @@ i18n: make object! [
42
43
  resize-panes #(en: "Resize panes" es: "Cambiar el tamaño de los paneles")
43
44
  breadcrumb #(en: "Breadcrumb" es: "Ruta de navegación")
44
45
  more-levels #(en: "Show more levels" es: "Mostrar más niveles")
46
+ orbit-more #(en: "+#1 more" es: "+#1 más")
47
+ orbit-first #(en: "Back to the first" es: "Volver a los primeros")
48
+ orbit-back-to #(en: "Back to #1" es: "Volver a #1")
45
49
  choose-date #(en: "Choose date" es: "Elegir fecha")
46
50
  choose-date-of #(en: "#1: choose date" es: "#1: elegir fecha")
47
51
  previous-month #(en: "Previous month" es: "Mes anterior")
@@ -53,8 +57,14 @@ i18n: make object! [
53
57
  drop-file #(en: "or drop it here" es: "o suéltalo aquí")
54
58
  drop-files #(en: "or drop them here" es: "o suéltalos aquí")
55
59
  remove-file #(en: "Remove #1" es: "Quitar #1")
60
+ choose-photo #(en: "Choose a photo" es: "Elegir una foto")
61
+ change-photo #(en: "Change" es: "Cambiar")
62
+ remove-photo #(en: "Remove" es: "Quitar")
56
63
  add-row #(en: "Add row" es: "Añadir fila")
57
64
  remove-row #(en: "Remove row" es: "Quitar fila")
65
+ leave-unsaved #(en: "Leave without saving?" es: "¿Salir sin guardar?")
66
+ leave #(en: "Leave" es: "Salir")
67
+ stay #(en: "Stay" es: "Quedarse")
58
68
  bold #(en: "Bold" es: "Negrita")
59
69
  italic #(en: "Italic" es: "Cursiva")
60
70
  heading #(en: "Heading" es: "Título")