@moltenship/calendar 2.0.0-beta.1 → 2.0.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/README.md +11 -10
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +2 -2
- package/docs/accessibility.md +5 -4
- package/docs/agents/changes.md +3 -3
- package/docs/agents/coding-agents.md +19 -20
- package/docs/agents/connect.md +20 -11
- package/docs/agents/deleting.md +2 -2
- package/docs/agents/reference.md +5 -6
- package/docs/agents/server.md +4 -4
- package/docs/agents/webmcp.md +2 -2
- package/docs/agents.md +10 -8
- package/docs/annotations.md +10 -8
- package/docs/api/changes.md +37 -21
- package/docs/api/{react.md → components.md} +65 -56
- package/docs/api/dnd-kit.md +1 -3
- package/docs/api/events.md +14 -13
- package/docs/api/primitives.md +61 -11
- package/docs/api/store.md +3 -3
- package/docs/api.md +23 -23
- package/docs/availability.md +25 -22
- package/docs/comparison.md +23 -24
- package/docs/concepts/anatomy.md +3 -3
- package/docs/concepts/events.md +2 -3
- package/docs/concepts/how-it-works.md +33 -16
- package/docs/concepts/state.md +1 -1
- package/docs/concepts/time.md +5 -7
- package/docs/customization.md +271 -0
- package/docs/frameworks.md +116 -0
- package/docs/guides/dnd-kit.md +2 -2
- package/docs/guides/google-calendar-sync.md +3 -3
- package/docs/guides/google-calendar.md +4 -4
- package/docs/guides/motion.md +2 -2
- package/docs/guides/nextjs-app-router.md +1 -1
- package/docs/guides/nextjs.md +1 -1
- package/docs/guides/performance.md +6 -6
- package/docs/guides/tanstack-query.md +2 -2
- package/docs/{guides/ics.md → ics/feed.md} +7 -9
- package/docs/ics/import.md +183 -0
- package/docs/{api/ics.md → ics/reference.md} +11 -53
- package/docs/ics.md +142 -0
- package/docs/index.md +81 -50
- package/docs/installation.md +48 -33
- package/docs/interactions.md +36 -3
- package/docs/llms.txt +81 -68
- package/docs/migrating-to-2.md +200 -25
- package/docs/quick-start.md +27 -23
- package/docs/{guides/recurring-events.md → recurrence/calendar.md} +23 -8
- package/docs/{concepts/recurrence.md → recurrence/model.md} +13 -12
- package/docs/{api/recurrence.md → recurrence/reference.md} +22 -61
- package/docs/recurrence.md +122 -0
- package/docs/stylex.md +74 -49
- package/docs/temporal/daylight-saving-time.md +172 -0
- package/docs/temporal/month-grid.md +119 -0
- package/docs/{api/temporal.md → temporal/reference.md} +7 -12
- package/docs/temporal.md +105 -0
- package/docs/testing.md +20 -1
- package/docs/theme-builder.md +9 -8
- package/docs/theming.md +108 -2
- package/docs/undo-redo.md +24 -16
- package/docs/views/agenda.md +14 -13
- package/docs/views/custom-views.md +13 -10
- package/docs/views/month.md +10 -9
- package/docs/views/resource-columns.md +21 -17
- package/docs/views/resource-timeline.md +16 -15
- package/docs/views/scrolling.md +7 -6
- package/docs/views/week-and-day.md +15 -14
- package/docs/views/year.md +11 -11
- package/docs/views.md +1 -1
- package/package.json +7 -6
- package/skills/moltenship-time/SKILL.md +7 -5
- package/skills/moltenship-time/references/compose.md +13 -6
- package/skills/moltenship-time/references/mistakes.md +4 -2
- package/skills/moltenship-time/references/solid.md +36 -25
- package/docs/api/solid.md +0 -460
package/README.md
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
# @moltenship/calendar
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
It has the React components and hooks, the event engine, the
|
|
5
|
-
interactions. Its parts are [ui-sdk](https://ui-sdk.dev)
|
|
6
|
-
calendar and act on it
|
|
3
|
+
Moltenship Time for React 19, a headless calendar built on the Temporal API. This is the package a
|
|
4
|
+
React app installs and imports. It has the React components and hooks, the event engine, the
|
|
5
|
+
Temporal helpers and the pointer interactions. Its parts are [ui-sdk](https://ui-sdk.dev)
|
|
6
|
+
components, so an AI agent can read a calendar and act on it once your app creates ui-sdk's agent
|
|
7
|
+
bridge. A SolidJS 2 app installs
|
|
8
|
+
[`@moltenship/calendar-solid`](https://time.molten.sh/docs/solid) instead.
|
|
7
9
|
|
|
8
|
-
|
|
9
|
-
> [Migrating to 2.0](https://time.molten.sh/docs/migrating-to-2).
|
|
10
|
+
Coming from 1.x? See [Migrating to 2.0](https://time.molten.sh/docs/react/migrating-to-2).
|
|
10
11
|
|
|
11
12
|
```ts
|
|
12
13
|
import { createCalendar, defineCalendarView, plainDateInterval } from "@moltenship/calendar";
|
|
@@ -34,7 +35,7 @@ pnpm add @moltenship/calendar @ui-sdk/core @ui-sdk/react react react-dom
|
|
|
34
35
|
|
|
35
36
|
The styled views, toolbar and theme aren't in this package. They're source files
|
|
36
37
|
that you add to your app with the shadcn CLI and then own; see
|
|
37
|
-
[Installation](https://time.molten.sh/docs/installation).
|
|
38
|
+
[Installation](https://time.molten.sh/docs/react/installation).
|
|
38
39
|
|
|
39
40
|
## For coding agents
|
|
40
41
|
|
|
@@ -46,13 +47,13 @@ installed:
|
|
|
46
47
|
`references/`. Install it with `npx skills add Moltenship/time --skill moltenship-time`, or copy
|
|
47
48
|
the folder into your agent's skills folder.
|
|
48
49
|
|
|
49
|
-
See [Build with a coding agent](https://time.molten.sh/docs/agents/coding-agents).
|
|
50
|
+
See [Build with a coding agent](https://time.molten.sh/docs/react/agents/coding-agents).
|
|
50
51
|
|
|
51
52
|
## Documentation
|
|
52
53
|
|
|
53
54
|
- [Docs](https://time.molten.sh/docs), starting with the
|
|
54
|
-
[Quick start](https://time.molten.sh/docs/quick-start)
|
|
55
|
-
- [Agents](https://time.molten.sh/docs/agents)
|
|
55
|
+
[Quick start](https://time.molten.sh/docs/react/quick-start)
|
|
56
|
+
- [Agents](https://time.molten.sh/docs/react/agents)
|
|
56
57
|
- [Repository](https://github.com/Moltenship/time)
|
|
57
58
|
|
|
58
59
|
## License
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CalendarDragFollower, CalendarDragMonitor, CalendarDragPreview, CalendarDropOptions, CalendarDropSession, CalendarDropSource, CalendarEventDrag, CalendarPoint, CalendarPointerOptions, CalendarRect, CalendarRegion, attachCalendarPointer, eventIdAttributes, eventIdOf, monitorCalendarDrags, observeCalendarRegions, resourceIdAttributes, resourceIdOf, startCalendarDrop
|
|
2
|
-
import { AnyCalendarView, CalendarActions, CalendarActiveView, CalendarActiveViewProps, CalendarAnnotations, CalendarAnnouncerProps, CalendarBusyResources, CalendarChangeReason, CalendarChangeSource, CalendarCommandOptions, CalendarContextValue, CalendarControlledState, CalendarDiagnostic, CalendarDraftBusy, CalendarEventProps, CalendarEventRenderValue, CalendarFactory, CalendarFrameProps, CalendarHistory, CalendarHistoryAnnouncementBuilder, CalendarHistoryAnnouncementContext, CalendarHistoryCommandOptions, CalendarHistoryMessages, CalendarHistoryOptions, CalendarHistoryShortcutsOptions, CalendarHistoryShortcutsTarget, CalendarKeyboardHandlers, CalendarKeyboardOptions, CalendarMeta, CalendarPartIds, CalendarPartRefs, CalendarPublicState, CalendarResourceExpansion, CalendarResourceExpansionCause, CalendarResourceExpansionCommand, CalendarResourceStatus, CalendarRootProps, CalendarRovingFocusOptions, CalendarRovingFocusProps, CalendarSemanticActions, CalendarStateChangeDetail, CalendarStateChangeHandler, CalendarStateChangeHandlers, CalendarStateSelector, CalendarStateSelectorOptions, CalendarStateSlice, CalendarStore, CalendarStoreOptions, CalendarTitleProps, CalendarToolbarProps, CalendarTriggerProps, CalendarView, CalendarViewActions, CalendarViewInput, CalendarViewOptionsMap, CalendarViewRendererProps, CalendarViewSwitcherProps, CalendarViewportProps, CalendarVisibleRange, CreateCalendarOptions, UseNowOptions, createCalendar, createCalendarStore, defineCalendarView, useAnchorDateRequests, useBusyResources, useCalendarAnnotations, useCalendarAnnouncer, useCalendarAvailability, useCalendarDraft, useCalendarDraftReporter, useCalendarFocus, useCalendarHistory, useCalendarHistoryShortcuts, useCalendarInteraction, useCalendarKeyboard, useCalendarSelection, useClosedDates, useDraftBusy, useNow, useResourceExpansion, useResourceStatus, useRovingFocus, useTimeGridAnnotations, useTimeGridAvailability, useTimelineAvailability, useVisibleResources } from "@moltenship/calendar-react";
|
|
1
|
+
import { CalendarDragFollower, CalendarDragMonitor, CalendarDragPreview, CalendarDropOptions, CalendarDropSession, CalendarDropSource, CalendarEventDrag, CalendarPoint, CalendarPointerOptions, CalendarRect, CalendarRegion, attachCalendarPointer, eventIdAttributes, eventIdOf, monitorCalendarDrags, observeCalendarRegions, resourceIdAttributes, resourceIdOf, startCalendarDrop } from "@moltenship/calendar-dnd";
|
|
2
|
+
import { AnyCalendarView, CalendarActions, CalendarActiveView, CalendarActiveViewProps, CalendarAnnotations, CalendarAnnouncerProps, CalendarBusyResources, CalendarChangeReason, CalendarChangeSource, CalendarCommandOptions, CalendarContextValue, CalendarControlledState, CalendarDiagnostic, CalendarDraftBusy, CalendarEventProps, CalendarEventRenderValue, CalendarFactory, CalendarFrameProps, CalendarHistory, CalendarHistoryAnnouncementBuilder, CalendarHistoryAnnouncementContext, CalendarHistoryCommandOptions, CalendarHistoryMessages, CalendarHistoryOptions, CalendarHistoryShortcutsOptions, CalendarHistoryShortcutsTarget, CalendarKeyboardHandlers, CalendarKeyboardOptions, CalendarMeta, CalendarPartIds, CalendarPartRefs, CalendarPublicState, CalendarResourceExpansion, CalendarResourceExpansionCause, CalendarResourceExpansionCommand, CalendarResourceStatus, CalendarRootProps, CalendarRovingFocusOptions, CalendarRovingFocusProps, CalendarSemanticActions, CalendarStateChangeDetail, CalendarStateChangeHandler, CalendarStateChangeHandlers, CalendarStateSelector, CalendarStateSelectorOptions, CalendarStateSlice, CalendarStore, CalendarStoreOptions, CalendarTitleProps, CalendarToolbarProps, CalendarTriggerProps, CalendarView, CalendarViewActions, CalendarViewInput, CalendarViewOptionsMap, CalendarViewRendererProps, CalendarViewSwitcherProps, CalendarViewportProps, CalendarVisibleRange, CreateCalendarOptions, UseNowOptions, createCalendar, createCalendarStore, defineCalendarView, useAnchorDateRequests, useBusyResources, useCalendarAnnotations, useCalendarAnnouncer, useCalendarAvailability, useCalendarDraft, useCalendarDraftReporter, useCalendarFocus, useCalendarHistory, useCalendarHistoryShortcuts, useCalendarInteraction, useCalendarKeyboard, useCalendarPointer, useCalendarSelection, useClosedDates, useDraftBusy, useNow, useResourceExpansion, useResourceStatus, useRovingFocus, useTimeGridAnnotations, useTimeGridAvailability, useTimelineAvailability, useVisibleResources } from "@moltenship/calendar-react";
|
|
3
3
|
export * from "@moltenship/calendar-core";
|
|
4
4
|
export * from "@moltenship/calendar-temporal";
|
|
5
5
|
export { type AnyCalendarView, type CalendarActions, type CalendarActiveView, type CalendarActiveViewProps, type CalendarAnnotations, type CalendarAnnouncerProps, type CalendarBusyResources, type CalendarChangeReason, type CalendarChangeSource, type CalendarCommandOptions, type CalendarContextValue, type CalendarControlledState, type CalendarDiagnostic, type CalendarDraftBusy, type CalendarDragFollower, type CalendarDragMonitor, type CalendarDragPreview, type CalendarDropOptions, type CalendarDropSession, type CalendarDropSource, type CalendarEventDrag, type CalendarEventProps, type CalendarEventRenderValue, type CalendarFactory, type CalendarFrameProps, type CalendarHistory, type CalendarHistoryAnnouncementBuilder, type CalendarHistoryAnnouncementContext, type CalendarHistoryCommandOptions, type CalendarHistoryMessages, type CalendarHistoryOptions, type CalendarHistoryShortcutsOptions, type CalendarHistoryShortcutsTarget, type CalendarKeyboardHandlers, type CalendarKeyboardOptions, type CalendarMeta, type CalendarPartIds, type CalendarPartRefs, type CalendarPoint, type CalendarPointerOptions, type CalendarPublicState, type CalendarRect, type CalendarRegion, type CalendarResourceExpansion, type CalendarResourceExpansionCause, type CalendarResourceExpansionCommand, type CalendarResourceStatus, type CalendarRootProps, type CalendarRovingFocusOptions, type CalendarRovingFocusProps, type CalendarSemanticActions, type CalendarStateChangeDetail, type CalendarStateChangeHandler, type CalendarStateChangeHandlers, type CalendarStateSelector, type CalendarStateSelectorOptions, type CalendarStateSlice, type CalendarStore, type CalendarStoreOptions, type CalendarTitleProps, type CalendarToolbarProps, type CalendarTriggerProps, type CalendarView, type CalendarViewActions, type CalendarViewInput, type CalendarViewOptionsMap, type CalendarViewRendererProps, type CalendarViewSwitcherProps, type CalendarViewportProps, type CalendarVisibleRange, type CreateCalendarOptions, type UseNowOptions, attachCalendarPointer, createCalendar, createCalendarStore, defineCalendarView, eventIdAttributes, eventIdOf, monitorCalendarDrags, observeCalendarRegions, resourceIdAttributes, resourceIdOf, startCalendarDrop, useAnchorDateRequests, useBusyResources, useCalendarAnnotations, useCalendarAnnouncer, useCalendarAvailability, useCalendarDraft, useCalendarDraftReporter, useCalendarFocus, useCalendarHistory, useCalendarHistoryShortcuts, useCalendarInteraction, useCalendarKeyboard, useCalendarPointer, useCalendarSelection, useClosedDates, useDraftBusy, useNow, useResourceExpansion, useResourceStatus, useRovingFocus, useTimeGridAnnotations, useTimeGridAvailability, useTimelineAvailability, useVisibleResources };
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { attachCalendarPointer, eventIdAttributes, eventIdOf, monitorCalendarDrags, observeCalendarRegions, resourceIdAttributes, resourceIdOf, startCalendarDrop
|
|
2
|
-
import { createCalendar, createCalendarStore, defineCalendarView, useAnchorDateRequests, useBusyResources, useCalendarAnnotations, useCalendarAnnouncer, useCalendarAvailability, useCalendarDraft, useCalendarDraftReporter, useCalendarFocus, useCalendarHistory, useCalendarHistoryShortcuts, useCalendarInteraction, useCalendarKeyboard, useCalendarSelection, useClosedDates, useDraftBusy, useNow, useResourceExpansion, useResourceStatus, useRovingFocus, useTimeGridAnnotations, useTimeGridAvailability, useTimelineAvailability, useVisibleResources } from "@moltenship/calendar-react";
|
|
1
|
+
import { attachCalendarPointer, eventIdAttributes, eventIdOf, monitorCalendarDrags, observeCalendarRegions, resourceIdAttributes, resourceIdOf, startCalendarDrop } from "@moltenship/calendar-dnd";
|
|
2
|
+
import { createCalendar, createCalendarStore, defineCalendarView, useAnchorDateRequests, useBusyResources, useCalendarAnnotations, useCalendarAnnouncer, useCalendarAvailability, useCalendarDraft, useCalendarDraftReporter, useCalendarFocus, useCalendarHistory, useCalendarHistoryShortcuts, useCalendarInteraction, useCalendarKeyboard, useCalendarPointer, useCalendarSelection, useClosedDates, useDraftBusy, useNow, useResourceExpansion, useResourceStatus, useRovingFocus, useTimeGridAnnotations, useTimeGridAvailability, useTimelineAvailability, useVisibleResources } from "@moltenship/calendar-react";
|
|
3
3
|
export * from "@moltenship/calendar-core";
|
|
4
4
|
export * from "@moltenship/calendar-temporal";
|
|
5
5
|
export { attachCalendarPointer, createCalendar, createCalendarStore, defineCalendarView, eventIdAttributes, eventIdOf, monitorCalendarDrags, observeCalendarRegions, resourceIdAttributes, resourceIdOf, startCalendarDrop, useAnchorDateRequests, useBusyResources, useCalendarAnnotations, useCalendarAnnouncer, useCalendarAvailability, useCalendarDraft, useCalendarDraftReporter, useCalendarFocus, useCalendarHistory, useCalendarHistoryShortcuts, useCalendarInteraction, useCalendarKeyboard, useCalendarPointer, useCalendarSelection, useClosedDates, useDraftBusy, useNow, useResourceExpansion, useResourceStatus, useRovingFocus, useTimeGridAnnotations, useTimeGridAvailability, useTimelineAvailability, useVisibleResources };
|
package/docs/accessibility.md
CHANGED
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
The keyboard map, screen reader announcements, the ARIA patterns each view uses, reduced motion, and right-to-left layout.
|
|
4
4
|
|
|
5
|
-
Source: https://time.molten.sh/docs/accessibility
|
|
5
|
+
Source: https://time.molten.sh/docs/react/accessibility
|
|
6
6
|
|
|
7
7
|
Everything you can do with a pointer in the built-in views, you can also do from the keyboard:
|
|
8
8
|
move around, open an event, and move, resize, or create one. A screen reader hears each step. Try it
|
|
9
9
|
here: Tab into the calendar or click a day, then use the keys below. The strip under the calendar
|
|
10
10
|
shows what a screen reader announces.
|
|
11
11
|
|
|
12
|
-
> Live example of the `week` view: see it at https://time.molten.sh/docs/accessibility
|
|
12
|
+
> Live example of the `week` view: see it at https://time.molten.sh/docs/react/accessibility
|
|
13
13
|
|
|
14
14
|
## Keyboard
|
|
15
15
|
|
|
@@ -231,7 +231,8 @@ specific elements:
|
|
|
231
231
|
focused separately. Event names lead with the title, so speech input still matches it.
|
|
232
232
|
- **Target size**, inside the month and time grids, where an event's box is its time span (WCAG
|
|
233
233
|
2.5.8's "essential" exception).
|
|
234
|
-
- **Hidden focusable elements**, for Base UI's focus guards, which pass focus straight on.
|
|
234
|
+
- **Hidden focusable elements**, for Base UI's focus guards, which pass focus straight on. The
|
|
235
|
+
demo's own shadcn components still use Base UI.
|
|
235
236
|
- **Command name**, for the same focus guards in WebKit, where Base UI makes them unnamed buttons
|
|
236
237
|
on purpose, so its focus trap catches VoiceOver's cursor instead of letting it leave a popup.
|
|
237
238
|
|
|
@@ -269,7 +270,7 @@ registry views use shadcn's own popover, select, and tooltip, which you install
|
|
|
269
270
|
|
|
270
271
|
Right-to-left takes two settings: `dir="rtl"` on an ancestor of the calendar, such as `<html>`,
|
|
271
272
|
for the layout, and `direction="rtl"` on `Root` for the keys. `Root` doesn't read the page's
|
|
272
|
-
`dir`, so set both
|
|
273
|
+
`dir`, so set both.
|
|
273
274
|
|
|
274
275
|
```tsx
|
|
275
276
|
<html dir="rtl" lang="ar">
|
package/docs/agents/changes.md
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Tell an agent's change from a person's, refuse it with a policy, and undo it without touching what the person did.
|
|
4
4
|
|
|
5
|
-
Source: https://time.molten.sh/docs/agents/changes
|
|
5
|
+
Source: https://time.molten.sh/docs/react/agents/changes
|
|
6
6
|
|
|
7
|
-
> Live example: see it at https://time.molten.sh/docs/agents/changes
|
|
7
|
+
> Live example: see it at https://time.molten.sh/docs/react/agents/changes
|
|
8
8
|
|
|
9
9
|
An agent's change reaches the same handlers as a person's, with a detail that says who made it.
|
|
10
10
|
You can log it, refuse it, and take it back. This page's samples import the `Calendar`, `Meeting`,
|
|
@@ -336,7 +336,7 @@ For one history that holds everyone's changes, leave `inputs` out. Each step in
|
|
|
336
336
|
|
|
337
337
|
## Saves that take a while
|
|
338
338
|
|
|
339
|
-
> Live example: see it at https://time.molten.sh/docs/agents/changes
|
|
339
|
+
> Live example: see it at https://time.molten.sh/docs/react/agents/changes
|
|
340
340
|
|
|
341
341
|
This page has two calendars, so this one has a label of its own, `Bookings`. An agent names a
|
|
342
342
|
calendar by its label, and a step on a label two calendars share fails: the bridge can't tell which
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Give Claude Code, Cursor or another coding agent these docs as Markdown, and a skill that teaches it the library.
|
|
4
4
|
|
|
5
|
-
Source: https://time.molten.sh/docs/agents/coding-agents
|
|
5
|
+
Source: https://time.molten.sh/docs/react/agents/coding-agents
|
|
6
6
|
|
|
7
7
|
The other pages in this section are about an agent that uses the calendar in your app. This one is
|
|
8
|
-
about the agent that writes your app. A coding agent trained before 2.0 doesn't know the
|
|
9
|
-
agent
|
|
8
|
+
about the agent that writes your app. A coding agent trained before 2.0 doesn't know the 2.0
|
|
9
|
+
API, such as the agent bridge, and guesses at it. Three things give it the real API:
|
|
10
10
|
|
|
11
11
|
| What | Where | Use it when |
|
|
12
12
|
| ------------------- | ---------------------------------------------------------- | --------------------------------------------------------- |
|
|
@@ -14,7 +14,7 @@ agent surface, and guesses at the rest. Three things give it the real API:
|
|
|
14
14
|
| Docs in the package | `node_modules/@moltenship/calendar/docs` | The agent can read files in your project |
|
|
15
15
|
| Docs on the site | [`/llms.txt`](https://time.molten.sh/llms.txt) and a `.md` version of every page | The agent can fetch a URL |
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
Each is made from the same source as the pages you're reading.
|
|
18
18
|
|
|
19
19
|
## Install the skill
|
|
20
20
|
|
|
@@ -38,9 +38,9 @@ The skill is a short guide and seven references the agent opens as it needs them
|
|
|
38
38
|
| `agent-ready.md` | The bridge, permissions, deleting, WebMCP, a model on your server |
|
|
39
39
|
| `testing.md` | `@moltenship/calendar-testing`: the environment, the harness, queries |
|
|
40
40
|
| `mistakes.md` | Mistakes agents make with this library, and the fix for each |
|
|
41
|
-
| `solid.md` |
|
|
41
|
+
| `solid.md` | SolidJS: the packages to install, a calendar, and the rules that differ from React |
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
Since 2.0 the npm package ships the same skill, at
|
|
44
44
|
`node_modules/@moltenship/calendar/skills/moltenship-time`. That copy matches the version you
|
|
45
45
|
installed. Without the CLI, copy the folder into your agent's skills folder, or point the agent at
|
|
46
46
|
it.
|
|
@@ -55,28 +55,28 @@ node_modules/@moltenship/calendar/docs/
|
|
|
55
55
|
index.md Introduction
|
|
56
56
|
quick-start.md
|
|
57
57
|
agents/connect.md
|
|
58
|
-
api/
|
|
58
|
+
api/components.md
|
|
59
59
|
...
|
|
60
60
|
```
|
|
61
61
|
|
|
62
|
-
They're written when the package is built, from the pages of this site, so they describe the
|
|
62
|
+
They're written when the package is built, from the React pages of this site, so they describe the
|
|
63
63
|
version in your `node_modules` and not the newest one. Links between pages are relative paths, and
|
|
64
|
-
they work offline.
|
|
64
|
+
they work offline. A link to a page of the Solid docs is a link to this site.
|
|
65
65
|
|
|
66
66
|
A live example can't run in a Markdown file. Where a page has one, the Markdown has a line with the
|
|
67
67
|
page's address, and the example's source stays as a code sample.
|
|
68
|
-
|
|
69
68
|
## Docs on the site
|
|
70
69
|
|
|
71
|
-
| Address
|
|
72
|
-
|
|
|
73
|
-
| [`/llms.txt`](https://time.molten.sh/llms.txt)
|
|
74
|
-
| [`/llms-full.txt`](https://time.molten.sh/llms-full.txt)
|
|
75
|
-
| `/docs/agents/connect.md`
|
|
76
|
-
| [`/docs.md`](https://time.molten.sh/docs.md)
|
|
70
|
+
| Address | What it returns |
|
|
71
|
+
| -------------------------------------------------------------------------------------------- | -------------------------------------------------------- |
|
|
72
|
+
| [`/llms.txt`](https://time.molten.sh/llms.txt) | The index, in the [llms.txt](https://llmstxt.org) format |
|
|
73
|
+
| [`/llms-full.txt`](https://time.molten.sh/llms-full.txt) | Every page in one Markdown document |
|
|
74
|
+
| `/docs/react/agents/connect.md` | One page as Markdown: add `.md` to any page's address |
|
|
75
|
+
| [`/docs/react.md`](https://time.molten.sh/docs/react.md) | The introduction to the React docs |
|
|
76
|
+
| [`/docs/solid.md`](https://time.molten.sh/docs/solid.md) | The introduction to the Solid docs |
|
|
77
77
|
|
|
78
|
-
The index
|
|
79
|
-
`Optional`. Start an agent there and let it fetch the pages it needs. `/llms-full.txt` is the whole
|
|
78
|
+
The index lists the React docs and then the Solid docs. It groups each set's pages as the sidebar
|
|
79
|
+
does and puts the ones an agent can skip under `Optional`. Start an agent there and let it fetch the pages it needs. `/llms-full.txt` is the whole
|
|
80
80
|
site and is large; use it when the agent can't follow links.
|
|
81
81
|
|
|
82
82
|
The site describes the newest version. For an older one, read the docs in the package.
|
|
@@ -113,5 +113,4 @@ create one bridge, name the calendar with `label`, and allow navigation and chan
|
|
|
113
113
|
person before a delete.
|
|
114
114
|
```
|
|
115
115
|
|
|
116
|
-
Then check what it built the way a person would, and with a test that runs
|
|
117
|
-
[an agent's steps through the bridge](../testing.md#changes-an-agent-makes).
|
|
116
|
+
Then check what it built the way a person would, and with a test that runs [an agent's steps through the bridge](../testing.md#changes-an-agent-makes).
|
package/docs/agents/connect.md
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Create the agent bridge, name your calendar, and decide which actions an agent may run.
|
|
4
4
|
|
|
5
|
-
Source: https://time.molten.sh/docs/agents/connect
|
|
5
|
+
Source: https://time.molten.sh/docs/react/agents/connect
|
|
6
6
|
|
|
7
|
-
> Live example: see it at https://time.molten.sh/docs/agents/connect
|
|
7
|
+
> Live example: see it at https://time.molten.sh/docs/react/agents/connect
|
|
8
8
|
|
|
9
9
|
A calendar is reachable by agents once your app creates ui-sdk's agent bridge. The bridge lists the
|
|
10
10
|
calendar, runs an agent's steps on it, and asks your `allow` before each one. This page sets that
|
|
@@ -231,15 +231,20 @@ Then, in the browser's console:
|
|
|
231
231
|
|
|
232
232
|
```js
|
|
233
233
|
agent.snapshot();
|
|
234
|
-
// [
|
|
234
|
+
// [
|
|
235
|
+
// { ref: "c1", component: "button", label: "Today", … },
|
|
236
|
+
// …,
|
|
237
|
+
// { ref: "c6", component: "select", label: "View", value: "week", … },
|
|
238
|
+
// { ref: "c7", component: "calendar", label: "Team calendar", view: "week", … },
|
|
239
|
+
// ]
|
|
235
240
|
|
|
236
241
|
const calendar = { ref: "Team calendar" };
|
|
237
242
|
|
|
238
243
|
await agent.act({ steps: [{ ...calendar, action: "describeCalendar" }] });
|
|
239
|
-
// { ok: true, steps: [{ step: 0, ref: "
|
|
244
|
+
// { ok: true, steps: [{ step: 0, ref: "c7", result: { today: "2026-10-06", views: […], … } }], … }
|
|
240
245
|
|
|
241
246
|
await agent.act({ steps: [{ ...calendar, action: "listEvents" }] });
|
|
242
|
-
// { ok: true, steps: [{ step: 0, ref: "
|
|
247
|
+
// { ok: true, steps: [{ step: 0, ref: "c7", result: [{ id: "review", title: "Design review", … }] }], … }
|
|
243
248
|
|
|
244
249
|
await agent.act({
|
|
245
250
|
steps: [
|
|
@@ -250,7 +255,7 @@ await agent.act({
|
|
|
250
255
|
},
|
|
251
256
|
],
|
|
252
257
|
});
|
|
253
|
-
// { ok: true, steps: [{ step: 0, ref: "
|
|
258
|
+
// { ok: true, steps: [{ step: 0, ref: "c7", result: { changeId: "change-1", status: "saved", … } }], … }
|
|
254
259
|
```
|
|
255
260
|
|
|
256
261
|
An action takes one object, never a list of values. `args: ["review", "2026-10-09T10:00"]` fails,
|
|
@@ -261,7 +266,9 @@ calendar-agent-invalid-arguments: moveEvent takes { eventId: ID, start: ISO date
|
|
|
261
266
|
```
|
|
262
267
|
|
|
263
268
|
`ref` takes the calendar's label, its ref from the snapshot, or its kind, `"calendar"`. A name that
|
|
264
|
-
fits two components fails the step and lists both, so use the ref then.
|
|
269
|
+
fits two components fails the step and lists both, so use the ref then. The registry's toolbar
|
|
270
|
+
adds its buttons and its view select to the snapshot, ahead of the calendar, so the calendar's ref
|
|
271
|
+
depends on what else is on the page. Its label doesn't.
|
|
265
272
|
|
|
266
273
|
In the object `snapshot()` returns, `anchorDate` is a `Temporal.PlainDate`. It becomes the string
|
|
267
274
|
`"2026-10-08"` when the snapshot is sent as JSON, which is how a model gets it.
|
|
@@ -333,8 +340,8 @@ agent reads, and the steps after it don't run:
|
|
|
333
340
|
```json
|
|
334
341
|
{
|
|
335
342
|
"ok": false,
|
|
336
|
-
"error": { "step": 1, "message": "The app refused moveEvent on
|
|
337
|
-
"steps": [{ "step": 0, "ref": "
|
|
343
|
+
"error": { "step": 1, "message": "The app refused moveEvent on c7." },
|
|
344
|
+
"steps": [{ "step": 0, "ref": "c7" }],
|
|
338
345
|
"appeared": [],
|
|
339
346
|
"values": {}
|
|
340
347
|
}
|
|
@@ -411,8 +418,10 @@ Check these first:
|
|
|
411
418
|
- **A frame.** The calendar renders `Calendar.Frame` inside `Root`. Without one it isn't listed.
|
|
412
419
|
- **One version.** `@ui-sdk/core` and `@ui-sdk/react` are installed once, at the same version.
|
|
413
420
|
`pnpm why @ui-sdk/core` or `npm ls @ui-sdk/core` shows more than one when they aren't.
|
|
414
|
-
- **One import path for the bridge.** Import `createAgent` from
|
|
415
|
-
|
|
421
|
+
- **One import path for the bridge.** Import `createAgent` from
|
|
422
|
+
`@ui-sdk/react/agent`
|
|
423
|
+
, the adapter your calendar uses.
|
|
424
|
+
A Solid app imports it from `@ui-sdk/solid/agent`.
|
|
416
425
|
- **The dev server's pre-bundle.** Vite pre-bundles dependencies in development. When one package
|
|
417
426
|
that imports `@ui-sdk/core` is kept out of the pre-bundle and another isn't, the page loads the
|
|
418
427
|
core twice. Solid's Vite plugin does that for `@ui-sdk/solid`. Keep the core out as well:
|
package/docs/agents/deleting.md
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Let an agent delete an event only after the person on the page says yes.
|
|
4
4
|
|
|
5
|
-
Source: https://time.molten.sh/docs/agents/deleting
|
|
5
|
+
Source: https://time.molten.sh/docs/react/agents/deleting
|
|
6
6
|
|
|
7
|
-
> Live example: see it at https://time.molten.sh/docs/agents/deleting
|
|
7
|
+
> Live example: see it at https://time.molten.sh/docs/react/agents/deleting
|
|
8
8
|
|
|
9
9
|
A deleted event is gone from the calendar, so an agent can't delete until you turn it on. Two
|
|
10
10
|
switches are involved, and a careful app sets both:
|
package/docs/agents/reference.md
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Every action an agent can call on a calendar, with its arguments, results and errors, and every field of the calendar's snapshot entry.
|
|
4
4
|
|
|
5
|
-
Source: https://time.molten.sh/docs/agents/reference
|
|
5
|
+
Source: https://time.molten.sh/docs/react/agents/reference
|
|
6
6
|
|
|
7
7
|
This page lists what a calendar gives ui-sdk's agent bridge. The guides start at
|
|
8
|
-
[Agents](../agents.md).
|
|
8
|
+
[Agents in your app](../agents.md).
|
|
9
9
|
|
|
10
10
|
## Root props
|
|
11
11
|
|
|
@@ -22,8 +22,7 @@ only when it renders `Calendar.Frame`.
|
|
|
22
22
|
|
|
23
23
|
## The bridge
|
|
24
24
|
|
|
25
|
-
The bridge is ui-sdk's, from `@ui-sdk/react/agent
|
|
26
|
-
Solid one:
|
|
25
|
+
The bridge is ui-sdk's, from `@ui-sdk/react/agent`:
|
|
27
26
|
|
|
28
27
|
```ts title="agent.ts"
|
|
29
28
|
"use client";
|
|
@@ -213,7 +212,7 @@ moves no event.
|
|
|
213
212
|
|
|
214
213
|
`selectEvent` sets the selection to `{ kind: "event", eventId }`, the calendar's default selection
|
|
215
214
|
for an event. It writes that shape on a calendar with a
|
|
216
|
-
[selection type of its own](../api/
|
|
215
|
+
[selection type of its own](../api/components.md#createcalendar) as well. If yours differs, map it in
|
|
217
216
|
`onSelectionChange` with `selection` controlled, or refuse `selectEvent` in `allow`.
|
|
218
217
|
|
|
219
218
|
### Events
|
|
@@ -268,7 +267,7 @@ A wall-clock time that a daylight saving change skips or repeats is resolved wit
|
|
|
268
267
|
|
|
269
268
|
### Recurring events
|
|
270
269
|
|
|
271
|
-
With [recurring events](../
|
|
270
|
+
With [recurring events](../recurrence.md), each occurrence is an event of its own in `listEvents`,
|
|
272
271
|
with the ID your expansion gives it, such as `standup::2026-10-20T09:00:00Z`. An agent names an
|
|
273
272
|
occurrence by that ID.
|
|
274
273
|
|
package/docs/agents/server.md
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Give a model the bridge's tool definitions from your server, and run its tool calls on the calendar in the browser.
|
|
4
4
|
|
|
5
|
-
Source: https://time.molten.sh/docs/agents/server
|
|
5
|
+
Source: https://time.molten.sh/docs/react/agents/server
|
|
6
6
|
|
|
7
|
-
> Live example: see it at https://time.molten.sh/docs/agents/server
|
|
7
|
+
> Live example: see it at https://time.molten.sh/docs/react/agents/server
|
|
8
8
|
|
|
9
9
|
The bridge runs in the browser, where the calendar is. The model runs on your server, where your
|
|
10
10
|
API key is. A tool call travels between them: the model asks for `act`, your server passes the call
|
|
@@ -94,8 +94,8 @@ export async function POST(request: Request): Promise<Response> {
|
|
|
94
94
|
}
|
|
95
95
|
```
|
|
96
96
|
|
|
97
|
-
|
|
98
|
-
|
|
97
|
+
The `POST` works in any server that speaks `Request` and `Response`; this one is a Next.js
|
|
98
|
+
route handler. Three things to keep:
|
|
99
99
|
|
|
100
100
|
- **The key stays on the server.** `new Anthropic()` reads `ANTHROPIC_API_KEY` from the
|
|
101
101
|
environment. Don't send it to the browser, and don't call the model from the browser.
|
package/docs/agents/webmcp.md
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Hand the calendar's tools to the agent built into a browser, with rules of their own for an agent you didn't write.
|
|
4
4
|
|
|
5
|
-
Source: https://time.molten.sh/docs/agents/webmcp
|
|
5
|
+
Source: https://time.molten.sh/docs/react/agents/webmcp
|
|
6
6
|
|
|
7
|
-
> Live example: see it at https://time.molten.sh/docs/agents/webmcp
|
|
7
|
+
> Live example: see it at https://time.molten.sh/docs/react/agents/webmcp
|
|
8
8
|
|
|
9
9
|
WebMCP lets a page offer tools to the agent built into a browser, through
|
|
10
10
|
`document.modelContext`. `registerTools` from `@ui-sdk/react/agent` registers the bridge's three
|
package/docs/agents.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
# Agents
|
|
1
|
+
# Agents in your app
|
|
2
2
|
|
|
3
3
|
What an AI agent sees of your calendar, what it can do to it, and where your app stays in charge.
|
|
4
4
|
|
|
5
|
-
Source: https://time.molten.sh/docs/agents
|
|
5
|
+
Source: https://time.molten.sh/docs/react/agents
|
|
6
6
|
|
|
7
|
-
> Live example: see it at https://time.molten.sh/docs/agents
|
|
7
|
+
> Live example: see it at https://time.molten.sh/docs/react/agents
|
|
8
8
|
|
|
9
9
|
An agent is an AI model with tools: the one built into a browser, or one you run and connect to
|
|
10
10
|
your page. Since 2.0 a calendar describes itself to agents. An agent reads the calendar's state and
|
|
@@ -25,7 +25,9 @@ calls a model would send. No model runs on these pages.
|
|
|
25
25
|
|
|
26
26
|
## What an agent sees
|
|
27
27
|
|
|
28
|
-
The bridge's `snapshot()` lists every ui-sdk component on the page. A calendar is one entry
|
|
28
|
+
The bridge's `snapshot()` lists every ui-sdk component on the page. A calendar is one entry, and
|
|
29
|
+
the registry's toolbar adds one for each of its buttons and its view select. A calendar on its own
|
|
30
|
+
is the first, `c1`:
|
|
29
31
|
|
|
30
32
|
```json
|
|
31
33
|
{
|
|
@@ -189,10 +191,10 @@ A model starts with `describeCalendar`. Its result is what the model can't know
|
|
|
189
191
|
```
|
|
190
192
|
|
|
191
193
|
`today` and `now` are in the calendar's time zone, so "tomorrow at ten" needs nothing from your
|
|
192
|
-
prompt. `views` is what `setView` takes
|
|
193
|
-
|
|
194
|
-
entry that isn't one of them fails
|
|
195
|
-
there are.
|
|
194
|
+
prompt. `views` is what `setView` takes: the names of the views this calendar was created with,
|
|
195
|
+
four here. `resources` is what `resourceIds` takes, and `actions` what the calendar offers now, each
|
|
196
|
+
with its input. On a calendar that has resources, a `resourceIds` entry that isn't one of them fails
|
|
197
|
+
with `calendar-agent-unknown-resource`, which lists the ones there are.
|
|
196
198
|
|
|
197
199
|
`listEvents` returns the events themselves, which is where event IDs come from:
|
|
198
200
|
|
package/docs/annotations.md
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Time-based information beside events, such as listening history, sleep, workouts and focus sessions.
|
|
4
4
|
|
|
5
|
-
Source: https://time.molten.sh/docs/annotations
|
|
5
|
+
Source: https://time.molten.sh/docs/react/annotations
|
|
6
6
|
|
|
7
|
-
> Live example of the `week` view: see it at https://time.molten.sh/docs/annotations
|
|
7
|
+
> Live example of the `week` view: see it at https://time.molten.sh/docs/react/annotations
|
|
8
8
|
|
|
9
9
|
Annotations show what happened alongside the events: what you listened to, when you slept, a
|
|
10
10
|
workout, a focus session. Unlike events they are read-only, and they never take part in overlap
|
|
@@ -74,9 +74,10 @@ rail.
|
|
|
74
74
|
- **Days.** An annotation across midnight shows on both days. A part that starts the day before
|
|
75
75
|
fades in at the top and has no icon.
|
|
76
76
|
- **Details.** Hovering a mark shows a tooltip, and clicking it opens a popover listing what it
|
|
77
|
-
merges. Both
|
|
78
|
-
until Escape
|
|
79
|
-
|
|
77
|
+
merges. Both come from the calendar's controls in `components/calendar/ui/`, one of each for the
|
|
78
|
+
whole grid. The popover keeps focus until Escape or its close button, which return focus to where
|
|
79
|
+
it was, or an outside click, which leaves focus where the click put it. Pressing or dragging a
|
|
80
|
+
mark never starts a new event.
|
|
80
81
|
|
|
81
82
|
## Customize
|
|
82
83
|
|
|
@@ -122,8 +123,9 @@ createWeekView<Meeting>({ annotations: { Annotations: MyAnnotations } });
|
|
|
122
123
|
```
|
|
123
124
|
|
|
124
125
|
- `AnnotationMark` has the variants `capsule` (default), `bar` (a thin bar that keeps its true
|
|
125
|
-
length) and `band` (a tint across the column behind events, with `placement: "overlay"`).
|
|
126
|
-
|
|
126
|
+
length) and `band` (a tint across the column behind events, with `placement: "overlay"`). Its
|
|
127
|
+
`render` prop takes an element to render in its place, such as a link to the track, and the
|
|
128
|
+
mark's props merge into it.
|
|
127
129
|
- `AnnotationMarkIcon` draws the source's `Icon`. Children replace it.
|
|
128
130
|
- `useAnnotationMark()` gives any part inside a mark its mark and width.
|
|
129
131
|
|
|
@@ -144,7 +146,7 @@ columns, and `summarizeAnnotationMarks` returns a day's totals per source.
|
|
|
144
146
|
|
|
145
147
|
## Anatomy
|
|
146
148
|
|
|
147
|
-
> Diagram: see it at https://time.molten.sh/docs/annotations
|
|
149
|
+
> Diagram: see it at https://time.molten.sh/docs/react/annotations
|
|
148
150
|
|
|
149
151
|
```txt title="Rendered by TimeGridColumn"
|
|
150
152
|
TimeGridColumn time-grid-column.tsx
|
package/docs/api/changes.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Proposals, changes, results, policies, placement helpers, and the pointer layer.
|
|
4
4
|
|
|
5
|
-
Source: https://time.molten.sh/docs/api/changes
|
|
5
|
+
Source: https://time.molten.sh/docs/react/api/changes
|
|
6
6
|
|
|
7
7
|
Everything on this page is exported from `@moltenship/calendar`. [Interactions](../interactions.md)
|
|
8
8
|
explains how the pieces fit together.
|
|
@@ -121,7 +121,7 @@ that throws rejects the change with the reason `policy-error`.
|
|
|
121
121
|
|
|
122
122
|
## Placement helpers
|
|
123
123
|
|
|
124
|
-
These build placements for proposals, with the same wall-clock rules the
|
|
124
|
+
These build placements for proposals, with the same wall-clock rules the calendar's gestures use.
|
|
125
125
|
|
|
126
126
|
| Function | Returns |
|
|
127
127
|
| ----------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
@@ -161,36 +161,52 @@ the changes `useCalendarPendingChanges` reads.
|
|
|
161
161
|
|
|
162
162
|
`useCalendarPointer(options)` returns a ref for the element that contains a view's days, and turns
|
|
163
163
|
drags inside it into proposals. `attachCalendarPointer(element, getOptions)` does the same without
|
|
164
|
-
|
|
165
|
-
`@moltenship/calendar
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
|
170
|
-
|
|
|
171
|
-
| `
|
|
172
|
-
| `
|
|
173
|
-
| `
|
|
174
|
-
| `
|
|
175
|
-
| `
|
|
176
|
-
| `
|
|
177
|
-
| `
|
|
178
|
-
| `
|
|
179
|
-
| `
|
|
180
|
-
| `
|
|
164
|
+
a framework and returns a cleanup function. `@moltenship/calendar` exports both: the hook comes from
|
|
165
|
+
`@moltenship/calendar-react`, and the function from `@moltenship/calendar-dnd`, which imports no
|
|
166
|
+
framework. `@moltenship/calendar-solid` exports a `useCalendarPointer` that takes the same options,
|
|
167
|
+
or an accessor of them, and passes them on untouched.
|
|
168
|
+
|
|
169
|
+
| Name | Type | Default | Description |
|
|
170
|
+
| ------------------------- | ------------------------------------------------------------------------------------ | ---------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
171
|
+
| `events` | `EventSnapshot` | | Required. The events as rendered, pending changes included: the Renderer's `events` prop. |
|
|
172
|
+
| `onPropose` | `(proposal, { input: "pointer" }) => void \| PromiseLike<CalendarTransactionResult>` | | Required. Receives one proposal per finished drag, and `{ input: "pointer" }`, and one per item dropped in from outside the calendar, with that drag's input. Usually `actions.proposeEventChange`, so `onEventChangeResult` hears the drag as the pointer's. Return the result, as it does, so the announcer says whether the change was saved. |
|
|
173
|
+
| `check` | `(proposal) => CalendarPolicyResult \| null` | | Asks the policies about the drop the preview shows, so the preview can mark it. Pass `actions.checkEventChange`. |
|
|
174
|
+
| `onPreview` | `(draft: { eventId, proposed } \| null) => void` | | Hears where a drop would land, once per change, and `null` when there's nowhere to drop or the gesture ends. Pass `useCalendarDraftReporter()` so `useCalendarDraft` and `useDraftBusy` follow pointer drags. |
|
|
175
|
+
| `timeZone` | `string` | | Required. The calendar's time zone. |
|
|
176
|
+
| `columns` | `readonly TimeGridColumn[]` | | The day columns of a time axis, a time grid's or an hour timeline's: `projection.days.map((day) => day.column)` in a time grid, `projection.columns` in resource columns or an hour timeline. Leave it out in a month grid or a day timeline. |
|
|
177
|
+
| `snap` | `{ increment, smallestUnit, mode? }` | `15 minutes` | The wall-clock grid for times. |
|
|
178
|
+
| `scrollContainer` | `{ current: Element \| null }` | `the nearest scrollable ancestor` | An object whose current is the element to scroll while dragging near its edges. It's read when a drag starts. |
|
|
179
|
+
| `sidewaysScrollContainer` | `{ current: Element \| null }` | `scrollContainer` | An object whose `current` is an element inside `scrollContainer` to scroll in its place at the left and right edges, for a view that scrolls its two axes in two elements. It's read when a drag starts. |
|
|
180
|
+
| `announcer` | `CalendarAnnouncer` | `silent; ranges in the runtime's locale` | Speaks each drag through the root's `Announcer` and labels the drag preview's range the same way. Pass `useCalendarAnnouncer()`. See [pointer gestures](../accessibility.md#pointer-gestures). |
|
|
181
|
+
| `ghostClassName` | `string` | | Extra classes for the drag preview. |
|
|
182
|
+
| `preview` | `"snapped" \| "free"` | `"snapped"` | How the drag preview moves. `"snapped"` draws the event where a drop would land, slot by slot. `"free"` moves a copy of a moved event with the pointer over a marker of where it would land, and slides the copy there on release; a resize or create on a time axis keeps its edge under the pointer. Both propose, check and announce the same snapped placement. See [snapped and free drags](../interactions.md#snapped-and-free-drags). |
|
|
183
|
+
| `disabled` | `boolean` | `false` | Turns gestures off. Pass the Renderer's `isReadOnly`, so a calendar without `onEventChange` starts none. `attachCalendarPointer` also reads it when it attaches, to listen for touch moves only when enabled, so attach again when it changes; `useCalendarPointer` does. |
|
|
181
184
|
|
|
182
185
|
While a gesture runs, the region has `data-interaction="move"`, `"resize"`, or `"create"`, and the
|
|
183
186
|
event being dragged has `data-dragging`. Preview elements have `data-calendar-ghost="event"` or
|
|
184
187
|
`"range"`, and `data-invalid` or `data-warning` when `check` says a policy would reject or flag the
|
|
185
188
|
drop. Range previews read `--calendar-ghost-background` and `--calendar-ghost-radius`, event
|
|
186
189
|
previews `--calendar-ghost-shadow` and `--calendar-ghost-opacity`, and both
|
|
187
|
-
`--calendar-ghost-z-index`.
|
|
190
|
+
`--calendar-ghost-z-index`. The registry's themes put the surface's background under an event
|
|
191
|
+
preview, so a chip of an app's without a background of its own stays readable while it moves; set
|
|
192
|
+
`--calendar-ghost-event-background` to change it. A month's timed chip, see-through at rest, takes
|
|
193
|
+
its event colour while it moves.
|
|
194
|
+
|
|
195
|
+
With `preview: "free"`, the copy that follows the pointer is an event preview too. The marker of
|
|
196
|
+
where the drop would land has `data-calendar-ghost="landing"`, sits one layer below the copy, and
|
|
197
|
+
takes `data-invalid` or `data-warning` like the other previews. It reads
|
|
198
|
+
`--calendar-ghost-landing-background`, `--calendar-ghost-landing-shadow` and
|
|
199
|
+
`--calendar-ghost-radius`. On release the copy has `data-settling` while it slides into place, over
|
|
200
|
+
`--calendar-ghost-settle-duration` (150ms) with `--calendar-ghost-settle-easing` (`ease-out`). Under
|
|
201
|
+
`prefers-reduced-motion: reduce` it doesn't slide, and a theme that sets the duration to `0s` turns
|
|
202
|
+
the slide off too.
|
|
188
203
|
|
|
189
204
|
### Drags from and to the rest of the page
|
|
190
205
|
|
|
191
206
|
These connect the views to drags that start or end outside the calendar, such as tasks dragged in
|
|
192
207
|
from a list or events dragged out to a bin. A drag-and-drop library's binding calls them with the
|
|
193
|
-
points it tracks; [dnd-kit's](./dnd-kit.md) is
|
|
208
|
+
points it tracks; [dnd-kit's](./dnd-kit.md) is
|
|
209
|
+
`@moltenship/calendar-dnd-kit`. Every view that uses
|
|
194
210
|
`useCalendarPointer` takes part, through the options it passes, and read-only views take none.
|
|
195
211
|
|
|
196
212
|
`startCalendarDrop(source, { input? })` follows one item dragged in:
|