@strapi/admin 5.18.0 → 5.19.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.
Files changed (90) hide show
  1. package/dist/admin/admin/src/components/GuidedTour/Provider.js +2 -1
  2. package/dist/admin/admin/src/components/GuidedTour/Provider.js.map +1 -1
  3. package/dist/admin/admin/src/components/GuidedTour/Provider.mjs +2 -1
  4. package/dist/admin/admin/src/components/GuidedTour/Provider.mjs.map +1 -1
  5. package/dist/admin/admin/src/components/LeftMenu.js +52 -29
  6. package/dist/admin/admin/src/components/LeftMenu.js.map +1 -1
  7. package/dist/admin/admin/src/components/LeftMenu.mjs +52 -29
  8. package/dist/admin/admin/src/components/LeftMenu.mjs.map +1 -1
  9. package/dist/admin/admin/src/components/MainNav/NavLink.js +4 -42
  10. package/dist/admin/admin/src/components/MainNav/NavLink.js.map +1 -1
  11. package/dist/admin/admin/src/components/MainNav/NavLink.mjs +4 -23
  12. package/dist/admin/admin/src/components/MainNav/NavLink.mjs.map +1 -1
  13. package/dist/admin/admin/src/components/NpsSurvey.js +1 -1
  14. package/dist/admin/admin/src/components/NpsSurvey.js.map +1 -1
  15. package/dist/admin/admin/src/components/NpsSurvey.mjs +1 -1
  16. package/dist/admin/admin/src/components/NpsSurvey.mjs.map +1 -1
  17. package/dist/admin/admin/src/components/SubNav.js +17 -11
  18. package/dist/admin/admin/src/components/SubNav.js.map +1 -1
  19. package/dist/admin/admin/src/components/SubNav.mjs +18 -12
  20. package/dist/admin/admin/src/components/SubNav.mjs.map +1 -1
  21. package/dist/admin/admin/src/components/UnstableGuidedTour/Context.js +30 -0
  22. package/dist/admin/admin/src/components/UnstableGuidedTour/Context.js.map +1 -1
  23. package/dist/admin/admin/src/components/UnstableGuidedTour/Context.mjs +30 -0
  24. package/dist/admin/admin/src/components/UnstableGuidedTour/Context.mjs.map +1 -1
  25. package/dist/admin/admin/src/components/UnstableGuidedTour/Overview.js +53 -16
  26. package/dist/admin/admin/src/components/UnstableGuidedTour/Overview.js.map +1 -1
  27. package/dist/admin/admin/src/components/UnstableGuidedTour/Overview.mjs +54 -17
  28. package/dist/admin/admin/src/components/UnstableGuidedTour/Overview.mjs.map +1 -1
  29. package/dist/admin/admin/src/components/UnstableGuidedTour/Step.js +83 -37
  30. package/dist/admin/admin/src/components/UnstableGuidedTour/Step.js.map +1 -1
  31. package/dist/admin/admin/src/components/UnstableGuidedTour/Step.mjs +85 -40
  32. package/dist/admin/admin/src/components/UnstableGuidedTour/Step.mjs.map +1 -1
  33. package/dist/admin/admin/src/components/UnstableGuidedTour/Tours.js +73 -51
  34. package/dist/admin/admin/src/components/UnstableGuidedTour/Tours.js.map +1 -1
  35. package/dist/admin/admin/src/components/UnstableGuidedTour/Tours.mjs +69 -47
  36. package/dist/admin/admin/src/components/UnstableGuidedTour/Tours.mjs.map +1 -1
  37. package/dist/admin/admin/src/components/UpsellBanner.js +1 -1
  38. package/dist/admin/admin/src/components/UpsellBanner.js.map +1 -1
  39. package/dist/admin/admin/src/components/UpsellBanner.mjs +2 -2
  40. package/dist/admin/admin/src/components/UpsellBanner.mjs.map +1 -1
  41. package/dist/admin/admin/src/features/Tracking.js +34 -1
  42. package/dist/admin/admin/src/features/Tracking.js.map +1 -1
  43. package/dist/admin/admin/src/features/Tracking.mjs +34 -1
  44. package/dist/admin/admin/src/features/Tracking.mjs.map +1 -1
  45. package/dist/admin/admin/src/hooks/usePersistentState.js +10 -0
  46. package/dist/admin/admin/src/hooks/usePersistentState.js.map +1 -1
  47. package/dist/admin/admin/src/hooks/usePersistentState.mjs +10 -1
  48. package/dist/admin/admin/src/hooks/usePersistentState.mjs.map +1 -1
  49. package/dist/admin/admin/src/pages/Home/HomePage.js +1 -0
  50. package/dist/admin/admin/src/pages/Home/HomePage.js.map +1 -1
  51. package/dist/admin/admin/src/pages/Home/HomePage.mjs +1 -0
  52. package/dist/admin/admin/src/pages/Home/HomePage.mjs.map +1 -1
  53. package/dist/admin/admin/src/pages/Home/components/FreeTrialEndedModal.js +2 -2
  54. package/dist/admin/admin/src/pages/Home/components/FreeTrialEndedModal.js.map +1 -1
  55. package/dist/admin/admin/src/pages/Home/components/FreeTrialEndedModal.mjs +3 -3
  56. package/dist/admin/admin/src/pages/Home/components/FreeTrialEndedModal.mjs.map +1 -1
  57. package/dist/admin/admin/src/pages/Home/components/FreeTrialWelcomeModal.js +1 -1
  58. package/dist/admin/admin/src/pages/Home/components/FreeTrialWelcomeModal.js.map +1 -1
  59. package/dist/admin/admin/src/pages/Home/components/FreeTrialWelcomeModal.mjs +2 -2
  60. package/dist/admin/admin/src/pages/Home/components/FreeTrialWelcomeModal.mjs.map +1 -1
  61. package/dist/admin/admin/src/pages/ProfilePage.js +297 -254
  62. package/dist/admin/admin/src/pages/ProfilePage.js.map +1 -1
  63. package/dist/admin/admin/src/pages/ProfilePage.mjs +297 -254
  64. package/dist/admin/admin/src/pages/ProfilePage.mjs.map +1 -1
  65. package/dist/admin/admin/src/pages/Settings/components/SettingsNav.js +12 -1
  66. package/dist/admin/admin/src/pages/Settings/components/SettingsNav.js.map +1 -1
  67. package/dist/admin/admin/src/pages/Settings/components/SettingsNav.mjs +12 -1
  68. package/dist/admin/admin/src/pages/Settings/components/SettingsNav.mjs.map +1 -1
  69. package/dist/admin/admin/src/pages/UseCasePage.js +1 -1
  70. package/dist/admin/admin/src/pages/UseCasePage.js.map +1 -1
  71. package/dist/admin/admin/src/pages/UseCasePage.mjs +1 -1
  72. package/dist/admin/admin/src/pages/UseCasePage.mjs.map +1 -1
  73. package/dist/admin/admin/src/translations/en.json.js +14 -1
  74. package/dist/admin/admin/src/translations/en.json.js.map +1 -1
  75. package/dist/admin/admin/src/translations/en.json.mjs +14 -1
  76. package/dist/admin/admin/src/translations/en.json.mjs.map +1 -1
  77. package/dist/admin/admin/src/translations/es.json.js +2 -1
  78. package/dist/admin/admin/src/translations/es.json.js.map +1 -1
  79. package/dist/admin/admin/src/translations/es.json.mjs +2 -1
  80. package/dist/admin/admin/src/translations/es.json.mjs.map +1 -1
  81. package/dist/admin/ee/admin/src/constants.js +4 -2
  82. package/dist/admin/ee/admin/src/constants.js.map +1 -1
  83. package/dist/admin/ee/admin/src/constants.mjs +4 -2
  84. package/dist/admin/ee/admin/src/constants.mjs.map +1 -1
  85. package/dist/admin/src/components/SubNav.d.ts +2 -1
  86. package/dist/admin/src/components/UnstableGuidedTour/Context.d.ts +2 -0
  87. package/dist/admin/src/components/UnstableGuidedTour/Step.d.ts +9 -3
  88. package/dist/admin/src/features/Tracking.d.ts +22 -3
  89. package/dist/admin/src/hooks/usePersistentState.d.ts +2 -1
  90. package/package.json +9 -9
