@lobehub/editor 1.4.7 → 1.5.0

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 (98) hide show
  1. package/es/editor-kernel/kernel.d.ts +4 -1
  2. package/es/editor-kernel/kernel.js +56 -1
  3. package/es/index.d.ts +2 -0
  4. package/es/index.js +2 -0
  5. package/es/locale/index.d.ts +7 -0
  6. package/es/locale/index.js +7 -0
  7. package/es/plugins/code/command/index.d.ts +3 -0
  8. package/es/plugins/code/command/index.js +48 -0
  9. package/es/plugins/code/index.d.ts +3 -0
  10. package/es/plugins/code/index.js +3 -0
  11. package/es/plugins/code/node/code.d.ts +19 -0
  12. package/es/plugins/{common/node/LexicalLineBreakNode.js → code/node/code.js} +93 -95
  13. package/es/plugins/code/plugin/index.d.ts +5 -0
  14. package/es/plugins/{common/node/ParagraphNode.js → code/plugin/index.js} +40 -33
  15. package/es/plugins/code/plugin/registry.d.ts +3 -0
  16. package/es/plugins/code/plugin/registry.js +48 -0
  17. package/es/plugins/code/react/CodeReactPlugin.d.ts +4 -0
  18. package/es/plugins/code/react/CodeReactPlugin.js +31 -0
  19. package/es/plugins/code/react/index.d.ts +1 -0
  20. package/es/plugins/code/react/index.js +1 -0
  21. package/es/plugins/code/react/style.d.ts +3 -0
  22. package/es/plugins/code/react/style.js +10 -0
  23. package/es/plugins/code/react/type.d.ts +3 -0
  24. package/es/plugins/code/react/type.js +1 -0
  25. package/es/plugins/common/data-source/json-data-source.js +42 -5
  26. package/es/plugins/common/data-source/text-data-source.js +2 -2
  27. package/es/plugins/common/index.d.ts +1 -0
  28. package/es/plugins/common/index.js +1 -0
  29. package/es/plugins/common/node/ElementDOMSlot.d.ts +3 -5
  30. package/es/plugins/common/node/ElementDOMSlot.js +29 -56
  31. package/es/plugins/common/node/cursor.d.ts +12 -0
  32. package/es/plugins/common/node/cursor.js +303 -0
  33. package/es/plugins/common/plugin/index.js +5 -9
  34. package/es/plugins/common/plugin/register.d.ts +3 -1
  35. package/es/plugins/common/plugin/register.js +46 -13
  36. package/es/plugins/link/command/index.d.ts +5 -1
  37. package/es/plugins/link/command/index.js +21 -3
  38. package/es/plugins/link/react/ReactLinkPlugin.js +6 -9
  39. package/es/plugins/link/react/components/LinkEdit.d.ts +2 -1
  40. package/es/plugins/link/react/components/LinkEdit.js +195 -51
  41. package/es/plugins/link/react/components/LinkToolbar.d.ts +10 -0
  42. package/es/plugins/link/react/components/LinkToolbar.js +73 -0
  43. package/es/plugins/link/react/style.d.ts +3 -2
  44. package/es/plugins/link/react/style.js +8 -5
  45. package/es/plugins/list/command/index.d.ts +1 -0
  46. package/es/plugins/list/command/index.js +1 -0
  47. package/es/plugins/list/plugin/checkList.d.ts +3 -0
  48. package/es/plugins/list/plugin/checkList.js +167 -0
  49. package/es/plugins/list/plugin/index.js +9 -2
  50. package/es/plugins/list/react/style.js +4 -2
  51. package/es/plugins/markdown/data-source/markdown-data-source.js +5 -1
  52. package/es/plugins/markdown/service/shortcut.d.ts +3 -3
  53. package/es/plugins/math/command/index.d.ts +13 -0
  54. package/es/plugins/math/command/index.js +47 -0
  55. package/es/plugins/math/index.d.ts +3 -0
  56. package/es/plugins/math/index.js +3 -0
  57. package/es/plugins/math/node/index.d.ts +45 -0
  58. package/es/plugins/math/node/index.js +259 -0
  59. package/es/plugins/math/plugin/index.d.ts +11 -0
  60. package/es/plugins/math/plugin/index.js +103 -0
  61. package/es/plugins/math/react/component/MathEditor.d.ts +10 -0
  62. package/es/plugins/math/react/component/MathEditor.js +253 -0
  63. package/es/plugins/math/react/component/MathEditorContainer.d.ts +14 -0
  64. package/es/plugins/math/react/component/MathEditorContainer.js +60 -0
  65. package/es/plugins/math/react/component/MathEditorContent.d.ts +26 -0
  66. package/es/plugins/math/react/component/MathEditorContent.js +163 -0
  67. package/es/plugins/math/react/component/MathInline.d.ts +10 -0
  68. package/es/plugins/math/react/component/MathInline.js +105 -0
  69. package/es/plugins/math/react/component/Placeholder.d.ts +3 -0
  70. package/es/plugins/math/react/component/Placeholder.js +19 -0
  71. package/es/plugins/math/react/index.d.ts +3 -0
  72. package/es/plugins/math/react/index.js +43 -0
  73. package/es/plugins/math/react/style.d.ts +6 -0
  74. package/es/plugins/math/react/style.js +16 -0
  75. package/es/plugins/math/react/type.d.ts +13 -0
  76. package/es/plugins/math/react/type.js +1 -0
  77. package/es/plugins/slash/react/ReactSlashPlugin.js +12 -10
  78. package/es/react/FloatMenu/FloatMenu.d.ts +4 -0
  79. package/es/react/FloatMenu/FloatMenu.js +49 -0
  80. package/es/react/FloatMenu/index.d.ts +2 -0
  81. package/es/react/FloatMenu/index.js +2 -0
  82. package/es/react/FloatMenu/type.d.ts +19 -0
  83. package/es/react/FloatMenu/type.js +1 -0
  84. package/es/react/SlashMenu/SlashMenu.js +32 -48
  85. package/es/react/SlashMenu/type.d.ts +5 -13
  86. package/es/react/hooks/useEditorState/index.d.ts +4 -0
  87. package/es/react/hooks/useEditorState/index.js +40 -4
  88. package/es/react/index.d.ts +1 -0
  89. package/es/react/index.js +1 -0
  90. package/es/types/global.d.ts +4 -0
  91. package/es/types/kernel.d.ts +26 -1
  92. package/package.json +2 -1
  93. package/es/plugins/common/node/LexicalLineBreakNode.d.ts +0 -31
  94. package/es/plugins/common/node/ParagraphNode.d.ts +0 -7
  95. package/es/plugins/link/react/components/Toolbar.d.ts +0 -7
  96. package/es/plugins/link/react/components/Toolbar.js +0 -63
  97. /package/es/react/{SlashMenu → FloatMenu}/style.d.ts +0 -0
  98. /package/es/react/{SlashMenu → FloatMenu}/style.js +0 -0
