1 Star 0 Fork 34

River/outline.js

forked from Yaohaixiao/outline.js 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
outline.min.js.map 142.72 KB
一键复制 编辑 原始数据 按行查看 历史
{"version":3,"file":"outline.min.js","sources":["src/utils/types/isString.js","src/utils/lang/hasOwn.js","src/utils/lang/toString.js","src/utils/types/isFunction.js","src/utils/types/isObject.js","src/base.js","src/utils/lang/extend.js","src/utils/types/isElement.js","src/utils/lang/later.js","src/utils/lang/easeInQuad.js","src/utils/dom/_getScrollElement.js","src/utils/dom/scrollTo.js","src/utils/dom/offsetTop.js","src/utils/dom/matches.js","src/utils/dom/getParentOrHost.js","src/utils/event/enum.js","src/utils/event/_off.js","src/utils/event/_delete.js","src/utils/event/purgeElement.js","src/utils/event/getListeners.js","src/utils/event/off.js","src/utils/event/on.js","src/utils/event/getTarget.js","src/utils/dom/resolveTextNode.js","src/utils/dom/closest.js","src/utils/event/stop.js","src/utils/observer/_subscribers.js","src/utils/observer/_hasDirectSubscribersFor.js","src/utils/observer/has.js","src/utils/observer/_hasSubscribers.js","src/utils/observer/emit.js","src/utils/types/isTypedArray.js","src/utils/types/isArray.js","src/utils/icons.js","src/utils/lang/trim.js","src/utils/types/isDOM.js","src/utils/types/isHTMLCollection.js","src/utils/types/isFragment.js","src/utils/types/isTextNode.js","src/utils/dom/setAttribute.js","src/utils/dom/createElement.js","src/utils/dom/hasClass.js","src/utils/dom/removeClass.js","src/_resetHeading.js","src/utils/types/isEmpty.js","src/getChapters.js","src/utils/lang/stripTags.js","src/_getChapterParentIdByDiffer.js","src/_getChaptersWithCode.js","src/anchors.js","src/utils/lang/toTree.js","src/_updateHeading.js","src/utils/dom/addClass.js","src/utils/dom/setProperty.js","src/zIndex.js","src/drawer.js","src/utils/event/at.js","src/utils/dom/getStyle.js","src/chapters.js","src/_paintChapters.js","src/utils/dom/intersection.js","src/_createButton.js","src/toolbar.js","src/utils/lang/guid.js","src/utils/observer/on.js","src/utils/observer/_removeSubscriber.js","src/utils/observer/off.js","src/utils/observer/_removeSubscriberByToken.js","src/outline.js"],"sourcesContent":["/**\n * 检测数据是否为 String 类型\n * ========================================================================\n * @method isArray\n * @param {*} str\n * @returns {boolean}\n */\nconst isString = (str) => {\n return typeof str === 'string'\n}\n\nexport default isString\n","/**\n * 检测对象自身属性中是否具有指定的属性。\n * ========================================================================\n * @method hasOwn\n * @param {Object} obj - (必须)检测的目标对象\n * @param {String} prop - (必须)属性名\n * @returns {Boolean}\n */\nconst hasOwn = (obj, prop) => {\n const hasOwnProperty = Object.prototype.hasOwnProperty\n return obj && hasOwnProperty.call(obj, prop)\n}\n\nexport default hasOwn\n","/**\n * Object 对象原型上的 toString 方法\n * ========================================================================\n * @method toString\n * @param {*} val\n * @returns {string}\n */\nconst toString = (val) => {\n return Object.prototype.toString.apply(val)\n}\n\nexport default toString\n","import toString from '../lang/toString'\n\n/**\n * 检测测试数据是否为 Function 类型\n * ========================================================================\n * @method isFunction\n * @param {*} val - (必须)待检测的数据\n * @returns {boolean} 'val' 是 Function 类型返回 true,否则返回 false\n */\nconst isFunction = (val) => {\n return typeof val === 'function' || toString(val) === '[object Function]'\n}\n\nexport default isFunction\n","import toString from '../lang/toString'\nimport isFunction from '../types/isFunction'\n\n/**\n * 检测数据是否为 Object 类型\n * ========================================================================\n * @method isObject\n * @param {*} o\n * @returns {boolean}\n */\nconst isObject = (o) => {\n return (\n (toString(o) === '[object Object]' ||\n typeof o === 'object' ||\n isFunction(o)) &&\n o !== null\n )\n}\n\nexport default isObject\n","import isString from './utils/types/isString'\r\nimport hasOwn from './utils/lang/hasOwn'\r\nimport isObject from './utils/types/isObject'\r\nimport extend from './utils/lang/extend'\r\n\r\nclass Base {\r\n constructor(options) {\r\n this.attrs = {}\r\n\r\n if (options) {\r\n this.initialize(options)\r\n }\r\n }\r\n\r\n initialize(options) {\r\n this.attr(options).render().addListeners()\r\n return this\r\n }\r\n\r\n attr(prop, value) {\r\n const attrs = this.attrs\r\n\r\n if (isString(prop)) {\r\n // 只能扩展 attrs 中已有的属性\r\n if (value && hasOwn(attrs, prop)) {\r\n // 更新单个配置信息\r\n attrs[prop] = value\r\n return this\r\n }\r\n\r\n // 只传递 prop 参数,则返回对应的属性值\r\n return attrs[prop]\r\n } else if (isObject(prop)) {\r\n // 批量更新配置信息\r\n extend(attrs, prop)\r\n\r\n return this\r\n } else if (arguments.length === 0) {\r\n // 不传递参数,直接返回整个\r\n return attrs\r\n }\r\n\r\n return this\r\n }\r\n\r\n render() {\r\n return this\r\n }\r\n\r\n destroy() {\r\n this.removeListeners()\r\n return this\r\n }\r\n\r\n reload(options) {\r\n this.destroy().initialize(this.attr(options))\r\n return this\r\n }\r\n\r\n addListeners() {\r\n return this\r\n }\r\n\r\n removeListeners() {\r\n return this\r\n }\r\n}\r\n\r\nexport default Base\r\n","import hasOwn from './hasOwn'\n\n/**\n * 扩展对象\n * ========================================================================\n * @method extend\n * @param {Object} origin\n * @param {Object} source\n */\nconst extend = (origin, source) => {\n const keys = Object.keys(source)\n\n keys.forEach((prop) => {\n if (hasOwn(source, prop)) {\n origin[prop] = source[prop]\n }\n })\n}\n\nexport default extend\n","import isObject from './isObject'\n\n/**\n * 检测数据是否为 HTMLElement DOM 节点\n * ========================================================================\n * @method isElement\n * @param {*} o\n * @returns {boolean}\n */\nconst isElement = (o) => {\n return !!(isObject(o) && o.nodeName && o.tagName && o.nodeType === 1)\n}\n\nexport default isElement\n","import isFunction from '../types/isFunction'\n\n/**\n * later - 延迟执行方法\n * ========================================================================\n * @method later\n * @param {Function} fn\n * @param {Number} [delay]\n * @returns {number|boolean}\n */\nconst later = (fn, delay = 300) => {\n if (!isFunction(fn)) {\n return false\n }\n\n return setTimeout(() => {\n fn()\n }, delay)\n}\n\nexport default later\n","/**\n * 返回给定值的平方值\n * ========================================================================\n * @method easeInQuad\n * @param {Number} x\n * @returns {number}\n */\nconst easeInQuad = (x) => {\n return x * x\n}\n\nexport default easeInQuad\n","import isString from '../types/isString'\nimport isElement from '../types/isElement'\n\n/**\n * 通过给的 scrollElement 参数,获取滚动 DOM 元素\n * ========================================================================\n * @method _getScrollElement\n * @param {String|HTMLElement} scrollElement\n * @returns {Element}\n * @private\n */\nconst _getScrollElement = (scrollElement = null) => {\n let $rootElements\n let $scrollElement\n\n if (!scrollElement) {\n $rootElements = document.querySelectorAll('html,body')\n $scrollElement =\n $rootElements[0].scrollTop - $rootElements[1].scrollTop >= 0\n ? $rootElements[0]\n : $rootElements[1]\n } else {\n if (isString(scrollElement)) {\n $scrollElement = document.querySelector(scrollElement)\n } else if (isElement(scrollElement)) {\n $scrollElement = scrollElement\n }\n }\n\n return $scrollElement\n}\n\nexport default _getScrollElement\n","import easeInQuad from '../lang/easeInQuad'\nimport isFunction from '../types/isFunction'\nimport _getScrollElement from './_getScrollElement'\n\n/**\n * 指定 rootElement DOM 节点滚动到指定 top 位置\n * ========================================================================\n * @method scrollTo\n * @param {HTMLElement|Object} [scrollElement] - (必须)要滚动的 DOM 节点\n * @param {Number} top - (必须)滚动的 scrollTop 数值\n * @param {Function} [afterStop] - (可选)滚动完成的回调函数\n */\nconst scrollTo = (scrollElement, top, afterStop) => {\n const $scrollElement = _getScrollElement(scrollElement)\n let scrollTop = $scrollElement.scrollTop\n let step = 0\n const distance = top - scrollTop\n const MAX_HEIGHT = $scrollElement.scrollHeight\n const MAX_TOP = top - MAX_HEIGHT <= 0 ? top : MAX_HEIGHT\n const stop = (top) => {\n if (isFunction(afterStop)) {\n afterStop(top)\n }\n\n return false\n }\n const play = () => {\n step += 1\n\n // 向上滚动\n if (distance < 0) {\n scrollTop -= easeInQuad(step)\n $scrollElement.scrollTop = scrollTop\n\n if (scrollTop <= top) {\n $scrollElement.scrollTop = top\n return stop(top)\n }\n } else {\n scrollTop += easeInQuad(step)\n $scrollElement.scrollTop = scrollTop\n\n if (scrollTop >= MAX_TOP) {\n $scrollElement.scrollTop = MAX_TOP\n return stop(MAX_TOP)\n }\n }\n\n requestAnimationFrame(play)\n }\n\n requestAnimationFrame(play)\n}\n\nexport default scrollTo\n","/**\n * 获取 DOM 节点相对于窗口的 left (纵坐标)值\n * ========================================================================\n * @method offsetTop\n * @param {HTMLElement} el - DOM 节点\n * @returns {Number}\n */\nconst offsetTop = (el) => {\n let top = el.offsetTop\n\n if (el.offsetParent !== null) {\n top += offsetTop(el.offsetParent)\n }\n\n return top\n}\n\nexport default offsetTop\n","/**\n * 获取 options 节点下匹配 selector 选择器的 DOM 节点\n * ========================================================================\n * Element.matches() 方法可以用来判断 DOM 元素是否与给定的选择器匹配,事件代理判断是\n * 否触发绑定的代理事件回调函数,关键就是使用 Element.matches() 辨别当前事件触发的目\n * 标 DOM 元素是否为事件代理所期望触发的目标。\n * ========================================================================\n * @method matches\n * @see https://developer.mozilla.org/en-US/docs/web/api/element/matches\n * @param {HTMLElement} el - (必须)DOM 元素\n * @param {String} selector - (必须)匹配 DOM 元素的选择器\n * @returns {Boolean}\n */\nconst matches = (el, selector = '') => {\n const sel = selector.replace(/^>/i, '')\n\n if (!selector || !sel || !el) {\n return false\n }\n\n /* istanbul ignore else */\n if (el.matches) {\n return el.matches(sel)\n } else if (el.msMatchesSelector) {\n return el.msMatchesSelector(sel)\n } else {\n return false\n }\n}\n\nexport default matches\n","/**\n * 获取 DOM 元素的父节点\n * ========================================================================\n * @method getParentOrHost\n * @param {*|HTMLElement} el - (必须)要获取父节点的 DOM 元素\n * @returns {*|HTMLElement}\n */\nconst getParentOrHost = (el) => {\n return el.host && el !== document && el.host.nodeType\n ? el.host\n : el.parentNode\n}\n\nexport default getParentOrHost\n","export const CAPTURE_EVENTS = [\n 'focusout',\n 'blur',\n 'focusin',\n 'focus',\n 'load',\n 'unload',\n 'mouseenter',\n 'mouseleave'\n]\n","import { CAPTURE_EVENTS } from './enum'\nimport _delete from './_delete'\n\n/**\n * (私有方法)取消 type 类型的代理事件绑定\n * ========================================================================\n * 如果没有设置 handler,则销毁 this.$options 绑定的所有符合 type 事件类型的事件绑定\n * ========================================================================\n * @method _off\n * @param {HTMLElement} el - (必须)取消事件绑定的 DOM 元素\n * @param {String} type - (必须)事件类型\n * @param {Function} fn - (必须)事件处理器回调函数\n * @private\n */\nconst _off = (el, type, fn) => {\n const capture = CAPTURE_EVENTS.indexOf(type) > -1\n\n /* istanbul ignore else */\n if (fn._delegateListener) {\n fn = fn._delegateListener\n delete fn._delegateListener\n }\n\n // 移除缓存的 _listeners 数据\n _delete(el, type, fn)\n\n el.removeEventListener(type, fn, capture)\n}\n\nexport default _off\n","/**\n * 删除 DOM 元素缓存的 _listeners 数据\n * ========================================================================\n * @method _delete\n * @param {HTMLElement} el - 要删除 listener 的 DOM 元素\n * @param {String} type - 事件类型(名称)\n * @param {Function} [fn] - 事件处理器回调函数\n */\nconst _delete = function (el, type, fn) {\n const listeners = el._listeners\n let index = -1\n\n if (listeners.length < 1) {\n return false\n }\n\n // 移除缓存的 _listeners 数据\n listeners.forEach((listener, i) => {\n const handler = listener.fn\n\n if (type === listener.type) {\n index = i\n\n if (handler === fn) {\n index = i\n }\n }\n })\n\n /* istanbul ignore else */\n if (index > -1) {\n listeners.splice(index, 1)\n }\n}\n\nexport default _delete\n","import isString from '../types/isString'\nimport isElement from '../types/isElement'\nimport getListeners from './getListeners'\nimport _off from './_off'\n\n/**\n * 销毁(type 类型的)代理事件绑定\n * ========================================================================\n * 1. 设置了事件类型 type,则销毁指定类型的事件绑定,否则清除所有代理事件绑定\n * 2. recurse 设置为 true,递归销毁子节点全部事件绑定\n * ========================================================================\n * @method purgeElement\n * @param {HTMLElement|String} el - (必须)DOM 元素或者其选择器\n * @param {String|Boolean} type - (必须)事件类型\n * @param {Boolean} [recurse] - (可选)是否递归销毁子节点所有事件绑定\n */\nconst purgeElement = function (el, type, recurse = false) {\n const $element = isString(el) ? document.querySelector(el) : el\n const $children = $element.childNodes\n const listeners = getListeners($element, type)\n\n listeners.forEach((listener) => {\n _off($element, listener.type, listener.fn)\n })\n\n if (\n (recurse || type === true || arguments.length === 1) &&\n $element &&\n $children\n ) {\n $children.forEach(($child) => {\n if (isElement($child)) {\n purgeElement($child, type, recurse)\n }\n })\n }\n}\n\nexport default purgeElement\n","import isString from '../types/isString'\n\n/**\n * 获取 DOM 元素(type 事件类型)事件绑定信息\n * ========================================================================\n * 如果设置了事件类型 type, 则返回指定类型的事件绑定信息,否则返回所有事件绑定信息\n * ========================================================================\n * @methods getListeners\n * @param {HTMLElement} el - (必须)要获取事件绑定信息的 DOM 元素\n * @param {String} [type] - (可选)事件类型\n * @returns {Array} - 已绑定的事件信息\n */\nconst getListeners = (el, type) => {\n let listeners = el._listeners || []\n\n if (isString(type) && type) {\n listeners = listeners.filter((listener) => {\n return listener.type === type\n })\n }\n\n return listeners\n}\n\nexport default getListeners\n","import purgeElement from './purgeElement'\nimport isFunction from '../types/isFunction'\nimport _off from './_off'\n\n/**\n * 取消 type 类型的代理事件绑定\n * ========================================================================\n * 如果没有设置 handler,则销毁 this.$options 绑定的所有符合 type 事件类型的事件绑定\n * ========================================================================\n * @method off\n * @param {HTMLElement} el - (必须)取消事件绑定的 DOM 元素\n * @param {String} type - (必须)事件类型\n * @param {Function} [fn] - (可选)事件处理器回调函数\n */\nconst off = (el, type, fn) => {\n // 如果不设置 fn 参数,默认清除 el 元素上绑定的所有事件处理器\n if (!isFunction(fn)) {\n return purgeElement(el, type)\n }\n\n _off(el, type, fn)\n}\n\nexport default off\n","import closest from '../dom/closest'\nimport off from './off'\nimport getTarget from './getTarget'\n\nimport { CAPTURE_EVENTS } from './enum'\n\n/**\n * 绑定代理事件\n * ========================================================================\n * @method on\n * @param {HTMLElement|String|Object} el - (必须)绑定代理事件的 DOM 节点\n * @param {String} selector - (必须)事件代理目标 DOM 元素的选择器\n * @param {String|Function} type - (必须)事件类型或者事件处理器回调函数\n * @param {Function|Object} fn - (可选) 事件处理器回调函数或者传递给事件处理器回调函数的数据对象\n * @param {Object|Boolean} [data] - (可选)传递给事件处理器回调函数的数据对象或者事件处理器回调函数的 this 上下文指向,\n * @param {Object|Boolean} [context] - (可选)事件处理器回调函数的 this 上下文指向,或者是否仅触发一次\n * 当设置为 true 时,则事件处理器回调函数的 this 上下文指向为 data 对象\n * @param {Boolean} once - (可选)是否仅触发一次\n */\nconst on = (el, selector, type, fn, data, context, once = false) => {\n // CAPTURE_EVENTS 中的特殊事件,采用事件捕获模型\n const capture = CAPTURE_EVENTS.indexOf(type) > -1\n\n const listener = function (evt) {\n const target = getTarget(evt)\n // 通过 Element.matches 方法获得点击的目标元素\n const delegateTarget = closest(target, selector, el)\n let overrideContext = context || el\n\n evt.delegateTarget = delegateTarget\n\n // 当设置为 true 时,则事件处理器回调函数的\n // this 上下文指向为 data 对象\n if (context === true) {\n overrideContext = data\n }\n\n /* istanbul ignore else */\n if (delegateTarget) {\n // 仅触发一次\n /* istanbul ignore else */\n if (once === true) {\n off(el, type, listener)\n }\n\n fn.call(overrideContext, evt, data)\n }\n }\n\n if (!el._listeners) {\n el._listeners = []\n }\n\n // 缓存 options 元素绑定的事件处理器\n el._listeners.push({\n el,\n selector,\n type,\n fn: listener,\n data,\n context,\n capture\n })\n\n // 缓存包装后的事件处理器\n fn._delegateListener = listener\n\n el.addEventListener(type, listener, capture)\n}\n\nexport default on\n","import resolveTextNode from '../dom/resolveTextNode'\n\n/**\n * 返回触发事件的 target DOM 元素\n * ========================================================================\n * @method getTarget\n * @param {Event} evt - Event 对象\n * @return {HTMLElement} - Event 对象的 target DOM 元素\n */\nconst getTarget = function (evt) {\n const target = evt.target\n\n return resolveTextNode(target)\n}\n\nexport default getTarget\n","/**\n * 在某些情况下,某些浏览器(例如:Safari 浏览器)会返回实际的目标元素内部的文本节点。\n * resolveTextNode() 方法则会返回实际的目标节点。\n * ========================================================================\n * @method resolveTextNode\n * @param {HTMLElement|Text} el - 要解析的节点\n * @return {*|HTMLElement} - 实际的目标 DOM 节点\n */\nconst resolveTextNode = function (el) {\n if (el && el.nodeType === 3) {\n return el.parentNode\n }\n\n return el\n}\n\nexport default resolveTextNode\n","import matches from './matches'\nimport getParentOrHost from './getParentOrHost'\n\n/**\n * 获取 options 元素父元素最近的包含 selector 选择器的元素\n * ========================================================================\n * @method closest\n * @param {HTMLElement} el - (必须)DOM 元素\n * @param {String} selector - (必须)DOM 元素的选择其\n * @param {HTMLElement} [ctx] - (必须)比对的 DOM 元素\n * @param {Boolean} [includeCTX] - (必须)是否包含 context DOM 元素\n * @returns {null|HTMLElement} - 返回最接近的 DOM 元素\n */\nconst closest = (el, selector, ctx, includeCTX) => {\n const context = ctx || document\n\n if (!el) {\n return null\n }\n\n do {\n /* istanbul ignore else */\n if (\n (selector != null &&\n (selector.startsWith('>')\n ? el.parentNode === context && matches(el, selector)\n : matches(el, selector))) ||\n (includeCTX && el === context)\n ) {\n return el\n }\n\n /* istanbul ignore else */\n if (el === context) {\n break\n }\n\n /* jshint boss:true */\n } while ((el = getParentOrHost(el)))\n}\n\nexport default closest\n","/**\n * 停止事件(阻止默认行为和阻止事件的捕获或冒泡)\n * ========================================================================\n * @method stop\n * @param {Event} evt - 事件对象\n *\n * @example\n * <div id=\"nav\" class=\"nav\">\n * <a id=\"service\" class=\"anchor\" href=\"https://www.yaohaixiao.com/serivce\">Service</a>\n * <a id=\"help\" class=\"anchor\" href=\"https://www.yaohaixiao.com/help\">Help</a>\n * </div>\n *\n * const $nav = document.querySelector('#nav')\n * const $service = document.querySelector('.anchor')\n *\n * on($nav, 'click', function(evt) {\n * console.log('你点击了导航栏')\n * })\n *\n * on($anchor, 'click', function(evt) {\n * console.log('tagName', this.tagName)\n *\n * // 工作台输出:'a'\n * // 不会触发事件冒泡,输出:'你点击了导航栏'\n * // 也不会切换到 href 属性的页面,阻止了点击链接的默认行为\n * stopEvent(evt)\n * })\n */\nconst stop = function (evt) {\n evt.stopPropagation()\n evt.preventDefault()\n}\n\nexport default stop\n","/**\n * 存储订阅者(主题和处理器的)私有对象\n * ========================================================================\n * @type {{}}\n * @private\n */\nconst _subscribers = {}\n\nexport default _subscribers\n","import _subscribers from './_subscribers'\nimport hasOwn from '../lang/hasOwn'\n\n/**\n * 判断是否存在与给定 topic 完全匹配的订阅者信息\n * ========================================================================\n * @method _hasDirectSubscribersFor\n * @param {String} topic - (必须)订阅主题字符串\n * @returns {Boolean}\n */\nconst _hasDirectSubscribersFor = (topic) => {\n return hasOwn(_subscribers, topic) && _subscribers[topic].length > 0\n}\n\nexport default _hasDirectSubscribersFor\n","import _hasDirectSubscribersFor from './_hasDirectSubscribersFor'\nimport _hasSubscribers from './_hasSubscribers'\n\n/**\n * 判断是否存在包含 topic 指定的订阅者信息\n * ========================================================================\n * @method has\n * @param {String} topic - (必须)主题名称\n * @param {Boolean} [isDirect] - (可选)是否为直接的主题,默认值:true\n * @returns {Boolean}\n */\nconst has = (topic, isDirect = true) => {\n return isDirect ? _hasDirectSubscribersFor(topic) : _hasSubscribers(topic)\n}\n\nexport default has\n","import _hasDirectSubscribersFor from './_hasDirectSubscribersFor'\n\n/**\n * 判断是否存在包含给定 topic 相关的订阅者信息\n * ========================================================================\n * @method _hasSubscribers\n * @param {String} topic - (必须)订阅主题字符串\n * @returns {Boolean}\n */\nconst _hasSubscribers = (topic) => {\n let found = _hasDirectSubscribersFor(topic)\n let position = topic.lastIndexOf('.')\n\n while (!found && position !== -1) {\n topic = topic.substring(0, position)\n position = topic.lastIndexOf('.')\n found = _hasDirectSubscribersFor(topic)\n }\n\n return found\n}\n\nexport default _hasSubscribers\n","import isTypedArray from '../types/isTypedArray'\nimport _subscribers from './_subscribers'\nimport has from './has'\nimport _hasDirectSubscribersFor from './_hasDirectSubscribersFor'\n\n/**\n * (异步)发布订阅主题信息\n * ========================================================================\n * 主题默认是异步发布的。确保在消费者处理主题时,主题的发起者不会被阻止。\n * ========================================================================\n * @method emit\n * @param {String} topic - (必须)主题名称\n * @param {Object} data - (必须)数据对象\n * @param {Boolean} async - (可选) 是否异步发布\n */\nconst emit = (topic, data, async = true) => {\n const execute = (topic) => {\n if (!_hasDirectSubscribersFor(topic)) {\n return false\n }\n\n _subscribers[topic].forEach((subscriber) => {\n // 针对 mqtt 消息服务返回的 Uint8Array 类似的 typed arrays 格式的数据\n // 采用 toString() 方法转化为普通(JSON)字符串\n const message = isTypedArray(data) ? data.toString() : data\n\n subscriber.callback.call(subscriber.context || subscriber, message)\n })\n }\n const deliver = () => {\n let subscriber = topic\n let position = topic.lastIndexOf('.')\n\n while (position !== -1) {\n subscriber = subscriber.substring(0, position)\n position = subscriber.lastIndexOf('.')\n\n execute(subscriber)\n }\n\n // 执行 topic 对应的处理器\n execute(topic)\n // 执行特殊 topic:'*'(监听全部消息的发布)\n execute('*')\n }\n\n if (!has(topic)) {\n return false\n }\n\n if (async) {\n setTimeout(deliver, 10)\n } else {\n deliver()\n }\n}\n\nexport default emit\n","import toString from '../lang/toString'\n/**\n * 判断检测数据是否为 Typed Arrays 类型的数据\n * ========================================================================\n * @param {*} val\n * @returns {boolean}\n */\nconst isTypedArray = (val) => {\n const TYPES = [\n '[object Int8Array]',\n '[object Uint8Array]',\n '[object Uint8ClampedArray]',\n '[object Int16Array]',\n '[object Uint16Array]',\n '[object Int32Array]',\n '[object Uint32Array]',\n '[object Float32Array]',\n '[object Float64Array]',\n '[object BigInt64Array]',\n '[object BigUint64Array]'\n ]\n\n return TYPES.indexOf(toString(val)) > -1\n}\n\nexport default isTypedArray\n","import toString from '../lang/toString'\n\n/**\n * 检测数据是否为 Array 类型\n * ========================================================================\n * @method isArray\n * @param {*} o\n * @returns {boolean}\n */\nconst isArray = (o) => {\n if (Array.isArray) {\n return Array.isArray(o)\n } else {\n return toString(o) === '[object Array]'\n }\n}\n\nexport default isArray\n","import isArray from './types/isArray'\n\n/**\n * 绘制 SVG Sprites 图标集\n * ========================================================================\n * @method paintSvgSprites\n * @param {Array} [symbols] - (可选)symbols 图标数组\n * 传递 symbols - 绘制 symbols + SYMBOLS 的图标集\n * 不传递 symbols - 仅绘制默认 SYMBOLS 图标集\n */\nexport const paintSvgSprites = (symbols = []) => {\n const SYMBOLS = [\n '<symbol id=\"outline-icon-up\" viewBox=\"0 0 1024 1024\"><path d=\"M494.784 261.696c0.832-0.448 1.536-1.216 2.368-1.536a38.72 38.72 0 0 1 46.08 8.256l277.824 302.272a41.92 41.92 0 0 1-1.536 58.048 39.104 39.104 0 0 1-56.448-1.6L513.728 355.904 260.736 626.048a39.104 39.104 0 0 1-56.448 1.088 41.6 41.6 0 0 1-1.088-57.984L483.84 269.696c0.512-0.512 1.344-0.768 1.92-1.408l1.088-1.344c2.368-2.496 5.312-3.648 8-5.248z\"></path></symbol>',\n '<symbol id=\"outline-icon-down\" viewBox=\"0 0 1024 1024\"><path d=\"M494.784 762.304c0.832 0.448 1.536 1.216 2.368 1.536 15.232 7.488 33.92 4.992 46.08-8.256l277.824-302.272a41.92 41.92 0 0 0-1.536-58.048 39.104 39.104 0 0 0-56.448 1.6l-249.344 271.232-252.992-270.144a39.104 39.104 0 0 0-56.448-1.088 41.6 41.6 0 0 0-1.088 57.984l280.576 299.456c0.512 0.512 1.344 0.768 1.92 1.408l1.088 1.344c2.368 2.496 5.312 3.648 8 5.248z\"></path></symbol>',\n '<symbol id=\"outline-icon-menu\" viewBox=\"0 0 1024 1024\"><path d=\"M320 256h640V128H320zM320 576h640V448H320zM320 896h640v-128H320zM64 256h128V128H64zM64 576h128V448H64zM64 896h128v-128H64z\"></path></symbol>',\n '<symbol id=\"outline-icon-hash\" viewBox=\"0 0 24 24\"><path d=\"M14.216 10l-0.444 4h-3.988l0.444-4zM15.006 2.89l-0.568 5.11h-3.988l0.543-4.89c0.061-0.549-0.335-1.043-0.883-1.104s-1.043 0.335-1.104 0.884l-0.568 5.11h-4.438c-0.552 0-1 0.448-1 1s0.448 1 1 1h4.216l-0.444 4h-3.772c-0.552 0-1 0.448-1 1s0.448 1 1 1h3.549l-0.543 4.89c-0.061 0.549 0.335 1.043 0.883 1.104s1.043-0.335 1.104-0.883l0.569-5.111h3.988l-0.543 4.89c-0.061 0.549 0.335 1.043 0.883 1.104s1.043-0.335 1.104-0.883l0.568-5.111h4.438c0.552 0 1-0.448 1-1s-0.448-1-1-1h-4.216l0.444-4h3.772c0.552 0 1-0.448 1-1s-0.448-1-1-1h-3.549l0.543-4.89c0.061-0.549-0.335-1.043-0.883-1.104s-1.043 0.335-1.104 0.883z\"></path></symbol>',\n '<symbol id=\"outline-icon-close\" viewBox=\"0 0 1024 1024\"><path d=\"M536.96 491.648L310.592 265.344a32 32 0 1 0-45.248 45.248L491.584 536.96l-226.304 226.304a32 32 0 0 0 45.312 45.248l226.24-226.304 226.304 226.304a32 32 0 0 0 45.248-45.248L582.144 536.896l226.304-226.24a32 32 0 0 0-45.248-45.248L536.896 491.584z\"></path></symbol>',\n '<symbol id=\"outline-icon-homepage\" viewBox=\"0 0 26 28\"><path d=\"M22 15.5v7.5c0 0.547-0.453 1-1 1h-6v-6h-4v6h-6c-0.547 0-1-0.453-1-1v-7.5c0-0.031 0.016-0.063 0.016-0.094l8.984-7.406 8.984 7.406c0.016 0.031 0.016 0.063 0.016 0.094zM25.484 14.422l-0.969 1.156c-0.078 0.094-0.203 0.156-0.328 0.172h-0.047c-0.125 0-0.234-0.031-0.328-0.109l-10.813-9.016-10.813 9.016c-0.109 0.078-0.234 0.125-0.375 0.109-0.125-0.016-0.25-0.078-0.328-0.172l-0.969-1.156c-0.172-0.203-0.141-0.531 0.063-0.703l11.234-9.359c0.656-0.547 1.719-0.547 2.375 0l3.813 3.187v-3.047c0-0.281 0.219-0.5 0.5-0.5h3c0.281 0 0.5 0.219 0.5 0.5v6.375l3.422 2.844c0.203 0.172 0.234 0.5 0.063 0.703z\"></path></symbol>',\n '<symbol id=\"outline-icon-github\" viewBox=\"0 0 24 28\"><path d=\"M12 2c6.625 0 12 5.375 12 12 0 5.297-3.437 9.797-8.203 11.391-0.609 0.109-0.828-0.266-0.828-0.578 0-0.391 0.016-1.687 0.016-3.297 0-1.125-0.375-1.844-0.812-2.219 2.672-0.297 5.484-1.313 5.484-5.922 0-1.313-0.469-2.375-1.234-3.219 0.125-0.313 0.531-1.531-0.125-3.187-1-0.313-3.297 1.234-3.297 1.234-0.953-0.266-1.984-0.406-3-0.406s-2.047 0.141-3 0.406c0 0-2.297-1.547-3.297-1.234-0.656 1.656-0.25 2.875-0.125 3.187-0.766 0.844-1.234 1.906-1.234 3.219 0 4.594 2.797 5.625 5.469 5.922-0.344 0.313-0.656 0.844-0.766 1.609-0.688 0.313-2.438 0.844-3.484-1-0.656-1.141-1.844-1.234-1.844-1.234-1.172-0.016-0.078 0.734-0.078 0.734 0.781 0.359 1.328 1.75 1.328 1.75 0.703 2.141 4.047 1.422 4.047 1.422 0 1 0.016 1.937 0.016 2.234 0 0.313-0.219 0.688-0.828 0.578-4.766-1.594-8.203-6.094-8.203-11.391 0-6.625 5.375-12 12-12zM4.547 19.234c0.031-0.063-0.016-0.141-0.109-0.187-0.094-0.031-0.172-0.016-0.203 0.031-0.031 0.063 0.016 0.141 0.109 0.187 0.078 0.047 0.172 0.031 0.203-0.031zM5.031 19.766c0.063-0.047 0.047-0.156-0.031-0.25-0.078-0.078-0.187-0.109-0.25-0.047-0.063 0.047-0.047 0.156 0.031 0.25 0.078 0.078 0.187 0.109 0.25 0.047zM5.5 20.469c0.078-0.063 0.078-0.187 0-0.297-0.063-0.109-0.187-0.156-0.266-0.094-0.078 0.047-0.078 0.172 0 0.281s0.203 0.156 0.266 0.109zM6.156 21.125c0.063-0.063 0.031-0.203-0.063-0.297-0.109-0.109-0.25-0.125-0.313-0.047-0.078 0.063-0.047 0.203 0.063 0.297 0.109 0.109 0.25 0.125 0.313 0.047zM7.047 21.516c0.031-0.094-0.063-0.203-0.203-0.25-0.125-0.031-0.266 0.016-0.297 0.109s0.063 0.203 0.203 0.234c0.125 0.047 0.266 0 0.297-0.094zM8.031 21.594c0-0.109-0.125-0.187-0.266-0.172-0.141 0-0.25 0.078-0.25 0.172 0 0.109 0.109 0.187 0.266 0.172 0.141 0 0.25-0.078 0.25-0.172zM8.937 21.438c-0.016-0.094-0.141-0.156-0.281-0.141-0.141 0.031-0.234 0.125-0.219 0.234 0.016 0.094 0.141 0.156 0.281 0.125s0.234-0.125 0.219-0.219z\"></path></symbol>',\n '<symbol id=\"outline-icon-issues\" viewBox=\"0 0 24 28\"><path d=\"M25.5 15c0 0.547-0.453 1-1 1h-3.5c0 1.953-0.422 3.422-1.047 4.531l3.25 3.266c0.391 0.391 0.391 1.016 0 1.406-0.187 0.203-0.453 0.297-0.703 0.297s-0.516-0.094-0.703-0.297l-3.094-3.078s-2.047 1.875-4.703 1.875v-14h-2v14c-2.828 0-4.891-2.063-4.891-2.063l-2.859 3.234c-0.203 0.219-0.469 0.328-0.75 0.328-0.234 0-0.469-0.078-0.672-0.25-0.406-0.375-0.438-1-0.078-1.422l3.156-3.547c-0.547-1.078-0.906-2.469-0.906-4.281h-3.5c-0.547 0-1-0.453-1-1s0.453-1 1-1h3.5v-4.594l-2.703-2.703c-0.391-0.391-0.391-1.016 0-1.406s1.016-0.391 1.406 0l2.703 2.703h13.188l2.703-2.703c0.391-0.391 1.016-0.391 1.406 0s0.391 1.016 0 1.406l-2.703 2.703v4.594h3.5c0.547 0 1 0.453 1 1zM18 6h-10c0-2.766 2.234-5 5-5s5 2.234 5 5z\"></path></symbol>',\n '<symbol id=\"outline-icon-tags\" viewBox=\"0 0 26 28\"><path d=\"M7 7c0-1.109-0.891-2-2-2s-2 0.891-2 2 0.891 2 2 2 2-0.891 2-2zM23.672 16c0 0.531-0.219 1.047-0.578 1.406l-7.672 7.688c-0.375 0.359-0.891 0.578-1.422 0.578s-1.047-0.219-1.406-0.578l-11.172-11.188c-0.797-0.781-1.422-2.297-1.422-3.406v-6.5c0-1.094 0.906-2 2-2h6.5c1.109 0 2.625 0.625 3.422 1.422l11.172 11.156c0.359 0.375 0.578 0.891 0.578 1.422zM29.672 16c0 0.531-0.219 1.047-0.578 1.406l-7.672 7.688c-0.375 0.359-0.891 0.578-1.422 0.578-0.812 0-1.219-0.375-1.75-0.922l7.344-7.344c0.359-0.359 0.578-0.875 0.578-1.406s-0.219-1.047-0.578-1.422l-11.172-11.156c-0.797-0.797-2.312-1.422-3.422-1.422h3.5c1.109 0 2.625 0.625 3.422 1.422l11.172 11.156c0.359 0.375 0.578 0.891 0.578 1.422z\"></path></symbol>'\n ]\n const sprites =\n isArray(symbols) && symbols.length > 0 ? SYMBOLS.concat(symbols) : SYMBOLS\n const $body = document.body\n let $icons = document.querySelector('#svg-sprites')\n\n if ($icons) {\n $icons.innerHTML = sprites.join('')\n } else {\n $icons = document.createElement('div')\n $icons.innerHTML =\n `<svg id=\"svg-sprites\" aria-hidden=\"true\" style=\"position:absolute;display:none;width:0;height:0;overflow:hidden;\">` +\n `${sprites.join('')}` +\n `</svg>`\n $body.insertBefore($icons.firstChild, $body.firstChild)\n }\n}\n\n/**\n * 创建 SVG 图标 DOM 元素\n * ========================================================================\n * @method createSvgIcon\n * @param {String} name\n * @param {Number|String|Array} [size]\n * @param {String} [color]\n * @param {String} [iconSet]\n * @returns {HTMLElement}\n */\nexport const createSvgIcon = (\n name,\n size = 0,\n color = '',\n iconSet = 'outline'\n) => {\n const binds = iconSet\n ? `xlink:href=\"#${iconSet}-icon-${name}\"`\n : `xlink:href=\"#icon-${name}\"`\n const width = isArray(size) ? size[0] : size\n const height = isArray(size) ? size[1] : size\n const defaultRules = size ? `width:${width}px;height:${height}px;` : ''\n const cssRules = color ? defaultRules + `color:${color}` : defaultRules\n const svg =\n `<svg aria-hidden=\"true\" class=\"outline-icon__svg\" style=\"${cssRules}\">` +\n `<use ${binds}></use>` +\n `</svg>`\n const $icon = document.createElement('i')\n\n $icon.className = 'outline-icon'\n $icon.innerHTML = svg\n\n return $icon\n}\n","import isString from '../types/isString'\n\n/**\n * 清楚字符串起始位置所有的空格\n * ========================================================================\n * @method trim\n * @param {string} str\n * @returns {string|Boolean}\n */\nconst trim = (str) => {\n if (!isString(str)) {\n return false\n }\n return str.replace(/(^\\s+)|(\\s+$)/g, '')\n}\n\nexport default trim\n","import isObject from './isObject'\r\nimport isElement from './isElement'\r\nimport isHTMLCollection from './isHTMLCollection'\r\nimport isFragment from './isFragment'\r\nimport isTextNode from './isTextNode'\r\n\r\nconst isDOM = (el) => {\r\n return !!(\r\n isObject(el) &&\r\n (isElement(el) || isHTMLCollection(el) || isFragment(el) || isTextNode(el))\r\n )\r\n}\r\n\r\nexport default isDOM\r\n","import toString from '../lang/toString'\r\nimport isObject from './isObject'\r\n\r\nconst isHTMLCollection = (el) => {\r\n return !!(isObject(el) && toString(el) === '[object NodeList]')\r\n}\r\n\r\nexport default isHTMLCollection\r\n","import toString from '../lang/toString'\nimport isObject from './isObject'\n\nconst isFragment = (fragment) => {\n return !!(\n isObject(fragment) && toString(fragment) === '[object DocumentFragment]'\n )\n}\n\nexport default isFragment\n","import toString from '../lang/toString'\r\nimport isObject from './isObject'\r\n\r\nconst isTextNode = (el) => {\r\n return !!(\r\n isObject(el) &&\r\n (toString(el) === '[object Text]' || (el.tagName && el.nodeType === 3))\r\n )\r\n}\r\n\r\nexport default isTextNode\r\n","/**\n * 给 DOM 节点设置属性/值\n * ========================================================================\n * @method setAttribute\n * @param {HTMLElement} el - DOM 节点\n * @param {String} attr - 属性名称\n * @param {String|Number|Boolean} value - 属性值\n */\nconst setAttribute = (el, attr, value) => {\n let tagName = el.tagName.toLowerCase()\n\n switch (attr) {\n case 'style':\n el.style.cssText = value\n break\n case 'value':\n if (tagName === 'input' || tagName === 'textarea') {\n el.value = value\n } else {\n el.setAttribute(attr, value)\n }\n break\n case 'className':\n el.className = value\n break\n default:\n el.setAttribute(attr, value)\n break\n }\n}\n\nexport default setAttribute\n","import hasOwn from '../lang/hasOwn'\nimport isObject from '../types/isObject'\nimport isString from '../types/isString'\nimport isArray from '../types/isArray'\nimport isDOM from '../types/isDOM'\nimport setAttribute from './setAttribute'\n\n/**\n * 创建 DOM 节点,并添加属性和子节点\n * ========================================================================\n * @method createElement\n * @param {String} tagName - 标签名称\n * @param {Object|Array} attrs - 属性对象或者子节点\n * @param {Array} [children] - 子节点数组\n * @returns {HTMLElement}\n */\nconst createElement = (tagName, attrs, children) => {\n const $fragment = document.createDocumentFragment()\n const $el = document.createElement(tagName)\n const isValidChild = (child) => {\n return isDOM(child) || isString(child)\n }\n const append = (child) => {\n let $child\n\n if (!isValidChild(child)) {\n return false\n }\n\n if (isDOM(child)) {\n $child = child\n } else if (isString(child)) {\n $child = document.createTextNode(child)\n }\n\n $fragment.appendChild($child)\n }\n\n if (isObject(attrs)) {\n Object.keys(attrs).forEach((attr) => {\n if (hasOwn(attrs, attr)) {\n setAttribute($el, attr, attrs[attr])\n }\n })\n } else if (isArray(attrs) && attrs.every((attr) => isValidChild(attr))) {\n attrs.forEach((child) => {\n append(child)\n })\n }\n\n if (isArray(children)) {\n children.forEach((child) => {\n append(child)\n })\n } else {\n append(children)\n }\n\n $el.appendChild($fragment)\n\n return $el\n}\n\nexport default createElement\n","import isElement from '../types/isElement'\n/**\n * 检测 DOM 节点是否包含名为 className 的样式\n * ========================================================================\n * @method hasClass\n * @param {HTMLElement} el - DOM 节点\n * @param {String} className - 样式名称\n * @returns {Boolean}\n */\nconst hasClass = (el, className) => {\n const pattern = new RegExp('(\\\\s|^)' + className + '(\\\\s|$)')\n let allClass\n let classList\n\n if (!isElement(el)) {\n return false\n }\n\n allClass = el.className\n\n if (!allClass) {\n return false\n }\n\n classList = el.classList\n\n if (classList?.contains) {\n return el.classList.contains(className)\n }\n\n return !!pattern.exec(allClass)\n}\n\nexport default hasClass\n","import trim from '../lang/trim'\nimport hasClass from './hasClass'\n\n/**\n * 移除 DOM 节点的 className 样式\n * ========================================================================\n * @method removeClass\n * @param {HTMLElement} el - DOM 节点\n * @param {String} className - 样式名称\n * @returns {Boolean}\n */\nconst removeClass = (el, className) => {\n let allClass = el.className\n let classList\n\n if (!allClass || !hasClass(el, className)) {\n return false\n }\n\n classList = el.classList\n\n if (classList?.remove) {\n classList.remove(className)\n } else {\n allClass = trim(allClass.replace(className, ''))\n el.className = allClass\n }\n}\n\nexport default removeClass\n","import removeClass from './utils/dom/removeClass'\nimport isEmpty from './utils/types/isEmpty'\nimport trim from './utils/lang/trim'\n\nconst _resetHeading = ($heading, hasAnchor = true, isAtStart = true) => {\n const CLS_HEADING = 'outline-heading'\n const text = $heading.innerHTML\n let $anchor\n\n $heading.innerHTML = text.replace(/^\\d+(?:(\\.?\\d*)*\\s?)?/gi, '')\n $heading.removeAttribute('id')\n $heading.removeAttribute('data-id')\n\n removeClass($heading, CLS_HEADING)\n\n if (!hasAnchor) {\n return false\n }\n\n $anchor = $heading.querySelector(`.${CLS_HEADING}__anchor`)\n\n if (isAtStart) {\n removeClass($heading, `${CLS_HEADING}_start`)\n }\n\n if (isEmpty(trim($heading.className))) {\n $heading.removeAttribute('class')\n }\n\n $heading.removeChild($anchor)\n}\n\nexport default _resetHeading\n","import isString from './isString'\n/**\n * 检测数据是否为空字符串\n * ========================================================================\n * @method isEmpty\n * @param {String} str\n * @returns {boolean}\n */\nconst isEmpty = (str) => {\n return isString(str) && str === ''\n}\n\nexport default isEmpty\n","import trim from './utils/lang/trim'\nimport stripTags from './utils/lang/stripTags'\n\nimport _getChapterParentIdByDiffer from './_getChapterParentIdByDiffer'\nimport _getChaptersWithCode from './_getChaptersWithCode'\n\nconst getChapters = (headings, showCode = true) => {\n let previous = 1\n let level = 0\n const chapters = []\n\n headings.forEach((heading, i) => {\n const headingLevel = heading.tagName.replace(/h/i, '')\n let current = parseInt(headingLevel, 10)\n let pid = -1\n\n // 场景1:当前标题是前一个标题的子标题\n // 当前标题的(标题标签)序号 > 前一个标题的序号:两个相连的标题是父标题 -> 子标题关系;\n // h2 (前一个标题)\n // h3 (当前标题)\n if (current > previous) {\n level += 1\n\n // 第一层级的 pid 是 -1\n if (level === 1) {\n pid = -1\n } else {\n pid = i - 1\n }\n }\n // 场景2:当前标题和前一个标题层级相同\n // 当前标题的(标题标签)序号 = 前一个标题的序号\n // h2 (前一个标题)\n // h2 (当前标题)\n // 当前标题的(标题标签)序号 < 前一个标题的序号,并且当前标题序号 > 当前的级别\n // h2\n // h4 (前一个标题)\n // h3 (当前标题:这种情况我们还是任务 h3 是 h2 的下一级章节)\n else if (current === previous || (current < previous && current > level)) {\n // H1 的层级肯定是 1\n if (current === 1) {\n level = 1\n pid = -1\n } else {\n pid = chapters[i - 1].pid\n }\n }\n // 场景3:当前标题比前一个标题层级高\n else if (current <= level) {\n // H1 的层级肯定是 1\n if (current === 1) {\n level = 1\n } else {\n level = level - (previous - current)\n\n if (level <= 1) {\n level = 1\n }\n }\n\n // 第一级的标题\n if (level === 1) {\n pid = -1\n } else {\n // 通过当前标题和前一个标题之间的等级差,获得当前标题的父标题ID\n pid = _getChapterParentIdByDiffer(chapters, previous - current, i)\n }\n }\n\n previous = current\n\n chapters.push({\n id: i,\n pid: pid,\n level: level,\n rel: `heading-${i}`,\n text: stripTags(trim(heading.innerHTML))\n })\n })\n\n return showCode ? _getChaptersWithCode(chapters) : chapters\n}\n\nexport default getChapters\n","import isString from '../types/isString'\n\n/**\n * 过滤所有 HTML 标签\n * ========================================================================\n * @method stripTags\n * @param {string} str\n * @returns {string}\n */\nconst stripTags = (str) => {\n if (!isString(str)) {\n return ''\n }\n return str.replace(/<\\/?[^>]+(>|$)/g, '')\n}\n\nexport default stripTags\n","const _getChapterParentIdByDiffer = (chapters, differ, index) => {\n let previous = chapters[index - 1]\n let pid\n let i\n\n for (i = 0; i < differ; i += 1) {\n pid = previous.pid\n previous = chapters[pid]\n }\n\n pid = previous.pid\n\n return pid\n}\n\nexport default _getChapterParentIdByDiffer\n","const _getChaptersWithCode = (chapters) => {\n const groups = {}\n const cb = (o) => {\n return [o.pid]\n }\n\n chapters.forEach((o) => {\n const group = JSON.stringify(cb(o))\n\n groups[group] = groups[group] || []\n groups[group].push(o)\n\n o.index = groups[group].length\n if (o.pid === -1) {\n o.code = String(o.index)\n }\n })\n\n Object.keys(groups).forEach((group) => {\n groups[group].forEach((c) => {\n chapters.forEach((o) => {\n if (o.pid === c.id) {\n o.code = c.code + '.' + o.index\n }\n })\n })\n })\n\n return chapters\n}\n\nexport default _getChaptersWithCode\n","import Base from './base'\n\n// 在文章的标题生成 anchor 链接\nimport isString from './utils/types/isString'\nimport isFunction from './utils/types/isFunction'\nimport isElement from './utils/types/isElement'\nimport toTree from './utils/lang/toTree'\nimport later from './utils/lang/later'\nimport scrollTo from './utils/dom/scrollTo'\nimport _getScrollElement from './utils/dom/_getScrollElement'\nimport offsetTop from './utils/dom/offsetTop'\nimport on from './utils/event/on'\nimport off from './utils/event/off'\nimport stop from './utils/event/stop'\nimport publish from './utils/observer/emit'\nimport { paintSvgSprites } from './utils/icons'\n\nimport _updateHeading from './_updateHeading'\nimport _resetHeading from './_resetHeading'\nimport getChapters from './getChapters'\n\nclass Anchors extends Base {\n constructor(options) {\n super()\n\n this.attrs = Anchors.DEFAULTS\n this.$articleElement = null\n this.$scrollElement = null\n this.$headings = []\n\n this.chapters = []\n\n if (options) {\n this.initialize(options)\n }\n }\n\n initialize(options) {\n let created\n let scrollElement\n let selector\n let $articleElement\n let articleElement\n\n this.attr(options)\n articleElement = this.attr('articleElement')\n scrollElement = this.attr('scrollElement')\n selector = this.attr('selector')\n created = this.attr('created')\n\n if (isString(articleElement)) {\n $articleElement = document.querySelector(articleElement)\n } else if (isElement(articleElement)) {\n $articleElement = articleElement\n }\n\n if (!$articleElement) {\n return this\n }\n\n this.$articleElement = $articleElement\n this.$scrollElement = _getScrollElement(scrollElement)\n this.$headings = [...$articleElement.querySelectorAll(selector)]\n\n if (this.$headings.length < 1) {\n return this\n }\n\n this.chapters = getChapters(this.$headings)\n\n if (isFunction(created)) {\n created.call(this)\n }\n\n this.render().addListeners()\n\n return this\n }\n\n getChapters(isTreeStructured = false) {\n const chapters = this.chapters\n return isTreeStructured ? toTree(chapters, 'id', 'pid') : chapters\n }\n\n count() {\n return this.chapters.length\n }\n\n render() {\n const mounted = this.attr('mounted')\n const hasAnchor = this.attr('hasAnchor')\n const isAtStart = this.attr('isAtStart')\n const showCode = this.attr('showCode')\n const anchorURL = this.attr('anchorURL')\n const $headings = this.$headings\n const chapters = this.getChapters()\n\n paintSvgSprites()\n\n $headings.forEach(($heading, i) => {\n const chapterCode = chapters[i].code\n _updateHeading($heading, i, {\n hasAnchor,\n isAtStart,\n showCode,\n chapterCode,\n anchorURL\n })\n })\n\n if (isFunction(mounted)) {\n mounted.call(this)\n }\n\n return this\n }\n\n scrollTo(top, after) {\n const el = this.$scrollElement\n\n scrollTo(el, top, after)\n\n return this\n }\n\n destroy() {\n const hasAnchor = this.attr('hasAnchor')\n const isAtStart = this.attr('isAtStart')\n const beforeDestroy = this.attr('beforeDestroy')\n const afterDestroy = this.attr('afterDestroy')\n const $headings = this.$headings\n\n if (isFunction(beforeDestroy)) {\n beforeDestroy.call(this)\n }\n\n this.removeListeners()\n $headings.forEach(($heading) => {\n _resetHeading($heading, hasAnchor, isAtStart)\n })\n\n this.attr(Anchors.DEFAULTS)\n this.$articleElement = null\n this.$scrollElement = null\n this.$headings = []\n this.chapters = []\n\n if (isFunction(afterDestroy)) {\n afterDestroy.call(this)\n }\n\n return this\n }\n\n onAnchorTrigger(evt) {\n const anchorURL = this.attr('anchorURL')\n const afterScroll = this.attr('afterScroll')\n const stickyHeight = this.attr('stickyHeight')\n const $anchor = evt.delegateTarget\n const $heading = $anchor.parentNode\n const top = offsetTop($heading) - (stickyHeight + 10)\n const $scrollElement = this.$scrollElement\n const min = 0\n const max = $scrollElement.scrollHeight - $scrollElement.clientHeight\n const after = () => {\n if (isFunction(afterScroll)) {\n afterScroll.call(this, 'anchor')\n }\n\n later(() => {\n publish('toolbar:update', {\n top,\n min,\n max\n })\n })\n }\n\n this.scrollTo(top, after)\n\n if (!anchorURL) {\n stop(evt)\n }\n\n return this\n }\n\n addListeners() {\n const $articleElement = this.$articleElement\n\n on(\n $articleElement,\n '.outline-heading__anchor',\n 'click',\n this.onAnchorTrigger,\n this,\n true\n )\n\n return this\n }\n\n removeListeners() {\n const $articleElement = this.$articleElement\n\n off($articleElement, 'click', this.onAnchorTrigger)\n\n return this\n }\n}\n\nAnchors.DEFAULTS = {\n scrollElement: 'html,body',\n articleElement: '#article',\n selector: 'h1,h2,h3,h4,h5,h6',\n stickyHeight: 0,\n anchorURL: '',\n hasAnchor: true,\n isAtStart: true,\n showCode: false,\n created: null,\n mounted: null,\n afterScroll: null,\n beforeDestroy: null,\n afterDestroy: null\n}\n\nexport default Anchors\n","const toTree = (list, nodeKey, parentKey) => {\r\n const map = {}\r\n const roots = []\r\n\r\n list.forEach((item, i) => {\r\n // initialize the map\r\n map[item[nodeKey]] = i\r\n // initialize the children\r\n item.children = []\r\n })\r\n\r\n list.forEach((item) => {\r\n const node = list[map[item[parentKey]]]\r\n\r\n if (item[parentKey] !== -1) {\r\n // if you have dangling branches check that map[node.parentId] exists\r\n node.children.push(item)\r\n } else {\r\n roots.push(item)\r\n }\r\n })\r\n\r\n return roots\r\n}\r\n\r\nexport default toTree\r\n","import trim from './utils/lang/trim'\nimport createElement from './utils/dom/createElement'\nimport setAttribute from './utils/dom/setAttribute'\n\nimport { createSvgIcon } from './utils/icons'\n\nconst _updateHeading = ($heading, i, options) => {\n const CLS_HEADING = 'outline-heading'\n const hasAnchor = options.hasAnchor || true\n const isAtStart = options.isAtStart || true\n const showCode = options.showCode || false\n const chapterCode = options.chapterCode || ''\n const anchorURL = options.anchorURL || ''\n const headingId = `heading-${i}`\n const attrs = {\n id: headingId,\n className: isAtStart ? `${CLS_HEADING} ${CLS_HEADING}_start` : CLS_HEADING,\n 'data-id': i\n }\n const keys = Object.keys(attrs)\n const text = trim($heading.innerHTML)\n let $anchor\n let $icon\n\n keys.forEach((prop) => {\n setAttribute($heading, prop, attrs[prop])\n })\n\n if (showCode) {\n $heading.innerHTML = chapterCode + ' ' + text\n }\n\n if (!hasAnchor) {\n return false\n }\n\n $icon = createSvgIcon('hash')\n $anchor = createElement(\n 'a',\n {\n id: `anchor-${i}`,\n className: `${CLS_HEADING}__anchor anchor-${i}`,\n href: anchorURL ? anchorURL : `#${headingId}`,\n target: anchorURL ? '_blank' : 'self',\n 'data-id': i\n },\n [$icon]\n )\n $heading.appendChild($anchor)\n}\n\nexport default _updateHeading\n","import hasClass from './hasClass'\n\n/**\n * 给 DOM 节点添加名为 className 的样式\n * ========================================================================\n * @method addClass\n * @param {HTMLElement} el - DOM 节点\n * @param {String} className - 样式名称\n * @returns {Boolean}\n */\nconst addClass = (el, className) => {\n let classList\n let allClass\n\n if (hasClass(el, className)) {\n return false\n }\n\n classList = el.classList\n\n if (classList?.add) {\n classList.add(className)\n } else {\n allClass = el.className\n allClass += allClass.length > 0 ? ' ' + className : className\n el.className = allClass\n }\n}\n\nexport default addClass\n","const setProperty = (prop, value) => {\r\n const documentElement = document.documentElement\r\n documentElement.style.setProperty(prop, value)\r\n}\r\n\r\nexport default setProperty\r\n","import setProperty from './utils/dom/setProperty'\n\nlet index = 2000\n\nconst zIndex = (idx) => {\n if (idx) {\n index = idx\n } else {\n index += 1\n }\n\n setProperty('--outline-zIndex', `${index}`)\n\n return index\n}\n\nexport default zIndex\n","import Base from './base'\n\nimport later from './utils/lang/later'\nimport isFunction from './utils/types/isFunction'\nimport addClass from './utils/dom/addClass'\nimport removeClass from './utils/dom/removeClass'\nimport createElement from './utils/dom/createElement'\nimport on from './utils/event/on'\nimport off from './utils/event/off'\n\nimport { paintSvgSprites, createSvgIcon } from './utils/icons'\nimport zIndex from './zIndex'\n\nclass Drawer extends Base {\n constructor(options) {\n super()\n\n this.attrs = Drawer.DEFAULTS\n this.title = ''\n this.closed = true\n this.$el = null\n this.$modal = null\n this.$header = null\n this.$title = null\n this.$close = null\n this.$main = null\n this.$footer = null\n this.$overlay = null\n this.zIndex = 0\n\n if (options) {\n this.initialize(options)\n }\n }\n\n initialize(options) {\n let created\n\n this.attr(options)\n\n this.title = this.attr('title')\n created = this.attr('created')\n\n if (isFunction(created)) {\n created.call(this)\n }\n\n this.render().addListeners()\n return this\n }\n\n setTitle(title) {\n this.attr('title', title)\n this.title = title\n this.$title.innerHTML = title\n\n return this\n }\n\n isClosed() {\n return this.closed\n }\n\n render() {\n const mounted = this.attr('mounted')\n const size = this.attr('size')\n const placement = this.attr('placement')\n const hasClose = this.attr('hasClose')\n const hasOverlay = this.attr('hasOverlay')\n const hasOffset = this.attr('hasOffset')\n const hasPadding = this.attr('hasPadding')\n const autoHeight = this.attr('autoHeight')\n const customClass = this.attr('customClass')\n const $fragment = document.createDocumentFragment()\n let $el\n let $modal\n let $header\n let $title\n let $close\n let $main\n let $footer\n let $overlay\n\n paintSvgSprites()\n this.zIndex = zIndex()\n\n $title = createElement(\n 'h2',\n {\n className: 'outline-drawer__title'\n },\n [this.title]\n )\n this.$title = $title\n\n if (hasClose) {\n $close = createElement(\n 'div',\n {\n className: 'outline-drawer__close'\n },\n [createSvgIcon('close', 20)]\n )\n this.$close = $close\n }\n\n $header = createElement(\n 'header',\n {\n className: 'outline-drawer__header'\n },\n [$title, $close]\n )\n this.$header = $header\n\n $main = createElement(\n 'div',\n {\n className: 'outline-drawer__main'\n },\n ['']\n )\n this.$main = $main\n\n if (!hasPadding) {\n addClass($main, 'outline-drawer_full')\n }\n\n $footer = createElement(\n 'footer',\n {\n className: 'outline-drawer__footer'\n },\n ['']\n )\n this.$footer = $footer\n\n $modal = createElement(\n 'div',\n {\n className: `outline-drawer__modal outline-drawer_${placement} outline-drawer_${size} outline-drawer_closed`\n },\n [$header, $main, $footer]\n )\n this.$modal = $modal\n\n if (hasOffset) {\n addClass($modal, 'outline-drawer_offset')\n }\n\n if (autoHeight) {\n addClass($modal, 'outline-drawer_auto')\n }\n\n if (customClass) {\n addClass($modal, customClass)\n }\n\n if (hasOverlay) {\n $overlay = createElement(\n 'div',\n {\n className: 'outline-drawer__overlay'\n },\n ['']\n )\n this.$overlay = $overlay\n }\n\n $el = createElement(\n 'div',\n {\n className: `outline-drawer`\n },\n [$modal, $overlay]\n )\n this.$el = $el\n $fragment.appendChild($el)\n document.body.appendChild($fragment)\n\n if (isFunction(mounted)) {\n mounted.call(this)\n }\n\n return this\n }\n\n open() {\n const opened = this.attr('afterOpened')\n const $modal = this.$modal\n\n addClass(this.$el, 'outline-drawer_opened')\n removeClass($modal, 'outline-drawer_closed')\n addClass($modal, 'outline-drawer_opened')\n\n later(() => {\n this.closed = false\n\n if (isFunction(opened)) {\n opened.call(this)\n }\n })\n\n return this\n }\n\n close() {\n const closed = this.attr('afterClosed')\n const $modal = this.$modal\n\n removeClass($modal, 'outline-drawer_opened')\n addClass($modal, 'outline-drawer_closed')\n\n later(() => {\n removeClass(this.$el, 'outline-drawer_opened')\n this.closed = true\n\n if (isFunction(closed)) {\n closed.call(this)\n }\n })\n\n return this\n }\n\n toggle() {\n const afterToggle = this.attr('afterToggle')\n const closed = this.isClosed()\n\n if (closed) {\n this.open()\n } else {\n this.close()\n }\n\n if (isFunction(afterToggle)) {\n later(() => {\n afterToggle.call(this, closed)\n })\n }\n\n return this\n }\n\n destroy() {\n const afterDestroy = this.attr('afterDestroy')\n const beforeDestroy = this.attr('beforeDestroy')\n let index = this.zIndex\n\n if (isFunction(beforeDestroy)) {\n beforeDestroy.call(this)\n }\n\n this.removeListeners()\n\n this.attrs = Drawer.DEFAULTS\n this.title = ''\n this.closed = false\n this.$el = null\n this.$modal = null\n this.$header = null\n this.$title = null\n this.$close = null\n this.$main = null\n this.$footer = null\n this.$overlay = null\n\n index -= 1\n zIndex(index)\n this.zIndex = 0\n\n if (isFunction(afterDestroy)) {\n afterDestroy.call(this)\n }\n\n return this\n }\n\n addListeners() {\n const hasClose = this.attr('hasClose')\n const hasOverlay = this.attr('hasOverlay')\n const $el = this.$el\n\n if (hasClose) {\n on($el, '.outline-drawer__close', 'click', this.onClose, this, true)\n }\n\n if (hasOverlay) {\n on($el, '.outline-drawer__overlay', 'click', this.onClose, this, true)\n }\n\n return this\n }\n\n removeListeners() {\n const hasClose = this.attr('hasClose')\n const hasOverlay = this.attr('hasOverlay')\n const $el = this.$el\n\n if (!hasClose && !hasOverlay) {\n return this\n }\n\n off($el, 'click', this.onClose)\n\n return this\n }\n\n onClose() {\n this.close()\n return this\n }\n}\n\nDrawer.DEFAULTS = {\n placement: 'rtl',\n title: '标题',\n size: 'regular',\n hasClose: true,\n hasOverlay: true,\n hasOffset: false,\n hasPadding: true,\n autoHeight: true,\n created: null,\n mounted: null,\n afterClosed: null,\n afterOpened: null,\n afterScroll: null,\n beforeDestroy: null,\n afterDestroy: null,\n afterToggle: null\n}\n\nexport default Drawer\n","import isFunction from '../types/isFunction'\nimport off from './off'\n\nimport { CAPTURE_EVENTS } from './enum'\n\n/**\n * 绑定事件\n * ========================================================================\n * @method at\n * @param {HTMLElement|String|Object} el - (必须)绑定代理事件的 DOM 节点\n * @param {String|Function} type - (必须)事件类型或者事件处理器回调函数\n * @param {Function|Object} fn - (必须) 事件处理器回调函数或者传递给事件处理器回调函数的数据对象\n * @param {Object|Boolean} [data] - (可选)传递给事件处理器回调函数的数据对象或者事件处理器回调函数的 this 上下文指向,\n * @param {Object|Boolean} [context] - (可选)事件处理器回调函数的 this 上下文指向,或者是否仅触发一次\n * 当设置为 true 时,则事件处理器回调函数的 this 上下文指向为 data 对象\n * @param {Boolean} once - (可选)是否仅触发一次\n */\nconst at = (el, type, fn, data, context, once = false) => {\n // CAPTURE_EVENTS 中的特殊事件,采用事件捕获模型\n const capture = CAPTURE_EVENTS.indexOf(type) > -1\n const listener = function (evt) {\n let overrideContext = context || el\n\n // 当设置为 true 时,则事件处理器回调函数的\n // this 上下文指向为 data 对象\n if (context === true) {\n overrideContext = data\n }\n\n // 仅触发一次\n /* istanbul ignore else */\n if (once === true) {\n off(el, type, listener)\n }\n\n fn.call(overrideContext, evt, data)\n }\n\n if (!isFunction(fn)) {\n return false\n }\n\n if (!el._listeners) {\n el._listeners = []\n }\n\n // 缓存 options 元素绑定的事件处理器\n el._listeners.push({\n el,\n type,\n fn: listener,\n data,\n context,\n capture\n })\n\n // 缓存包装后的事件处理器\n fn._delegateListener = listener\n\n el.addEventListener(type, listener, capture)\n}\n\nexport default at\n","/**\r\n * 获取HTML元素的某个CSS样式值\r\n * ====================================================\r\n * @param el\r\n * @param ruleName\r\n * @returns {*}\r\n */\r\nconst getStyle = (el, ruleName) => {\r\n return getComputedStyle(el)[ruleName]\r\n}\r\n\r\nexport default getStyle\r\n","import Base from './base'\n\nimport isString from './utils/types/isString'\nimport isFunction from './utils/types/isFunction'\nimport isElement from './utils/types/isElement'\nimport later from './utils/lang/later'\nimport at from './utils/event/at'\nimport on from './utils/event/on'\nimport off from './utils/event/off'\nimport stop from './utils/event/stop'\nimport createElement from './utils/dom/createElement'\nimport scrollTo from './utils/dom/scrollTo'\nimport addClass from './utils/dom/addClass'\nimport intersection from './utils/dom/intersection'\nimport removeClass from './utils/dom/removeClass'\nimport offsetTop from './utils/dom/offsetTop'\nimport getStyle from './utils/dom/getStyle'\nimport setProperty from './utils/dom/setProperty'\nimport publish from './utils/observer/emit'\n\nimport _getScrollElement from './utils/dom/_getScrollElement'\nimport _paintChapters from './_paintChapters'\n\nclass Chapters extends Base {\n constructor(options) {\n super()\n\n this.attrs = Chapters.DEFAULTS\n this.$el = null\n this.$title = null\n this.$main = null\n this.$list = null\n this.$placeholder = null\n this.$parentElement = null\n this.$scrollElement = null\n this.chapters = []\n this.closed = false\n this.active = 0\n this.offsetTop = 0\n this.offsetWidth = 0\n this.$active = null\n this.scrollTimer = null\n this.resizeTimer = null\n this.playing = false\n this.Observer = null\n\n if (options) {\n this.initialize(options)\n }\n }\n\n initialize(options) {\n let created\n let parentElement\n let scrollElement\n let $parent\n\n this.attr(options)\n created = this.attr('created')\n parentElement = this.attr('parentElement')\n scrollElement = this.attr('scrollElement')\n\n if (isString(parentElement)) {\n $parent = document.querySelector(parentElement)\n } else if (isElement(parentElement)) {\n $parent = parentElement\n }\n this.$parentElement = $parent\n this.$scrollElement = _getScrollElement(scrollElement)\n\n this.chapters = this.attr('chapters')\n this.closed = this.attr('closed')\n this.active = this.attr('active')\n\n if (isFunction(created)) {\n created.call(this)\n }\n\n if (this.chapters.length < 1) {\n return this\n }\n\n this.render().addListeners()\n\n this.$active = document.querySelector(`#chapter-${this.active}`)\n\n return this\n }\n\n isClosed() {\n return this.closed\n }\n\n isSticky() {\n const position = this.attr('position')\n return position === 'sticky'\n }\n\n isFixed() {\n const position = this.attr('position')\n return position === 'fixed'\n }\n\n isInside() {\n return this.isFixed() || this.isSticky()\n }\n\n isOutside() {\n return !this.isInside()\n }\n\n _paintEdge() {\n const STICKY = 'outline-chapters_sticky'\n const FIXED = 'outline-chapters_fixed'\n const HIDDEN = 'outline-chapters_hidden'\n const title = this.attr('title')\n const customClass = this.attr('customClass')\n const $parentElement = this.$parentElement\n const contents = []\n let $title = null\n let $el\n let $main\n let $list\n let $placeholder\n\n if (!$parentElement) {\n return this\n }\n\n if (this.isInside()) {\n $title = createElement(\n 'h2',\n {\n className: 'outline-chapters__title'\n },\n [title]\n )\n this.$title = $title\n contents.push($title)\n }\n\n $list = createElement(\n 'ul',\n {\n // 为优化性能,添加了 _fixed 和 _hidden\n // fixed 为了让 $list 脱离流布局\n // hidden 让 $list 不可见\n className: `outline-chapters__list ${FIXED} ${HIDDEN}`\n },\n ['']\n )\n this.$list = $list\n\n $placeholder = createElement(\n 'div',\n {\n className: 'outline-chapters__placeholder'\n },\n ['']\n )\n this.$placeholder = $placeholder\n\n $main = createElement(\n 'div',\n {\n className: 'outline-chapters__main'\n },\n [$list, $placeholder]\n )\n this.$main = $main\n contents.push($main)\n\n $el = createElement(\n 'nav',\n {\n id: 'outline-chapters',\n className: 'outline-chapters'\n },\n contents\n )\n this.$el = $el\n\n if (this.isSticky()) {\n this.calculateStickyHeight()\n addClass($el, STICKY)\n }\n\n if (customClass) {\n addClass($el, customClass)\n }\n\n $parentElement.appendChild($el)\n\n return this\n }\n\n render() {\n const FIXED = 'outline-chapters_fixed'\n const HIDDEN = 'outline-chapters_hidden'\n const showCode = this.attr('showCode')\n const mounted = this.attr('mounted')\n const $parentElement = this.$parentElement\n let $el\n let $list\n\n if (!$parentElement) {\n return this\n }\n\n this._paintEdge()\n\n $list = this.$list\n _paintChapters($list, this.chapters, showCode)\n removeClass($list, FIXED)\n removeClass($list, HIDDEN)\n this.positionPlaceholder(this.active)\n\n $el = this.$el\n this.offsetTop = offsetTop($el)\n this.offsetWidth = $el.offsetWidth\n\n if (this.isFixed()) {\n this.sticky()\n setProperty('--outline-chapters-width', `${this.offsetWidth}px`)\n }\n\n if (isFunction(mounted)) {\n mounted.call(this)\n }\n\n this.onObserver()\n\n return this\n }\n\n positionPlaceholder(index) {\n const $main = this.$main\n const $list = this.$list\n const $placeholder = this.$placeholder\n const $anchor = $list.querySelector('.outline-chapters__anchor')\n const mainPaddingTop = parseInt(getStyle($main, 'padding-top'), 10)\n const mainBorderTop = parseInt(getStyle($main, 'border-top-width'), 10)\n const placeholderPaddingTop = parseInt(getStyle($list, 'padding-top'), 10)\n const placeholderMarginTop = parseInt(getStyle($list, 'margin-top'), 10)\n const placeholderBorderTop = parseInt(\n getStyle($list, 'border-top-width'),\n 10\n )\n let height = $anchor.offsetHeight\n let offsetTop = 0\n let top\n\n if (mainPaddingTop) {\n offsetTop += mainPaddingTop\n }\n\n if (placeholderPaddingTop) {\n offsetTop += placeholderPaddingTop\n }\n\n if (placeholderMarginTop) {\n offsetTop += placeholderMarginTop\n }\n\n if (mainBorderTop) {\n offsetTop += mainBorderTop\n }\n\n if (placeholderBorderTop) {\n offsetTop += placeholderBorderTop\n }\n\n top = height * index\n // top:calc(${offsetTop}px + ${top}px);\n $placeholder.style.cssText = `transform: translateY(${\n offsetTop + top\n }px);height:${height}px;`\n\n return this\n }\n\n highlight(id) {\n const $anchor = this.$el.querySelector(`#chapter__anchor-${id}`)\n const HIGHLIGHT = 'outline-chapters_active'\n\n if (!$anchor) {\n return this\n }\n\n if (this.$active) {\n removeClass(this.$active, HIGHLIGHT)\n }\n\n this.active = parseInt($anchor.getAttribute('data-id'), 10)\n this.$active = $anchor\n addClass(this.$active, HIGHLIGHT)\n\n this.positionPlaceholder(this.active)\n\n return this\n }\n\n sticky() {\n const afterSticky = this.attr('afterSticky')\n const FIXED = 'outline-chapters_fixed'\n const $el = this.$el\n const top = this.offsetTop\n const scrollTop = this.$scrollElement.scrollTop\n let isStickying\n\n if (!this.isFixed()) {\n return this\n }\n\n isStickying = scrollTop >= top\n\n if (isStickying) {\n addClass($el, FIXED)\n } else {\n removeClass($el, FIXED)\n }\n\n if (isFunction(afterSticky)) {\n afterSticky.call(this, this.isClosed(), isStickying)\n }\n\n return this\n }\n\n calculateStickyHeight() {\n const documentElement = document.documentElement\n const height = Math.max(\n documentElement.clientHeight || 0,\n window.innerHeight || 0\n )\n setProperty('--outline-sticky-height', `${height}px`)\n return this\n }\n\n scrollTo(top, after) {\n const el = this.$scrollElement\n\n scrollTo(el, top, after)\n\n return this\n }\n\n show() {\n const FOLDED = 'outline-chapters_folded'\n const HIDDEN = 'outline-chapters_hidden'\n const opened = this.attr('afterOpened')\n const $el = this.$el\n const $parent = this.$parentElement\n\n if (this.isInside()) {\n removeClass($parent, HIDDEN)\n removeClass($el, HIDDEN)\n later(() => {\n removeClass($parent, FOLDED)\n removeClass($el, FOLDED)\n }, 30)\n } else {\n removeClass($el, HIDDEN)\n }\n this.closed = false\n\n if (isFunction(opened)) {\n opened.call(this)\n }\n\n return this\n }\n\n hide() {\n const FOLDED = 'outline-chapters_folded'\n const HIDDEN = 'outline-chapters_hidden'\n const closed = this.attr('afterClosed')\n const $el = this.$el\n const $parent = this.$parentElement\n\n if (this.isInside()) {\n addClass($parent, FOLDED)\n addClass($el, FOLDED)\n later(() => {\n addClass($parent, HIDDEN)\n addClass($el, HIDDEN)\n })\n } else {\n addClass($el, HIDDEN)\n }\n this.closed = true\n\n if (isFunction(closed)) {\n closed.call(this)\n }\n\n return this\n }\n\n toggle() {\n const afterToggle = this.attr('afterToggle')\n const top = this.offsetTop\n const scrollTop = this.$scrollElement.scrollTop\n let isStickying\n\n if (this.isClosed()) {\n this.show()\n } else {\n this.hide()\n }\n\n if (isFunction(afterToggle)) {\n later(() => {\n isStickying = scrollTop >= top\n afterToggle.call(this, this.isClosed(), isStickying)\n })\n }\n\n return this\n }\n\n destroy() {\n const beforeDestroy = this.attr('beforeDestroy')\n const afterDestroy = this.attr('afterDestroy')\n\n if (isFunction(beforeDestroy)) {\n beforeDestroy.call(this)\n }\n\n this.removeListeners()\n this.$parentElement.removeChild(this.$el)\n\n this.attr(Chapters.DEFAULTS)\n this.$el = null\n this.$title = null\n this.$main = null\n this.$list = null\n this.$placeholder = null\n this.$parentElement = null\n this.$scrollElement = null\n this.chapters = []\n this.active = 0\n this.offsetTop = 0\n this.$active = null\n this.closed = false\n\n if (this.scrollTimer) {\n clearTimeout(this.scrollTimer)\n this.scrollTimer = null\n }\n\n if (this.resizeTimer) {\n clearTimeout(this.resizeTimer)\n this.resizeTimer = null\n }\n\n if (isFunction(afterDestroy)) {\n afterDestroy.call(this)\n }\n\n if (this.Observer) {\n this.Observer = null\n }\n\n return this\n }\n\n onObserver() {\n const selector = this.attr('selector')\n let timer = null\n\n this.Observer = intersection(\n ($heading) => {\n const id = $heading.getAttribute('data-id')\n\n if (this.playing) {\n return false\n }\n\n if (timer) {\n clearTimeout(timer)\n }\n\n timer = later(() => {\n this.highlight(id)\n }, 100)\n },\n {\n selector,\n context: this\n }\n )\n\n return this\n }\n\n onSelect(evt) {\n const stickyHeight = this.attr('stickyHeight')\n const $anchor = evt.delegateTarget\n const id = $anchor.getAttribute('data-id')\n const headingId = $anchor.href.split('#')[1]\n const $heading = document.querySelector(`#${headingId}`)\n const top = offsetTop($heading) - (stickyHeight + 10)\n const min = 0\n const max = this.$scrollElement.scrollHeight\n const afterScroll = this.attr('afterScroll')\n const after = () => {\n if (isFunction(afterScroll)) {\n afterScroll.call(this, 'chapter')\n }\n\n later(() => {\n this.playing = false\n publish('toolbar:update', {\n top,\n min,\n max\n })\n })\n }\n\n this.playing = true\n if (this.isFixed()) {\n this.sticky()\n later(() => {\n this.scrollTo(top, after)\n this.highlight(id)\n }, 10)\n } else {\n this.scrollTo(top, after)\n this.highlight(id)\n }\n\n stop(evt)\n\n return this\n }\n\n onScroll() {\n const $scrollElement = this.$scrollElement\n\n if (this.scrollTimer) {\n clearTimeout(this.scrollTimer)\n }\n\n this.scrollTimer = later(() => {\n const top = $scrollElement.scrollTop\n const min = 0\n const max = $scrollElement.scrollHeight - $scrollElement.clientHeight\n\n if (this.isFixed()) {\n this.sticky()\n }\n\n publish('toolbar:update', {\n top,\n min,\n max\n })\n }, 100)\n\n return this\n }\n\n onResize() {\n if (this.resizeTimer) {\n clearTimeout(this.resizeTimer)\n }\n\n this.resizeTimer = later(() => {\n this.calculateStickyHeight()\n })\n\n return this\n }\n\n addListeners() {\n const $el = this.$el\n const $scrollElement = this.$scrollElement\n const tagName = $scrollElement.tagName.toLowerCase()\n let $element = $scrollElement\n\n if (tagName === 'html' || tagName === 'body') {\n $element = window\n }\n\n on($el, '.outline-chapters__anchor', 'click', this.onSelect, this, true)\n at($element, 'scroll', this.onScroll, this, true)\n if (this.isSticky()) {\n at($element, 'resize', this.onResize, this, true)\n }\n\n return this\n }\n\n removeListeners() {\n const selector = this.attr('selector')\n const $el = this.$el\n const $scrollElement = this.$scrollElement\n const tagName = $scrollElement.tagName.toLowerCase()\n let $element = $scrollElement\n\n if (tagName === 'html' || tagName === 'body') {\n $element = window\n }\n\n off($el, 'click', this.onSelect)\n off($element, 'scroll', this.onScroll)\n\n if (this.isSticky()) {\n at($element, 'resize', this.onResize)\n }\n\n if (this.Observer) {\n document.querySelectorAll(selector).forEach((section) => {\n this.Observer.unobserve(section)\n })\n }\n\n return this\n }\n}\n\nChapters.DEFAULTS = {\n parentElement: '',\n scrollElement: '',\n selector: '.outline-heading',\n active: 0,\n closed: false,\n showCode: true,\n position: 'relative',\n stickyHeight: 0,\n chapters: [],\n created: null,\n mounted: null,\n afterClosed: null,\n afterOpened: null,\n afterScroll: null,\n beforeDestroy: null,\n afterDestroy: null,\n afterSticky: null\n}\n\nexport default Chapters\n","import createElement from './utils/dom/createElement'\n\nconst _paintChapters = ($list, chapters, showCode = false) => {\n const byId = (id) => document.getElementById(id)\n\n chapters.forEach((chapter) => {\n const pid = chapter.pid\n const id = chapter.id\n const rel = chapter.rel\n const $text = createElement(\n 'span',\n {\n className: 'outline-chapters__text'\n },\n [chapter.text]\n )\n const $link = createElement(\n 'a',\n {\n id: `chapter__anchor-${id}`,\n className: 'outline-chapters__anchor',\n href: '#' + rel,\n rel: rel,\n 'data-id': id\n },\n [$text]\n )\n let $code\n let $li\n let $ul\n let $parent\n\n if (showCode) {\n $code = createElement(\n 'span',\n {\n className: 'outline-chapters__code',\n 'data-id': id\n },\n [chapter.code]\n )\n\n $link.insertBefore($code, $link.firstChild)\n }\n\n $li = createElement(\n 'li',\n {\n id: `chapter-${id}`,\n className: 'outline-chapters__item',\n 'data-id': id\n },\n [$link]\n )\n\n if (pid === -1) {\n $list.appendChild($li)\n } else {\n $parent = byId(`chapter-${pid}`)\n $ul = byId(`subject-${pid}`)\n\n if (!$ul) {\n $ul = createElement(\n 'ul',\n {\n id: 'subject-' + pid,\n className: 'outline-chapters__subject'\n },\n [$li]\n )\n\n $parent.appendChild($ul)\n } else {\n $ul.appendChild($li)\n }\n }\n })\n}\n\nexport default _paintChapters\n","import isFunction from '../types/isFunction'\nimport isElement from '../types/isElement'\n\n/**\n * 通用的 IntersectionObserver 观察者处理器\n * ========================================================================\n * @method intersection\n * @param {Function} fn\n * @param {Object} [props]\n * @param {Object|HTMLElement} [props.root]\n * @param {String} [props.selector]\n * @param {Object} [props.context]\n * @param {String} [props.attr]\n * @param {String} [props.rootMargin]\n */\nconst intersection = (fn, props = {}) => {\n const root = props.root || null\n const selector = props.selector || '.outline-heading'\n const context = props.context || null\n const rootMargin = props.rootMargin || '0px 0px -90% 0px'\n const options = {\n rootMargin: rootMargin\n }\n const Observer = new IntersectionObserver((entries) => {\n entries.forEach((entry) => {\n if (entry.intersectionRatio > 0) {\n if (isFunction(fn)) {\n fn.call(context || entry.target, entry.target)\n }\n }\n })\n }, options)\n const $root = isElement(root) ? root : document\n\n if (root) {\n options.root = root\n }\n\n $root.querySelectorAll(selector).forEach((section) => {\n Observer.observe(section)\n })\n\n return Observer\n}\n\nexport default intersection\n","import { createSvgIcon } from './utils/icons'\nimport createElement from './utils/dom/createElement'\nimport addClass from './utils/dom/addClass'\n\nconst _createButton = (button, rounded = true) => {\n const $icon = createSvgIcon(button.icon, button.size)\n const $anchor = createElement(\n 'a',\n {\n className: `outline-toolbar__anchor`,\n href: button.link\n },\n [$icon]\n )\n const $button = createElement(\n 'div',\n {\n className: `outline-toolbar__button ${button.name}`\n },\n [button.link ? $anchor : $icon]\n )\n\n addClass($icon, 'outline-toolbar__icon')\n\n if (rounded) {\n addClass($button, 'outline-toolbar_rounded')\n }\n\n if (button.disabled) {\n addClass($button, 'outline-toolbar_disabled')\n }\n\n return $button\n}\n\nexport default _createButton\n","import Base from './base'\n\nimport isString from './utils/types/isString'\nimport isFunction from './utils/types/isFunction'\nimport isObject from './utils/types/isObject'\nimport isArray from './utils/types/isArray'\nimport later from './utils/lang/later'\nimport createElement from './utils/dom/createElement'\nimport addClass from './utils/dom/addClass'\nimport hasClass from './utils/dom/hasClass'\nimport removeClass from './utils/dom/removeClass'\nimport on from './utils/event/on'\nimport off from './utils/event/off'\nimport publish from './utils/observer/emit'\nimport { paintSvgSprites } from './utils/icons'\n\nimport _createButton from './_createButton'\n\nconst DISABLED = 'outline-toolbar_disabled'\nconst HIDDEN = 'outline-toolbar_hidden'\n\nclass Toolbar extends Base {\n constructor(options) {\n super()\n\n this.attrs = Toolbar.DEFAULTS\n this.$el = null\n this.disabled = false\n this.closed = false\n this.buttons = []\n\n if (options) {\n this.initialize(options)\n }\n }\n\n initialize(options) {\n let created\n\n this.attr(options)\n created = this.attr('created')\n this.disabled = this.attr('disabled')\n this.closed = this.attr('closed')\n\n if (isFunction(created)) {\n created.call(this)\n }\n\n this.render().addListeners()\n\n return this\n }\n\n isDisabled(name) {\n const buttons = this.attr('buttons')\n let button\n\n if (name) {\n button = buttons.find((option) => option.name === name)\n\n return button?.disabled\n }\n\n return this.disabled\n }\n\n isClosed() {\n return this.closed\n }\n\n highlight(name) {\n const button = this.buttons.find((item) => item.name === name)\n const ACTIVE = 'outline-toolbar_active'\n let $button\n\n if ($button) {\n return this\n }\n\n $button = button.$el\n\n if (hasClass($button, ACTIVE)) {\n removeClass($button, ACTIVE)\n } else {\n addClass($button, ACTIVE)\n }\n\n return this\n }\n\n render() {\n const mounted = this.attr('mounted')\n const buttons = this.attr('buttons') || []\n const rounded = this.attr('rounded')\n const placement = this.attr('placement')\n const $buttons = document.createDocumentFragment()\n const $fragment = document.createDocumentFragment()\n\n paintSvgSprites()\n\n buttons.forEach((button) => {\n const $button = _createButton(button, rounded)\n\n $buttons.appendChild($button)\n this.buttons.push({\n name: button.name,\n $el: $button\n })\n })\n\n this.$el = createElement(\n 'div',\n {\n id: 'outline-toolbar',\n className: `outline-toolbar outline-toolbar_${placement}`\n },\n [$buttons]\n )\n $fragment.appendChild(this.$el)\n document.body.appendChild($fragment)\n\n if (this.closed) {\n this.hide()\n }\n\n if (this.disabled) {\n this.disable()\n }\n\n if (isFunction(mounted)) {\n mounted.call(this)\n }\n\n return this\n }\n\n add(button) {\n const $el = this.$el\n const buttons = this.attr('buttons')\n const action = button.action\n const $fragment = document.createDocumentFragment()\n let type\n\n if (isObject(button)) {\n buttons.push(button)\n $fragment.appendChild(_createButton(button))\n } else if (isArray(button)) {\n button.forEach((item) => {\n $fragment.appendChild(_createButton(item))\n })\n }\n $el.appendChild($fragment)\n\n if (action && isFunction(action.handler)) {\n type = action.type || 'click'\n on($el, `.${button.name}`, type, action.handler)\n }\n\n return this\n }\n\n remove(name) {\n const $el = this.$el\n const buttons = this.attr('buttons')\n const button = buttons.find((option) => option.name === name)\n let index = -1\n let $button\n\n if (!button) {\n return this\n }\n\n buttons.forEach((button, i) => {\n if (button.name === name) {\n index = i\n }\n })\n\n if (index > -1) {\n this.attr().buttons.splice(index, 1)\n }\n\n $button = $el.querySelector(`.${name}`)\n this.switch(name, false)\n $el.removeChild($button)\n\n return this\n }\n\n switch(name, enabled) {\n const $el = this.$el\n const buttons = this.attr('buttons')\n const button = buttons.find((option) => option.name === name)\n let action\n let type\n let listener\n let $button\n\n if (!button) {\n return this\n }\n\n buttons.forEach((option) => {\n if (option.name === name) {\n button.disabled = !enabled\n }\n })\n\n action = button.action\n $button = $el.querySelector(`.${name}`)\n\n if (action) {\n type = action.type || 'click'\n listener = action.handler\n }\n\n if (enabled) {\n removeClass($button, DISABLED)\n\n if (type && listener) {\n on($el, `.${name}`, type, listener)\n }\n } else {\n addClass($button, DISABLED)\n\n if (type && listener) {\n off($el, type, listener)\n }\n }\n\n return this\n }\n\n disable(name) {\n const disabled = this.attr('afterDisabled')\n\n if (name) {\n this.switch(name, false)\n } else {\n addClass(this.$el, DISABLED)\n this.removeListeners()\n this.disabled = true\n\n if (isFunction(disabled)) {\n disabled.call(this)\n }\n }\n\n return this\n }\n\n enable(name) {\n const enabled = this.attr('afterEnabled')\n\n if (name) {\n this.switch(name, true)\n } else {\n this.disabled = false\n removeClass(this.$el, DISABLED)\n this.addListeners()\n\n if (isFunction(enabled)) {\n enabled.call(this)\n }\n }\n\n return this\n }\n\n show(name) {\n const opened = this.attr('afterOpened')\n const button = this.attr('buttons').find((option) => option.name === name)\n const $el = this.$el\n let $button\n\n if (name) {\n if (!button) {\n return this\n }\n\n $button = $el.querySelector(`.${name}`)\n removeClass($button, HIDDEN)\n } else {\n removeClass($el, HIDDEN)\n this.closed = false\n\n if (isFunction(opened)) {\n later(() => {\n opened.call(this)\n }, 310)\n }\n }\n\n return this\n }\n\n hide(name) {\n const closed = this.attr('afterClosed')\n const button = this.attr('buttons').find((option) => option.name === name)\n const $el = this.$el\n let $button\n\n if (name) {\n if (!button) {\n return this\n }\n $button = $el.querySelector(`.${name}`)\n addClass($button, HIDDEN)\n } else {\n addClass($el, HIDDEN)\n this.closed = true\n\n if (isFunction(closed)) {\n later(() => {\n closed.call(this)\n }, 310)\n }\n }\n\n return this\n }\n\n toggle() {\n if (this.isClosed()) {\n this.show()\n } else {\n this.hide()\n }\n\n return this\n }\n\n destroy() {\n const beforeDestroy = this.attr('beforeDestroy')\n const afterDestroy = this.attr('afterDestroy')\n let $el = this.$el\n\n if (isFunction(beforeDestroy)) {\n beforeDestroy.call(this)\n }\n\n this.removeListeners()\n document.body.removeChild($el)\n $el = null\n\n this.attr(Toolbar.DEFAULTS)\n this.disabled = false\n this.closed = false\n this.buttons = []\n\n if (isFunction(afterDestroy)) {\n afterDestroy.call(this)\n }\n\n return this\n }\n\n refresh() {\n const $el = this.$el\n const buttons = this.attr('buttons') || []\n\n this.removeListeners()\n $el.innerHTML = ''\n\n buttons.forEach((button) => {\n this.$el.appendChild(_createButton(button))\n })\n\n this.addListeners()\n\n return this\n }\n\n addListeners() {\n const buttons = this.attr('buttons')\n const $el = this.$el\n\n if (!buttons || buttons.length < 1) {\n return this\n }\n\n buttons.forEach((button) => {\n const action = button.action\n const disabled = this.disabled\n let type\n let listener\n let context\n let command\n\n if (disabled) {\n return false\n }\n\n if (action) {\n listener = action.handler\n if (isString(listener)) {\n command = listener\n action.handler = function () {\n publish(command, button.name)\n }\n listener = action.handler\n }\n\n type = action.type || 'click'\n context = action.context\n }\n\n if (isFunction(listener)) {\n on($el, `.${button.name}`, type, listener, context || this, true)\n }\n })\n\n return this\n }\n\n removeListeners() {\n const buttons = this.attr('buttons')\n const $el = this.$el\n\n if (!buttons || buttons.length < 1) {\n return this\n }\n\n buttons.forEach((button) => {\n const action = button.action\n const disabled = this.disabled\n let type\n let listener\n\n if (disabled) {\n return false\n }\n\n if (action) {\n listener = action.handler\n type = action.type || 'click'\n }\n\n if (isFunction(listener)) {\n off($el, type, listener)\n }\n })\n\n return this\n }\n}\n\nToolbar.DEFAULTS = {\n placement: 'ltr',\n closed: false,\n disabled: false,\n rounded: true,\n buttons: [],\n created: null,\n mounted: null,\n afterClosed: null,\n afterOpened: null,\n afterDisabled: null,\n afterEnabled: null,\n beforeDestroy: null,\n afterDestroy: null\n}\n\nexport default Toolbar\n","/**\n * 生成唯一 id 字符串的函数\n * ========================================================================\n * @method guid\n * @param {String} [prefix] - 生成 id 的前缀字符串\n * @return {String} 返回一个表示唯一 id 的字符串\n */\nconst guid = (() => {\n let uuid = 0\n\n return (prefix) => {\n uuid += 1\n\n return prefix ? prefix + '-' + uuid : 'guid-' + uuid\n }\n})()\n\nexport default guid\n","import _subscribers from './_subscribers'\nimport isFunction from '../types/isFunction'\nimport guid from '../lang/guid'\n\n/**\n * 订阅主题,并给出处理器函数\n * ========================================================================\n * @method on\n * @param {String} topic - (必须)主题名称\n * @param {Function} handler - (必须)主题的处理器函数\n * @param {Object} [context] - (可选)指定 this 执行上下文\n * @return {String} - 唯一的 token 字符串,例如:'guid-1'。\n */\nconst on = (topic, handler, context = null) => {\n const token = guid()\n let subject = typeof topic === 'symbol' ? topic.toString() : topic\n\n if (!isFunction(handler)) {\n return ''\n }\n\n /* istanbul ignore else */\n if (!_subscribers[subject]) {\n _subscribers[subject] = []\n }\n\n _subscribers[subject].push({\n topic: subject,\n callback: handler,\n context,\n token\n })\n\n return token\n}\n\nexport default on\n","import _subscribers from './_subscribers'\nimport hasOwn from '../lang/hasOwn'\n\n/**\n * 删除与给定 topic 相同的订阅者信息\n * ========================================================================\n * @method _removeSubscriber\n * @param {String} topic - (必须)订阅主题字符串\n * @returns {Boolean}\n */\nconst _removeSubscriber = (topic) => {\n if (!hasOwn(_subscribers, topic)) {\n return false\n }\n\n delete _subscribers[topic]\n}\n\nexport default _removeSubscriber\n","import has from './has'\nimport _removeSubscriber from './_removeSubscriber'\nimport _removeSubscriberByToken from './_removeSubscriberByToken'\n\n/**\n * 取消订阅主题\n * ========================================================================\n * @method off\n * @param {String} topic - (必须)订阅的主题\n * @param {Function|String} [token] - (可选)订阅主题的处理器函数或者唯一 Id 值\n */\nconst off = (topic, token) => {\n if (!has(topic)) {\n return false\n }\n\n if (token) {\n _removeSubscriberByToken(token)\n } else {\n _removeSubscriber(topic)\n }\n}\n\nexport default off\n","import _subscribers from './_subscribers'\nimport _removeSubscriber from './_removeSubscriber'\n\n/**\n * 通过订阅者 token 值删除订阅者信息\n * ========================================================================\n * @method _removeSubscriberByToken\n * @param {String} token - 订阅者 token 字符串\n * @returns {boolean}\n * @private\n */\nconst _removeSubscriberByToken = (token) => {\n const keys = Object.keys(_subscribers)\n let index = -1\n\n if (!token || keys.length < 1) {\n return false\n }\n\n keys.forEach((subject) => {\n const subscriber = _subscribers[subject]\n let topic\n\n subscriber.forEach((execution, j) => {\n if (execution.callback === token || execution.token === token) {\n topic = execution.topic\n subscriber.splice(index, j)\n }\n })\n\n /* istanbul ignore else */\n if (subscriber.length < 1) {\n _removeSubscriber(topic)\n }\n })\n}\n\nexport default _removeSubscriberByToken\n","import Base from './base'\nimport Anchors from './anchors'\nimport Drawer from './drawer'\nimport Chapters from './chapters'\nimport Toolbar from './toolbar'\n\nimport later from './utils/lang/later'\nimport isFunction from './utils/types/isFunction'\nimport scrollTo from './utils/dom/scrollTo'\nimport _getScrollElement from './utils/dom/_getScrollElement'\nimport subscribe from './utils/observer/on'\nimport unsubscribe from './utils/observer/off'\n\nclass Outline extends Base {\n constructor(options) {\n super()\n\n this.attrs = Outline.DEFAULTS\n this.anchors = null\n this.drawer = null\n this.chapters = null\n this.toolbar = null\n\n if (options) {\n this.initialize(options)\n }\n }\n\n initialize(options) {\n this.attr(options).render().addListeners()\n return this\n }\n\n getChapters(isTreeStructured = false) {\n return this.anchors.getChapters(isTreeStructured)\n }\n\n count() {\n return this.anchors.count()\n }\n\n render() {\n this._renderAnchors()._renderChapters()._renderToolbar()\n\n return this\n }\n\n _renderAnchors() {\n const articleElement = this.attr('articleElement')\n const selector = this.attr('selector')\n const stickyHeight = this.attr('stickyHeight')\n const scrollElement = this.attr('scrollElement')\n const showCode = this.attr('showCode')\n const anchorURL = this.attr('anchorURL')\n const afterScroll = this.attr('afterScroll')\n\n this.anchors = new Anchors({\n articleElement,\n stickyHeight,\n scrollElement,\n selector,\n showCode,\n anchorURL,\n afterScroll\n })\n\n return this\n }\n\n _renderChapters() {\n const title = this.attr('title')\n const stickyHeight = this.attr('stickyHeight')\n const scrollElement = this.attr('scrollElement')\n const customClass = this.attr('customClass')\n const showCode = this.attr('showCode')\n const position = this.attr('position')\n const placement = this.attr('placement')\n const afterSticky = this.attr('afterSticky')\n const afterToggle = this.attr('afterToggle')\n const afterScroll = this.attr('afterScroll')\n const count = this.count()\n let parentElement = this.attr('parentElement')\n let CHAPTERS_OPTIONS\n\n if (count < 1) {\n return this\n }\n\n CHAPTERS_OPTIONS = {\n scrollElement,\n showCode,\n position,\n title,\n stickyHeight,\n chapters: this.anchors.getChapters(),\n afterSticky,\n afterToggle,\n afterScroll\n }\n\n if (position === 'relative') {\n this.drawer = new Drawer({\n placement,\n title,\n size: 'tiny',\n hasOffset: true,\n hasPadding: false,\n customClass,\n afterClosed: () => {\n const toolbar = this.toolbar\n toolbar.toggle()\n }\n })\n parentElement = this.drawer.$main\n } else {\n CHAPTERS_OPTIONS.customClass = customClass\n }\n\n CHAPTERS_OPTIONS.parentElement = parentElement\n this.chapters = new Chapters(CHAPTERS_OPTIONS)\n\n return this\n }\n\n _renderToolbar() {\n const placement = this.attr('placement')\n const homepage = this.attr('homepage')\n const git = this.attr('git')\n const tags = this.attr('tags')\n const issues = this.attr('issues')\n const count = this.count()\n const UP = {\n name: 'up',\n icon: 'up',\n size: 20,\n action: {\n type: 'click',\n handler: 'toolbar:action:up'\n }\n }\n const HOME = {\n name: 'homepage',\n icon: 'homepage',\n size: 20,\n link: homepage\n }\n const GIT = {\n name: 'github',\n icon: 'github',\n size: 20,\n link: git\n }\n const TAGS = {\n name: 'tags',\n icon: 'tags',\n size: 20,\n link: tags\n }\n const ISSUES = {\n name: 'issues',\n icon: 'issues',\n size: 20,\n link: issues\n }\n const MENU = {\n name: 'menu',\n icon: 'menu',\n size: 18,\n action: {\n type: 'click',\n handler: 'toolbar:action:toggle'\n }\n }\n const DOWN = {\n name: 'down',\n icon: 'down',\n size: 20,\n action: {\n type: 'click',\n handler: 'toolbar:action:down'\n }\n }\n const buttons = []\n\n buttons.push(UP)\n if (homepage) {\n buttons.push(HOME)\n }\n if (git) {\n buttons.push(GIT)\n }\n if (tags) {\n buttons.push(TAGS)\n }\n if (issues) {\n buttons.push(ISSUES)\n }\n if (count > 0) {\n buttons.push(MENU)\n }\n buttons.push(DOWN)\n\n this.toolbar = new Toolbar({\n placement,\n buttons: buttons\n })\n\n return this\n }\n\n toTop() {\n const afterScroll = this.attr('afterScroll')\n const toolbar = this.toolbar\n const chapters = this.chapters\n const count = this.count()\n const afterTop = () => {\n toolbar.hide('up')\n toolbar.show('down')\n\n if (count > 0) {\n chapters.highlight(0)\n }\n chapters.playing = false\n\n if (isFunction(afterScroll)) {\n afterScroll.call(toolbar, 'up')\n }\n }\n\n chapters.playing = true\n this.scrollTo(0, afterTop)\n\n return this\n }\n\n toBottom() {\n const afterScroll = this.attr('afterScroll')\n const $scrollElement = _getScrollElement(this.attr('scrollElement'))\n const toolbar = this.toolbar\n const chapters = this.chapters\n const count = this.count()\n const top = Math.floor(\n $scrollElement.scrollHeight - $scrollElement.clientHeight\n )\n const afterDown = () => {\n toolbar.hide('down')\n toolbar.show('up')\n\n if (count > 1) {\n chapters.highlight(count - 1)\n }\n chapters.playing = false\n\n if (isFunction(afterScroll)) {\n afterScroll.call(toolbar, 'bottom')\n }\n }\n\n chapters.playing = true\n this.scrollTo(top, afterDown)\n\n return this\n }\n\n scrollTo(top, afterScroll) {\n const scrollElement = this.attr('scrollElement')\n scrollTo(scrollElement, top, afterScroll)\n return this\n }\n\n toggle() {\n const position = this.attr('position')\n const toolbar = this.toolbar\n const drawer = this.drawer\n const chapters = this.chapters\n const count = this.count()\n\n if (position !== 'relative') {\n chapters.toggle()\n toolbar.highlight('menu')\n } else {\n toolbar.toggle()\n\n if (count < 1) {\n return this\n }\n\n later(() => {\n if (chapters.isInside()) {\n chapters.toggle()\n } else {\n drawer.toggle()\n }\n })\n }\n\n return this\n }\n\n destroy() {\n let anchors = this.anchors\n let chapters = this.chapters\n let drawer = this.drawer\n let toolbar = this.toolbar\n const isOutside = chapters.isOutside()\n const count = this.count()\n\n this.removeListeners()\n\n if (count > 0) {\n chapters.destroy()\n chapters = null\n\n if (isOutside) {\n drawer.destroy()\n drawer = null\n }\n }\n\n toolbar.destroy()\n toolbar = null\n\n anchors.destroy()\n anchors = null\n\n this.attr(Outline.DEFAULTS)\n\n return this\n }\n\n onToggle() {\n this.toggle()\n return this\n }\n\n onScrollTop() {\n this.toTop()\n return this\n }\n\n onScrollBottom() {\n this.toBottom()\n return this\n }\n\n onToolbarUpdate({ top, min, max }) {\n const toolbar = this.toolbar\n const current = Math.ceil(top)\n\n if (current <= min) {\n toolbar.hide('up')\n toolbar.show('down')\n } else if (current >= max) {\n toolbar.hide('down')\n toolbar.show('up')\n } else if (current > min && current < max) {\n toolbar.show('up')\n toolbar.show('down')\n }\n\n return this\n }\n\n addListeners() {\n subscribe('toolbar:update', this.onToolbarUpdate, this)\n subscribe('toolbar:action:up', this.onScrollTop, this)\n subscribe('toolbar:action:toggle', this.onToggle, this)\n subscribe('toolbar:action:down', this.onScrollBottom, this)\n return this\n }\n\n removeListeners() {\n unsubscribe('toolbar:update')\n unsubscribe('toolbar:action:up')\n unsubscribe('toolbar:action:toggle')\n unsubscribe('toolbar:action:down')\n return this\n }\n}\n\nOutline.DEFAULTS = {\n articleElement: '#article',\n selector: 'h2,h3,h4,h5,h6',\n title: '目录',\n scrollElement: 'html,body',\n position: 'relative',\n parentElement: '#aside',\n placement: 'rtl',\n showCode: true,\n anchorURL: '',\n stickyHeight: 0,\n homepage: '',\n git: '',\n tags: '',\n issues: '',\n customClass: '',\n afterSticky: null,\n afterToggle: null,\n afterScroll: null\n}\n\nif (window.jQuery) {\n // 将 Outline 扩展为一个 jquery 插件\n // eslint-disable-next-line no-undef\n jQuery.extend(jQuery.fn, {\n outline: function (options) {\n // eslint-disable-next-line no-undef\n let $article = jQuery(this)\n\n return new Outline(\n // eslint-disable-next-line no-undef\n jQuery.extend({}, options, {\n articleElement: $article\n })\n )\n }\n })\n}\n\nexport default Outline\n"],"names":["isString","str","hasOwn","obj","prop","hasOwnProperty","Object","prototype","call","toString","val","apply","isFunction","isObject","o","Base","constructor","options","this","attrs","initialize","attr","render","addListeners","value","origin","source","keys","forEach","arguments","length","destroy","removeListeners","reload","isElement","nodeName","tagName","nodeType","later","fn","delay","setTimeout","easeInQuad","x","_getScrollElement","scrollElement","$rootElements","$scrollElement","document","querySelector","querySelectorAll","scrollTop","scrollTo","top","afterStop","step","distance","MAX_HEIGHT","scrollHeight","MAX_TOP","stop","play","requestAnimationFrame","offsetTop","el","offsetParent","matches","selector","sel","replace","msMatchesSelector","getParentOrHost","host","parentNode","CAPTURE_EVENTS","_off","type","capture","indexOf","_delegateListener","listeners","_listeners","index","listener","i","handler","splice","_delete","removeEventListener","purgeElement","recurse","$element","$children","childNodes","filter","getListeners","$child","off","on","data","context","once","evt","target","getTarget","delegateTarget","ctx","includeCTX","startsWith","closest","overrideContext","push","addEventListener","stopPropagation","preventDefault","_subscribers","_hasDirectSubscribersFor","topic","has","isDirect","found","position","lastIndexOf","substring","_hasSubscribers","emit","async","execute","subscriber","message","callback","deliver","isArray","Array","paintSvgSprites","symbols","SYMBOLS","sprites","concat","$body","body","$icons","innerHTML","join","createElement","insertBefore","firstChild","createSvgIcon","name","size","color","iconSet","binds","width","height","defaultRules","svg","$icon","className","trim","isDOM","isHTMLCollection","fragment","isTextNode","setAttribute","toLowerCase","style","cssText","children","$fragment","createDocumentFragment","$el","isValidChild","child","append","createTextNode","appendChild","every","hasClass","pattern","RegExp","allClass","classList","contains","exec","removeClass","remove","_resetHeading","$heading","hasAnchor","isAtStart","CLS_HEADING","text","$anchor","removeAttribute","removeChild","getChapters","headings","showCode","previous","level","chapters","heading","headingLevel","current","parseInt","pid","differ","_getChapterParentIdByDiffer","id","rel","groups","group","JSON","stringify","cb","code","String","c","_getChaptersWithCode","Anchors","super","DEFAULTS","$articleElement","$headings","created","articleElement","isTreeStructured","list","nodeKey","parentKey","map","roots","item","node","toTree","count","mounted","anchorURL","chapterCode","headingId","href","_updateHeading","after","beforeDestroy","afterDestroy","onAnchorTrigger","afterScroll","stickyHeight","max","clientHeight","publish","min","addClass","add","setProperty","documentElement","zIndex","idx","Drawer","title","closed","$modal","$header","$title","$close","$main","$footer","$overlay","setTitle","isClosed","placement","hasClose","hasOverlay","hasOffset","hasPadding","autoHeight","customClass","open","opened","close","toggle","afterToggle","onClose","afterClosed","afterOpened","at","getStyle","ruleName","getComputedStyle","Chapters","$list","$placeholder","$parentElement","active","offsetWidth","$active","scrollTimer","resizeTimer","playing","Observer","parentElement","$parent","isSticky","isFixed","isInside","isOutside","_paintEdge","contents","calculateStickyHeight","byId","getElementById","chapter","$text","$link","$code","$li","$ul","_paintChapters","positionPlaceholder","sticky","onObserver","mainPaddingTop","mainBorderTop","placeholderPaddingTop","placeholderMarginTop","placeholderBorderTop","offsetHeight","highlight","HIGHLIGHT","getAttribute","afterSticky","FIXED","isStickying","Math","window","innerHeight","show","FOLDED","HIDDEN","hide","clearTimeout","timer","props","root","rootMargin","IntersectionObserver","entries","entry","intersectionRatio","$root","section","observe","intersection","onSelect","split","onScroll","onResize","unobserve","_createButton","button","rounded","icon","link","$button","disabled","DISABLED","Toolbar","buttons","isDisabled","find","option","ACTIVE","$buttons","disable","action","switch","enabled","enable","refresh","command","afterDisabled","afterEnabled","guid","uuid","prefix","token","subject","_removeSubscriber","execution","j","_removeSubscriberByToken","Outline","anchors","drawer","toolbar","_renderAnchors","_renderChapters","_renderToolbar","CHAPTERS_OPTIONS","homepage","git","tags","issues","HOME","GIT","TAGS","ISSUES","MENU","toTop","toBottom","floor","onToggle","onScrollTop","onScrollBottom","onToolbarUpdate","ceil","subscribe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K,GACLC,KAAM,GACNC,OAAQ,GACR9H,YAAa,GACbsD,YAAa,KACbjD,YAAa,KACbnC,YAAa,MAGXwF,OAAOoF,QAGTA,OAAOC,OAAOD,OAAO5X,GAAI,CACvB8X,QAAS,SAAUpZ,GAEjB,IAAIqZ,EAAWH,OAAOjZ,MAEtB,OAAO,IAAIsX,EAET2B,OAAOC,OAAO,CAAE,EAAEnZ,EAAS,CACzBiN,eAAgBoM,IAGrB"}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/river666/outline.js.git
[email protected]:river666/outline.js.git
river666
outline.js
outline.js
master

搜索帮助