@octanejs/lexical 0.1.11 → 0.1.12
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.
- package/package.json +9 -9
- package/src/LexicalAutoEmbedPlugin.tsrx +3 -1
- package/src/LexicalBlockWithAlignableContents.tsrx +2 -1
- package/src/LexicalCharacterLimitPlugin.tsrx +1 -3
- package/src/LexicalClearEditorPlugin.tsrx +2 -1
- package/src/LexicalMarkdownShortcutPlugin.tsrx +2 -1
- package/src/LexicalNodeContextMenuPlugin.tsrx +3 -4
- package/src/LexicalNodeMenuPlugin.tsrx +3 -1
- package/src/LexicalPlainTextPlugin.tsrx +2 -1
- package/src/LexicalRichTextPlugin.tsrx +2 -1
- package/src/LexicalSelectionAlwaysOnDisplay.tsrx +2 -1
- package/src/LexicalTypeaheadMenuPlugin.tsrx +3 -1
- package/src/shared/LexicalContentEditableElement.tsrx +2 -1
- package/src/shared/LexicalDecorators.tsrx +2 -1
- package/src/types.ts +1 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@octanejs/lexical",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.12",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -104,20 +104,20 @@
|
|
|
104
104
|
"@lexical/utils": "0.46.0",
|
|
105
105
|
"@lexical/yjs": "0.46.0",
|
|
106
106
|
"lexical": "0.46.0",
|
|
107
|
-
"yjs": "^13.6.
|
|
108
|
-
"@octanejs/floating-ui": "0.1.
|
|
107
|
+
"yjs": "^13.6.31",
|
|
108
|
+
"@octanejs/floating-ui": "0.1.12"
|
|
109
109
|
},
|
|
110
110
|
"peerDependencies": {
|
|
111
|
-
"octane": "0.1.
|
|
111
|
+
"octane": "0.1.13"
|
|
112
112
|
},
|
|
113
113
|
"devDependencies": {
|
|
114
114
|
"@lexical/react": "0.46.0",
|
|
115
|
-
"@tsrx/react": "^0.2.
|
|
115
|
+
"@tsrx/react": "^0.2.46",
|
|
116
116
|
"esbuild": "^0.28.1",
|
|
117
|
-
"react": "^19.2.
|
|
118
|
-
"react-dom": "^19.2.
|
|
119
|
-
"vitest": "^4.1.
|
|
120
|
-
"octane": "0.1.
|
|
117
|
+
"react": "^19.2.7",
|
|
118
|
+
"react-dom": "^19.2.7",
|
|
119
|
+
"vitest": "^4.1.10",
|
|
120
|
+
"octane": "0.1.13"
|
|
121
121
|
},
|
|
122
122
|
"scripts": {
|
|
123
123
|
"test": "vitest run"
|
|
@@ -29,7 +29,9 @@ type LexicalAutoEmbedPluginProps<TEmbedConfig extends EmbedConfig> = {
|
|
|
29
29
|
menuCommandPriority?: CommandListenerPriority;
|
|
30
30
|
};
|
|
31
31
|
|
|
32
|
-
export function LexicalAutoEmbedPlugin<TEmbedConfig extends EmbedConfig>(
|
|
32
|
+
export function LexicalAutoEmbedPlugin<TEmbedConfig extends EmbedConfig>(
|
|
33
|
+
props: LexicalAutoEmbedPluginProps<TEmbedConfig>,
|
|
34
|
+
) {
|
|
33
35
|
const embedConfigs = props.embedConfigs;
|
|
34
36
|
const onOpenEmbedModalForConfig = props.onOpenEmbedModalForConfig;
|
|
35
37
|
const getMenuOptions = props.getMenuOptions;
|
|
@@ -21,7 +21,8 @@ import type { ElementFormatType, NodeKey } from 'lexical';
|
|
|
21
21
|
import { useEffect, useRef } from 'octane';
|
|
22
22
|
import type { OctaneNode } from 'octane';
|
|
23
23
|
|
|
24
|
-
type Props =
|
|
24
|
+
type Props =
|
|
25
|
+
Readonly<{
|
|
25
26
|
children: OctaneNode;
|
|
26
27
|
format?: ElementFormatType | null;
|
|
27
28
|
nodeKey: NodeKey;
|
|
@@ -36,9 +36,7 @@ type RendererProps = {
|
|
|
36
36
|
function DefaultRenderer(props: RendererProps) @{
|
|
37
37
|
<span
|
|
38
38
|
class={'characters-limit ' + (props.remainingCharacters < 0 ? 'characters-limit-exceeded' : '')}
|
|
39
|
-
>
|
|
40
|
-
{props.remainingCharacters as unknown as string}
|
|
41
|
-
</span>
|
|
39
|
+
>{props.remainingCharacters as unknown as string}</span>
|
|
42
40
|
}
|
|
43
41
|
|
|
44
42
|
type Props = {
|
|
@@ -113,7 +113,8 @@ interface Props {
|
|
|
113
113
|
// item-only fields are optional (`type` is a plain string, so the union does not
|
|
114
114
|
// discriminate), plus the item's resolved getItemProps() bag —
|
|
115
115
|
// `Record<string, unknown>`, the @octanejs/floating-ui prop-getter return type.
|
|
116
|
-
type ContextMenuListItem =
|
|
116
|
+
type ContextMenuListItem =
|
|
117
|
+
MenuSeparatorType & {
|
|
117
118
|
disabled?: boolean;
|
|
118
119
|
icon?: OctaneNode | null;
|
|
119
120
|
label?: string;
|
|
@@ -143,9 +144,7 @@ function ContextMenuList(props: ContextMenuListProps) @{
|
|
|
143
144
|
@if (item.type === 'item') {
|
|
144
145
|
<button {...item.itemProps} class={item.className} role="menuitem" disabled={item.disabled}>
|
|
145
146
|
{item.icon}
|
|
146
|
-
<span>
|
|
147
|
-
{item.label as string}
|
|
148
|
-
</span>
|
|
147
|
+
<span>{item.label as string}</span>
|
|
149
148
|
</button>
|
|
150
149
|
} @else {
|
|
151
150
|
<hr {...item.itemProps} class={item.className} />
|
|
@@ -26,7 +26,9 @@ export type NodeMenuPluginProps<TOption extends MenuOption> = {
|
|
|
26
26
|
parent?: HTMLElement;
|
|
27
27
|
};
|
|
28
28
|
|
|
29
|
-
export function LexicalNodeMenuPlugin<TOption extends MenuOption>(
|
|
29
|
+
export function LexicalNodeMenuPlugin<TOption extends MenuOption>(
|
|
30
|
+
props: NodeMenuPluginProps<TOption>,
|
|
31
|
+
) {
|
|
30
32
|
const options = props.options;
|
|
31
33
|
const nodeKey = props.nodeKey;
|
|
32
34
|
const onClose = props.onClose;
|
|
@@ -9,7 +9,8 @@ import type { OctaneNode } from 'octane';
|
|
|
9
9
|
|
|
10
10
|
// Octane analog of @lexical/react's ErrorBoundaryType (a component taking the
|
|
11
11
|
// decorator subtree plus an onError callback).
|
|
12
|
-
type ErrorBoundaryType =
|
|
12
|
+
type ErrorBoundaryType =
|
|
13
|
+
(props: {
|
|
13
14
|
children: OctaneNode;
|
|
14
15
|
onError: (error: Error) => void;
|
|
15
16
|
}) => OctaneNode;
|
|
@@ -11,7 +11,8 @@ import type { OctaneNode } from 'octane';
|
|
|
11
11
|
|
|
12
12
|
// Octane analog of @lexical/react's ErrorBoundaryType (a component taking the
|
|
13
13
|
// decorator subtree plus an onError callback).
|
|
14
|
-
type ErrorBoundaryType =
|
|
14
|
+
type ErrorBoundaryType =
|
|
15
|
+
(props: {
|
|
15
16
|
children: OctaneNode;
|
|
16
17
|
onError: (error: Error) => void;
|
|
17
18
|
}) => OctaneNode;
|
|
@@ -3,7 +3,8 @@ import { selectionAlwaysOnDisplay } from '@lexical/utils';
|
|
|
3
3
|
import { useLexicalComposerContext } from './LexicalComposerContext';
|
|
4
4
|
import { useEffect } from 'octane';
|
|
5
5
|
|
|
6
|
-
type Props =
|
|
6
|
+
type Props =
|
|
7
|
+
Readonly<{
|
|
7
8
|
onReposition?: (node: readonly HTMLElement[]) => void;
|
|
8
9
|
}>;
|
|
9
10
|
|
|
@@ -40,7 +40,9 @@ export type TypeaheadMenuPluginProps<TOption extends MenuOption> = {
|
|
|
40
40
|
ignoreEntityBoundary?: boolean;
|
|
41
41
|
};
|
|
42
42
|
|
|
43
|
-
export function LexicalTypeaheadMenuPlugin<TOption extends MenuOption>(
|
|
43
|
+
export function LexicalTypeaheadMenuPlugin<TOption extends MenuOption>(
|
|
44
|
+
props: TypeaheadMenuPluginProps<TOption>,
|
|
45
|
+
) {
|
|
44
46
|
const options = props.options;
|
|
45
47
|
const onQueryChange = props.onQueryChange;
|
|
46
48
|
const onSelectOption = props.onSelectOption;
|
|
@@ -20,7 +20,8 @@ type DivAttributes = Octane.HTMLAttributes<HTMLDivElement>;
|
|
|
20
20
|
* set ARIA properties. The camelCase `aria*` props (such as `ariaLabel`) are
|
|
21
21
|
* also accepted but are retained only for backwards compatibility.
|
|
22
22
|
*/
|
|
23
|
-
export type ContentEditableElementProps =
|
|
23
|
+
export type ContentEditableElementProps =
|
|
24
|
+
{
|
|
24
25
|
editor: LexicalEditor;
|
|
25
26
|
ariaActiveDescendant?: DivAttributes['aria-activedescendant'];
|
|
26
27
|
ariaAutoComplete?: DivAttributes['aria-autocomplete'];
|
package/src/types.ts
CHANGED
|
@@ -12,10 +12,7 @@ import type {
|
|
|
12
12
|
// tsgo treats as `any` via the ambient module — so the typed surface lives here).
|
|
13
13
|
|
|
14
14
|
export type InitialEditorStateType =
|
|
15
|
-
|
|
|
16
|
-
| string
|
|
17
|
-
| EditorState
|
|
18
|
-
| ((editor: LexicalEditor) => void);
|
|
15
|
+
null | string | EditorState | ((editor: LexicalEditor) => void);
|
|
19
16
|
|
|
20
17
|
export type InitialConfigType = Readonly<{
|
|
21
18
|
namespace: string;
|