npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@tridion-sites/extensions

v3.0.0

Published

Tridion Sites Extensions API

Downloads

97

Readme

Tridion Sites Extensions API

@tridion-sites/extensions provides an API for frontend extensions for Tridion Sites.

Getting Started

All extensions export an ExtensionModule object. The initialize function on this object receives an ExtensionBuilder from Tridion Sites as its argument, which gives a developer access to the extensions API.

Common functionality

This functionality can be used in any extension point and is available throughout the application.

Hooks

| Name | Description | Example | | ------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | useConfirmation | Opens a confirmation dialog with the provided options | useHelloAction | | useNotifications | Provides ability to show notifications and save them in Message Center | useHelloAction | | useUserProfile | Provides access to the current user profile information | useHelloAction |

Components and styling

Components and style constants are provided so extensions can maintain a consistent look & feel with Tridion Sites.

Layout

💡 Tip: Layout components have an exposed className prop. This allows custom styles to be added via styled-components or CSS modules.

| Name | Description | Example | | -------------------------------------------------------------------------------------------------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Block | | Users List Item | | Center | | Schema Purpose Column | | Flex | | Number Field | | Stack | | Users List |

Other components

| Name | Description | Example | | ------------------------------------------------------------------------------------------------------ | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Button | | | | Icon | | Smile Icon | | Link | | | | Text | | Number Field | | TextLink | | Item Link |

Style constants

| Name | Description | Example | | ------------------------------------------------------------------------------------------------------------------------------ | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | getBorderRadius | | Hex Color Picker | | getColorPalette | | | | getOpacityLevel | | | | getSpacing | | | | getTransitionDuration | | | | getZIndex | | |

Data loading

Mutations and queries provide a way to requires Tridion Sites data. They operate with model instances of @tridion-sites/models package rather than simple objects of @tridion-sites/open-api-client.

💡 Tip: Mutations and queries share cached data between the host application and extensions. This means that if provided request was already loaded somewhere else - it is going to be retrieved from the cache if applicable.

Queries

Queries provide a way of retrieving data from the backend as well as managing its loading and reloading.

| Name | Description | Example | | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | useActivityInstancesQuery | | | | useDefaultTranslationJobQuery | | | | useFavoritesQuery | | | | useItemBlueprintHierarchyQuery | | | | useItemChildrenQuery | | | | useItemClassifiedItemsQuery | | | | useItemDefaultDataQuery | | | | useItemHistoryQuery | | | | useItemPublishedPagesQuery | | | | useItemPublishedToQuery | | | | useItemPublishUrlsQuery | | | | useItemQuery | | Work Items Popover | | useItemsInProgressQuery | | | | useItemsQuery | | | | useItemsToPublishQuery | | | | useItemsToUnpublishQuery | | | | useItemTranslationInfoQuery | | | | useItemUsedByQuery | | | | useItemUsesQuery | | | | usePublicationBlueprintHierarchyQuery | | | | usePublicationsQuery | | | | usePublishableTargetTypesQuery | | | | useSearchInContainerQuery | | | | useSystemSearchQuery | | | | useUserGroupsQuery | | | | useUserProfileQuery | | | | useUsersQuery | | Users Page |

Mutations

Mutations provide a way of changing data on the backend as well as handling request execution.

| Name | Description | Example | | ------------------------------------------------------------------------------------------------------------------------------------------------ | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | useAddToBundleMutation | | | | useAssignActivitiesMutation | | | | useAssignActivityMutation | | | | useAutoClassifyItemMutation | | | | useAutoClassifyItemsMutation | | | | useChangeUserLanguageMutation | | Change Language to Dutch Action | | useChangeUserLocaleMutation | | | | useCopyItemMutation | | | | useCopyItemsMutation | | | | useCreateTranslationJobMutation | | | | useDeleteItemMutation | | | | useDeleteItemsMutation | | | | useFinishActivitiesMutation | | | | useFinishActivityMutation | | | | useFinishEditingItemMutation | | | | useFinishEditingItemsMutation | | | | useLocalizeItemMutation | | | | useLocalizeItemsMutation | | | | useMoveItemMutation | | | | useMoveItemsMutation | | | | usePublishItemsMutation | | | | useRemoveFromBundleMutation | | | | useRestartActivitiesMutation | | | | useRestartActivityMutation | | | | useRevertItemMutation | | | | useRevertItemsMutation | | | | useRollbackItemMutation | | | | useStartActivitiesMutation | | | | useStartActivityMutation | | | | useStartWorkflowMutation | | | | useUnlocalizeItemMutation | | | | useUnlocalizeItemsMutation | | | | useUnpublishItemsMutation | | | | useUpdateItemMutation | | | | useUploadMultimediaMutation | | |

Data Contexts

Tridion Sites contains nested data contexts. All extension points and hooks exist within a data context. Within any given data context, one can access both the data in that context and any parent data contexts. It is important to note where an extension is located to determine what data it can access.

💡 Tip: Some extensions might appear in multiple places. Hooks with optional contexts are provided for this purpose.

  • Activities Explorer
    • Activities Explorer Table
  • Content Explorer
    • Content Explorer Table
    • Content Explorer Tree
  • Content editors
    • Bundle editor
    • Category editor
    • Component editor
    • Folder editor
    • Keyword editor
    • Page editor
    • Structure Group editor