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 {
15
15
import {
16
16
AIMenuController ,
17
17
AIToolbarButton ,
18
- locales as aiLocales ,
19
18
createAIExtension ,
20
19
createBlockNoteAIClient ,
21
20
getAISlashMenuItems ,
22
21
} from "@blocknote/xl-ai" ;
22
+ import { en as aiEn } from "@blocknote/xl-ai/locales" ;
23
23
import "@blocknote/xl-ai/style.css" ;
24
24
import { getEnv } from "./getEnv.js" ;
25
25
@@ -58,7 +58,7 @@ export default function App() {
58
58
const editor = useCreateBlockNote ( {
59
59
dictionary : {
60
60
...en ,
61
- ai : aiLocales . en , // add default translations for the AI extension
61
+ ai : aiEn , // add default translations for the AI extension
62
62
} ,
63
63
// Register the AI extension
64
64
extensions : [
Original file line number Diff line number Diff line change @@ -20,13 +20,13 @@ import {
20
20
import {
21
21
AIMenuController ,
22
22
AIToolbarButton ,
23
- locales as aiLocales ,
24
23
createAIExtension ,
25
24
createBlockNoteAIClient ,
26
25
getAIExtension ,
27
26
getAISlashMenuItems ,
28
27
llmFormats ,
29
28
} from "@blocknote/xl-ai" ;
29
+ import { en as aiEn } from "@blocknote/xl-ai/locales" ;
30
30
import "@blocknote/xl-ai/style.css" ;
31
31
import { Fieldset , MantineProvider , Switch } from "@mantine/core" ;
32
32
@@ -88,7 +88,7 @@ export default function App() {
88
88
const editor = useCreateBlockNote ( {
89
89
dictionary : {
90
90
...en ,
91
- ai : aiLocales . en , // add default translations for the AI extension
91
+ ai : aiEn , // add default translations for the AI extension
92
92
} ,
93
93
// Register the AI extension
94
94
extensions : [
Original file line number Diff line number Diff line change @@ -16,12 +16,12 @@ import {
16
16
AIMenu ,
17
17
AIMenuController ,
18
18
AIToolbarButton ,
19
- locales as aiLocales ,
20
19
createAIExtension ,
21
20
createBlockNoteAIClient ,
22
21
getAISlashMenuItems ,
23
22
getDefaultAIMenuItems ,
24
23
} from "@blocknote/xl-ai" ;
24
+ import { en as aiEn } from "@blocknote/xl-ai/locales" ;
25
25
import "@blocknote/xl-ai/style.css" ;
26
26
import { getEnv } from "./getEnv.js" ;
27
27
@@ -62,7 +62,7 @@ export default function App() {
62
62
const editor = useCreateBlockNote ( {
63
63
dictionary : {
64
64
...en ,
65
- ai : aiLocales . en , // add default translations for the AI extension
65
+ ai : aiEn , // add default translations for the AI extension
66
66
} ,
67
67
// Register the AI extension
68
68
extensions : [
Original file line number Diff line number Diff line change @@ -15,11 +15,11 @@ import {
15
15
import {
16
16
AIMenuController ,
17
17
AIToolbarButton ,
18
- locales as aiLocales ,
19
18
createAIExtension ,
20
19
createBlockNoteAIClient ,
21
20
getAISlashMenuItems ,
22
21
} from "@blocknote/xl-ai" ;
22
+ import { en as aiEn } from "@blocknote/xl-ai/locales" ;
23
23
import "@blocknote/xl-ai/style.css" ;
24
24
import { useEffect , useState } from "react" ;
25
25
import YPartyKitProvider from "y-partykit/provider" ;
@@ -104,7 +104,7 @@ export default function App() {
104
104
} ,
105
105
dictionary : {
106
106
...en ,
107
- ai : aiLocales . en , // add default translations for the AI extension
107
+ ai : aiEn , // add default translations for the AI extension
108
108
} ,
109
109
// Register the AI extension
110
110
extensions : [
Original file line number Diff line number Diff line change 48
48
"import" : " ./dist/style.css" ,
49
49
"require" : " ./dist/style.css" ,
50
50
"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"
51
56
}
52
57
},
53
58
"scripts" : {
Original file line number Diff line number Diff line change @@ -11,6 +11,5 @@ export * from "./components/FormattingToolbar/AIToolbarButton.js";
11
11
export * from "./components/SuggestionMenu/getAISlashMenuItems.js" ;
12
12
13
13
export * from "./i18n/dictionary.js" ;
14
- export * as locales from "./i18n/locales/index.js" ;
15
14
16
15
export * from "./api/index.js" ;
Original file line number Diff line number Diff line change @@ -30,9 +30,14 @@ export default defineConfig((conf) => ({
30
30
build : {
31
31
sourcemap : true ,
32
32
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
+ } ,
34
37
name : "blocknote-xl-ai" ,
35
- fileName : "blocknote-xl-ai" ,
38
+ formats : [ "es" , "cjs" ] ,
39
+ fileName : ( format , entryName ) =>
40
+ format === "es" ? `${ entryName } .js` : `${ entryName } .cjs` ,
36
41
} ,
37
42
rollupOptions : {
38
43
// make sure to externalize deps that shouldn't be bundled
You can’t perform that action at this time.
0 commit comments