@astryx-vue/richtext 0.7.7 → 0.7.8
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/index.js +9 -3
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1185,7 +1185,8 @@ isReadOnly: {
|
|
|
1185
1185
|
});
|
|
1186
1186
|
onBeforeUnmount(() => stopEditing?.());
|
|
1187
1187
|
const placements = useOverlayPlacements(editor, (origin) => {
|
|
1188
|
-
|
|
1188
|
+
const root = editor.getRootElement();
|
|
1189
|
+
if (root === null) return [];
|
|
1189
1190
|
return $bulletItems().flatMap(({ item, task }) => {
|
|
1190
1191
|
const element = editor.getElementByKey(item.getKey());
|
|
1191
1192
|
if (element === null) return [];
|
|
@@ -1202,12 +1203,17 @@ isReadOnly: {
|
|
|
1202
1203
|
const box = element.getBoundingClientRect();
|
|
1203
1204
|
const style = getComputedStyle(element);
|
|
1204
1205
|
const isRtl = style.direction === "rtl";
|
|
1206
|
+
const container = root.parentElement;
|
|
1207
|
+
const scaleX = container != null && container.offsetWidth > 0 ? origin.width / container.offsetWidth : 1;
|
|
1208
|
+
const scaleY = container != null && container.offsetHeight > 0 ? origin.height / container.offsetHeight : 1;
|
|
1209
|
+
const safeScaleX = scaleX > 0 ? scaleX : 1;
|
|
1210
|
+
const safeScaleY = scaleY > 0 ? scaleY : 1;
|
|
1205
1211
|
return [{
|
|
1206
1212
|
key: item.getKey(),
|
|
1207
1213
|
checked: task === "checked",
|
|
1208
1214
|
label: item.getTextContent(),
|
|
1209
|
-
top: box.top - origin.top + Number.parseFloat(style.paddingTop || "0"),
|
|
1210
|
-
left:
|
|
1215
|
+
top: (box.top - origin.top) / safeScaleY + Number.parseFloat(style.paddingTop || "0"),
|
|
1216
|
+
left: isRtl ? (box.right - origin.left) / safeScaleX - CHECKBOX_SIZE : (box.left - origin.left) / safeScaleX
|
|
1211
1217
|
}];
|
|
1212
1218
|
});
|
|
1213
1219
|
}, samePlacements);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astryx-vue/richtext",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.7.
|
|
4
|
+
"version": "0.7.8",
|
|
5
5
|
"description": "Astryx rich text for Vue — Lexical nodes and lossless Markdown import/export. Not affiliated with Meta.",
|
|
6
6
|
"author": "ShenQingchuan",
|
|
7
7
|
"license": "MIT",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"@lexical/utils": "0.52.0",
|
|
67
67
|
"lexical": "0.52.0",
|
|
68
68
|
"vue": "^3.5.0",
|
|
69
|
-
"@astryx-vue/core": "^0.7.
|
|
69
|
+
"@astryx-vue/core": "^0.7.8"
|
|
70
70
|
},
|
|
71
71
|
"peerDependenciesMeta": {
|
|
72
72
|
"@lexical/code": {
|
|
@@ -130,7 +130,7 @@
|
|
|
130
130
|
"unplugin-vue": "8.0.0",
|
|
131
131
|
"vue": "3.5.43",
|
|
132
132
|
"vue-tsc": "3.3.12",
|
|
133
|
-
"@astryx-vue/core": "^0.7.
|
|
133
|
+
"@astryx-vue/core": "^0.7.8"
|
|
134
134
|
},
|
|
135
135
|
"publishConfig": {
|
|
136
136
|
"access": "public"
|