1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-04 10:19:24 +02:00

Add intro.js

This commit is contained in:
Daniel Neto 2024-05-13 10:48:47 -03:00
parent 1cfc673e42
commit abb433718e
71 changed files with 2775 additions and 2 deletions

26
node_modules/intro.js/src/core/DOMEvent.d.ts generated vendored Normal file
View file

@ -0,0 +1,26 @@
import { IntroJs } from "../intro";
/**
* DOMEvent Handles all DOM events
*
* methods:
*
* on - add event handler
* off - remove event
*/
declare class DOMEvent {
private readonly events_key;
/**
* Gets a unique ID for an event listener
*/
private _id;
/**
* Adds event listener
*/
on(obj: EventTarget, type: string, listener: (context: IntroJs | EventTarget, e: Event) => void | undefined | string | Promise<string | void>, context: IntroJs, useCapture: boolean): void;
/**
* Removes event listener
*/
off(obj: EventTarget, type: string, listener: (context: IntroJs | EventTarget, e: Event) => void | undefined | string | Promise<string | void>, context: IntroJs, useCapture: boolean): void;
}
declare const _default: DOMEvent;
export default _default;

7
node_modules/intro.js/src/core/addOverlayLayer.d.ts generated vendored Normal file
View file

@ -0,0 +1,7 @@
import { IntroJs } from "../intro";
/**
* Add overlay layer to the page
*
* @api private
*/
export default function addOverlayLayer(intro: IntroJs, targetElm: HTMLElement): boolean;

13
node_modules/intro.js/src/core/dontShowAgain.d.ts generated vendored Normal file
View file

@ -0,0 +1,13 @@
import { IntroJs } from "../intro";
/**
* Set the "Don't show again" state
*
* @api private
*/
export declare function setDontShowAgain(intro: IntroJs, dontShowAgain: boolean): void;
/**
* Get the "Don't show again" state from cookies
*
* @api private
*/
export declare function getDontShowAgain(intro: IntroJs): boolean;

8
node_modules/intro.js/src/core/exitIntro.d.ts generated vendored Normal file
View file

@ -0,0 +1,8 @@
import { IntroJs } from "../intro";
/**
* Exit from intro
*
* @api private
* @param {Boolean} force - Setting to `true` will skip the result of beforeExit callback
*/
export default function exitIntro(intro: IntroJs, targetElement: HTMLElement, force?: boolean): Promise<void>;

8
node_modules/intro.js/src/core/fetchIntroSteps.d.ts generated vendored Normal file
View file

@ -0,0 +1,8 @@
import { IntroJs } from "../intro";
import { IntroStep } from "./steps";
/**
* Finds all Intro steps from the data-* attributes and the options.steps array
*
* @api private
*/
export default function fetchIntroSteps(intro: IntroJs, targetElm: HTMLElement): IntroStep[];

81
node_modules/intro.js/src/core/hint.d.ts generated vendored Normal file
View file

@ -0,0 +1,81 @@
import { HintPosition } from "./steps";
import { IntroJs } from "../intro";
/**
* Get a queryselector within the hint wrapper
*/
export declare function hintQuerySelectorAll(selector: string): HTMLElement[];
/**
* Hide a hint
*
* @api private
*/
export declare function hideHint(intro: IntroJs, stepId: number): Promise<void>;
/**
* Hide all hints
*
* @api private
*/
export declare function hideHints(intro: IntroJs): Promise<void>;
/**
* Show all hints
*
* @api private
*/
export declare function showHints(intro: IntroJs): Promise<void>;
/**
* Show a hint
*
* @api private
*/
export declare function showHint(stepId: number): void;
/**
* Removes all hint elements on the page
* Useful when you want to destroy the elements and add them again (e.g. a modal or popup)
*
* @api private
*/
export declare function removeHints(intro: IntroJs): void;
/**
* Remove one single hint element from the page
* Useful when you want to destroy the element and add them again (e.g. a modal or popup)
* Use removeHints if you want to remove all elements.
*
* @api private
*/
export declare function removeHint(stepId: number): void;
/**
* Add all available hints to the page
*
* @api private
*/
export declare function addHints(intro: IntroJs): Promise<void>;
/**
* Aligns hint position
*
* @api private
*/
export declare function alignHintPosition(position: HintPosition, hintElement: HTMLElement, targetElement?: HTMLElement): void;
/**
* Triggers when user clicks on the hint element
*
* @api private
*/
export declare function showHintDialog(intro: IntroJs, stepId: number): Promise<void>;
/**
* Removes open hint (tooltip hint)
*
* @api private
*/
export declare function removeHintTooltip(): string | undefined;
/**
* Start parsing hint items
*
* @api private
*/
export declare function populateHints(intro: IntroJs, targetElm: HTMLElement): Promise<boolean>;
/**
* Re-aligns all hint elements
*
* @api private
*/
export declare function reAlignHints(intro: IntroJs): void;

