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.d.mts
CHANGED
|
@@ -13,33 +13,6 @@ type PageFeedbackToolbarCSSProps = {
|
|
|
13
13
|
};
|
|
14
14
|
declare function PageFeedbackToolbarCSS({ demoAnnotations, demoDelay, enableDemoMode, }?: PageFeedbackToolbarCSSProps): react.ReactPortal | null;
|
|
15
15
|
|
|
16
|
-
interface AnnotationPopupProps {
|
|
17
|
-
/** Element name to display in header */
|
|
18
|
-
element: string;
|
|
19
|
-
/** Optional timestamp display (e.g., "@ 1.23s" for animation feedback) */
|
|
20
|
-
timestamp?: string;
|
|
21
|
-
/** Optional selected/highlighted text */
|
|
22
|
-
selectedText?: string;
|
|
23
|
-
/** Placeholder text for the textarea */
|
|
24
|
-
placeholder?: string;
|
|
25
|
-
/** Called when annotation is submitted with text */
|
|
26
|
-
onSubmit: (text: string) => void;
|
|
27
|
-
/** Called when popup is cancelled/dismissed */
|
|
28
|
-
onCancel: () => void;
|
|
29
|
-
/** Position styles (left, top) */
|
|
30
|
-
style?: React.CSSProperties;
|
|
31
|
-
/** Color variant for submit button */
|
|
32
|
-
variant?: "blue" | "green";
|
|
33
|
-
}
|
|
34
|
-
interface AnnotationPopupHandle {
|
|
35
|
-
/** Shake the popup (e.g., when user clicks outside) */
|
|
36
|
-
shake: () => void;
|
|
37
|
-
}
|
|
38
|
-
declare const AnnotationPopup: react.ForwardRefExoticComponent<AnnotationPopupProps & react.RefAttributes<AnnotationPopupHandle>>;
|
|
39
|
-
declare function AnnotationPopupPresence({ isOpen, ...props }: AnnotationPopupProps & {
|
|
40
|
-
isOpen: boolean;
|
|
41
|
-
}): react_jsx_runtime.JSX.Element;
|
|
42
|
-
|
|
43
16
|
interface AnnotationPopupCSSProps {
|
|
44
17
|
/** Element name to display in header */
|
|
45
18
|
element: string;
|
|
@@ -219,4 +192,4 @@ declare function getStorageKey(pathname: string): string;
|
|
|
219
192
|
declare function loadAnnotations<T = Annotation>(pathname: string): T[];
|
|
220
193
|
declare function saveAnnotations<T = Annotation>(pathname: string, annotations: T[]): void;
|
|
221
194
|
|
|
222
|
-
export { PageFeedbackToolbarCSS as Agentation,
|
|
195
|
+
export { PageFeedbackToolbarCSS as Agentation, AnimatedBunny, type Annotation, AnnotationPopupCSS, type AnnotationPopupCSSHandle, type AnnotationPopupCSSProps, type DemoAnnotation, IconChatEllipsis, IconCheck, IconCheckSmall, IconCheckSmallAnimated, IconCheckmark, IconCheckmarkCircle, IconCheckmarkLarge, IconClose, IconCopyAlt, IconCopyAnimated, IconEye, IconEyeAlt, IconEyeAnimated, IconEyeClosed, IconEyeMinus, IconGear, IconHelp, IconListSparkle, IconMoon, IconPause, IconPauseAlt, IconPausePlayAnimated, IconPlayAlt, IconPlus, IconSun, IconTrashAlt, IconXmark, IconXmarkLarge, PageFeedbackToolbarCSS, getElementClasses, getElementPath, getNearbyText, getStorageKey, identifyAnimationElement, identifyElement, loadAnnotations, saveAnnotations };
|
package/dist/index.d.ts
CHANGED
|
@@ -13,33 +13,6 @@ type PageFeedbackToolbarCSSProps = {
|
|
|
13
13
|
};
|
|
14
14
|
declare function PageFeedbackToolbarCSS({ demoAnnotations, demoDelay, enableDemoMode, }?: PageFeedbackToolbarCSSProps): react.ReactPortal | null;
|
|
15
15
|
|
|
16
|
-
interface AnnotationPopupProps {
|
|
17
|
-
/** Element name to display in header */
|
|
18
|
-
element: string;
|
|
19
|
-
/** Optional timestamp display (e.g., "@ 1.23s" for animation feedback) */
|
|
20
|
-
timestamp?: string;
|
|
21
|
-
/** Optional selected/highlighted text */
|
|
22
|
-
selectedText?: string;
|
|
23
|
-
/** Placeholder text for the textarea */
|
|
24
|
-
placeholder?: string;
|
|
25
|
-
/** Called when annotation is submitted with text */
|
|
26
|
-
onSubmit: (text: string) => void;
|
|
27
|
-
/** Called when popup is cancelled/dismissed */
|
|
28
|
-
onCancel: () => void;
|
|
29
|
-
/** Position styles (left, top) */
|
|
30
|
-
style?: React.CSSProperties;
|
|
31
|
-
/** Color variant for submit button */
|
|
32
|
-
variant?: "blue" | "green";
|
|
33
|
-
}
|
|
34
|
-
interface AnnotationPopupHandle {
|
|
35
|
-
/** Shake the popup (e.g., when user clicks outside) */
|
|
36
|
-
shake: () => void;
|
|
37
|
-
}
|
|
38
|
-
declare const AnnotationPopup: react.ForwardRefExoticComponent<AnnotationPopupProps & react.RefAttributes<AnnotationPopupHandle>>;
|
|
39
|
-
declare function AnnotationPopupPresence({ isOpen, ...props }: AnnotationPopupProps & {
|
|
40
|
-
isOpen: boolean;
|
|
41
|
-
}): react_jsx_runtime.JSX.Element;
|
|
42
|
-
|
|
43
16
|
interface AnnotationPopupCSSProps {
|
|
44
17
|
/** Element name to display in header */
|
|
45
18
|
element: string;
|
|
@@ -219,4 +192,4 @@ declare function getStorageKey(pathname: string): string;
|
|
|
219
192
|
declare function loadAnnotations<T = Annotation>(pathname: string): T[];
|
|
220
193
|
declare function saveAnnotations<T = Annotation>(pathname: string, annotations: T[]): void;
|
|
221
194
|
|
|
222
|
-
export { PageFeedbackToolbarCSS as Agentation,
|
|
195
|
+
export { PageFeedbackToolbarCSS as Agentation, AnimatedBunny, type Annotation, AnnotationPopupCSS, type AnnotationPopupCSSHandle, type AnnotationPopupCSSProps, type DemoAnnotation, IconChatEllipsis, IconCheck, IconCheckSmall, IconCheckSmallAnimated, IconCheckmark, IconCheckmarkCircle, IconCheckmarkLarge, IconClose, IconCopyAlt, IconCopyAnimated, IconEye, IconEyeAlt, IconEyeAnimated, IconEyeClosed, IconEyeMinus, IconGear, IconHelp, IconListSparkle, IconMoon, IconPause, IconPauseAlt, IconPausePlayAnimated, IconPlayAlt, IconPlus, IconSun, IconTrashAlt, IconXmark, IconXmarkLarge, PageFeedbackToolbarCSS, getElementClasses, getElementPath, getNearbyText, getStorageKey, identifyAnimationElement, identifyElement, loadAnnotations, saveAnnotations };
|
package/dist/index.js
CHANGED
|
@@ -22,11 +22,8 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
22
22
|
var index_exports = {};
|
|
23
23
|
__export(index_exports, {
|
|
24
24
|
Agentation: () => PageFeedbackToolbarCSS,
|
|
25
|
-
AgentationCSS: () => PageFeedbackToolbarCSS,
|
|
26
25
|
AnimatedBunny: () => AnimatedBunny,
|
|
27
|
-
AnnotationPopup: () => AnnotationPopup,
|
|
28
26
|
AnnotationPopupCSS: () => AnnotationPopupCSS,
|
|
29
|
-
AnnotationPopupPresence: () => AnnotationPopupPresence,
|
|
30
27
|
IconChatEllipsis: () => IconChatEllipsis,
|
|
31
28
|
IconCheck: () => IconCheck,
|
|
32
29
|
IconCheckSmall: () => IconCheckSmall,
|
|
@@ -2677,7 +2674,7 @@ function PageFeedbackToolbarCSS({
|
|
|
2677
2674
|
] }),
|
|
2678
2675
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { className: styles_module_default2.settingsVersion, children: [
|
|
2679
2676
|
"v",
|
|
2680
|
-
"
|
|
2677
|
+
"1.1.0"
|
|
2681
2678
|
] }),
|
|
2682
2679
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
2683
2680
|
"button",
|
|
@@ -3201,144 +3198,11 @@ function PageFeedbackToolbarCSS({
|
|
|
3201
3198
|
document.body
|
|
3202
3199
|
);
|
|
3203
3200
|
}
|
|
3204
|
-
|
|
3205
|
-
// src/components/annotation-popup/index.tsx
|
|
3206
|
-
var import_react3 = require("react");
|
|
3207
|
-
var import_framer_motion = require("framer-motion");
|
|
3208
|
-
|
|
3209
|
-
// src/components/annotation-popup/styles.module.scss
|
|
3210
|
-
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}';
|
|
3211
|
-
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" };
|
|
3212
|
-
if (typeof document !== "undefined") {
|
|
3213
|
-
let style = document.getElementById("feedback-tool-styles-annotation-popup-styles");
|
|
3214
|
-
if (!style) {
|
|
3215
|
-
style = document.createElement("style");
|
|
3216
|
-
style.id = "feedback-tool-styles-annotation-popup-styles";
|
|
3217
|
-
style.textContent = css3;
|
|
3218
|
-
document.head.appendChild(style);
|
|
3219
|
-
}
|
|
3220
|
-
}
|
|
3221
|
-
var styles_module_default3 = classNames3;
|
|
3222
|
-
|
|
3223
|
-
// src/components/annotation-popup/index.tsx
|
|
3224
|
-
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
3225
|
-
var AnnotationPopup = (0, import_react3.forwardRef)(
|
|
3226
|
-
function AnnotationPopup2({
|
|
3227
|
-
element,
|
|
3228
|
-
timestamp,
|
|
3229
|
-
selectedText,
|
|
3230
|
-
placeholder = "What should change?",
|
|
3231
|
-
onSubmit,
|
|
3232
|
-
onCancel,
|
|
3233
|
-
style,
|
|
3234
|
-
variant = "blue"
|
|
3235
|
-
}, ref) {
|
|
3236
|
-
const [text, setText] = (0, import_react3.useState)("");
|
|
3237
|
-
const textareaRef = (0, import_react3.useRef)(null);
|
|
3238
|
-
const controls = (0, import_framer_motion.useAnimation)();
|
|
3239
|
-
(0, import_react3.useEffect)(() => {
|
|
3240
|
-
controls.start({ opacity: 1, scale: 1, y: 0 });
|
|
3241
|
-
const timer = setTimeout(() => {
|
|
3242
|
-
const textarea = textareaRef.current;
|
|
3243
|
-
if (textarea) {
|
|
3244
|
-
textarea.focus();
|
|
3245
|
-
textarea.selectionStart = textarea.selectionEnd = textarea.value.length;
|
|
3246
|
-
textarea.scrollTop = textarea.scrollHeight;
|
|
3247
|
-
}
|
|
3248
|
-
}, 10);
|
|
3249
|
-
return () => clearTimeout(timer);
|
|
3250
|
-
}, [controls]);
|
|
3251
|
-
const shake = (0, import_react3.useCallback)(async () => {
|
|
3252
|
-
await controls.start({
|
|
3253
|
-
x: [0, -3, 3, -2, 2, 0],
|
|
3254
|
-
transition: { duration: 0.25, ease: "easeOut" }
|
|
3255
|
-
});
|
|
3256
|
-
textareaRef.current?.focus();
|
|
3257
|
-
}, [controls]);
|
|
3258
|
-
(0, import_react3.useImperativeHandle)(ref, () => ({
|
|
3259
|
-
shake
|
|
3260
|
-
}), [shake]);
|
|
3261
|
-
const handleSubmit = (0, import_react3.useCallback)(() => {
|
|
3262
|
-
if (!text.trim()) return;
|
|
3263
|
-
onSubmit(text.trim());
|
|
3264
|
-
}, [text, onSubmit]);
|
|
3265
|
-
const handleKeyDown = (0, import_react3.useCallback)(
|
|
3266
|
-
(e) => {
|
|
3267
|
-
if (e.key === "Enter" && !e.shiftKey) {
|
|
3268
|
-
e.preventDefault();
|
|
3269
|
-
handleSubmit();
|
|
3270
|
-
}
|
|
3271
|
-
if (e.key === "Escape") {
|
|
3272
|
-
onCancel();
|
|
3273
|
-
}
|
|
3274
|
-
},
|
|
3275
|
-
[handleSubmit, onCancel]
|
|
3276
|
-
);
|
|
3277
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
3278
|
-
import_framer_motion.motion.div,
|
|
3279
|
-
{
|
|
3280
|
-
className: styles_module_default3.popup,
|
|
3281
|
-
"data-annotation-popup": true,
|
|
3282
|
-
initial: { opacity: 0, scale: 0.95, y: 4 },
|
|
3283
|
-
animate: controls,
|
|
3284
|
-
exit: { opacity: 0, scale: 0.95, y: 4 },
|
|
3285
|
-
transition: { type: "spring", stiffness: 500, damping: 35 },
|
|
3286
|
-
style,
|
|
3287
|
-
onClick: (e) => e.stopPropagation(),
|
|
3288
|
-
children: [
|
|
3289
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: styles_module_default3.header, children: [
|
|
3290
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: styles_module_default3.element, children: element }),
|
|
3291
|
-
timestamp && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: styles_module_default3.timestamp, children: timestamp })
|
|
3292
|
-
] }),
|
|
3293
|
-
selectedText && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: styles_module_default3.quote, children: [
|
|
3294
|
-
"\u201C",
|
|
3295
|
-
selectedText.slice(0, 80),
|
|
3296
|
-
selectedText.length > 80 ? "..." : "",
|
|
3297
|
-
"\u201D"
|
|
3298
|
-
] }),
|
|
3299
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
3300
|
-
"textarea",
|
|
3301
|
-
{
|
|
3302
|
-
ref: textareaRef,
|
|
3303
|
-
className: `${styles_module_default3.textarea} ${variant === "green" ? styles_module_default3.green : ""}`,
|
|
3304
|
-
placeholder,
|
|
3305
|
-
value: text,
|
|
3306
|
-
onChange: (e) => setText(e.target.value),
|
|
3307
|
-
rows: 2,
|
|
3308
|
-
onKeyDown: handleKeyDown
|
|
3309
|
-
}
|
|
3310
|
-
),
|
|
3311
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: styles_module_default3.actions, children: [
|
|
3312
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { className: styles_module_default3.cancel, onClick: onCancel, children: "Cancel" }),
|
|
3313
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
3314
|
-
"button",
|
|
3315
|
-
{
|
|
3316
|
-
className: `${styles_module_default3.submit} ${variant === "green" ? styles_module_default3.green : ""}`,
|
|
3317
|
-
onClick: handleSubmit,
|
|
3318
|
-
disabled: !text.trim(),
|
|
3319
|
-
children: "Add"
|
|
3320
|
-
}
|
|
3321
|
-
)
|
|
3322
|
-
] })
|
|
3323
|
-
]
|
|
3324
|
-
}
|
|
3325
|
-
);
|
|
3326
|
-
}
|
|
3327
|
-
);
|
|
3328
|
-
function AnnotationPopupPresence({
|
|
3329
|
-
isOpen,
|
|
3330
|
-
...props
|
|
3331
|
-
}) {
|
|
3332
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_framer_motion.AnimatePresence, { children: isOpen && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(AnnotationPopup, { ...props }) });
|
|
3333
|
-
}
|
|
3334
3201
|
// Annotate the CommonJS export names for ESM import in node:
|
|
3335
3202
|
0 && (module.exports = {
|
|
3336
3203
|
Agentation,
|
|
3337
|
-
AgentationCSS,
|
|
3338
3204
|
AnimatedBunny,
|
|
3339
|
-
AnnotationPopup,
|
|
3340
3205
|
AnnotationPopupCSS,
|
|
3341
|
-
AnnotationPopupPresence,
|
|
3342
3206
|
IconChatEllipsis,
|
|
3343
3207
|
IconCheck,
|
|
3344
3208
|
IconCheckSmall,
|