@windrun-huaiin/diaomao 14.2.0 → 14.3.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@windrun-huaiin/diaomao",
3
- "version": "14.2.0",
3
+ "version": "14.3.0",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -17,8 +17,8 @@
17
17
  "dependencies": {
18
18
  "@clerk/localizations": "^4.2.2",
19
19
  "@clerk/nextjs": "^7.0.5",
20
- "@clerk/themes": "^2.4.57",
21
20
  "@clerk/shared": "^4.3.1",
21
+ "@clerk/themes": "^2.4.57",
22
22
  "@fingerprintjs/fingerprintjs": "^5.1.0",
23
23
  "@hookform/resolvers": "^5.2.2",
24
24
  "@radix-ui/react-alert-dialog": "^1.1.15",
@@ -27,10 +27,10 @@
27
27
  "@radix-ui/react-slot": "^1.2.4",
28
28
  "@tailwindcss/typography": "^0.5.19",
29
29
  "@types/mdx": "^2.0.13",
30
- "@windrun-huaiin/backend-core": "14.2.0",
31
- "@windrun-huaiin/base-ui": "14.0.2",
32
- "@windrun-huaiin/lib": "^14.0.0",
33
- "@windrun-huaiin/third-ui": "14.1.0",
30
+ "@windrun-huaiin/backend-core": "14.3.0",
31
+ "@windrun-huaiin/base-ui": "14.0.3",
32
+ "@windrun-huaiin/lib": "14.0.1",
33
+ "@windrun-huaiin/third-ui": "14.4.0",
34
34
  "autoprefixer": "^10.4.27",
35
35
  "class-variance-authority": "^0.7.1",
36
36
  "clsx": "^2.1.1",
@@ -75,7 +75,7 @@
75
75
  "@types/react": "^19.2.14",
76
76
  "@types/react-dom": "^19.2.3",
77
77
  "@typescript-eslint/parser": "^8.56.1",
78
- "@windrun-huaiin/dev-scripts": "^14.1.2",
78
+ "@windrun-huaiin/dev-scripts": "^14.1.3",
79
79
  "baseline-browser-mapping": "^2.10.0",
80
80
  "eslint": "^9.39.1",
81
81
  "eslint-config-next": "^16.1.6",
@@ -125,7 +125,7 @@
125
125
  "deep-clean": "dev-scripts deep-clean",
126
126
  "d8": "pnpm run deep-clean",
127
127
  "diaomao-help": "dev-scripts -h",
128
- "diaomao-update": "dev-scripts diaomao-update -v",
128
+ "diaomao-update": "pnpm add -D @windrun-huaiin/dev-scripts@latest && pnpm exec dev-scripts diaomao-update -v",
129
129
  "easy-changeset": "dev-scripts easy-changeset",
130
130
  "dj": "pnpm run easy-changeset && pnpm changeset status",
131
131
  "djv": "pnpm changeset version",
@@ -138,9 +138,6 @@
138
138
  "core-sync-route": "dev-scripts backend-core routes:sync",
139
139
  "core-sync-schema": "dev-scripts backend-core prisma:sync",
140
140
  "core-sync-sql": "dev-scripts backend-core migrations:sync --schema diaomao --dest database",
141
- "whoareyou": "dev-scripts generate-nextjs-architecture -v",
142
- "windrun": "pnpm remove @windrun-huaiin/base-ui @windrun-huaiin/lib @windrun-huaiin/third-ui @windrun-huaiin/backend-core @windrun-huaiin/dev-scripts && pnpm add @windrun-huaiin/base-ui@latest @windrun-huaiin/lib@latest @windrun-huaiin/third-ui@latest @windrun-huaiin/backend-core@latest && pnpm add -D @windrun-huaiin/dev-scripts@latest",
143
- "windrun3": "pnpm remove @windrun-huaiin/third-ui && pnpm add @windrun-huaiin/third-ui@latest",
144
- "windrunC": "pnpm remove @windrun-huaiin/backend-core && pnpm add @windrun-huaiin/backend-core@latest"
141
+ "whoareyou": "dev-scripts generate-nextjs-architecture -v"
145
142
  }
146
143
  }
@@ -2,7 +2,7 @@
2
2
  title: Blog
3
3
  description: Articles and thoughts about various topics.
4
4
  icon: Rss
5
- date: 2026-03-22
5
+ date: 2026-03-27
6
6
  ---
