Commit Graph
1676 Commits
Author SHA1 Message Date
Libin YANG fd136f79f8 chore(deps): bump wrangler, marked, and related packages (#1919) 2026-08-18 21:52:26 +08:00
ziven 4892a3d8ec refactor(upload): modularize image upload providers (#1918) 2026-08-18 19:29:17 +08:00
Libin YANG a6c64f2a37 chore(deps): bump pnpm, workers-types, and security overrides (#1917) 2026-08-17 17:31:56 +08:00
Libin YANG 435c7d132b chore(deps): bump CodeMirror, vue-tsc, and workers-types (#1915) 2026-08-16 21:17:57 +08:00
Libin YANG 9abab6a020 fix(web): keep Mermaid diagrams intact when copying to WeChat (#1914)
Sanitize juice-invalid CSS, flatten foreignObject labels, separate overlapping state edge labels, and drop extra journey preview height.
2026-08-16 09:57:42 +08:00
Libin YANG 236f2f12a9 chore(deps): bump packages and migrate CI to pnpm/setup (#1911) 2026-08-15 08:52:58 +08:00
Doocs Bot b18f949318 chore: auto update starcharts 2026-08-14 08:24:00 +08:00
Doocs Bot b917d74aba chore: auto update starcharts 2026-08-13 20:19:55 +08:00
Libin YANG 761b4f4b42 chore(deps): bump wrangler, vscode types, and related packages (#1910)
Align @types/vscode and engines.vscode at 1.125.0 so vsce packaging
stays valid. Bump wrangler to ^4.122.0 so @cloudflare/vite-plugin
1.52.0 can land after the npmmirror lag that blocked 1.51.2.
2026-08-13 19:55:54 +08:00
Doocs Bot 1620929d8c chore: auto update starcharts 2026-08-13 08:23:37 +08:00
Doocs Bot d7bd3f2210 chore: auto update starcharts 2026-08-12 21:07:12 +08:00
Libin YANG a8ac842dd2 docs: replace star-history chart with repo-hosted starcharts (#1909)
The star-history.com chart API is rate-limited. Adopt the same
approach as doocs/leetcode: generate images/starcharts.svg in the
repo via MaoLongLong/actions-starcharts on a 12h schedule, and
reference the local SVG in README.md and README-EN.md.
2026-08-12 21:03:00 +08:00
Libin YANG 130f8d5d43 chore(deps): bump aws-sdk, reka-ui, tsx, and cloudflare packages (#1905) 2026-08-11 08:50:34 +08:00
Libin YANG 4a1eb2025c fix(core): add boundary rules to markup extension delimiters (#1904)
* fix(core): add boundary rules to markup extension delimiters

Intraword text like `C++是最好的语言,C++是最好的语言` had its two `++`
pairs matched as underline delimiters. Require the opening delimiter to
not directly follow an ASCII letter/digit (checked across inline token
boundaries), and disallow whitespace right inside the delimiters, so
`x==1==y`, `v1~2~3` and `++ text ++` stay literal as well. CJK intraword
usage such as `把++重点++标出` keeps rendering.


* fix(core): drop regex lookbehind from markup boundary rules

Regex lookbehind throws a SyntaxError at parse time in JS engines
without support (older WebViews), which would crash the whole renderer
on load. Enforce the same boundaries without it: scan delimiter runs in
`start` and check the preceding char manually, and require the content''s
final char via an explicit non-whitespace character class.
2026-08-10 15:02:35 +08:00
Libin YANG 879186d1a3 chore(deps): replace deprecated crypto-js with crypto-es (#1903) 2026-08-10 09:39:32 +08:00
Libin YANG 8fcda70cc3 chore(deps): bump @lucide/vue and @cloudflare/workers-types (#1902) 2026-08-10 08:58:03 +08:00
Libin YANG 4699016755 chore(deps): upgrade dependencies (#1900)
Bump outdated deps within existing semver ranges and catalog:
@aws-sdk/client-s3 and s3-request-presigner 3.1106.0,
@cloudflare/vite-plugin 1.51.1, @cloudflare/workers-types 5.20260808.1,
@lucide/vue 1.30.0, @types/node 26.2.0, @antfu/eslint-config 9.3.0,
eslint 10.8.1, hono 4.13.1, isomorphic-dompurify 3.22.0, tsx 4.23.11,
vite 8.2.1, wrangler 4.120.0.

Kept: prettier 2.8.8 (pinned), typescript ~6.0.3 (TS 7 major deferred),
@types/vscode 1.120.0 (must not exceed engines.vscode), crypto-js
(deprecated, no successor). Patched deps unchanged; patch files still apply.
2026-08-09 20:08:57 +08:00
Libin YANG 4aaa1ee278 perf(web): editor rendering & storage performance, fix history preview overflow (#1898)
- Group posts by parent id once instead of re-filtering per tree node
- Collect headings during render instead of parsing the output HTML
- Debounce reactive persistence behind an in-memory overlay so sync
  reads stay current; snapshot pending writes to localStorage on
  pagehide and restore them on next launch so no state is lost
- Skip off-screen rendering via content-visibility for the post tree,
  search results, and diff lines
- Preload the post-slider chunk when idle; pre-bundle diff-match-patch
  so the dev server stops force-reloading on first interaction
2026-08-07 17:15:48 +08:00
Libin YANG 1d4dee424d chore: pin LF line endings for generated dts files (#1899)
unplugin-auto-import / unplugin-vue-components regenerate
auto-imports.d.ts and components.d.ts with LF on every dev-server
start. On Windows with core.autocrlf=true git expects CRLF, so the
files showed up as modified after each `pnpm web dev` despite an empty
diff. Pin eol=lf in .gitattributes to stop the phantom dirty state for
all contributors.
2026-08-07 17:15:22 +08:00
Libin YANGandCursor 6ca214b7c3 fix(web): editor search & persistence fixes, keyboard a11y, cleanups (#1896)
* fix(web): fix post search misses and history restore timestamp

- extract search logic to lib/search-posts with a 250ms debounce; count matches via String.match (avoids stale-lastIndex misses of a reused global RegExp across posts) in a single scan for results and totals together
- render search results and history version entries as real buttons; make the history list width responsive on narrow screens
- bump post.updateDatetime on history restore so restored content is picked up by update-time sorting and cloud sync

Co-authored-by: Cursor <cursoragent@cursor.com>

* perf(web): replace deep post watches with signature watchers

- watch per-post signatures (id/title/content length/updateDatetime ms/parent/history length/collapsed) instead of deep-traversing every post on each editor commit; the old deep watch compared identical object identities and never persisted edits
- collect dirty post ids in a set and flush once per debounce window, so rapid edits across different posts are all saved (shared single-argument debounce used to drop earlier posts)
- inject heading anchor ids during render instead of assigning output twice, avoiding a second preview DOM rebuild

Co-authored-by: Cursor <cursoragent@cursor.com>

* refactor: dedupe escapeHtml/delay helpers and remove dead code

- share one escapeHtml in apps/api share pages and reuse @md/core's in the formula dialog
- centralize the delay() helper used by preview boot, PNG export and the editor header
- drop unused createTable/checkImage utilities and a stale debug comment

Co-authored-by: Cursor <cursoragent@cursor.com>

* feat(web): improve keyboard accessibility across editor UI

- make drag-drop upload areas, syntax help cards, JSON preview expanders and the footer line/col indicator keyboard-operable (real buttons or role/tabindex + Enter/Space)
- reveal hover-only controls (post item menu, table cell delete buttons) on keyboard focus via focus-visible
- add missing aria-labels to icon-only buttons, role=tablist to the CSS editor tabs, role=checkbox to multi-select, and move the collapse toggle out of the post row button to avoid nested interactives

Co-authored-by: Cursor <cursoragent@cursor.com>

* test(core): add render tests for footnote, toc, ruby, markup, slider and alert extensions

Co-authored-by: Cursor <cursoragent@cursor.com>

* ci: unify web type-check with build and include @md/shared in tests

- run the package's own vue-tsc --build --force for type-check:web so CI catches the same errors as pnpm web build
- add @md/shared tests to the root test script

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(ci): commit generated auto-import/components dts for type-check job

vue-tsc --build --force builds the referenced tsconfig.app.json, which includes auto-imports.d.ts and components.d.ts. Both were gitignored, so the CI type-check job (no prior vite build to regenerate them) failed with TS2304 for every auto-imported global (ref, useDark, useToggle, ...).

The previous vue-tsc --noEmit ran on the solution-style root tsconfig (files: [] + references) and checked zero files, which is why CI was green while real errors slipped through.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(web): guard zero-width search matches and clean up a11y semantics

- ignore zero-width regex matches when counting, highlighting and snippeting so empty-matching patterns (a*, ^, \b) neither match every post nor inflate counts to O(content length); replace skips zero-width positions and inserts the replacement literally
- give the multi-select checkbox an accessible name (new common.selectPost message)
- move the CSS tab more-actions button out of the role=tab element so each tab is a single focus stop

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-07 14:25:03 +08:00
Libin YANGandCursor 91dadd4ddd fix(web): guard drag-drop binding against stale template ref on HMR remount
The async onMounted callback can resolve after an HMR remount, where
codeMirrorWrapper of the stale instance is already null.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-07 10:42:00 +08:00
Libin YANGandCursor fa8eb20a33 fix(web): defer panel resize to rAF and skip no-ops
nextTick still runs inside Vue's update flush, where resize() ->
setLayout re-queues SplitterGroup's own update and Vue aborts with
'Maximum recursive updates exceeded'. rAF runs after paint when the
group layout has settled; the getSize guard prevents no-op resizes
from starting a constraint cascade.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-07 10:32:52 +08:00
Libin YANG 64573a9a31 feat(web): add visual table editor dialog (#1895)
- create and edit GFM tables in a dialog with row/column steppers,
  per-column alignment cycling, and cell keyboard navigation
- open in edit mode from the editor context menu (position-aware via
  posAtCoords), the insert dropdown, slash command, and command palette
- click a table in the preview to edit it, mapped positionally through
  a marked-parity scanner (fence/blockquote/indentation aware)
- preserve original indentation on update, re-locate tables safely when
  the document changed while the dialog is open, and swallow surplus
  blank lines on delete
- guard ResizablePanel.resize() calls against reka-ui mount races
2026-08-07 10:24:58 +08:00
Libin YANGandCursor c975279c6f build(deps): fix hono ReDoS alert, bump aws-sdk and workflow pnpm (#1894)
* build(deps): fix hono ReDoS via override and bump aws-sdk

- Override hono to ^4.13.0: @modelcontextprotocol/sdk pins 4.12.33,
  which is vulnerable to ReDoS in the CORS middleware
  (CVE-2026-69207 / GHSA-8j4g-w8fx-2239, dependabot alert #317)
- Bump @aws-sdk/client-s3 and @aws-sdk/s3-request-presigner to 3.1104.0

Co-authored-by: Cursor <cursoragent@cursor.com>

* ci: bump pnpm from 11.18.0 to 11.20.0 in workflows

All actions were verified against upstream and are already on their
latest major versions (checkout v7, setup-node v7, wrangler-action v4,
github-script v9, stale v11, upload-artifact v7, etc.).

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-06 08:58:24 +08:00
Libin YANG 0e5ac74a38 build(deps): bump dependencies to latest compatible versions (#1893)
- catalog: @codemirror/view 6.43.8, workers-types 5.20260804.1,
  marked 18.0.9, tsx 4.23.7, wrangler 4.119.0
- shared: @codemirror/lang-html 6.4.12, lang-markdown 6.5.2
- core: mermaid 11.16.1
- web: vue 3.5.41, juice 12.1.2, aws-sdk s3 3.1103.0,
  @cloudflare/vite-plugin 1.51.0, unplugin-auto-import 21.1.0
- api: hono 4.13.0
- migrate pnpm patches for @codemirror/view and juice to the new
  versions (MeasureRequest export, macOS Alt+Shift, parseCSS guard)

Skipped on purpose: prettier 3.x (pinned to 2.8.8), typescript 7.x
(major), @types/vscode (kept aligned with engines.vscode 1.120).
2026-08-06 08:17:27 +08:00
Libin YANG 9a548dd360 build(deps): bump tsx from 4.23.1 to 4.23.2 (#1889) 2026-08-02 20:23:37 +08:00
Libin YANG 779c351aa1 fix(vscode): shrink vsix size and fix packaging checks (#1888)
- webpack: clean dist/ before builds so stale async chunks are not packaged
- webpack: keep previewRenderer as an external so it loads on demand
  instead of being inlined into extension.js (3.97 MiB -> 9.7 KB)
- align @types/vscode with engines.vscode so vsce package succeeds
- relax smoke-test count assertion for locale-neutral core fallbacks
2026-08-02 16:35:57 +08:00
Libin YANG dc4bab3d85 feat(web): adapt theme options to compact blocks in narrow right slider (#1887) 2026-08-02 09:30:30 +08:00
Libin YANG adf6c62aa7 perf(web): cut initial JS bundle by ~620 kB (#1886)
- Scope the manualChunks highlight.js rule to the package root so
  @antv/infographic's select-highlight.js no longer drags roughjs,
  measury fonts, culori and tinycolor2 onto the critical path
  (highlight chunk: 281 kB -> 57 kB min)
- Only pin core @lezer packages (common/lr/highlight/markdown/html)
  in the codemirror chunk; language grammars follow the lazy
  LanguageDescription.load() chunks again (1,019 kB -> 624 kB min)
- Drop css/javascript language setups from the shared editor barrel;
  lazy consumers import them via '@md/shared/editor/css' and
  '@md/shared/editor/javascript' instead
- Replace jszip with fflate (already bundled via @md/core) for the
  CSS-theme and posts ZIP exports; remove the jszip dependency
- Fix Vite native-config-loader warnings: replace __dirname with
  fileURLToPath(import.meta.url) and add the .ts extension to the
  local plugin import
2026-08-02 08:15:19 +08:00
Libin YANG 5664b7f1a2 build(deps): bump dependencies to latest compatible versions (#1885)
- npm: aws-sdk 3.1101.0, @cloudflare/vite-plugin 1.50.0, vite 8.2.0,
  wrangler 4.118.0, hono 4.12.33, wxt 0.21.3, vue-tsc 3.3.9,
  lint-staged 17.3.0, isomorphic-dompurify 3.21.0 (incl. vscode
  runtime pin), plus all in-range direct/transitive updates
- ci: pin pnpm 11.18.0 in workflows (pnpm/action-setup#276 fixed);
  all actions verified on their latest majors
- docker: nginx 1.30.4-alpine, golang 1.26.5-alpine, alpine 3.24
- hold prettier 2.8.8 (pinned) and typescript 6.x (ts-loader/vue-tsc
  not yet compatible with the TS 7 native port)
2026-08-02 07:14:27 +08:00
Libin YANG e50183350a feat(web): show header actions as text on desktop and icons on mobile (#1884) 2026-07-31 22:28:42 +08:00
YangFong 029a7ed4e7 feat(web): support drag-and-drop JSON import (#1880) 2026-07-31 21:53:08 +08:00
YangFong 0022275aa4 fix(web): prevent focus ring clipping in diff tab select (#1883) 2026-07-31 21:31:24 +08:00
YangFong 3d16426a0f fix(web): keep active item in view in command palette (#1881) 2026-07-31 07:01:09 +08:00
YangFong 54cc7b05b7 fix(web): deduplicate filenames when exporting posts as zip (#1879) 2026-07-31 06:55:19 +08:00
Libin YANG 7e6511f547 fix(web): parse text/plain JSON responses in mp image upload (#1878)
WeChat's media/uploadimg endpoint returns a JSON body with a text/plain
Content-Type. The fetch wrapper that replaced axios only parsed
application/json responses, so the body stayed a string, res.url was
undefined, and the client reported "no URL returned" even though the
image had been uploaded successfully.

Restore axios-like lenient JSON parsing for non-JSON content types and
surface the WeChat errcode/errmsg detail in mp token/upload errors.

#1877
2026-07-30 09:58:44 +08:00
Libin YANG af2eeaa26d build(deps): bump dependencies to latest compatible versions (#1875) 2026-07-29 20:58:58 +08:00
dependabot[bot] 26300bb336 build(deps): bump actions/stale from 10 to 11 (#1872)
Bumps [actions/stale](https://github.com/actions/stale) from 10 to 11.
- [Release notes](https://github.com/actions/stale/releases)
- [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/stale/compare/v10...v11)

---
updated-dependencies:
- dependency-name: actions/stale
  dependency-version: '11'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-07-29 20:25:12 +08:00
YangFong 70c8c2d274 fix(web): keep post list item height consistent in multi-select mode (#1873) 2026-07-29 20:24:17 +08:00
Libin YANG 74b2723d38 build(deps): bump dependencies to latest compatible versions (#1871) 2026-07-29 20:13:51 +08:00
YangFong 85a65e464c feat(web): add markdown syntax highlighting to post history (#1870) 2026-07-28 20:42:47 +08:00
YangFong b49e693939 style(web): add active indicator and refine history list item states (#1869) 2026-07-28 20:42:14 +08:00
YangFong 3198bb3d34 feat(web): add CSS syntax highlighting in theme preview dialog (#1866) 2026-07-28 17:05:01 +08:00
YangFong 20b1f88bad fix(vscode): configure i18n-ally display and fallback languages (#1865) 2026-07-28 11:53:31 +08:00
YangFong c55623a96b refactor(i18n): add namespace to ai/upload/store locale keys (#1845) 2026-07-28 11:52:43 +08:00
YangFong a81d230ea2 refactor(web): use shadcn Select in custom component form (#1864) 2026-07-28 08:45:32 +08:00
YangFong 142054116e feat(web): add transition animation to back-to-top button (#1858)
- Only set left/top/right/bottom style props when defined, avoiding
  invalid `undefinedpx` CSS values when a side is omitted
- Disable the enter/leave transition under prefers-reduced-motion
2026-07-28 08:43:33 +08:00
YangFong 0ef6dd3128 fix(web): widen mp account config form widths for i18n long text (#1863) 2026-07-28 08:26:10 +08:00
YangFong 67aea37454 fix(web): reset replace panel state when closing search tab (#1862) 2026-07-28 08:22:12 +08:00
YangFong 5aa9126d58 refactor(web): unify markdown help dialog icon with help menu (#1861) 2026-07-28 08:20:32 +08:00