@remotion/promo-pages 4.0.482 → 4.0.484
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/Homepage.js +552 -133
- package/dist/design.js +180 -46
- package/dist/experts.js +180 -46
- package/dist/homepage/Pricing.js +180 -46
- package/dist/prompts/PromptsGallery.js +203 -76
- package/dist/prompts/PromptsShow.js +180 -46
- package/dist/prompts/PromptsSubmit.js +24095 -44195
- package/dist/tailwind.css +0 -14
- package/dist/team.js +180 -46
- package/dist/template-modal-content.js +180 -46
- package/dist/templates.js +181 -46
- package/package.json +13 -13
package/dist/tailwind.css
CHANGED
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
'Noto Color Emoji';
|
|
7
7
|
--font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New',
|
|
8
8
|
monospace;
|
|
9
|
-
--color-red-500: oklch(63.7% 0.237 25.331);
|
|
10
9
|
--color-slate-200: oklch(92.9% 0.013 255.508);
|
|
11
10
|
--color-gray-100: oklch(96.7% 0.003 264.542);
|
|
12
11
|
--color-gray-200: oklch(92.8% 0.006 264.531);
|
|
@@ -803,10 +802,6 @@
|
|
|
803
802
|
border-bottom-style: var(--tw-border-style);
|
|
804
803
|
border-bottom-width: 4px;
|
|
805
804
|
}
|
|
806
|
-
.border-dashed {
|
|
807
|
-
--tw-border-style: dashed;
|
|
808
|
-
border-style: dashed;
|
|
809
|
-
}
|
|
810
805
|
.border-none {
|
|
811
806
|
--tw-border-style: none;
|
|
812
807
|
border-style: none;
|
|
@@ -821,9 +816,6 @@
|
|
|
821
816
|
.border-black {
|
|
822
817
|
border-color: var(--color-black);
|
|
823
818
|
}
|
|
824
|
-
.border-brand {
|
|
825
|
-
border-color: #0b84f3;
|
|
826
|
-
}
|
|
827
819
|
.border-muted {
|
|
828
820
|
border-color: var(--subtitle);
|
|
829
821
|
}
|
|
@@ -851,9 +843,6 @@
|
|
|
851
843
|
.bg-brand {
|
|
852
844
|
background-color: #0b84f3;
|
|
853
845
|
}
|
|
854
|
-
.bg-brand\/10 {
|
|
855
|
-
background-color: color-mix(in oklab, #0b84f3 10%, transparent);
|
|
856
|
-
}
|
|
857
846
|
.bg-brand\/50 {
|
|
858
847
|
background-color: color-mix(in oklab, #0b84f3 50%, transparent);
|
|
859
848
|
}
|
|
@@ -1214,9 +1203,6 @@
|
|
|
1214
1203
|
.text-muted {
|
|
1215
1204
|
color: var(--subtitle);
|
|
1216
1205
|
}
|
|
1217
|
-
.text-red-500 {
|
|
1218
|
-
color: var(--color-red-500);
|
|
1219
|
-
}
|
|
1220
1206
|
.text-text {
|
|
1221
1207
|
color: var(--text-color);
|
|
1222
1208
|
}
|
package/dist/team.js
CHANGED
|
@@ -5746,7 +5746,7 @@ var getComponentsToAddStacksTo = () => componentsToAddStacksTo;
|
|
|
5746
5746
|
var addSequenceStackTraces = (component) => {
|
|
5747
5747
|
componentsToAddStacksTo.push(component);
|
|
5748
5748
|
};
|
|
5749
|
-
var VERSION = "4.0.
|
|
5749
|
+
var VERSION = "4.0.484";
|
|
5750
5750
|
var checkMultipleRemotionVersions = () => {
|
|
5751
5751
|
if (typeof globalThis === "undefined") {
|
|
5752
5752
|
return;
|
|
@@ -6962,6 +6962,35 @@ function findRange(input, inputRange) {
|
|
|
6962
6962
|
return i - 1;
|
|
6963
6963
|
}
|
|
6964
6964
|
var defaultEasing = (num) => num;
|
|
6965
|
+
var shouldExtendRightForEasing = (easing) => {
|
|
6966
|
+
return easing.remotionShouldExtendRight === true;
|
|
6967
|
+
};
|
|
6968
|
+
var resolveEasingForSegment = ({
|
|
6969
|
+
easing,
|
|
6970
|
+
segmentIndex
|
|
6971
|
+
}) => {
|
|
6972
|
+
if (easing === undefined) {
|
|
6973
|
+
return defaultEasing;
|
|
6974
|
+
}
|
|
6975
|
+
if (typeof easing === "function") {
|
|
6976
|
+
return easing;
|
|
6977
|
+
}
|
|
6978
|
+
return easing[segmentIndex];
|
|
6979
|
+
};
|
|
6980
|
+
var interpolateSegment = ({
|
|
6981
|
+
input,
|
|
6982
|
+
inputRange,
|
|
6983
|
+
outputRange,
|
|
6984
|
+
easing,
|
|
6985
|
+
extrapolateLeft,
|
|
6986
|
+
extrapolateRight
|
|
6987
|
+
}) => {
|
|
6988
|
+
return interpolateFunction(input, inputRange, outputRange, {
|
|
6989
|
+
easing,
|
|
6990
|
+
extrapolateLeft,
|
|
6991
|
+
extrapolateRight: input > inputRange[1] && extrapolateRight === "clamp" && shouldExtendRightForEasing(easing) ? "extend" : extrapolateRight
|
|
6992
|
+
});
|
|
6993
|
+
};
|
|
6965
6994
|
var interpolateNumber = ({
|
|
6966
6995
|
input,
|
|
6967
6996
|
inputRange,
|
|
@@ -6972,15 +7001,6 @@ var interpolateNumber = ({
|
|
|
6972
7001
|
return outputRange[0];
|
|
6973
7002
|
}
|
|
6974
7003
|
const easingOption = options?.easing;
|
|
6975
|
-
const resolveEasingForSegment = (segmentIndex) => {
|
|
6976
|
-
if (easingOption === undefined) {
|
|
6977
|
-
return defaultEasing;
|
|
6978
|
-
}
|
|
6979
|
-
if (typeof easingOption === "function") {
|
|
6980
|
-
return easingOption;
|
|
6981
|
-
}
|
|
6982
|
-
return easingOption[segmentIndex];
|
|
6983
|
-
};
|
|
6984
7004
|
let extrapolateLeft = "extend";
|
|
6985
7005
|
if (options?.extrapolateLeft !== undefined) {
|
|
6986
7006
|
extrapolateLeft = options.extrapolateLeft;
|
|
@@ -6991,11 +7011,41 @@ var interpolateNumber = ({
|
|
|
6991
7011
|
}
|
|
6992
7012
|
const posterizedInput = options?.posterize === undefined ? input : Math.floor(input / options.posterize) * options.posterize;
|
|
6993
7013
|
const range = findRange(posterizedInput, inputRange);
|
|
6994
|
-
|
|
6995
|
-
easing:
|
|
7014
|
+
const easing = resolveEasingForSegment({
|
|
7015
|
+
easing: easingOption,
|
|
7016
|
+
segmentIndex: range
|
|
7017
|
+
});
|
|
7018
|
+
let result = interpolateSegment({
|
|
7019
|
+
input: posterizedInput,
|
|
7020
|
+
inputRange: [inputRange[range], inputRange[range + 1]],
|
|
7021
|
+
outputRange: [outputRange[range], outputRange[range + 1]],
|
|
7022
|
+
easing,
|
|
6996
7023
|
extrapolateLeft,
|
|
6997
7024
|
extrapolateRight
|
|
6998
7025
|
});
|
|
7026
|
+
for (let segmentIndex = 0;segmentIndex < range; segmentIndex++) {
|
|
7027
|
+
const previousEasing = resolveEasingForSegment({
|
|
7028
|
+
easing: easingOption,
|
|
7029
|
+
segmentIndex
|
|
7030
|
+
});
|
|
7031
|
+
if (!shouldExtendRightForEasing(previousEasing)) {
|
|
7032
|
+
continue;
|
|
7033
|
+
}
|
|
7034
|
+
const previousSegmentEnd = inputRange[segmentIndex + 1];
|
|
7035
|
+
if (posterizedInput <= previousSegmentEnd) {
|
|
7036
|
+
continue;
|
|
7037
|
+
}
|
|
7038
|
+
const continuedSegmentValue = interpolateSegment({
|
|
7039
|
+
input: posterizedInput,
|
|
7040
|
+
inputRange: [inputRange[segmentIndex], previousSegmentEnd],
|
|
7041
|
+
outputRange: [outputRange[segmentIndex], outputRange[segmentIndex + 1]],
|
|
7042
|
+
easing: previousEasing,
|
|
7043
|
+
extrapolateLeft,
|
|
7044
|
+
extrapolateRight: "extend"
|
|
7045
|
+
});
|
|
7046
|
+
result += continuedSegmentValue - outputRange[segmentIndex + 1];
|
|
7047
|
+
}
|
|
7048
|
+
return result;
|
|
6999
7049
|
};
|
|
7000
7050
|
var interpolateString = ({
|
|
7001
7051
|
input,
|
|
@@ -7469,21 +7519,40 @@ class Easing {
|
|
|
7469
7519
|
static back(s = 1.70158) {
|
|
7470
7520
|
return (t) => t * t * ((s + 1) * t - s);
|
|
7471
7521
|
}
|
|
7472
|
-
static spring(
|
|
7473
|
-
|
|
7522
|
+
static spring({
|
|
7523
|
+
allowTail = false,
|
|
7524
|
+
durationRestThreshold,
|
|
7525
|
+
...config
|
|
7526
|
+
} = {}) {
|
|
7527
|
+
const easing = (t) => {
|
|
7474
7528
|
if (t <= 0) {
|
|
7475
7529
|
return 0;
|
|
7476
7530
|
}
|
|
7477
|
-
if (t >= 1) {
|
|
7531
|
+
if (!allowTail && t >= 1) {
|
|
7478
7532
|
return 1;
|
|
7479
7533
|
}
|
|
7534
|
+
if (allowTail) {
|
|
7535
|
+
return spring({
|
|
7536
|
+
fps: springEasingDurationInFrames,
|
|
7537
|
+
frame: t * measureSpring({
|
|
7538
|
+
fps: springEasingDurationInFrames,
|
|
7539
|
+
config,
|
|
7540
|
+
threshold: durationRestThreshold
|
|
7541
|
+
}),
|
|
7542
|
+
config
|
|
7543
|
+
});
|
|
7544
|
+
}
|
|
7480
7545
|
return spring({
|
|
7481
7546
|
fps: springEasingDurationInFrames,
|
|
7482
7547
|
frame: t * springEasingDurationInFrames,
|
|
7483
7548
|
config,
|
|
7484
|
-
durationInFrames: springEasingDurationInFrames
|
|
7549
|
+
durationInFrames: springEasingDurationInFrames,
|
|
7550
|
+
durationRestThreshold
|
|
7485
7551
|
});
|
|
7486
7552
|
};
|
|
7553
|
+
return Object.assign(easing, {
|
|
7554
|
+
remotionShouldExtendRight: allowTail
|
|
7555
|
+
});
|
|
7487
7556
|
}
|
|
7488
7557
|
static bounce(t) {
|
|
7489
7558
|
const u = clampUnit(t);
|
|
@@ -8014,25 +8083,31 @@ var interpolateColors = (input, inputRange, outputRange, options) => {
|
|
|
8014
8083
|
const processedOutputRange = outputRange.map((c2) => processColor(c2));
|
|
8015
8084
|
return interpolateColorsRGB(input, inputRange, processedOutputRange, options);
|
|
8016
8085
|
};
|
|
8017
|
-
var easingToFn = (
|
|
8018
|
-
|
|
8086
|
+
var easingToFn = ({
|
|
8087
|
+
easing,
|
|
8088
|
+
forceSpringAllowTail
|
|
8089
|
+
}) => {
|
|
8090
|
+
switch (easing.type) {
|
|
8019
8091
|
case "linear":
|
|
8020
8092
|
return Easing.linear;
|
|
8021
8093
|
case "spring":
|
|
8022
8094
|
return Easing.spring({
|
|
8023
|
-
|
|
8024
|
-
|
|
8025
|
-
|
|
8026
|
-
|
|
8095
|
+
allowTail: forceSpringAllowTail ?? easing.allowTail ?? undefined,
|
|
8096
|
+
damping: easing.damping,
|
|
8097
|
+
durationRestThreshold: easing.durationRestThreshold ?? undefined,
|
|
8098
|
+
mass: easing.mass,
|
|
8099
|
+
overshootClamping: easing.overshootClamping,
|
|
8100
|
+
stiffness: easing.stiffness
|
|
8027
8101
|
});
|
|
8028
8102
|
case "bezier":
|
|
8029
|
-
return bezier(
|
|
8103
|
+
return bezier(easing.x1, easing.y1, easing.x2, easing.y2);
|
|
8030
8104
|
default:
|
|
8031
|
-
throw new TypeError(`Unsupported easing: ${JSON.stringify(
|
|
8105
|
+
throw new TypeError(`Unsupported easing: ${JSON.stringify(easing)}`);
|
|
8032
8106
|
}
|
|
8033
8107
|
};
|
|
8034
8108
|
var interpolateKeyframedStatus = ({
|
|
8035
8109
|
frame,
|
|
8110
|
+
forceSpringAllowTail,
|
|
8036
8111
|
status
|
|
8037
8112
|
}) => {
|
|
8038
8113
|
const { keyframes, easing, clamping, interpolationFunction } = status;
|
|
@@ -8051,7 +8126,7 @@ var interpolateKeyframedStatus = ({
|
|
|
8051
8126
|
}
|
|
8052
8127
|
try {
|
|
8053
8128
|
return interpolateColors(frame, inputRange, outputs, {
|
|
8054
|
-
easing: easing.map(easingToFn),
|
|
8129
|
+
easing: easing.map((e) => easingToFn({ easing: e, forceSpringAllowTail })),
|
|
8055
8130
|
posterize: status.posterize
|
|
8056
8131
|
});
|
|
8057
8132
|
} catch {
|
|
@@ -8063,7 +8138,7 @@ var interpolateKeyframedStatus = ({
|
|
|
8063
8138
|
}
|
|
8064
8139
|
try {
|
|
8065
8140
|
return interpolate(frame, inputRange, outputs, {
|
|
8066
|
-
easing: easing.map(easingToFn),
|
|
8141
|
+
easing: easing.map((e) => easingToFn({ easing: e, forceSpringAllowTail })),
|
|
8067
8142
|
extrapolateLeft: clamping.left,
|
|
8068
8143
|
extrapolateRight: clamping.right,
|
|
8069
8144
|
posterize: status.posterize
|
|
@@ -8086,6 +8161,7 @@ var resolveDragOverrideValue = ({
|
|
|
8086
8161
|
return { type: "none" };
|
|
8087
8162
|
}
|
|
8088
8163
|
const interpolated = interpolateKeyframedStatus({
|
|
8164
|
+
forceSpringAllowTail: null,
|
|
8089
8165
|
frame,
|
|
8090
8166
|
status: dragOverrideValue.status
|
|
8091
8167
|
});
|
|
@@ -8111,6 +8187,7 @@ var getEffectiveVisualModeValue = ({
|
|
|
8111
8187
|
if (propStatus.status === "keyframed") {
|
|
8112
8188
|
if (frame !== null) {
|
|
8113
8189
|
return interpolateKeyframedStatus({
|
|
8190
|
+
forceSpringAllowTail: null,
|
|
8114
8191
|
frame,
|
|
8115
8192
|
status: propStatus
|
|
8116
8193
|
});
|
|
@@ -8179,6 +8256,7 @@ var resolvePropStatusOverrides = (propStatus, frame) => {
|
|
|
8179
8256
|
}
|
|
8180
8257
|
if (status.status === "keyframed") {
|
|
8181
8258
|
const value = interpolateKeyframedStatus({
|
|
8259
|
+
forceSpringAllowTail: null,
|
|
8182
8260
|
frame,
|
|
8183
8261
|
status
|
|
8184
8262
|
});
|
|
@@ -8354,6 +8432,17 @@ var findPropsToDelete = ({
|
|
|
8354
8432
|
var DEFAULT_LINEAR_EASING = {
|
|
8355
8433
|
type: "linear"
|
|
8356
8434
|
};
|
|
8435
|
+
var getEasingIndexToDuplicate = ({
|
|
8436
|
+
insertedKeyframeIndex,
|
|
8437
|
+
easingLength,
|
|
8438
|
+
keyframeCount
|
|
8439
|
+
}) => {
|
|
8440
|
+
const isSplittingExistingSegment = insertedKeyframeIndex > 0 && insertedKeyframeIndex < keyframeCount - 1;
|
|
8441
|
+
if (!isSplittingExistingSegment || easingLength === 0) {
|
|
8442
|
+
return null;
|
|
8443
|
+
}
|
|
8444
|
+
return Math.min(insertedKeyframeIndex - 1, easingLength - 1);
|
|
8445
|
+
};
|
|
8357
8446
|
var makeStaticDragOverride = (value) => {
|
|
8358
8447
|
return { type: "static", value };
|
|
8359
8448
|
};
|
|
@@ -8365,6 +8454,16 @@ var makeKeyframedDragOverride = ({
|
|
|
8365
8454
|
const existingIndex = status.keyframes.findIndex((keyframe) => keyframe.frame === frame);
|
|
8366
8455
|
const keyframes = existingIndex === -1 ? [...status.keyframes, { frame, value }].sort((first, second) => first.frame - second.frame) : status.keyframes.map((keyframe, index) => index === existingIndex ? { frame, value } : keyframe);
|
|
8367
8456
|
const easing = [...status.easing];
|
|
8457
|
+
if (existingIndex === -1) {
|
|
8458
|
+
const insertedKeyframeIndex = keyframes.findIndex((keyframe) => keyframe.frame === frame);
|
|
8459
|
+
const easingIndexToDuplicate = getEasingIndexToDuplicate({
|
|
8460
|
+
insertedKeyframeIndex,
|
|
8461
|
+
easingLength: easing.length,
|
|
8462
|
+
keyframeCount: keyframes.length
|
|
8463
|
+
});
|
|
8464
|
+
const easingToDuplicate = easingIndexToDuplicate === null ? DEFAULT_LINEAR_EASING : easing[easingIndexToDuplicate];
|
|
8465
|
+
easing.splice(insertedKeyframeIndex, 0, easingToDuplicate);
|
|
8466
|
+
}
|
|
8368
8467
|
while (easing.length < keyframes.length - 1) {
|
|
8369
8468
|
easing.push(DEFAULT_LINEAR_EASING);
|
|
8370
8469
|
}
|
|
@@ -8436,6 +8535,7 @@ var computeEffectiveSchemaValuesDotNotation = ({
|
|
|
8436
8535
|
value = dragOverride.value;
|
|
8437
8536
|
} else if (frame !== null) {
|
|
8438
8537
|
const interpolated = interpolateKeyframedStatus({
|
|
8538
|
+
forceSpringAllowTail: null,
|
|
8439
8539
|
frame,
|
|
8440
8540
|
status
|
|
8441
8541
|
});
|
|
@@ -12587,6 +12687,7 @@ var AudioForRenderingRefForwardingFunction = (props, ref) => {
|
|
|
12587
12687
|
var AudioForRendering = forwardRef6(AudioForRenderingRefForwardingFunction);
|
|
12588
12688
|
var AudioRefForwardingFunction = (props, ref) => {
|
|
12589
12689
|
const audioTagsContext = useContext30(SharedAudioTagsContext);
|
|
12690
|
+
const propsWithFreeze = props;
|
|
12590
12691
|
const {
|
|
12591
12692
|
startFrom,
|
|
12592
12693
|
endAt,
|
|
@@ -12597,14 +12698,18 @@ var AudioRefForwardingFunction = (props, ref) => {
|
|
|
12597
12698
|
pauseWhenBuffering,
|
|
12598
12699
|
showInTimeline,
|
|
12599
12700
|
onError: onRemotionError,
|
|
12701
|
+
freeze,
|
|
12600
12702
|
...otherProps
|
|
12601
|
-
} =
|
|
12602
|
-
const { loop, ...propsOtherThanLoop } =
|
|
12703
|
+
} = propsWithFreeze;
|
|
12704
|
+
const { loop, freeze: _freeze, ...propsOtherThanLoop } = propsWithFreeze;
|
|
12603
12705
|
const { fps } = useVideoConfig();
|
|
12604
12706
|
const environment = useRemotionEnvironment();
|
|
12605
12707
|
if (environment.isClientSideRendering) {
|
|
12606
12708
|
throw new Error("<Html5Audio> is not supported in @remotion/web-renderer. Use <Audio> from @remotion/media instead. See https://remotion.dev/docs/client-side-rendering/limitations");
|
|
12607
12709
|
}
|
|
12710
|
+
if (typeof freeze !== "undefined") {
|
|
12711
|
+
throw new TypeError('The "freeze" prop is not supported on <Html5Audio />. Use <Sequence freeze={...}> to freeze media playback.');
|
|
12712
|
+
}
|
|
12608
12713
|
const { durations, setDurations } = useContext30(DurationsContext);
|
|
12609
12714
|
if (typeof props.src !== "string") {
|
|
12610
12715
|
throw new TypeError(`The \`<Html5Audio>\` tag requires a string for \`src\`, but got ${JSON.stringify(props.src)} instead.`);
|
|
@@ -12943,6 +13048,10 @@ function resolveHtmlInCanvasPixelDensity(pixelDensity) {
|
|
|
12943
13048
|
}
|
|
12944
13049
|
return pixelDensity;
|
|
12945
13050
|
}
|
|
13051
|
+
var isMissingPaintRecordError = (error2) => {
|
|
13052
|
+
return error2 instanceof DOMException && error2.name === "InvalidStateError";
|
|
13053
|
+
};
|
|
13054
|
+
var missingPaintRecordMessage = "HtmlInCanvas: Expected the element to be inside the viewport during rendering, but Chrome had no cached paint record for it.";
|
|
12946
13055
|
var resizeOffscreenCanvas = ({
|
|
12947
13056
|
offscreen,
|
|
12948
13057
|
width,
|
|
@@ -12986,6 +13095,7 @@ var HtmlInCanvasContent = forwardRef9(({
|
|
|
12986
13095
|
const canvasWidth = Math.ceil(width * resolvedPixelDensity);
|
|
12987
13096
|
const canvasHeight = Math.ceil(height * resolvedPixelDensity);
|
|
12988
13097
|
const { continueRender: continueRender2, cancelRender: cancelRender2 } = useDelayRender();
|
|
13098
|
+
const { isRendering } = useRemotionEnvironment();
|
|
12989
13099
|
if (!isHtmlInCanvasSupported()) {
|
|
12990
13100
|
cancelRender2(new Error(HTML_IN_CANVAS_UNSUPPORTED_MESSAGE));
|
|
12991
13101
|
}
|
|
@@ -13036,28 +13146,51 @@ var HtmlInCanvasContent = forwardRef9(({
|
|
|
13036
13146
|
}
|
|
13037
13147
|
const handle = delayRender("onPaint");
|
|
13038
13148
|
if (!initializedRef.current) {
|
|
13039
|
-
|
|
13040
|
-
|
|
13041
|
-
|
|
13042
|
-
|
|
13043
|
-
|
|
13044
|
-
|
|
13045
|
-
element,
|
|
13046
|
-
elementImage: initImage,
|
|
13047
|
-
pixelDensity: resolvedPixelDensity
|
|
13048
|
-
});
|
|
13049
|
-
if (typeof cleanup !== "function") {
|
|
13050
|
-
throw new Error("HtmlInCanvas: when `onInit` is provided, it must return a cleanup function, or a Promise that resolves to one.");
|
|
13051
|
-
}
|
|
13052
|
-
if (unmountedRef.current) {
|
|
13053
|
-
cleanup();
|
|
13149
|
+
let initImage = null;
|
|
13150
|
+
try {
|
|
13151
|
+
initImage = placeholderCanvas.captureElementImage(element);
|
|
13152
|
+
} catch (error2) {
|
|
13153
|
+
if (isMissingPaintRecordError(error2) && !isRendering) {} else if (isMissingPaintRecordError(error2)) {
|
|
13154
|
+
throw new Error(missingPaintRecordMessage);
|
|
13054
13155
|
} else {
|
|
13055
|
-
|
|
13156
|
+
throw error2;
|
|
13157
|
+
}
|
|
13158
|
+
}
|
|
13159
|
+
if (initImage) {
|
|
13160
|
+
initializedRef.current = true;
|
|
13161
|
+
const currentOnInit = onInitRef.current;
|
|
13162
|
+
if (currentOnInit) {
|
|
13163
|
+
const cleanup = await currentOnInit({
|
|
13164
|
+
canvas: offscreen,
|
|
13165
|
+
element,
|
|
13166
|
+
elementImage: initImage,
|
|
13167
|
+
pixelDensity: resolvedPixelDensity
|
|
13168
|
+
});
|
|
13169
|
+
if (typeof cleanup !== "function") {
|
|
13170
|
+
throw new Error("HtmlInCanvas: when `onInit` is provided, it must return a cleanup function, or a Promise that resolves to one.");
|
|
13171
|
+
}
|
|
13172
|
+
if (unmountedRef.current) {
|
|
13173
|
+
cleanup();
|
|
13174
|
+
} else {
|
|
13175
|
+
onInitCleanupRef.current = cleanup;
|
|
13176
|
+
}
|
|
13056
13177
|
}
|
|
13057
13178
|
}
|
|
13058
13179
|
}
|
|
13059
13180
|
const handler = onPaintRef.current ?? defaultOnPaint;
|
|
13060
|
-
|
|
13181
|
+
let elImage;
|
|
13182
|
+
try {
|
|
13183
|
+
elImage = placeholderCanvas.captureElementImage(element);
|
|
13184
|
+
} catch (error2) {
|
|
13185
|
+
if (isMissingPaintRecordError(error2) && !isRendering) {
|
|
13186
|
+
continueRender2(handle);
|
|
13187
|
+
return;
|
|
13188
|
+
}
|
|
13189
|
+
if (isMissingPaintRecordError(error2)) {
|
|
13190
|
+
throw new Error(missingPaintRecordMessage);
|
|
13191
|
+
}
|
|
13192
|
+
throw error2;
|
|
13193
|
+
}
|
|
13061
13194
|
await handler({
|
|
13062
13195
|
canvas: offscreen,
|
|
13063
13196
|
element,
|
|
@@ -13082,7 +13215,8 @@ var HtmlInCanvasContent = forwardRef9(({
|
|
|
13082
13215
|
chainState,
|
|
13083
13216
|
continueRender2,
|
|
13084
13217
|
cancelRender2,
|
|
13085
|
-
resolvedPixelDensity
|
|
13218
|
+
resolvedPixelDensity,
|
|
13219
|
+
isRendering
|
|
13086
13220
|
]);
|
|
13087
13221
|
useLayoutEffect9(() => {
|
|
13088
13222
|
const placeholder = canvas2dRef.current;
|