@@ -1 +1 @@
1
- {"version":3,"file":"Overview.mjs","sources":["../../../../../../admin/src/components/UnstableGuidedTour/Overview.tsx"],"sourcesContent":["import { Box, Button, Flex, Link, ProgressBar, Typography } from '@strapi/design-system';\nimport { CheckCircle, ChevronRight } from '@strapi/icons';\nimport { useIntl } from 'react-intl';\nimport { NavLink } from 'react-router-dom';\nimport { styled, useTheme } from 'styled-components';\n\nimport { type ValidTourName, unstableUseGuidedTour } from './Context';\n\n/* -------------------------------------------------------------------------------------------------\n * Styled\n * -----------------------------------------------------------------------------------------------*/\n\nconst StyledProgressBar = styled(ProgressBar)`\n width: 100%;\n background-color: ${({ theme }) => theme.colors.neutral150};\n > div {\n background-color: ${({ theme }) => theme.colors.success500};\n }\n`;\n\nconst Container = styled(Flex)`\n width: 100%;\n border-radius: ${({ theme }) => theme.borderRadius};\n background-color: ${({ theme }) => theme.colors.neutral0};\n box-shadow: ${({ theme }) => theme.shadows.tableShadow};\n align-items: stretch;\n`;\n\nconst ContentSection = styled(Flex)`\n flex: 1;\n padding: ${({ theme }) => theme.spaces[8]};\n`;\n\nconst VerticalSeparator = styled.div`\n width: 1px;\n background-color: ${({ theme }) => theme.colors.neutral150};\n`;\n\nconst TourTaskContainer = styled(Flex)`\n &:not(:last-child) {\n border-bottom: ${({ theme }) => `1px solid ${theme.colors.neutral150}`};\n }\n padding: ${({ theme }) => theme.spaces[4]};\n`;\n\nconst TodoCircle = styled(Box)`\n border: 1px solid ${({ theme }) => theme.colors.neutral300};\n border-radius: 50%;\n height: 13px;\n width: 13px;\n`;\n\n/* -------------------------------------------------------------------------------------------------\n * Constants\n * -----------------------------------------------------------------------------------------------*/\n\nconst LINK_LABEL = {\n id: 'tours.overview.tour.link',\n defaultMessage: 'Start',\n};\nconst DONE_LABEL = {\n id: 'tours.overview.tour.done',\n defaultMessage: 'Done',\n};\n\nconst TASK_CONTENT = [\n {\n tourName: 'contentTypeBuilder',\n link: {\n label: LINK_LABEL,\n to: '/plugins/content-type-builder',\n },\n title: {\n id: 'tours.overview.contentTypeBuilder.label',\n defaultMessage: 'Create your schema',\n },\n done: DONE_LABEL,\n },\n {\n tourName: 'contentManager',\n link: {\n label: LINK_LABEL,\n to: '/content-manager',\n },\n title: {\n id: 'tours.overview.contentManager.label',\n defaultMessage: 'Create and publish content',\n },\n done: DONE_LABEL,\n },\n {\n tourName: 'apiTokens',\n link: {\n label: LINK_LABEL,\n to: '/settings/api-tokens',\n },\n title: {\n id: 'tours.overview.apiTokens.label',\n defaultMessage: 'Create and copy an API token',\n },\n done: DONE_LABEL,\n },\n {\n tourName: 'strapiCloud',\n link: {\n label: {\n id: 'tours.overview.strapiCloud.link',\n defaultMessage: 'Read documentation',\n },\n to: 'https://docs.strapi.io/cloud/intro',\n },\n title: {\n id: 'tours.overview.strapiCloud.label',\n defaultMessage: 'Deploy your application to Strapi Cloud',\n },\n done: DONE_LABEL,\n isExternal: true,\n },\n];\n\n/* -------------------------------------------------------------------------------------------------\n * GuidedTourOverview\n * -----------------------------------------------------------------------------------------------*/\n\nconst WaveIcon = () => {\n const theme = useTheme();\n return (\n <svg width=\"26\" height=\"27\" viewBox=\"0 0 26 27\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M24.4138 9.30762C25.1565 10.5578 25.6441 11.9429 25.8481 13.3827C26.0522 14.8225 25.9687 16.2885 25.6026 17.6958C25.2365 19.1032 24.5949 20.4239 23.7151 21.5818C22.8352 22.7396 21.7345 23.7114 20.4766 24.4411C19.2188 25.1708 17.8287 25.6439 16.3868 25.8329C14.945 26.022 13.48 25.9232 12.0765 25.5424C10.673 25.1616 9.35903 24.5063 8.21045 23.6144C7.06188 22.7226 6.10154 21.6118 5.385 20.3464L0.268755 11.4851C0.0253867 11.0275 -0.0308559 10.4934 0.111878 9.99514C0.254612 9.49692 0.585176 9.07356 1.03392 8.81426C1.48266 8.55497 2.01453 8.47999 2.51746 8.60514C3.02039 8.73028 3.45511 9.04576 3.73001 9.48512L6.05 13.5001C6.11567 13.6139 6.20309 13.7136 6.30729 13.7936C6.41148 13.8735 6.53041 13.9322 6.65728 13.9662C6.78415 14.0002 6.91647 14.0089 7.04669 13.9918C7.17692 13.9746 7.3025 13.932 7.41625 13.8664C7.53001 13.8007 7.62972 13.7133 7.70969 13.6091C7.78966 13.5049 7.84833 13.386 7.88234 13.2591C7.91635 13.1322 7.92504 12.9999 7.90791 12.8697C7.89078 12.7395 7.84817 12.6139 7.78251 12.5001L2.87501 4.00012C2.63164 3.54255 2.57539 3.00837 2.71813 2.51014C2.86086 2.01192 3.19143 1.58856 3.64017 1.32926C4.08891 1.06997 4.62078 0.994994 5.12371 1.12014C5.62664 1.24528 6.06136 1.56077 6.33626 2.00012L11.25 10.5001C11.3137 10.6175 11.4003 10.7209 11.5046 10.8042C11.609 10.8876 11.7289 10.9492 11.8575 10.9854C11.986 11.0216 12.1205 11.0318 12.253 11.0152C12.3855 10.9986 12.5133 10.9556 12.629 10.8888C12.7446 10.8221 12.8457 10.7328 12.9263 10.6263C13.0068 10.5198 13.0653 10.3982 13.0981 10.2688C13.1309 10.1394 13.1375 10.0047 13.1174 9.87264C13.0974 9.74062 13.0511 9.61395 12.9813 9.50012L9.23125 3.00012C8.9738 2.54125 8.90753 1.99941 9.04682 1.49203C9.18612 0.984641 9.51974 0.552582 9.97539 0.289483C10.431 0.0263834 10.972 -0.0465606 11.4811 0.0864587C11.9902 0.219478 12.4263 0.547745 12.695 1.00012L17.75 9.76512C16.6322 10.8916 16.0035 12.4132 16 14.0001C15.9963 15.2989 16.4177 16.5633 17.2 17.6001C17.278 17.7074 17.3766 17.7981 17.49 17.867C17.6034 17.9358 17.7293 17.9814 17.8605 18.001C17.9917 18.0207 18.1255 18.0141 18.2541 17.9816C18.3827 17.9491 18.5035 17.8913 18.6096 17.8116C18.7156 17.7319 18.8048 17.6319 18.8718 17.5175C18.9388 17.403 18.9824 17.2763 19 17.1448C19.0176 17.0134 19.0089 16.8797 18.9743 16.7516C18.9398 16.6236 18.8801 16.5036 18.7988 16.3989C18.4824 15.9765 18.2528 15.4958 18.1231 14.9843C17.9934 14.4729 17.9661 13.9408 18.0429 13.4188C18.1197 12.8967 18.2991 12.3951 18.5706 11.9426C18.8421 11.4902 19.2005 11.096 19.625 10.7826C19.8224 10.6365 19.9592 10.4229 20.0092 10.1825C20.0592 9.94202 20.019 9.69157 19.8963 9.47887L18.4638 7.00012C18.2063 6.54125 18.14 5.99941 18.2793 5.49203C18.4186 4.98464 18.7522 4.55258 19.2079 4.28948C19.6635 4.02638 20.2045 3.95344 20.7136 4.08646C21.2227 4.21948 21.6588 4.54774 21.9275 5.00012L24.4138 9.30762ZM20.7425 2.18262C21.4432 2.36725 22.1001 2.68931 22.6752 3.13008C23.2503 3.57084 23.7321 4.12153 24.0925 4.75012L24.1338 4.82137C24.2664 5.05111 24.4848 5.21877 24.741 5.28745C24.8679 5.32146 25.0002 5.33015 25.1304 5.31302C25.2607 5.29589 25.3862 5.25328 25.5 5.18762C25.6138 5.12196 25.7135 5.03453 25.7934 4.93034C25.8734 4.82614 25.9321 4.70721 25.9661 4.58035C26.0001 4.45348 26.0088 4.32115 25.9917 4.19093C25.9745 4.0607 25.9319 3.93513 25.8663 3.82137L25.825 3.75012C25.3335 2.89321 24.6767 2.14252 23.8926 1.54167C23.1085 0.940821 22.2128 0.501801 21.2575 0.250119C21.002 0.184041 20.7307 0.221665 20.5028 0.354786C20.2749 0.487908 20.1088 0.705731 20.0409 0.960766C19.9729 1.2158 20.0085 1.48736 20.14 1.71625C20.2714 1.94513 20.488 2.11277 20.7425 2.18262ZM6.9475 25.2151C5.65171 24.1925 4.56342 22.9315 3.74126 21.5001C3.67559 21.3864 3.58817 21.2866 3.48397 21.2067C3.37978 21.1267 3.26085 21.068 3.13398 21.034C3.00711 21 2.87479 20.9913 2.74456 21.0085C2.61434 21.0256 2.48876 21.0682 2.37501 21.1339C2.26125 21.1995 2.16154 21.287 2.08157 21.3911C2.00159 21.4953 1.94293 21.6143 1.90892 21.7411C1.87491 21.868 1.86622 22.0003 1.88335 22.1306C1.90048 22.2608 1.94309 22.3864 2.00875 22.5001C2.95782 24.1511 4.21368 25.6056 5.70875 26.7851C5.91728 26.9455 6.18063 27.0173 6.44172 26.9849C6.70282 26.9525 6.94062 26.8185 7.10359 26.612C7.26655 26.4054 7.34156 26.143 7.31234 25.8815C7.28313 25.62 7.15204 25.3806 6.9475 25.2151Z\"\n fill={theme.colors.primary600}\n />\n </svg>\n );\n};\n\nexport const UnstableGuidedTourOverview = () => {\n const { formatMessage } = useIntl();\n const tours = unstableUseGuidedTour('Overview', (s) => s.state.tours);\n const dispatch = unstableUseGuidedTour('Overview', (s) => s.dispatch);\n const enabled = unstableUseGuidedTour('Overview', (s) => s.state.enabled);\n const tourNames = Object.keys(tours) as ValidTourName[];\n\n const completedTours = tourNames.filter((tourName) => tours[tourName].isCompleted);\n const completionPercentage =\n tourNames.length > 0 ? Math.round((completedTours.length / tourNames.length) * 100) : 0;\n\n if (!enabled) {\n return null;\n }\n\n return (\n <Container tag=\"section\" gap={0}>\n {/* Greeting */}\n <ContentSection direction=\"column\" gap={2} alignItems=\"start\">\n <WaveIcon />\n <Flex direction=\"column\" alignItems=\"start\" gap={1} paddingTop={4}>\n <Typography fontSize=\"20px\" fontWeight=\"bold\">\n {formatMessage({\n id: 'tours.overview.title',\n defaultMessage: 'Discover your application!',\n })}\n </Typography>\n <Typography>\n {formatMessage({\n id: 'tours.overview.subtitle',\n defaultMessage: 'Follow the guided tour to get the most out of Strapi.',\n })}\n </Typography>\n </Flex>\n <Flex\n direction=\"column\"\n alignItems=\"start\"\n width=\"100%\"\n paddingTop={5}\n paddingBottom={8}\n gap={2}\n >\n <Typography variant=\"pi\">{completionPercentage}%</Typography>\n <StyledProgressBar value={completionPercentage} />\n </Flex>\n <Button variant=\"tertiary\" onClick={() => dispatch({ type: 'skip_all_tours' })}>\n {formatMessage({\n id: 'tours.overview.close',\n defaultMessage: 'Close guided tour',\n })}\n </Button>\n </ContentSection>\n <VerticalSeparator />\n {/* Task List */}\n <ContentSection direction=\"column\" alignItems=\"start\">\n <Typography variant=\"omega\" fontWeight=\"bold\">\n {formatMessage({\n id: 'tours.overview.tasks',\n defaultMessage: 'Your tasks',\n })}\n </Typography>\n <Box width=\"100%\" borderColor=\"neutral150\" marginTop={4} hasRadius>\n {TASK_CONTENT.map((task) => {\n const tour = tours[task.tourName as ValidTourName];\n\n return (\n <TourTaskContainer\n key={task.tourName}\n alignItems=\"center\"\n justifyContent=\"space-between\"\n >\n {tour.isCompleted ? (\n <>\n <Flex gap={2}>\n <CheckCircle fill=\"success500\" />\n <Typography style={{ textDecoration: 'line-through' }} textColor=\"neutral500\">\n {formatMessage(task.title)}\n </Typography>\n </Flex>\n <Typography variant=\"omega\" textColor=\"neutral500\">\n {formatMessage(task.done)}\n </Typography>\n </>\n ) : (\n <>\n <Flex gap={2} alignItems=\"center\">\n <Flex height=\"16px\" width=\"16px\" justifyContent=\"center\">\n <TodoCircle />\n </Flex>\n <Typography>{formatMessage(task.title)}</Typography>\n </Flex>\n {task.isExternal ? (\n <Link\n isExternal\n href={task.link.to}\n onClick={() =>\n dispatch({ type: 'skip_tour', payload: task.tourName as ValidTourName })\n }\n >\n {formatMessage(task.link.label)}\n </Link>\n ) : (\n <Link endIcon={<ChevronRight />} to={task.link.to} tag={NavLink}>\n {formatMessage(task.link.label)}\n </Link>\n )}\n </>\n )}\n </TourTaskContainer>\n );\n })}\n </Box>\n </ContentSection>\n </Container>\n );\n};\n"],"names":["StyledProgressBar","styled","ProgressBar","theme","colors","neutral150","success500","Container","Flex","borderRadius","neutral0","shadows","tableShadow","ContentSection","spaces","VerticalSeparator","div","TourTaskContainer","TodoCircle","Box","neutral300","LINK_LABEL","id","defaultMessage","DONE_LABEL","TASK_CONTENT","tourName","link","label","to","title","done","isExternal","WaveIcon","useTheme","_jsx","svg","width","height","viewBox","fill","xmlns","path","d","primary600","UnstableGuidedTourOverview","formatMessage","useIntl","tours","unstableUseGuidedTour","s","state","dispatch","enabled","tourNames","Object","keys","completedTours","filter","isCompleted","completionPercentage","length","Math","round","_jsxs","tag","gap","direction","alignItems","paddingTop","Typography","fontSize","fontWeight","paddingBottom","variant","value","Button","onClick","type","borderColor","marginTop","hasRadius","map","task","tour","justifyContent","_Fragment","CheckCircle","style","textDecoration","textColor","Link","href","payload","endIcon","ChevronRight","NavLink"],"mappings":";;;;;;;;AAQA;;AAEkG,qGAElG,MAAMA,iBAAAA,GAAoBC,MAAOC,CAAAA,WAAAA,CAAY;;oBAEzB,EAAE,CAAC,EAAEC,KAAK,EAAE,GAAKA,KAAMC,CAAAA,MAAM,CAACC,UAAU,CAAC;;sBAEvC,EAAE,CAAC,EAAEF,KAAK,EAAE,GAAKA,KAAMC,CAAAA,MAAM,CAACE,UAAU,CAAC;;AAE/D,CAAC;AAED,MAAMC,SAAAA,GAAYN,MAAOO,CAAAA,IAAAA,CAAK;;AAEb,iBAAA,EAAE,CAAC,EAAEL,KAAK,EAAE,GAAKA,KAAAA,CAAMM,YAAY,CAAC;oBACjC,EAAE,CAAC,EAAEN,KAAK,EAAE,GAAKA,KAAMC,CAAAA,MAAM,CAACM,QAAQ,CAAC;cAC7C,EAAE,CAAC,EAAEP,KAAK,EAAE,GAAKA,KAAMQ,CAAAA,OAAO,CAACC,WAAW,CAAC;;AAEzD,CAAC;AAED,M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CAAAA,UAAU,iBACdG,GAACwD,CAAAA,IAAAA,EAAAA;4CACC3D,UAAU,EAAA,IAAA;4CACV4D,IAAMT,EAAAA,IAAAA,CAAKxD,IAAI,CAACE,EAAE;AAClBgD,4CAAAA,OAAAA,EAAS,IACPzB,QAAS,CAAA;oDAAE0B,IAAM,EAAA,WAAA;AAAae,oDAAAA,OAAAA,EAASV,KAAKzD;AAA0B,iDAAA,CAAA;sDAGvEoB,aAAcqC,CAAAA,IAAAA,CAAKxD,IAAI,CAACC,KAAK;2DAGhCO,GAACwD,CAAAA,IAAAA,EAAAA;AAAKG,4CAAAA,OAAAA,gBAAS3D,GAAC4D,CAAAA,YAAAA,EAAAA,EAAAA,CAAAA;4CAAiBlE,EAAIsD,EAAAA,IAAAA,CAAKxD,IAAI,CAACE,EAAE;4CAAEoC,GAAK+B,EAAAA,OAAAA;sDACrDlD,aAAcqC,CAAAA,IAAAA,CAAKxD,IAAI,CAACC,KAAK;;;;AApCjCuD,6BAAAA,EAAAA,IAAAA,CAAKzD,QAAQ,CAAA;AA2CxB,yBAAA;;;;;;AAKV;;;;"}
1
+ {"version":3,"file":"Overview.mjs","sources":["../../../../../../admin/src/components/UnstableGuidedTour/Overview.tsx"],"sourcesContent":["import { Box, Button, Dialog, Flex, Link, ProgressBar, Typography } from '@strapi/design-system';\nimport { CheckCircle, ChevronRight } from '@strapi/icons';\nimport { useIntl } from 'react-intl';\nimport { NavLink } from 'react-router-dom';\nimport { styled, useTheme } from 'styled-components';\n\nimport { useTracking } from '../../features/Tracking';\nimport { useGetGuidedTourMetaQuery } from '../../services/admin';\nimport { ConfirmDialog } from '../ConfirmDialog';\n\nimport { type ValidTourName, unstableUseGuidedTour } from './Context';\n\n/* -------------------------------------------------------------------------------------------------\n * Styled\n * -----------------------------------------------------------------------------------------------*/\n\nconst StyledProgressBar = styled(ProgressBar)`\n width: 100%;\n background-color: ${({ theme }) => theme.colors.neutral150};\n > div {\n background-color: ${({ theme }) => theme.colors.success500};\n }\n`;\n\nconst Container = styled(Flex)`\n width: 100%;\n border-radius: ${({ theme }) => theme.borderRadius};\n background-color: ${({ theme }) => theme.colors.neutral0};\n box-shadow: ${({ theme }) => theme.shadows.tableShadow};\n align-items: stretch;\n`;\n\nconst ContentSection = styled(Flex)`\n flex: 1;\n padding: ${({ theme }) => theme.spaces[8]};\n`;\n\nconst VerticalSeparator = styled.div`\n width: 1px;\n background-color: ${({ theme }) => theme.colors.neutral150};\n`;\n\nconst TourTaskContainer = styled(Flex)`\n &:not(:last-child) {\n border-bottom: ${({ theme }) => `1px solid ${theme.colors.neutral150}`};\n }\n padding: ${({ theme }) => theme.spaces[4]};\n`;\n\nconst TodoCircle = styled(Box)`\n border: 1px solid ${({ theme }) => theme.colors.neutral300};\n border-radius: 50%;\n height: 13px;\n width: 13px;\n`;\n\n/* -------------------------------------------------------------------------------------------------\n * Constants\n * -----------------------------------------------------------------------------------------------*/\n\nconst LINK_LABEL = {\n id: 'tours.overview.tour.link',\n defaultMessage: 'Start',\n};\nconst DONE_LABEL = {\n id: 'tours.overview.tour.done',\n defaultMessage: 'Done',\n};\n\nconst TASK_CONTENT = [\n {\n tourName: 'contentTypeBuilder',\n link: {\n label: LINK_LABEL,\n to: '/plugins/content-type-builder',\n },\n title: {\n id: 'tours.overview.contentTypeBuilder.label',\n defaultMessage: 'Create your schema',\n },\n done: DONE_LABEL,\n },\n {\n tourName: 'contentManager',\n link: {\n label: LINK_LABEL,\n to: '/content-manager',\n },\n title: {\n id: 'tours.overview.contentManager.label',\n defaultMessage: 'Create and publish content',\n },\n done: DONE_LABEL,\n },\n {\n tourName: 'apiTokens',\n link: {\n label: LINK_LABEL,\n to: '/settings/api-tokens',\n },\n title: {\n id: 'tours.overview.apiTokens.label',\n defaultMessage: 'Create and copy an API token',\n },\n done: DONE_LABEL,\n },\n {\n tourName: 'strapiCloud',\n link: {\n label: {\n id: 'tours.overview.strapiCloud.link',\n defaultMessage: 'Read documentation',\n },\n to: 'https://docs.strapi.io/cloud/intro',\n },\n title: {\n id: 'tours.overview.strapiCloud.label',\n defaultMessage: 'Deploy your application to Strapi Cloud',\n },\n done: DONE_LABEL,\n isExternal: true,\n },\n];\n\n/* -------------------------------------------------------------------------------------------------\n * GuidedTourOverview\n * -----------------------------------------------------------------------------------------------*/\n\nconst WaveIcon = () => {\n const theme = useTheme();\n return (\n <svg width=\"26\" height=\"27\" viewBox=\"0 0 26 27\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M24.4138 9.30762C25.1565 10.5578 25.6441 11.9429 25.8481 13.3827C26.0522 14.8225 25.9687 16.2885 25.6026 17.6958C25.2365 19.1032 24.5949 20.4239 23.7151 21.5818C22.8352 22.7396 21.7345 23.7114 20.4766 24.4411C19.2188 25.1708 17.8287 25.6439 16.3868 25.8329C14.945 26.022 13.48 25.9232 12.0765 25.5424C10.673 25.1616 9.35903 24.5063 8.21045 23.6144C7.06188 22.7226 6.10154 21.6118 5.385 20.3464L0.268755 11.4851C0.0253867 11.0275 -0.0308559 10.4934 0.111878 9.99514C0.254612 9.49692 0.585176 9.07356 1.03392 8.81426C1.48266 8.55497 2.01453 8.47999 2.51746 8.60514C3.02039 8.73028 3.45511 9.04576 3.73001 9.48512L6.05 13.5001C6.11567 13.6139 6.20309 13.7136 6.30729 13.7936C6.41148 13.8735 6.53041 13.9322 6.65728 13.9662C6.78415 14.0002 6.91647 14.0089 7.04669 13.9918C7.17692 13.9746 7.3025 13.932 7.41625 13.8664C7.53001 13.8007 7.62972 13.7133 7.70969 13.6091C7.78966 13.5049 7.84833 13.386 7.88234 13.2591C7.91635 13.1322 7.92504 12.9999 7.90791 12.8697C7.89078 12.7395 7.84817 12.6139 7.78251 12.5001L2.87501 4.00012C2.63164 3.54255 2.57539 3.00837 2.71813 2.51014C2.86086 2.01192 3.19143 1.58856 3.64017 1.32926C4.08891 1.06997 4.62078 0.994994 5.12371 1.12014C5.62664 1.24528 6.06136 1.56077 6.33626 2.00012L11.25 10.5001C11.3137 10.6175 11.4003 10.7209 11.5046 10.8042C11.609 10.8876 11.7289 10.9492 11.8575 10.9854C11.986 11.0216 12.1205 11.0318 12.253 11.0152C12.3855 10.9986 12.5133 10.9556 12.629 10.8888C12.7446 10.8221 12.8457 10.7328 12.9263 10.6263C13.0068 10.5198 13.0653 10.3982 13.0981 10.2688C13.1309 10.1394 13.1375 10.0047 13.1174 9.87264C13.0974 9.74062 13.0511 9.61395 12.9813 9.50012L9.23125 3.00012C8.9738 2.54125 8.90753 1.99941 9.04682 1.49203C9.18612 0.984641 9.51974 0.552582 9.97539 0.289483C10.431 0.0263834 10.972 -0.0465606 11.4811 0.0864587C11.9902 0.219478 12.4263 0.547745 12.695 1.00012L17.75 9.76512C16.6322 10.8916 16.0035 12.4132 16 14.0001C15.9963 15.2989 16.4177 16.5633 17.2 17.6001C17.278 17.7074 17.3766 17.7981 17.49 17.867C17.6034 17.9358 17.7293 17.9814 17.8605 18.001C17.9917 18.0207 18.1255 18.0141 18.2541 17.9816C18.3827 17.9491 18.5035 17.8913 18.6096 17.8116C18.7156 17.7319 18.8048 17.6319 18.8718 17.5175C18.9388 17.403 18.9824 17.2763 19 17.1448C19.0176 17.0134 19.0089 16.8797 18.9743 16.7516C18.9398 16.6236 18.8801 16.5036 18.7988 16.3989C18.4824 15.9765 18.2528 15.4958 18.1231 14.9843C17.9934 14.4729 17.9661 13.9408 18.0429 13.4188C18.1197 12.8967 18.2991 12.3951 18.5706 11.9426C18.8421 11.4902 19.2005 11.096 19.625 10.7826C19.8224 10.6365 19.9592 10.4229 20.0092 10.1825C20.0592 9.94202 20.019 9.69157 19.8963 9.47887L18.4638 7.00012C18.2063 6.54125 18.14 5.99941 18.2793 5.49203C18.4186 4.98464 18.7522 4.55258 19.2079 4.28948C19.6635 4.02638 20.2045 3.95344 20.7136 4.08646C21.2227 4.21948 21.6588 4.54774 21.9275 5.00012L24.4138 9.30762ZM20.7425 2.18262C21.4432 2.36725 22.1001 2.68931 22.6752 3.13008C23.2503 3.57084 23.7321 4.12153 24.0925 4.75012L24.1338 4.82137C24.2664 5.05111 24.4848 5.21877 24.741 5.28745C24.8679 5.32146 25.0002 5.33015 25.1304 5.31302C25.2607 5.29589 25.3862 5.25328 25.5 5.18762C25.6138 5.12196 25.7135 5.03453 25.7934 4.93034C25.8734 4.82614 25.9321 4.70721 25.9661 4.58035C26.0001 4.45348 26.0088 4.32115 25.9917 4.19093C25.9745 4.0607 25.9319 3.93513 25.8663 3.82137L25.825 3.75012C25.3335 2.89321 24.6767 2.14252 23.8926 1.54167C23.1085 0.940821 22.2128 0.501801 21.2575 0.250119C21.002 0.184041 20.7307 0.221665 20.5028 0.354786C20.2749 0.487908 20.1088 0.705731 20.0409 0.960766C19.9729 1.2158 20.0085 1.48736 20.14 1.71625C20.2714 1.94513 20.488 2.11277 20.7425 2.18262ZM6.9475 25.2151C5.65171 24.1925 4.56342 22.9315 3.74126 21.5001C3.67559 21.3864 3.58817 21.2866 3.48397 21.2067C3.37978 21.1267 3.26085 21.068 3.13398 21.034C3.00711 21 2.87479 20.9913 2.74456 21.0085C2.61434 21.0256 2.48876 21.0682 2.37501 21.1339C2.26125 21.1995 2.16154 21.287 2.08157 21.3911C2.00159 21.4953 1.94293 21.6143 1.90892 21.7411C1.87491 21.868 1.86622 22.0003 1.88335 22.1306C1.90048 22.2608 1.94309 22.3864 2.00875 22.5001C2.95782 24.1511 4.21368 25.6056 5.70875 26.7851C5.91728 26.9455 6.18063 27.0173 6.44172 26.9849C6.70282 26.9525 6.94062 26.8185 7.10359 26.612C7.26655 26.4054 7.34156 26.143 7.31234 25.8815C7.28313 25.62 7.15204 25.3806 6.9475 25.2151Z\"\n fill={theme.colors.primary600}\n />\n </svg>\n );\n};\n\nexport const UnstableGuidedTourOverview = () => {\n const { formatMessage } = useIntl();\n const { trackUsage } = useTracking();\n\n const tours = unstableUseGuidedTour('Overview', (s) => s.state.tours);\n const dispatch = unstableUseGuidedTour('Overview', (s) => s.dispatch);\n const enabled = unstableUseGuidedTour('Overview', (s) => s.state.enabled);\n const completedActions = unstableUseGuidedTour('Overview', (s) => s.state.completedActions);\n const { data: guidedTourMeta } = useGetGuidedTourMetaQuery();\n\n const tourNames = Object.keys(tours) as ValidTourName[];\n const completedTours = tourNames.filter((tourName) => tours[tourName].isCompleted);\n const completionPercentage =\n tourNames.length > 0 ? Math.round((completedTours.length / tourNames.length) * 100) : 0;\n\n if (!guidedTourMeta?.data.isFirstSuperAdminUser || !enabled) {\n return null;\n }\n\n const handleConfirmDialog = () => {\n trackUsage('didSkipGuidedTour', { name: 'all' });\n dispatch({ type: 'skip_all_tours' });\n };\n\n const handleClickStrapiCloud = (tourName: ValidTourName) => {\n trackUsage('didCompleteGuidedTour', { name: tourName });\n dispatch({ type: 'skip_tour', payload: tourName });\n };\n\n return (\n <Container tag=\"section\" gap={0}>\n {/* Greeting */}\n <ContentSection direction=\"column\" gap={2} alignItems=\"start\">\n <WaveIcon />\n <Flex direction=\"column\" alignItems=\"start\" gap={1} paddingTop={4}>\n <Typography fontSize=\"20px\" fontWeight=\"bold\">\n {formatMessage({\n id: 'tours.overview.title',\n defaultMessage: 'Discover your application!',\n })}\n </Typography>\n <Typography>\n {formatMessage({\n id: 'tours.overview.subtitle',\n defaultMessage: 'Follow the guided tour to get the most out of Strapi.',\n })}\n </Typography>\n </Flex>\n <Flex\n direction=\"column\"\n alignItems=\"flex-start\"\n width=\"100%\"\n paddingTop={5}\n paddingBottom={8}\n gap={2}\n >\n <Typography variant=\"pi\">{completionPercentage}%</Typography>\n <StyledProgressBar value={completionPercentage} />\n </Flex>\n <Dialog.Root>\n <Dialog.Trigger>\n <Button variant=\"tertiary\">\n {formatMessage({\n id: 'tours.overview.close',\n defaultMessage: 'Close guided tour',\n })}\n </Button>\n </Dialog.Trigger>\n <ConfirmDialog onConfirm={handleConfirmDialog}>\n {formatMessage({\n id: 'tours.overview.close.description',\n defaultMessage: 'Are you sure you want to close the guided tour?',\n })}\n </ConfirmDialog>\n </Dialog.Root>\n </ContentSection>\n <VerticalSeparator />\n {/* Task List */}\n <ContentSection direction=\"column\" alignItems=\"start\">\n <Typography variant=\"omega\" fontWeight=\"bold\">\n {formatMessage({\n id: 'tours.overview.tasks',\n defaultMessage: 'Your tasks',\n })}\n </Typography>\n <Box width=\"100%\" borderColor=\"neutral150\" marginTop={4} hasRadius>\n {TASK_CONTENT.map((task) => {\n const tourName = task.tourName as ValidTourName;\n const tour = tours[tourName];\n const isLinkDisabled =\n tourName !== 'contentTypeBuilder' &&\n !completedActions.includes('didCreateContentTypeSchema');\n\n return (\n <TourTaskContainer key={tourName} alignItems=\"center\" justifyContent=\"space-between\">\n {tour.isCompleted ? (\n <>\n <Flex gap={2}>\n <CheckCircle fill=\"success500\" />\n <Typography style={{ textDecoration: 'line-through' }} textColor=\"neutral500\">\n {formatMessage(task.title)}\n </Typography>\n </Flex>\n <Typography variant=\"omega\" textColor=\"neutral500\">\n {formatMessage(task.done)}\n </Typography>\n </>\n ) : (\n <>\n <Flex gap={2} alignItems=\"center\">\n <Flex height=\"16px\" width=\"16px\" justifyContent=\"center\">\n <TodoCircle />\n </Flex>\n <Typography>{formatMessage(task.title)}</Typography>\n </Flex>\n {task.isExternal ? (\n <Link\n isExternal\n disabled={isLinkDisabled}\n href={task.link.to}\n onClick={() => handleClickStrapiCloud(task.tourName as ValidTourName)}\n >\n {formatMessage(task.link.label)}\n </Link>\n ) : (\n <Link\n endIcon={<ChevronRight />}\n disabled={isLinkDisabled}\n to={task.link.to}\n tag={NavLink}\n onClick={() =>\n trackUsage('didStartGuidedTourFromHomepage', { name: tourName })\n }\n >\n {formatMessage(task.link.label)}\n </Link>\n )}\n </>\n )}\n </TourTaskContainer>\n );\n })}\n </Box>\n </ContentSection>\n </Container>\n );\n};\n"],"names":["StyledProgressBar","styled","ProgressBar","theme","colors","neutral150","success500","Container","Flex","borderRadius","neutral0","shadows","tableShadow","ContentSection","spaces","VerticalSeparator","div","TourTaskContainer","TodoCircle","Box","neutral300","LINK_LABEL","id","defaultMessage","DONE_LABEL","TASK_CONTENT","tourName","link","label","to","title","done","isExternal","WaveIcon","useTheme","_jsx","svg","width","height","viewBox","fill","xmlns","path","d","primary600","UnstableGuidedTourOverview","formatMessage","useIntl","trackUsage","useTracking","tours","unstableUseGuidedTour","s","state","dispatch","enabled","completedActions","data","guidedTourMeta","useGetGuidedTourMetaQuery","tourNames","Object","keys","completedTours","filter","isCompleted","completionPercentage","length","Math","round","isFirstSuperAdminUser","handleConfirmDialog","name","type","handleClickStrapiCloud","payload","_jsxs","tag","gap","direction","alignItems","paddingTop","Typography","fontSize","fontWeight","paddingBottom","variant","value","Dialog","Root","Trigger","Button","ConfirmDialog","onConfirm","borderColor","marginTop","hasRadius","map","task","tour","isLinkDisabled","includes","justifyContent","_Fragment","CheckCircle","style","textDecoration","textColor","Link","disabled","href","onClick","endIcon","ChevronRight","NavLink"],"mappings":";;;;;;;;;;;AAYA;;AAEkG,qGAElG,MAAMA,iBAAAA,GAAoBC,MAAOC,CAAAA,WAAAA,CAAY;;oBAEzB,EAAE,CAAC,EAAEC,KAAK,EAAE,GAAKA,KAAMC,CAAAA,MAAM,CAACC,UAAU,CAAC;;sBAEvC,EAAE,CAAC,EAAEF,KAAK,EAAE,GAAKA,KAAMC,CAAAA,MAAM,CAACE,UAAU,CAAC;;AAE/D,CAAC;AAED,MAAMC,SAAAA,GAAYN,MAAOO,CAAAA,IAAAA,CAAK;;AAEb,iBAAA,EAAE,CAAC,EAAEL,KAAK,EAAE,GAAKA,KAAAA,CAAMM,YAAY,CAAC;oBACjC,EAAE,CAAC,EAAEN,KAAK,EAAE,GAAKA,KAAMC,CAAAA,MAAM,CAACM,QAAQ,CAAC;cAC7C,EAAE,CAAC,EAAEP,KAAK,EAAE,GAAKA,KAAMQ,CAAAA,OAAO,CAACC,WAAW,CAAC;;AAEzD,CAAC;AAED,MAAMC,cAAAA,GAAiBZ,MAAOO,CAAAA,IAAAA,CAAK;;WAExB,EAAE,CAAC,EAAEL,KAAK,EAA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AA,CAAKvE,IAAI,CAACC,KAAK;2DAGhCO,GAACyE,CAAAA,IAAAA,EAAAA;AACCI,4CAAAA,OAAAA,gBAAS7E,GAAC8E,CAAAA,YAAAA,EAAAA,EAAAA,CAAAA;4CACVJ,QAAUT,EAAAA,cAAAA;4CACVvE,EAAIqE,EAAAA,IAAAA,CAAKvE,IAAI,CAACE,EAAE;4CAChBgD,GAAKqC,EAAAA,OAAAA;4CACLH,OAAS,EAAA,IACP/D,WAAW,gCAAkC,EAAA;oDAAEwB,IAAM9C,EAAAA;AAAS,iDAAA,CAAA;sDAG/DoB,aAAcoD,CAAAA,IAAAA,CAAKvE,IAAI,CAACC,KAAK;;;;AAxChBF,6BAAAA,EAAAA,QAAAA,CAAAA;AA+C5B,yBAAA;;;;;;AAKV;;;;"}
@@ -6,6 +6,7 @@ var designSystem = require('@strapi/design-system');
6
6
  var reactIntl = require('react-intl');
