@liveblocks/react-blocknote 3.21.0-exp2 → 3.21.0-exp3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"BlockNoteLiveblocksExtension.cjs","sources":["../src/BlockNoteLiveblocksExtension.ts"],"sourcesContent":["import { useLiveblocksExtension as useTipTapLiveblocksExtension } from \"@liveblocks/react-tiptap\";\nimport type { Mark } from \"@tiptap/core\";\n\nexport type LiveblocksExtensionOptions = Parameters<\n typeof useTipTapLiveblocksExtension\n>[0];\n\nexport const useLiveblocksExtension = (\n options: LiveblocksExtensionOptions = {}\n) => {\n const extension = useTipTapLiveblocksExtension({\n ...options,\n // @ts-expect-error - Hidden config option\n textEditorType: \"blocknote\",\n });\n\n extension.config.extendMarkSchema = (mark: Mark) => {\n if (mark.name === \"liveblocksCommentMark\") {\n return {\n blocknoteIgnore: true,\n };\n }\n return {};\n };\n\n return extension;\n};\n"],"names":["useTipTapLiveblocksExtension"],"mappings":";;;;AAOO,MAAM,sBAAyB,GAAA,CACpC,OAAsC,GAAA,EACnC,KAAA;AACH,EAAA,MAAM,YAAYA,kCAA6B,CAAA;AAAA,IAC7C,GAAG,OAAA;AAAA;AAAA,IAEH,cAAgB,EAAA,WAAA;AAAA,GACjB,CAAA,CAAA;AAED,EAAU,SAAA,CAAA,MAAA,CAAO,gBAAmB,GAAA,CAAC,IAAe,KAAA;AAClD,IAAI,IAAA,IAAA,CAAK,SAAS,uBAAyB,EAAA;AACzC,MAAO,OAAA;AAAA,QACL,eAAiB,EAAA,IAAA;AAAA,OACnB,CAAA;AAAA,KACF;AACA,IAAA,OAAO,EAAC,CAAA;AAAA,GACV,CAAA;AAEA,EAAO,OAAA,SAAA,CAAA;AACT;;;;"}
1
+ {"version":3,"file":"BlockNoteLiveblocksExtension.cjs","sources":["../src/BlockNoteLiveblocksExtension.ts"],"sourcesContent":["import { useLiveblocksExtension as useTipTapLiveblocksExtension } from \"@liveblocks/react-tiptap\";\nimport type { Mark } from \"@tiptap/core\";\n\nexport type LiveblocksExtensionOptions = NonNullable<\n Parameters<typeof useTipTapLiveblocksExtension>[0]\n>;\n\nexport const useLiveblocksExtension = (\n options: LiveblocksExtensionOptions = {}\n) => {\n const extension = useTipTapLiveblocksExtension({\n ...options,\n // @ts-expect-error - Hidden config option\n textEditorType: \"blocknote\",\n });\n\n extension.config.extendMarkSchema = (mark: Mark) => {\n if (mark.name === \"liveblocksCommentMark\") {\n return {\n blocknoteIgnore: true,\n };\n }\n return {};\n };\n\n return extension;\n};\n"],"names":["useTipTapLiveblocksExtension"],"mappings":";;;;AAOO,MAAM,sBAAyB,GAAA,CACpC,OAAsC,GAAA,EACnC,KAAA;AACH,EAAA,MAAM,YAAYA,kCAA6B,CAAA;AAAA,IAC7C,GAAG,OAAA;AAAA;AAAA,IAEH,cAAgB,EAAA,WAAA;AAAA,GACjB,CAAA,CAAA;AAED,EAAU,SAAA,CAAA,MAAA,CAAO,gBAAmB,GAAA,CAAC,IAAe,KAAA;AAClD,IAAI,IAAA,IAAA,CAAK,SAAS,uBAAyB,EAAA;AACzC,MAAO,OAAA;AAAA,QACL,eAAiB,EAAA,IAAA;AAAA,OACnB,CAAA;AAAA,KACF;AACA,IAAA,OAAO,EAAC,CAAA;AAAA,GACV,CAAA;AAEA,EAAO,OAAA,SAAA,CAAA;AACT;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"BlockNoteLiveblocksExtension.js","sources":["../src/BlockNoteLiveblocksExtension.ts"],"sourcesContent":["import { useLiveblocksExtension as useTipTapLiveblocksExtension } from \"@liveblocks/react-tiptap\";\nimport type { Mark } from \"@tiptap/core\";\n\nexport type LiveblocksExtensionOptions = Parameters<\n typeof useTipTapLiveblocksExtension\n>[0];\n\nexport const useLiveblocksExtension = (\n options: LiveblocksExtensionOptions = {}\n) => {\n const extension = useTipTapLiveblocksExtension({\n ...options,\n // @ts-expect-error - Hidden config option\n textEditorType: \"blocknote\",\n });\n\n extension.config.extendMarkSchema = (mark: Mark) => {\n if (mark.name === \"liveblocksCommentMark\") {\n return {\n blocknoteIgnore: true,\n };\n }\n return {};\n };\n\n return extension;\n};\n"],"names":["useTipTapLiveblocksExtension"],"mappings":";;AAOO,MAAM,sBAAyB,GAAA,CACpC,OAAsC,GAAA,EACnC,KAAA;AACH,EAAA,MAAM,YAAYA,wBAA6B,CAAA;AAAA,IAC7C,GAAG,OAAA;AAAA;AAAA,IAEH,cAAgB,EAAA,WAAA;AAAA,GACjB,CAAA,CAAA;AAED,EAAU,SAAA,CAAA,MAAA,CAAO,gBAAmB,GAAA,CAAC,IAAe,KAAA;AAClD,IAAI,IAAA,IAAA,CAAK,SAAS,uBAAyB,EAAA;AACzC,MAAO,OAAA;AAAA,QACL,eAAiB,EAAA,IAAA;AAAA,OACnB,CAAA;AAAA,KACF;AACA,IAAA,OAAO,EAAC,CAAA;AAAA,GACV,CAAA;AAEA,EAAO,OAAA,SAAA,CAAA;AACT;;;;"}
1
+ {"version":3,"file":"BlockNoteLiveblocksExtension.js","sources":["../src/BlockNoteLiveblocksExtension.ts"],"sourcesContent":["import { useLiveblocksExtension as useTipTapLiveblocksExtension } from \"@liveblocks/react-tiptap\";\nimport type { Mark } from \"@tiptap/core\";\n\nexport type LiveblocksExtensionOptions = NonNullable<\n Parameters<typeof useTipTapLiveblocksExtension>[0]\n>;\n\nexport const useLiveblocksExtension = (\n options: LiveblocksExtensionOptions = {}\n) => {\n const extension = useTipTapLiveblocksExtension({\n ...options,\n // @ts-expect-error - Hidden config option\n textEditorType: \"blocknote\",\n });\n\n extension.config.extendMarkSchema = (mark: Mark) => {\n if (mark.name === \"liveblocksCommentMark\") {\n return {\n blocknoteIgnore: true,\n };\n }\n return {};\n };\n\n return extension;\n};\n"],"names":["useTipTapLiveblocksExtension"],"mappings":";;AAOO,MAAM,sBAAyB,GAAA,CACpC,OAAsC,GAAA,EACnC,KAAA;AACH,EAAA,MAAM,YAAYA,wBAA6B,CAAA;AAAA,IAC7C,GAAG,OAAA;AAAA;AAAA,IAEH,cAAgB,EAAA,WAAA;AAAA,GACjB,CAAA,CAAA;AAED,EAAU,SAAA,CAAA,MAAA,CAAO,gBAAmB,GAAA,CAAC,IAAe,KAAA;AAClD,IAAI,IAAA,IAAA,CAAK,SAAS,uBAAyB,EAAA;AACzC,MAAO,OAAA;AAAA,QACL,eAAiB,EAAA,IAAA;AAAA,OACnB,CAAA;AAAA,KACF;AACA,IAAA,OAAO,EAAC,CAAA;AAAA,GACV,CAAA;AAEA,EAAO,OAAA,SAAA,CAAA;AACT;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../src/index.ts"],"sourcesContent":["import { detectDupes } from \"@liveblocks/core\";\n\nimport { PKG_FORMAT, PKG_NAME, PKG_VERSION } from \"./version\";\n\ndetectDupes(PKG_NAME, PKG_VERSION, PKG_FORMAT);\n\nexport { useLiveblocksExtension } from \"./BlockNoteLiveblocksExtension\";\nexport { AnchoredThreads } from \"./comments/AnchoredThreads\";\nexport { FloatingComposer } from \"./comments/FloatingComposer\";\nexport { FloatingThreads } from \"./comments/FloatingThreads\";\nexport { withLiveblocksEditorOptions } from \"./initialization/liveblocksEditorOptions\";\nexport { withLiveblocksSchema } from \"./initialization/schema\";\nexport { useCreateBlockNoteWithLiveblocks } from \"./initialization/useCreateBlockNoteWithLiveblocks\";\nexport { HistoryVersionPreview } from \"./version-history/HistoryVersionPreview\";\nexport { useIsEditorReady } from \"@liveblocks/react-tiptap\";\n"],"names":["detectDupes","PKG_NAME","PKG_VERSION","PKG_FORMAT"],"mappings":";;;;;;;;;;;;;;AAIAA,gBAAY,CAAAC,gBAAA,EAAUC,qBAAaC,kBAAU,CAAA;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.cjs","sources":["../src/index.ts"],"sourcesContent":["import { detectDupes } from \"@liveblocks/core\";\n\nimport { PKG_FORMAT, PKG_NAME, PKG_VERSION } from \"./version\";\n\ndetectDupes(PKG_NAME, PKG_VERSION, PKG_FORMAT);\n\nexport type { LiveblocksExtensionOptions } from \"./BlockNoteLiveblocksExtension\";\nexport { useLiveblocksExtension } from \"./BlockNoteLiveblocksExtension\";\nexport { AnchoredThreads } from \"./comments/AnchoredThreads\";\nexport { FloatingComposer } from \"./comments/FloatingComposer\";\nexport { FloatingThreads } from \"./comments/FloatingThreads\";\nexport { withLiveblocksEditorOptions } from \"./initialization/liveblocksEditorOptions\";\nexport { withLiveblocksSchema } from \"./initialization/schema\";\nexport { useCreateBlockNoteWithLiveblocks } from \"./initialization/useCreateBlockNoteWithLiveblocks\";\nexport { HistoryVersionPreview } from \"./version-history/HistoryVersionPreview\";\nexport { useIsEditorReady } from \"@liveblocks/react-tiptap\";\n"],"names":["detectDupes","PKG_NAME","PKG_VERSION","PKG_FORMAT"],"mappings":";;;;;;;;;;;;;;AAIAA,gBAAY,CAAAC,gBAAA,EAAUC,qBAAaC,kBAAU,CAAA;;;;;;;;;;;;;;;"}
package/dist/index.d.cts CHANGED
@@ -7,7 +7,7 @@ import * as _blocknote_core from '@blocknote/core';
7
7
  import { BlockSchema, DefaultBlockSchema, InlineContentSchema, DefaultInlineContentSchema, StyleSchema, DefaultStyleSchema, BlockNoteEditor, BlockNoteEditorOptions, BlockNoteSchema } from '@blocknote/core';
