@react-fabric/lexical 1.0.0-beta.56 → 1.0.0-beta.58
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/css/_lexical.css +4 -0
- package/dist/cjs/node_modules/@lexical/clipboard/LexicalClipboard.dev.js +33 -1
- package/dist/cjs/node_modules/@lexical/clipboard/LexicalClipboard.prod.js +11 -11
- package/dist/cjs/node_modules/@lexical/code/LexicalCode.dev.js +525 -194
- package/dist/cjs/node_modules/@lexical/code/LexicalCode.prod.js +26 -23
- package/dist/cjs/node_modules/@lexical/html/LexicalHtml.dev.js +3 -3
- package/dist/cjs/node_modules/@lexical/html/LexicalHtml.prod.js +3 -3
- package/dist/cjs/node_modules/@lexical/link/LexicalLink.dev.js +95 -38
- package/dist/cjs/node_modules/@lexical/link/LexicalLink.prod.js +11 -10
- package/dist/cjs/node_modules/@lexical/list/LexicalList.dev.js +387 -124
- package/dist/cjs/node_modules/@lexical/list/LexicalList.prod.js +22 -18
- package/dist/cjs/node_modules/@lexical/rich-text/LexicalRichText.dev.js +54 -29
- package/dist/cjs/node_modules/@lexical/rich-text/LexicalRichText.prod.js +10 -10
- package/dist/cjs/node_modules/@lexical/selection/LexicalSelection.dev.js +107 -8
- package/dist/cjs/node_modules/@lexical/selection/LexicalSelection.js +4 -0
- package/dist/cjs/node_modules/@lexical/selection/LexicalSelection.prod.js +23 -20
- package/dist/cjs/node_modules/@lexical/table/LexicalTable.dev.js +420 -137
- package/dist/cjs/node_modules/@lexical/table/LexicalTable.prod.js +50 -45
- package/dist/cjs/node_modules/@lexical/utils/LexicalUtils.dev.js +61 -65
- package/dist/cjs/node_modules/@lexical/utils/LexicalUtils.js +2 -0
- package/dist/cjs/node_modules/@lexical/utils/LexicalUtils.prod.js +47 -46
- package/dist/cjs/packages/lexical/src/hooks/useFormatWatcher.js +3 -1
- package/dist/cjs/packages/lexical/src/plugins/ToolbarPlugin.js +20 -10
- package/dist/esm/node_modules/@lexical/clipboard/LexicalClipboard.dev.js +34 -2
- package/dist/esm/node_modules/@lexical/clipboard/LexicalClipboard.prod.js +3 -3
- package/dist/esm/node_modules/@lexical/code/LexicalCode.dev.js +524 -196
- package/dist/esm/node_modules/@lexical/code/LexicalCode.prod.js +3 -3
- package/dist/esm/node_modules/@lexical/html/LexicalHtml.dev.js +4 -4
- package/dist/esm/node_modules/@lexical/html/LexicalHtml.prod.js +3 -3
- package/dist/esm/node_modules/@lexical/link/LexicalLink.dev.js +96 -40
- package/dist/esm/node_modules/@lexical/link/LexicalLink.prod.js +3 -3
- package/dist/esm/node_modules/@lexical/list/LexicalList.dev.js +387 -127
- package/dist/esm/node_modules/@lexical/list/LexicalList.prod.js +5 -4
- package/dist/esm/node_modules/@lexical/rich-text/LexicalRichText.dev.js +56 -31
- package/dist/esm/node_modules/@lexical/rich-text/LexicalRichText.prod.js +4 -4
- package/dist/esm/node_modules/@lexical/selection/LexicalSelection.dev.js +106 -10
- package/dist/esm/node_modules/@lexical/selection/LexicalSelection.js +3 -1
- package/dist/esm/node_modules/@lexical/selection/LexicalSelection.prod.js +3 -3
- package/dist/esm/node_modules/@lexical/table/LexicalTable.dev.js +417 -139
- package/dist/esm/node_modules/@lexical/table/LexicalTable.prod.js +3 -3
- package/dist/esm/node_modules/@lexical/utils/LexicalUtils.dev.js +62 -67
- package/dist/esm/node_modules/@lexical/utils/LexicalUtils.js +2 -1
- package/dist/esm/node_modules/@lexical/utils/LexicalUtils.prod.js +3 -3
- package/dist/esm/packages/lexical/src/hooks/useFormatWatcher.js +3 -1
- package/dist/esm/packages/lexical/src/plugins/ToolbarPlugin.js +20 -10
- package/package.json +12 -12
- package/src/hooks/useFormatWatcher.ts +3 -1
- package/src/plugins/ToolbarPlugin.tsx +5 -10
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import { isHTMLElement, $getRoot, $isElementNode, $getChildCaret, $getSiblingCaret, $getAdjacentChildCaret, $getChildCaretOrSelf, makeStepwiseIterator, $isChildCaret, $cloneWithProperties, $setSelection, $getSelection, $getPreviousSelection, $isRangeSelection, $
|
|
3
|
+
import { isHTMLElement, $getRoot, $isElementNode, $getChildCaret, $getSiblingCaret, $getAdjacentChildCaret, $getChildCaretOrSelf, makeStepwiseIterator, $isChildCaret, $cloneWithProperties, $setSelection, $getSelection, $getPreviousSelection, $isRangeSelection, $caretFromPoint, $createParagraphNode, $normalizeCaret, $setSelectionFromCaretRange, $getCollapsedCaretRange, $getCaretInDirection, $splitAtPointCaretNext, $isTextPointCaret, $isSiblingCaret, $rewindSiblingCaret, $getState, $setState, getDOMTextNode } from 'lexical';
|
|
4
4
|
export { $splitNode, isBlockDomNode, isHTMLAnchorElement, isHTMLElement, isInlineDomNode } from 'lexical';
|
|
5
5
|
import { createRectsFromDOMRange } from '../selection/LexicalSelection.js';
|
|
6
6
|
|
|
@@ -12,6 +12,6 @@ import { createRectsFromDOMRange } from '../selection/LexicalSelection.js';
|
|
|
12
12
|
*
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
function
|
|
15
|
+
function N(t,...e){const n=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",t);for(const t of e)o.append("v",t);throw n.search=o.toString(),Error(`Minified Lexical error #${t}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const M="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,R=M&&"documentMode"in document?document.documentMode:null,T=M&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),B=M&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),_=!(!M||!("InputEvent"in window)||R)&&"getTargetRanges"in new window.InputEvent("input"),k=M&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),K=M&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,H=M&&/Android/.test(navigator.userAgent),O=M&&/^(?=.*Chrome).*/i.test(navigator.userAgent),$=M&&H&&O,D=M&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!O;function I(...t){const e=[];for(const n of t)if(n&&"string"==typeof n)for(const[t]of n.matchAll(/\S+/g))e.push(t);return e}function j(...t){return ()=>{for(let e=t.length-1;e>=0;e--)t[e]();t.length=0;}}function F(t){return `${t}px`}const U={attributes:!0,characterData:!0,childList:!0,subtree:!0};function z(e,n,o){let r=null,i=null,l=null,u=[];const s=document.createElement("div");function c(){null===r&&N(182),null===i&&N(183);const{left:t,top:l}=i.getBoundingClientRect(),c=createRectsFromDOMRange(e,n);var f,a;s.isConnected||(a=s,(f=i).insertBefore(a,f.firstChild));let d=!1;for(let e=0;e<c.length;e++){const n=c[e],o=u[e]||document.createElement("div"),r=o.style;"absolute"!==r.position&&(r.position="absolute",d=!0);const i=F(n.left-t);r.left!==i&&(r.left=i,d=!0);const f=F(n.top-l);r.top!==f&&(o.style.top=f,d=!0);const a=F(n.width);r.width!==a&&(o.style.width=a,d=!0);const g=F(n.height);r.height!==g&&(o.style.height=g,d=!0),o.parentNode!==s&&(s.append(o),d=!0),u[e]=o;}for(;u.length>c.length;)u.pop();d&&o(u);}function f(){i=null,r=null,null!==l&&l.disconnect(),l=null,s.remove();for(const t of u)t.remove();u=[];}s.style.position="relative";const a=e.registerRootListener((function n(){const o=e.getRootElement();if(null===o)return f();const u=o.parentElement;if(!isHTMLElement(u))return f();f(),r=o,i=u,l=new MutationObserver((t=>{const o=e.getRootElement(),l=o&&o.parentElement;if(o!==r||l!==i)return n();for(const e of t)if(!s.contains(e.target))return c()})),l.observe(u,U),c();}));return ()=>{a(),f();}}function V(t,e,n){if("text"!==t.type&&$isElementNode(e)){const o=e.getDOMSlot(n);return [o.element,o.getFirstChildOffset()+t.offset]}return [getDOMTextNode(n)||n,t.offset]}function W(t,o){let r=null,i=null,l=null,u=null,s=null,c=null,f=()=>{};function a(a){a.read((()=>{const a=$getSelection();if(!$isRangeSelection(a))return r=null,l=null,u=null,c=null,f(),void(f=()=>{});const[d,g]=function(t){const e=t.getStartEndPoints();return t.isBackward()?[e[1],e[0]]:e}(a),p=d.getNode(),m=p.getKey(),h=d.offset,v=g.getNode(),y=v.getKey(),w=g.offset,x=t.getElementByKey(m),E=t.getElementByKey(y),S=null===r||x!==i||h!==l||m!==r.getKey(),A=null===u||E!==s||w!==c||y!==u.getKey();if((S||A)&&null!==x&&null!==E){const e=function(t,e,n,o,r,i,l){const u=(t._window?t._window.document:document).createRange();return u.setStart(...V(e,n,o)),u.setEnd(...V(r,i,l)),u}(t,d,p,x,g,v,E);f(),f=z(t,e,(t=>{if(void 0===o)for(const e of t){const t=e.style;"Highlight"!==t.background&&(t.background="Highlight"),"HighlightText"!==t.color&&(t.color="HighlightText"),t.marginTop!==F(-1.5)&&(t.marginTop=F(-1.5)),t.paddingTop!==F(4)&&(t.paddingTop=F(4)),t.paddingBottom!==F(0)&&(t.paddingBottom=F(0));}else o(t);}));}r=p,i=x,l=h,u=v,s=E,c=w;}));}return a(t.getEditorState()),j(t.registerUpdateListener((({editorState:t})=>a(t))),(()=>{f();}))}function G(t){let e=null;const n=()=>{const n=getSelection(),o=n&&n.anchorNode,r=t.getRootElement();null!==o&&null!==r&&r.contains(o)?null!==e&&(e(),e=null):null===e&&(e=W(t));};return document.addEventListener("selectionchange",n),()=>{null!==e&&e(),document.removeEventListener("selectionchange",n);}}const q=_,J=M,Q=H,X=$,Y=T,Z=D,tt=O,et=B,nt=K,ot=k;function rt(t,...e){const n=I(...e);n.length>0&&t.classList.add(...n);}function it(t,...e){const n=I(...e);n.length>0&&t.classList.remove(...n);}function lt(t,e){for(const n of e)if(t.type.startsWith(n))return !0;return !1}function ut(t,e){const n=t[Symbol.iterator]();return new Promise(((t,o)=>{const r=[],i=()=>{const{done:l,value:u}=n.next();if(l)return t(r);const s=new FileReader;s.addEventListener("error",o),s.addEventListener("load",(()=>{const t=s.result;"string"==typeof t&&r.push({file:u,result:t}),i();})),lt(u,e)?s.readAsDataURL(u):i();};i();}))}function st(t,e){return Array.from(at(t,e))}function ct(t){return t?t.getAdjacentCaret():null}function ft(t,e){return Array.from(ht(t,e))}function at(t,e){return dt("next",t,e)}function dt(t,e,n){const r=$getRoot(),d=e||r,g=$isElementNode(d)?$getChildCaret(d,t):$getSiblingCaret(d,t),p=pt(d),m=n?$getAdjacentChildCaret($getChildCaretOrSelf($getSiblingCaret(n,t))):function(t,e){const n=$t($getSiblingCaret(t,e));return n&&n[0]}(d,t);let h=p;return makeStepwiseIterator({hasNext:t=>null!==t,initial:g,map:t=>({depth:h,node:t.origin}),step:t=>{if(t.isSameNodeCaret(m))return null;$isChildCaret(t)&&h++;const e=$t(t);return !e||e[0].isSameNodeCaret(m)?null:(h+=e[1],e[0])}})}function gt(t){const e=$t($getSiblingCaret(t,"next"));return e&&[e[0].origin,e[1]]}function pt(t){let e=-1;for(let n=t;null!==n;n=n.getParent())e++;return e}function mt(t){const e=$t($getChildCaretOrSelf($getSiblingCaret(t,"previous")),"root");return e&&e[0].origin}function ht(t,e){return dt("previous",t,e)}function vt(t,e){let n=t;for(;null!=n;){if(n instanceof e)return n;n=n.getParent();}return null}function yt(t){const e=wt(t,(t=>$isElementNode(t)&&!t.isInline()));return $isElementNode(e)||N(4,t.__key),e}const wt=(t,e)=>{let n=t;for(;n!==$getRoot()&&null!=n;){if(e(n))return n;n=n.getParent();}return null};function xt(t,e,n,o){const r=t=>t instanceof e;return t.registerNodeTransform(e,(t=>{const e=(t=>{const e=t.getChildren();for(let t=0;t<e.length;t++){const n=e[t];if(r(n))return null}let n=t,o=t;for(;null!==n;)if(o=n,n=n.getParent(),r(n))return {child:o,parent:n};return null})(t);if(null!==e){const{child:r,parent:i}=e;if(r.is(t)){o(i,t);const e=r.getNextSiblings(),l=e.length;if(i.insertAfter(r),0!==l){const t=n(i);r.insertAfter(t);for(let n=0;n<l;n++)t.append(e[n]);}i.canBeEmpty()||0!==i.getChildrenSize()||i.remove();}}}))}function Et(t,e){const n=new Map,o=t._pendingEditorState;for(const[t,o]of e._nodeMap)n.set(t,$cloneWithProperties(o));o&&(o._nodeMap=n),t._dirtyType=2;const r=e._selection;$setSelection(null===r?null:r.clone());}function St(t){const o=$getSelection()||$getPreviousSelection();let r;if($isRangeSelection(o))r=$caretFromPoint(o.focus,"next");else {if(null!=o){const t=o.getNodes(),e=t[t.length-1];e&&(r=$getSiblingCaret(e,"next"));}r=r||$getChildCaret($getRoot(),"previous").getFlipped().insert($createParagraphNode());}const c=At(t,r),f=$getAdjacentChildCaret(c),d=$isChildCaret(f)?$normalizeCaret(f):c;return $setSelectionFromCaretRange($getCollapsedCaretRange(d)),t.getLatest()}function At(t,e,n){let o=$getCaretInDirection(e,"next");for(let t=o;t;t=$splitAtPointCaretNext(t,n))o=t;return $isTextPointCaret(o)&&N(283),o.insert(t.isInline()?$createParagraphNode().append(t):t),$getCaretInDirection($getSiblingCaret(t.getLatest(),"next"),e.direction)}function Ct(t,e){const n=e();return t.replace(n),n.append(t),n}function Lt(t,e){return null!==t&&Object.getPrototypeOf(t).constructor.name===e.name}function Pt(t,e){const n=[];for(let o=0;o<t.length;o++){const r=e(t[o]);null!==r&&n.push(r);}return n}function bt(t,e){$getChildCaret(t,"next").insert(e);}let Nt=!(et||!J)&&void 0;function Mt(t){let e=1;if(function(){if(void 0===Nt){const t=document.createElement("div");t.style.cssText="position: absolute; opacity: 0; width: 100px; left: -1000px;",document.body.appendChild(t);const e=t.getBoundingClientRect();t.style.setProperty("zoom","2"),Nt=t.getBoundingClientRect().width===e.width,document.body.removeChild(t);}return Nt}())for(;t;)e*=Number(window.getComputedStyle(t).getPropertyValue("zoom")),t=t.parentElement;return e}function Rt(t){return null!==t._parentEditor}function Tt(t,e){return Bt(t,e,null)}function Bt(t,e,n){let r=!1;for(const i of Kt(t))e(i)?null!==n&&n(i):(r=!0,$isElementNode(i)&&Bt(i,e,n||(t=>i.insertAfter(t))),i.remove());return r}function _t(t,e){const n=[],r=Array.from(t).reverse();for(let t=r.pop();void 0!==t;t=r.pop())if(e(t))n.push(t);else if($isElementNode(t))for(const e of Kt(t))r.push(e);return n}function kt(t){return Ht($getChildCaret(t,"next"))}function Kt(t){return Ht($getChildCaret(t,"previous"))}function Ht(t){return makeStepwiseIterator({hasNext:$isSiblingCaret,initial:t.getAdjacentCaret(),map:t=>t.origin.getLatest(),step:t=>t.getAdjacentCaret()})}function Ot(t){$rewindSiblingCaret($getSiblingCaret(t,"next")).splice(1,t.getChildren());}function $t(t,e="root"){let n=0,o=t,r=$getAdjacentChildCaret(o);for(;null===r;){if(n--,r=o.getParentCaret(e),!r)return null;o=r,r=$getAdjacentChildCaret(o);}return r&&[r,n]}function Dt(t){const e=e=>$getState(e,t),n=(e,n)=>$setState(e,t,n);return {$get:e,$set:n,accessors:[e,n],makeGetterMethod:()=>function(){return e(this)},makeSetterMethod:()=>function(t){return n(this,t)},stateConfig:t}}
|
|
16
16
|
|
|
17
|
-
export {
|
|
17
|
+
export { _t as $descendantsMatching, st as $dfs, at as $dfsIterator, Pt as $filter, wt as $findMatchingParent, kt as $firstToLastIterator, ct as $getAdjacentCaret, $t as $getAdjacentSiblingOrParentSiblingCaret, pt as $getDepth, yt as $getNearestBlockElementAncestorOrThrow, vt as $getNearestNodeOfType, mt as $getNextRightPreorderNode, gt as $getNextSiblingOrParentSibling, bt as $insertFirst, St as $insertNodeToNearestRoot, At as $insertNodeToNearestRootAtCaret, Rt as $isEditorIsNestedEditor, Kt as $lastToFirstIterator, Et as $restoreEditorState, ft as $reverseDfs, ht as $reverseDfsIterator, Tt as $unwrapAndFilterDescendants, Ot as $unwrapNode, Ct as $wrapNodeInElement, q as CAN_USE_BEFORE_INPUT, J as CAN_USE_DOM, Q as IS_ANDROID, X as IS_ANDROID_CHROME, Y as IS_APPLE, Z as IS_APPLE_WEBKIT, tt as IS_CHROME, et as IS_FIREFOX, nt as IS_IOS, ot as IS_SAFARI, rt as addClassNamesToElement, Mt as calculateZoomLevel, lt as isMimeType, Dt as makeStateWrapper, W as markSelection, ut as mediaFileReader, j as mergeRegister, Lt as objectKlassEquals, z as positionNodeOnRange, xt as registerNestedElementResolver, it as removeClassNamesFromElement, G as selectionAlwaysOnDisplay };
|
|
@@ -160,7 +160,9 @@ var useFormatWatcher = function useFormatWatcher() {
|
|
|
160
160
|
setIsSubscript(selection.hasFormat("subscript"));
|
|
161
161
|
setIsSuperscript(selection.hasFormat("superscript"));
|
|
162
162
|
setIsCode(selection.hasFormat("code"));
|
|
163
|
-
|
|
163
|
+
editor.read(function () {
|
|
164
|
+
setIsRTL($isParentElementRTL(selection));
|
|
165
|
+
});
|
|
164
166
|
|
|
165
167
|
// Update links
|
|
166
168
|
var node = getSelectedNode(selection);
|
|
@@ -135,9 +135,11 @@ var ToolbarPlugin = function ToolbarPlugin() {
|
|
|
135
135
|
variant: "link",
|
|
136
136
|
children: [/*#__PURE__*/jsx(ButtonWrapper, {
|
|
137
137
|
value: "start",
|
|
138
|
-
rtlFlip: true,
|
|
139
138
|
label: t("tool.alignStart"),
|
|
140
|
-
icon:
|
|
139
|
+
icon: {
|
|
140
|
+
icon: CoreIcons.alignLeft,
|
|
141
|
+
rtlFlip: true
|
|
142
|
+
},
|
|
141
143
|
onClick: function onClick() {
|
|
142
144
|
return watch.activeEditor.dispatchCommand(FORMAT_ELEMENT_COMMAND, "start");
|
|
143
145
|
}
|
|
@@ -150,33 +152,41 @@ var ToolbarPlugin = function ToolbarPlugin() {
|
|
|
150
152
|
}
|
|
151
153
|
}), /*#__PURE__*/jsx(ButtonWrapper, {
|
|
152
154
|
value: "end",
|
|
153
|
-
rtlFlip: true,
|
|
154
155
|
label: t("tool.alignEnd"),
|
|
155
|
-
icon:
|
|
156
|
+
icon: {
|
|
157
|
+
icon: CoreIcons.alignRight,
|
|
158
|
+
rtlFlip: true
|
|
159
|
+
},
|
|
156
160
|
onClick: function onClick() {
|
|
157
161
|
return watch.activeEditor.dispatchCommand(FORMAT_ELEMENT_COMMAND, "end");
|
|
158
162
|
}
|
|
159
163
|
}), /*#__PURE__*/jsx(ButtonWrapper, {
|
|
160
164
|
value: "justify",
|
|
161
|
-
rtlFlip: true,
|
|
162
165
|
label: t("tool.alignJustify"),
|
|
163
|
-
icon:
|
|
166
|
+
icon: {
|
|
167
|
+
icon: CoreIcons.alignJustify,
|
|
168
|
+
rtlFlip: true
|
|
169
|
+
},
|
|
164
170
|
onClick: function onClick() {
|
|
165
171
|
return watch.activeEditor.dispatchCommand(FORMAT_ELEMENT_COMMAND, "justify");
|
|
166
172
|
}
|
|
167
173
|
}), /*#__PURE__*/jsx(ButtonWrapper, {
|
|
168
174
|
value: "justify",
|
|
169
|
-
rtlFlip: true,
|
|
170
175
|
label: t("tool.indentOut"),
|
|
171
|
-
icon:
|
|
176
|
+
icon: {
|
|
177
|
+
icon: CoreIcons.formatIndentDecrease,
|
|
178
|
+
rtlFlip: true
|
|
179
|
+
},
|
|
172
180
|
onClick: function onClick() {
|
|
173
181
|
return watch.outdent();
|
|
174
182
|
}
|
|
175
183
|
}), /*#__PURE__*/jsx(ButtonWrapper, {
|
|
176
184
|
value: "justify",
|
|
177
|
-
rtlFlip: true,
|
|
178
185
|
label: t("tool.identIn"),
|
|
179
|
-
icon:
|
|
186
|
+
icon: {
|
|
187
|
+
icon: CoreIcons.formatIndentIncrease,
|
|
188
|
+
rtlFlip: true
|
|
189
|
+
},
|
|
180
190
|
onClick: function onClick() {
|
|
181
191
|
return watch.indent();
|
|
182
192
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-fabric/lexical",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.58",
|
|
4
4
|
"description": "RUF: Lexical editor",
|
|
5
5
|
"author": "Adarsh Pastakia <adarshpastakia@outlook.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -35,22 +35,22 @@
|
|
|
35
35
|
"watch": "npm-run-all -p watch:rollup watch:dts"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@lexical/react": "
|
|
39
|
-
"@react-fabric/core": "^1.0.0-beta.
|
|
40
|
-
"@react-fabric/form": "^1.0.0-beta.
|
|
41
|
-
"@react-fabric/utilities": "^1.0.0-beta.
|
|
42
|
-
"classnames": "
|
|
43
|
-
"lexical": "
|
|
38
|
+
"@lexical/react": "~0.35.0",
|
|
39
|
+
"@react-fabric/core": "^1.0.0-beta.58",
|
|
40
|
+
"@react-fabric/form": "^1.0.0-beta.58",
|
|
41
|
+
"@react-fabric/utilities": "^1.0.0-beta.58",
|
|
42
|
+
"classnames": "~2.5.1",
|
|
43
|
+
"lexical": "~0.35.0"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
|
-
"i18next": "
|
|
47
|
-
"react": "
|
|
48
|
-
"react-dom": "
|
|
49
|
-
"react-i18next": "
|
|
46
|
+
"i18next": "~25.6.0",
|
|
47
|
+
"react": "~19.2.0",
|
|
48
|
+
"react-dom": "~19.2.0",
|
|
49
|
+
"react-i18next": "~16.2.1"
|
|
50
50
|
},
|
|
51
51
|
"engines": {
|
|
52
52
|
"node": ">=18.12.0",
|
|
53
53
|
"npm": ">=8.19.0"
|
|
54
54
|
},
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "7e66f8c498e37a40e410ecafff2ea6b31505dc1a"
|
|
56
56
|
}
|
|
@@ -167,7 +167,9 @@ export const useFormatWatcher = () => {
|
|
|
167
167
|
setIsSubscript(selection.hasFormat("subscript"));
|
|
168
168
|
setIsSuperscript(selection.hasFormat("superscript"));
|
|
169
169
|
setIsCode(selection.hasFormat("code"));
|
|
170
|
-
|
|
170
|
+
editor.read(() => {
|
|
171
|
+
setIsRTL($isParentElementRTL(selection));
|
|
172
|
+
});
|
|
171
173
|
|
|
172
174
|
// Update links
|
|
173
175
|
const node = getSelectedNode(selection);
|
|
@@ -175,9 +175,8 @@ export const ToolbarPlugin = () => {
|
|
|
175
175
|
<ButtonGroup variant="link">
|
|
176
176
|
<ButtonWrapper
|
|
177
177
|
value="start"
|
|
178
|
-
rtlFlip
|
|
179
178
|
label={t("tool.alignStart")}
|
|
180
|
-
icon={CoreIcons.alignLeft}
|
|
179
|
+
icon={{ icon: CoreIcons.alignLeft, rtlFlip: true }}
|
|
181
180
|
onClick={() =>
|
|
182
181
|
watch.activeEditor.dispatchCommand(FORMAT_ELEMENT_COMMAND, "start")
|
|
183
182
|
}
|
|
@@ -192,18 +191,16 @@ export const ToolbarPlugin = () => {
|
|
|
192
191
|
/>
|
|
193
192
|
<ButtonWrapper
|
|
194
193
|
value="end"
|
|
195
|
-
rtlFlip
|
|
196
194
|
label={t("tool.alignEnd")}
|
|
197
|
-
icon={CoreIcons.alignRight}
|
|
195
|
+
icon={{ icon: CoreIcons.alignRight, rtlFlip: true }}
|
|
198
196
|
onClick={() =>
|
|
199
197
|
watch.activeEditor.dispatchCommand(FORMAT_ELEMENT_COMMAND, "end")
|
|
200
198
|
}
|
|
201
199
|
/>
|
|
202
200
|
<ButtonWrapper
|
|
203
201
|
value="justify"
|
|
204
|
-
rtlFlip
|
|
205
202
|
label={t("tool.alignJustify")}
|
|
206
|
-
icon={CoreIcons.alignJustify}
|
|
203
|
+
icon={{ icon: CoreIcons.alignJustify, rtlFlip: true }}
|
|
207
204
|
onClick={() =>
|
|
208
205
|
watch.activeEditor.dispatchCommand(
|
|
209
206
|
FORMAT_ELEMENT_COMMAND,
|
|
@@ -213,16 +210,14 @@ export const ToolbarPlugin = () => {
|
|
|
213
210
|
/>
|
|
214
211
|
<ButtonWrapper
|
|
215
212
|
value="justify"
|
|
216
|
-
rtlFlip
|
|
217
213
|
label={t("tool.indentOut")}
|
|
218
|
-
icon={CoreIcons.formatIndentDecrease}
|
|
214
|
+
icon={{ icon: CoreIcons.formatIndentDecrease, rtlFlip: true }}
|
|
219
215
|
onClick={() => watch.outdent()}
|
|
220
216
|
/>
|
|
221
217
|
<ButtonWrapper
|
|
222
218
|
value="justify"
|
|
223
|
-
rtlFlip
|
|
224
219
|
label={t("tool.identIn")}
|
|
225
|
-
icon={CoreIcons.formatIndentIncrease}
|
|
220
|
+
icon={{ icon: CoreIcons.formatIndentIncrease, rtlFlip: true }}
|
|
226
221
|
onClick={() => watch.indent()}
|
|
227
222
|
/>
|
|
228
223
|
</ButtonGroup>
|