@object-ui/plugin-gantt 17.6.0 → 17.7.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.
@@ -24,12 +24,20 @@ export type SchedLinkType = 'fs' | 'ss' | 'ff' | 'sf';
24
24
  /**
25
25
  * Working-calendar model. When supplied to the scheduling functions, durations
26
26
  * are measured in *working* days and rescheduled tasks never start on a
27
- * non-working day. Days are evaluated at UTC midnight granularity.
27
+ * non-working day. Days are the chart's LOCAL calendar days — the days
28
+ * `GanttView` draws its columns on (display space, which a business
29
+ * `timeZone` makes that zone's wall clock), and the days its own column fold
30
+ * (`isWorkingColumn`) keys weekends and holidays by.
31
+ *
32
+ * They were UTC days until objectui#10866. That agreed with a date-only value
33
+ * only while the value was READ as UTC midnight; it now reads as local
34
+ * midnight of its day, and a UTC floor put a rescheduled successor on the
35
+ * previous calendar day in every zone but UTC.
28
36
  */
29
37
  export interface WorkingCalendar {
30
38
  /** Treat Saturday/Sunday as non-working. */
31
39
  skipWeekends?: boolean;
32
- /** ISO `yyyy-mm-dd` (UTC) keys to treat as non-working (holidays). */
40
+ /** ISO `yyyy-mm-dd` calendar-day keys to treat as non-working (holidays). */
33
41
  holidays?: Set<string>;
34
42
  }