7
node_modules/intro.js/src/core/introForElement.d.ts generated vendored Normal file
View file

@ -0,0 +1,7 @@
import { IntroJs } from "../intro";
/**
* Initiate a new introduction/guide from an element in the page
*
* @api private
*/
export default function introForElement(intro: IntroJs, targetElm: HTMLElement): Promise<Boolean>;

17
node_modules/intro.js/src/core/onKeyDown.d.ts generated vendored Normal file
View file

@ -0,0 +1,17 @@
import { IntroJs } from "../intro";
/**
* on keyCode:
* https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode
* This feature has been removed from the Web standards.
* Though some browsers may still support it, it is in
* the process of being dropped.
* Instead, you should use KeyboardEvent.code,
* if it's implemented.
*
* jQuery's approach is to test for
* (1) e.which, then
* (2) e.charCode, then
* (3) e.keyCode
* https://github.com/jquery/jquery/blob/a6b0705294d336ae2f63f7276de0da1195495363/src/event.js#L638
*/
export default function onKeyDown(intro: IntroJs, e: KeyboardEvent): Promise<void>;

2
node_modules/intro.js/src/core/onResize.d.ts generated vendored Normal file
View file

@ -0,0 +1,2 @@
import { IntroJs } from "../intro";
export default function onResize(intro: IntroJs): void;

8
node_modules/intro.js/src/core/placeTooltip.d.ts generated vendored Normal file
View file

@ -0,0 +1,8 @@
import { HintStep, IntroStep } from "./steps";
import { IntroJs } from "../intro";
/**
* Render tooltip box in the page
*
* @api private
*/
export default function placeTooltip(intro: IntroJs, currentStep: IntroStep | HintStep, tooltipLayer: HTMLElement, arrowLayer: HTMLElement, hintMode?: boolean): void;

6
node_modules/intro.js/src/core/refresh.d.ts generated vendored Normal file
View file

@ -0,0 +1,6 @@
import { IntroJs } from "../intro";
/**
* Update placement of the intro objects on the screen
* @api private
*/
export default function refresh(intro: IntroJs, refreshSteps?: boolean): IntroJs | undefined;

View file

@ -0,0 +1,6 @@
/**
* To remove all show element(s)
*
* @api private
*/
export default function removeShowElement(): void;

View file

@ -0,0 +1,8 @@
import { IntroJs } from "../intro";
import { HintStep, IntroStep } from "./steps";
/**
* Update the position of the helper layer on the screen
*
* @api private
*/
export default function setHelperLayerPosition(intro: IntroJs, step: IntroStep | HintStep, helperLayer: HTMLElement): void;

18
node_modules/intro.js/src/core/showElement.d.ts generated vendored Normal file
View file

@ -0,0 +1,18 @@
import { IntroStep } from "./steps";
import { IntroJs } from "../intro";
/**
* Deletes and recreates the bullets layer
* @private
*/
export declare function _recreateBullets(intro: IntroJs, targetElement: IntroStep): void;
/**
* Updates an existing progress bar variables
* @private
*/
export declare function _updateProgressBar(oldReferenceLayer: HTMLElement, currentStep: number, introItemsLength: number): void;
/**
* Show an element on the page
*
* @api private
*/
export default function _showElement(intro: IntroJs, targetElement: IntroStep): Promise<void>;

