@agentiffai/design 1.5.1 → 1.5.2
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.cjs +13 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +13 -10
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -666,7 +666,7 @@ interface PostPreviewCardProps {
|
|
|
666
666
|
onContentChange?: (content: string) => void;
|
|
667
667
|
/** Current edited hashtags (controlled) */
|
|
668
668
|
editHashtags?: string[];
|
|
669
|
-
/** Callback when hashtags change
|
|
669
|
+
/** Callback when hashtags change */
|
|
670
670
|
onHashtagsChange?: (hashtags: string[]) => void;
|
|
671
671
|
/** Show loading skeleton when content is being generated */
|
|
672
672
|
isLoading?: boolean;
|
package/dist/index.d.ts
CHANGED
|
@@ -666,7 +666,7 @@ interface PostPreviewCardProps {
|
|
|
666
666
|
onContentChange?: (content: string) => void;
|
|
667
667
|
/** Current edited hashtags (controlled) */
|
|
668
668
|
editHashtags?: string[];
|
|
669
|
-
/** Callback when hashtags change
|
|
669
|
+
/** Callback when hashtags change */
|
|
670
670
|
onHashtagsChange?: (hashtags: string[]) => void;
|
|
671
671
|
/** Show loading skeleton when content is being generated */
|
|
672
672
|
isLoading?: boolean;
|
package/dist/index.js
CHANGED
|
@@ -9947,7 +9947,7 @@ var PostPreviewCard = ({
|
|
|
9947
9947
|
const [newHashtag, setNewHashtag] = useState("");
|
|
9948
9948
|
const showSkeleton = isLoading && !post.content;
|
|
9949
9949
|
const displayContent = isEditing && editContent !== void 0 ? editContent : post.editedContent || post.content;
|
|
9950
|
-
const displayHashtags =
|
|
9950
|
+
const displayHashtags = editHashtags !== void 0 ? editHashtags : post.hashtags;
|
|
9951
9951
|
const currentCharCount = displayContent.length;
|
|
9952
9952
|
const charPercentage = useMemo(
|
|
9953
9953
|
() => getCharacterLimitPercentage(post.platform, currentCharCount),
|
|
@@ -10016,11 +10016,11 @@ var PostPreviewCard = ({
|
|
|
10016
10016
|
autoFocus: true
|
|
10017
10017
|
}
|
|
10018
10018
|
) : /* @__PURE__ */ jsx(PostContent, { children: displayContent }),
|
|
10019
|
-
!showSkeleton && (displayHashtags.length > 0 ||
|
|
10019
|
+
!showSkeleton && (displayHashtags.length > 0 || onHashtagsChange) && /* @__PURE__ */ jsxs(HashtagsContainer, { children: [
|
|
10020
10020
|
displayHashtags.map((hashtag) => /* @__PURE__ */ jsxs(HashtagPill, { $platformColor: platformConfig.color, children: [
|
|
10021
10021
|
"#",
|
|
10022
10022
|
hashtag.replace(/^#/, ""),
|
|
10023
|
-
|
|
10023
|
+
onHashtagsChange && /* @__PURE__ */ jsx(
|
|
10024
10024
|
RemoveHashtagButton,
|
|
10025
10025
|
{
|
|
10026
10026
|
type: "button",
|
|
@@ -10030,7 +10030,7 @@ var PostPreviewCard = ({
|
|
|
10030
10030
|
}
|
|
10031
10031
|
)
|
|
10032
10032
|
] }, hashtag)),
|
|
10033
|
-
|
|
10033
|
+
onHashtagsChange && /* @__PURE__ */ jsxs(HashtagEditor, { children: [
|
|
10034
10034
|
/* @__PURE__ */ jsxs(HashtagInputWrapper, { children: [
|
|
10035
10035
|
/* @__PURE__ */ jsx(HashPrefix, { children: "#" }),
|
|
10036
10036
|
/* @__PURE__ */ jsx(
|
|
@@ -10580,16 +10580,18 @@ var PlatformCarousel = ({
|
|
|
10580
10580
|
}) }),
|
|
10581
10581
|
/* @__PURE__ */ jsx(ContentContainer2, { children: posts.map((post, index) => {
|
|
10582
10582
|
const isEditing = editingIndex === index;
|
|
10583
|
-
|
|
10583
|
+
const isActive = index === activeIndex;
|
|
10584
|
+
const canEditHashtags = isActive && !!onEditHashtagsChange;
|
|
10585
|
+
return /* @__PURE__ */ jsx(Slide, { $isActive: isActive, children: /* @__PURE__ */ jsx(
|
|
10584
10586
|
PostPreviewCard,
|
|
10585
10587
|
{
|
|
10586
10588
|
post,
|
|
10587
|
-
isActive
|
|
10589
|
+
isActive,
|
|
10588
10590
|
isEditing,
|
|
10589
10591
|
editContent: isEditing ? editContent : void 0,
|
|
10590
10592
|
onContentChange: isEditing ? onEditContentChange : void 0,
|
|
10591
|
-
editHashtags:
|
|
10592
|
-
onHashtagsChange:
|
|
10593
|
+
editHashtags: canEditHashtags ? editHashtags : void 0,
|
|
10594
|
+
onHashtagsChange: canEditHashtags ? onEditHashtagsChange : void 0,
|
|
10593
10595
|
isLoading,
|
|
10594
10596
|
onImageChange: onImageChangeRequest ? () => onImageChangeRequest(index) : void 0
|
|
10595
10597
|
}
|
|
@@ -10737,6 +10739,7 @@ var PlatformGrid = ({
|
|
|
10737
10739
|
return /* @__PURE__ */ jsx(Grid, { "data-testid": "platform-grid", children: posts.map((post, index) => {
|
|
10738
10740
|
const isEditing = editingIndex === index;
|
|
10739
10741
|
const isActive = activeIndex === index;
|
|
10742
|
+
const canEditHashtags = isActive && !!onEditHashtagsChange;
|
|
10740
10743
|
return /* @__PURE__ */ jsx(
|
|
10741
10744
|
GridCell,
|
|
10742
10745
|
{
|
|
@@ -10762,8 +10765,8 @@ var PlatformGrid = ({
|
|
|
10762
10765
|
isEditing,
|
|
10763
10766
|
editContent: isEditing ? editContent : void 0,
|
|
10764
10767
|
onContentChange: isEditing ? onEditContentChange : void 0,
|
|
10765
|
-
editHashtags:
|
|
10766
|
-
onHashtagsChange:
|
|
10768
|
+
editHashtags: canEditHashtags ? editHashtags : void 0,
|
|
10769
|
+
onHashtagsChange: canEditHashtags ? onEditHashtagsChange : void 0,
|
|
10767
10770
|
isLoading,
|
|
10768
10771
|
onImageChange: onImageChangeRequest ? () => onImageChangeRequest(index) : void 0
|
|
10769
10772
|
}
|