File tree Expand file tree Collapse file tree 7 files changed +20
-11
lines changed Expand file tree Collapse file tree 7 files changed +20
-11
lines changed Original file line number Diff line number Diff line change @@ -15,11 +15,11 @@ import {
1515import {
1616 AIMenuController ,
1717 AIToolbarButton ,
18- locales as aiLocales ,
1918 createAIExtension ,
2019 createBlockNoteAIClient ,
2120 getAISlashMenuItems ,
2221} from "@blocknote/xl-ai" ;
22+ import { en as aiEn } from "@blocknote/xl-ai/locales" ;
2323import "@blocknote/xl-ai/style.css" ;
2424import { getEnv } from "./getEnv.js" ;
2525
@@ -58,7 +58,7 @@ export default function App() {
5858 const editor = useCreateBlockNote ( {
5959 dictionary : {
6060 ...en ,
61- ai : aiLocales . en , // add default translations for the AI extension
61+ ai : aiEn , // add default translations for the AI extension
6262 } ,
6363 // Register the AI extension
6464 extensions : [
Original file line number Diff line number Diff line change @@ -20,13 +20,13 @@ import {
2020import {
2121 AIMenuController ,
2222 AIToolbarButton ,
23- locales as aiLocales ,
2423 createAIExtension ,
2524 createBlockNoteAIClient ,
2625 getAIExtension ,
2726 getAISlashMenuItems ,
2827 llmFormats ,
2928} from "@blocknote/xl-ai" ;
29+ import { en as aiEn } from "@blocknote/xl-ai/locales" ;
3030import "@blocknote/xl-ai/style.css" ;
3131import { Fieldset , MantineProvider , Switch } from "@mantine/core" ;
3232
@@ -88,7 +88,7 @@ export default function App() {
8888 const editor = useCreateBlockNote ( {
8989 dictionary : {
9090 ...en ,
91- ai : aiLocales . en , // add default translations for the AI extension
91+ ai : aiEn , // add default translations for the AI extension
9292 } ,
9393 // Register the AI extension
9494 extensions : [
Original file line number Diff line number Diff line change @@ -16,12 +16,12 @@ import {
1616 AIMenu ,
1717 AIMenuController ,
1818 AIToolbarButton ,
19- locales as aiLocales ,
2019 createAIExtension ,
2120 createBlockNoteAIClient ,
2221 getAISlashMenuItems ,
2322 getDefaultAIMenuItems ,
2423} from "@blocknote/xl-ai" ;
24+ import { en as aiEn } from "@blocknote/xl-ai/locales" ;
2525import "@blocknote/xl-ai/style.css" ;
2626import { getEnv } from "./getEnv.js" ;
2727
@@ -62,7 +62,7 @@ export default function App() {
6262 const editor = useCreateBlockNote ( {
6363 dictionary : {
6464 ...en ,
65- ai : aiLocales . en , // add default translations for the AI extension
65+ ai : aiEn , // add default translations for the AI extension
6666 } ,
6767 // Register the AI extension
6868 extensions : [
Original file line number Diff line number Diff line change @@ -15,11 +15,11 @@ import {
1515import {
1616 AIMenuController ,
1717 AIToolbarButton ,
18- locales as aiLocales ,
1918 createAIExtension ,
2019 createBlockNoteAIClient ,
2120 getAISlashMenuItems ,
2221} from "@blocknote/xl-ai" ;
22+ import { en as aiEn } from "@blocknote/xl-ai/locales" ;
2323import "@blocknote/xl-ai/style.css" ;
2424import { useEffect , useState } from "react" ;
2525import YPartyKitProvider from "y-partykit/provider" ;
@@ -104,7 +104,7 @@ export default function App() {
104104 } ,
105105 dictionary : {
106106 ...en ,
107- ai : aiLocales . en , // add default translations for the AI extension
107+ ai : aiEn , // add default translations for the AI extension
108108 } ,
109109 // Register the AI extension
110110 extensions : [
Original file line number Diff line number Diff line change 4848 "import" : " ./dist/style.css" ,
4949 "require" : " ./dist/style.css" ,
5050 "style" : " ./dist/style.css"
51+ },
52+ "./locales" : {
53+ "types" : " ./types/src/i18n/locales/index.d.ts" ,
54+ "import" : " ./dist/locales.js" ,
55+ "require" : " ./dist/locales.cjs"
5156 }
5257 },
5358 "scripts" : {
Original file line number Diff line number Diff line change @@ -11,6 +11,5 @@ export * from "./components/FormattingToolbar/AIToolbarButton.js";
1111export * from "./components/SuggestionMenu/getAISlashMenuItems.js" ;
1212
1313export * from "./i18n/dictionary.js" ;
14- export * as locales from "./i18n/locales/index.js" ;
1514
1615export * from "./api/index.js" ;
Original file line number Diff line number Diff line change @@ -30,9 +30,14 @@ export default defineConfig((conf) => ({
3030 build : {
3131 sourcemap : true ,
3232 lib : {
33- entry : path . resolve ( __dirname , "src/index.ts" ) ,
33+ entry : {
34+ "blocknote-xl-ai" : path . resolve ( __dirname , "src/index.ts" ) ,
35+ locales : path . resolve ( __dirname , "src/i18n/locales/index.ts" ) ,
36+ } ,
3437 name : "blocknote-xl-ai" ,
35- fileName : "blocknote-xl-ai" ,
38+ formats : [ "es" , "cjs" ] ,
39+ fileName : ( format , entryName ) =>
40+ format === "es" ? `${ entryName } .js` : `${ entryName } .cjs` ,
3641 } ,
3742 rollupOptions : {
3843 // make sure to externalize deps that shouldn't be bundled
You can’t perform that action at this time.
0 commit comments