Files
lobehub/locales/ru-RU
Innei 58fb45d251 🐛 fix: add unsaved changes guard to prevent data loss on navigation (#12332)
* 🐛 fix: add unsaved changes guard to prevent data loss on navigation

Migrate from BrowserRouter to createBrowserRouter (data router API) to enable
route-level navigation blocking. Add UnsavedChangesGuard component that uses
useBlocker to prevent leaving editor pages with unsaved changes, auto-saving
before navigation. Remove legacy renderRoutes/RouteConfig dead code.

Fixes LOBE-4973

* 🔧 chore: remove unused ESLint suppressions for welcome.ts

Cleaned up eslint-suppressions.json by removing suppressions related to sort-keys-fix and typescript-sort-keys for welcome.ts, as they are no longer needed.

Signed-off-by: Innei <tukon479@gmail.com>

*  perf: skip JSON snapshot on selection-only Lexical updates

Reintroduce dirtyElements/dirtyLeaves guard before editor.getDocument('json')
and deep-equality check, avoiding O(document-size) work on caret/selection
updates that do not mutate content.

* 🔧 test: update UnsavedChangesGuard tests to use message.destroy instead of message.success

Signed-off-by: Innei <tukon479@gmail.com>

* fix: dayjs init

- Moved dayjs plugin extensions (relativeTime, utc, isToday, isYesterday) to src/initialize.ts for centralized initialization.
- Removed redundant extensions from individual components to prevent duplicate calls.
- Updated locale loading logic in Locale.tsx to ensure correct dayjs locale handling.

This change improves performance by ensuring dayjs plugins are only extended once during application initialization.

Signed-off-by: Innei <tukon479@gmail.com>

* refactor: update router configuration to use RouteObject type

- Changed the type of desktopRoutes from RouteConfig[] to RouteObject[] for better compatibility with react-router-dom.
- Removed the RouteConfig interface from the router utility file to streamline the codebase.

This refactor enhances the router's integration with the latest routing library standards.

Signed-off-by: Innei <tukon479@gmail.com>

* feat: enhance Vite configuration and chunk management

- Added a function to suppress Vite's default URL print in the server configuration.
- Updated chunk file naming strategy in sharedRollupOutput to organize output files into specific directories based on chunk type (i18n, vendor, assets).
- Removed redundant dayjs chunk handling logic to streamline the manualChunks function.

These changes improve the clarity of the build output and enhance the server's configuration options.

Signed-off-by: Innei <tukon479@gmail.com>

*  feat: add collapsible error stack with __CI__ default expand

- Add Collapse + Highlighter for error stack in Error component
- Define __CI__ in Vite (sharedRendererDefine) based on process.env.CI
- Add __CI__ to global.d.ts
- Add error.stack i18n to all 18 locales

Made-with: Cursor

* chore: update build:spa:copy script to handle multiple asset directories

- Modified the build:spa:copy script in package.json to iterate over multiple directories (assets, i18n, vendor) for both desktop and mobile builds, improving the asset copying process.

This change enhances the build process by ensuring all relevant directories are copied correctly.

Signed-off-by: Innei <tukon479@gmail.com>

* 🐛 fix: mark initialize.ts as sideEffects to prevent tree-shaking

sideEffects: false caused Rollup to drop the side-effect-only import
of initialize.ts, removing dayjs.extend(relativeTime) and enableMapSet()
from the production bundle.

---------

Signed-off-by: Innei <tukon479@gmail.com>
2026-03-03 18:50:57 +08:00
..
2026-01-19 01:13:02 +08:00
2026-01-31 20:34:06 +08:00
2025-12-31 15:20:11 +08:00
2026-03-02 23:14:02 +08:00
2025-12-31 15:20:11 +08:00
2026-02-12 21:22:21 +08:00
2025-12-31 15:20:11 +08:00
2025-12-31 15:20:11 +08:00
2025-12-31 15:20:11 +08:00
2026-02-12 21:22:21 +08:00
2025-12-31 15:20:11 +08:00
2026-01-25 17:33:00 +08:00
2026-01-22 20:08:21 +08:00
2025-12-31 15:20:11 +08:00
2025-12-31 15:20:11 +08:00
2026-01-13 12:25:07 +08:00
2025-12-31 15:20:11 +08:00
2025-12-31 15:20:11 +08:00
2026-02-15 11:10:47 +08:00
2025-12-31 15:20:11 +08:00
2025-12-31 15:20:11 +08:00
2026-02-15 11:10:47 +08:00
2025-12-31 15:20:11 +08:00