agentation 1.0.0 → 1.1.0
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 +1 -28
- package/dist/index.d.ts +1 -28
- package/dist/index.js +1 -137
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -134
- package/dist/index.mjs.map +1 -1
- package/package.json +10 -11
package/dist/index.mjs
CHANGED
|
@@ -2610,7 +2610,7 @@ function PageFeedbackToolbarCSS({
|
|
|
2610
2610
|
] }),
|
|
2611
2611
|
/* @__PURE__ */ jsxs3("span", { className: styles_module_default2.settingsVersion, children: [
|
|
2612
2612
|
"v",
|
|
2613
|
-
"
|
|
2613
|
+
"1.1.0"
|
|
2614
2614
|
] }),
|
|
2615
2615
|
/* @__PURE__ */ jsx3(
|
|
2616
2616
|
"button",
|
|
@@ -3134,143 +3134,10 @@ function PageFeedbackToolbarCSS({
|
|
|
3134
3134
|
document.body
|
|
3135
3135
|
);
|
|
3136
3136
|
}
|
|
3137
|
-
|
|
3138
|
-
// src/components/annotation-popup/index.tsx
|
|
3139
|
-
import { useState as useState3, useRef as useRef3, useEffect as useEffect3, useCallback as useCallback3, forwardRef as forwardRef2, useImperativeHandle as useImperativeHandle2 } from "react";
|
|
3140
|
-
import { motion, AnimatePresence, useAnimation } from "framer-motion";
|
|
3141
|
-
|
|
3142
|
-
// src/components/annotation-popup/styles.module.scss
|
|
3143
|
-
var css3 = '.styles-module__popup___MBQDV {\n position: fixed;\n transform: translateX(-50%);\n width: 280px;\n padding: 0.75rem 1rem 14px;\n background: #1a1a1a;\n border-radius: 16px;\n box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.08);\n cursor: default;\n z-index: 99999;\n font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;\n}\n\n.styles-module__header___1q-wa {\n display: flex;\n align-items: center;\n justify-content: space-between;\n margin-bottom: 0.5rem;\n}\n\n.styles-module__element___tPxVO {\n font-size: 0.75rem;\n font-weight: 500;\n color: rgba(255, 255, 255, 0.65);\n max-width: 100%;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n flex: 1;\n}\n\n.styles-module__timestamp___t7PEZ {\n font-size: 0.625rem;\n font-weight: 500;\n color: rgba(255, 255, 255, 0.35);\n font-variant-numeric: tabular-nums;\n margin-left: 0.5rem;\n flex-shrink: 0;\n}\n\n.styles-module__quote___uFJyr {\n font-size: 0.6875rem;\n font-style: italic;\n color: rgba(255, 255, 255, 0.5);\n margin-bottom: 0.5rem;\n padding: 0.4rem 0.5rem;\n background: rgba(255, 255, 255, 0.05);\n border-radius: 0.25rem;\n line-height: 1.45;\n}\n\n.styles-module__textarea___Pw6C4 {\n width: 100%;\n padding: 0.5rem 0.625rem;\n font-size: 0.8125rem;\n font-family: inherit;\n background: rgba(255, 255, 255, 0.05);\n color: #fff;\n border: 1px solid rgba(255, 255, 255, 0.15);\n border-radius: 8px;\n resize: none;\n outline: none;\n transition: border-color 0.15s ease;\n}\n.styles-module__textarea___Pw6C4:focus {\n border-color: #3c82f7;\n}\n.styles-module__textarea___Pw6C4.styles-module__green___zdmke:focus {\n border-color: #34C759;\n}\n.styles-module__textarea___Pw6C4::placeholder {\n color: rgba(255, 255, 255, 0.35);\n}\n.styles-module__textarea___Pw6C4::-webkit-scrollbar {\n width: 6px;\n}\n.styles-module__textarea___Pw6C4::-webkit-scrollbar-track {\n background: transparent;\n}\n.styles-module__textarea___Pw6C4::-webkit-scrollbar-thumb {\n background: rgba(255, 255, 255, 0.2);\n border-radius: 3px;\n}\n\n.styles-module__actions___bxQCu {\n display: flex;\n justify-content: flex-end;\n gap: 0.375rem;\n margin-top: 0.5rem;\n}\n\n.styles-module__cancel___-xAEc,\n.styles-module__submit___nnXO9 {\n padding: 0.4rem 0.875rem;\n font-size: 0.75rem;\n font-weight: 500;\n border-radius: 1rem;\n border: none;\n cursor: pointer;\n transition: all 0.15s ease;\n}\n\n.styles-module__cancel___-xAEc {\n background: transparent;\n color: rgba(255, 255, 255, 0.5);\n}\n.styles-module__cancel___-xAEc:hover {\n background: rgba(255, 255, 255, 0.1);\n color: rgba(255, 255, 255, 0.8);\n}\n\n.styles-module__submit___nnXO9 {\n background: #3c82f7;\n color: white;\n}\n.styles-module__submit___nnXO9:hover:not(:disabled) {\n background: #2d6fdf;\n}\n.styles-module__submit___nnXO9:disabled {\n opacity: 0.4;\n cursor: not-allowed;\n}\n.styles-module__submit___nnXO9.styles-module__green___zdmke {\n background: #34C759;\n}\n.styles-module__submit___nnXO9.styles-module__green___zdmke:hover:not(:disabled) {\n background: #2db84d;\n}';
|
|
3144
|
-
var classNames3 = { "popup": "styles-module__popup___MBQDV", "header": "styles-module__header___1q-wa", "element": "styles-module__element___tPxVO", "timestamp": "styles-module__timestamp___t7PEZ", "quote": "styles-module__quote___uFJyr", "textarea": "styles-module__textarea___Pw6C4", "green": "styles-module__green___zdmke", "actions": "styles-module__actions___bxQCu", "cancel": "styles-module__cancel___-xAEc", "submit": "styles-module__submit___nnXO9" };
|
|
3145
|
-
if (typeof document !== "undefined") {
|
|
3146
|
-
let style = document.getElementById("feedback-tool-styles-annotation-popup-styles");
|
|
3147
|
-
if (!style) {
|
|
3148
|
-
style = document.createElement("style");
|
|
3149
|
-
style.id = "feedback-tool-styles-annotation-popup-styles";
|
|
3150
|
-
style.textContent = css3;
|
|
3151
|
-
document.head.appendChild(style);
|
|
3152
|
-
}
|
|
3153
|
-
}
|
|
3154
|
-
var styles_module_default3 = classNames3;
|
|
3155
|
-
|
|
3156
|
-
// src/components/annotation-popup/index.tsx
|
|
3157
|
-
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
3158
|
-
var AnnotationPopup = forwardRef2(
|
|
3159
|
-
function AnnotationPopup2({
|
|
3160
|
-
element,
|
|
3161
|
-
timestamp,
|
|
3162
|
-
selectedText,
|
|
3163
|
-
placeholder = "What should change?",
|
|
3164
|
-
onSubmit,
|
|
3165
|
-
onCancel,
|
|
3166
|
-
style,
|
|
3167
|
-
variant = "blue"
|
|
3168
|
-
}, ref) {
|
|
3169
|
-
const [text, setText] = useState3("");
|
|
3170
|
-
const textareaRef = useRef3(null);
|
|
3171
|
-
const controls = useAnimation();
|
|
3172
|
-
useEffect3(() => {
|
|
3173
|
-
controls.start({ opacity: 1, scale: 1, y: 0 });
|
|
3174
|
-
const timer = setTimeout(() => {
|
|
3175
|
-
const textarea = textareaRef.current;
|
|
3176
|
-
if (textarea) {
|
|
3177
|
-
textarea.focus();
|
|
3178
|
-
textarea.selectionStart = textarea.selectionEnd = textarea.value.length;
|
|
3179
|
-
textarea.scrollTop = textarea.scrollHeight;
|
|
3180
|
-
}
|
|
3181
|
-
}, 10);
|
|
3182
|
-
return () => clearTimeout(timer);
|
|
3183
|
-
}, [controls]);
|
|
3184
|
-
const shake = useCallback3(async () => {
|
|
3185
|
-
await controls.start({
|
|
3186
|
-
x: [0, -3, 3, -2, 2, 0],
|
|
3187
|
-
transition: { duration: 0.25, ease: "easeOut" }
|
|
3188
|
-
});
|
|
3189
|
-
textareaRef.current?.focus();
|
|
3190
|
-
}, [controls]);
|
|
3191
|
-
useImperativeHandle2(ref, () => ({
|
|
3192
|
-
shake
|
|
3193
|
-
}), [shake]);
|
|
3194
|
-
const handleSubmit = useCallback3(() => {
|
|
3195
|
-
if (!text.trim()) return;
|
|
3196
|
-
onSubmit(text.trim());
|
|
3197
|
-
}, [text, onSubmit]);
|
|
3198
|
-
const handleKeyDown = useCallback3(
|
|
3199
|
-
(e) => {
|
|
3200
|
-
if (e.key === "Enter" && !e.shiftKey) {
|
|
3201
|
-
e.preventDefault();
|
|
3202
|
-
handleSubmit();
|
|
3203
|
-
}
|
|
3204
|
-
if (e.key === "Escape") {
|
|
3205
|
-
onCancel();
|
|
3206
|
-
}
|
|
3207
|
-
},
|
|
3208
|
-
[handleSubmit, onCancel]
|
|
3209
|
-
);
|
|
3210
|
-
return /* @__PURE__ */ jsxs4(
|
|
3211
|
-
motion.div,
|
|
3212
|
-
{
|
|
3213
|
-
className: styles_module_default3.popup,
|
|
3214
|
-
"data-annotation-popup": true,
|
|
3215
|
-
initial: { opacity: 0, scale: 0.95, y: 4 },
|
|
3216
|
-
animate: controls,
|
|
3217
|
-
exit: { opacity: 0, scale: 0.95, y: 4 },
|
|
3218
|
-
transition: { type: "spring", stiffness: 500, damping: 35 },
|
|
3219
|
-
style,
|
|
3220
|
-
onClick: (e) => e.stopPropagation(),
|
|
3221
|
-
children: [
|
|
3222
|
-
/* @__PURE__ */ jsxs4("div", { className: styles_module_default3.header, children: [
|
|
3223
|
-
/* @__PURE__ */ jsx4("span", { className: styles_module_default3.element, children: element }),
|
|
3224
|
-
timestamp && /* @__PURE__ */ jsx4("span", { className: styles_module_default3.timestamp, children: timestamp })
|
|
3225
|
-
] }),
|
|
3226
|
-
selectedText && /* @__PURE__ */ jsxs4("div", { className: styles_module_default3.quote, children: [
|
|
3227
|
-
"\u201C",
|
|
3228
|
-
selectedText.slice(0, 80),
|
|
3229
|
-
selectedText.length > 80 ? "..." : "",
|
|
3230
|
-
"\u201D"
|
|
3231
|
-
] }),
|
|
3232
|
-
/* @__PURE__ */ jsx4(
|
|
3233
|
-
"textarea",
|
|
3234
|
-
{
|
|
3235
|
-
ref: textareaRef,
|
|
3236
|
-
className: `${styles_module_default3.textarea} ${variant === "green" ? styles_module_default3.green : ""}`,
|
|
3237
|
-
placeholder,
|
|
3238
|
-
value: text,
|
|
3239
|
-
onChange: (e) => setText(e.target.value),
|
|
3240
|
-
rows: 2,
|
|
3241
|
-
onKeyDown: handleKeyDown
|
|
3242
|
-
}
|
|
3243
|
-
),
|
|
3244
|
-
/* @__PURE__ */ jsxs4("div", { className: styles_module_default3.actions, children: [
|
|
3245
|
-
/* @__PURE__ */ jsx4("button", { className: styles_module_default3.cancel, onClick: onCancel, children: "Cancel" }),
|
|
3246
|
-
/* @__PURE__ */ jsx4(
|
|
3247
|
-
"button",
|
|
3248
|
-
{
|
|
3249
|
-
className: `${styles_module_default3.submit} ${variant === "green" ? styles_module_default3.green : ""}`,
|
|
3250
|
-
onClick: handleSubmit,
|
|
3251
|
-
disabled: !text.trim(),
|
|
3252
|
-
children: "Add"
|
|
3253
|
-
}
|
|
3254
|
-
)
|
|
3255
|
-
] })
|
|
3256
|
-
]
|
|
3257
|
-
}
|
|
3258
|
-
);
|
|
3259
|
-
}
|
|
3260
|
-
);
|
|
3261
|
-
function AnnotationPopupPresence({
|
|
3262
|
-
isOpen,
|
|
3263
|
-
...props
|
|
3264
|
-
}) {
|
|
3265
|
-
return /* @__PURE__ */ jsx4(AnimatePresence, { children: isOpen && /* @__PURE__ */ jsx4(AnnotationPopup, { ...props }) });
|
|
3266
|
-
}
|
|
3267
3137
|
export {
|
|
3268
3138
|
PageFeedbackToolbarCSS as Agentation,
|
|
3269
|
-
PageFeedbackToolbarCSS as AgentationCSS,
|
|
3270
3139
|
AnimatedBunny,
|
|
3271
|
-
AnnotationPopup,
|
|
3272
3140
|
AnnotationPopupCSS,
|
|
3273
|
-
AnnotationPopupPresence,
|
|
3274
3141
|
IconChatEllipsis,
|
|
3275
3142
|
IconCheck,
|
|
3276
3143
|
IconCheckSmall,
|