48
node_modules/intro.js/src/core/steps.d.ts generated vendored Normal file
View file

@ -0,0 +1,48 @@
import { IntroJs } from "../intro";
export type ScrollTo = "off" | "element" | "tooltip";
export type TooltipPosition = "floating" | "top" | "bottom" | "left" | "right" | "top-right-aligned" | "top-left-aligned" | "top-middle-aligned" | "bottom-right-aligned" | "bottom-left-aligned" | "bottom-middle-aligned";
export type HintPosition = "top-left" | "top-right" | "top-middle" | "bottom-left" | "bottom-right" | "bottom-middle" | "middle-left" | "middle-right" | "middle-middle";
export type IntroStep = {
step: number;
title: string;
intro: string;
tooltipClass?: string;
highlightClass?: string;
element?: HTMLElement | string | null;
position: TooltipPosition;
scrollTo: ScrollTo;
disableInteraction?: boolean;
};
export type HintStep = {
element?: HTMLElement | string | null;
tooltipClass?: string;
position: TooltipPosition;
hint?: string;
hintTargetElement?: HTMLElement;
hintAnimation?: boolean;
hintPosition: HintPosition;
};
/**
* Go to specific step of introduction
*
* @api private
*/
export declare function goToStep(intro: IntroJs, step: number): Promise<void>;
/**
* Go to the specific step of introduction with the explicit [data-step] number
*
* @api private
*/
export declare function goToStepNumber(intro: IntroJs, step: number): Promise<void>;
/**
* Go to next step on intro
*
* @api private
*/
export declare function nextStep(intro: IntroJs): Promise<boolean>;
/**
* Go to previous step on intro
*
* @api private
*/
export declare function previousStep(intro: IntroJs): Promise<boolean>;

27
node_modules/intro.js/src/index.d.ts generated vendored Normal file
View file

@ -0,0 +1,27 @@
import { IntroJs } from "./intro";
/**
* Create a new IntroJS instance
*
* @param targetElm Optional target element to start the tour/hint on
* @returns
*/
declare const introJs: {
(targetElm?: string | HTMLElement): IntroJs;
/**
* Current IntroJs version
*
* @property version
* @type String
*/
version: string;
/**
* key-val object helper for introJs instances
*
* @property instances
* @type Object
*/
instances: {
[key: number]: IntroJs;
};
};
export default introJs;

71
node_modules/intro.js/src/intro.d.ts generated vendored Normal file
View file

