You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// The Yjs Provider responsible for transporting updates:
83
-
provider,
84
-
// Where to store BlockNote data in the Y.Doc:
85
-
fragment: doc.getXmlFragment("document-store"),
86
-
// Information (name and color) for this user:
87
-
user: {
88
-
name: isGhostWriting
89
-
? `Ghost Writer #${ghostWriterIndex}`
90
-
: "My Username",
91
-
color: isGhostWriting ? "#CCCCCC" : "#00ff00",
92
-
},
93
-
},
94
-
dictionary: {
95
-
...en,
96
-
ai: aiEn,// add default translations for the AI extension
97
-
},
98
-
// Register the AI extension
99
-
extensions: [
100
-
AIExtension({
101
-
transport: newDefaultChatTransport({
102
-
api: `${BASE_URL}/regular/streamText`,
103
-
}),
104
-
}),
105
-
],
106
-
// We set some initial content for demo purposes
107
-
initialContent: [
108
-
{
109
-
type: "heading",
110
-
props: {
111
-
level: 1,
81
+
consteditor=useCreateBlockNote(
82
+
withCollaboration({
83
+
collaboration: {
84
+
// The Yjs Provider responsible for transporting updates:
85
+
provider,
86
+
// Where to store BlockNote data in the Y.Doc:
87
+
fragment: doc.getXmlFragment("document-store"),
88
+
// Information (name and color) for this user:
89
+
user: {
90
+
name: isGhostWriting
91
+
? `Ghost Writer #${ghostWriterIndex}`
92
+
: "My Username",
93
+
color: isGhostWriting ? "#CCCCCC" : "#00ff00",
112
94
},
113
-
content: "Open source software",
114
-
},
115
-
{
116
-
type: "paragraph",
117
-
content:
118
-
"Open source software refers to computer programs whose source code is made available to the public, allowing anyone to view, modify, and distribute the code. This model stands in contrast to proprietary software, where the source code is kept secret and only the original creators have the right to make changes. Open projects are developed collaboratively, often by communities of developers from around the world, and are typically distributed under licenses that promote sharing and openness.",
119
95
},
120
-
{
121
-
type: "paragraph",
122
-
content:
123
-
"One of the primary benefits of open source is the promotion of digital autonomy. By providing access to the source code, these programs empower users to control their own technology, customize software to fit their needs, and avoid vendor lock-in. This level of transparency also allows for greater security, as anyone can inspect the code for vulnerabilities or malicious elements. As a result, users are not solely dependent on a single company for updates, bug fixes, or continued support.",
96
+
dictionary: {
97
+
...en,
98
+
ai: aiEn,// add default translations for the AI extension
124
99
},
125
-
{
126
-
type: "paragraph",
127
-
content:
128
-
"Additionally, open development fosters innovation and collaboration. Developers can build upon existing projects, share improvements, and learn from each other, accelerating the pace of technological advancement. The open nature of these projects often leads to higher quality software, as bugs are identified and fixed more quickly by a diverse group of contributors. Furthermore, using open source can reduce costs for individuals, businesses, and governments, as it is often available for free and can be tailored to specific requirements without expensive licensing fees.",
129
-
},
130
-
],
131
-
});
100
+
// Register the AI extension
101
+
extensions: [
102
+
AIExtension({
103
+
transport: newDefaultChatTransport({
104
+
api: `${BASE_URL}/regular/streamText`,
105
+
}),
106
+
}),
107
+
],
108
+
// We set some initial content for demo purposes
109
+
initialContent: [
110
+
{
111
+
type: "heading",
112
+
props: {
113
+
level: 1,
114
+
},
115
+
content: "Open source software",
116
+
},
117
+
{
118
+
type: "paragraph",
119
+
content:
120
+
"Open source software refers to computer programs whose source code is made available to the public, allowing anyone to view, modify, and distribute the code. This model stands in contrast to proprietary software, where the source code is kept secret and only the original creators have the right to make changes. Open projects are developed collaboratively, often by communities of developers from around the world, and are typically distributed under licenses that promote sharing and openness.",
121
+
},
122
+
{
123
+
type: "paragraph",
124
+
content:
125
+
"One of the primary benefits of open source is the promotion of digital autonomy. By providing access to the source code, these programs empower users to control their own technology, customize software to fit their needs, and avoid vendor lock-in. This level of transparency also allows for greater security, as anyone can inspect the code for vulnerabilities or malicious elements. As a result, users are not solely dependent on a single company for updates, bug fixes, or continued support.",
126
+
},
127
+
{
128
+
type: "paragraph",
129
+
content:
130
+
"Additionally, open development fosters innovation and collaboration. Developers can build upon existing projects, share improvements, and learn from each other, accelerating the pace of technological advancement. The open nature of these projects often leads to higher quality software, as bugs are identified and fixed more quickly by a diverse group of contributors. Furthermore, using open source can reduce costs for individuals, businesses, and governments, as it is often available for free and can be tailored to specific requirements without expensive licensing fees.",
0 commit comments