@remotion/web-renderer 4.0.395 → 4.0.396
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/border-radius.d.ts +31 -0
- package/dist/border-radius.js +152 -0
- package/dist/calculate-transforms.d.ts +2 -0
- package/dist/calculate-transforms.js +17 -0
- package/dist/composable.d.ts +2 -8
- package/dist/compose-canvas.js +28 -4
- package/dist/compose.d.ts +4 -3
- package/dist/compose.js +39 -12
- package/dist/drawing/border-radius.d.ts +3 -5
- package/dist/drawing/border-radius.js +12 -11
- package/dist/drawing/calculate-transforms.d.ts +6 -2
- package/dist/drawing/calculate-transforms.js +19 -22
- package/dist/drawing/canvas-offset-from-rect.d.ts +8 -0
- package/dist/drawing/canvas-offset-from-rect.js +12 -0
- package/dist/drawing/clamp-rect-to-parent-bounds.d.ts +4 -0
- package/dist/drawing/clamp-rect-to-parent-bounds.js +7 -0
- package/dist/drawing/compose-canvas.d.ts +1 -0
- package/dist/drawing/compose-canvas.js +36 -0
- package/dist/drawing/compose-svg.d.ts +1 -0
- package/dist/drawing/compose-svg.js +34 -0
- package/dist/drawing/compose.d.ts +5 -0
- package/dist/drawing/compose.js +6 -0
- package/dist/drawing/draw-border.d.ts +2 -5
- package/dist/drawing/draw-border.js +37 -37
- package/dist/drawing/draw-element-to-canvas.d.ts +2 -1
- package/dist/drawing/draw-element-to-canvas.js +8 -36
- package/dist/drawing/draw-element.d.ts +5 -3
- package/dist/drawing/draw-element.js +29 -14
- package/dist/drawing/draw-outline.d.ts +9 -0
- package/dist/drawing/draw-outline.js +116 -0
- package/dist/drawing/get-bounding-box-including-shadow.d.ts +1 -0
- package/dist/drawing/get-bounding-box-including-shadow.js +6 -0
- package/dist/drawing/get-computed-style-cache.d.ts +0 -0
- package/dist/drawing/get-computed-style-cache.js +1 -0
- package/dist/drawing/get-pretransform-rect.d.ts +1 -0
- package/dist/drawing/get-pretransform-rect.js +31 -0
- package/dist/drawing/handle-3d-transform.d.ts +10 -0
- package/dist/drawing/handle-3d-transform.js +39 -0
- package/dist/drawing/has-transform.d.ts +4 -0
- package/dist/drawing/has-transform.js +14 -0
- package/dist/drawing/overflow.d.ts +7 -0
- package/dist/drawing/overflow.js +12 -0
- package/dist/drawing/process-node.d.ts +17 -0
- package/dist/drawing/process-node.js +41 -0
- package/dist/drawing/text/handle-text-node.d.ts +6 -5
- package/dist/drawing/text/handle-text-node.js +5 -5
- package/dist/drawing/transform-in-3d.d.ts +7 -7
- package/dist/drawing/transform-in-3d.js +20 -12
- package/dist/drawing/transform-rect-with-matrix.d.ts +4 -0
- package/dist/drawing/transform-rect-with-matrix.js +19 -0
- package/dist/esm/index.mjs +501 -218
- package/dist/find-canvas-elements.d.ts +1 -0
- package/dist/find-canvas-elements.js +13 -0
- package/dist/find-capturable-elements.d.ts +1 -1
- package/dist/find-capturable-elements.js +20 -22
- package/dist/get-biggest-bounding-client-rect.js +14 -4
- package/dist/internal-state.d.ts +9 -0
- package/dist/internal-state.js +12 -0
- package/dist/opacity.d.ts +4 -0
- package/dist/opacity.js +7 -0
- package/dist/render-media-on-web.d.ts +2 -0
- package/dist/render-media-on-web.js +5 -0
- package/dist/render-still-on-web.d.ts +5 -1
- package/dist/render-still-on-web.js +4 -1
- package/dist/take-screenshot.d.ts +5 -2
- package/dist/take-screenshot.js +16 -4
- package/dist/transform.d.ts +4 -0
- package/dist/transform.js +6 -0
- package/package.json +6 -6
- package/dist/drawing/text/get-base-height.d.ts +0 -1
- package/dist/drawing/text/get-base-height.js +0 -13
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const findCanvasElements: (element: HTMLDivElement) => HTMLCanvasElement[];
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.findCanvasElements = void 0;
|
|
4
|
+
const findCanvasElements = (element) => {
|
|
5
|
+
const canvasElements = element.querySelectorAll('canvas');
|
|
6
|
+
const composables = [];
|
|
7
|
+
Array.from(canvasElements).forEach((canvasElement) => {
|
|
8
|
+
const canvas = canvasElement;
|
|
9
|
+
composables.push(canvas);
|
|
10
|
+
});
|
|
11
|
+
return composables;
|
|
12
|
+
};
|
|
13
|
+
exports.findCanvasElements = findCanvasElements;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { Composable } from './composable';
|
|
2
|
-
export declare const findCapturableElements: (element: HTMLDivElement) => Composable[]
|
|
2
|
+
export declare const findCapturableElements: (element: HTMLDivElement, context: OffscreenCanvasRenderingContext2D) => Promise<Composable[]>;
|
|
@@ -1,28 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
element: canvas,
|
|
10
|
-
});
|
|
1
|
+
import { drawElementToCanvas } from './drawing/draw-element-to-canvas';
|
|
2
|
+
export const findCapturableElements = async (element, context) => {
|
|
3
|
+
const treeWalker = document.createTreeWalker(element, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_TEXT, (node) => {
|
|
4
|
+
if (node instanceof Element) {
|
|
5
|
+
const computedStyle = getComputedStyle(node);
|
|
6
|
+
return computedStyle.display === 'none'
|
|
7
|
+
? NodeFilter.FILTER_REJECT
|
|
8
|
+
: NodeFilter.FILTER_ACCEPT;
|
|
11
9
|
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
10
|
+
return NodeFilter.FILTER_ACCEPT;
|
|
11
|
+
});
|
|
12
|
+
const composables = [];
|
|
13
|
+
while (treeWalker.nextNode()) {
|
|
14
|
+
const node = treeWalker.currentNode;
|
|
15
|
+
if (node instanceof HTMLCanvasElement ||
|
|
16
|
+
node instanceof SVGSVGElement ||
|
|
17
|
+
node instanceof HTMLImageElement) {
|
|
18
|
+
await drawElementToCanvas(node, context);
|
|
21
19
|
composables.push({
|
|
22
|
-
type: '
|
|
23
|
-
element:
|
|
20
|
+
type: 'element',
|
|
21
|
+
element: node,
|
|
24
22
|
});
|
|
25
23
|
}
|
|
26
|
-
}
|
|
24
|
+
}
|
|
27
25
|
return composables;
|
|
28
26
|
};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { parseOutlineOffset, parseOutlineWidth } from './drawing/draw-outline';
|
|
2
|
+
import { skipToNextNonDescendant } from './walk-tree';
|
|
1
3
|
export const getBiggestBoundingClientRect = (element) => {
|
|
2
4
|
const treeWalker = document.createTreeWalker(element, NodeFilter.SHOW_ELEMENT);
|
|
3
5
|
let mostLeft = Infinity;
|
|
@@ -5,11 +7,19 @@ export const getBiggestBoundingClientRect = (element) => {
|
|
|
5
7
|
let mostRight = -Infinity;
|
|
6
8
|
let mostBottom = -Infinity;
|
|
7
9
|
while (true) {
|
|
10
|
+
const computedStyle = getComputedStyle(treeWalker.currentNode);
|
|
11
|
+
const outlineWidth = parseOutlineWidth(computedStyle.outlineWidth);
|
|
12
|
+
const outlineOffset = parseOutlineOffset(computedStyle.outlineOffset);
|
|
8
13
|
const rect = treeWalker.currentNode.getBoundingClientRect();
|
|
9
|
-
mostLeft = Math.min(mostLeft, rect.left);
|
|
10
|
-
mostTop = Math.min(mostTop, rect.top);
|
|
11
|
-
mostRight = Math.max(mostRight, rect.right);
|
|
12
|
-
mostBottom = Math.max(mostBottom, rect.bottom);
|
|
14
|
+
mostLeft = Math.min(mostLeft, rect.left - outlineOffset - outlineWidth);
|
|
15
|
+
mostTop = Math.min(mostTop, rect.top - outlineOffset - outlineWidth);
|
|
16
|
+
mostRight = Math.max(mostRight, rect.right + outlineOffset + outlineWidth);
|
|
17
|
+
mostBottom = Math.max(mostBottom, rect.bottom + outlineOffset + outlineWidth);
|
|
18
|
+
if (computedStyle.overflow === 'hidden') {
|
|
19
|
+
if (!skipToNextNonDescendant(treeWalker)) {
|
|
20
|
+
break;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
13
23
|
if (!treeWalker.nextNode()) {
|
|
14
24
|
break;
|
|
15
25
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const makeInternalState: () => {
|
|
2
|
+
getDrawn3dPixels: () => number;
|
|
3
|
+
getDrawn3dTextures: () => number;
|
|
4
|
+
add3DTransform: ({ canvasWidth, canvasHeight, }: {
|
|
5
|
+
canvasWidth: number;
|
|
6
|
+
canvasHeight: number;
|
|
7
|
+
}) => void;
|
|
8
|
+
};
|
|
9
|
+
export type InternalState = ReturnType<typeof makeInternalState>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export const makeInternalState = () => {
|
|
2
|
+
let drawn3dPixels = 0;
|
|
3
|
+
let drawn3dTextures = 0;
|
|
4
|
+
return {
|
|
5
|
+
getDrawn3dPixels: () => drawn3dPixels,
|
|
6
|
+
getDrawn3dTextures: () => drawn3dTextures,
|
|
7
|
+
add3DTransform: ({ canvasWidth, canvasHeight, }) => {
|
|
8
|
+
drawn3dPixels += canvasWidth * canvasHeight;
|
|
9
|
+
drawn3dTextures++;
|
|
10
|
+
},
|
|
11
|
+
};
|
|
12
|
+
};
|
package/dist/opacity.js
ADDED
|
@@ -2,6 +2,7 @@ import { type LogLevel } from 'remotion';
|
|
|
2
2
|
import type { AnyZodObject, z } from 'zod';
|
|
3
3
|
import { type OnArtifact } from './artifact';
|
|
4
4
|
import { type FrameRange } from './frame-range';
|
|
5
|
+
import type { InternalState } from './internal-state';
|
|
5
6
|
import type { WebRendererContainer, WebRendererQuality } from './mediabunny-mappings';
|
|
6
7
|
import { type WebRendererCodec } from './mediabunny-mappings';
|
|
7
8
|
import type { WebRendererOutputTarget } from './output-target';
|
|
@@ -25,6 +26,7 @@ export type RenderMediaOnWebProgress = {
|
|
|
25
26
|
};
|
|
26
27
|
export type RenderMediaOnWebResult = {
|
|
27
28
|
getBlob: () => Promise<Blob>;
|
|
29
|
+
internalState: InternalState;
|
|
28
30
|
};
|
|
29
31
|
export type RenderMediaOnWebProgressCallback = (progress: RenderMediaOnWebProgress) => void;
|
|
30
32
|
type OptionalRenderMediaOnWebOptions<Schema extends AnyZodObject> = {
|
|
@@ -7,6 +7,7 @@ import { canUseWebFsWriter } from './can-use-webfs-target';
|
|
|
7
7
|
import { createScaffold } from './create-scaffold';
|
|
8
8
|
import { getRealFrameRange } from './frame-range';
|
|
9
9
|
import { getDefaultAudioEncodingConfig } from './get-audio-encoding-config';
|
|
10
|
+
import { makeInternalState } from './internal-state';
|
|
10
11
|
import { codecToMediabunnyCodec, containerToMediabunnyContainer, getDefaultVideoCodecForContainer, getMimeType, getQualityForWebRendererQuality, } from './mediabunny-mappings';
|
|
11
12
|
import { onlyOneRenderAtATimeQueue } from './render-operations-queue';
|
|
12
13
|
import { sendUsageEvent } from './send-telemetry-event';
|
|
@@ -69,6 +70,7 @@ const internalRenderMediaOnWeb = async ({ composition, inputProps, delayRenderTi
|
|
|
69
70
|
defaultCodec: resolved.defaultCodec,
|
|
70
71
|
defaultOutName: resolved.defaultOutName,
|
|
71
72
|
});
|
|
73
|
+
const internalState = makeInternalState();
|
|
72
74
|
const artifactsHandler = handleArtifacts();
|
|
73
75
|
cleanupFns.push(() => {
|
|
74
76
|
cleanupScaffold();
|
|
@@ -153,6 +155,7 @@ const internalRenderMediaOnWeb = async ({ composition, inputProps, delayRenderTi
|
|
|
153
155
|
width: resolved.width,
|
|
154
156
|
height: resolved.height,
|
|
155
157
|
logLevel,
|
|
158
|
+
internalState,
|
|
156
159
|
});
|
|
157
160
|
if (signal === null || signal === void 0 ? void 0 : signal.aborted) {
|
|
158
161
|
throw new Error('renderMediaOnWeb() was cancelled');
|
|
@@ -213,6 +216,7 @@ const internalRenderMediaOnWeb = async ({ composition, inputProps, delayRenderTi
|
|
|
213
216
|
getBlob: () => {
|
|
214
217
|
return webFsTarget.getBlob();
|
|
215
218
|
},
|
|
219
|
+
internalState,
|
|
216
220
|
};
|
|
217
221
|
}
|
|
218
222
|
if (!(target instanceof BufferTarget)) {
|
|
@@ -230,6 +234,7 @@ const internalRenderMediaOnWeb = async ({ composition, inputProps, delayRenderTi
|
|
|
230
234
|
}
|
|
231
235
|
return Promise.resolve(new Blob([target.buffer], { type: mimeType }));
|
|
232
236
|
},
|
|
237
|
+
internalState,
|
|
233
238
|
};
|
|
234
239
|
}
|
|
235
240
|
catch (err) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type LogLevel } from 'remotion';
|
|
2
2
|
import type { AnyZodObject } from 'zod';
|
|
3
3
|
import type { OnArtifact } from './artifact';
|
|
4
|
+
import type { InternalState } from './internal-state';
|
|
4
5
|
import type { CompositionCalculateMetadataOrExplicit } from './props-if-has-props';
|
|
5
6
|
import type { InputPropsIfHasProps } from './render-media-on-web';
|
|
6
7
|
export type RenderStillOnWebImageFormat = 'png' | 'jpeg' | 'webp';
|
|
@@ -20,5 +21,8 @@ type OptionalRenderStillOnWebOptions<Schema extends AnyZodObject> = {
|
|
|
20
21
|
licenseKey: string | undefined;
|
|
21
22
|
};
|
|
22
23
|
export type RenderStillOnWebOptions<Schema extends AnyZodObject, Props extends Record<string, unknown>> = MandatoryRenderStillOnWebOptions<Schema, Props> & Partial<OptionalRenderStillOnWebOptions<Schema>> & InputPropsIfHasProps<Schema, Props>;
|
|
23
|
-
export declare const renderStillOnWeb: <Schema extends AnyZodObject, Props extends Record<string, unknown>>(options: RenderStillOnWebOptions<Schema, Props>) => Promise<
|
|
24
|
+
export declare const renderStillOnWeb: <Schema extends AnyZodObject, Props extends Record<string, unknown>>(options: RenderStillOnWebOptions<Schema, Props>) => Promise<{
|
|
25
|
+
blob: Blob;
|
|
26
|
+
internalState: InternalState;
|
|
27
|
+
}>;
|
|
24
28
|
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Internals, } from 'remotion';
|
|
2
2
|
import { handleArtifacts } from './artifact';
|
|
3
3
|
import { createScaffold } from './create-scaffold';
|
|
4
|
+
import { makeInternalState } from './internal-state';
|
|
4
5
|
import { onlyOneRenderAtATimeQueue } from './render-operations-queue';
|
|
5
6
|
import { sendUsageEvent } from './send-telemetry-event';
|
|
6
7
|
import { takeScreenshot } from './take-screenshot';
|
|
@@ -21,6 +22,7 @@ async function internalRenderStillOnWeb({ frame, delayRenderTimeoutInMillisecond
|
|
|
21
22
|
if (signal === null || signal === void 0 ? void 0 : signal.aborted) {
|
|
22
23
|
return Promise.reject(new Error('renderStillOnWeb() was cancelled'));
|
|
23
24
|
}
|
|
25
|
+
const internalState = makeInternalState();
|
|
24
26
|
const { delayRenderScope, div, cleanupScaffold, collectAssets } = await createScaffold({
|
|
25
27
|
width: resolved.width,
|
|
26
28
|
height: resolved.height,
|
|
@@ -59,6 +61,7 @@ async function internalRenderStillOnWeb({ frame, delayRenderTimeoutInMillisecond
|
|
|
59
61
|
height: resolved.height,
|
|
60
62
|
imageFormat,
|
|
61
63
|
logLevel,
|
|
64
|
+
internalState,
|
|
62
65
|
});
|
|
63
66
|
const assets = collectAssets.current.collectAssets();
|
|
64
67
|
if (onArtifact) {
|
|
@@ -69,7 +72,7 @@ async function internalRenderStillOnWeb({ frame, delayRenderTimeoutInMillisecond
|
|
|
69
72
|
succeeded: true,
|
|
70
73
|
apiName: 'renderStillOnWeb',
|
|
71
74
|
});
|
|
72
|
-
return imageData;
|
|
75
|
+
return { blob: imageData, internalState };
|
|
73
76
|
}
|
|
74
77
|
catch (err) {
|
|
75
78
|
sendUsageEvent({
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import type { LogLevel } from 'remotion';
|
|
2
|
+
import type { InternalState } from './internal-state';
|
|
2
3
|
import type { RenderStillOnWebImageFormat } from './render-still-on-web';
|
|
3
|
-
export declare const createFrame: ({ div, width, height, logLevel, }: {
|
|
4
|
+
export declare const createFrame: ({ div, width, height, logLevel, internalState, }: {
|
|
4
5
|
div: HTMLDivElement;
|
|
5
6
|
width: number;
|
|
6
7
|
height: number;
|
|
7
8
|
logLevel: LogLevel;
|
|
9
|
+
internalState: InternalState;
|
|
8
10
|
}) => Promise<OffscreenCanvas>;
|
|
9
|
-
export declare const takeScreenshot: ({ div, width, height, imageFormat, logLevel, }: {
|
|
11
|
+
export declare const takeScreenshot: ({ div, width, height, imageFormat, logLevel, internalState, }: {
|
|
10
12
|
div: HTMLDivElement;
|
|
11
13
|
width: number;
|
|
12
14
|
height: number;
|
|
13
15
|
imageFormat: RenderStillOnWebImageFormat;
|
|
14
16
|
logLevel: LogLevel;
|
|
17
|
+
internalState: InternalState;
|
|
15
18
|
}) => Promise<Blob>;
|
package/dist/take-screenshot.js
CHANGED
|
@@ -1,15 +1,27 @@
|
|
|
1
1
|
import { compose } from './compose';
|
|
2
|
-
export const createFrame = async ({ div, width, height, logLevel, }) => {
|
|
2
|
+
export const createFrame = async ({ div, width, height, logLevel, internalState, }) => {
|
|
3
3
|
const canvas = new OffscreenCanvas(width, height);
|
|
4
4
|
const context = canvas.getContext('2d');
|
|
5
5
|
if (!context) {
|
|
6
6
|
throw new Error('Could not get context');
|
|
7
7
|
}
|
|
8
|
-
await compose({
|
|
8
|
+
await compose({
|
|
9
|
+
element: div,
|
|
10
|
+
context,
|
|
11
|
+
logLevel,
|
|
12
|
+
parentRect: new DOMRect(0, 0, width, height),
|
|
13
|
+
internalState,
|
|
14
|
+
});
|
|
9
15
|
return canvas;
|
|
10
16
|
};
|
|
11
|
-
export const takeScreenshot = async ({ div, width, height, imageFormat, logLevel, }) => {
|
|
12
|
-
const frame = await createFrame({
|
|
17
|
+
export const takeScreenshot = async ({ div, width, height, imageFormat, logLevel, internalState, }) => {
|
|
18
|
+
const frame = await createFrame({
|
|
19
|
+
div,
|
|
20
|
+
width,
|
|
21
|
+
height,
|
|
22
|
+
logLevel,
|
|
23
|
+
internalState,
|
|
24
|
+
});
|
|
13
25
|
const imageData = await frame.convertToBlob({
|
|
14
26
|
type: `image/${imageFormat}`,
|
|
15
27
|
});
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"url": "https://github.com/remotion-dev/remotion/tree/main/packages/web-renderer"
|
|
4
4
|
},
|
|
5
5
|
"name": "@remotion/web-renderer",
|
|
6
|
-
"version": "4.0.
|
|
6
|
+
"version": "4.0.396",
|
|
7
7
|
"main": "dist/index.js",
|
|
8
8
|
"sideEffects": false,
|
|
9
9
|
"scripts": {
|
|
@@ -16,14 +16,14 @@
|
|
|
16
16
|
"author": "Remotion <jonny@remotion.dev>",
|
|
17
17
|
"license": "UNLICENSED",
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@remotion/licensing": "4.0.
|
|
20
|
-
"remotion": "4.0.
|
|
19
|
+
"@remotion/licensing": "4.0.396",
|
|
20
|
+
"remotion": "4.0.396",
|
|
21
21
|
"mediabunny": "1.27.2"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@remotion/eslint-config-internal": "4.0.
|
|
25
|
-
"@remotion/player": "4.0.
|
|
26
|
-
"@remotion/media": "4.0.
|
|
24
|
+
"@remotion/eslint-config-internal": "4.0.396",
|
|
25
|
+
"@remotion/player": "4.0.396",
|
|
26
|
+
"@remotion/media": "4.0.396",
|
|
27
27
|
"@vitejs/plugin-react": "4.1.0",
|
|
28
28
|
"@vitest/browser-playwright": "4.0.9",
|
|
29
29
|
"playwright": "1.55.1",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const getOpticalHeight: (span: HTMLSpanElement) => number;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
// A text with e.g. font-size: 12px does not always get rendered with 12px
|
|
2
|
-
// With "Arial", it gets rendered with 13.5px height, with SF Pro, it gets
|
|
3
|
-
// rendered with 14px height. I therefore conclude there is no logic
|
|
4
|
-
// and we need to measure it. I rendered the string "1", "a" and "qË" and
|
|
5
|
-
// they all have the same height, so it doesn't matter if certain characters
|
|
6
|
-
// go low or high.
|
|
7
|
-
export const getOpticalHeight = (span) => {
|
|
8
|
-
const originalText = span.textContent;
|
|
9
|
-
span.textContent = '1';
|
|
10
|
-
const { height } = span.getBoundingClientRect();
|
|
11
|
-
span.textContent = originalText;
|
|
12
|
-
return height;
|
|
13
|
-
};
|