@retor/react-native 0.4.2 → 0.4.3

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.d.mts CHANGED
@@ -21,6 +21,8 @@ interface RetorTag {
21
21
  progress?: number;
22
22
  /** Profile image URL. For notes rendered with `icon` tag type, replaces the icon with a circular avatar. */
23
23
  avatarUrl?: string;
24
+ /** Display name of the note's author. Used for the initial-letter fallback when `avatarUrl` is absent. */
25
+ authorName?: string;
24
26
  }
25
27
  interface RetorLine {
26
28
  _id: string;
package/dist/index.d.ts CHANGED
@@ -21,6 +21,8 @@ interface RetorTag {
21
21
  progress?: number;
22
22
  /** Profile image URL. For notes rendered with `icon` tag type, replaces the icon with a circular avatar. */
23
23
  avatarUrl?: string;
24
+ /** Display name of the note's author. Used for the initial-letter fallback when `avatarUrl` is absent. */
25
+ authorName?: string;
24
26
  }
25
27
  interface RetorLine {
26
28
  _id: string;
package/dist/index.js CHANGED
@@ -579,12 +579,9 @@ var import_lucide_react_native2 = require("lucide-react-native");
579
579
 
580
580
  // src/lineProgress.ts
581
581
  function mergeLineTagsByProgress(controls, notes) {
582
- const sortedControls = [...controls].sort((a, b) => (a.index ?? 0) - (b.index ?? 0));
583
- const lastIdx = Math.max(1, sortedControls.length - 1);
584
582
  const merged = [];
585
- for (const c of sortedControls) {
586
- const idx = c.index ?? 0;
587
- merged.push({ ...c, _isNote: false, progress: idx / lastIdx });
583
+ for (const c of controls) {
584
+ merged.push({ ...c, _isNote: false, progress: c.progress ?? 0 });
588
585
  }
589
586
  for (const n of notes) {
590
587
  merged.push({ ...n, _isNote: true, progress: n.progress ?? 0 });
@@ -733,12 +730,14 @@ function DefaultLineTagList({ listHeader }) {
733
730
  }
734
731
  function DefaultTagItem({ tag, isActive }) {
735
732
  const { controls, openAddNote } = useRetorBridge();
733
+ const initial = tag.authorName?.trim().charAt(0).toUpperCase();
736
734
  return /* @__PURE__ */ import_react6.default.createElement(
737
735
  import_react_native5.Pressable,
738
736
  {
739
737
  onPress: () => controls.scrollToTag(tag._id),
740
738
  style: [styles3.tagItem, isActive && styles3.tagItemActive]
741
739
  },
740
+ tag.avatarUrl ? /* @__PURE__ */ import_react6.default.createElement(import_react_native5.Image, { source: { uri: tag.avatarUrl }, style: styles3.tagAvatar }) : initial ? /* @__PURE__ */ import_react6.default.createElement(import_react_native5.View, { style: styles3.tagInitial }, /* @__PURE__ */ import_react6.default.createElement(import_react_native5.Text, { style: styles3.tagInitialText }, initial)) : null,
742
741
  /* @__PURE__ */ import_react6.default.createElement(import_react_native5.View, { style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ import_react6.default.createElement(import_react_native5.Text, { style: [styles3.tagText, isActive && styles3.tagTextActive], numberOfLines: 1 }, tag.name), isActive && tag.description && /* @__PURE__ */ import_react6.default.createElement(import_react_native5.Text, { style: styles3.tagDescription, numberOfLines: 2 }, tag.description)),
743
742
  tag.subtitle && /* @__PURE__ */ import_react6.default.createElement(import_react_native5.Text, { style: styles3.tagSubtitle, numberOfLines: 1 }, tag.subtitle),
744
743
  isActive && /* @__PURE__ */ import_react6.default.createElement(
@@ -788,6 +787,16 @@ var styles3 = import_react_native5.StyleSheet.create({
788
787
  gap: 8
789
788
  },
790
789
  tagItemActive: { backgroundColor: "rgba(255,255,255,0.1)" },
790
+ tagAvatar: { width: 22, height: 22, borderRadius: 11 },
791
+ tagInitial: {
792
+ width: 22,
793
+ height: 22,
794
+ borderRadius: 11,
795
+ backgroundColor: "rgba(255,255,255,0.15)",
796
+ alignItems: "center",
797
+ justifyContent: "center"
798
+ },
799
+ tagInitialText: { color: "white", fontSize: 11, fontWeight: "700" },
791
800
  tagText: { color: "rgba(255,255,255,0.6)", fontSize: 13 },
792
801
  tagTextActive: { color: "white", fontWeight: "600" },
793
802
  tagDescription: { color: "rgba(255,255,255,0.4)", fontSize: 11, marginTop: 2, lineHeight: 14 },
package/dist/index.mjs CHANGED
@@ -528,7 +528,7 @@ var styles2 = StyleSheet4.create({
528
528
 
529
529
  // src/LineDetailSheet.tsx
530
530
  import React6, { useCallback as useCallback2, useEffect as useEffect3, useMemo as useMemo4, useRef as useRef3, useState as useState3 } from "react";
531
- import { Pressable as Pressable2, StyleSheet as StyleSheet5, Text as Text2, View as View5 } from "react-native";
531
+ import { Image, Pressable as Pressable2, StyleSheet as StyleSheet5, Text as Text2, View as View5 } from "react-native";
532
532
  import {
533
533
  BottomSheetBackdrop as BottomSheetBackdrop2,
534
534
  BottomSheetFooter,
@@ -540,12 +540,9 @@ import { ArrowDown as ArrowDown2, ArrowUp as ArrowUp2, Pause, Play, Plus } from
540
540
 
541
541
  // src/lineProgress.ts
542
542
  function mergeLineTagsByProgress(controls, notes) {
543
- const sortedControls = [...controls].sort((a, b) => (a.index ?? 0) - (b.index ?? 0));
544
- const lastIdx = Math.max(1, sortedControls.length - 1);
545
543
  const merged = [];
546
- for (const c of sortedControls) {
547
- const idx = c.index ?? 0;
548
- merged.push({ ...c, _isNote: false, progress: idx / lastIdx });
544
+ for (const c of controls) {
545
+ merged.push({ ...c, _isNote: false, progress: c.progress ?? 0 });
549
546
  }
550
547
  for (const n of notes) {
551
548
  merged.push({ ...n, _isNote: true, progress: n.progress ?? 0 });
@@ -694,12 +691,14 @@ function DefaultLineTagList({ listHeader }) {
694
691
  }
695
692
  function DefaultTagItem({ tag, isActive }) {
696
693
  const { controls, openAddNote } = useRetorBridge();
694
+ const initial = tag.authorName?.trim().charAt(0).toUpperCase();
697
695
  return /* @__PURE__ */ React6.createElement(
698
696
  Pressable2,
699
697
  {
700
698
  onPress: () => controls.scrollToTag(tag._id),
701
699
  style: [styles3.tagItem, isActive && styles3.tagItemActive]
702
700
  },
701
+ tag.avatarUrl ? /* @__PURE__ */ React6.createElement(Image, { source: { uri: tag.avatarUrl }, style: styles3.tagAvatar }) : initial ? /* @__PURE__ */ React6.createElement(View5, { style: styles3.tagInitial }, /* @__PURE__ */ React6.createElement(Text2, { style: styles3.tagInitialText }, initial)) : null,
703
702
  /* @__PURE__ */ React6.createElement(View5, { style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ React6.createElement(Text2, { style: [styles3.tagText, isActive && styles3.tagTextActive], numberOfLines: 1 }, tag.name), isActive && tag.description && /* @__PURE__ */ React6.createElement(Text2, { style: styles3.tagDescription, numberOfLines: 2 }, tag.description)),
704
703
  tag.subtitle && /* @__PURE__ */ React6.createElement(Text2, { style: styles3.tagSubtitle, numberOfLines: 1 }, tag.subtitle),
705
704
  isActive && /* @__PURE__ */ React6.createElement(
@@ -749,6 +748,16 @@ var styles3 = StyleSheet5.create({
749
748
  gap: 8
750
749
  },
751
750
  tagItemActive: { backgroundColor: "rgba(255,255,255,0.1)" },
751
+ tagAvatar: { width: 22, height: 22, borderRadius: 11 },
752
+ tagInitial: {
753
+ width: 22,
754
+ height: 22,
755
+ borderRadius: 11,
756
+ backgroundColor: "rgba(255,255,255,0.15)",
757
+ alignItems: "center",
758
+ justifyContent: "center"
759
+ },
760
+ tagInitialText: { color: "white", fontSize: 11, fontWeight: "700" },
752
761
  tagText: { color: "rgba(255,255,255,0.6)", fontSize: 13 },
753
762
  tagTextActive: { color: "white", fontWeight: "600" },
754
763
  tagDescription: { color: "rgba(255,255,255,0.4)", fontSize: 11, marginTop: 2, lineHeight: 14 },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@retor/react-native",
3
- "version": "0.4.2",
3
+ "version": "0.4.3",
4
4
  "description": "React Native SDK for embedding Retor 3D experiences",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",