@blotch/dolan 0.0.0-stage → 22.2.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 (273) hide show
  1. package/dist/commands/add.d.ts +22 -0
  2. package/dist/commands/add.js +132 -0
  3. package/dist/commands/add.js.map +1 -0
  4. package/dist/commands/add.test.d.ts +1 -0
  5. package/dist/commands/add.test.js +209 -0
  6. package/dist/commands/add.test.js.map +1 -0
  7. package/dist/commands/diff.d.ts +13 -0
  8. package/dist/commands/diff.js +155 -0
  9. package/dist/commands/diff.js.map +1 -0
  10. package/dist/commands/diff.test.d.ts +1 -0
  11. package/dist/commands/diff.test.js +327 -0
  12. package/dist/commands/diff.test.js.map +1 -0
  13. package/dist/commands/doctor.d.ts +15 -0
  14. package/dist/commands/doctor.js +248 -0
  15. package/dist/commands/doctor.js.map +1 -0
  16. package/dist/commands/doctor.test.d.ts +1 -0
  17. package/dist/commands/doctor.test.js +301 -0
  18. package/dist/commands/doctor.test.js.map +1 -0
  19. package/dist/commands/eject.d.ts +11 -0
  20. package/dist/commands/eject.js +55 -0
  21. package/dist/commands/eject.js.map +1 -0
  22. package/dist/commands/eject.test.d.ts +1 -0
  23. package/dist/commands/eject.test.js +151 -0
  24. package/dist/commands/eject.test.js.map +1 -0
  25. package/dist/commands/info.d.ts +1 -0
  26. package/dist/commands/info.js +73 -0
  27. package/dist/commands/info.js.map +1 -0
  28. package/dist/commands/info.test.d.ts +1 -0
  29. package/dist/commands/info.test.js +143 -0
  30. package/dist/commands/info.test.js.map +1 -0
  31. package/dist/commands/init.d.ts +1 -0
  32. package/dist/commands/init.js +98 -0
  33. package/dist/commands/init.js.map +1 -0
  34. package/dist/commands/init.test.d.ts +1 -0
  35. package/dist/commands/init.test.js +154 -0
  36. package/dist/commands/init.test.js.map +1 -0
  37. package/dist/commands/list.d.ts +16 -0
  38. package/dist/commands/list.js +124 -0
  39. package/dist/commands/list.js.map +1 -0
  40. package/dist/commands/list.test.d.ts +1 -0
  41. package/dist/commands/list.test.js +285 -0
  42. package/dist/commands/list.test.js.map +1 -0
  43. package/dist/commands/outdated.d.ts +13 -0
  44. package/dist/commands/outdated.js +116 -0
  45. package/dist/commands/outdated.js.map +1 -0
  46. package/dist/commands/outdated.test.d.ts +1 -0
  47. package/dist/commands/outdated.test.js +208 -0
  48. package/dist/commands/outdated.test.js.map +1 -0
  49. package/dist/commands/remove.d.ts +18 -0
  50. package/dist/commands/remove.js +161 -0
  51. package/dist/commands/remove.js.map +1 -0
  52. package/dist/commands/remove.test.d.ts +1 -0
  53. package/dist/commands/remove.test.js +361 -0
  54. package/dist/commands/remove.test.js.map +1 -0
  55. package/dist/commands/theme.d.ts +1 -0
  56. package/dist/commands/theme.js +66 -0
  57. package/dist/commands/theme.js.map +1 -0
  58. package/dist/commands/theme.test.d.ts +1 -0
  59. package/dist/commands/theme.test.js +133 -0
  60. package/dist/commands/theme.test.js.map +1 -0
  61. package/dist/commands/update.d.ts +31 -0
  62. package/dist/commands/update.js +601 -0
  63. package/dist/commands/update.js.map +1 -0
  64. package/dist/commands/update.test.d.ts +1 -0
  65. package/dist/commands/update.test.js +1233 -0
  66. package/dist/commands/update.test.js.map +1 -0
  67. package/dist/config.d.ts +11 -0
  68. package/dist/config.js +19 -0
  69. package/dist/config.js.map +1 -0
  70. package/dist/config.test.d.ts +1 -0
  71. package/dist/config.test.js +48 -0
  72. package/dist/config.test.js.map +1 -0
  73. package/dist/index.d.ts +2 -0
  74. package/dist/index.js +89 -0
  75. package/dist/index.js.map +1 -0
  76. package/dist/lockfile.d.ts +21 -0
  77. package/dist/lockfile.js +39 -0
  78. package/dist/lockfile.js.map +1 -0
  79. package/dist/registry.d.ts +14 -0
  80. package/dist/registry.js +85 -0
  81. package/dist/registry.js.map +1 -0
  82. package/dist/registry.test.d.ts +1 -0
  83. package/dist/registry.test.js +95 -0
  84. package/dist/registry.test.js.map +1 -0
  85. package/dist/test-utils.d.ts +16 -0
  86. package/dist/test-utils.js +65 -0
  87. package/dist/test-utils.js.map +1 -0
  88. package/dist/ui/components/accordion/accordion.test.ts +194 -0
  89. package/dist/ui/components/accordion/accordion.ts +173 -0
  90. package/dist/ui/components/accordion/index.ts +6 -0
  91. package/dist/ui/components/action-sheet/action-sheet.test.ts +211 -0
  92. package/dist/ui/components/action-sheet/action-sheet.ts +353 -0
  93. package/dist/ui/components/action-sheet/index.ts +6 -0
  94. package/dist/ui/components/alert/alert.test.ts +48 -0
  95. package/dist/ui/components/alert/alert.ts +104 -0
  96. package/dist/ui/components/alert/index.ts +1 -0
  97. package/dist/ui/components/alert-dialog/alert-dialog.test.ts +141 -0
  98. package/dist/ui/components/alert-dialog/alert-dialog.ts +243 -0
  99. package/dist/ui/components/alert-dialog/index.ts +7 -0
  100. package/dist/ui/components/area-chart/area-chart-render.test.ts +121 -0
  101. package/dist/ui/components/area-chart/area-chart.test.ts +158 -0
  102. package/dist/ui/components/area-chart/area-chart.ts +349 -0
  103. package/dist/ui/components/area-chart/index.ts +6 -0
  104. package/dist/ui/components/aspect-ratio/aspect-ratio.test.ts +10 -0
  105. package/dist/ui/components/aspect-ratio/aspect-ratio.ts +28 -0
  106. package/dist/ui/components/aspect-ratio/index.ts +1 -0
  107. package/dist/ui/components/avatar/avatar.test.ts +69 -0
  108. package/dist/ui/components/avatar/avatar.ts +131 -0
  109. package/dist/ui/components/avatar/index.ts +1 -0
  110. package/dist/ui/components/badge/badge.test.ts +49 -0
  111. package/dist/ui/components/badge/badge.ts +97 -0
  112. package/dist/ui/components/badge/index.ts +1 -0
  113. package/dist/ui/components/bar-chart/bar-chart-render.test.ts +174 -0
  114. package/dist/ui/components/bar-chart/bar-chart.test.ts +73 -0
  115. package/dist/ui/components/bar-chart/bar-chart.ts +327 -0
  116. package/dist/ui/components/bar-chart/index.ts +6 -0
  117. package/dist/ui/components/bottom-sheet/bottom-sheet.test.ts +163 -0
  118. package/dist/ui/components/bottom-sheet/bottom-sheet.ts +339 -0
  119. package/dist/ui/components/bottom-sheet/index.ts +1 -0
  120. package/dist/ui/components/button/button-render.test.ts +113 -0
  121. package/dist/ui/components/button/button.test.ts +70 -0
  122. package/dist/ui/components/button/button.ts +170 -0
  123. package/dist/ui/components/button/index.ts +6 -0
  124. package/dist/ui/components/button-group/button-group-render.test.ts +146 -0
  125. package/dist/ui/components/button-group/button-group.test.ts +54 -0
  126. package/dist/ui/components/button-group/button-group.ts +209 -0
  127. package/dist/ui/components/button-group/index.ts +8 -0
  128. package/dist/ui/components/candlestick-chart/candlestick-chart-render.test.ts +174 -0
  129. package/dist/ui/components/candlestick-chart/candlestick-chart.test.ts +96 -0
  130. package/dist/ui/components/candlestick-chart/candlestick-chart.ts +355 -0
  131. package/dist/ui/components/candlestick-chart/index.ts +7 -0
  132. package/dist/ui/components/card/card.test.ts +110 -0
  133. package/dist/ui/components/card/card.ts +162 -0
  134. package/dist/ui/components/card/index.ts +8 -0
  135. package/dist/ui/components/cartesian-chart/cartesian-chart-render.test.ts +188 -0
  136. package/dist/ui/components/cartesian-chart/cartesian-chart.test.ts +549 -0
  137. package/dist/ui/components/cartesian-chart/cartesian-chart.ts +1140 -0
  138. package/dist/ui/components/cartesian-chart/index.ts +18 -0
  139. package/dist/ui/components/checkbox/checkbox.test.ts +59 -0
  140. package/dist/ui/components/checkbox/checkbox.ts +96 -0
  141. package/dist/ui/components/checkbox/index.ts +1 -0
  142. package/dist/ui/components/collapsible/collapsible.test.ts +112 -0
  143. package/dist/ui/components/collapsible/collapsible.ts +122 -0
  144. package/dist/ui/components/collapsible/index.ts +5 -0
  145. package/dist/ui/components/dialog/dialog.test.ts +157 -0
  146. package/dist/ui/components/dialog/dialog.ts +248 -0
  147. package/dist/ui/components/dialog/index.ts +7 -0
  148. package/dist/ui/components/empty-state/empty-state.test.ts +60 -0
  149. package/dist/ui/components/empty-state/empty-state.ts +46 -0
  150. package/dist/ui/components/empty-state/index.ts +1 -0
  151. package/dist/ui/components/icon/icon.test.ts +52 -0
  152. package/dist/ui/components/icon/icon.ts +54 -0
  153. package/dist/ui/components/icon/icons.ts +569 -0
  154. package/dist/ui/components/icon/index.ts +2 -0
  155. package/dist/ui/components/input/index.ts +1 -0
  156. package/dist/ui/components/input/input.test.ts +134 -0
  157. package/dist/ui/components/input/input.ts +189 -0
  158. package/dist/ui/components/label/index.ts +1 -0
  159. package/dist/ui/components/label/label.test.ts +38 -0
  160. package/dist/ui/components/label/label.ts +24 -0
  161. package/dist/ui/components/line-chart/index.ts +6 -0
  162. package/dist/ui/components/line-chart/line-chart-render.test.ts +121 -0
  163. package/dist/ui/components/line-chart/line-chart.test.ts +81 -0
  164. package/dist/ui/components/line-chart/line-chart.ts +273 -0
  165. package/dist/ui/components/list/index.ts +1 -0
  166. package/dist/ui/components/list/list.test.ts +35 -0
  167. package/dist/ui/components/list/list.ts +71 -0
  168. package/dist/ui/components/nav-drawer/index.ts +8 -0
  169. package/dist/ui/components/nav-drawer/nav-drawer.test.ts +267 -0
  170. package/dist/ui/components/nav-drawer/nav-drawer.ts +504 -0
  171. package/dist/ui/components/pagination/index.ts +1 -0
  172. package/dist/ui/components/pagination/pagination.test.ts +96 -0
  173. package/dist/ui/components/pagination/pagination.ts +147 -0
  174. package/dist/ui/components/progress/index.ts +1 -0
  175. package/dist/ui/components/progress/progress.test.ts +71 -0
  176. package/dist/ui/components/progress/progress.ts +118 -0
  177. package/dist/ui/components/radio-group/index.ts +1 -0
  178. package/dist/ui/components/radio-group/radio-group.test.ts +115 -0
  179. package/dist/ui/components/radio-group/radio-group.ts +129 -0
  180. package/dist/ui/components/scatter-chart/index.ts +6 -0
  181. package/dist/ui/components/scatter-chart/scatter-chart-render.test.ts +157 -0
  182. package/dist/ui/components/scatter-chart/scatter-chart.test.ts +57 -0
  183. package/dist/ui/components/scatter-chart/scatter-chart.ts +277 -0
  184. package/dist/ui/components/scroll-area/index.ts +1 -0
  185. package/dist/ui/components/scroll-area/scroll-area.test.ts +40 -0
  186. package/dist/ui/components/scroll-area/scroll-area.ts +73 -0
  187. package/dist/ui/components/select/index.ts +1 -0
  188. package/dist/ui/components/select/select.test.ts +107 -0
  189. package/dist/ui/components/select/select.ts +146 -0
  190. package/dist/ui/components/separator/index.ts +1 -0
  191. package/dist/ui/components/separator/separator.test.ts +26 -0
  192. package/dist/ui/components/separator/separator.ts +45 -0
  193. package/dist/ui/components/sheet/index.ts +7 -0
  194. package/dist/ui/components/sheet/sheet.test.ts +44 -0
  195. package/dist/ui/components/sheet/sheet.ts +114 -0
  196. package/dist/ui/components/skeleton/index.ts +1 -0
  197. package/dist/ui/components/skeleton/skeleton.test.ts +13 -0
  198. package/dist/ui/components/skeleton/skeleton.ts +45 -0
  199. package/dist/ui/components/spinner/index.ts +1 -0
  200. package/dist/ui/components/spinner/spinner.test.ts +39 -0
  201. package/dist/ui/components/spinner/spinner.ts +83 -0
  202. package/dist/ui/components/switch/index.ts +1 -0
  203. package/dist/ui/components/switch/switch.test.ts +63 -0
  204. package/dist/ui/components/switch/switch.ts +98 -0
  205. package/dist/ui/components/tabs/index.ts +1 -0
  206. package/dist/ui/components/tabs/tabs.test.ts +199 -0
  207. package/dist/ui/components/tabs/tabs.ts +317 -0
  208. package/dist/ui/components/textarea/index.ts +1 -0
  209. package/dist/ui/components/textarea/textarea.test.ts +138 -0
  210. package/dist/ui/components/textarea/textarea.ts +221 -0
  211. package/dist/ui/components/toast/index.ts +9 -0
  212. package/dist/ui/components/toast/toast-state.test.ts +54 -0
  213. package/dist/ui/components/toast/toast-state.ts +46 -0
  214. package/dist/ui/components/toast/toast.test.ts +342 -0
  215. package/dist/ui/components/toast/toast.ts +527 -0
  216. package/dist/ui/components/toggle/index.ts +7 -0
  217. package/dist/ui/components/toggle/toggle.test.ts +186 -0
  218. package/dist/ui/components/toggle/toggle.ts +218 -0
  219. package/dist/ui/components/typography/index.ts +5 -0
  220. package/dist/ui/components/typography/typography.test.ts +55 -0
  221. package/dist/ui/components/typography/typography.ts +44 -0
  222. package/dist/ui/theme/dark.css +41 -0
  223. package/dist/ui/theme/default.css +56 -0
  224. package/dist/ui/theme/tailwind-plugin.test.ts +124 -0
  225. package/dist/ui/theme/tailwind-plugin.ts +151 -0
  226. package/dist/ui/utils/animate.test.ts +324 -0
  227. package/dist/ui/utils/animate.ts +544 -0
  228. package/dist/ui/utils/cn.test.ts +27 -0
  229. package/dist/ui/utils/cn.ts +6 -0
  230. package/dist/utils/analyze.d.ts +32 -0
  231. package/dist/utils/analyze.js +109 -0
  232. package/dist/utils/analyze.js.map +1 -0
  233. package/dist/utils/analyze.test.d.ts +1 -0
  234. package/dist/utils/analyze.test.js +146 -0
  235. package/dist/utils/analyze.test.js.map +1 -0
  236. package/dist/utils/animate.d.ts +210 -0
  237. package/dist/utils/animate.js +423 -0
  238. package/dist/utils/animate.js.map +1 -0
  239. package/dist/utils/animate.test.d.ts +1 -0
  240. package/dist/utils/animate.test.js +365 -0
  241. package/dist/utils/animate.test.js.map +1 -0
  242. package/dist/utils/banner.d.ts +1 -0
  243. package/dist/utils/banner.js +15 -0
  244. package/dist/utils/banner.js.map +1 -0
  245. package/dist/utils/banner.test.d.ts +1 -0
  246. package/dist/utils/banner.test.js +29 -0
  247. package/dist/utils/banner.test.js.map +1 -0
  248. package/dist/utils/cn.d.ts +2 -0
  249. package/dist/utils/cn.js +6 -0
  250. package/dist/utils/cn.js.map +1 -0
  251. package/dist/utils/cn.test.d.ts +1 -0
  252. package/dist/utils/cn.test.js +21 -0
  253. package/dist/utils/cn.test.js.map +1 -0
  254. package/dist/utils/format.d.ts +31 -0
  255. package/dist/utils/format.js +95 -0
  256. package/dist/utils/format.js.map +1 -0
  257. package/dist/utils/format.test.d.ts +1 -0
  258. package/dist/utils/format.test.js +71 -0
  259. package/dist/utils/format.test.js.map +1 -0
  260. package/dist/utils/logger.d.ts +6 -0
  261. package/dist/utils/logger.js +16 -0
  262. package/dist/utils/logger.js.map +1 -0
  263. package/dist/utils/logger.test.d.ts +1 -0
  264. package/dist/utils/logger.test.js +36 -0
  265. package/dist/utils/logger.test.js.map +1 -0
  266. package/dist/utils/resolve-paths.d.ts +12 -0
  267. package/dist/utils/resolve-paths.js +29 -0
  268. package/dist/utils/resolve-paths.js.map +1 -0
  269. package/dist/utils/resolve-paths.test.d.ts +1 -0
  270. package/dist/utils/resolve-paths.test.js +52 -0
  271. package/dist/utils/resolve-paths.test.js.map +1 -0
  272. package/package.json +56 -4
  273. package/README.md +0 -3
