react-timelane 0.0.0 → 0.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 (110) hide show
  1. package/dist/components/TimelineAside.d.ts +13 -0
  2. package/dist/components/TimelineBackground.d.ts +5 -0
  3. package/dist/components/TimelineBody.d.ts +13 -0
  4. package/dist/components/TimelineHeader/DaysHeader.d.ts +15 -0
  5. package/dist/components/TimelineHeader/MonthsHeader.d.ts +15 -0
  6. package/dist/components/TimelineHeader/TimelineHeader.d.ts +24 -0
  7. package/dist/components/TimelineHeader/WeeksHeader.d.ts +15 -0
  8. package/dist/components/TimelineHeader/index.d.ts +5 -0
  9. package/dist/components/TimelineHeader/renderingUtils.d.ts +4 -0
  10. package/dist/components/TimelineSelectionLayer.d.ts +6 -0
  11. package/dist/components/TimelineSettingsContext.d.ts +7 -0
  12. package/dist/components/TimelineSettingsProvider.d.ts +7 -0
  13. package/dist/components/TimelineWrapper.d.ts +17 -0
  14. package/dist/components/core/CoreItem/CoreItemComponent.d.ts +14 -0
  15. package/dist/components/core/CoreItem/DragResizeComponent.d.ts +20 -0
  16. package/dist/components/core/CoreSwimlane/AvailableSpaceIndicator.d.ts +21 -0
  17. package/dist/components/core/CoreSwimlane/CoreSwimlane.d.ts +16 -0
  18. package/dist/components/core/CoreSwimlane/DropPreview.d.ts +9 -0
  19. package/dist/components/core/CoreSwimlane/DropTarget.d.ts +11 -0
  20. package/dist/components/core/CoreSwimlane/OverlapIndicator.d.ts +6 -0
  21. package/dist/components/core/CoreSwimlane/utils.d.ts +13 -0
  22. package/dist/components/core/utils.d.ts +15 -0
  23. package/dist/components/layout/TimelineLayout.d.ts +23 -0
  24. package/dist/hooks/useScroll.d.ts +10 -0
  25. package/dist/hooks/useTimelineContext.d.ts +1 -0
  26. package/dist/index.d.ts +13 -0
  27. package/dist/react-timelane.css +1 -0
  28. package/dist/react-timelane.js +4744 -0
  29. package/dist/types/AvailableSpace.d.ts +6 -0
  30. package/dist/types/CoreItem.d.ts +12 -0
  31. package/dist/types/DateBounds.d.ts +4 -0
  32. package/dist/types/Dimensions.d.ts +4 -0
  33. package/dist/types/GrabInfo.d.ts +5 -0
  34. package/dist/types/Grid.d.ts +6 -0
  35. package/dist/types/OffsetBounds.d.ts +4 -0
  36. package/dist/types/Pixels.d.ts +4 -0
  37. package/{src/types/Position.ts → dist/types/Position.d.ts} +2 -2
  38. package/dist/types/Rectangle.d.ts +6 -0
  39. package/dist/types/SwimlaneT.d.ts +5 -0
  40. package/dist/types/TimeRange.d.ts +4 -0
  41. package/dist/types/TimelineSettings.d.ts +11 -0
  42. package/dist/types/index.d.ts +15 -0
  43. package/package.json +1 -1
  44. package/vite.config.ts +1 -1
  45. package/.github/workflows/static.yml +0 -55
  46. package/docs/README.md +0 -54
  47. package/docs/eslint.config.js +0 -28
  48. package/docs/index.html +0 -12
  49. package/docs/package-lock.json +0 -5101
  50. package/docs/package.json +0 -35
  51. package/docs/src/App.css +0 -5
  52. package/docs/src/App.tsx +0 -59
  53. package/docs/src/assets/react.svg +0 -1
  54. package/docs/src/components/AllocationComponent.tsx +0 -82
  55. package/docs/src/components/Timeline.tsx +0 -183
  56. package/docs/src/constants.ts +0 -42
  57. package/docs/src/hooks/useLocalStorage.ts +0 -21
  58. package/docs/src/main.tsx +0 -9
  59. package/docs/src/models/Allocation.ts +0 -11
  60. package/docs/src/models/AllocationId.ts +0 -1
  61. package/docs/src/models/Resource.ts +0 -8
  62. package/docs/src/models/ResourceId.ts +0 -1
  63. package/docs/src/vite-env.d.ts +0 -1
  64. package/docs/tsconfig.json +0 -27
  65. package/docs/vite.config.ts +0 -8
  66. package/src/components/Timeline.scss +0 -297
  67. package/src/components/TimelineAside.tsx +0 -81
  68. package/src/components/TimelineBackground.tsx +0 -53
  69. package/src/components/TimelineBody.tsx +0 -54
  70. package/src/components/TimelineHeader/DaysHeader.tsx +0 -44
  71. package/src/components/TimelineHeader/MonthsHeader.tsx +0 -62
  72. package/src/components/TimelineHeader/TimelineHeader.tsx +0 -64
  73. package/src/components/TimelineHeader/WeeksHeader.tsx +0 -63
  74. package/src/components/TimelineHeader/index.ts +0 -9
  75. package/src/components/TimelineHeader/renderingUtils.tsx +0 -57
  76. package/src/components/TimelineSelectionLayer.tsx +0 -179
  77. package/src/components/TimelineSettingsContext.tsx +0 -27
  78. package/src/components/TimelineSettingsProvider.tsx +0 -24
  79. package/src/components/TimelineWrapper.tsx +0 -51
  80. package/src/components/core/CoreItem/CoreItemComponent.tsx +0 -69
  81. package/src/components/core/CoreItem/DragResizeComponent.tsx +0 -180
  82. package/src/components/core/CoreSwimlane/AvailableSpaceIndicator.tsx +0 -156
  83. package/src/components/core/CoreSwimlane/CoreSwimlane.tsx +0 -245
  84. package/src/components/core/CoreSwimlane/DropPreview.tsx +0 -30
  85. package/src/components/core/CoreSwimlane/DropTarget.tsx +0 -83
  86. package/src/components/core/CoreSwimlane/OverlapIndicator.tsx +0 -22
  87. package/src/components/core/CoreSwimlane/utils.ts +0 -375
  88. package/src/components/core/utils.ts +0 -154
  89. package/src/components/layout/TimelineLayout.tsx +0 -93
  90. package/src/components/layout/layout.scss +0 -107
  91. package/src/global.d.ts +0 -9
  92. package/src/hooks/useScroll.tsx +0 -71
  93. package/src/hooks/useTimelineContext.tsx +0 -6
  94. package/src/index.ts +0 -15
  95. package/src/types/AvailableSpace.ts +0 -6
  96. package/src/types/CoreItem.ts +0 -23
  97. package/src/types/DateBounds.ts +0 -4
  98. package/src/types/Dimensions.ts +0 -4
  99. package/src/types/GrabInfo.ts +0 -6
  100. package/src/types/Grid.ts +0 -6
  101. package/src/types/OffsetBounds.ts +0 -4
  102. package/src/types/Pixels.ts +0 -4
  103. package/src/types/Rectangle.ts +0 -6
  104. package/src/types/SwimlaneT.ts +0 -6
  105. package/src/types/TimeRange.ts +0 -4
  106. package/src/types/TimelineSettings.ts +0 -11
  107. package/src/types/index.ts +0 -15
  108. package/tsconfig.json +0 -32
  109. /package/{src/types/ItemId.ts → dist/types/ItemId.d.ts} +0 -0
  110. /package/{src/types/SwimlaneId.ts → dist/types/SwimlaneId.d.ts} +0 -0
