@knocklabs/react 0.12.1 → 0.13.1
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 +39 -0
- package/dist/cjs/_virtual/_rolldown/runtime.js +1 -0
- package/dist/cjs/index.css +1 -1
- package/dist/cjs/index.js +1 -2
- package/dist/cjs/modules/core/components/Button/Button.js +2 -2
- package/dist/cjs/modules/core/components/Button/Button.js.map +1 -1
- package/dist/cjs/modules/core/components/Button/ButtonGroup.js +2 -2
- package/dist/cjs/modules/core/components/Button/ButtonGroup.js.map +1 -1
- package/dist/cjs/modules/core/components/Button/ButtonSpinner.js +2 -2
- package/dist/cjs/modules/core/components/Button/ButtonSpinner.js.map +1 -1
- package/dist/cjs/modules/core/components/Button/index.js +1 -0
- package/dist/cjs/modules/core/components/Icons/Bell.js +2 -2
- package/dist/cjs/modules/core/components/Icons/Bell.js.map +1 -1
- package/dist/cjs/modules/core/components/Icons/CheckmarkCircle.js +2 -2
- package/dist/cjs/modules/core/components/Icons/CheckmarkCircle.js.map +1 -1
- package/dist/cjs/modules/core/components/Icons/ChevronDown.js +2 -2
- package/dist/cjs/modules/core/components/Icons/ChevronDown.js.map +1 -1
- package/dist/cjs/modules/core/components/Icons/CloseCircle.js +2 -2
- package/dist/cjs/modules/core/components/Icons/CloseCircle.js.map +1 -1
- package/dist/cjs/modules/core/components/Icons/index.js +1 -0
- package/dist/cjs/modules/core/components/Spinner/Spinner.js +3 -3
- package/dist/cjs/modules/core/components/Spinner/Spinner.js.map +1 -1
- package/dist/cjs/modules/core/components/Spinner/index.js +1 -0
- package/dist/cjs/modules/core/cx/index.js +2 -2
- package/dist/cjs/modules/core/cx/index.js.map +1 -1
- package/dist/cjs/modules/core/debounce/index.js +2 -2
- package/dist/cjs/modules/core/debounce/index.js.map +1 -1
- package/dist/cjs/modules/core/hooks/index.js +1 -0
- package/dist/cjs/modules/core/hooks/useComponentVisible.js +2 -2
- package/dist/cjs/modules/core/hooks/useComponentVisible.js.map +1 -1
- package/dist/cjs/modules/core/hooks/useOnBottomScroll.js +2 -2
- package/dist/cjs/modules/core/hooks/useOnBottomScroll.js.map +1 -1
- package/dist/cjs/modules/core/index.js +1 -0
- package/dist/cjs/modules/core/utils.js +2 -2
- package/dist/cjs/modules/core/utils.js.map +1 -1
- package/dist/cjs/modules/feed/components/EmptyFeed/EmptyFeed.js +2 -2
- package/dist/cjs/modules/feed/components/EmptyFeed/EmptyFeed.js.map +1 -1
- package/dist/cjs/modules/feed/components/EmptyFeed/index.js +1 -0
- package/dist/cjs/modules/feed/components/NotificationCell/ArchiveButton.js +2 -2
- package/dist/cjs/modules/feed/components/NotificationCell/ArchiveButton.js.map +1 -1
- package/dist/cjs/modules/feed/components/NotificationCell/Avatar.js +2 -2
- package/dist/cjs/modules/feed/components/NotificationCell/Avatar.js.map +1 -1
- package/dist/cjs/modules/feed/components/NotificationCell/NotificationCell.js +2 -2
- package/dist/cjs/modules/feed/components/NotificationCell/NotificationCell.js.map +1 -1
- package/dist/cjs/modules/feed/components/NotificationCell/index.js +1 -0
- package/dist/cjs/modules/feed/components/NotificationFeed/Dropdown.js +2 -2
- package/dist/cjs/modules/feed/components/NotificationFeed/Dropdown.js.map +1 -1
- package/dist/cjs/modules/feed/components/NotificationFeed/MarkAsRead.js +2 -2
- package/dist/cjs/modules/feed/components/NotificationFeed/MarkAsRead.js.map +1 -1
- package/dist/cjs/modules/feed/components/NotificationFeed/NotificationFeed.js +2 -2
- package/dist/cjs/modules/feed/components/NotificationFeed/NotificationFeed.js.map +1 -1
- package/dist/cjs/modules/feed/components/NotificationFeed/NotificationFeedHeader.js +2 -2
- package/dist/cjs/modules/feed/components/NotificationFeed/NotificationFeedHeader.js.map +1 -1
- package/dist/cjs/modules/feed/components/NotificationFeed/index.js +1 -0
- package/dist/cjs/modules/feed/components/NotificationFeedContainer/NotificationFeedContainer.js +2 -2
- package/dist/cjs/modules/feed/components/NotificationFeedContainer/NotificationFeedContainer.js.map +1 -1
- package/dist/cjs/modules/feed/components/NotificationFeedContainer/index.js +1 -0
- package/dist/cjs/modules/feed/components/NotificationFeedPopover/NotificationFeedPopover.js +2 -2
- package/dist/cjs/modules/feed/components/NotificationFeedPopover/NotificationFeedPopover.js.map +1 -1
- package/dist/cjs/modules/feed/components/NotificationFeedPopover/index.js +1 -0
- package/dist/cjs/modules/feed/components/NotificationIconButton/NotificationIconButton.js +2 -2
- package/dist/cjs/modules/feed/components/NotificationIconButton/NotificationIconButton.js.map +1 -1
- package/dist/cjs/modules/feed/components/NotificationIconButton/index.js +1 -0
- package/dist/cjs/modules/feed/components/UnseenBadge/UnseenBadge.js +2 -2
- package/dist/cjs/modules/feed/components/UnseenBadge/UnseenBadge.js.map +1 -1
- package/dist/cjs/modules/feed/components/UnseenBadge/index.js +1 -0
- package/dist/cjs/modules/feed/index.js +1 -0
- package/dist/cjs/modules/guide/components/Banner/Banner.js +2 -2
- package/dist/cjs/modules/guide/components/Banner/Banner.js.map +1 -1
- package/dist/cjs/modules/guide/components/Banner/index.js +1 -0
- package/dist/cjs/modules/guide/components/Card/Card.js +2 -2
- package/dist/cjs/modules/guide/components/Card/Card.js.map +1 -1
- package/dist/cjs/modules/guide/components/Card/index.js +1 -0
- package/dist/cjs/modules/guide/components/Modal/Modal.js +2 -2
- package/dist/cjs/modules/guide/components/Modal/Modal.js.map +1 -1
- package/dist/cjs/modules/guide/components/Modal/index.js +1 -0
- package/dist/cjs/modules/guide/components/Toolbar/KnockButton.js +2 -2
- package/dist/cjs/modules/guide/components/Toolbar/KnockButton.js.map +1 -1
- package/dist/cjs/modules/guide/components/Toolbar/V2/FocusChin.js +2 -2
- package/dist/cjs/modules/guide/components/Toolbar/V2/FocusChin.js.map +1 -1
- package/dist/cjs/modules/guide/components/Toolbar/V2/GuideAnnotatedStatusDot.js +2 -2
- package/dist/cjs/modules/guide/components/Toolbar/V2/GuideAnnotatedStatusDot.js.map +1 -1
- package/dist/cjs/modules/guide/components/Toolbar/V2/GuideContextDetails.js +2 -2
- package/dist/cjs/modules/guide/components/Toolbar/V2/GuideContextDetails.js.map +1 -1
- package/dist/cjs/modules/guide/components/Toolbar/V2/GuideRow.js +2 -2
- package/dist/cjs/modules/guide/components/Toolbar/V2/GuideRow.js.map +1 -1
- package/dist/cjs/modules/guide/components/Toolbar/V2/GuideRowDetails.js +2 -2
- package/dist/cjs/modules/guide/components/Toolbar/V2/GuideRowDetails.js.map +1 -1
- package/dist/cjs/modules/guide/components/Toolbar/V2/Kbd.js +2 -2
- package/dist/cjs/modules/guide/components/Toolbar/V2/Kbd.js.map +1 -1
- package/dist/cjs/modules/guide/components/Toolbar/V2/V2.js +2 -2
- package/dist/cjs/modules/guide/components/Toolbar/V2/V2.js.map +1 -1
- package/dist/cjs/modules/guide/components/Toolbar/V2/helpers.js +2 -2
- package/dist/cjs/modules/guide/components/Toolbar/V2/helpers.js.map +1 -1
- package/dist/cjs/modules/guide/components/Toolbar/V2/index.js +1 -0
- package/dist/cjs/modules/guide/components/Toolbar/V2/useDraggable.js +2 -2
- package/dist/cjs/modules/guide/components/Toolbar/V2/useDraggable.js.map +1 -1
- package/dist/cjs/modules/guide/components/Toolbar/V2/useInspectGuideClientStore.js +2 -2
- package/dist/cjs/modules/guide/components/Toolbar/V2/useInspectGuideClientStore.js.map +1 -1
- package/dist/cjs/modules/guide/components/Toolbar/index.js +1 -0
- package/dist/cjs/modules/guide/components/Toolbar/shared.js +2 -2
- package/dist/cjs/modules/guide/components/Toolbar/shared.js.map +1 -1
- package/dist/cjs/modules/guide/components/Toolbar/styles.inline.js +2 -0
- package/dist/cjs/modules/guide/components/Toolbar/styles.inline.js.map +1 -0
- package/dist/cjs/modules/guide/components/Toolbar/useToolbarStyles.js +2 -2
- package/dist/cjs/modules/guide/components/Toolbar/useToolbarStyles.js.map +1 -1
- package/dist/cjs/modules/guide/components/helpers.js +2 -2
- package/dist/cjs/modules/guide/components/helpers.js.map +1 -1
- package/dist/cjs/modules/guide/components/index.js +1 -0
- package/dist/cjs/modules/guide/index.js +1 -0
- package/dist/cjs/modules/guide/providers/KnockGuideProvider.js +2 -2
- package/dist/cjs/modules/guide/providers/KnockGuideProvider.js.map +1 -1
- package/dist/cjs/modules/guide/providers/index.js +1 -0
- package/dist/cjs/modules/ms-teams/components/MsTeamsAuthButton/MsTeamsAuthButton.js +2 -2
- package/dist/cjs/modules/ms-teams/components/MsTeamsAuthButton/MsTeamsAuthButton.js.map +1 -1
- package/dist/cjs/modules/ms-teams/components/MsTeamsAuthButton/index.js +1 -0
- package/dist/cjs/modules/ms-teams/components/MsTeamsAuthContainer/MsTeamsAuthContainer.js +2 -2
- package/dist/cjs/modules/ms-teams/components/MsTeamsAuthContainer/MsTeamsAuthContainer.js.map +1 -1
- package/dist/cjs/modules/ms-teams/components/MsTeamsAuthContainer/index.js +1 -0
- package/dist/cjs/modules/ms-teams/components/MsTeamsChannelCombobox/MsTeamsChannelCombobox.js +2 -2
- package/dist/cjs/modules/ms-teams/components/MsTeamsChannelCombobox/MsTeamsChannelCombobox.js.map +1 -1
- package/dist/cjs/modules/ms-teams/components/MsTeamsChannelCombobox/MsTeamsChannelInTeamCombobox.js +2 -2
- package/dist/cjs/modules/ms-teams/components/MsTeamsChannelCombobox/MsTeamsChannelInTeamCombobox.js.map +1 -1
- package/dist/cjs/modules/ms-teams/components/MsTeamsChannelCombobox/MsTeamsConnectionError.js +2 -2
- package/dist/cjs/modules/ms-teams/components/MsTeamsChannelCombobox/MsTeamsConnectionError.js.map +1 -1
- package/dist/cjs/modules/ms-teams/components/MsTeamsChannelCombobox/MsTeamsErrorMessage.js +2 -2
- package/dist/cjs/modules/ms-teams/components/MsTeamsChannelCombobox/MsTeamsErrorMessage.js.map +1 -1
- package/dist/cjs/modules/ms-teams/components/MsTeamsChannelCombobox/MsTeamsTeamCombobox.js +2 -2
- package/dist/cjs/modules/ms-teams/components/MsTeamsChannelCombobox/MsTeamsTeamCombobox.js.map +1 -1
- package/dist/cjs/modules/ms-teams/components/MsTeamsChannelCombobox/index.js +1 -0
- package/dist/cjs/modules/ms-teams/components/MsTeamsIcon/MsTeamsIcon.js +2 -2
- package/dist/cjs/modules/ms-teams/components/MsTeamsIcon/MsTeamsIcon.js.map +1 -1
- package/dist/cjs/modules/ms-teams/components/MsTeamsIcon/index.js +1 -0
- package/dist/cjs/modules/ms-teams/index.js +1 -0
- package/dist/cjs/modules/ms-teams/utils.js +2 -2
- package/dist/cjs/modules/ms-teams/utils.js.map +1 -1
- package/dist/cjs/modules/slack/components/SlackAddChannelInput/SlackAddChannelInput.js +2 -2
- package/dist/cjs/modules/slack/components/SlackAddChannelInput/SlackAddChannelInput.js.map +1 -1
- package/dist/cjs/modules/slack/components/SlackAuthButton/SlackAuthButton.js +2 -2
- package/dist/cjs/modules/slack/components/SlackAuthButton/SlackAuthButton.js.map +1 -1
- package/dist/cjs/modules/slack/components/SlackAuthButton/index.js +1 -0
- package/dist/cjs/modules/slack/components/SlackAuthContainer/SlackAuthContainer.js +2 -2
- package/dist/cjs/modules/slack/components/SlackAuthContainer/SlackAuthContainer.js.map +1 -1
- package/dist/cjs/modules/slack/components/SlackAuthContainer/index.js +1 -0
- package/dist/cjs/modules/slack/components/SlackChannelCombobox/SlackChannelCombobox.js +2 -2
- package/dist/cjs/modules/slack/components/SlackChannelCombobox/SlackChannelCombobox.js.map +1 -1
- package/dist/cjs/modules/slack/components/SlackChannelCombobox/SlackConnectionError.js +2 -2
- package/dist/cjs/modules/slack/components/SlackChannelCombobox/SlackConnectionError.js.map +1 -1
- package/dist/cjs/modules/slack/components/SlackChannelCombobox/SlackErrorMessage.js +2 -2
- package/dist/cjs/modules/slack/components/SlackChannelCombobox/SlackErrorMessage.js.map +1 -1
- package/dist/cjs/modules/slack/components/SlackChannelCombobox/index.js +1 -0
- package/dist/cjs/modules/slack/components/SlackIcon/SlackIcon.js +2 -2
- package/dist/cjs/modules/slack/components/SlackIcon/SlackIcon.js.map +1 -1
- package/dist/cjs/modules/slack/components/SlackIcon/index.js +1 -0
- package/dist/cjs/modules/slack/index.js +1 -0
- package/dist/cjs/modules/slack/utils.js +2 -2
- package/dist/cjs/modules/slack/utils.js.map +1 -1
- package/dist/cjs/next/KnockGuideLocationSensor.js +2 -2
- package/dist/cjs/next/KnockGuideLocationSensor.js.map +1 -1
- package/dist/cjs/next.js +1 -2
- package/dist/cjs/tanstack/KnockGuideLocationSensor.js +2 -2
- package/dist/cjs/tanstack/KnockGuideLocationSensor.js.map +1 -1
- package/dist/cjs/tanstack.js +1 -2
- package/dist/esm/index.mjs +36 -118
- package/dist/esm/modules/core/components/Button/Button.mjs +28 -21
- package/dist/esm/modules/core/components/Button/Button.mjs.map +1 -1
- package/dist/esm/modules/core/components/Button/ButtonGroup.mjs +11 -9
- package/dist/esm/modules/core/components/Button/ButtonGroup.mjs.map +1 -1
- package/dist/esm/modules/core/components/Button/ButtonSpinner.mjs +13 -10
- package/dist/esm/modules/core/components/Button/ButtonSpinner.mjs.map +1 -1
- package/dist/esm/modules/core/components/Button/index.mjs +3 -0
- package/dist/esm/modules/core/components/Icons/Bell.mjs +26 -10
- package/dist/esm/modules/core/components/Icons/Bell.mjs.map +1 -1
- package/dist/esm/modules/core/components/Icons/CheckmarkCircle.mjs +26 -10
- package/dist/esm/modules/core/components/Icons/CheckmarkCircle.mjs.map +1 -1
- package/dist/esm/modules/core/components/Icons/ChevronDown.mjs +21 -10
- package/dist/esm/modules/core/components/Icons/ChevronDown.mjs.map +1 -1
- package/dist/esm/modules/core/components/Icons/CloseCircle.mjs +18 -10
- package/dist/esm/modules/core/components/Icons/CloseCircle.mjs.map +1 -1
- package/dist/esm/modules/core/components/Icons/index.mjs +5 -0
- package/dist/esm/modules/core/components/Spinner/Spinner.mjs +40 -30
- package/dist/esm/modules/core/components/Spinner/Spinner.mjs.map +1 -1
- package/dist/esm/modules/core/components/Spinner/index.mjs +2 -0
- package/dist/esm/modules/core/cx/index.mjs +6 -5
- package/dist/esm/modules/core/cx/index.mjs.map +1 -1
- package/dist/esm/modules/core/debounce/index.mjs +14 -14
- package/dist/esm/modules/core/debounce/index.mjs.map +1 -1
- package/dist/esm/modules/core/hooks/index.mjs +2 -0
- package/dist/esm/modules/core/hooks/useComponentVisible.mjs +17 -18
- package/dist/esm/modules/core/hooks/useComponentVisible.mjs.map +1 -1
- package/dist/esm/modules/core/hooks/useOnBottomScroll.mjs +21 -21
- package/dist/esm/modules/core/hooks/useOnBottomScroll.mjs.map +1 -1
- package/dist/esm/modules/core/index.mjs +14 -0
- package/dist/esm/modules/core/utils.mjs +10 -11
- package/dist/esm/modules/core/utils.mjs.map +1 -1
- package/dist/esm/modules/feed/components/EmptyFeed/EmptyFeed.mjs +23 -14
- package/dist/esm/modules/feed/components/EmptyFeed/EmptyFeed.mjs.map +1 -1
- package/dist/esm/modules/feed/components/EmptyFeed/index.mjs +2 -0
- package/dist/esm/modules/feed/components/NotificationCell/ArchiveButton.mjs +42 -40
- package/dist/esm/modules/feed/components/NotificationCell/ArchiveButton.mjs.map +1 -1
- package/dist/esm/modules/feed/components/NotificationCell/Avatar.mjs +24 -15
- package/dist/esm/modules/feed/components/NotificationCell/Avatar.mjs.map +1 -1
- package/dist/esm/modules/feed/components/NotificationCell/NotificationCell.mjs +88 -64
- package/dist/esm/modules/feed/components/NotificationCell/NotificationCell.mjs.map +1 -1
- package/dist/esm/modules/feed/components/NotificationCell/index.mjs +3 -0
- package/dist/esm/modules/feed/components/NotificationFeed/Dropdown.mjs +22 -17
- package/dist/esm/modules/feed/components/NotificationFeed/Dropdown.mjs.map +1 -1
- package/dist/esm/modules/feed/components/NotificationFeed/MarkAsRead.mjs +26 -21
- package/dist/esm/modules/feed/components/NotificationFeed/MarkAsRead.mjs.map +1 -1
- package/dist/esm/modules/feed/components/NotificationFeed/NotificationFeed.mjs +78 -68
- package/dist/esm/modules/feed/components/NotificationFeed/NotificationFeed.mjs.map +1 -1
- package/dist/esm/modules/feed/components/NotificationFeed/NotificationFeedHeader.mjs +33 -17
- package/dist/esm/modules/feed/components/NotificationFeed/NotificationFeedHeader.mjs.map +1 -1
- package/dist/esm/modules/feed/components/NotificationFeed/index.mjs +4 -0
- package/dist/esm/modules/feed/components/NotificationFeedContainer/NotificationFeedContainer.mjs +11 -9
- package/dist/esm/modules/feed/components/NotificationFeedContainer/NotificationFeedContainer.mjs.map +1 -1
- package/dist/esm/modules/feed/components/NotificationFeedContainer/index.mjs +2 -0
- package/dist/esm/modules/feed/components/NotificationFeedPopover/NotificationFeedPopover.mjs +62 -65
- package/dist/esm/modules/feed/components/NotificationFeedPopover/NotificationFeedPopover.mjs.map +1 -1
- package/dist/esm/modules/feed/components/NotificationFeedPopover/index.mjs +2 -0
- package/dist/esm/modules/feed/components/NotificationIconButton/NotificationIconButton.mjs +22 -17
- package/dist/esm/modules/feed/components/NotificationIconButton/NotificationIconButton.mjs.map +1 -1
- package/dist/esm/modules/feed/components/NotificationIconButton/index.mjs +2 -0
- package/dist/esm/modules/feed/components/UnseenBadge/UnseenBadge.mjs +27 -23
- package/dist/esm/modules/feed/components/UnseenBadge/UnseenBadge.mjs.map +1 -1
- package/dist/esm/modules/feed/components/UnseenBadge/index.mjs +2 -0
- package/dist/esm/modules/feed/index.mjs +18 -0
- package/dist/esm/modules/guide/components/Banner/Banner.mjs +138 -129
- package/dist/esm/modules/guide/components/Banner/Banner.mjs.map +1 -1
- package/dist/esm/modules/guide/components/Banner/index.mjs +2 -0
- package/dist/esm/modules/guide/components/Card/Card.mjs +184 -167
- package/dist/esm/modules/guide/components/Card/Card.mjs.map +1 -1
- package/dist/esm/modules/guide/components/Card/index.mjs +2 -0
- package/dist/esm/modules/guide/components/Modal/Modal.mjs +188 -168
- package/dist/esm/modules/guide/components/Modal/Modal.mjs.map +1 -1
- package/dist/esm/modules/guide/components/Modal/index.mjs +2 -0
- package/dist/esm/modules/guide/components/Toolbar/KnockButton.mjs +46 -24
- package/dist/esm/modules/guide/components/Toolbar/KnockButton.mjs.map +1 -1
- package/dist/esm/modules/guide/components/Toolbar/V2/FocusChin.mjs +174 -111
- package/dist/esm/modules/guide/components/Toolbar/V2/FocusChin.mjs.map +1 -1
- package/dist/esm/modules/guide/components/Toolbar/V2/GuideAnnotatedStatusDot.mjs +82 -19
- package/dist/esm/modules/guide/components/Toolbar/V2/GuideAnnotatedStatusDot.mjs.map +1 -1
- package/dist/esm/modules/guide/components/Toolbar/V2/GuideContextDetails.mjs +189 -47
- package/dist/esm/modules/guide/components/Toolbar/V2/GuideContextDetails.mjs.map +1 -1
- package/dist/esm/modules/guide/components/Toolbar/V2/GuideRow.mjs +229 -143
- package/dist/esm/modules/guide/components/Toolbar/V2/GuideRow.mjs.map +1 -1
- package/dist/esm/modules/guide/components/Toolbar/V2/GuideRowDetails.mjs +180 -68
- package/dist/esm/modules/guide/components/Toolbar/V2/GuideRowDetails.mjs.map +1 -1
- package/dist/esm/modules/guide/components/Toolbar/V2/Kbd.mjs +17 -14
- package/dist/esm/modules/guide/components/Toolbar/V2/Kbd.mjs.map +1 -1
- package/dist/esm/modules/guide/components/Toolbar/V2/V2.mjs +315 -159
- package/dist/esm/modules/guide/components/Toolbar/V2/V2.mjs.map +1 -1
- package/dist/esm/modules/guide/components/Toolbar/V2/helpers.mjs +9 -11
- package/dist/esm/modules/guide/components/Toolbar/V2/helpers.mjs.map +1 -1
- package/dist/esm/modules/guide/components/Toolbar/V2/index.mjs +2 -0
- package/dist/esm/modules/guide/components/Toolbar/V2/useDraggable.mjs +66 -74
- package/dist/esm/modules/guide/components/Toolbar/V2/useDraggable.mjs.map +1 -1
- package/dist/esm/modules/guide/components/Toolbar/V2/useInspectGuideClientStore.mjs +136 -192
- package/dist/esm/modules/guide/components/Toolbar/V2/useInspectGuideClientStore.mjs.map +1 -1
- package/dist/esm/modules/guide/components/Toolbar/index.mjs +3 -0
- package/dist/esm/modules/guide/components/Toolbar/shared.mjs +6 -5
- package/dist/esm/modules/guide/components/Toolbar/shared.mjs.map +1 -1
- package/dist/esm/modules/guide/components/Toolbar/styles.inline.mjs +6 -0
- package/dist/esm/modules/guide/components/Toolbar/styles.inline.mjs.map +1 -0
- package/dist/esm/modules/guide/components/Toolbar/useToolbarStyles.mjs +13 -12
- package/dist/esm/modules/guide/components/Toolbar/useToolbarStyles.mjs.map +1 -1
- package/dist/esm/modules/guide/components/helpers.mjs +15 -15
- package/dist/esm/modules/guide/components/helpers.mjs.map +1 -1
- package/dist/esm/modules/guide/components/index.mjs +9 -0
- package/dist/esm/modules/guide/index.mjs +8 -0
- package/dist/esm/modules/guide/providers/KnockGuideProvider.mjs +19 -17
- package/dist/esm/modules/guide/providers/KnockGuideProvider.mjs.map +1 -1
- package/dist/esm/modules/guide/providers/index.mjs +2 -0
- package/dist/esm/modules/ms-teams/components/MsTeamsAuthButton/MsTeamsAuthButton.mjs +78 -52
- package/dist/esm/modules/ms-teams/components/MsTeamsAuthButton/MsTeamsAuthButton.mjs.map +1 -1
- package/dist/esm/modules/ms-teams/components/MsTeamsAuthButton/index.mjs +2 -0
- package/dist/esm/modules/ms-teams/components/MsTeamsAuthContainer/MsTeamsAuthContainer.mjs +33 -16
- package/dist/esm/modules/ms-teams/components/MsTeamsAuthContainer/MsTeamsAuthContainer.mjs.map +1 -1
- package/dist/esm/modules/ms-teams/components/MsTeamsAuthContainer/index.mjs +2 -0
- package/dist/esm/modules/ms-teams/components/MsTeamsChannelCombobox/MsTeamsChannelCombobox.mjs +60 -28
- package/dist/esm/modules/ms-teams/components/MsTeamsChannelCombobox/MsTeamsChannelCombobox.mjs.map +1 -1
- package/dist/esm/modules/ms-teams/components/MsTeamsChannelCombobox/MsTeamsChannelInTeamCombobox.mjs +47 -39
- package/dist/esm/modules/ms-teams/components/MsTeamsChannelCombobox/MsTeamsChannelInTeamCombobox.mjs.map +1 -1
- package/dist/esm/modules/ms-teams/components/MsTeamsChannelCombobox/MsTeamsConnectionError.mjs +11 -14
- package/dist/esm/modules/ms-teams/components/MsTeamsChannelCombobox/MsTeamsConnectionError.mjs.map +1 -1
- package/dist/esm/modules/ms-teams/components/MsTeamsChannelCombobox/MsTeamsErrorMessage.mjs +23 -11
- package/dist/esm/modules/ms-teams/components/MsTeamsChannelCombobox/MsTeamsErrorMessage.mjs.map +1 -1
- package/dist/esm/modules/ms-teams/components/MsTeamsChannelCombobox/MsTeamsTeamCombobox.mjs +41 -33
- package/dist/esm/modules/ms-teams/components/MsTeamsChannelCombobox/MsTeamsTeamCombobox.mjs.map +1 -1
- package/dist/esm/modules/ms-teams/components/MsTeamsChannelCombobox/index.mjs +2 -0
- package/dist/esm/modules/ms-teams/components/MsTeamsIcon/MsTeamsIcon.mjs +99 -15
- package/dist/esm/modules/ms-teams/components/MsTeamsIcon/MsTeamsIcon.mjs.map +1 -1
- package/dist/esm/modules/ms-teams/components/MsTeamsIcon/index.mjs +2 -0
- package/dist/esm/modules/ms-teams/index.mjs +7 -0
- package/dist/esm/modules/ms-teams/utils.mjs +6 -5
- package/dist/esm/modules/ms-teams/utils.mjs.map +1 -1
- package/dist/esm/modules/slack/components/SlackAddChannelInput/SlackAddChannelInput.mjs +48 -32
- package/dist/esm/modules/slack/components/SlackAddChannelInput/SlackAddChannelInput.mjs.map +1 -1
- package/dist/esm/modules/slack/components/SlackAuthButton/SlackAuthButton.mjs +82 -58
- package/dist/esm/modules/slack/components/SlackAuthButton/SlackAuthButton.mjs.map +1 -1
- package/dist/esm/modules/slack/components/SlackAuthButton/index.mjs +2 -0
- package/dist/esm/modules/slack/components/SlackAuthContainer/SlackAuthContainer.mjs +33 -16
- package/dist/esm/modules/slack/components/SlackAuthContainer/SlackAuthContainer.mjs.map +1 -1
- package/dist/esm/modules/slack/components/SlackAuthContainer/index.mjs +2 -0
- package/dist/esm/modules/slack/components/SlackChannelCombobox/SlackChannelCombobox.mjs +100 -66
- package/dist/esm/modules/slack/components/SlackChannelCombobox/SlackChannelCombobox.mjs.map +1 -1
- package/dist/esm/modules/slack/components/SlackChannelCombobox/SlackConnectionError.mjs +11 -14
- package/dist/esm/modules/slack/components/SlackChannelCombobox/SlackConnectionError.mjs.map +1 -1
- package/dist/esm/modules/slack/components/SlackChannelCombobox/SlackErrorMessage.mjs +23 -11
- package/dist/esm/modules/slack/components/SlackChannelCombobox/SlackErrorMessage.mjs.map +1 -1
- package/dist/esm/modules/slack/components/SlackChannelCombobox/index.mjs +2 -0
- package/dist/esm/modules/slack/components/SlackIcon/SlackIcon.mjs +32 -12
- package/dist/esm/modules/slack/components/SlackIcon/SlackIcon.mjs.map +1 -1
- package/dist/esm/modules/slack/components/SlackIcon/index.mjs +2 -0
- package/dist/esm/modules/slack/index.mjs +7 -0
- package/dist/esm/modules/slack/utils.mjs +6 -5
- package/dist/esm/modules/slack/utils.mjs.map +1 -1
- package/dist/esm/next/KnockGuideLocationSensor.mjs +37 -37
- package/dist/esm/next/KnockGuideLocationSensor.mjs.map +1 -1
- package/dist/esm/next.mjs +2 -5
- package/dist/esm/tanstack/KnockGuideLocationSensor.mjs +16 -19
- package/dist/esm/tanstack/KnockGuideLocationSensor.mjs.map +1 -1
- package/dist/esm/tanstack.mjs +2 -5
- package/dist/index.css +1 -1
- package/package.json +20 -22
- package/dist/cjs/index.js.map +0 -1
- package/dist/cjs/modules/guide/components/Toolbar/styles.css.inline.js +0 -2
- package/dist/cjs/modules/guide/components/Toolbar/styles.css.inline.js.map +0 -1
- package/dist/cjs/next.js.map +0 -1
- package/dist/cjs/tanstack.js.map +0 -1
- package/dist/esm/index.mjs.map +0 -1
- package/dist/esm/modules/guide/components/Toolbar/styles.css.inline.mjs +0 -5
- package/dist/esm/modules/guide/components/Toolbar/styles.css.inline.mjs.map +0 -1
- package/dist/esm/next.mjs.map +0 -1
- package/dist/esm/tanstack.mjs.map +0 -1
|
@@ -1,145 +1,231 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { Icon as A } from "@telegraph/icon";
|
|
4
|
-
import { Box as f, Stack as i } from "@telegraph/layout";
|
|
5
|
-
import { Tag as C } from "@telegraph/tag";
|
|
6
|
-
import { Tooltip as h } from "@telegraph/tooltip";
|
|
7
|
-
import { Text as y } from "@telegraph/typography";
|
|
8
|
-
import { Gauge as D } from "lucide-react";
|
|
9
|
-
import * as t from "react";
|
|
10
|
-
import { GuideAnnotatedStatusDot as c } from "./GuideAnnotatedStatusDot.mjs";
|
|
11
|
-
import { GuideRowDetails as z, getSelectableStatusSummary as w } from "./GuideRowDetails.mjs";
|
|
12
|
-
import { sharedTooltipProps as E } from "./helpers.mjs";
|
|
1
|
+
import { sharedTooltipProps as e } from "./helpers.mjs";
|
|
2
|
+
import { GuideAnnotatedStatusDot as t } from "./GuideAnnotatedStatusDot.mjs";
|
|
13
3
|
import { isUncommittedGuide as n } from "./useInspectGuideClientStore.mjs";
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
4
|
+
import { GuideRowDetails as r, getSelectableStatusSummary as i } from "./GuideRowDetails.mjs";
|
|
5
|
+
import { useGuideContext as a, useStore as o } from "@knocklabs/react-core";
|
|
6
|
+
import * as s from "react";
|
|
7
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
8
|
+
import { Button as u } from "@telegraph/button";
|
|
9
|
+
import { Icon as d } from "@telegraph/icon";
|
|
10
|
+
import { Box as f, Stack as p } from "@telegraph/layout";
|
|
11
|
+
import { Tooltip as m } from "@telegraph/tooltip";
|
|
12
|
+
import { Text as h } from "@telegraph/typography";
|
|
13
|
+
import { Gauge as g } from "lucide-react";
|
|
14
|
+
import { Tag as _ } from "@telegraph/tag";
|
|
15
|
+
//#region src/modules/guide/components/Toolbar/V2/GuideRow.tsx
|
|
16
|
+
var v = "data-kgt-guide-row-key", y = ({ label: e, color: t = "gray", children: n }) => /* @__PURE__ */ l(p, {
|
|
17
|
+
direction: "row",
|
|
18
|
+
align: "center",
|
|
19
|
+
gap: "0_5",
|
|
20
|
+
px: "1",
|
|
21
|
+
height: "5",
|
|
22
|
+
bg: "surface-2",
|
|
23
|
+
rounded: "full",
|
|
24
|
+
border: "px",
|
|
25
|
+
borderColor: "gray-4",
|
|
26
|
+
children: [/* @__PURE__ */ c(h, {
|
|
27
|
+
as: "span",
|
|
28
|
+
size: "0",
|
|
29
|
+
color: t,
|
|
30
|
+
weight: "medium",
|
|
31
|
+
children: e
|
|
32
|
+
}), n]
|
|
33
|
+
}), b = (e) => {
|
|
34
|
+
if (n(e)) return {
|
|
35
|
+
color: "red",
|
|
36
|
+
label: "Inactive",
|
|
37
|
+
description: "This guide has never been committed and published yet"
|
|
38
|
+
};
|
|
39
|
+
let { annotation: t } = e;
|
|
40
|
+
if (!t.active.status) return {
|
|
41
|
+
color: "red",
|
|
42
|
+
label: "Inactive",
|
|
43
|
+
description: "This guide is inactive"
|
|
44
|
+
};
|
|
45
|
+
if (t.archived.status) return {
|
|
46
|
+
color: "red",
|
|
47
|
+
label: "Archived",
|
|
48
|
+
description: "User has already dismissed this guide"
|
|
49
|
+
};
|
|
50
|
+
if (!t.targetable.status) return {
|
|
51
|
+
color: "red",
|
|
52
|
+
label: "Not targeted",
|
|
53
|
+
description: t.targetable.message
|
|
54
|
+
};
|
|
55
|
+
let r = i(t.selectable.status);
|
|
56
|
+
return t.selectable.status === void 0 ? r : t.activatable.status ? {
|
|
57
|
+
...r,
|
|
58
|
+
...t.selectable.status === "returned" ? { label: "Display" } : void 0
|
|
59
|
+
} : {
|
|
60
|
+
color: "red",
|
|
61
|
+
label: "Not activated",
|
|
62
|
+
description: "This guide cannot be activated in the current location"
|
|
63
|
+
};
|
|
64
|
+
}, x = (e) => {
|
|
65
|
+
if (n(e)) return {
|
|
66
|
+
active: { color: "gray" },
|
|
67
|
+
archived: { color: "gray" },
|
|
68
|
+
targetable: { color: "gray" },
|
|
69
|
+
activatable: { color: "gray" },
|
|
70
|
+
selectable: { color: "gray" }
|
|
71
|
+
};
|
|
72
|
+
let { annotation: t } = e, r = {
|
|
73
|
+
color: t.active.status ? "blue" : "red",
|
|
74
|
+
tooltip: `Active: ${t.active.status ? "Yes" : "No"}`
|
|
75
|
+
}, a = {
|
|
76
|
+
color: t.archived.status ? "red" : "blue",
|
|
77
|
+
tooltip: `Archived: ${t.archived.status ? "Yes" : "No"}`
|
|
78
|
+
}, o = {
|
|
79
|
+
color: t.targetable.status ? "blue" : "red",
|
|
80
|
+
tooltip: `Targeting: ${t.targetable.status ? "Yes" : "No"}`
|
|
81
|
+
}, s = {
|
|
82
|
+
color: t.activatable.status ? "blue" : "red",
|
|
83
|
+
tooltip: `Activated: ${t.activatable.status ? "Yes" : "No"}`
|
|
84
|
+
}, c = i(t.selectable.status);
|
|
85
|
+
return {
|
|
86
|
+
active: r,
|
|
87
|
+
archived: a,
|
|
88
|
+
targetable: o,
|
|
89
|
+
activatable: s,
|
|
90
|
+
selectable: {
|
|
91
|
+
color: c.color,
|
|
92
|
+
tooltip: c.label
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
}, S = ({ guide: i, orderIndex: S, isExpanded: C, onClick: w }) => {
|
|
96
|
+
let { client: T } = a(), { debugSettings: E } = o(T.store, (e) => ({ debugSettings: e.debug || {} })), [D, O] = s.useState(!1), k = E.focusedGuideKeys || {}, A = Object.keys(k).length > 0, j = !!k[i.key], M = x(i), N = b(i), P = { [v]: i.key };
|
|
97
|
+
return /* @__PURE__ */ l(f, {
|
|
98
|
+
rounded: "3",
|
|
99
|
+
overflow: "hidden",
|
|
100
|
+
border: "px",
|
|
101
|
+
borderStyle: "solid",
|
|
102
|
+
borderColor: C ? "gray-6" : "transparent",
|
|
103
|
+
onMouseEnter: () => O(!0),
|
|
104
|
+
onMouseLeave: () => O(!1),
|
|
105
|
+
style: { cursor: "pointer" },
|
|
106
|
+
...P,
|
|
107
|
+
children: [/* @__PURE__ */ l(p, {
|
|
108
|
+
h: "7",
|
|
109
|
+
px: "1",
|
|
110
|
+
gap: "1",
|
|
111
|
+
align: "center",
|
|
112
|
+
justify: "space-between",
|
|
113
|
+
rounded: "3",
|
|
114
|
+
overflow: "hidden",
|
|
115
|
+
border: "px",
|
|
116
|
+
borderStyle: "solid",
|
|
117
|
+
borderColor: C ? "transparent" : j ? "gray-6" : D ? "gray-4" : "transparent",
|
|
118
|
+
backgroundColor: C ? "surface-2" : j ? "gray-2" : D ? "surface-2" : "transparent",
|
|
119
|
+
onClick: () => w(i.key),
|
|
120
|
+
children: [/* @__PURE__ */ l(p, {
|
|
121
|
+
align: "center",
|
|
122
|
+
gap: "1_5",
|
|
123
|
+
style: {
|
|
124
|
+
minWidth: 0,
|
|
125
|
+
flex: 1
|
|
126
|
+
},
|
|
127
|
+
children: [/* @__PURE__ */ l(p, {
|
|
128
|
+
w: "7",
|
|
129
|
+
justify: "space-between",
|
|
130
|
+
align: "center",
|
|
131
|
+
gap: "0_5",
|
|
132
|
+
children: [/* @__PURE__ */ c(f, {
|
|
133
|
+
w: "3",
|
|
134
|
+
children: !i.bypass_global_group_limit && /* @__PURE__ */ c(d, {
|
|
135
|
+
icon: g,
|
|
136
|
+
size: "0",
|
|
137
|
+
color: "gray",
|
|
138
|
+
alt: "Subject to throttling"
|
|
139
|
+
})
|
|
140
|
+
}), /* @__PURE__ */ c(h, {
|
|
141
|
+
as: "span",
|
|
142
|
+
size: "1",
|
|
143
|
+
weight: "medium",
|
|
144
|
+
color: i.bypass_global_group_limit ? "blue" : "default",
|
|
145
|
+
style: { flexShrink: 0 },
|
|
146
|
+
children: S + 1
|
|
147
|
+
})]
|
|
148
|
+
}), /* @__PURE__ */ c(m, {
|
|
149
|
+
label: `${i.key}${i.bypass_global_group_limit ? " (unthrottled)" : ""}`,
|
|
150
|
+
...e,
|
|
151
|
+
children: /* @__PURE__ */ c(h, {
|
|
152
|
+
as: "code",
|
|
153
|
+
size: "1",
|
|
154
|
+
weight: "medium",
|
|
155
|
+
color: "default",
|
|
156
|
+
style: {
|
|
157
|
+
display: "block",
|
|
158
|
+
overflow: "hidden",
|
|
159
|
+
textOverflow: "ellipsis",
|
|
160
|
+
whiteSpace: "nowrap",
|
|
161
|
+
maxWidth: "200px"
|
|
162
|
+
},
|
|
163
|
+
children: i.key
|
|
164
|
+
})
|
|
165
|
+
})]
|
|
166
|
+
}), /* @__PURE__ */ l(p, {
|
|
167
|
+
align: "center",
|
|
168
|
+
gap: "1_5",
|
|
169
|
+
style: { flexShrink: 0 },
|
|
170
|
+
children: [
|
|
171
|
+
!A && /* @__PURE__ */ c(m, {
|
|
172
|
+
label: N.description,
|
|
173
|
+
...e,
|
|
174
|
+
children: /* @__PURE__ */ c(_, {
|
|
175
|
+
size: "0",
|
|
176
|
+
variant: "soft",
|
|
177
|
+
color: N.color,
|
|
178
|
+
children: N.label
|
|
179
|
+
})
|
|
180
|
+
}),
|
|
181
|
+
/* @__PURE__ */ l(y, {
|
|
182
|
+
label: "Elig:",
|
|
183
|
+
color: n(i) ? "disabled" : i.annotation.isEligible ? "blue" : "gray",
|
|
184
|
+
children: [
|
|
185
|
+
/* @__PURE__ */ c(t, {
|
|
186
|
+
color: M.active.color,
|
|
187
|
+
tooltip: M.active.tooltip
|
|
188
|
+
}),
|
|
189
|
+
/* @__PURE__ */ c(t, {
|
|
190
|
+
color: M.archived.color,
|
|
191
|
+
tooltip: M.archived.tooltip
|
|
192
|
+
}),
|
|
193
|
+
/* @__PURE__ */ c(t, {
|
|
194
|
+
color: M.targetable.color,
|
|
195
|
+
tooltip: M.targetable.tooltip
|
|
196
|
+
})
|
|
197
|
+
]
|
|
198
|
+
}),
|
|
199
|
+
/* @__PURE__ */ l(y, {
|
|
200
|
+
label: "Vis:",
|
|
201
|
+
color: n(i) ? "disabled" : i.annotation.isQualified && i.annotation.selectable.status === "returned" ? "blue" : "gray",
|
|
202
|
+
children: [/* @__PURE__ */ c(t, {
|
|
203
|
+
color: M.activatable.color,
|
|
204
|
+
tooltip: M.activatable.tooltip
|
|
205
|
+
}), /* @__PURE__ */ c(t, {
|
|
206
|
+
color: M.selectable.color,
|
|
207
|
+
tooltip: M.selectable.tooltip
|
|
208
|
+
})]
|
|
209
|
+
}),
|
|
210
|
+
/* @__PURE__ */ c(u, {
|
|
211
|
+
size: "0",
|
|
212
|
+
variant: j ? "solid" : "outline",
|
|
213
|
+
color: j ? "blue" : "gray",
|
|
214
|
+
disabled: n(i) || i.annotation.selectable.status === void 0,
|
|
215
|
+
onClick: (e) => {
|
|
216
|
+
e.stopPropagation(), T.setDebug({
|
|
217
|
+
...E,
|
|
218
|
+
focusedGuideKeys: j ? {} : { [i.key]: !0 }
|
|
219
|
+
});
|
|
220
|
+
},
|
|
221
|
+
children: "Focus"
|
|
222
|
+
})
|
|
223
|
+
]
|
|
224
|
+
})]
|
|
225
|
+
}), C && /* @__PURE__ */ c(r, { guide: i })]
|
|
226
|
+
});
|
|
140
227
|
};
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
//# sourceMappingURL=GuideRow.mjs.map
|
|
228
|
+
//#endregion
|
|
229
|
+
export { v as GUIDE_ROW_DATA_SELECTOR, S as GuideRow };
|
|
230
|
+
|
|
231
|
+
//# sourceMappingURL=GuideRow.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GuideRow.mjs","sources":["../../../../../../../src/modules/guide/components/Toolbar/V2/GuideRow.tsx"],"sourcesContent":["import { useGuideContext, useStore } from \"@knocklabs/react-core\";\nimport { Button } from \"@telegraph/button\";\nimport { Icon } from \"@telegraph/icon\";\nimport { Box, Stack } from \"@telegraph/layout\";\nimport { Tag } from \"@telegraph/tag\";\nimport { Tooltip } from \"@telegraph/tooltip\";\nimport { Text } from \"@telegraph/typography\";\nimport { Gauge } from \"lucide-react\";\nimport * as React from \"react\";\n\nimport {\n StatusColor,\n GuideAnnotatedStatusDot as StatusDot,\n} from \"./GuideAnnotatedStatusDot\";\nimport {\n GuideRowDetails,\n StatusSummary,\n getSelectableStatusSummary,\n} from \"./GuideRowDetails\";\nimport { sharedTooltipProps } from \"./helpers\";\nimport {\n AnnotatedGuide,\n AnnotatedStatuses,\n UncommittedGuide,\n isUncommittedGuide,\n} from \"./useInspectGuideClientStore\";\n\nexport const GUIDE_ROW_DATA_SELECTOR = \"data-kgt-guide-row-key\";\n\nconst Pill = ({\n label,\n color = \"gray\",\n children,\n}: {\n label: string;\n color?: StatusColor | \"disabled\";\n children: React.ReactNode;\n}) => {\n return (\n <Stack\n direction=\"row\"\n align=\"center\"\n gap=\"0_5\"\n px=\"1\"\n height=\"5\"\n bg=\"surface-2\"\n rounded=\"full\"\n border=\"px\"\n borderColor=\"gray-4\"\n >\n <Text as=\"span\" size=\"0\" color={color} weight=\"medium\">\n {label}\n </Text>\n {children}\n </Stack>\n );\n};\n\nconst getStatusSummary = (\n guide: AnnotatedGuide | UncommittedGuide,\n): StatusSummary => {\n if (isUncommittedGuide(guide)) {\n return {\n color: \"red\",\n label: \"Inactive\",\n description: \"This guide has never been committed and published yet\",\n };\n }\n\n const { annotation } = guide;\n\n if (!annotation.active.status) {\n return {\n color: \"red\",\n label: \"Inactive\",\n description: \"This guide is inactive\",\n };\n }\n if (annotation.archived.status) {\n return {\n color: \"red\",\n label: \"Archived\",\n description: \"User has already dismissed this guide\",\n };\n }\n if (!annotation.targetable.status) {\n return {\n color: \"red\",\n label: \"Not targeted\",\n description: annotation.targetable.message,\n };\n }\n\n const selectableStatusSummary = getSelectableStatusSummary(\n annotation.selectable.status,\n );\n\n // Prioritize an undefined selectable status ahead of activatable status.\n if (annotation.selectable.status === undefined) {\n return selectableStatusSummary;\n }\n\n if (!annotation.activatable.status) {\n return {\n color: \"red\",\n label: \"Not activated\",\n description: \"This guide cannot be activated in the current location\",\n };\n }\n\n return {\n ...selectableStatusSummary,\n\n // Shorten the label we display here for space.\n ...(annotation.selectable.status === \"returned\"\n ? { label: \"Display\" }\n : undefined),\n };\n};\n\ntype StatusDot = {\n color: StatusColor;\n tooltip?: string;\n};\n\nconst getStatusDots = (\n guide: AnnotatedGuide | UncommittedGuide,\n): Record<keyof AnnotatedStatuses, StatusDot> => {\n if (isUncommittedGuide(guide)) {\n return {\n active: { color: \"gray\" },\n archived: { color: \"gray\" },\n targetable: { color: \"gray\" },\n activatable: { color: \"gray\" },\n selectable: { color: \"gray\" },\n };\n }\n\n const { annotation } = guide;\n\n const active: StatusDot = {\n color: annotation.active.status ? \"blue\" : \"red\",\n tooltip: `Active: ${annotation.active.status ? \"Yes\" : \"No\"}`,\n };\n\n const archived: StatusDot = {\n color: annotation.archived.status ? \"red\" : \"blue\",\n tooltip: `Archived: ${annotation.archived.status ? \"Yes\" : \"No\"}`,\n };\n\n const targetable: StatusDot = {\n color: annotation.targetable.status ? \"blue\" : \"red\",\n tooltip: `Targeting: ${annotation.targetable.status ? \"Yes\" : \"No\"}`,\n };\n\n const activatable: StatusDot = {\n color: annotation.activatable.status ? \"blue\" : \"red\",\n tooltip: `Activated: ${annotation.activatable.status ? \"Yes\" : \"No\"}`,\n };\n\n const selectableStatusSummary = getSelectableStatusSummary(\n annotation.selectable.status,\n );\n\n const selectable = {\n color: selectableStatusSummary.color,\n tooltip: selectableStatusSummary.label,\n };\n\n return { active, archived, targetable, activatable, selectable };\n};\n\ntype Props = {\n guide: UncommittedGuide | AnnotatedGuide;\n orderIndex: number;\n isExpanded: boolean;\n onClick: (guideKey: string) => void;\n};\n\nexport const GuideRow = ({ guide, orderIndex, isExpanded, onClick }: Props) => {\n const { client } = useGuideContext();\n const { debugSettings } = useStore(client.store, (state) => ({\n debugSettings: state.debug || {},\n }));\n const [isHovered, setIsHovered] = React.useState(false);\n\n const focusedGuideKeys = debugSettings.focusedGuideKeys || {};\n const hasFocus = Object.keys(focusedGuideKeys).length > 0;\n const isFocused = !!focusedGuideKeys[guide.key];\n\n const dots = getStatusDots(guide);\n const summary = getStatusSummary(guide);\n const dataAttrs = { [GUIDE_ROW_DATA_SELECTOR]: guide.key };\n\n return (\n <Box\n rounded=\"3\"\n overflow=\"hidden\"\n border=\"px\"\n borderStyle=\"solid\"\n borderColor={isExpanded ? \"gray-6\" : \"transparent\"}\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => setIsHovered(false)}\n style={{ cursor: \"pointer\" }}\n {...dataAttrs}\n >\n <Stack\n h=\"7\"\n px=\"1\"\n gap=\"1\"\n align=\"center\"\n justify=\"space-between\"\n rounded=\"3\"\n overflow=\"hidden\"\n border=\"px\"\n borderStyle=\"solid\"\n borderColor={\n isExpanded\n ? \"transparent\"\n : isFocused\n ? \"gray-6\"\n : isHovered\n ? \"gray-4\"\n : \"transparent\"\n }\n backgroundColor={\n isExpanded\n ? \"surface-2\"\n : isFocused\n ? \"gray-2\"\n : isHovered\n ? \"surface-2\"\n : \"transparent\"\n }\n onClick={() => onClick(guide.key)}\n >\n {/* Left section: order + key */}\n <Stack align=\"center\" gap=\"1_5\" style={{ minWidth: 0, flex: 1 }}>\n <Stack w=\"7\" justify=\"space-between\" align=\"center\" gap=\"0_5\">\n <Box w=\"3\">\n {!guide.bypass_global_group_limit && (\n <Icon\n icon={Gauge}\n size=\"0\"\n color=\"gray\"\n alt=\"Subject to throttling\"\n />\n )}\n </Box>\n <Text\n as=\"span\"\n size=\"1\"\n weight=\"medium\"\n color={guide.bypass_global_group_limit ? \"blue\" : \"default\"}\n style={{ flexShrink: 0 }}\n >\n {orderIndex + 1}\n </Text>\n </Stack>\n <Tooltip\n label={`${guide.key}${guide.bypass_global_group_limit ? \" (unthrottled)\" : \"\"}`}\n {...sharedTooltipProps}\n >\n <Text\n as=\"code\"\n size=\"1\"\n weight=\"medium\"\n color=\"default\"\n style={{\n display: \"block\",\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n maxWidth: \"200px\",\n }}\n >\n {guide.key}\n </Text>\n </Tooltip>\n </Stack>\n\n {/* Right section: verdict + pills + focus */}\n <Stack align=\"center\" gap=\"1_5\" style={{ flexShrink: 0 }}>\n {!hasFocus && (\n <Tooltip label={summary.description} {...sharedTooltipProps}>\n <Tag size=\"0\" variant=\"soft\" color={summary.color}>\n {summary.label}\n </Tag>\n </Tooltip>\n )}\n\n <Pill\n label=\"Elig:\"\n color={\n isUncommittedGuide(guide)\n ? \"disabled\"\n : guide.annotation.isEligible\n ? \"blue\"\n : \"gray\"\n }\n >\n <StatusDot\n color={dots.active.color}\n tooltip={dots.active.tooltip!}\n />\n <StatusDot\n color={dots.archived.color}\n tooltip={dots.archived.tooltip!}\n />\n <StatusDot\n color={dots.targetable.color}\n tooltip={dots.targetable.tooltip!}\n />\n </Pill>\n <Pill\n label=\"Vis:\"\n color={\n isUncommittedGuide(guide)\n ? \"disabled\"\n : guide.annotation.isQualified &&\n guide.annotation.selectable.status === \"returned\"\n ? \"blue\"\n : \"gray\"\n }\n >\n <StatusDot\n color={dots.activatable.color}\n tooltip={dots.activatable.tooltip!}\n />\n <StatusDot\n color={dots.selectable.color}\n tooltip={dots.selectable.tooltip!}\n />\n </Pill>\n\n <Button\n size=\"0\"\n variant={isFocused ? \"solid\" : \"outline\"}\n color={isFocused ? \"blue\" : \"gray\"}\n disabled={\n isUncommittedGuide(guide) ||\n guide.annotation.selectable.status === undefined\n }\n onClick={(e: React.MouseEvent) => {\n e.stopPropagation();\n client.setDebug({\n ...debugSettings,\n focusedGuideKeys: isFocused ? {} : { [guide.key]: true },\n });\n }}\n >\n Focus\n </Button>\n </Stack>\n </Stack>\n\n {isExpanded && <GuideRowDetails guide={guide} />}\n </Box>\n );\n};\n"],"names":["GUIDE_ROW_DATA_SELECTOR","Pill","label","color","children","React","Stack","Text","getStatusSummary","guide","isUncommittedGuide","description","annotation","active","status","archived","targetable","message","selectableStatusSummary","getSelectableStatusSummary","selectable","undefined","activatable","getStatusDots","tooltip","GuideRow","orderIndex","isExpanded","onClick","client","useGuideContext","debugSettings","useStore","store","state","debug","isHovered","setIsHovered","useState","focusedGuideKeys","hasFocus","Object","keys","length","isFocused","key","dots","summary","dataAttrs","Box","cursor","minWidth","flex","bypass_global_group_limit","Icon","Gauge","flexShrink","Tooltip","sharedTooltipProps","display","overflow","textOverflow","whiteSpace","maxWidth","Tag","isEligible","StatusDot","isQualified","Button","e","stopPropagation","setDebug","GuideRowDetails"],"mappings":";;;;;;;;;;;;;AA2BO,MAAMA,IAA0B,0BAEjCC,IAAOA,CAAC;AAAA,EACZC,OAAAA;AAAAA,EACAC,OAAAA,IAAQ;AAAA,EACRC,UAAAA;AAKF,MAEK,gBAAAC,EAAA,cAAAC,GAAA,EACC,WAAU,OACV,OAAM,UACN,KAAI,OACJ,IAAG,KACH,QAAO,KACP,IAAG,aACH,SAAQ,QACR,QAAO,MACP,aAAY,SAEZ,GAAA,gBAAAD,EAAA,cAACE,KAAK,IAAG,QAAO,MAAK,KAAI,OAAAJ,GAAc,QAAO,YAC3CD,CACH,GACCE,CACH,GAIEI,IAAmBA,CACvBC,MACkB;AACdC,MAAAA,EAAmBD,CAAK;AACnB,WAAA;AAAA,MACLN,OAAO;AAAA,MACPD,OAAO;AAAA,MACPS,aAAa;AAAA,IACf;AAGI,QAAA;AAAA,IAAEC,YAAAA;AAAAA,EAAAA,IAAeH;AAEnB,MAAA,CAACG,EAAWC,OAAOC;AACd,WAAA;AAAA,MACLX,OAAO;AAAA,MACPD,OAAO;AAAA,MACPS,aAAa;AAAA,IACf;AAEEC,MAAAA,EAAWG,SAASD;AACf,WAAA;AAAA,MACLX,OAAO;AAAA,MACPD,OAAO;AAAA,MACPS,aAAa;AAAA,IACf;AAEE,MAAA,CAACC,EAAWI,WAAWF;AAClB,WAAA;AAAA,MACLX,OAAO;AAAA,MACPD,OAAO;AAAA,MACPS,aAAaC,EAAWI,WAAWC;AAAAA,IACrC;AAGF,QAAMC,IAA0BC,EAC9BP,EAAWQ,WAAWN,MACxB;AAGIF,SAAAA,EAAWQ,WAAWN,WAAW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MAAA;AAAA,IAAK,CACxD;AAAA,EAAA,KACD,OAGJ,CACF,CACF,GAEClB,KAAc,gBAAAtB,EAAA,cAACmE,GAAgB,EAAA,OAAA/D,EAAA,CAAgB,CAClD;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"GuideRow.mjs","names":[],"sources":["../../../../../../../src/modules/guide/components/Toolbar/V2/GuideRow.tsx"],"sourcesContent":["import { useGuideContext, useStore } from \"@knocklabs/react-core\";\nimport { Button } from \"@telegraph/button\";\nimport { Icon } from \"@telegraph/icon\";\nimport { Box, Stack } from \"@telegraph/layout\";\nimport { Tag } from \"@telegraph/tag\";\nimport { Tooltip } from \"@telegraph/tooltip\";\nimport { Text } from \"@telegraph/typography\";\nimport { Gauge } from \"lucide-react\";\nimport * as React from \"react\";\n\nimport {\n StatusColor,\n GuideAnnotatedStatusDot as StatusDot,\n} from \"./GuideAnnotatedStatusDot\";\nimport {\n GuideRowDetails,\n StatusSummary,\n getSelectableStatusSummary,\n} from \"./GuideRowDetails\";\nimport { sharedTooltipProps } from \"./helpers\";\nimport {\n AnnotatedGuide,\n AnnotatedStatuses,\n UncommittedGuide,\n isUncommittedGuide,\n} from \"./useInspectGuideClientStore\";\n\nexport const GUIDE_ROW_DATA_SELECTOR = \"data-kgt-guide-row-key\";\n\nconst Pill = ({\n label,\n color = \"gray\",\n children,\n}: {\n label: string;\n color?: StatusColor | \"disabled\";\n children: React.ReactNode;\n}) => {\n return (\n <Stack\n direction=\"row\"\n align=\"center\"\n gap=\"0_5\"\n px=\"1\"\n height=\"5\"\n bg=\"surface-2\"\n rounded=\"full\"\n border=\"px\"\n borderColor=\"gray-4\"\n >\n <Text as=\"span\" size=\"0\" color={color} weight=\"medium\">\n {label}\n </Text>\n {children}\n </Stack>\n );\n};\n\nconst getStatusSummary = (\n guide: AnnotatedGuide | UncommittedGuide,\n): StatusSummary => {\n if (isUncommittedGuide(guide)) {\n return {\n color: \"red\",\n label: \"Inactive\",\n description: \"This guide has never been committed and published yet\",\n };\n }\n\n const { annotation } = guide;\n\n if (!annotation.active.status) {\n return {\n color: \"red\",\n label: \"Inactive\",\n description: \"This guide is inactive\",\n };\n }\n if (annotation.archived.status) {\n return {\n color: \"red\",\n label: \"Archived\",\n description: \"User has already dismissed this guide\",\n };\n }\n if (!annotation.targetable.status) {\n return {\n color: \"red\",\n label: \"Not targeted\",\n description: annotation.targetable.message,\n };\n }\n\n const selectableStatusSummary = getSelectableStatusSummary(\n annotation.selectable.status,\n );\n\n // Prioritize an undefined selectable status ahead of activatable status.\n if (annotation.selectable.status === undefined) {\n return selectableStatusSummary;\n }\n\n if (!annotation.activatable.status) {\n return {\n color: \"red\",\n label: \"Not activated\",\n description: \"This guide cannot be activated in the current location\",\n };\n }\n\n return {\n ...selectableStatusSummary,\n\n // Shorten the label we display here for space.\n ...(annotation.selectable.status === \"returned\"\n ? { label: \"Display\" }\n : undefined),\n };\n};\n\ntype StatusDot = {\n color: StatusColor;\n tooltip?: string;\n};\n\nconst getStatusDots = (\n guide: AnnotatedGuide | UncommittedGuide,\n): Record<keyof AnnotatedStatuses, StatusDot> => {\n if (isUncommittedGuide(guide)) {\n return {\n active: { color: \"gray\" },\n archived: { color: \"gray\" },\n targetable: { color: \"gray\" },\n activatable: { color: \"gray\" },\n selectable: { color: \"gray\" },\n };\n }\n\n const { annotation } = guide;\n\n const active: StatusDot = {\n color: annotation.active.status ? \"blue\" : \"red\",\n tooltip: `Active: ${annotation.active.status ? \"Yes\" : \"No\"}`,\n };\n\n const archived: StatusDot = {\n color: annotation.archived.status ? \"red\" : \"blue\",\n tooltip: `Archived: ${annotation.archived.status ? \"Yes\" : \"No\"}`,\n };\n\n const targetable: StatusDot = {\n color: annotation.targetable.status ? \"blue\" : \"red\",\n tooltip: `Targeting: ${annotation.targetable.status ? \"Yes\" : \"No\"}`,\n };\n\n const activatable: StatusDot = {\n color: annotation.activatable.status ? \"blue\" : \"red\",\n tooltip: `Activated: ${annotation.activatable.status ? \"Yes\" : \"No\"}`,\n };\n\n const selectableStatusSummary = getSelectableStatusSummary(\n annotation.selectable.status,\n );\n\n const selectable = {\n color: selectableStatusSummary.color,\n tooltip: selectableStatusSummary.label,\n };\n\n return { active, archived, targetable, activatable, selectable };\n};\n\ntype Props = {\n guide: UncommittedGuide | AnnotatedGuide;\n orderIndex: number;\n isExpanded: boolean;\n onClick: (guideKey: string) => void;\n};\n\nexport const GuideRow = ({ guide, orderIndex, isExpanded, onClick }: Props) => {\n const { client } = useGuideContext();\n const { debugSettings } = useStore(client.store, (state) => ({\n debugSettings: state.debug || {},\n }));\n const [isHovered, setIsHovered] = React.useState(false);\n\n const focusedGuideKeys = debugSettings.focusedGuideKeys || {};\n const hasFocus = Object.keys(focusedGuideKeys).length > 0;\n const isFocused = !!focusedGuideKeys[guide.key];\n\n const dots = getStatusDots(guide);\n const summary = getStatusSummary(guide);\n const dataAttrs = { [GUIDE_ROW_DATA_SELECTOR]: guide.key };\n\n return (\n <Box\n rounded=\"3\"\n overflow=\"hidden\"\n border=\"px\"\n borderStyle=\"solid\"\n borderColor={isExpanded ? \"gray-6\" : \"transparent\"}\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => setIsHovered(false)}\n style={{ cursor: \"pointer\" }}\n {...dataAttrs}\n >\n <Stack\n h=\"7\"\n px=\"1\"\n gap=\"1\"\n align=\"center\"\n justify=\"space-between\"\n rounded=\"3\"\n overflow=\"hidden\"\n border=\"px\"\n borderStyle=\"solid\"\n borderColor={\n isExpanded\n ? \"transparent\"\n : isFocused\n ? \"gray-6\"\n : isHovered\n ? \"gray-4\"\n : \"transparent\"\n }\n backgroundColor={\n isExpanded\n ? \"surface-2\"\n : isFocused\n ? \"gray-2\"\n : isHovered\n ? \"surface-2\"\n : \"transparent\"\n }\n onClick={() => onClick(guide.key)}\n >\n {/* Left section: order + key */}\n <Stack align=\"center\" gap=\"1_5\" style={{ minWidth: 0, flex: 1 }}>\n <Stack w=\"7\" justify=\"space-between\" align=\"center\" gap=\"0_5\">\n <Box w=\"3\">\n {!guide.bypass_global_group_limit && (\n <Icon\n icon={Gauge}\n size=\"0\"\n color=\"gray\"\n alt=\"Subject to throttling\"\n />\n )}\n </Box>\n <Text\n as=\"span\"\n size=\"1\"\n weight=\"medium\"\n color={guide.bypass_global_group_limit ? \"blue\" : \"default\"}\n style={{ flexShrink: 0 }}\n >\n {orderIndex + 1}\n </Text>\n </Stack>\n <Tooltip\n label={`${guide.key}${guide.bypass_global_group_limit ? \" (unthrottled)\" : \"\"}`}\n {...sharedTooltipProps}\n >\n <Text\n as=\"code\"\n size=\"1\"\n weight=\"medium\"\n color=\"default\"\n style={{\n display: \"block\",\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n maxWidth: \"200px\",\n }}\n >\n {guide.key}\n </Text>\n </Tooltip>\n </Stack>\n\n {/* Right section: verdict + pills + focus */}\n <Stack align=\"center\" gap=\"1_5\" style={{ flexShrink: 0 }}>\n {!hasFocus && (\n <Tooltip label={summary.description} {...sharedTooltipProps}>\n <Tag size=\"0\" variant=\"soft\" color={summary.color}>\n {summary.label}\n </Tag>\n </Tooltip>\n )}\n\n <Pill\n label=\"Elig:\"\n color={\n isUncommittedGuide(guide)\n ? \"disabled\"\n : guide.annotation.isEligible\n ? \"blue\"\n : \"gray\"\n }\n >\n <StatusDot\n color={dots.active.color}\n tooltip={dots.active.tooltip!}\n />\n <StatusDot\n color={dots.archived.color}\n tooltip={dots.archived.tooltip!}\n />\n <StatusDot\n color={dots.targetable.color}\n tooltip={dots.targetable.tooltip!}\n />\n </Pill>\n <Pill\n label=\"Vis:\"\n color={\n isUncommittedGuide(guide)\n ? \"disabled\"\n : guide.annotation.isQualified &&\n guide.annotation.selectable.status === \"returned\"\n ? \"blue\"\n : \"gray\"\n }\n >\n <StatusDot\n color={dots.activatable.color}\n tooltip={dots.activatable.tooltip!}\n />\n <StatusDot\n color={dots.selectable.color}\n tooltip={dots.selectable.tooltip!}\n />\n </Pill>\n\n <Button\n size=\"0\"\n variant={isFocused ? \"solid\" : \"outline\"}\n color={isFocused ? \"blue\" : \"gray\"}\n disabled={\n isUncommittedGuide(guide) ||\n guide.annotation.selectable.status === undefined\n }\n onClick={(e: React.MouseEvent) => {\n e.stopPropagation();\n client.setDebug({\n ...debugSettings,\n focusedGuideKeys: isFocused ? {} : { [guide.key]: true },\n });\n }}\n >\n Focus\n </Button>\n </Stack>\n </Stack>\n\n {isExpanded && <GuideRowDetails guide={guide} />}\n </Box>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;AA2BA,IAAa,IAA0B,0BAEjC,KAAQ,EACZ,UACA,WAAQ,QACR,kBAOE,kBAAC,GAAD;CACE,WAAU;CACV,OAAM;CACN,KAAI;CACJ,IAAG;CACH,QAAO;CACP,IAAG;CACH,SAAQ;CACR,QAAO;CACP,aAAY;WATd,CAWE,kBAAC,GAAD;EAAM,IAAG;EAAO,MAAK;EAAW;EAAO,QAAO;YAC3C;CACG,CAAA,GACL,CACI;IAIL,KACJ,MACkB;CAClB,IAAI,EAAmB,CAAK,GAC1B,OAAO;EACL,OAAO;EACP,OAAO;EACP,aAAa;CACf;CAGF,IAAM,EAAE,kBAAe;CAEvB,IAAI,CAAC,EAAW,OAAO,QACrB,OAAO;EACL,OAAO;EACP,OAAO;EACP,aAAa;CACf;CAEF,IAAI,EAAW,SAAS,QACtB,OAAO;EACL,OAAO;EACP,OAAO;EACP,aAAa;CACf;CAEF,IAAI,CAAC,EAAW,WAAW,QACzB,OAAO;EACL,OAAO;EACP,OAAO;EACP,aAAa,EAAW,WAAW;CACrC;CAGF,IAAM,IAA0B,EAC9B,EAAW,WAAW,MACxB;CAeA,OAZI,EAAW,WAAW,WAAW,KAAA,IAC5B,IAGJ,EAAW,YAAY,SAQrB;EACL,GAAG;EAGH,GAAI,EAAW,WAAW,WAAW,aACjC,EAAE,OAAO,UAAU,IACnB,KAAA;CACN,IAdS;EACL,OAAO;EACP,OAAO;EACP,aAAa;CACf;AAWJ,GAOM,KACJ,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