@spider-analyzer/timeline 4.0.3 → 5.0.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 (75) hide show
  1. package/CHANGELOG.md +80 -1
  2. package/README.md +275 -637
  3. package/dist/index.d.mts +132 -0
  4. package/dist/index.d.ts +132 -0
  5. package/dist/index.js +2913 -22
  6. package/dist/index.js.map +1 -0
  7. package/dist/index.mjs +2906 -0
  8. package/dist/index.mjs.map +1 -0
  9. package/dist/timeline.css +139 -0
  10. package/package.json +52 -15
  11. package/src/Cursor.jsx +5 -13
  12. package/src/TimeLine.tsx +994 -0
  13. package/src/TimeLineResizer.jsx +2 -8
  14. package/src/ToolTip.jsx +7 -7
  15. package/src/cursorElements/CursorIcon.jsx +6 -29
  16. package/src/cursorElements/CursorSelection.jsx +4 -19
  17. package/src/cursorElements/DragOverlay.jsx +2 -12
  18. package/src/cursorElements/LeftHandle.jsx +3 -19
  19. package/src/cursorElements/LeftToolTip.jsx +2 -7
  20. package/src/cursorElements/RightHandle.jsx +3 -19
  21. package/src/cursorElements/RightToolTip.jsx +4 -13
  22. package/src/cursorElements/ZoomIn.jsx +5 -25
  23. package/src/cursorElements/ZoomOut.jsx +4 -21
  24. package/src/cursorElements/utils.js +1 -1
  25. package/src/index.js +6 -0
  26. package/src/index.ts +158 -0
  27. package/src/moment-shim.ts +169 -0
  28. package/src/styles.ts +15 -0
  29. package/src/time.ts +52 -0
  30. package/src/timeLineElements/Button.jsx +5 -30
  31. package/src/timeLineElements/HistoToolTip.jsx +3 -17
  32. package/src/timeLineElements/Histogram.jsx +4 -16
  33. package/src/timeLineElements/Legend.jsx +2 -16
  34. package/src/timeLineElements/QualityLine.jsx +4 -11
  35. package/src/timeLineElements/Tools.jsx +1 -1
  36. package/src/timeLineElements/XAxis.jsx +5 -8
  37. package/src/timeLineElements/XGrid.jsx +3 -7
  38. package/src/timeLineElements/YAxis.jsx +4 -7
  39. package/src/timeLineElements/YGrid.jsx +2 -6
  40. package/src/timeLineElements/axesStyles.jsx +0 -49
  41. package/src/timeline.css +139 -0
  42. package/src/utils.ts +60 -0
  43. package/.babelrc +0 -8
  44. package/.gitlab-ci.yml +0 -27
  45. package/Makefile +0 -20
  46. package/dist/Cursor.js +0 -290
  47. package/dist/TimeLine.js +0 -1177
  48. package/dist/TimeLineResizer.js +0 -70
  49. package/dist/ToolTip.js +0 -43
  50. package/dist/cursorElements/CursorIcon.js +0 -98
  51. package/dist/cursorElements/CursorSelection.js +0 -179
  52. package/dist/cursorElements/DragOverlay.js +0 -168
  53. package/dist/cursorElements/LeftHandle.js +0 -95
  54. package/dist/cursorElements/LeftToolTip.js +0 -70
  55. package/dist/cursorElements/RightHandle.js +0 -95
  56. package/dist/cursorElements/RightToolTip.js +0 -75
  57. package/dist/cursorElements/ZoomIn.js +0 -93
  58. package/dist/cursorElements/ZoomOut.js +0 -67
  59. package/dist/cursorElements/commonStyles.js +0 -28
  60. package/dist/cursorElements/handleHistoHovering.js +0 -79
  61. package/dist/cursorElements/utils.js +0 -30
  62. package/dist/theme.js +0 -59
  63. package/dist/timeLineElements/Button.js +0 -101
  64. package/dist/timeLineElements/HistoToolTip.js +0 -78
  65. package/dist/timeLineElements/Histogram.js +0 -110
  66. package/dist/timeLineElements/Legend.js +0 -70
  67. package/dist/timeLineElements/QualityLine.js +0 -81
  68. package/dist/timeLineElements/Tools.js +0 -115
  69. package/dist/timeLineElements/XAxis.js +0 -76
  70. package/dist/timeLineElements/XGrid.js +0 -47
  71. package/dist/timeLineElements/YAxis.js +0 -60
  72. package/dist/timeLineElements/YGrid.js +0 -46
  73. package/dist/timeLineElements/axesStyles.js +0 -57
  74. package/src/TimeLine.jsx +0 -1163
  75. package/src/cursorElements/commonStyles.js +0 -21
