@liveblocks/react-lexical 2.16.0-toolbars4 → 2.16.0-toolbars5

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.
Files changed (37) hide show
  1. package/dist/comments/anchored-threads.js +2 -2
  2. package/dist/comments/anchored-threads.js.map +1 -1
  3. package/dist/comments/anchored-threads.mjs +1 -1
  4. package/dist/comments/anchored-threads.mjs.map +1 -1
  5. package/dist/index.d.mts +3 -3
  6. package/dist/index.d.ts +3 -3
  7. package/dist/index.js +2 -2
  8. package/dist/index.js.map +1 -1
  9. package/dist/index.mjs +1 -1
  10. package/dist/index.mjs.map +1 -1
  11. package/dist/is-block-node-active.js +51 -0
  12. package/dist/is-block-node-active.js.map +1 -0
  13. package/dist/is-block-node-active.mjs +49 -0
  14. package/dist/is-block-node-active.mjs.map +1 -0
  15. package/dist/liveblocks-plugin-provider.js +2 -15
  16. package/dist/liveblocks-plugin-provider.js.map +1 -1
  17. package/dist/liveblocks-plugin-provider.mjs +2 -14
  18. package/dist/liveblocks-plugin-provider.mjs.map +1 -1
  19. package/dist/toolbar/floating-toolbar.js +16 -19
  20. package/dist/toolbar/floating-toolbar.js.map +1 -1
  21. package/dist/toolbar/floating-toolbar.mjs +16 -19
  22. package/dist/toolbar/floating-toolbar.mjs.map +1 -1
  23. package/dist/toolbar/toolbar.js +30 -25
  24. package/dist/toolbar/toolbar.js.map +1 -1
  25. package/dist/toolbar/toolbar.mjs +30 -25
  26. package/dist/toolbar/toolbar.mjs.map +1 -1
  27. package/dist/use-root-element.js +21 -0
  28. package/dist/use-root-element.js.map +1 -0
  29. package/dist/use-root-element.mjs +19 -0
  30. package/dist/use-root-element.mjs.map +1 -0
  31. package/dist/version.js +1 -1
  32. package/dist/version.mjs +1 -1
  33. package/package.json +6 -6
  34. package/dist/get-active-block-element.js +0 -26
  35. package/dist/get-active-block-element.js.map +0 -1
  36. package/dist/get-active-block-element.mjs +0 -24
  37. package/dist/get-active-block-element.mjs.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@liveblocks/react-lexical",
3
- "version": "2.16.0-toolbars4",
3
+ "version": "2.16.0-toolbars5",
4
4
  "description": "A lexical react plugin to enable collaboration, comments, live cursors, and more.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "commonjs",
@@ -42,11 +42,11 @@
42
42
  },
