@spider-analyzer/timeline 4.0.3 → 5.0.0

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 (76) hide show
  1. package/CHANGELOG.md +70 -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-EX2XZ6IP.css +139 -0
  10. package/package.json +48 -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
  76. /package/dist/{tipDark.css → tipDark-BQEJ43KY.css} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,4 +1,73 @@
1
- ##4.0.0
1
+ ## 5.0.0
2
+
3
+ First v5 release on npm. Major rework focused on decoupling consumers
4
+ from `moment-timezone` / `@material-ui/styles` / `lodash-es`, and
5
+ simplifying the zoom-state API. See `MIGRATION-v5.md` for a
6
+ step-by-step upgrade guide.
7
+
8
+ ### Breaking — public API
9
+
10
+ - **Instants are native `Date` everywhere.** Every prop and callback
11
+ argument that used to be a `moment` object is now a plain `Date`.
12
+ - **Durations are plain numbers (milliseconds).** `biggestVisibleDomain`,
13
+ `biggestTimeSpan`, `smallestResolution` no longer accept
14
+ `moment.Duration`.
15
+ - **`timeZone: string`** (IANA name) is now required. It threads into
16
+ the internal tz-aware time engine so formatting is correct regardless
17
+ of host settings.
18
+ - **`domain` replaces `domains`.** The zoom-history stack is moved
19
+ inside the component. The host passes a single
20
+ `domain: {min, max} | null` and observes changes via
21
+ `onDomainChange(domain)`. Pass `null` on first render to defer to
22
+ `onLoadDefaultDomain()`. Hosts gain **zoom-out-to-previous-view undo
23
+ for free** — the breadcrumb is kept internally.
24
+ - **`onDomainChange(domain)`** replaces `onUpdateDomains(domains)`.
25
+ - **`onTimeSpanChange({start, stop})`** replaces `onCustomRange(start, stop)`.
26
+ - **`onLoadHisto({intervalMs, start, end})`** — object shape (was
27
+ positional args).
28
+ - **`onLoadDefaultDomain(): Domain | Promise<Domain> | void`** — may
29
+ now return the default (sync or async). The component seeds its
30
+ internal stack from the returned value.
31
+ - **`@material-ui/styles` peerDep removed.** The library ships one
32
+ `dist/timeline.css` with rules keyed on `tl-<slot>` class names.
33
+ Consumers override via `classes={{ <slot>: 'my-class' }}` and plain
34
+ CSS in their own stylesheet.
35
+ - **Peer deps slim.** Only React ≥ 16.8 now; no more MUI / moment
36
+ peer-pulls.
37
+
38
+ ### Removed runtime dependencies
39
+
40
+ - `@material-ui/styles` — replaced by static CSS + `classes` prop.
41
+ - `moment-timezone` — replaced internally by Luxon (via a moment-API
42
+ shim, `src/moment-shim.ts`); drops ~300 KB from consumer bundles
43
+ that didn't already use moment.
44
+ - `lodash-es` — replaced by ~50 lines of local helpers in
45
+ `src/utils.ts`.
46
+
47
+ ### Internal
48
+
49
+ - `src/TimeLine.jsx` class component → `src/TimeLine.tsx` function
50
+ component with hooks (`useState` / `useEffect` / `useRef` /
51
+ `useCallback` / `forwardRef` + `useImperativeHandle`). Behavior
52
+ preserved; every prior `componentDidUpdate` branch now lives in a
53
+ focused effect.
54
+ - `src/index.ts` with a full typed public API; tsup emits `.d.ts`
55
+ alongside ESM + CJS.
56
+ - Babel build replaced by tsup (ESM + CJS + `.d.ts` + CSS). ≈85 KB
57
+ ESM; `luxon` is external so consumers dedupe.
58
+ - `src/time.ts` funnels the Date ↔ Luxon conversion at the boundary —
59
+ one file to touch if we ever swap the time engine again.
60
+ - `rc-tooltip` bumped 5 → 6; migrated `visible` → `open`.
61
+ - Vitest + Testing Library regression suite (12 tests).
62
+ - Demo app modernized to Vite + React 18 + luxon; Docker / koa / webpack
63
+ stack removed.
64
+
65
+ ## 4.1.0
66
+ - React 18 / 19 peer support (peerDependency widened to `^16.8.0 || ^17 || ^18 || ^19`; React 15 no longer supported — hooks are required).
67
+ - 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.
68
+ - Dev: added Vitest + Testing Library regression suite (12 tests covering render, ref API, onLoadHisto/onLoadDefaultDomain/onUpdateDomains contracts, zoomIn/zoomOut stack semantics, shiftTimeLine).
69
+
70
+ ## 4.0.0
2
71
  - Changed to moment-timezone to manage change of default timezone in parent application
3
72
 
4
73
  ## 3.4.0