@ynput/ayon-addon-planner 0.0.0-stage → 0.1.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/slots.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ import type { SlotDeclaration } from "@ynput/ayon-addon";
2
+
3
+ /** The planner's slots, as its manifest declares them. */
4
+ export declare const slots: readonly SlotDeclaration[];
package/slots.js ADDED
@@ -0,0 +1,78 @@
1
+ // The planner's slots as data: a plain module without static imports, so `ayon-addon check` and `slots` can
2
+ // load it in Node. The planner's own manifest declares exactly this list.
3
+ //
4
+ // Each slot's `example` is what AYON's developer mode shows in it with Show slots on, owned by the
5
+ // planner. A menu item's example needs no code (AYON's `run` only says it was used); the small
6
+ // components are drawn in their slot's real shape by examples/, loaded only when shown.
7
+ const BOOKING_EVENT_TYPES = ["capacity", "allocation", "absence", "milestone"];
8
+
9
+ export const slots = [
10
+ {
11
+ name: "planner.taskEventMenuItem",
12
+ version: 1,
13
+ label: "Task event menu item",
14
+ description: "an item in the right-click menu of a task event on the Schedule page",
15
+ required: ["label", "icon"],
16
+ pieces: ["run"],
17
+ optional: { position: /^(top|bottom)$/ },
18
+ example: { label: "Example task event action", icon: "extension" },
19
+ },
20
+ {
21
+ name: "planner.bookingEventMenuItem",
22
+ version: 1,
23
+ label: "Booking event menu item",
24
+ description:
25
+ "an item in the right-click menu of a booking event on the Plan page, for the event types in `eventTypes` (all when not set)",
26
+ required: ["label", "icon"],
27
+ pieces: ["run"],
28
+ optional: { position: /^(top|bottom)$/ },
29
+ // a type that doesn't exist would just never show: say so in `ayon-addon check` and the console
30
+ check: ({ eventTypes }) =>
31
+ eventTypes === undefined ||
32
+ (Array.isArray(eventTypes) &&
33
+ eventTypes.length &&
34
+ eventTypes.every((type) => BOOKING_EVENT_TYPES.includes(type)))
35
+ ? undefined
36
+ : `invalid eventTypes: use a list of ${BOOKING_EVENT_TYPES.join(", ")}`,
37
+ example: { label: "Example booking event action", icon: "extension" },
38
+ },
39
+ {
40
+ name: "planner.bookingEventFormHeaderItem",
41
+ version: 1,
42
+ label: "Booking form header item",
43
+ description:
44
+ "a small control in the header of the booking event form on the Plan page (popover and docked), next to its own buttons",
45
+ required: ["label"],
46
+ pieces: ["component"],
47
+ example: {
48
+ label: "Example form header item",
49
+ component: () => import("./examples/BookingEventFormHeaderItem.js"),
50
+ },
51
+ },
52
+ {
53
+ name: "planner.timelineEventBadge",
54
+ version: 1,
55
+ label: "Event start",
56
+ description:
57
+ "a small badge (an icon or a dot) before the title of an event bar on the Plan and Schedule timelines",
58
+ required: ["label"],
59
+ pieces: ["component"],
60
+ example: {
61
+ label: "Example badge",
62
+ component: () => import("./examples/TimelineEventBadge.js"),
63
+ },
64
+ },
65
+ {
66
+ name: "planner.timelineEventEndItem",
67
+ version: 1,
68
+ label: "Event end",
69
+ description:
70
+ "a small item (an icon or a dot) at the end of an event bar on the Plan and Schedule timelines",
71
+ required: ["label"],
72
+ pieces: ["component"],
73
+ example: {
74
+ label: "Example end item",
75
+ component: () => import("./examples/TimelineEventEndItem.js"),
76
+ },
77
+ },
78
+ ];