ugcinc-render 1.5.30 → 1.5.32

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/index.js CHANGED
@@ -388,51 +388,6 @@ function hexToRgba(hex, opacity = 100) {
388
388
  return `rgba(${r}, ${g}, ${b}, ${opacity / 100})`;
389
389
  }
390
390
 
391
- // src/utils/emoji.ts
392
- var APPLE_EMOJI_CDN_BASE = "https://cdn.jsdelivr.net/npm/emoji-datasource-apple/img/apple/64/";
393
- function emojiToUnified(emoji) {
394
- const codePoints = [];
395
- for (const codePoint of emoji) {
396
- const hex = codePoint.codePointAt(0)?.toString(16);
397
- if (hex) {
398
- codePoints.push(hex);
399
- }
400
- }
401
- return codePoints.join("-");
402
- }
403
- function getAppleEmojiUrl(emoji) {
404
- const unified = emojiToUnified(emoji);
405
- return `${APPLE_EMOJI_CDN_BASE}${unified}.png`;
406
- }
407
- var EMOJI_REGEX = /(?:\p{Emoji_Presentation}|\p{Emoji}\uFE0F)(?:\p{Emoji_Modifier}|\uFE0F|\u200D(?:\p{Emoji_Presentation}|\p{Emoji}\uFE0F)(?:\p{Emoji_Modifier})?)*|\p{Regional_Indicator}{2}/gu;
408
- function splitTextAndEmojis(text) {
409
- const segments = [];
410
- let lastIndex = 0;
411
- EMOJI_REGEX.lastIndex = 0;
412
- let match;
413
- while ((match = EMOJI_REGEX.exec(text)) !== null) {
414
- if (match.index > lastIndex) {
415
- segments.push({
416
- type: "text",
417
- content: text.slice(lastIndex, match.index)
418
- });
419
- }
420
- segments.push({
421
- type: "emoji",
422
- content: match[0],
423
- imageUrl: getAppleEmojiUrl(match[0])
424
- });
425
- lastIndex = match.index + match[0].length;
426
- }
427
- if (lastIndex < text.length) {
428
- segments.push({
429
- type: "text",
430
- content: text.slice(lastIndex)
431
- });
432
- }
433
- return segments;
434
- }
435
-
436
391
  // src/components/TextElement.tsx
437
392
  var import_jsx_runtime = require("react/jsx-runtime");
438
393
  function calculateAutoWidthAndLines({
@@ -731,37 +686,9 @@ function TextElement({ segment, scale = 1 }) {
731
686
  autoWidth,
732
687
  verticalAlign
733
688
  ]);
734
- const hasStroke = strokeWidth > 0 && strokeColor;
735
- const renderTextWithEmojis = (text) => {
736
- if (!hasStroke) {
737
- return text;
738
- }
739
- const segments = splitTextAndEmojis(text);
740
- if (segments.every((s) => s.type === "text")) {
741
- return text;
742
- }
743
- return segments.map((segment2, i) => {
744
- if (segment2.type === "text") {
745
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.default.Fragment, { children: segment2.content }, i);
746
- }
747
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
748
- "span",
749
- {
750
- style: {
751
- textShadow: "none",
752
- WebkitTextStroke: "initial",
753
- // Ensure emoji renders properly
754
- display: "inline"
755
- },
756
- children: segment2.content
757
- },
758
- i
759
- );
760
- });
761
- };
762
689
  if (autoWidth) {
763
690
  const textContent = calculatedLines.map((line, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react.default.Fragment, { children: [
764
- renderTextWithEmojis(line),
691
+ line,
765
692
  index < calculatedLines.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("br", {})
766
693
  ] }, index));
767
694
  if (backgroundColor) {
@@ -780,7 +707,7 @@ function TextElement({ segment, scale = 1 }) {
780
707
  }
781
708
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: positioningContainerStyle, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: { width: calculatedWidth, maxWidth: width }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: textStyle, children: textContent }) }) });
782
709
  }
783
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: positioningContainerStyle, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: backgroundBoxStyle, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: textStyle, children: renderTextWithEmojis(segment.text) }) }) });
710
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: positioningContainerStyle, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: backgroundBoxStyle, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: textStyle, children: segment.text }) }) });
784
711
  }
785
712
 
786
713
  // src/components/ImageElement.tsx