7
7
  var reactRouterDom = require('react-router-dom');
8
8
  var styled = require('styled-components');
9
+ var Tracking = require('../../features/Tracking.js');
9
10
  var Context = require('./Context.js');
10
11
 
11
12
  function _interopNamespaceDefault(e) {
@@ -30,8 +31,34 @@ var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
30
31
  const ActionsContainer = styled.styled(designSystem.Flex)`
31
32
  border-top: ${({ theme })=>`1px solid ${theme.colors.neutral150}`};
32
33
  `;
34
+ /**
35
+ * TODO:
36
+ * We should probably move all arrow styles + svg to the DS
37
+ */ const PopoverArrow = styled.styled(designSystem.Popover.Arrow)`
38
+ fill: ${({ theme })=>theme.colors.neutral0};
39
+ transform: translateY(-16px) rotate(-90deg);
40
+ `;
41
+ const StepCount = ({ tourName })=>{
42
+ const state = Context.unstableUseGuidedTour('GuidedTourPopover', (s)=>s.state);
43
+ const currentStep = state.tours[tourName].currentStep + 1;
44
+ // TODO: Currently all tours do not count their last step, but we should find a way to make this more smart
45
+ const displayedLength = state.tours[tourName].length - 1;
46
+ return /*#__PURE__*/ jsxRuntime.jsx(designSystem.Typography, {
47
+ variant: "omega",
48
+ fontSize: "12px",
49
+ children: /*#__PURE__*/ jsxRuntime.jsx(reactIntl.FormattedMessage, {
50
+ id: "tours.stepCount",
51
+ defaultMessage: "Step {currentStep} of {tourLength}",
52
+ values: {
53
+ currentStep,
54
+ tourLength: displayedLength
55
+ }
56
+ })
57
+ });
58
+ };
33
59
  const createStepComponents = (tourName)=>({
34
- Root: /*#__PURE__*/ React__namespace.forwardRef((props, ref)=>/*#__PURE__*/ jsxRuntime.jsx(designSystem.Popover.Content, {
60
+ Root: /*#__PURE__*/ React__namespace.forwardRef(({ withArrow = true, ...props }, ref)=>{
61
+ return /*#__PURE__*/ jsxRuntime.jsxs(designSystem.Popover.Content, {
35
62
  ref: ref,
36
63
  side: "top",
37
64
  align: "center",
@@ -39,13 +66,29 @@ const createStepComponents = (tourName)=>({
39
66
  border: 'none'
40
67
  },
41
68
  ...props,
42
- children: /*#__PURE__*/ jsxRuntime.jsx(designSystem.Flex, {
43
- width: "360px",
44
- direction: "column",
45
- alignItems: "start",
46
- children: props.children
47
- })
48
- })),
69
+ children: [
70
+ withArrow && /*#__PURE__*/ jsxRuntime.jsx(PopoverArrow, {
71
+ asChild: true,
72
+ children: /*#__PURE__*/ jsxRuntime.jsx("svg", {
73
+ xmlns: "http://www.w3.org/2000/svg",
74
+ width: "23",
75
+ height: "25",
76
+ viewBox: "0 0 23 25",
77
+ fill: "none",
78
+ children: /*#__PURE__*/ jsxRuntime.jsx("path", {
79
+ d: "M11 24.5L1.82843 15.3284C0.266332 13.7663 0.26633 11.2337 1.82843 9.67157L11 0.5L23 12.5L11 24.5Z"
80
+ })
81
+ })
82
+ }),
83
+ /*#__PURE__*/ jsxRuntime.jsx(designSystem.Flex, {
84
+ width: "360px",
85
+ direction: "column",
86
+ alignItems: "start",
87
+ children: props.children
88
+ })
89
+ ]
90
+ });
91
+ }),
49
92
  Title: (props)=>{
50
93
  return /*#__PURE__*/ jsxRuntime.jsx(designSystem.Box, {
51
94
  paddingTop: 5,
@@ -80,41 +123,49 @@ const createStepComponents = (tourName)=>({
80
123
  })
81
124
  })
82
125
  }),
83
- Actions: ({ showStepCount = true, showSkip = false, to, ...props })=>{
126
+ Actions: ({ showStepCount = true, showSkip = false, to, children, ...flexProps })=>{
127
+ const { trackUsage } = Tracking.useTracking();
84
128
  const dispatch = Context.unstableUseGuidedTour('GuidedTourPopover', (s)=>s.dispatch);
85
129
  const state = Context.unstableUseGuidedTour('GuidedTourPopover', (s)=>s.state);
86
130
  const currentStep = state.tours[tourName].currentStep + 1;
87
- // TODO: Currently all tours do not count their last step, but we should find a way to make this more smart
88
- const displayedLength = state.tours[tourName].length - 1;
131
+ const actualTourLength = state.tours[tourName].length;
132
+ const handleSkipAction = ()=>{
133
+ trackUsage('didSkipGuidedTour', {
134
+ name: tourName
135
+ });
136
+ dispatch({
137
+ type: 'skip_tour',
138
+ payload: tourName
139
+ });
140
+ };
141
+ const handleNextStep = ()=>{
142
+ if (currentStep === actualTourLength) {
143
+ trackUsage('didCompleteGuidedTour', {
144
+ name: tourName
145
+ });
146
+ }
147
+ dispatch({
148
+ type: 'next_step',
149
+ payload: tourName
150
+ });
151
+ };
89
152
  return /*#__PURE__*/ jsxRuntime.jsx(ActionsContainer, {
90
153
  width: "100%",
91
154
  padding: 3,
92
155
  paddingLeft: 5,
93
- children: 'children' in props ? props.children : /*#__PURE__*/ jsxRuntime.jsxs(designSystem.Flex, {
94
- flex: 1,
95
- justifyContent: showStepCount ? 'space-between' : 'flex-end',
156
+ justifyContent: showStepCount ? 'space-between' : 'flex-end',
157
+ ...flexProps,
158
+ children: children ? children : /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
96
159
  children: [
97
- showStepCount && /*#__PURE__*/ jsxRuntime.jsx(designSystem.Typography, {
98
- variant: "omega",
99
- fontSize: "12px",
100
- children: /*#__PURE__*/ jsxRuntime.jsx(reactIntl.FormattedMessage, {
101
- id: "tours.stepCount",
102
- defaultMessage: "Step {currentStep} of {tourLength}",
103
- values: {
104
- currentStep,
105
- tourLength: displayedLength
106
- }
107
- })
160
+ showStepCount && /*#__PURE__*/ jsxRuntime.jsx(StepCount, {
161
+ tourName: tourName
108
162
  }),
109
163
  /*#__PURE__*/ jsxRuntime.jsxs(designSystem.Flex, {
110
164
  gap: 2,
111
165
  children: [
112
166
  showSkip && /*#__PURE__*/ jsxRuntime.jsx(designSystem.Button, {
113
167
  variant: "tertiary",
114
- onClick: ()=>dispatch({
115
- type: 'skip_tour',
116
- payload: tourName
117
- }),
168
+ onClick: handleSkipAction,
118
169
  children: /*#__PURE__*/ jsxRuntime.jsx(reactIntl.FormattedMessage, {
119
170
  id: "tours.skip",
120
171
  defaultMessage: "Skip"
@@ -123,19 +174,13 @@ const createStepComponents = (tourName)=>({
123
174
  to ? /*#__PURE__*/ jsxRuntime.jsx(designSystem.LinkButton, {
124
175
  tag: reactRouterDom.NavLink,
125
176
  to: to,
126
- onClick: ()=>dispatch({
127
- type: 'next_step',
128
- payload: tourName
129
- }),
177
+ onClick: handleNextStep,
130
178
  children: /*#__PURE__*/ jsxRuntime.jsx(reactIntl.FormattedMessage, {
131
179
  id: "tours.next",
132
180
  defaultMessage: "Next"
133
181
  })
134
182
  }) : /*#__PURE__*/ jsxRuntime.jsx(designSystem.Button, {
135
- onClick: ()=>dispatch({
136
- type: 'next_step',
137
- payload: tourName
138
- }),
183
+ onClick: handleNextStep,
139
184
  children: /*#__PURE__*/ jsxRuntime.jsx(reactIntl.FormattedMessage, {
140
185
  id: "tours.next",
141
186
  defaultMessage: "Next"
@@ -149,5 +194,6 @@ const createStepComponents = (tourName)=>({
149
194
  }
150
195
  });
151
196
 
197
+ exports.StepCount = StepCount;
152
198
  exports.createStepComponents = createStepComponents;
153
199
  //# sourceMappingURL=Step.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Step.js","sources":["../../../../../../admin/src/components/UnstableGuidedTour/Step.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { Popover, Box, Flex, Button, Typography, LinkButton } from '@strapi/design-system';\nimport { FormattedMessage, type MessageDescriptor } from 'react-intl';\nimport { NavLink } from 'react-router-dom';\nimport { styled } from 'styled-components';\n\nimport { unstableUseGuidedTour, ValidTourName } from './Context';\n\n/* -------------------------------------------------------------------------------------------------\n * Step factory\n * -----------------------------------------------------------------------------------------------*/\n\ntype WithChildren = {\n children: React.ReactNode;\n id?: never;\n defaultMessage?: never;\n};\n\ntype WithIntl = {\n children?: undefined;\n id: MessageDescriptor['id'];\n defaultMessage: MessageDescriptor['defaultMessage'];\n};\n\ntype WithActionsChildren = {\n children: React.ReactNode;\n showStepCount?: boolean;\n showSkip?: boolean;\n};\n\ntype WithActionsProps = {\n children?: undefined;\n showStepCount?: boolean;\n showSkip?: boolean;\n};\n\ntype StepProps = WithChildren | WithIntl;\ntype ActionsProps = WithActionsChildren | WithActionsProps;\n\ntype Step = {\n Root: React.ForwardRefExoticComponent<React.ComponentProps<typeof Popover.Content>>;\n Title: (props: StepProps) => React.ReactNode;\n Content: (props: StepProps) => React.ReactNode;\n Actions: (props: ActionsProps & { to?: string }) => React.ReactNode;\n};\n\nconst ActionsContainer = styled(Flex)`\n border-top: ${({ theme }) => `1px solid ${theme.colors.neutral150}`};\n`;\n\nconst createStepComponents = (tourName: ValidTourName): Step => ({\n Root: React.forwardRef((props, ref) => (\n <Popover.Content ref={ref} side=\"top\" align=\"center\" style={{ border: 'none' }} {...props}>\n <Flex width=\"360px\" direction=\"column\" alignItems=\"start\">\n {props.children}\n </Flex>\n </Popover.Content>\n )),\n\n Title: (props) => {\n return (\n <Box paddingTop={5} paddingLeft={5} paddingRight={5} paddingBottom={1} width=\"100%\">\n {'children' in props ? (\n props.children\n ) : (\n <Typography tag=\"div\" variant=\"omega\" fontWeight=\"bold\">\n <FormattedMessage tagName=\"h1\" id={props.id} defaultMessage={props.defaultMessage} />\n </Typography>\n )}\n </Box>\n );\n },\n\n Content: (props) => (\n <Box paddingBottom={5} paddingLeft={5} paddingRight={5} width=\"100%\">\n {'children' in props ? (\n props.children\n ) : (\n <Typography tag=\"div\" variant=\"omega\">\n <FormattedMessage tagName=\"p\" id={props.id} defaultMessage={props.defaultMessage} />\n </Typography>\n )}\n </Box>\n ),\n\n Actions: ({ showStepCount = true, showSkip = false, to, ...props }) => {\n const dispatch = unstableUseGuidedTour('GuidedTourPopover', (s) => s.dispatch);\n const state = unstableUseGuidedTour('GuidedTourPopover', (s) => s.state);\n const currentStep = state.tours[tourName].currentStep + 1;\n // TODO: Currently all tours do not count their last step, but we should find a way to make this more smart\n const displayedLength = state.tours[tourName].length - 1;\n\n return (\n <ActionsContainer width=\"100%\" padding={3} paddingLeft={5}>\n {'children' in props ? (\n props.children\n ) : (\n <Flex flex={1} justifyContent={showStepCount ? 'space-between' : 'flex-end'}>\n {showStepCount && (\n <Typography variant=\"omega\" fontSize=\"12px\">\n <FormattedMessage\n id=\"tours.stepCount\"\n defaultMessage=\"Step {currentStep} of {tourLength}\"\n values={{ currentStep, tourLength: displayedLength }}\n />\n </Typography>\n )}\n <Flex gap={2}>\n {showSkip && (\n <Button\n variant=\"tertiary\"\n onClick={() => dispatch({ type: 'skip_tour', payload: tourName })}\n >\n <FormattedMessage id=\"tours.skip\" defaultMessage=\"Skip\" />\n </Button>\n )}\n {to ? (\n <LinkButton\n tag={NavLink}\n to={to}\n onClick={() => dispatch({ type: 'next_step', payload: tourName })}\n >\n <FormattedMessage id=\"tours.next\" defaultMessage=\"Next\" />\n </LinkButton>\n ) : (\n <Button onClick={() => dispatch({ type: 'next_step', payload: tourName })}>\n <FormattedMessage id=\"tours.next\" defaultMessage=\"Next\" />\n </Button>\n )}\n </Flex>\n </Flex>\n )}\n </ActionsContainer>\n );\n },\n});\n\nexport type { Step };\nexport { createStepComponents };\n"],"names":["ActionsContainer","styled","Flex","theme","colors","neutral150","createStepComponents","tourName","Root","React","forwardRef","props","ref","_jsx","Popover","Content","side","align","style","border","width","direction","alignItems","children","Title","Box","paddingTop","paddingLeft","paddingRight","paddingBottom","Typography","tag","variant","fontWeight","FormattedMessage","tagName","id","defaultMessage","Actions","showStepCount","showSkip","to","dispatch","unstableUseGuidedTour","s","state","currentStep","tours","displayedLength","length","padding","_jsxs","flex","justifyContent","fontSize","values","tourLength","gap","Button","onClick","type","payload","LinkButton","NavLink"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+CA,MAAMA,gBAAAA,GAAmBC,aAAOC,CAAAA,iBAAAA,CAAK;AACvB,cAAA,EAAE,CAAC,EAAEC,KAAK,EAAE,GAAK,CAAC,UAAU,EAAEA,KAAAA,CAAMC,MAAM,CAACC,UAAU,CAAC,CAAC,CAAC;AACtE,CAAC;AAEKC,MAAAA,oBAAAA,GAAuB,CAACC,QAAAA,IAAmC;QAC/DC,IAAMC,gBAAAA,gBAAAA,CAAMC,UAAU,CAAC,CAACC,OAAOC,GAC7B,iBAAAC,cAAA,CAACC,qBAAQC,OAAO,EAAA;gBAACH,GAAKA,EAAAA,GAAAA;gBAAKI,IAAK,EAAA,KAAA;gBAAMC,KAAM,EAAA,QAAA;gBAASC,KAAO,EAAA;oBAAEC,MAAQ,EAAA;AAAO,iBAAA;AAAI,gBAAA,GAAGR,KAAK;AACvF,gBAAA,QAAA,gBAAAE,cAACX,CAAAA,iBAAAA,EAAAA;oBAAKkB,KAAM,EAAA,OAAA;oBAAQC,SAAU,EAAA,QAAA;oBAASC,UAAW,EAAA,OAAA;AAC/CX,oBAAAA,QAAAA,EAAAA,KAAAA,CAAMY;;;AAKbC,QAAAA,KAAAA,EAAO,CAACb,KAAAA,GAAAA;AACN,YAAA,qBACEE,cAACY,CAAAA,gBAAAA,EAAAA;gBAAIC,UAAY,EAAA,CAAA;gBAAGC,WAAa,EAAA,CAAA;gBAAGC,YAAc,EAAA,CAAA;gBAAGC,aAAe,EAAA,CAAA;gBAAGT,KAAM,EAAA,MAAA;AAC1E,gBAAA,QAAA,EAAA,UAAA,IAAcT,KACbA,GAAAA,KAAAA,CAAMY,QAAQ,iBAEd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AAA,EAAAA;AACJkB,oCAAAA,OAAAA,EAAS,IAAMjB,QAAS,CAAA;4CAAEkB,IAAM,EAAA,WAAA;4CAAaC,OAAStD,EAAAA;AAAS,yCAAA,CAAA;AAE/D,oCAAA,QAAA,gBAAAM,cAACqB,CAAAA,0BAAAA,EAAAA;wCAAiBE,EAAG,EAAA,YAAA;wCAAaC,cAAe,EAAA;;mDAGnDxB,cAAC6C,CAAAA,mBAAAA,EAAAA;AAAOC,oCAAAA,OAAAA,EAAS,IAAMjB,QAAS,CAAA;4CAAEkB,IAAM,EAAA,WAAA;4CAAaC,OAAStD,EAAAA;AAAS,yCAAA,CAAA;AACrE,oCAAA,QAAA,gBAAAM,cAACqB,CAAAA,0BAAAA,EAAAA;wCAAiBE,EAAG,EAAA,YAAA;wCAAaC,cAAe,EAAA;;;;;;;;AAQjE;KACF;;;;"}
1
+ {"version":3,"file":"Step.js","sources":["../../../../../../admin/src/components/UnstableGuidedTour/Step.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport {\n Popover,\n Box,\n Flex,\n Button,\n Typography,\n LinkButton,\n FlexProps,\n} from '@strapi/design-system';\nimport { FormattedMessage, type MessageDescriptor } from 'react-intl';\nimport { NavLink } from 'react-router-dom';\nimport { styled } from 'styled-components';\n\nimport { type EventWithoutProperties, useTracking } from '../../features/Tracking';\n\nimport { unstableUseGuidedTour, ValidTourName } from './Context';\n\n/* -------------------------------------------------------------------------------------------------\n * Step factory\n * -----------------------------------------------------------------------------------------------*/\n\ntype WithChildren = {\n children: React.ReactNode;\n id?: never;\n defaultMessage?: never;\n};\n\ntype WithIntl = {\n children?: undefined;\n id: MessageDescriptor['id'];\n defaultMessage: MessageDescriptor['defaultMessage'];\n withArrow?: boolean;\n};\n\ntype WithActionsChildren = {\n children: React.ReactNode;\n showStepCount?: boolean;\n showSkip?: boolean;\n};\n\ntype WithActionsProps = {\n children?: undefined;\n showStepCount?: boolean;\n showSkip?: boolean;\n};\n\ntype StepProps = WithChildren | WithIntl;\ntype ActionsProps = WithActionsChildren | WithActionsProps;\n\ntype Step = {\n Root: React.ForwardRefExoticComponent<\n React.ComponentProps<typeof Popover.Content> & { withArrow?: boolean }\n >;\n Title: (props: StepProps) => React.ReactNode;\n Content: (props: StepProps) => React.ReactNode;\n Actions: (props: ActionsProps & { to?: string } & FlexProps) => React.ReactNode;\n};\n\nconst ActionsContainer = styled(Flex)`\n border-top: ${({ theme }) => `1px solid ${theme.colors.neutral150}`};\n`;\n\n/**\n * TODO:\n * We should probably move all arrow styles + svg to the DS\n */\nconst PopoverArrow = styled(Popover.Arrow)`\n fill: ${({ theme }) => theme.colors.neutral0};\n transform: translateY(-16px) rotate(-90deg);\n`;\n\nexport const StepCount = ({ tourName }: { tourName: ValidTourName }) => {\n const state = unstableUseGuidedTour('GuidedTourPopover', (s) => s.state);\n const currentStep = state.tours[tourName].currentStep + 1;\n // TODO: Currently all tours do not count their last step, but we should find a way to make this more smart\n const displayedLength = state.tours[tourName].length - 1;\n\n return (\n <Typography variant=\"omega\" fontSize=\"12px\">\n <FormattedMessage\n id=\"tours.stepCount\"\n defaultMessage=\"Step {currentStep} of {tourLength}\"\n values={{ currentStep, tourLength: displayedLength }}\n />\n </Typography>\n );\n};\n\nconst createStepComponents = (tourName: ValidTourName): Step => ({\n Root: React.forwardRef(({ withArrow = true, ...props }, ref) => {\n return (\n <Popover.Content ref={ref} side=\"top\" align=\"center\" style={{ border: 'none' }} {...props}>\n {withArrow && (\n <PopoverArrow asChild>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"23\"\n height=\"25\"\n viewBox=\"0 0 23 25\"\n fill=\"none\"\n >\n <path d=\"M11 24.5L1.82843 15.3284C0.266332 13.7663 0.26633 11.2337 1.82843 9.67157L11 0.5L23 12.5L11 24.5Z\" />\n </svg>\n </PopoverArrow>\n )}\n <Flex width=\"360px\" direction=\"column\" alignItems=\"start\">\n {props.children}\n </Flex>\n </Popover.Content>\n );\n }),\n\n Title: (props) => {\n return (\n <Box paddingTop={5} paddingLeft={5} paddingRight={5} paddingBottom={1} width=\"100%\">\n {'children' in props ? (\n props.children\n ) : (\n <Typography tag=\"div\" variant=\"omega\" fontWeight=\"bold\">\n <FormattedMessage tagName=\"h1\" id={props.id} defaultMessage={props.defaultMessage} />\n </Typography>\n )}\n </Box>\n );\n },\n\n Content: (props) => (\n <Box paddingBottom={5} paddingLeft={5} paddingRight={5} width=\"100%\">\n {'children' in props ? (\n props.children\n ) : (\n <Typography tag=\"div\" variant=\"omega\">\n <FormattedMessage tagName=\"p\" id={props.id} defaultMessage={props.defaultMessage} />\n </Typography>\n )}\n </Box>\n ),\n\n Actions: ({ showStepCount = true, showSkip = false, to, children, ...flexProps }) => {\n const { trackUsage } = useTracking();\n const dispatch = unstableUseGuidedTour('GuidedTourPopover', (s) => s.dispatch);\n const state = unstableUseGuidedTour('GuidedTourPopover', (s) => s.state);\n const currentStep = state.tours[tourName].currentStep + 1;\n const actualTourLength = state.tours[tourName].length;\n\n const handleSkipAction = () => {\n trackUsage('didSkipGuidedTour', { name: tourName });\n dispatch({ type: 'skip_tour', payload: tourName });\n };\n\n const handleNextStep = () => {\n if (currentStep === actualTourLength) {\n trackUsage('didCompleteGuidedTour', { name: tourName });\n }\n dispatch({ type: 'next_step', payload: tourName });\n };\n\n return (\n <ActionsContainer\n width=\"100%\"\n padding={3}\n paddingLeft={5}\n justifyContent={showStepCount ? 'space-between' : 'flex-end'}\n {...flexProps}\n >\n {children ? (\n children\n ) : (\n <>\n {showStepCount && <StepCount tourName={tourName} />}\n <Flex gap={2}>\n {showSkip && (\n <Button variant=\"tertiary\" onClick={handleSkipAction}>\n <FormattedMessage id=\"tours.skip\" defaultMessage=\"Skip\" />\n </Button>\n )}\n {to ? (\n <LinkButton tag={NavLink} to={to} onClick={handleNextStep}>\n <FormattedMessage id=\"tours.next\" defaultMessage=\"Next\" />\n </LinkButton>\n ) : (\n <Button onClick={handleNextStep}>\n <FormattedMessage id=\"tours.next\" defaultMessage=\"Next\" />\n </Button>\n )}\n </Flex>\n </>\n )}\n </ActionsContainer>\n );\n },\n});\n\nexport type { Step };\nexport { createStepComponents };\n"],"names":["ActionsContainer","styled","Flex","theme","colors","neutral150","PopoverArrow","Popover","Arrow","neutral0","StepCount","tourName","state","unstableUseGuidedTour","s","currentStep","tours","displayedLength","length","_jsx","Typography","variant","fontSize","FormattedMessage","id","defaultMessage","values","tourLength","createStepComponents","Root","React","forwardRef","withArrow","props","ref","_jsxs","Content","side","align","style","border","asChild","svg","xmlns","width","height","viewBox","fill","path","d","direction","alignItems","children","Title","Box","paddingTop","paddingLeft","paddingRight","paddingBottom","tag","fontWeight","tagName","Actions","showStepCount","showSkip","to","flexProps","trackUsage","useTracking","dispatch","actualTourLength","handleSkipAction","name","type","payload","handleNextStep","padding","justifyContent","_Fragment","gap","Button","onClick","LinkButton","NavLink"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4DA,MAAMA,gBAAAA,GAAmBC,aAAOC,CAAAA,iBAAAA,CAAK;AACvB,cAAA,EAAE,CAAC,EAAEC,KAAK,EAAE,GAAK,CAAC,UAAU,EAAEA,KAAAA,CAAMC,MAAM,CAACC,UAAU,CAAC,CAAC,CAAC;AACtE,CAAC;AAED;;;AAGC,IACD,MAAMC,YAAeL,GAAAA,aAAAA,CAAOM,oBAAQC,CAAAA,KAAK,CAAC;QAClC,EAAE,CAAC,EAAEL,KAAK,EAAE,GAAKA,KAAMC,CAAAA,MAAM,CAACK,QAAQ,CAAC;;AAE/C,CAAC;AAEYC,MAAAA,SAAAA,GAAY,CAAC,EAAEC,QAAQ,EAA+B,GAAA;AACjE,IAAA,MAAMC,QAAQC,6BAAsB,CAAA,mBAAA,EAAqB,CAACC,CAAAA,GAAMA,EAAEF,KAAK,CAAA;AACvE,IAAA,MAAMG,cAAcH,KAAMI,CAAAA,KAAK,CAACL,QAAS,CAAA,CAACI,WAAW,GAAG,CAAA;;AAExD,IAAA,MAAME,kBAAkBL,KAAMI,CAAAA,KA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AAS;AAEZd,gBAAAA,QAAAA,EAAAA,QAAAA,GACCA,QAEA,iBAAAjB,eAAA,CAAA2C,mBAAA,EAAA;;AACGf,wBAAAA,aAAAA,kBAAiB5C,cAACT,CAAAA,SAAAA,EAAAA;4BAAUC,QAAUA,EAAAA;;sCACvCwB,eAACjC,CAAAA,iBAAAA,EAAAA;4BAAK6E,GAAK,EAAA,CAAA;;AACRf,gCAAAA,QAAAA,kBACC7C,cAAC6D,CAAAA,mBAAAA,EAAAA;oCAAO3D,OAAQ,EAAA,UAAA;oCAAW4D,OAASV,EAAAA,gBAAAA;AAClC,oCAAA,QAAA,gBAAApD,cAACI,CAAAA,0BAAAA,EAAAA;wCAAiBC,EAAG,EAAA,YAAA;wCAAaC,cAAe,EAAA;;;AAGpDwC,gCAAAA,EAAAA,iBACC9C,cAAC+D,CAAAA,uBAAAA,EAAAA;oCAAWvB,GAAKwB,EAAAA,sBAAAA;oCAASlB,EAAIA,EAAAA,EAAAA;oCAAIgB,OAASN,EAAAA,cAAAA;AACzC,oCAAA,QAAA,gBAAAxD,cAACI,CAAAA,0BAAAA,EAAAA;wCAAiBC,EAAG,EAAA,YAAA;wCAAaC,cAAe,EAAA;;mDAGnDN,cAAC6D,CAAAA,mBAAAA,EAAAA;oCAAOC,OAASN,EAAAA,cAAAA;AACf,oCAAA,QAAA,gBAAAxD,cAACI,CAAAA,0BAAAA,EAAAA;wCAAiBC,EAAG,EAAA,YAAA;wCAAaC,cAAe,EAAA;;;;;;;;AAQjE;KACF;;;;;"}
@@ -1,16 +1,43 @@
1
- import { jsx, jsxs } from 'react/jsx-runtime';
1
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
2
  import * as React from 'react';
3
- import { Flex, Popover, Box, Typography, Button, LinkButton } from '@strapi/design-system';
3
+ import { Flex, Popover, Typography, Box, Button, LinkButton } from '@strapi/design-system';
4
4
  import { FormattedMessage } from 'react-intl';
5
5
  import { NavLink } from 'react-router-dom';
6
6
  import { styled } from 'styled-components';
7
+ import { useTracking } from '../../features/Tracking.mjs';
7
8
  import { unstableUseGuidedTour } from './Context.mjs';
8
9
 
9
10
  const ActionsContainer = styled(Flex)`
10
11
  border-top: ${({ theme })=>`1px solid ${theme.colors.neutral150}`};
11
12
  `;
13
+ /**
14
+ * TODO:
15
+ * We should probably move all arrow styles + svg to the DS
16
+ */ const PopoverArrow = styled(Popover.Arrow)`
17
+ fill: ${({ theme })=>theme.colors.neutral0};
18
+ transform: translateY(-16px) rotate(-90deg);
19
+ `;
20
+ const StepCount = ({ tourName })=>{
21
+ const state = unstableUseGuidedTour('GuidedTourPopover', (s)=>s.state);
22
+ const currentStep = state.tours[tourName].currentStep + 1;
23
+ // TODO: Currently all tours do not count their last step, but we should find a way to make this more smart
24
+ const displayedLength = state.tours[tourName].length - 1;
25
+ return /*#__PURE__*/ jsx(Typography, {
26
+ variant: "omega",
27
+ fontSize: "12px",
28
+ children: /*#__PURE__*/ jsx(FormattedMessage, {
29
+ id: "tours.stepCount",
30
+ defaultMessage: "Step {currentStep} of {tourLength}",
31
+ values: {
32
+ currentStep,
33
+ tourLength: displayedLength
34
+ }
35
+ })
36
+ });
37
+ };
12
38
  const createStepComponents = (tourName)=>({
13
- Root: /*#__PURE__*/ React.forwardRef((props, ref)=>/*#__PURE__*/ jsx(Popover.Content, {
39
+ Root: /*#__PURE__*/ React.forwardRef(({ withArrow = true, ...props }, ref)=>{
40
+ return /*#__PURE__*/ jsxs(Popover.Content, {
14
41
  ref: ref,
15
42
  side: "top",
16
43
  align: "center",
@@ -18,13 +45,29 @@ const createStepComponents = (tourName)=>({
18
45
  border: 'none'
19
46
  },
20
47
  ...props,
21
- children: /*#__PURE__*/ jsx(Flex, {
22
- width: "360px",
23
- direction: "column",
24
- alignItems: "start",
25
- children: props.children
26
- })
27
- })),
48
+ children: [
49
+ withArrow && /*#__PURE__*/ jsx(PopoverArrow, {
50
+ asChild: true,
51
+ children: /*#__PURE__*/ jsx("svg", {
52
+ xmlns: "http://www.w3.org/2000/svg",
53
+ width: "23",
54
+ height: "25",
55
+ viewBox: "0 0 23 25",
56
+ fill: "none",
57
+ children: /*#__PURE__*/ jsx("path", {
58
+ d: "M11 24.5L1.82843 15.3284C0.266332 13.7663 0.26633 11.2337 1.82843 9.67157L11 0.5L23 12.5L11 24.5Z"
59
+ })
60
+ })
61
+ }),
62
+ /*#__PURE__*/ jsx(Flex, {
63
+ width: "360px",
64
+ direction: "column",
65
+ alignItems: "start",
66
+ children: props.children
67
+ })
68
+ ]
69
+ });
70
+ }),
28
71
  Title: (props)=>{
29
72
  return /*#__PURE__*/ jsx(Box, {
30
73
  paddingTop: 5,
@@ -59,41 +102,49 @@ const createStepComponents = (tourName)=>({
59
102
  })
60
103
  })
61
104
  }),
62
- Actions: ({ showStepCount = true, showSkip = false, to, ...props })=>{
105
+ Actions: ({ showStepCount = true, showSkip = false, to, children, ...flexProps })=>{
106
+ const { trackUsage } = useTracking();
63
107
  const dispatch = unstableUseGuidedTour('GuidedTourPopover', (s)=>s.dispatch);
64
108
  const state = unstableUseGuidedTour('GuidedTourPopover', (s)=>s.state);
65
109
  const currentStep = state.tours[tourName].currentStep + 1;
66
- // TODO: Currently all tours do not count their last step, but we should find a way to make this more smart
67
- const displayedLength = state.tours[tourName].length - 1;
110
+ const actualTourLength = state.tours[tourName].length;
111
+ const handleSkipAction = ()=>{
112
+ trackUsage('didSkipGuidedTour', {
113
+ name: tourName
114
+ });
115
+ dispatch({
116
+ type: 'skip_tour',
117
+ payload: tourName
118
+ });
119
+ };
120
+ const handleNextStep = ()=>{
121
+ if (currentStep === actualTourLength) {
122
+ trackUsage('didCompleteGuidedTour', {
123
+ name: tourName
124
+ });
125
+ }
126
+ dispatch({
127
+ type: 'next_step',
128
+ payload: tourName
129
+ });
130
+ };
68
131
  return /*#__PURE__*/ jsx(ActionsContainer, {
69
132
  width: "100%",
70
133
  padding: 3,
71
134
  paddingLeft: 5,
72
- children: 'children' in props ? props.children : /*#__PURE__*/ jsxs(Flex, {
73
- flex: 1,
74
- justifyContent: showStepCount ? 'space-between' : 'flex-end',
135
+ justifyContent: showStepCount ? 'space-between' : 'flex-end',
136
+ ...flexProps,
137
+ children: children ? children : /*#__PURE__*/ jsxs(Fragment, {
75
138
  children: [
76
- showStepCount && /*#__PURE__*/ jsx(Typography, {
77
- variant: "omega",
78
- fontSize: "12px",
79
- children: /*#__PURE__*/ jsx(FormattedMessage, {
80
- id: "tours.stepCount",
81
- defaultMessage: "Step {currentStep} of {tourLength}",
82
- values: {
83
- currentStep,
84
- tourLength: displayedLength
85
- }
86
- })
139
+ showStepCount && /*#__PURE__*/ jsx(StepCount, {
140
+ tourName: tourName
87
141
  }),
88
142
  /*#__PURE__*/ jsxs(Flex, {
89
143
  gap: 2,
90
144
  children: [
91
145
  showSkip && /*#__PURE__*/ jsx(Button, {
92
146
  variant: "tertiary",
93
- onClick: ()=>dispatch({
94
- type: 'skip_tour',
95
- payload: tourName
96
- }),
147
+ onClick: handleSkipAction,
97
148
  children: /*#__PURE__*/ jsx(FormattedMessage, {
98
149
  id: "tours.skip",
99
150
  defaultMessage: "Skip"
@@ -102,19 +153,13 @@ const createStepComponents = (tourName)=>({
102
153
  to ? /*#__PURE__*/ jsx(LinkButton, {
103
154
  tag: NavLink,
104
155
  to: to,
105
- onClick: ()=>dispatch({
106
- type: 'next_step',
107
- payload: tourName
108
- }),
156
+ onClick: handleNextStep,
109
157
  children: /*#__PURE__*/ jsx(FormattedMessage, {
110
158
  id: "tours.next",
111
159
  defaultMessage: "Next"
112
160
  })
113
161
  }) : /*#__PURE__*/ jsx(Button, {
114
- onClick: ()=>dispatch({
115
- type: 'next_step',
116
- payload: tourName
117
- }),
162
+ onClick: handleNextStep,
118
163
  children: /*#__PURE__*/ jsx(FormattedMessage, {
119
164
  id: "tours.next",
120
165
  defaultMessage: "Next"
@@ -128,5 +173,5 @@ const createStepComponents = (tourName)=>({
128
173
  }
129
174
  });
130
175
 
131
- export { createStepComponents };
176
+ export { StepCount, createStepComponents };
132
177
  //# sourceMappingURL=Step.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Step.mjs","sources":["../../../../../../admin/src/components/UnstableGuidedTour/Step.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { Popover, Box, Flex, Button, Typography, LinkButton } from '@strapi/design-system';\nimport { FormattedMessage, type MessageDescriptor } from 'react-intl';\nimport { NavLink } from 'react-router-dom';\nimport { styled } from 'styled-components';\n\nimport { unstableUseGuidedTour, ValidTourName } from './Context';\n\n/* -------------------------------------------------------------------------------------------------\n * Step factory\n * -----------------------------------------------------------------------------------------------*/\n\ntype WithChildren = {\n children: React.ReactNode;\n id?: never;\n defaultMessage?: never;\n};\n\ntype WithIntl = {\n children?: undefined;\n id: MessageDescriptor['id'];\n defaultMessage: MessageDescriptor['defaultMessage'];\n};\n\ntype WithActionsChildren = {\n children: React.ReactNode;\n showStepCount?: boolean;\n showSkip?: boolean;\n};\n\ntype WithActionsProps = {\n children?: undefined;\n showStepCount?: boolean;\n showSkip?: boolean;\n};\n\ntype StepProps = WithChildren | WithIntl;\ntype ActionsProps = WithActionsChildren | WithActionsProps;\n\ntype Step = {\n Root: React.ForwardRefExoticComponent<React.ComponentProps<typeof Popover.Content>>;\n Title: (props: StepProps) => React.ReactNode;\n Content: (props: StepProps) => React.ReactNode;\n Actions: (props: ActionsProps & { to?: string }) => React.ReactNode;\n};\n\nconst ActionsContainer = styled(Flex)`\n border-top: ${({ theme }) => `1px solid ${theme.colors.neutral150}`};\n`;\n\nconst createStepComponents = (tourName: ValidTourName): Step => ({\n Root: React.forwardRef((props, ref) => (\n <Popover.Content ref={ref} side=\"top\" align=\"center\" style={{ border: 'none' }} {...props}>\n <Flex width=\"360px\" direction=\"column\" alignItems=\"start\">\n {props.children}\n </Flex>\n </Popover.Content>\n )),\n\n Title: (props) => {\n return (\n <Box paddingTop={5} paddingLeft={5} paddingRight={5} paddingBottom={1} width=\"100%\">\n {'children' in props ? (\n props.children\n ) : (\n <Typography tag=\"div\" variant=\"omega\" fontWeight=\"bold\">\n <FormattedMessage tagName=\"h1\" id={props.id} defaultMessage={props.defaultMessage} />\n </Typography>\n )}\n </Box>\n );\n },\n\n Content: (props) => (\n <Box paddingBottom={5} paddingLeft={5} paddingRight={5} width=\"100%\">\n {'children' in props ? (\n props.children\n ) : (\n <Typography tag=\"div\" variant=\"omega\">\n <FormattedMessage tagName=\"p\" id={props.id} defaultMessage={props.defaultMessage} />\n </Typography>\n )}\n </Box>\n ),\n\n Actions: ({ showStepCount = true, showSkip = false, to, ...props }) => {\n const dispatch = unstableUseGuidedTour('GuidedTourPopover', (s) => s.dispatch);\n const state = unstableUseGuidedTour('GuidedTourPopover', (s) => s.state);\n const currentStep = state.tours[tourName].currentStep + 1;\n // TODO: Currently all tours do not count their last step, but we should find a way to make this more smart\n const displayedLength = state.tours[tourName].length - 1;\n\n return (\n <ActionsContainer width=\"100%\" padding={3} paddingLeft={5}>\n {'children' in props ? (\n props.children\n ) : (\n <Flex flex={1} justifyContent={showStepCount ? 'space-between' : 'flex-end'}>\n {showStepCount && (\n <Typography variant=\"omega\" fontSize=\"12px\">\n <FormattedMessage\n id=\"tours.stepCount\"\n defaultMessage=\"Step {currentStep} of {tourLength}\"\n values={{ currentStep, tourLength: displayedLength }}\n />\n </Typography>\n )}\n <Flex gap={2}>\n {showSkip && (\n <Button\n variant=\"tertiary\"\n onClick={() => dispatch({ type: 'skip_tour', payload: tourName })}\n >\n <FormattedMessage id=\"tours.skip\" defaultMessage=\"Skip\" />\n </Button>\n )}\n {to ? (\n <LinkButton\n tag={NavLink}\n to={to}\n onClick={() => dispatch({ type: 'next_step', payload: tourName })}\n >\n <FormattedMessage id=\"tours.next\" defaultMessage=\"Next\" />\n </LinkButton>\n ) : (\n <Button onClick={() => dispatch({ type: 'next_step', payload: tourName })}>\n <FormattedMessage id=\"tours.next\" defaultMessage=\"Next\" />\n </Button>\n )}\n </Flex>\n </Flex>\n )}\n </ActionsContainer>\n );\n },\n});\n\nexport type { Step };\nexport { createStepComponents };\n"],"names":["ActionsContainer","styled","Flex","theme","colors","neutral150","createStepComponents","tourName","Root","React","forwardRef","props","ref","_jsx","Popover","Content","side","align","style","border","width","direction","alignItems","children","Title","Box","paddingTop","paddingLeft","paddingRight","paddingBottom","Typography","tag","variant","fontWeight","FormattedMessage","tagName","id","defaultMessage","Actions","showStepCount","showSkip","to","dispatch","unstableUseGuidedTour","s","state","currentStep","tours","displayedLength","length","padding","_jsxs","flex","justifyContent","fontSize","values","tourLength","gap","Button","onClick","type","payload","LinkButton","NavLink"],"mappings":";;;;;;;;AA+CA,MAAMA,gBAAAA,GAAmBC,MAAOC,CAAAA,IAAAA,CAAK;AACvB,cAAA,EAAE,CAAC,EAAEC,KAAK,EAAE,GAAK,CAAC,UAAU,EAAEA,KAAAA,CAAMC,MAAM,CAACC,UAAU,CAAC,CAAC,CAAC;AACtE,CAAC;AAEKC,MAAAA,oBAAAA,GAAuB,CAACC,QAAAA,IAAmC;QAC/DC,IAAMC,gBAAAA,KAAAA,CAAMC,UAAU,CAAC,CAACC,OAAOC,GAC7B,iBAAAC,GAAA,CAACC,QAAQC,OAAO,EAAA;gBAACH,GAAKA,EAAAA,GAAAA;gBAAKI,IAAK,EAAA,KAAA;gBAAMC,KAAM,EAAA,QAAA;gBAASC,KAAO,EAAA;oBAAEC,MAAQ,EAAA;AAAO,iBAAA;AAAI,gBAAA,GAAGR,KAAK;AACvF,gBAAA,QAAA,gBAAAE,GAACX,CAAAA,IAAAA,EAAAA;oBAAKkB,KAAM,EAAA,OAAA;oBAAQC,SAAU,EAAA,QAAA;oBAASC,UAAW,EAAA,OAAA;AAC/CX,oBAAAA,QAAAA,EAAAA,KAAAA,CAAMY;;;AAKbC,QAAAA,KAAAA,EAAO,CAACb,KAAAA,GAAAA;AACN,YAAA,qBACEE,GAACY,CAAAA,GAAAA,EAAAA;gBAAIC,UAAY,EAAA,CAAA;gBAAGC,WAAa,EAAA,CAAA;gBAAGC,YAAc,EAAA,CAAA;gBAAG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AA;;;AAGpDI,gCAAAA,EAAAA,iBACC5B,GAACiD,CAAAA,UAAAA,EAAAA;oCACC/B,GAAKgC,EAAAA,OAAAA;oCACLtB,EAAIA,EAAAA,EAAAA;AACJkB,oCAAAA,OAAAA,EAAS,IAAMjB,QAAS,CAAA;4CAAEkB,IAAM,EAAA,WAAA;4CAAaC,OAAStD,EAAAA;AAAS,yCAAA,CAAA;AAE/D,oCAAA,QAAA,gBAAAM,GAACqB,CAAAA,gBAAAA,EAAAA;wCAAiBE,EAAG,EAAA,YAAA;wCAAaC,cAAe,EAAA;;mDAGnDxB,GAAC6C,CAAAA,MAAAA,EAAAA;AAAOC,oCAAAA,OAAAA,EAAS,IAAMjB,QAAS,CAAA;4CAAEkB,IAAM,EAAA,WAAA;4CAAaC,OAAStD,EAAAA;AAAS,yCAAA,CAAA;AACrE,oCAAA,QAAA,gBAAAM,GAACqB,CAAAA,gBAAAA,EAAAA;wCAAiBE,EAAG,EAAA,YAAA;wCAAaC,cAAe,EAAA;;;;;;;;AAQjE;KACF;;;;"}
1
+ {"version":3,"file":"Step.mjs","sources":["../../../../../../admin/src/components/UnstableGuidedTour/Step.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport {\n Popover,\n Box,\n Flex,\n Button,\n Typography,\n LinkButton,\n FlexProps,\n} from '@strapi/design-system';\nimport { FormattedMessage, type MessageDescriptor } from 'react-intl';\nimport { NavLink } from 'react-router-dom';\nimport { styled } from 'styled-components';\n\nimport { type EventWithoutProperties, useTracking } from '../../features/Tracking';\n\nimport { unstableUseGuidedTour, ValidTourName } from './Context';\n\n/* -------------------------------------------------------------------------------------------------\n * Step factory\n * -----------------------------------------------------------------------------------------------*/\n\ntype WithChildren = {\n children: React.ReactNode;\n id?: never;\n defaultMessage?: never;\n};\n\ntype WithIntl = {\n children?: undefined;\n id: MessageDescriptor['id'];\n defaultMessage: MessageDescriptor['defaultMessage'];\n withArrow?: boolean;\n};\n\ntype WithActionsChildren = {\n children: React.ReactNode;\n showStepCount?: boolean;\n showSkip?: boolean;\n};\n\ntype WithActionsProps = {\n children?: undefined;\n showStepCount?: boolean;\n showSkip?: boolean;\n};\n\ntype StepProps = WithChildren | WithIntl;\ntype ActionsProps = WithActionsChildren | WithActionsProps;\n\ntype Step = {\n Root: React.ForwardRefExoticComponent<\n React.ComponentProps<typeof Popover.Content> & { withArrow?: boolean }\n >;\n Title: (props: StepProps) => React.ReactNode;\n Content: (props: StepProps) => React.ReactNode;\n Actions: (props: ActionsProps & { to?: string } & FlexProps) => React.ReactNode;\n};\n\nconst ActionsContainer = styled(Flex)`\n border-top: ${({ theme }) => `1px solid ${theme.colors.neutral150}`};\n`;\n\n/**\n * TODO:\n * We should probably move all arrow styles + svg to the DS\n */\nconst PopoverArrow = styled(Popover.Arrow)`\n fill: ${({ theme }) => theme.colors.neutral0};\n transform: translateY(-16px) rotate(-90deg);\n`;\n\nexport const StepCount = ({ tourName }: { tourName: ValidTourName }) => {\n const state = unstableUseGuidedTour('GuidedTourPopover', (s) => s.state);\n const currentStep = state.tours[tourName].currentStep + 1;\n // TODO: Currently all tours do not count their last step, but we should find a way to make this more smart\n const displayedLength = state.tours[tourName].length - 1;\n\n return (\n <Typography variant=\"omega\" fontSize=\"12px\">\n <FormattedMessage\n id=\"tours.stepCount\"\n defaultMessage=\"Step {currentStep} of {tourLength}\"\n values={{ currentStep, tourLength: displayedLength }}\n />\n </Typography>\n );\n};\n\nconst createStepComponents = (tourName: ValidTourName): Step => ({\n Root: React.forwardRef(({ withArrow = true, ...props }, ref) => {\n return (\n <Popover.Content ref={ref} side=\"top\" align=\"center\" style={{ border: 'none' }} {...props}>\n {withArrow && (\n <PopoverArrow asChild>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"23\"\n height=\"25\"\n viewBox=\"0 0 23 25\"\n fill=\"none\"\n >\n <path d=\"M11 24.5L1.82843 15.3284C0.266332 13.7663 0.26633 11.2337 1.82843 9.67157L11 0.5L23 12.5L11 24.5Z\" />\n </svg>\n </PopoverArrow>\n )}\n <Flex width=\"360px\" direction=\"column\" alignItems=\"start\">\n {props.children}\n </Flex>\n </Popover.Content>\n );\n }),\n\n Title: (props) => {\n return (\n <Box paddingTop={5} paddingLeft={5} paddingRight={5} paddingBottom={1} width=\"100%\">\n {'children' in props ? (\n props.children\n ) : (\n <Typography tag=\"div\" variant=\"omega\" fontWeight=\"bold\">\n <FormattedMessage tagName=\"h1\" id={props.id} defaultMessage={props.defaultMessage} />\n </Typography>\n )}\n </Box>\n );\n },\n\n Content: (props) => (\n <Box paddingBottom={5} paddingLeft={5} paddingRight={5} width=\"100%\">\n {'children' in props ? (\n props.children\n ) : (\n <Typography tag=\"div\" variant=\"omega\">\n <FormattedMessage tagName=\"p\" id={props.id} defaultMessage={props.defaultMessage} />\n </Typography>\n )}\n </Box>\n ),\n\n Actions: ({ showStepCount = true, showSkip = false, to, children, ...flexProps }) => {\n const { trackUsage } = useTracking();\n const dispatch = unstableUseGuidedTour('GuidedTourPopover', (s) => s.dispatch);\n const state = unstableUseGuidedTour('GuidedTourPopover', (s) => s.state);\n const currentStep = state.tours[tourName].currentStep + 1;\n const actualTourLength = state.tours[tourName].length;\n\n const handleSkipAction = () => {\n trackUsage('didSkipGuidedTour', { name: tourName });\n dispatch({ type: 'skip_tour', payload: tourName });\n };\n\n const handleNextStep = () => {\n if (currentStep === actualTourLength) {\n trackUsage('didCompleteGuidedTour', { name: tourName });\n }\n dispatch({ type: 'next_step', payload: tourName });\n };\n\n return (\n <ActionsContainer\n width=\"100%\"\n padding={3}\n paddingLeft={5}\n justifyContent={showStepCount ? 'space-between' : 'flex-end'}\n {...flexProps}\n >\n {children ? (\n children\n ) : (\n <>\n {showStepCount && <StepCount tourName={tourName} />}\n <Flex gap={2}>\n {showSkip && (\n <Button variant=\"tertiary\" onClick={handleSkipAction}>\n <FormattedMessage id=\"tours.skip\" defaultMessage=\"Skip\" />\n </Button>\n )}\n {to ? (\n <LinkButton tag={NavLink} to={to} onClick={handleNextStep}>\n <FormattedMessage id=\"tours.next\" defaultMessage=\"Next\" />\n </LinkButton>\n ) : (\n <Button onClick={handleNextStep}>\n <FormattedMessage id=\"tours.next\" defaultMessage=\"Next\" />\n </Button>\n )}\n </Flex>\n </>\n )}\n </ActionsContainer>\n );\n },\n});\n\nexport type { Step };\nexport { createStepComponents };\n"],"names":["ActionsContainer","styled","Flex","theme","colors","neutral150","PopoverArrow","Popover","Arrow","neutral0","StepCount","tourName","state","unstableUseGuidedTour","s","currentStep","tours","displayedLength","length","_jsx","Typography","variant","fontSize","FormattedMessage","id","defaultMessage","values","tourLength","createStepComponents","Root","React","forwardRef","withArrow","props","ref","_jsxs","Content","side","align","style","border","asChild","svg","xmlns","width","height","viewBox","fill","path","d","direction","alignItems","children","Title","Box","paddingTop","paddingLeft","paddingRight","paddingBottom","tag","fontWeight","tagName","Actions","showStepCount","showSkip","to","flexProps","trackUsage","useTracking","dispatch","actualTourLength","handleSkipAction","name","type","payload","handleNextStep","padding","justifyContent","_Fragment","gap","Button","onClick","LinkButton","NavLink"],"mappings":";;;;;;;;;AA4DA,MAAMA,gBAAAA,GAAmBC,MAAOC,CAAAA,IAAAA,CAAK;AACvB,cAAA,EAAE,CAAC,EAAEC,KAAK,EAAE,GAAK,CAAC,UAAU,EAAEA,KAAAA,CAAMC,MAAM,CAACC,UAAU,CAAC,CAAC,CAAC;AACtE,CAAC;AAED;;;AAGC,IACD,MAAMC,YAAeL,GAAAA,MAAAA,CAAOM,OAAQC,CAAAA,KAAK,CAAC;QAClC,EAAE,CAAC,EAAEL,KAAK,EAAE,GAAKA,KAAMC,CAAAA,MAAM,CAACK,QAAQ,CAAC;;AAE/C,CAAC;AAEYC,MAAAA,SAAAA,GAAY,CAAC,EAAEC,QAAQ,EAA+B,GAAA;AACjE,IAAA,MAAMC,QAAQC,qBAAsB,CAAA,mBAAA,EAAqB,CAACC,CAAAA,GAAMA,EAAEF,KAAK,CAAA;AACvE,IAAA,MAAMG,cAAcH,KAAMI,CAAAA,KAA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