@claspo/document-connector

SDK connection layer for managing Claspo widget layouts, positioning, events, and resource loading in host documents

@claspo/document-connector


@claspo/document-connector / DocumentConnectorEventType

DocumentConnectorEventType

default

Enumeration Members

Enumeration MemberValue
CONTACT_ID_WAS_RECEIVED"CONTACT_ID_WAS_RECEIVED"
CLOSE_WIDGET"CLOSE_WIDGET"
SHOW_WIDGET"SHOW_WIDGET"
CLOSE_ICON_CLICKED"CLOSE_ICON_CLICKED"
BRANDING_ELEMENT_CLICKED"BRANDING_ELEMENT_CLICKED"
CONTACT_DATA_SUBMIT"CONTACT_DATA_SUBMIT"
WIDGET_CONTENT_CLICKED"WIDGET_CONTENT_CLICKED"

@claspo/document-connector


@claspo/document-connector / DocumentConnectorEvents.interface

DocumentConnectorEvents.interface

DocumentConnectorEventName

type DocumentConnectorEventName = 
  | default
  | SysActionTypes
  | SysEventTypes
  | SysRouterEvent;

@claspo/document-connector


@claspo/document-connector / StaticDocumentConnector

StaticDocumentConnector

default

Document connector for static (runtime) widget rendering. Handles the connection between the widget and the host document, managing component registration, resolution, and Google Fonts loading.

Extends

  • default

Constructors

Constructor

new default(params): default;

Creates a new StaticDocumentConnector instance. Initializes the component register, resolver, and entry module for static rendering.

Parameters
ParameterTypeDescription
paramsWidgetInitConfigIWidget initialization configuration. See WidgetInitConfigI at @claspo/common
Returns

default

Overrides
BaseDocumentConnector.constructor

Methods

connect()

connect(containerElement): Promise<any>;

Connects the widget to the specified container element. Loads Google Fonts (unless disabled) and initializes the renderer.

Parameters
ParameterTypeDescription
containerElementHTMLElementThe HTML element to render the widget into
Returns

Promise<any>

Promise that resolves when the widget is connected and rendered

disconnect()

disconnect(): void;

Disconnects the widget from the document. Cleans up controllers, entry module, and Google Fonts loader.

Returns

void

Overrides
BaseDocumentConnector.disconnect

on()

on(eventName, listener): {
  off: () => void;
};

Subscribes to widget events with typed event names.

Parameters
ParameterTypeDescription
eventName| DocumentConnectorEventName | "*"The event name to listen for, or * to listen for all events
listener(value, eventName, params?) => voidCallback function invoked when the event is emitted
Returns
{
  off: () => void;
}

An object with an off method to unsubscribe

NameType
off()() => void
Overrides
BaseDocumentConnector.on

Properties

PropertyTypeDescriptionOverridesInherited from
paramsWidgetInitConfigI--BaseDocumentConnector.params
containerHTMLElement--BaseDocumentConnector.container
componentRegisterWcRegisterRegistry for Web Component classes--
componentResolverWcResolverResolver for loading and resolving Web ComponentsBaseDocumentConnector.componentResolver-
googleFontsLoaderGoogleFontsLoaderLoader for Google Fonts, null until connect() is called--