Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solid Notification support for useCollection #1280

Merged
merged 4 commits into from
Aug 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
397 changes: 329 additions & 68 deletions src/frontend/packages/activitypub-components/dist/index.cjs.js

Large diffs are not rendered by default.

Large diffs are not rendered by default.

35 changes: 22 additions & 13 deletions src/frontend/packages/activitypub-components/dist/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export declare namespace ACTIVITY_TYPES {
let REMOVE: string;
let TENTATIVE_REJECT: string;
let TENTATIVE_ACCEPT: string;
let TRAVAL: string;
let TRAVEL: string;
let UNDO: string;
let UPDATE: string;
let VIEW: string;
Expand Down Expand Up @@ -57,30 +57,39 @@ export function useOutbox(): {
loaded: boolean;
owner: import('react-admin').Identifier | undefined;
};
declare namespace _default {
export { arrayOf };
interface UseCollectionOptions {
dereferenceItems?: boolean;
liveUpdates?: boolean;
}
export function useCollection(
predicateOrUrl: any,
options?: {}
): {
items: undefined;
totalItems: undefined;
error: unknown;
/**
* Subscribe a collection. Supports pagination.
* @param predicateOrUrl The collection URI or the predicate to get the collection URI from the identity (webId).
* @param {UseCollectionOptions} options Defaults to `{ dereferenceItems: false, liveUpdates: true }`
*/
export const useCollection: (
predicateOrUrl: string,
options?: UseCollectionOptions
) => {
items: any[];
totalItems: number | undefined;
error: false | unknown[];
refetch: <TPageData>(
options?: (import('react-query').RefetchOptions & import('react-query').RefetchQueryFilters<TPageData>) | undefined
) => Promise<import('react-query').QueryObserverResult<import('react-query').InfiniteData<any>, unknown>>;
fetchNextPage: (
options?: import('react-query').FetchNextPageOptions | undefined
) => Promise<import('react-query').InfiniteQueryObserverResult<any, unknown>>;
addItem: (item: string | any, shouldRefetch?: boolean | number) => void;
removeItem: (item: string | any, shouldRefetch?: boolean) => void;
hasNextPage: boolean | undefined;
isLoading: boolean;
isFetching: boolean;
isFetchingNextPage: boolean;
status: 'success' | 'error' | 'loading' | 'idle';
addItem: (item: any) => void;
removeItem: (itemId: any) => void;
url: any;
hasLiveUpdates: {
status: string;
error?: any;
};
};
export function CommentsField({
source,
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsDA,wEAAyE;AClDzE;;;;;;EA0EC;;;;AKzED;;;;;;;;;;;;;;EAuHC;ACtHD;;;;;;;4CAkBC;;;;;;;;;ACpBD;;;;4CAgBC;AChBD;;;;;mDAcC;ACdD;;;;;;EAiEC;AClED,gEAwBC;ACxBD;;EAwBC;AGtBD;;;;;;;;;;;;;EAkCC","sources":["packages/activitypub-components/src/src/constants.js","packages/activitypub-components/src/src/hooks/useOutbox.js","packages/activitypub-components/src/src/components/CommentsField/CustomMention.js","packages/activitypub-components/src/src/components/CommentsField/PostCommentForm.js","packages/activitypub-components/src/src/components/CommentsField/CommentsList.js","packages/activitypub-components/src/src/utils.js","packages/activitypub-components/src/src/hooks/useCollection.js","packages/activitypub-components/src/src/components/CommentsField/CommentsField.js","packages/activitypub-components/src/src/components/CollectionList.js","packages/activitypub-components/src/src/components/ReferenceCollectionField.js","packages/activitypub-components/src/src/hooks/useInbox.js","packages/activitypub-components/src/src/hooks/useNodeinfo.js","packages/activitypub-components/src/src/hooks/useWebfinger.js","packages/activitypub-components/src/src/hooks/useMentions/MentionsList.js","packages/activitypub-components/src/src/hooks/useMentions/renderMentions.js","packages/activitypub-components/src/src/hooks/useMentions/useMentions.js","packages/activitypub-components/src/src/index.ts","packages/activitypub-components/src/index.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,"// Components\nexport { default as CommentsField } from './components/CommentsField/CommentsField';\nexport { default as CollectionList } from './components/CollectionList';\nexport { default as ReferenceCollectionField } from './components/ReferenceCollectionField';\n\n// Hooks\nexport { default as useCollection } from './hooks/useCollection';\nexport { default as useInbox } from './hooks/useInbox';\nexport { default as useNodeinfo } from './hooks/useNodeinfo';\nexport { default as useOutbox } from './hooks/useOutbox';\nexport { default as useWebfinger } from './hooks/useWebfinger';\nexport { default as useMentions } from './hooks/useMentions/useMentions';\n\n// Constants\nexport { ACTIVITY_TYPES, ACTOR_TYPES, OBJECT_TYPES, PUBLIC_URI } from './constants';\n"],"names":[],"version":3,"file":"index.d.ts.map"}
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsDA,wEAAyE;AClDzE;;;;;;EA0EC;AK5BD;IACE,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED;;;;GAIG;AACH,OAAA,MAAM,gCAAiC,MAAM,YAAW,oBAAoB;;;;;;oBA6EjE,MAAM,GAAG,GAAG,kBAAiB,OAAO,GAAG,MAAM;uBA4B7C,MAAM,GAAG,GAAG,kBAAiB,OAAO;;;;;;;gBApGkB,MAAM;gBAAU,GAAG;;CAiLnF,CAAC;AC5OF;;;;;;;4CAkBC;;;;;;;;;ACpBD;;;;4CAgBC;AChBD;;;;;mDAcC;ACdD;;;;;;EAiEC;AClED,gEAwBC;ACxBD;;EAwBC;AGtBD;;;;;;;;;;;;;EAkCC","sources":["packages/activitypub-components/src/src/constants.js","packages/activitypub-components/src/src/hooks/useOutbox.js","packages/activitypub-components/src/src/components/CommentsField/CustomMention.js","packages/activitypub-components/src/src/components/CommentsField/PostCommentForm.js","packages/activitypub-components/src/src/components/CommentsField/CommentsList.js","packages/activitypub-components/src/src/utils.ts","packages/activitypub-components/src/src/hooks/useCollection.ts","packages/activitypub-components/src/src/components/CommentsField/CommentsField.js","packages/activitypub-components/src/src/components/CollectionList.js","packages/activitypub-components/src/src/components/ReferenceCollectionField.js","packages/activitypub-components/src/src/hooks/useInbox.js","packages/activitypub-components/src/src/hooks/useNodeinfo.js","packages/activitypub-components/src/src/hooks/useWebfinger.js","packages/activitypub-components/src/src/hooks/useMentions/MentionsList.js","packages/activitypub-components/src/src/hooks/useMentions/renderMentions.js","packages/activitypub-components/src/src/hooks/useMentions/useMentions.js","packages/activitypub-components/src/src/index.ts","packages/activitypub-components/src/index.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,"// Components\nexport { default as CommentsField } from './components/CommentsField/CommentsField';\nexport { default as CollectionList } from './components/CollectionList';\nexport { default as ReferenceCollectionField } from './components/ReferenceCollectionField';\n\n// Hooks\nexport { default as useCollection } from './hooks/useCollection';\nexport { default as useInbox } from './hooks/useInbox';\nexport { default as useNodeinfo } from './hooks/useNodeinfo';\nexport { default as useOutbox } from './hooks/useOutbox';\nexport { default as useWebfinger } from './hooks/useWebfinger';\nexport { default as useMentions } from './hooks/useMentions/useMentions';\n\n// Constants\nexport { ACTIVITY_TYPES, ACTOR_TYPES, OBJECT_TYPES, PUBLIC_URI } from './constants';\n"],"names":[],"version":3,"file":"index.d.ts.map"}
Loading