@toantranmei/editor 0.4.0 → 0.4.1

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.
@@ -175,6 +175,7 @@ var i = (e) => e.map(([e, t]) => `${e}:${t};`).join(""), a = [
175
175
  blockSelected: "rgba(35, 131, 226, 0.14)",
176
176
  danger: n("tint.red.lightText"),
177
177
  handle: "#b9b9b7",
178
+ scrollbarThumb: "color-mix(in srgb, #a19e99 50%, transparent)",
178
179
  inlineCodeText: "#eb5757",
179
180
  inlineCodeBg: "rgba(135, 131, 120, 0.15)",
180
181
  overlay: "rgba(0, 0, 0, 0.5)"
@@ -207,6 +208,7 @@ var i = (e) => e.map(([e, t]) => `${e}:${t};`).join(""), a = [
207
208
  blockSelected: "rgba(35, 131, 226, 0.22)",
208
209
  danger: n("tint.red.darkText"),
209
210
  handle: "#5a5a5a",
211
+ scrollbarThumb: "color-mix(in srgb, #7d7a75 50%, transparent)",
210
212
  inlineCodeText: "#ff7369",
211
213
  inlineCodeBg: "rgba(135, 131, 120, 0.15)",
212
214
  overlay: "rgba(255, 255, 255, 0.5)"
@@ -300,7 +302,8 @@ var i = (e) => e.map(([e, t]) => `${e}:${t};`).join(""), a = [
300
302
  gripWidth: "18px",
301
303
  iconSize: "18px",
302
304
  radius: n("radius.sm"),
303
- gap: n("space.1")
305
+ gap: n("space.1"),
306
+ offset: "18px"
304
307
  },
305
308
  block: {
306
309
  paddingY: "3px",
@@ -444,12 +447,18 @@ var i = (e) => e.map(([e, t]) => `${e}:${t};`).join(""), a = [
444
447
  indent: n("space.5")
445
448
  },
446
449
  tableControls: {
447
- gripSize: "12px",
450
+ pillLength: "18px",
451
+ pillThickness: "6px",
452
+ pillBg: n("color.textFaint"),
453
+ pillRing: n("color.bg"),
454
+ gripLength: "22px",
455
+ gripThickness: "14px",
448
456
  gripBg: n("color.elevated"),
449
457
  gripColor: n("color.textFaint"),
450
- gripHoverBg: n("color.hover"),
451
- addSize: "18px",
452
- addBg: n("color.surface"),
458
+ gripBorder: n("color.border"),
459
+ addSize: "16px",
460
+ addGap: n("space.4"),
461
+ addBorder: n("color.border"),
453
462
  addHoverBg: n("color.hover"),
454
463
  radius: n("radius.sm")
455
464
  },
@@ -497,10 +506,13 @@ var i = (e) => e.map(([e, t]) => `${e}:${t};`).join(""), a = [
497
506
  },
498
507
  database: {
499
508
  gap: n("space.4"),
500
- titleSize: "1.5em",
509
+ titleSize: "24px",
501
510
  titleWeight: n("fontWeight.semibold"),
502
511
  titleColor: n("color.text"),
503
512
  titlePlaceholder: n("color.textFaint"),
513
+ headerRowHeight: "40px",
514
+ addViewWidth: "390px",
515
+ addViewTileHeight: "56px",
504
516
  fontSize: n("fontSize.sm"),
505
517
  mutedColor: n("color.textMuted"),
506
518
  faintColor: n("color.textFaint"),
@@ -540,6 +552,8 @@ var i = (e) => e.map(([e, t]) => `${e}:${t};`).join(""), a = [
540
552
  resizeHandleWidth: n("borderWidth.thick"),
541
553
  dropIndicator: n("color.accent"),
542
554
  dropIndicatorWidth: n("borderWidth.medium"),
555
+ dragGhostOpacity: "0.4",
556
+ dragGhostZ: "70",
543
557
  editorBg: n("color.elevated"),
544
558
  editorShadow: n("shadow.popover"),
545
559
  editorMinHeight: "120px",
@@ -558,6 +572,8 @@ var i = (e) => e.map(([e, t]) => `${e}:${t};`).join(""), a = [
558
572
  avatarSize: "18px",
559
573
  avatarRadius: n("rounded.full"),
560
574
  menuWidth: "260px",
575
+ propEditorWidth: "290px",
576
+ newPropWidth: "404px",
561
577
  builderWidth: "560px",
562
578
  formulaHeight: "96px",
563
579
  dangerColor: n("color.danger"),
@@ -755,4 +771,4 @@ function T() {
755
771
  }
756
772
  export { S as a, d as c, l as d, t as f, T as i, o as l, r as m, h as n, b as o, i as p, C as r, a as s, f as t, u };
757
773
 
758
- //# sourceMappingURL=css-Cf_w91Fs.js.map
774
+ //# sourceMappingURL=css-B-tIYjEV.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"css-B-tIYjEV.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","UNSAFE_CSS","unbalancedQuotes","open","ch","unsafeCss","isDev","safePairs","ok","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 /** Scrollbar thumb, as Notion: its tertiary text color at half strength on a transparent track. */\n scrollbarThumb: 'color-mix(in srgb, #a19e99 50%, transparent)',\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 scrollbarThumb: 'color-mix(in srgb, #7d7a75 50%, transparent)',\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 /** Room between the ⋮⋮ grip and the block, so a click meant for the block doesn't land on the handle (Notion). */\n offset: '18px',\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 /**\n * Table row / column handles and \"+\" bars, like Notion's simple table: a small pill on the hovered row's left border\n * and column's top border, that grows into a ⋮⋮ button when pointed at (click: menu; drag: move the row / column).\n */\n tableControls: {\n pillLength: '18px',\n pillThickness: '6px',\n pillBg: r('color.textFaint'),\n /** Ring around the pill, the page color, so it reads over the table's border. */\n pillRing: r('color.bg'),\n gripLength: '22px',\n gripThickness: '14px',\n gripBg: r('color.elevated'),\n gripColor: r('color.textFaint'),\n gripBorder: r('color.border'),\n /** \"+\" bars below and right of the table, this far from it. */\n addSize: '16px',\n addGap: r('space.4'),\n addBorder: r('color.border'),\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 /** Notion: 24px, semibold (not relative to the database's 14px text). */\n titleSize: '24px',\n titleWeight: r('fontWeight.semibold'),\n titleColor: r('color.text'),\n titlePlaceholder: r('color.textFaint'),\n /** Title row: Notion's is 40px (a 24px title with 4px above and below). */\n headerRowHeight: '40px',\n /** \"Add a new view\" menu (Notion): 4 columns of layout tiles. */\n addViewWidth: '390px',\n addViewTileHeight: '56px',\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 /** Space kept while a database loads (title + tabs + header + 3 rows), so the page doesn't jump. */\n loadingHeight: 'calc(var(--me-database-row-height) * 4 + 5em)',\n /** Same, below the title and tabs (views still loading). */\n loadingBodyHeight: 'calc(var(--me-database-row-height) * 4)',\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 /** A row being dragged: its see-through copy under the pointer (Notion: 0.4). */\n dragGhostOpacity: '0.4',\n dragGhostZ: '70',\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 /** A property's settings (Notion's 290px). */\n propEditorWidth: '290px',\n /** \"+\" in the table header: two columns of types (Notion's 404px menu). */\n newPropWidth: '404px',\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\n// A value or name that could leave its declaration (or the <style>) is dropped: braces, `;`, `<>`, comments\n// (`/*` could swallow the next rules) and backslash escapes (`\\7d` is a `}`).\nconst UNSAFE_CSS = /[{};<>\\\\]|\\/\\*|\\*\\//\n\n/** True when a quote is never closed (it would run a string over the closing brace). `\"it's\"` is balanced. */\nfunction unbalancedQuotes(v: string): boolean {\n let open = ''\n for (const ch of v) {\n if (open) {\n if (ch === open) open = ''\n }\n else if (ch === '\"' || ch === \"'\") open = ch\n }\n return open !== ''\n}\n\nexport const unsafeCss = (v: string) => UNSAFE_CSS.test(v) || unbalancedQuotes(v)\n\nconst isDev = () => typeof process !== 'undefined' && process.env?.NODE_ENV !== 'production'\n\n/** Keeps the safe `[name, value]` pairs; warns in development about each dropped one. */\nexport function safePairs(pairs: [string, string][]): [string, string][] {\n return pairs.filter(([k, v]) => {\n const ok = !unsafeCss(k) && !unsafeCss(v)\n if (!ok && isDev()) console.warn(`[mei-editor] token \"${k}\" dropped: its name or value is not safe in CSS ({ } ; < > \\\\ comments, unclosed quotes)`)\n return ok\n })\n}\n\nfunction overridePairs(tokens: Omit<ThemeTokens, 'dark'>): [string, string][] {\n const { components, ...semantic } = tokens\n return safePairs([...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;CAA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