@agentiffai/design 1.3.14 → 1.3.16
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/copilotkit/index.cjs +7 -3
- package/dist/copilotkit/index.cjs.map +1 -1
- package/dist/copilotkit/index.js +7 -3
- package/dist/copilotkit/index.js.map +1 -1
- package/dist/index.cjs +51 -23
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +51 -23
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5460,7 +5460,7 @@ var Input2 = ({
|
|
|
5460
5460
|
};
|
|
5461
5461
|
function parseMarkdown(text) {
|
|
5462
5462
|
if (!text) return [];
|
|
5463
|
-
text = text.replace(/<!--TOOL_CALL:[
|
|
5463
|
+
text = text.replace(/<!--TOOL_CALL:[^:]+:[\s\S]+?-->/g, "").replace(/__TOOL_CALL__:[^:]+:\{[^}]*(?:\{[^}]*\}[^}]*)*\}/g, "").replace(/<!--TOOL_CALL:[\s\S]*$/g, "").replace(/__TOOL_CALL__:[\s\S]*$/g, "");
|
|
5464
5464
|
const elements = [];
|
|
5465
5465
|
let key = 0;
|
|
5466
5466
|
const paragraphs = text.split(/\n\n+/);
|
|
@@ -8265,9 +8265,9 @@ var ProgressFill = styled47.div`
|
|
|
8265
8265
|
}};
|
|
8266
8266
|
`;
|
|
8267
8267
|
var Actions3 = styled47.div`
|
|
8268
|
-
display:
|
|
8269
|
-
grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
|
|
8268
|
+
display: flex;
|
|
8270
8269
|
gap: ${tokens.spacing.sm};
|
|
8270
|
+
justify-content: flex-end;
|
|
8271
8271
|
`;
|
|
8272
8272
|
var ActionButton5 = styled47.button`
|
|
8273
8273
|
padding: ${tokens.spacing.sm} ${tokens.spacing.md};
|
|
@@ -8275,9 +8275,11 @@ var ActionButton5 = styled47.button`
|
|
|
8275
8275
|
font-size: ${tokens.typography.fontSize.sm};
|
|
8276
8276
|
font-weight: ${tokens.typography.fontWeight.semibold};
|
|
8277
8277
|
cursor: pointer;
|
|
8278
|
-
transition:
|
|
8278
|
+
transition: background ${tokens.transitions.fast}, opacity ${tokens.transitions.fast};
|
|
8279
8279
|
border: none;
|
|
8280
8280
|
white-space: nowrap;
|
|
8281
|
+
min-width: 90px;
|
|
8282
|
+
text-align: center;
|
|
8281
8283
|
|
|
8282
8284
|
&:disabled {
|
|
8283
8285
|
opacity: 0.5;
|
|
@@ -9262,6 +9264,29 @@ function truncateText(text, maxLength) {
|
|
|
9262
9264
|
function getSubredditUrl(subreddit) {
|
|
9263
9265
|
return `https://www.reddit.com/r/${subreddit}`;
|
|
9264
9266
|
}
|
|
9267
|
+
var renderSimpleMarkdown = (text) => {
|
|
9268
|
+
if (!text) return null;
|
|
9269
|
+
let processed = text;
|
|
9270
|
+
processed = processed.replace(/\*\*(.+?)\*\*/g, "{{BOLD:$1}}");
|
|
9271
|
+
processed = processed.replace(/\*(.+?)\*/g, "{{ITALIC:$1}}");
|
|
9272
|
+
processed = processed.replace(/`(.+?)`/g, "{{CODE:$1}}");
|
|
9273
|
+
const segments = processed.split(/({{(?:BOLD|ITALIC|CODE):.+?}})/g);
|
|
9274
|
+
return segments.map((segment, i) => {
|
|
9275
|
+
if (segment.startsWith("{{BOLD:")) {
|
|
9276
|
+
const content = segment.slice(7, -2);
|
|
9277
|
+
return /* @__PURE__ */ jsx("strong", { children: content }, i);
|
|
9278
|
+
}
|
|
9279
|
+
if (segment.startsWith("{{ITALIC:")) {
|
|
9280
|
+
const content = segment.slice(9, -2);
|
|
9281
|
+
return /* @__PURE__ */ jsx("em", { children: content }, i);
|
|
9282
|
+
}
|
|
9283
|
+
if (segment.startsWith("{{CODE:")) {
|
|
9284
|
+
const content = segment.slice(7, -2);
|
|
9285
|
+
return /* @__PURE__ */ jsx("code", { style: { background: "rgba(255,255,255,0.1)", padding: "0 4px", borderRadius: "3px", fontFamily: "monospace" }, children: content }, i);
|
|
9286
|
+
}
|
|
9287
|
+
return segment;
|
|
9288
|
+
});
|
|
9289
|
+
};
|
|
9265
9290
|
var SubredditBadge = ({
|
|
9266
9291
|
subreddit,
|
|
9267
9292
|
linked = true
|
|
@@ -9330,10 +9355,7 @@ var RedditOpportunityCard = ({
|
|
|
9330
9355
|
() => getRedditCharPercentage(charCount, REDDIT_LIMITS.comment),
|
|
9331
9356
|
[charCount]
|
|
9332
9357
|
);
|
|
9333
|
-
const charLimitColor = useMemo(
|
|
9334
|
-
() => getRedditCharLimitColor(charPercentage),
|
|
9335
|
-
[charPercentage]
|
|
9336
|
-
);
|
|
9358
|
+
const charLimitColor = useMemo(() => getRedditCharLimitColor(charPercentage), [charPercentage]);
|
|
9337
9359
|
const handleContentChange = (e) => {
|
|
9338
9360
|
onContentChange?.(e.target.value);
|
|
9339
9361
|
};
|
|
@@ -9399,7 +9421,7 @@ var RedditOpportunityCard = ({
|
|
|
9399
9421
|
placeholder: "Write your reply...",
|
|
9400
9422
|
autoFocus: true
|
|
9401
9423
|
}
|
|
9402
|
-
) : /* @__PURE__ */ jsx(ReplyContent, { children: displayContent }),
|
|
9424
|
+
) : /* @__PURE__ */ jsx(ReplyContent, { children: renderSimpleMarkdown(displayContent) }),
|
|
9403
9425
|
opportunity.strategy ? /* @__PURE__ */ jsxs(StrategyHint, { children: [
|
|
9404
9426
|
/* @__PURE__ */ jsx(StrategyIconImg, { src: "/assets/icon-set/Icon-lightbulb-fill.svg", alt: "" }),
|
|
9405
9427
|
/* @__PURE__ */ jsxs(StrategyText, { children: [
|
|
@@ -9407,13 +9429,7 @@ var RedditOpportunityCard = ({
|
|
|
9407
9429
|
opportunity.strategy
|
|
9408
9430
|
] })
|
|
9409
9431
|
] }) : null,
|
|
9410
|
-
/* @__PURE__ */ jsx(ProgressBarContainer2, { children: /* @__PURE__ */ jsx(ProgressBarTrack2, { children: /* @__PURE__ */ jsx(
|
|
9411
|
-
ProgressBarFill3,
|
|
9412
|
-
{
|
|
9413
|
-
$percentage: Math.min(charPercentage, 100),
|
|
9414
|
-
$color: charLimitColor
|
|
9415
|
-
}
|
|
9416
|
-
) }) })
|
|
9432
|
+
/* @__PURE__ */ jsx(ProgressBarContainer2, { children: /* @__PURE__ */ jsx(ProgressBarTrack2, { children: /* @__PURE__ */ jsx(ProgressBarFill3, { $percentage: Math.min(charPercentage, 100), $color: charLimitColor }) }) })
|
|
9417
9433
|
] })
|
|
9418
9434
|
]
|
|
9419
9435
|
}
|
|
@@ -9737,10 +9753,13 @@ var RedditEngagementControls = ({
|
|
|
9737
9753
|
const [showRegenerateInput, setShowRegenerateInput] = useState(false);
|
|
9738
9754
|
const [regenerateFeedback, setRegenerateFeedback] = useState("");
|
|
9739
9755
|
const [copiedFeedback, setCopiedFeedback] = useState(false);
|
|
9756
|
+
const [engagedWithContent, setEngagedWithContent] = useState(null);
|
|
9757
|
+
const isEngaged = engagedWithContent !== null && engagedWithContent === currentReply;
|
|
9740
9758
|
const handleCopyAndOpen = useCallback(async () => {
|
|
9741
9759
|
try {
|
|
9742
9760
|
await navigator.clipboard.writeText(currentReply);
|
|
9743
9761
|
setCopiedFeedback(true);
|
|
9762
|
+
setEngagedWithContent(currentReply);
|
|
9744
9763
|
setTimeout(() => setCopiedFeedback(false), 2e3);
|
|
9745
9764
|
onCopyAndOpen();
|
|
9746
9765
|
} catch (err) {
|
|
@@ -9840,14 +9859,14 @@ var RedditEngagementControls = ({
|
|
|
9840
9859
|
/* @__PURE__ */ jsxs(
|
|
9841
9860
|
ActionButton6,
|
|
9842
9861
|
{
|
|
9843
|
-
$variant: "primary",
|
|
9862
|
+
$variant: isEngaged && !copiedFeedback ? "engaged" : "primary",
|
|
9844
9863
|
onClick: handleCopyAndOpen,
|
|
9845
|
-
disabled: isLoading,
|
|
9846
|
-
$pulse: !justCopied && !copiedFeedback,
|
|
9847
|
-
title: "Copy reply and open post in new tab",
|
|
9864
|
+
disabled: isLoading || isEngaged && !copiedFeedback,
|
|
9865
|
+
$pulse: !justCopied && !copiedFeedback && !isEngaged,
|
|
9866
|
+
title: isEngaged ? "Already copied - edit to re-enable" : "Copy reply and open post in new tab",
|
|
9848
9867
|
children: [
|
|
9849
|
-
copiedFeedback ? /* @__PURE__ */ jsx(Icon3, { src: "/assets/icon-set/Icon-check-fill.svg", alt: "" }) : /* @__PURE__ */ jsx(Icon3, { src: "/assets/icon-set/Icon-clipboard-fill.svg", alt: "" }),
|
|
9850
|
-
copiedFeedback ? "Copied!" : "
|
|
9868
|
+
copiedFeedback ? /* @__PURE__ */ jsx(Icon3, { src: "/assets/icon-set/Icon-check-fill.svg", alt: "" }) : isEngaged ? /* @__PURE__ */ jsx(Icon3, { src: "/assets/icon-set/Icon-check-fill.svg", alt: "" }) : /* @__PURE__ */ jsx(Icon3, { src: "/assets/icon-set/Icon-clipboard-fill.svg", alt: "" }),
|
|
9869
|
+
copiedFeedback ? "Copied!" : isEngaged ? "Engaged" : "Engage"
|
|
9851
9870
|
]
|
|
9852
9871
|
}
|
|
9853
9872
|
),
|
|
@@ -9856,7 +9875,7 @@ var RedditEngagementControls = ({
|
|
|
9856
9875
|
{
|
|
9857
9876
|
$variant: "success",
|
|
9858
9877
|
onClick: onMarkPosted,
|
|
9859
|
-
disabled: isLoading || !justCopied && !copiedFeedback,
|
|
9878
|
+
disabled: isLoading || !justCopied && !copiedFeedback && !isEngaged,
|
|
9860
9879
|
title: "Mark as posted after you've replied",
|
|
9861
9880
|
children: [
|
|
9862
9881
|
/* @__PURE__ */ jsx(Icon3, { src: "/assets/icon-set/Icon-check-fill.svg", alt: "" }),
|
|
@@ -10083,6 +10102,15 @@ var ActionButton6 = styled47.button`
|
|
|
10083
10102
|
opacity: 0.9;
|
|
10084
10103
|
}
|
|
10085
10104
|
`;
|
|
10105
|
+
case "engaged":
|
|
10106
|
+
return css`
|
|
10107
|
+
background: ${tokens.colors.text.tertiary};
|
|
10108
|
+
color: ${tokens.colors.background.darker};
|
|
10109
|
+
cursor: default;
|
|
10110
|
+
${Icon3} {
|
|
10111
|
+
filter: brightness(0) saturate(100%) invert(15%);
|
|
10112
|
+
}
|
|
10113
|
+
`;
|
|
10086
10114
|
default:
|
|
10087
10115
|
return "";
|
|
10088
10116
|
}
|