@toantranmei/editor 0.3.1 → 0.4.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 +82 -1
- package/dist/collaboration.js +205 -19
- package/dist/collaboration.js.map +1 -1
- package/dist/{css-el97DJfy.js → css-Cf_w91Fs.js} +26 -11
- package/dist/css-Cf_w91Fs.js.map +1 -0
- package/dist/{date-utils-DW99lT2W.js → date-utils-CevhhRfQ.js} +22 -4
- package/dist/date-utils-CevhhRfQ.js.map +1 -0
- package/dist/index.js +2058 -1621
- package/dist/index.js.map +1 -1
- package/dist/nuxt.js +2 -1
- package/dist/nuxt.js.map +1 -1
- package/dist/render.js +200 -182
- package/dist/render.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/collaboration.d.ts +9 -1
- package/dist/types/components/MeiEditor.vue.d.ts +3 -2
- package/dist/types/composables/useUploadState.d.ts +10 -0
- package/dist/types/config.d.ts +5 -2
- package/dist/types/extensions/block-drop.d.ts +23 -0
- package/dist/types/extensions/file-block.d.ts +5 -2
- package/dist/types/extensions/file-drop.d.ts +65 -0
- package/dist/types/extensions/index.d.ts +1 -1
- package/dist/types/extensions/upload-attrs.d.ts +29 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/locale.d.ts +9 -0
- package/dist/types/presence.d.ts +39 -0
- package/dist/types/render/index.d.ts +18 -3
- package/dist/types/theme/css.d.ts +3 -0
- package/dist/types/theme/tokens.d.ts +4 -0
- package/package.json +1 -1
- package/dist/css-el97DJfy.js.map +0 -1
- package/dist/date-utils-DW99lT2W.js.map +0 -1
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { Extension } from '@tiptap/core';
|
|
2
|
+
import type { Node as PMNode } from '@tiptap/pm/model';
|
|
2
3
|
import { PluginKey } from '@tiptap/pm/state';
|
|
4
|
+
import type { EditorView } from '@tiptap/pm/view';
|
|
3
5
|
export interface BlockDropOptions {
|
|
4
6
|
/** Node types whose direct children are "blocks" you can drop between. */
|
|
5
7
|
containers: string[];
|
|
@@ -18,6 +20,27 @@ declare module '@tiptap/core' {
|
|
|
18
20
|
}
|
|
19
21
|
}
|
|
20
22
|
export declare const blockDropKey: PluginKey<any>;
|
|
23
|
+
/** A block under (or nearest to) a point: its container, and whether the point is in the block's top half. */
|
|
24
|
+
export interface BlockAtPoint {
|
|
25
|
+
container: PMNode;
|
|
26
|
+
/** -1 for the doc. */
|
|
27
|
+
containerPos: number;
|
|
28
|
+
block: {
|
|
29
|
+
node: PMNode;
|
|
30
|
+
pos: number;
|
|
31
|
+
rect: DOMRect;
|
|
32
|
+
};
|
|
33
|
+
/** False when the point is below every block (`block` is then the last one). */
|
|
34
|
+
hit: boolean;
|
|
35
|
+
before: boolean;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Geometry-only lookup (`posAtCoords` fails over node views, gaps and the gutter): the container under the point
|
|
39
|
+
* (a column or the doc), then its child block at the point's height, or the last one.
|
|
40
|
+
*/
|
|
41
|
+
export declare function blockAtPoint(view: EditorView, x: number, y: number, containers?: string[]): BlockAtPoint | null;
|
|
42
|
+
/** Position between blocks nearest to a point (before / after the block at its height). */
|
|
43
|
+
export declare function blockGapAtPoint(view: EditorView, x: number, y: number, containers?: string[]): number | null;
|
|
21
44
|
/**
|
|
22
45
|
* Notion-style drop for blocks dragged from the drag handle:
|
|
23
46
|
* - between blocks (top level or in a column), never inside a list item by accident;
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { Node } from '@tiptap/core';
|
|
2
2
|
export type FileKind = 'file' | 'audio' | 'video';
|
|
3
3
|
export interface FileBlockOptions {
|
|
4
|
-
/**
|
|
5
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Uploads a file and resolves to its URL. Without it files are inlined as base64.
|
|
6
|
+
* `onProgress` (0..1) is optional to call: the block shows it while the upload runs.
|
|
7
|
+
*/
|
|
8
|
+
upload: ((file: File, kind: FileKind, onProgress?: (fraction: number) => void) => Promise<string>) | null;
|
|
6
9
|
/** Max size in MB. */
|
|
7
10
|
maxSize: number;
|
|
8
11
|
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { Extension, type Editor } from '@tiptap/core';
|
|
2
|
+
/** Why an upload placeholder could not become a real image / file. */
|
|
3
|
+
export type UploadError = 'tooLarge' | 'badType' | 'failed';
|
|
4
|
+
/** Local state of a pasted / dropped file while it uploads (never in the document). */
|
|
5
|
+
export interface PendingUpload {
|
|
6
|
+
/** Kept so "Retry" can send it again. */
|
|
7
|
+
file: File;
|
|
8
|
+
/** `blob:` URL of an image, shown until the upload resolves. */
|
|
9
|
+
preview: string | null;
|
|
10
|
+
/** 0..1, when the uploader reports progress. */
|
|
11
|
+
progress: number;
|
|
12
|
+
}
|
|
13
|
+
export interface FileDropStorage {
|
|
14
|
+
/** Pending uploads by the node's `uploadId` attribute. */
|
|
15
|
+
uploads: Map<string, PendingUpload>;
|
|
16
|
+
/** Uploads still running, by `uploadId`: settled once their result is written ({@link uploadsSettled}). */
|
|
17
|
+
running: Map<string, Promise<void>>;
|
|
18
|
+
/** Local time each other-tab upload (`uploadId`) was first seen here, for `uploadStaleAt` (not reactive). */
|
|
19
|
+
firstSeen: Map<string, number>;
|
|
20
|
+
}
|
|
21
|
+
declare module '@tiptap/core' {
|
|
22
|
+
interface Storage {
|
|
23
|
+
fileDrop: FileDropStorage;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
/** An `uploading` node without a local upload and older than this is shown as interrupted (its tab closed). */
|
|
27
|
+
export declare const UPLOAD_STALE_MS: number;
|
|
28
|
+
/**
|
|
29
|
+
* How a node's upload looks in this tab:
|
|
30
|
+
* - `local`: this tab owns the file (progress, Delete, Retry on error);
|
|
31
|
+
* - `remote`: another tab is uploading it (message only);
|
|
32
|
+
* - `interrupted`: `uploading` for longer than `UPLOAD_STALE_MS` with nobody here owning it (Delete for editors);
|
|
33
|
+
* - null: no upload.
|
|
34
|
+
*/
|
|
35
|
+
export type UploadState = 'local' | 'remote' | 'interrupted' | null;
|
|
36
|
+
export declare function uploadState(editor: Editor, attrs: Record<string, unknown>, now?: number): UploadState;
|
|
37
|
+
/**
|
|
38
|
+
* When an `uploading` node without a local file becomes interrupted (ms, local clock). `uploadStartedAt` comes from
|
|
39
|
+
* another machine whose clock may differ, so the countdown never starts before this tab first saw the upload:
|
|
40
|
+
* `max(firstSeenHere, min(uploadStartedAt, firstSeenHere)) + UPLOAD_STALE_MS`, i.e. 2 minutes after first seen, fixed. Nodes without an `uploadId` (duplicates,
|
|
41
|
+
* older documents) only use `uploadStartedAt`.
|
|
42
|
+
*/
|
|
43
|
+
export declare function uploadStaleAt(editor: Editor, attrs: Record<string, unknown>, now?: number): number;
|
|
44
|
+
/** The pending upload of a node (reactive), or null (another tab's upload, or none). Also one started by an earlier
|
|
45
|
+
* editor of this page, destroyed while it uploads. */
|
|
46
|
+
export declare function pendingUpload(editor: Editor, uploadId: unknown): PendingUpload | null;
|
|
47
|
+
/**
|
|
48
|
+
* Resolves once every upload running for this editor has written its result (its `src`, or its error), also after
|
|
49
|
+
* the editor is destroyed; null when none is running. Counts the uploads this editor started and, for a collaborative
|
|
50
|
+
* editor, every upload still running on its Yjs document (started by an earlier editor of it). A collaborative editor
|
|
51
|
+
* destroyed meanwhile writes the result into its Yjs document: keep that document open (and saved, synced) until
|
|
52
|
+
* then, e.g. close it in `.finally()`. A plain (`v-model`) editor destroyed meanwhile cannot keep the result.
|
|
53
|
+
*/
|
|
54
|
+
export declare function uploadsSettled(editor: Editor): Promise<void> | null;
|
|
55
|
+
/**
|
|
56
|
+
* Validates and uploads the file of a placeholder node, then sets its `src` (or `error`).
|
|
57
|
+
* Also used by the node views' "Retry" button.
|
|
58
|
+
*/
|
|
59
|
+
export declare function runUpload(editor: Editor, uploadId: string): Promise<void>;
|
|
60
|
+
/**
|
|
61
|
+
* Paste or drop images and files anywhere in the editor: each file becomes an image block (with an instant preview)
|
|
62
|
+
* or a file block, uploaded through `uploadImage` / `fileBlock.upload`. Failures stay on the block with a Retry.
|
|
63
|
+
* Runs before `markdownPaste`; pastes with text or web images keep the regular path.
|
|
64
|
+
*/
|
|
65
|
+
export declare const FileDrop: Extension<Record<string, never>, FileDropStorage>;
|
|
@@ -12,7 +12,7 @@ export interface MeiExtensionsOptions extends Partial<MeiConfigStorage> {
|
|
|
12
12
|
}
|
|
13
13
|
/**
|
|
14
14
|
* Editor core (always loaded) + the extensions of the given blocks.
|
|
15
|
-
* Core: paragraphs, text marks, links, history, colors, slash menu, drag & drop,
|
|
15
|
+
* Core: paragraphs, text marks, links, history, colors, slash menu, drag & drop, file paste / drop,
|
|
16
16
|
* block selection, block ids and the unknown-block fallback.
|
|
17
17
|
*/
|
|
18
18
|
export declare function createExtensions({ blocks, undoRedo, ...config }: MeiExtensionsOptions): AnyExtension[];
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Transient attributes of an image / file block created by paste or drop (see `FileDrop`). Never rendered to HTML
|
|
3
|
+
* nor parsed from it, so copies and exports never carry an upload in progress.
|
|
4
|
+
*/
|
|
5
|
+
export declare function uploadAttributes(): {
|
|
6
|
+
/** Key of the pending upload in `editor.storage.fileDrop.uploads` (this tab only). */
|
|
7
|
+
uploadId: {
|
|
8
|
+
default: null;
|
|
9
|
+
rendered: boolean;
|
|
10
|
+
parseHTML: () => null;
|
|
11
|
+
};
|
|
12
|
+
uploading: {
|
|
13
|
+
default: boolean;
|
|
14
|
+
rendered: boolean;
|
|
15
|
+
parseHTML: () => boolean;
|
|
16
|
+
};
|
|
17
|
+
/** When the upload started (ms epoch). An `uploading` node older than 2 minutes counts as interrupted. */
|
|
18
|
+
uploadStartedAt: {
|
|
19
|
+
default: null;
|
|
20
|
+
rendered: boolean;
|
|
21
|
+
parseHTML: () => null;
|
|
22
|
+
};
|
|
23
|
+
/** `'tooLarge' | 'badType' | 'failed'` when the upload could not finish. */
|
|
24
|
+
error: {
|
|
25
|
+
default: null;
|
|
26
|
+
rendered: boolean;
|
|
27
|
+
parseHTML: () => null;
|
|
28
|
+
};
|
|
29
|
+
};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export { MeiEditorPlugin, type MeiEditorPluginOptions } from './plugin';
|
|
|
4
4
|
export { createExtensions, type MeiExtensionsOptions } from './extensions';
|
|
5
5
|
export { MeiConfig, type ImageUploader, type MeiConfigStorage } from './config';
|
|
6
6
|
export { BlockDrop } from './extensions/block-drop';
|
|
7
|
+
export { FileDrop, pendingUpload, runUpload, uploadsSettled, type FileDropStorage, type PendingUpload, type UploadError, } from './extensions/file-drop';
|
|
7
8
|
export { Callout } from './extensions/callout';
|
|
8
9
|
export { Column, Columns } from './extensions/columns';
|
|
9
10
|
export { ImageBlock } from './extensions/image-block';
|
|
@@ -36,4 +37,5 @@ export { blockNodeView } from './nodeviews/renderer';
|
|
|
36
37
|
export { useClickOutside } from './composables/useClickOutside';
|
|
37
38
|
export { useEditable } from './composables/useEditable';
|
|
38
39
|
export { useScope } from './composables/useScope';
|
|
40
|
+
export type { MeiCollaboration, MeiPresence, PresenceUser } from './collaboration';
|
|
39
41
|
export type { Editor, JSONContent } from '@tiptap/vue-3';
|
package/dist/types/locale.d.ts
CHANGED
|
@@ -68,6 +68,11 @@ export interface EditorMessages {
|
|
|
68
68
|
caption: string;
|
|
69
69
|
uploading: string;
|
|
70
70
|
uploadFailed: string;
|
|
71
|
+
/** Pasted / dropped image in a format browsers can't show (HEIC, TIFF…). */
|
|
72
|
+
badType: string;
|
|
73
|
+
retry: string;
|
|
74
|
+
/** An upload whose tab went away (still "uploading" after 2 minutes). */
|
|
75
|
+
uploadInterrupted: string;
|
|
71
76
|
align: string;
|
|
72
77
|
alignments: {
|
|
73
78
|
left: string;
|
|
@@ -179,6 +184,10 @@ export interface EditorMessages {
|
|
|
179
184
|
invalidLink: string;
|
|
180
185
|
uploading: string;
|
|
181
186
|
download: string;
|
|
187
|
+
retry: string;
|
|
188
|
+
/** An upload whose tab went away (still "uploading" after 2 minutes). */
|
|
189
|
+
uploadInterrupted: string;
|
|
190
|
+
delete: string;
|
|
182
191
|
};
|
|
183
192
|
datePicker: {
|
|
184
193
|
endDate: string;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { type Editor, Extension } from '@tiptap/core';
|
|
2
|
+
import type { Awareness } from 'y-protocols/awareness';
|
|
3
|
+
/** Who a remote caret belongs to. */
|
|
4
|
+
export interface PresenceUser {
|
|
5
|
+
name: string;
|
|
6
|
+
/** CSS colour of the caret, selection and active block (e.g. `presenceColor(i)`). */
|
|
7
|
+
color: string;
|
|
8
|
+
avatarUrl?: string | null;
|
|
9
|
+
}
|
|
10
|
+
/** `MeiCollaboration.presence`: remote carets and selections over a `y-protocols` awareness. */
|
|
11
|
+
export interface MeiPresence {
|
|
12
|
+
awareness: Awareness;
|
|
13
|
+
/** Server-trusted identity of a remote Yjs client id; null = do not draw. */
|
|
14
|
+
resolveUser: (clientId: number) => PresenceUser | null;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* 12 caret colours, each with a contrast ≥ 3:1 against white and against the dark editor background (#191919).
|
|
18
|
+
* Name labels use white text on the colour darkened to ≥ 4.5:1 (`labelBackground`). Adjacent entries differ in hue.
|
|
19
|
+
*/
|
|
20
|
+
export declare const PRESENCE_COLORS: readonly string[];
|
|
21
|
+
/** `PRESENCE_COLORS[index % 12]` (negative and fractional indexes are folded in). */
|
|
22
|
+
export declare function presenceColor(index: number): string;
|
|
23
|
+
/**
|
|
24
|
+
* Background of a name label for caret `color`: the colour itself, darkened just enough for white text to reach
|
|
25
|
+
* 4.5:1. Non-hex colours are returned unchanged.
|
|
26
|
+
*/
|
|
27
|
+
export declare function labelBackground(color: string): string;
|
|
28
|
+
/**
|
|
29
|
+
* Remote carets (with name labels), selections and the active block of each peer; publishes the local selection,
|
|
30
|
+
* throttled. Names and colours come only from `resolveUser`, never from the remote awareness state.
|
|
31
|
+
*/
|
|
32
|
+
export declare function presenceExtension(presence: MeiPresence): Extension<any, any>;
|
|
33
|
+
/**
|
|
34
|
+
* Redraws remote carets, e.g. after `resolveUser` changed its answer (a peer's access was revoked, names arrived).
|
|
35
|
+
* Awareness changes redraw on their own.
|
|
36
|
+
*/
|
|
37
|
+
export declare function refreshPresence(editor: Editor): void;
|
|
38
|
+
/** Scrolls the editor to a peer's caret (e.g. on avatar click). False when that peer has no caret here. */
|
|
39
|
+
export declare function scrollToPeer(editor: Editor, clientId: number): boolean;
|
|
@@ -14,7 +14,7 @@ export { attr, escapeHtml, safeUrl } from './html';
|
|
|
14
14
|
export { highlightCode } from './highlight';
|
|
15
15
|
export { hydrateMermaid, type HydrateMermaidOptions } from './mermaid';
|
|
16
16
|
import { baseTokensCss, overridesCss } from '../theme/css';
|
|
17
|
-
import type
|
|
17
|
+
import { type ThemeTokens } from '../theme/tokens';
|
|
18
18
|
export { baseTokensCss, overridesCss };
|
|
19
19
|
/** Per-render state shared by the built-in renderers. */
|
|
20
20
|
export interface RenderState {
|
|
@@ -42,10 +42,25 @@ export declare function hasMath(doc: JSONContent | null | undefined): boolean;
|
|
|
42
42
|
* and `options.katex` isn't given. Falls back to TeX source if KaTeX isn't installed.
|
|
43
43
|
*/
|
|
44
44
|
export declare function renderHTMLAsync(doc: JSONContent | null | undefined, options?: RenderOptions): Promise<string>;
|
|
45
|
+
/** Light / dark token overrides for a server-rendered page that follows the OS colour scheme. */
|
|
46
|
+
export interface RenderTokensOptions {
|
|
47
|
+
/**
|
|
48
|
+
* Overrides for every mode (light, and dark unless `dark` overrides them): a token tree like `<MeiEditor :tokens>`
|
|
49
|
+
* (`{ color: { text: '#222' } }`) or a flat map (`{ 'color.text': '#222' }`, `{ '--me-color-text': '#222' }`).
|
|
50
|
+
*/
|
|
51
|
+
light?: ThemeTokens | Record<string, string>;
|
|
52
|
+
/** Overrides for dark mode (same shapes), applied under `prefers-color-scheme: dark` and `html.dark` / `.me-dark`. */
|
|
53
|
+
dark?: ThemeTokens['dark'] | Record<string, string>;
|
|
54
|
+
}
|
|
45
55
|
/**
|
|
46
56
|
* `<style id="mei-editor-tokens">` with the editor's default design tokens (light + dark).
|
|
47
57
|
* The editor injects them at runtime; server-rendered pages put this in `<head>` (next to
|
|
48
58
|
* `style.css`). A `<MeiEditor>` mounted later on the page reuses it instead of adding another.
|
|
49
|
-
*
|
|
59
|
+
*
|
|
60
|
+
* - `renderTokensStyle(overrides)`: token overrides (`ThemeTokens`), unlayered, for `.me-scope`; dark follows
|
|
61
|
+
* `html.dark` / `.me-dark` (like the editor).
|
|
62
|
+
* - `renderTokensStyle({ light, dark })` (`light` required, may be `{}`): the page also follows the OS,
|
|
63
|
+
* `@media (prefers-color-scheme: dark)` switches to the default dark tokens plus `dark` (published pages without a
|
|
64
|
+
* theme toggle). `{ dark }` alone is the overrides form above.
|
|
50
65
|
*/
|
|
51
|
-
export declare function renderTokensStyle(
|
|
66
|
+
export declare function renderTokensStyle(options?: ThemeTokens | RenderTokensOptions): string;
|
|
@@ -9,6 +9,9 @@ export declare const LAYER = "mei-editor";
|
|
|
9
9
|
export declare const LAYER_ORDER = "@layer theme, base, mei-editor, components, utilities;";
|
|
10
10
|
/** Default tokens (light + dark) plus palette mappings, generated from tokens.ts. */
|
|
11
11
|
export declare function baseTokensCss(): string;
|
|
12
|
+
export declare const unsafeCss: (v: string) => boolean;
|
|
13
|
+
/** Keeps the safe `[name, value]` pairs; warns in development about each dropped one. */
|
|
14
|
+
export declare function safePairs(pairs: [string, string][]): [string, string][];
|
|
12
15
|
/**
|
|
13
16
|
* CSS that applies token overrides to every editor matching `scope`
|
|
14
17
|
* (unlayered, so it beats the defaults). Returns '' when there is nothing to override.
|
|
@@ -509,6 +509,10 @@ export declare const component: {
|
|
|
509
509
|
/** Table. Row/header heights are also read by the virtualizer (px). */
|
|
510
510
|
rowHeight: string;
|
|
511
511
|
headerHeight: string;
|
|
512
|
+
/** Space kept while a database loads (title + tabs + header + 3 rows), so the page doesn't jump. */
|
|
513
|
+
loadingHeight: string;
|
|
514
|
+
/** Same, below the title and tabs (views still loading). */
|
|
515
|
+
loadingBodyHeight: string;
|
|
512
516
|
footerHeight: string;
|
|
513
517
|
groupHeaderHeight: string;
|
|
514
518
|
headerColor: string;
|
package/package.json
CHANGED
package/dist/css-el97DJfy.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"css-el97DJfy.js","names":["r","kebab","s","cssVar","path","ref","flatten","tree","key","value","prefix","declarations","pairs","k","v","PALETTE_NAMES","primitive","palette","name","mode","semanticBase","semanticLight","semanticDark","component","LAYER","LAYER_ORDER","darkSelectors","scope","baseTokensCss","light","dark","tints","overridePairs","semantic","tokens","components","overridesCss","rest","darkPairs","injectStyle","el","id","css","BASE_STYLE_ID","installBaseTokens"],"sources":["../src/theme/define.ts","../src/theme/tokens.ts","../src/theme/css.ts"],"sourcesContent":["/** Helpers to turn token objects into CSS custom properties. No values live here. */\n\nexport interface TokenTree { [key: string]: string | TokenTree }\n\nexport type DeepPartial<T> = { [K in keyof T]?: T[K] extends string ? string : DeepPartial<T[K]> }\n\n/** Loosens literal string types so token objects can be compared/overridden. */\nexport type Widen<T> = { [K in keyof T]: T[K] extends string ? string : Widen<T[K]> }\n\nconst kebab = (s: string) => s.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase()\n\n/** `'menu.itemHeight'` → `'--me-menu-item-height'` */\nexport const cssVar = (path: string) => `--me-${path.split('.').map(kebab).join('-')}`\n\n/** Reference another token: `ref('color.text')` → `'var(--me-color-text)'` */\nexport const ref = (path: string) => `var(${cssVar(path)})`\n\n/** Flattens a token tree into `[cssVarName, value]` pairs. */\nexport function flatten(tree: TokenTree, prefix = ''): [string, string][] {\n return Object.entries(tree).flatMap(([key, value]) => {\n const path = prefix ? `${prefix}.${key}` : key\n return typeof value === 'string' ? [[cssVar(path), value] as [string, string]] : flatten(value, path)\n })\n}\n\nexport const declarations = (pairs: [string, string][]) => pairs.map(([k, v]) => `${k}:${v};`).join('')\n","/**\n * ─────────────────────────────────────────────────────────────────────────────\n * THE single source of every visual value in @toantranmei/editor.\n * Stylesheets in src/styles only reference these tokens via var(--me-…);\n * `pnpm check:styles` fails the build if a raw value sneaks in elsewhere.\n *\n * Three tiers:\n * 1. primitive – raw values (colors, scales). Only referenced by tiers 2–3.\n * 2. semantic – meaning (text, surface, accent…). Has light + dark variants.\n * 3. component – per-part knobs (menu item height, callout padding…).\n *\n * CSS variable name = `--me-` + path in kebab-case, e.g. component.menu.itemHeight\n * → --me-menu-item-height, semantic color.textMuted → --me-color-text-muted.\n * ─────────────────────────────────────────────────────────────────────────────\n */\nimport { ref as r } from './define'\n\n// ── 1. Primitive ──────────────────────────────────────────────────────────────\n\n/** Notion's content palette. Names are what documents store (`data-text-color=\"red\"`). */\nexport const PALETTE_NAMES = ['gray', 'brown', 'orange', 'yellow', 'green', 'blue', 'purple', 'pink', 'red'] as const\nexport type PaletteName = typeof PALETTE_NAMES[number]\n\nexport const primitive = {\n white: '#ffffff',\n black: '#000000',\n gray: {\n 50: '#f7f6f3',\n 100: '#f1f1ef',\n 200: '#e9e9e7',\n 300: '#d4d4d4',\n 400: '#9b9a97',\n 500: '#787774',\n 800: '#37352f',\n 850: '#2f2f2f',\n 900: '#252525',\n 925: '#202020',\n 950: '#191919',\n },\n azure: { 400: '#4a9ff5', 500: '#2383e2', 600: '#0077d4' },\n /** Content palette: `light`/`dark` × `text`/`bg`. */\n tint: {\n gray: { lightText: '#787774', lightBg: '#f1f1ef', darkText: '#9b9b9b', darkBg: '#2f2f2f' },\n brown: { lightText: '#9f6b53', lightBg: '#f4eeee', darkText: '#ba856f', darkBg: '#4a3228' },\n orange: { lightText: '#d9730d', lightBg: '#fbecdd', darkText: '#c77d48', darkBg: '#5c3b23' },\n yellow: { lightText: '#cb912f', lightBg: '#fbf3db', darkText: '#ca984d', darkBg: '#564328' },\n green: { lightText: '#448361', lightBg: '#edf3ec', darkText: '#529e72', darkBg: '#243d30' },\n blue: { lightText: '#337ea9', lightBg: '#e7f3f8', darkText: '#5e87c9', darkBg: '#143a4e' },\n purple: { lightText: '#9065b0', lightBg: '#f6f3f9', darkText: '#9d68d3', darkBg: '#3c2d49' },\n pink: { lightText: '#c14c8a', lightBg: '#faf1f5', darkText: '#d15796', darkBg: '#4e2c3c' },\n red: { lightText: '#d44c47', lightBg: '#fdebec', darkText: '#df5452', darkBg: '#522e2a' },\n } satisfies Record<PaletteName, Record<string, string>>,\n space: { 0: '0', 1: '2px', 2: '4px', 3: '6px', 4: '8px', 5: '12px', 6: '14px', 7: '16px', 8: '24px', 9: '32px' },\n rounded: { xs: '3px', sm: '4px', md: '6px', lg: '8px', full: '9999px' },\n fontSize: { xs: '12px', sm: '14px', md: '16px', lg: '20px' },\n fontWeight: { regular: '400', medium: '500', semibold: '600' },\n lineHeight: { tight: '1.2', snug: '1.3', normal: '1.5', relaxed: '1.6' },\n borderWidth: { thin: '1px', medium: '2px', thick: '3px', heavy: '4px' },\n duration: { fast: '120ms', normal: '150ms' },\n fontFamily: {\n sans: 'ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Helvetica, \"Apple Color Emoji\", Arial, sans-serif, \"Segoe UI Emoji\"',\n mono: '\"SFMono-Regular\", Menlo, Consolas, monospace',\n },\n}\n\n// ── 2. Semantic ───────────────────────────────────────────────────────────────\n\nconst palette = (mode: 'light' | 'dark') => Object.fromEntries(PALETTE_NAMES.map(name => [name, {\n text: r(`tint.${name}.${mode}Text`),\n bg: r(`tint.${name}.${mode}Bg`),\n}])) as Record<PaletteName, { text: string, bg: string }>\n\n/** Mode-independent semantic tokens. */\nexport const semanticBase = {\n font: {\n sans: r('fontFamily.sans'),\n mono: r('fontFamily.mono'),\n size: r('fontSize.md'),\n lineHeight: r('lineHeight.normal'),\n },\n radius: { sm: r('rounded.sm'), md: r('rounded.md'), lg: r('rounded.lg') },\n}\n\nexport const semanticLight = {\n color: {\n text: r('gray.800'),\n textMuted: r('gray.500'),\n textFaint: r('gray.400'),\n bg: r('white'),\n elevated: r('white'),\n surface: r('gray.50'),\n hover: 'rgba(55, 53, 47, 0.08)',\n border: r('gray.200'),\n accent: r('azure.500'),\n accentHover: r('azure.600'),\n onAccent: r('white'),\n selection: 'rgba(35, 131, 226, 0.28)',\n blockSelected: 'rgba(35, 131, 226, 0.14)',\n danger: r('tint.red.lightText'),\n handle: '#b9b9b7',\n inlineCodeText: '#eb5757',\n inlineCodeBg: 'rgba(135, 131, 120, 0.15)',\n overlay: 'rgba(0, 0, 0, 0.5)',\n },\n shadow: {\n popover: 'rgba(15, 15, 15, 0.05) 0 0 0 1px, rgba(15, 15, 15, 0.1) 0 3px 6px, rgba(15, 15, 15, 0.2) 0 9px 24px',\n },\n palette: palette('light'),\n syntax: {\n comment: '#8e908c',\n keyword: '#8959a8',\n string: '#718c00',\n number: '#f5871f',\n title: '#4271ae',\n variable: '#c82829',\n meta: '#3e999f',\n },\n}\n\nexport const semanticDark: typeof semanticLight = {\n color: {\n text: r('gray.300'),\n textMuted: '#9b9b9b',\n textFaint: '#7f7f7f',\n bg: r('gray.950'),\n elevated: r('gray.900'),\n surface: r('gray.925'),\n hover: 'rgba(255, 255, 255, 0.055)',\n border: r('gray.850'),\n accent: r('azure.400'),\n accentHover: r('azure.500'),\n onAccent: r('white'),\n selection: 'rgba(35, 131, 226, 0.4)',\n blockSelected: 'rgba(35, 131, 226, 0.22)',\n danger: r('tint.red.darkText'),\n handle: '#5a5a5a',\n inlineCodeText: '#ff7369',\n inlineCodeBg: 'rgba(135, 131, 120, 0.15)',\n overlay: 'rgba(255, 255, 255, 0.5)',\n },\n shadow: {\n popover: 'rgba(255, 255, 255, 0.094) 0 0 0 1px, rgba(0, 0, 0, 0.3) 0 3px 6px, rgba(0, 0, 0, 0.4) 0 9px 24px',\n },\n palette: palette('dark'),\n syntax: {\n comment: '#7f848e',\n keyword: '#c678dd',\n string: '#98c379',\n number: '#d19a66',\n title: '#61afef',\n variable: '#e06c75',\n meta: '#56b6c2',\n },\n}\n\n// ── 3. Component ──────────────────────────────────────────────────────────────\n\nexport const component = {\n /** Editor root. `bg` is transparent so it blends into the page; a forced mode paints `forcedBg`. */\n editor: { bg: 'transparent', forcedBg: r('color.bg') },\n icon: { size: r('fontSize.md'), stroke: '1.75' },\n popover: { bg: r('color.elevated'), radius: r('radius.lg'), shadow: r('shadow.popover'), padding: r('space.2'), offset: r('space.4') },\n menu: {\n itemGap: r('space.4'),\n itemPaddingX: r('space.4'),\n itemPaddingY: r('space.2'),\n itemRadius: r('radius.md'),\n itemHover: r('color.hover'),\n iconBox: '28px',\n iconRadius: r('radius.md'),\n iconBorder: r('color.border'),\n titleSize: r('fontSize.sm'),\n descriptionSize: r('fontSize.xs'),\n descriptionColor: r('color.textMuted'),\n labelSize: r('fontSize.xs'),\n labelWeight: r('fontWeight.medium'),\n labelColor: r('color.textMuted'),\n shortcutColor: r('color.textFaint'),\n width: '288px',\n submenuWidth: '224px',\n maxHeight: '320px',\n },\n toolbar: {\n buttonSize: '28px',\n buttonRadius: r('radius.sm'),\n buttonHover: r('color.hover'),\n activeColor: r('color.accent'),\n dividerColor: r('color.border'),\n linkFormWidth: '320px',\n },\n button: {\n height: '32px',\n paddingX: r('space.5'),\n radius: r('radius.md'),\n fontSize: r('fontSize.sm'),\n border: r('color.border'),\n bg: r('color.bg'),\n hoverBg: r('color.surface'),\n primaryBg: r('color.accent'),\n primaryHoverBg: r('color.accentHover'),\n primaryText: r('color.onAccent'),\n floatingBg: r('color.elevated'),\n floatingHoverBg: r('color.surface'),\n floatingShadow: r('shadow.popover'),\n disabledOpacity: '0.5',\n },\n input: {\n height: '32px',\n paddingX: r('space.4'),\n radius: r('radius.md'),\n fontSize: r('fontSize.sm'),\n border: r('color.border'),\n focusBorder: r('color.accent'),\n focusRing: 'color-mix(in srgb, var(--me-color-accent) 20%, transparent)',\n },\n handle: {\n color: r('color.handle'),\n hoverColor: r('color.textMuted'),\n hoverBg: r('color.hover'),\n /** \"+\" button (square) and the ⋮⋮ grip, like Notion. */\n buttonWidth: '24px',\n buttonHeight: '24px',\n gripWidth: '18px',\n iconSize: '18px',\n radius: r('radius.sm'),\n gap: r('space.1'),\n },\n /**\n * Block rhythm, two levels like Notion: text blocks (paragraphs, lists, quotes,\n * toggles) sit close (`gap` + `paddingY`); every boxed/media block (code, callout,\n * table, image, embed, HTML, file, math, TOC, columns) uses `boxSpacing`.\n */\n block: {\n paddingY: '3px',\n paddingX: r('space.1'),\n gap: '1px',\n boxSpacing: r('space.4'),\n radius: r('radius.sm'),\n minHeight: 'calc(var(--me-font-line-height) * 1em)',\n /** Tint over any selected block (text, boxes and media alike). */\n selectedBg: r('color.blockSelected'),\n },\n /** Shared look of boxed blocks: code, callout, file rows, upload placeholders, HTML. */\n box: {\n bg: r('color.surface'),\n border: r('color.border'),\n radius: r('radius.md'),\n padding: '12px 16px',\n paddingCompact: '6px 10px',\n /** Header row inside a box (code language + copy, HTML name + tabs). */\n barPadding: '8px 10px 0 14px',\n barColor: r('color.textMuted'),\n barFontSize: r('fontSize.xs'),\n barIconSize: r('fontSize.sm'),\n barButtonSize: '24px',\n },\n /** Underlined tabs (upload placeholders, HTML Code / Preview). */\n tabs: {\n gap: r('space.7'),\n fontSize: r('fontSize.sm'),\n color: r('color.textMuted'),\n activeColor: r('color.text'),\n indicator: r('borderWidth.medium'),\n paddingBottom: r('space.4'),\n },\n heading: {\n weight: r('fontWeight.semibold'),\n lineHeight: r('lineHeight.snug'),\n h1Size: '1.875em',\n h2Size: '1.5em',\n h3Size: '1.25em',\n h4Size: '1.1em',\n h1Margin: '1.1em',\n h2Margin: '0.9em',\n h3Margin: '0.6em',\n h4Margin: '0.5em',\n /** Space kept above a heading scrolled to from the outline/TOC (room for sticky app headers). */\n scrollMargin: '80px',\n },\n link: { underline: 'color-mix(in srgb, var(--me-color-text) 40%, transparent)', underlineHover: r('color.text') },\n inlineCode: { color: r('color.inlineCodeText'), bg: r('color.inlineCodeBg'), radius: r('radius.sm'), fontSize: '85%', padding: '0.2em 0.4em' },\n list: { indent: '1.6em' },\n todo: { checkSize: r('fontSize.md'), checkColor: r('color.accent'), doneColor: r('color.textFaint') },\n quote: { borderWidth: r('borderWidth.thick'), borderColor: 'currentColor', paddingLeft: r('space.6') },\n divider: { color: r('color.border'), spacing: r('space.6') },\n callout: {\n /** Left matches top, so the icon sits evenly from both edges; right/bottom follow `box.padding`. */\n padding: '12px 16px 12px 12px',\n gap: r('space.4'),\n iconSize: r('fontSize.lg'),\n iconBox: '28px',\n defaultBg: r('palette.gray.bg'),\n pickerWidth: '240px',\n },\n toggle: { arrowColor: r('color.text'), buttonSize: '24px', headingArrowOffset: 'calc(var(--me-block-padding-y) + 0.15em)' },\n columns: { gap: r('space.9') },\n code: { fontSize: '85%', lineHeight: r('lineHeight.relaxed') },\n table: { border: r('color.border'), headerBg: r('color.surface'), cellPadding: '6px 8px', cellMinWidth: '80px', selected: r('color.blockSelected'), resizeHandle: r('color.accent') },\n media: {\n captionColor: r('color.textMuted'),\n captionSize: r('fontSize.sm'),\n resizeHandleBg: r('color.overlay'),\n errorColor: r('color.danger'),\n },\n dropIndicator: { color: 'rgba(35, 131, 226, 0.5)', height: r('borderWidth.heavy') },\n html: {\n /** User HTML usually assumes a white page, also in dark mode. */\n frameBg: '#fff',\n editorBg: r('color.bg'),\n editorFont: r('font.mono'),\n editorFontSize: '13px',\n editorPadding: r('space.5'),\n coverBg: 'rgba(15, 15, 15, 0.08)',\n },\n /** Full-screen views (HTML block expand, image zoom). */\n modal: {\n backdrop: 'rgba(15, 15, 15, 0.6)',\n /** Image viewer: darker, so the photo stands out. */\n backdropStrong: 'rgba(15, 15, 15, 0.88)',\n inset: '4vh 4vw',\n toolbarOffset: r('space.7'),\n },\n image: {\n /** Hover toolbar inset from the image's top-right corner. */\n toolbarInset: r('space.3'),\n menuWidth: '208px',\n cropDim: 'rgba(15, 15, 15, 0.55)',\n cropBorder: r('white'),\n cropHandle: '10px',\n cropHandleBg: r('white'),\n cropHandleBorder: 'rgba(15, 15, 15, 0.35)',\n },\n outline: {\n /** Distance from the viewport's right edge and top. */\n right: r('space.7'),\n top: '30vh',\n barColor: r('color.border'),\n barActive: r('color.textMuted'),\n barHeight: r('borderWidth.medium'),\n barGap: r('space.3'),\n barWidth: '16px',\n panelWidth: '240px',\n panelMaxHeight: '60vh',\n itemColor: r('color.textMuted'),\n itemActive: r('color.accent'),\n indent: r('space.5'),\n },\n tableControls: {\n gripSize: '12px',\n gripBg: r('color.elevated'),\n gripColor: r('color.textFaint'),\n gripHoverBg: r('color.hover'),\n addSize: '18px',\n addBg: r('color.surface'),\n addHoverBg: r('color.hover'),\n radius: r('radius.sm'),\n },\n toc: { itemColor: r('color.textMuted'), itemHover: r('color.hover'), indent: r('space.7'), padding: r('space.2') },\n math: { editorWidth: '360px', emptyColor: r('color.textFaint') },\n emojiMenu: { cell: '32px', columns: '8', size: r('fontSize.lg') },\n file: { sizeColor: r('color.textFaint') },\n mention: {\n color: r('color.text'),\n bg: r('color.hover'),\n hoverBg: 'color-mix(in srgb, var(--me-color-text) 14%, transparent)',\n radius: r('radius.sm'),\n padding: '0 3px',\n pageUnderline: r('color.textFaint'),\n avatarRadius: r('rounded.full'),\n avatarSize: '1.1em',\n popoverWidth: '280px',\n },\n /** Sub-page / link-to-page rows (`@toantranmei/page-block`). */\n pageLink: {\n color: r('color.text'),\n hoverBg: r('color.hover'),\n radius: r('radius.sm'),\n padding: '3px 2px',\n gap: r('space.3'),\n fontWeight: r('fontWeight.medium'),\n iconSize: '1.2em',\n iconColor: r('color.textMuted'),\n underline: r('color.textFaint'),\n underlineHover: r('color.text'),\n mutedColor: r('color.textMuted'),\n missingColor: r('color.textFaint'),\n popoverWidth: '320px',\n },\n /** Database block (`@toantranmei/database-block`): header, tabs, toolbar, table and the other views. */\n database: {\n gap: r('space.4'),\n titleSize: '1.5em',\n titleWeight: r('fontWeight.semibold'),\n titleColor: r('color.text'),\n titlePlaceholder: r('color.textFaint'),\n fontSize: r('fontSize.sm'),\n mutedColor: r('color.textMuted'),\n faintColor: r('color.textFaint'),\n border: r('color.border'),\n radius: r('radius.sm'),\n hoverBg: r('color.hover'),\n bg: r('color.bg'),\n /** Scroll area of an inline database; a full-page one uses `fullHeight`. */\n maxHeight: '520px',\n fullHeight: '75vh',\n /** Tabs + toolbar row. */\n tabGap: r('space.1'),\n tabPadding: '4px 8px',\n tabActiveColor: r('color.text'),\n tabIndicator: r('borderWidth.medium'),\n toolbarGap: r('space.2'),\n toolbarButtonActive: r('color.accent'),\n searchWidth: '180px',\n /** Table. Row/header heights are also read by the virtualizer (px). */\n rowHeight: '33px',\n headerHeight: '33px',\n footerHeight: '33px',\n groupHeaderHeight: '40px',\n headerColor: r('color.textMuted'),\n headerBg: r('color.bg'),\n headerWeight: r('fontWeight.regular'),\n cellPaddingX: r('space.4'),\n cellMinWidth: '60px',\n cellDefaultWidth: '180px',\n selectColWidth: '32px',\n handleColWidth: '20px',\n activeRing: r('color.accent'),\n activeRingWidth: r('borderWidth.medium'),\n selectedBg: r('color.blockSelected'),\n placeholderBg: r('color.surface'),\n placeholderRadius: r('radius.sm'),\n resizeHandle: r('color.accent'),\n resizeHandleWidth: r('borderWidth.thick'),\n dropIndicator: r('color.accent'),\n dropIndicatorWidth: r('borderWidth.medium'),\n editorBg: r('color.elevated'),\n editorShadow: r('shadow.popover'),\n editorMinHeight: '120px',\n readOnlyColor: r('color.textMuted'),\n linkColor: r('color.text'),\n aggregateColor: r('color.textMuted'),\n errorColor: r('color.danger'),\n /** Select / multi-select / status / person / relation chips. */\n tagHeight: '20px',\n tagPadding: '0 6px',\n tagRadius: r('radius.sm'),\n tagGap: r('space.2'),\n tagFontSize: r('fontSize.sm'),\n defaultTagBg: r('palette.gray.bg'),\n defaultTagText: r('color.text'),\n swatchSize: r('fontSize.md'),\n avatarSize: '18px',\n avatarRadius: r('rounded.full'),\n /** Popovers: menus, filter / sort builders, property editor. */\n menuWidth: '260px',\n builderWidth: '560px',\n formulaHeight: '96px',\n dangerColor: r('color.danger'),\n warningBg: r('palette.yellow.bg'),\n warningText: r('palette.yellow.text'),\n /** Board. */\n columnWidth: '264px',\n columnGap: r('space.5'),\n columnBg: r('color.surface'),\n cardBg: r('color.elevated'),\n cardBorder: r('color.border'),\n cardRadius: r('radius.md'),\n cardPadding: '8px 10px',\n cardGap: r('space.3'),\n cardShadow: 'rgba(15, 15, 15, 0.1) 0 0 0 1px, rgba(15, 15, 15, 0.1) 0 2px 4px',\n dropBg: 'color-mix(in srgb, var(--me-color-accent) 10%, transparent)',\n /** Calendar. */\n calendarCellHeight: '116px',\n calendarTodayBg: r('color.accent'),\n calendarTodayText: r('color.onAccent'),\n calendarOutsideBg: r('color.surface'),\n /** Timeline: width of one day at each scale (px, read by the view). */\n timelineDay: '40px',\n timelineWeek: '16px',\n timelineMonth: '5px',\n timelineRowHeight: '36px',\n timelineLabelWidth: '200px',\n barBg: 'color-mix(in srgb, var(--me-color-accent) 18%, var(--me-color-bg))',\n barBorder: r('color.accent'),\n barRadius: r('radius.md'),\n barHeight: '24px',\n todayLine: r('palette.red.text'),\n /** Gallery card widths per size, cover height. */\n gallerySmall: '180px',\n galleryMedium: '260px',\n galleryLarge: '340px',\n coverHeight: '148px',\n coverBg: r('color.surface'),\n /** Pivot. */\n pivotHeaderBg: r('color.surface'),\n pivotTotalWeight: r('fontWeight.semibold'),\n /** Full-page database link row. */\n linkIconSize: '1.2em',\n },\n /** Charts (`@toantranmei/chart-block`), also used by the database chart view. */\n chart: {\n height: '320px',\n padding: r('space.5'),\n text: r('color.textMuted'),\n title: r('color.text'),\n axis: r('color.border'),\n splitLine: r('color.border'),\n tooltipBg: r('color.elevated'),\n tooltipText: r('color.text'),\n tooltipBorder: r('color.border'),\n fontSize: r('fontSize.xs'),\n fontFamily: r('font.sans'),\n series1: r('palette.blue.text'),\n series2: r('palette.orange.text'),\n series3: r('palette.green.text'),\n series4: r('palette.purple.text'),\n series5: r('palette.red.text'),\n series6: r('palette.yellow.text'),\n series7: r('palette.pink.text'),\n series8: r('palette.brown.text'),\n series9: r('palette.gray.text'),\n /** Standalone block: data grid and config panel. */\n cellWidth: '120px',\n gridMaxHeight: '260px',\n panelGap: r('space.4'),\n emptyColor: r('color.textFaint'),\n },\n /** Comment highlights, gutter badges and the side panel (`@toantranmei/comments`). */\n comments: {\n highlight: 'color-mix(in srgb, var(--me-palette-yellow-text) 22%, transparent)',\n highlightActive: 'color-mix(in srgb, var(--me-palette-yellow-text) 45%, transparent)',\n underline: r('palette.yellow.text'),\n badgeBg: r('color.surface'),\n badgeColor: r('color.textMuted'),\n badgeActiveBg: r('palette.yellow.bg'),\n badgeActiveColor: r('palette.yellow.text'),\n badgeSize: '22px',\n badgeOffset: '-36px',\n badgeFontSize: r('fontSize.xs'),\n panelWidth: '340px',\n panelBg: r('color.bg'),\n panelBorder: r('color.border'),\n panelPadding: r('space.5'),\n threadGap: r('space.4'),\n threadRadius: r('radius.lg'),\n threadBorder: r('color.border'),\n threadActiveBorder: r('palette.yellow.text'),\n threadPadding: r('space.5'),\n quoteColor: r('color.textMuted'),\n quoteBorder: r('palette.yellow.text'),\n avatarSize: '24px',\n metaColor: r('color.textFaint'),\n metaFontSize: r('fontSize.xs'),\n bodyFontSize: r('fontSize.sm'),\n composerMinHeight: '36px',\n composerBg: r('color.surface'),\n composerPadding: '6px 8px',\n composerWidth: '320px',\n },\n /** Synced block frame (`@toantranmei/synced-block`). */\n synced: {\n border: 'color-mix(in srgb, var(--me-palette-red-text) 55%, transparent)',\n borderWidth: r('borderWidth.medium'),\n radius: r('radius.md'),\n padding: '2px 4px',\n labelColor: r('palette.red.text'),\n labelBg: r('color.bg'),\n labelFontSize: r('fontSize.xs'),\n labelPadding: '0 6px',\n labelOffset: '-10px',\n hoverBorder: r('palette.red.text'),\n emptyColor: r('color.textFaint'),\n gap: r('space.3'),\n },\n datepicker: {\n width: '264px',\n cell: '34px',\n todayColor: r('color.accent'),\n selectedBg: r('color.accent'),\n selectedText: r('color.onAccent'),\n rangeBg: 'color-mix(in srgb, var(--me-color-accent) 18%, transparent)',\n outsideColor: r('color.textFaint'),\n inputBg: r('color.surface'),\n },\n switch: { width: '28px', height: '16px', knob: '12px', off: r('color.border'), on: r('color.accent'), knobColor: r('color.bg') },\n unknown: { color: r('color.textMuted'), invalidBorder: r('palette.red.text'), invalidColor: r('palette.red.text') },\n /** Handle tooltip and toast: dark in both modes, like Notion. */\n tooltip: {\n bg: '#0f0f0f',\n text: 'rgba(255, 255, 255, 0.9)',\n hint: 'rgba(206, 205, 202, 0.6)',\n radius: r('radius.sm'),\n padding: '4px 8px',\n fontSize: r('fontSize.xs'),\n offset: r('space.3'),\n shadow: 'rgba(15, 15, 15, 0.1) 0 3px 6px',\n },\n}\n\n/** Everything a consumer can override, with autocomplete. */\nexport interface ThemeTokens {\n color?: Partial<Record<keyof typeof semanticLight.color, string>>\n shadow?: Partial<Record<keyof typeof semanticLight.shadow, string>>\n palette?: Partial<Record<PaletteName, { text?: string, bg?: string }>>\n syntax?: Partial<Record<keyof typeof semanticLight.syntax, string>>\n font?: Partial<Record<keyof typeof semanticBase.font, string>>\n radius?: Partial<Record<keyof typeof semanticBase.radius, string>>\n /** Per-part knobs, e.g. `{ menu: { itemRadius: '8px' } }`. */\n components?: { [G in keyof typeof component]?: Partial<Record<keyof typeof component[G], string>> }\n /** Overrides applied only in dark mode. */\n dark?: Pick<ThemeTokens, 'color' | 'shadow' | 'palette' | 'syntax'>\n}\n","import { declarations, flatten, type TokenTree } from './define'\nimport { component, PALETTE_NAMES, primitive, semanticBase, semanticDark, semanticLight, type ThemeTokens } from './tokens'\n\n/** CSS cascade layer for all library styles; app CSS outside layers always wins. */\nexport const LAYER = 'mei-editor'\n\n/**\n * Layer order declared wherever library CSS loads. Whichever sheet the browser sees\n * first fixes the order, so every entry point repeats it: resets (`base`, e.g.\n * Tailwind preflight) lose to the editor, while app `components`/`utilities` win.\n */\nexport const LAYER_ORDER = `@layer theme, base, ${LAYER}, components, utilities;`\n\nconst darkSelectors = (scope: string) => [\n `html.dark ${scope}:not(.me-light)`,\n `${scope}.me-dark`,\n]\n\n/** Default tokens (light + dark) plus palette mappings, generated from tokens.ts. */\nexport function baseTokensCss(): string {\n const light = [\n ...flatten(primitive as unknown as TokenTree),\n ...flatten(semanticBase),\n ...flatten(semanticLight as unknown as TokenTree),\n ...flatten(component),\n ]\n const dark = flatten(semanticDark as unknown as TokenTree)\n\n // Colors are stored by name in documents; map each name to its palette tokens.\n const tints = PALETTE_NAMES.map(name => [\n `:where(.me-scope) [data-text-color=\"${name}\"]{color:var(--me-palette-${name}-text);}`,\n `:where(.me-scope) [data-bg-color=\"${name}\"]{background-color:var(--me-palette-${name}-bg);}`,\n `:where(.me-scope) [data-color=\"${name}\"]{--me-tint-text:var(--me-palette-${name}-text);--me-tint-bg:var(--me-palette-${name}-bg);}`,\n ].join('\\n')).join('\\n')\n\n return [\n LAYER_ORDER,\n `@layer ${LAYER} {`,\n `:where(.me-scope){${declarations(light)}}`,\n `${darkSelectors('.me-scope').map(s => `:where(${s})`).join(',')}{${declarations(dark)}}`,\n tints,\n '}',\n ].join('\\n')\n}\n\nfunction overridePairs(tokens: Omit<ThemeTokens, 'dark'>): [string, string][] {\n const { components, ...semantic } = tokens\n return [...flatten(semantic as TokenTree), ...flatten((components ?? {}) as TokenTree)]\n}\n\n/**\n * CSS that applies token overrides to every editor matching `scope`\n * (unlayered, so it beats the defaults). Returns '' when there is nothing to override.\n */\nexport function overridesCss(tokens: ThemeTokens | undefined, scope = '.me-scope'): string {\n if (!tokens) return ''\n const { dark, ...rest } = tokens\n const light = overridePairs(rest)\n const darkPairs = dark ? overridePairs(dark) : []\n return [\n light.length ? `${scope}{${declarations(light)}}` : '',\n darkPairs.length ? `${darkSelectors(scope).join(',')}{${declarations(darkPairs)}}` : '',\n ].filter(Boolean).join('\\n')\n}\n\n/** Adds or replaces a <style> tag in <head>. Pass empty css to remove it. */\nexport function injectStyle(id: string, css: string) {\n if (typeof document === 'undefined') return\n let el = document.getElementById(id) as HTMLStyleElement | null\n if (!css) return el?.remove()\n if (!el) {\n el = document.createElement('style')\n el.id = id\n // Base tokens go first so later sheets (and app CSS) can override them.\n if (id === BASE_STYLE_ID) document.head.prepend(el)\n else document.head.appendChild(el)\n }\n if (el.textContent !== css) el.textContent = css\n}\n\nconst BASE_STYLE_ID = 'mei-editor-tokens'\n\n/** Injects the default tokens once per document. */\nexport function installBaseTokens() {\n if (typeof document === 'undefined' || document.getElementById(BASE_STYLE_ID)) return\n injectStyle(BASE_STYLE_ID, baseTokensCss())\n}\n"],"mappings":";AASA,IAAMC,KAAS,MAAcC,EAAE,QAAQ,sBAAsB,OAAO,CAAC,CAAC,YAAY,GAGrEC,KAAU,MAAiB,QAAQC,EAAK,MAAM,GAAG,CAAC,CAAC,IAAIH,CAAK,CAAC,CAAC,KAAK,GAAG,KAGtEI,KAAO,MAAiB,OAAOF,EAAOC,CAAI,EAAE;AAGzD,SAAgBE,EAAQ,GAAiB,IAAS,IAAwB;CACxE,OAAO,OAAO,QAAQC,CAAI,CAAC,CAAC,SAAS,CAACC,GAAKC,OAAW;EACpD,IAAML,IAAOM,IAAS,GAAGA,EAAO,GAAGF,MAAQA;EAC3C,OAAO,OAAOC,KAAU,WAAW,CAAC,CAACN,EAAOC,CAAI,GAAGK,CAAK,CAAqB,IAAIH,EAAQG,GAAOL,CAAI;CACtG,CAAC;AACH;AAEA,IAAaO,KAAgB,MAA8BC,EAAM,KAAK,CAACC,GAAGC,OAAO,GAAGD,EAAE,GAAGC,EAAE,EAAE,CAAC,CAAC,KAAK,EAAE,GCLzFC,IAAgB;CAAC;CAAQ;CAAS;CAAU;CAAU;CAAS;CAAQ;CAAU;CAAQ;AAAK,GAG9FC,IAAY;CACvB,OAAO;CACP,OAAO;CACP,MAAM;EACJ,IAAI;EACJ,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;CACP;CACA,OAAO;EAAE,KAAK;EAAW,KAAK;E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AO,GACnC,EAAG,KAAKC,GAEJA,MAAOE,IAAe,SAAS,KAAK,QAAQH,CAAE,IAC7C,SAAS,KAAK,YAAYA,CAAE,IAE/BA,EAAG,gBAAgBE,MAAK,EAAG,cAAcA;AAC/C;AAEA,IAAMC,IAAgB;AAGtB,SAAgBC,IAAoB;CAClC,AAAI,OAAO,WAAa,OAAe,SAAS,eAAeD,CAAa,KAC5EJ,EAAYI,GAAef,EAAc,CAAC;AAC5C"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"date-utils-DW99lT2W.js","names":["vi","level","c","n","mb","kb","\"none\"","\"day\"","\"at\"","en","zh","locales","resolveMessages","layers","out","locale","overrides","key","value","current","LANGUAGE_ALIASES","toEmbedUrl","url","raw","host","id","HTML_MAX_HEIGHT","htmlBlockCsp","network","extra","o","src","base","htmlBlockDocument","csp","code","pad","DATE_FORMATS","isoDate","d","parseIsoDate","m","dayDiff","today","a","b","formatDate","dd","mm","yyyy","format","diff","relative","formatTime","h","time","formatDateValue","one","text","date","v","start","parseDateInput","t","valid","year","parsed","y","mo","parseTimeInput","min","suffix","REMINDERS_DATE","REMINDERS_TIME","OFFSET_MIN","reminderTime"],"sources":["../src/locale.ts","../src/extensions/code-languages.ts","../src/extensions/embed-url.ts","../src/extensions/html-document.ts","../src/date-utils.ts"],"sourcesContent":["export type BlockGroup = 'basic' | 'media' | 'advanced' | 'layout'\n\nexport interface EditorMessages {\n placeholder: string\n headingPlaceholder: (level: number) => string\n togglePlaceholder: string\n groups: Record<BlockGroup, string>\n blocks: Record<string, { title: string, description: string }>\n slash: { empty: string, results: string, recent: string, colors: string, textColor: (color: string) => string, bgColor: (color: string) => string }\n /** Handle tooltips: `<verb> <text>`, e.g. \"**Drag** to move\". */\n handle: { add: string, addAbove: string, drag: string, menu: string, dragVerb: string, clickVerb: string, altClickVerb: string }\n blockMenu: {\n delete: string\n duplicate: string\n turnInto: string\n color: string\n textColor: string\n backgroundColor: string\n recent: string\n search: string\n noResults: string\n moveUp: string\n moveDown: string\n copyLink: string\n linkCopied: string\n actions: string\n selected: (count: number) => string\n }\n colors: Record<string, string>\n format: { bold: string, italic: string, underline: string, strike: string, code: string, link: string, color: string, linkPlaceholder: string, removeLink: string, apply: string }\n image: {\n upload: string\n link: string\n choose: string\n dropHint: (maxMb: number) => string\n insert: string\n notImage: string\n tooLarge: (maxMb: number) => string\n invalidLink: string\n caption: string\n uploading: string\n uploadFailed: string\n align: string\n alignments: { left: string, center: string, right: string }\n captionToggle: string\n crop: string\n cropDone: string\n cropCancel: string\n cropReset: string\n zoom: string\n zoomIn: string\n zoomOut: string\n zoomReset: string\n download: string\n more: string\n replace: string\n copyLink: string\n linkCopied: string\n original: string\n delete: string\n close: string\n }\n embed: { hint: string, placeholder: string, submit: string, invalid: string }\n callout: { change: string, icon: string, background: string }\n code: { copy: string, copied: string }\n unknownBlock: string\n invalidBlock: string\n contentError: string\n toc: { empty: string, untitled: string, title: string }\n table: {\n rowMenu: string\n columnMenu: string\n headerRow: string\n headerColumn: string\n insertAbove: string\n insertBelow: string\n insertLeft: string\n insertRight: string\n duplicate: string\n moveUp: string\n moveDown: string\n moveLeft: string\n moveRight: string\n clear: string\n color: string\n deleteRow: string\n deleteColumn: string\n merge: string\n split: string\n addRow: string\n addColumn: string\n }\n math: { placeholder: string, inputPlaceholder: string, hintBlock: string, hintInline: string, missing: string }\n mermaid: { preview: string, invalid: string, missing: string }\n html: {\n title: string\n code: string\n preview: string\n upload: string\n uploadFile: string\n write: string\n expand: string\n close: string\n interact: string\n emptyHint: string\n placeholder: string\n wrongType: string\n tooLarge: (maxKb: number) => string\n }\n file: {\n upload: string\n link: string\n embed: string\n chooseFile: string\n chooseAudio: string\n chooseVideo: string\n dropHint: (maxMb: number) => string\n tooLarge: (maxMb: number) => string\n wrongType: string\n uploadFailed: string\n invalidLink: string\n uploading: string\n download: string\n }\n datePicker: {\n endDate: string\n dateFormat: string\n includeTime: string\n timeFormat: string\n hour12: string\n hour24: string\n remind: string\n clear: string\n learnReminders: string\n prevMonth: string\n nextMonth: string\n formats: Record<'full' | 'short' | 'mdy' | 'dmy' | 'ymd' | 'relative', string>\n reminders: Record<string, string>\n }\n mention: { today: string, tomorrow: string, yesterday: string, people: string, pages: string, dates: string, empty: string, searchPlaceholder: string, noSearch: string, openPage: string, prevMonth: string, nextMonth: string }\n}\n\nexport const vi: EditorMessages = {\n placeholder: 'Gõ \\'/\\' để chọn loại block...',\n headingPlaceholder: level => `Tiêu đề ${level}`,\n togglePlaceholder: 'Toggle',\n groups: { basic: 'Cơ bản', media: 'Media', advanced: 'Nâng cao', layout: 'Bố cục' },\n blocks: {\n paragraph: { title: 'Văn bản', description: 'Đoạn văn bản thường.' },\n heading1: { title: 'Tiêu đề 1', description: 'Tiêu đề lớn.' },\n heading2: { title: 'Tiêu đề 2', description: 'Tiêu đề vừa.' },\n heading3: { title: 'Tiêu đề 3', description: 'Tiêu đề nhỏ.' },\n heading4: { title: 'Tiêu đề 4', description: 'Tiêu đề rất nhỏ.' },\n toggleHeading1: { title: 'Toggle tiêu đề 1', description: 'Tiêu đề lớn có thể thu gọn.' },\n toggleHeading2: { title: 'Toggle tiêu đề 2', description: 'Tiêu đề vừa có thể thu gọn.' },\n toggleHeading3: { title: 'Toggle tiêu đề 3', description: 'Tiêu đề nhỏ có thể thu gọn.' },\n toc: { title: 'Mục lục', description: 'Tự tạo từ các tiêu đề.' },\n mathBlock: { title: 'Công thức', description: 'Công thức toán (LaTeX).' },\n mathInline: { title: 'Công thức trong dòng', description: 'Công thức nằm trong câu.' },\n mermaid: { title: 'Sơ đồ Mermaid', description: 'Flowchart, sequence, gantt...' },\n html: { title: 'HTML', description: 'Chạy HTML/CSS/JS tương tác trong trang.' },\n 'file-file': { title: 'Tệp đính kèm', description: 'Tải lên hoặc dán link tệp.' },\n 'file-audio': { title: 'Âm thanh', description: 'Tải lên hoặc dán link audio.' },\n 'file-video': { title: 'Video tải lên', description: 'Tải lên hoặc dán link video.' },\n mention: { title: 'Nhắc tên / ngày', description: 'Nhắc người, trang hoặc ngày.' },\n bulletList: { title: 'Danh sách chấm', description: 'Danh sách gạch đầu dòng.' },\n orderedList: { title: 'Danh sách số', description: 'Danh sách đánh số thứ tự.' },\n taskList: { title: 'Việc cần làm', description: 'Danh sách checkbox.' },\n blockquote: { title: 'Trích dẫn', description: 'Đoạn trích dẫn.' },\n divider: { title: 'Đường kẻ', description: 'Phân cách các phần.' },\n codeBlock: { title: 'Code', description: 'Đoạn code có tô màu cú pháp.' },\n image: { title: 'Hình ảnh', description: 'Tải ảnh lên hoặc dán link.' },\n embed: { title: 'Video / Embed', description: 'Nhúng YouTube, Vimeo, web...' },\n callout: { title: 'Callout', description: 'Khối nổi bật có icon.' },\n toggle: { title: 'Toggle', description: 'Khối có thể thu gọn / mở rộng.' },\n table: { title: 'Bảng', description: 'Bảng 3×3 đơn giản.' },\n columns2: { title: '2 cột', description: 'Chia nội dung thành 2 cột.' },\n columns3: { title: '3 cột', description: 'Chia nội dung thành 3 cột.' },\n columns4: { title: '4 cột', description: 'Chia nội dung thành 4 cột.' },\n },\n slash: { empty: 'Không tìm thấy block nào', results: 'Kết quả', recent: 'Dùng gần đây', colors: 'Màu', textColor: c => `Chữ ${c.toLowerCase()}`, bgColor: c => `Nền ${c.toLowerCase()}` },\n handle: { add: 'để thêm block bên dưới', addAbove: 'để thêm bên trên', drag: 'để di chuyển', menu: 'để mở menu', dragVerb: 'Kéo', clickVerb: 'Bấm', altClickVerb: 'Alt+bấm' },\n blockMenu: {\n delete: 'Xoá',\n duplicate: 'Nhân bản',\n turnInto: 'Chuyển thành',\n color: 'Màu',\n textColor: 'Màu chữ',\n backgroundColor: 'Màu nền',\n recent: 'Dùng gần đây',\n search: 'Tìm thao tác...',\n noResults: 'Không có kết quả',\n moveUp: 'Di chuyển lên',\n moveDown: 'Di chuyển xuống',\n copyLink: 'Sao chép link tới block',\n linkCopied: 'Đã sao chép link',\n actions: 'Thao tác',\n selected: n => `${n} block`,\n },\n colors: { default: 'Mặc định', gray: 'Xám', brown: 'Nâu', orange: 'Cam', yellow: 'Vàng', green: 'Xanh lá', blue: 'Xanh dương', purple: 'Tím', pink: 'Hồng', red: 'Đỏ' },\n format: { bold: 'Đậm', italic: 'Nghiêng', underline: 'Gạch chân', strike: 'Gạch ngang', code: 'Code', link: 'Link', color: 'Màu', linkPlaceholder: 'Dán link...', removeLink: 'Bỏ link', apply: 'OK' },\n image: {\n upload: 'Tải lên',\n link: 'Dán link',\n choose: 'Chọn ảnh',\n dropHint: mb => `Hoặc kéo thả ảnh vào đây · tối đa ${mb}MB`,\n insert: 'Chèn ảnh',\n notImage: 'File không phải ảnh.',\n tooLarge: mb => `Ảnh tối đa ${mb}MB.`,\n invalidLink: 'Link ảnh không hợp lệ.',\n caption: 'Thêm chú thích...',\n uploading: 'Đang tải lên...',\n uploadFailed: 'Tải ảnh lên thất bại.',\n align: 'Căn lề',\n alignments: { left: 'Căn trái', center: 'Căn giữa', right: 'Căn phải' },\n captionToggle: 'Chú thích',\n crop: 'Cắt ảnh',\n cropDone: 'Xong',\n cropCancel: 'Huỷ',\n cropReset: 'Đặt lại',\n zoom: 'Phóng to',\n zoomIn: 'Phóng to',\n zoomOut: 'Thu nhỏ',\n zoomReset: 'Về 100%',\n download: 'Tải xuống',\n more: 'Thêm',\n replace: 'Thay ảnh',\n copyLink: 'Sao chép link ảnh',\n linkCopied: 'Đã sao chép',\n original: 'Xem ảnh gốc',\n delete: 'Xoá',\n close: 'Đóng',\n },\n embed: { hint: 'Nhúng video hoặc trang web (YouTube, Vimeo, Loom, Figma, Google Maps...)', placeholder: 'Dán link vào đây...', submit: 'Nhúng', invalid: 'Link không hợp lệ (cần http/https).' },\n callout: { change: 'Đổi icon / màu', icon: 'Icon', background: 'Màu nền' },\n code: { copy: 'Copy', copied: 'Đã copy' },\n unknownBlock: 'Block không được hỗ trợ',\n invalidBlock: 'Block bị lỗi dữ liệu (đã giữ nguyên)',\n contentError: 'Không đọc được nội dung. Editor đang ở chế độ chỉ xem để không ghi đè dữ liệu đã lưu.',\n toc: { empty: 'Thêm tiêu đề để tạo mục lục.', untitled: 'Không có tiêu đề', title: 'Mục lục' },\n table: {\n rowMenu: 'Bấm để mở menu hàng',\n columnMenu: 'Bấm để mở menu cột',\n headerRow: 'Hàng tiêu đề',\n headerColumn: 'Cột tiêu đề',\n insertAbove: 'Chèn hàng phía trên',\n insertBelow: 'Chèn hàng phía dưới',\n insertLeft: 'Chèn cột bên trái',\n insertRight: 'Chèn cột bên phải',\n duplicate: 'Nhân bản',\n moveUp: 'Di chuyển lên',\n moveDown: 'Di chuyển xuống',\n moveLeft: 'Di chuyển sang trái',\n moveRight: 'Di chuyển sang phải',\n clear: 'Xoá nội dung',\n color: 'Màu nền',\n deleteRow: 'Xoá hàng',\n deleteColumn: 'Xoá cột',\n merge: 'Gộp ô',\n split: 'Tách ô',\n addRow: 'Thêm hàng',\n addColumn: 'Thêm cột',\n },\n math: {\n placeholder: 'Thêm công thức',\n inputPlaceholder: 'Nhập LaTeX, ví dụ E = mc^2',\n hintBlock: '⌘ + Enter để xong',\n hintInline: 'Enter để xong',\n missing: 'Cần cài thư viện \"katex\" để hiển thị công thức.',\n },\n mermaid: { preview: 'Xem trước sơ đồ', invalid: 'Cú pháp Mermaid chưa đúng.', missing: 'Cần cài thư viện \"mermaid\" để hiển thị sơ đồ.' },\n html: {\n title: 'HTML',\n code: 'Code',\n preview: 'Xem trước',\n upload: 'Tải lên file .html',\n uploadFile: 'Tải lên file',\n write: 'Viết code',\n expand: 'Phóng to',\n close: 'Đóng',\n interact: 'Tương tác',\n emptyHint: 'Chạy HTML, CSS và JavaScript ngay trong trang (máy tính, quiz, sơ đồ, prototype...).',\n placeholder: '<!-- Viết hoặc dán code HTML vào đây -->',\n wrongType: 'Chỉ nhận file .html.',\n tooLarge: kb => `File tối đa ${kb >= 1024 ? `${Math.round(kb / 1024)}MB` : `${kb}KB`}.`,\n },\n file: {\n upload: 'Tải lên',\n link: 'Dán link',\n embed: 'Chèn',\n chooseFile: 'Chọn tệp',\n chooseAudio: 'Chọn tệp âm thanh',\n chooseVideo: 'Chọn video',\n dropHint: mb => `Hoặc kéo thả vào đây · tối đa ${mb}MB`,\n tooLarge: mb => `Tệp tối đa ${mb}MB.`,\n wrongType: 'Định dạng tệp không phù hợp.',\n uploadFailed: 'Tải lên thất bại.',\n invalidLink: 'Link không hợp lệ.',\n uploading: 'Đang tải lên...',\n download: 'Tải xuống',\n },\n datePicker: {\n endDate: 'Ngày kết thúc',\n dateFormat: 'Định dạng ngày',\n includeTime: 'Bao gồm giờ',\n timeFormat: 'Định dạng giờ',\n hour12: '12 giờ',\n hour24: '24 giờ',\n remind: 'Nhắc nhở',\n clear: 'Xoá',\n learnReminders: 'Tìm hiểu về nhắc nhở',\n prevMonth: 'Tháng trước',\n nextMonth: 'Tháng sau',\n formats: { full: 'Ngày đầy đủ', short: 'Ngày rút gọn', mdy: 'Tháng/Ngày/Năm', dmy: 'Ngày/Tháng/Năm', ymd: 'Năm/Tháng/Ngày', relative: 'Tương đối' },\n reminders: {\n 'none': 'Không',\n 'day': 'Trong ngày (9:00)',\n 'at': 'Đúng giờ',\n '5m': 'Trước 5 phút',\n '10m': 'Trước 10 phút',\n '15m': 'Trước 15 phút',\n '30m': 'Trước 30 phút',\n '1h': 'Trước 1 giờ',\n '2h': 'Trước 2 giờ',\n '1d': 'Trước 1 ngày',\n '2d': 'Trước 2 ngày',\n '1w': 'Trước 1 tuần',\n },\n },\n mention: { today: 'Hôm nay', tomorrow: 'Ngày mai', yesterday: 'Hôm qua', people: 'Người', pages: 'Trang', dates: 'Ngày', empty: 'Không tìm thấy', searchPlaceholder: 'Tìm người hoặc trang...', noSearch: 'Chưa cấu hình tìm kiếm (mention.configure({ search }))', openPage: 'Mở trang', prevMonth: 'Tháng trước', nextMonth: 'Tháng sau' },\n}\n\nexport const en: EditorMessages = {\n placeholder: 'Type \\'/\\' for commands...',\n headingPlaceholder: level => `Heading ${level}`,\n togglePlaceholder: 'Toggle',\n groups: { basic: 'Basic blocks', media: 'Media', advanced: 'Advanced', layout: 'Layout' },\n blocks: {\n paragraph: { title: 'Text', description: 'Plain text.' },\n heading1: { title: 'Heading 1', description: 'Big section heading.' },\n heading2: { title: 'Heading 2', description: 'Medium section heading.' },\n heading3: { title: 'Heading 3', description: 'Small section heading.' },\n heading4: { title: 'Heading 4', description: 'Smallest heading.' },\n toggleHeading1: { title: 'Toggle heading 1', description: 'Collapsible big heading.' },\n toggleHeading2: { title: 'Toggle heading 2', description: 'Collapsible medium heading.' },\n toggleHeading3: { title: 'Toggle heading 3', description: 'Collapsible small heading.' },\n toc: { title: 'Table of contents', description: 'Built from your headings.' },\n mathBlock: { title: 'Block equation', description: 'Math with LaTeX.' },\n mathInline: { title: 'Inline equation', description: 'Math inside a sentence.' },\n mermaid: { title: 'Mermaid diagram', description: 'Flowchart, sequence, gantt...' },\n html: { title: 'HTML', description: 'Interactive HTML/CSS/JS on the page.' },\n 'file-file': { title: 'File', description: 'Upload or link a file.' },\n 'file-audio': { title: 'Audio', description: 'Upload or link audio.' },\n 'file-video': { title: 'Video upload', description: 'Upload or link a video.' },\n mention: { title: 'Mention', description: 'Mention a person, page or date.' },\n bulletList: { title: 'Bulleted list', description: 'A simple bulleted list.' },\n orderedList: { title: 'Numbered list', description: 'A list with numbering.' },\n taskList: { title: 'To-do list', description: 'Track tasks with checkboxes.' },\n blockquote: { title: 'Quote', description: 'Capture a quote.' },\n divider: { title: 'Divider', description: 'Visually divide blocks.' },\n codeBlock: { title: 'Code', description: 'Code with syntax highlighting.' },\n image: { title: 'Image', description: 'Upload or embed with a link.' },\n embed: { title: 'Video / Embed', description: 'YouTube, Vimeo, any web page...' },\n callout: { title: 'Callout', description: 'Make writing stand out.' },\n toggle: { title: 'Toggle', description: 'Hide content inside a toggle.' },\n table: { title: 'Table', description: 'A simple 3×3 table.' },\n columns2: { title: '2 columns', description: 'Split content into 2 columns.' },\n columns3: { title: '3 columns', description: 'Split content into 3 columns.' },\n columns4: { title: '4 columns', description: 'Split content into 4 columns.' },\n },\n slash: { empty: 'No results', results: 'Results', recent: 'Recently used', colors: 'Colors', textColor: c => `${c} text`, bgColor: c => `${c} background` },\n handle: { add: 'to add below', addAbove: 'to add above', drag: 'to move', menu: 'to open menu', dragVerb: 'Drag', clickVerb: 'Click', altClickVerb: 'Alt-click' },\n blockMenu: {\n delete: 'Delete',\n duplicate: 'Duplicate',\n turnInto: 'Turn into',\n color: 'Color',\n textColor: 'Text color',\n backgroundColor: 'Background color',\n recent: 'Last used',\n search: 'Search actions...',\n noResults: 'No results',\n moveUp: 'Move up',\n moveDown: 'Move down',\n copyLink: 'Copy link to block',\n linkCopied: 'Link copied',\n actions: 'Actions',\n selected: n => `${n} blocks`,\n },\n colors: { default: 'Default', gray: 'Gray', brown: 'Brown', orange: 'Orange', yellow: 'Yellow', green: 'Green', blue: 'Blue', purple: 'Purple', pink: 'Pink', red: 'Red' },\n format: { bold: 'Bold', italic: 'Italic', underline: 'Underline', strike: 'Strikethrough', code: 'Code', link: 'Link', color: 'Color', linkPlaceholder: 'Paste link...', removeLink: 'Remove link', apply: 'OK' },\n image: {\n upload: 'Upload',\n link: 'Embed link',\n choose: 'Choose an image',\n dropHint: mb => `Or drop an image here · max ${mb}MB`,\n insert: 'Embed image',\n notImage: 'This file is not an image.',\n tooLarge: mb => `Images can be at most ${mb}MB.`,\n invalidLink: 'Invalid image link.',\n caption: 'Write a caption...',\n uploading: 'Uploading...',\n uploadFailed: 'Upload failed.',\n align: 'Align',\n alignments: { left: 'Align left', center: 'Align center', right: 'Align right' },\n captionToggle: 'Caption',\n crop: 'Crop',\n cropDone: 'Done',\n cropCancel: 'Cancel',\n cropReset: 'Reset',\n zoom: 'View full size',\n zoomIn: 'Zoom in',\n zoomOut: 'Zoom out',\n zoomReset: 'Reset to 100%',\n download: 'Download',\n more: 'More',\n replace: 'Replace',\n copyLink: 'Copy image link',\n linkCopied: 'Copied',\n original: 'View original',\n delete: 'Delete',\n close: 'Close',\n },\n embed: { hint: 'Embed a video or web page (YouTube, Vimeo, Loom, Figma, Google Maps...)', placeholder: 'Paste a link...', submit: 'Embed', invalid: 'Invalid link (http/https only).' },\n callout: { change: 'Change icon / color', icon: 'Icon', background: 'Background' },\n code: { copy: 'Copy', copied: 'Copied' },\n unknownBlock: 'Unsupported block',\n invalidBlock: 'Invalid block data (kept as is)',\n contentError: 'This content can\\'t be read. The editor is read-only so saved data isn\\'t overwritten.',\n toc: { empty: 'Add headings to build a table of contents.', untitled: 'Untitled', title: 'Table of contents' },\n table: {\n rowMenu: 'Click to open the row menu',\n columnMenu: 'Click to open the column menu',\n headerRow: 'Header row',\n headerColumn: 'Header column',\n insertAbove: 'Insert above',\n insertBelow: 'Insert below',\n insertLeft: 'Insert left',\n insertRight: 'Insert right',\n duplicate: 'Duplicate',\n moveUp: 'Move up',\n moveDown: 'Move down',\n moveLeft: 'Move left',\n moveRight: 'Move right',\n clear: 'Clear contents',\n color: 'Background color',\n deleteRow: 'Delete row',\n deleteColumn: 'Delete column',\n merge: 'Merge cells',\n split: 'Split cell',\n addRow: 'Add a row',\n addColumn: 'Add a column',\n },\n math: {\n placeholder: 'Add an equation',\n inputPlaceholder: 'Type LaTeX, e.g. E = mc^2',\n hintBlock: '⌘ + Enter to finish',\n hintInline: 'Enter to finish',\n missing: 'Install the \"katex\" package to render equations.',\n },\n mermaid: { preview: 'Diagram preview', invalid: 'Invalid Mermaid syntax.', missing: 'Install the \"mermaid\" package to render diagrams.' },\n html: {\n title: 'HTML',\n code: 'Code',\n preview: 'Preview',\n upload: 'Upload .html file',\n uploadFile: 'Upload file',\n write: 'Write code',\n expand: 'Expand',\n close: 'Close',\n interact: 'Interact',\n emptyHint: 'Run HTML, CSS and JavaScript right on the page (calculators, quizzes, diagrams, prototypes...).',\n placeholder: '<!-- Write or paste HTML here -->',\n wrongType: 'Only .html files are supported.',\n tooLarge: kb => `Max file size is ${kb >= 1024 ? `${Math.round(kb / 1024)}MB` : `${kb}KB`}.`,\n },\n file: {\n upload: 'Upload',\n link: 'Embed link',\n embed: 'Embed',\n chooseFile: 'Choose a file',\n chooseAudio: 'Choose audio',\n chooseVideo: 'Choose a video',\n dropHint: mb => `Or drop it here · max ${mb}MB`,\n tooLarge: mb => `Files can be at most ${mb}MB.`,\n wrongType: 'Unsupported file type.',\n uploadFailed: 'Upload failed.',\n invalidLink: 'Invalid link.',\n uploading: 'Uploading...',\n download: 'Download',\n },\n datePicker: {\n endDate: 'End date',\n dateFormat: 'Date format',\n includeTime: 'Include time',\n timeFormat: 'Time format',\n hour12: '12 hour',\n hour24: '24 hour',\n remind: 'Remind',\n clear: 'Clear',\n learnReminders: 'Learn about reminders',\n prevMonth: 'Previous month',\n nextMonth: 'Next month',\n formats: { full: 'Full date', short: 'Short date', mdy: 'Month/Day/Year', dmy: 'Day/Month/Year', ymd: 'Year/Month/Day', relative: 'Relative' },\n reminders: {\n 'none': 'None',\n 'day': 'On day of event (9:00 AM)',\n 'at': 'At time of event',\n '5m': '5 minutes before',\n '10m': '10 minutes before',\n '15m': '15 minutes before',\n '30m': '30 minutes before',\n '1h': '1 hour before',\n '2h': '2 hours before',\n '1d': '1 day before',\n '2d': '2 days before',\n '1w': '1 week before',\n },\n },\n mention: { today: 'Today', tomorrow: 'Tomorrow', yesterday: 'Yesterday', people: 'People', pages: 'Pages', dates: 'Dates', empty: 'No results', searchPlaceholder: 'Search people or pages...', noSearch: 'Search is not configured (mention.configure({ search }))', openPage: 'Open page', prevMonth: 'Previous month', nextMonth: 'Next month' },\n}\n\nexport const zh: EditorMessages = {\n placeholder: '输入“/”选择块类型...',\n headingPlaceholder: level => `标题 ${level}`,\n togglePlaceholder: '折叠列表',\n groups: { basic: '基础块', media: '媒体', advanced: '高级', layout: '布局' },\n blocks: {\n paragraph: { title: '文本', description: '普通文本段落。' },\n heading1: { title: '标题 1', description: '一级标题。' },\n heading2: { title: '标题 2', description: '二级标题。' },\n heading3: { title: '标题 3', description: '三级标题。' },\n heading4: { title: '标题 4', description: '四级标题。' },\n toggleHeading1: { title: '折叠标题 1', description: '可折叠的一级标题。' },\n toggleHeading2: { title: '折叠标题 2', description: '可折叠的二级标题。' },\n toggleHeading3: { title: '折叠标题 3', description: '可折叠的三级标题。' },\n toc: { title: '目录', description: '根据标题自动生成。' },\n mathBlock: { title: '公式块', description: '使用 LaTeX 编写数学公式。' },\n mathInline: { title: '行内公式', description: '嵌入句子中的公式。' },\n mermaid: { title: 'Mermaid 图表', description: '流程图、时序图、甘特图...' },\n html: { title: 'HTML', description: '在页面中运行交互式 HTML/CSS/JS。' },\n 'file-file': { title: '文件', description: '上传文件或粘贴文件链接。' },\n 'file-audio': { title: '音频', description: '上传音频或粘贴音频链接。' },\n 'file-video': { title: '上传视频', description: '上传视频或粘贴视频链接。' },\n mention: { title: '提及', description: '提及成员、页面或日期。' },\n bulletList: { title: '无序列表', description: '简单的项目符号列表。' },\n orderedList: { title: '有序列表', description: '带编号的列表。' },\n taskList: { title: '待办清单', description: '用复选框跟踪任务。' },\n blockquote: { title: '引用', description: '引用一段文字。' },\n divider: { title: '分割线', description: '在内容之间添加分隔。' },\n codeBlock: { title: '代码', description: '支持语法高亮的代码块。' },\n image: { title: '图片', description: '上传图片或通过链接嵌入。' },\n embed: { title: '视频 / 嵌入', description: '嵌入 YouTube、Vimeo 或任意网页...' },\n callout: { title: '标注', description: '带图标的醒目提示块。' },\n toggle: { title: '折叠列表', description: '可展开 / 收起的内容块。' },\n table: { title: '表格', description: '简单的 3×3 表格。' },\n columns2: { title: '2 栏', description: '将内容分为 2 栏。' },\n columns3: { title: '3 栏', description: '将内容分为 3 栏。' },\n columns4: { title: '4 栏', description: '将内容分为 4 栏。' },\n },\n slash: { empty: '没有找到匹配的块', results: '搜索结果', recent: '最近使用', colors: '颜色', textColor: c => `${c}文字`, bgColor: c => `${c}背景` },\n handle: { add: '在下方添加块', addAbove: '在上方添加', drag: '移动', menu: '打开菜单', dragVerb: '拖动', clickVerb: '点击', altClickVerb: 'Alt+点击' },\n blockMenu: {\n delete: '删除',\n duplicate: '创建副本',\n turnInto: '转换为',\n color: '颜色',\n textColor: '文字颜色',\n backgroundColor: '背景颜色',\n recent: '最近使用',\n search: '搜索操作...',\n noResults: '无结果',\n moveUp: '上移',\n moveDown: '下移',\n copyLink: '复制块链接',\n linkCopied: '链接已复制',\n actions: '操作',\n selected: n => `${n} 个块`,\n },\n colors: { default: '默认', gray: '灰色', brown: '棕色', orange: '橙色', yellow: '黄色', green: '绿色', blue: '蓝色', purple: '紫色', pink: '粉色', red: '红色' },\n format: { bold: '加粗', italic: '斜体', underline: '下划线', strike: '删除线', code: '代码', link: '链接', color: '颜色', linkPlaceholder: '粘贴链接...', removeLink: '移除链接', apply: '确定' },\n image: {\n upload: '上传',\n link: '嵌入链接',\n choose: '选择图片',\n dropHint: mb => `或将图片拖放到此处 · 最大 ${mb}MB`,\n insert: '嵌入图片',\n notImage: '该文件不是图片。',\n tooLarge: mb => `图片不能超过 ${mb}MB。`,\n invalidLink: '图片链接无效。',\n caption: '添加说明...',\n uploading: '正在上传...',\n uploadFailed: '上传失败。',\n align: '对齐',\n alignments: { left: '左对齐', center: '居中', right: '右对齐' },\n captionToggle: '说明',\n crop: '裁剪',\n cropDone: '完成',\n cropCancel: '取消',\n cropReset: '重置',\n zoom: '查看大图',\n zoomIn: '放大',\n zoomOut: '缩小',\n zoomReset: '恢复 100%',\n download: '下载',\n more: '更多',\n replace: '替换',\n copyLink: '复制图片链接',\n linkCopied: '已复制',\n original: '查看原图',\n delete: '删除',\n close: '关闭',\n },\n embed: { hint: '嵌入视频或网页(YouTube、Vimeo、Loom、Figma、Google 地图...)', placeholder: '粘贴链接...', submit: '嵌入', invalid: '链接无效(仅支持 http/https)。' },\n callout: { change: '更改图标 / 颜色', icon: '图标', background: '背景' },\n code: { copy: '复制', copied: '已复制' },\n unknownBlock: '不支持的块',\n invalidBlock: '块数据有误(已原样保留)',\n contentError: '无法读取此内容。编辑器已切换为只读模式,以免覆盖已保存的数据。',\n toc: { empty: '添加标题以生成目录。', untitled: '无标题', title: '目录' },\n table: {\n rowMenu: '点击打开行菜单',\n columnMenu: '点击打开列菜单',\n headerRow: '标题行',\n headerColumn: '标题列',\n insertAbove: '在上方插入',\n insertBelow: '在下方插入',\n insertLeft: '在左侧插入',\n insertRight: '在右侧插入',\n duplicate: '创建副本',\n moveUp: '上移',\n moveDown: '下移',\n moveLeft: '左移',\n moveRight: '右移',\n clear: '清除内容',\n color: '背景颜色',\n deleteRow: '删除行',\n deleteColumn: '删除列',\n merge: '合并单元格',\n split: '拆分单元格',\n addRow: '添加一行',\n addColumn: '添加一列',\n },\n math: {\n placeholder: '添加公式',\n inputPlaceholder: '输入 LaTeX,例如 E = mc^2',\n hintBlock: '⌘ + Enter 完成',\n hintInline: 'Enter 完成',\n missing: '请安装 \"katex\" 包以显示公式。',\n },\n mermaid: { preview: '图表预览', invalid: 'Mermaid 语法有误。', missing: '请安装 \"mermaid\" 包以显示图表。' },\n html: {\n title: 'HTML',\n code: '代码',\n preview: '预览',\n upload: '上传 .html 文件',\n uploadFile: '上传文件',\n write: '编写代码',\n expand: '展开',\n close: '关闭',\n interact: '交互',\n emptyHint: '直接在页面中运行 HTML、CSS 和 JavaScript(计算器、测验、图表、原型...)。',\n placeholder: '<!-- 在此编写或粘贴 HTML 代码 -->',\n wrongType: '仅支持 .html 文件。',\n tooLarge: kb => `文件不能超过 ${kb >= 1024 ? `${Math.round(kb / 1024)}MB` : `${kb}KB`}。`,\n },\n file: {\n upload: '上传',\n link: '嵌入链接',\n embed: '嵌入',\n chooseFile: '选择文件',\n chooseAudio: '选择音频',\n chooseVideo: '选择视频',\n dropHint: mb => `或拖放到此处 · 最大 ${mb}MB`,\n tooLarge: mb => `文件不能超过 ${mb}MB。`,\n wrongType: '不支持该文件类型。',\n uploadFailed: '上传失败。',\n invalidLink: '链接无效。',\n uploading: '正在上传...',\n download: '下载',\n },\n datePicker: {\n endDate: '结束日期',\n dateFormat: '日期格式',\n includeTime: '包含时间',\n timeFormat: '时间格式',\n hour12: '12 小时制',\n hour24: '24 小时制',\n remind: '提醒',\n clear: '清除',\n learnReminders: '了解提醒功能',\n prevMonth: '上个月',\n nextMonth: '下个月',\n formats: { full: '完整日期', short: '简短日期', mdy: '月/日/年', dmy: '日/月/年', ymd: '年/月/日', relative: '相对日期' },\n reminders: {\n 'none': '无',\n 'day': '当天(上午 9:00)',\n 'at': '事件发生时',\n '5m': '提前 5 分钟',\n '10m': '提前 10 分钟',\n '15m': '提前 15 分钟',\n '30m': '提前 30 分钟',\n '1h': '提前 1 小时',\n '2h': '提前 2 小时',\n '1d': '提前 1 天',\n '2d': '提前 2 天',\n '1w': '提前 1 周',\n },\n },\n mention: { today: '今天', tomorrow: '明天', yesterday: '昨天', people: '成员', pages: '页面', dates: '日期', empty: '无结果', searchPlaceholder: '搜索成员或页面...', noSearch: '尚未配置搜索(mention.configure({ search }))', openPage: '打开页面', prevMonth: '上个月', nextMonth: '下个月' },\n}\n\nexport const locales = { vi, en, zh }\nexport type LocaleName = keyof typeof locales\n\ntype DeepPartial<T> = { [K in keyof T]?: T[K] extends (...args: any[]) => any ? T[K] : T[K] extends object ? DeepPartial<T[K]> : T[K] }\nexport type PartialMessages = DeepPartial<EditorMessages>\n\n/** Merges override layers (e.g. custom blocks' strings, then app overrides) into a base locale, one level deep per section. */\nexport function resolveMessages(locale: LocaleName = 'vi', ...layers: (PartialMessages | undefined)[]): EditorMessages {\n const out: any = { ...(locales[locale] ?? vi) }\n for (const overrides of layers) {\n if (!overrides) continue\n for (const [key, value] of Object.entries(overrides)) {\n const current = out[key]\n out[key] = value && typeof value === 'object' && current && typeof current === 'object' ? { ...current, ...value } : value\n }\n }\n return out as EditorMessages\n}\n","/** Common names for highlight.js grammars (`ts` → `typescript`). */\nexport const LANGUAGE_ALIASES: Record<string, string> = {\n js: 'javascript', ts: 'typescript', sh: 'bash', zsh: 'bash', html: 'xml', vue: 'xml', py: 'python',\n yml: 'yaml', md: 'markdown', 'c++': 'cpp', cs: 'csharp', rb: 'ruby', rs: 'rust', kt: 'kotlin', golang: 'go',\n}\n","/** Turns a YouTube / Vimeo / Loom watch link into an embeddable URL. */\nexport function toEmbedUrl(raw: string): string | null {\n let url: URL\n try {\n url = new URL(raw.trim())\n }\n catch {\n return null\n }\n if (!/^https?:$/.test(url.protocol)) return null\n\n const host = url.hostname.replace(/^www\\./, '')\n if (host === 'youtu.be') return `https://www.youtube.com/embed/${url.pathname.slice(1)}`\n if (host.endsWith('youtube.com')) {\n const id = url.searchParams.get('v') ?? url.pathname.match(/\\/(?:embed|shorts)\\/([^/]+)/)?.[1]\n if (id) return `https://www.youtube.com/embed/${id}`\n }\n if (host === 'vimeo.com') {\n const id = url.pathname.match(/\\/(\\d+)/)?.[1]\n if (id) return `https://player.vimeo.com/video/${id}`\n }\n if (host === 'loom.com') {\n const id = url.pathname.match(/\\/share\\/([^/]+)/)?.[1]\n if (id) return `https://www.loom.com/embed/${id}`\n }\n return url.toString()\n}\n","export interface HtmlBlockOptions {\n /**\n * What the block's code may load from the network. `false` (default, like Notion):\n * nothing. Images, fonts and scripts must be inlined. `true`: anything. A list of\n * origins (`['https://cdn.jsdelivr.net']`): only those.\n */\n network: boolean | string[]\n /** Largest `.html` file that can be uploaded, in KB. */\n maxSize: number\n /** Height of a new block, in px. */\n defaultHeight: number\n}\n\n/** Block heights users can drag between, in px. */\nexport const HTML_MIN_HEIGHT = 120\nexport const HTML_MAX_HEIGHT = 2000\n\n/**\n * Content-Security-Policy for the sandboxed page. The iframe has no `allow-same-origin`,\n * so the code can't touch the editor, its page, cookies or storage either way; the\n * policy additionally blocks network requests unless `network` allows them.\n */\nexport function htmlBlockCsp(network: HtmlBlockOptions['network']): string | null {\n if (network === true) return null\n const extra = Array.isArray(network) ? network.filter(o => /^https?:\\/\\/[\\w.-]+(?::\\d+)?$/.test(o)).join(' ') : ''\n const src = (base: string) => `${base}${extra ? ` ${extra}` : ''}`\n return [\n `default-src 'none'`,\n `script-src ${src(`'unsafe-inline' 'unsafe-eval' data: blob:`)}`,\n `style-src ${src(`'unsafe-inline' data:`)}`,\n `img-src ${src('data: blob:')}`,\n `font-src ${src('data:')}`,\n `media-src ${src('data: blob:')}`,\n `connect-src ${extra || `'none'`}`,\n `frame-src 'none'`,\n `form-action 'none'`,\n `base-uri 'none'`,\n ].join('; ')\n}\n\n/**\n * The iframe document: a strict CSP first (later policies can only tighten it), then\n * the user's HTML.\n */\nexport function htmlBlockDocument(code: string, network: HtmlBlockOptions['network']): string {\n const csp = htmlBlockCsp(network)\n const head = [\n '<meta charset=\"utf-8\">',\n '<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">',\n csp ? `<meta http-equiv=\"Content-Security-Policy\" content=\"${csp}\">` : '',\n ].join('')\n return `<!doctype html><html><head>${head}</head><body>${code}</body></html>`\n}\n","/**\n * Date mention values: local dates as `YYYY-MM-DD`, times as `HH:mm` (24h).\n * Formatting follows Notion's options (full, short, M/D/Y, D/M/Y, Y/M/D, relative).\n */\nconst pad = (n: number) => String(n).padStart(2, '0')\n\nexport type DateFormat = 'full' | 'short' | 'mdy' | 'dmy' | 'ymd' | 'relative'\nexport type TimeFormat = '12' | '24'\nexport const DATE_FORMATS: DateFormat[] = ['full', 'short', 'mdy', 'dmy', 'ymd', 'relative']\n\n/** Everything a date mention stores (besides its id = start date). */\nexport interface DateValue {\n start: string\n end?: string | null\n time?: string | null\n endTime?: string | null\n format?: DateFormat | null\n timeFormat?: TimeFormat | null\n remind?: string | null\n}\n\nexport const isoDate = (d: Date) => `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}`\n\n/** `YYYY-MM-DD` → local Date (no timezone shift). */\nexport function parseIsoDate(id: string | null | undefined): Date | null {\n const m = /^(\\d{4})-(\\d{2})-(\\d{2})$/.exec(id ?? '')\n return m ? new Date(Number(m[1]), Number(m[2]) - 1, Number(m[3])) : null\n}\n\nconst dayDiff = (d: Date) => {\n const today = new Date()\n const a = Date.UTC(d.getFullYear(), d.getMonth(), d.getDate())\n const b = Date.UTC(today.getFullYear(), today.getMonth(), today.getDate())\n return Math.round((a - b) / 86_400_000)\n}\n\nexport interface RelativeLabels { today: string, tomorrow: string, yesterday: string }\n\n/** One date in the chosen format. */\nexport function formatDate(id: string, locale: string, format: DateFormat = 'relative', relative?: RelativeLabels): string {\n const d = parseIsoDate(id)\n if (!d) return id\n const dd = pad(d.getDate())\n const mm = pad(d.getMonth() + 1)\n const yyyy = d.getFullYear()\n switch (format) {\n case 'full': return new Intl.DateTimeFormat(locale, { day: 'numeric', month: 'long', year: 'numeric' }).format(d)\n case 'mdy': return `${mm}/${dd}/${yyyy}`\n case 'dmy': return `${dd}/${mm}/${yyyy}`\n case 'ymd': return `${yyyy}/${mm}/${dd}`\n case 'relative': {\n const diff = dayDiff(d)\n if (relative && diff === 0) return relative.today\n if (relative && diff === 1) return relative.tomorrow\n if (relative && diff === -1) return relative.yesterday\n return new Intl.DateTimeFormat(locale, { day: 'numeric', month: 'short', year: diff > -180 && diff < 180 && d.getFullYear() === new Date().getFullYear() ? undefined : 'numeric' }).format(d)\n }\n default: return new Intl.DateTimeFormat(locale, { day: 'numeric', month: 'short', year: 'numeric' }).format(d)\n }\n}\n\n/** `HH:mm` → \"2:30 PM\" or \"14:30\". */\nexport function formatTime(time: string, locale: string, format: TimeFormat = '24'): string {\n const [h, m] = time.split(':').map(Number)\n if (h === undefined || m === undefined || Number.isNaN(h) || Number.isNaN(m)) return time\n return new Intl.DateTimeFormat(locale, { hour: 'numeric', minute: '2-digit', hour12: format === '12' }).format(new Date(2000, 0, 1, h, m))\n}\n\n/** The chip label: date (+ time), with \"→ end\" for ranges. */\nexport function formatDateValue(v: DateValue, locale: string, relative?: RelativeLabels): string {\n const one = (date: string, time?: string | null) => {\n const text = formatDate(date, locale, v.format ?? 'relative', relative)\n return time ? `${text} ${formatTime(time, locale, v.timeFormat ?? '24')}` : text\n }\n const start = one(v.start, v.time)\n return v.end ? `${start} → ${one(v.end, v.endTime ?? (v.time ? v.time : null))}` : start\n}\n\n/** Back-compat: short date only. */\nexport function formatMentionDate(id: string, locale: string): string {\n return formatDate(id, locale, 'short')\n}\n\n/** Parses what users type in the date box: 24/10/2026, 2026-10-24, 10/24/2026 (en), \"Oct 24, 2026\", 2026年10月24日. */\nexport function parseDateInput(text: string, locale: string): string | null {\n const t = text.trim()\n // Chinese: 2026年10月24日 / 10月24日\n let m = /^(?:(\\d{4})\\s*年\\s*)?(\\d{1,2})\\s*月\\s*(\\d{1,2})\\s*[日号]?$/.exec(t)\n if (m) return valid(m[1] ? Number(m[1]) : new Date().getFullYear(), Number(m[2]), Number(m[3]))\n m = /^(\\d{4})[-/.](\\d{1,2})[-/.](\\d{1,2})$/.exec(t)\n if (m) return valid(Number(m[1]), Number(m[2]), Number(m[3]))\n m = /^(\\d{1,2})[-/.](\\d{1,2})(?:[-/.](\\d{2,4}))?$/.exec(t)\n if (m) {\n const year = m[3] ? Number(m[3].length === 2 ? `20${m[3]}` : m[3]) : new Date().getFullYear()\n const [a, b] = [Number(m[1]), Number(m[2])]\n // en-US reads M/D, everyone else D/M.\n return locale.startsWith('en') ? valid(year, a, b) : valid(year, b, a)\n }\n const parsed = Date.parse(t)\n return Number.isNaN(parsed) ? null : isoDate(new Date(parsed))\n}\n\nfunction valid(y: number, mo: number, d: number): string | null {\n const date = new Date(y, mo - 1, d)\n return date.getFullYear() === y && date.getMonth() === mo - 1 && date.getDate() === d ? isoDate(date) : null\n}\n\n/** Parses \"14:30\", \"9\", \"2:30 pm\", \"9am\", \"下午2:30\", \"14点\" → `HH:mm`. */\nexport function parseTimeInput(text: string): string | null {\n const t = text.trim()\n // Chinese puts the period first: 上午 / 下午 / 晚上 9:30.\n const zh = /^(上午|早上|中午|下午|晚上)\\s*/.exec(t)\n const m = /^(\\d{1,2})(?:[:.h点時时](\\d{2})?分?)?\\s*(am|pm|sa|ch)?$/i.exec(zh ? t.slice(zh[0].length) : t)\n if (!m) return null\n let h = Number(m[1])\n const min = Number(m[2] ?? 0)\n const suffix = zh ? (zh[1] === '上午' || zh[1] === '早上' ? 'am' : zh[1] === '中午' ? (h < 11 ? 'pm' : undefined) : 'pm') : m[3]?.toLowerCase()\n if (suffix === 'pm' || suffix === 'ch') h = h % 12 + 12\n else if (suffix === 'am' || suffix === 'sa') h = h % 12\n return h < 24 && min < 60 ? `${pad(h)}:${pad(min)}` : null\n}\n\n// --- Reminders ------------------------------------------------------------------\n\n/** Reminder presets (like Notion's). Date-only ones fire at 09:00. */\nexport const REMINDERS_DATE = ['none', 'day', '1d', '2d', '1w'] as const\nexport const REMINDERS_TIME = ['none', 'at', '5m', '10m', '15m', '30m', '1h', '2h', '1d', '2d'] as const\n\nconst OFFSET_MIN: Record<string, number> = { 'at': 0, 'day': 0, '5m': 5, '10m': 10, '15m': 15, '30m': 30, '1h': 60, '2h': 120, '1d': 1440, '2d': 2880, '1w': 10080 }\n\n/** When the reminder should fire, or null without one. */\nexport function reminderTime(v: DateValue): Date | null {\n if (!v.remind || v.remind === 'none' || !(v.remind in OFFSET_MIN)) return null\n const d = parseIsoDate(v.start)\n if (!d) return null\n const [h, m] = (v.time ?? '09:00').split(':').map(Number)\n d.setHours(h ?? 9, m ?? 0, 0, 0)\n return new Date(d.getTime() - OFFSET_MIN[v.remind]! * 60_000)\n}\n"],"mappings":";AA8IA,IAAaA,IAAqB;CAChC,aAAa;CACb,qBAAoB,MAAS,WAAWC;CACxC,mBAAmB;CACnB,QAAQ;EAAE,OAAO;EAAU,OAAO;EAAS,UAAU;EAAY,QAAQ;CAAS;CAClF,QAAQ;EACN,WAAW;GAAE,OAAO;GAAW,aAAa;EAAuB;EACnE,UAAU;GAAE,OAAO;GAAa,aAAa;EAAe;EAC5D,UAAU;GAAE,OAAO;GAAa,aAAa;EAAe;EAC5D,UAAU;GAAE,OAAO;GAAa,aAAa;EAAe;EAC5D,UAAU;GAAE,OAAO;GAAa,aAAa;EAAmB;EAChE,gBAAgB;GAAE,OAAO;GAAoB,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