package/CHANGELOG.md CHANGED
@@ -1,4 +1,83 @@
1
- ##4.0.0
1
+ ## 5.0.1
2
+
3
+ - Expose the stylesheets through the `exports` map so consumers can
4
+ import them without tripping Node/webpack's ESM resolver:
5
+ - `@spider-analyzer/timeline/timeline.css`
6
+ - `@spider-analyzer/timeline/tipDark.css`
7
+ - `@spider-analyzer/timeline/dist/{timeline,tipDark}.css` (backcompat)
8
+ - Stabilize the emitted CSS filenames (no more content hash) so those
9
+ import paths are durable across builds.
10
+
11
+ ## 5.0.0
12
+
13
+ First v5 release on npm. Major rework focused on decoupling consumers
14
+ from `moment-timezone` / `@material-ui/styles` / `lodash-es`, and
15
+ simplifying the zoom-state API. See `MIGRATION-v5.md` for a
16
+ step-by-step upgrade guide.
17
+
18
+ ### Breaking — public API
19
+
20
+ - **Instants are native `Date` everywhere.** Every prop and callback
21
+ argument that used to be a `moment` object is now a plain `Date`.
22
+ - **Durations are plain numbers (milliseconds).** `biggestVisibleDomain`,
23
+ `biggestTimeSpan`, `smallestResolution` no longer accept
24
+ `moment.Duration`.
25
+ - **`timeZone: string`** (IANA name) is now required. It threads into
26
+ the internal tz-aware time engine so formatting is correct regardless
27
+ of host settings.
28
+ - **`domain` replaces `domains`.** The zoom-history stack is moved
29
+ inside the component. The host passes a single
30
+ `domain: {min, max} | null` and observes changes via
31
+ `onDomainChange(domain)`. Pass `null` on first render to defer to
32
+ `onLoadDefaultDomain()`. Hosts gain **zoom-out-to-previous-view undo
33
+ for free** — the breadcrumb is kept internally.
34
+ - **`onDomainChange(domain)`** replaces `onUpdateDomains(domains)`.
35
+ - **`onTimeSpanChange({start, stop})`** replaces `onCustomRange(start, stop)`.
36
+ - **`onLoadHisto({intervalMs, start, end})`** — object shape (was
37
+ positional args).
38
+ - **`onLoadDefaultDomain(): Domain | Promise<Domain> | void`** — may
39
+ now return the default (sync or async). The component seeds its
40
+ internal stack from the returned value.
41
+ - **`@material-ui/styles` peerDep removed.** The library ships one
42
+ `dist/timeline.css` with rules keyed on `tl-<slot>` class names.
43
+ Consumers override via `classes={{ <slot>: 'my-class' }}` and plain
44
+ CSS in their own stylesheet.
45
+ - **Peer deps slim.** Only React ≥ 16.8 now; no more MUI / moment
46
+ peer-pulls.
47
+
48
+ ### Removed runtime dependencies
49
+
50
+ - `@material-ui/styles` — replaced by static CSS + `classes` prop.
51
+ - `moment-timezone` — replaced internally by Luxon (via a moment-API
52
+ shim, `src/moment-shim.ts`); drops ~300 KB from consumer bundles
53
+ that didn't already use moment.
54
+ - `lodash-es` — replaced by ~50 lines of local helpers in
55
+ `src/utils.ts`.
56
+
57
+ ### Internal
58
+
59
+ - `src/TimeLine.jsx` class component → `src/TimeLine.tsx` function
60
+ component with hooks (`useState` / `useEffect` / `useRef` /
61
+ `useCallback` / `forwardRef` + `useImperativeHandle`). Behavior
62
+ preserved; every prior `componentDidUpdate` branch now lives in a
63
+ focused effect.
64
+ - `src/index.ts` with a full typed public API; tsup emits `.d.ts`
65
+ alongside ESM + CJS.
66
+ - Babel build replaced by tsup (ESM + CJS + `.d.ts` + CSS). ≈85 KB
67
+ ESM; `luxon` is external so consumers dedupe.
68
+ - `src/time.ts` funnels the Date ↔ Luxon conversion at the boundary —
69
+ one file to touch if we ever swap the time engine again.
70
+ - `rc-tooltip` bumped 5 → 6; migrated `visible` → `open`.
71
+ - Vitest + Testing Library regression suite (12 tests).
72
+ - Demo app modernized to Vite + React 18 + luxon; Docker / koa / webpack
73
+ stack removed.
74
+
75
+ ## 4.1.0
76
+ - React 18 / 19 peer support (peerDependency widened to `^16.8.0 || ^17 || ^18 || ^19`; React 15 no longer supported — hooks are required).
77
+ - Fix: replaced `defaultProps` on function components (Cursor, ToolTip, XAxis, YAxis, XGrid, YGrid) with default-parameter destructuring. Removes the React 18.3 deprecation warning and keeps the component working in React 19 where `defaultProps` on function components is removed.
78
+ - Dev: added Vitest + Testing Library regression suite (12 tests covering render, ref API, onLoadHisto/onLoadDefaultDomain/onUpdateDomains contracts, zoomIn/zoomOut stack semantics, shiftTimeLine).
79
+
80
+ ## 4.0.0
2
81
  - Changed to moment-timezone to manage change of default timezone in parent application
3
82
 
4
83
  ## 3.4.0