@ -0,0 +1,71 @@
import { HintStep, IntroStep } from "./core/steps";
import { Options } from "./option";
type introBeforeChangeCallback = (this: IntroJs, targetElement: HTMLElement, currentStep: number, direction: "backward" | "forward") => Promise<boolean> | boolean;
type introChangeCallback = (this: IntroJs, targetElement: HTMLElement) => void | Promise<void>;
type introAfterChangeCallback = (this: IntroJs, targetElement: HTMLElement) => void | Promise<void>;
type introCompleteCallback = (this: IntroJs, currentStep: number, reason: "skip" | "end" | "done") => void | Promise<void>;
type introStartCallback = (this: IntroJs, targetElement: HTMLElement) => void | Promise<void>;
type introExitCallback = (this: IntroJs) => void | Promise<void>;
type introSkipCallback = (this: IntroJs, currentStep: number) => void | Promise<void>;
type introBeforeExitCallback = (this: IntroJs, targetElement: HTMLElement) => boolean | Promise<boolean>;
type hintsAddedCallback = (this: IntroJs) => void | Promise<void>;
type hintClickCallback = (this: IntroJs, hintElement: HTMLElement, item: HintStep, stepId: number) => void | Promise<void>;
type hintCloseCallback = (this: IntroJs, stepId: number) => void | Promise<void>;
export declare class IntroJs {
_currentStep: number;
_currentStepNumber: number | undefined;
_direction: "forward" | "backward";
_targetElement: HTMLElement;
_introItems: IntroStep[];
_hintItems: HintStep[];
_options: Options;
_introBeforeChangeCallback?: introBeforeChangeCallback;
_introChangeCallback?: introChangeCallback;
_introAfterChangeCallback?: introAfterChangeCallback;
_introCompleteCallback?: introCompleteCallback;
_introStartCallback?: introStartCallback;
_introExitCallback?: introExitCallback;
_introSkipCallback?: introSkipCallback;
_introBeforeExitCallback?: introBeforeExitCallback;
_hintsAddedCallback?: hintsAddedCallback;
_hintClickCallback?: hintClickCallback;
_hintCloseCallback?: hintCloseCallback;
_lastShowElementTimer: number;
_hintsAutoRefreshFunction: (...args: any[]) => void;
constructor(targetElement: HTMLElement);
isActive(): boolean;
clone(): IntroJs;
setOption<K extends keyof Options>(key: K, value: Options[K]): this;
setOptions(partialOptions: Partial<Options>): this;
start(): Promise<this>;
goToStep(step: number): Promise<this>;
addStep(step: Partial<IntroStep>): this;
addSteps(steps: Partial<IntroStep>[]): this;
goToStepNumber(step: number): Promise<this>;
nextStep(): Promise<this>;
previousStep(): Promise<this>;
currentStep(): number;
exit(force: boolean): Promise<this>;
refresh(refreshSteps?: boolean): this;
setDontShowAgain(dontShowAgain: boolean): this;
onbeforechange(providedCallback: introBeforeChangeCallback): this;
onchange(providedCallback: introChangeCallback): this;
onafterchange(providedCallback: introAfterChangeCallback): this;
oncomplete(providedCallback: introCompleteCallback): this;
onhintsadded(providedCallback: hintsAddedCallback): this;
onhintclick(providedCallback: hintClickCallback): this;
onhintclose(providedCallback: hintCloseCallback): this;
onstart(providedCallback: introStartCallback): this;
onexit(providedCallback: introExitCallback): this;
onskip(providedCallback: introSkipCallback): this;
onbeforeexit(providedCallback: introBeforeExitCallback): this;
addHints(): Promise<this>;
hideHint(stepId: number): Promise<this>;
hideHints(): Promise<this>;
showHint(stepId: number): this;
showHints(): Promise<this>;
removeHints(): this;
removeHint(stepId: number): this;
showHintDialog(stepId: number): Promise<this>;
}
export {};

47
node_modules/intro.js/src/option.d.ts generated vendored Normal file
View file

@ -0,0 +1,47 @@
import { HintPosition, HintStep, IntroStep, ScrollTo, TooltipPosition } from "./core/steps";
export interface Options {
steps: Partial<IntroStep>[];
hints: Partial<HintStep>[];
isActive: boolean;
nextLabel: string;
prevLabel: string;
skipLabel: string;
doneLabel: string;
hidePrev: boolean;
hideNext: boolean;
nextToDone: boolean;
tooltipPosition: string;
tooltipClass: string;
group: string;
highlightClass: string;
exitOnEsc: boolean;
exitOnOverlayClick: boolean;
showStepNumbers: boolean;
stepNumbersOfLabel: string;
keyboardNavigation: boolean;
showButtons: boolean;
showBullets: boolean;
showProgress: boolean;
scrollToElement: boolean;
scrollTo: ScrollTo;
scrollPadding: number;
overlayOpacity: number;
autoPosition: boolean;
positionPrecedence: TooltipPosition[];
disableInteraction: boolean;
dontShowAgain: boolean;
dontShowAgainLabel: string;
dontShowAgainCookie: string;
dontShowAgainCookieDays: number;
helperElementPadding: number;
hintPosition: HintPosition;
hintButtonLabel: string;
hintShowButton: boolean;
hintAutoRefreshInterval: number;
hintAnimation: boolean;
buttonClass: string;
progressBarAdditionalClass: boolean;
}
export declare function getDefaultOptions(): Options;
export declare function setOption<K extends keyof Options>(options: Options, key: K, value: Options[K]): Options;
export declare function setOptions(options: Options, partialOptions: Partial<Options>): Options;