@@ -1877,7 +1804,6 @@ function VideoEditorComposition({
1877
1804
  if (segment.type === "image") {
1878
1805
  const src = getSource(segment);
1879
1806
  if (!src) {
1880
- console.warn(`No source found for image segment: ${segment.id}`);
1881
1807
  return null;
1882
1808
  }
1883
1809
  return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
@@ -1894,7 +1820,6 @@ function VideoEditorComposition({
1894
1820
  if (segment.type === "video") {
1895
1821
  const src = getSource(segment);
1896
1822
  if (!src) {
1897
- console.warn(`No source found for video segment: ${segment.id}`);
1898
1823
  return null;
1899
1824
  }
1900
1825
  return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
package/dist/index.mjs CHANGED
@@ -302,51 +302,6 @@ function hexToRgba(hex, opacity = 100) {
302
302
  return `rgba(${r}, ${g}, ${b}, ${opacity / 100})`;
303
303
  }
304
304
 
305
- // src/utils/emoji.ts
306
- var APPLE_EMOJI_CDN_BASE = "https://cdn.jsdelivr.net/npm/emoji-datasource-apple/img/apple/64/";
307
- function emojiToUnified(emoji) {
308
- const codePoints = [];
309
- for (const codePoint of emoji) {
310
- const hex = codePoint.codePointAt(0)?.toString(16);
311
- if (hex) {
312
- codePoints.push(hex);
313
- }
314
- }
315
- return codePoints.join("-");
316
- }
317
- function getAppleEmojiUrl(emoji) {
318
- const unified = emojiToUnified(emoji);
319
- return `${APPLE_EMOJI_CDN_BASE}${unified}.png`;
320
- }
321
- var EMOJI_REGEX = /(?:\p{Emoji_Presentation}|\p{Emoji}\uFE0F)(?:\p{Emoji_Modifier}|\uFE0F|\u200D(?:\p{Emoji_Presentation}|\p{Emoji}\uFE0F)(?:\p{Emoji_Modifier})?)*|\p{Regional_Indicator}{2}/gu;
322
- function splitTextAndEmojis(text) {
323
- const segments = [];
324
- let lastIndex = 0;
325
- EMOJI_REGEX.lastIndex = 0;
326
- let match;
327
- while ((match = EMOJI_REGEX.exec(text)) !== null) {
328
- if (match.index > lastIndex) {
329
- segments.push({
330
- type: "text",
331
- content: text.slice(lastIndex, match.index)
332
- });
333
- }
334
- segments.push({
335
- type: "emoji",
336
- content: match[0],
337
- imageUrl: getAppleEmojiUrl(match[0])
338
- });
339
- lastIndex = match.index + match[0].length;
340
- }
341
- if (lastIndex < text.length) {
342
- segments.push({
343
- type: "text",
344
- content: text.slice(lastIndex)
345
- });
346
- }
347
- return segments;
348
- }
349
-
350
305
  // src/components/TextElement.tsx
351
306
  import { jsx, jsxs } from "react/jsx-runtime";
352
307
  function calculateAutoWidthAndLines({
@@ -645,37 +600,9 @@ function TextElement({ segment, scale = 1 }) {
645
600
  autoWidth,
646
601
  verticalAlign
647
602
  ]);
648
- const hasStroke = strokeWidth > 0 && strokeColor;
649
- const renderTextWithEmojis = (text) => {
650
- if (!hasStroke) {
651
- return text;
652
- }
653
- const segments = splitTextAndEmojis(text);
654
- if (segments.every((s) => s.type === "text")) {
655
- return text;
656
- }
657
- return segments.map((segment2, i) => {
658
- if (segment2.type === "text") {
659
- return /* @__PURE__ */ jsx(React.Fragment, { children: segment2.content }, i);
660
- }
661
- return /* @__PURE__ */ jsx(
662
- "span",
663
- {
664
- style: {
665
- textShadow: "none",
666
- WebkitTextStroke: "initial",
667
- // Ensure emoji renders properly
668
- display: "inline"
669
- },
670
- children: segment2.content
671
- },
672
- i
673
- );
674
- });
675
- };
676
603
  if (autoWidth) {
677
604
  const textContent = calculatedLines.map((line, index) => /* @__PURE__ */ jsxs(React.Fragment, { children: [
678
- renderTextWithEmojis(line),
605
+ line,
679
606
  index < calculatedLines.length - 1 && /* @__PURE__ */ jsx("br", {})
680
607
  ] }, index));
681
608
  if (backgroundColor) {
@@ -694,7 +621,7 @@ function TextElement({ segment, scale = 1 }) {
694
621
  }
695
622
  return /* @__PURE__ */ jsx("div", { style: positioningContainerStyle, children: /* @__PURE__ */ jsx("div", { style: { width: calculatedWidth, maxWidth: width }, children: /* @__PURE__ */ jsx("div", { style: textStyle, children: textContent }) }) });
696
623
  }
697
- return /* @__PURE__ */ jsx("div", { style: positioningContainerStyle, children: /* @__PURE__ */ jsx("div", { style: backgroundBoxStyle, children: /* @__PURE__ */ jsx("div", { style: textStyle, children: renderTextWithEmojis(segment.text) }) }) });
624
+ return /* @__PURE__ */ jsx("div", { style: positioningContainerStyle, children: /* @__PURE__ */ jsx("div", { style: backgroundBoxStyle, children: /* @__PURE__ */ jsx("div", { style: textStyle, children: segment.text }) }) });
698
625
  }
699
626
 
700
627
  // src/components/ImageElement.tsx
@@ -1791,7 +1718,6 @@ function VideoEditorComposition({
1791
1718
  if (segment.type === "image") {
1792
1719
  const src = getSource(segment);
1793
1720
  if (!src) {
1794
- console.warn(`No source found for image segment: ${segment.id}`);
1795
1721
  return null;
1796
1722
  }
1797
1723
  return /* @__PURE__ */ jsx5(
@@ -1808,7 +1734,6 @@ function VideoEditorComposition({
1808
1734
  if (segment.type === "video") {
1809
1735
  const src = getSource(segment);
1810
1736
  if (!src) {
1811
- console.warn(`No source found for video segment: ${segment.id}`);
1812
1737
  return null;
1813
1738
  }
1814
1739
  return /* @__PURE__ */ jsx5(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ugcinc-render",
3
- "version": "1.5.30",
3
+ "version": "1.5.32",
4
4
  "description": "Unified rendering package for UGC Inc - shared types, components, and compositions for pixel-perfect client/server rendering",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",