@mx-cartographer/experiences 9.7.202 → 9.7.203
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/CHANGELOG.md +5 -0
- package/dist/core/stores/AnalyticsStore.es.js +9 -8
- package/dist/core/stores/AnalyticsStore.es.js.map +1 -1
- package/dist/core/stores/InsightsV2Store.d.ts +4 -0
- package/dist/core/stores/InsightsV2Store.es.js +10 -8
- package/dist/core/stores/InsightsV2Store.es.js.map +1 -1
- package/dist/core/types/Insights.d.ts +1 -0
- package/dist/core/types/Insights.es.js.map +1 -1
- package/dist/core/utils/PostHog.d.ts +2 -0
- package/dist/core/utils/PostHog.es.js +6 -0
- package/dist/core/utils/PostHog.es.js.map +1 -0
- package/dist/insights-v2/blocks/ComponentBlocks/FeedbackBlock/FeedbackBlock.d.ts +14 -0
- package/dist/insights-v2/blocks/ComponentBlocks/FeedbackBlock/FeedbackBlock.es.js +324 -0
- package/dist/insights-v2/blocks/ComponentBlocks/FeedbackBlock/FeedbackBlock.es.js.map +1 -0
- package/dist/insights-v2/blocks/ComponentBlocks/FeedbackBlock/index.d.ts +1 -0
- package/dist/insights-v2/blocks/ComponentBlocks/FeedbackBlock/survey.d.ts +29 -0
- package/dist/insights-v2/blocks/ComponentBlocks/FeedbackBlock/survey.es.js +25 -0
- package/dist/insights-v2/blocks/ComponentBlocks/FeedbackBlock/survey.es.js.map +1 -0
- package/dist/insights-v2/blocks/ComponentBlocks/index.d.ts +1 -0
- package/dist/insights-v2/components/BaseLayout.es.js +137 -135
- package/dist/insights-v2/components/BaseLayout.es.js.map +1 -1
- package/dist/insights-v2/components/Header.d.ts +5 -1
- package/dist/insights-v2/components/Header.es.js +15 -15
- package/dist/insights-v2/components/Header.es.js.map +1 -1
- package/dist/insights-v2/index.es.js +51 -49
- package/dist/insights-v2/mappings/blocks.es.js +96 -94
- package/dist/insights-v2/mappings/blocks.es.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FeedbackBlock.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/FeedbackBlock/FeedbackBlock.tsx"],"sourcesContent":["import { type KeyboardEvent, type RefObject, useEffect, useRef, useState } from 'react'\n\nimport Box from '@mui/material/Box'\nimport Button from '@mui/material/Button'\nimport ButtonBase from '@mui/material/ButtonBase'\nimport Stack from '@mui/material/Stack'\nimport TextField from '@mui/material/TextField'\nimport { alpha } from '@mui/material/styles'\n\nimport { Icon } from '@mxenabled/mx-icons'\nimport { Text } from '@mxenabled/mxui'\nimport { observer } from 'mobx-react-lite'\n\nimport { useGlobalStore, useInsightsV2Store, VISUALLY_HIDDEN_SX } from '../../../../common'\nimport {\n BEAT_CARD_TITLE_KEY,\n BEAT_KEEP_AFTER_DISMISS_KEY,\n} from '../../../../core/stores/InsightsV2Store'\nimport type { InstanceSlotData } from '../../../../core/types/Insights'\nimport { buildDynamicCopy } from '../../../../core/utils/Localization'\nimport { useAnalyticsEvent } from '../../../analytics'\nimport { useBeatActions } from '../../../beatActions'\nimport { HOST_ACTIONS } from '../../../ctaActions'\nimport { asNonEmptyText } from '../../slotReaders'\nimport type { BlockProps } from '../../types'\nimport { userFeedbackSurveyEvents, userFeedbackSurveyId } from './survey'\n\n/** The survey's words, sent by the server in `instance_slot.data`. */\nconst COPY_SLOTS = [\n 'question1',\n 'question2',\n 'question3',\n 'strongly_disagree',\n 'strongly_agree',\n 'continue',\n 'submit_feedback',\n 'feedback',\n 'feedback_placeholder',\n 'thank_you',\n 'feedback_sent',\n 'oops',\n 'feedback_error',\n 'try_again',\n // `_1{rating}`: a scale button's accessible name.\n 'rating_aria',\n // `_1{step} of _2{total}`: the survey's progress for screen readers (the step bar is decorative).\n 'step_count',\n] as const\ntype FeedbackCopy = Record<(typeof COPY_SLOTS)[number], string>\n\n/** Every copy slot as non-blank text, else undefined: the survey draws nothing rather than a blank label. */\nconst readCopy = (data?: InstanceSlotData): FeedbackCopy | undefined =>\n COPY_SLOTS.every((key) => asNonEmptyText(data?.[key]) !== undefined)\n ? (data as FeedbackCopy)\n : undefined\n\nconst RATINGS = [1, 2, 3, 4, 5]\nconst STEPS = 3\n/** The free-text answer's limit, on the field and on the sent payload. */\nconst FEEDBACK_MAX_LENGTH = 500\n/** beatContext key: the survey's shown event already fired for this beat (survives a remount after Undo). */\nexport const SURVEY_SHOWN_KEY = 'survey_shown'\n/** beatContext key: the result phase ('sent' | 'error'), so a remount shows it, not the survey again. */\nexport const SURVEY_PHASE_KEY = 'survey_phase'\n\n// ARIA radio group keys: arrows step (wrapping), Home and End jump to the ends.\nconst RATING_KEY_STEPS: Record<string, number> = {\n ArrowDown: 1,\n ArrowLeft: -1,\n ArrowRight: 1,\n ArrowUp: -1,\n}\n\ntype Phase = 'survey' | 'sent' | 'error'\n\nconst isResultPhase = (value: unknown): value is Exclude<Phase, 'survey'> =>\n value === 'sent' || value === 'error'\n\nconst StepBar = ({ step }: { step: number }) => (\n <Stack aria-hidden={true} direction=\"row\" sx={{ gap: 4, height: 4 }}>\n {Array.from({ length: STEPS }, (_, index) => (\n <Box\n key={index}\n sx={(theme) => ({\n // Figma `_components/stepper/inactive`: grey 300 light, 500 dark.\n bgcolor:\n index <= step\n ? 'primary.main'\n : theme.palette.grey[theme.palette.mode === 'dark' ? 500 : 300],\n borderRadius: '24px',\n flex: 1,\n })}\n />\n ))}\n </Stack>\n)\n\n// Figma \"Toggle | NumberRating\": five joined 44px cells, the picked one tinted primary. A radio group:\n// one tab stop (the picked cell, else the first), and the arrow keys move focus and pick.\nconst ratingKeyTarget = (key: string, index: number) => {\n if (key === 'Home') return 0\n if (key === 'End') return RATINGS.length - 1\n if (key in RATING_KEY_STEPS) {\n return (index + RATING_KEY_STEPS[key] + RATINGS.length) % RATINGS.length\n }\n return undefined\n}\n\nconst RatingScale = ({\n ariaLabel,\n label,\n onChange,\n tabStopRef,\n value,\n}: {\n ariaLabel: (rating: number) => string\n label: string\n onChange: (rating: number) => void\n /** Receives the group's tab stop, for focus to land on after Continue. */\n tabStopRef: RefObject<HTMLButtonElement | null>\n value?: number\n}) => {\n const cells = useRef<(HTMLButtonElement | null)[]>([])\n const tabStop = value === undefined ? 0 : RATINGS.indexOf(value)\n\n const onKeyDown = (event: KeyboardEvent, index: number) => {\n const target = ratingKeyTarget(event.key, index)\n if (target === undefined) return\n event.preventDefault()\n cells.current[target]?.focus()\n onChange(RATINGS[target])\n }\n\n return (\n <Stack aria-label={label} direction=\"row\" role=\"radiogroup\">\n {RATINGS.map((rating, index) => {\n const selected = rating === value\n return (\n <ButtonBase\n aria-checked={selected}\n aria-label={ariaLabel(rating)}\n key={rating}\n onClick={() => onChange(rating)}\n onKeyDown={(event) => onKeyDown(event, index)}\n ref={(cell) => {\n cells.current[index] = cell\n if (index === tabStop) tabStopRef.current = cell\n }}\n role=\"radio\"\n sx={(theme) => ({\n bgcolor: selected\n ? alpha(theme.palette.primary.main, theme.palette.action.selectedOpacity)\n : undefined,\n border: 1,\n borderColor: selected ? 'primary.main' : 'divider',\n color: 'primary.main',\n flex: 1,\n fontSize: 13,\n fontWeight: 600,\n height: 44,\n lineHeight: '16px',\n zIndex: selected ? 1 : 0,\n // Joined cells: one shared border between neighbours, the picked cell drawn on top.\n '&:not(:first-of-type)': { ml: '-1px' },\n '&:first-of-type': { borderBottomLeftRadius: 4, borderTopLeftRadius: 4 },\n '&:last-of-type': { borderBottomRightRadius: 4, borderTopRightRadius: 4 },\n // Inset, so the joined neighbours do not cover it; raised above the picked cell.\n '&.Mui-focusVisible': {\n outline: `2px solid ${theme.palette.info.main}`,\n outlineOffset: -2,\n zIndex: 2,\n },\n })}\n tabIndex={index === tabStop ? 0 : -1}\n >\n {rating}\n </ButtonBase>\n )\n })}\n </Stack>\n )\n}\n\n// Figma `<Snackbar>` (`_components/snackbar/*/background`): light mode draws white text on the 600 tone; dark\n// mode the lighter main tone, where white fails AA, so black text (6.6:1 on error, 7.6:1 on success). The icon\n// takes the same colour.\nconst StatusBanner = ({\n action,\n bannerRef,\n message,\n severity,\n}: {\n action?: React.ReactNode\n bannerRef: RefObject<HTMLDivElement | null>\n message: string\n severity: 'success' | 'error'\n}) => (\n <Stack\n direction=\"row\"\n ref={bannerRef}\n role={severity === 'error' ? 'alert' : 'status'}\n sx={(theme) => {\n const isDark = theme.palette.mode === 'dark'\n return {\n bgcolor: isDark ? theme.palette[severity].main : theme.palette[severity][600],\n borderRadius: '4px',\n color: isDark ? theme.palette.common.black : theme.palette.common.white,\n px: 16,\n py: 8,\n }\n }}\n tabIndex={-1}\n >\n <Box sx={{ flexShrink: 0, pt: 8, width: 32 }}>\n <Icon fill={true} name={severity === 'success' ? 'check_circle' : 'error'} size={24} />\n </Box>\n <Stack sx={{ gap: 12, pl: 4, py: 8 }}>\n <Text sx={{ color: 'inherit' }} variant=\"subtitle1\">\n {message}\n </Text>\n {action}\n </Stack>\n </Stack>\n)\n\n/**\n * The User Feedback survey (Figma 1283:81740): two 1-5 ratings and a free-text answer, one per step,\n * then a thank-you. The question is the card's title. On submit it sends PostHog's survey events and\n * dismisses the beat, keeping the card (and its thank-you) in the feed until the next refresh.\n */\nconst FeedbackBlock = observer(({ beatGuid = '', payload }: BlockProps) => {\n const copy = readCopy(payload.instance_slot?.data)\n const { beatContext, setBeatContext } = useInsightsV2Store()\n const { onCtaAction } = useBeatActions()\n const stores = useGlobalStore()\n const fireAnalyticsEvent = useAnalyticsEvent()\n const postHogPublicKey = stores.appDataStore.appConfig?.postHogPublicKey\n const surveyId = userFeedbackSurveyId(postHogPublicKey)\n const surveyEvents = userFeedbackSurveyEvents(postHogPublicKey)\n\n const [step, setStep] = useState(0)\n const [ratings, setRatings] = useState<(number | undefined)[]>([])\n const [text, setText] = useState('')\n const [phase, setPhase] = useState<Phase>(() => {\n const savedPhase = beatContext[beatGuid]?.[SURVEY_PHASE_KEY]\n return isResultPhase(savedPhase) ? savedPhase : 'survey'\n })\n const [isSubmitting, setIsSubmitting] = useState(false)\n // The state disables the button on the next render; the ref drops a second click before it.\n const isSubmittingRef = useRef(false)\n // The latest is_dismissed, read after the host's dismiss call settles.\n const isDismissedRef = useRef(payload.is_dismissed)\n isDismissedRef.current = payload.is_dismissed\n\n const bannerRef = useRef<HTMLDivElement>(null)\n const ratingTabStopRef = useRef<HTMLButtonElement>(null)\n const feedbackInputRef = useRef<HTMLTextAreaElement>(null)\n const hasContinuedRef = useRef(false)\n\n // Once per beat, as pulse's survey shown, and only once the survey can draw.\n const hasCopy = !!copy\n useEffect(() => {\n if (!hasCopy || beatContext[beatGuid]?.[SURVEY_SHOWN_KEY]) return\n setBeatContext(beatGuid, { [SURVEY_SHOWN_KEY]: true })\n fireAnalyticsEvent(surveyEvents.shown)\n }, [beatGuid, hasCopy, surveyId])\n\n // The survey's controls unmount with the result, so focus moves to the banner that replaced them.\n // Only on a change: a card that mounts with its result (a remount) must not steal focus.\n const initialPhase = useRef(phase)\n useEffect(() => {\n if (phase !== 'survey' && phase !== initialPhase.current) bannerRef.current?.focus()\n }, [phase])\n\n // After Continue the pressed button stays, so focus moves on to the next step's first control.\n useEffect(() => {\n if (!hasContinuedRef.current) return\n if (step === STEPS - 1) feedbackInputRef.current?.focus()\n else ratingTabStopRef.current?.focus()\n }, [step])\n\n const questions = copy ? [copy.question1, copy.question2, copy.question3] : []\n const resultTitles = { sent: copy?.thank_you, error: copy?.oops }\n const title = phase === 'survey' ? questions[step] : resultTitles[phase]\n\n useEffect(() => {\n if (beatGuid && typeof title === 'string') {\n setBeatContext(beatGuid, { [BEAT_CARD_TITLE_KEY]: title })\n }\n }, [beatGuid, setBeatContext, title])\n\n // Hand the header back to the envelope's title when the block goes.\n useEffect(\n () => () => {\n if (beatGuid) setBeatContext(beatGuid, { [BEAT_CARD_TITLE_KEY]: undefined })\n },\n [beatGuid, setBeatContext],\n )\n\n if (!copy) return null\n\n const showResult = (result: Exclude<Phase, 'survey'>) => {\n setBeatContext(beatGuid, { [SURVEY_PHASE_KEY]: result })\n setPhase(result)\n }\n\n const dismiss = async () => {\n try {\n if (!onCtaAction) throw new Error('No onCtaAction handler to dismiss the beat')\n setBeatContext(beatGuid, { [BEAT_KEEP_AFTER_DISMISS_KEY]: true })\n await onCtaAction({ beatGuid, name: HOST_ACTIONS.dismissBeat })\n showResult('sent')\n } catch (error) {\n stores.captureException(error, { store: 'FeedbackBlock', handler: 'dismissBeat' })\n // Set before the call (the host flips is_dismissed mid-call); cleared so the menu returns on\n // failure, unless the host dismissed the beat anyway (clearing it would swap Oops for the hidden card).\n if (!isDismissedRef.current)\n setBeatContext(beatGuid, { [BEAT_KEEP_AFTER_DISMISS_KEY]: false })\n showResult('error')\n }\n }\n\n // One run at a time: Submit and Try Again ignore a press while the host's dismiss is pending.\n const runOnce = async (run: () => Promise<void>) => {\n if (isSubmittingRef.current) return\n isSubmittingRef.current = true\n setIsSubmitting(true)\n try {\n await run()\n } finally {\n isSubmittingRef.current = false\n setIsSubmitting(false)\n }\n }\n\n const submit = () =>\n runOnce(() => {\n const [first, second] = ratings\n fireAnalyticsEvent(\n surveyEvents.sent(first, second, text.trim().slice(0, FEEDBACK_MAX_LENGTH)),\n )\n fireAnalyticsEvent(surveyEvents.dismissed)\n return dismiss()\n })\n\n const continueToNextStep = () => {\n hasContinuedRef.current = true\n setStep(step + 1)\n }\n\n if (phase !== 'survey') {\n return (\n <Box sx={{ pb: 16, px: 16, width: '100%' }}>\n {phase === 'sent' ? (\n <StatusBanner bannerRef={bannerRef} message={copy.feedback_sent} severity=\"success\" />\n ) : (\n <StatusBanner\n action={\n <Button\n disabled={isSubmitting}\n onClick={() => void runOnce(dismiss)}\n sx={{ alignSelf: 'flex-start', color: 'inherit', minHeight: 0, p: 0 }}\n variant=\"text\"\n >\n {copy.try_again}\n </Button>\n }\n bannerRef={bannerRef}\n message={copy.feedback_error}\n severity=\"error\"\n />\n )}\n </Box>\n )\n }\n\n const isTextStep = step === STEPS - 1\n const canContinue = isTextStep ? text.trim() !== '' : ratings[step] !== undefined\n\n return (\n <Stack sx={{ width: '100%' }}>\n <Stack sx={{ gap: 24, pb: 16, px: 16 }}>\n <Box component=\"span\" sx={VISUALLY_HIDDEN_SX}>\n {buildDynamicCopy(copy.step_count, String(step + 1), String(STEPS)) as string}\n </Box>\n <StepBar step={step} />\n {isTextStep ? (\n <TextField\n inputRef={feedbackInputRef}\n label={copy.feedback}\n minRows={2}\n multiline={true}\n onChange={(event) => setText(event.target.value)}\n placeholder={copy.feedback_placeholder}\n slotProps={{ htmlInput: { maxLength: FEEDBACK_MAX_LENGTH } }}\n value={text}\n />\n ) : (\n <Stack sx={{ gap: 6, pb: 8 }}>\n <RatingScale\n ariaLabel={(rating) => buildDynamicCopy(copy.rating_aria, String(rating)) as string}\n label={questions[step]}\n onChange={(rating) =>\n setRatings((current) => Object.assign([...current], { [step]: rating }))\n }\n tabStopRef={ratingTabStopRef}\n value={ratings[step]}\n />\n <Stack direction=\"row\" sx={{ justifyContent: 'space-between' }}>\n <Text color=\"text.secondary\" variant=\"caption\">\n {copy.strongly_disagree}\n </Text>\n <Text color=\"text.secondary\" variant=\"caption\">\n {copy.strongly_agree}\n </Text>\n </Stack>\n </Stack>\n )}\n </Stack>\n <Stack sx={{ pb: 16, px: 16 }}>\n <Button\n disabled={!canContinue || isSubmitting}\n onClick={isTextStep ? () => void submit() : continueToNextStep}\n variant=\"outlined\"\n >\n {isTextStep ? copy.submit_feedback : copy.continue}\n </Button>\n </Stack>\n </Stack>\n )\n})\n\nexport default FeedbackBlock\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AA4BA,IAAM,KAAa;AAAA,EACjB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,EAEA;AACF,GAIM,KAAA,CAAY,MAChB,GAAW,MAAA,CAAO,MAAQ,GAAe,IAAO,CAAA,CAAI,MAAM,MAA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AAQ;AAAA,cAClC,UAAA,EAAK;AAAA,YACF,CAAA,GACN,gBAAA,EAAC,GAAD;AAAA,cAAM,OAAM;AAAA,cAAiB,SAAQ;AAAA,cAClC,UAAA,EAAK;AAAA,YACF,CAAA,CACD;AAAA,UACF,CAAA,CAAA;AAAA;MAEJ;AAAA,IACP,CAAA,GAAA,gBAAA,EAAC,GAAD;AAAA,MAAO,IAAI;AAAA,QAAE,IAAI;AAAA,QAAI,IAAI;AAAA,MAAG;AAAA,MAC1B,UAAA,gBAAA,EAAC,GAAD;AAAA,QACE,UAAU,CAAC,MAAe;AAAA,QAC1B,SAAS,IAAA,MAAA;AAAmB,UAAK,GAAO;AAAA,YAAI;AAAA,QAC5C,SAAQ;AAAA,QAEP,UAAA,IAAa,EAAK,kBAAkB,EAAK;AAAA,MACpC,CAAA;AAAA,IACH,CAAA,CACF;AAAA;AAEX,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as FeedbackBlock } from './FeedbackBlock';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/** pulse's USER_FEEDBACK_INSIGHT_SURVEY_ID: the same PostHog survey, per environment. */
|
|
2
|
+
export declare const userFeedbackSurveyId: (postHogPublicKey?: string) => "01986709-032e-0000-5496-ad8f17623225" | "0198428e-bfe6-0000-002d-1fe2e87b3821";
|
|
3
|
+
/** The PostHog survey events pulse's UserFeedback beat sends, with the same keys. */
|
|
4
|
+
export declare const userFeedbackSurveyEvents: (postHogPublicKey?: string) => {
|
|
5
|
+
shown: {
|
|
6
|
+
postHog: {
|
|
7
|
+
eventName: string;
|
|
8
|
+
properties: () => {
|
|
9
|
+
$survey_id: string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
dismissed: {
|
|
14
|
+
postHog: {
|
|
15
|
+
eventName: string;
|
|
16
|
+
properties: () => {
|
|
17
|
+
$survey_id: string;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
sent: (first?: number, second?: number, feedback?: string) => {
|
|
22
|
+
postHog: {
|
|
23
|
+
eventName: string;
|
|
24
|
+
properties: () => {
|
|
25
|
+
$survey_id: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { isProductionPostHogKey as u } from "../../../../core/utils/PostHog.es.js";
|
|
2
|
+
var v = (e) => u(e) ? "01986709-032e-0000-5496-ad8f17623225" : "0198428e-bfe6-0000-002d-1fe2e87b3821", y = (e) => {
|
|
3
|
+
const n = v(e), s = (r, o = {}) => ({ postHog: {
|
|
4
|
+
eventName: r,
|
|
5
|
+
properties: () => ({
|
|
6
|
+
$survey_id: n,
|
|
7
|
+
...o
|
|
8
|
+
})
|
|
9
|
+
} });
|
|
10
|
+
return {
|
|
11
|
+
shown: s("survey shown"),
|
|
12
|
+
dismissed: s("survey dismissed"),
|
|
13
|
+
sent: (r, o, t) => s("survey sent", {
|
|
14
|
+
$survey_response: r,
|
|
15
|
+
$survey_response_1: o,
|
|
16
|
+
$survey_response_2: t
|
|
17
|
+
})
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export {
|
|
21
|
+
y as userFeedbackSurveyEvents,
|
|
22
|
+
v as userFeedbackSurveyId
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
//# sourceMappingURL=survey.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"survey.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/FeedbackBlock/survey.ts"],"sourcesContent":["import { isProductionPostHogKey } from '../../../../core/utils/PostHog'\nimport type { AnalyticsEventConfigEntry } from '../../../analytics/analyticsEventsConfig'\n\n/** pulse's USER_FEEDBACK_INSIGHT_SURVEY_ID: the same PostHog survey, per environment. */\nexport const userFeedbackSurveyId = (postHogPublicKey?: string) =>\n isProductionPostHogKey(postHogPublicKey)\n ? '01986709-032e-0000-5496-ad8f17623225'\n : '0198428e-bfe6-0000-002d-1fe2e87b3821'\n\n/** The PostHog survey events pulse's UserFeedback beat sends, with the same keys. */\nexport const userFeedbackSurveyEvents = (postHogPublicKey?: string) => {\n const $survey_id = userFeedbackSurveyId(postHogPublicKey)\n const event = (eventName: string, extra: Record<string, unknown> = {}) =>\n ({\n postHog: { eventName, properties: () => ({ $survey_id, ...extra }) },\n }) satisfies AnalyticsEventConfigEntry\n\n return {\n shown: event('survey shown'),\n dismissed: event('survey dismissed'),\n sent: (first?: number, second?: number, feedback?: string) =>\n event('survey sent', {\n $survey_response: first,\n $survey_response_1: second,\n $survey_response_2: feedback,\n }),\n }\n}\n"],"mappings":";AAIA,IAAa,IAAA,CAAwB,MACnC,EAAuB,CAAgB,IACnC,yCACA,wCAGO,IAAA,CAA4B,MAA8B;AACrE,QAAM,IAAa,EAAqB,CAAgB,GAClD,IAAA,CAAS,GAAmB,IAAiC,CAAC,OACjE,EACC,SAAS;AAAA,IAAE,WAAA;AAAA,IAAW,YAAA,OAAmB;AAAA,MAAE,YAAA;AAAA,MAAY,GAAG;AAAA,IAAM;AAAA,EAAG,EACrE;AAEF,SAAO;AAAA,IACL,OAAO,EAAM,cAAc;AAAA,IAC3B,WAAW,EAAM,kBAAkB;AAAA,IACnC,MAAA,CAAO,GAAgB,GAAiB,MACtC,EAAM,eAAe;AAAA,MACnB,kBAAkB;AAAA,MAClB,oBAAoB;AAAA,MACpB,oBAAoB;AAAA,IACtB,CAAC;AAAA,EACL;AACF"}
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import { useAppConfig as
|
|
2
|
-
import { BEAT_ACTIVE_AT_KEY as
|
|
3
|
-
import { sendClientConfiguredCta as
|
|
4
|
-
import { BeatActionsProvider as
|
|
5
|
-
import { isContactSupportCtaDisabled as
|
|
6
|
-
import { CtaStatus as
|
|
7
|
-
import { HOST_ACTIONS as
|
|
8
|
-
import { reportCtaClick as
|
|
9
|
-
import { useBeatCtaActions as
|
|
10
|
-
import { actionBlocksKey as
|
|
11
|
-
import { logoFromRef as
|
|
12
|
-
import
|
|
13
|
-
import { ErrorCard as
|
|
14
|
-
import { blocks as
|
|
15
|
-
import { ActionBlockLayer as
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import { FeedbackBar as
|
|
19
|
-
import { DismissInsightDialog as
|
|
20
|
-
import { HiddenConfirmationCard as
|
|
21
|
-
import { LoadingCard as
|
|
22
|
-
import { ObsolesceBanner as
|
|
23
|
-
import { useBeatFeedbackFlow as
|
|
24
|
-
import { useEffect as
|
|
25
|
-
import { observer as
|
|
26
|
-
import
|
|
27
|
-
import { P as
|
|
1
|
+
import { useAppConfig as po, useGlobalCopyStore as mo, useGlobalStore as uo, useInsightsV2Store as fo } from "../../common/context/hooks.es.js";
|
|
2
|
+
import { BEAT_ACTIVE_AT_KEY as Co, BEAT_CARD_TITLE_KEY as ho, BEAT_KEEP_AFTER_DISMISS_KEY as go } from "../../core/stores/InsightsV2Store.es.js";
|
|
3
|
+
import { sendClientConfiguredCta as _o } from "../../common/utils/PostMessage.es.js";
|
|
4
|
+
import { BeatActionsProvider as bo } from "../beatActions.es.js";
|
|
5
|
+
import { isContactSupportCtaDisabled as yo } from "../actionBlocks/ContactSupportActionBlock.es.js";
|
|
6
|
+
import { CtaStatus as ko } from "./CtaStatus.es.js";
|
|
7
|
+
import { HOST_ACTIONS as vo } from "../ctaActions/hostActions.es.js";
|
|
8
|
+
import { reportCtaClick as xo } from "../ctaActions/runCtaAction.es.js";
|
|
9
|
+
import { useBeatCtaActions as So } from "../ctaActions/useCtaAction.es.js";
|
|
10
|
+
import { actionBlocksKey as To } from "../mappings/actionBlocksKey.es.js";
|
|
11
|
+
import { logoFromRef as Ao } from "./shared/EntityLogo.es.js";
|
|
12
|
+
import wo from "./FeedbackDialog.es.js";
|
|
13
|
+
import { ErrorCard as Do } from "./ErrorCard.es.js";
|
|
14
|
+
import { blocks as Bo } from "../mappings/blocks.es.js";
|
|
15
|
+
import { ActionBlockLayer as Lo } from "../actionBlocks/ActionBlockLayer.es.js";
|
|
16
|
+
import Eo from "./Footer.es.js";
|
|
17
|
+
import Io from "./Header.es.js";
|
|
18
|
+
import { FeedbackBar as Oo } from "./FeedbackBar.es.js";
|
|
19
|
+
import { DismissInsightDialog as Fo } from "./DismissInsightDialog.es.js";
|
|
20
|
+
import { HiddenConfirmationCard as Ho } from "./HiddenConfirmationCard.es.js";
|
|
21
|
+
import { LoadingCard as Mo } from "./LoadingCard.es.js";
|
|
22
|
+
import { ObsolesceBanner as Ro } from "./ObsolesceBanner.es.js";
|
|
23
|
+
import { useBeatFeedbackFlow as No } from "../hooks/useBeatFeedbackFlow.es.js";
|
|
24
|
+
import { useEffect as Po, useMemo as Ko } from "react";
|
|
25
|
+
import { observer as Go } from "mobx-react-lite";
|
|
26
|
+
import B from "@mui/material/Stack";
|
|
27
|
+
import { P as Wo } from "@mxenabled/mxui";
|
|
28
28
|
import f from "@mui/material/Button";
|
|
29
|
-
import { ChevronRight as
|
|
30
|
-
import { Fragment as
|
|
31
|
-
import
|
|
32
|
-
import
|
|
33
|
-
var
|
|
29
|
+
import { ChevronRight as G } from "@mxenabled/mx-icons";
|
|
30
|
+
import { Fragment as Xo, jsx as o, jsxs as C } from "react/jsx-runtime";
|
|
31
|
+
import W from "@mui/material/Box";
|
|
32
|
+
import Vo from "@mui/material/Card";
|
|
33
|
+
var Yo = {}, jo = {
|
|
34
34
|
position: "absolute",
|
|
35
35
|
top: 0,
|
|
36
36
|
left: 0,
|
|
@@ -39,7 +39,7 @@ var Mo = {}, Po = {
|
|
|
39
39
|
backgroundColor: "background.default",
|
|
40
40
|
opacity: 0.7,
|
|
41
41
|
zIndex: 3
|
|
42
|
-
},
|
|
42
|
+
}, L = {
|
|
43
43
|
alignSelf: "flex-start",
|
|
44
44
|
fontSize: 13,
|
|
45
45
|
fontWeight: 600,
|
|
@@ -51,12 +51,12 @@ var Mo = {}, Po = {
|
|
|
51
51
|
px: 0,
|
|
52
52
|
py: 4,
|
|
53
53
|
textAlign: "left"
|
|
54
|
-
},
|
|
55
|
-
...
|
|
54
|
+
}, zo = {
|
|
55
|
+
...L,
|
|
56
56
|
alignItems: "center",
|
|
57
57
|
display: "flex",
|
|
58
58
|
textTransform: "none"
|
|
59
|
-
},
|
|
59
|
+
}, Uo = {
|
|
60
60
|
flexGrow: 1,
|
|
61
61
|
minHeight: 0,
|
|
62
62
|
overflow: "clip",
|
|
@@ -66,7 +66,7 @@ var Mo = {}, Po = {
|
|
|
66
66
|
height: "100%",
|
|
67
67
|
justifyContent: "center"
|
|
68
68
|
}
|
|
69
|
-
},
|
|
69
|
+
}, $o = {
|
|
70
70
|
color: "text.secondary",
|
|
71
71
|
fontSize: 13,
|
|
72
72
|
fontWeight: 600,
|
|
@@ -76,196 +76,198 @@ var Mo = {}, Po = {
|
|
|
76
76
|
px: 16,
|
|
77
77
|
py: 12,
|
|
78
78
|
"&.Mui-disabled": { color: "text.disabled" }
|
|
79
|
-
},
|
|
80
|
-
const
|
|
81
|
-
|
|
82
|
-
|
|
79
|
+
}, Dt = Go(({ beat: t, beatActions: l = Yo, obsolete: y, isLoading: E = !1, isError: X = !1 }) => {
|
|
80
|
+
const V = mo(), h = fo(), { config: Y } = po(), i = No(t, l), k = uo(), { runCta: j, primary: v, secondary: I, linkPresentation: z } = So(t, l, t.insights_payload?.primary_cta ?? void 0, t.insights_payload?.secondary_cta ?? void 0, t.insights_payload?.in_description_cta ?? void 0), c = t.insights_payload?.widget_type === "mini", g = t.active_at ?? t.insights_payload?.active_at;
|
|
81
|
+
Po(() => {
|
|
82
|
+
g == null || g === "" || h.setBeatContext(t.guid, { [Co]: g });
|
|
83
83
|
}, [
|
|
84
|
-
|
|
84
|
+
g,
|
|
85
85
|
t.guid,
|
|
86
|
-
|
|
86
|
+
h
|
|
87
87
|
]);
|
|
88
|
-
const
|
|
89
|
-
...
|
|
88
|
+
const U = Ko(() => ({
|
|
89
|
+
...i.wrappedActions,
|
|
90
90
|
beat: t
|
|
91
|
-
}), [
|
|
92
|
-
if (
|
|
91
|
+
}), [i.wrappedActions, t]), O = h.beatContext[t.guid], F = !!O?.[go], x = F ? "visible" : i.cardState;
|
|
92
|
+
if (X) return /* @__PURE__ */ o(Do, {});
|
|
93
93
|
const e = t.insights_payload;
|
|
94
|
-
if (!e ||
|
|
95
|
-
const { instance_slot:
|
|
96
|
-
logo:
|
|
94
|
+
if (!e || x === "dismissed") return null;
|
|
95
|
+
const { instance_slot: $, primary_cta: r, secondary_cta: d, sub_title: q, title: J, guid: H, dismissed_at: Q } = e, { block: Z } = $, oo = q ?? (e.subtitle ? {
|
|
96
|
+
logo: Ao(e.logo),
|
|
97
97
|
text: e.subtitle
|
|
98
|
-
} : void 0),
|
|
99
|
-
if (!
|
|
100
|
-
if (a.block ===
|
|
101
|
-
|
|
98
|
+
} : void 0), m = (s) => yo(s, Y, l.onContactSupport), M = async (s, a) => {
|
|
99
|
+
if (!m(a.block)) {
|
|
100
|
+
if (a.block === To.CONTACT_SUPPORT_ACTION_BLOCK) {
|
|
101
|
+
xo({
|
|
102
102
|
beat: t,
|
|
103
|
-
stores:
|
|
103
|
+
stores: k,
|
|
104
104
|
hostActions: l,
|
|
105
105
|
slot: s
|
|
106
106
|
}), l.onContactSupport?.();
|
|
107
107
|
return;
|
|
108
108
|
}
|
|
109
|
-
await
|
|
109
|
+
await j(s, a);
|
|
110
110
|
}
|
|
111
|
-
},
|
|
112
|
-
const { is_mobile_webview: s, clientConfig: a } =
|
|
113
|
-
|
|
111
|
+
}, S = Bo[Z], p = e.in_description_cta, _ = !c && p?.label && p.block ? p : void 0, to = r?.label || (_ ? void 0 : p?.label) || void 0, u = !c && !!r?.label, T = t.in_description_cta || t.html_in_description_cta, io = () => {
|
|
112
|
+
const { is_mobile_webview: s, clientConfig: a } = k.appDataStore.appConfig;
|
|
113
|
+
_o(t.template, {
|
|
114
114
|
isMobileWebview: s,
|
|
115
115
|
webviewScheme: a?.master?.ui_message_webview_url_scheme,
|
|
116
116
|
userGuid: e.user_guid ?? t.user_guid
|
|
117
117
|
});
|
|
118
|
-
}, n = u ? v.presentation : void 0,
|
|
118
|
+
}, n = u ? v.presentation : void 0, eo = n?.kind === "hidden" && !!n.hideAll, R = !c && !!d?.label && !eo, b = c ? z : void 0, no = b?.kind === "status" ? b : void 0, N = b ? no?.action?.label : to, A = O?.[ho], ro = b?.title || (typeof A == "string" ? A : "") || J || "", P = !!N && !u, K = typeof A == "string", so = !K || !!e.description.html_text || !!_ || P || !p?.label && !!T, ao = u && n?.kind !== "hidden" || R, lo = (s) => {
|
|
119
119
|
const { onCtaAction: a } = l;
|
|
120
120
|
a && (s.stopPropagation(), Promise.resolve().then(() => a({
|
|
121
121
|
beatGuid: t.guid,
|
|
122
|
-
name:
|
|
123
|
-
})).catch((
|
|
122
|
+
name: vo.cardClick
|
|
123
|
+
})).catch((co) => k.captureException(co, {
|
|
124
124
|
store: "BaseLayout",
|
|
125
125
|
template: t.template,
|
|
126
126
|
handler: "cardClick"
|
|
127
127
|
})));
|
|
128
|
-
},
|
|
129
|
-
return /* @__PURE__ */
|
|
130
|
-
value:
|
|
131
|
-
children: /* @__PURE__ */ C(
|
|
128
|
+
}, w = V.insights_feed?.general, D = y?.state === "not_refreshable" && !Q && !!w;
|
|
129
|
+
return /* @__PURE__ */ o(bo, {
|
|
130
|
+
value: U,
|
|
131
|
+
children: /* @__PURE__ */ C(B, {
|
|
132
132
|
sx: { mb: 16 },
|
|
133
133
|
children: [
|
|
134
|
-
|
|
135
|
-
onClose:
|
|
136
|
-
onLeaveFeedback:
|
|
137
|
-
onUndo:
|
|
138
|
-
}) : /* @__PURE__ */ C(
|
|
139
|
-
...
|
|
140
|
-
copy:
|
|
141
|
-
}), /* @__PURE__ */ C(
|
|
142
|
-
inert:
|
|
134
|
+
x === "confirming" ? /* @__PURE__ */ o(Ho, {
|
|
135
|
+
onClose: i.collapseConfirmation,
|
|
136
|
+
onLeaveFeedback: i.openHideSurvey,
|
|
137
|
+
onUndo: i.undoDismiss
|
|
138
|
+
}) : /* @__PURE__ */ C(Xo, { children: [y && w && /* @__PURE__ */ o(Ro, {
|
|
139
|
+
...y,
|
|
140
|
+
copy: w
|
|
141
|
+
}), /* @__PURE__ */ C(Vo, {
|
|
142
|
+
inert: D,
|
|
143
143
|
sx: {
|
|
144
144
|
display: "flex",
|
|
145
145
|
flexDirection: "column",
|
|
146
|
-
...
|
|
146
|
+
...D && {
|
|
147
147
|
position: "relative",
|
|
148
148
|
zIndex: 2,
|
|
149
149
|
pointerEvents: "none"
|
|
150
150
|
}
|
|
151
151
|
},
|
|
152
152
|
children: [
|
|
153
|
-
|
|
154
|
-
/* @__PURE__ */
|
|
153
|
+
D && /* @__PURE__ */ o(W, { sx: jo }),
|
|
154
|
+
/* @__PURE__ */ o(Io, {
|
|
155
|
+
hidesMenu: F,
|
|
155
156
|
isMini: c,
|
|
156
|
-
subtitle:
|
|
157
|
-
title:
|
|
157
|
+
subtitle: oo,
|
|
158
|
+
title: ro,
|
|
159
|
+
wrapsTitle: K
|
|
158
160
|
}),
|
|
159
|
-
/* @__PURE__ */
|
|
160
|
-
sx:
|
|
161
|
-
children:
|
|
162
|
-
beatGuid:
|
|
161
|
+
/* @__PURE__ */ o(W, {
|
|
162
|
+
sx: Uo,
|
|
163
|
+
children: E ? /* @__PURE__ */ o(Mo, {}) : S && /* @__PURE__ */ o(S, {
|
|
164
|
+
beatGuid: H,
|
|
163
165
|
payload: e
|
|
164
166
|
})
|
|
165
167
|
}),
|
|
166
|
-
/* @__PURE__ */ C(
|
|
168
|
+
so && /* @__PURE__ */ C(B, {
|
|
167
169
|
sx: {
|
|
168
170
|
gap: 6,
|
|
169
171
|
pb: 16,
|
|
170
|
-
pt:
|
|
172
|
+
pt: E || S ? 12 : 0,
|
|
171
173
|
px: 16
|
|
172
174
|
},
|
|
173
175
|
children: [
|
|
174
|
-
/* @__PURE__ */
|
|
176
|
+
/* @__PURE__ */ o(Wo, {
|
|
175
177
|
dangerouslySetInnerHTML: { __html: e.description.html_text },
|
|
176
178
|
sx: { fontWeight: "fontWeightRegular" },
|
|
177
179
|
variant: "subtitle2"
|
|
178
180
|
}),
|
|
179
|
-
|
|
180
|
-
endIcon: /* @__PURE__ */
|
|
181
|
-
onClick: () =>
|
|
182
|
-
guid:
|
|
181
|
+
_ && /* @__PURE__ */ o(f, {
|
|
182
|
+
endIcon: /* @__PURE__ */ o(G, {}),
|
|
183
|
+
onClick: () => h.openActionDrawer({
|
|
184
|
+
guid: H,
|
|
183
185
|
trigger: "inDescriptionCta"
|
|
184
186
|
}),
|
|
185
|
-
sx:
|
|
186
|
-
children:
|
|
187
|
+
sx: L,
|
|
188
|
+
children: _.label
|
|
187
189
|
}),
|
|
188
|
-
|
|
189
|
-
onClick: c ?
|
|
190
|
-
sx:
|
|
190
|
+
P && /* @__PURE__ */ o(f, {
|
|
191
|
+
onClick: c ? lo : void 0,
|
|
192
|
+
sx: zo,
|
|
191
193
|
variant: "text",
|
|
192
|
-
children:
|
|
194
|
+
children: N
|
|
193
195
|
}),
|
|
194
|
-
!
|
|
195
|
-
endIcon: /* @__PURE__ */
|
|
196
|
-
onClick:
|
|
197
|
-
sx:
|
|
198
|
-
children:
|
|
196
|
+
!p?.label && T && /* @__PURE__ */ o(f, {
|
|
197
|
+
endIcon: /* @__PURE__ */ o(G, {}),
|
|
198
|
+
onClick: io,
|
|
199
|
+
sx: L,
|
|
200
|
+
children: T
|
|
199
201
|
})
|
|
200
202
|
]
|
|
201
203
|
}),
|
|
202
|
-
|
|
204
|
+
ao && /* @__PURE__ */ C(B, {
|
|
203
205
|
sx: {
|
|
204
206
|
gap: 8,
|
|
205
207
|
pb: 16,
|
|
206
208
|
px: 16
|
|
207
209
|
},
|
|
208
210
|
children: [
|
|
209
|
-
u && r && n?.kind === "status" && /* @__PURE__ */
|
|
211
|
+
u && r && n?.kind === "status" && /* @__PURE__ */ o(ko, {
|
|
210
212
|
action: n.action,
|
|
211
213
|
sx: n.sx,
|
|
212
214
|
icon: n.icon,
|
|
213
215
|
label: n.label,
|
|
214
216
|
tone: n.tone
|
|
215
217
|
}),
|
|
216
|
-
u && r && !n && /* @__PURE__ */
|
|
217
|
-
"aria-disabled":
|
|
218
|
+
u && r && !n && /* @__PURE__ */ o(f, {
|
|
219
|
+
"aria-disabled": m(r.block) || v.disabled,
|
|
218
220
|
disabled: v.disabled,
|
|
219
|
-
onClick: () =>
|
|
220
|
-
sx: { ...
|
|
221
|
+
onClick: () => M("primary", r),
|
|
222
|
+
sx: { ...m(r.block) && { color: "text.disabled" } },
|
|
221
223
|
variant: "outlined",
|
|
222
224
|
children: r.label
|
|
223
225
|
}),
|
|
224
|
-
|
|
225
|
-
"aria-disabled":
|
|
226
|
+
R && d && /* @__PURE__ */ o(f, {
|
|
227
|
+
"aria-disabled": m(d.block) || I.disabled,
|
|
226
228
|
color: "inherit",
|
|
227
|
-
disabled:
|
|
228
|
-
onClick: () =>
|
|
229
|
+
disabled: I.disabled,
|
|
230
|
+
onClick: () => M("secondary", d),
|
|
229
231
|
sx: {
|
|
230
|
-
|
|
231
|
-
...
|
|
232
|
+
...$o,
|
|
233
|
+
...m(d.block) && { color: "text.disabled" }
|
|
232
234
|
},
|
|
233
235
|
children: d.label
|
|
234
236
|
})
|
|
235
237
|
]
|
|
236
238
|
}),
|
|
237
|
-
/* @__PURE__ */
|
|
238
|
-
onTellUsMore:
|
|
239
|
-
show:
|
|
239
|
+
/* @__PURE__ */ o(Oo, {
|
|
240
|
+
onTellUsMore: i.openRatingSurvey,
|
|
241
|
+
show: i.isFeedbackBarShown
|
|
240
242
|
})
|
|
241
243
|
]
|
|
242
244
|
})] }),
|
|
243
|
-
/* @__PURE__ */
|
|
244
|
-
/* @__PURE__ */
|
|
245
|
-
isOpen:
|
|
246
|
-
onClose:
|
|
247
|
-
onDismiss:
|
|
245
|
+
/* @__PURE__ */ o(Lo, { beat: t }),
|
|
246
|
+
/* @__PURE__ */ o(Fo, {
|
|
247
|
+
isOpen: i.isDismissOpen,
|
|
248
|
+
onClose: i.closeDismissDialog,
|
|
249
|
+
onDismiss: i.confirmDismiss
|
|
248
250
|
}),
|
|
249
|
-
|
|
250
|
-
characterLimitLabel:
|
|
251
|
-
closeAriaLabel:
|
|
251
|
+
i.isSurveyOpen && /* @__PURE__ */ o(wo, {
|
|
252
|
+
characterLimitLabel: i.survey.characterLimitLabel,
|
|
253
|
+
closeAriaLabel: i.survey.closeAriaLabel,
|
|
252
254
|
isOpen: !0,
|
|
253
|
-
onBackClick:
|
|
254
|
-
onClose:
|
|
255
|
-
onSubmit:
|
|
256
|
-
onTextInputFocus:
|
|
257
|
-
options:
|
|
258
|
-
primaryText:
|
|
259
|
-
secondaryText:
|
|
260
|
-
title:
|
|
255
|
+
onBackClick: i.feedbackDialogCallbacks.onBackClick,
|
|
256
|
+
onClose: i.closeSurvey,
|
|
257
|
+
onSubmit: i.submitSurvey,
|
|
258
|
+
onTextInputFocus: i.feedbackDialogCallbacks.onTextInputFocus,
|
|
259
|
+
options: i.survey.options,
|
|
260
|
+
primaryText: i.survey.submitText,
|
|
261
|
+
secondaryText: i.survey.backText,
|
|
262
|
+
title: i.survey.title
|
|
261
263
|
}),
|
|
262
|
-
|
|
264
|
+
x === "visible" && e.footer && /* @__PURE__ */ o(Eo, { footer: e.footer })
|
|
263
265
|
]
|
|
264
266
|
})
|
|
265
267
|
});
|
|
266
268
|
});
|
|
267
269
|
export {
|
|
268
|
-
|
|
270
|
+
Dt as default
|
|
269
271
|
};
|
|
270
272
|
|
|
271
273
|
//# sourceMappingURL=BaseLayout.es.js.map
|