From cfc6bb65ae40a558219bf1d903647e094e0a93b4 Mon Sep 17 00:00:00 2001 From: andrepolischuk Date: Fri, 28 Jun 2024 12:12:05 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20rambler-?= =?UTF-8?q?digital-solutions/widgetly@d9e135e74ec2f5367f500538bede116e8a63?= =?UTF-8?q?5785=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- classes/BaseLayout.html | 20 +++++++++---------- classes/Container.html | 12 +++++------ classes/ContentElement.html | 4 ++-- classes/EmbedLayout.html | 24 +++++++++++----------- classes/IFrameConsumer.html | 10 +++++----- classes/IFrameProvider.html | 22 ++++++++++---------- classes/Mediator.html | 26 ++++++++++++------------ classes/OverlayLayout.html | 28 +++++++++++++------------- classes/Widget.html | 30 ++++++++++++++-------------- functions/createMediator.html | 4 ++-- functions/createViewportManager.html | 4 ++-- functions/registerIFrame.html | 4 ++-- functions/setMutationParams.html | 4 ++-- hierarchy.html | 2 +- index.html | 2 +- interfaces/Callback.html | 4 ++-- interfaces/ContainerElement.html | 4 ++-- interfaces/Debounce.html | 4 ++-- interfaces/EmbedLayoutConfig.html | 6 +++--- interfaces/EnterViewportOptions.html | 8 ++++---- interfaces/IFrameConsumerConfig.html | 10 +++++----- interfaces/MediatorAPI.html | 4 ++-- interfaces/MediatorConfig.html | 10 +++++----- interfaces/OverlayLayoutConfig.html | 12 +++++------ interfaces/ViewportManager.html | 4 ++-- interfaces/VisibleArea.html | 12 +++++------ interfaces/WidgetAPI.html | 4 ++-- interfaces/WidgetConfig.html | 16 +++++++-------- modules.html | 2 +- variables/globalViewportEvents.html | 4 ++-- variables/mutationEvents.html | 4 ++-- 31 files changed, 152 insertions(+), 152 deletions(-) diff --git a/classes/BaseLayout.html b/classes/BaseLayout.html index 6197ff9..e4c989d 100644 --- a/classes/BaseLayout.html +++ b/classes/BaseLayout.html @@ -1,6 +1,6 @@ BaseLayout | widgetly

Class BaseLayout<T>Abstract

Basic layout

destroy Destroy layout

-

Type Parameters

  • T = any

Hierarchy (view full)

Methods

Type Parameters

  • T = any

Hierarchy (view full)

Methods

Methods

Generated using TypeDoc
+

Parameters

Returns void

Generated using TypeDoc

Class Container

Container for widgets

-

Hierarchy

  • EventEmitter
    • Container

Constructors

Hierarchy

  • EventEmitter
    • Container

Constructors

Methods

  • Append content element

    -

    Parameters

    • element: HTMLElement

    Returns void

  • Returns a Promise that resolves when the container enters the viewport from the top

    -

    Parameters

    Returns Promise<void>

Generated using TypeDoc
+

Returns Container

Methods

  • Append content element

    +

    Parameters

    • element: HTMLElement

    Returns void

  • Returns a Promise that resolves when the container enters the viewport from the top

    +

    Parameters

    Returns Promise<void>

Generated using TypeDoc

Class ContentElementAbstract

Content element

-

Implemented by

Generated using TypeDoc
+

Implemented by

Generated using TypeDoc

Class EmbedLayout

Embedded layout

destroy Destroy layout

-

Hierarchy (view full)

Constructors

Hierarchy (view full)

Constructors

Methods

Constructors

Methods

  • Add current object to container

    +

Returns EmbedLayout

Methods

  • Set content in the layout

    +

Returns void

  • Show/hide loader

    +

Returns void

Generated using TypeDoc
+

Returns void

Generated using TypeDoc

Class IFrameConsumer

Consumer inside an iframe

-

Constructors

Constructors

