UNPKG

@atlaskit/mention

Version:

A React component used to display user profiles in a list for 'Mention' functionality

68 lines (67 loc) 2.7 kB
// data is returned from team search service export var MentionType = /*#__PURE__*/function (MentionType) { MentionType[MentionType["SELF"] = 0] = "SELF"; MentionType[MentionType["RESTRICTED"] = 1] = "RESTRICTED"; MentionType[MentionType["DEFAULT"] = 2] = "DEFAULT"; return MentionType; }({}); export var UserAccessLevel = /*#__PURE__*/function (UserAccessLevel) { UserAccessLevel[UserAccessLevel["NONE"] = 0] = "NONE"; UserAccessLevel[UserAccessLevel["SITE"] = 1] = "SITE"; UserAccessLevel[UserAccessLevel["APPLICATION"] = 2] = "APPLICATION"; UserAccessLevel[UserAccessLevel["CONTAINER"] = 3] = "CONTAINER"; return UserAccessLevel; }({}); export var UserType = /*#__PURE__*/function (UserType) { UserType[UserType["DEFAULT"] = 0] = "DEFAULT"; UserType[UserType["SPECIAL"] = 1] = "SPECIAL"; UserType[UserType["APP"] = 2] = "APP"; UserType[UserType["TEAM"] = 3] = "TEAM"; UserType[UserType["SYSTEM"] = 4] = "SYSTEM"; return UserType; }({}); export var SliNames = /*#__PURE__*/function (SliNames) { SliNames["SEARCH"] = "searchUser"; SliNames["SEARCH_TEAM"] = "searchTeam"; SliNames["INITIAL_STATE"] = "initialState"; SliNames["SELECT"] = "select"; SliNames["SELECT_TEAM"] = "selectTeam"; return SliNames; }({}); export var ComponentNames = /*#__PURE__*/function (ComponentNames) { ComponentNames["TYPEAHEAD"] = "mentionTypeahead"; ComponentNames["MENTION"] = "mention"; return ComponentNames; }({}); export var Actions = /*#__PURE__*/function (Actions) { Actions["VIEWED"] = "viewed"; Actions["CLICKED"] = "clicked"; Actions["CLOSED"] = "closed"; Actions["SUCCEEDED"] = "succeeded"; Actions["FAILED"] = "failed"; return Actions; }({}); export var MentionNameStatus = /*#__PURE__*/function (MentionNameStatus) { MentionNameStatus[MentionNameStatus["UNKNOWN"] = 0] = "UNKNOWN"; MentionNameStatus[MentionNameStatus["SERVICE_ERROR"] = 1] = "SERVICE_ERROR"; MentionNameStatus[MentionNameStatus["OK"] = 2] = "OK"; return MentionNameStatus; }({}); export function isRestricted(accessLevel) { return !!accessLevel && accessLevel === UserAccessLevel[UserAccessLevel.NONE]; } export function isSpecialMention(mention) { return !!mention.userType && mention.userType === UserType[UserType.SPECIAL]; } export function isAppMention(mention) { return mention.userType && mention.userType === UserType[UserType.APP]; } export function isTeamMention(mention) { return mention.userType && mention.userType === UserType[UserType.TEAM]; } export function isSpecialMentionText(mentionText) { return mentionText && (mentionText === '@all' || mentionText === '@here'); } export var isPromise = function isPromise(p) { return !!(p && p.then); };