@lexical/react 0.49.1-nightly.20260901.0 → 0.50.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.
- package/dist/LexicalAutoEmbedPlugin.d.ts +4 -47
- package/dist/LexicalAutoEmbedPlugin.dev.js +5 -31
- package/dist/LexicalAutoEmbedPlugin.dev.mjs +5 -30
- package/dist/LexicalAutoEmbedPlugin.prod.js +1 -1
- package/dist/LexicalAutoEmbedPlugin.prod.mjs +1 -1
- package/dist/LexicalAutoEmbedPluginUtils.d.ts +53 -0
- package/dist/LexicalAutoEmbedPluginUtils.dev.js +66 -0
- package/dist/LexicalAutoEmbedPluginUtils.dev.mjs +62 -0
- package/dist/LexicalAutoEmbedPluginUtils.js +11 -0
- package/dist/LexicalAutoEmbedPluginUtils.js.flow +40 -0
- package/dist/LexicalAutoEmbedPluginUtils.mjs +14 -0
- package/dist/LexicalAutoEmbedPluginUtils.node.mjs +12 -0
- package/dist/LexicalAutoEmbedPluginUtils.prod.js +9 -0
- package/dist/LexicalAutoEmbedPluginUtils.prod.mjs +9 -0
- package/dist/LexicalCollaborationContext.d.ts +1 -26
- package/dist/LexicalCollaborationContext.dev.js +5 -55
- package/dist/LexicalCollaborationContext.dev.mjs +4 -53
- package/dist/LexicalCollaborationContext.prod.js +2 -2
- package/dist/LexicalCollaborationContext.prod.mjs +2 -2
- package/dist/LexicalCollaborationContextUtils.d.ts +35 -0
- package/dist/LexicalCollaborationContextUtils.dev.js +83 -0
- package/dist/LexicalCollaborationContextUtils.dev.mjs +79 -0
- package/dist/LexicalCollaborationContextUtils.js +11 -0
- package/dist/LexicalCollaborationContextUtils.js.flow +25 -0
- package/dist/LexicalCollaborationContextUtils.mjs +14 -0
- package/dist/LexicalCollaborationContextUtils.node.mjs +12 -0
- package/dist/LexicalCollaborationContextUtils.prod.js +9 -0
- package/dist/LexicalCollaborationContextUtils.prod.mjs +9 -0
- package/dist/LexicalMenuOption.d.ts +29 -0
- package/dist/LexicalMenuOption.dev.js +51 -0
- package/dist/LexicalMenuOption.dev.mjs +49 -0
- package/dist/LexicalMenuOption.js +11 -0
- package/dist/LexicalMenuOption.js.flow +20 -0
- package/dist/LexicalMenuOption.mjs +12 -0
- package/dist/LexicalMenuOption.node.mjs +10 -0
- package/dist/LexicalMenuOption.prod.js +9 -0
- package/dist/LexicalMenuOption.prod.mjs +9 -0
- package/dist/LexicalNodeMenuPlugin.dev.js +5 -28
- package/dist/LexicalNodeMenuPlugin.dev.mjs +4 -27
- package/dist/LexicalNodeMenuPlugin.prod.js +1 -1
- package/dist/LexicalNodeMenuPlugin.prod.mjs +1 -1
- package/dist/LexicalTypeaheadMenuPlugin.d.ts +2 -34
- package/dist/LexicalTypeaheadMenuPlugin.dev.js +10 -78
- package/dist/LexicalTypeaheadMenuPlugin.dev.mjs +9 -76
- package/dist/LexicalTypeaheadMenuPlugin.prod.js +1 -1
- package/dist/LexicalTypeaheadMenuPlugin.prod.mjs +1 -1
- package/dist/LexicalTypeaheadMenuPluginUtils.d.ts +44 -0
- package/dist/LexicalTypeaheadMenuPluginUtils.dev.js +81 -0
- package/dist/LexicalTypeaheadMenuPluginUtils.dev.mjs +76 -0
- package/dist/LexicalTypeaheadMenuPluginUtils.js +11 -0
- package/dist/LexicalTypeaheadMenuPluginUtils.js.flow +34 -0
- package/dist/LexicalTypeaheadMenuPluginUtils.mjs +15 -0
- package/dist/LexicalTypeaheadMenuPluginUtils.node.mjs +13 -0
- package/dist/LexicalTypeaheadMenuPluginUtils.prod.js +9 -0
- package/dist/LexicalTypeaheadMenuPluginUtils.prod.mjs +9 -0
- package/dist/shared/LexicalMenu.d.ts +5 -19
- package/package.json +164 -20
- package/src/LexicalAutoEmbedPlugin.tsx +12 -70
- package/src/LexicalAutoEmbedPluginUtils.ts +80 -0
- package/src/LexicalCollaborationContext.tsx +11 -90
- package/src/LexicalCollaborationContextUtils.ts +99 -0
- package/src/LexicalMenuOption.ts +39 -0
- package/src/LexicalTypeaheadMenuPlugin.tsx +6 -80
- package/src/LexicalTypeaheadMenuPluginUtils.ts +93 -0
- package/src/shared/LexicalMenu.tsx +12 -28
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import{useLexicalComposerContext as t}from"@lexical/react/LexicalComposerContext";import{
|
|
9
|
+
import{useLexicalComposerContext as t}from"@lexical/react/LexicalComposerContext";import{CAN_USE_DOM as e,getDOMShadowRoots as n,mergeRegister as l,registerEventListener as o,getRootOwnerDocument as r,COMMAND_PRIORITY_LOW as i,KEY_ARROW_DOWN_COMMAND as c,KEY_ARROW_UP_COMMAND as u,KEY_ESCAPE_COMMAND as s,KEY_TAB_COMMAND as a,KEY_ENTER_COMMAND as d,isDOMShadowRoot as p,isHTMLElement as m,getParentElement as f,$getSelection as g,$isRangeSelection as h,$isTextNode as y,getDOMSelection as x,getDOMSelectionPoints as C}from"lexical";import{useLayoutEffect as b,useEffect as v,useRef as w,useCallback as R,useState as E,useMemo as I,startTransition as S}from"react";import{SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND as O}from"@lexical/react/LexicalTypeaheadMenuPluginUtils";export{PUNCTUATION,SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND,getScrollParent,useBasicTypeaheadTriggerMatch}from"@lexical/react/LexicalTypeaheadMenuPluginUtils";import{getScrollParent as T}from"@lexical/utils";import P from"react-dom";import{jsx as N,jsxs as A}from"react/jsx-runtime";export{MenuOption}from"@lexical/react/LexicalMenuOption";const k=e?b:v,D=t=>{const e=t.closest("#typeahead-menu");if(!e)return;const n=e.getBoundingClientRect();n.top+n.height>window.innerHeight&&e.scrollIntoView({block:"center"}),n.top<0&&e.scrollIntoView({block:"center"}),t.scrollIntoView({block:"nearest"})};function M(t,e){const n=t.getBoundingClientRect(),l=e.getBoundingClientRect();return n.top>=l.top-6&&n.top<=l.bottom+6}function L(e,r,i,c){const[u]=t();v(()=>{if(null!=r&&null!=e){const t=u.getRootElement(),e=null!=t?T(t,!1):document.body;let s=!1,a=M(r,e);const d=function(){s||(window.requestAnimationFrame(function(){i(),s=!1}),s=!0);const t=M(r,e);t!==a&&(a=t,null!=c&&c(t))},p=new ResizeObserver(i),m=n(t??r);return p.observe(r),l(o(window,"resize",i),o(document,"scroll",d,{capture:!0,passive:!0}),...m.map(t=>o(t,"scroll",d,{capture:!0,passive:!0})),()=>p.unobserve(r))}},[r,u,c,i,e])}function B({index:t,isSelected:e,onClick:n,onMouseEnter:l,option:o}){let r="item";return e&&(r+=" selected"),/*#__PURE__*/A("li",{tabIndex:-1,className:r,ref:o.setRefElement,role:"option","aria-selected":e,id:"typeahead-item-"+t,onMouseEnter:l,onClick:n,children:[o.icon,/*#__PURE__*/N("span",{className:"text",children:o.title})]},o.key)}function F({close:t,editor:e,anchorElementRef:n,resolution:o,options:r,menuRenderFn:p,onSelectOption:m,shouldSplitNodeWithQuery:f=!1,commandPriority:y=i,preselectFirstItem:x=!0}){const[C,b]=E(null),w=null!==C?Math.min(r.length-1,C):null,S=o.match&&o.match.matchingString;v(()=>{x&&b(0)},[S,x]);const T=R(n=>{e.update(()=>{const e=null!=o.match&&f?function(t){const e=g();if(!h(e)||!e.isCollapsed())return null;const n=e.anchor;if("text"!==n.type)return null;const l=n.getNode();if(!l.isSimpleText())return null;const o=n.offset,r=l.getTextContent().slice(0,o),i=t.replaceableString.length,c=o-function(t,e,n){let l=n;for(let n=l;n<=e.length;n++)t.slice(-n)===e.substring(0,n)&&(l=n);return l}(r,t.matchingString,i);if(c<0)return null;let u;return 0===c?[u]=l.splitText(o):[,u]=l.splitText(c,o),u}(o.match):null;m(n,e,t,o.match?o.match.matchingString:"")})},[e,f,o.match,m,t]),A=R(t=>{const n=e.getRootElement();null!==n&&(n.setAttribute("aria-activedescendant","typeahead-item-"+t),b(t))},[e]),M=R(()=>n.current&&r.length?/*#__PURE__*/P.createPortal(/*#__PURE__*/N("div",{className:"typeahead-popover mentions-menu",children:/*#__PURE__*/N("ul",{children:r.map((t,e)=>/*#__PURE__*/N(B,{index:e,isSelected:w===e,onClick:()=>{b(e),T(t)},onMouseEnter:()=>{b(e)},option:t},t.key))})}),n.current):null,[n,r,w,T,b]);v(()=>()=>{const t=e.getRootElement();null!==t&&t.removeAttribute("aria-activedescendant")},[e]),k(()=>{null===r?b(null):null===w&&x&&A(0)},[r,w,A,x]);const L=null==p&&(null===r||!r.length);v(()=>l(e.registerCommand(O,({option:t})=>!(!t.ref||null==t.ref.current)&&(D(t.ref.current),!0),y)),[e,A,y]),v(()=>l(e.registerCommand(c,t=>{const n=t;if(L)return!1;const l=null===w?0:w!==r.length-1?w+1:0;A(l);const o=r[l];return o?(o.ref&&o.ref.current&&e.dispatchCommand(O,{index:l,option:o}),n.preventDefault(),n.stopImmediatePropagation(),!0):(A(-1),n.preventDefault(),n.stopImmediatePropagation(),!0)},y),e.registerCommand(u,t=>{const e=t;if(L)return!1;const n=null===w?r.length-1:0!==w?w-1:r.length-1;A(n);const l=r[n];return l?(l.ref&&l.ref.current&&D(l.ref.current),e.preventDefault(),e.stopImmediatePropagation(),!0):(A(-1),e.preventDefault(),e.stopImmediatePropagation(),!0)},y),e.registerCommand(s,e=>{const n=e;return!L&&(n.preventDefault(),n.stopImmediatePropagation(),t(),!0)},y),e.registerCommand(a,t=>{const e=t;return null!==r&&null!==w&&null!=r[w]&&(e.preventDefault(),e.stopImmediatePropagation(),T(r[w]),!0)},y),e.registerCommand(d,t=>!(null===r||null===w||null==r[w]||t&&t.shiftKey)&&(null!==t&&(t.preventDefault(),t.stopImmediatePropagation()),T(r[w]),!0),y)),[T,t,e,r,L,w,A,y]);const F=I(()=>({options:r,selectOptionAndCleanUp:T,selectedIndex:w,setHighlightedIndex:b}),[T,w,r]);return null!=p?p(n,F,o.match?o.match.matchingString:""):M()}function $(t,e){null!=e&&(t.className=e),t.setAttribute("aria-label","Typeahead menu"),t.setAttribute("role","listbox"),t.style.display="block",t.style.position="absolute"}function U(t){if("static"!==t.position)return!0;const e=t.willChange;return"none"!==t.transform||"none"!==t.perspective||"none"!==t.filter||"none"!==t.backdropFilter||t.contain.includes("paint")||t.contain.includes("layout")||t.contain.includes("strict")||t.contain.includes("content")||e.includes("transform")||e.includes("perspective")||e.includes("filter")||e.includes("contain")}function _(n,l,o,i,c=!0){const[u]=t(),s=i??function(t){if(!e)return;const n=t.getRootElement();if(null!==n){const t=n.getRootNode();return p(t)?t:n.ownerDocument.body}return document.body}(u),a=e?r(u.getRootElement()).createElement("div"):null,d=w(a),g=R(()=>{if(null===d.current||void 0===s)return;d.current.style.top=d.current.style.bottom;const t=u.getRootElement(),e=d.current,l=e.firstChild;if(null!==t&&null!==n){const{left:r,top:i,width:u,height:a}=n.getRect(),g=d.current.offsetHeight,h=function(t){const e=p(t)?t.host:t;for(let t=m(e)?e:null;null!==t;t=f(t)){const e=t.ownerDocument.defaultView;if(null===e)break;if(U(e.getComputedStyle(t))){const e=t.getBoundingClientRect();return{left:e.left+t.clientLeft-t.scrollLeft,top:e.top+t.clientTop-t.scrollTop}}}return null}(s),y=t=>null!==h?t-h.left:t+window.pageXOffset,x=t=>null!==h?t-h.top:t+(c?window.pageYOffset:0);if(e.style.top=`${x(i+g+3)}px`,e.style.left=`${y(r)}px`,e.style.height=`${a}px`,e.style.width=`${u}px`,null!==l){l.style.top=`${i}`;const n=l.getBoundingClientRect(),o=n.height,c=n.width,u=t.getBoundingClientRect();r+c>u.right&&(e.style.left=`${y(u.right-c)}px`),(i+o>window.innerHeight||i+o>u.bottom)&&i-u.top>o+a&&(e.style.top=`${x(i-o-a)}px`)}e.isConnected||($(e,o),s.append(e)),e.setAttribute("id","typeahead-menu"),t.setAttribute("aria-controls","typeahead-menu")}},[u,n,c,o,s]);v(()=>{const t=u.getRootElement();return null!==n&&g(),()=>{null!==t&&t.removeAttribute("aria-controls");const e=d.current;null!==e&&e.isConnected&&(e.remove(),e.removeAttribute("id"))}},[u,g,n]);const h=R(t=>{null!==n&&(t||l(null))},[n,l]);return L(n,d.current,g,h),null!=a&&a===d.current&&($(a,o),null!=s&&s.append(a)),d}function H({options:e,onQueryChange:n,onSelectOption:l,onOpen:o,onClose:r,menuRenderFn:c,triggerFn:u,anchorClassName:s,commandPriority:a=i,parent:d,preselectFirstItem:p=!0,ignoreEntityBoundary:m=!1}){const[f]=t(),[b,w]=E(null),I=_(b,w,s,d),O=R(()=>{if(null===b)return;const t=()=>{w(null)};let e;try{e=r&&r()}finally{e?e.then(t,t):t()}},[r,b]),T=R(t=>{w(t),null!=o&&null===b&&o(t)},[o,b]);return v(()=>{const t=f.registerUpdateListener(()=>{f.read("latest",()=>{if(!f.isEditable())return void O();const t=()=>{f.isComposing()||O()},e=f._window||window,l=e.document.createRange(),o=g(),r=function(t){let e=null;return t.read("latest",()=>{const t=g();h(t)&&(e=function(t){const e=t.anchor;if("text"!==e.type)return null;const n=e.getNode();if(!n.isSimpleText())return null;const l=e.offset;return n.getTextContent().slice(0,l)}(t))}),e}(f);if(!h(o)||!o.isCollapsed()||null===r||null===l)return void t();const i=u(r,f);if(n(i?i.matchingString:null),null!==i&&(m||!function(t,e){return 0===e&&t.read("latest",()=>{const t=g();if(h(t)){const e=t.anchor.getNode().getPreviousSibling();return y(e)&&e.isTextEntity()}return!1})}(f,i.leadOffset))){const t=function(t,e,n,l){const o=x(n);if(null===o||!o.isCollapsed)return!1;const r=C(o,l),i=r.anchorNode,c=t,u=r.anchorOffset;if(null==i||null==u)return!1;try{e.setStart(i,c),e.setEnd(i,u)}catch(t){return!1}return!0}(i.leadOffset,l,e,f.getRootElement());if(null!==t)return void S(()=>T({getRect:()=>l.getBoundingClientRect(),match:i}))}t()})});return()=>{t()}},[f,u,n,b,O,T,m]),v(()=>f.registerEditableListener(t=>{t||O()}),[f,O]),null===b||null===f||null===I.current?null:/*#__PURE__*/N(F,{close:O,resolution:b,editor:f,anchorElementRef:I,options:e,menuRenderFn:c,shouldSplitNodeWithQuery:!0,onSelectOption:l,commandPriority:a,preselectFirstItem:p})}export{H as LexicalTypeaheadMenuPlugin,L as useDynamicPositioning};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
import type { MenuOption, TriggerFn } from './shared/LexicalMenu';
|
|
9
|
+
import { getScrollParent as getScrollParent_ } from '@lexical/utils';
|
|
10
|
+
import { type LexicalCommand } from 'lexical';
|
|
11
|
+
/**
|
|
12
|
+
* The default set of punctuation characters (as a character-class fragment)
|
|
13
|
+
* that terminate a typeahead query. Used as the default `punctuation` option of
|
|
14
|
+
* {@link useBasicTypeaheadTriggerMatch}.
|
|
15
|
+
*/
|
|
16
|
+
export declare const PUNCTUATION = "\\.,\\+\\*\\?\\$\\@\\|#{}\\(\\)\\^\\-\\[\\]\\\\/!%'\"~=<>_:;";
|
|
17
|
+
/**
|
|
18
|
+
* Command dispatched while the typeahead menu is open to scroll the option at
|
|
19
|
+
* the given `index` into view. The built-in menu hook registers a default
|
|
20
|
+
* handler; custom implementations can register their own handler at a higher
|
|
21
|
+
* priority to override the scrolling behavior.
|
|
22
|
+
*/
|
|
23
|
+
export declare const SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND: LexicalCommand<{
|
|
24
|
+
index: number;
|
|
25
|
+
option: MenuOption;
|
|
26
|
+
}>;
|
|
27
|
+
/** @deprecated Moved to `@lexical/utils`. Import `getScrollParent` from there. */
|
|
28
|
+
export declare const getScrollParent: typeof getScrollParent_;
|
|
29
|
+
/**
|
|
30
|
+
* Builds a {@link TriggerFn} for the common case of a single-character
|
|
31
|
+
* `trigger` (such as `@` or `#`) followed by a query. The returned function
|
|
32
|
+
* matches when the trigger is preceded by whitespace, an open parenthesis,
|
|
33
|
+
* or the start of the line
|
|
34
|
+
* and is followed by between `minLength` and `maxLength` non-`punctuation`
|
|
35
|
+
* characters (optionally allowing whitespace).
|
|
36
|
+
*
|
|
37
|
+
* @returns A memoized trigger function for {@link LexicalTypeaheadMenuPlugin}.
|
|
38
|
+
*/
|
|
39
|
+
export declare function useBasicTypeaheadTriggerMatch(trigger: string, { minLength, maxLength, punctuation, allowWhitespace, }: {
|
|
40
|
+
minLength?: number;
|
|
41
|
+
maxLength?: number;
|
|
42
|
+
punctuation?: string;
|
|
43
|
+
allowWhitespace?: boolean;
|
|
44
|
+
}): TriggerFn;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
'use strict';
|
|
10
|
+
|
|
11
|
+
var utils = require('@lexical/utils');
|
|
12
|
+
var lexical = require('lexical');
|
|
13
|
+
var react = require('react');
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
17
|
+
*
|
|
18
|
+
* This source code is licensed under the MIT license found in the
|
|
19
|
+
* LICENSE file in the root directory of this source tree.
|
|
20
|
+
*
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* The default set of punctuation characters (as a character-class fragment)
|
|
26
|
+
* that terminate a typeahead query. Used as the default `punctuation` option of
|
|
27
|
+
* {@link useBasicTypeaheadTriggerMatch}.
|
|
28
|
+
*/
|
|
29
|
+
const PUNCTUATION = '\\.,\\+\\*\\?\\$\\@\\|#{}\\(\\)\\^\\-\\[\\]\\\\/!%\'"~=<>_:;';
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Command dispatched while the typeahead menu is open to scroll the option at
|
|
33
|
+
* the given `index` into view. The built-in menu hook registers a default
|
|
34
|
+
* handler; custom implementations can register their own handler at a higher
|
|
35
|
+
* priority to override the scrolling behavior.
|
|
36
|
+
*/
|
|
37
|
+
const SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND = /* @__PURE__ */lexical.createCommand('SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND');
|
|
38
|
+
|
|
39
|
+
/** @deprecated Moved to `@lexical/utils`. Import `getScrollParent` from there. */
|
|
40
|
+
const getScrollParent = utils.getScrollParent;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Builds a {@link TriggerFn} for the common case of a single-character
|
|
44
|
+
* `trigger` (such as `@` or `#`) followed by a query. The returned function
|
|
45
|
+
* matches when the trigger is preceded by whitespace, an open parenthesis,
|
|
46
|
+
* or the start of the line
|
|
47
|
+
* and is followed by between `minLength` and `maxLength` non-`punctuation`
|
|
48
|
+
* characters (optionally allowing whitespace).
|
|
49
|
+
*
|
|
50
|
+
* @returns A memoized trigger function for {@link LexicalTypeaheadMenuPlugin}.
|
|
51
|
+
*/
|
|
52
|
+
function useBasicTypeaheadTriggerMatch(trigger, {
|
|
53
|
+
minLength = 1,
|
|
54
|
+
maxLength = 75,
|
|
55
|
+
punctuation = PUNCTUATION,
|
|
56
|
+
allowWhitespace = false
|
|
57
|
+
}) {
|
|
58
|
+
return react.useCallback(text => {
|
|
59
|
+
const validCharsSuffix = allowWhitespace ? '' : '\\s';
|
|
60
|
+
const validChars = '[^' + trigger + punctuation + validCharsSuffix + ']';
|
|
61
|
+
const TypeaheadTriggerRegex = new RegExp('(^|\\s|\\()(' + '[' + trigger + ']' + '((?:' + validChars + '){0,' + maxLength + '})' + ')$');
|
|
62
|
+
const match = TypeaheadTriggerRegex.exec(text);
|
|
63
|
+
if (match !== null) {
|
|
64
|
+
const maybeLeadingWhitespace = match[1];
|
|
65
|
+
const matchingString = match[3];
|
|
66
|
+
if (matchingString.length >= minLength) {
|
|
67
|
+
return {
|
|
68
|
+
leadOffset: match.index + maybeLeadingWhitespace.length,
|
|
69
|
+
matchingString,
|
|
70
|
+
replaceableString: match[2]
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return null;
|
|
75
|
+
}, [allowWhitespace, trigger, punctuation, maxLength, minLength]);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
exports.PUNCTUATION = PUNCTUATION;
|
|
79
|
+
exports.SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND = SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND;
|
|
80
|
+
exports.getScrollParent = getScrollParent;
|
|
81
|
+
exports.useBasicTypeaheadTriggerMatch = useBasicTypeaheadTriggerMatch;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { getScrollParent as getScrollParent$1 } from '@lexical/utils';
|
|
10
|
+
import { createCommand } from 'lexical';
|
|
11
|
+
import { useCallback } from 'react';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
15
|
+
*
|
|
16
|
+
* This source code is licensed under the MIT license found in the
|
|
17
|
+
* LICENSE file in the root directory of this source tree.
|
|
18
|
+
*
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* The default set of punctuation characters (as a character-class fragment)
|
|
24
|
+
* that terminate a typeahead query. Used as the default `punctuation` option of
|
|
25
|
+
* {@link useBasicTypeaheadTriggerMatch}.
|
|
26
|
+
*/
|
|
27
|
+
const PUNCTUATION = '\\.,\\+\\*\\?\\$\\@\\|#{}\\(\\)\\^\\-\\[\\]\\\\/!%\'"~=<>_:;';
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Command dispatched while the typeahead menu is open to scroll the option at
|
|
31
|
+
* the given `index` into view. The built-in menu hook registers a default
|
|
32
|
+
* handler; custom implementations can register their own handler at a higher
|
|
33
|
+
* priority to override the scrolling behavior.
|
|
34
|
+
*/
|
|
35
|
+
const SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND = /* @__PURE__ */createCommand('SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND');
|
|
36
|
+
|
|
37
|
+
/** @deprecated Moved to `@lexical/utils`. Import `getScrollParent` from there. */
|
|
38
|
+
const getScrollParent = getScrollParent$1;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Builds a {@link TriggerFn} for the common case of a single-character
|
|
42
|
+
* `trigger` (such as `@` or `#`) followed by a query. The returned function
|
|
43
|
+
* matches when the trigger is preceded by whitespace, an open parenthesis,
|
|
44
|
+
* or the start of the line
|
|
45
|
+
* and is followed by between `minLength` and `maxLength` non-`punctuation`
|
|
46
|
+
* characters (optionally allowing whitespace).
|
|
47
|
+
*
|
|
48
|
+
* @returns A memoized trigger function for {@link LexicalTypeaheadMenuPlugin}.
|
|
49
|
+
*/
|
|
50
|
+
function useBasicTypeaheadTriggerMatch(trigger, {
|
|
51
|
+
minLength = 1,
|
|
52
|
+
maxLength = 75,
|
|
53
|
+
punctuation = PUNCTUATION,
|
|
54
|
+
allowWhitespace = false
|
|
55
|
+
}) {
|
|
56
|
+
return useCallback(text => {
|
|
57
|
+
const validCharsSuffix = allowWhitespace ? '' : '\\s';
|
|
58
|
+
const validChars = '[^' + trigger + punctuation + validCharsSuffix + ']';
|
|
59
|
+
const TypeaheadTriggerRegex = new RegExp('(^|\\s|\\()(' + '[' + trigger + ']' + '((?:' + validChars + '){0,' + maxLength + '})' + ')$');
|
|
60
|
+
const match = TypeaheadTriggerRegex.exec(text);
|
|
61
|
+
if (match !== null) {
|
|
62
|
+
const maybeLeadingWhitespace = match[1];
|
|
63
|
+
const matchingString = match[3];
|
|
64
|
+
if (matchingString.length >= minLength) {
|
|
65
|
+
return {
|
|
66
|
+
leadOffset: match.index + maybeLeadingWhitespace.length,
|
|
67
|
+
matchingString,
|
|
68
|
+
replaceableString: match[2]
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return null;
|
|
73
|
+
}, [allowWhitespace, trigger, punctuation, maxLength, minLength]);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export { PUNCTUATION, SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND, getScrollParent, useBasicTypeaheadTriggerMatch };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
'use strict'
|
|
10
|
+
const LexicalTypeaheadMenuPluginUtils = process.env.NODE_ENV !== 'production' ? require('./LexicalTypeaheadMenuPluginUtils.dev.js') : require('./LexicalTypeaheadMenuPluginUtils.prod.js');
|
|
11
|
+
module.exports = LexicalTypeaheadMenuPluginUtils;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
* @flow strict
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import type {LexicalCommand} from 'lexical';
|
|
11
|
+
|
|
12
|
+
import type {MenuOption} from '@lexical/react/LexicalMenuOption';
|
|
13
|
+
import type {TriggerFn} from '@lexical/react/LexicalTypeaheadMenuPlugin';
|
|
14
|
+
|
|
15
|
+
declare export var PUNCTUATION: string;
|
|
16
|
+
declare export var SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND: LexicalCommand<{
|
|
17
|
+
index: number,
|
|
18
|
+
option: MenuOption,
|
|
19
|
+
}>;
|
|
20
|
+
|
|
21
|
+
declare export function getScrollParent(
|
|
22
|
+
element: HTMLElement,
|
|
23
|
+
includeHidden?: boolean,
|
|
24
|
+
): HTMLElement | HTMLBodyElement;
|
|
25
|
+
|
|
26
|
+
declare export hook useBasicTypeaheadTriggerMatch(
|
|
27
|
+
trigger: string,
|
|
28
|
+
options: {
|
|
29
|
+
minLength?: number,
|
|
30
|
+
maxLength?: number,
|
|
31
|
+
punctuation?: string,
|
|
32
|
+
allowWhitespace?: boolean,
|
|
33
|
+
},
|
|
34
|
+
): TriggerFn;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import * as modDev from './LexicalTypeaheadMenuPluginUtils.dev.mjs';
|
|
10
|
+
import * as modProd from './LexicalTypeaheadMenuPluginUtils.prod.mjs';
|
|
11
|
+
const mod = process.env.NODE_ENV !== 'production' ? modDev : modProd;
|
|
12
|
+
export const PUNCTUATION = mod.PUNCTUATION;
|
|
13
|
+
export const SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND = mod.SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND;
|
|
14
|
+
export const getScrollParent = mod.getScrollParent;
|
|
15
|
+
export const useBasicTypeaheadTriggerMatch = mod.useBasicTypeaheadTriggerMatch;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
const mod = await (process.env.NODE_ENV !== 'production' ? import('./LexicalTypeaheadMenuPluginUtils.dev.mjs') : import('./LexicalTypeaheadMenuPluginUtils.prod.mjs'));
|
|
10
|
+
export const PUNCTUATION = mod.PUNCTUATION;
|
|
11
|
+
export const SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND = mod.SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND;
|
|
12
|
+
export const getScrollParent = mod.getScrollParent;
|
|
13
|
+
export const useBasicTypeaheadTriggerMatch = mod.useBasicTypeaheadTriggerMatch;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
"use strict";var e=require("@lexical/utils"),t=require("lexical"),r=require("react");const n="\\.,\\+\\*\\?\\$\\@\\|#{}\\(\\)\\^\\-\\[\\]\\\\/!%'\"~=<>_:;",a=/* @__PURE__ */t.createCommand("SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND"),l=e.getScrollParent;exports.PUNCTUATION=n,exports.SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND=a,exports.getScrollParent=l,exports.useBasicTypeaheadTriggerMatch=function(e,{minLength:t=1,maxLength:a=75,punctuation:l=n,allowWhitespace:c=!1}){return r.useCallback(r=>{const n=new RegExp("(^|\\s|\\()(["+e+"]((?:"+("[^"+e+l+(c?"":"\\s")+"]")+"){0,"+a+"}))$").exec(r);if(null!==n){const e=n[1],r=n[3];if(r.length>=t)return{leadOffset:n.index+e.length,matchingString:r,replaceableString:n[2]}}return null},[c,e,l,a,t])};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import{getScrollParent as t}from"@lexical/utils";import{createCommand as e}from"lexical";import{useCallback as n}from"react";const r="\\.,\\+\\*\\?\\$\\@\\|#{}\\(\\)\\^\\-\\[\\]\\\\/!%'\"~=<>_:;",l=/* @__PURE__ */e("SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND"),i=t;function o(t,{minLength:e=1,maxLength:l=75,punctuation:i=r,allowWhitespace:o=!1}){return n(n=>{const r=new RegExp("(^|\\s|\\()(["+t+"]((?:"+("[^"+t+i+(o?"":"\\s")+"]")+"){0,"+l+"}))$").exec(n);if(null!==r){const t=r[1],n=r[3];if(n.length>=e)return{leadOffset:r.index+t.length,matchingString:n,replaceableString:r[2]}}return null},[o,t,i,l,e])}export{r as PUNCTUATION,l as SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND,i as getScrollParent,o as useBasicTypeaheadTriggerMatch};
|
|
@@ -5,7 +5,9 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
|
-
import {
|
|
8
|
+
import { MenuOption } from '@lexical/react/LexicalMenuOption';
|
|
9
|
+
import { SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND } from '@lexical/react/LexicalTypeaheadMenuPluginUtils';
|
|
10
|
+
import { type CommandListenerPriority, type LexicalEditor, type TextNode } from 'lexical';
|
|
9
11
|
import { type JSX, type ReactPortal, type RefObject } from 'react';
|
|
10
12
|
/**
|
|
11
13
|
* Describes where a typeahead trigger matched the text before the cursor: the
|
|
@@ -27,20 +29,7 @@ export type MenuResolution = {
|
|
|
27
29
|
match?: MenuTextMatch;
|
|
28
30
|
getRect: () => DOMRect;
|
|
29
31
|
};
|
|
30
|
-
|
|
31
|
-
* The base class for an item shown in a {@link LexicalTypeaheadMenuPlugin} or
|
|
32
|
-
* {@link LexicalNodeMenuPlugin} menu. Each option has a unique `key` and a `ref`
|
|
33
|
-
* to its rendered element (used for scrolling and keyboard navigation).
|
|
34
|
-
* Subclass it to attach your own data such as a label or callback.
|
|
35
|
-
*/
|
|
36
|
-
export declare class MenuOption {
|
|
37
|
-
key: string;
|
|
38
|
-
ref?: RefObject<HTMLElement | null>;
|
|
39
|
-
icon?: JSX.Element;
|
|
40
|
-
title?: JSX.Element | string;
|
|
41
|
-
constructor(key: string);
|
|
42
|
-
setRefElement(element: HTMLElement | null): void;
|
|
43
|
-
}
|
|
32
|
+
export { MenuOption };
|
|
44
33
|
/**
|
|
45
34
|
* A render function for a menu's contents. It receives the anchor element ref,
|
|
46
35
|
* the current item props (selected index, options, and helpers to select or
|
|
@@ -61,10 +50,7 @@ export type MenuRenderFn<TOption extends MenuOption> = (anchorElementRef: RefObj
|
|
|
61
50
|
* nearest scroll container's viewport.
|
|
62
51
|
*/
|
|
63
52
|
export declare function useDynamicPositioning(resolution: MenuResolution | null, targetElement: HTMLElement | null, onReposition: () => void, onVisibilityChange?: (isInView: boolean) => void): void;
|
|
64
|
-
export
|
|
65
|
-
index: number;
|
|
66
|
-
option: MenuOption;
|
|
67
|
-
}>;
|
|
53
|
+
export { SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND };
|
|
68
54
|
export declare function LexicalMenu<TOption extends MenuOption>({ close, editor, anchorElementRef, resolution, options, menuRenderFn: menuRenderFnProp, onSelectOption, shouldSplitNodeWithQuery, commandPriority, preselectFirstItem, }: {
|
|
69
55
|
close: () => void;
|
|
70
56
|
editor: LexicalEditor;
|
package/package.json
CHANGED
|
@@ -8,28 +8,28 @@
|
|
|
8
8
|
"rich-text"
|
|
9
9
|
],
|
|
10
10
|
"license": "MIT",
|
|
11
|
-
"version": "0.
|
|
11
|
+
"version": "0.50.0",
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"@floating-ui/react": "^0.27.19",
|
|
14
|
-
"@lexical/a11y": "0.
|
|
15
|
-
"@lexical/devtools-core": "0.
|
|
16
|
-
"@lexical/dragon": "0.
|
|
17
|
-
"@lexical/extension": "0.
|
|
18
|
-
"@lexical/hashtag": "0.
|
|
19
|
-
"@lexical/history": "0.
|
|
20
|
-
"@lexical/internal": "0.
|
|
21
|
-
"@lexical/link": "0.
|
|
22
|
-
"@lexical/list": "0.
|
|
23
|
-
"@lexical/mark": "0.
|
|
24
|
-
"@lexical/markdown": "0.
|
|
25
|
-
"@lexical/overflow": "0.
|
|
26
|
-
"@lexical/plain-text": "0.
|
|
27
|
-
"@lexical/rich-text": "0.
|
|
28
|
-
"@lexical/table": "0.
|
|
29
|
-
"@lexical/text": "0.
|
|
30
|
-
"@lexical/utils": "0.
|
|
31
|
-
"@lexical/yjs": "0.
|
|
32
|
-
"lexical": "0.
|
|
14
|
+
"@lexical/a11y": "0.50.0",
|
|
15
|
+
"@lexical/devtools-core": "0.50.0",
|
|
16
|
+
"@lexical/dragon": "0.50.0",
|
|
17
|
+
"@lexical/extension": "0.50.0",
|
|
18
|
+
"@lexical/hashtag": "0.50.0",
|
|
19
|
+
"@lexical/history": "0.50.0",
|
|
20
|
+
"@lexical/internal": "0.50.0",
|
|
21
|
+
"@lexical/link": "0.50.0",
|
|
22
|
+
"@lexical/list": "0.50.0",
|
|
23
|
+
"@lexical/mark": "0.50.0",
|
|
24
|
+
"@lexical/markdown": "0.50.0",
|
|
25
|
+
"@lexical/overflow": "0.50.0",
|
|
26
|
+
"@lexical/plain-text": "0.50.0",
|
|
27
|
+
"@lexical/rich-text": "0.50.0",
|
|
28
|
+
"@lexical/table": "0.50.0",
|
|
29
|
+
"@lexical/text": "0.50.0",
|
|
30
|
+
"@lexical/utils": "0.50.0",
|
|
31
|
+
"@lexical/yjs": "0.50.0",
|
|
32
|
+
"lexical": "0.50.0"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
35
|
"react": ">=18.x",
|
|
@@ -123,6 +123,42 @@
|
|
|
123
123
|
"default": "./dist/LexicalAutoEmbedPlugin.js"
|
|
124
124
|
}
|
|
125
125
|
},
|
|
126
|
+
"./LexicalAutoEmbedPluginUtils": {
|
|
127
|
+
"source": "./src/LexicalAutoEmbedPluginUtils.ts",
|
|
128
|
+
"import": {
|
|
129
|
+
"types@<5.2": "./dist/typescript-too-old.d.ts",
|
|
130
|
+
"types": "./dist/LexicalAutoEmbedPluginUtils.d.ts",
|
|
131
|
+
"development": "./dist/LexicalAutoEmbedPluginUtils.dev.mjs",
|
|
132
|
+
"production": "./dist/LexicalAutoEmbedPluginUtils.prod.mjs",
|
|
133
|
+
"node": "./dist/LexicalAutoEmbedPluginUtils.node.mjs",
|
|
134
|
+
"default": "./dist/LexicalAutoEmbedPluginUtils.mjs"
|
|
135
|
+
},
|
|
136
|
+
"require": {
|
|
137
|
+
"types@<5.2": "./dist/typescript-too-old.d.ts",
|
|
138
|
+
"types": "./dist/LexicalAutoEmbedPluginUtils.d.ts",
|
|
139
|
+
"development": "./dist/LexicalAutoEmbedPluginUtils.dev.js",
|
|
140
|
+
"production": "./dist/LexicalAutoEmbedPluginUtils.prod.js",
|
|
141
|
+
"default": "./dist/LexicalAutoEmbedPluginUtils.js"
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
"./LexicalAutoEmbedPluginUtils.js": {
|
|
145
|
+
"source": "./src/LexicalAutoEmbedPluginUtils.ts",
|
|
146
|
+
"import": {
|
|
147
|
+
"types@<5.2": "./dist/typescript-too-old.d.ts",
|
|
148
|
+
"types": "./dist/LexicalAutoEmbedPluginUtils.d.ts",
|
|
149
|
+
"development": "./dist/LexicalAutoEmbedPluginUtils.dev.mjs",
|
|
150
|
+
"production": "./dist/LexicalAutoEmbedPluginUtils.prod.mjs",
|
|
151
|
+
"node": "./dist/LexicalAutoEmbedPluginUtils.node.mjs",
|
|
152
|
+
"default": "./dist/LexicalAutoEmbedPluginUtils.mjs"
|
|
153
|
+
},
|
|
154
|
+
"require": {
|
|
155
|
+
"types@<5.2": "./dist/typescript-too-old.d.ts",
|
|
156
|
+
"types": "./dist/LexicalAutoEmbedPluginUtils.d.ts",
|
|
157
|
+
"development": "./dist/LexicalAutoEmbedPluginUtils.dev.js",
|
|
158
|
+
"production": "./dist/LexicalAutoEmbedPluginUtils.prod.js",
|
|
159
|
+
"default": "./dist/LexicalAutoEmbedPluginUtils.js"
|
|
160
|
+
}
|
|
161
|
+
},
|
|
126
162
|
"./LexicalAutoFocusPlugin": {
|
|
127
163
|
"source": "./src/LexicalAutoFocusPlugin.ts",
|
|
128
164
|
"import": {
|
|
@@ -411,6 +447,42 @@
|
|
|
411
447
|
"default": "./dist/LexicalCollaborationContext.js"
|
|
412
448
|
}
|
|
413
449
|
},
|
|
450
|
+
"./LexicalCollaborationContextUtils": {
|
|
451
|
+
"source": "./src/LexicalCollaborationContextUtils.ts",
|
|
452
|
+
"import": {
|
|
453
|
+
"types@<5.2": "./dist/typescript-too-old.d.ts",
|
|
454
|
+
"types": "./dist/LexicalCollaborationContextUtils.d.ts",
|
|
455
|
+
"development": "./dist/LexicalCollaborationContextUtils.dev.mjs",
|
|
456
|
+
"production": "./dist/LexicalCollaborationContextUtils.prod.mjs",
|
|
457
|
+
"node": "./dist/LexicalCollaborationContextUtils.node.mjs",
|
|
458
|
+
"default": "./dist/LexicalCollaborationContextUtils.mjs"
|
|
459
|
+
},
|
|
460
|
+
"require": {
|
|
461
|
+
"types@<5.2": "./dist/typescript-too-old.d.ts",
|
|
462
|
+
"types": "./dist/LexicalCollaborationContextUtils.d.ts",
|
|
463
|
+
"development": "./dist/LexicalCollaborationContextUtils.dev.js",
|
|
464
|
+
"production": "./dist/LexicalCollaborationContextUtils.prod.js",
|
|
465
|
+
"default": "./dist/LexicalCollaborationContextUtils.js"
|
|
466
|
+
}
|
|
467
|
+
},
|
|
468
|
+
"./LexicalCollaborationContextUtils.js": {
|
|
469
|
+
"source": "./src/LexicalCollaborationContextUtils.ts",
|
|
470
|
+
"import": {
|
|
471
|
+
"types@<5.2": "./dist/typescript-too-old.d.ts",
|
|
472
|
+
"types": "./dist/LexicalCollaborationContextUtils.d.ts",
|
|
473
|
+
"development": "./dist/LexicalCollaborationContextUtils.dev.mjs",
|
|
474
|
+
"production": "./dist/LexicalCollaborationContextUtils.prod.mjs",
|
|
475
|
+
"node": "./dist/LexicalCollaborationContextUtils.node.mjs",
|
|
476
|
+
"default": "./dist/LexicalCollaborationContextUtils.mjs"
|
|
477
|
+
},
|
|
478
|
+
"require": {
|
|
479
|
+
"types@<5.2": "./dist/typescript-too-old.d.ts",
|
|
480
|
+
"types": "./dist/LexicalCollaborationContextUtils.d.ts",
|
|
481
|
+
"development": "./dist/LexicalCollaborationContextUtils.dev.js",
|
|
482
|
+
"production": "./dist/LexicalCollaborationContextUtils.prod.js",
|
|
483
|
+
"default": "./dist/LexicalCollaborationContextUtils.js"
|
|
484
|
+
}
|
|
485
|
+
},
|
|
414
486
|
"./LexicalCollaborationPlugin": {
|
|
415
487
|
"source": "./src/LexicalCollaborationPlugin.tsx",
|
|
416
488
|
"import": {
|
|
@@ -1023,6 +1095,42 @@
|
|
|
1023
1095
|
"default": "./dist/LexicalMarkdownShortcutPlugin.js"
|
|
1024
1096
|
}
|
|
1025
1097
|
},
|
|
1098
|
+
"./LexicalMenuOption": {
|
|
1099
|
+
"source": "./src/LexicalMenuOption.ts",
|
|
1100
|
+
"import": {
|
|
1101
|
+
"types@<5.2": "./dist/typescript-too-old.d.ts",
|
|
1102
|
+
"types": "./dist/LexicalMenuOption.d.ts",
|
|
1103
|
+
"development": "./dist/LexicalMenuOption.dev.mjs",
|
|
1104
|
+
"production": "./dist/LexicalMenuOption.prod.mjs",
|
|
1105
|
+
"node": "./dist/LexicalMenuOption.node.mjs",
|
|
1106
|
+
"default": "./dist/LexicalMenuOption.mjs"
|
|
1107
|
+
},
|
|
1108
|
+
"require": {
|
|
1109
|
+
"types@<5.2": "./dist/typescript-too-old.d.ts",
|
|
1110
|
+
"types": "./dist/LexicalMenuOption.d.ts",
|
|
1111
|
+
"development": "./dist/LexicalMenuOption.dev.js",
|
|
1112
|
+
"production": "./dist/LexicalMenuOption.prod.js",
|
|
1113
|
+
"default": "./dist/LexicalMenuOption.js"
|
|
1114
|
+
}
|
|
1115
|
+
},
|
|
1116
|
+
"./LexicalMenuOption.js": {
|
|
1117
|
+
"source": "./src/LexicalMenuOption.ts",
|
|
1118
|
+
"import": {
|
|
1119
|
+
"types@<5.2": "./dist/typescript-too-old.d.ts",
|
|
1120
|
+
"types": "./dist/LexicalMenuOption.d.ts",
|
|
1121
|
+
"development": "./dist/LexicalMenuOption.dev.mjs",
|
|
1122
|
+
"production": "./dist/LexicalMenuOption.prod.mjs",
|
|
1123
|
+
"node": "./dist/LexicalMenuOption.node.mjs",
|
|
1124
|
+
"default": "./dist/LexicalMenuOption.mjs"
|
|
1125
|
+
},
|
|
1126
|
+
"require": {
|
|
1127
|
+
"types@<5.2": "./dist/typescript-too-old.d.ts",
|
|
1128
|
+
"types": "./dist/LexicalMenuOption.d.ts",
|
|
1129
|
+
"development": "./dist/LexicalMenuOption.dev.js",
|
|
1130
|
+
"production": "./dist/LexicalMenuOption.prod.js",
|
|
1131
|
+
"default": "./dist/LexicalMenuOption.js"
|
|
1132
|
+
}
|
|
1133
|
+
},
|
|
1026
1134
|
"./LexicalNestedComposer": {
|
|
1027
1135
|
"source": "./src/LexicalNestedComposer.tsx",
|
|
1028
1136
|
"import": {
|
|
@@ -1491,6 +1599,42 @@
|
|
|
1491
1599
|
"default": "./dist/LexicalTypeaheadMenuPlugin.js"
|
|
1492
1600
|
}
|
|
1493
1601
|
},
|
|
1602
|
+
"./LexicalTypeaheadMenuPluginUtils": {
|
|
1603
|
+
"source": "./src/LexicalTypeaheadMenuPluginUtils.ts",
|
|
1604
|
+
"import": {
|
|
1605
|
+
"types@<5.2": "./dist/typescript-too-old.d.ts",
|
|
1606
|
+
"types": "./dist/LexicalTypeaheadMenuPluginUtils.d.ts",
|
|
1607
|
+
"development": "./dist/LexicalTypeaheadMenuPluginUtils.dev.mjs",
|
|
1608
|
+
"production": "./dist/LexicalTypeaheadMenuPluginUtils.prod.mjs",
|
|
1609
|
+
"node": "./dist/LexicalTypeaheadMenuPluginUtils.node.mjs",
|
|
1610
|
+
"default": "./dist/LexicalTypeaheadMenuPluginUtils.mjs"
|
|
1611
|
+
},
|
|
1612
|
+
"require": {
|
|
1613
|
+
"types@<5.2": "./dist/typescript-too-old.d.ts",
|
|
1614
|
+
"types": "./dist/LexicalTypeaheadMenuPluginUtils.d.ts",
|
|
1615
|
+
"development": "./dist/LexicalTypeaheadMenuPluginUtils.dev.js",
|
|
1616
|
+
"production": "./dist/LexicalTypeaheadMenuPluginUtils.prod.js",
|
|
1617
|
+
"default": "./dist/LexicalTypeaheadMenuPluginUtils.js"
|
|
1618
|
+
}
|
|
1619
|
+
},
|
|
1620
|
+
"./LexicalTypeaheadMenuPluginUtils.js": {
|
|
1621
|
+
"source": "./src/LexicalTypeaheadMenuPluginUtils.ts",
|
|
1622
|
+
"import": {
|
|
1623
|
+
"types@<5.2": "./dist/typescript-too-old.d.ts",
|
|
1624
|
+
"types": "./dist/LexicalTypeaheadMenuPluginUtils.d.ts",
|
|
1625
|
+
"development": "./dist/LexicalTypeaheadMenuPluginUtils.dev.mjs",
|
|
1626
|
+
"production": "./dist/LexicalTypeaheadMenuPluginUtils.prod.mjs",
|
|
1627
|
+
"node": "./dist/LexicalTypeaheadMenuPluginUtils.node.mjs",
|
|
1628
|
+
"default": "./dist/LexicalTypeaheadMenuPluginUtils.mjs"
|
|
1629
|
+
},
|
|
1630
|
+
"require": {
|
|
1631
|
+
"types@<5.2": "./dist/typescript-too-old.d.ts",
|
|
1632
|
+
"types": "./dist/LexicalTypeaheadMenuPluginUtils.d.ts",
|
|
1633
|
+
"development": "./dist/LexicalTypeaheadMenuPluginUtils.dev.js",
|
|
1634
|
+
"production": "./dist/LexicalTypeaheadMenuPluginUtils.prod.js",
|
|
1635
|
+
"default": "./dist/LexicalTypeaheadMenuPluginUtils.js"
|
|
1636
|
+
}
|
|
1637
|
+
},
|
|
1494
1638
|
"./ReactExtension": {
|
|
1495
1639
|
"source": "./src/ReactExtension.tsx",
|
|
1496
1640
|
"import": {
|