import { findTextNode } from '@finsweet/ts-utils'; import ClipboardJS from 'clipboard'; const ATTRIBUTES = { Main: 'fs-copy', GlobalSelector: 'fs-copy-selector', CopiedMessage: 'fs-copied-message', CopiedDuration: 'fs-copied-duration', } as const; const DEFAULT_COPIED_MESSAGE_DURATION = 1000; const SUCCESS_CSS_CLASS = 'fs-copied'; interface GlobalParams { globalSelector: string; globalCopiedMessage?: string; globalCopiedDuration?: string; } /** * Copy text to clipboard through simple custom attributes. * * Element properties * @attribute [fs-copy] Accepts a query selector (id "#" or CSS Class ".") a text string or a "self" value. * @attribute [fs-copied-message] Message to be displayed after copying * @attribute [fs-copied-duration] Duration that the fs-copied text will be displayed * *