@cratis/components 0.1.9 → 0.1.10

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 (101) hide show
  1. package/dist/cjs/PivotViewer/PivotViewer.css +1258 -0
  2. package/dist/cjs/PivotViewer/components/Spinner.css +77 -0
  3. package/dist/cjs/TimeMachine/EventsView.css +213 -0
  4. package/dist/cjs/TimeMachine/TimeMachine.css +567 -0
  5. package/dist/esm/PivotViewer/PivotViewer.css +1258 -0
  6. package/dist/esm/PivotViewer/components/Spinner.css +77 -0
  7. package/dist/esm/TimeMachine/EventsView.css +213 -0
  8. package/dist/esm/TimeMachine/TimeMachine.css +567 -0
  9. package/package.json +3 -4
  10. package/.storybook/main.ts +0 -24
  11. package/CommandDialog/CommandDialog.stories.tsx +0 -25
  12. package/CommandDialog/CommandDialog.tsx +0 -161
  13. package/CommandDialog/index.ts +0 -4
  14. package/CommandForm/CommandForm.stories.tsx +0 -24
  15. package/CommandForm/CommandForm.tsx +0 -266
  16. package/CommandForm/CommandFormField.tsx +0 -27
  17. package/CommandForm/CommandFormFields.tsx +0 -142
  18. package/CommandForm/DatePickerField.tsx +0 -57
  19. package/CommandForm/DropdownField.tsx +0 -65
  20. package/CommandForm/InputTextField.tsx +0 -62
  21. package/CommandForm/SliderField.tsx +0 -68
  22. package/CommandForm/index.ts +0 -10
  23. package/Common/ErrorBoundary.stories.tsx +0 -10
  24. package/Common/ErrorBoundary.tsx +0 -41
  25. package/Common/FormElement.stories.tsx +0 -10
  26. package/Common/FormElement.tsx +0 -20
  27. package/Common/Page.stories.tsx +0 -10
  28. package/Common/Page.tsx +0 -21
  29. package/Common/index.ts +0 -6
  30. package/DataPage/DataPage.stories.tsx +0 -10
  31. package/DataPage/DataPage.tsx +0 -191
  32. package/DataPage/index.ts +0 -4
  33. package/DataTables/DataTableForObservableQuery.stories.tsx +0 -10
  34. package/DataTables/DataTableForObservableQuery.tsx +0 -97
  35. package/DataTables/DataTableForQuery.stories.tsx +0 -10
  36. package/DataTables/DataTableForQuery.tsx +0 -97
  37. package/DataTables/index.ts +0 -5
  38. package/Dialogs/BusyIndicatorDialog.stories.tsx +0 -26
  39. package/Dialogs/BusyIndicatorDialog.tsx +0 -26
  40. package/Dialogs/ConfirmationDialog.stories.tsx +0 -36
  41. package/Dialogs/ConfirmationDialog.tsx +0 -75
  42. package/Dialogs/index.ts +0 -5
  43. package/Dropdown/Dropdown.tsx +0 -23
  44. package/Dropdown/index.ts +0 -4
  45. package/PivotViewer/PivotViewer.stories.tsx +0 -24
  46. package/PivotViewer/PivotViewer.tsx +0 -791
  47. package/PivotViewer/components/AxisLabels.tsx +0 -69
  48. package/PivotViewer/components/DetailPanel.tsx +0 -108
  49. package/PivotViewer/components/FilterPanel.tsx +0 -189
  50. package/PivotViewer/components/FilterPanelContainer.tsx +0 -10
  51. package/PivotViewer/components/PivotCanvas.tsx +0 -660
  52. package/PivotViewer/components/PivotViewerMain.tsx +0 -229
  53. package/PivotViewer/components/RangeHistogramFilter.tsx +0 -220
  54. package/PivotViewer/components/Spinner.tsx +0 -21
  55. package/PivotViewer/components/Toolbar.tsx +0 -130
  56. package/PivotViewer/components/ToolbarContainer.tsx +0 -10
  57. package/PivotViewer/components/index.ts +0 -12
  58. package/PivotViewer/components/pivot/animation.ts +0 -108
  59. package/PivotViewer/components/pivot/buckets.ts +0 -152
  60. package/PivotViewer/components/pivot/colorResolver.ts +0 -67
  61. package/PivotViewer/components/pivot/constants.ts +0 -46
  62. package/PivotViewer/components/pivot/sprites.ts +0 -265
  63. package/PivotViewer/components/pivot/visibility.ts +0 -319
  64. package/PivotViewer/constants.ts +0 -9
  65. package/PivotViewer/engine/layout.ts +0 -149
  66. package/PivotViewer/engine/pivot.worker.ts +0 -86
  67. package/PivotViewer/engine/store.ts +0 -437
  68. package/PivotViewer/engine/types.ts +0 -255
  69. package/PivotViewer/hooks/index.ts +0 -13
  70. package/PivotViewer/hooks/useContainerDimensions.ts +0 -45
  71. package/PivotViewer/hooks/useDimensionState.ts +0 -53
  72. package/PivotViewer/hooks/useFilterOptions.ts +0 -36
  73. package/PivotViewer/hooks/useFilterPanelDrag.ts +0 -49
  74. package/PivotViewer/hooks/useFilterState.ts +0 -106
  75. package/PivotViewer/hooks/useFilteredData.ts +0 -119
  76. package/PivotViewer/hooks/usePanning.ts +0 -163
  77. package/PivotViewer/hooks/usePivotEngine.ts +0 -252
  78. package/PivotViewer/hooks/useSelectedItem.ts +0 -402
  79. package/PivotViewer/hooks/useWheelZoom.ts +0 -114
  80. package/PivotViewer/hooks/useZoomState.ts +0 -34
  81. package/PivotViewer/index.ts +0 -7
  82. package/PivotViewer/types.ts +0 -59
  83. package/PivotViewer/utils/animations.ts +0 -249
  84. package/PivotViewer/utils/constants.ts +0 -20
  85. package/PivotViewer/utils/index.ts +0 -6
  86. package/PivotViewer/utils/selection.ts +0 -292
  87. package/PivotViewer/utils/utils.ts +0 -259
  88. package/TimeMachine/EventsView.stories.tsx +0 -10
  89. package/TimeMachine/EventsView.tsx +0 -119
  90. package/TimeMachine/Properties.stories.tsx +0 -10
  91. package/TimeMachine/Properties.tsx +0 -98
  92. package/TimeMachine/ReadModelView.stories.tsx +0 -10
  93. package/TimeMachine/ReadModelView.tsx +0 -143
  94. package/TimeMachine/TimeMachine.stories.tsx +0 -10
  95. package/TimeMachine/TimeMachine.tsx +0 -244
  96. package/TimeMachine/index.ts +0 -8
  97. package/TimeMachine/types.ts +0 -23
  98. package/global.d.ts +0 -11
  99. package/index.ts +0 -22
  100. package/useOverlayZIndex.ts +0 -32
  101. package/vite.config.ts +0 -80
