@react-agendfy/plugin-timeline 0.0.0-stage → 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/CHANGELOG.md +46 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.es.js +90 -0
- package/dist/index.umd.js +1 -0
- package/dist/plugin-timeline.css +1 -0
- package/package.json +34 -3
- package/README.md +0 -3
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# @react-agendfy/plugin-timeline
|
|
2
|
+
|
|
3
|
+
## 2.0.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- f9a62af: v2 modernization release. See MIGRATION.md for the full v1 → v2 guide.
|
|
8
|
+
|
|
9
|
+
**@react-agendfy/core (major — breaking):**
|
|
10
|
+
|
|
11
|
+
- Fully typed public API: `CalendarProps`/`Config` no longer accept arbitrary
|
|
12
|
+
keys; `Calendar` is a named export with a working `forwardRef`.
|
|
13
|
+
- CSS class namespace unified to `react-agendfy-*` (old `react-agenfy-*` typo
|
|
14
|
+
and `fc-*` classes removed) — custom CSS overrides must update selectors.
|
|
15
|
+
- New 3-layer design-token system scoped under `.agendfy`
|
|
16
|
+
(`--agendfy-*`; legacy `--color-*`/`--padding-*` names kept via a compat
|
|
17
|
+
layer), OS-aware dark mode, `theme` now applied via a scoped `data-theme`
|
|
18
|
+
attribute on the calendar root instead of mutating `document.documentElement`.
|
|
19
|
+
- Built-in i18n catalog (en, pt, pt-BR, es, fr, ar) with user-config override;
|
|
20
|
+
`lang: 'pt'` now resolves to European Portuguese (use `'pt-BR'` for
|
|
21
|
+
Brazilian). Automatic RTL via `lang` or the new `direction` prop.
|
|
22
|
+
- WCAG 2.1 AA accessibility: grid semantics, roving-tabindex arrow-key
|
|
23
|
+
navigation, keyboard-operable events and drag & drop.
|
|
24
|
+
- Correctness fixes: export crash, horizontal drag discarded as click,
|
|
25
|
+
off-slot events not rendering, multi-day duration collapse on drag, resize
|
|
26
|
+
off-by-one and timezone drift, inert data-source plugins.
|
|
27
|
+
|
|
28
|
+
**@react-agendfy/ai (new):** provider-agnostic AI layer — natural-language
|
|
29
|
+
event parsing (with an offline deterministic fallback), conflict detection and
|
|
30
|
+
free-slot search (deterministic), LLM-assisted scheduling suggestions,
|
|
31
|
+
calendar insights, React hooks, and a Quick Add header plugin. Ships an
|
|
32
|
+
optional Claude adapter and an HTTP adapter for backend proxies.
|
|
33
|
+
|
|
34
|
+
**Plugins (minor):** publish manifests fixed to ship built `dist` output,
|
|
35
|
+
normalized peer dependencies, theme plugin now applies a complete dark token
|
|
36
|
+
set to the calendar root.
|
|
37
|
+
|
|
38
|
+
### Patch Changes
|
|
39
|
+
|
|
40
|
+
- Updated dependencies [f5aa769]
|
|
41
|
+
- Updated dependencies [6fc7fc6]
|
|
42
|
+
- Updated dependencies [89c638a]
|
|
43
|
+
- Updated dependencies [c26c3e0]
|
|
44
|
+
- Updated dependencies [3c59b01]
|
|
45
|
+
- Updated dependencies [f9a62af]
|
|
46
|
+
- @react-agendfy/core@2.0.0
|
package/dist/index.d.ts
ADDED
package/dist/index.es.js
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { jsxs as a, jsx as r, Fragment as h } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as m } from "react";
|
|
3
|
+
const g = ({ resource: i, eventsByResource: s, onEventClick: l, level: n }) => {
|
|
4
|
+
var d;
|
|
5
|
+
const o = (s[i.id] || []).sort(
|
|
6
|
+
(e, t) => new Date(e.start).getTime() - new Date(t.start).getTime()
|
|
7
|
+
);
|
|
8
|
+
return /* @__PURE__ */ a(h, { children: [
|
|
9
|
+
/* @__PURE__ */ a("div", { className: "ag-timeline-resource-row", role: "row", style: { backgroundColor: `rgba(0,0,0,${n * 0.03})` }, children: [
|
|
10
|
+
/* @__PURE__ */ a("div", { className: "ag-timeline-resource-header", role: "rowheader", style: { paddingLeft: `${n * 20 + 10}px` }, children: [
|
|
11
|
+
i.children && i.children.length > 0 && /* @__PURE__ */ r("span", { className: "ag-resource-toggle", children: "▼" }),
|
|
12
|
+
i.title
|
|
13
|
+
] }),
|
|
14
|
+
/* @__PURE__ */ r("div", { className: "ag-timeline-events-lane", role: "gridcell", children: o.map((e) => /* @__PURE__ */ a(
|
|
15
|
+
"button",
|
|
16
|
+
{
|
|
17
|
+
onClick: () => l == null ? void 0 : l(e),
|
|
18
|
+
className: "ag-timeline-event",
|
|
19
|
+
"aria-label": `Event: ${e.title}`,
|
|
20
|
+
style: {
|
|
21
|
+
backgroundColor: e.color || "var(--ag-event-bg-color, #e0eaff)",
|
|
22
|
+
borderLeft: `4px solid ${e.color || "var(--ag-event-border-color, #5a8def)"}`
|
|
23
|
+
},
|
|
24
|
+
children: [
|
|
25
|
+
/* @__PURE__ */ r("div", { className: "ag-event-title", children: e.title }),
|
|
26
|
+
/* @__PURE__ */ a("div", { className: "ag-event-time", children: [
|
|
27
|
+
new Date(e.start).toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" }),
|
|
28
|
+
" -",
|
|
29
|
+
e.end && new Date(e.end).toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" })
|
|
30
|
+
] })
|
|
31
|
+
]
|
|
32
|
+
},
|
|
33
|
+
e.id
|
|
34
|
+
)) })
|
|
35
|
+
] }),
|
|
36
|
+
(d = i.children) == null ? void 0 : d.map((e) => /* @__PURE__ */ r(
|
|
37
|
+
g,
|
|
38
|
+
{
|
|
39
|
+
resource: e,
|
|
40
|
+
eventsByResource: s,
|
|
41
|
+
onEventClick: l,
|
|
42
|
+
level: n + 1
|
|
43
|
+
},
|
|
44
|
+
e.id
|
|
45
|
+
))
|
|
46
|
+
] });
|
|
47
|
+
}, p = ({
|
|
48
|
+
events: i,
|
|
49
|
+
resources: s = [],
|
|
50
|
+
currentDate: l,
|
|
51
|
+
onEventClick: n
|
|
52
|
+
}) => {
|
|
53
|
+
const o = m(() => {
|
|
54
|
+
const e = {};
|
|
55
|
+
for (const t of i) {
|
|
56
|
+
const u = t.resourceIds || (t.resourceId ? [t.resourceId] : ["unassigned"]);
|
|
57
|
+
for (const c of u)
|
|
58
|
+
e[c] || (e[c] = []), e[c].push(t);
|
|
59
|
+
}
|
|
60
|
+
return e;
|
|
61
|
+
}, [i]), d = m(() => {
|
|
62
|
+
const e = [...s];
|
|
63
|
+
return o.unassigned && e.push({
|
|
64
|
+
id: "unassigned",
|
|
65
|
+
title: "Unassigned"
|
|
66
|
+
}), e;
|
|
67
|
+
}, [s, o]);
|
|
68
|
+
return /* @__PURE__ */ a("div", { className: "ag-timeline-view", role: "grid", "aria-label": "Resource Timeline", children: [
|
|
69
|
+
d.map((e) => /* @__PURE__ */ r(
|
|
70
|
+
g,
|
|
71
|
+
{
|
|
72
|
+
resource: e,
|
|
73
|
+
eventsByResource: o,
|
|
74
|
+
onEventClick: n,
|
|
75
|
+
level: 0
|
|
76
|
+
},
|
|
77
|
+
e.id
|
|
78
|
+
)),
|
|
79
|
+
d.length === 0 && /* @__PURE__ */ r("div", { className: "ag-timeline-empty", children: /* @__PURE__ */ r("p", { children: "No resources to display." }) })
|
|
80
|
+
] });
|
|
81
|
+
}, N = {
|
|
82
|
+
key: "timeline-view",
|
|
83
|
+
type: "view",
|
|
84
|
+
viewName: "timeline",
|
|
85
|
+
component: p,
|
|
86
|
+
props: { label: "Timeline" }
|
|
87
|
+
};
|
|
88
|
+
export {
|
|
89
|
+
N as default
|
|
90
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(i,s){typeof exports=="object"&&typeof module<"u"?module.exports=s(require("react/jsx-runtime"),require("react")):typeof define=="function"&&define.amd?define(["react/jsx-runtime","react"],s):(i=typeof globalThis<"u"?globalThis:i||self,i.ReactAgendfyTimeline=s(i.jsxRuntime,i.React))})(this,(function(i,s){"use strict";const g=({resource:r,eventsByResource:n,onEventClick:a,level:o})=>{var d;const l=(n[r.id]||[]).sort((e,t)=>new Date(e.start).getTime()-new Date(t.start).getTime());return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"ag-timeline-resource-row",role:"row",style:{backgroundColor:`rgba(0,0,0,${o*.03})`},children:[i.jsxs("div",{className:"ag-timeline-resource-header",role:"rowheader",style:{paddingLeft:`${o*20+10}px`},children:[r.children&&r.children.length>0&&i.jsx("span",{className:"ag-resource-toggle",children:"▼"}),r.title]}),i.jsx("div",{className:"ag-timeline-events-lane",role:"gridcell",children:l.map(e=>i.jsxs("button",{onClick:()=>a==null?void 0:a(e),className:"ag-timeline-event","aria-label":`Event: ${e.title}`,style:{backgroundColor:e.color||"var(--ag-event-bg-color, #e0eaff)",borderLeft:`4px solid ${e.color||"var(--ag-event-border-color, #5a8def)"}`},children:[i.jsx("div",{className:"ag-event-title",children:e.title}),i.jsxs("div",{className:"ag-event-time",children:[new Date(e.start).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})," -",e.end&&new Date(e.end).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})]})]},e.id))})]}),(d=r.children)==null?void 0:d.map(e=>i.jsx(g,{resource:e,eventsByResource:n,onEventClick:a,level:o+1},e.id))]})};return{key:"timeline-view",type:"view",viewName:"timeline",component:({events:r,resources:n=[],currentDate:a,onEventClick:o})=>{const l=s.useMemo(()=>{const e={};for(const t of r){const m=t.resourceIds||(t.resourceId?[t.resourceId]:["unassigned"]);for(const c of m)e[c]||(e[c]=[]),e[c].push(t)}return e},[r]),d=s.useMemo(()=>{const e=[...n];return l.unassigned&&e.push({id:"unassigned",title:"Unassigned"}),e},[n,l]);return i.jsxs("div",{className:"ag-timeline-view",role:"grid","aria-label":"Resource Timeline",children:[d.map(e=>i.jsx(g,{resource:e,eventsByResource:l,onEventClick:o,level:0},e.id)),d.length===0&&i.jsx("div",{className:"ag-timeline-empty",children:i.jsx("p",{children:"No resources to display."})})]})},props:{label:"Timeline"}}}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.ag-timeline-view{display:flex;flex-direction:column;width:100%}.ag-timeline-empty{padding:var(--padding-1rem);text-align:center;color:var(--color-text-gray-700)}.ag-timeline-resource-row{display:flex;flex-direction:column;border-bottom:1px solid var(--color-border-gray-300)}.ag-timeline-resource-header{font-weight:700;padding:var(--padding-0_5rem);background-color:var(--color-bg-gray-50);border-bottom:1px solid var(--color-border-gray-300);cursor:pointer;-webkit-user-select:none;user-select:none;display:flex;align-items:center;gap:var(--gap-0_5rem)}.ag-resource-toggle{font-size:var(--font-size-sm)}.ag-timeline-events-lane{position:relative;min-height:2.5rem;display:flex;flex-direction:column;gap:var(--gap-0_5rem);padding:var(--padding-0_5rem)}.ag-timeline-event{display:flex;flex-direction:column;justify-content:center;padding:var(--baseevent-padding-small);border-radius:var(--baseevent-border-radius-small);font-size:var(--baseevent-time-font-size-medium);color:var(--color-text-white);background-color:var(--color-bg-blue-50);border-left:4px solid var(--color-bg-view-btn-active);cursor:pointer;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;transition:background-color var(--transition-duration) var(--transition-timing)}.ag-timeline-event:hover{background-color:var(--color-bg-hover)}.ag-event-title{font-weight:500}.ag-event-time{font-size:var(--font-size-xs);color:var(--color-text-gray-500)}
|
package/package.json
CHANGED
|
@@ -1,6 +1,37 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-agendfy/plugin-timeline",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "2.0.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"files": [
|
|
6
|
+
"dist"
|
|
7
|
+
],
|
|
8
|
+
"main": "./dist/index.umd.js",
|
|
9
|
+
"module": "./dist/index.es.js",
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"import": "./dist/index.es.js",
|
|
14
|
+
"require": "./dist/index.umd.js",
|
|
15
|
+
"types": "./dist/index.d.ts"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"scripts": {
|
|
19
|
+
"build": "vite build",
|
|
20
|
+
"dev": "vite",
|
|
21
|
+
"preview": "vite preview"
|
|
22
|
+
},
|
|
23
|
+
"peerDependencies": {
|
|
24
|
+
"@react-agendfy/core": "^2.0.0",
|
|
25
|
+
"react": "^18 || ^19",
|
|
26
|
+
"react-dom": "^18 || ^19"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"@vitejs/plugin-react": "^4.0.0",
|
|
30
|
+
"typescript": "^5.7.3",
|
|
31
|
+
"vite": "^6.1.0",
|
|
32
|
+
"vite-plugin-dts": "^3.0.0"
|
|
33
|
+
},
|
|
34
|
+
"publishConfig": {
|
|
35
|
+
"access": "public"
|
|
36
|
+
}
|
|
6
37
|
}
|
package/README.md
DELETED