posthog-js 1.347.2 → 1.348.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/array.full.es5.js +1 -1
- package/dist/array.full.js +1 -1
- package/dist/array.full.no-external.js +1 -1
- package/dist/array.js +1 -1
- package/dist/array.no-external.js +1 -1
- package/dist/conversations.js +1 -1
- package/dist/conversations.js.map +1 -1
- package/dist/customizations.full.js +1 -1
- package/dist/lazy-recorder.js +1 -1
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/module.d.ts +43 -1
- package/dist/module.full.d.ts +43 -1
- package/dist/module.full.js +1 -1
- package/dist/module.full.js.map +1 -1
- package/dist/module.full.no-external.d.ts +43 -1
- package/dist/module.full.no-external.js +1 -1
- package/dist/module.full.no-external.js.map +1 -1
- package/dist/module.js +1 -1
- package/dist/module.js.map +1 -1
- package/dist/module.no-external.d.ts +43 -1
- package/dist/module.no-external.js +1 -1
- package/dist/module.no-external.js.map +1 -1
- package/dist/posthog-recorder.js +1 -1
- package/dist/product-tours-preview.d.ts +2 -0
- package/dist/product-tours-preview.js +1 -1
- package/dist/product-tours-preview.js.map +1 -1
- package/dist/product-tours.js +1 -1
- package/dist/product-tours.js.map +1 -1
- package/dist/src/extensions/conversations/external/components/ConversationsWidget.d.ts +43 -2
- package/dist/src/extensions/conversations/external/components/TicketListItem.d.ts +13 -0
- package/dist/src/extensions/conversations/external/components/TicketListView.d.ts +15 -0
- package/dist/src/extensions/conversations/external/components/styles.d.ts +184 -0
- package/dist/src/extensions/conversations/external/components/utils.d.ts +8 -0
- package/dist/src/extensions/conversations/external/index.d.ts +39 -1
- package/dist/src/extensions/product-tours/product-tours.d.ts +2 -0
- package/dist/src/posthog-product-tours-types.d.ts +42 -0
- package/dist/surveys-preview.d.ts +2 -0
- package/lib/package.json +1 -1
- package/lib/src/extensions/conversations/external/components/ConversationsWidget.d.ts +43 -2
- package/lib/src/extensions/conversations/external/components/ConversationsWidget.js +96 -28
- package/lib/src/extensions/conversations/external/components/ConversationsWidget.js.map +1 -1
- package/lib/src/extensions/conversations/external/components/TicketListItem.d.ts +13 -0
- package/lib/src/extensions/conversations/external/components/TicketListItem.js +47 -0
- package/lib/src/extensions/conversations/external/components/TicketListItem.js.map +1 -0
- package/lib/src/extensions/conversations/external/components/TicketListView.d.ts +15 -0
- package/lib/src/extensions/conversations/external/components/TicketListView.js +75 -0
- package/lib/src/extensions/conversations/external/components/TicketListView.js.map +1 -0
- package/lib/src/extensions/conversations/external/components/styles.d.ts +184 -0
- package/lib/src/extensions/conversations/external/components/styles.js +189 -0
- package/lib/src/extensions/conversations/external/components/styles.js.map +1 -1
- package/lib/src/extensions/conversations/external/components/utils.d.ts +8 -0
- package/lib/src/extensions/conversations/external/components/utils.js +49 -0
- package/lib/src/extensions/conversations/external/components/utils.js.map +1 -0
- package/lib/src/extensions/conversations/external/index.d.ts +39 -1
- package/lib/src/extensions/conversations/external/index.js +253 -31
- package/lib/src/extensions/conversations/external/index.js.map +1 -1
- package/lib/src/extensions/product-tours/components/ProductTourSurveyStepInner.js +1 -1
- package/lib/src/extensions/product-tours/components/ProductTourSurveyStepInner.js.map +1 -1
- package/lib/src/extensions/product-tours/product-tours.d.ts +2 -0
- package/lib/src/extensions/product-tours/product-tours.js +78 -71
- package/lib/src/extensions/product-tours/product-tours.js.map +1 -1
- package/lib/src/posthog-product-tours-types.d.ts +42 -0
- package/lib/src/posthog-product-tours-types.js +43 -1
- package/lib/src/posthog-product-tours-types.js.map +1 -1
- package/lib/src/utils/product-tour-event-receiver.js +2 -1
- package/lib/src/utils/product-tour-event-receiver.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/react/dist/esm/index.js +25 -1
- package/react/dist/esm/index.js.map +1 -1
- package/react/dist/types/index.d.ts +4 -2
- package/react/dist/umd/index.js +25 -0
- package/react/dist/umd/index.js.map +1 -1
|
@@ -93,6 +93,6 @@ function ProductTourSurveyStepInner(_a) {
|
|
|
93
93
|
if (!survey) {
|
|
94
94
|
return (0, jsx_runtime_1.jsx)("div", {});
|
|
95
95
|
}
|
|
96
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("button", { class: "ph-tour-dismiss", onClick: onDismiss, "aria-label": "Close survey", style: cursorStyle, children: (0, icons_1.cancelSVG)() }), (0, jsx_runtime_1.jsx)("div", { class: "ph-tour-survey-question", children: survey.questionText }), isOpenText ? ((0, jsx_runtime_1.jsx)(OpenTextInput, { value: textValue, onChange: setTextValue, onSubmit: handleTextSubmit, isInteractive: isInteractive })) : ((0, jsx_runtime_1.jsx)(RatingInput, { survey: survey, onSubmit: onSubmit, isInteractive: isInteractive })), (0, jsx_runtime_1.jsxs)("div", { class: "ph-tour-footer", children: [(0, jsx_runtime_1.jsxs)("span", { class: "ph-tour-progress", children: [stepIndex + 1, " of ", totalSteps] }), (0, jsx_runtime_1.jsxs)("div", { class: "ph-tour-buttons", children: [!isFirstStep && ((0, jsx_runtime_1.jsx)("button", { class: "ph-tour-button ph-tour-button--secondary", onClick: onPrevious, style: cursorStyle, children:
|
|
96
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("button", { class: "ph-tour-dismiss", onClick: onDismiss, "aria-label": "Close survey", style: cursorStyle, children: (0, icons_1.cancelSVG)() }), (0, jsx_runtime_1.jsx)("div", { class: "ph-tour-survey-question", children: survey.questionText }), isOpenText ? ((0, jsx_runtime_1.jsx)(OpenTextInput, { value: textValue, onChange: setTextValue, onSubmit: handleTextSubmit, isInteractive: isInteractive })) : ((0, jsx_runtime_1.jsx)(RatingInput, { survey: survey, onSubmit: onSubmit, isInteractive: isInteractive })), (0, jsx_runtime_1.jsxs)("div", { class: "ph-tour-footer", children: [(0, jsx_runtime_1.jsxs)("span", { class: "ph-tour-progress", children: [stepIndex + 1, " of ", totalSteps] }), (0, jsx_runtime_1.jsxs)("div", { class: "ph-tour-buttons", children: [!isFirstStep && ((0, jsx_runtime_1.jsx)("button", { class: "ph-tour-button ph-tour-button--secondary", onClick: onPrevious, style: cursorStyle, children: survey.backButtonText || 'Back' })), isOpenText && ((0, jsx_runtime_1.jsx)("button", { class: "ph-tour-button ph-tour-button--primary", onClick: handleTextSubmit, style: cursorStyle, children: survey.submitButtonText || 'Submit' }))] })] }), !whiteLabel && ((0, jsx_runtime_1.jsxs)("a", { href: isInteractive ? 'https://posthog.com/product-tours' : undefined, target: isInteractive ? '_blank' : undefined, rel: isInteractive ? 'noopener noreferrer' : undefined, class: "ph-tour-branding", style: isInteractive ? undefined : { cursor: 'default', pointerEvents: 'none' }, children: ["Survey by ", icons_1.IconPosthogLogo] }))] }));
|
|
97
97
|
}
|
|
98
98
|
//# sourceMappingURL=ProductTourSurveyStepInner.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductTourSurveyStepInner.js","sourceRoot":"","sources":["../../../../../src/extensions/product-tours/components/ProductTourSurveyStepInner.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAqKA,gEAqFC;;AAzPD,sCAA0D;AAE1D,6CAAgE;AAChE,6CAM4B;AAY5B,IAAM,gBAAgB,GAAG,CAAC,yBAAiB,EAAE,oBAAY,EAAE,sBAAc,CAAC,CAAA;AAC1E,IAAM,eAAe,GAAG,CAAC,6BAAqB,EAAE,yBAAiB,EAAE,oBAAY,EAAE,sBAAc,EAAE,0BAAkB,CAAC,CAAA;AAEpH,SAAS,eAAe,CAAC,KAAa;IAClC,QAAQ,KAAK,EAAE,CAAC;QACZ,KAAK,CAAC;YACF,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAA;QAC1B,KAAK,EAAE;YACH,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,C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AAE,YAAY,EACtB,QAAQ,EAAE,gBAAgB,EAC1B,aAAa,EAAE,aAAa,GAC9B,CACL,CAAC,CAAC,CAAC,CACA,uBAAC,WAAW,IAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,aAAa,EAAE,aAAa,GAAI,CACpF,EAED,iCAAK,KAAK,EAAC,gBAAgB,aACvB,kCAAM,KAAK,EAAC,kBAAkB,aACzB,SAAS,GAAG,CAAC,UAAM,UAAU,IAC3B,EAEP,iCAAK,KAAK,EAAC,iBAAiB,aACvB,CAAC,WAAW,IAAI,CACb,mCACI,KAAK,EAAC,0CAA0C,EAChD,OAAO,EAAE,UAAU,EACnB,KAAK,EAAE,WAAW,qBAGb,CACZ,EACA,UAAU,IAAI,CACX,mCACI,KAAK,EAAC,wCAAwC,EAC9C,OAAO,EAAE,gBAAgB,EACzB,KAAK,EAAE,WAAW,uBAGb,CACZ,IACC,IACJ,EAEL,CAAC,UAAU,IAAI,CACZ,+BACI,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC,mCAAmC,CAAC,CAAC,CAAC,SAAS,EACrE,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,EAC5C,GAAG,EAAE,aAAa,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,SAAS,EACtD,KAAK,EAAC,kBAAkB,EACxB,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,EAAE,2BAEpE,uBAAe,IAC1B,CACP,IACF,CACN,CAAA;AACL,CAAC","sourcesContent":["import { h } from 'preact'\nimport { useState, useRef, useEffect } from 'preact/hooks'\nimport { ProductTourStep, ProductTourAppearance, ProductTourSurveyQuestion } from '../../../posthog-product-tours-types'\nimport { cancelSVG, IconPosthogLogo } from '../../surveys/icons'\nimport {\n dissatisfiedEmoji,\n neutralEmoji,\n satisfiedEmoji,\n veryDissatisfiedEmoji,\n verySatisfiedEmoji,\n} from '../../surveys/icons'\n\nexport interface ProductTourSurveyStepInnerProps {\n step: ProductTourStep\n appearance?: ProductTourAppearance\n stepIndex: number\n totalSteps: number\n onPrevious?: () => void\n onSubmit?: (response: string | number | null) => void\n onDismiss?: () => void\n}\n\nconst threeScaleEmojis = [dissatisfiedEmoji, neutralEmoji, satisfiedEmoji]\nconst fiveScaleEmojis = [veryDissatisfiedEmoji, dissatisfiedEmoji, neutralEmoji, satisfiedEmoji, verySatisfiedEmoji]\n\nfunction getScaleNumbers(scale: number): number[] {\n switch (scale) {\n case 5:\n return [1, 2, 3, 4, 5]\n case 10:\n return [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\n default:\n return [1, 2, 3, 4, 5]\n }\n}\n\nfunction OpenTextInput({\n value,\n onChange,\n onSubmit,\n isInteractive,\n}: {\n value: string\n onChange: (text: string) => void\n onSubmit?: () => void\n isInteractive: boolean\n}): h.JSX.Element {\n const inputRef = useRef<HTMLTextAreaElement>(null)\n\n useEffect(() => {\n if (isInteractive) {\n setTimeout(() => inputRef.current?.focus(), 100)\n }\n }, [isInteractive])\n\n const handleKeyDown = (e: KeyboardEvent) => {\n if (e.key === 'Enter' && e.metaKey && isInteractive) {\n e.preventDefault()\n onSubmit?.()\n }\n }\n\n return (\n <textarea\n ref={inputRef}\n class=\"ph-tour-survey-textarea\"\n rows={3}\n placeholder=\"Your feedback (optional)...\"\n value={value}\n onInput={(e) => onChange((e.target as HTMLTextAreaElement).value)}\n onKeyDown={handleKeyDown}\n disabled={!isInteractive}\n style={isInteractive ? undefined : { cursor: 'default' }}\n />\n )\n}\n\nfunction RatingInput({\n survey,\n onSubmit,\n isInteractive,\n}: {\n survey: ProductTourSurveyQuestion\n onSubmit?: (rating: number) => void\n isInteractive: boolean\n}): h.JSX.Element {\n const [selectedRating, setSelectedRating] = useState<number | null>(null)\n const display = survey.display || 'emoji'\n const scale = survey.scale || 5\n\n const handleSelect = (rating: number) => {\n if (!isInteractive) {\n return\n }\n setSelectedRating(rating)\n // Auto-submit on selection for ratings\n onSubmit?.(rating)\n }\n\n if (display === 'emoji') {\n const emojis = scale === 3 ? threeScaleEmojis : fiveScaleEmojis\n return (\n <div class=\"ph-tour-survey-rating-container\">\n <div class=\"ph-tour-survey-rating-emoji\">\n {emojis.map((emoji, idx) => {\n const rating = idx + 1\n const isActive = selectedRating === rating\n return (\n <button\n key={idx}\n type=\"button\"\n class={`ph-tour-survey-emoji-button ${isActive ? 'ph-tour-survey-emoji-button--active' : ''}`}\n onClick={() => handleSelect(rating)}\n style={isInteractive ? undefined : { cursor: 'default' }}\n aria-label={`Rate ${rating}`}\n >\n {emoji}\n </button>\n )\n })}\n </div>\n {(survey.lowerBoundLabel || survey.upperBoundLabel) && (\n <div class=\"ph-tour-survey-rating-labels\">\n <span>{survey.lowerBoundLabel}</span>\n <span>{survey.upperBoundLabel}</span>\n </div>\n )}\n </div>\n )\n }\n\n // Number display\n const numbers = getScaleNumbers(scale)\n return (\n <div class=\"ph-tour-survey-rating-container\">\n <div\n class=\"ph-tour-survey-rating-numbers\"\n style={{ gridTemplateColumns: `repeat(${numbers.length}, minmax(0, 1fr))` }}\n >\n {numbers.map((num) => {\n const isActive = selectedRating === num\n return (\n <button\n key={num}\n type=\"button\"\n class={`ph-tour-survey-number-button ${isActive ? 'ph-tour-survey-number-button--active' : ''}`}\n onClick={() => handleSelect(num)}\n style={isInteractive ? undefined : { cursor: 'default' }}\n aria-label={`Rate ${num}`}\n >\n {num}\n </button>\n )\n })}\n </div>\n {(survey.lowerBoundLabel || survey.upperBoundLabel) && (\n <div class=\"ph-tour-survey-rating-labels\">\n <span>{survey.lowerBoundLabel}</span>\n <span>{survey.upperBoundLabel}</span>\n </div>\n )}\n </div>\n )\n}\n\nexport function ProductTourSurveyStepInner({\n step,\n appearance,\n stepIndex,\n totalSteps,\n onPrevious,\n onSubmit,\n onDismiss,\n}: ProductTourSurveyStepInnerProps): h.JSX.Element {\n const [textValue, setTextValue] = useState('')\n const survey = step.survey\n const whiteLabel = appearance?.whiteLabel ?? false\n const isFirstStep = stepIndex === 0\n const isOpenText = survey?.type === 'open'\n\n const isInteractive = !!(onPrevious || onSubmit || onDismiss)\n const cursorStyle = isInteractive ? undefined : { cursor: 'default' }\n\n const handleTextSubmit = () => {\n onSubmit?.(textValue.trim() || null)\n }\n\n if (!survey) {\n return <div />\n }\n\n return (\n <>\n <button class=\"ph-tour-dismiss\" onClick={onDismiss} aria-label=\"Close survey\" style={cursorStyle}>\n {cancelSVG()}\n </button>\n\n <div class=\"ph-tour-survey-question\">{survey.questionText}</div>\n\n {isOpenText ? (\n <OpenTextInput\n value={textValue}\n onChange={setTextValue}\n onSubmit={handleTextSubmit}\n isInteractive={isInteractive}\n />\n ) : (\n <RatingInput survey={survey} onSubmit={onSubmit} isInteractive={isInteractive} />\n )}\n\n <div class=\"ph-tour-footer\">\n <span class=\"ph-tour-progress\">\n {stepIndex + 1} of {totalSteps}\n </span>\n\n <div class=\"ph-tour-buttons\">\n {!isFirstStep && (\n <button\n class=\"ph-tour-button ph-tour-button--secondary\"\n onClick={onPrevious}\n style={cursorStyle}\n >\n Back\n </button>\n )}\n {isOpenText && (\n <button\n class=\"ph-tour-button ph-tour-button--primary\"\n onClick={handleTextSubmit}\n style={cursorStyle}\n >\n Submit\n </button>\n )}\n </div>\n </div>\n\n {!whiteLabel && (\n <a\n href={isInteractive ? 'https://posthog.com/product-tours' : undefined}\n target={isInteractive ? '_blank' : undefined}\n rel={isInteractive ? 'noopener noreferrer' : undefined}\n class=\"ph-tour-branding\"\n style={isInteractive ? undefined : { cursor: 'default', pointerEvents: 'none' }}\n >\n Survey by {IconPosthogLogo}\n </a>\n )}\n </>\n )\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ProductTourSurveyStepInner.js","sourceRoot":"","sources":["../../../../../src/extensions/product-tours/components/ProductTourSurveyStepInner.tsx"],"names":[],"mappings":";;;;;;;;;;;;;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+BACI,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC,mCAAmC,CAAC,CAAC,CAAC,SAAS,EACrE,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,EAC5C,GAAG,EAAE,aAAa,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,SAAS,EACtD,KAAK,EAAC,kBAAkB,EACxB,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,EAAE,2BAEpE,uBAAe,IAC1B,CACP,IACF,CACN,CAAA;AACL,CAAC","sourcesContent":["import { h } from 'preact'\nimport { useState, useRef, useEffect } from 'preact/hooks'\nimport { ProductTourStep, ProductTourAppearance, ProductTourSurveyQuestion } from '../../../posthog-product-tours-types'\nimport { cancelSVG, IconPosthogLogo } from '../../surveys/icons'\nimport {\n dissatisfiedEmoji,\n neutralEmoji,\n satisfiedEmoji,\n veryDissatisfiedEmoji,\n verySatisfiedEmoji,\n} from '../../surveys/icons'\n\nexport interface ProductTourSurveyStepInnerProps {\n step: ProductTourStep\n appearance?: ProductTourAppearance\n stepIndex: number\n totalSteps: number\n onPrevious?: () => void\n onSubmit?: (response: string | number | null) => void\n onDismiss?: () => void\n}\n\nconst threeScaleEmojis = [dissatisfiedEmoji, neutralEmoji, satisfiedEmoji]\nconst fiveScaleEmojis = [veryDissatisfiedEmoji, dissatisfiedEmoji, neutralEmoji, satisfiedEmoji, verySatisfiedEmoji]\n\nfunction getScaleNumbers(scale: number): number[] {\n switch (scale) {\n case 5:\n return [1, 2, 3, 4, 5]\n case 10:\n return [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\n default:\n return [1, 2, 3, 4, 5]\n }\n}\n\nfunction OpenTextInput({\n value,\n onChange,\n onSubmit,\n isInteractive,\n}: {\n value: string\n onChange: (text: string) => void\n onSubmit?: () => void\n isInteractive: boolean\n}): h.JSX.Element {\n const inputRef = useRef<HTMLTextAreaElement>(null)\n\n useEffect(() => {\n if (isInteractive) {\n setTimeout(() => inputRef.current?.focus(), 100)\n }\n }, [isInteractive])\n\n const handleKeyDown = (e: KeyboardEvent) => {\n if (e.key === 'Enter' && e.metaKey && isInteractive) {\n e.preventDefault()\n onSubmit?.()\n }\n }\n\n return (\n <textarea\n ref={inputRef}\n class=\"ph-tour-survey-textarea\"\n rows={3}\n placeholder=\"Your feedback (optional)...\"\n value={value}\n onInput={(e) => onChange((e.target as HTMLTextAreaElement).value)}\n onKeyDown={handleKeyDown}\n disabled={!isInteractive}\n style={isInteractive ? undefined : { cursor: 'default' }}\n />\n )\n}\n\nfunction RatingInput({\n survey,\n onSubmit,\n isInteractive,\n}: {\n survey: ProductTourSurveyQuestion\n onSubmit?: (rating: number) => void\n isInteractive: boolean\n}): h.JSX.Element {\n const [selectedRating, setSelectedRating] = useState<number | null>(null)\n const display = survey.display || 'emoji'\n const scale = survey.scale || 5\n\n const handleSelect = (rating: number) => {\n if (!isInteractive) {\n return\n }\n setSelectedRating(rating)\n // Auto-submit on selection for ratings\n onSubmit?.(rating)\n }\n\n if (display === 'emoji') {\n const emojis = scale === 3 ? threeScaleEmojis : fiveScaleEmojis\n return (\n <div class=\"ph-tour-survey-rating-container\">\n <div class=\"ph-tour-survey-rating-emoji\">\n {emojis.map((emoji, idx) => {\n const rating = idx + 1\n const isActive = selectedRating === rating\n return (\n <button\n key={idx}\n type=\"button\"\n class={`ph-tour-survey-emoji-button ${isActive ? 'ph-tour-survey-emoji-button--active' : ''}`}\n onClick={() => handleSelect(rating)}\n style={isInteractive ? undefined : { cursor: 'default' }}\n aria-label={`Rate ${rating}`}\n >\n {emoji}\n </button>\n )\n })}\n </div>\n {(survey.lowerBoundLabel || survey.upperBoundLabel) && (\n <div class=\"ph-tour-survey-rating-labels\">\n <span>{survey.lowerBoundLabel}</span>\n <span>{survey.upperBoundLabel}</span>\n </div>\n )}\n </div>\n )\n }\n\n // Number display\n const numbers = getScaleNumbers(scale)\n return (\n <div class=\"ph-tour-survey-rating-container\">\n <div\n class=\"ph-tour-survey-rating-numbers\"\n style={{ gridTemplateColumns: `repeat(${numbers.length}, minmax(0, 1fr))` }}\n >\n {numbers.map((num) => {\n const isActive = selectedRating === num\n return (\n <button\n key={num}\n type=\"button\"\n class={`ph-tour-survey-number-button ${isActive ? 'ph-tour-survey-number-button--active' : ''}`}\n onClick={() => handleSelect(num)}\n style={isInteractive ? undefined : { cursor: 'default' }}\n aria-label={`Rate ${num}`}\n >\n {num}\n </button>\n )\n })}\n </div>\n {(survey.lowerBoundLabel || survey.upperBoundLabel) && (\n <div class=\"ph-tour-survey-rating-labels\">\n <span>{survey.lowerBoundLabel}</span>\n <span>{survey.upperBoundLabel}</span>\n </div>\n )}\n </div>\n )\n}\n\nexport function ProductTourSurveyStepInner({\n step,\n appearance,\n stepIndex,\n totalSteps,\n onPrevious,\n onSubmit,\n onDismiss,\n}: ProductTourSurveyStepInnerProps): h.JSX.Element {\n const [textValue, setTextValue] = useState('')\n const survey = step.survey\n const whiteLabel = appearance?.whiteLabel ?? false\n const isFirstStep = stepIndex === 0\n const isOpenText = survey?.type === 'open'\n\n const isInteractive = !!(onPrevious || onSubmit || onDismiss)\n const cursorStyle = isInteractive ? undefined : { cursor: 'default' }\n\n const handleTextSubmit = () => {\n onSubmit?.(textValue.trim() || null)\n }\n\n if (!survey) {\n return <div />\n }\n\n return (\n <>\n <button class=\"ph-tour-dismiss\" onClick={onDismiss} aria-label=\"Close survey\" style={cursorStyle}>\n {cancelSVG()}\n </button>\n\n <div class=\"ph-tour-survey-question\">{survey.questionText}</div>\n\n {isOpenText ? (\n <OpenTextInput\n value={textValue}\n onChange={setTextValue}\n onSubmit={handleTextSubmit}\n isInteractive={isInteractive}\n />\n ) : (\n <RatingInput survey={survey} onSubmit={onSubmit} isInteractive={isInteractive} />\n )}\n\n <div class=\"ph-tour-footer\">\n <span class=\"ph-tour-progress\">\n {stepIndex + 1} of {totalSteps}\n </span>\n\n <div class=\"ph-tour-buttons\">\n {!isFirstStep && (\n <button\n class=\"ph-tour-button ph-tour-button--secondary\"\n onClick={onPrevious}\n style={cursorStyle}\n >\n {survey.backButtonText || 'Back'}\n </button>\n )}\n {isOpenText && (\n <button\n class=\"ph-tour-button ph-tour-button--primary\"\n onClick={handleTextSubmit}\n style={cursorStyle}\n >\n {survey.submitButtonText || 'Submit'}\n </button>\n )}\n </div>\n </div>\n\n {!whiteLabel && (\n <a\n href={isInteractive ? 'https://posthog.com/product-tours' : undefined}\n target={isInteractive ? '_blank' : undefined}\n rel={isInteractive ? 'noopener noreferrer' : undefined}\n class=\"ph-tour-branding\"\n style={isInteractive ? undefined : { cursor: 'default', pointerEvents: 'none' }}\n >\n Survey by {IconPosthogLogo}\n </a>\n )}\n </>\n )\n}\n"]}
|
|
@@ -44,6 +44,8 @@ export declare class ProductTourManager {
|
|
|
44
44
|
private _removeTriggerSelectorListener;
|
|
45
45
|
private _removeAllTriggerListeners;
|
|
46
46
|
private _captureEvent;
|
|
47
|
+
private _captureStepShown;
|
|
48
|
+
private _captureStepSelectorFailed;
|
|
47
49
|
getActiveProductTours(callback: ProductTourCallback): void;
|
|
48
50
|
resetTour(tourId: string): void;
|
|
49
51
|
resetAllTours(): void;
|
|
@@ -25,6 +25,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
25
25
|
exports.ProductTourManager = void 0;
|
|
26
26
|
var jsx_runtime_1 = require("preact/jsx-runtime");
|
|
27
27
|
var preact_1 = require("preact");
|
|
28
|
+
var posthog_product_tours_types_1 = require("../../posthog-product-tours-types");
|
|
28
29
|
var posthog_surveys_types_1 = require("../../posthog-surveys-types");
|
|
29
30
|
var product_tours_utils_1 = require("./product-tours-utils");
|
|
30
31
|
var ProductTourTooltip_1 = require("./components/ProductTourTooltip");
|
|
@@ -174,15 +175,16 @@ var ProductTourManager = /** @class */ (function () {
|
|
|
174
175
|
}
|
|
175
176
|
};
|
|
176
177
|
this.nextStep = function () {
|
|
178
|
+
var _a;
|
|
177
179
|
if (!_this._activeTour) {
|
|
178
180
|
return;
|
|
179
181
|
}
|
|
180
182
|
var currentStep = _this._activeTour.steps[_this._currentStepIndex];
|
|
181
|
-
_this._captureEvent(
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
183
|
+
_this._captureEvent(posthog_product_tours_types_1.ProductTourEventName.STEP_COMPLETED, (_a = {},
|
|
184
|
+
_a[posthog_product_tours_types_1.ProductTourEventProperties.TOUR_ID] = _this._activeTour.id,
|
|
185
|
+
_a[posthog_product_tours_types_1.ProductTourEventProperties.TOUR_STEP_ID] = currentStep.id,
|
|
186
|
+
_a[posthog_product_tours_types_1.ProductTourEventProperties.TOUR_STEP_ORDER] = _this._currentStepIndex,
|
|
187
|
+
_a));
|
|
186
188
|
if (_this._currentStepIndex < _this._activeTour.steps.length - 1) {
|
|
187
189
|
_this._setStepIndex(_this._currentStepIndex + 1);
|
|
188
190
|
_this._renderCurrentStep();
|
|
@@ -199,32 +201,33 @@ var ProductTourManager = /** @class */ (function () {
|
|
|
199
201
|
_this._renderCurrentStep();
|
|
200
202
|
};
|
|
201
203
|
this.dismissTour = function (reason) {
|
|
202
|
-
var _a;
|
|
204
|
+
var _a, _b;
|
|
203
205
|
if (reason === void 0) { reason = 'user_clicked_skip'; }
|
|
204
206
|
if (!_this._activeTour) {
|
|
205
207
|
return;
|
|
206
208
|
}
|
|
207
209
|
var currentStep = _this._activeTour.steps[_this._currentStepIndex];
|
|
208
|
-
_this._captureEvent(
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
210
|
+
_this._captureEvent(posthog_product_tours_types_1.ProductTourEventName.DISMISSED, (_a = {},
|
|
211
|
+
_a[posthog_product_tours_types_1.ProductTourEventProperties.TOUR_ID] = _this._activeTour.id,
|
|
212
|
+
_a[posthog_product_tours_types_1.ProductTourEventProperties.TOUR_STEP_ID] = currentStep.id,
|
|
213
|
+
_a[posthog_product_tours_types_1.ProductTourEventProperties.TOUR_STEP_ORDER] = _this._currentStepIndex,
|
|
214
|
+
_a[posthog_product_tours_types_1.ProductTourEventProperties.TOUR_DISMISS_REASON] = reason,
|
|
215
|
+
_a));
|
|
214
216
|
if (!_this._isPreviewMode) {
|
|
215
217
|
storage_1.localStore._set("".concat(constants_1.TOUR_DISMISSED_KEY_PREFIX).concat(_this._activeTour.id), true);
|
|
216
218
|
_this._instance.capture('$set', {
|
|
217
|
-
$set: (
|
|
219
|
+
$set: (_b = {}, _b["$product_tour_dismissed/".concat(_this._activeTour.id)] = true, _b),
|
|
218
220
|
});
|
|
219
221
|
}
|
|
220
222
|
window.dispatchEvent(new CustomEvent('PHProductTourDismissed', { detail: { tourId: _this._activeTour.id, reason: reason } }));
|
|
221
223
|
_this._cleanup();
|
|
222
224
|
};
|
|
223
225
|
this._handleButtonClick = function (button) {
|
|
226
|
+
var _a, _b, _c;
|
|
224
227
|
if (_this._activeTour) {
|
|
225
228
|
var currentStep = _this._activeTour.steps[_this._currentStepIndex];
|
|
226
229
|
if (currentStep) {
|
|
227
|
-
_this._captureEvent(
|
|
230
|
+
_this._captureEvent(posthog_product_tours_types_1.ProductTourEventName.BUTTON_CLICKED, __assign(__assign((_a = {}, _a[posthog_product_tours_types_1.ProductTourEventProperties.TOUR_ID] = _this._activeTour.id, _a[posthog_product_tours_types_1.ProductTourEventProperties.TOUR_NAME] = _this._activeTour.name, _a[posthog_product_tours_types_1.ProductTourEventProperties.TOUR_ITERATION] = _this._activeTour.current_iteration || 1, _a[posthog_product_tours_types_1.ProductTourEventProperties.TOUR_STEP_ID] = currentStep.id, _a[posthog_product_tours_types_1.ProductTourEventProperties.TOUR_STEP_ORDER] = _this._currentStepIndex, _a[posthog_product_tours_types_1.ProductTourEventProperties.TOUR_BUTTON_TEXT] = button.text, _a[posthog_product_tours_types_1.ProductTourEventProperties.TOUR_BUTTON_ACTION] = button.action, _a), (button.link && (_b = {}, _b[posthog_product_tours_types_1.ProductTourEventProperties.TOUR_BUTTON_LINK] = button.link, _b))), (button.tourId && (_c = {}, _c[posthog_product_tours_types_1.ProductTourEventProperties.TOUR_BUTTON_TOUR_ID] = button.tourId, _c))));
|
|
228
231
|
}
|
|
229
232
|
}
|
|
230
233
|
switch (button.action) {
|
|
@@ -484,24 +487,24 @@ var ProductTourManager = /** @class */ (function () {
|
|
|
484
487
|
return true;
|
|
485
488
|
};
|
|
486
489
|
ProductTourManager.prototype.showTour = function (tour, options) {
|
|
487
|
-
var _a;
|
|
488
|
-
var
|
|
489
|
-
var renderReason = (
|
|
490
|
+
var _a, _b;
|
|
491
|
+
var _c;
|
|
492
|
+
var renderReason = (_c = options === null || options === void 0 ? void 0 : options.reason) !== null && _c !== void 0 ? _c : 'auto';
|
|
490
493
|
this.cancelPendingTour(tour.id);
|
|
491
494
|
this._activeTour = tour;
|
|
492
495
|
this._setStepIndex(0);
|
|
493
496
|
var rendered = this._renderCurrentStep();
|
|
494
497
|
if (rendered) {
|
|
495
|
-
this._captureEvent(
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
498
|
+
this._captureEvent(posthog_product_tours_types_1.ProductTourEventName.SHOWN, (_a = {},
|
|
499
|
+
_a[posthog_product_tours_types_1.ProductTourEventProperties.TOUR_ID] = tour.id,
|
|
500
|
+
_a[posthog_product_tours_types_1.ProductTourEventProperties.TOUR_NAME] = tour.name,
|
|
501
|
+
_a[posthog_product_tours_types_1.ProductTourEventProperties.TOUR_ITERATION] = tour.current_iteration || 1,
|
|
502
|
+
_a[posthog_product_tours_types_1.ProductTourEventProperties.TOUR_RENDER_REASON] = renderReason,
|
|
503
|
+
_a));
|
|
501
504
|
if (!this._isPreviewMode) {
|
|
502
505
|
storage_1.localStore._set("".concat(constants_1.TOUR_SHOWN_KEY_PREFIX).concat(tour.id), true);
|
|
503
506
|
this._instance.capture('$set', {
|
|
504
|
-
$set: (
|
|
507
|
+
$set: (_b = {}, _b["$product_tour_shown/".concat(tour.id)] = true, _b),
|
|
505
508
|
});
|
|
506
509
|
}
|
|
507
510
|
}
|
|
@@ -533,28 +536,29 @@ var ProductTourManager = /** @class */ (function () {
|
|
|
533
536
|
this._renderCurrentStep();
|
|
534
537
|
};
|
|
535
538
|
ProductTourManager.prototype._completeTour = function () {
|
|
536
|
-
var _a;
|
|
539
|
+
var _a, _b;
|
|
537
540
|
if (!this._activeTour) {
|
|
538
541
|
return;
|
|
539
542
|
}
|
|
540
|
-
this._captureEvent(
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
543
|
+
this._captureEvent(posthog_product_tours_types_1.ProductTourEventName.COMPLETED, (_a = {},
|
|
544
|
+
_a[posthog_product_tours_types_1.ProductTourEventProperties.TOUR_ID] = this._activeTour.id,
|
|
545
|
+
_a[posthog_product_tours_types_1.ProductTourEventProperties.TOUR_STEPS_COUNT] = this._activeTour.steps.length,
|
|
546
|
+
_a));
|
|
544
547
|
if (!this._isPreviewMode) {
|
|
545
548
|
storage_1.localStore._set("".concat(constants_1.TOUR_COMPLETED_KEY_PREFIX).concat(this._activeTour.id), true);
|
|
546
549
|
this._instance.capture('$set', {
|
|
547
|
-
$set: (
|
|
548
|
-
|
|
549
|
-
|
|
550
|
+
$set: (_b = {},
|
|
551
|
+
_b["$product_tour_completed/".concat(this._activeTour.id)] = true,
|
|
552
|
+
_b),
|
|
550
553
|
});
|
|
551
554
|
}
|
|
552
555
|
window.dispatchEvent(new CustomEvent('PHProductTourCompleted', { detail: { tourId: this._activeTour.id } }));
|
|
553
556
|
this._cleanup();
|
|
554
557
|
};
|
|
555
558
|
ProductTourManager.prototype._renderCurrentStep = function (retryCount) {
|
|
559
|
+
var _a, _b, _c;
|
|
556
560
|
var _this = this;
|
|
557
|
-
var
|
|
561
|
+
var _d;
|
|
558
562
|
if (retryCount === void 0) { retryCount = 0; }
|
|
559
563
|
if (!this._activeTour) {
|
|
560
564
|
return false;
|
|
@@ -567,12 +571,7 @@ var ProductTourManager = /** @class */ (function () {
|
|
|
567
571
|
}
|
|
568
572
|
// Banner step - render full-width banner
|
|
569
573
|
if (step.type === 'banner') {
|
|
570
|
-
this.
|
|
571
|
-
$product_tour_id: this._activeTour.id,
|
|
572
|
-
$product_tour_step_id: step.id,
|
|
573
|
-
$product_tour_step_order: this._currentStepIndex,
|
|
574
|
-
$product_tour_step_type: 'banner',
|
|
575
|
-
});
|
|
574
|
+
this._captureStepShown();
|
|
576
575
|
this._isResuming = false;
|
|
577
576
|
this._renderBanner();
|
|
578
577
|
return true;
|
|
@@ -588,21 +587,16 @@ var ProductTourManager = /** @class */ (function () {
|
|
|
588
587
|
}
|
|
589
588
|
// Screen-positioned step (no element targeting) - render without a target element
|
|
590
589
|
if (!(0, product_tours_utils_1.hasElementTarget)(step)) {
|
|
591
|
-
this.
|
|
592
|
-
$product_tour_id: this._activeTour.id,
|
|
593
|
-
$product_tour_step_id: step.id,
|
|
594
|
-
$product_tour_step_order: this._currentStepIndex,
|
|
595
|
-
$product_tour_step_type: step.type,
|
|
596
|
-
});
|
|
590
|
+
this._captureStepShown();
|
|
597
591
|
this._isResuming = false;
|
|
598
592
|
this._renderTooltipWithPreact(null);
|
|
599
593
|
return true;
|
|
600
594
|
}
|
|
601
595
|
var result = (0, product_tours_utils_1.findStepElement)(step);
|
|
602
|
-
var inferenceProps = {
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
596
|
+
var inferenceProps = (_a = {},
|
|
597
|
+
_a[posthog_product_tours_types_1.ProductTourEventProperties.USE_MANUAL_SELECTOR] = (_d = step.useManualSelector) !== null && _d !== void 0 ? _d : false,
|
|
598
|
+
_a[posthog_product_tours_types_1.ProductTourEventProperties.INFERENCE_DATA_PRESENT] = !!step.inferenceData,
|
|
599
|
+
_a);
|
|
606
600
|
var previousStep = this._currentStepIndex > 0 ? this._activeTour.steps[this._currentStepIndex - 1] : null;
|
|
607
601
|
var shouldWaitForElement = (previousStep === null || previousStep === void 0 ? void 0 : previousStep.progressionTrigger) === 'click' || this._isResuming;
|
|
608
602
|
// 2s total timeout
|
|
@@ -618,7 +612,7 @@ var ProductTourManager = /** @class */ (function () {
|
|
|
618
612
|
return false;
|
|
619
613
|
}
|
|
620
614
|
var waitDurationMs = retryCount * retryTimeout;
|
|
621
|
-
this.
|
|
615
|
+
this._captureStepSelectorFailed(result, __assign((_b = {}, _b[posthog_product_tours_types_1.ProductTourEventProperties.TOUR_WAITED_FOR_ELEMENT] = shouldWaitForElement, _b[posthog_product_tours_types_1.ProductTourEventProperties.TOUR_WAIT_DURATION_MS] = waitDurationMs, _b), inferenceProps));
|
|
622
616
|
if (this._currentStepIndex === 0 && !this._isResuming) {
|
|
623
617
|
logger.warn("Tour \"".concat(this._activeTour.name, "\" failed to show: element for first step not found (").concat(result.error, ")"));
|
|
624
618
|
return false;
|
|
@@ -629,7 +623,7 @@ var ProductTourManager = /** @class */ (function () {
|
|
|
629
623
|
return false;
|
|
630
624
|
}
|
|
631
625
|
if (result.error === 'multiple_matches') {
|
|
632
|
-
this.
|
|
626
|
+
this._captureStepSelectorFailed(result, inferenceProps);
|
|
633
627
|
// Continue with first match for multiple_matches case
|
|
634
628
|
}
|
|
635
629
|
if (!result.element) {
|
|
@@ -637,7 +631,7 @@ var ProductTourManager = /** @class */ (function () {
|
|
|
637
631
|
}
|
|
638
632
|
var element = result.element;
|
|
639
633
|
var metadata = (0, product_tours_utils_1.getElementMetadata)(element);
|
|
640
|
-
this.
|
|
634
|
+
this._captureStepShown(__assign((_c = {}, _c[posthog_product_tours_types_1.ProductTourEventProperties.TOUR_STEP_SELECTOR] = step.selector, _c[posthog_product_tours_types_1.ProductTourEventProperties.TOUR_STEP_SELECTOR_FOUND] = true, _c[posthog_product_tours_types_1.ProductTourEventProperties.TOUR_STEP_ELEMENT_TAG] = metadata.tag, _c[posthog_product_tours_types_1.ProductTourEventProperties.TOUR_STEP_ELEMENT_ID] = metadata.id, _c[posthog_product_tours_types_1.ProductTourEventProperties.TOUR_STEP_ELEMENT_CLASSES] = metadata.classes, _c[posthog_product_tours_types_1.ProductTourEventProperties.TOUR_STEP_ELEMENT_TEXT] = metadata.text, _c), inferenceProps));
|
|
641
635
|
this._isResuming = false;
|
|
642
636
|
this._renderTooltipWithPreact(element);
|
|
643
637
|
return true;
|
|
@@ -651,18 +645,19 @@ var ProductTourManager = /** @class */ (function () {
|
|
|
651
645
|
(0, preact_1.render)((0, jsx_runtime_1.jsx)(ProductTourTooltip_1.ProductTourTooltip, { tour: this._activeTour, step: step, stepIndex: this._currentStepIndex, totalSteps: this._activeTour.steps.length, targetElement: element, onNext: this.nextStep, onPrevious: this.previousStep, onDismiss: onDismissOverride || this.dismissTour, onSurveySubmit: onSurveySubmit, onButtonClick: this._handleButtonClick }), shadow);
|
|
652
646
|
};
|
|
653
647
|
ProductTourManager.prototype._renderBanner = function () {
|
|
654
|
-
var _this = this;
|
|
655
648
|
var _a;
|
|
649
|
+
var _this = this;
|
|
650
|
+
var _b;
|
|
656
651
|
if (!this._activeTour) {
|
|
657
652
|
return;
|
|
658
653
|
}
|
|
659
654
|
var step = this._activeTour.steps[this._currentStepIndex];
|
|
660
655
|
var result = retrieveBannerShadow(this._activeTour, step.bannerConfig);
|
|
661
656
|
if (!result) {
|
|
662
|
-
this._captureEvent(
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
657
|
+
this._captureEvent(posthog_product_tours_types_1.ProductTourEventName.BANNER_CONTAINER_SELECTOR_FAILED, (_a = {},
|
|
658
|
+
_a[posthog_product_tours_types_1.ProductTourEventProperties.TOUR_ID] = this._activeTour.id,
|
|
659
|
+
_a[posthog_product_tours_types_1.ProductTourEventProperties.TOUR_BANNER_SELECTOR] = (_b = step === null || step === void 0 ? void 0 : step.bannerConfig) === null || _b === void 0 ? void 0 : _b.selector,
|
|
660
|
+
_a));
|
|
666
661
|
this.dismissTour('container_unavailable');
|
|
667
662
|
return;
|
|
668
663
|
}
|
|
@@ -678,9 +673,9 @@ var ProductTourManager = /** @class */ (function () {
|
|
|
678
673
|
(0, preact_1.render)((0, jsx_runtime_1.jsx)(ProductTourBanner_1.ProductTourBanner, { step: step, onDismiss: function () { return _this.dismissTour('user_clicked_skip'); }, onTriggerTour: handleTriggerTour, displayFrequency: this._activeTour.display_frequency }), shadow);
|
|
679
674
|
};
|
|
680
675
|
ProductTourManager.prototype._renderSurveyStep = function () {
|
|
681
|
-
var _a;
|
|
676
|
+
var _a, _b;
|
|
682
677
|
var _this = this;
|
|
683
|
-
var
|
|
678
|
+
var _c, _d, _e;
|
|
684
679
|
if (!this._activeTour) {
|
|
685
680
|
return;
|
|
686
681
|
}
|
|
@@ -688,19 +683,15 @@ var ProductTourManager = /** @class */ (function () {
|
|
|
688
683
|
var step = this._activeTour.steps[this._currentStepIndex];
|
|
689
684
|
var surveyId = step.linkedSurveyId;
|
|
690
685
|
var questionId = step.linkedSurveyQuestionId;
|
|
691
|
-
var questionText = ((
|
|
692
|
-
this.
|
|
693
|
-
|
|
694
|
-
$product_tour_step_id: step.id,
|
|
695
|
-
$product_tour_step_order: this._currentStepIndex,
|
|
696
|
-
$product_tour_step_type: 'survey',
|
|
697
|
-
$product_tour_linked_survey_id: surveyId,
|
|
698
|
-
});
|
|
699
|
-
this._captureEvent(posthog_surveys_types_1.SurveyEventName.SHOWN, (_a = {},
|
|
700
|
-
_a[posthog_surveys_types_1.SurveyEventProperties.SURVEY_ID] = surveyId,
|
|
701
|
-
_a[posthog_surveys_types_1.SurveyEventProperties.PRODUCT_TOUR_ID] = tourId,
|
|
702
|
-
_a.sessionRecordingUrl = (_d = (_c = this._instance).get_session_replay_url) === null || _d === void 0 ? void 0 : _d.call(_c),
|
|
686
|
+
var questionText = ((_c = step.survey) === null || _c === void 0 ? void 0 : _c.questionText) || '';
|
|
687
|
+
this._captureStepShown((_a = {},
|
|
688
|
+
_a[posthog_product_tours_types_1.ProductTourEventProperties.TOUR_LINKED_SURVEY_ID] = surveyId,
|
|
703
689
|
_a));
|
|
690
|
+
this._captureEvent(posthog_surveys_types_1.SurveyEventName.SHOWN, (_b = {},
|
|
691
|
+
_b[posthog_surveys_types_1.SurveyEventProperties.SURVEY_ID] = surveyId,
|
|
692
|
+
_b[posthog_surveys_types_1.SurveyEventProperties.PRODUCT_TOUR_ID] = tourId,
|
|
693
|
+
_b.sessionRecordingUrl = (_e = (_d = this._instance).get_session_replay_url) === null || _e === void 0 ? void 0 : _e.call(_d),
|
|
694
|
+
_b));
|
|
704
695
|
var handleSubmit = function (response) {
|
|
705
696
|
var _a, _b;
|
|
706
697
|
var _c, _d;
|
|
@@ -836,6 +827,22 @@ var ProductTourManager = /** @class */ (function () {
|
|
|
836
827
|
}
|
|
837
828
|
this._instance.capture(eventName, properties);
|
|
838
829
|
};
|
|
830
|
+
ProductTourManager.prototype._captureStepShown = function (extraProps) {
|
|
831
|
+
var _a;
|
|
832
|
+
if (!this._activeTour) {
|
|
833
|
+
return;
|
|
834
|
+
}
|
|
835
|
+
var step = this._activeTour.steps[this._currentStepIndex];
|
|
836
|
+
this._captureEvent(posthog_product_tours_types_1.ProductTourEventName.STEP_SHOWN, __assign((_a = {}, _a[posthog_product_tours_types_1.ProductTourEventProperties.TOUR_ID] = this._activeTour.id, _a[posthog_product_tours_types_1.ProductTourEventProperties.TOUR_STEP_ID] = step.id, _a[posthog_product_tours_types_1.ProductTourEventProperties.TOUR_STEP_ORDER] = this._currentStepIndex, _a[posthog_product_tours_types_1.ProductTourEventProperties.TOUR_STEP_TYPE] = step.type, _a), extraProps));
|
|
837
|
+
};
|
|
838
|
+
ProductTourManager.prototype._captureStepSelectorFailed = function (result, extraProps) {
|
|
839
|
+
var _a;
|
|
840
|
+
if (!this._activeTour) {
|
|
841
|
+
return;
|
|
842
|
+
}
|
|
843
|
+
var step = this._activeTour.steps[this._currentStepIndex];
|
|
844
|
+
this._captureEvent(posthog_product_tours_types_1.ProductTourEventName.STEP_SELECTOR_FAILED, __assign((_a = {}, _a[posthog_product_tours_types_1.ProductTourEventProperties.TOUR_ID] = this._activeTour.id, _a[posthog_product_tours_types_1.ProductTourEventProperties.TOUR_STEP_ID] = step.id, _a[posthog_product_tours_types_1.ProductTourEventProperties.TOUR_STEP_ORDER] = this._currentStepIndex, _a[posthog_product_tours_types_1.ProductTourEventProperties.TOUR_STEP_SELECTOR] = step.selector, _a[posthog_product_tours_types_1.ProductTourEventProperties.TOUR_ERROR] = result.error, _a[posthog_product_tours_types_1.ProductTourEventProperties.TOUR_MATCHES_COUNT] = result.matchCount, _a[posthog_product_tours_types_1.ProductTourEventProperties.TOUR_FAILURE_PHASE] = 'runtime', _a), extraProps));
|
|
845
|
+
};
|
|
839
846
|
// Public API methods delegated from PostHogProductTours
|
|
840
847
|
ProductTourManager.prototype.getActiveProductTours = function (callback) {
|
|
841
848
|
var _this = this;
|