onchain-lexical-instance 0.0.9 → 0.0.11
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/OnchainLexicalInstance.js +190 -44
- package/dist/OnchainLexicalInstance.mjs +186 -45
- package/package.json +5 -5
- package/src/bar/BarComponent.tsx +17 -6
- package/src/bar/styles.module.less +4 -1
- package/src/const.ts +6 -7
- package/src/image/index.tsx +289 -289
- package/src/index.ts +6 -0
- package/src/instancePlugin.ts +14 -3
- package/src/number/styles.module.less +1 -1
- package/src/paragraph/index.ts +215 -215
- package/src/paragraph/styles.module.less +42 -0
- package/src/paragraph/title.ts +25 -1
- package/src/parameters/index.tsx +92 -0
- package/src/parameters/parametersComponent.tsx +55 -0
- package/src/utils.ts +21 -11
|
@@ -20,6 +20,7 @@ var list = require('@lexical/list');
|
|
|
20
20
|
var selection = require('@lexical/selection');
|
|
21
21
|
var table = require('@lexical/table');
|
|
22
22
|
var useLexicalNodeSelection = require('@lexical/react/useLexicalNodeSelection');
|
|
23
|
+
var hooks = require('onchain-utility/hooks');
|
|
23
24
|
var richText = require('@lexical/rich-text');
|
|
24
25
|
var useLexicalEditable = require('@lexical/react/useLexicalEditable');
|
|
25
26
|
var EquationEditor = require('onchain-lexical-ui/EquationEditor');
|
|
@@ -89,9 +90,9 @@ function styleInject(css, ref) {
|
|
|
89
90
|
}
|
|
90
91
|
}
|
|
91
92
|
|
|
92
|
-
var css_248z$
|
|
93
|
-
var Styles$
|
|
94
|
-
styleInject(css_248z$
|
|
93
|
+
var css_248z$8 = ".base-module_instance__4TS7Q>p:first-of-type{word-wrap:normal;border-bottom:1px solid #d8d8d8;height:38px;line-height:38px;margin-bottom:4px}";
|
|
94
|
+
var Styles$8 = {"instance":"base-module_instance__4TS7Q"};
|
|
95
|
+
styleInject(css_248z$8);
|
|
95
96
|
|
|
96
97
|
/**
|
|
97
98
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
@@ -101,13 +102,6 @@ styleInject(css_248z$7);
|
|
|
101
102
|
*
|
|
102
103
|
*/
|
|
103
104
|
|
|
104
|
-
/**
|
|
105
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
106
|
-
*
|
|
107
|
-
* This source code is licensed under the MIT license found in the
|
|
108
|
-
* LICENSE file in the root directory of this source tree.
|
|
109
|
-
*
|
|
110
|
-
*/
|
|
111
105
|
let InstanceParagraphType = /*#__PURE__*/function (InstanceParagraphType) {
|
|
112
106
|
InstanceParagraphType[InstanceParagraphType["Title"] = 2] = "Title";
|
|
113
107
|
InstanceParagraphType[InstanceParagraphType["Description"] = 3] = "Description";
|
|
@@ -161,6 +155,9 @@ const COMPONENT_UPDATE = lexical.createCommand('COMPONENT_UPDATE');
|
|
|
161
155
|
/** 标题更新事件 */
|
|
162
156
|
const INSTANCE_TITLE_UPDATE = lexical.createCommand('INSTANCE_TITLE_UPDATE');
|
|
163
157
|
|
|
158
|
+
/** 参数更新 */
|
|
159
|
+
const PARAMETERS_UPDATE = lexical.createCommand('PARAMETERS_UPDATE');
|
|
160
|
+
|
|
164
161
|
/** 获取禁止编辑dom节点选择器 */
|
|
165
162
|
const DisableSelector = `[contenteditable='false']:not([ignorecontenteditable])`;
|
|
166
163
|
|
|
@@ -480,6 +477,10 @@ function $isPlaceholderDecoratorNode(node) {
|
|
|
480
477
|
return node instanceof PlaceholderDecoratorNode;
|
|
481
478
|
}
|
|
482
479
|
|
|
480
|
+
var css_248z$7 = ".styles-module_instance-title__Xh6UG{height:100%;overflow:hidden;padding-right:68px;text-overflow:ellipsis;white-space:nowrap}.styles-module_instance-title__Xh6UG.styles-module_title-hover__9nE-K{overflow:initial;white-space:normal}.styles-module_instance-title__Xh6UG.styles-module_title-hover__9nE-K>span:nth-of-type(2){background-color:#f9f9f9;border:1px solid #d8d8d8;border-top-color:transparent;display:inline-block;left:-5px;line-height:36px;min-height:100%;padding:0 4px;position:relative;z-index:1}.styles-module_instance-title__Xh6UG.styles-module_title-hover__9nE-K>span:nth-of-type(2):after,.styles-module_instance-title__Xh6UG.styles-module_title-hover__9nE-K>span:nth-of-type(2):before{background-color:#f9f9f9;content:\"\";display:inline-block;height:37px;pointer-events:none;position:absolute;top:-1px;width:5px;z-index:2}.styles-module_instance-title__Xh6UG.styles-module_title-hover__9nE-K>span:nth-of-type(2):before{left:-4px}.styles-module_instance-title__Xh6UG.styles-module_title-hover__9nE-K>span:nth-of-type(2):after{right:-4px}";
|
|
481
|
+
var Styles$7 = {"instance-title":"styles-module_instance-title__Xh6UG","title-hover":"styles-module_title-hover__9nE-K"};
|
|
482
|
+
styleInject(css_248z$7);
|
|
483
|
+
|
|
483
484
|
/**
|
|
484
485
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
485
486
|
*
|
|
@@ -555,7 +556,29 @@ class InstanceTitleNode extends InstanceHeadingNode {
|
|
|
555
556
|
}
|
|
556
557
|
createDOM(config) {
|
|
557
558
|
const element = super.createDOM(config);
|
|
559
|
+
element.classList.add(Styles$7['instance-title']);
|
|
558
560
|
setDisable(this, element);
|
|
561
|
+
element.onmousemove = function (event) {
|
|
562
|
+
const span = event.target;
|
|
563
|
+
if (span === element.querySelector(`span:nth-of-type(2)`)) {
|
|
564
|
+
const titleWidth = span.offsetWidth;
|
|
565
|
+
const headingWidth = element.offsetWidth;
|
|
566
|
+
const styles = element.computedStyleMap();
|
|
567
|
+
const paddingLeft = styles.get('padding-left') || {
|
|
568
|
+
value: 0
|
|
569
|
+
};
|
|
570
|
+
const paddingRight = styles.get('padding-right') || {
|
|
571
|
+
value: 0
|
|
572
|
+
};
|
|
573
|
+
const display = headingWidth - paddingRight.value - paddingLeft.value;
|
|
574
|
+
if (display <= titleWidth) {
|
|
575
|
+
element.classList.add(Styles$7['title-hover']);
|
|
576
|
+
span.onmouseout = function (event) {
|
|
577
|
+
element.classList.remove(Styles$7['title-hover']);
|
|
578
|
+
};
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
};
|
|
559
582
|
return element;
|
|
560
583
|
}
|
|
561
584
|
exportDOM(editor) {
|
|
@@ -830,6 +853,11 @@ function getLatestValue(data, key) {
|
|
|
830
853
|
}
|
|
831
854
|
return data[key];
|
|
832
855
|
}
|
|
856
|
+
|
|
857
|
+
/**
|
|
858
|
+
* 跳转到指定实例
|
|
859
|
+
* dom 属性 data-scrollTo=“false” 时可以禁止跳转
|
|
860
|
+
*/
|
|
833
861
|
function $scrollTo(number) {
|
|
834
862
|
const editor = lexical.$getEditor();
|
|
835
863
|
const nodeKey = numberNodeKey.get(number);
|
|
@@ -989,14 +1017,7 @@ function $updateRichInstanceContent(instance, {
|
|
|
989
1017
|
if ($isInstanceNode(insNode)) {
|
|
990
1018
|
const fragment = $createFragmentNode();
|
|
991
1019
|
onchainLexicalMarkdown.$textToRichNodes(fragment, content);
|
|
992
|
-
const nodes = fragment.getChildren();
|
|
993
|
-
const count = InstanceNode.DEFAULT_PARAGRAPHS - 1;
|
|
994
|
-
for (let index = 0; index < count; index++) {
|
|
995
|
-
const node = nodes[0];
|
|
996
|
-
if (!node /** || !$isInstanceParagraphNode(node) */) {
|
|
997
|
-
nodes.splice(index, 0, $createInstanceParagraphNode());
|
|
998
|
-
}
|
|
999
|
-
}
|
|
1020
|
+
const nodes = correctedInstanceParagraph(fragment.getChildren(), () => $createInstanceParagraphNode());
|
|
1000
1021
|
const oldChildren = insNode.getPracticalChildren().filter(node => !$isInstanceNode(node)).slice(1, Infinity);
|
|
1001
1022
|
const previous = oldChildren.at(0);
|
|
1002
1023
|
for (let index = nodes.length - 1; index > -1; index--) {
|
|
@@ -1051,7 +1072,7 @@ function useContentEditable() {
|
|
|
1051
1072
|
const selection = lexical.$getSelection();
|
|
1052
1073
|
if (selection) {
|
|
1053
1074
|
setContentEditable(!selection.getNodes().some(node => {
|
|
1054
|
-
return editor.getElementByKey(node.getKey())?.closest(DisableSelector);
|
|
1075
|
+
return editor.getElementByKey(node.getKey())?.closest(DisableSelector) || $isInInstanceTitleNode(node);
|
|
1055
1076
|
}));
|
|
1056
1077
|
}
|
|
1057
1078
|
}, [editor]);
|
|
@@ -1066,12 +1087,24 @@ function useContentEditable() {
|
|
|
1066
1087
|
};
|
|
1067
1088
|
}
|
|
1068
1089
|
|
|
1069
|
-
/**
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1090
|
+
/** 修正实例内行条目,避免过少段落导致左边操作栏位子不够 */
|
|
1091
|
+
function correctedInstanceParagraph(nodes, createParagraph) {
|
|
1092
|
+
const count = InstanceNode.DEFAULT_PARAGRAPHS - 1;
|
|
1093
|
+
for (let index = 0; index < count; index++) {
|
|
1094
|
+
const node = nodes[index];
|
|
1095
|
+
if (!node /** || !$isInstanceParagraphNode(node) */) {
|
|
1096
|
+
nodes.splice(index, 0, createParagraph());
|
|
1097
|
+
}
|
|
1098
|
+
}
|
|
1099
|
+
return nodes;
|
|
1100
|
+
}
|
|
1101
|
+
|
|
1102
|
+
/**
|
|
1103
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
1104
|
+
*
|
|
1105
|
+
* This source code is licensed under the MIT license found in the
|
|
1106
|
+
* LICENSE file in the root directory of this source tree.
|
|
1107
|
+
*
|
|
1075
1108
|
*/
|
|
1076
1109
|
|
|
1077
1110
|
class InstanceParagraphNode extends lexical.ParagraphNode {
|
|
@@ -1267,7 +1300,7 @@ const Number$1 = props => {
|
|
|
1267
1300
|
});
|
|
1268
1301
|
};
|
|
1269
1302
|
|
|
1270
|
-
var css_248z$6 = ".styles-module_instance-number__yIPpS{align-items:center;display:inline-flex;height:38px;justify-content:flex-start;left:0;position:absolute;top:0;user-select:none;z-index:2}.styles-module_instance-number__yIPpS>div>span:first-of-type{padding-right:4px}";
|
|
1303
|
+
var css_248z$6 = ".styles-module_instance-number__yIPpS{align-items:center;display:inline-flex;height:38px;justify-content:flex-start;left:0;position:absolute;top:0;user-select:none;z-index:2}.styles-module_instance-number__yIPpS>div>span:first-of-type:not(:empty){padding-right:4px}";
|
|
1271
1304
|
var Styles$6 = {"instance-number":"styles-module_instance-number__yIPpS"};
|
|
1272
1305
|
styleInject(css_248z$6);
|
|
1273
1306
|
|
|
@@ -1543,7 +1576,7 @@ class InstanceNode extends lexical.ElementNode {
|
|
|
1543
1576
|
|
|
1544
1577
|
createDOM(config) {
|
|
1545
1578
|
const dom = document.createElement('div');
|
|
1546
|
-
const classNames = [Styles$
|
|
1579
|
+
const classNames = [Styles$8.instance, 'rich-text-instance', getCachedClassNameArray(config.theme, 'instance') ?? []];
|
|
1547
1580
|
if (classNames !== undefined) {
|
|
1548
1581
|
const domClassList = dom.classList;
|
|
1549
1582
|
domClassList.add(...classNames.flat(1));
|
|
@@ -1777,8 +1810,8 @@ function isFixedAddress(instance) {
|
|
|
1777
1810
|
return !!instance && Object.keys(instance).length === 1 && typeof instance.value === 'object';
|
|
1778
1811
|
}
|
|
1779
1812
|
|
|
1780
|
-
var css_248z$5 = ".styles-module_left__CN0nC{align-items:center;display:flex;flex-direction:column;left:0;position:absolute;transform:translate(-26px);user-select:none;width:26px}.styles-module_left__CN0nC .styles-module_link__M-1Wq{margin-bottom:6px}.styles-module_left__CN0nC .styles-module_link__M-1Wq>button>span>div{position:relative}.styles-module_left__CN0nC .styles-module_link__M-1Wq>button>span>div>i{align-items:center;background-color:#0563b0;border-radius:50%;bottom:-2px;color:#fff;display:flex;font-size:10px;font-style:normal;height:12px;justify-content:center;position:absolute;right:-2px;width:12px}.styles-module_left__CN0nC .styles-module_hiddenLinkCount__ThNp5>button>span>div>i,.styles-module_left__CN0nC .styles-module_link__M-1Wq>button>span>div>i:empty{display:none}.styles-module_left__CN0nC>*{align-items:center;display:inline-flex;justify-content:center}.styles-module_left__CN0nC>span:first-of-type{height:38px}.styles-module_right__sxVYl{align-items:center;display:inline-flex;height:
|
|
1781
|
-
var Styles$5 = {"left":"styles-module_left__CN0nC","link":"styles-module_link__M-1Wq","hiddenLinkCount":"styles-module_hiddenLinkCount__ThNp5","right":"styles-module_right__sxVYl","selected":"styles-module_selected__dpCTX","hasChildren":"styles-module_hasChildren__FqxrJ","hover":"styles-module_hover__IeKlt"};
|
|
1813
|
+
var css_248z$5 = ".styles-module_left__CN0nC{align-items:center;display:flex;flex-direction:column;left:0;position:absolute;transform:translate(-26px);user-select:none;width:26px}.styles-module_left__CN0nC .styles-module_link__M-1Wq{margin-bottom:6px}.styles-module_left__CN0nC .styles-module_link__M-1Wq>button>span>div{position:relative}.styles-module_left__CN0nC .styles-module_link__M-1Wq>button>span>div>i{align-items:center;background-color:#0563b0;border-radius:50%;bottom:-2px;color:#fff;display:flex;font-size:10px;font-style:normal;height:12px;justify-content:center;position:absolute;right:-2px;width:12px}.styles-module_left__CN0nC .styles-module_hiddenLinkCount__ThNp5>button>span>div>i,.styles-module_left__CN0nC .styles-module_link__M-1Wq>button>span>div>i:empty{display:none}.styles-module_left__CN0nC>*{align-items:center;display:inline-flex;justify-content:center}.styles-module_left__CN0nC>span:first-of-type{height:38px}.styles-module_right__sxVYl{align-items:center;display:inline-flex;height:38px;justify-content:flex-end;position:absolute;right:0;top:0;user-select:none;z-index:2}.styles-module_right__sxVYl>span{cursor:pointer;margin-left:10px}.styles-module_hasChildren__FqxrJ,.styles-module_hover__IeKlt:hover,.styles-module_selected__dpCTX{color:#0563b0}.styles-module_empty__g2IcU{cursor:default!important}";
|
|
1814
|
+
var Styles$5 = {"left":"styles-module_left__CN0nC","link":"styles-module_link__M-1Wq","hiddenLinkCount":"styles-module_hiddenLinkCount__ThNp5","right":"styles-module_right__sxVYl","selected":"styles-module_selected__dpCTX","hasChildren":"styles-module_hasChildren__FqxrJ","hover":"styles-module_hover__IeKlt","empty":"styles-module_empty__g2IcU"};
|
|
1782
1815
|
styleInject(css_248z$5);
|
|
1783
1816
|
|
|
1784
1817
|
/**
|
|
@@ -1885,6 +1918,8 @@ const Bar = props => {
|
|
|
1885
1918
|
return true;
|
|
1886
1919
|
}, lexical.COMMAND_PRIORITY_EDITOR));
|
|
1887
1920
|
}, []);
|
|
1921
|
+
const trackLinkCount = instance?.trackLinkCount || 0;
|
|
1922
|
+
const isTemporarilyCreated = instance?.isCustom && instance?.dataType === 'add';
|
|
1888
1923
|
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
1889
1924
|
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1890
1925
|
"data-bar": "left",
|
|
@@ -1898,20 +1933,22 @@ const Bar = props => {
|
|
|
1898
1933
|
children: /*#__PURE__*/jsxRuntime.jsx(DropDown, {
|
|
1899
1934
|
arrow: true,
|
|
1900
1935
|
showIcon: false,
|
|
1901
|
-
disabled: !
|
|
1936
|
+
disabled: !trackLinkCount,
|
|
1902
1937
|
stopCloseOnClickSelf: true,
|
|
1903
|
-
buttonLabel:
|
|
1904
|
-
/*#__PURE__*/
|
|
1905
|
-
// [TODO] 显示 trackLinkCount
|
|
1906
|
-
jsxRuntime.jsxs("div", {
|
|
1938
|
+
buttonLabel: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1907
1939
|
children: [/*#__PURE__*/jsxRuntime.jsx("i", {
|
|
1908
|
-
children:
|
|
1940
|
+
children: trackLinkCount || ''
|
|
1909
1941
|
}), /*#__PURE__*/jsxRuntime.jsx(Icon.StaticIcon, {
|
|
1910
|
-
className: `${Styles$5.hover}`,
|
|
1942
|
+
className: `${trackLinkCount ? Styles$5.hover : Styles$5.empty}`,
|
|
1911
1943
|
type: "icon-front-link1"
|
|
1912
1944
|
})]
|
|
1913
1945
|
}),
|
|
1914
1946
|
onOpen: setOpen,
|
|
1947
|
+
isItClosed: ({
|
|
1948
|
+
listQuantity
|
|
1949
|
+
}) => {
|
|
1950
|
+
return listQuantity === '1';
|
|
1951
|
+
},
|
|
1915
1952
|
children: Components.TrackLinkList && instance ? /*#__PURE__*/jsxRuntime.jsx(Components.TrackLinkList, {
|
|
1916
1953
|
number: instance.number
|
|
1917
1954
|
}) : null
|
|
@@ -1942,7 +1979,7 @@ const Bar = props => {
|
|
|
1942
1979
|
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1943
1980
|
"data-bar": "right",
|
|
1944
1981
|
className: Styles$5.right,
|
|
1945
|
-
children: [!preview && extra.showRightToolbar !== false ? /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
1982
|
+
children: [!preview && extra.showRightToolbar !== false && !isTemporarilyCreated ? /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
1946
1983
|
children: instance?.checkOut ? /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
1947
1984
|
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
1948
1985
|
title: onchainUtility.translateI18n('[TODO] 国际化', {
|
|
@@ -22261,12 +22298,12 @@ function $isKeywordNode(node) {
|
|
|
22261
22298
|
return node instanceof KeywordNode;
|
|
22262
22299
|
}
|
|
22263
22300
|
|
|
22264
|
-
/**
|
|
22265
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
22266
|
-
*
|
|
22267
|
-
* This source code is licensed under the MIT license found in the
|
|
22268
|
-
* LICENSE file in the root directory of this source tree.
|
|
22269
|
-
*
|
|
22301
|
+
/**
|
|
22302
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
22303
|
+
*
|
|
22304
|
+
* This source code is licensed under the MIT license found in the
|
|
22305
|
+
* LICENSE file in the root directory of this source tree.
|
|
22306
|
+
*
|
|
22270
22307
|
*/
|
|
22271
22308
|
|
|
22272
22309
|
const ImageComponent$2 = /*#__PURE__*/React__namespace.lazy(() => Promise.resolve().then(function () { return ImageComponent$1; }));
|
|
@@ -23761,7 +23798,8 @@ const InstancePlugin = props => {
|
|
|
23761
23798
|
const node = $createTitleOnlyInstanceNode(instance);
|
|
23762
23799
|
const fragment = $createFragmentNode();
|
|
23763
23800
|
onchainLexicalMarkdown.$textToRichNodes(fragment, contentText);
|
|
23764
|
-
|
|
23801
|
+
const nodes = correctedInstanceParagraph(fragment.getChildren(), () => $createInstanceParagraphNode());
|
|
23802
|
+
node.append(...nodes);
|
|
23765
23803
|
return node;
|
|
23766
23804
|
} else {
|
|
23767
23805
|
return $createInstanceNode(instance);
|
|
@@ -24029,6 +24067,109 @@ function $isPageBreakNode(node) {
|
|
|
24029
24067
|
return node instanceof PageBreakNode;
|
|
24030
24068
|
}
|
|
24031
24069
|
|
|
24070
|
+
/**
|
|
24071
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
24072
|
+
*
|
|
24073
|
+
* This source code is licensed under the MIT license found in the
|
|
24074
|
+
* LICENSE file in the root directory of this source tree.
|
|
24075
|
+
*
|
|
24076
|
+
*/
|
|
24077
|
+
|
|
24078
|
+
const ParametersComponent = ({
|
|
24079
|
+
nodeKey
|
|
24080
|
+
}) => {
|
|
24081
|
+
const [editor] = LexicalComposerContext.useLexicalComposerContext();
|
|
24082
|
+
const [parameters, setParameters,, latestParameters] = hooks.useStore({
|
|
24083
|
+
number: '',
|
|
24084
|
+
value: ''
|
|
24085
|
+
});
|
|
24086
|
+
React.useEffect(() => {
|
|
24087
|
+
editor.read(() => {
|
|
24088
|
+
const node = lexical.$getNodeByKey(nodeKey);
|
|
24089
|
+
if ($isParametersNode(node)) {
|
|
24090
|
+
setParameters(node.__parameters);
|
|
24091
|
+
}
|
|
24092
|
+
});
|
|
24093
|
+
return utils$1.mergeRegister(editor.registerCommand(PARAMETERS_UPDATE, ({
|
|
24094
|
+
number,
|
|
24095
|
+
value
|
|
24096
|
+
}) => {
|
|
24097
|
+
const latest = latestParameters.current;
|
|
24098
|
+
if (number !== latest.number) {
|
|
24099
|
+
return false;
|
|
24100
|
+
}
|
|
24101
|
+
const node = lexical.$getNodeByKey(nodeKey);
|
|
24102
|
+
if ($isParametersNode(node)) {
|
|
24103
|
+
setParameters({
|
|
24104
|
+
value
|
|
24105
|
+
});
|
|
24106
|
+
Object.assign(node.__parameters, {
|
|
24107
|
+
value
|
|
24108
|
+
});
|
|
24109
|
+
}
|
|
24110
|
+
return true;
|
|
24111
|
+
}, lexical.COMMAND_PRIORITY_EDITOR));
|
|
24112
|
+
}, []);
|
|
24113
|
+
return /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
24114
|
+
children: parameters.value
|
|
24115
|
+
});
|
|
24116
|
+
};
|
|
24117
|
+
|
|
24118
|
+
/**
|
|
24119
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
24120
|
+
*
|
|
24121
|
+
* This source code is licensed under the MIT license found in the
|
|
24122
|
+
* LICENSE file in the root directory of this source tree.
|
|
24123
|
+
*
|
|
24124
|
+
*/
|
|
24125
|
+
|
|
24126
|
+
class ParametersNode extends lexical.TextDecoratorNode {
|
|
24127
|
+
static getType() {
|
|
24128
|
+
return 'Parameters';
|
|
24129
|
+
}
|
|
24130
|
+
static clone(node) {
|
|
24131
|
+
return new ParametersNode(node.__parameters, node.__key);
|
|
24132
|
+
}
|
|
24133
|
+
static importJSON(serializedNode) {
|
|
24134
|
+
return $createParametersNode(serializedNode.parameters).updateFromJSON(serializedNode);
|
|
24135
|
+
}
|
|
24136
|
+
constructor(number, key) {
|
|
24137
|
+
super(key);
|
|
24138
|
+
this.__parameters = number;
|
|
24139
|
+
}
|
|
24140
|
+
exportJSON() {
|
|
24141
|
+
return {
|
|
24142
|
+
...super.exportJSON(),
|
|
24143
|
+
parameters: this.__parameters
|
|
24144
|
+
};
|
|
24145
|
+
}
|
|
24146
|
+
createDOM(config, editor) {
|
|
24147
|
+
const span = super.createDOM(config, editor);
|
|
24148
|
+
span.setAttribute('ignorecontenteditable', '');
|
|
24149
|
+
return span;
|
|
24150
|
+
}
|
|
24151
|
+
updateDOM(prevNode, dom, config) {
|
|
24152
|
+
return super.updateDOM(prevNode, dom, config);
|
|
24153
|
+
}
|
|
24154
|
+
collapseAtStart() {
|
|
24155
|
+
return true;
|
|
24156
|
+
}
|
|
24157
|
+
isInline() {
|
|
24158
|
+
return true;
|
|
24159
|
+
}
|
|
24160
|
+
decorate(editor, config) {
|
|
24161
|
+
return /*#__PURE__*/jsxRuntime.jsx(ParametersComponent, {
|
|
24162
|
+
nodeKey: this.getKey()
|
|
24163
|
+
});
|
|
24164
|
+
}
|
|
24165
|
+
}
|
|
24166
|
+
function $createParametersNode(parameters) {
|
|
24167
|
+
return lexical.$applyNodeReplacement(new ParametersNode(parameters));
|
|
24168
|
+
}
|
|
24169
|
+
function $isParametersNode(node) {
|
|
24170
|
+
return node instanceof ParametersNode;
|
|
24171
|
+
}
|
|
24172
|
+
|
|
24032
24173
|
/**
|
|
24033
24174
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
24034
24175
|
*
|
|
@@ -25075,6 +25216,7 @@ exports.$createInternalLinkNode = $createInternalLinkNode;
|
|
|
25075
25216
|
exports.$createKeywordNode = $createKeywordNode;
|
|
25076
25217
|
exports.$createNumberDecoratorNode = $createNumberDecoratorNode;
|
|
25077
25218
|
exports.$createPageBreakNode = $createPageBreakNode;
|
|
25219
|
+
exports.$createParametersNode = $createParametersNode;
|
|
25078
25220
|
exports.$createPlaceholderDecoratorNode = $createPlaceholderDecoratorNode;
|
|
25079
25221
|
exports.$createTitleOnlyInstanceNode = $createTitleOnlyInstanceNode;
|
|
25080
25222
|
exports.$findNearestListItemNode = $findNearestListItemNode;
|
|
@@ -25117,6 +25259,7 @@ exports.$isKeywordNode = $isKeywordNode;
|
|
|
25117
25259
|
exports.$isLastItemInList = $isLastItemInList;
|
|
25118
25260
|
exports.$isNumberDecoratorNode = $isNumberDecoratorNode;
|
|
25119
25261
|
exports.$isPageBreakNode = $isPageBreakNode;
|
|
25262
|
+
exports.$isParametersNode = $isParametersNode;
|
|
25120
25263
|
exports.$isPlaceholderDecoratorNode = $isPlaceholderDecoratorNode;
|
|
25121
25264
|
exports.$isRemoved = $isRemoved;
|
|
25122
25265
|
exports.$isSelectedTitleNode = $isSelectedTitleNode;
|
|
@@ -25163,9 +25306,12 @@ exports.InternalLinkNode = InternalLinkNode;
|
|
|
25163
25306
|
exports.KeywordNode = KeywordNode;
|
|
25164
25307
|
exports.NumberDecoratorNode = NumberDecoratorNode;
|
|
25165
25308
|
exports.OPEN_CREATE_WINDOW = OPEN_CREATE_WINDOW;
|
|
25309
|
+
exports.PARAMETERS_UPDATE = PARAMETERS_UPDATE;
|
|
25166
25310
|
exports.PageBreakNode = PageBreakNode;
|
|
25311
|
+
exports.ParametersNode = ParametersNode;
|
|
25167
25312
|
exports.PlaceholderDecoratorNode = PlaceholderDecoratorNode;
|
|
25168
25313
|
exports.clearCache = clearCache;
|
|
25314
|
+
exports.correctedInstanceParagraph = correctedInstanceParagraph;
|
|
25169
25315
|
exports.fixedAddress = fixedAddress;
|
|
25170
25316
|
exports.getCachedClassNameArray = getCachedClassNameArray;
|
|
25171
25317
|
exports.getCodeLanguages = getCodeLanguages;
|