Methods

  • Factory that exports a facade available externally to the widget (for the webmaster)

    -

    Returns Record<string, any>

  • Factory that exports a facade available to the widget

    -

    Returns {
        externalizedProps: Record<string, any>;
        getSize: (() => {
            height: number;
            width: number;
        });
        initialize: ((...args) => void);
        resize: (() => undefined | void);
        watchSize: (() => void);
    }

    • externalizedProps: Record<string, any>
    • getSize: (() => {
          height: number;
          width: number;
      })
        • (): {
              height: number;
              width: number;
          }
        • Returns {
              height: number;
              width: number;
          }

          • height: number
          • width: number
    • initialize: ((...args) => void)
        • (...args): void
        • Parameters

          • Rest ...args: []

          Returns void

    • resize: (() => undefined | void)
        • (): undefined | void
        • Returns undefined | void

    • watchSize: (() => void)
        • (): void
        • Returns void

Generated using TypeDoc
+

Returns IFrameConsumer

Methods

  • Factory that exports a facade available externally to the widget (for the webmaster)

    +

    Returns Record<string, any>

  • Factory that exports a facade available to the widget

    +

    Returns {
        externalizedProps: Record<string, any>;
        getSize: (() => {
            height: number;
            width: number;
        });
        initialize: ((...args) => void);
        resize: (() => undefined | void);
        watchSize: (() => void);
    }

    • externalizedProps: Record<string, any>
    • getSize: (() => {
          height: number;
          width: number;
      })
        • (): {
              height: number;
              width: number;
          }
        • Returns {
              height: number;
              width: number;
          }

          • height: number
          • width: number
    • initialize: ((...args) => void)
        • (...args): void
        • Parameters

          • Rest ...args: []

          Returns void

    • resize: (() => undefined | void)
        • (): undefined | void
        • Returns undefined | void

    • watchSize: (() => void)
        • (): void
        • Returns void

Generated using TypeDoc

Class IFrameProvider

Wrapper over an iframe

viewportChange Event when the viewport of the element changes destroy Termination of the provider

-

Hierarchy

  • EventEmitter
    • IFrameProvider

Implements

Constructors

Hierarchy

  • EventEmitter
    • IFrameProvider

Implements

Constructors

Methods

