UNPKG

lisn.js

Version:

Simply handle user gestures and actions. Includes widgets.

1 lines 17.9 kB
{"version":3,"file":"view-trigger.cjs","names":["MC","_interopRequireWildcard","require","MH","_cssAlter","_domAlter","_domSearch","_text","_validation","_views","_animate","_animatePlay","_viewWatcher","_trigger","_debug","_interopRequireDefault","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","_defineProperty","_toPropertyKey","value","enumerable","configurable","writable","_toPrimitive","Symbol","toPrimitive","TypeError","String","Number","ViewTrigger","Trigger","register","registerTrigger","element","args","actions","config","assign","views","validateStrList","isValidView","newConfigValidator","constructor","_config$rootMargin","_config$target","logger","debug","Logger","name","formatAsString","getConfig","copyObject","lengthOf","watcher","ViewWatcher","reuse","root","rootMargin","replace","threshold","target","S_AT","oppositeViews","getOppositeViews","setupWatcher","debug6","run","onView","reverse","willAnimate","action","isInstanceOf","Animate","AnimatePlay","setupRepresentative","then","exports","key","_ref","isLiteralString","isValidScrollOffset","waitForReferenceElement","undefined","_ref2","validateString","validateNumList","tryWrap","prev","previousElementSibling","prevChild","childrenOf","hasClass","PREFIX_WRAPPER","PREFIX_GHOST","insertGhostClone","_clone"],"sources":["../../../src/ts/triggers/view-trigger.ts"],"sourcesContent":["/**\n * @module Triggers\n *\n * @categoryDescription View\n * {@link ViewTrigger} allows you to run actions when the viewport's scroll\n * position relative to a given target or offset from top/bottom/left/right is\n * one of the matching \"views\" (at/above/below/left/right), and undo those\n * actions when the viewport's \"view\" is not matching.\n */\n\nimport * as MC from \"@lisn/globals/minification-constants\";\nimport * as MH from \"@lisn/globals/minification-helpers\";\n\nimport { ViewTarget, View, CommaSeparatedStr } from \"@lisn/globals/types\";\n\nimport { hasClass } from \"@lisn/utils/css-alter\";\nimport { insertGhostClone, tryWrap } from \"@lisn/utils/dom-alter\";\nimport { waitForReferenceElement } from \"@lisn/utils/dom-search\";\nimport { formatAsString } from \"@lisn/utils/text\";\nimport {\n validateStrList,\n validateString,\n validateNumList,\n} from \"@lisn/utils/validation\";\nimport {\n getOppositeViews,\n isValidView,\n isValidScrollOffset,\n} from \"@lisn/utils/views\";\n\nimport { Action } from \"@lisn/actions/action\";\nimport { Animate } from \"@lisn/actions/animate\";\nimport { AnimatePlay } from \"@lisn/actions/animate-play\";\n\nimport { ViewWatcher } from \"@lisn/watchers/view-watcher\";\n\nimport {\n registerTrigger,\n Trigger,\n TriggerConfig,\n} from \"@lisn/triggers/trigger\";\n\nimport { WidgetConfigValidatorFunc } from \"@lisn/widgets/widget\";\n\nimport debug from \"@lisn/debug/debug\";\n\n/**\n * {@link ViewTrigger} allows you to run actions when the viewport's scroll\n * position relative to a given target or offset from top/bottom/left/right is\n * one of the matching \"views\" (at/above/below/left/right), and undo those\n * actions when the viewport's \"view\" is not matching.\n *\n * -------\n *\n * To use with auto-widgets (HTML API), see {@link registerTrigger} for the\n * specification.\n *\n * - Arguments (optional): One or more (comma-separated) {@link View}s.\n * Default is \"at\".\n * - Additional trigger options:\n * - `target`: A string element specification for an element (see\n * {@link Utils.getReferenceElement | getReferenceElement}) or a\n * {@link Types.ScrollOffset | ScrollOffset}.\n * - `root`: A string element specification. See\n * {@link Utils.getReferenceElement | getReferenceElement}.\n * - `rootMargin`: A string.\n * - `threshold`: A number or list (comma-separated) of numbers.\n *\n * @example\n * Show the element when it's in the viewport, hide otherwise.\n *\n * ```html\n * <div data-lisn-on-view=\"at @show\"></div>\n * ```\n *\n * @example\n * Same as above. \"views\" is optional and defaults to \"at\".\n *\n * ```html\n * <div data-lisn-on-view=\"@show\"></div>\n * ```\n *\n * @example\n * As above but using a CSS class instead of data attribute:\n *\n * ```html\n * <div class=\"lisn-on-view--@show\"></div>\n * ```\n *\n * @example\n * Show the element 1000ms after the first time it enters the viewport.\n *\n * ```html\n * <div data-lisn-on-view=\"@show +once +delay=1000\"></div>\n * ```\n *\n * @example\n * Add class `seen` the first time the element enters the viewport, and play\n * the animations defined on it 1000ms after each time it enters the viewport,\n * reverse the animations as soon as it goes out of view.\n *\n * ```html\n * <div data-lisn-on-view=\"@add-class=seen +once ;\n * @animate +do-delay=1000\"\n * ></div>\n * ```\n *\n * @example\n * Add class `seen` when the viewport is at or below the element (element\n * above viewport), remove it when the viewport is above the element.\n * Element going to the left or right of the viewport will not trigger the\n * action. See {@link getOppositeViews}:\n *\n * ```html\n * <div data-lisn-on-view=\"at,below @add-class=seen\"></div>\n * ```\n *\n * @example\n * Add class `cls` when the viewport is above or to the left the element\n * (element below or to the right of the viewport), remove it when the\n * viewport is either at, below or to the right of the element.\n *\n * ```html\n * <div data-lisn-on-view=\"above,left @add-class=cls\"></div>\n * ```\n *\n * @example\n * Hide the element when the viewport is above the next element with class\n * `section`, show it when the viewport is below or at the target element.\n *\n * ```html\n * <div data-lisn-on-view=\"above @hide +target=next.section\"></div>\n * <div class=\"section\"></div>\n * ```\n *\n * @example\n * As above, but using `data-lisn-ref` attribute instead of class selector.\n *\n * ```html\n * <div data-lisn-on-view=\"above @hide +target=next-section\"></div>\n * <div data-lisn-ref=\"section\"></div>\n * ```\n *\n * @example\n * Open the {@link Widgets.Openable | Openable} widget configured for this\n * element when the viewport is 75% down from the top of the page.\n *\n * ```html\n * <div data-lisn-on-view=\"@open +target=top:75%\"></div>\n * ```\n *\n * @category View\n */\nexport class ViewTrigger extends Trigger {\n readonly getConfig: () => ViewTriggerConfig;\n\n static register() {\n registerTrigger(\n \"view\",\n (element, args, actions, config) => {\n return new ViewTrigger(\n element,\n actions,\n MH.assign(config, {\n views: validateStrList(\"views\", args, isValidView),\n } as const),\n );\n },\n newConfigValidator,\n );\n }\n\n /**\n * If no actions are supplied, nothing is done.\n *\n * @throws {@link Errors.LisnUsageError | LisnUsageError}\n * If the config is invalid.\n */\n constructor(element: Element, actions: Action[], config?: ViewTriggerConfig) {\n super(element, actions, config);\n\n const logger = debug\n ? new debug.Logger({\n name: `ViewTrigger-${formatAsString(element)}`,\n })\n : null;\n\n this.getConfig = () => MH.copyObject(config);\n\n if (!MH.lengthOf(actions)) {\n return;\n }\n\n const watcher = ViewWatcher.reuse({\n root: config?.root,\n rootMargin: config?.rootMargin?.replace(/,/g, \" \"),\n threshold: config?.threshold,\n });\n\n const target = config?.target ?? element;\n const views = config?.views || MC.S_AT;\n const oppositeViews = getOppositeViews(views);\n\n const setupWatcher = (target: ViewTarget) => {\n if (!MH.lengthOf(oppositeViews)) {\n debug: logger?.debug6(\"Trigger can never be reversed, running now\");\n // The action is never undone\n this.run();\n } else {\n debug: logger?.debug6(\"Setting up trigger\", views, oppositeViews);\n watcher.onView(target, this.run, { views });\n watcher.onView(target, this.reverse, { views: oppositeViews });\n }\n };\n\n // See comment in globals/settings under contentWrappingAllowed\n let willAnimate = false;\n for (const action of actions) {\n if (\n MH.isInstanceOf(action, Animate) ||\n MH.isInstanceOf(action, AnimatePlay)\n ) {\n willAnimate = true;\n break;\n }\n }\n\n if (willAnimate) {\n setupRepresentative(element).then(setupWatcher);\n } else {\n setupWatcher(target);\n }\n }\n}\n\n/**\n * @category View\n * @interface\n */\nexport type ViewTriggerConfig = TriggerConfig & {\n /**\n * The {@link View} to use as the trigger.\n * See also {@link Watchers/ViewWatcher.OnViewOptions | OnViewOptions}\n *\n * Actions will be \"done\" when the view matches the given spec and \"undone\"\n * otherwise. What the opposite views are depends on the given view. E.g. for\n * \"at\", opposites are all the other ones; for \"above\", the opposite ones\n * are \"at\" and \"below\"; for \"at,above\" opposite is \"below\", etc.\n *\n * @defaultValue \"at\"\n */\n views?: CommaSeparatedStr<View> | View[];\n\n /**\n * The target to use for the ViewWatcher. It can be a string offset\n * specification.\n * See {@link Watchers/ViewWatcher.OnViewOptions | OnViewOptions}\n *\n * @defaultValue The element on which the {@link ViewTrigger} is defined\n */\n target?: ViewTarget;\n\n /**\n * The root to pass to the {@link ViewWatcher}.\n * See also {@link Watchers/ViewWatcher.ViewWatcherConfig | ViewWatcherConfig}\n *\n * @defaultValue {@link ViewWatcher} default\n */\n root?: Element | null;\n\n /**\n * The root margin to pass to the {@link ViewWatcher}.\n * See also {@link Watchers/ViewWatcher.ViewWatcherConfig | ViewWatcherConfig}\n *\n * It can be either space-separated or comma-separated.\n *\n * @defaultValue {@link ViewWatcher} default\n */\n rootMargin?: string;\n\n /**\n * The threshold to pass to the {@link ViewWatcher}.\n * See also {@link Watchers/ViewWatcher.ViewWatcherConfig | ViewWatcherConfig}\n *\n * @defaultValue {@link ViewWatcher} default\n */\n threshold?: number | number[];\n};\n\n// ----------\n\nconst newConfigValidator: WidgetConfigValidatorFunc<\n Omit<ViewTriggerConfig, \"views\">\n> = (element) => {\n return {\n target: (key, value) =>\n MH.isLiteralString(value) && isValidScrollOffset(value)\n ? value\n : ((MH.isLiteralString(value)\n ? waitForReferenceElement(value, element)\n : null) ?? undefined),\n root: (key, value) =>\n (MH.isLiteralString(value)\n ? waitForReferenceElement(value, element)\n : null) ?? undefined,\n rootMargin: validateString,\n threshold: (key, value) => validateNumList(key, value),\n };\n};\n\nconst setupRepresentative = async (element: Element): Promise<Element> => {\n let target: Element | null = await tryWrap(element);\n if (!target) {\n // Not allowed to wrap. Create a dummy hidden clone that's not animated and\n // position it absolutely in a wrapper of size 0 that's inserted just\n // before the actual element, so that the hidden clone overlaps the actual\n // element's regular (pre-transformed) position.\n\n const prev = element.previousElementSibling;\n const prevChild = MH.childrenOf(prev)[0];\n if (\n prev &&\n hasClass(prev, MC.PREFIX_WRAPPER) &&\n prevChild &&\n hasClass(prevChild, MC.PREFIX_GHOST)\n ) {\n // Already cloned by a previous animate action?\n target = prevChild;\n } else {\n target = (await insertGhostClone(element))._clone;\n }\n }\n\n return target;\n};\n"],"mappings":";;;;;;AAUA,IAAAA,EAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,EAAA,GAAAF,uBAAA,CAAAC,OAAA;AAIA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AACA,IAAAK,KAA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