@blqke/vgentation 0.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/README.md ADDED
@@ -0,0 +1 @@
1
+ Documentation: [./DOCS.md](./DOCS.md)
@@ -0,0 +1,52 @@
1
+ import { CSSProperties, DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
2
+ import { ComponentTreeNode } from '../types';
3
+ export interface AnnotationPopupProps {
4
+ /** Element name to display in header */
5
+ element: string;
6
+ /** Optional timestamp display (e.g., "@ 1.23s" for animation feedback) */
7
+ timestamp?: string;
8
+ /** Optional selected/highlighted text */
9
+ selectedText?: string;
10
+ /** Placeholder text for the textarea */
11
+ placeholder?: string;
12
+ /** Initial value for textarea (for edit mode) */
13
+ initialValue?: string;
14
+ /** Label for submit button (default: "Add") */
15
+ submitLabel?: string;
16
+ /** Position styles (left, top) */
17
+ popupStyle?: CSSProperties;
18
+ /** Custom color for submit button and textarea focus (hex) */
19
+ accentColor?: string;
20
+ /** External exit state (parent controls exit animation) */
21
+ isExiting?: boolean;
22
+ /** Light mode styling */
23
+ lightMode?: boolean;
24
+ /** Vue component tree (closest component first) */
25
+ componentTree?: ComponentTreeNode[];
26
+ }
27
+ export interface AnnotationPopupExpose {
28
+ /** Shake the popup (e.g., when user clicks outside) */
29
+ shake: () => void;
30
+ }
31
+ declare const _default: DefineComponent<AnnotationPopupProps, {
32
+ /** Shake the popup (e.g., when user clicks outside) */
33
+ shake: () => void;
34
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
35
+ submit: (text: string) => any;
36
+ cancel: () => any;
37
+ selectComponent: (index: number, component: ComponentTreeNode) => any;
38
+ }, string, PublicProps, Readonly<AnnotationPopupProps> & Readonly<{
39
+ onSubmit?: ((text: string) => any) | undefined;
40
+ onCancel?: (() => any) | undefined;
41
+ onSelectComponent?: ((index: number, component: ComponentTreeNode) => any) | undefined;
42
+ }>, {
43
+ placeholder: string;
44
+ initialValue: string;
45
+ submitLabel: string;
46
+ accentColor: string;
47
+ isExiting: boolean;
48
+ lightMode: boolean;
49
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {
50
+ textareaRef: HTMLTextAreaElement;
51
+ }, HTMLDivElement>;
52
+ export default _default;
@@ -0,0 +1,103 @@
1
+ import { ComponentTreeNode } from '../types';
2
+ import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions, CreateComponentPublicInstanceWithMixins, GlobalComponents, GlobalDirectives } from 'vue';
3
+ import { AnnotationPopupProps } from './AnnotationPopup.vue';
4
+ export type DemoAnnotation = {
5
+ selector: string;
6
+ comment: string;
7
+ selectedText?: string;
8
+ };
9
+ type __VLS_Props = {
10
+ demoAnnotations?: DemoAnnotation[];
11
+ demoDelay?: number;
12
+ enableDemoMode?: boolean;
13
+ showToggleButton?: boolean;
14
+ };
15
+ declare const _default: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
16
+ demoDelay: number;
17
+ enableDemoMode: boolean;
18
+ showToggleButton: boolean;
19
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {
20
+ popupRef: CreateComponentPublicInstanceWithMixins<Readonly< AnnotationPopupProps> & Readonly<{
21
+ onSubmit?: ((text: string) => any) | undefined;
22
+ onCancel?: (() => any) | undefined;
23
+ onSelectComponent?: ((index: number, component: ComponentTreeNode) => any) | undefined;
24
+ }>, {
25
+ shake: () => void;
26
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
27
+ submit: (text: string) => any;
28
+ cancel: () => any;
29
+ selectComponent: (index: number, component: ComponentTreeNode) => any;
30
+ }, PublicProps, {
31
+ placeholder: string;
32
+ initialValue: string;
33
+ submitLabel: string;
34
+ accentColor: string;
35
+ isExiting: boolean;
36
+ lightMode: boolean;
37
+ }, false, {}, {}, GlobalComponents, GlobalDirectives, string, {
38
+ textareaRef: HTMLTextAreaElement;
39
+ }, HTMLDivElement, ComponentProvideOptions, {
40
+ P: {};
41
+ B: {};
42
+ D: {};
43
+ C: {};
44
+ M: {};
45
+ Defaults: {};
46
+ }, Readonly< AnnotationPopupProps> & Readonly<{
47
+ onSubmit?: ((text: string) => any) | undefined;
48
+ onCancel?: (() => any) | undefined;
49
+ onSelectComponent?: ((index: number, component: ComponentTreeNode) => any) | undefined;
50
+ }>, {
51
+ shake: () => void;
52
+ }, {}, {}, {}, {
53
+ placeholder: string;
54
+ initialValue: string;
55
+ submitLabel: string;
56
+ accentColor: string;
57
+ isExiting: boolean;
58
+ lightMode: boolean;
59
+ }> | null;
60
+ editPopupRef: CreateComponentPublicInstanceWithMixins<Readonly< AnnotationPopupProps> & Readonly<{
61
+ onSubmit?: ((text: string) => any) | undefined;
62
+ onCancel?: (() => any) | undefined;
63
+ onSelectComponent?: ((index: number, component: ComponentTreeNode) => any) | undefined;
64
+ }>, {
65
+ shake: () => void;
66
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
67
+ submit: (text: string) => any;
68
+ cancel: () => any;
69
+ selectComponent: (index: number, component: ComponentTreeNode) => any;
70
+ }, PublicProps, {
71
+ placeholder: string;
72
+ initialValue: string;
73
+ submitLabel: string;
74
+ accentColor: string;
75
+ isExiting: boolean;
76
+ lightMode: boolean;
77
+ }, false, {}, {}, GlobalComponents, GlobalDirectives, string, {
78
+ textareaRef: HTMLTextAreaElement;
79
+ }, HTMLDivElement, ComponentProvideOptions, {
80
+ P: {};
81
+ B: {};
82
+ D: {};
83
+ C: {};
84
+ M: {};
85
+ Defaults: {};
86
+ }, Readonly< AnnotationPopupProps> & Readonly<{
87
+ onSubmit?: ((text: string) => any) | undefined;
88
+ onCancel?: (() => any) | undefined;
89
+ onSelectComponent?: ((index: number, component: ComponentTreeNode) => any) | undefined;
90
+ }>, {
91
+ shake: () => void;
92
+ }, {}, {}, {}, {
93
+ placeholder: string;
94
+ initialValue: string;
95
+ submitLabel: string;
96
+ accentColor: string;
97
+ isExiting: boolean;
98
+ lightMode: boolean;
99
+ }> | null;
100
+ dragRectRef: HTMLDivElement;
101
+ highlightsContainerRef: HTMLDivElement;
102
+ }, any>;
103
+ export default _default;
@@ -0,0 +1,7 @@
1
+ import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
2
+ type __VLS_Props = {
3
+ size?: number;
4
+ color?: string;
5
+ };
6
+ declare const _default: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, SVGSVGElement>;
7
+ export default _default;
@@ -0,0 +1,6 @@
1
+ import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
2
+ type __VLS_Props = {
3
+ size?: number;
4
+ };
5
+ declare const _default: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, SVGSVGElement>;
6
+ export default _default;
@@ -0,0 +1,7 @@
1
+ import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
2
+ type __VLS_Props = {
3
+ size?: number;
4
+ copied?: boolean;
5
+ };
6
+ declare const _default: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, SVGSVGElement>;
7
+ export default _default;
@@ -0,0 +1,7 @@
1
+ import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
2
+ type __VLS_Props = {
3
+ size?: number;
4
+ isOpen?: boolean;
5
+ };
6
+ declare const _default: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, SVGSVGElement>;
7
+ export default _default;
@@ -0,0 +1,7 @@
1
+ import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
2
+ type __VLS_Props = {
3
+ size?: number;
4
+ isPaused?: boolean;
5
+ };
6
+ declare const _default: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, SVGSVGElement>;
7
+ export default _default;
@@ -0,0 +1,34 @@
1
+ import { FunctionalComponent, CSSProperties } from 'vue';
2
+ export { default as IconCopyAnimated } from './IconCopyAnimated.vue';
3
+ export { default as IconEyeAnimated } from './IconEyeAnimated.vue';
4
+ export { default as IconPausePlayAnimated } from './IconPausePlayAnimated.vue';
5
+ export { default as IconCheckSmallAnimated } from './IconCheckSmallAnimated.vue';
6
+ export { default as AnimatedBunny } from './AnimatedBunny.vue';
7
+ interface IconProps {
8
+ size?: number;
9
+ style?: CSSProperties;
10
+ }
11
+ export declare const IconClose: FunctionalComponent<IconProps>;
12
+ export declare const IconPlus: FunctionalComponent<IconProps>;
13
+ export declare const IconCheck: FunctionalComponent<IconProps>;
14
+ export declare const IconCheckSmall: FunctionalComponent<IconProps>;
15
+ export declare const IconListSparkle: FunctionalComponent<IconProps>;
16
+ export declare const IconHelp: FunctionalComponent<IconProps>;
17
+ export declare const IconCopyAlt: FunctionalComponent<IconProps>;
18
+ export declare const IconEye: FunctionalComponent<IconProps>;
19
+ export declare const IconEyeAlt: FunctionalComponent<IconProps>;
20
+ export declare const IconEyeClosed: FunctionalComponent<IconProps>;
21
+ export declare const IconEyeMinus: FunctionalComponent<IconProps>;
22
+ export declare const IconGear: FunctionalComponent<IconProps>;
23
+ export declare const IconPauseAlt: FunctionalComponent<IconProps>;
24
+ export declare const IconPause: FunctionalComponent<IconProps>;
25
+ export declare const IconPlayAlt: FunctionalComponent<IconProps>;
26
+ export declare const IconTrashAlt: FunctionalComponent<IconProps>;
27
+ export declare const IconChatEllipsis: FunctionalComponent<IconProps>;
28
+ export declare const IconCheckmark: FunctionalComponent<IconProps>;
29
+ export declare const IconCheckmarkLarge: FunctionalComponent<IconProps>;
30
+ export declare const IconCheckmarkCircle: FunctionalComponent<IconProps>;
31
+ export declare const IconXmark: FunctionalComponent<IconProps>;
32
+ export declare const IconXmarkLarge: FunctionalComponent<IconProps>;
33
+ export declare const IconSun: FunctionalComponent<IconProps>;
34
+ export declare const IconMoon: FunctionalComponent<IconProps>;
@@ -0,0 +1,63 @@
1
+ import { InjectionKey, Ref, ComputedRef } from 'vue';
2
+ import { Annotation } from '../types';
3
+ /** Full context returned by useVgentation() */
4
+ export interface VgentationContext {
5
+ /** Whether the annotation tool is currently active */
6
+ readonly isActive: ComputedRef<boolean>;
7
+ /** Current list of annotations */
8
+ readonly annotations: ComputedRef<readonly Annotation[]>;
9
+ /** Current markdown output */
10
+ readonly output: ComputedRef<string>;
11
+ /** Activate the annotation tool */
12
+ activate: () => void;
13
+ /** Deactivate the annotation tool */
14
+ deactivate: () => void;
15
+ /** Toggle the annotation tool active state */
16
+ toggle: () => void;
17
+ /** Clear all annotations */
18
+ clearAll: () => void;
19
+ /** Copy output to clipboard */
20
+ copyOutput: () => void;
21
+ /** Get a copy of current annotations array */
22
+ getAnnotations: () => Annotation[];
23
+ /** Get the current markdown output string */
24
+ getOutput: () => string;
25
+ /** @internal Register the Vgentation component instance */
26
+ _register: (instance: RegisteredInstance) => void;
27
+ /** @internal Unregister the Vgentation component instance */
28
+ _unregister: () => void;
29
+ /** @internal Check if a component is registered */
30
+ _isRegistered: ComputedRef<boolean>;
31
+ }
32
+ /** @internal Interface for the registered Vgentation component */
33
+ export interface RegisteredInstance {
34
+ isActive: Ref<boolean>;
35
+ annotations: Ref<Annotation[]>;
36
+ getOutput: () => string;
37
+ clearAll: () => void;
38
+ copyOutput: () => void;
39
+ }
40
+ export declare const VgentationKey: InjectionKey<VgentationContext>;
41
+ export declare function createVgentationContext(): VgentationContext;
42
+ /**
43
+ * Use the Vgentation context from anywhere in your app.
44
+ *
45
+ * @example
46
+ * ```vue
47
+ * <script setup>
48
+ * import { useVgentation } from 'vgentation'
49
+ *
50
+ * const { toggle, isActive } = useVgentation()
51
+ * </script>
52
+ *
53
+ * <template>
54
+ * <button @click="toggle">{{ isActive ? 'Active' : 'Inactive' }}</button>
55
+ * </template>
56
+ * ```
57
+ */
58
+ export declare function useVgentation(): VgentationContext;
59
+ /**
60
+ * @internal Provide Vgentation context. Used by Vgentation.vue component.
61
+ * Should not be called directly by users.
62
+ */
63
+ export declare function provideVgentation(): VgentationContext;