@univerjs/engine-render 1.0.0-insiders.20260717-1e84621 → 1.0.0-insiders.20260720-e1e8f51
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/lib/cjs/index.js
CHANGED
|
@@ -21291,6 +21291,12 @@ var DocComponent = class extends RenderComponent {
|
|
|
21291
21291
|
_defineProperty(this, "pageMarginLeft", 0);
|
|
21292
21292
|
_defineProperty(this, "pageMarginTop", 0);
|
|
21293
21293
|
_defineProperty(this, "pageLayoutType", 0);
|
|
21294
|
+
_defineProperty(this, "onTextFillImageLoaded", void 0);
|
|
21295
|
+
this.onTextFillImageLoaded = () => {
|
|
21296
|
+
var _config$onTextFillIma;
|
|
21297
|
+
this.makeDirty(true);
|
|
21298
|
+
config === null || config === void 0 || (_config$onTextFillIma = config.onTextFillImageLoaded) === null || _config$onTextFillIma === void 0 || _config$onTextFillIma.call(config);
|
|
21299
|
+
};
|
|
21294
21300
|
this._setConfig(config);
|
|
21295
21301
|
}
|
|
21296
21302
|
getSkeleton() {
|
|
@@ -23684,6 +23690,7 @@ var FontAndBaseLine = class extends docExtension {
|
|
|
23684
23690
|
{}
|
|
23685
23691
|
);
|
|
23686
23692
|
_defineProperty(this, "_textFillImageCache", /* @__PURE__ */ new Map());
|
|
23693
|
+
_defineProperty(this, "_textFillImageLoadListeners", /* @__PURE__ */ new Map());
|
|
23687
23694
|
}
|
|
23688
23695
|
draw(ctx, _parentScale, glyph, _, _more) {
|
|
23689
23696
|
var _glyph$parent;
|
|
@@ -23809,10 +23816,32 @@ var FontAndBaseLine = class extends docExtension {
|
|
|
23809
23816
|
return pattern;
|
|
23810
23817
|
}
|
|
23811
23818
|
_getTextFillImage(source) {
|
|
23819
|
+
var _this$parent;
|
|
23820
|
+
const onTextFillImageLoaded = (_this$parent = this.parent) === null || _this$parent === void 0 ? void 0 : _this$parent.onTextFillImageLoaded;
|
|
23812
23821
|
const cached = this._textFillImageCache.get(source);
|
|
23813
|
-
if (cached)
|
|
23822
|
+
if (cached) {
|
|
23823
|
+
if (!cached.complete && onTextFillImageLoaded) {
|
|
23824
|
+
var _this$_textFillImageL;
|
|
23825
|
+
(_this$_textFillImageL = this._textFillImageLoadListeners.get(source)) === null || _this$_textFillImageL === void 0 || _this$_textFillImageL.add(onTextFillImageLoaded);
|
|
23826
|
+
}
|
|
23827
|
+
return cached;
|
|
23828
|
+
}
|
|
23814
23829
|
const image = new Image();
|
|
23815
|
-
|
|
23830
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
23831
|
+
if (onTextFillImageLoaded) listeners.add(onTextFillImageLoaded);
|
|
23832
|
+
this._textFillImageLoadListeners.set(source, listeners);
|
|
23833
|
+
image.onload = () => {
|
|
23834
|
+
image.onload = null;
|
|
23835
|
+
image.onerror = null;
|
|
23836
|
+
const loadListeners = this._textFillImageLoadListeners.get(source);
|
|
23837
|
+
this._textFillImageLoadListeners.delete(source);
|
|
23838
|
+
loadListeners === null || loadListeners === void 0 || loadListeners.forEach((listener) => listener());
|
|
23839
|
+
};
|
|
23840
|
+
image.onerror = () => {
|
|
23841
|
+
image.onload = null;
|
|
23842
|
+
image.onerror = null;
|
|
23843
|
+
this._textFillImageLoadListeners.delete(source);
|
|
23844
|
+
};
|
|
23816
23845
|
image.src = source;
|
|
23817
23846
|
this._textFillImageCache.set(source, image);
|
|
23818
23847
|
return image.complete ? image : null;
|
|
@@ -27573,7 +27602,7 @@ Engine = __decorate([__decorateParam(2, ICanvasColorService)], Engine);
|
|
|
27573
27602
|
//#endregion
|
|
27574
27603
|
//#region package.json
|
|
27575
27604
|
var name = "@univerjs/engine-render";
|
|
27576
|
-
var version = "1.0.0-insiders.
|
|
27605
|
+
var version = "1.0.0-insiders.20260720-e1e8f51";
|
|
27577
27606
|
|
|
27578
27607
|
//#endregion
|
|
27579
27608
|
//#region src/config/config.ts
|
|
@@ -28846,6 +28875,7 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
28846
28875
|
_recoverySizeBoundary(selectedObjects, ancestorLeft, ancestorTop, topSceneWidth, topSceneHeight) {
|
|
28847
28876
|
for (let i = 0; i < selectedObjects.length; i++) {
|
|
28848
28877
|
const moveObject = selectedObjects[i];
|
|
28878
|
+
if (this._getConfig(moveObject).moveBoundaryEnabled === false) continue;
|
|
28849
28879
|
const { left, top, width, height } = moveObject;
|
|
28850
28880
|
const newTransform = {};
|
|
28851
28881
|
if (left + ancestorLeft < this.zeroLeft) {
|
package/lib/es/index.js
CHANGED
|
@@ -21290,6 +21290,12 @@ var DocComponent = class extends RenderComponent {
|
|
|
21290
21290
|
_defineProperty(this, "pageMarginLeft", 0);
|
|
21291
21291
|
_defineProperty(this, "pageMarginTop", 0);
|
|
21292
21292
|
_defineProperty(this, "pageLayoutType", 0);
|
|
21293
|
+
_defineProperty(this, "onTextFillImageLoaded", void 0);
|
|
21294
|
+
this.onTextFillImageLoaded = () => {
|
|
21295
|
+
var _config$onTextFillIma;
|
|
21296
|
+
this.makeDirty(true);
|
|
21297
|
+
config === null || config === void 0 || (_config$onTextFillIma = config.onTextFillImageLoaded) === null || _config$onTextFillIma === void 0 || _config$onTextFillIma.call(config);
|
|
21298
|
+
};
|
|
21293
21299
|
this._setConfig(config);
|
|
21294
21300
|
}
|
|
21295
21301
|
getSkeleton() {
|
|
@@ -23683,6 +23689,7 @@ var FontAndBaseLine = class extends docExtension {
|
|
|
23683
23689
|
{}
|
|
23684
23690
|
);
|
|
23685
23691
|
_defineProperty(this, "_textFillImageCache", /* @__PURE__ */ new Map());
|
|
23692
|
+
_defineProperty(this, "_textFillImageLoadListeners", /* @__PURE__ */ new Map());
|
|
23686
23693
|
}
|
|
23687
23694
|
draw(ctx, _parentScale, glyph, _, _more) {
|
|
23688
23695
|
var _glyph$parent;
|
|
@@ -23808,10 +23815,32 @@ var FontAndBaseLine = class extends docExtension {
|
|
|
23808
23815
|
return pattern;
|
|
23809
23816
|
}
|
|
23810
23817
|
_getTextFillImage(source) {
|
|
23818
|
+
var _this$parent;
|
|
23819
|
+
const onTextFillImageLoaded = (_this$parent = this.parent) === null || _this$parent === void 0 ? void 0 : _this$parent.onTextFillImageLoaded;
|
|
23811
23820
|
const cached = this._textFillImageCache.get(source);
|
|
23812
|
-
if (cached)
|
|
23821
|
+
if (cached) {
|
|
23822
|
+
if (!cached.complete && onTextFillImageLoaded) {
|
|
23823
|
+
var _this$_textFillImageL;
|
|
23824
|
+
(_this$_textFillImageL = this._textFillImageLoadListeners.get(source)) === null || _this$_textFillImageL === void 0 || _this$_textFillImageL.add(onTextFillImageLoaded);
|
|
23825
|
+
}
|
|
23826
|
+
return cached;
|
|
23827
|
+
}
|
|
23813
23828
|
const image = new Image();
|
|
23814
|
-
|
|
23829
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
23830
|
+
if (onTextFillImageLoaded) listeners.add(onTextFillImageLoaded);
|
|
23831
|
+
this._textFillImageLoadListeners.set(source, listeners);
|
|
23832
|
+
image.onload = () => {
|
|
23833
|
+
image.onload = null;
|
|
23834
|
+
image.onerror = null;
|
|
23835
|
+
const loadListeners = this._textFillImageLoadListeners.get(source);
|
|
23836
|
+
this._textFillImageLoadListeners.delete(source);
|
|
23837
|
+
loadListeners === null || loadListeners === void 0 || loadListeners.forEach((listener) => listener());
|
|
23838
|
+
};
|
|
23839
|
+
image.onerror = () => {
|
|
23840
|
+
image.onload = null;
|
|
23841
|
+
image.onerror = null;
|
|
23842
|
+
this._textFillImageLoadListeners.delete(source);
|
|
23843
|
+
};
|
|
23815
23844
|
image.src = source;
|
|
23816
23845
|
this._textFillImageCache.set(source, image);
|
|
23817
23846
|
return image.complete ? image : null;
|
|
@@ -27572,7 +27601,7 @@ Engine = __decorate([__decorateParam(2, ICanvasColorService)], Engine);
|
|
|
27572
27601
|
//#endregion
|
|
27573
27602
|
//#region package.json
|
|
27574
27603
|
var name = "@univerjs/engine-render";
|
|
27575
|
-
var version = "1.0.0-insiders.
|
|
27604
|
+
var version = "1.0.0-insiders.20260720-e1e8f51";
|
|
27576
27605
|
|
|
27577
27606
|
//#endregion
|
|
27578
27607
|
//#region src/config/config.ts
|
|
@@ -28845,6 +28874,7 @@ var Transformer = class extends Disposable {
|
|
|
28845
28874
|
_recoverySizeBoundary(selectedObjects, ancestorLeft, ancestorTop, topSceneWidth, topSceneHeight) {
|
|
28846
28875
|
for (let i = 0; i < selectedObjects.length; i++) {
|
|
28847
28876
|
const moveObject = selectedObjects[i];
|
|
28877
|
+
if (this._getConfig(moveObject).moveBoundaryEnabled === false) continue;
|
|
28848
28878
|
const { left, top, width, height } = moveObject;
|
|
28849
28879
|
const newTransform = {};
|
|
28850
28880
|
if (left + ancestorLeft < this.zeroLeft) {
|
|
@@ -31,12 +31,15 @@ export interface IDocumentsConfig extends IPageMarginLayout {
|
|
|
31
31
|
pageFillColor?: string;
|
|
32
32
|
pageStrokeColor?: string;
|
|
33
33
|
marginStrokeColor?: string;
|
|
34
|
+
/** Called after an image used by a text fill finishes loading. */
|
|
35
|
+
onTextFillImageLoaded?: () => void;
|
|
34
36
|
}
|
|
35
37
|
export declare abstract class DocComponent extends RenderComponent<IDocumentSkeletonGlyph | IDocumentSkeletonLine, DOCS_EXTENSION_TYPE, IBoundRectNoAngle[]> {
|
|
36
38
|
private _skeleton?;
|
|
37
39
|
pageMarginLeft: number;
|
|
38
40
|
pageMarginTop: number;
|
|
39
41
|
pageLayoutType: PageLayoutType;
|
|
42
|
+
readonly onTextFillImageLoaded: () => void;
|
|
40
43
|
constructor(oKey: string, _skeleton?: DocumentSkeleton | undefined, config?: IDocumentsConfig);
|
|
41
44
|
getSkeleton(): DocumentSkeleton | undefined;
|
|
42
45
|
setSkeleton(skeleton: DocumentSkeleton): void;
|
|
@@ -33,6 +33,7 @@ export declare class FontAndBaseLine extends docExtension {
|
|
|
33
33
|
*/
|
|
34
34
|
actualFontMap: Record<string, string>;
|
|
35
35
|
private _textFillImageCache;
|
|
36
|
+
private _textFillImageLoadListeners;
|
|
36
37
|
constructor();
|
|
37
38
|
draw(ctx: UniverRenderingContext, _parentScale: IScale, glyph: IDocumentSkeletonGlyph, _?: IBoundRectNoAngle, _more?: IDrawInfo): void;
|
|
38
39
|
private _fillTextWithTextFill;
|