7
7
 
8
8
  ## Past List
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  title: Monthly Summary
3
3
  description: Index and Summary
4
- date: 2026-03-22
4
+ date: 2026-03-27
5
5
  ---
6
6
 
7
7
 
@@ -1,15 +0,0 @@
1
- diff --git a/dist/toc.js b/dist/toc.js
2
- index 7d1336e9b4e54d862739ed02019505e7f3c2589d..e3d504e38a0d07cf6341704898e570dbf58b9002 100644
3
- --- a/dist/toc.js
4
- +++ b/dist/toc.js
5
- @@ -100,7 +100,9 @@ function useAnchorObserver(watch, single) {
6
- }
7
- }
8
- if (state.visible.size === 0) {
9
- - const viewTop = entries[0].rootBounds.top;
10
- + const rootBounds = entries[0]?.rootBounds;
11
- + if (!rootBounds) return;
12
- + const viewTop = rootBounds.top;
13
- let fallback;
14
- let min = -1;
15
- for (const id of watch) {
@@ -1,159 +0,0 @@
1
- diff --git a/dist/components/layout/toc-clerk.d.ts.map b/dist/components/layout/toc-clerk.d.ts.map
2
- index 9156ea92f045791b8600661d8dac7ef17e8659bc..aec472b0c2387fea6c5ee0f2668087de2530398e 100644
3
- --- a/dist/components/layout/toc-clerk.d.ts.map
4
- +++ b/dist/components/layout/toc-clerk.d.ts.map
5
- @@ -1 +1 @@
6
- -{"version":3,"file":"toc-clerk.d.ts","sourceRoot":"","sources":["../../../src/components/layout/toc-clerk.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,cAAc,EAA+B,MAAM,OAAO,CAAC;AAOzE,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,EACpC,GAAG,EACH,SAAS,EACT,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,KAAK,CAAC,2CAsGvB"}
7
-
8
- +{"version":3,"file":"toc-clerk.d.ts","sourceRoot":"","sources":["../../../src/components/layout/toc-clerk.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,cAAc,EAA0B,MAAM,OAAO,CAAC;AAMpE,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,EACpC,GAAG,EACH,SAAS,EACT,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,KAAK,CAAC,2CA4BvB"}
9
-
10
- diff --git a/dist/components/layout/toc-clerk.js b/dist/components/layout/toc-clerk.js
11
- index 40f8b2b191cd2817a51de0aaf9c492a3077aac60..f36b807e5eea299e18818b9d938aa506cbaad406 100644
12
- --- a/dist/components/layout/toc-clerk.js
13
- +++ b/dist/components/layout/toc-clerk.js
14
- @@ -1,9 +1,8 @@
15
- 'use client';
16
- -import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
17
- +import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
18
- import * as Primitive from 'fumadocs-core/toc';
19
- -import { useEffect, useRef, useState } from 'react';
20
- +import { useRef } from 'react';
21
- import { cn } from '../../utils/cn.js';
22
- -import { TocThumb } from '../../components/layout/toc-thumb.js';
23
- import { useTOCItems } from '../../components/layout/toc.js';
24
- import { mergeRefs } from '../../utils/merge-refs.js';
25
- import { useI18n } from '../../contexts/i18n.js';
26
- @@ -11,51 +10,9 @@ export default function ClerkTOCItems({ ref, className, ...props }) {
27
- const containerRef = useRef(null);
28
- const items = useTOCItems();
29
- const { text } = useI18n();
30
- - const [svg, setSvg] = useState();
31
- - useEffect(() => {
32
- - if (!containerRef.current)
33
- - return;
34
- - const container = containerRef.current;
35
- - function onResize() {
36
- - if (container.clientHeight === 0)
37
- - return;
38
- - let w = 0, h = 0;
39
- - const d = [];
40
- - for (let i = 0; i < items.length; i++) {
41
- - const element = container.querySelector(`a[href="#${items[i].url.slice(1)}"]`);
42
- - if (!element)
43
- - continue;
44
- - const styles = getComputedStyle(element);
45
- - const offset = getLineOffset(items[i].depth) + 1, top = element.offsetTop + parseFloat(styles.paddingTop), bottom = element.offsetTop +
46
- - element.clientHeight -
47
- - parseFloat(styles.paddingBottom);
48
- - w = Math.max(offset, w);
49
- - h = Math.max(h, bottom);
50
- - d.push(`${i === 0 ? 'M' : 'L'}${offset} ${top}`);
51
- - d.push(`L${offset} ${bottom}`);
52
- - }
53
- - setSvg({
54
- - path: d.join(' '),
55
- - width: w + 1,
56
- - height: h,
57
- - });
58
- - }
59
- - const observer = new ResizeObserver(onResize);
60
- - onResize();
61
- - observer.observe(container);
62
- - return () => {
63
- - observer.disconnect();
64
- - };
65
- - }, [items]);
66
- if (items.length === 0)
67
- return (_jsx("div", { className: "rounded-lg border bg-fd-card p-3 text-xs text-fd-muted-foreground", children: text.tocNoHeadings }));
68
- - return (_jsxs(_Fragment, { children: [svg ? (_jsx("div", { className: "absolute start-0 top-0 rtl:-scale-x-100", style: {
69
- - width: svg.width,
70
- - height: svg.height,
71
- - maskImage: `url("data:image/svg+xml,${
72
- - // Inline SVG
73
- - encodeURIComponent(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${svg.width} ${svg.height}"><path d="${svg.path}" stroke="black" stroke-width="1" fill="none" /></svg>`)}")`,
74
- - }, children: _jsx(TocThumb, { containerRef: containerRef, className: "mt-(--fd-top) h-(--fd-height) bg-fd-primary transition-all" }) })) : null, _jsx("div", { ref: mergeRefs(containerRef, ref), className: cn('flex flex-col', className), ...props, children: items.map((item, i) => (_jsx(TOCItem, { item: item, upper: items[i - 1]?.depth, lower: items[i + 1]?.depth }, item.url))) })] }));
75
- + return (_jsx("div", { ref: mergeRefs(containerRef, ref), className: cn('flex flex-col relative', className), ...props, children: items.map((item, i) => (_jsx(EnhancedClerkTOCItemInternal, { item: item, upperDepth: items[i - 1]?.depth, lowerDepth: items[i + 1]?.depth }, item.url))) }));
76
- }
77
- function getItemOffset(depth) {
78
- if (depth <= 2)
79
- @@ -67,11 +24,74 @@ function getItemOffset(depth) {
80
- function getLineOffset(depth) {
81
- return depth >= 3 ? 10 : 0;
82
- }
83
- -function TOCItem({ item, upper = item.depth, lower = item.depth, }) {
84
- - const offset = getLineOffset(item.depth), upperOffset = getLineOffset(upper), lowerOffset = getLineOffset(lower);
85
- +function getVisualLinePosition(depth) {
86
- + return getLineOffset(depth);
87
- +}
88
- +function EnhancedClerkTOCItemInternal({ item, upperDepth = item.depth, lowerDepth = item.depth, }) {
89
- + const isH3 = item.depth === 3;
90
- + const rawTitle = typeof item.title === 'string' ? item.title : '';
91
- + const { isStep, displayStep, content } = getStepInfoFromTitle(rawTitle);
92
- + let stepNumber = isH3 && isStep ? String(displayStep) : null;
93
- + let resolvedContent = item.title;
94
- + if (isH3 && isStep) {
95
- + resolvedContent = content ?? item.title;
96
- + }
97
- + if (isH3 && !stepNumber) {
98
- + const urlNum = _getDigitsFromUrl(item.url);
99
- + if (urlNum != null) {
100
- + const clamped = Math.max(0, Math.min(19, urlNum));
101
- + stepNumber = String(clamped);
102
- + if (typeof rawTitle === 'string') {
103
- + const m = rawTitle.match(/^(\d+(?:\.\d+)*\.?)\s+(.+)$/);
104
- + if (m && m[2]) {
105
- + resolvedContent = m[2];
106
- + }
107
- + }
108
- + }
109
- + }
110
- + const shouldRenderCircle = isH3 && stepNumber !== null;
111
- + const lineOffsetWithinItem = getLineOffset(item.depth);
112
- + const upperLineOffsetWithinItem = getLineOffset(upperDepth);
113
- + const lowerLineOffsetWithinItem = getLineOffset(lowerDepth);
114
- + const itemPadding = getItemOffset(item.depth);
115
- + const visualElementX = getVisualLinePosition(item.depth);
116
- + const CIRCLE_RADIUS_PX = 7;
117
- return (_jsxs(Primitive.TOCItem, { href: item.url, style: {
118
- - paddingInlineStart: getItemOffset(item.depth),
119
- - }, className: "prose relative py-1.5 text-sm text-fd-muted-foreground hover:text-fd-accent-foreground transition-colors [overflow-wrap:anywhere] first:pt-0 last:pb-0 data-[active=true]:text-fd-primary", children: [offset !== upperOffset ? (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 16 16", className: "absolute -top-1.5 start-0 size-4 rtl:-scale-x-100", children: _jsx("line", { x1: upperOffset, y1: "0", x2: offset, y2: "12", className: "stroke-fd-foreground/10", strokeWidth: "1" }) })) : null, _jsx("div", { className: cn('absolute inset-y-0 w-px bg-fd-foreground/10', offset !== upperOffset && 'top-1.5', offset !== lowerOffset && 'bottom-1.5'), style: {
120
- - insetInlineStart: offset,
121
- - } }), item.title] }));
122
- + paddingInlineStart: itemPadding,
123
- + }, className: "prose group relative py-1.5 text-sm text-fd-muted-foreground hover:text-fd-accent-foreground transition-colors [overflow-wrap:anywhere] first:pt-0 last:pb-0 data-[active=true]:text-fd-primary", children: [lineOffsetWithinItem !== upperLineOffsetWithinItem ? (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 16 16", className: "absolute -top-1.5 size-4 pointer-events-none rtl:-scale-x-100", style: {
124
- + insetInlineStart: Math.min(lineOffsetWithinItem, upperLineOffsetWithinItem),
125
- + zIndex: 1,
126
- + }, children: _jsx("line", { x1: upperLineOffsetWithinItem -
127
- + Math.min(lineOffsetWithinItem, upperLineOffsetWithinItem), y1: "0", x2: lineOffsetWithinItem -
128
- + Math.min(lineOffsetWithinItem, upperLineOffsetWithinItem), y2: "12", className: cn('stroke-fd-foreground/10', 'group-data-[active=true]:stroke-fd-primary'), strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) })) : null, _jsx("div", { className: cn('absolute inset-y-0 pointer-events-none transition-all duration-500 ease-in-out', 'w-[2px] bg-fd-foreground/15 group-data-[active=true]:bg-fd-primary', lineOffsetWithinItem !== upperLineOffsetWithinItem && 'top-1.5', lineOffsetWithinItem !== lowerLineOffsetWithinItem && 'bottom-1.5'), style: {
129
- + insetInlineStart: lineOffsetWithinItem,
130
- + zIndex: 1,
131
- + } }), shouldRenderCircle && stepNumber ? (_jsx("span", { className: cn('absolute z-10 flex size-[14px] -translate-y-1/2 items-center justify-center rounded-full', 'bg-black text-white dark:bg-white dark:text-black', 'group-data-[active=true]:bg-fd-primary group-data-[active=true]:text-white dark:group-data-[active=true]:text-black', 'font-medium text-xs'), style: {
132
- + left: visualElementX - CIRCLE_RADIUS_PX,
133
- + top: '50%',
134
- + }, children: stepNumber })) : null, _jsx("span", { style: { position: 'relative', zIndex: 1 }, children: resolvedContent })] }));
135
- +}
136
- +function _getDigitsFromUrl(url) {
137
- + const match = /^#(\d+)-/.exec(url);
138
- + if (!match)
139
- + return null;
140
- + const value = Number.parseInt(match[1], 10);
141
- + return Number.isNaN(value) ? null : value;
142
- +}
143
- +function getStepInfoFromTitle(title) {
144
- + const trimmed = title.trim();
145
- + const match = trimmed.match(/^(\d+(?:\.\d+)*\.?)\s+(.+)$/);
146
- + if (!match)
147
- + return { isStep: false, displayStep: null, content: null };
148
- + const content = (match[2] ?? '').trim();
149
- + if (content.length === 0)
150
- + return { isStep: false, displayStep: null, content: null };
151
- + const numericPart = match[1].replace(/\.$/, '');
152
- + const parts = numericPart.split('.').map((part) => Number.parseInt(part, 10));
153
- + const lastPart = parts.at(-1);
154
- + if (lastPart == null || Number.isNaN(lastPart)) {
155
- + return { isStep: false, displayStep: null, content: null };
156
- + }
157
- + const clamped = Math.max(0, Math.min(19, lastPart));
158
- + return { isStep: true, displayStep: clamped, content };
159
- }