style: 移除 emoji, 注释改为中文 (保留专业名词)
- 移除所有 Vue 组件和 README 中的 emoji (按钮文字、标题、功能列表) - 将 src 下所有英文注释改为中文, 保留专业名词 (RRULE, EXDATE, ICS 等) - 涉及文件: date.js, event-factory.js, ical-io.js, organize.js, recur.js, split.js, weekday.js, useCalendar.js, EventDetail.vue, App.vue, DropZone.vue, EventList.vue, HeaderBar.vue, README.md
This commit is contained in:
@@ -1,17 +1,16 @@
|
||||
/**
|
||||
* Event model factory and helpers.
|
||||
* 事件模型工厂与辅助函数。
|
||||
*
|
||||
* The EventModel is the plain-JS shape used throughout the app (see
|
||||
* docs/superpowers/specs/... §4.2). This module centralizes creation
|
||||
* and cloning so that useCalendar.js stays focused on state management.
|
||||
* EventModel 是应用内通用的纯 JS 数据结构 (见 docs/superpowers/specs/...
|
||||
* §4.2)。本模块集中管理事件的创建与克隆, 使 useCalendar.js 专注于状态管理。
|
||||
*/
|
||||
import { todayISO, nowCompactTimestamp } from './date.js'
|
||||
import { genUUID } from './uuid.js'
|
||||
|
||||
/**
|
||||
* Create a new single-occurrence event with sensible defaults.
|
||||
* @param {object} [overrides] - partial fields to override
|
||||
* @returns {object} a fresh EventModel
|
||||
* 创建一个具有合理默认值的单次事件。
|
||||
* @param {object} [overrides] - 需覆盖的部分字段
|
||||
* @returns {object} 一个全新的 EventModel
|
||||
*/
|
||||
export function createEvent(overrides = {}) {
|
||||
return {
|
||||
@@ -31,12 +30,11 @@ export function createEvent(overrides = {}) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Deep-clone an event (or any plain-data object).
|
||||
* 深拷贝一个事件 (或任意纯数据对象)。
|
||||
*
|
||||
* Uses JSON round-trip rather than structuredClone because events may be
|
||||
* wrapped in Vue reactive proxies, which structuredClone cannot handle.
|
||||
* EventModel contains only plain data (strings, arrays, nested objects),
|
||||
* so JSON cloning is safe and lossless here.
|
||||
* 使用 JSON 往返而非 structuredClone, 因为事件可能被 Vue 响应式代理包裹,
|
||||
* structuredClone 无法处理。EventModel 仅含纯数据 (字符串、数组、嵌套对象),
|
||||
* 因此 JSON 拷贝在此是安全且无损的。
|
||||
*/
|
||||
export function cloneEvent(ev) {
|
||||
return JSON.parse(JSON.stringify(ev))
|
||||
|
||||
Reference in New Issue
Block a user