@mintplayer/react-bootstrap 19.10.0 → 19.11.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mintplayer/react-bootstrap",
3
- "version": "19.10.0",
3
+ "version": "19.11.0",
4
4
  "description": "React 19 wrappers around @mintplayer/web-components. Each sub-entry maps one-to-one with a WC sub-entry and exposes typed React components via @lit/react's createComponent.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -1,7 +1,7 @@
1
1
  import * as e from "react";
2
2
  import { createComponent as t } from "@lit/react";
3
3
  import { MpScheduler as n } from "@mintplayer/web-components/scheduler";
4
- const a = t({
4
+ const c = t({
5
5
  react: e,
6
6
  tagName: "mp-scheduler",
7
7
  elementClass: n,
@@ -16,9 +16,16 @@ const a = t({
16
16
  // — `date` carries the newly displayed date, so a controlled `date` prop
17
17
  // stays in sync by updating state from this callback.
18
18
  onViewChange: "view-change",
19
- onSelectionChange: "selection-change"
19
+ onSelectionChange: "selection-change",
20
+ // Resource-tree mutation requests (timeline view, off unless the matching
21
+ // permission is granted). Like event-create these are requests: apply them
22
+ // to your own `resources` array.
23
+ onResourceCreate: "resource-create",
24
+ onGroupCreate: "group-create",
25
+ onResourceUpdate: "resource-update",
26
+ onResourceDelete: "resource-delete"
20
27
  }
21
28
  });
22
29
  export {
23
- a as BsScheduler
30
+ c as BsScheduler
24
31
  };
@@ -1,55 +1,33 @@
1
1
  import { EventName } from '@lit/react';
2
2
  import { MpScheduler } from '@mintplayer/web-components/scheduler';
3
- import { SchedulerEvent, TimeSlot, ViewType } from '@mintplayer/web-components/scheduler-core';
4
- interface TimeRange {
5
- start: Date;
6
- end: Date;
7
- }
3
+ import { SchedulerEventMap } from '@mintplayer/web-components/scheduler-core';
8
4
  /**
9
5
  * React wrapper for `<mp-scheduler>`. Side-effect-registers the WC via
10
6
  * the import above. Maps every scheduler custom-event onto a typed
11
7
  * `on*` React prop.
12
8
  *
9
+ * The payload types come straight from `SchedulerEventMap`, the web
10
+ * component's own union — hand-copied shapes had drifted (an invented `slots`
11
+ * field on selection-change, a required `originalEvent` on event-delete that
12
+ * is never sent, a missing `selectedEvent`), and a wrong type here is worse
13
+ * than none because it type-checks.
14
+ *
13
15
  * Note: `events` and `resources` props are JS-shaped (arrays of
14
16
  * SchedulerEvent / Resource); @lit/react forwards them as element
15
- * properties.
17
+ * properties. `readonly` is a real property on the element, so it forwards
18
+ * the same way.
16
19
  */
17
20
  export declare const BsScheduler: import('@lit/react').ReactWebComponent<MpScheduler, {
18
- onEventSelected: EventName<CustomEvent<{
19
- event: SchedulerEvent;
20
- originalEvent: Event;
21
- }>>;
22
- onEventDblClick: EventName<CustomEvent<{
23
- event: SchedulerEvent;
24
- originalEvent: Event;
25
- }>>;
26
- onEventCreate: EventName<CustomEvent<{
27
- range: TimeRange;
28
- view: ViewType;
29
- resourceId?: string;
30
- originalEvent: Event;
31
- }>>;
32
- onEventUpdate: EventName<CustomEvent<{
33
- event: SchedulerEvent;
34
- oldEvent: SchedulerEvent;
35
- originalEvent: Event;
36
- }>>;
37
- onEventDelete: EventName<CustomEvent<{
38
- event: SchedulerEvent;
39
- originalEvent: Event;
40
- }>>;
41
- onDateClick: EventName<CustomEvent<{
42
- date: Date;
43
- originalEvent: Event;
44
- }>>;
45
- onViewChange: EventName<CustomEvent<{
46
- view: ViewType;
47
- date: Date;
48
- }>>;
49
- onSelectionChange: EventName<CustomEvent<{
50
- range: TimeRange | null;
51
- view: ViewType;
52
- slots?: TimeSlot[];
53
- }>>;
21
+ onEventSelected: EventName<SchedulerEventMap["event-selected"]>;
22
+ onEventDblClick: EventName<SchedulerEventMap["event-dblclick"]>;
23
+ onEventCreate: EventName<SchedulerEventMap["event-create"]>;
24
+ onEventUpdate: EventName<SchedulerEventMap["event-update"]>;
25
+ onEventDelete: EventName<SchedulerEventMap["event-delete"]>;
26
+ onDateClick: EventName<SchedulerEventMap["date-click"]>;
27
+ onViewChange: EventName<SchedulerEventMap["view-change"]>;
28
+ onSelectionChange: EventName<SchedulerEventMap["selection-change"]>;
29
+ onResourceCreate: EventName<SchedulerEventMap["resource-create"]>;
30
+ onGroupCreate: EventName<SchedulerEventMap["group-create"]>;
31
+ onResourceUpdate: EventName<SchedulerEventMap["resource-update"]>;
32
+ onResourceDelete: EventName<SchedulerEventMap["resource-delete"]>;
54
33
  }>;
55
- export {};