@cord-sdk/react
Advanced tools
Comparing version 0.0.32 to 0.0.33
@@ -79,3 +79,3 @@ 'use strict'; | ||
}); | ||
function CordProvider({ clientAuthToken, enableTasks, enableAnnotations, blurScreenshots, showBlurredScreenshots, annotationMode, cordScriptUrl, navigate, threadOptions, children, onLoad, onInitError, }) { | ||
function CordProvider({ clientAuthToken, enableTasks, enableAnnotations, blurScreenshots, enableScreenshotCapture, showBlurredScreenshots, annotationMode, cordScriptUrl, navigate, threadOptions, children, onLoad, onInitError, }) { | ||
if ((clientAuthToken === null || clientAuthToken === void 0 ? void 0 : clientAuthToken.length) === 0) { | ||
@@ -153,5 +153,6 @@ console.warn(`CordProvider was given an empty string as token. Cord components will not be rendered.`); | ||
blur_screenshots: blurScreenshots, | ||
enable_screenshot_capture: enableScreenshotCapture, | ||
show_blurred_screenshots: showBlurredScreenshots, | ||
navigate, | ||
react_package_version: "0.0.32", | ||
react_package_version: "0.0.33", | ||
thread_options: threadOptions | ||
@@ -179,2 +180,3 @@ ? { | ||
threadOptions, | ||
enableScreenshotCapture, | ||
]); | ||
@@ -791,5 +793,3 @@ React.useEffect(() => { | ||
const [ids, setIds] = React.useState([]); | ||
const [fetchMore, setFetchMore] = React.useState( | ||
// eslint-disable-next-line @typescript-eslint/no-shadow -- Disabling for pre-existing problems. Please do not copy this comment, and consider fixing this one! | ||
(_) => (_) => { }); | ||
const [fetchMore, setFetchMore] = React.useState(() => async (_n) => { }); | ||
const { sdk } = useCordContext$1('useCordThreadIDs'); | ||
@@ -820,3 +820,5 @@ const threadsSDK = sdk === null || sdk === void 0 ? void 0 : sdk.experimental.threads; | ||
const [ids, setIds] = React.useState([]); | ||
const [fetchMore, setFetchMore] = React.useState((_) => (_n) => { }); | ||
const [fetchMore, setFetchMore] = React.useState(() => async (_n) => { }); | ||
const [loading, setLoading] = React.useState(true); | ||
const [hasMore, setHasMore] = React.useState(false); | ||
const { sdk } = useCordContext$1('useCordMessageIDs'); | ||
@@ -830,5 +832,7 @@ const messagesSDK = sdk === null || sdk === void 0 ? void 0 : sdk.experimental.messages; | ||
// eslint-disable-next-line @typescript-eslint/no-shadow | ||
({ ids, fetchMore }) => { | ||
({ ids, fetchMore, loading, hasMore }) => { | ||
setIds(ids); | ||
setFetchMore((_) => fetchMore); | ||
setFetchMore(() => fetchMore); | ||
setLoading(loading); | ||
setHasMore(hasMore); | ||
}); | ||
@@ -839,3 +843,3 @@ return () => { | ||
}, [messagesSDK, threadId]); | ||
return { ids, fetchMore }; | ||
return { ids, fetchMore, loading, hasMore }; | ||
} | ||
@@ -842,0 +846,0 @@ |
@@ -18,2 +18,3 @@ import React from 'react'; | ||
blurScreenshots?: boolean; | ||
enableScreenshotCapture?: boolean; | ||
showBlurredScreenshots?: BlurDisplayLocation; | ||
@@ -34,3 +35,3 @@ cordScriptUrl?: string; | ||
}; | ||
export declare function CordProvider({ clientAuthToken, enableTasks, enableAnnotations, blurScreenshots, showBlurredScreenshots, annotationMode, cordScriptUrl, navigate, threadOptions, children, onLoad, onInitError, }: React.PropsWithChildren<Props>): JSX.Element; | ||
export declare function CordProvider({ clientAuthToken, enableTasks, enableAnnotations, blurScreenshots, enableScreenshotCapture, showBlurredScreenshots, annotationMode, cordScriptUrl, navigate, threadOptions, children, onLoad, onInitError, }: React.PropsWithChildren<Props>): JSX.Element; | ||
export declare function useCordContext(hook: string): { | ||
@@ -37,0 +38,0 @@ sdk: ICordSDK | null; |
@@ -5,2 +5,4 @@ import type { FetchMoreCallback } from '@cord-sdk/types'; | ||
fetchMore: FetchMoreCallback; | ||
loading: boolean; | ||
hasMore: boolean; | ||
}; |
@@ -70,3 +70,3 @@ import React, { useMemo, useState, useRef, useEffect, useContext, useCallback } from 'react'; | ||
}); | ||
function CordProvider({ clientAuthToken, enableTasks, enableAnnotations, blurScreenshots, showBlurredScreenshots, annotationMode, cordScriptUrl, navigate, threadOptions, children, onLoad, onInitError, }) { | ||
function CordProvider({ clientAuthToken, enableTasks, enableAnnotations, blurScreenshots, enableScreenshotCapture, showBlurredScreenshots, annotationMode, cordScriptUrl, navigate, threadOptions, children, onLoad, onInitError, }) { | ||
if ((clientAuthToken === null || clientAuthToken === void 0 ? void 0 : clientAuthToken.length) === 0) { | ||
@@ -144,5 +144,6 @@ console.warn(`CordProvider was given an empty string as token. Cord components will not be rendered.`); | ||
blur_screenshots: blurScreenshots, | ||
enable_screenshot_capture: enableScreenshotCapture, | ||
show_blurred_screenshots: showBlurredScreenshots, | ||
navigate, | ||
react_package_version: "0.0.32", | ||
react_package_version: "0.0.33", | ||
thread_options: threadOptions | ||
@@ -170,2 +171,3 @@ ? { | ||
threadOptions, | ||
enableScreenshotCapture, | ||
]); | ||
@@ -782,5 +784,3 @@ useEffect(() => { | ||
const [ids, setIds] = useState([]); | ||
const [fetchMore, setFetchMore] = useState( | ||
// eslint-disable-next-line @typescript-eslint/no-shadow -- Disabling for pre-existing problems. Please do not copy this comment, and consider fixing this one! | ||
(_) => (_) => { }); | ||
const [fetchMore, setFetchMore] = useState(() => async (_n) => { }); | ||
const { sdk } = useCordContext$1('useCordThreadIDs'); | ||
@@ -811,3 +811,5 @@ const threadsSDK = sdk === null || sdk === void 0 ? void 0 : sdk.experimental.threads; | ||
const [ids, setIds] = useState([]); | ||
const [fetchMore, setFetchMore] = useState((_) => (_n) => { }); | ||
const [fetchMore, setFetchMore] = useState(() => async (_n) => { }); | ||
const [loading, setLoading] = useState(true); | ||
const [hasMore, setHasMore] = useState(false); | ||
const { sdk } = useCordContext$1('useCordMessageIDs'); | ||
@@ -821,5 +823,7 @@ const messagesSDK = sdk === null || sdk === void 0 ? void 0 : sdk.experimental.messages; | ||
// eslint-disable-next-line @typescript-eslint/no-shadow | ||
({ ids, fetchMore }) => { | ||
({ ids, fetchMore, loading, hasMore }) => { | ||
setIds(ids); | ||
setFetchMore((_) => fetchMore); | ||
setFetchMore(() => fetchMore); | ||
setLoading(loading); | ||
setHasMore(hasMore); | ||
}); | ||
@@ -830,3 +834,3 @@ return () => { | ||
}, [messagesSDK, threadId]); | ||
return { ids, fetchMore }; | ||
return { ids, fetchMore, loading, hasMore }; | ||
} | ||
@@ -833,0 +837,0 @@ |
{ | ||
"name": "@cord-sdk/react", | ||
"description": "React components for Cord", | ||
"version": "0.0.32", | ||
"version": "0.0.33", | ||
"homepage": "https://docs.cord.com/", | ||
@@ -22,4 +22,4 @@ "license": "MIT", | ||
"dependencies": { | ||
"@cord-sdk/types": "0.0.32", | ||
"@cord-sdk/components": "0.0.32", | ||
"@cord-sdk/types": "0.0.33", | ||
"@cord-sdk/components": "0.0.33", | ||
"lodash": "^4.17.21" | ||
@@ -31,3 +31,3 @@ }, | ||
"devDependencies": { | ||
"@cord-sdk/jsx": "0.0.32", | ||
"@cord-sdk/jsx": "0.0.33", | ||
"@types/lodash-es": "^4.17.6", | ||
@@ -34,0 +34,0 @@ "@types/react": "^17.0.43", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
100687
2042
+ Added@cord-sdk/components@0.0.33(transitive)
+ Added@cord-sdk/types@0.0.33(transitive)
- Removed@cord-sdk/components@0.0.32(transitive)
- Removed@cord-sdk/types@0.0.32(transitive)
Updated@cord-sdk/components@0.0.33
Updated@cord-sdk/types@0.0.33