createElement destroy getElement @@ -15,19 +15,19 @@
  • widget: Widget

    Widget object

  • id: string

    Unique widget identifier

  • Optional reduceViewportChange: Debounce

    Method to debounce viewport change tracking

    -
  • Returns IFrameProvider

    Methods

    • Get the current iframe element

      -

      Returns HTMLIFrameElement

    • Initialization of the iframe provider

      -

      Returns Promise<Promisify<EventEmitter<DefaultEventMap> & IFrameConsumerAPI>>

    • Subscription to changes in the visible area of the iframe

      +

    Returns IFrameProvider

    Methods

    • Get the current iframe element

      +

      Returns HTMLIFrameElement

    • Initialization of the iframe provider

      +

      Returns Promise<Promisify<EventEmitter<DefaultEventMap> & IFrameConsumerAPI>>

    • Subscription to changes in the visible area of the iframe

      Parameters

      Returns (() => void)

        • (): void
        • Returns void

    Generated using TypeDoc
    +

    Returns (() => void)

    Generated using TypeDoc

    Class Mediator

    Mediator - a widget factory

    -

    Hierarchy

    • EventEmitter
      • Mediator

    Constructors

    Hierarchy

    • EventEmitter
      • Mediator

    Constructors

    Properties

    id prefix widgetInstances @@ -31,22 +31,22 @@
  • externalize
  • externalizeAsProvider
  • -

    Returns Mediator

    Properties

    id: string

    Mediator identifier

    -
    prefix: string

    Prefix used for data-attributes

    -
    widgetInstances: Record<string, Widget> = {}

    Widget instances

    -
    widgets: Record<string, {
        config: WidgetConfig;
        properties: Record<string, any>;
    }> = {}

    Widgets

    -

    Type declaration

    Methods

    • Create a widget and place it on the page

      +

    Returns Mediator

    Properties

    id: string

    Mediator identifier

    +
    prefix: string

    Prefix used for data-attributes

    +
    widgetInstances: Record<string, Widget> = {}

    Widget instances

    +
    widgets: Record<string, {
        config: WidgetConfig;
        properties: Record<string, any>;
    }> = {}

    Widgets

    +

    Type declaration

    Methods

    • Create a widget and place it on the page

      Parameters

      • name: string

        Widget name

      • containerElement: string | HTMLElement

        Element/selector where the widget will be inserted

      • Optional params: Record<string, any>

        Widget initialization parameters

        -

      Returns Promise<WidgetAPI>

    • Create a widget and place it on the page

      +

    Returns Promise<WidgetAPI>

  • Create a widget and place it on the page

    Parameters

    • name: string

      Widget name

    • Optional params: Record<string, any>

      Widget initialization parameters

      -

    Returns Promise<WidgetAPI>

    • Define a widget

      +

    Returns Promise<WidgetAPI>

    • Define a widget

      Parameters

      • config: WidgetConfig

        Widget configuration

      • properties: Record<string, any> = {}

        Additional widget properties, this object is copied to the widget as is and supplements it with these properties

        -

      Returns void

    • Destroy the mediator and stop listening to DOM events

      -

      Returns void

    • Factory that exports a facade available to the widget

      +

    Returns void

    Generated using TypeDoc
    +

    Returns void

    Generated using TypeDoc

    Class OverlayLayout

    Layout for modal window

    destroy Destroy layout

    -

    Hierarchy (view full)

    Constructors

    Hierarchy (view full)

    Constructors

    Methods

    Constructors

    Methods

    • Set content in layout

      +

    Returns OverlayLayout

    Methods

    • Toggle loader visibility

      +

    Returns void

    Generated using TypeDoc
    +

    Returns void

    Generated using TypeDoc

    Class Widget

    Widget

    destroy Widget deletion event

    -

    Hierarchy

    • EventEmitter
      • Widget

    Constructors

    Hierarchy

    • EventEmitter
      • Widget

    Constructors

    Properties

    config id name @@ -36,18 +36,18 @@
  • whenContainerInViewport
  • reduceViewportChange
  • -

    Returns Widget

    Properties

    config: WidgetConfig

    Widget configuration

    -
    id: string

    Widget identifier

    -
    name: string

    Widget name

    -
    params: Record<string, any>

    External parameters for the widget

    -
    properties: Record<string, any>

    Widget properties

    -

    Methods

    • Set a container for the widget

      -

      Parameters

      Returns void

    Returns Widget

    Properties

    config: WidgetConfig

    Widget configuration

    +
    id: string

    Widget identifier

    +
    name: string

    Widget name

    +
    params: Record<string, any>

    External parameters for the widget

    +
    properties: Record<string, any>

    Widget properties

    +

    Methods

    • Set a container for the widget

      +

      Parameters

      Returns void

    • Destroy the widget and stop listening events

      -

      Returns void

    • A factory that exports the facade available to the external user

      +

    Returns IFrameProvider

    • Destroy the widget and stop listening events

      +

      Returns void

    • A factory that exports the facade available to the external user

      Returns {
          destroy: (() => void);
          params: Record<string, any>;
      }

      • destroy: (() => void)
          • (): void
          • Destroy the widget and stop listening events

            -

            Returns void

      • params: Record<string, any>
    • A factory that exports the facade available in the iframe

      +

      Returns void

  • params: Record<string, any>
    • A factory that exports the facade available in the iframe

      Returns {
          destroy: (() => void);
          getVisibleArea: (() => VisibleArea);
          mediator: {
              buildWidget: {
                  (name, containerElement, params?): Promise<WidgetAPI>;
                  (name, params?): Promise<WidgetAPI>;
              };
              initializeDOMElements: (() => void);
          };
          params: Record<string, any>;
          resize: undefined | (() => void);
          scrollTo: ((top, duration?) => Promise<void>);
          subscribeVisibleAreaChange: ((callback) => undefined | (() => void));
          url: string;
      }

      • destroy: (() => void)
          • (): void
          • Destroy the widget and stop listening events

            Returns void

      • getVisibleArea: (() => VisibleArea)
      • mediator: {
            buildWidget: {
                (name, containerElement, params?): Promise<WidgetAPI>;
                (name, params?): Promise<WidgetAPI>;
            };
            initializeDOMElements: (() => void);
        }
        • buildWidget: {
              (name, containerElement, params?): Promise<WidgetAPI>;
              (name, params?): Promise<WidgetAPI>;
          }
            • (name, containerElement, params?): Promise<WidgetAPI>
            • Create a widget and place it on the page

              Parameters

              • name: string

                Widget name

                @@ -61,12 +61,12 @@

                Parameters

                • top: number

                  The coordinate relative to the top-left corner of the iframe to scroll to

                • duration: number = 200

                  Scroll animation time, default is 200

                Returns Promise<void>

          • subscribeVisibleAreaChange: ((callback) => undefined | (() => void))
              • (callback): undefined | (() => void)
              • Callback for iframe viewport change (whether the iframe is visible or not)

                -

                Parameters

                Returns undefined | (() => void)

          • url: string
    • Widget initialization function

      -

      Returns Promise<{
          destroy: (() => void);
          params: Record<string, any>;
      }>

    • Wait when the container enters the viewport from the top

      -

      Parameters

      Returns Promise<void>

    Generated using TypeDoc
    +

    Parameters

    Returns undefined | (() => void)

  • url: string
  • Generated using TypeDoc

    Function createMediator

    Generated using TypeDoc
    +

    Returns Mediator

    Generated using TypeDoc

    Function registerIFrame

    Generated using TypeDoc
    +

    Returns IFrameConsumer

    Generated using TypeDoc

    Function setMutationParams

    • Set parameters for mutationObserver

      -

      Parameters

      • params: MutationObserverInit

      Returns void

    Generated using TypeDoc
    +

    Parameters

    • params: MutationObserverInit

    Returns void

    Generated using TypeDoc

    Generated using TypeDoc

    Interface Callback

    Base callback

    -
    interface Callback ((...args) => any)

    Generated using TypeDoc
    +

    interface Callback ((...args) => any)

    Generated using TypeDoc

    Interface ContainerElement

    Container element

    -
    interface ContainerElement {}

    Hierarchy

    • HTMLElement
      • ContainerElement

    Generated using TypeDoc
    +

    interface ContainerElement {}

    Hierarchy

    • HTMLElement
      • ContainerElement

    Generated using TypeDoc

    Interface Debounce

    Base debounce

    -
    interface Debounce (<T>(func) => T)

    Generated using TypeDoc
    +

    interface Debounce (<T>(func) => T)

    Generated using TypeDoc

    Interface EmbedLayoutConfig

    Embedded layout configuration

    -
    interface EmbedLayoutConfig {
        spinner?: string;
    }

    Properties

    interface EmbedLayoutConfig {
        spinner?: string;
    }

    Properties

    Properties

    spinner?: string

    Spinner HTML template

    -

    Generated using TypeDoc
    +

    Generated using TypeDoc

    Interface EnterViewportOptions

    Options for waiting when the container enters the viewport

    -
    interface EnterViewportOptions {
        lazy?: boolean;
        offset?: number;
    }

    Properties

    interface EnterViewportOptions {
        lazy?: boolean;
        offset?: number;
    }

    Properties

    Properties

    lazy?: boolean

    Enable lazy loading, default is false

    -
    offset?: number

    Offset for lazy loading, default is 300

    -

    Generated using TypeDoc
    +

    offset?: number

    Offset for lazy loading, default is 300

    +

    Generated using TypeDoc

    Interface IFrameConsumerConfig

    Configuration of the consumer inside an iframe

    -
    interface IFrameConsumerConfig {
        externalize?(this): void;
        externalizeAsConsumer?(this): void;
        initialize(this): void;
    }

    Methods

    interface IFrameConsumerConfig {
        externalize?(this): void;
        externalizeAsConsumer?(this): void;
        initialize(this): void;
    }

    Methods

    Generated using TypeDoc
    +

    Parameters

    Returns void

    Generated using TypeDoc

    Interface MediatorAPI

    Mediator facade available to the widget and inside an iframe

    -
    interface MediatorAPI {}

    Hierarchy

    • EventEmitterAPI
    • Record<string, any>
      • MediatorAPI

    Generated using TypeDoc
    +

    interface MediatorAPI {}

    Hierarchy

    • EventEmitterAPI
    • Record<string, any>
      • MediatorAPI

    Generated using TypeDoc

    Interface MediatorConfig

    Mediator configuration

    -
    interface MediatorConfig {
        prefix: string;
        externalizeAsProvider?(this): Record<string, any>;
        initialize?(this): void;
    }

    Properties

    interface MediatorConfig {
        prefix: string;
        externalizeAsProvider?(this): Record<string, any>;
        initialize?(this): void;
    }

    Properties

    prefix: string

    Prefix for data-attributes

    -

    Methods

    • Factory that exports a facade available in an iframe

      -

      Parameters

      Returns Record<string, any>

    Generated using TypeDoc
    +

    Methods

    • Factory that exports a facade available in an iframe

      +

      Parameters

      Returns Record<string, any>

    Generated using TypeDoc

    Interface OverlayLayoutConfig

    Overlay layout configuration for modal window

    -
    interface OverlayLayoutConfig {
        animationDuration?: number;
        className?: string;
        hidden?: boolean;
        spinner?: string;
    }

    Properties

    interface OverlayLayoutConfig {
        animationDuration?: number;
        className?: string;
        hidden?: boolean;
        spinner?: string;
    }

    Properties

    animationDuration?: number

    Duration of opacity animation in ms, default 200

    -
    className?: string

    CSS class added to element

    -
    hidden?: boolean

    Add hidden layout to DOM

    -
    spinner?: string

    HTML template for spinner

    -

    Generated using TypeDoc
    +

    className?: string

    CSS class added to element

    +
    hidden?: boolean

    Add hidden layout to DOM

    +
    spinner?: string

    HTML template for spinner

    +

    Generated using TypeDoc

    Interface ViewportManager

    Base viewport manager

    -
    interface ViewportManager {}

    Generated using TypeDoc
    +

    interface ViewportManager {}

    Generated using TypeDoc

    Interface VisibleArea

    Visible area

    -
    interface VisibleArea {
        height: number;
        left: number;
        top: number;
        width: number;
    }

    Properties

    interface VisibleArea {
        height: number;
        left: number;
        top: number;
        width: number;
    }

    Properties

    Properties

    height: number

    Visible height of the element

    -
    left: number

    Coordinates relative to the top left corner of the element from which it is visible

    -
    top: number

    Coordinates relative to the top left corner of the element from which it is visible

    -
    width: number

    Visible width of the element

    -

    Generated using TypeDoc
    +

    left: number

    Coordinates relative to the top left corner of the element from which it is visible

    +
    top: number

    Coordinates relative to the top left corner of the element from which it is visible

    +
    width: number

    Visible width of the element

    +

    Generated using TypeDoc

    Interface WidgetAPI

    Widget facade available to the user

    -
    interface WidgetAPI {}

    Hierarchy

    • EventEmitterAPI
    • Record<string, any>
      • WidgetAPI

    Generated using TypeDoc
    +

    interface WidgetAPI {}

    Hierarchy

    • EventEmitterAPI
    • Record<string, any>
      • WidgetAPI

    Generated using TypeDoc

    Interface WidgetConfig

    Widget configuration

    -
    interface WidgetConfig {
        name: string;
        reduceViewportChange?: Debounce;
        destroy?(this): void;
        externalize?(this): Record<string, any>;
        externalizeAsProvider?(this): Record<string, any>;
        initialize(this): void;
    }

    Properties

    interface WidgetConfig {
        name: string;
        reduceViewportChange?: Debounce;
        destroy?(this): void;
        externalize?(this): Record<string, any>;
        externalizeAsProvider?(this): Record<string, any>;
        initialize(this): void;
    }

    Properties

    name: string

    Unique widget name

    -
    reduceViewportChange?: Debounce

    Function to slow down the processing of Viewport changes, if it is absent, the standard debounce is used

    -

    Methods

    • Widget deletion function, this function should be called by the user when deleting the widget

      -

      Parameters

      Returns void

    • A factory that exports the facade available to the user. +

    reduceViewportChange?: Debounce

    Function to slow down the processing of Viewport changes, if it is absent, the standard debounce is used

    +

    Methods

    • Widget deletion function, this function should be called by the user when deleting the widget

      +

      Parameters

      Returns void

    • A factory that exports the facade available to the user. By default, exports properties passed to the widget and properties that the iframe exports

      -

      Parameters

      Returns Record<string, any>

    • A factory that exports the facade available in the iframe

      -

      Parameters

      Returns Record<string, any>

    • Widget initialization function, should render the widget

      -

      Parameters

      Returns void

    Generated using TypeDoc
    +

    Parameters

    Returns Record<string, any>

    • A factory that exports the facade available in the iframe

      +

      Parameters

      Returns Record<string, any>

    • Widget initialization function, should render the widget

      +

      Parameters

      Returns void

    Generated using TypeDoc

    Variable globalViewportEventsConst

    globalViewportEvents: EventEmitter<DefaultEventMap> = ...

    Monitor scroll window

    -

    Generated using TypeDoc
    +

    Generated using TypeDoc

    Variable mutationEventsConst

    mutationEvents: EventEmitter<DefaultEventMap> = ...

    Create a MutationObserver

    -

    Generated using TypeDoc
    +

    Generated using TypeDoc