@celljs/ta-web 4.9.0 → 4.9.1

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 (127) hide show
  1. package/README.en.md +1 -1
  2. package/README.md +1 -1
  3. package/esm/browser/assistant/assistant-extension.js +13 -5
  4. package/esm/browser/assistant/assistant-task-source.d.ts +2 -0
  5. package/esm/browser/assistant/assistant-task-source.js +2 -0
  6. package/esm/browser/assistant/assistant-task-util.d.ts +6 -0
  7. package/esm/browser/assistant/assistant-task-util.js +8 -0
  8. package/esm/browser/assistant/assistant-tasks.js +3 -2
  9. package/esm/browser/assistant/assistant.d.ts +20 -0
  10. package/esm/browser/assistant/assistant.js +45 -1
  11. package/esm/browser/assistant/task-views.d.ts +40 -6
  12. package/esm/browser/assistant/task-views.js +73 -21
  13. package/esm/browser/avatar/dino-avatar.d.ts +3 -4
  14. package/esm/browser/avatar/dino-avatar.js +4 -178
  15. package/esm/browser/avatar/dino-face.d.ts +19 -0
  16. package/esm/browser/avatar/dino-face.js +142 -0
  17. package/esm/browser/avatar/dino-geometry.d.ts +11 -0
  18. package/esm/browser/avatar/dino-geometry.js +38 -0
  19. package/esm/browser/avatar/dino-kinds.d.ts +15 -0
  20. package/esm/browser/avatar/dino-kinds.js +544 -0
  21. package/esm/browser/avatar/dino-motion.js +1 -1
  22. package/esm/browser/avatar/dino-shape.d.ts +80 -0
  23. package/esm/browser/avatar/dino-shape.js +113 -0
  24. package/esm/browser/avatar/dino-species.d.ts +1 -61
  25. package/esm/browser/avatar/dino-species.js +2 -653
  26. package/esm/browser/components/access-view.js +1 -1
  27. package/esm/browser/components/account-menu.js +1 -1
  28. package/esm/browser/components/app-shell-hooks.d.ts +47 -0
  29. package/esm/browser/components/app-shell-hooks.js +165 -0
  30. package/esm/browser/components/app-view.js +6 -151
  31. package/esm/browser/components/auth-view.js +1 -1
  32. package/esm/browser/components/composer.js +17 -10
  33. package/esm/browser/components/dino.js +1 -1
  34. package/esm/browser/components/folder-picker.js +4 -1
  35. package/esm/browser/components/host-view.d.ts +1 -1
  36. package/esm/browser/components/host-view.js +1 -1
  37. package/esm/browser/components/select-bar.d.ts +9 -0
  38. package/esm/browser/components/select-bar.js +24 -0
  39. package/esm/browser/components/settings-choices.d.ts +35 -0
  40. package/esm/browser/components/settings-choices.js +117 -0
  41. package/esm/browser/components/settings-parts.d.ts +21 -0
  42. package/esm/browser/components/settings-parts.js +300 -0
  43. package/esm/browser/components/settings-view.d.ts +0 -6
  44. package/esm/browser/components/settings-view.js +4 -406
  45. package/esm/browser/components/workbench-view.js +1 -1
  46. package/esm/browser/extension/icons.js +2 -1
  47. package/esm/browser/extension/web-extension-api.d.ts +38 -1
  48. package/esm/browser/extension/web-extensions.js +6 -1
  49. package/esm/browser/extension/web-tasks.d.ts +9 -1
  50. package/esm/browser/extension/web-tasks.js +24 -0
  51. package/esm/browser/hooks.d.ts +3 -1
  52. package/esm/browser/hooks.js +8 -0
  53. package/esm/browser/i18n/locales.d.ts +6 -1
  54. package/esm/browser/i18n/messages.d.ts +5 -0
  55. package/esm/browser/i18n/messages.js +10 -0
  56. package/esm/browser/style/device.js +16 -0
  57. package/esm/browser/style/shell.d.ts +1 -1
  58. package/esm/browser/style/shell.js +1 -0
  59. package/esm/browser/style/tasks.d.ts +1 -1
  60. package/esm/browser/style/tasks.js +2 -0
  61. package/esm/browser/workbench-util.d.ts +61 -0
  62. package/esm/browser/workbench-util.js +138 -0
  63. package/esm/browser/workbench.d.ts +1 -37
  64. package/esm/browser/workbench.js +2 -136
  65. package/lib/browser/assistant/assistant-extension.js +13 -5
  66. package/lib/browser/assistant/assistant-task-source.d.ts +2 -0
  67. package/lib/browser/assistant/assistant-task-source.js +2 -0
  68. package/lib/browser/assistant/assistant-task-util.d.ts +6 -0
  69. package/lib/browser/assistant/assistant-task-util.js +8 -0
  70. package/lib/browser/assistant/assistant-tasks.js +2 -1
  71. package/lib/browser/assistant/assistant.d.ts +20 -0
  72. package/lib/browser/assistant/assistant.js +45 -1
  73. package/lib/browser/assistant/task-views.d.ts +40 -6
  74. package/lib/browser/assistant/task-views.js +74 -21
  75. package/lib/browser/avatar/dino-avatar.d.ts +3 -4
  76. package/lib/browser/avatar/dino-avatar.js +27 -202
  77. package/lib/browser/avatar/dino-face.d.ts +20 -0
  78. package/lib/browser/avatar/dino-face.js +148 -0
  79. package/lib/browser/avatar/dino-geometry.d.ts +12 -0
  80. package/lib/browser/avatar/dino-geometry.js +47 -0
  81. package/lib/browser/avatar/dino-kinds.d.ts +16 -0
  82. package/lib/browser/avatar/dino-kinds.js +547 -0
  83. package/lib/browser/avatar/dino-motion.js +2 -2
  84. package/lib/browser/avatar/dino-shape.d.ts +81 -0
  85. package/lib/browser/avatar/dino-shape.js +126 -0
  86. package/lib/browser/avatar/dino-species.d.ts +1 -61
  87. package/lib/browser/avatar/dino-species.js +34 -687
  88. package/lib/browser/components/access-view.js +2 -2
  89. package/lib/browser/components/account-menu.js +2 -2
  90. package/lib/browser/components/app-shell-hooks.d.ts +48 -0
  91. package/lib/browser/components/app-shell-hooks.js +207 -0
  92. package/lib/browser/components/app-view.js +16 -161
  93. package/lib/browser/components/auth-view.js +3 -3
  94. package/lib/browser/components/composer.js +17 -10
  95. package/lib/browser/components/dino.js +3 -3
  96. package/lib/browser/components/folder-picker.js +4 -1
  97. package/lib/browser/components/host-view.d.ts +1 -1
  98. package/lib/browser/components/host-view.js +5 -5
  99. package/lib/browser/components/select-bar.d.ts +10 -0
  100. package/lib/browser/components/select-bar.js +61 -0
  101. package/lib/browser/components/settings-choices.d.ts +36 -0
  102. package/lib/browser/components/settings-choices.js +156 -0
  103. package/lib/browser/components/settings-parts.d.ts +22 -0
  104. package/lib/browser/components/settings-parts.js +336 -0
  105. package/lib/browser/components/settings-view.d.ts +0 -6
  106. package/lib/browser/components/settings-view.js +2 -405
  107. package/lib/browser/components/workbench-view.js +3 -3
  108. package/lib/browser/extension/icons.js +1 -0
  109. package/lib/browser/extension/web-extension-api.d.ts +38 -1
  110. package/lib/browser/extension/web-extensions.js +5 -0
  111. package/lib/browser/extension/web-tasks.d.ts +9 -1
  112. package/lib/browser/extension/web-tasks.js +24 -0
  113. package/lib/browser/hooks.d.ts +3 -1
  114. package/lib/browser/hooks.js +9 -0
  115. package/lib/browser/i18n/locales.d.ts +6 -1
  116. package/lib/browser/i18n/messages.d.ts +5 -0
  117. package/lib/browser/i18n/messages.js +10 -0
  118. package/lib/browser/style/device.js +16 -0
  119. package/lib/browser/style/shell.d.ts +1 -1
  120. package/lib/browser/style/shell.js +1 -0
  121. package/lib/browser/style/tasks.d.ts +1 -1
  122. package/lib/browser/style/tasks.js +2 -0
  123. package/lib/browser/workbench-util.d.ts +62 -0
  124. package/lib/browser/workbench-util.js +144 -0
  125. package/lib/browser/workbench.d.ts +1 -37
  126. package/lib/browser/workbench.js +24 -159
  127. package/package.json +7 -7