5
node_modules/intro.js/src/util/addClass.d.ts generated vendored Normal file
View file

@ -0,0 +1,5 @@
/**
* Append a class to an element
* @api private
*/
export default function addClass(element: HTMLElement, className: string): void;

4
node_modules/intro.js/src/util/appendChild.d.ts generated vendored Normal file
View file

@ -0,0 +1,4 @@
/**
* Appends `element` to `parentElement`
*/
export default function appendChild(parentElement: HTMLElement, element: HTMLElement, animate?: boolean): void;

16
node_modules/intro.js/src/util/checkLeft.d.ts generated vendored Normal file
View file

@ -0,0 +1,16 @@
/**
* Set tooltip right so it doesn't go off the left side of the window
*
* @return boolean true, if tooltipLayerStyleRight is ok. false, otherwise.
*/
export default function checkLeft(targetOffset: {
top: number;
left: number;
width: number;
height: number;
}, tooltipLayerStyleRight: number, tooltipOffset: {
top: number;
left: number;
width: number;
height: number;
}, tooltipLayer: HTMLElement): boolean;

19
node_modules/intro.js/src/util/checkRight.d.ts generated vendored Normal file
View file

@ -0,0 +1,19 @@
/**
* Set tooltip left so it doesn't go off the right side of the window
*
* @return boolean true, if tooltipLayerStyleLeft is ok. false, otherwise.
*/
export default function checkRight(targetOffset: {
top: number;
left: number;
width: number;
height: number;
}, tooltipLayerStyleLeft: number, tooltipOffset: {
top: number;
left: number;
width: number;
height: number;
}, windowSize: {
width: number;
height: number;
}, tooltipLayer: HTMLElement): boolean;

5
node_modules/intro.js/src/util/cloneObject.d.ts generated vendored Normal file
View file

@ -0,0 +1,5 @@
/**
* Makes a copy of an object
* @api private
*/
export default function cloneObject<T>(source: T): T;

6
node_modules/intro.js/src/util/cookie.d.ts generated vendored Normal file
View file

@ -0,0 +1,6 @@
export declare function setCookie(name: string, value: string, days?: number): string;
export declare function getAllCookies(): {
[name: string]: string;
};
export declare function getCookie(name: string): string;
export declare function deleteCookie(name: string): void;

6
node_modules/intro.js/src/util/createElement.d.ts generated vendored Normal file
View file

@ -0,0 +1,6 @@
/**
* Create a DOM element with various attributes
*/
export default function _createElement<K extends keyof HTMLElementTagNameMap>(tagName: K, attrs?: {
[key: string]: string | Function;
}): HTMLElementTagNameMap[K];

1
node_modules/intro.js/src/util/debounce.d.ts generated vendored Normal file
View file

@ -0,0 +1 @@
export default function debounce(func: Function, timeout: number): (...args: any) => void;

View file

@ -0,0 +1,7 @@
/**
* Check to see if the element is in the viewport or not
* http://stackoverflow.com/questions/123999/how-to-tell-if-a-dom-element-is-visible-in-the-current-viewport
*
* @api private
*/
export default function elementInViewport(el: HTMLElement): boolean;

13
node_modules/intro.js/src/util/getOffset.d.ts generated vendored Normal file
View file

@ -0,0 +1,13 @@
/**
* Get an element position on the page relative to another element (or body)
* Thanks to `meouw`: http://stackoverflow.com/a/442474/375966
*
* @api private
* @returns Element's position info
*/
export default function getOffset(element: HTMLElement, relativeEl?: HTMLElement): {
width: number;
height: number;
left: number;
top: number;
};

8
node_modules/intro.js/src/util/getPropValue.d.ts generated vendored Normal file
View file

