Emdash source with visual editor image upload fix

Fixes:
1. media.ts: wrap placeholder generation in try-catch
2. toolbar.ts: check r.ok, display error message in popover
This commit is contained in:
2026-05-03 10:44:54 +07:00
parent 78f81bebb6
commit 2d1be52177
2352 changed files with 662964 additions and 0 deletions

View File

@@ -0,0 +1,44 @@
import { transformAsync } from "@babel/core";
import type { Plugin } from "rolldown";
import { defineConfig } from "tsdown";
const JS_TS_RE = /\.[jt]sx?$/;
function linguiMacroPlugin(): Plugin {
return {
name: "lingui-macro",
transform: {
filter: { id: JS_TS_RE },
async handler(code: string, id: string) {
if (!code.includes("@lingui")) return;
const result = await transformAsync(code, {
filename: id,
plugins: ["@lingui/babel-plugin-lingui-macro"],
parserOpts: { plugins: ["jsx", "typescript"] },
});
if (!result?.code) return;
return { code: result.code, map: result.map ?? undefined };
},
},
};
}
export default defineConfig({
entry: ["src/index.ts", "src/locales/index.ts"],
format: ["esm"],
dts: true,
clean: true,
platform: "browser",
plugins: [linguiMacroPlugin()],
// @tiptap/suggestion is intentionally bundled (devDependency)
inlineOnly: false,
external: [
"react",
"react-dom",
"react/jsx-runtime",
"react/jsx-dev-runtime",
// Keep TanStack external - Vite in consumer project will need to resolve these
"@tanstack/react-router",
"@tanstack/react-query",
],
});