43
43
  "dependencies": {
44
44
  "@floating-ui/react-dom": "^2.1.1",
45
- "@liveblocks/client": "2.16.0-toolbars4",
46
- "@liveblocks/core": "2.16.0-toolbars4",
47
- "@liveblocks/react": "2.16.0-toolbars4",
48
- "@liveblocks/react-ui": "2.16.0-toolbars4",
49
- "@liveblocks/yjs": "2.16.0-toolbars4",
45
+ "@liveblocks/client": "2.16.0-toolbars5",
46
+ "@liveblocks/core": "2.16.0-toolbars5",
47
+ "@liveblocks/react": "2.16.0-toolbars5",
48
+ "@liveblocks/react-ui": "2.16.0-toolbars5",
49
+ "@liveblocks/yjs": "2.16.0-toolbars5",
50
50
  "@radix-ui/react-select": "^2.1.2",
51
51
  "@radix-ui/react-toggle": "^1.1.0",
52
52
  "yjs": "^13.6.18"
@@ -1,26 +0,0 @@
1
- 'use strict';
2
-
3
- var utils = require('@lexical/utils');
4
- var lexical = require('lexical');
5
-
6
- function isParentRootOrShadowRoot(node) {
7
- const parent = node.getParent();
8
- return parent !== null && lexical.$isRootOrShadowRoot(parent);
9
- }
10
- function getActiveBlockElement(editor) {
11
- return editor.getEditorState().read(() => {
12
- const selection = lexical.$getSelection();
13
- if (!lexical.$isRangeSelection(selection))
14
- return null;
15
- const anchor = selection.anchor.getNode();
16
- const focus = selection.focus.getNode();
17
- const commonAncestor = anchor.getCommonAncestor(focus);
18
- if (!commonAncestor || lexical.$isRootOrShadowRoot(commonAncestor))
19
- return null;
20
- const element = isParentRootOrShadowRoot(commonAncestor) ? commonAncestor : utils.$findMatchingParent(commonAncestor, isParentRootOrShadowRoot);
21
- return element;
22
- });
23
- }
24
-
25
- exports.getActiveBlockElement = getActiveBlockElement;
26
- //# sourceMappingURL=get-active-block-element.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-active-block-element.js","sources":["../src/get-active-block-element.ts"],"sourcesContent":["import { $findMatchingParent } from \"@lexical/utils\";\nimport type { LexicalEditor, LexicalNode } from \"lexical\";\nimport { $getSelection, $isRangeSelection, $isRootOrShadowRoot } from \"lexical\";\n\nfunction isParentRootOrShadowRoot(node: LexicalNode) {\n const parent = node.getParent();\n\n return parent !== null && $isRootOrShadowRoot(parent);\n}\n\nexport function getActiveBlockElement(editor: LexicalEditor) {\n return editor.getEditorState().read(() => {\n const selection = $getSelection();\n\n if (!$isRangeSelection(selection)) return null;\n\n const anchor = selection.anchor.getNode();\n const focus = selection.focus.getNode();\n\n const commonAncestor = anchor.getCommonAncestor(focus);\n\n if (!commonAncestor || $isRootOrShadowRoot(commonAncestor)) return null;\n\n const element = isParentRootOrShadowRoot(commonAncestor)\n ? commonAncestor\n : $findMatchingParent(commonAncestor, isParentRootOrShadowRoot);\n\n return element;\n });\n}\n"],"names":["$isRootOrShadowRoot","$getSelection","$isRangeSelection","$findMatchingParent"],"mappings":";;;;;AAIA,SAAS,yBAAyB,IAAmB,EAAA;AACnD,EAAM,MAAA,MAAA,GAAS,KAAK,SAAU,EAAA,CAAA;AAE9B,EAAO,OAAA,MAAA,KAAW,IAAQ,IAAAA,2BAAA,CAAoB,MAAM,CAAA,CAAA;AACtD,CAAA;AAEO,SAAS,sBAAsB,MAAuB,EAAA;AAC3D,EAAA,OAAO,MAAO,CAAA,cAAA,EAAiB,CAAA,IAAA,CAAK,MAAM;AACxC,IAAA,MAAM,YAAYC,qBAAc,EAAA,CAAA;AAEhC,IAAI,IAAA,CAACC,0BAAkB,SAAS,CAAA;AAAG,MAAO,OAAA,IAAA,CAAA;AAE1C,IAAM,MAAA,MAAA,GAAS,SAAU,CAAA,MAAA,CAAO,OAAQ,EAAA,CAAA;AACxC,IAAM,MAAA,KAAA,GAAQ,SAAU,CAAA,KAAA,CAAM,OAAQ,EAAA,CAAA;AAEtC,IAAM,MAAA,cAAA,GAAiB,MAAO,CAAA,iBAAA,CAAkB,KAAK,CAAA,CAAA;AAErD,IAAI,IAAA,CAAC,cAAkB,IAAAF,2BAAA,CAAoB,cAAc,CAAA;AAAG,MAAO,OAAA,IAAA,CAAA;AAEnE,IAAA,MAAM,UAAU,wBAAyB,CAAA,cAAc,IACnD,cACA,GAAAG,yBAAA,CAAoB,gBAAgB,wBAAwB,CAAA,CAAA;AAEhE,IAAO,OAAA,OAAA,CAAA;AAAA,GACR,CAAA,CAAA;AACH;;;;"}
@@ -1,24 +0,0 @@
1
- import { $findMatchingParent } from '@lexical/utils';
2
- import { $isRootOrShadowRoot, $getSelection, $isRangeSelection } from 'lexical';
3
-
4
- function isParentRootOrShadowRoot(node) {
5
- const parent = node.getParent();
6
- return parent !== null && $isRootOrShadowRoot(parent);
7
- }
8
- function getActiveBlockElement(editor) {
9
- return editor.getEditorState().read(() => {
10
- const selection = $getSelection();
11
- if (!$isRangeSelection(selection))
12
- return null;
13
- const anchor = selection.anchor.getNode();
14
- const focus = selection.focus.getNode();
15
- const commonAncestor = anchor.getCommonAncestor(focus);
16
- if (!commonAncestor || $isRootOrShadowRoot(commonAncestor))
17
- return null;
18
- const element = isParentRootOrShadowRoot(commonAncestor) ? commonAncestor : $findMatchingParent(commonAncestor, isParentRootOrShadowRoot);
19
- return element;
20
- });
21
- }
22
-
23
- export { getActiveBlockElement };
24
- //# sourceMappingURL=get-active-block-element.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-active-block-element.mjs","sources":["../src/get-active-block-element.ts"],"sourcesContent":["import { $findMatchingParent } from \"@lexical/utils\";\nimport type { LexicalEditor, LexicalNode } from \"lexical\";\nimport { $getSelection, $isRangeSelection, $isRootOrShadowRoot } from \"lexical\";\n\nfunction isParentRootOrShadowRoot(node: LexicalNode) {\n const parent = node.getParent();\n\n return parent !== null && $isRootOrShadowRoot(parent);\n}\n\nexport function getActiveBlockElement(editor: LexicalEditor) {\n return editor.getEditorState().read(() => {\n const selection = $getSelection();\n\n if (!$isRangeSelection(selection)) return null;\n\n const anchor = selection.anchor.getNode();\n const focus = selection.focus.getNode();\n\n const commonAncestor = anchor.getCommonAncestor(focus);\n\n if (!commonAncestor || $isRootOrShadowRoot(commonAncestor)) return null;\n\n const element = isParentRootOrShadowRoot(commonAncestor)\n ? commonAncestor\n : $findMatchingParent(commonAncestor, isParentRootOrShadowRoot);\n\n return element;\n });\n}\n"],"names":[],"mappings":";;;AAIA,SAAS,yBAAyB,IAAmB,EAAA;AACnD,EAAM,MAAA,MAAA,GAAS,KAAK,SAAU,EAAA,CAAA;AAE9B,EAAO,OAAA,MAAA,KAAW,IAAQ,IAAA,mBAAA,CAAoB,MAAM,CAAA,CAAA;AACtD,CAAA;AAEO,SAAS,sBAAsB,MAAuB,EAAA;AAC3D,EAAA,OAAO,MAAO,CAAA,cAAA,EAAiB,CAAA,IAAA,CAAK,MAAM;AACxC,IAAA,MAAM,YAAY,aAAc,EAAA,CAAA;AAEhC,IAAI,IAAA,CAAC,kBAAkB,SAAS,CAAA;AAAG,MAAO,OAAA,IAAA,CAAA;AAE1C,IAAM,MAAA,MAAA,GAAS,SAAU,CAAA,MAAA,CAAO,OAAQ,EAAA,CAAA;AACxC,IAAM,MAAA,KAAA,GAAQ,SAAU,CAAA,KAAA,CAAM,OAAQ,EAAA,CAAA;AAEtC,IAAM,MAAA,cAAA,GAAiB,MAAO,CAAA,iBAAA,CAAkB,KAAK,CAAA,CAAA;AAErD,IAAI,IAAA,CAAC,cAAkB,IAAA,mBAAA,CAAoB,cAAc,CAAA;AAAG,MAAO,OAAA,IAAA,CAAA;AAEnE,IAAA,MAAM,UAAU,wBAAyB,CAAA,cAAc,IACnD,cACA,GAAA,mBAAA,CAAoB,gBAAgB,wBAAwB,CAAA,CAAA;AAEhE,IAAO,OAAA,OAAA,CAAA;AAAA,GACR,CAAA,CAAA;AACH;;;;"}