8
8
  import { DependencyList } from 'react';
9
9
 
10
- type LiveblocksExtensionOptions = Parameters<typeof useLiveblocksExtension$1>[0];
10
+ type LiveblocksExtensionOptions = NonNullable<Parameters<typeof useLiveblocksExtension$1>[0]>;
11
11
  declare const useLiveblocksExtension: (options?: LiveblocksExtensionOptions) => _tiptap_core.Extension<any, any>;
12
12
 
13
13
  type AnchoredThreadsProps<B extends BlockSchema = DefaultBlockSchema, I extends InlineContentSchema = DefaultInlineContentSchema, S extends StyleSchema = DefaultStyleSchema> = Omit<Parameters<typeof AnchoredThreads$1>[0], "editor"> & {
@@ -28,9 +28,7 @@ declare function FloatingThreads(props: FloatingThreadsProps): react_jsx_runtime
28
28
  /**
29
29
  * Helper function to add Liveblocks support to BlockNoteEditorOptions
30
30
  */
31
- declare const withLiveblocksEditorOptions: <B extends BlockSchema = DefaultBlockSchema, I extends InlineContentSchema = DefaultInlineContentSchema, S extends StyleSchema = DefaultStyleSchema>(liveblocksExtension: Extension<any, any>, blocknoteOptions?: Partial<BlockNoteEditorOptions<B, I, S>>, liveblocksOptions?: Partial<{
32
- mentions: boolean;
33
- }>) => Partial<BlockNoteEditorOptions<B, I, S>>;
31
+ declare const withLiveblocksEditorOptions: <B extends BlockSchema = DefaultBlockSchema, I extends InlineContentSchema = DefaultInlineContentSchema, S extends StyleSchema = DefaultStyleSchema>(liveblocksExtension: Extension<any, any>, blocknoteOptions?: Partial<BlockNoteEditorOptions<B, I, S>>, liveblocksOptions?: LiveblocksExtensionOptions) => Partial<BlockNoteEditorOptions<B, I, S>>;
34
32
 
35
33
  /**
36
34
  * Adds the Liveblocks Mention and Group Mention nodes as inline content to the BlockNote schema
@@ -119,4 +117,4 @@ type HistoryVersionPreviewProps<B extends BlockSchema = DefaultBlockSchema, I ex
119
117
  };
120
118
  declare function HistoryVersionPreview(props: HistoryVersionPreviewProps): react_jsx_runtime.JSX.Element;
121
119
 
122
- export { AnchoredThreads, FloatingComposer, FloatingThreads, HistoryVersionPreview, useCreateBlockNoteWithLiveblocks, useLiveblocksExtension, withLiveblocksEditorOptions, withLiveblocksSchema };
120
+ export { AnchoredThreads, FloatingComposer, FloatingThreads, HistoryVersionPreview, LiveblocksExtensionOptions, useCreateBlockNoteWithLiveblocks, useLiveblocksExtension, withLiveblocksEditorOptions, withLiveblocksSchema };
package/dist/index.d.ts CHANGED
@@ -7,7 +7,7 @@ import * as _blocknote_core from '@blocknote/core';
7
7
  import { BlockSchema, DefaultBlockSchema, InlineContentSchema, DefaultInlineContentSchema, StyleSchema, DefaultStyleSchema, BlockNoteEditor, BlockNoteEditorOptions, BlockNoteSchema } from '@blocknote/core';
8
8
  import { DependencyList } from 'react';
9
9
 
10
- type LiveblocksExtensionOptions = Parameters<typeof useLiveblocksExtension$1>[0];
10
+ type LiveblocksExtensionOptions = NonNullable<Parameters<typeof useLiveblocksExtension$1>[0]>;
11
11
  declare const useLiveblocksExtension: (options?: LiveblocksExtensionOptions) => _tiptap_core.Extension<any, any>;
12
12
 
13
13
  type AnchoredThreadsProps<B extends BlockSchema = DefaultBlockSchema, I extends InlineContentSchema = DefaultInlineContentSchema, S extends StyleSchema = DefaultStyleSchema> = Omit<Parameters<typeof AnchoredThreads$1>[0], "editor"> & {
@@ -28,9 +28,7 @@ declare function FloatingThreads(props: FloatingThreadsProps): react_jsx_runtime
28
28
  /**
29
29
  * Helper function to add Liveblocks support to BlockNoteEditorOptions
30
30
  */
31
- declare const withLiveblocksEditorOptions: <B extends BlockSchema = DefaultBlockSchema, I extends InlineContentSchema = DefaultInlineContentSchema, S extends StyleSchema = DefaultStyleSchema>(liveblocksExtension: Extension<any, any>, blocknoteOptions?: Partial<BlockNoteEditorOptions<B, I, S>>, liveblocksOptions?: Partial<{
32
- mentions: boolean;
33
- }>) => Partial<BlockNoteEditorOptions<B, I, S>>;
31
+ declare const withLiveblocksEditorOptions: <B extends BlockSchema = DefaultBlockSchema, I extends InlineContentSchema = DefaultInlineContentSchema, S extends StyleSchema = DefaultStyleSchema>(liveblocksExtension: Extension<any, any>, blocknoteOptions?: Partial<BlockNoteEditorOptions<B, I, S>>, liveblocksOptions?: LiveblocksExtensionOptions) => Partial<BlockNoteEditorOptions<B, I, S>>;
34
32
 
35
33
  /**
36
34
  * Adds the Liveblocks Mention and Group Mention nodes as inline content to the BlockNote schema
@@ -119,4 +117,4 @@ type HistoryVersionPreviewProps<B extends BlockSchema = DefaultBlockSchema, I ex
119
117
  };
120
118
  declare function HistoryVersionPreview(props: HistoryVersionPreviewProps): react_jsx_runtime.JSX.Element;
121
119
 
122
- export { AnchoredThreads, FloatingComposer, FloatingThreads, HistoryVersionPreview, useCreateBlockNoteWithLiveblocks, useLiveblocksExtension, withLiveblocksEditorOptions, withLiveblocksSchema };
120
+ export { AnchoredThreads, FloatingComposer, FloatingThreads, HistoryVersionPreview, LiveblocksExtensionOptions, useCreateBlockNoteWithLiveblocks, useLiveblocksExtension, withLiveblocksEditorOptions, withLiveblocksSchema };
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["import { detectDupes } from \"@liveblocks/core\";\n\nimport { PKG_FORMAT, PKG_NAME, PKG_VERSION } from \"./version\";\n\ndetectDupes(PKG_NAME, PKG_VERSION, PKG_FORMAT);\n\nexport { useLiveblocksExtension } from \"./BlockNoteLiveblocksExtension\";\nexport { AnchoredThreads } from \"./comments/AnchoredThreads\";\nexport { FloatingComposer } from \"./comments/FloatingComposer\";\nexport { FloatingThreads } from \"./comments/FloatingThreads\";\nexport { withLiveblocksEditorOptions } from \"./initialization/liveblocksEditorOptions\";\nexport { withLiveblocksSchema } from \"./initialization/schema\";\nexport { useCreateBlockNoteWithLiveblocks } from \"./initialization/useCreateBlockNoteWithLiveblocks\";\nexport { HistoryVersionPreview } from \"./version-history/HistoryVersionPreview\";\nexport { useIsEditorReady } from \"@liveblocks/react-tiptap\";\n"],"names":[],"mappings":";;;;;;;;;;;;AAIA,WAAY,CAAA,QAAA,EAAU,aAAa,UAAU,CAAA"}
1
+ {"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["import { detectDupes } from \"@liveblocks/core\";\n\nimport { PKG_FORMAT, PKG_NAME, PKG_VERSION } from \"./version\";\n\ndetectDupes(PKG_NAME, PKG_VERSION, PKG_FORMAT);\n\nexport type { LiveblocksExtensionOptions } from \"./BlockNoteLiveblocksExtension\";\nexport { useLiveblocksExtension } from \"./BlockNoteLiveblocksExtension\";\nexport { AnchoredThreads } from \"./comments/AnchoredThreads\";\nexport { FloatingComposer } from \"./comments/FloatingComposer\";\nexport { FloatingThreads } from \"./comments/FloatingThreads\";\nexport { withLiveblocksEditorOptions } from \"./initialization/liveblocksEditorOptions\";\nexport { withLiveblocksSchema } from \"./initialization/schema\";\nexport { useCreateBlockNoteWithLiveblocks } from \"./initialization/useCreateBlockNoteWithLiveblocks\";\nexport { HistoryVersionPreview } from \"./version-history/HistoryVersionPreview\";\nexport { useIsEditorReady } from \"@liveblocks/react-tiptap\";\n"],"names":[],"mappings":";;;;;;;;;;;;AAIA,WAAY,CAAA,QAAA,EAAU,aAAa,UAAU,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"liveblocksEditorOptions.cjs","sources":["../../src/initialization/liveblocksEditorOptions.ts"],"sourcesContent":["import {\n type BlockNoteEditorOptions,\n type BlockSchema,\n createExtension,\n type DefaultBlockSchema,\n type DefaultInlineContentSchema,\n type DefaultStyleSchema,\n type InlineContentSchema,\n type StyleSchema,\n} from \"@blocknote/core\";\nimport type { Extension } from \"@tiptap/core\";\n\nimport { withLiveblocksSchema } from \"./schema\";\n/**\n * Helper function to add Liveblocks support to BlockNoteEditorOptions\n */\nexport const withLiveblocksEditorOptions = <\n B extends BlockSchema = DefaultBlockSchema,\n I extends InlineContentSchema = DefaultInlineContentSchema,\n S extends StyleSchema = DefaultStyleSchema,\n>(\n liveblocksExtension: Extension<any, any>,\n blocknoteOptions: Partial<BlockNoteEditorOptions<B, I, S>> = {},\n liveblocksOptions: Partial<{ mentions: boolean }> = {}\n): Partial<BlockNoteEditorOptions<B, I, S>> => {\n const {\n schema: blocknoteSchema,\n extensions: blocknoteExtensions,\n disableExtensions: blocknoteDisableExtensions,\n ...extraBlocknoteOptions\n } = blocknoteOptions;\n\n return {\n // add the liveblocks schema (i.e.: add the mentions nodes to the schema)\n schema: withLiveblocksSchema(blocknoteSchema, liveblocksOptions),\n\n // add the liveblocks extension\n extensions: [\n createExtension({\n key: \"liveblocksExtension\",\n tiptapExtensions: [liveblocksExtension],\n }),\n ...(blocknoteExtensions ?? []),\n ],\n\n // disable the history extension\n disableExtensions: [\"history\", ...(blocknoteDisableExtensions || [])],\n\n // pass the rest of the options through\n ...extraBlocknoteOptions,\n };\n};\n"],"names":["withLiveblocksSchema","createExtension"],"mappings":";;;;;AAgBa,MAAA,2BAAA,GAA8B,CAKzC,mBACA,EAAA,gBAAA,GAA6D,EAC7D,EAAA,iBAAA,GAAoD,EACP,KAAA;AAC7C,EAAM,MAAA;AAAA,IACJ,MAAQ,EAAA,eAAA;AAAA,IACR,UAAY,EAAA,mBAAA;AAAA,IACZ,iBAAmB,EAAA,0BAAA;AAAA,IACnB,GAAG,qBAAA;AAAA,GACD,GAAA,gBAAA,CAAA;AAEJ,EAAO,OAAA;AAAA;AAAA,IAEL,MAAA,EAAQA,2BAAqB,CAAA,eAAA,EAAiB,iBAAiB,CAAA;AAAA;AAAA,IAG/D,UAAY,EAAA;AAAA,MACVC,oBAAgB,CAAA;AAAA,QACd,GAAK,EAAA,qBAAA;AAAA,QACL,gBAAA,EAAkB,CAAC,mBAAmB,CAAA;AAAA,OACvC,CAAA;AAAA,MACD,GAAI,uBAAuB,EAAC;AAAA,KAC9B;AAAA;AAAA,IAGA,mBAAmB,CAAC,SAAA,EAAW,GAAI,0BAAA,IAA8B,EAAG,CAAA;AAAA;AAAA,IAGpE,GAAG,qBAAA;AAAA,GACL,CAAA;AACF;;;;"}
1
+ {"version":3,"file":"liveblocksEditorOptions.cjs","sources":["../../src/initialization/liveblocksEditorOptions.ts"],"sourcesContent":["import {\n type BlockNoteEditorOptions,\n type BlockSchema,\n createExtension,\n type DefaultBlockSchema,\n type DefaultInlineContentSchema,\n type DefaultStyleSchema,\n type InlineContentSchema,\n type StyleSchema,\n} from \"@blocknote/core\";\nimport type { Extension } from \"@tiptap/core\";\n\nimport type { LiveblocksExtensionOptions } from \"../BlockNoteLiveblocksExtension\";\nimport { withLiveblocksSchema } from \"./schema\";\n/**\n * Helper function to add Liveblocks support to BlockNoteEditorOptions\n */\nexport const withLiveblocksEditorOptions = <\n B extends BlockSchema = DefaultBlockSchema,\n I extends InlineContentSchema = DefaultInlineContentSchema,\n S extends StyleSchema = DefaultStyleSchema,\n>(\n liveblocksExtension: Extension<any, any>,\n blocknoteOptions: Partial<BlockNoteEditorOptions<B, I, S>> = {},\n liveblocksOptions: LiveblocksExtensionOptions = {}\n): Partial<BlockNoteEditorOptions<B, I, S>> => {\n const {\n schema: blocknoteSchema,\n extensions: blocknoteExtensions,\n disableExtensions: blocknoteDisableExtensions,\n ...extraBlocknoteOptions\n } = blocknoteOptions;\n\n return {\n // add the liveblocks schema (i.e.: add the mentions nodes to the schema)\n schema: withLiveblocksSchema(blocknoteSchema, liveblocksOptions),\n\n // add the liveblocks extension\n extensions: [\n createExtension({\n key: \"liveblocksExtension\",\n tiptapExtensions: [liveblocksExtension],\n }),\n ...(blocknoteExtensions ?? []),\n ],\n\n // disable the history extension\n disableExtensions: [\"history\", ...(blocknoteDisableExtensions || [])],\n\n // pass the rest of the options through\n ...extraBlocknoteOptions,\n };\n};\n"],"names":["withLiveblocksSchema","createExtension"],"mappings":";;;;;AAiBa,MAAA,2BAAA,GAA8B,CAKzC,mBACA,EAAA,gBAAA,GAA6D,EAC7D,EAAA,iBAAA,GAAgD,EACH,KAAA;AAC7C,EAAM,MAAA;AAAA,IACJ,MAAQ,EAAA,eAAA;AAAA,IACR,UAAY,EAAA,mBAAA;AAAA,IACZ,iBAAmB,EAAA,0BAAA;AAAA,IACnB,GAAG,qBAAA;AAAA,GACD,GAAA,gBAAA,CAAA;AAEJ,EAAO,OAAA;AAAA;AAAA,IAEL,MAAA,EAAQA,2BAAqB,CAAA,eAAA,EAAiB,iBAAiB,CAAA;AAAA;AAAA,IAG/D,UAAY,EAAA;AAAA,MACVC,oBAAgB,CAAA;AAAA,QACd,GAAK,EAAA,qBAAA;AAAA,QACL,gBAAA,EAAkB,CAAC,mBAAmB,CAAA;AAAA,OACvC,CAAA;AAAA,MACD,GAAI,uBAAuB,EAAC;AAAA,KAC9B;AAAA;AAAA,IAGA,mBAAmB,CAAC,SAAA,EAAW,GAAI,0BAAA,IAA8B,EAAG,CAAA;AAAA;AAAA,IAGpE,GAAG,qBAAA;AAAA,GACL,CAAA;AACF;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"liveblocksEditorOptions.js","sources":["../../src/initialization/liveblocksEditorOptions.ts"],"sourcesContent":["import {\n type BlockNoteEditorOptions,\n type BlockSchema,\n createExtension,\n type DefaultBlockSchema,\n type DefaultInlineContentSchema,\n type DefaultStyleSchema,\n type InlineContentSchema,\n type StyleSchema,\n} from \"@blocknote/core\";\nimport type { Extension } from \"@tiptap/core\";\n\nimport { withLiveblocksSchema } from \"./schema\";\n/**\n * Helper function to add Liveblocks support to BlockNoteEditorOptions\n */\nexport const withLiveblocksEditorOptions = <\n B extends BlockSchema = DefaultBlockSchema,\n I extends InlineContentSchema = DefaultInlineContentSchema,\n S extends StyleSchema = DefaultStyleSchema,\n>(\n liveblocksExtension: Extension<any, any>,\n blocknoteOptions: Partial<BlockNoteEditorOptions<B, I, S>> = {},\n liveblocksOptions: Partial<{ mentions: boolean }> = {}\n): Partial<BlockNoteEditorOptions<B, I, S>> => {\n const {\n schema: blocknoteSchema,\n extensions: blocknoteExtensions,\n disableExtensions: blocknoteDisableExtensions,\n ...extraBlocknoteOptions\n } = blocknoteOptions;\n\n return {\n // add the liveblocks schema (i.e.: add the mentions nodes to the schema)\n schema: withLiveblocksSchema(blocknoteSchema, liveblocksOptions),\n\n // add the liveblocks extension\n extensions: [\n createExtension({\n key: \"liveblocksExtension\",\n tiptapExtensions: [liveblocksExtension],\n }),\n ...(blocknoteExtensions ?? []),\n ],\n\n // disable the history extension\n disableExtensions: [\"history\", ...(blocknoteDisableExtensions || [])],\n\n // pass the rest of the options through\n ...extraBlocknoteOptions,\n };\n};\n"],"names":[],"mappings":";;;AAgBa,MAAA,2BAAA,GAA8B,CAKzC,mBACA,EAAA,gBAAA,GAA6D,EAC7D,EAAA,iBAAA,GAAoD,EACP,KAAA;AAC7C,EAAM,MAAA;AAAA,IACJ,MAAQ,EAAA,eAAA;AAAA,IACR,UAAY,EAAA,mBAAA;AAAA,IACZ,iBAAmB,EAAA,0BAAA;AAAA,IACnB,GAAG,qBAAA;AAAA,GACD,GAAA,gBAAA,CAAA;AAEJ,EAAO,OAAA;AAAA;AAAA,IAEL,MAAA,EAAQ,oBAAqB,CAAA,eAAA,EAAiB,iBAAiB,CAAA;AAAA;AAAA,IAG/D,UAAY,EAAA;AAAA,MACV,eAAgB,CAAA;AAAA,QACd,GAAK,EAAA,qBAAA;AAAA,QACL,gBAAA,EAAkB,CAAC,mBAAmB,CAAA;AAAA,OACvC,CAAA;AAAA,MACD,GAAI,uBAAuB,EAAC;AAAA,KAC9B;AAAA;AAAA,IAGA,mBAAmB,CAAC,SAAA,EAAW,GAAI,0BAAA,IAA8B,EAAG,CAAA;AAAA;AAAA,IAGpE,GAAG,qBAAA;AAAA,GACL,CAAA;AACF;;;;"}
1
+ {"version":3,"file":"liveblocksEditorOptions.js","sources":["../../src/initialization/liveblocksEditorOptions.ts"],"sourcesContent":["import {\n type BlockNoteEditorOptions,\n type BlockSchema,\n createExtension,\n type DefaultBlockSchema,\n type DefaultInlineContentSchema,\n type DefaultStyleSchema,\n type InlineContentSchema,\n type StyleSchema,\n} from \"@blocknote/core\";\nimport type { Extension } from \"@tiptap/core\";\n\nimport type { LiveblocksExtensionOptions } from \"../BlockNoteLiveblocksExtension\";\nimport { withLiveblocksSchema } from \"./schema\";\n/**\n * Helper function to add Liveblocks support to BlockNoteEditorOptions\n */\nexport const withLiveblocksEditorOptions = <\n B extends BlockSchema = DefaultBlockSchema,\n I extends InlineContentSchema = DefaultInlineContentSchema,\n S extends StyleSchema = DefaultStyleSchema,\n>(\n liveblocksExtension: Extension<any, any>,\n blocknoteOptions: Partial<BlockNoteEditorOptions<B, I, S>> = {},\n liveblocksOptions: LiveblocksExtensionOptions = {}\n): Partial<BlockNoteEditorOptions<B, I, S>> => {\n const {\n schema: blocknoteSchema,\n extensions: blocknoteExtensions,\n disableExtensions: blocknoteDisableExtensions,\n ...extraBlocknoteOptions\n } = blocknoteOptions;\n\n return {\n // add the liveblocks schema (i.e.: add the mentions nodes to the schema)\n schema: withLiveblocksSchema(blocknoteSchema, liveblocksOptions),\n\n // add the liveblocks extension\n extensions: [\n createExtension({\n key: \"liveblocksExtension\",\n tiptapExtensions: [liveblocksExtension],\n }),\n ...(blocknoteExtensions ?? []),\n ],\n\n // disable the history extension\n disableExtensions: [\"history\", ...(blocknoteDisableExtensions || [])],\n\n // pass the rest of the options through\n ...extraBlocknoteOptions,\n };\n};\n"],"names":[],"mappings":";;;AAiBa,MAAA,2BAAA,GAA8B,CAKzC,mBACA,EAAA,gBAAA,GAA6D,EAC7D,EAAA,iBAAA,GAAgD,EACH,KAAA;AAC7C,EAAM,MAAA;AAAA,IACJ,MAAQ,EAAA,eAAA;AAAA,IACR,UAAY,EAAA,mBAAA;AAAA,IACZ,iBAAmB,EAAA,0BAAA;AAAA,IACnB,GAAG,qBAAA;AAAA,GACD,GAAA,gBAAA,CAAA;AAEJ,EAAO,OAAA;AAAA;AAAA,IAEL,MAAA,EAAQ,oBAAqB,CAAA,eAAA,EAAiB,iBAAiB,CAAA;AAAA;AAAA,IAG/D,UAAY,EAAA;AAAA,MACV,eAAgB,CAAA;AAAA,QACd,GAAK,EAAA,qBAAA;AAAA,QACL,gBAAA,EAAkB,CAAC,mBAAmB,CAAA;AAAA,OACvC,CAAA;AAAA,MACD,GAAI,uBAAuB,EAAC;AAAA,KAC9B;AAAA;AAAA,IAGA,mBAAmB,CAAC,SAAA,EAAW,GAAI,0BAAA,IAA8B,EAAG,CAAA;AAAA;AAAA,IAGpE,GAAG,qBAAA;AAAA,GACL,CAAA;AACF;;;;"}
@@ -4,7 +4,7 @@ var react = require('@blocknote/react');
4
4
  var BlockNoteLiveblocksExtension = require('../BlockNoteLiveblocksExtension.cjs');
5
5
  var liveblocksEditorOptions = require('./liveblocksEditorOptions.cjs');
6
6
 
7
- const useCreateBlockNoteWithLiveblocks = (blocknoteOptions = {}, liveblocksOptions = void 0, deps = []) => {
7
+ const useCreateBlockNoteWithLiveblocks = (blocknoteOptions = {}, liveblocksOptions, deps = []) => {
8
8
  const liveblocksExtension = BlockNoteLiveblocksExtension.useLiveblocksExtension(liveblocksOptions);
9
9
  return react.useCreateBlockNote(
10
10
  liveblocksEditorOptions.withLiveblocksEditorOptions(
@@ -1 +1 @@
1
- {"version":3,"file":"useCreateBlockNoteWithLiveblocks.cjs","sources":["../../src/initialization/useCreateBlockNoteWithLiveblocks.ts"],"sourcesContent":["import type {\n BlockNoteEditorOptions,\n BlockSchema,\n DefaultBlockSchema,\n DefaultInlineContentSchema,\n DefaultStyleSchema,\n InlineContentSchema,\n StyleSchema,\n} from \"@blocknote/core\";\nimport { useCreateBlockNote } from \"@blocknote/react\";\nimport type { DependencyList } from \"react\";\n\nimport type { LiveblocksExtensionOptions } from \"../BlockNoteLiveblocksExtension\";\nimport { useLiveblocksExtension } from \"../BlockNoteLiveblocksExtension\";\nimport { withLiveblocksEditorOptions } from \"./liveblocksEditorOptions\";\n\n/**\n * Function that can be used instead of standard useCreateBlockNote to add Liveblocks support\n */\nexport const useCreateBlockNoteWithLiveblocks = <\n B extends BlockSchema = DefaultBlockSchema,\n I extends InlineContentSchema = DefaultInlineContentSchema,\n S extends StyleSchema = DefaultStyleSchema,\n>(\n blocknoteOptions: Partial<BlockNoteEditorOptions<B, I, S>> = {},\n liveblocksOptions: LiveblocksExtensionOptions = undefined,\n deps: DependencyList = []\n) => {\n const liveblocksExtension = useLiveblocksExtension(liveblocksOptions);\n return useCreateBlockNote(\n withLiveblocksEditorOptions(\n liveblocksExtension,\n blocknoteOptions,\n liveblocksOptions\n ),\n [liveblocksExtension, ...deps]\n );\n};\n"],"names":["useLiveblocksExtension","useCreateBlockNote","withLiveblocksEditorOptions"],"mappings":";;;;;;AAmBa,MAAA,gCAAA,GAAmC,CAK9C,gBAA6D,GAAA,IAC7D,iBAAgD,GAAA,KAAA,CAAA,EAChD,IAAuB,GAAA,EACpB,KAAA;AACH,EAAM,MAAA,mBAAA,GAAsBA,oDAAuB,iBAAiB,CAAA,CAAA;AACpE,EAAO,OAAAC,wBAAA;AAAA,IACLC,mDAAA;AAAA,MACE,mBAAA;AAAA,MACA,gBAAA;AAAA,MACA,iBAAA;AAAA,KACF;AAAA,IACA,CAAC,mBAAqB,EAAA,GAAG,IAAI,CAAA;AAAA,GAC/B,CAAA;AACF;;;;"}
1
+ {"version":3,"file":"useCreateBlockNoteWithLiveblocks.cjs","sources":["../../src/initialization/useCreateBlockNoteWithLiveblocks.ts"],"sourcesContent":["import type {\n BlockNoteEditorOptions,\n BlockSchema,\n DefaultBlockSchema,\n DefaultInlineContentSchema,\n DefaultStyleSchema,\n InlineContentSchema,\n StyleSchema,\n} from \"@blocknote/core\";\nimport { useCreateBlockNote } from \"@blocknote/react\";\nimport type { DependencyList } from \"react\";\n\nimport type { LiveblocksExtensionOptions } from \"../BlockNoteLiveblocksExtension\";\nimport { useLiveblocksExtension } from \"../BlockNoteLiveblocksExtension\";\nimport { withLiveblocksEditorOptions } from \"./liveblocksEditorOptions\";\n\n/**\n * Function that can be used instead of standard useCreateBlockNote to add Liveblocks support\n */\nexport const useCreateBlockNoteWithLiveblocks = <\n B extends BlockSchema = DefaultBlockSchema,\n I extends InlineContentSchema = DefaultInlineContentSchema,\n S extends StyleSchema = DefaultStyleSchema,\n>(\n blocknoteOptions: Partial<BlockNoteEditorOptions<B, I, S>> = {},\n liveblocksOptions?: LiveblocksExtensionOptions,\n deps: DependencyList = []\n) => {\n const liveblocksExtension = useLiveblocksExtension(liveblocksOptions);\n return useCreateBlockNote(\n withLiveblocksEditorOptions(\n liveblocksExtension,\n blocknoteOptions,\n liveblocksOptions\n ),\n [liveblocksExtension, ...deps]\n );\n};\n"],"names":["useLiveblocksExtension","useCreateBlockNote","withLiveblocksEditorOptions"],"mappings":";;;;;;AAmBa,MAAA,gCAAA,GAAmC,CAK9C,gBAA6D,GAAA,IAC7D,iBACA,EAAA,IAAA,GAAuB,EACpB,KAAA;AACH,EAAM,MAAA,mBAAA,GAAsBA,oDAAuB,iBAAiB,CAAA,CAAA;AACpE,EAAO,OAAAC,wBAAA;AAAA,IACLC,mDAAA;AAAA,MACE,mBAAA;AAAA,MACA,gBAAA;AAAA,MACA,iBAAA;AAAA,KACF;AAAA,IACA,CAAC,mBAAqB,EAAA,GAAG,IAAI,CAAA;AAAA,GAC/B,CAAA;AACF;;;;"}
@@ -2,7 +2,7 @@ import { useCreateBlockNote } from '@blocknote/react';
2
2
  import { useLiveblocksExtension } from '../BlockNoteLiveblocksExtension.js';
3
3
  import { withLiveblocksEditorOptions } from './liveblocksEditorOptions.js';
4
4
 
5
- const useCreateBlockNoteWithLiveblocks = (blocknoteOptions = {}, liveblocksOptions = void 0, deps = []) => {
5
+ const useCreateBlockNoteWithLiveblocks = (blocknoteOptions = {}, liveblocksOptions, deps = []) => {
6
6
  const liveblocksExtension = useLiveblocksExtension(liveblocksOptions);
7
7
  return useCreateBlockNote(
8
8
  withLiveblocksEditorOptions(
@@ -1 +1 @@
1
- {"version":3,"file":"useCreateBlockNoteWithLiveblocks.js","sources":["../../src/initialization/useCreateBlockNoteWithLiveblocks.ts"],"sourcesContent":["import type {\n BlockNoteEditorOptions,\n BlockSchema,\n DefaultBlockSchema,\n DefaultInlineContentSchema,\n DefaultStyleSchema,\n InlineContentSchema,\n StyleSchema,\n} from \"@blocknote/core\";\nimport { useCreateBlockNote } from \"@blocknote/react\";\nimport type { DependencyList } from \"react\";\n\nimport type { LiveblocksExtensionOptions } from \"../BlockNoteLiveblocksExtension\";\nimport { useLiveblocksExtension } from \"../BlockNoteLiveblocksExtension\";\nimport { withLiveblocksEditorOptions } from \"./liveblocksEditorOptions\";\n\n/**\n * Function that can be used instead of standard useCreateBlockNote to add Liveblocks support\n */\nexport const useCreateBlockNoteWithLiveblocks = <\n B extends BlockSchema = DefaultBlockSchema,\n I extends InlineContentSchema = DefaultInlineContentSchema,\n S extends StyleSchema = DefaultStyleSchema,\n>(\n blocknoteOptions: Partial<BlockNoteEditorOptions<B, I, S>> = {},\n liveblocksOptions: LiveblocksExtensionOptions = undefined,\n deps: DependencyList = []\n) => {\n const liveblocksExtension = useLiveblocksExtension(liveblocksOptions);\n return useCreateBlockNote(\n withLiveblocksEditorOptions(\n liveblocksExtension,\n blocknoteOptions,\n liveblocksOptions\n ),\n [liveblocksExtension, ...deps]\n );\n};\n"],"names":[],"mappings":";;;;AAmBa,MAAA,gCAAA,GAAmC,CAK9C,gBAA6D,GAAA,IAC7D,iBAAgD,GAAA,KAAA,CAAA,EAChD,IAAuB,GAAA,EACpB,KAAA;AACH,EAAM,MAAA,mBAAA,GAAsB,uBAAuB,iBAAiB,CAAA,CAAA;AACpE,EAAO,OAAA,kBAAA;AAAA,IACL,2BAAA;AAAA,MACE,mBAAA;AAAA,MACA,gBAAA;AAAA,MACA,iBAAA;AAAA,KACF;AAAA,IACA,CAAC,mBAAqB,EAAA,GAAG,IAAI,CAAA;AAAA,GAC/B,CAAA;AACF;;;;"}
1
+ {"version":3,"file":"useCreateBlockNoteWithLiveblocks.js","sources":["../../src/initialization/useCreateBlockNoteWithLiveblocks.ts"],"sourcesContent":["import type {\n BlockNoteEditorOptions,\n BlockSchema,\n DefaultBlockSchema,\n DefaultInlineContentSchema,\n DefaultStyleSchema,\n InlineContentSchema,\n StyleSchema,\n} from \"@blocknote/core\";\nimport { useCreateBlockNote } from \"@blocknote/react\";\nimport type { DependencyList } from \"react\";\n\nimport type { LiveblocksExtensionOptions } from \"../BlockNoteLiveblocksExtension\";\nimport { useLiveblocksExtension } from \"../BlockNoteLiveblocksExtension\";\nimport { withLiveblocksEditorOptions } from \"./liveblocksEditorOptions\";\n\n/**\n * Function that can be used instead of standard useCreateBlockNote to add Liveblocks support\n */\nexport const useCreateBlockNoteWithLiveblocks = <\n B extends BlockSchema = DefaultBlockSchema,\n I extends InlineContentSchema = DefaultInlineContentSchema,\n S extends StyleSchema = DefaultStyleSchema,\n>(\n blocknoteOptions: Partial<BlockNoteEditorOptions<B, I, S>> = {},\n liveblocksOptions?: LiveblocksExtensionOptions,\n deps: DependencyList = []\n) => {\n const liveblocksExtension = useLiveblocksExtension(liveblocksOptions);\n return useCreateBlockNote(\n withLiveblocksEditorOptions(\n liveblocksExtension,\n blocknoteOptions,\n liveblocksOptions\n ),\n [liveblocksExtension, ...deps]\n );\n};\n"],"names":[],"mappings":";;;;AAmBa,MAAA,gCAAA,GAAmC,CAK9C,gBAA6D,GAAA,IAC7D,iBACA,EAAA,IAAA,GAAuB,EACpB,KAAA;AACH,EAAM,MAAA,mBAAA,GAAsB,uBAAuB,iBAAiB,CAAA,CAAA;AACpE,EAAO,OAAA,kBAAA;AAAA,IACL,2BAAA;AAAA,MACE,mBAAA;AAAA,MACA,gBAAA;AAAA,MACA,iBAAA;AAAA,KACF;AAAA,IACA,CAAC,mBAAqB,EAAA,GAAG,IAAI,CAAA;AAAA,GAC/B,CAAA;AACF;;;;"}
package/dist/version.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  const PKG_NAME = "@liveblocks/react-blocknote";
4
- const PKG_VERSION = typeof "3.21.0-exp2" === "string" && "3.21.0-exp2";
4
+ const PKG_VERSION = typeof "3.21.0-exp3" === "string" && "3.21.0-exp3";
5
5
  const PKG_FORMAT = typeof "cjs" === "string" && "cjs";
6
6
 
7
7
  exports.PKG_FORMAT = PKG_FORMAT;
package/dist/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  const PKG_NAME = "@liveblocks/react-blocknote";
2
- const PKG_VERSION = typeof "3.21.0-exp2" === "string" && "3.21.0-exp2";
2
+ const PKG_VERSION = typeof "3.21.0-exp3" === "string" && "3.21.0-exp3";
3
3
  const PKG_FORMAT = typeof "esm" === "string" && "esm";
4
4
 
5
5
  export { PKG_FORMAT, PKG_NAME, PKG_VERSION };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@liveblocks/react-blocknote",
3
- "version": "3.21.0-exp2",
3
+ "version": "3.21.0-exp3",
4
4
  "description": "An integration of BlockNote + React to enable collaboration, comments, live cursors, and more with Liveblocks.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Liveblocks Inc.",
@@ -33,12 +33,12 @@
33
33
  "README.md"
34
34
  ],
35
35
  "dependencies": {
36
- "@liveblocks/client": "3.21.0-exp2",
37
- "@liveblocks/react": "3.21.0-exp2",
38
- "@liveblocks/react-tiptap": "3.21.0-exp2",
39
- "@liveblocks/react-ui": "3.21.0-exp2",
40
- "@liveblocks/core": "3.21.0-exp2",
41
- "@liveblocks/yjs": "3.21.0-exp2"
36
+ "@liveblocks/client": "3.21.0-exp3",
37
+ "@liveblocks/core": "3.21.0-exp3",
38
+ "@liveblocks/react": "3.21.0-exp3",
39
+ "@liveblocks/react-ui": "3.21.0-exp3",
40
+ "@liveblocks/react-tiptap": "3.21.0-exp3",
41
+ "@liveblocks/yjs": "3.21.0-exp3"
42
42
  },
43
43
  "peerDependencies": {
44
44
  "@blocknote/core": ">=0.43",