timeline-canvas 1.5.0 → 1.6.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/LICENSE +21 -0
- package/README.md +3 -0
- package/README_CN.md +3 -0
- package/dist/{ContextMenuPlugin-C84Iiz8U.d.mts → ContextMenuPlugin-BRv4YT-G.d.mts} +1 -1
- package/dist/{DarkThemePlugin-YD-fFNVt.d.mts → DarkThemePlugin-DN2gKMxW.d.mts} +1 -1
- package/dist/{EventMediaPlugin-BiG8wzdz.d.mts → EventMediaPlugin-B1YKwQ8_.d.mts} +1 -1
- package/dist/{EventTooltipPlugin-r1624PXo.d.mts → EventTooltipPlugin-CVvSszzY.d.mts} +1 -1
- package/dist/{LightThemePlugin-CGDyxruq.d.mts → LightThemePlugin-DOaW67ZR.d.mts} +1 -1
- package/dist/{PerformanceOverlayPlugin-DDmW-ils.d.mts → PerformanceOverlayPlugin-BrIN19DR.d.mts} +1 -1
- package/dist/builtin-plugin/ContextMenuPlugin.d.mts +1 -1
- package/dist/builtin-plugin/DarkThemePlugin.d.mts +1 -1
- package/dist/builtin-plugin/EventMediaPlugin.d.mts +1 -1
- package/dist/builtin-plugin/EventTooltipPlugin.d.mts +1 -1
- package/dist/builtin-plugin/LightThemePlugin.d.mts +1 -1
- package/dist/builtin-plugin/MutexGuardPlugin.d.mts +1 -1
- package/dist/builtin-plugin/PerformanceOverlayPlugin.d.mts +1 -1
- package/dist/index.d.mts +8 -8
- package/dist/index.mjs +1 -1
- package/dist/{types-Ch6RMCi9.d.mts → types-KQ5C-I-e.d.mts} +491 -4
- package/package.json +12 -13
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Sky
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -17,6 +17,9 @@ A powerful, high-performance timeline component built with HTML5 Canvas and Type
|
|
|
17
17
|
- 📏 **Smart Guides**: Alignment guides and snapping for precise event placement.
|
|
18
18
|
- ⏱️ **Time Indicator**: Draggable time head with snapping support.
|
|
19
19
|
- 🔌 **Plugin System**: Extensible architecture with built-in plugins for themes, context menus, and more.
|
|
20
|
+
- 🧭 **Resource scheduling (new in 1.6)**: optional `businessId` on events/tracks, strict atomic import/export (`loadScheduleData`/`exportScheduleData`), incremental upsert/patch/delete by business identity, a viewport snapshot subscription, and a unified `renderEventContent` hook covering normal, drag and resize phases.
|
|
21
|
+
- 📨 **Optional async editing protocol** (`scheduleEditing`): candidate preview, typed validation, single-commit settlement with server correction, unknown-result reconciliation and per-event edit state.
|
|
22
|
+
|
|
20
23
|
- 📝 **TypeScript**: Written in TypeScript with full type definitions.
|
|
21
24
|
|
|
22
25
|
## Installation
|
package/README_CN.md
CHANGED
|
@@ -17,6 +17,9 @@
|
|
|
17
17
|
- 📏 **智能辅助线**: 对齐辅助线和吸附功能,实现精确的事件放置。
|
|
18
18
|
- ⏱️ **时间指示器**: 可拖动的时间头,支持吸附。
|
|
19
19
|
- 🔌 **插件系统**: 可扩展架构,内置主题、右键菜单等插件。
|
|
20
|
+
- 🧭 **资源排程(1.6 新增)**: 事件/轨道可选 `businessId`,严格原子导入导出(`loadScheduleData`/`exportScheduleData`),按业务身份的增量 upsert/patch/删除,视口快照订阅,以及覆盖普通/拖动/拉伸阶段的统一 `renderEventContent` 内容入口。
|
|
21
|
+
- 📨 **可选异步编辑协议**(`scheduleEditing`):候选预览、typed 校验、单次提交结算与服务器修正、未知结果权威核对、单事件编辑状态查询。
|
|
22
|
+
|
|
20
23
|
- 📝 **TypeScript**: 使用 TypeScript 编写,提供完整的类型定义。
|
|
21
24
|
|
|
22
25
|
## 安装
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as TimelinePlugin } from "./types-
|
|
1
|
+
import { d as TimelinePlugin } from "./types-KQ5C-I-e.mjs";
|
|
2
2
|
//#region src/plugins/builtin/EventTooltipPlugin.d.ts
|
|
3
3
|
interface EventTooltipPluginOptions {
|
|
4
4
|
/** 自定义 HTML 模板函数,接收事件标题,返回 HTML 字符串。传入此参数将自动启用 HTML 渲染模式 */
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as ContextMenuPlugin } from "../ContextMenuPlugin-
|
|
1
|
+
import { t as ContextMenuPlugin } from "../ContextMenuPlugin-BRv4YT-G.mjs";
|
|
2
2
|
export { ContextMenuPlugin };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as DarkThemePlugin } from "../DarkThemePlugin-
|
|
1
|
+
import { t as DarkThemePlugin } from "../DarkThemePlugin-DN2gKMxW.mjs";
|
|
2
2
|
export { DarkThemePlugin as DarkTheme, DarkThemePlugin };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as EventMediaPlugin } from "../EventMediaPlugin-
|
|
1
|
+
import { t as EventMediaPlugin } from "../EventMediaPlugin-B1YKwQ8_.mjs";
|
|
2
2
|
export { EventMediaPlugin };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as EventTooltipPlugin } from "../EventTooltipPlugin-
|
|
1
|
+
import { t as EventTooltipPlugin } from "../EventTooltipPlugin-CVvSszzY.mjs";
|
|
2
2
|
export { EventTooltipPlugin };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as LightThemePlugin } from "../LightThemePlugin-
|
|
1
|
+
import { t as LightThemePlugin } from "../LightThemePlugin-DOaW67ZR.mjs";
|
|
2
2
|
export { LightThemePlugin as LightTheme, LightThemePlugin };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as PerformanceOverlayPlugin } from "../PerformanceOverlayPlugin-
|
|
1
|
+
import { t as PerformanceOverlayPlugin } from "../PerformanceOverlayPlugin-BrIN19DR.mjs";
|
|
2
2
|
export { PerformanceOverlayPlugin };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
import { t as ContextMenuPlugin } from "./ContextMenuPlugin-
|
|
3
|
-
import { t as DarkThemePlugin } from "./DarkThemePlugin-
|
|
4
|
-
import { t as EventMediaPlugin } from "./EventMediaPlugin-
|
|
5
|
-
import { t as EventTooltipPlugin } from "./EventTooltipPlugin-
|
|
6
|
-
import { t as LightThemePlugin } from "./LightThemePlugin-
|
|
7
|
-
import { t as PerformanceOverlayPlugin } from "./PerformanceOverlayPlugin-
|
|
1
|
+
import { $ as ScheduleValidationResult, A as EventMoveData, B as ScheduleEditDraft, C as EventAddData, D as EventContentRenderContext, E as EventContentRect, F as ScheduleChange, G as ScheduleErrorCode, H as ScheduleEditState, I as ScheduleCommitResult, J as ScheduleEventPatch, K as ScheduleEventInput, L as ScheduleCommitStateData, M as EventUpdateData, N as InteractionTarget, O as EventDeleteData, P as LoadDataFormat, Q as ScheduleTrackInput, R as ScheduleCommitStateKind, S as ContextMenuStyle, T as EventContentPhase, U as ScheduleEditingOptions, V as ScheduleEditSnapshot, W as ScheduleError, X as SchedulePlacement, Y as ScheduleEventUpsert, Z as ScheduleResult, _ as translateTimelineConfig, a as PluginLocalizedText, at as TimelineI18nMessages, b as ContextMenuData, c as PluginType, ct as TimelineOptions, d as TimelinePlugin, dt as Track, et as TimeIndicatorMoveData, f as Timeline, ft as TrackRect, g as normalizeTimelineLocale, h as createTimelineMessages, i as PluginContext, it as TimelineEvent, j as EventTextStyle, k as EventEditData, l as RenderLayer, lt as TimelineState, m as createDefaultContextMenuItems, mt as ZoomData, n as CoreRenderTarget, nt as TimelineColors, o as PluginMetadata, ot as TimelineLocale, p as ChangeType, pt as ViewportListener, q as ScheduleEventLocation, r as PluginAPI, rt as TimelineConfig, s as PluginPriority, st as TimelineMessageParams, t as CoreLayerHook, tt as TimelineCallbacks, u as RenderLayerPosition, ut as TimelineViewportSnapshot, v as translateTimelineMessage, w as EventClickData, x as ContextMenuItem, y as BusinessId, z as ScheduleDataFormat } from "./types-KQ5C-I-e.mjs";
|
|
2
|
+
import { t as ContextMenuPlugin } from "./ContextMenuPlugin-BRv4YT-G.mjs";
|
|
3
|
+
import { t as DarkThemePlugin } from "./DarkThemePlugin-DN2gKMxW.mjs";
|
|
4
|
+
import { t as EventMediaPlugin } from "./EventMediaPlugin-B1YKwQ8_.mjs";
|
|
5
|
+
import { t as EventTooltipPlugin } from "./EventTooltipPlugin-CVvSszzY.mjs";
|
|
6
|
+
import { t as LightThemePlugin } from "./LightThemePlugin-DOaW67ZR.mjs";
|
|
7
|
+
import { t as PerformanceOverlayPlugin } from "./PerformanceOverlayPlugin-BrIN19DR.mjs";
|
|
8
8
|
//#region src/utils/time.d.ts
|
|
9
9
|
declare function formatTime(seconds: number, showSeconds?: boolean): string;
|
|
10
10
|
declare function getCurrentTime(): number;
|
|
@@ -14,4 +14,4 @@ declare function formatDuration(duration: number, label?: string): string;
|
|
|
14
14
|
//#region src/plugins/metadata.d.ts
|
|
15
15
|
declare function getPluginMetadataDescription(metadata: PluginMetadata, locale?: string): string;
|
|
16
16
|
//#endregion
|
|
17
|
-
export { type ChangeType, type ContextMenuData, type ContextMenuItem, ContextMenuPlugin, type ContextMenuStyle, type CoreLayerHook, type CoreRenderTarget, DarkThemePlugin, type EventAddData, type EventClickData, type EventDeleteData, type EventEditData, EventMediaPlugin, type EventMoveData, type EventTextStyle, EventTooltipPlugin, type EventUpdateData, type InteractionTarget, LightThemePlugin, type LoadDataFormat, PerformanceOverlayPlugin, type PluginAPI, type PluginContext, type PluginLocalizedText, type PluginMetadata, PluginPriority, PluginType, type RenderLayer, type RenderLayerPosition, type TimeIndicatorMoveData, Timeline, type TimelineCallbacks, type TimelineColors, type TimelineConfig, type TimelineEvent, type TimelineI18nMessages, type TimelineLocale, type TimelineMessageParams, type TimelineOptions, type TimelinePlugin, type TimelineState, type Track, type ZoomData, createDefaultContextMenuItems, createTimelineMessages, formatDuration, formatTime, formatTimeRange, getCurrentTime, getPluginMetadataDescription, normalizeTimelineLocale, translateTimelineConfig, translateTimelineMessage };
|
|
17
|
+
export { type BusinessId, type ChangeType, type ContextMenuData, type ContextMenuItem, ContextMenuPlugin, type ContextMenuStyle, type CoreLayerHook, type CoreRenderTarget, DarkThemePlugin, type EventAddData, type EventClickData, type EventContentPhase, type EventContentRect, type EventContentRenderContext, type EventDeleteData, type EventEditData, EventMediaPlugin, type EventMoveData, type EventTextStyle, EventTooltipPlugin, type EventUpdateData, type InteractionTarget, LightThemePlugin, type LoadDataFormat, PerformanceOverlayPlugin, type PluginAPI, type PluginContext, type PluginLocalizedText, type PluginMetadata, PluginPriority, PluginType, type RenderLayer, type RenderLayerPosition, type ScheduleChange, type ScheduleCommitResult, type ScheduleCommitStateData, type ScheduleCommitStateKind, type ScheduleDataFormat, type ScheduleEditDraft, type ScheduleEditSnapshot, type ScheduleEditState, type ScheduleEditingOptions, type ScheduleError, type ScheduleErrorCode, type ScheduleEventInput, type ScheduleEventLocation, type ScheduleEventPatch, type ScheduleEventUpsert, type SchedulePlacement, type ScheduleResult, type ScheduleTrackInput, type ScheduleValidationResult, type TimeIndicatorMoveData, Timeline, type TimelineCallbacks, type TimelineColors, type TimelineConfig, type TimelineEvent, type TimelineI18nMessages, type TimelineLocale, type TimelineMessageParams, type TimelineOptions, type TimelinePlugin, type TimelineState, type TimelineViewportSnapshot, type Track, type TrackRect, type ViewportListener, type ZoomData, createDefaultContextMenuItems, createTimelineMessages, formatDuration, formatTime, formatTimeRange, getCurrentTime, getPluginMetadataDescription, normalizeTimelineLocale, translateTimelineConfig, translateTimelineMessage };
|