@@ -0,0 +1,109 @@
1
+ import pc from 'picocolors';
2
+ import { diffLines, structuredPatch, applyPatch, } from 'diff';
3
+ export const STATUS_ICONS = {
4
+ 'up-to-date': pc.green('✓'),
5
+ 'auto-update': pc.blue('↑'),
6
+ 'user-modified': pc.yellow('~'),
7
+ conflict: pc.red('⚠'),
8
+ 'new-upstream': pc.blue('+'),
9
+ };
10
+ export const STATUS_LABELS = {
11
+ 'up-to-date': pc.dim('up to date'),
12
+ 'auto-update': pc.blue('upstream updated → auto-update'),
13
+ 'user-modified': pc.yellow('you modified → keeping yours'),
14
+ conflict: pc.red('conflict — both modified'),
15
+ 'new-upstream': pc.blue('new file from upstream'),
16
+ };
17
+ /**
18
+ * Three-way merge status detection. The lockfile stores the hash of each
19
+ * file at install time (the "base"). Comparing current (user's file),
20
+ * upstream (bundled source), and base (lockfile hash) lets us determine
21
+ * who changed what:
22
+ * base == current, base != upstream → upstream changed → safe auto-update
23
+ * base != current, base == upstream → user changed → keep theirs
24
+ * base != current, base != upstream → both changed → conflict
25
+ * When no base exists (missing lockfile entry), we can't tell who diverged,
26
+ * so any difference is flagged as a conflict to be safe.
27
+ */
28
+ export const analyzeFile = (currentContent, newContent, storedHash, hashContent) => {
29
+ if (currentContent === null) {
30
+ return 'new-upstream';
31
+ }
32
+ const currentHash = hashContent(currentContent);
33
+ const newHash = hashContent(newContent);
34
+ if (storedHash === null) {
35
+ if (currentHash === newHash)
36
+ return 'up-to-date';
37
+ return 'conflict';
38
+ }
39
+ if (storedHash === currentHash && storedHash === newHash)
40
+ return 'up-to-date';
41
+ if (currentHash === newHash)
42
+ return 'up-to-date';
43
+ if (storedHash === currentHash && storedHash !== newHash)
44
+ return 'auto-update';
45
+ if (storedHash !== currentHash && storedHash === newHash)
46
+ return 'user-modified';
47
+ return 'conflict';
48
+ };
49
+ export const formatDiff = (currentContent, newContent) => {
50
+ const changes = diffLines(currentContent, newContent);
51
+ const lines = [];
52
+ for (const change of changes) {
53
+ const text = change.value.replace(/\n$/, '');
54
+ const changeLines = text.split('\n');
55
+ for (const line of changeLines) {
56
+ if (change.added) {
57
+ lines.push(pc.green(`+ ${line}`));
58
+ }
59
+ else if (change.removed) {
60
+ lines.push(pc.red(`- ${line}`));
61
+ }
62
+ else {
63
+ lines.push(pc.dim(` ${line}`));
64
+ }
65
+ }
66
+ }
67
+ return lines.join('\n');
68
+ };
69
+ export const summarizeComponent = (analysis) => {
70
+ const statuses = analysis.files.map((f) => f.status);
71
+ if (statuses.includes('conflict'))
72
+ return 'conflict';
73
+ if (statuses.includes('auto-update') || statuses.includes('new-upstream'))
74
+ return 'auto-update';
75
+ if (statuses.includes('user-modified'))
76
+ return 'user-modified';
77
+ return 'up-to-date';
78
+ };
79
+ export const getHunks = (currentContent, newContent, context = 3) => {
80
+ const patch = structuredPatch('file', 'file', currentContent, newContent, '', '', {
81
+ context,
82
+ });
83
+ return patch.hunks;
84
+ };
85
+ export const formatHunk = (hunk) => {
86
+ const lines = [];
87
+ for (const line of hunk.lines) {
88
+ const prefix = line[0];
89
+ if (prefix === '+') {
90
+ lines.push(pc.green(line));
91
+ }
92
+ else if (prefix === '-') {
93
+ lines.push(pc.red(line));
94
+ }
95
+ else {
96
+ lines.push(pc.dim(line));
97
+ }
98
+ }
99
+ return lines.join('\n');
100
+ };
101
+ export const applySelectedHunks = (currentContent, newContent, acceptedIndices) => {
102
+ const patch = structuredPatch('file', 'file', currentContent, newContent);
103
+ const partial = {
104
+ ...patch,
105
+ hunks: patch.hunks.filter((_, i) => acceptedIndices.includes(i)),
106
+ };
107
+ return applyPatch(currentContent, partial);
108
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CAAC,CAAC;QAC7B,CAAC;aAAM,IAAI,MAAM,KAAK,GAAG,EAAE,CAAC;YAC1B,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;QAC3B,CAAC;aAAM,CAAC;YACN,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;QAC3B,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAChC,cAAsB,EACtB,UAAkB,EAClB,eAAyB,EACT,EAAE;IAClB,MAAM,KAAK,GAAG,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,UAAU,CAAC,CAAC;IAC1E,MAAM,OAAO,GAAe;QAC1B,GAAG,KAAK;QACR,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;KACjE,CAAC;IACF,OAAO,UAAU,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;AAC7C,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,146 @@
1
+ import { describe, expect, it } from 'vitest';
2
+ import { createHash } from 'node:crypto';
3
+ import { analyzeFile, formatDiff, summarizeComponent } from './analyze';
4
+ const hash = (content) => createHash('sha256').update(content).digest('hex').slice(0, 16);
5
+ describe('analyzeFile', () => {
6
+ it('returns new-upstream when current content is null', () => {
7
+ expect(analyzeFile(null, 'new content', null, hash)).toBe('new-upstream');
8
+ });
9
+ it('returns up-to-date when current matches new (no stored hash)', () => {
10
+ expect(analyzeFile('same', 'same', null, hash)).toBe('up-to-date');
11
+ });
12
+ it('returns conflict when content differs with no stored hash', () => {
13
+ expect(analyzeFile('local', 'upstream', null, hash)).toBe('conflict');
14
+ });
15
+ it('returns up-to-date when all three hashes match', () => {
16
+ const stored = hash('content');
17
+ expect(analyzeFile('content', 'content', stored, hash)).toBe('up-to-date');
18
+ });
19
+ it('returns up-to-date when user made same change as upstream', () => {
20
+ const stored = hash('original');
21
+ expect(analyzeFile('updated', 'updated', stored, hash)).toBe('up-to-date');
22
+ });
23
+ it('returns auto-update when only upstream changed', () => {
24
+ const stored = hash('original');
25
+ expect(analyzeFile('original', 'new-upstream', stored, hash)).toBe('auto-update');
26
+ });
27
+ it('returns user-modified when only user changed', () => {
28
+ const stored = hash('original');
29
+ expect(analyzeFile('user-edit', 'original', stored, hash)).toBe('user-modified');
30
+ });
31
+ it('returns conflict when both user and upstream changed differently', () => {
32
+ const stored = hash('original');
33
+ expect(analyzeFile('user-edit', 'upstream-edit', stored, hash)).toBe('conflict');
34
+ });
35
+ });
36
+ describe('summarizeComponent', () => {
37
+ it('returns up-to-date when all files are up-to-date', () => {
38
+ const result = summarizeComponent({
39
+ name: 'test',
40
+ files: [
41
+ {
42
+ file: 'a.ts',
43
+ status: 'up-to-date',
44
+ currentContent: '',
45
+ newContent: '',
46
+ },
47
+ {
48
+ file: 'b.ts',
49
+ status: 'up-to-date',
50
+ currentContent: '',
51
+ newContent: '',
52
+ },
53
+ ],
54
+ });
55
+ expect(result).toBe('up-to-date');
56
+ });
57
+ it('returns conflict when any file has conflict', () => {
58
+ const result = summarizeComponent({
59
+ name: 'test',
60
+ files: [
61
+ {
62
+ file: 'a.ts',
63
+ status: 'auto-update',
64
+ currentContent: '',
65
+ newContent: '',
66
+ },
67
+ {
68
+ file: 'b.ts',
69
+ status: 'conflict',
70
+ currentContent: '',
71
+ newContent: '',
72
+ },
73
+ ],
74
+ });
75
+ expect(result).toBe('conflict');
76
+ });
77
+ it('returns auto-update when any file needs update (no conflicts)', () => {
78
+ const result = summarizeComponent({
79
+ name: 'test',
80
+ files: [
81
+ {
82
+ file: 'a.ts',
83
+ status: 'up-to-date',
84
+ currentContent: '',
85
+ newContent: '',
86
+ },
87
+ {
88
+ file: 'b.ts',
89
+ status: 'auto-update',
90
+ currentContent: '',
91
+ newContent: '',
92
+ },
93
+ ],
94
+ });
95
+ expect(result).toBe('auto-update');
96
+ });
97
+ it('returns auto-update for new-upstream files', () => {
98
+ const result = summarizeComponent({
99
+ name: 'test',
100
+ files: [
101
+ {
102
+ file: 'a.ts',
103
+ status: 'new-upstream',
104
+ currentContent: '',
105
+ newContent: '',
106
+ },
107
+ ],
108
+ });
109
+ expect(result).toBe('auto-update');
110
+ });
111
+ it('returns user-modified when only user changes exist', () => {
112
+ const result = summarizeComponent({
113
+ name: 'test',
114
+ files: [
115
+ {
116
+ file: 'a.ts',
117
+ status: 'up-to-date',
118
+ currentContent: '',
119
+ newContent: '',
120
+ },
121
+ {
122
+ file: 'b.ts',
123
+ status: 'user-modified',
124
+ currentContent: '',
125
+ newContent: '',
126
+ },
127
+ ],
128
+ });
129
+ expect(result).toBe('user-modified');
130
+ });
131
+ });
132
+ describe('formatDiff', () => {
133
+ it('produces output with added and removed lines', () => {
134
+ const result = formatDiff('line one\nline two\n', 'line one\nline three\n');
135
+ expect(result).toContain('line one');
136
+ expect(result).toContain('line two');
137
+ expect(result).toContain('line three');
138
+ });
139
+ it('returns context-only output for identical content', () => {
140
+ const result = formatDiff('same\n', 'same\n');
141
+ expect(result).toContain('same');
142
+ expect(result).not.toContain('+');
143
+ expect(result).not.toContain('-');
144
+ });
145
+ });
146
+ //# sourceMappingURL=analyze.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analyze.test.js","sourceRoot":"","sources":["../../src/utils/analyze.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAEx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CAAC,CAAC;QAClC,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;IACpC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,210 @@
1
+ /**
2
+ * Shared animation utility for @blotch/ui components.
3
+ *
4
+ * Centralizes all motion constants (durations, easing curves, scale factors)
5
+ * and provides reusable animation helpers that wrap the Lynx element.animate() API.
6
+ * This ensures a consistent, cohesive motion language across the entire component library.
7
+ */
8
+ /**
9
+ * Duration constants in milliseconds
10
+ */
11
+ export declare const DURATION: {
12
+ /**
13
+ * Micro-interactions: checkbox tick, radio dot
14
+ */
15
+ readonly instant: 100;
16
+ /**
17
+ * Press/release, thumb slide
18
+ */
19
+ readonly fast: 150;
20
+ /**
21
+ * Overlays, content transitions
22
+ */
23
+ readonly normal: 250;
24
+ /**
25
+ * Sheet/drawer slide, accordion expand
26
+ */
27
+ readonly slow: 350;
28
+ };
29
+ /**
30
+ * Easing curves for different animation contexts
31
+ */
32
+ export declare const EASING: {
33
+ /**
34
+ * Entering elements — fast start, gentle stop
35
+ */
36
+ readonly decelerate: "cubic-bezier(0.0, 0.0, 0.2, 1)";
37
+ /**
38
+ * Exiting elements — gentle start, fast stop
39
+ */
40
+ readonly accelerate: "cubic-bezier(0.4, 0.0, 1, 1)";
41
+ /**
42
+ * General purpose movement
43
+ */
44
+ readonly standard: "cubic-bezier(0.4, 0.0, 0.2, 1)";
45
+ /**
46
+ * Bouncy overshoot — playful, energetic entrance
47
+ */
48
+ readonly spring: "cubic-bezier(0.34, 1.56, 0.64, 1)";
49
+ /**
50
+ * Gentle overshoot — refined entrance
51
+ */
52
+ readonly springSubtle: "cubic-bezier(0.22, 1.2, 0.36, 1)";
53
+ /**
54
+ * iOS-style sheet/drawer slide
55
+ */
56
+ readonly sheet: "cubic-bezier(0.32, 0.72, 0, 1)";
57
+ };
58
+ /**
59
+ * Scale factors for transform animations
60
+ */
61
+ export declare const SCALE: {
62
+ /**
63
+ * Button/toggle press
64
+ */
65
+ readonly pressDown: 0.97;
66
+ /**
67
+ * List item / card press (lighter)
68
+ */
69
+ readonly pressDownLight: 0.985;
70
+ /**
71
+ * Small elements popping in (check, radio dot)
72
+ */
73
+ readonly popFrom: 0.6;
74
+ /**
75
+ * Dialog entrance starting scale
76
+ */
77
+ readonly dialogFrom: 0.9;
78
+ /**
79
+ * Dialog exit ending scale
80
+ */
81
+ readonly dialogTo: 0.95;
82
+ };
83
+ /**
84
+ * Options shared by most animation helpers
85
+ */
86
+ export type AnimateOptions = {
87
+ duration?: number;
88
+ easing?: string;
89
+ fill?: 'none' | 'forwards' | 'backwards' | 'both';
90
+ };
91
+ /**
92
+ * A cancelable animation handle returned by Lynx element.animate()
93
+ */
94
+ export type AnimationHandle = {
95
+ cancel(): void;
96
+ };
97
+ /**
98
+ * Fades an element in (opacity 0 → 1).
99
+ * Used for backdrops, content reveals, and soft entrances.
100
+ */
101
+ export declare const fadeIn: (el: any, options?: AnimateOptions) => AnimationHandle | undefined;
102
+ /**
103
+ * Fades an element out (opacity 1 → 0).
104
+ * Used for backdrops, content dismissals, and soft exits.
105
+ */
106
+ export declare const fadeOut: (el: any, options?: AnimateOptions) => AnimationHandle | undefined;
107
+ /**
108
+ * Scales and fades an element in — used for overlay panels (dialog, alert-dialog).
109
+ * Animates from a smaller scale + offset to full size.
110
+ */
111
+ export declare const scaleIn: (el: any, options?: AnimateOptions & {
112
+ fromScale?: number;
113
+ fromY?: number;
114
+ }) => AnimationHandle | undefined;
115
+ /**
116
+ * Scales and fades an element out — used for overlay panel exit.
117
+ */
118
+ export declare const scaleOut: (el: any, options?: AnimateOptions & {
119
+ toScale?: number;
120
+ toY?: number;
121
+ }) => AnimationHandle | undefined;
122
+ /**
123
+ * Slides an element in from a direction.
124
+ * Used for sheets (bottom), nav-drawers (left/right), toasts (bottom).
125
+ */
126
+ export declare const slideIn: (el: any, direction: "up" | "down" | "left" | "right", options?: AnimateOptions) => AnimationHandle | undefined;
127
+ /**
128
+ * Slides an element out to a direction.
129
+ */
130
+ export declare const slideOut: (el: any, direction: "up" | "down" | "left" | "right", options?: AnimateOptions) => AnimationHandle | undefined;
131
+ /**
132
+ * Pops a small element in with spring physics.
133
+ * Used for checkbox marks, radio dots, badges.
134
+ */
135
+ export declare const popIn: (el: any, options?: AnimateOptions & {
136
+ fromScale?: number;
137
+ }) => AnimationHandle | undefined;
138
+ /**
139
+ * Pops a small element out (reverse of popIn).
140
+ */
141
+ export declare const popOut: (el: any, options?: AnimateOptions & {
142
+ toScale?: number;
143
+ }) => AnimationHandle | undefined;
144
+ /**
145
+ * Animates an element being pressed down (scale shrink).
146
+ *
147
+ * Wire this to BOTH the touch and mouse press-start events —
148
+ * `(bindtouchstart)` and `(bindmousedown)`. Native (iOS/Android) only ever
149
+ * fires touch events; Lynx web runs in the browser, where a mouse press fires
150
+ * `mousedown` and NEVER `touchstart`. Mouse events are inert on touch devices,
151
+ * so binding both yields identical press-and-hold feedback across platforms.
152
+ * See `transitionTransform` for why this uses a CSS transition, not
153
+ * `el.animate()`.
154
+ */
155
+ export declare const pressDown: (el: any, scale?: number) => AnimationHandle | undefined;
156
+ /**
157
+ * Animates an element releasing from a press (scale back with spring).
158
+ *
159
+ * Wire this to the touch AND mouse release events — `(bindtouchend)` +
160
+ * `(bindtouchcancel)` and `(bindmouseup)` + `(bindmouseleave)`. See `pressDown`
161
+ * for why the mouse bindings are required on Lynx web. `mouseleave` is the
162
+ * `touchcancel` analogue: it restores the scale if the cursor leaves the
163
+ * element while still pressed.
164
+ */
165
+ export declare const pressRelease: (el: any) => AnimationHandle | undefined;
166
+ /**
167
+ * Orchestrates opening an overlay (backdrop + panel entrance).
168
+ * Provides staggered timing — backdrop fades first, then panel enters.
169
+ */
170
+ export declare const overlayOpen: (backdrop: any, panel: any, type: "center" | "bottom" | "left" | "right") => {
171
+ backdrop?: AnimationHandle;
172
+ panel?: AnimationHandle;
173
+ };
174
+ /**
175
+ * Orchestrates closing an overlay (panel exits, then backdrop fades).
176
+ * Returns total animation duration for cleanup scheduling.
177
+ */
178
+ export declare const overlayClose: (backdrop: any, panel: any, type: "center" | "bottom" | "left" | "right") => number;
179
+ /**
180
+ * Creates a continuous pulse animation (for skeleton loading states).
181
+ * Oscillates opacity between 1 and 0.5 indefinitely.
182
+ */
183
+ export declare const pulse: (el: any, options?: {
184
+ duration?: number;
185
+ }) => AnimationHandle | undefined;
186
+ /**
187
+ * Creates a horizontal shake animation (for error states on inputs).
188
+ * Shakes ±4px then ±2px before settling.
189
+ */
190
+ export declare const shake: (el: any, options?: AnimateOptions) => AnimationHandle | undefined;
191
+ /**
192
+ * Animates a spring-based translation between two X positions.
193
+ * Used for switch thumbs with a squish effect at midpoint.
194
+ */
195
+ export declare const springTranslateX: (el: any, fromX: number, toX: number, options?: AnimateOptions) => AnimationHandle | undefined;
196
+ /**
197
+ * Content reveal animation — fade in with upward slide.
198
+ * Used for accordion content, tab content, alerts, etc.
199
+ */
200
+ export declare const revealIn: (el: any, options?: AnimateOptions & {
201
+ fromY?: number;
202
+ }) => AnimationHandle | undefined;
203
+ /**
204
+ * Direction-aware slide + fade for tab content transitions.
205
+ * Slides from left or right based on navigation direction, creating
206
+ * a spatial relationship between tab panels.
207
+ */
208
+ export declare const directionalSlideIn: (el: any, direction: 1 | -1, options?: AnimateOptions & {
209
+ distance?: number;
210
+ }) => AnimationHandle | undefined;