Link provider
Contains provider with react context for anything link related and the link http client
yarn add @atlaskit/link-provider
2.0.0
Major Changes
-
#117363
10a0f7f6c2027
- This package'speerDependencies
have been adjusted forreact
and/orreact-dom
to reflect the status of only supporting React 18 going forward. No explicit breaking change to React support has been made in this release, but this is to signify going forward, breaking changes for React 16 or React 17 may come via non-major semver releases.Please refer this community post for more details: https://community.developer.atlassian.com/t/rfc-78-dropping-support-for-react-16-and-rendering-in-a-react-18-concurrent-root-in-jira-and-confluence/87026
Patch Changes
- Updated dependencies
Note: This component is designed for internal Atlassian development.
External contributors will be able to use this component but will not be able to submit issues.
SmartCardProvider
SmartCardProvider
is a core component for managing the rendering and functionality of linking components, specifically Smart Links.
Its primary purpose is to act as a wrapper that provides context and an HTTP client, which ensures efficient rendering.
It is recommended to use a single SmartCardProvider
per page for optimal performance.
The component is responsible for data fetching and caching, interacting with the Object Resolver Service to resolve link metadata.
Prerequisites
The following packages are @atlaskit/link-provider
's peer dependencies.
Please check our package.json for versioning.
react
Installation
yarn add @atlaskit/link-provider
Usage
The following code example will render the inline Smart Link.
import { SmartCardProvider } from '@atlaskit/link-provider';
<SmartCardProvider>
<Card appearance="inline" url="https://link-url" />
</SmartCardProvider>
For setting up SmartCardProvider
for local environment and/or customisation of HTTP client that interacts with the Object Resolver Service,
please see CardClient.
Props
client
import
A client that make request to Object Resolver Service to resolve url for linking components.
See CardClient
for more details.
../../client.CardClient
cacheOptions
object
deprecated
Feature removed (EDM-2205)
maxAge number maxLoadingDelay number
storeOptions
object
The options for redux store that contains linking data.
initialState
can be used to set linking data and prevent card client to make a request to resolve the url.
initialState required @atlaskit/linking-common.CardStore
children
React.ReactNode
required
Any React components contains linking components.
React.ReactNode
renderers
object
A render function returning React component.
emoji
is used to render Smart Link icon for Confluence emoji.
adf adf => React.ReactNodeemoji function emoji, parentComponent => React.ReactNode
featureFlags
intersection
Specify feature flag value to linking components.
The use of this prop is not recommended.
Please use @atlaskit/platform-feature-flags
instead.
@atlaskit/linking-common.LinkingPlatformFeatureFlags&[flag: string] unknown required unknown
isAdminHubAIEnabled
boolean
Flag indicated whether AI feature is enabled in AdminHub. This is required for AI summary in Smart Links.
product
import
The product that linking components are rendered in. Required for features such as AI summary in Smart Links, Loom embed Smart Links, etc.
@atlaskit/linking-common.ProductType
authFlow
union
Enable and disable authentication flow. If disabled, Smart Links will not offer Connect option when the link returns forbidden nor unauthorized status.
One of "oauth2", "disabled"