35
43
  export interface SchedulableTask {
@@ -1 +1 @@
1
- {"version":3,"file":"scheduling.d.ts","sourceRoot":"","sources":["../src/scheduling.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAIH,MAAM,MAAM,aAAa,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAEtD;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,4CAA4C;IAC5C,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,sEAAsE;IACtE,QAAQ,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CACxB;AAuED,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,GAAG,MAAM,CA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"}
@@ -0,0 +1,55 @@
1
+ /**
2
+ * ObjectUI
3
+ * Copyright (c) 2024-present ObjectStack Inc.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+ /**
9
+ * "Shifted clock" for business-time-zone rendering: translate
10
+ * real instants into a display space where the browser's local clock reads
11
+ * the CONFIGURED zone's wall time. All existing local-clock logic — shift
12
+ * bands, day columns, snapping, the today line, date labels — then renders
13
+ * that zone correctly for every viewer. `from` translates an emitted date
14
+ * back into the real instant, which is what a `datetime` field persists.
15
+ * `to` and `from` read each zone's offset at the instant they are handed, so
16
+ * they are exact inverses except near a DST change of the configured zone or
17
+ * the viewer's, where they can disagree by an hour: `to(from(midnight))` can
18
+ * then be 23:00 of the day before. A `datetime` value takes the shim as it is.
19
+ * A date-only value is a calendar day, not an instant (objectui#10866), so
20
+ * `ObjectGantt` does not round-trip it: it hands the view the instant
21
+ * {@link invertTo} finds for the day's local midnight, and writes a dropped
22
+ * `date` field as the day of the display date {@link invertFrom} recovers,
23
+ * never as an instant (`readTaskDate`, `toStoredDateValue`).
24
+ */
25
+ export declare function makeTzShift(timeZone?: string): {
26
+ delta: number;
27
+ to: (d: Date) => Date;
28
+ from: (d: Date) => Date;
29
+ now: () => Date;
30
+ };
31
+ /** The part of a shim the two inverses below read. */
32
+ type Shim = Pick<ReturnType<typeof makeTzShift>, 'delta' | 'to' | 'from'>;
33
+ /**
34
+ * The instant a shim's `to` maps EXACTLY onto `display`: how `ObjectGantt`
35
+ * hands `GanttView` a date-only day, so the bar is drawn from that day's local
36
+ * midnight in the view's display space on a DST day too (objectui#10866),
37
+ * where `from(display)` is drawn from 23:00 of the day before or 01:00. When
38
+ * `to` maps no instant onto that midnight (for example, the chart zone's
39
+ * clocks change at 00:00 that day), an instant it maps a step later, 01:00 of
40
+ * that day for an hour's step. The identity shim hands `display` back.
41
+ */
42
+ export declare function invertTo(shift: Shim, display: Date): Date;
43
+ /**
44
+ * The display-space `Date` a shim's `from` was handed, recovered EXACTLY from
45
+ * the instant it returned: how `ObjectGantt` reads the day a `date` field was
46
+ * dropped on (objectui#10866), where `to(instant)` can fall on 23:00 of the
47
+ * day before. Where `from` maps two display instants an hour apart onto one
48
+ * instant, the later is taken: the two sit on either side of the chart zone's
49
+ * clock stepping forward against the viewer's, and when that step falls at a
50
+ * display midnight, a day dropped there is the later one.
51
+ * The identity shim hands `instant` back.
52
+ */
53
+ export declare function invertFrom(shift: Shim, instant: Date): Date;
54
+ export {};
55
+ //# sourceMappingURL=tzShift.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tzShift.d.ts","sourceRoot":"","sources":["../src/tzShift.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AA4BH;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,WAAW,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG;IAC9C,KAAK,EAAE,MAAM,CAAC;IACd,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,KAAK,IAAI,CAAC;IACtB,IAAI,EAAE,CAAC,CAAC,EAAE,IAAI,KAAK,IAAI,CAAC;IACxB,GAAG,EAAE,MAAM,IAAI,CAAC;CACjB,CAkBA;AAED,sDAAsD;AACtD,KAAK,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,OAAO,WAAW,CAAC,EAAE,OAAO,GAAG,IAAI,GAAG,MAAM,CAAC,CAAC;AA8C1E;;;;;;;;GAQG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,GAAG,IAAI,CAEzD;AAED;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,GAAG,IAAI,CAE3D"}
@@ -1 +1 @@
1
- {"version":3,"file":"useGanttTranslation.d.ts","sourceRoot":"","sources":["../src/useGanttTranslation.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH;;;;;GAKG;AACH,eAAO,MAAM,0BAA0B,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CA6F7D,CAAC;AA4BF,wBAAgB,mBAAmB;aAqBjB,MAAM,YAAY,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAG,MAAM;;EAMnE"}
1
+ {"version":3,"file":"useGanttTranslation.d.ts","sourceRoot":"","sources":["../src/useGanttTranslation.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH;;;;;GAKG;AACH,eAAO,MAAM,0BAA0B,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAsG7D,CAAC;AAwCF,wBAAgB,mBAAmB;aAqBjB,MAAM,YAAY,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAG,MAAM;;EAMnE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@object-ui/plugin-gantt",
3
- "version": "17.6.0",
3
+ "version": "17.7.0",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "description": "Gantt chart plugin for Object UI",
@@ -24,16 +24,17 @@
24
24
  }
25
25
  },
26
26
  "dependencies": {
27
- "@objectstack/spec": "^17.0.0",
28
- "lucide-react": "^1.31.0",
27
+ "@objectstack/spec": "^17.5.0",
28
+ "lucide-react": "^1.43.0",
29
29
  "sonner": "^2.0.8",
30
- "@object-ui/components": "17.6.0",
31
- "@object-ui/core": "17.6.0",
32
- "@object-ui/fields": "17.6.0",
33
- "@object-ui/i18n": "17.6.0",
34
- "@object-ui/plugin-detail": "17.6.0",
35
- "@object-ui/react": "17.6.0",
36
- "@object-ui/types": "17.6.0"
30
+ "@object-ui/components": "17.7.0",
31
+ "@object-ui/core": "17.7.0",
32
+ "@object-ui/fields": "17.7.0",
33
+ "@object-ui/i18n": "17.7.0",
34
+ "@object-ui/permissions": "17.7.0",
35
+ "@object-ui/plugin-detail": "17.7.0",
36
+ "@object-ui/react": "17.7.0",
37
+ "@object-ui/types": "17.7.0"
37
38
  },
38
39
  "peerDependencies": {
39
40
  "react": "^18.0.0 || ^19.0.0",
@@ -45,7 +46,9 @@
45
46
  "@vitejs/plugin-react": "^6.0.5",
46
47
  "typescript": "^6.0.3",
47
48
  "vite": "^8.2.1",
48
- "vite-plugin-dts": "^5.0.3"
49
+ "vite-plugin-dts": "^5.0.3",
50
+ "@object-ui/test-support": "17.4.0",
51
+ "@object-ui/sdui-parser": "17.7.0"
49
52
  },
50
53
  "keywords": [
51
54
  "objectui",
@@ -72,8 +75,8 @@
72
75
  ],
73
76
  "scripts": {
74
77
  "build": "vite build",
75
- "test": "vitest run",
76
- "test:watch": "vitest",
78
+ "test": "vitest run --root ../.. packages/plugin-gantt/",
79
+ "test:watch": "vitest --root ../.. packages/plugin-gantt/",
77
80
  "type-check": "tsc --noEmit && tsc -p tsconfig.test.json",
78
81
  "lint": "eslint ."
79
82
  }