@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.cjs
CHANGED
|
@@ -5466,7 +5466,7 @@ var Input2 = ({
|
|
|
5466
5466
|
};
|
|
5467
5467
|
function parseMarkdown(text) {
|
|
5468
5468
|
if (!text) return [];
|
|
5469
|
-
text = text.replace(/<!--TOOL_CALL:[
|
|
5469
|
+
text = text.replace(/<!--TOOL_CALL:[^:]+:[\s\S]+?-->/g, "").replace(/__TOOL_CALL__:[^:]+:\{[^}]*(?:\{[^}]*\}[^}]*)*\}/g, "").replace(/<!--TOOL_CALL:[\s\S]*$/g, "").replace(/__TOOL_CALL__:[\s\S]*$/g, "");
|
|
5470
5470
|
const elements = [];
|
|
5471
5471
|
let key = 0;
|
|
5472
5472
|
const paragraphs = text.split(/\n\n+/);
|
|
@@ -8271,9 +8271,9 @@ var ProgressFill = styled47__default.default.div`
|
|
|
8271
8271
|
}};
|
|
8272
8272
|
`;
|
|
8273
8273
|
var Actions3 = styled47__default.default.div`
|
|
8274
|
-
display:
|
|
8275
|
-
grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
|
|
8274
|
+
display: flex;
|
|
8276
8275
|
gap: ${tokens.spacing.sm};
|
|
8276
|
+
justify-content: flex-end;
|
|
8277
8277
|
`;
|
|
8278
8278
|
var ActionButton5 = styled47__default.default.button`
|
|
8279
8279
|
padding: ${tokens.spacing.sm} ${tokens.spacing.md};
|
|
@@ -8281,9 +8281,11 @@ var ActionButton5 = styled47__default.default.button`
|
|
|
8281
8281
|
font-size: ${tokens.typography.fontSize.sm};
|
|
8282
8282
|
font-weight: ${tokens.typography.fontWeight.semibold};
|
|
8283
8283
|
cursor: pointer;
|
|
8284
|
-
transition:
|
|
8284
|
+
transition: background ${tokens.transitions.fast}, opacity ${tokens.transitions.fast};
|
|
8285
8285
|
border: none;
|
|
8286
8286
|
white-space: nowrap;
|
|
8287
|
+
min-width: 90px;
|
|
8288
|
+
text-align: center;
|
|
8287
8289
|
|
|
8288
8290
|
&:disabled {
|
|
8289
8291
|
opacity: 0.5;
|
|
@@ -9268,6 +9270,29 @@ function truncateText(text, maxLength) {
|
|
|
9268
9270
|
function getSubredditUrl(subreddit) {
|
|
9269
9271
|
return `https://www.reddit.com/r/${subreddit}`;
|
|
9270
9272
|
}
|
|
9273
|
+
var renderSimpleMarkdown = (text) => {
|
|
9274
|
+
if (!text) return null;
|
|
9275
|
+
let processed = text;
|
|
9276
|
+
processed = processed.replace(/\*\*(.+?)\*\*/g, "{{BOLD:$1}}");
|
|
9277
|
+
processed = processed.replace(/\*(.+?)\*/g, "{{ITALIC:$1}}");
|
|
9278
|
+
processed = processed.replace(/`(.+?)`/g, "{{CODE:$1}}");
|
|
9279
|
+
const segments = processed.split(/({{(?:BOLD|ITALIC|CODE):.+?}})/g);
|
|
9280
|
+
return segments.map((segment, i) => {
|
|
9281
|
+
if (segment.startsWith("{{BOLD:")) {
|
|
9282
|
+
const content = segment.slice(7, -2);
|
|
9283
|
+
return /* @__PURE__ */ jsxRuntime.jsx("strong", { children: content }, i);
|
|
9284
|
+
}
|
|
9285
|
+
if (segment.startsWith("{{ITALIC:")) {
|
|
9286
|
+
const content = segment.slice(9, -2);
|
|
9287
|
+
return /* @__PURE__ */ jsxRuntime.jsx("em", { children: content }, i);
|
|
9288
|
+
}
|
|
9289
|
+
if (segment.startsWith("{{CODE:")) {
|
|
9290
|
+
const content = segment.slice(7, -2);
|
|
9291
|
+
return /* @__PURE__ */ jsxRuntime.jsx("code", { style: { background: "rgba(255,255,255,0.1)", padding: "0 4px", borderRadius: "3px", fontFamily: "monospace" }, children: content }, i);
|
|
9292
|
+
}
|
|
9293
|
+
return segment;
|
|
9294
|
+
});
|
|
9295
|
+
};
|
|
9271
9296
|
var SubredditBadge = ({
|
|
9272
9297
|
subreddit,
|
|
9273
9298
|
linked = true
|
|
@@ -9336,10 +9361,7 @@ var RedditOpportunityCard = ({
|
|
|
9336
9361
|
() => getRedditCharPercentage(charCount, REDDIT_LIMITS.comment),
|
|
9337
9362
|
[charCount]
|
|
9338
9363
|
);
|
|
9339
|
-
const charLimitColor = react.useMemo(
|
|
9340
|
-
() => getRedditCharLimitColor(charPercentage),
|
|
9341
|
-
[charPercentage]
|
|
9342
|
-
);
|
|
9364
|
+
const charLimitColor = react.useMemo(() => getRedditCharLimitColor(charPercentage), [charPercentage]);
|
|
9343
9365
|
const handleContentChange = (e) => {
|
|
9344
9366
|
onContentChange?.(e.target.value);
|
|
9345
9367
|
};
|
|
@@ -9405,7 +9427,7 @@ var RedditOpportunityCard = ({
|
|
|
9405
9427
|
placeholder: "Write your reply...",
|
|
9406
9428
|
autoFocus: true
|
|
9407
9429
|
}
|
|
9408
|
-
) : /* @__PURE__ */ jsxRuntime.jsx(ReplyContent, { children: displayContent }),
|
|
9430
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(ReplyContent, { children: renderSimpleMarkdown(displayContent) }),
|
|
9409
9431
|
opportunity.strategy ? /* @__PURE__ */ jsxRuntime.jsxs(StrategyHint, { children: [
|
|
9410
9432
|
/* @__PURE__ */ jsxRuntime.jsx(StrategyIconImg, { src: "/assets/icon-set/Icon-lightbulb-fill.svg", alt: "" }),
|
|
9411
9433
|
/* @__PURE__ */ jsxRuntime.jsxs(StrategyText, { children: [
|
|
@@ -9413,13 +9435,7 @@ var RedditOpportunityCard = ({
|
|
|
9413
9435
|
opportunity.strategy
|
|
9414
9436
|
] })
|
|
9415
9437
|
] }) : null,
|
|
9416
|
-
/* @__PURE__ */ jsxRuntime.jsx(ProgressBarContainer2, { children: /* @__PURE__ */ jsxRuntime.jsx(ProgressBarTrack2, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
9417
|
-
ProgressBarFill3,
|
|
9418
|
-
{
|
|
9419
|
-
$percentage: Math.min(charPercentage, 100),
|
|
9420
|
-
$color: charLimitColor
|
|
9421
|
-
}
|
|
9422
|
-
) }) })
|
|
9438
|
+
/* @__PURE__ */ jsxRuntime.jsx(ProgressBarContainer2, { children: /* @__PURE__ */ jsxRuntime.jsx(ProgressBarTrack2, { children: /* @__PURE__ */ jsxRuntime.jsx(ProgressBarFill3, { $percentage: Math.min(charPercentage, 100), $color: charLimitColor }) }) })
|
|
9423
9439
|
] })
|
|
9424
9440
|
]
|
|
9425
9441
|
}
|
|
@@ -9743,10 +9759,13 @@ var RedditEngagementControls = ({
|
|
|
9743
9759
|
const [showRegenerateInput, setShowRegenerateInput] = react.useState(false);
|
|
9744
9760
|
const [regenerateFeedback, setRegenerateFeedback] = react.useState("");
|
|
9745
9761
|
const [copiedFeedback, setCopiedFeedback] = react.useState(false);
|
|
9762
|
+
const [engagedWithContent, setEngagedWithContent] = react.useState(null);
|
|
9763
|
+
const isEngaged = engagedWithContent !== null && engagedWithContent === currentReply;
|
|
9746
9764
|
const handleCopyAndOpen = react.useCallback(async () => {
|
|
9747
9765
|
try {
|
|
9748
9766
|
await navigator.clipboard.writeText(currentReply);
|
|
9749
9767
|
setCopiedFeedback(true);
|
|
9768
|
+
setEngagedWithContent(currentReply);
|
|
9750
9769
|
setTimeout(() => setCopiedFeedback(false), 2e3);
|
|
9751
9770
|
onCopyAndOpen();
|
|
9752
9771
|
} catch (err) {
|
|
@@ -9846,14 +9865,14 @@ var RedditEngagementControls = ({
|
|
|
9846
9865
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
9847
9866
|
ActionButton6,
|
|
9848
9867
|
{
|
|
9849
|
-
$variant: "primary",
|
|
9868
|
+
$variant: isEngaged && !copiedFeedback ? "engaged" : "primary",
|
|
9850
9869
|
onClick: handleCopyAndOpen,
|
|
9851
|
-
disabled: isLoading,
|
|
9852
|
-
$pulse: !justCopied && !copiedFeedback,
|
|
9853
|
-
title: "Copy reply and open post in new tab",
|
|
9870
|
+
disabled: isLoading || isEngaged && !copiedFeedback,
|
|
9871
|
+
$pulse: !justCopied && !copiedFeedback && !isEngaged,
|
|
9872
|
+
title: isEngaged ? "Already copied - edit to re-enable" : "Copy reply and open post in new tab",
|
|
9854
9873
|
children: [
|
|
9855
|
-
copiedFeedback ? /* @__PURE__ */ jsxRuntime.jsx(Icon3, { src: "/assets/icon-set/Icon-check-fill.svg", alt: "" }) : /* @__PURE__ */ jsxRuntime.jsx(Icon3, { src: "/assets/icon-set/Icon-clipboard-fill.svg", alt: "" }),
|
|
9856
|
-
copiedFeedback ? "Copied!" : "
|
|
9874
|
+
copiedFeedback ? /* @__PURE__ */ jsxRuntime.jsx(Icon3, { src: "/assets/icon-set/Icon-check-fill.svg", alt: "" }) : isEngaged ? /* @__PURE__ */ jsxRuntime.jsx(Icon3, { src: "/assets/icon-set/Icon-check-fill.svg", alt: "" }) : /* @__PURE__ */ jsxRuntime.jsx(Icon3, { src: "/assets/icon-set/Icon-clipboard-fill.svg", alt: "" }),
|
|
9875
|
+
copiedFeedback ? "Copied!" : isEngaged ? "Engaged" : "Engage"
|
|
9857
9876
|
]
|
|
9858
9877
|
}
|
|
9859
9878
|
),
|
|
@@ -9862,7 +9881,7 @@ var RedditEngagementControls = ({
|
|
|
9862
9881
|
{
|
|
9863
9882
|
$variant: "success",
|
|
9864
9883
|
onClick: onMarkPosted,
|
|
9865
|
-
disabled: isLoading || !justCopied && !copiedFeedback,
|
|
9884
|
+
disabled: isLoading || !justCopied && !copiedFeedback && !isEngaged,
|
|
9866
9885
|
title: "Mark as posted after you've replied",
|
|
9867
9886
|
children: [
|
|
9868
9887
|
/* @__PURE__ */ jsxRuntime.jsx(Icon3, { src: "/assets/icon-set/Icon-check-fill.svg", alt: "" }),
|
|
@@ -10089,6 +10108,15 @@ var ActionButton6 = styled47__default.default.button`
|
|
|
10089
10108
|
opacity: 0.9;
|
|
10090
10109
|
}
|
|
10091
10110
|
`;
|
|
10111
|
+
case "engaged":
|
|
10112
|
+
return styled47.css`
|
|
10113
|
+
background: ${tokens.colors.text.tertiary};
|
|
10114
|
+
color: ${tokens.colors.background.darker};
|
|
10115
|
+
cursor: default;
|
|
10116
|
+
${Icon3} {
|
|
10117
|
+
filter: brightness(0) saturate(100%) invert(15%);
|
|
10118
|
+
}
|
|
10119
|
+
`;
|
|
10092
10120
|
default:
|
|
10093
10121
|
return "";
|
|
10094
10122
|
}
|