@ -0,0 +1,8 @@
/**
* Get an element CSS property on the page
* Thanks to JavaScript Kit: http://www.javascriptkit.com/dhtmltutors/dhtmlcascade4.shtml
*
* @api private
* @returns string property value
*/
export default function getPropValue(element: HTMLElement, propName: string): string;

5
node_modules/intro.js/src/util/getScrollParent.d.ts generated vendored Normal file
View file

@ -0,0 +1,5 @@
/**
* Find the nearest scrollable parent
* copied from https://stackoverflow.com/questions/35939886/find-first-scrollable-parent
*/
export default function getScrollParent(element: HTMLElement): HTMLElement;

10
node_modules/intro.js/src/util/getWindowSize.d.ts generated vendored Normal file
View file

@ -0,0 +1,10 @@
/**
* Provides a cross-browser way to get the screen dimensions
* via: http://stackoverflow.com/questions/5864467/internet-explorer-innerheight
*
* @api private
*/
export default function getWinSize(): {
width: number;
height: number;
};

6
node_modules/intro.js/src/util/isFixed.d.ts generated vendored Normal file
View file

@ -0,0 +1,6 @@
/**
* Checks to see if target element (or parents) position is fixed or not
*
* @api private
*/
export default function isFixed(element: HTMLElement): boolean;

2
node_modules/intro.js/src/util/isFunction.d.ts generated vendored Normal file
View file

@ -0,0 +1,2 @@
declare const _default: (x: any) => x is Function;
export default _default;

4
node_modules/intro.js/src/util/removeChild.d.ts generated vendored Normal file
View file

@ -0,0 +1,4 @@
/**
* Removes `element` from `parentElement`
*/
export default function removeChild(element: HTMLElement | null, animate?: boolean): void;

6
node_modules/intro.js/src/util/removeClass.d.ts generated vendored Normal file
View file

@ -0,0 +1,6 @@
/**
* Remove a class from an element
*
* @api private
*/
export default function removeClass(element: HTMLElement, classNameRegex: RegExp | string): void;

4
node_modules/intro.js/src/util/removeEntry.d.ts generated vendored Normal file
View file

@ -0,0 +1,4 @@
/**
* Remove an entry from a string array if it's there, does nothing if it isn't there.
*/
export default function removeEntry<K>(stringArray: K[], stringToRemove: K): void;

View file

@ -0,0 +1,4 @@
/**
* scroll a scrollable element to a child element
*/
export default function scrollParentToElement(scrollToElement: boolean, targetElement: HTMLElement): void;

7
node_modules/intro.js/src/util/scrollTo.d.ts generated vendored Normal file
View file

@ -0,0 +1,7 @@
import { ScrollTo } from "../core/steps";
/**
* To change the scroll of `window` after highlighting an element
*
* @api private
*/
export default function scrollTo(scrollToElement: boolean, scrollTo: ScrollTo, scrollPadding: number, targetElement: HTMLElement, tooltipLayer: HTMLElement): void;

View file

@ -0,0 +1,6 @@
/**
* Setting anchors to behave like buttons
*
* @api private
*/
export default function setAnchorAsButton(anchor: HTMLElement): void;

7
node_modules/intro.js/src/util/setShowElement.d.ts generated vendored Normal file
View file

@ -0,0 +1,7 @@
/**
* To set the show element
* This function set a relative (in most cases) position and changes the z-index
*
* @api private
*/
export default function setShowElement(targetElement: HTMLElement): void;

6
node_modules/intro.js/src/util/setStyle.d.ts generated vendored Normal file
View file

@ -0,0 +1,6 @@
/**
* Sets the style of an DOM element
*/
export default function setStyle(element: HTMLElement, style: string | {
[key: string]: string | number;
}): void;

10
node_modules/intro.js/src/util/stamp.d.ts generated vendored Normal file
View file

@ -0,0 +1,10 @@
/**
* Mark any object with an incrementing number
* used for keeping track of objects
*
* @param Object obj Any object or DOM Element
* @param String key
* @return Object
*/
declare const stamp: <T>(obj: T, key?: string) => number;
export default stamp;