@@ -1,633 +1,6 @@
1
1
  /* The kinds of dinosaur ta can be: the outline of each, its bones and its colors. dino-avatar.ts draws them. */
2
- /** The length of a leg of the logo, from the hip to the ground; rig() makes the legs of other kinds swing as far as it does. */
3
- export const LEG = 56;
4
- function smooth(edge0, edge1, x) {
5
- const t = Math.min(1, Math.max(0, (x - edge0) / (edge1 - edge0)));
6
- return t * t * (3 - 2 * t);
7
- }
8
- const n = (value) => Math.round(value * 100) / 100;
9
- export var Outline;
10
- (function (Outline) {
11
- /**
12
- * A closed outline through `keys`, as cubic Béziers that pass through each (Catmull-Rom); at a
13
- * corner the curves on either side of it meet at an angle.
14
- */
15
- function loop(keys) {
16
- const at = (i) => keys[(i + keys.length) % keys.length];
17
- let d = `M${n(keys[0][0])} ${n(keys[0][1])}`;
18
- for (let i = 0; i < keys.length; i++) {
19
- const [p0, p1, p2, p3] = [at(i - 1), at(i), at(i + 1), at(i + 2)];
20
- const out = p1[2] ? [0, 0] : [(p2[0] - p0[0]) / 6, (p2[1] - p0[1]) / 6];
21
- const into = p2[2] ? [0, 0] : [(p3[0] - p1[0]) / 6, (p3[1] - p1[1]) / 6];
22
- d += `C${n(p1[0] + out[0])} ${n(p1[1] + out[1])} ${n(p2[0] - into[0])} ${n(p2[1] - into[1])} ${n(p2[0])} ${n(p2[1])}`;
23
- }
24
- return `${d}Z`;
25
- }
26
- Outline.loop = loop;
27
- /** A circle as four curves, the hole of an eye. */
28
- function circle(x, y, r) {
29
- const k = r * 0.5523;
30
- return (`M${n(x + r)} ${n(y)}C${n(x + r)} ${n(y + k)} ${n(x + k)} ${n(y + r)} ${n(x)} ${n(y + r)}` +
31
- `C${n(x - k)} ${n(y + r)} ${n(x - r)} ${n(y + k)} ${n(x - r)} ${n(y)}` +
32
- `C${n(x - r)} ${n(y - k)} ${n(x - k)} ${n(y - r)} ${n(x)} ${n(y - r)}` +
33
- `C${n(x + k)} ${n(y - r)} ${n(x + r)} ${n(y - k)} ${n(x + r)} ${n(y)}Z`);
34
- }
35
- Outline.circle = circle;
36
- })(Outline || (Outline = {}));
37
- /**
38
- * Which side of a line a point is on, softly: 0 well before the line through `at`, 1 well past it
39
- * in the direction `toward`, eased across `band` units on either side of it.
40
- */
41
- export function cut(at, toward, band) {
42
- const length = Math.hypot(toward.x, toward.y);
43
- const tx = toward.x / length;
44
- const ty = toward.y / length;
45
- return (x, y) => smooth(-band, band, (x - at.x) * tx + (y - at.y) * ty);
46
- }
47
- /** The bones of a kind as the sides of lines it is cut along: each bone where all its lines agree, the jaw within the head, the tip within the tail. */
48
- export function bones(cuts) {
49
- const all = (sides, x, y) => sides.reduce((product, side) => product * side(x, y), 1);
50
- return (x, y) => {
51
- const head = all(cuts.head, x, y);
52
- const jaw = head * all(cuts.jaw, x, y);
53
- const tail = all(cuts.tail, x, y) * (1 - head);
54
- const tip = tail * all(cuts.tip, x, y);
55
- const back = all(cuts.back, x, y) * (1 - head - tail);
56
- return { head: head - jaw, jaw, tail: tail - tip, tip, back, body: Math.max(0, 1 - head - tail - back) };
57
- };
58
- }
59
- /** The outline of assets/logo.svg; dino-avatar.spec.ts keeps the two the same. */
60
- export const LOGO_PATH = 'M87.56 246.56C78.45 245.88 69.68 241.69 63.62 235.12C55.27 226.06 53.05 217.63 57.25 210.87C58.80 208.36 60.00 207.04 65.18 202.17C69.26 198.32 70.20 196.55 70.21 192.69C70.21 189.81 70.10 189.60 68.07 188.59C58.99 184.06 48.53 175.16 41.10 165.64C20.03 138.61 16.32 99.87 32.24 73.21C35.05 68.50 38.42 64.26 40.25 63.11C42.91 61.44 46.64 61.89 48.71 64.14C51.04 66.67 51.48 69.39 50.27 73.65C48.09 81.27 47.41 86.83 47.99 92.32C49.53 106.98 58.42 118.20 70.83 121.15C73.08 121.68 78.88 121.72 81.15 121.22C88.97 119.48 94.86 113.39 96.69 105.18C97.35 102.17 97.35 102.36 97.36 79.55C97.37 56.55 97.35 57.24 98.04 53.23C102.05 29.98 119.81 12.19 141.49 9.73C143.46 9.51 150.65 9.43 152.36 9.61C160.37 10.46 167.56 12.82 174.51 16.89C177.43 18.59 176.54 18.47 186.86 18.57C196.67 18.66 196.99 18.68 200.87 19.58C210.24 21.74 219.17 27.62 224.57 35.17C229.72 42.38 232.50 49.80 233.36 58.67C233.68 61.91 233.71 76.53 233.41 78.22C232.01 86.00 227.35 91.05 220.23 92.50C218.50 92.85 180.16 92.91 177.10 92.57C165.61 91.28 155.17 86.13 150.52 79.47C148.44 76.48 145.54 75.90 143.40 78.04C141.49 79.95 141.76 81.92 144.74 87.63C150.17 98.03 159.04 105.16 169.50 107.52C172.11 108.11 172.69 107.96 173.25 106.55C173.81 105.12 174.70 103.52 175.57 102.37C178.23 98.86 180.68 100.09 183.51 106.36C184.55 108.67 183.79 108.47 191.23 108.44C198.27 108.42 197.86 108.50 198.43 107.20C200.89 101.63 202.81 99.79 204.99 100.89C206.11 101.47 207.63 103.65 208.74 106.31C209.67 108.51 209.55 108.45 213.05 108.41C216.35 108.36 217.08 108.45 218.31 109.05C225.39 112.51 217.61 125.59 205.66 130.33C199.65 132.71 198.20 132.85 180.39 132.87C164.51 132.89 165.38 132.84 164.14 133.78C162.82 134.78 162.30 136.08 162.30 138.40C162.30 139.80 161.98 143.39 161.42 148.29C159.70 163.39 153.05 175.87 141.81 185.08C138.73 187.60 134.92 189.85 129.84 192.14C125.19 194.25 115.57 196.33 110.54 196.34C109.17 196.34 108.60 196.57 108.23 197.27C108.10 197.53 107.64 198.49 107.20 199.42C103.90 206.45 98.19 211.37 88.72 215.35C85.89 216.54 85.91 216.52 85.98 219.64C86.04 222.32 86.33 222.69 90.00 224.75C92.29 226.04 94.81 227.75 95.82 228.71C100.98 233.57 100.86 241.48 95.60 244.93C93.34 246.41 91.24 246.84 87.56 246.56ZM134.07 240.25C128.56 238.82 125.22 235.56 123.96 230.38C123.70 229.30 123.68 228.71 123.59 220.23C123.53 214.63 123.44 210.89 123.34 210.35C123.00 208.36 122.74 207.31 122.25 205.86C121.48 203.62 121.59 203.31 123.26 202.93C129.90 201.41 136.34 198.97 140.57 196.35C147.00 192.39 151.46 188.55 155.60 183.42C157.24 181.39 157.77 181.54 158.23 184.19C159.89 193.79 157.66 202.21 151.13 210.89C149.39 213.20 149.36 213.30 149.36 215.69C149.35 218.41 149.61 218.72 151.96 218.75C157.60 218.82 162.31 219.95 165.26 221.92C173.20 227.23 172.45 238.39 164.03 240.43C162.18 240.88 135.88 240.72 134.07 240.25ZM185.67 173.17C183.79 172.66 182.15 171.55 180.81 169.86C178.08 166.41 174.71 164.68 169.71 164.16C166.89 163.87 166.86 163.80 167.90 160.34C168.86 157.13 169.71 152.32 170.10 147.82C170.40 144.42 170.40 144.42 170.65 144.15C172.11 142.53 184.08 147.33 189.10 151.54C193.73 155.43 196.56 162.25 195.41 166.75C194.22 171.40 189.83 174.29 185.67 173.17ZM144.28 53.97C148.98 52.79 151.98 47.68 150.77 42.91C148.71 34.78 137.83 33.29 134.20 40.65C130.66 47.83 136.74 55.88 144.28 53.97Z';
61
- const [LOGO_BODY, LOGO_FRONT, LOGO_ARM, LOGO_EYE] = LOGO_PATH.split(/(?<=Z)(?=M)/);
62
- /** ta as the logo draws it. */
63
- const TREX = {
64
- id: 'trex',
65
- skin: LOGO_BODY + LOGO_EYE,
66
- parts: [
67
- { d: LOGO_FRONT, joint: { x: 146, y: 192 }, swing: 'front', lift: 'frontLift', far: true },
68
- { d: LOGO_ARM, joint: { x: 171, y: 149 }, swing: 'arm', far: false },
69
- ],
70
- eye: { x: 141.3, y: 44.6, r: 10.9 },
71
- joints: {
72
- feet: { x: 128, y: 244 },
73
- neck: { x: 122, y: 124 },
74
- jaw: { x: 150, y: 94 },
75
- tail: { x: 54, y: 160 },
76
- tip: { x: 40, y: 112 },
77
- hip: { x: 86, y: 188 },
78
- },
79
- weights(x, y) {
80
- // The neck: a band across it, from the back of the neck down to the throat.
81
- const across = ((x - 92) * 42 - (y - 106) * 76) / 86.8;
82
- const head = smooth(-4, 24, across) * smooth(78, 96, x);
83
- // The jaw: below the line of the mouth, fading at the corner of the mouth and down the throat.
84
- const mouth = x >= 177 ? 96.5 : 80 + ((x - 143) * 16.5) / 34;
85
- const jaw = head * smooth(mouth - 3, mouth + 4, y) * smooth(140, 152, x) * (1 - smooth(132, 146, y));
86
- // The tail from where it leaves the back, and again toward its tip.
87
- const tail = smooth(178, 128, y) * (1 - smooth(52, 92, x));
88
- const tip = smooth(128, 86, y) * (1 - smooth(48, 70, x));
89
- const back = smooth(186, 204, y) * (1 - smooth(108, 124, x));
90
- return { head: head - jaw, jaw, tail: tail - tip, tip, back, body: Math.max(0, 1 - head - tail - back) };
91
- },
92
- head: { axis: { x: 132, y: 60 }, center: { x: 160, y: 60 }, depth: 22 },
93
- body: { center: { x: 112, y: 160 }, depth: 26 },
94
- colors: { skin: '#10B981', lit: '#34D399', shade: '#0EA372', ridge: '#047857' },
95
- badge: { x: 54, y: 34 },
96
- snout: { x: 238, y: 94 },
97
- nose: { x: 222, y: 66 },
98
- face: [76, -20, 184],
99
- };
100
- /** The colors of a kind from its own: lighter for what is lit, a little darker for the far side, darker still for the brow. */
101
- function tones(skin) {
102
- const rgb = [1, 3, 5].map(i => Number.parseInt(skin.slice(i, i + 2), 16));
103
- const mix = (to, k) => `#${rgb
104
- .map(c => Math.round(c + (to - c) * k)
105
- .toString(16)
106
- .padStart(2, '0'))
107
- .join('')}`;
108
- return { skin, lit: mix(255, 0.3), shade: mix(0, 0.12), ridge: mix(0, 0.38) };
109
- }
110
- /** A leg on its own, upright from `top` to the ground: its width, and how much its foot reaches forward. */
111
- function leg(x, top, width, foot = 6, ground = 244) {
112
- const mid = (top + ground) / 2;
113
- return Outline.loop([
114
- [x + width / 2, top - 4],
115
- [x + width + 1, top + 4],
116
- [x + width - 1, mid],
117
- [x + width + foot, ground - 6],
118
- [x + width + foot - 5, ground],
119
- [x + 3, ground],
120
- [x - 1, ground - 6],
121
- [x + 1, mid],
122
- [x - 1, top + 4],
123
- ]);
124
- }
125
- const left = (x, band) => cut({ x, y: 0 }, { x: -1, y: 0 }, band);
126
- const right = (x, band) => cut({ x, y: 0 }, { x: 1, y: 0 }, band);
127
- const below = (y, band) => cut({ x: 0, y }, { x: 0, y: 1 }, band);
128
- /** Three horns and a frill; on four legs. */
129
- const TRICERATOPS = {
130
- id: 'triceratops',
131
- turns: 0.4,
132
- spins: 0.3,
133
- leans: 0.35,
134
- skin: Outline.loop([
135
- [16, 186, 1],
136
- [40, 166],
137
- [64, 140],
138
- [92, 118],
139
- [122, 108],
140
- [142, 110],
141
- [140, 84],
142
- [150, 58],
143
- [174, 40],
144
- [202, 38],
145
- [218, 58],
146
- [224, 76],
147
- [232, 90],
148
- [238, 98],
149
- [244, 80, 1],
150
- [246, 106],
151
- [252, 122],
152
- [250, 138],
153
- [244, 142, 1],
154
- [226, 140, 1],
155
- [240, 150],
156
- [234, 158],
157
- [218, 166],
158
- [198, 170],
159
- [184, 180],
160
- [172, 194],
161
- [146, 202],
162
- [118, 202],
163
- [112, 206],
164
- [112, 226],
165
- [116, 238],
166
- [112, 244],
167
- [80, 244],
168
- [74, 236],
169
- [74, 222],
170
- [66, 202],
171
- [46, 194],
172
- ]) + Outline.circle(204, 104, 9),
173
- parts: [
174
- { d: leg(116, 192, 24), joint: { x: 128, y: 198 }, swing: 'front', lift: 'frontLift', far: true },
175
- { d: leg(190, 170, 20), joint: { x: 200, y: 178 }, swing: 'back', lift: 'backLift', far: true },
176
- { d: leg(152, 166, 32), joint: { x: 168, y: 176 }, swing: 'front', lift: 'frontLift', far: false, gap: true },
177
- ],
178
- eye: { x: 204, y: 104, r: 9 },
179
- joints: {
180
- feet: { x: 130, y: 244 },
181
- neck: { x: 170, y: 134 },
182
- jaw: { x: 226, y: 140 },
183
- tail: { x: 58, y: 170 },
184
- tip: { x: 34, y: 178 },
185
- hip: { x: 90, y: 196 },
186
- },
187
- weights: bones({
188
- head: [cut({ x: 164, y: 136 }, { x: 76, y: -40 }, 12)],
189
- jaw: [below(141, 3), right(208, 6)],
190
- tail: [left(62, 14)],
191
- tip: [left(34, 8)],
192
- back: [below(204, 8), left(114, 6)],
193
- }),
194
- head: { axis: { x: 186, y: 100 }, center: { x: 206, y: 100 }, depth: 22 },
195
- body: { center: { x: 112, y: 160 }, depth: 30 },
196
- colors: tones('#EE7B3B'),
197
- badge: { x: 60, y: 70 },
198
- snout: { x: 252, y: 130 },
199
- nose: { x: 238, y: 118 },
200
- face: [132, 30, 132],
201
- // Its two horns over the eyes, ivory, one on each side of its head.
202
- decor: [
203
- {
204
- depth: 0.6,
205
- markup: `<path d="${Outline.loop([
206
- [212, 62],
207
- [232, 50],
208
- [254, 42, 1],
209
- [234, 62],
210
- [224, 74],
211
- ])}" fill="#F3DFC1"/>`,
212
- },
213
- ],
214
- };
215
- /** Plates along its back and spikes at the end of its tail; on four legs, its head low. */
216
- const STEGOSAURUS = {
217
- id: 'stegosaurus',
218
- turns: 0.4,
219
- spins: 0.3,
220
- leans: 0.35,
221
- skin: Outline.loop([
222
- [14, 180, 1],
223
- [18, 168],
224
- [4, 146, 1],
225
- [32, 162],
226
- [28, 140, 1],
227
- [48, 154],
228
- [62, 144],
229
- [56, 108, 1],
230
- [78, 128],
231
- [86, 82, 1],
232
- [106, 112],
233
- [122, 70, 1],
234
- [140, 106],
235
- [160, 80, 1],
236
- [170, 118],
237
- [192, 104, 1],
238
- [194, 134],
239
- [210, 148],
240
- [232, 156],
241
- [248, 168],
242
- [250, 178, 1],
243
- [230, 180, 1],
244
- [244, 186, 1],
245
- [232, 194],
246
- [212, 192],
247
- [196, 198],
248
- [184, 206],
249
- [150, 212],
250
- [124, 210],
251
- [116, 214],
252
- [114, 230],
253
- [120, 238],
254
- [116, 244],
255
- [86, 244],
256
- [80, 238],
257
- [80, 226],
258
- [72, 206],
259
- [48, 194],
260
- [28, 188],
261
- ]) + Outline.circle(228, 168, 6),
262
- parts: [
263
- { d: leg(124, 200, 22), joint: { x: 134, y: 206 }, swing: 'front', lift: 'frontLift', far: true },
264
- { d: leg(200, 188, 18), joint: { x: 208, y: 194 }, swing: 'back', lift: 'backLift', far: true },
265
- { d: leg(170, 190, 26), joint: { x: 182, y: 198 }, swing: 'front', lift: 'frontLift', far: false, gap: true },
266
- ],
267
- eye: { x: 228, y: 168, r: 6 },
268
- joints: {
269
- feet: { x: 130, y: 244 },
270
- neck: { x: 200, y: 168 },
271
- jaw: { x: 230, y: 181 },
272
- tail: { x: 60, y: 170 },
273
- tip: { x: 32, y: 170 },
274
- hip: { x: 94, y: 204 },
275
- },
276
- weights: bones({
277
- head: [cut({ x: 204, y: 160 }, { x: 1, y: 0.3 }, 10)],
278
- jaw: [below(181.5, 2.5), right(222, 5)],
279
- tail: [left(58, 12)],
280
- tip: [left(30, 8)],
281
- back: [below(210, 8), left(118, 6)],
282
- }),
283
- head: { axis: { x: 220, y: 172 }, center: { x: 230, y: 174 }, depth: 14 },
284
- body: { center: { x: 118, y: 168 }, depth: 30 },
285
- colors: tones('#4285F4'),
286
- badge: { x: 40, y: 82 },
287
- snout: { x: 254, y: 178 },
288
- nose: { x: 242, y: 171 },
289
- face: [168, 112, 100],
290
- };
291
- /** A neck that reaches up to the trees; on four legs, the front ones long. */
292
- const BRACHIOSAURUS = {
293
- id: 'brachiosaurus',
294
- turns: 0.45,
295
- spins: 0.3,
296
- leans: 0.35,
297
- skin: Outline.loop([
298
- [10, 170, 1],
299
- [36, 150],
300
- [66, 128],
301
- [100, 112],
302
- [132, 104],
303
- [152, 98],
304
- [164, 80],
305
- [174, 56],
306
- [182, 34],
307
- [192, 18],
308
- [212, 10],
309
- [234, 18],
310
- [242, 30, 1],
311
- [222, 34, 1],
312
- [238, 38, 1],
313
- [226, 46],
314
- [206, 48],
315
- [200, 62],
316
- [196, 86],
317
- [194, 112],
318
- [190, 136],
319
- [184, 160],
320
- [172, 178],
321
- [140, 186],
322
- [112, 184],
323
- [104, 190],
324
- [102, 222],
325
- [108, 238],
326
- [104, 244],
327
- [76, 244],
328
- [70, 238],
329
- [70, 220],
330
- [64, 192],
331
- [42, 180],
332
- ]) + Outline.circle(212, 24, 5.5),
333
- parts: [
334
- { d: leg(110, 184, 22), joint: { x: 120, y: 190 }, swing: 'front', lift: 'frontLift', far: true },
335
- { d: leg(186, 146, 18), joint: { x: 196, y: 154 }, swing: 'back', lift: 'backLift', far: true },
336
- { d: leg(158, 138, 28), joint: { x: 172, y: 148 }, swing: 'front', lift: 'frontLift', far: false, gap: true },
337
- ],
338
- eye: { x: 212, y: 24, r: 5.5 },
339
- joints: {
340
- feet: { x: 128, y: 244 },
341
- neck: { x: 176, y: 112 },
342
- jaw: { x: 222, y: 35 },
343
- tail: { x: 52, y: 160 },
344
- tip: { x: 28, y: 166 },
345
- hip: { x: 86, y: 192 },
346
- },
347
- weights: bones({
348
- head: [cut({ x: 176, y: 96 }, { x: 0.3, y: -1 }, 14)],
349
- jaw: [below(35.5, 2), right(214, 5)],
350
- tail: [left(54, 12)],
351
- tip: [left(28, 8)],
352
- back: [below(194, 8), left(110, 6)],
353
- }),
354
- head: { axis: { x: 204, y: 28 }, center: { x: 214, y: 28 }, depth: 12 },
355
- body: { center: { x: 116, y: 150 }, depth: 30 },
356
- colors: tones('#8C5CF0'),
357
- badge: { x: 60, y: 64 },
358
- snout: { x: 246, y: 30 },
359
- nose: { x: 230, y: 20 },
360
- face: [166, -6, 88],
361
- };
362
- /** Quick and lean, a long straight tail; on two legs. */
363
- const VELOCIRAPTOR = {
364
- id: 'velociraptor',
365
- turns: 0.75,
366
- spins: 0.7,
367
- skin: Outline.loop([
368
- [8, 118, 1],
369
- [40, 110],
370
- [76, 110],
371
- [104, 112],
372
- [130, 110],
373
- [152, 98],
374
- [164, 80],
375
- [170, 62],
376
- [162, 48, 1],
377
- [180, 50],
378
- [196, 50],
379
- [224, 60],
380
- [238, 70, 1],
381
- [210, 76, 1],
382
- [230, 80, 1],
383
- [216, 88],
384
- [192, 88],
385
- [182, 104],
386
- [178, 126],
387
- [168, 146],
388
- [150, 158],
389
- [126, 160],
390
- [114, 168],
391
- [118, 196],
392
- [112, 222],
393
- [128, 236],
394
- [124, 244],
395
- [96, 244],
396
- [92, 238],
397
- [96, 222],
398
- [90, 192],
399
- [80, 164],
400
- [66, 140],
401
- [36, 128],
402
- ]) + Outline.circle(194, 64, 6.5),
403
- parts: [
404
- {
405
- d: Outline.loop([
406
- [126, 164],
407
- [146, 168],
408
- [150, 196],
409
- [144, 222],
410
- [160, 236],
411
- [156, 242],
412
- [130, 242],
413
- [128, 236],
414
- [130, 220],
415
- [126, 192],
416
- ]),
417
- joint: { x: 136, y: 170 },
418
- swing: 'front',
419
- lift: 'frontLift',
420
- far: true,
421
- },
422
- {
423
- d: Outline.loop([
424
- [164, 130],
425
- [180, 132],
426
- [198, 152],
427
- [192, 162, 1],
428
- [178, 150],
429
- [164, 144],
430
- ]),
431
- joint: { x: 168, y: 136 },
432
- swing: 'arm',
433
- far: false,
434
- gap: true,
435
- },
436
- ],
437
- eye: { x: 194, y: 64, r: 6.5 },
438
- joints: {
439
- feet: { x: 112, y: 244 },
440
- neck: { x: 168, y: 104 },
441
- jaw: { x: 210, y: 77 },
442
- tail: { x: 84, y: 124 },
443
- tip: { x: 40, y: 118 },
444
- hip: { x: 100, y: 170 },
445
- },
446
- weights: bones({
447
- head: [cut({ x: 172, y: 96 }, { x: 0.6, y: -1 }, 10)],
448
- jaw: [below(78, 2.5), right(200, 5)],
449
- tail: [left(84, 16), cut({ x: 0, y: 150 }, { x: 0, y: -1 }, 8)],
450
- tip: [left(40, 10)],
451
- back: [below(172, 8), left(122, 6)],
452
- }),
453
- head: { axis: { x: 186, y: 68 }, center: { x: 200, y: 70 }, depth: 14 },
454
- body: { center: { x: 122, y: 140 }, depth: 20 },
455
- colors: tones('#EA4335'),
456
- badge: { x: 60, y: 58 },
457
- snout: { x: 240, y: 72 },
458
- nose: { x: 228, y: 64 },
459
- face: [150, 16, 104],
460
- };
461
- /** Armored all over, spikes on its back and a club at the end of its tail; low, on four legs. */
462
- const ANKYLOSAURUS = {
463
- id: 'ankylosaurus',
464
- turns: 0.4,
465
- spins: 0.3,
466
- leans: 0.35,
467
- skin: Outline.loop([
468
- [8, 174],
469
- [2, 160],
470
- [12, 146],
471
- [28, 146],
472
- [36, 156],
473
- [52, 154],
474
- [72, 140],
475
- [88, 124],
476
- [92, 108, 1],
477
- [104, 116],
478
- [122, 108],
479
- [128, 94, 1],
480
- [138, 106],
481
- [156, 104],
482
- [164, 92, 1],
483
- [172, 108],
484
- [188, 116],
485
- [198, 108, 1],
486
- [202, 124],
487
- [214, 132],
488
- [230, 136],
489
- [246, 150],
490
- [248, 160, 1],
491
- [230, 160, 1],
492
- [242, 168, 1],
493
- [232, 176],
494
- [214, 176],
495
- [202, 182],
496
- [190, 196],
497
- [158, 204],
498
- [124, 204],
499
- [118, 208],
500
- [118, 230],
501
- [122, 238],
502
- [118, 244],
503
- [90, 244],
504
- [86, 238],
505
- [86, 226],
506
- [80, 204],
507
- [60, 186],
508
- [40, 176],
509
- [28, 172],
510
- ]) + Outline.circle(224, 148, 5.5),
511
- parts: [
512
- { d: leg(126, 196, 22), joint: { x: 136, y: 202 }, swing: 'front', lift: 'frontLift', far: true },
513
- { d: leg(204, 182, 16), joint: { x: 212, y: 190 }, swing: 'back', lift: 'backLift', far: true },
514
- { d: leg(176, 184, 24), joint: { x: 188, y: 192 }, swing: 'front', lift: 'frontLift', far: false, gap: true },
515
- ],
516
- eye: { x: 224, y: 148, r: 5.5 },
517
- joints: {
518
- feet: { x: 134, y: 244 },
519
- neck: { x: 206, y: 156 },
520
- jaw: { x: 230, y: 161 },
521
- tail: { x: 74, y: 166 },
522
- tip: { x: 40, y: 164 },
523
- hip: { x: 100, y: 204 },
524
- },
525
- weights: bones({
526
- head: [cut({ x: 208, y: 150 }, { x: 1, y: 0.1 }, 8)],
527
- jaw: [below(161.5, 2), right(222, 5)],
528
- tail: [left(72, 12)],
529
- tip: [left(42, 8)],
530
- back: [below(208, 8), left(122, 6)],
531
- }),
532
- head: { axis: { x: 216, y: 154 }, center: { x: 228, y: 154 }, depth: 14 },
533
- body: { center: { x: 132, y: 160 }, depth: 34 },
534
- colors: tones('#FBBC05'),
535
- badge: { x: 54, y: 92 },
536
- snout: { x: 252, y: 156 },
537
- nose: { x: 240, y: 152 },
538
- face: [172, 100, 92],
539
- };
540
- /** A flier: wings, a long beak and a crest behind it; it stands on small legs. */
541
- const PTERANODON = {
542
- id: 'pteranodon',
543
- turns: 0.6,
544
- spins: 0.6,
545
- skin: Outline.loop([
546
- [96, 196, 1],
547
- [104, 170],
548
- [108, 140],
549
- [118, 112],
550
- [134, 94],
551
- [142, 80],
552
- [112, 58, 1],
553
- [150, 62],
554
- [168, 64],
555
- [204, 76],
556
- [246, 94, 1],
557
- [190, 90, 1],
558
- [230, 98, 1],
559
- [196, 102],
560
- [172, 100],
561
- [160, 108],
562
- [152, 128],
563
- [150, 156],
564
- [144, 184],
565
- [140, 198],
566
- [144, 222],
567
- [154, 238],
568
- [150, 244],
569
- [128, 244],
570
- [124, 238],
571
- [128, 222],
572
- [122, 204],
573
- [110, 204],
574
- ]) + Outline.circle(176, 78, 6.5),
575
- parts: [
576
- {
577
- d: Outline.loop([
578
- [144, 112],
579
- [138, 74],
580
- [130, 40],
581
- [104, 6, 1],
582
- [106, 36],
583
- [112, 70],
584
- [126, 108],
585
- ]),
586
- joint: { x: 140, y: 116 },
587
- swing: 'wing',
588
- far: true,
589
- },
590
- {
591
- d: Outline.loop([
592
- [142, 118],
593
- [114, 92],
594
- [86, 60],
595
- [18, 40, 1],
596
- [38, 66],
597
- [64, 92],
598
- [98, 124],
599
- [134, 148],
600
- ]),
601
- joint: { x: 138, y: 126 },
602
- swing: 'wing',
603
- far: false,
604
- gap: true,
605
- },
606
- ],
607
- eye: { x: 176, y: 78, r: 6.5 },
608
- joints: {
609
- feet: { x: 138, y: 244 },
610
- neck: { x: 150, y: 108 },
611
- jaw: { x: 190, y: 92 },
612
- tail: { x: 110, y: 190 },
613
- tip: { x: 102, y: 196 },
614
- hip: { x: 134, y: 200 },
615
- },
616
- weights: bones({
617
- head: [cut({ x: 150, y: 104 }, { x: 0.5, y: -1 }, 10)],
618
- jaw: [below(94, 2), right(184, 5)],
619
- tail: [left(112, 6), below(186, 6)],
620
- tip: [left(102, 6)],
621
- back: [below(202, 6)],
622
- }),
623
- head: { axis: { x: 166, y: 80 }, center: { x: 176, y: 82 }, depth: 12 },
624
- body: { center: { x: 130, y: 160 }, depth: 18 },
625
- colors: tones('#45B5E8'),
626
- badge: { x: 222, y: 38 },
627
- snout: { x: 248, y: 96 },
628
- nose: { x: 222, y: 88 },
629
- face: [120, 18, 142],
630
- };
2
+ import { ANKYLOSAURUS, BRACHIOSAURUS, PTERANODON, STEGOSAURUS, TREX, TRICERATOPS, VELOCIRAPTOR } from './dino-kinds.js';
3
+ import { below, bones, cut, left, leg, Outline, right, tones, tube } from './dino-shape.js';
631
4
  /** A long crest curving back from its head, a bill like a duck's; on two legs. */
