This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

@brandfolder/panel
TypeScript icon, indicating that this package has built-in type declarations

0.0.4 • Public • Published

panel-ui-sdk

This library was generated with Nx.

Running unit tests

Run nx test panel-ui-sdk to execute the unit tests via Jest.

Manually publish to NPM

  • Bump version in libs/panel-ui-sdk/package.json
  • run npm run build panel-ui-sdk
  • run npm login --auth-type=web
  • use npm credentials from 1password
  • run npm run publish-sdk
  • type in the one time password from 1password

Documentation

Initialization

export interface PanelUISdkParameters {
  anchorElement: HTMLElement; // Used to append the Iframe containing the Panel
  panelUIBaseUrl?: string; // Custom base URL if using a self-hosted version of the Panel
}

Example:

const anchor = window.getElementById('panel-anchor');
const panel = new PanelUISdk({ 
  anchorElement: anchor, 
  panelUIBaseUrl: 'https://custom-panel.com'
});

PanelUISdk.selectAttachments

Opens the Panel on the Org landing page. Allows you to pass in a handler to listen for attachment selection events.

Arguments:

export interface SelectAttachmentProps {
  onSelect: (attachment: AttachmentDto) => void; // Called whenever user selects an attachment
}

Example:

panel.selectAttachments({ 
  onSelect: (attachment) => console.log('Attachment selected: ', attachment) 
});

PanelUISdk.closePanel

Removes the Panel IFrame from the anchor element. All listeners that were registered while the Panel was opened are deleted.

Example:

panel.closePanel()

Readme

Keywords

Package Sidebar

Install

npm i @brandfolder/panel

Weekly Downloads

1

Version

0.0.4

License

MIT

Unpacked Size

5.3 kB

Total Files

9

Last publish

Collaborators

  • brandfolder-developers