@ones-editor/editor 0.0.7-beta.28 → 0.0.7-beta.29
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/@ones-editor/tsconfig.tsbuildinfo +1 -1
- package/dist/index.js +18 -14
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3133,6 +3133,9 @@ div.editor-root.readonly div.editor-content div[data-type=editor-block] > [data-
|
|
|
3133
3133
|
min-height: inherit;
|
|
3134
3134
|
overflow: hidden;
|
|
3135
3135
|
}
|
|
3136
|
+
.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image] [data-type=block-content] .images .image-container:first-child:last-child {
|
|
3137
|
+
height: 100%;
|
|
3138
|
+
}
|
|
3136
3139
|
.editor-root div.editor-content div[data-type=editor-container] .embed-block[data-type=editor-block][data-embed-type=image] [data-type=block-content] .images .image-container img {
|
|
3137
3140
|
max-width: 100%;
|
|
3138
3141
|
width: 100%;
|
|
@@ -49130,13 +49133,7 @@ ${codeText}
|
|
|
49130
49133
|
if (typeof flex === "string") {
|
|
49131
49134
|
flex = Number.parseInt(flex, 10);
|
|
49132
49135
|
}
|
|
49133
|
-
|
|
49134
|
-
return { src: src2, width, height, flex, virtualSize: false };
|
|
49135
|
-
}
|
|
49136
|
-
if (width && !height) {
|
|
49137
|
-
return { src: src2, width, height: "auto", flex, virtualSize: false };
|
|
49138
|
-
}
|
|
49139
|
-
return { src: src2, width: "auto", height: "auto", flex, virtualSize: true };
|
|
49136
|
+
return { src: src2, width: width != null ? width : "auto", height: height != null ? height : "auto", flex, virtualSize: !width || !height };
|
|
49140
49137
|
};
|
|
49141
49138
|
let images = [];
|
|
49142
49139
|
const src = data.src;
|
|
@@ -49183,14 +49180,14 @@ ${codeText}
|
|
|
49183
49180
|
widthPercent
|
|
49184
49181
|
};
|
|
49185
49182
|
images.forEach((image, index2) => {
|
|
49186
|
-
|
|
49187
|
-
|
|
49188
|
-
|
|
49183
|
+
const src2 = image.src || `empty:${index2}`;
|
|
49184
|
+
const widthKey = getImageWidthKeyFromSrc(src2);
|
|
49185
|
+
if (widthKey && typeof image.width === "number") {
|
|
49189
49186
|
result[widthKey] = image.width;
|
|
49190
|
-
|
|
49191
|
-
|
|
49192
|
-
|
|
49193
|
-
|
|
49187
|
+
}
|
|
49188
|
+
const heightKey = getImageHeightKeyFromSrc(src2);
|
|
49189
|
+
if (heightKey && typeof image.height === "number") {
|
|
49190
|
+
result[heightKey] = image.height;
|
|
49194
49191
|
}
|
|
49195
49192
|
assert(logger$13, image.flex, "no image flex");
|
|
49196
49193
|
const flexKey = getImageFlexKeyFromSrc(index2);
|
|
@@ -49209,6 +49206,11 @@ ${codeText}
|
|
|
49209
49206
|
}
|
|
49210
49207
|
const widthPercent = getWidthPercent(imageData);
|
|
49211
49208
|
if (!widthPercent) {
|
|
49209
|
+
if (images.length === 1) {
|
|
49210
|
+
const image = images[0];
|
|
49211
|
+
const imageHeight = image.height;
|
|
49212
|
+
return imageHeight === "auto" ? "auto" : `${imageHeight}px`;
|
|
49213
|
+
}
|
|
49212
49214
|
return "";
|
|
49213
49215
|
}
|
|
49214
49216
|
let totalWidth = parentContainer.getBoundingClientRect().width * (widthPercent / 100);
|
|
@@ -50014,6 +50016,8 @@ ${codeText}
|
|
|
50014
50016
|
if (!this.autoFix) {
|
|
50015
50017
|
this.setAutoFix(true);
|
|
50016
50018
|
}
|
|
50019
|
+
const container = block.querySelector(".images");
|
|
50020
|
+
container.style.height = "";
|
|
50017
50021
|
const rootContainer = this.editor.rootContainer;
|
|
50018
50022
|
const totalWidth = rootContainer.getBoundingClientRect().width;
|
|
50019
50023
|
const blockRect = block.getBoundingClientRect();
|