@univerjs/engine-render 0.4.0-alpha.0 → 0.4.0-nightly.202410121605

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/es/index.js CHANGED
@@ -4286,6 +4286,9 @@ const _Canvas = class _Canvas {
4286
4286
  getHeight() {
4287
4287
  return this._height;
4288
4288
  }
4289
+ setId(id) {
4290
+ this._canvasEle.id = id;
4291
+ }
4289
4292
  setSize(width, height, pixelRatioParam) {
4290
4293
  var _a10;
4291
4294
  this._pixelRatio = pixelRatioParam || getDevicePixelRatio();
@@ -29428,6 +29431,7 @@ const _ThinEngine = class _ThinEngine extends Disposable {
29428
29431
  __name(_ThinEngine, "ThinEngine");
29429
29432
  let ThinEngine = _ThinEngine;
29430
29433
  const _Engine = class _Engine extends ThinEngine {
29434
+ // unitId
29431
29435
  constructor(elemWidth = 1, elemHeight = 1, pixelRatio, mode) {
29432
29436
  super();
29433
29437
  __publicField(this, "renderEvenInBackground", !0);
@@ -29479,6 +29483,7 @@ const _Engine = class _Engine extends ThinEngine {
29479
29483
  __publicField(this, "_isUsingFirefox", navigator.userAgent.indexOf("Firefox") !== -1);
29480
29484
  __publicField(this, "_previousWidth", -1e3);
29481
29485
  __publicField(this, "_previousHeight", -1e3);
29486
+ __publicField(this, "_unitId", "");
29482
29487
  this._canvas = new Canvas({
29483
29488
  mode,
29484
29489
  width: elemWidth,
@@ -19,6 +19,7 @@ interface ICanvasProps {
19
19
  height?: number;
20
20
  pixelRatio?: number;
21
21
  mode?: CanvasRenderMode;
22
+ id?: string;
22
23
  }
23
24
  /**
24
25
  * View Renderer constructor. It is a wrapper around native canvas element.
@@ -48,6 +49,7 @@ export declare class Canvas {
48
49
  getPixelRatio(): number;
49
50
  getWidth(): number;
50
51
  getHeight(): number;
52
+ setId(id: string): void;
51
53
  setSize(width?: number, height?: number, pixelRatioParam?: number): void;
52
54
  setPixelRatio(pixelRatio: number): void;
53
55
  dispose(): void;
@@ -54,6 +54,7 @@ export declare class Engine extends ThinEngine<Scene> {
54
54
  private _isUsingFirefox;
55
55
  private _previousWidth;
56
56
  private _previousHeight;
57
+ private _unitId;
57
58
  constructor(elemWidth?: number, elemHeight?: number, pixelRatio?: number, mode?: CanvasRenderMode);
58
59
  _init(): void;
59
60
  get elapsedTime(): number;
@@ -1,11 +1,11 @@
1
- import { Disposable, Injector, IUniverInstanceService, UniverInstanceType, Dependency, DependencyIdentifier, IDisposable, Nullable, UnitModel, UnitType } from '@univerjs/core';
1
+ import { Dependency, DependencyIdentifier, IDisposable, Nullable, UnitModel, UnitType, Disposable, Injector, IUniverInstanceService, UniverInstanceType } from '@univerjs/core';
2
2
  import { Observable } from 'rxjs';
3
- import { Engine } from '../engine';
4
- import { IRender, RenderUnit } from './render-unit';
5
3
  import { BaseObject } from '../base-object';
6
4
  import { DocComponent } from '../components/docs/doc-component';
7
5
  import { SheetComponent } from '../components/sheets/sheet-component';
8
6
  import { Slide } from '../components/slides/slide';
7
+ import { Engine } from '../engine';
8
+ import { IRender, RenderUnit } from './render-unit';
9
9
  export type RenderComponentType = SheetComponent | DocComponent | Slide | BaseObject;
10
10
  export interface IRenderManagerService extends IDisposable {
11
11
  /** @deprecated */