632
5
  const PARASAUROLOPHUS = {
633
6
  id: 'parasaurolophus',
@@ -730,30 +103,6 @@ const PARASAUROLOPHUS = {
730
103
  nose: { x: 228, y: 58 },
731
104
  face: [114, -4, 134],
732
105
  };
733
- /**
734
- * The two sides of a body as long as a snake's, along its `spine` ([x, y, half its thickness] from the head
735
- * on): the side to the right of the way the spine runs, and the other, both from the head on. `spikes` puts
736
- * a spike on the other side (the back) between every two points of the spine from the second on.
737
- */
738
- function tube(spine, spikes = 0) {
739
- const front = [];
740
- const back = [];
741
- spine.forEach(([x, y, r], i) => {
742
- const [px, py] = spine[Math.max(0, i - 1)];
743
- const [nx, ny] = spine[Math.min(spine.length - 1, i + 1)];
744
- const length = Math.hypot(nx - px, ny - py);
745
- const ux = (ny - py) / length;
746
- const uy = -(nx - px) / length;
747
- front.push([x + r * ux, y + r * uy]);
748
- back.push([x - r * ux, y - r * uy]);
749
- if (spikes && i > 0 && i + 1 < spine.length) {
750
- // A spike halfway to the next point, standing off the back.
751
- const [mx, my, mr] = [(x + nx) / 2, (y + ny) / 2, (r + spine[i + 1][2]) / 2];
752
- back.push([mx - (mr + spikes) * ux, my - (mr + spikes) * uy, 1]);
753
- }
754
- });
755
- return { front, back };
756
- }
757
106
  const GOLD = '#F2B92E';
758
107
  const DRAGON_BODY = tube([
759
108
  [184, 96, 15],
@@ -2,7 +2,7 @@ import { Check, LogOut, Monitor, Plus, Smartphone, Trash2, X } from 'lucide-reac
2
2
  import * as React from 'react';
3
3
  import { useNotices, useWorkbench } from '../hooks.js';
4
4
  import { useLanguage, useT } from '../i18n/use-t.js';
5
- import { WorkbenchUtil } from '../workbench.js';
5
+ import { WorkbenchUtil } from '../workbench-util.js';
6
6
  import { AccessViewUtil } from './access-util.js';
7
7
  import { ChatListUtil } from './chat-list.js';
8
8
  import { Icon, IconButton } from './icon.js';
@@ -4,7 +4,7 @@ import { useDevice } from '../device/device.js';
4
4
  import { usePwa, useSettings, useWorkbench } from '../hooks.js';
5
5
  import { HostUtil } from '../hosts.js';
6
6
  import { useT } from '../i18n/use-t.js';
7
- import { WorkbenchUtil } from '../workbench.js';
7
+ import { WorkbenchUtil } from '../workbench-util.js';
8
8
  import { AuthDialog } from './auth-view.js';
9
9
  import { DinoLookPicker } from './dino-look-picker.js';
10
10
  import { HostsDialog } from './host-view.js';