@agentiffai/design 0.1.8 → 0.1.10
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 +159 -15
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +32 -0
- package/dist/index.d.ts +32 -0
- package/dist/index.js +159 -15
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -7828,22 +7828,35 @@ var ActionButton5 = styled11__default.default.button`
|
|
|
7828
7828
|
}
|
|
7829
7829
|
}}
|
|
7830
7830
|
`;
|
|
7831
|
-
var PostPreviewCard = ({
|
|
7831
|
+
var PostPreviewCard = ({
|
|
7832
|
+
post,
|
|
7833
|
+
isActive = false,
|
|
7834
|
+
isEditing = false,
|
|
7835
|
+
editContent,
|
|
7836
|
+
onContentChange,
|
|
7837
|
+
isLoading = false
|
|
7838
|
+
}) => {
|
|
7832
7839
|
const platformConfig = PLATFORM_CONFIGS[post.platform];
|
|
7840
|
+
const showSkeleton = isLoading && !post.content;
|
|
7841
|
+
const displayContent = isEditing && editContent !== void 0 ? editContent : post.editedContent || post.content;
|
|
7842
|
+
const currentCharCount = displayContent.length;
|
|
7833
7843
|
const charPercentage = react.useMemo(
|
|
7834
|
-
() => getCharacterLimitPercentage(post.platform,
|
|
7835
|
-
[post.platform,
|
|
7844
|
+
() => getCharacterLimitPercentage(post.platform, currentCharCount),
|
|
7845
|
+
[post.platform, currentCharCount]
|
|
7836
7846
|
);
|
|
7837
7847
|
const charLimitColorClass = react.useMemo(
|
|
7838
7848
|
() => getCharacterLimitColor(charPercentage),
|
|
7839
7849
|
[charPercentage]
|
|
7840
7850
|
);
|
|
7841
|
-
const
|
|
7842
|
-
const
|
|
7851
|
+
const charCountDisplay = `${currentCharCount}/${platformConfig.maxChars}`;
|
|
7852
|
+
const handleContentChange = (e) => {
|
|
7853
|
+
onContentChange?.(e.target.value);
|
|
7854
|
+
};
|
|
7843
7855
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7844
7856
|
CardContainer,
|
|
7845
7857
|
{
|
|
7846
7858
|
$isActive: isActive,
|
|
7859
|
+
$isEditing: isEditing,
|
|
7847
7860
|
$platformColor: platformConfig.color,
|
|
7848
7861
|
"data-testid": "post-preview-card",
|
|
7849
7862
|
children: [
|
|
@@ -7853,8 +7866,22 @@ var PostPreviewCard = ({ post, isActive = false }) => {
|
|
|
7853
7866
|
/* @__PURE__ */ jsxRuntime.jsx(CharacterBadge, { $colorClass: charLimitColorClass, children: charCountDisplay })
|
|
7854
7867
|
] }),
|
|
7855
7868
|
/* @__PURE__ */ jsxRuntime.jsxs(ContentSection, { children: [
|
|
7856
|
-
/* @__PURE__ */ jsxRuntime.
|
|
7857
|
-
|
|
7869
|
+
showSkeleton ? /* @__PURE__ */ jsxRuntime.jsxs(SkeletonContent, { children: [
|
|
7870
|
+
/* @__PURE__ */ jsxRuntime.jsx(SkeletonLine, { $width: "100%" }),
|
|
7871
|
+
/* @__PURE__ */ jsxRuntime.jsx(SkeletonLine, { $width: "95%" }),
|
|
7872
|
+
/* @__PURE__ */ jsxRuntime.jsx(SkeletonLine, { $width: "88%" }),
|
|
7873
|
+
/* @__PURE__ */ jsxRuntime.jsx(SkeletonLine, { $width: "70%" })
|
|
7874
|
+
] }) : isEditing ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
7875
|
+
PostContentEditable,
|
|
7876
|
+
{
|
|
7877
|
+
value: displayContent,
|
|
7878
|
+
onChange: handleContentChange,
|
|
7879
|
+
placeholder: "Enter your post content...",
|
|
7880
|
+
$platformColor: platformConfig.color,
|
|
7881
|
+
autoFocus: true
|
|
7882
|
+
}
|
|
7883
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(PostContent, { children: displayContent }),
|
|
7884
|
+
!showSkeleton && post.hashtags.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(HashtagsContainer, { children: post.hashtags.map((hashtag) => /* @__PURE__ */ jsxRuntime.jsxs(HashtagPill, { $platformColor: platformConfig.color, children: [
|
|
7858
7885
|
"#",
|
|
7859
7886
|
hashtag.replace(/^#/, "")
|
|
7860
7887
|
] }, hashtag)) })
|
|
@@ -7878,8 +7905,8 @@ var CardContainer = styled11__default.default.div`
|
|
|
7878
7905
|
padding: ${tokens.spacing.md};
|
|
7879
7906
|
position: relative;
|
|
7880
7907
|
transition: all ${tokens.transitions.normal};
|
|
7881
|
-
border: 2px solid ${({ $isActive, $platformColor }) => $isActive ? $platformColor : tokens.colors.border.default};
|
|
7882
|
-
box-shadow: ${({ $isActive, $platformColor }) => $isActive ? `${tokens.shadows.lg}, 0 4px 12px ${$platformColor}33` : tokens.shadows.md};
|
|
7908
|
+
border: 2px solid ${({ $isActive, $isEditing, $platformColor }) => $isEditing ? $platformColor : $isActive ? $platformColor : tokens.colors.border.default};
|
|
7909
|
+
box-shadow: ${({ $isActive, $isEditing, $platformColor }) => $isEditing ? `${tokens.shadows.lg}, 0 4px 16px ${$platformColor}40` : $isActive ? `${tokens.shadows.lg}, 0 4px 12px ${$platformColor}33` : tokens.shadows.md};
|
|
7883
7910
|
|
|
7884
7911
|
&:hover {
|
|
7885
7912
|
border-color: ${({ $platformColor }) => `${$platformColor}80`};
|
|
@@ -7936,6 +7963,35 @@ var PostContent = styled11__default.default.div`
|
|
|
7936
7963
|
margin-bottom: ${tokens.spacing.sm};
|
|
7937
7964
|
letter-spacing: 0.01em;
|
|
7938
7965
|
`;
|
|
7966
|
+
var PostContentEditable = styled11__default.default.textarea`
|
|
7967
|
+
width: 100%;
|
|
7968
|
+
min-height: 180px;
|
|
7969
|
+
max-height: 300px;
|
|
7970
|
+
font-size: ${tokens.typography.fontSize.base};
|
|
7971
|
+
font-family: ${tokens.typography.fontFamily.primary};
|
|
7972
|
+
line-height: 1.6;
|
|
7973
|
+
color: ${tokens.colors.text.primary};
|
|
7974
|
+
background: ${tokens.colors.background.darker};
|
|
7975
|
+
border: 1px solid ${tokens.colors.border.default};
|
|
7976
|
+
border-radius: ${tokens.borderRadius.md};
|
|
7977
|
+
padding: ${tokens.spacing.md};
|
|
7978
|
+
margin-bottom: ${tokens.spacing.sm};
|
|
7979
|
+
letter-spacing: 0.01em;
|
|
7980
|
+
resize: vertical;
|
|
7981
|
+
box-sizing: border-box;
|
|
7982
|
+
transition: border-color ${tokens.transitions.fast}, box-shadow ${tokens.transitions.fast};
|
|
7983
|
+
overflow-y: auto;
|
|
7984
|
+
|
|
7985
|
+
&:focus {
|
|
7986
|
+
outline: none;
|
|
7987
|
+
border-color: ${({ $platformColor }) => $platformColor};
|
|
7988
|
+
box-shadow: 0 0 0 2px ${({ $platformColor }) => `${$platformColor}30`};
|
|
7989
|
+
}
|
|
7990
|
+
|
|
7991
|
+
&::placeholder {
|
|
7992
|
+
color: ${tokens.colors.text.tertiary};
|
|
7993
|
+
}
|
|
7994
|
+
`;
|
|
7939
7995
|
var HashtagsContainer = styled11__default.default.div`
|
|
7940
7996
|
display: flex;
|
|
7941
7997
|
flex-wrap: wrap;
|
|
@@ -7992,7 +8048,41 @@ var ImagePreview = styled11__default.default.img`
|
|
|
7992
8048
|
object-fit: cover;
|
|
7993
8049
|
display: block;
|
|
7994
8050
|
`;
|
|
7995
|
-
var
|
|
8051
|
+
var shimmer = styled11.keyframes`
|
|
8052
|
+
0% {
|
|
8053
|
+
background-position: -200% 0;
|
|
8054
|
+
}
|
|
8055
|
+
100% {
|
|
8056
|
+
background-position: 200% 0;
|
|
8057
|
+
}
|
|
8058
|
+
`;
|
|
8059
|
+
var SkeletonContent = styled11__default.default.div`
|
|
8060
|
+
display: flex;
|
|
8061
|
+
flex-direction: column;
|
|
8062
|
+
gap: ${tokens.spacing.sm};
|
|
8063
|
+
padding: ${tokens.spacing.sm} 0;
|
|
8064
|
+
`;
|
|
8065
|
+
var SkeletonLine = styled11__default.default.div`
|
|
8066
|
+
height: 16px;
|
|
8067
|
+
width: ${({ $width }) => $width};
|
|
8068
|
+
background: linear-gradient(
|
|
8069
|
+
90deg,
|
|
8070
|
+
${tokens.colors.border.default} 0%,
|
|
8071
|
+
rgba(255, 255, 255, 0.15) 50%,
|
|
8072
|
+
${tokens.colors.border.default} 100%
|
|
8073
|
+
);
|
|
8074
|
+
background-size: 200% 100%;
|
|
8075
|
+
border-radius: ${tokens.borderRadius.sm};
|
|
8076
|
+
animation: ${shimmer} 1.5s ease-in-out infinite;
|
|
8077
|
+
`;
|
|
8078
|
+
var PlatformCarousel = ({
|
|
8079
|
+
posts,
|
|
8080
|
+
onActiveChange,
|
|
8081
|
+
editingIndex,
|
|
8082
|
+
editContent,
|
|
8083
|
+
onEditContentChange,
|
|
8084
|
+
isLoading = false
|
|
8085
|
+
}) => {
|
|
7996
8086
|
const [activeIndex, setActiveIndex] = react.useState(0);
|
|
7997
8087
|
react.useEffect(() => {
|
|
7998
8088
|
if (activeIndex >= posts.length && posts.length > 0) {
|
|
@@ -8029,7 +8119,20 @@ var PlatformCarousel = ({ posts, onActiveChange }) => {
|
|
|
8029
8119
|
`${post.platform}-${index}`
|
|
8030
8120
|
);
|
|
8031
8121
|
}) }),
|
|
8032
|
-
/* @__PURE__ */ jsxRuntime.jsx(ContentContainer2, { children: posts.map((post, index) =>
|
|
8122
|
+
/* @__PURE__ */ jsxRuntime.jsx(ContentContainer2, { children: posts.map((post, index) => {
|
|
8123
|
+
const isEditing = editingIndex === index;
|
|
8124
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Slide, { $isActive: index === activeIndex, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
8125
|
+
PostPreviewCard,
|
|
8126
|
+
{
|
|
8127
|
+
post,
|
|
8128
|
+
isActive: index === activeIndex,
|
|
8129
|
+
isEditing,
|
|
8130
|
+
editContent: isEditing ? editContent : void 0,
|
|
8131
|
+
onContentChange: isEditing ? onEditContentChange : void 0,
|
|
8132
|
+
isLoading
|
|
8133
|
+
}
|
|
8134
|
+
) }, `slide-${post.platform}-${index}`);
|
|
8135
|
+
}) }),
|
|
8033
8136
|
posts.length > 1 && /* @__PURE__ */ jsxRuntime.jsx(NavigationDotsContainer, { children: posts.map((post, index) => {
|
|
8034
8137
|
const config = PLATFORM_CONFIGS[post.platform];
|
|
8035
8138
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -8148,11 +8251,29 @@ var EmptyState = styled11__default.default.div`
|
|
|
8148
8251
|
font-family: inherit;
|
|
8149
8252
|
font-size: ${tokens.typography.fontSize.sm};
|
|
8150
8253
|
`;
|
|
8151
|
-
var PlatformGrid = ({
|
|
8254
|
+
var PlatformGrid = ({
|
|
8255
|
+
posts,
|
|
8256
|
+
editingIndex,
|
|
8257
|
+
editContent,
|
|
8258
|
+
onEditContentChange,
|
|
8259
|
+
isLoading = false
|
|
8260
|
+
}) => {
|
|
8152
8261
|
if (posts.length === 0) {
|
|
8153
8262
|
return /* @__PURE__ */ jsxRuntime.jsx(EmptyState2, { children: /* @__PURE__ */ jsxRuntime.jsx(EmptyStateText, { children: "No posts to display" }) });
|
|
8154
8263
|
}
|
|
8155
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Grid, { "data-testid": "platform-grid", children: posts.map((post) =>
|
|
8264
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Grid, { "data-testid": "platform-grid", children: posts.map((post, index) => {
|
|
8265
|
+
const isEditing = editingIndex === index;
|
|
8266
|
+
return /* @__PURE__ */ jsxRuntime.jsx(GridCell, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
8267
|
+
PostPreviewCard,
|
|
8268
|
+
{
|
|
8269
|
+
post,
|
|
8270
|
+
isEditing,
|
|
8271
|
+
editContent: isEditing ? editContent : void 0,
|
|
8272
|
+
onContentChange: isEditing ? onEditContentChange : void 0,
|
|
8273
|
+
isLoading
|
|
8274
|
+
}
|
|
8275
|
+
) }, post.platform);
|
|
8276
|
+
}) });
|
|
8156
8277
|
};
|
|
8157
8278
|
PlatformGrid.displayName = "PlatformGrid";
|
|
8158
8279
|
var Grid = styled11__default.default.div`
|
|
@@ -8289,7 +8410,11 @@ var SocialMediaCanvas = ({
|
|
|
8289
8410
|
emptyTitle = "No Posts Yet",
|
|
8290
8411
|
emptyDescription = "Generate social media posts to see them here.",
|
|
8291
8412
|
onActiveChange,
|
|
8292
|
-
showViewToggle = true
|
|
8413
|
+
showViewToggle = true,
|
|
8414
|
+
editingIndex,
|
|
8415
|
+
editContent,
|
|
8416
|
+
onEditContentChange,
|
|
8417
|
+
isLoading = false
|
|
8293
8418
|
}) => {
|
|
8294
8419
|
const [viewMode, setViewMode] = react.useState(initialViewMode);
|
|
8295
8420
|
const handleActiveChange = (index) => {
|
|
@@ -8334,7 +8459,26 @@ var SocialMediaCanvas = ({
|
|
|
8334
8459
|
)
|
|
8335
8460
|
] })
|
|
8336
8461
|
] }),
|
|
8337
|
-
/* @__PURE__ */ jsxRuntime.jsx(Content4, { children: viewMode === "carousel" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
8462
|
+
/* @__PURE__ */ jsxRuntime.jsx(Content4, { children: viewMode === "carousel" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
8463
|
+
PlatformCarousel,
|
|
8464
|
+
{
|
|
8465
|
+
posts,
|
|
8466
|
+
onActiveChange: handleActiveChange,
|
|
8467
|
+
editingIndex,
|
|
8468
|
+
editContent,
|
|
8469
|
+
onEditContentChange,
|
|
8470
|
+
isLoading
|
|
8471
|
+
}
|
|
8472
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
8473
|
+
PlatformGrid,
|
|
8474
|
+
{
|
|
8475
|
+
posts,
|
|
8476
|
+
editingIndex,
|
|
8477
|
+
editContent,
|
|
8478
|
+
onEditContentChange,
|
|
8479
|
+
isLoading
|
|
8480
|
+
}
|
|
8481
|
+
) })
|
|
8338
8482
|
] });
|
|
8339
8483
|
};
|
|
8340
8484
|
SocialMediaCanvas.displayName = "SocialMediaCanvas";
|