@designcrowd/library.brand-page 5.16.8 → 5.16.9
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/lib/src/{CreatedOnBrandCrowd-de-de-BIOe-8IA.js → CreatedOnBrandCrowd-de-de-B6cjsGEo.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-en-us-DV20bca1.js → CreatedOnBrandCrowd-en-us-DvRO5Sa0.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-es-es-DKqBeyh-.js → CreatedOnBrandCrowd-es-es-DtVH8873.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-fr-BzxDd-OM.js → CreatedOnBrandCrowd-fr-ca-D28gtzFz.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-ca-BzxDd-OM.js → CreatedOnBrandCrowd-fr-fr-D28gtzFz.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-pt-B1jO4ynE.js → CreatedOnBrandCrowd-pt-br-D10hKyH2.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-br-B1jO4ynE.js → CreatedOnBrandCrowd-pt-pt-D10hKyH2.js} +1 -1
- package/lib/src/{CreatedOnDcom-de-de-Dbz_XUoY.js → CreatedOnDcom-de-de-DMd-C-rQ.js} +1 -1
- package/lib/src/{CreatedOnDcom-en-us-C5klzL2y.js → CreatedOnDcom-en-us-TclOYB4s.js} +1 -1
- package/lib/src/{CreatedOnDcom-es-es-CP1DRQVG.js → CreatedOnDcom-es-es-D2Q12HIf.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-ca-Dh-kd_pp.js → CreatedOnDcom-fr-ca-CTRPkn9H.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-fr-DP2Sztda.js → CreatedOnDcom-fr-fr-B0FpJam-.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-br-C8n0YKop.js → CreatedOnDcom-pt-br-Cnf8RpjD.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-pt-DqGJHyCL.js → CreatedOnDcom-pt-pt-CDtpJcux.js} +1 -1
- package/lib/src/brand-page-maker/components/brandpage-maker-page/BrandPageMakerPage.mixin.d.ts +1 -0
- package/lib/src/brand-page-maker/composables/useEventTracker.d.ts +18 -0
- package/lib/src/brand-page-maker/composables/useEventTracker.js +23 -0
- package/lib/src/brand-page-maker/utils/mixpanel.util.d.ts +1 -0
- package/lib/src/brand-page-maker/utils/mixpanel.util.js +29 -0
- package/lib/src/css/library.brand-page-brandCrowd.min.css +22 -22
- package/lib/src/css/library.brand-page-brandPage.min.css +22 -22
- package/lib/src/css/library.brand-page-designCom.min.css +22 -22
- package/lib/src/css/library.brand-page-preview.min.css +22 -22
- package/lib/src/index.mjs +1 -1
- package/lib/src/{lib-CaUOFYrW.js → lib-CRiA0WxA.js} +14693 -14606
- package/lib/src/shared/content-settings/components/content-settings/ContentSettings.mixin.d.ts +1 -0
- package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItem.mixin.d.ts +1 -0
- package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.d.ts +1 -0
- package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.js +4 -0
- package/lib/src/shared/content-settings/components/image-field/ImageField.mixin.js +3 -1
- package/lib/src/shared/logo-settings/components/EditLogoSettings.mixin.d.ts +1 -0
- package/lib/src/shared/page-settings/components/page-settings/PageSettings.mixin.d.ts +1 -0
- package/lib/src/shared/publish-brand-page-with-state/PublishBrandPageModalWithState.mixin.d.ts +1 -0
- package/lib/src/shared/side-bar/components/SideBarTabButton.mixin.d.ts +1 -0
- package/lib/src/shared/style-settings/components/StyleSettings.mixin.d.ts +1 -0
- package/lib/src/shared/template-settings/components/TemplatesSettings.mixin.d.ts +1 -0
- package/package.json +1 -1
- package/src/brand-page-maker/composables/useEventTracker.ts +28 -0
- package/src/brand-page-maker/utils/mixpanel.util.ts +42 -0
- package/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.ts +4 -0
- package/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.vue +1 -1
- package/src/shared/content-settings/components/generate-ai-button/GenerateAiButton.vue +24 -6
- package/src/shared/content-settings/components/generate-ai-modal/GenerateAiModal.vue +47 -4
- package/src/shared/content-settings/components/image-field/ImageField.mixin.ts +4 -1
- package/src/shared/content-settings/components/testimonial-items-field/TestimonialItemsField.vue +3 -1
- package/src/shared/content-settings/components/text-items-field/TextItemsField.vue +3 -1
package/lib/src/shared/content-settings/components/content-settings/ContentSettings.mixin.d.ts
CHANGED
|
@@ -772,6 +772,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
772
772
|
sendAddContentContinuationEvent: (continuation: string) => void;
|
|
773
773
|
sendUpsellOfferEvent: (upsellType: string) => void;
|
|
774
774
|
sendUpsellOfferActionEvent: (upsellType: string, action: string) => void;
|
|
775
|
+
sendGenerateTextContinuationEvent: (cta_location: string, continuation: string | null) => void;
|
|
775
776
|
};
|
|
776
777
|
externalEditor: import("@tiptap/vue-3").Editor;
|
|
777
778
|
}, {
|
|
@@ -494,6 +494,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
494
494
|
sendAddContentContinuationEvent: (continuation: string) => void;
|
|
495
495
|
sendUpsellOfferEvent: (upsellType: string) => void;
|
|
496
496
|
sendUpsellOfferActionEvent: (upsellType: string, action: string) => void;
|
|
497
|
+
sendGenerateTextContinuationEvent: (cta_location: string, continuation: string | null) => void;
|
|
497
498
|
};
|
|
498
499
|
}, {
|
|
499
500
|
selectEventDebounceHandler: DebounceHandle | undefined;
|
|
@@ -811,6 +811,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
811
811
|
generateText(): string;
|
|
812
812
|
showGenerateText(): boolean;
|
|
813
813
|
plainTextValue(): string;
|
|
814
|
+
ctaLocation(): string;
|
|
814
815
|
}, {
|
|
815
816
|
onFieldChanged(payload: UpdateItemValuePayload<unknown>): void;
|
|
816
817
|
onFieldChangeLogo(): void;
|
|
@@ -12,6 +12,7 @@ import { commonTr } from '../../../../composables/useTranslate';
|
|
|
12
12
|
import { getPlainTextFromRTE, replaceTextInRTE, } from '../../../../brand-page-maker/utils';
|
|
13
13
|
import { isDefaultContentText } from '../../utils';
|
|
14
14
|
import { useUiLogoSettingsStore } from '../../../logo-settings/store';
|
|
15
|
+
import { getCtaLocationFromFieldType } from '../../../../brand-page-maker/utils/mixpanel.util';
|
|
15
16
|
const RTE_ALLOWED_SECTION_TYPES = [
|
|
16
17
|
'banner-section',
|
|
17
18
|
'text',
|
|
@@ -203,6 +204,9 @@ export default defineComponent({
|
|
|
203
204
|
return '';
|
|
204
205
|
return plainText;
|
|
205
206
|
},
|
|
207
|
+
ctaLocation() {
|
|
208
|
+
return getCtaLocationFromFieldType(this.field.name, this.type);
|
|
209
|
+
},
|
|
206
210
|
},
|
|
207
211
|
watch: {
|
|
208
212
|
fieldType() {
|
|
@@ -198,6 +198,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
198
198
|
sendAddContentContinuationEvent: (continuation: string) => void;
|
|
199
199
|
sendUpsellOfferEvent: (upsellType: string) => void;
|
|
200
200
|
sendUpsellOfferActionEvent: (upsellType: string, action: string) => void;
|
|
201
|
+
sendGenerateTextContinuationEvent: (cta_location: string, continuation: string | null) => void;
|
|
201
202
|
};
|
|
202
203
|
makerFonts: import("vue").ComputedRef<{
|
|
203
204
|
id: string;
|
|
@@ -4709,6 +4709,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
4709
4709
|
sendAddContentContinuationEvent: (continuation: string) => void;
|
|
4710
4710
|
sendUpsellOfferEvent: (upsellType: string) => void;
|
|
4711
4711
|
sendUpsellOfferActionEvent: (upsellType: string, action: string) => void;
|
|
4712
|
+
sendGenerateTextContinuationEvent: (cta_location: string, continuation: string | null) => void;
|
|
4712
4713
|
};
|
|
4713
4714
|
}, {
|
|
4714
4715
|
isDeleteModalVisible: boolean;
|
package/lib/src/shared/publish-brand-page-with-state/PublishBrandPageModalWithState.mixin.d.ts
CHANGED
|
@@ -434,6 +434,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
434
434
|
sendAddContentContinuationEvent: (continuation: string) => void;
|
|
435
435
|
sendUpsellOfferEvent: (upsellType: string) => void;
|
|
436
436
|
sendUpsellOfferActionEvent: (upsellType: string, action: string) => void;
|
|
437
|
+
sendGenerateTextContinuationEvent: (cta_location: string, continuation: string | null) => void;
|
|
437
438
|
};
|
|
438
439
|
}, {
|
|
439
440
|
purchasedDomains: UserDomainName[];
|
|
@@ -37,6 +37,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
37
37
|
sendAddContentContinuationEvent: (continuation: string) => void;
|
|
38
38
|
sendUpsellOfferEvent: (upsellType: string) => void;
|
|
39
39
|
sendUpsellOfferActionEvent: (upsellType: string, action: string) => void;
|
|
40
|
+
sendGenerateTextContinuationEvent: (cta_location: string, continuation: string | null) => void;
|
|
40
41
|
};
|
|
41
42
|
}, {}, {}, {
|
|
42
43
|
onTabSelected(tabName: string): void;
|
|
@@ -879,6 +879,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
879
879
|
sendAddContentContinuationEvent: (continuation: string) => void;
|
|
880
880
|
sendUpsellOfferEvent: (upsellType: string) => void;
|
|
881
881
|
sendUpsellOfferActionEvent: (upsellType: string, action: string) => void;
|
|
882
|
+
sendGenerateTextContinuationEvent: (cta_location: string, continuation: string | null) => void;
|
|
882
883
|
};
|
|
883
884
|
}, {
|
|
884
885
|
styleThemeKeys: Readonly<{
|
|
@@ -580,6 +580,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
580
580
|
sendAddContentContinuationEvent: (continuation: string) => void;
|
|
581
581
|
sendUpsellOfferEvent: (upsellType: string) => void;
|
|
582
582
|
sendUpsellOfferActionEvent: (upsellType: string, action: string) => void;
|
|
583
|
+
sendGenerateTextContinuationEvent: (cta_location: string, continuation: string | null) => void;
|
|
583
584
|
};
|
|
584
585
|
}, {
|
|
585
586
|
tabs: string[];
|
package/package.json
CHANGED
|
@@ -53,6 +53,11 @@ export const EVENTS = {
|
|
|
53
53
|
WEBSITE_MAKER_UPSELL_ACTION: 'website_maker_upsell_action',
|
|
54
54
|
WEBSITE_MAKER_SWITCH_LOGO: 'website_maker_switch_logo',
|
|
55
55
|
WEBSITE_MAKER_SWITCH_LOGO_MODAL: 'website_maker_switch_logo_modal',
|
|
56
|
+
WEBSITE_MAKER_AI_GENERATE_TEXT: 'website_maker_ai_generate_text',
|
|
57
|
+
WEBSITE_MAKER_AI_REGENERATE_TEXT: 'website_maker_ai_regenerate_text',
|
|
58
|
+
WEBSITE_MAKER_AI_SEND_PROMPT: 'website_maker_ai_send_prompt',
|
|
59
|
+
WEBSITE_MAKER_AI_COPY_RESPONSE: 'website_maker_ai_copy_response',
|
|
60
|
+
WEBSITE_MAKER_AI_STOP_GENERATION: 'website_maker_ai_stop_generation',
|
|
56
61
|
};
|
|
57
62
|
|
|
58
63
|
export const SELECT_LOCATIONS = {
|
|
@@ -76,6 +81,15 @@ export const UPGRADE_CTA_LOCATIONS = {
|
|
|
76
81
|
GOOGLE_ADSENSE: 'google_adsense',
|
|
77
82
|
};
|
|
78
83
|
|
|
84
|
+
export const GENERATE_AI_TEXT_CTA_LOCATIONS = {
|
|
85
|
+
BANNER_DESCRIPTION: 'banner_description',
|
|
86
|
+
BANNER_TITLE: 'banner_title',
|
|
87
|
+
ABOUT_TITLE: 'about_title',
|
|
88
|
+
ABOUT_PARAGRAPH: 'about_paragraph',
|
|
89
|
+
TEXT_ITEM: 'text_item',
|
|
90
|
+
TESTIMONIAL_ITEM: 'testimonial_item',
|
|
91
|
+
};
|
|
92
|
+
|
|
79
93
|
export const TRIGGER_TYPE = {
|
|
80
94
|
AUTOMATIC: 'automatic',
|
|
81
95
|
USER_TRIGGERED: 'user_triggered',
|
|
@@ -90,6 +104,11 @@ export const PUBLISH_MODAL_CONTINUATION_EVENTS = {
|
|
|
90
104
|
VIEW_WEBSITE: 'view_website',
|
|
91
105
|
};
|
|
92
106
|
|
|
107
|
+
export const GENERATE_TEXT_CONTINUATION_EVENTS = {
|
|
108
|
+
USE_TEXT: 'use_text',
|
|
109
|
+
EXIT: 'exit',
|
|
110
|
+
};
|
|
111
|
+
|
|
93
112
|
export const PUBLISH_OPTION_MODAL_CONTINUATION_EVENTS = {
|
|
94
113
|
PREMIUM: 'premium',
|
|
95
114
|
EXIT: 'exit',
|
|
@@ -266,6 +285,15 @@ const useEventTracker = () => {
|
|
|
266
285
|
action,
|
|
267
286
|
});
|
|
268
287
|
},
|
|
288
|
+
sendGenerateTextContinuationEvent: (
|
|
289
|
+
cta_location: string,
|
|
290
|
+
continuation: string | null,
|
|
291
|
+
) => {
|
|
292
|
+
_publishEvent(EVENTS.WEBSITE_MAKER_AI_GENERATE_TEXT, {
|
|
293
|
+
cta_location,
|
|
294
|
+
continuation,
|
|
295
|
+
});
|
|
296
|
+
},
|
|
269
297
|
};
|
|
270
298
|
};
|
|
271
299
|
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { GENERATE_AI_TEXT_CTA_LOCATIONS } from '../composables/useEventTracker';
|
|
2
|
+
|
|
3
|
+
export const getCtaLocationFromFieldType = (
|
|
4
|
+
fieldType: string,
|
|
5
|
+
sectionType?: string,
|
|
6
|
+
): string => {
|
|
7
|
+
if (fieldType === 'text') {
|
|
8
|
+
return GENERATE_AI_TEXT_CTA_LOCATIONS.TEXT_ITEM;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
if (fieldType === 'testimonials') {
|
|
12
|
+
return GENERATE_AI_TEXT_CTA_LOCATIONS.TESTIMONIAL_ITEM;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
if (sectionType === 'banner-section') {
|
|
16
|
+
if (fieldType === 'description') {
|
|
17
|
+
return GENERATE_AI_TEXT_CTA_LOCATIONS.BANNER_DESCRIPTION;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
if (fieldType === 'title') {
|
|
21
|
+
return GENERATE_AI_TEXT_CTA_LOCATIONS.BANNER_TITLE;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
if (sectionType === 'about-section') {
|
|
26
|
+
if (fieldType === 'title') {
|
|
27
|
+
return GENERATE_AI_TEXT_CTA_LOCATIONS.ABOUT_TITLE;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
if (fieldType === 'paragraph') {
|
|
31
|
+
return GENERATE_AI_TEXT_CTA_LOCATIONS.ABOUT_PARAGRAPH;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// Fallback: try to match directly with field type
|
|
36
|
+
// This handles cases where fieldType might already be in the correct format
|
|
37
|
+
const matchingLocation = Object.values(GENERATE_AI_TEXT_CTA_LOCATIONS).find(
|
|
38
|
+
(location) => location === fieldType,
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
return matchingLocation || fieldType;
|
|
42
|
+
};
|
|
@@ -30,6 +30,7 @@ import {
|
|
|
30
30
|
} from '../../../../brand-page-maker/utils';
|
|
31
31
|
import { isDefaultContentText } from '../../utils';
|
|
32
32
|
import { useUiLogoSettingsStore } from '../../../logo-settings/store';
|
|
33
|
+
import { getCtaLocationFromFieldType } from '../../../../brand-page-maker/utils/mixpanel.util';
|
|
33
34
|
|
|
34
35
|
const RTE_ALLOWED_SECTION_TYPES = [
|
|
35
36
|
'banner-section',
|
|
@@ -252,6 +253,9 @@ export default defineComponent({
|
|
|
252
253
|
|
|
253
254
|
return plainText;
|
|
254
255
|
},
|
|
256
|
+
ctaLocation(): string {
|
|
257
|
+
return getCtaLocationFromFieldType(this.field.name, this.type);
|
|
258
|
+
},
|
|
255
259
|
},
|
|
256
260
|
watch: {
|
|
257
261
|
fieldType() {
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
:is-visible="generateTextModalVisible"
|
|
16
16
|
:existing-text="props.existingText"
|
|
17
17
|
:is-design-com="props.isDesignCom"
|
|
18
|
-
:
|
|
18
|
+
:cta-location="props.ctaLocation"
|
|
19
19
|
@on-close="onCloseGenerateTextModal"
|
|
20
20
|
@on-use-text="handleUseGeneratedText"
|
|
21
21
|
/>
|
|
@@ -32,18 +32,22 @@ import {
|
|
|
32
32
|
useSnapshotStore,
|
|
33
33
|
} from '../../../../brand-page-maker/stores';
|
|
34
34
|
import type { AbTestResult } from '../../../../brand-page/models/brand-page-context.model';
|
|
35
|
+
import {
|
|
36
|
+
EVENTS,
|
|
37
|
+
GENERATE_TEXT_CONTINUATION_EVENTS,
|
|
38
|
+
useEventTracker,
|
|
39
|
+
} from '../../../../brand-page-maker/composables/useEventTracker';
|
|
35
40
|
|
|
36
41
|
interface Props {
|
|
37
42
|
id: string;
|
|
38
43
|
existingText: string;
|
|
39
44
|
isDesignCom?: boolean;
|
|
40
45
|
captureSnapshotDelay?: number;
|
|
41
|
-
|
|
46
|
+
ctaLocation: string;
|
|
42
47
|
}
|
|
43
48
|
|
|
44
49
|
const props = withDefaults(defineProps<Props>(), {
|
|
45
50
|
isDesignCom: false,
|
|
46
|
-
fieldType: 'text',
|
|
47
51
|
});
|
|
48
52
|
|
|
49
53
|
const emit = defineEmits<{
|
|
@@ -52,6 +56,7 @@ const emit = defineEmits<{
|
|
|
52
56
|
}>();
|
|
53
57
|
|
|
54
58
|
const brandPageContainerStore = useBrandPageContainerStore();
|
|
59
|
+
const eventTracker = useEventTracker();
|
|
55
60
|
const snapshotStore = useSnapshotStore();
|
|
56
61
|
|
|
57
62
|
const abTests = computed(() => brandPageContainerStore.abTests);
|
|
@@ -68,10 +73,18 @@ const generateTextModalVisible = ref(false);
|
|
|
68
73
|
const generateText = commonTr('generateText');
|
|
69
74
|
|
|
70
75
|
const onShowGenerateModal = () => {
|
|
71
|
-
snapshotStore.clearSnapshot();
|
|
72
|
-
|
|
73
76
|
generateTextModalVisible.value = true;
|
|
74
77
|
|
|
78
|
+
eventTracker.sendWebsiteEvent({
|
|
79
|
+
eventName: EVENTS.WEBSITE_MAKER_AI_GENERATE_TEXT,
|
|
80
|
+
eventProps: {
|
|
81
|
+
cta_location: props.ctaLocation,
|
|
82
|
+
continuation: null,
|
|
83
|
+
},
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
snapshotStore.clearSnapshot();
|
|
87
|
+
|
|
75
88
|
setTimeout(() => {
|
|
76
89
|
emit('capture-snapshot');
|
|
77
90
|
}, 50);
|
|
@@ -79,10 +92,15 @@ const onShowGenerateModal = () => {
|
|
|
79
92
|
|
|
80
93
|
const onCloseGenerateTextModal = () => {
|
|
81
94
|
generateTextModalVisible.value = false;
|
|
95
|
+
|
|
96
|
+
eventTracker.sendGenerateTextContinuationEvent(
|
|
97
|
+
props.ctaLocation,
|
|
98
|
+
GENERATE_TEXT_CONTINUATION_EVENTS.EXIT,
|
|
99
|
+
);
|
|
82
100
|
};
|
|
83
101
|
|
|
84
102
|
const handleUseGeneratedText = (generatedText: string) => {
|
|
85
103
|
emit('on-use-text', generatedText);
|
|
86
|
-
|
|
104
|
+
generateTextModalVisible.value = false;
|
|
87
105
|
};
|
|
88
106
|
</script>
|
|
@@ -162,18 +162,24 @@ import {
|
|
|
162
162
|
commonTr,
|
|
163
163
|
} from '../../../../composables/useTranslate';
|
|
164
164
|
import { getInstance as getDesignTemplateClient } from '../../../../clients/design-template-client';
|
|
165
|
+
import {
|
|
166
|
+
EVENTS,
|
|
167
|
+
GENERATE_TEXT_CONTINUATION_EVENTS,
|
|
168
|
+
useEventTracker,
|
|
169
|
+
} from '../../../../brand-page-maker/composables/useEventTracker';
|
|
165
170
|
import { useSnapshotStore } from '../../../../brand-page-maker/stores';
|
|
166
171
|
|
|
167
172
|
interface Props {
|
|
168
173
|
isVisible: boolean;
|
|
169
174
|
existingText?: string;
|
|
170
175
|
isDesignCom?: boolean;
|
|
171
|
-
|
|
176
|
+
ctaLocation: string;
|
|
172
177
|
}
|
|
173
178
|
|
|
174
179
|
const props = withDefaults(defineProps<Props>(), {
|
|
175
180
|
isVisible: true,
|
|
176
181
|
existingText: '',
|
|
182
|
+
snapshotBase64: null,
|
|
177
183
|
fieldType: 'text',
|
|
178
184
|
});
|
|
179
185
|
|
|
@@ -189,6 +195,7 @@ const data = reactive({
|
|
|
189
195
|
promptError: '',
|
|
190
196
|
});
|
|
191
197
|
|
|
198
|
+
const eventTracker = useEventTracker();
|
|
192
199
|
const textareaRef = ref<HTMLTextAreaElement | null>(null);
|
|
193
200
|
const MAX_PROMPT_LENGTH = 500;
|
|
194
201
|
|
|
@@ -303,6 +310,13 @@ const typeText = (fullText: string) => {
|
|
|
303
310
|
const copyToClipboard = async () => {
|
|
304
311
|
if (!data.response) return;
|
|
305
312
|
|
|
313
|
+
eventTracker.sendWebsiteEvent({
|
|
314
|
+
eventName: EVENTS.WEBSITE_MAKER_AI_COPY_RESPONSE,
|
|
315
|
+
eventProps: {
|
|
316
|
+
cta_location: props.ctaLocation,
|
|
317
|
+
},
|
|
318
|
+
});
|
|
319
|
+
|
|
306
320
|
try {
|
|
307
321
|
await navigator.clipboard.writeText(data.response);
|
|
308
322
|
data.isCopied = true;
|
|
@@ -319,21 +333,44 @@ const copyToClipboard = async () => {
|
|
|
319
333
|
const onUseText = () => {
|
|
320
334
|
if (!data.response) return;
|
|
321
335
|
|
|
336
|
+
eventTracker.sendGenerateTextContinuationEvent(
|
|
337
|
+
props.ctaLocation,
|
|
338
|
+
GENERATE_TEXT_CONTINUATION_EVENTS.USE_TEXT,
|
|
339
|
+
);
|
|
340
|
+
|
|
322
341
|
emit('on-use-text', data.response);
|
|
323
342
|
onClose();
|
|
324
343
|
};
|
|
325
344
|
|
|
326
345
|
const onStopGeneration = () => {
|
|
346
|
+
eventTracker.sendWebsiteEvent({
|
|
347
|
+
eventName: EVENTS.WEBSITE_MAKER_AI_STOP_GENERATION,
|
|
348
|
+
eventProps: {
|
|
349
|
+
cta_location: props.ctaLocation,
|
|
350
|
+
},
|
|
351
|
+
});
|
|
327
352
|
stopGeneration();
|
|
328
353
|
data.response = generateAiModalTr('generationStopped');
|
|
329
354
|
};
|
|
330
355
|
const onRegeneratePrompt = () => {
|
|
331
356
|
if (data.lastPromptSent) {
|
|
357
|
+
eventTracker.sendWebsiteEvent({
|
|
358
|
+
eventName: EVENTS.WEBSITE_MAKER_AI_REGENERATE_TEXT,
|
|
359
|
+
eventProps: {
|
|
360
|
+
cta_location: props.ctaLocation,
|
|
361
|
+
},
|
|
362
|
+
});
|
|
332
363
|
onSendPrompt(data.lastPromptSent);
|
|
333
364
|
}
|
|
334
365
|
};
|
|
335
366
|
|
|
336
367
|
const onSendButtonClick = () => {
|
|
368
|
+
eventTracker.sendWebsiteEvent({
|
|
369
|
+
eventName: EVENTS.WEBSITE_MAKER_AI_SEND_PROMPT,
|
|
370
|
+
eventProps: {
|
|
371
|
+
cta_location: props.ctaLocation,
|
|
372
|
+
},
|
|
373
|
+
});
|
|
337
374
|
onSendPrompt();
|
|
338
375
|
};
|
|
339
376
|
|
|
@@ -399,10 +436,10 @@ const onSendPrompt = async (customPrompt?: string) => {
|
|
|
399
436
|
}
|
|
400
437
|
};
|
|
401
438
|
|
|
402
|
-
// Generate default prompt based on
|
|
439
|
+
// Generate default prompt based on CTA location
|
|
403
440
|
const getDefaultPrompt = (): string => {
|
|
404
|
-
const
|
|
405
|
-
return `Improve this ${
|
|
441
|
+
const locationLabel = props.ctaLocation.replace(/_/g, ' ');
|
|
442
|
+
return `Improve this ${locationLabel}`;
|
|
406
443
|
};
|
|
407
444
|
|
|
408
445
|
// Auto-generate text when modal opens if there's existing text
|
|
@@ -416,6 +453,12 @@ watch(
|
|
|
416
453
|
data.lastPromptSent = '';
|
|
417
454
|
|
|
418
455
|
if (props.existingText && props.existingText.trim()) {
|
|
456
|
+
eventTracker.sendWebsiteEvent({
|
|
457
|
+
eventName: EVENTS.WEBSITE_MAKER_AI_SEND_PROMPT,
|
|
458
|
+
eventProps: {
|
|
459
|
+
cta_location: props.ctaLocation,
|
|
460
|
+
},
|
|
461
|
+
});
|
|
419
462
|
const defaultPrompt = getDefaultPrompt();
|
|
420
463
|
onSendPrompt(defaultPrompt);
|
|
421
464
|
}
|
package/src/shared/content-settings/components/testimonial-items-field/TestimonialItemsField.vue
CHANGED
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
:id="`${id}-${option.index}`"
|
|
22
22
|
:existing-text="getPlainTextValue(option.index)"
|
|
23
23
|
:is-design-com="isDesignCom"
|
|
24
|
-
|
|
24
|
+
:cta-location="getCtaLocationFromFieldType('testimonials')"
|
|
25
25
|
@capture-snapshot="onCaptureSnapshot"
|
|
26
26
|
@on-use-text="(text) => onUseGeneratedText(text, option.index)"
|
|
27
27
|
/>
|
|
@@ -204,6 +204,7 @@ import TextareaField from '../../../content-settings/components/textarea-field/T
|
|
|
204
204
|
import ColorReplacementsField from '../color-replacements-field/ColorReplacementsField.vue';
|
|
205
205
|
import GenerateAiButton from '../generate-ai-button/GenerateAiButton.vue';
|
|
206
206
|
import { testimonialItemsFieldTr } from '../../../../composables/useTranslate';
|
|
207
|
+
import { getCtaLocationFromFieldType } from '../../../../brand-page-maker/utils/mixpanel.util';
|
|
207
208
|
import PersonalisationOverrideField from '../../../content-settings/components/personalisation-override-field/PersonalisationOverrideField.vue';
|
|
208
209
|
|
|
209
210
|
export default {
|
|
@@ -221,6 +222,7 @@ export default {
|
|
|
221
222
|
setup() {
|
|
222
223
|
return {
|
|
223
224
|
testimonialItemsFieldTr,
|
|
225
|
+
getCtaLocationFromFieldType,
|
|
224
226
|
};
|
|
225
227
|
},
|
|
226
228
|
};
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
:id="`${id}-${option.index}`"
|
|
22
22
|
:existing-text="getPlainTextValue(option.index)"
|
|
23
23
|
:is-design-com="isDesignCom"
|
|
24
|
-
|
|
24
|
+
:cta-location="getCtaLocationFromFieldType('text')"
|
|
25
25
|
@capture-snapshot="onCaptureSnapshot"
|
|
26
26
|
@on-use-text="(text) => onUseGeneratedText(text, option.index)"
|
|
27
27
|
/>
|
|
@@ -97,6 +97,7 @@ import {
|
|
|
97
97
|
textItemsFieldTr,
|
|
98
98
|
} from '../../../../composables/useTranslate';
|
|
99
99
|
import PersonalisationOverrideField from '../../../content-settings/components/personalisation-override-field/PersonalisationOverrideField.vue';
|
|
100
|
+
import { getCtaLocationFromFieldType } from '../../../../brand-page-maker/utils/mixpanel.util';
|
|
100
101
|
|
|
101
102
|
export default {
|
|
102
103
|
components: {
|
|
@@ -112,6 +113,7 @@ export default {
|
|
|
112
113
|
return {
|
|
113
114
|
commonTr,
|
|
114
115
|
textItemsFieldTr,
|
|
116
|
+
getCtaLocationFromFieldType,
|
|
115
117
|
};
|
|
116
118
|
},
|
|
117
119
|
};
|