Class PanoTagPluginController

Hierarchy

  • TagRender
    • PanoTagPluginController

Constructors

Properties

VERSION: string = __DNALOGEL_VERSION__

@realsee/dnalogel 版本号

config: Pick<Tags, "globalConfig" | "contentTypeConfig"> = DefaultConfig
five: Five
hooks: Subscribe<EventMap> = ...

插件事件钩子

state: {
    enabled: boolean;
    visible: boolean;
} = ...

state

Type declaration

  • enabled: boolean
  • visible: boolean
staticPrefix: string = '//vrlab-static.ljcdn.com'
tags: TagInstance[] = []

Methods

  • 插件自身DOM添加到父容器

    Parameters

    • wrapper: Element

    Returns void

  • @description: 改变data

    Type Parameters

    • C extends "Model" | "Image" | "Link" | "Audio" | "Text" | "ImageText" | "Video" | "Sticker" | "VRLink" | "PanoLink" | "Marketing" | "MediaPlane" | "MediaModel" | "Custom" | "Unknown" = "Model" | "Image" | "Link" | "Audio" | "Text" | "ImageText" | "Video" | "Sticker" | "VRLink" | "PanoLink" | "Marketing" | "MediaPlane" | "MediaModel" | "Custom" | "Unknown"

    Parameters

    • id: TagId
    • data: PartialObjectDeep<C extends "Model" | "Image" | "Link" | "Audio" | "Text" | "ImageText" | "Video" | "Sticker" | "VRLink" | "PanoLink" | "Marketing" | "MediaPlane" | "MediaModel" | "Custom" | "Unknown"
          ? ContentTypeMap[C]
          : {
              action?: {
                  type: "iframe" | "window" | "custom";
                  url?: string;
              };
              matrix?: number[];
              modelUrl: string;
          } & {
              extraData?: Object;
          } | {
              mediaData: Object[];
              text?: string;
              title?: string;
          } & {
              extraData?: Object;
          } | {
              icon?: TagIconUrl;
              linkType?: "normal" | "vr";
              text?: string;
              title?: string;
          } & {
              extraData?: Object;
          } | {
              appearance?: "line" | "plane";
              audioUrl: string;
              text?: string;
              theme?: "light" | "dark";
              title?: string;
          } & {
              extraData?: Object;
          } | {
              appearance?: "line" | "plane";
              description?: string;
              edit?: {
                  description?: {
                      inputting?: boolean;
                      placeholder?: string;
                  };
                  title?: {
                      inputting?: boolean;
                      placeholder?: string;
                  };
              };
              text?: string;
              title?: string;
          } & {
              extraData?: Object;
          } | {
              brandTags?: string[];
              headerPictureUrl?: string;
              highlightText?: string;
              limitWidth?: number | boolean;
              price?: {
                  unit: string;
                  value: string | number;
              };
              tags?: string[];
              theme?: "light" | "dark";
              title: string;
          } & {
              extraData?: Object;
          } | {
              autoplayConfig?: {
                  autoplayCarousel?: boolean;
                  autoplayVideo?: boolean;
                  autoplayVideoInCarousel?: boolean;
              };
              enableCarousel?: boolean;
              mediaData: MediaData[];
              objectFit?: ObjectFit;
              playIcon?: string;
          } & DeprecatedMediaPlaneProperty & {
              extraData?: Object;
          } | {
              action?: {
                  type: "iframe" | "window";
                  url: string;
              };
              matrix?: number[];
              mediaData: MediaData[];
              mediaPosition: [ArrayPosition, ArrayPosition, ArrayPosition, ArrayPosition];
              modelUrl: string;
              objectFit?: ObjectFit;
          } & {
              extraData?: Object;
          } | Object & {
              extraData?: Object;
          }>
    • deepMerge: boolean = true

    Returns void

  • @description: 改变全局配置

    Parameters

    • globalConfig: TagConfig<"Model" | "Image" | "Link" | "Audio" | "Text" | "ImageText" | "Video" | "Sticker" | "VRLink" | "PanoLink" | "Marketing" | "MediaPlane" | "MediaModel" | "Custom" | "Unknown">
    • merge: boolean = true

    Returns void

  • @description: 改变tag的stickType

    Type Parameters

    • C extends "Model" | "Image" | "Link" | "Audio" | "Text" | "ImageText" | "Video" | "Sticker" | "VRLink" | "PanoLink" | "Marketing" | "MediaPlane" | "MediaModel" | "Custom" | "Unknown" = "Model" | "Image" | "Link" | "Audio" | "Text" | "ImageText" | "Video" | "Sticker" | "VRLink" | "PanoLink" | "Marketing" | "MediaPlane" | "MediaModel" | "Custom" | "Unknown"

    Parameters

    • id: TagId
    • data: PartialObjectDeep<{
          data: {
              action?: {
                  type: "iframe" | "window" | "custom";
                  url?: string;
              };
              matrix?: number[];
              modelUrl: string;
          } & {
              extraData?: Object;
          } | {
              mediaData: Object[];
              text?: string;
              title?: string;
          } & {
              extraData?: Object;
          } | {
              icon?: TagIconUrl;
              linkType?: "normal" | "vr";
              text?: string;
              title?: string;
          } & {
              extraData?: Object;
          } | {
              appearance?: "line" | "plane";
              audioUrl: string;
              text?: string;
              theme?: "light" | "dark";
              title?: string;
          } & {
              extraData?: Object;
          } | {
              appearance?: "line" | "plane";
              description?: string;
              edit?: {
                  description?: {
                      inputting?: boolean;
                      placeholder?: string;
                  };
                  title?: {
                      inputting?: boolean;
                      placeholder?: string;
                  };
              };
              text?: string;
              title?: string;
          } & {
              extraData?: Object;
          } | {
              brandTags?: string[];
              headerPictureUrl?: string;
              highlightText?: string;
              limitWidth?: number | boolean;
              price?: {
                  unit: string;
                  value: string | number;
              };
              tags?: string[];
              theme?: "light" | "dark";
              title: string;
          } & {
              extraData?: Object;
          } | {
              autoplayConfig?: {
                  autoplayCarousel?: boolean;
                  autoplayVideo?: boolean;
                  autoplayVideoInCarousel?: boolean;
              };
              enableCarousel?: boolean;
              mediaData: MediaData[];
              objectFit?: ObjectFit;
              playIcon?: string;
          } & DeprecatedMediaPlaneProperty & {
              extraData?: Object;
          } | {
              action?: {
                  type: "iframe" | "window";
                  url: string;
              };
              matrix?: number[];
              mediaData: MediaData[];
              mediaPosition: [ArrayPosition, ArrayPosition, ArrayPosition, ArrayPosition];
              modelUrl: string;
              objectFit?: ObjectFit;
          } & {
              extraData?: Object;
          } | Object & {
              extraData?: Object;
          };
          normal?: ArrayPosition;
          position: ArrayPosition | [ArrayPosition, ArrayPosition, ArrayPosition, ArrayPosition];
          stickType: StickType;
      }>
    • deepMerge: boolean = true

    Returns void

  • @description: 改变tag任意属性

    Type Parameters

    • C extends "Model" | "Image" | "Link" | "Audio" | "Text" | "ImageText" | "Video" | "Sticker" | "VRLink" | "PanoLink" | "Marketing" | "MediaPlane" | "MediaModel" | "Custom" | "Unknown" = "Model" | "Image" | "Link" | "Audio" | "Text" | "ImageText" | "Video" | "Sticker" | "VRLink" | "PanoLink" | "Marketing" | "MediaPlane" | "MediaModel" | "Custom" | "Unknown"

    Parameters

    Returns void

  • 获取当前的插件状态,如果当初插件内存在需要通过动画变更的 state 值,则通过此方法可以得到中间状态

    Returns State

  • Type Parameters

    • C extends "Model" | "Image" | "Link" | "Audio" | "Text" | "ImageText" | "Video" | "Sticker" | "VRLink" | "PanoLink" | "Marketing" | "MediaPlane" | "MediaModel" | "Custom" | "Unknown" = "Model" | "Image" | "Link" | "Audio" | "Text" | "ImageText" | "Video" | "Sticker" | "VRLink" | "PanoLink" | "Marketing" | "MediaPlane" | "MediaModel" | "Custom" | "Unknown"

    • S extends StickType = StickType

    Parameters

    Returns TagInstance<C, S>

  • @description: 获取merge后的配置 TODO: 缓存

    Parameters

    Returns TagConfig<"Model" | "Image" | "Link" | "Audio" | "Text" | "ImageText" | "Video" | "Sticker" | "VRLink" | "PanoLink" | "Marketing" | "MediaPlane" | "MediaModel" | "Custom" | "Unknown">

  • Parameters

    • Optional params: {
          userAction?: boolean;
          withAnimation?: boolean;
      }
      • Optional userAction?: boolean
      • Optional withAnimation?: boolean

    Returns Promise<void>

  • @description: 设置 contentType 的渲染器

    Note

    优先级低于 tag.element

    Parameters

    • contentType: string

      如果是 TagContentType 中的类型,将会覆盖掉插件内部默认的渲染器, 如果是其他任意 str ing 如:'Foo',则可以将类似 {id: 1, contentType: 'Foo', position: [0,0,0]} 的 tag 交给插件渲染

    • renderer: ElementRenderer

    Returns void

  • Parameters

    • state: Partial<State>
    • params: {
          userAction?: boolean;
          visibleWithAnimation?: boolean;
      }
      • Optional userAction?: boolean
      • Optional visibleWithAnimation?: boolean

    Returns void

  • Parameters

    • Optional params: {
          userAction?: boolean;
          withAnimation?: boolean;
      }
      • Optional userAction?: boolean
      • Optional withAnimation?: boolean

    Returns Promise<void>