@selfcommunity/react-core
Version:
React Core Components useful for integrating UI Community components (react-ui).
123 lines (122 loc) • 10.5 kB
JavaScript
/**
* Cache prefixes
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.USER_OTHER_EVENTS_STATE_CACHE_PREFIX_KEY = exports.USER_EVENTS_STATE_CACHE_PREFIX_KEY = exports.USER_FOLLOWED_TOOLS_STATE_CACHE_PREFIX_KEY = exports.USER_FOLLOWERS_TOOLS_STATE_CACHE_PREFIX_KEY = exports.CATEGORIES_POPULAR_TOOLS_STATE_CACHE_PREFIX_KEY = exports.CATEGORIES_SUGGESTION_TOOLS_STATE_CACHE_PREFIX_KEY = exports.CATEGORIES_FOLLOWED_TOOLS_STATE_CACHE_PREFIX_KEY = exports.CATEGORIES_LIST_TOOLS_STATE_CACHE_PREFIX_KEY = exports.getPmSnippetObjectCacheKey = exports.PM_SNIPPET_OBJECT_CACHE_PREFIX_KEY = exports.getPmSnippetsObjectCacheKey = exports.PM_SNIPPETS_OBJECT_CACHE_PREFIX_KEY = exports.getAdvObjectCacheKey = exports.ADV_OBJECT_CACHE_PREFIX_KEY = exports.getFeedSPCacheKey = exports.FEED_CACHE_SP_KEY = exports.getVirtualizedScrollStateCacheKey = exports.VIRTUALIZED_SCROLL_STATE_CACHE_PREFIX_KEY = exports.getStateFeedCacheKey = exports.FEED_STATE_CACHE_PREFIX_KEY = exports.getFeedCacheKey = exports.FEED_CACHE_PREFIX_KEY = exports.getBroadcastMessagesObjectCacheKey = exports.BROADCAST_MESSAGES_OBJECT_CACHE_PREFIX_KEY = exports.getContributorsCachePrefixKeys = exports.getContributorsCacheKey = exports.CONTRIBUTORS_CACHE_PREFIX_KEY = exports.getIncubatorObjectCacheKey = exports.INCUBATOR_OBJECT_CACHE_PREFIX_KEY = exports.getGroupsObjectCacheKey = exports.GROUPS_OBJECT_CACHE_PREFIX_KEY = exports.getGroupObjectCacheKey = exports.GROUP_OBJECT_CACHE_PREFIX_KEY = exports.getLiveStreamObjectCacheKey = exports.LIVESTREAM_OBJECT_CACHE_PREFIX_KEY = exports.getEventsObjectCacheKey = exports.EVENTS_OBJECT_CACHE_PREFIX_KEY = exports.getEventObjectCacheKey = exports.EVENT_OBJECT_CACHE_PREFIX_KEY = exports.getCategoryObjectCacheKey = exports.CATEGORY_OBJECT_CACHE_PREFIX_KEY = exports.getCategoriesObjectCacheKey = exports.CATEGORIES_OBJECT_CACHE_PREFIX_KEY = exports.getCommentObjectsCachePrefixKeys = exports.getCommentObjectsCacheKey = exports.COMMENT_OBJECTS_CACHE_PREFIX_KEY = exports.getCommentObjectCacheKey = exports.COMMENT_OBJECT_CACHE_PREFIX_KEY = exports.getFeedObjectCacheKey = exports.FEED_OBJECT_CACHE_PREFIX_KEY = void 0;
exports.getWidgetStateCacheKey = exports.GROUPS_SUBSCRIBED_TOOLS_STATE_CACHE_PREFIX_KEY = exports.GROUPS_LIST_TOOLS_STATE_CACHE_PREFIX_KEY = exports.GROUP_REQUESTS_TOOLS_STATE_CACHE_PREFIX_KEY = exports.GROUP_MEMBERS_TOOLS_STATE_CACHE_PREFIX_KEY = exports.POLL_SUGGESTION_TOOLS_STATE_CACHE_PREFIX_KEY = exports.INCUBATOR_SUGGESTION_TOOLS_STATE_CACHE_PREFIX_KEY = exports.INCUBATOR_LIST_TOOLS_STATE_CACHE_PREFIX_KEY = exports.PEOPLE_SUGGESTION_TOOLS_STATE_CACHE_PREFIX_KEY = exports.TRENDING_PEOPLE_TOOLS_STATE_CACHE_PREFIX_KEY = exports.RELATED_FEED_TOOLS_STATE_CACHE_PREFIX_KEY = exports.TRENDING_FEED_TOOLS_STATE_CACHE_PREFIX_KEY = exports.USER_CONNECTIONS_REQUESTS_SENT_TOOLS_STATE_CACHE_PREFIX_KEY = exports.USER_CONNECTIONS_REQUESTS_TOOLS_STATE_CACHE_PREFIX_KEY = exports.USER_CONNECTIONS_TOOLS_STATE_CACHE_PREFIX_KEY = exports.EVENT_MEDIA_STATE_CACHE_PREFIX_KEY = exports.USER_LIVE_STREAM_CACHE_PREFIX_KEY = exports.USER_REQUESTS_EVENTS_STATE_CACHE_PREFIX_KEY = exports.USER_INVITED_EVENTS_STATE_CACHE_PREFIX_KEY = exports.USER_PARTECIPANTS_EVENTS_STATE_CACHE_PREFIX_KEY = void 0;
/** FEED OBJECT **/
exports.FEED_OBJECT_CACHE_PREFIX_KEY = '_fo_';
const getFeedObjectCacheKey = (id, type) => `${exports.FEED_OBJECT_CACHE_PREFIX_KEY}${type}_${id}`;
exports.getFeedObjectCacheKey = getFeedObjectCacheKey;
/** COMMMENT OBJECT **/
exports.COMMENT_OBJECT_CACHE_PREFIX_KEY = '_co_';
const getCommentObjectCacheKey = (id) => `${exports.COMMENT_OBJECT_CACHE_PREFIX_KEY}${id}`;
exports.getCommentObjectCacheKey = getCommentObjectCacheKey;
/** COMMMENT OBJECTS **/
exports.COMMENT_OBJECTS_CACHE_PREFIX_KEY = '_cos_';
const getCommentObjectsCacheKey = (id, type, next) => `${exports.COMMENT_OBJECTS_CACHE_PREFIX_KEY}${type}_${id}_${next}`;
exports.getCommentObjectsCacheKey = getCommentObjectsCacheKey;
const getCommentObjectsCachePrefixKeys = (id, type) => `${exports.COMMENT_OBJECTS_CACHE_PREFIX_KEY}${type}_${id}`;
exports.getCommentObjectsCachePrefixKeys = getCommentObjectsCachePrefixKeys;
/** CATEGORIES OBJECT **/
exports.CATEGORIES_OBJECT_CACHE_PREFIX_KEY = '_cas_';
const getCategoriesObjectCacheKey = () => `${exports.CATEGORIES_OBJECT_CACHE_PREFIX_KEY}`;
exports.getCategoriesObjectCacheKey = getCategoriesObjectCacheKey;
/** CATEGORY OBJECT **/
exports.CATEGORY_OBJECT_CACHE_PREFIX_KEY = '_ca_';
const getCategoryObjectCacheKey = (id) => `${exports.CATEGORY_OBJECT_CACHE_PREFIX_KEY}${id}`;
exports.getCategoryObjectCacheKey = getCategoryObjectCacheKey;
/** EVENT OBJECT **/
exports.EVENT_OBJECT_CACHE_PREFIX_KEY = '_evt_';
const getEventObjectCacheKey = (id) => `${exports.EVENT_OBJECT_CACHE_PREFIX_KEY}${id}`;
exports.getEventObjectCacheKey = getEventObjectCacheKey;
/** EVENTS OBJECT **/
exports.EVENTS_OBJECT_CACHE_PREFIX_KEY = '_evts_';
const getEventsObjectCacheKey = () => `${exports.EVENTS_OBJECT_CACHE_PREFIX_KEY}`;
exports.getEventsObjectCacheKey = getEventsObjectCacheKey;
/** EVENT OBJECT **/
exports.LIVESTREAM_OBJECT_CACHE_PREFIX_KEY = '_liveStream_';
const getLiveStreamObjectCacheKey = (id) => `${exports.LIVESTREAM_OBJECT_CACHE_PREFIX_KEY}${id}`;
exports.getLiveStreamObjectCacheKey = getLiveStreamObjectCacheKey;
/** GROUP OBJECT **/
exports.GROUP_OBJECT_CACHE_PREFIX_KEY = '_grp_';
const getGroupObjectCacheKey = (id) => `${exports.GROUP_OBJECT_CACHE_PREFIX_KEY}${id}`;
exports.getGroupObjectCacheKey = getGroupObjectCacheKey;
/** GROUPS OBJECT **/
exports.GROUPS_OBJECT_CACHE_PREFIX_KEY = '_grps_';
const getGroupsObjectCacheKey = () => `${exports.GROUPS_OBJECT_CACHE_PREFIX_KEY}`;
exports.getGroupsObjectCacheKey = getGroupsObjectCacheKey;
/** INCUBATOR OBJECT **/
exports.INCUBATOR_OBJECT_CACHE_PREFIX_KEY = '_inc_';
const getIncubatorObjectCacheKey = (id) => `${exports.INCUBATOR_OBJECT_CACHE_PREFIX_KEY}${id}`;
exports.getIncubatorObjectCacheKey = getIncubatorObjectCacheKey;
/** CONTRIBUTORS **/
exports.CONTRIBUTORS_CACHE_PREFIX_KEY = '_contr_';
const getContributorsCacheKey = (id, type, next) => `${exports.CONTRIBUTORS_CACHE_PREFIX_KEY}${type}_${id}_${next}`;
exports.getContributorsCacheKey = getContributorsCacheKey;
const getContributorsCachePrefixKeys = (id, type) => `${exports.CONTRIBUTORS_CACHE_PREFIX_KEY}${type}_${id}`;
exports.getContributorsCachePrefixKeys = getContributorsCachePrefixKeys;
/** BROADCAST MESSAGES OBJECT **/
exports.BROADCAST_MESSAGES_OBJECT_CACHE_PREFIX_KEY = '_bcms_';
const getBroadcastMessagesObjectCacheKey = () => `${exports.BROADCAST_MESSAGES_OBJECT_CACHE_PREFIX_KEY}`;
exports.getBroadcastMessagesObjectCacheKey = getBroadcastMessagesObjectCacheKey;
/** FEED **/
// Cache single response body
exports.FEED_CACHE_PREFIX_KEY = '_feed_';
const getFeedCacheKey = (id, next) => `${exports.FEED_CACHE_PREFIX_KEY}${id}_${next}`;
exports.getFeedCacheKey = getFeedCacheKey;
// Cache state of the feed (ex. useSCFetchFeed)
exports.FEED_STATE_CACHE_PREFIX_KEY = '_feed_st_';
const getStateFeedCacheKey = (id) => `${exports.FEED_STATE_CACHE_PREFIX_KEY}${id}`;
exports.getStateFeedCacheKey = getStateFeedCacheKey;
// Cache the state of the virtualized feed
exports.VIRTUALIZED_SCROLL_STATE_CACHE_PREFIX_KEY = '_virtualized_scroll_st_';
const getVirtualizedScrollStateCacheKey = (id) => `${exports.VIRTUALIZED_SCROLL_STATE_CACHE_PREFIX_KEY}${id}`;
exports.getVirtualizedScrollStateCacheKey = getVirtualizedScrollStateCacheKey;
// Cache feed position
exports.FEED_CACHE_SP_KEY = '_feed_spos_';
const getFeedSPCacheKey = (id) => `${exports.FEED_CACHE_SP_KEY}${id}`;
exports.getFeedSPCacheKey = getFeedSPCacheKey;
/** CUSTOM ADVERTISING **/
exports.ADV_OBJECT_CACHE_PREFIX_KEY = '_adv_';
const getAdvObjectCacheKey = (id) => `${exports.ADV_OBJECT_CACHE_PREFIX_KEY}${id}`;
exports.getAdvObjectCacheKey = getAdvObjectCacheKey;
/** PRIVATE MESSAGE SNIPPETS OBJECT **/
exports.PM_SNIPPETS_OBJECT_CACHE_PREFIX_KEY = '_pmss_';
const getPmSnippetsObjectCacheKey = () => `${exports.PM_SNIPPETS_OBJECT_CACHE_PREFIX_KEY}`;
exports.getPmSnippetsObjectCacheKey = getPmSnippetsObjectCacheKey;
/** PRIVATE MESSAGE SNIPPET OBJECT **/
exports.PM_SNIPPET_OBJECT_CACHE_PREFIX_KEY = '_pms_';
const getPmSnippetObjectCacheKey = (id) => `${exports.PM_SNIPPET_OBJECT_CACHE_PREFIX_KEY}${id}`;
exports.getPmSnippetObjectCacheKey = getPmSnippetObjectCacheKey;
/** TOOLS */
exports.CATEGORIES_LIST_TOOLS_STATE_CACHE_PREFIX_KEY = '_cListWidget_';
exports.CATEGORIES_FOLLOWED_TOOLS_STATE_CACHE_PREFIX_KEY = '_cFolWidget_';
exports.CATEGORIES_SUGGESTION_TOOLS_STATE_CACHE_PREFIX_KEY = '_cSugWidget_';
exports.CATEGORIES_POPULAR_TOOLS_STATE_CACHE_PREFIX_KEY = '_cPopWidget_';
exports.USER_FOLLOWERS_TOOLS_STATE_CACHE_PREFIX_KEY = '_uFolWidget_';
exports.USER_FOLLOWED_TOOLS_STATE_CACHE_PREFIX_KEY = '_uFoldWidget_';
exports.USER_EVENTS_STATE_CACHE_PREFIX_KEY = '_uEvents_';
exports.USER_OTHER_EVENTS_STATE_CACHE_PREFIX_KEY = '_uOtherEvents_';
exports.USER_PARTECIPANTS_EVENTS_STATE_CACHE_PREFIX_KEY = '_uPartecipantsEvents_';
exports.USER_INVITED_EVENTS_STATE_CACHE_PREFIX_KEY = '_uInvitedEvents_';
exports.USER_REQUESTS_EVENTS_STATE_CACHE_PREFIX_KEY = '_uRequestsEvents_';
exports.USER_LIVE_STREAM_CACHE_PREFIX_KEY = '_uUserLives_';
exports.EVENT_MEDIA_STATE_CACHE_PREFIX_KEY = '_eMedia_';
exports.USER_CONNECTIONS_TOOLS_STATE_CACHE_PREFIX_KEY = '_uConWidget_';
exports.USER_CONNECTIONS_REQUESTS_TOOLS_STATE_CACHE_PREFIX_KEY = '_uConReqWidget_';
exports.USER_CONNECTIONS_REQUESTS_SENT_TOOLS_STATE_CACHE_PREFIX_KEY = '_uConReqSentWidget_';
exports.TRENDING_FEED_TOOLS_STATE_CACHE_PREFIX_KEY = '_fTrendWidget_';
exports.RELATED_FEED_TOOLS_STATE_CACHE_PREFIX_KEY = '_rFeedWidget_';
exports.TRENDING_PEOPLE_TOOLS_STATE_CACHE_PREFIX_KEY = '_pTrendWidget_';
exports.PEOPLE_SUGGESTION_TOOLS_STATE_CACHE_PREFIX_KEY = '_pSugWidget_';
exports.INCUBATOR_LIST_TOOLS_STATE_CACHE_PREFIX_KEY = '_iListWidget_';
exports.INCUBATOR_SUGGESTION_TOOLS_STATE_CACHE_PREFIX_KEY = '_iSugWidget_';
exports.POLL_SUGGESTION_TOOLS_STATE_CACHE_PREFIX_KEY = '_pSugWidget_';
exports.GROUP_MEMBERS_TOOLS_STATE_CACHE_PREFIX_KEY = '_gMemWidget_';
exports.GROUP_REQUESTS_TOOLS_STATE_CACHE_PREFIX_KEY = '_gReqWidget_';
exports.GROUPS_LIST_TOOLS_STATE_CACHE_PREFIX_KEY = '_glIST_';
exports.GROUPS_SUBSCRIBED_TOOLS_STATE_CACHE_PREFIX_KEY = '_gSubWidget_';
const getWidgetStateCacheKey = (p, id = undefined) => `${p}${id !== undefined ? id : ''}`;
exports.getWidgetStateCacheKey = getWidgetStateCacheKey;
;