@clypra-studio/engine 1.10.2 → 2.2.0
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/captions/index.cjs +559 -0
- package/dist/captions/index.cjs.map +1 -0
- package/dist/captions/index.d.cts +184 -0
- package/dist/captions/index.d.ts +184 -0
- package/dist/captions/index.js +35 -0
- package/dist/captions/index.js.map +1 -0
- package/dist/{chunk-ZV3RQAUJ.js → chunk-3AVGIISI.js} +175 -11
- package/dist/chunk-3AVGIISI.js.map +1 -0
- package/dist/{chunk-YBOYDQU5.js → chunk-4AT7MAXU.js} +9 -3
- package/dist/chunk-4AT7MAXU.js.map +1 -0
- package/dist/chunk-5DNPTBGA.js +520 -0
- package/dist/chunk-5DNPTBGA.js.map +1 -0
- package/dist/{chunk-V5VSY64D.js → chunk-IZH6P7WL.js} +2 -2
- package/dist/{index-Qc3rcMrW.d.ts → index-BRT37RMX.d.ts} +21 -6
- package/dist/{index-9XU-qEO-.d.cts → index-Nn5el7W0.d.cts} +21 -6
- package/dist/index.cjs +717 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +56 -48
- package/dist/index.d.ts +56 -48
- package/dist/index.js +55 -19
- package/dist/index.js.map +1 -1
- package/dist/rendering/index.cjs +179 -11
- package/dist/rendering/index.cjs.map +1 -1
- package/dist/rendering/index.d.cts +1 -1
- package/dist/rendering/index.d.ts +1 -1
- package/dist/rendering/index.js +2 -2
- package/dist/textEffects/index.cjs +8 -2
- package/dist/textEffects/index.cjs.map +1 -1
- package/dist/textEffects/index.js +2 -2
- package/package.json +6 -1
- package/dist/chunk-YBOYDQU5.js.map +0 -1
- package/dist/chunk-ZV3RQAUJ.js.map +0 -1
- /package/dist/{chunk-V5VSY64D.js.map → chunk-IZH6P7WL.js.map} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { B as BubbleAppearance, d as BubbleAssetDefinition, e as BubblePathCommand, f as BubbleRenderMode, g as BubbleRenderOptions, h as BubbleShape, i as BubbleTailPosition, j as BubbleTailSide, k as BubbleTexture, l as CANONICAL_RENDERER_VERSION, n as CanonicalRenderContext, o as CanonicalRenderInput, p as CanonicalRenderResult, F as FreeformBubbleDefinition, P as ParametricBubbleDefinition, u as RenderCapability, w as RenderDiagnostics, x as RenderEnvironment, y as RenderIdentity, D as TEXT_TEMPLATE_RENDERER_VERSION,
|
|
1
|
+
export { B as BubbleAppearance, d as BubbleAssetDefinition, e as BubblePathCommand, f as BubbleRenderMode, g as BubbleRenderOptions, h as BubbleShape, i as BubbleTailPosition, j as BubbleTailSide, k as BubbleTexture, l as CANONICAL_RENDERER_VERSION, n as CanonicalRenderContext, o as CanonicalRenderInput, p as CanonicalRenderResult, F as FreeformBubbleDefinition, P as ParametricBubbleDefinition, u as RenderCapability, w as RenderDiagnostics, x as RenderEnvironment, y as RenderIdentity, D as TEXT_TEMPLATE_RENDERER_VERSION, ag as TextBubbleCategory, ah as TextBubbleLayout, ai as TextBubblePadding, aj as TextBubblePreset, ak as TextEffectRenderInput, aq as TextTemplateRenderInput, at as compileBubblePath, au as compileBubbleSvg, av as createBubbleAssetDefinition, aw as createFreeformBubbleAssetDefinition, ax as drawChalkSpeechBubble, ay as drawComicBurst, az as drawRibbonBanner, aA as drawSpeechBubble, aB as drawThoughtCloud, aC as drawTornPaper, aG as getTextTemplateControls, aJ as pseudoNoise, aK as renderBubbleAssetDefinition, aL as renderBubbleBackground, aM as renderBubblePresetBackground, aN as renderCanonicalToCanvas, aO as renderTextEffectToCanvas, aP as renderTextTemplateToCanvas, aQ as resolveBubbleLayout, aR as resolveTemplateFontFamily, aS as resolveTextTemplateArtifact, aT as validateBubbleAssetDefinition } from '../index-Nn5el7W0.cjs';
|
|
2
2
|
import '../types-BsF33bC4.cjs';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { B as BubbleAppearance, d as BubbleAssetDefinition, e as BubblePathCommand, f as BubbleRenderMode, g as BubbleRenderOptions, h as BubbleShape, i as BubbleTailPosition, j as BubbleTailSide, k as BubbleTexture, l as CANONICAL_RENDERER_VERSION, n as CanonicalRenderContext, o as CanonicalRenderInput, p as CanonicalRenderResult, F as FreeformBubbleDefinition, P as ParametricBubbleDefinition, u as RenderCapability, w as RenderDiagnostics, x as RenderEnvironment, y as RenderIdentity, D as TEXT_TEMPLATE_RENDERER_VERSION,
|
|
1
|
+
export { B as BubbleAppearance, d as BubbleAssetDefinition, e as BubblePathCommand, f as BubbleRenderMode, g as BubbleRenderOptions, h as BubbleShape, i as BubbleTailPosition, j as BubbleTailSide, k as BubbleTexture, l as CANONICAL_RENDERER_VERSION, n as CanonicalRenderContext, o as CanonicalRenderInput, p as CanonicalRenderResult, F as FreeformBubbleDefinition, P as ParametricBubbleDefinition, u as RenderCapability, w as RenderDiagnostics, x as RenderEnvironment, y as RenderIdentity, D as TEXT_TEMPLATE_RENDERER_VERSION, ag as TextBubbleCategory, ah as TextBubbleLayout, ai as TextBubblePadding, aj as TextBubblePreset, ak as TextEffectRenderInput, aq as TextTemplateRenderInput, at as compileBubblePath, au as compileBubbleSvg, av as createBubbleAssetDefinition, aw as createFreeformBubbleAssetDefinition, ax as drawChalkSpeechBubble, ay as drawComicBurst, az as drawRibbonBanner, aA as drawSpeechBubble, aB as drawThoughtCloud, aC as drawTornPaper, aG as getTextTemplateControls, aJ as pseudoNoise, aK as renderBubbleAssetDefinition, aL as renderBubbleBackground, aM as renderBubblePresetBackground, aN as renderCanonicalToCanvas, aO as renderTextEffectToCanvas, aP as renderTextTemplateToCanvas, aQ as resolveBubbleLayout, aR as resolveTemplateFontFamily, aS as resolveTextTemplateArtifact, aT as validateBubbleAssetDefinition } from '../index-BRT37RMX.js';
|
|
2
2
|
import '../types-BsF33bC4.js';
|
package/dist/rendering/index.js
CHANGED
|
@@ -23,8 +23,8 @@ import {
|
|
|
23
23
|
resolveTemplateFontFamily,
|
|
24
24
|
resolveTextTemplateArtifact,
|
|
25
25
|
validateBubbleAssetDefinition
|
|
26
|
-
} from "../chunk-
|
|
27
|
-
import "../chunk-
|
|
26
|
+
} from "../chunk-3AVGIISI.js";
|
|
27
|
+
import "../chunk-4AT7MAXU.js";
|
|
28
28
|
export {
|
|
29
29
|
CANONICAL_RENDERER_VERSION,
|
|
30
30
|
TEXT_TEMPLATE_RENDERER_VERSION,
|
|
@@ -376,6 +376,10 @@ function hexToRgb(hex) {
|
|
|
376
376
|
b: parseInt(result[3], 16)
|
|
377
377
|
} : { r: 255, g: 255, b: 255 };
|
|
378
378
|
}
|
|
379
|
+
function hexToRgba(hex, alpha) {
|
|
380
|
+
const rgb = hexToRgb(hex);
|
|
381
|
+
return `rgba(${rgb.r}, ${rgb.g}, ${rgb.b}, ${alpha})`;
|
|
382
|
+
}
|
|
379
383
|
|
|
380
384
|
// src/renderer.ts
|
|
381
385
|
function getCanvas2DContext(canvas) {
|
|
@@ -532,9 +536,11 @@ function renderTextEffectCore(ctx, cfg) {
|
|
|
532
536
|
};
|
|
533
537
|
const renderWithShadowTrick = (mode, sColor, sBlur, sOffsetX, sOffsetY, opacity, overrideStyle = "#000", spread = 0) => {
|
|
534
538
|
ctx.save();
|
|
535
|
-
|
|
539
|
+
const normalizedOpacity = Math.max(0, Math.min(100, opacity)) / 100;
|
|
540
|
+
const shadowColor2 = /^#(?:[\da-f]{3}|[\da-f]{6})$/i.test(sColor) ? hexToRgba(sColor, normalizedOpacity) : sColor;
|
|
541
|
+
ctx.globalAlpha = /^#(?:[\da-f]{3}|[\da-f]{6})$/i.test(sColor) ? 1 : normalizedOpacity;
|
|
536
542
|
const shiftX = 1e4;
|
|
537
|
-
ctx.shadowColor =
|
|
543
|
+
ctx.shadowColor = shadowColor2;
|
|
538
544
|
ctx.shadowBlur = sBlur;
|
|
539
545
|
ctx.shadowOffsetX = shiftX + sOffsetX;
|
|
540
546
|
ctx.shadowOffsetY = sOffsetY;
|