@lobehub/editor 1.8.4 → 1.8.5

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.
@@ -142,10 +142,14 @@ var LinkEdit = /*#__PURE__*/memo(function (_ref) {
142
142
  }
143
143
  }, [linkNodeRef, linkInputRef, handleSubmit, handleCancel]);
144
144
  useEffect(function () {
145
- updatePosition({
146
- floating: divRef.current,
147
- reference: linkDom
148
- });
145
+ if (linkDom) {
146
+ updatePosition({
147
+ floating: divRef.current,
148
+ reference: linkDom
149
+ });
150
+ } else {
151
+ cleanPosition(divRef.current);
152
+ }
149
153
  }, [linkDom]);
150
154
 
151
155
  // 点击编辑器外部时关闭面板
@@ -190,6 +194,7 @@ var LinkEdit = /*#__PURE__*/memo(function (_ref) {
190
194
  return false;
191
195
  }, COMMAND_PRIORITY_NORMAL));
192
196
  }, []);
197
+ if (!linkNodeRef.current) return null;
193
198
  return /*#__PURE__*/_jsxs(Block, {
194
199
  className: styles.linkEdit,
195
200
  ref: divRef,
@@ -5,7 +5,7 @@ export var useStyles = createStyles(function (_ref) {
5
5
  var cx = _ref.cx,
6
6
  css = _ref.css,
7
7
  token = _ref.token;
8
- var position = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: absolute;\n z-index: 999;\n "])));
8
+ var position = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: absolute;\n z-index: 999;\n inset-block-start: -9999px;\n inset-inline-start: -9999px;\n "])));
9
9
  return {
10
10
  link: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n cursor: pointer;\n\n margin-block: 1em;\n margin-inline: 0;\n padding: 2px;\n border: none;\n "]))),
11
11
  linkEdit: cx(position, css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n min-width: 320px;\n max-width: 100%;\n background: ", ";\n "])), token.colorBgElevated)),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/editor",
3
- "version": "1.8.4",
3
+ "version": "1.8.5",
4
4
  "description": "A powerful and extensible rich text editor built on Meta's Lexical framework, providing a modern editing experience with React integration.",
5
5
  "keywords": [
6
6
  "lobehub",