UNPKG

@kontent-ai/smart-link

Version:

Kontent.ai Smart Link SDK allowing to automatically inject [smart links](https://docs.kontent.ai/tutorials/develop-apps/build-strong-foundation/set-up-editing-from-preview#a-using-smart-links) to Kontent.ai according to manually specified [HTML data attri

31 lines 1.13 kB
import { KSLAddButtonElement } from "./KSLAddButtonElement"; import { KSLButtonElement } from "./KSLButtonElement"; import { KSLContainerElement } from "./KSLContainerElement"; import { KSLHighlightElement } from "./KSLHighlightElement"; import { KSLIconElement } from "./KSLIconElement"; import { KSLPopoverElement } from "./KSLPopoverElement"; import { KSLTooltipElement } from "./KSLTooltipElement"; const webComponents = [ KSLIconElement, KSLButtonElement, KSLAddButtonElement, KSLHighlightElement, KSLContainerElement, KSLTooltipElement, KSLPopoverElement, ]; const webComponentTags = webComponents.map((component) => component.is); /** * Define all web components if it is possible. */ export function defineAllRequiredWebComponents() { const allDefined = webComponents.map(async (webComponent) => await webComponent.define()); return Promise.all(allDefined); } /** * Check if element is a web component based on its tag name. */ export function isElementWebComponent(element) { return webComponentTags.includes(element.tagName.toLowerCase()); } //# sourceMappingURL=components.js.map