@@ -1,7 +0,0 @@
1
- import { LexicalEditor } from 'lexical';
2
- import type { FC } from 'react';
3
- import { LinkNode } from '../../node/LinkNode';
4
- export declare const Toolbar: FC<{
5
- editor: LexicalEditor;
6
- linkNode: LinkNode | null;
7
- }>;
@@ -1,63 +0,0 @@
1
- import { ActionIconGroup } from '@lobehub/ui';
2
- import { EditIcon, ExternalLinkIcon, UnlinkIcon } from 'lucide-react';
3
- import { useTranslation } from "../../../../editor-kernel/react/useTranslation";
4
- import { TOGGLE_LINK_COMMAND } from "../../node/LinkNode";
5
- import { useStyles } from "../style";
6
- import { EDIT_LINK_COMMAND } from "./LinkEdit";
7
- import { jsx as _jsx } from "react/jsx-runtime";
8
- export var Toolbar = function Toolbar(_ref) {
9
- var linkNode = _ref.linkNode,
10
- editor = _ref.editor;
11
- var _useStyles = useStyles(),
12
- theme = _useStyles.theme;
13
- var t = useTranslation();
14
- var handleEdit = function handleEdit() {
15
- // Edit link
16
- if (linkNode) {
17
- editor.dispatchCommand(EDIT_LINK_COMMAND, {
18
- linkNode: linkNode,
19
- linkNodeDOM: editor.getElementByKey(linkNode.getKey())
20
- });
21
- }
22
- };
23
- var handleRemove = function handleRemove() {
24
- // Remove link
25
- editor.dispatchCommand(TOGGLE_LINK_COMMAND, null);
26
- };
27
- var handleOpenLink = function handleOpenLink() {
28
- // Open link in new window
29
- if (linkNode) {
30
- var url = editor.read(function () {
31
- return linkNode.getURL();
32
- });
33
- window.open(url, '_blank');
34
- }
35
- };
36
- return /*#__PURE__*/_jsx(ActionIconGroup, {
37
- items: [{
38
- icon: EditIcon,
39
- key: 'edit',
40
- label: t('link.edit'),
41
- onClick: handleEdit
42
- }, {
43
- icon: ExternalLinkIcon,
44
- key: 'openLink',
45
- label: t('link.open'),
46
- onClick: handleOpenLink
47
- }, {
48
- icon: UnlinkIcon,
49
- key: 'unlink',
50
- label: t('link.unlink'),
51
- onClick: handleRemove
52
- }],
53
- shadow: true,
54
- size: {
55
- blockSize: 32,
56
- size: 16
57
- },
58
- style: {
59
- background: theme.colorBgElevated
60
- },
61
- variant: 'outlined'
62
- });
63
- };
File without changes
File without changes