@@ -1,98 +0,0 @@
1
- // Copyright (c) Cratis. All rights reserved.
2
- // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
-
4
- import React from 'react';
5
-
6
- interface PropertiesProps {
7
- data: Record<string, unknown>;
8
- /** CSS class name for the container */
9
- className?: string;
10
- /** Text alignment for the table */
11
- align?: 'left' | 'right';
12
- }
13
-
14
- export const Properties: React.FC<PropertiesProps> = ({ data, className, align = 'left' }) => {
15
- const tableStyle: React.CSSProperties = {
16
- width: '100%',
17
- borderCollapse: 'collapse',
18
- fontFamily: '-apple-system, BlinkMacSystemFont, "SF Mono", monospace',
19
- fontSize: '13px',
20
- };
21
-
22
- const rowStyle: React.CSSProperties = {
23
- borderBottom: '1px solid rgba(255,255,255,0.1)',
24
- };
25
-
26
- const labelStyle: React.CSSProperties = {
27
- padding: '8px 12px',
28
- color: 'rgba(255,255,255,0.6)',
29
- textAlign: align,
30
- fontWeight: 500,
31
- width: '40%',
32
- };
33
-
34
- const valueStyle: React.CSSProperties = {
35
- padding: '8px 12px',
36
- color: '#fff',
37
- textAlign: align,
38
- };
39
-
40
- const renderValue = (value: unknown): React.ReactNode => {
41
- if (value === null || value === undefined) {
42
- return <span style={{ color: 'rgba(255,255,255,0.4)' }}>null</span>;
43
- }
44
-
45
- if (typeof value === 'boolean') {
46
- return <span style={{ color: value ? '#4ade80' : '#f87171' }}>{value.toString()}</span>;
47
- }
48
-
49
- if (typeof value === 'number') {
50
- return <span style={{ color: '#fbbf24' }}>{value}</span>;
51
- }
52
-
53
- if (value instanceof Date) {
54
- return <span style={{ color: '#60a5fa' }}>{value.toLocaleString()}</span>;
55
- }
56
-
57
- if (Array.isArray(value)) {
58
- return (
59
- <span style={{ color: 'rgba(255,255,255,0.7)' }}>
60
- Array[{value.length}]
61
- </span>
62
- );
63
- }
64
-
65
- if (typeof value === 'object') {
66
- return (
67
- <span style={{ color: 'rgba(255,255,255,0.7)' }}>
68
- {'{'}...{'}'}
69
- </span>
70
- );
71
- }
72
-
73
- return <span>{String(value)}</span>;
74
- };
75
-
76
- const formatPropertyName = (key: string): string => {
77
- // Convert camelCase to Title Case with spaces
78
- return key
79
- .replace(/([A-Z])/g, ' $1')
80
- .replace(/^./, str => str.toUpperCase())
81
- .trim();
82
- };
83
-
84
- return (
85
- <div className={className}>
86
- <table style={tableStyle}>
87
- <tbody>
88
- {data && Object.entries(data).map(([key, value], index) => (
89
- <tr key={`${key}-${index}`} style={rowStyle}>
90
- <td style={labelStyle}>{formatPropertyName(key)}</td>
91
- <td style={valueStyle}>{renderValue(value)}</td>
92
- </tr>
93
- ))}
94
- </tbody>
95
- </table>
96
- </div>
97
- );
98
- };
@@ -1,10 +0,0 @@
1
- // Copyright (c) Cratis. All rights reserved.
2
- // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
-
4
- import React from 'react';
5
- import * as Comp from './ReadModelView';
6
- const Component: React.ComponentType<any> | undefined = (Comp as any).default || (Object.values(Comp)[0] as any);
7
-
8
- export default { title: 'TimeMachine/ReadModelView', component: Component };
9
-
10
- export const Default = () => (Component ? <Component /> : <div>Unable to render component</div>);
@@ -1,143 +0,0 @@
1
- // Copyright (c) Cratis. All rights reserved.
2
- // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
-
4
- import React, { useState } from 'react';
5
- import type { Version } from './types';
6
- import { Properties } from './Properties';
7
-
8
- interface ReadModelViewProps {
9
- versions: Version[];
10
- selectedIndex: number;
11
- hoveredIndex: number | null;
12
- onVersionSelect: (index: number) => void;
13
- onHoveringCardChange: (isHovering: boolean) => void;
14
- }
15
-
16
- export const ReadModelView: React.FC<ReadModelViewProps> = ({
17
- versions,
18
- selectedIndex,
19
- hoveredIndex,
20
- onVersionSelect,
21
- onHoveringCardChange,
22
- }) => {
23
- const displayIndex = hoveredIndex ?? selectedIndex;
24
- const [flippedMap, setFlippedMap] = useState<Record<string, boolean>>({});
25
-
26
- const toggleFlip = (id: string) => (event: React.MouseEvent<HTMLButtonElement>) => {
27
- event.stopPropagation();
28
- setFlippedMap(previous => ({
29
- ...previous,
30
- [id]: !previous[id]
31
- }));
32
- };
33
-
34
- return (
35
- <>
36
- {/* Starfield background */}
37
- <div className="time-machine-background">
38
- <div className="stars"></div>
39
- <div className="stars stars-2"></div>
40
- <div className="stars stars-3"></div>
41
- </div>
42
-
43
- {/* 3D Stacked Windows */}
44
- <div className="time-machine-viewport">
45
- <div className="windows-container">
46
- {versions.map((version, index) => {
47
- const depth = index - displayIndex;
48
- const isActive = index === displayIndex;
49
- const isVisible = depth >= 0 && depth < 10;
50
- const isFlipped = flippedMap[version.id] ?? false;
51
-
52
- if (!isVisible) return null;
53
-
54
- // Only prepare events for the active version to avoid showing all events at once
55
- const events = isActive && version.events?.length
56
- ? version.events.map(event => ({
57
- ...event,
58
- occurred: new Date(event.occurred)
59
- }))
60
- : [];
61
-
62
- return (
63
- <div
64
- key={version.id}
65
- className={`version-window ${isActive ? 'active' : ''} ${isFlipped ? 'flipped' : ''}`}
66
- style={{
67
- '--depth': depth,
68
- '--z-offset': -depth * 150,
69
- '--scale': 1 - depth * 0.05,
70
- '--opacity': 1 - depth * 0.12,
71
- } as React.CSSProperties}
72
- onClick={() => onVersionSelect(index)}
73
- onMouseEnter={() => onHoveringCardChange(true)}
74
- onMouseLeave={() => onHoveringCardChange(false)}
75
- >
76
- <div className="version-window-inner">
77
- <div className="version-window-face version-window-face--front">
78
- <div className="window-chrome">
79
- <div className="window-controls">
80
- <span className="control close"></span>
81
- <span className="control minimize"></span>
82
- <span className="control maximize"></span>
83
- </div>
84
- <div className="window-title">{version.label}</div>
85
- <div className="window-actions">
86
- <button
87
- type="button"
88
- className="window-flip-button"
89
- onClick={toggleFlip(version.id)}
90
- aria-label="Show related events"
91
- aria-pressed={isFlipped}
92
- >
93
- <i className={`pi ${isFlipped ? 'pi-undo' : 'pi-refresh'}`} />
94
- </button>
95
- </div>
96
- </div>
97
- <div className="window-content">
98
- {version.content}
99
- </div>
100
- </div>
101
- <div className="version-window-face version-window-face--back">
102
- <div className="window-chrome window-chrome--back">
103
- <div className="window-controls">
104
- <span className="control close"></span>
105
- <span className="control minimize"></span>
106
- <span className="control maximize"></span>
107
- </div>
108
- <div className="window-title">Related Events</div>
109
- <div className="window-actions">
110
- <button
111
- type="button"
112
- className="window-flip-button"
113
- onClick={toggleFlip(version.id)}
114
- aria-label="Show read model snapshot"
115
- aria-pressed={isFlipped}
116
- >
117
- <i className={`pi ${isFlipped ? 'pi-undo' : 'pi-refresh'}`} />
118
- </button>
119
- </div>
120
- </div>
121
- <div className="window-content window-content--events">
122
- <div className="snapshot-event-list">
123
- {events.map((event, eventIndex) => (
124
- <div key={`${version.id}-${event.sequenceNumber ?? eventIndex}`} className="snapshot-event">
125
- <div className="snapshot-event-header">
126
- <span className="snapshot-event-name">{event.type}</span>
127
- <span className="snapshot-event-timestamp">{event.occurred.toLocaleString()}</span>
128
- </div>
129
- <Properties data={event.content} align="left" />
130
- </div>
131
- ))}
132
- </div>
133
- </div>
134
- </div>
135
- </div>
136
- </div>
137
- );
138
- })}
139
- </div>
140
- </div>
141
- </>
142
- );
143
- };
@@ -1,10 +0,0 @@
1
- // Copyright (c) Cratis. All rights reserved.
2
- // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
-
4
- import React from 'react';
5
- import * as Comp from './TimeMachine';
6
- const Component: React.ComponentType<any> | undefined = (Comp as any).default || (Object.values(Comp)[0] as any);
7
-
8
- export default { title: 'TimeMachine/TimeMachine', component: Component };
9
-
10
- export const Default = () => (Component ? <Component /> : <div>Unable to render component</div>);
@@ -1,244 +0,0 @@
1
- // Copyright (c) Cratis. All rights reserved.
2
- // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
-
4
- import React, { useState, useCallback, useRef, useEffect } from 'react';
5
- import type { Version } from './types';
6
- import { ReadModelView } from './ReadModelView';
7
- import { EventsView } from './EventsView';
8
- import './TimeMachine.css';
9
-
10
- type ViewMode = 'readmodel' | 'events';
11
-
12
- interface TimeMachineProps {
13
- versions: Version[];
14
- currentVersionIndex?: number;
15
- onVersionChange?: (index: number) => void;
16
- /** Scroll sensitivity - higher values require more scrolling to change versions */
17
- scrollSensitivity?: number;
18
- }
19
-
20
- export const TimeMachine: React.FC<TimeMachineProps> = ({
21
- versions,
22
- currentVersionIndex = 0,
23
- onVersionChange,
24
- scrollSensitivity = 50,
25
- }) => {
26
- const [selectedIndex, setSelectedIndex] = useState(currentVersionIndex);
27
- const [hoveredIndex, setHoveredIndex] = useState<number | null>(null);
28
- const [isHoveringCard, setIsHoveringCard] = useState(false);
29
- const [viewMode, setViewMode] = useState<ViewMode>('readmodel');
30
- const containerRef = useRef<HTMLDivElement>(null);
31
- const scrollAccumulatorRef = useRef(0);
32
-
33
- const handleVersionSelect = useCallback((index: number) => {
34
- setSelectedIndex(index);
35
- onVersionChange?.(index);
36
- }, [onVersionChange]);
37
-
38
- const handleTimelineHover = useCallback((index: number | null) => {
39
- setHoveredIndex(index);
40
- }, []);
41
-
42
- // Handle trackpad two-finger scroll gesture
43
- useEffect(() => {
44
- if (viewMode !== 'readmodel') {
45
- return;
46
- }
47
-
48
- const container = containerRef.current;
49
- if (!container) return;
50
-
51
- const handleWheel = (e: WheelEvent) => {
52
- // Only handle navigation when not hovering over a card
53
- if (isHoveringCard) {
54
- return; // Allow normal scrolling within cards
55
- }
56
-
57
- // Prevent default scrolling behavior
58
- e.preventDefault();
59
-
60
- // Use deltaX for horizontal scroll, fallback to deltaY for vertical
61
- // Most trackpads send horizontal delta for two-finger swipe
62
- const delta = Math.abs(e.deltaX) > Math.abs(e.deltaY) ? e.deltaX : e.deltaY;
63
-
64
- // Accumulate scroll delta
65
- scrollAccumulatorRef.current += delta;
66
-
67
- // Check if we've accumulated enough scroll to change version
68
- if (Math.abs(scrollAccumulatorRef.current) >= scrollSensitivity) {
69
- const direction = scrollAccumulatorRef.current > 0 ? 1 : -1;
70
- const newIndex = Math.max(0, Math.min(versions.length - 1, selectedIndex + direction));
71
-
72
- if (newIndex !== selectedIndex) {
73
- setSelectedIndex(newIndex);
74
- onVersionChange?.(newIndex);
75
- }
76
-
77
- // Reset accumulator after version change
78
- scrollAccumulatorRef.current = 0;
79
- }
80
- };
81
-
82
- container.addEventListener('wheel', handleWheel, { passive: false });
83
-
84
- return () => {
85
- container.removeEventListener('wheel', handleWheel);
86
- };
87
- }, [versions.length, selectedIndex, onVersionChange, scrollSensitivity, isHoveringCard, viewMode]);
88
-
89
- // Calculate the display index - either hovered or selected
90
- // (not used in this component; ReadModelView computes its own display index)
91
- void hoveredIndex;
92
- void selectedIndex;
93
-
94
- // Get all events from all versions
95
- const allEvents = versions.flatMap(version => version.events || []);
96
-
97
- return (
98
- <div className="time-machine" ref={containerRef}>
99
- {/* View Switcher */}
100
- <div className="view-switcher">
101
- <button
102
- className={`view-button ${viewMode === 'readmodel' ? 'active' : ''}`}
103
- onClick={() => setViewMode('readmodel')}
104
- aria-label="Read Model View"
105
- title="Read Model View"
106
- >
107
- <i className="pi pi-box" />
108
- </button>
109
- <button
110
- className={`view-button ${viewMode === 'events' ? 'active' : ''}`}
111
- onClick={() => setViewMode('events')}
112
- aria-label="Events View"
113
- title="Events View"
114
- >
115
- <i className="pi pi-list" />
116
- </button>
117
- </div>
118
-
119
- {/* Render the appropriate view */}
120
- {viewMode === 'readmodel' ? (
121
- <ReadModelView
122
- versions={versions}
123
- selectedIndex={selectedIndex}
124
- hoveredIndex={hoveredIndex}
125
- onVersionSelect={handleVersionSelect}
126
- onHoveringCardChange={setIsHoveringCard}
127
- />
128
- ) : (
129
- <EventsView events={allEvents} />
130
- )}
131
-
132
- {/* Timeline - only show in ReadModel view */}
133
- {viewMode === 'readmodel' && (
134
- <Timeline
135
- versions={versions}
136
- selectedIndex={selectedIndex}
137
- hoveredIndex={hoveredIndex}
138
- onSelect={handleVersionSelect}
139
- onHover={handleTimelineHover}
140
- />
141
- )}
142
-
143
- {/* Navigation arrows - only show in ReadModel view */}
144
- {viewMode === 'readmodel' && (
145
- <div className="navigation-controls">
146
- <button
147
- className="nav-button prev"
148
- disabled={selectedIndex === 0}
149
- onClick={() => handleVersionSelect(Math.max(0, selectedIndex - 1))}
150
- aria-label="Previous version"
151
- >
152
-
153
- </button>
154
- <button
155
- className="nav-button next"
156
- disabled={selectedIndex === versions.length - 1}
157
- onClick={() => handleVersionSelect(Math.min(versions.length - 1, selectedIndex + 1))}
158
- aria-label="Next version"
159
- >
160
-
161
- </button>
162
- </div>
163
- )}
164
- </div>
165
- );
166
- };
167
-
168
- interface TimelineProps {
169
- versions: Version[];
170
- selectedIndex: number;
171
- hoveredIndex: number | null;
172
- onSelect: (index: number) => void;
173
- onHover: (index: number | null) => void;
174
- }
175
-
176
- const Timeline: React.FC<TimelineProps> = ({
177
- versions,
178
- selectedIndex,
179
- hoveredIndex,
180
- onSelect,
181
- onHover,
182
- }) => {
183
- const getMagnification = (index: number, hoverIdx: number | null): number => {
184
- if (hoverIdx === null) return 1;
185
- const distance = Math.abs(index - hoverIdx);
186
- // Fish-eye effect: items close to hover get magnified
187
- if (distance === 0) return 2.0;
188
- if (distance === 1) return 1.6;
189
- if (distance === 2) return 1.3;
190
- if (distance === 3) return 1.1;
191
- return 1;
192
- };
193
-
194
- const formatDate = (date: Date): string => {
195
- return date.toLocaleDateString('en-US', {
196
- month: 'short',
197
- day: 'numeric',
198
- year: 'numeric',
199
- });
200
- };
201
-
202
- const formatTime = (date: Date): string => {
203
- return date.toLocaleTimeString('en-US', {
204
- hour: 'numeric',
205
- minute: '2-digit',
206
- hour12: true,
207
- });
208
- };
209
-
210
- return (
211
- <div
212
- className="timeline"
213
- onMouseLeave={() => onHover(null)}
214
- >
215
- <div className="timeline-track">
216
- {versions.map((version, index) => {
217
- const magnification = getMagnification(index, hoveredIndex);
218
- const isSelected = index === selectedIndex;
219
- const isHovered = index === hoveredIndex;
220
-
221
- return (
222
- <div
223
- key={version.id}
224
- className={`timeline-entry ${isSelected ? 'selected' : ''} ${isHovered ? 'hovered' : ''}`}
225
- style={{
226
- '--magnification': magnification,
227
- } as React.CSSProperties}
228
- onMouseEnter={() => onHover(index)}
229
- onClick={() => onSelect(index)}
230
- >
231
- <div className="timeline-tick"></div>
232
- <div className="timeline-label">
233
- <span className="timeline-date">{formatDate(version.timestamp)}</span>
234
- <span className="timeline-time">{formatTime(version.timestamp)}</span>
235
- </div>
236
- </div>
237
- );
238
- })}
239
- </div>
240
- </div>
241
- );
242
- };
243
-
244
- export default TimeMachine;
@@ -1,8 +0,0 @@
1
- // Copyright (c) Cratis. All rights reserved.
2
- // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
-
4
- export { TimeMachine } from './TimeMachine';
5
- export { ReadModelView } from './ReadModelView';
6
- export { EventsView } from './EventsView';
7
- export { Properties } from './Properties';
8
- export * from './types';
@@ -1,23 +0,0 @@
1
- // Copyright (c) Cratis. All rights reserved.
2
- // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
-
4
- export interface Version {
5
- id: string;
6
- timestamp: Date;
7
- label: string;
8
- content: React.ReactNode;
9
- events?: Event[];
10
- }
11
-
12
- export interface Event {
13
- sequenceNumber: number;
14
- type: string;
15
- occurred: Date;
16
- content: Record<string, unknown>;
17
- }
18
-
19
- export interface TimelineEntry {
20
- id: string;
21
- timestamp: Date;
22
- label: string;
23
- }
package/global.d.ts DELETED
@@ -1,11 +0,0 @@
1
- // Copyright (c) Cratis. All rights reserved.
2
- // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
-
4
- import * as React from 'react';
5
-
6
- declare global {
7
- namespace JSX {
8
- interface Element extends React.ReactElement {}
9
- // Add additional JSX-related overrides if necessary.
10
- }
11
- }
package/index.ts DELETED
@@ -1,22 +0,0 @@
1
- // Copyright (c) Cratis. All rights reserved.
2
- // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
-
4
- import * as CommandDialog from './CommandDialog';
5
- import * as CommandForm from './CommandForm';
6
- import * as DataPage from './DataPage';
7
- import * as dataTables from './DataTables';
8
- import * as dialogs from './Dialogs';
9
- import * as Dropdown from './Dropdown';
10
- import * as PivotViewer from './PivotViewer';
11
- import * as TimeMachine from './TimeMachine';
12
-
13
- export {
14
- CommandDialog,
15
- CommandForm,
16
- DataPage,
17
- dataTables,
18
- dialogs,
19
- Dropdown,
20
- PivotViewer,
21
- TimeMachine,
22
- };
@@ -1,32 +0,0 @@
1
- // Copyright (c) Cratis. All rights reserved.
2
- // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
-
4
- import { useEffect } from 'react';
5
-
6
- /**
7
- * Hook to force a specific z-index on PrimeReact overlay components.
8
- * This is a workaround for PrimeReact's automatic z-index calculation
9
- * which can cause overlays to appear behind dialogs.
10
- *
11
- * @param className - The CSS class name to target (e.g., 'location-autocomplete-overlay')
12
- * @param zIndex - The desired z-index value (default: 10000)
13
- */
14
- export function useOverlayZIndex(className: string, zIndex: number = 10000): void {
15
- useEffect(() => {
16
- const observer = new MutationObserver(() => {
17
- const panel = document.querySelector(`.${className}`);
18
- if (panel instanceof HTMLElement && panel.style.zIndex !== zIndex.toString()) {
19
- panel.style.zIndex = zIndex.toString();
20
- }
21
- });
22
-
23
- observer.observe(document.body, {
24
- childList: true,
25
- subtree: true,
26
- attributes: true,
27
- attributeFilter: ['style']
28
- });
29
-
30
- return () => observer.disconnect();
31
- }, [className, zIndex]);
32
- }