@haklex/rich-plugin-block-handle 0.62.1 → 0.63.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.
@@ -1 +1 @@
1
- {"version":3,"file":"BlockHandlePlugin.d.ts","sourceRoot":"","sources":["../src/BlockHandlePlugin.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAiC,YAAY,EAAE,MAAM,OAAO,CAAC;AAmtBzE,wBAAgB,iBAAiB,IAAI,YAAY,CAGhD"}
1
+ {"version":3,"file":"BlockHandlePlugin.d.ts","sourceRoot":"","sources":["../src/BlockHandlePlugin.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAiC,YAAY,EAAE,MAAM,OAAO,CAAC;AAotBzE,wBAAgB,iBAAiB,IAAI,YAAY,CAGhD"}
package/dist/index.mjs CHANGED
@@ -1277,14 +1277,16 @@ function BlockHandleInner({ editor }) {
1277
1277
  const node = $getNearestNodeFromDOMNode(element);
1278
1278
  if (node) nodeKey = node.getKey();
1279
1279
  });
1280
- setHandle({
1280
+ const top = handleTop({
1281
+ top: page.top,
1282
+ paddingTop: Number.parseFloat(computed.paddingTop) || 0,
1283
+ lineHeight: parseLineHeight(computed.lineHeight, computed.fontSize)
1284
+ }, GRIP_HEIGHT);
1285
+ const left = toPagePosition(rootRect).left - GUTTER_INSET;
1286
+ setHandle((state) => state.visible && state.top === top && state.left === left && state.nodeKey === nodeKey ? state : {
1281
1287
  visible: true,
1282
- top: handleTop({
1283
- top: page.top,
1284
- paddingTop: Number.parseFloat(computed.paddingTop) || 0,
1285
- lineHeight: parseLineHeight(computed.lineHeight, computed.fontSize)
1286
- }, GRIP_HEIGHT),
1287
- left: toPagePosition(rootRect).left - GUTTER_INSET,
1288
+ top,
1289
+ left,
1288
1290
  nodeKey
1289
1291
  });
1290
1292
  }, [editor]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haklex/rich-plugin-block-handle",
3
- "version": "0.62.1",
3
+ "version": "0.63.0",
4
4
  "description": "Block handle plugin with add button and context menu",
5
5
  "repository": {
6
6
  "type": "git",
@@ -42,9 +42,9 @@
42
42
  "vite": "^8.3.5"
43
43
  },
44
44
  "peerDependencies": {
45
- "@haklex/rich-editor": "^0.62.1",
46
- "@haklex/rich-editor-ui": "^0.62.1",
47
- "@haklex/rich-style-token": "^0.62.1",
45
+ "@haklex/rich-editor": "^0.63.0",
46
+ "@haklex/rich-editor-ui": "^0.63.0",
47
+ "@haklex/rich-style-token": "^0.63.0",
48
48
  "@lexical/html": "^0.53.0",
49
49
  "@lexical/list": "^0.53.0",
50
50
  "@lexical/react": "^0.53.0",