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.12 kB
import { KSLAddButtonElement } from './KSLAddButtonElement'; import { KSLContainerElement } from './KSLContainerElement'; import { KSLButtonElement } from './KSLButtonElement'; import { KSLIconElement } from './KSLIconElement'; import { KSLTooltipElement } from './KSLTooltipElement'; import { KSLHighlightElement } from './KSLHighlightElement'; import { KSLPopoverElement } from './KSLPopoverElement'; 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((webComponent) => 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