package/src/global.d.ts DELETED
@@ -1,9 +0,0 @@
1
- declare module "*.scss" {
2
- const content: Record<string, string>;
3
- export default content;
4
- }
5
-
6
- declare module "*.css" {
7
- const content: Record<string, string>;
8
- export default content;
9
- }
@@ -1,71 +0,0 @@
1
- import { ItemId, SwimlaneId } from "../types";
2
- import { useTimelineContext } from "./useTimelineContext";
3
- import { dateToPixel } from "../components/core/utils";
4
-
5
- export const useScroll = () => {
6
- const { settings } = useTimelineContext();
7
-
8
- function scrollTo(destination: { horz?: Date; vert?: SwimlaneId } | ItemId) {
9
- if (destination instanceof Object) {
10
- if (destination.horz !== undefined) {
11
- scrollToDate(destination.horz);
12
- }
13
-
14
- if (destination.vert !== undefined) {
15
- scrollToLane(destination.vert);
16
- }
17
- } else {
18
- scrollToItem(destination);
19
- }
20
- }
21
-
22
- function scrollToDate(date: Date) {
23
- window.requestAnimationFrame(() => {
24
- const el: HTMLElement | null = document.getElementById(
25
- "timeline-background-date-anchor"
26
- );
27
-
28
- if (el) {
29
- const offsetLeft: number = dateToPixel(date, settings.start, settings);
30
-
31
- el.style.setProperty("left", `${offsetLeft}px`);
32
-
33
- el.scrollIntoView({
34
- block: "nearest",
35
- inline: "center",
36
- behavior: "smooth",
37
- });
38
- }
39
- });
40
- }
41
-
42
- function scrollToLane(laneId: SwimlaneId) {
43
- window.requestAnimationFrame(() => {
44
- const el: HTMLElement | null = document.getElementById(
45
- `timeline-swimlane-${laneId}`
46
- );
47
-
48
- if (el) {
49
- el.scrollIntoView({ block: "center", behavior: "smooth" });
50
- }
51
- });
52
- }
53
-
54
- function scrollToItem(itemId: ItemId) {
55
- window.requestAnimationFrame(() => {
56
- const el: HTMLElement | null = document.getElementById(
57
- `timeline-item-${itemId}`
58
- );
59
-
60
- if (el) {
61
- el.scrollIntoView({
62
- block: "center",
63
- inline: "center",
64
- behavior: "smooth",
65
- });
66
- }
67
- });
68
- }
69
-
70
- return { scrollTo, scrollToDate, scrollToItem, scrollToLane };
71
- };
@@ -1,6 +0,0 @@
1
- import { useContext } from "react";
2
- import { TimelineSettingsContext } from "../components/TimelineSettingsContext";
3
-
4
- export const useTimelineContext = () => {
5
- return useContext(TimelineSettingsContext);
6
- };
package/src/index.ts DELETED
@@ -1,15 +0,0 @@
1
- export { default as TimelineLayout } from "./components/layout/TimelineLayout";
2
- export { default as TimelineAside } from "./components/TimelineAside";
3
- export { default as TimelineBackground } from "./components/TimelineBackground";
4
- export * from "./components/TimelineHeader";
5
- export { default as TimelineWrapper } from "./components/TimelineWrapper";
6
- export { default as CoreSwimlane } from "./components/core/CoreSwimlane/CoreSwimlane";
7
- export { TimelineBody } from "./components/TimelineBody";
8
- export { TimelineSelectionLayer } from "./components/TimelineSelectionLayer";
9
-
10
- export * from "./types";
11
- export * from "./components/core/utils";
12
- export * from "./components/core/CoreSwimlane/utils";
13
-
14
- export { useScroll } from "./hooks/useScroll";
15
- export { useTimelineContext } from "./hooks/useTimelineContext";
@@ -1,6 +0,0 @@
1
- export interface AvailableSpace {
2
- start: Date;
3
- end: Date;
4
- minOffset: number;
5
- maxOffset: number;
6
- }
@@ -1,23 +0,0 @@
1
- import { ItemId } from "./ItemId";
2
- import { SwimlaneId } from "./SwimlaneId";
3
-
4
- export type CoreItem<T = void> = {
5
- id: ItemId;
6
- swimlaneId: SwimlaneId;
7
- start: Date;
8
- end: Date;
9
- size: number;
10
- offset: number;
11
- payload: T;
12
- };
13
-
14
- export function isCoreItem(a: object): a is CoreItem {
15
- return (
16
- "id" in a &&
17
- "swimlaneId" in a &&
18
- "start" in a &&
19
- "end" in a &&
20
- "size" in a &&
21
- "offset" in a
22
- );
23
- }
@@ -1,4 +0,0 @@
1
- export interface DateBounds {
2
- lower: Date;
3
- upper: Date;
4
- }
@@ -1,4 +0,0 @@
1
- export interface Dimensions {
2
- width: number;
3
- height: number;
4
- }
@@ -1,6 +0,0 @@
1
- import { Position } from "./Position";
2
-
3
- export interface GrabInfo {
4
- absolute: Position;
5
- relative: Position;
6
- }
package/src/types/Grid.ts DELETED
@@ -1,6 +0,0 @@
1
- export interface Grid {
2
- x?: number;
3
- y?: number;
4
- offsetX?: number;
5
- offsetY?: number;
6
- }
@@ -1,4 +0,0 @@
1
- export interface OffsetBounds {
2
- lower: number;
3
- upper: number;
4
- }
@@ -1,4 +0,0 @@
1
- export interface Pixels {
2
- pixelsPerDay: number;
3
- pixelsPerResource: number;
4
- }
@@ -1,6 +0,0 @@
1
- export interface Rectangle {
2
- x: number;
3
- y: number;
4
- width: number;
5
- height: number;
6
- }
@@ -1,6 +0,0 @@
1
- import { SwimlaneId } from "./SwimlaneId";
2
-
3
- export interface SwimlaneT {
4
- id: SwimlaneId;
5
- capacity: number;
6
- }
@@ -1,4 +0,0 @@
1
- export interface TimeRange {
2
- start: Date;
3
- end: Date;
4
- }
@@ -1,11 +0,0 @@
1
- export interface TimelineSettings {
2
- start: Date;
3
- end: Date;
4
- pixelsPerDay: number;
5
- pixelsPerResource: number;
6
- showMonths: boolean;
7
- showWeeks: boolean;
8
- showDays: boolean;
9
- allowOverlaps: boolean;
10
- focusedDate: Date | null;
11
- }
@@ -1,15 +0,0 @@
1
- export { type TimeRange } from "./TimeRange";
2
- export { type Pixels } from "./Pixels";
3
- export { type Rectangle } from "./Rectangle";
4
- export { type Position } from "./Position";
5
- export { type Grid } from "./Grid";
6
- export { type ItemId } from "./ItemId";
7
- export { type AvailableSpace } from "./AvailableSpace";
8
- export { type CoreItem, isCoreItem } from "./CoreItem";
9
- export { type Dimensions } from "./Dimensions";
10
- export { type GrabInfo } from "./GrabInfo";
11
- export { type SwimlaneId } from "./SwimlaneId";
12
- export { type SwimlaneT } from "./SwimlaneT";
13
- export { type DateBounds } from "./DateBounds";
14
- export { type OffsetBounds } from "./OffsetBounds";
15
- export { type TimelineSettings } from "./TimelineSettings";
package/tsconfig.json DELETED
@@ -1,32 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
4
- "target": "ES2020",
5
- "useDefineForClassFields": true,
6
- "lib": ["ES2020", "DOM", "DOM.Iterable"],
7
- "module": "ESNext",
8
- "skipLibCheck": true,
9
-
10
- /* Bundler mode */
11
- "moduleResolution": "bundler",
12
- "allowImportingTsExtensions": true,
13
- "verbatimModuleSyntax": false,
14
- "moduleDetection": "force",
15
- "noEmit": true,
16
- "jsx": "react-jsx",
17
- "allowSyntheticDefaultImports": true,
18
- "allowArbitraryExtensions": true,
19
- "allowJs": true,
20
- "isolatedModules": true,
21
-
22
- /* Linting */
23
- "strict": true,
24
- "noUnusedLocals": true,
25
- "noUnusedParameters": false,
26
- "erasableSyntaxOnly": true,
27
- "noFallthroughCasesInSwitch": true,
28
- "noUncheckedSideEffectImports": true
29
- },
30
- "include": ["src"],
31
- "exclude": ["docs"]
32
- }
File without changes