1 Star 0 Fork 34

liming0101/outline.js

forked from Yaohaixiao/outline.js 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
outline.min.js.map 235.19 KB
一键复制 编辑 原始数据 按行查看 历史
{"version":3,"file":"outline.min.js","sources":["utils/lang/toString.js","utils/types/isFunction.js","utils/lang/later.js","utils/types/isObject.js","utils/types/isArray.js","utils/lang/cloneDeep.js","utils/types/isString.js","utils/types/isElement.js","utils/dom/hasClass.js","utils/dom/addClass.js","utils/lang/easeInQuad.js","utils/dom/_getScrollElement.js","utils/dom/scrollTo.js","utils/lang/trim.js","getChaptersByHeadings.js","utils/lang/stripTags.js","_getChapterParentIdByDiffer.js","_getChaptersWithCode.js","getChapters.js","utils/lang/toTree.js","utils/lang/hasOwn.js","utils/lang/extend.js","utils/observer/_subscribers.js","utils/observer/_hasDirectSubscribersFor.js","utils/observer/has.js","utils/observer/_hasSubscribers.js","utils/observer/emit.js","utils/types/isTypedArray.js","utils/lang/guid.js","utils/observer/_removeSubscriber.js","utils/observer/off.js","utils/observer/_removeSubscriberByToken.js","base.js","utils/observer/on.js","utils/lang/timeSlice.js","utils/dom/offsetTop.js","utils/dom/matches.js","utils/dom/getParentOrHost.js","utils/event/enum.js","utils/event/_off.js","utils/event/_delete.js","utils/event/purgeElement.js","utils/event/getListeners.js","utils/event/off.js","utils/event/on.js","utils/event/getTarget.js","utils/dom/resolveTextNode.js","utils/dom/closest.js","utils/event/stop.js","utils/icons/symbols.js","utils/icons/defaults.js","utils/icons/getSymbols.js","utils/icons/getSymbol.js","utils/icons/paint.js","utils/icons/add.js","utils/types/isDOM.js","utils/types/isHTMLCollection.js","utils/types/isFragment.js","utils/types/isTextNode.js","utils/dom/setAttribute.js","utils/dom/setAttributes.js","utils/dom/createElement.js","utils/icons/createElement.js","utils/types/isSVG.js","utils/icons/icon.js","utils/dom/removeClass.js","_removeHeading.js","utils/types/isEmpty.js","anchors.js","_updateHeading.js","utils/types/tags.js","utils/types/isHTML.js","utils/lang/stripScripts.js","utils/dom/setProperty.js","zIndex.js","drawer.js","utils/dom/html.js","utils/event/at.js","utils/dom/getStyle.js","navigator.js","_paintChapters.js","utils/dom/inBounding.js","utils/dom/intersection.js","utils/types/isObjectLike.js","utils/types/isPlainObject.js","utils/lang/encodeHTML.js","message.js","command.js","commands.js","_createButton.js","toolbar.js","speech.js","_updateSiblingElements.js","reader.js","outline.js"],"sourcesContent":["/**\r\n * Object 对象原型上的 toString 方法\r\n * ========================================================================\r\n * @method toString\r\n * @param {*} val\r\n * @returns {string}\r\n */\r\nconst toString = (val) => {\r\n return Object.prototype.toString.apply(val)\r\n}\r\n\r\nexport default toString\r\n","import toString from '../lang/toString'\r\n\r\n/**\r\n * 检测测试数据是否为 Function 类型\r\n * ========================================================================\r\n * @method isFunction\r\n * @param {*} val - (必须)待检测的数据\r\n * @returns {boolean} 'val' 是 Function 类型返回 true,否则返回 false\r\n */\r\nconst isFunction = (val) => {\r\n return typeof val === 'function' || toString(val) === '[object Function]'\r\n}\r\n\r\nexport default isFunction\r\n","import isFunction from '../types/isFunction'\r\n\r\n/**\r\n * later - 延迟执行方法\r\n * ========================================================================\r\n * @method later\r\n * @param {Function} fn\r\n * @param {Number} [delay]\r\n * @returns {number|boolean}\r\n */\r\nconst later = (fn, delay = 300) => {\r\n if (!isFunction(fn)) {\r\n return false\r\n }\r\n\r\n return setTimeout(() => {\r\n fn()\r\n }, delay)\r\n}\r\n\r\nexport default later\r\n","import toString from '../lang/toString'\r\nimport isFunction from './isFunction'\r\n\r\n/**\r\n * 检测数据是否为 Object 类型\r\n * ========================================================================\r\n * @method isObject\r\n * @param {*} o\r\n * @returns {boolean}\r\n */\r\nconst isObject = (o) => {\r\n return (\r\n (toString(o) === '[object Object]' ||\r\n typeof o === 'object' ||\r\n isFunction(o)) &&\r\n o !== null\r\n )\r\n}\r\n\r\nexport default isObject\r\n","import toString from '../lang/toString'\r\n\r\n/**\r\n * 检测数据是否为 Array 类型\r\n * ========================================================================\r\n * @method isArray\r\n * @param {*} o\r\n * @returns {boolean}\r\n */\r\nconst isArray = (o) => {\r\n if (Array.isArray) {\r\n return Array.isArray(o)\r\n } else {\r\n return toString(o) === '[object Array]'\r\n }\r\n}\r\n\r\nexport default isArray\r\n","import isObject from '../types/isObject'\r\nimport isArray from '../types/isArray'\r\n\r\n/**\r\n * 深拷贝对象函数\r\n * ========================================================================\r\n * @methods cloneDeep\r\n * @param {Object} obj - 深拷贝的对象\r\n * @returns {Array|Object|*}\r\n *\r\n * @example\r\n * const arr = cloneDeep([2,3,4,6])\r\n * => [2,3,4,6]\r\n */\r\nconst cloneDeep = (obj) => {\r\n let clone = {}\r\n\r\n if (obj === null) {\r\n return null\r\n }\r\n\r\n if (isArray(obj)) {\r\n clone = Array.from(obj)\r\n } else {\r\n clone = Object.assign({}, obj)\r\n Object.keys(clone).forEach((key) => {\r\n return (clone[key] = isObject(obj[key]) ? cloneDeep(obj[key]) : obj[key])\r\n })\r\n }\r\n\r\n return clone\r\n}\r\n\r\nexport default cloneDeep\r\n","/**\r\n * 检测数据是否为 String 类型\r\n * ========================================================================\r\n * @method isArray\r\n * @param {*} str\r\n * @returns {boolean}\r\n */\r\nconst isString = (str) => {\r\n return typeof str === 'string'\r\n}\r\n\r\nexport default isString\r\n","import isObject from './isObject'\r\n\r\n/**\r\n * 检测数据是否为 HTMLElement DOM 节点\r\n * ========================================================================\r\n * @method isElement\r\n * @param {*} o\r\n * @returns {boolean}\r\n */\r\nconst isElement = (o) => {\r\n return !!(isObject(o) && o.nodeName && o.tagName && o.nodeType === 1)\r\n}\r\n\r\nexport default isElement\r\n","import isElement from '../types/isElement'\r\n/**\r\n * 检测 DOM 节点是否包含名为 className 的样式\r\n * ========================================================================\r\n * @method hasClass\r\n * @param {HTMLElement} el - DOM 节点\r\n * @param {String} className - 样式名称\r\n * @returns {Boolean}\r\n */\r\nconst hasClass = (el, className) => {\r\n const pattern = new RegExp('(\\\\s|^)' + className + '(\\\\s|$)')\r\n let allClass\r\n let classList\r\n\r\n if (!isElement(el)) {\r\n return false\r\n }\r\n\r\n allClass = el.className\r\n\r\n if (!allClass) {\r\n return false\r\n }\r\n\r\n classList = el.classList\r\n\r\n if (classList && classList.contains) {\r\n return el.classList.contains(className)\r\n }\r\n\r\n return !!pattern.exec(allClass)\r\n}\r\n\r\nexport default hasClass\r\n","import hasClass from './hasClass'\r\n\r\n/**\r\n * 给 DOM 节点添加名为 className 的样式\r\n * ========================================================================\r\n * @method addClass\r\n * @param {HTMLElement} el - DOM 节点\r\n * @param {String} className - 样式名称\r\n * @returns {Boolean}\r\n */\r\nconst addClass = (el, className) => {\r\n let classList\r\n let allClass\r\n\r\n if (hasClass(el, className)) {\r\n return false\r\n }\r\n\r\n classList = el.classList\r\n\r\n if (classList?.add) {\r\n classList.add(className)\r\n } else {\r\n allClass = el.className\r\n allClass += allClass.length > 0 ? ' ' + className : className\r\n el.className = allClass\r\n }\r\n}\r\n\r\nexport default addClass\r\n","/**\r\n * 返回给定值的平方值\r\n * ========================================================================\r\n * @method easeInQuad\r\n * @param {Number} x\r\n * @returns {number}\r\n */\r\nconst easeInQuad = (x) => {\r\n return x * x\r\n}\r\n\r\nexport default easeInQuad\r\n","import isString from '../types/isString'\r\nimport isElement from '../types/isElement'\r\n\r\n/**\r\n * 通过给的 scrollElement 参数,获取滚动 DOM 元素\r\n * ========================================================================\r\n * @method _getScrollElement\r\n * @param {String|HTMLElement} scrollElement\r\n * @returns {Element}\r\n * @private\r\n */\r\nconst _getScrollElement = (scrollElement = null) => {\r\n let $rootElements\r\n let $scrollElement\r\n\r\n if (!scrollElement) {\r\n $rootElements = document.querySelectorAll('html,body')\r\n $scrollElement =\r\n $rootElements[0].scrollTop - $rootElements[1].scrollTop >= 0\r\n ? $rootElements[0]\r\n : $rootElements[1]\r\n } else {\r\n if (isString(scrollElement)) {\r\n $scrollElement = document.querySelector(scrollElement)\r\n } else if (isElement(scrollElement)) {\r\n $scrollElement = scrollElement\r\n }\r\n }\r\n\r\n return $scrollElement\r\n}\r\n\r\nexport default _getScrollElement\r\n","import easeInQuad from '../lang/easeInQuad'\r\nimport isFunction from '../types/isFunction'\r\nimport _getScrollElement from './_getScrollElement'\r\n\r\n/**\r\n * 指定 rootElement DOM 节点滚动到指定 top 位置\r\n * ========================================================================\r\n * @method scrollTo\r\n * @param {HTMLElement|Object} [scrollElement] - (必须)要滚动的 DOM 节点\r\n * @param {Number} top - (必须)滚动的 scrollTop 数值\r\n * @param {Function} [afterStop] - (可选)滚动完成的回调函数\r\n */\r\nconst scrollTo = (scrollElement, top, afterStop) => {\r\n const $scrollElement = _getScrollElement(scrollElement)\r\n let scrollTop = $scrollElement.scrollTop\r\n let step = 0\r\n const distance = top - scrollTop\r\n const MAX_HEIGHT = $scrollElement.scrollHeight\r\n const MAX_TOP = top - MAX_HEIGHT <= 0 ? top : MAX_HEIGHT\r\n const stop = (top) => {\r\n if (isFunction(afterStop)) {\r\n afterStop(top)\r\n }\r\n\r\n return false\r\n }\r\n const play = () => {\r\n step += 1\r\n\r\n // 向上滚动\r\n if (distance < 0) {\r\n scrollTop -= easeInQuad(step)\r\n $scrollElement.scrollTop = scrollTop\r\n\r\n if (scrollTop <= top) {\r\n $scrollElement.scrollTop = top\r\n return stop(top)\r\n }\r\n } else {\r\n scrollTop += easeInQuad(step)\r\n $scrollElement.scrollTop = scrollTop\r\n\r\n if (scrollTop >= MAX_TOP) {\r\n $scrollElement.scrollTop = MAX_TOP\r\n return stop(MAX_TOP)\r\n }\r\n }\r\n\r\n // eslint-disable-next-line compat/compat\r\n requestAnimationFrame(play)\r\n }\r\n\r\n // eslint-disable-next-line compat/compat\r\n requestAnimationFrame(play)\r\n}\r\n\r\nexport default scrollTo\r\n","import isString from '../types/isString'\r\n\r\n/**\r\n * 清楚字符串起始位置所有的空格\r\n * ========================================================================\r\n * @method trim\r\n * @param {string} str\r\n * @returns {string|Boolean}\r\n */\r\nconst trim = (str) => {\r\n if (!isString(str)) {\r\n return false\r\n }\r\n return str.replace(/(^\\s+)|(\\s+$)/g, '')\r\n}\r\n\r\nexport default trim\r\n","import trim from './utils/lang/trim'\r\nimport stripTags from './utils/lang/stripTags'\r\nimport isFunction from './utils/types/isFunction'\r\n\r\nimport _getChapterParentIdByDiffer from './_getChapterParentIdByDiffer'\r\nimport _getChaptersWithCode from './_getChaptersWithCode'\r\n\r\n/**\r\n * 根据文章中的 h1~h6 标签,自动分析返回文章章节数据\r\n * ========================================================================\r\n * @method getChaptersByHeadings\r\n * @param {Array} headings\r\n * @param {Boolean} [showCode]\r\n * @param {Function} [chapterTextFilter]\r\n * @return {*|*[]}\r\n */\r\nconst getChaptersByHeadings = (\r\n headings,\r\n showCode = true,\r\n chapterTextFilter = null\r\n) => {\r\n let previous = 1\r\n let level = 0\r\n let text = ''\r\n const chapters = []\r\n\r\n headings.forEach((heading, i) => {\r\n const tagName = heading.tagName\r\n const headingLevel = tagName.replace(/h/i, '')\r\n let current = parseInt(headingLevel, 10)\r\n let pid = -1\r\n\r\n // 场景1:当前标题是前一个标题的子标题\r\n // 当前标题的(标题标签)序号 > 前一个标题的序号:两个相连的标题是父标题 -> 子标题关系;\r\n // h2 (前一个标题)\r\n // h3 (当前标题)\r\n if (current > previous) {\r\n level += 1\r\n\r\n // 第一层级的 pid 是 -1\r\n if (level === 1) {\r\n pid = -1\r\n } else {\r\n pid = i - 1\r\n }\r\n }\r\n // 场景2:当前标题和前一个标题层级相同\r\n // 当前标题的(标题标签)序号 = 前一个标题的序号\r\n // h2 (前一个标题)\r\n // h2 (当前标题)\r\n // 当前标题的(标题标签)序号 < 前一个标题的序号并且当前标题序号 > 当前的级别\r\n // h2\r\n // h4 (前一个标题)\r\n // h3 (当前标题:这种情况我们还是任务 h3 是 h2 的下一级章节)\r\n else if (current === previous || (current < previous && current > level)) {\r\n // H1 的层级肯定是 1\r\n if (current === 1) {\r\n level = 1\r\n pid = -1\r\n } else {\r\n pid = chapters[i - 1].pid\r\n }\r\n }\r\n // 场景3:当前标题比前一个标题层级高\r\n else if (current <= level) {\r\n // H1 的层级肯定是 1\r\n if (current === 1) {\r\n level = 1\r\n } else {\r\n level = level - (previous - current)\r\n\r\n if (level <= 1) {\r\n level = 1\r\n }\r\n }\r\n\r\n // 第一级的标题\r\n if (level === 1) {\r\n pid = -1\r\n } else {\r\n // 通过当前标题和前一个标题之间的等级差获得当前标题的父标题ID\r\n pid = _getChapterParentIdByDiffer(chapters, previous - current, i)\r\n }\r\n }\r\n\r\n previous = current\r\n\r\n text = stripTags(trim(heading.innerHTML))\r\n\r\n if (isFunction(chapterTextFilter)) {\r\n text = chapterTextFilter(text)\r\n }\r\n\r\n chapters.push({\r\n id: i,\r\n pid: pid,\r\n level: level,\r\n rel: `heading-${i}`,\r\n text,\r\n tagName\r\n })\r\n })\r\n\r\n return showCode ? _getChaptersWithCode(chapters) : chapters\r\n}\r\n\r\nexport default getChaptersByHeadings\r\n","import isString from '../types/isString'\r\n\r\n/**\r\n * 过滤所有 HTML 标签\r\n * ========================================================================\r\n * @method stripTags\r\n * @param {string} str\r\n * @returns {string}\r\n */\r\nconst stripTags = (str) => {\r\n if (!isString(str)) {\r\n return ''\r\n }\r\n return str.replace(/<\\/?[^>]+(>|$)/g, '')\r\n}\r\n\r\nexport default stripTags\r\n","const _getChapterParentIdByDiffer = (chapters, differ, index) => {\r\n let previous = chapters[index - 1]\r\n let pid\r\n let i\r\n\r\n for (i = 0; i < differ; i += 1) {\r\n pid = previous.pid\r\n previous = chapters[pid]\r\n }\r\n\r\n pid = previous.pid\r\n\r\n return pid\r\n}\r\n\r\nexport default _getChapterParentIdByDiffer\r\n","import isArray from './utils/types/isArray'\r\n\r\nconst _getChaptersWithCode = (chapters) => {\r\n const groups = {}\r\n const cb = (o) => {\r\n return [o.pid]\r\n }\r\n\r\n chapters.forEach((o) => {\r\n const group = JSON.stringify(cb(o))\r\n\r\n groups[group] = groups[group] || []\r\n groups[group].push(o)\r\n\r\n o.index = groups[group].length\r\n\r\n if (o.pid === -1) {\r\n o.code = String(o.index)\r\n }\r\n })\r\n\r\n Object.keys(groups).forEach((group) => {\r\n groups[group].forEach((c) => {\r\n const subjects = groups[`[${c.id}]`]\r\n\r\n if (!subjects || !isArray(subjects)) {\r\n return false\r\n }\r\n\r\n subjects.forEach((o) => {\r\n o.code = c.code + '.' + o.index\r\n })\r\n })\r\n })\r\n\r\n return chapters\r\n}\r\n\r\nexport default _getChaptersWithCode\r\n","import isString from './utils/types/isString'\r\nimport isFunction from './utils/types/isFunction'\r\nimport isElement from './utils/types/isElement'\r\nimport toTree from './utils/lang/toTree'\r\n\r\nimport getChaptersByHeadings from './getChaptersByHeadings'\r\n\r\n/**\r\n *\r\n * @param {Object} [options]\r\n * @param {String|HTMLElement} [options.articleElement]\r\n * @param {String} [options.selector]\r\n * @param {Boolean} [options.showCode]\r\n * @param {Function} [options.chapterTextFilter]\r\n * @param {Boolean} [options.isTreeStructured]\r\n * @returns {Array}\r\n */\r\nconst getChapters = (options) => {\r\n const {\r\n articleElement,\r\n selector,\r\n showCode,\r\n chapterTextFilter,\r\n isTreeStructured\r\n } = options\r\n let $article = document.querySelector('#article')\r\n let $headings = []\r\n let chapters = []\r\n let filter = (text) => {\r\n return text.replace(/\\(.*?\\)/, '()')\r\n }\r\n\r\n if (isString(articleElement)) {\r\n $article = document.querySelector(articleElement)\r\n } else if (isElement(articleElement)) {\r\n $article = articleElement\r\n }\r\n\r\n if (!$article) {\r\n return chapters\r\n }\r\n\r\n if (isFunction(chapterTextFilter)) {\r\n filter = chapterTextFilter\r\n }\r\n\r\n $headings = [...$article.querySelectorAll(selector || 'h1,h2,h3,h4,h5,h6')]\r\n chapters = getChaptersByHeadings($headings, showCode || true, filter)\r\n\r\n return isTreeStructured === true ? toTree(chapters, 'id', 'pid') : chapters\r\n}\r\n\r\nexport default getChapters\r\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","/**\r\n * 检测对象自身属性中是否具有指定的属性。\r\n * ========================================================================\r\n * @method hasOwn\r\n * @param {Object} obj - (必须)检测的目标对象\r\n * @param {String} prop - (必须)属性名\r\n * @returns {Boolean}\r\n */\r\nconst hasOwn = (obj, prop) => {\r\n const hasOwnProperty = Object.prototype.hasOwnProperty\r\n return obj && hasOwnProperty.call(obj, prop)\r\n}\r\n\r\nexport default hasOwn\r\n","import hasOwn from './hasOwn'\r\n\r\n/**\r\n * 扩展对象\r\n * ========================================================================\r\n * @method extend\r\n * @param {Object} origin\r\n * @param {Object} source\r\n */\r\nconst extend = (origin, source) => {\r\n const keys = Object.keys(source)\r\n\r\n keys.forEach((prop) => {\r\n if (hasOwn(source, prop)) {\r\n origin[prop] = source[prop]\r\n }\r\n })\r\n}\r\n\r\nexport default extend\r\n","/**\r\n * 存储订阅者(主题和处理器的)私有对象\r\n * ========================================================================\r\n * @type {{}}\r\n * @private\r\n */\r\nconst _subscribers = {}\r\n\r\nexport default _subscribers\r\n","import _subscribers from './_subscribers'\r\nimport hasOwn from '../lang/hasOwn'\r\n\r\n/**\r\n * 判断是否存在与给定 topic 完全匹配的订阅者信息\r\n * ========================================================================\r\n * @method _hasDirectSubscribersFor\r\n * @param {String} topic - (必须)订阅主题字符串\r\n * @returns {Boolean}\r\n */\r\nconst _hasDirectSubscribersFor = (topic) => {\r\n return hasOwn(_subscribers, topic) && _subscribers[topic].length > 0\r\n}\r\n\r\nexport default _hasDirectSubscribersFor\r\n","import _hasDirectSubscribersFor from './_hasDirectSubscribersFor'\r\nimport _hasSubscribers from './_hasSubscribers'\r\n\r\n/**\r\n * 判断是否存在包含 topic 指定的订阅者信息\r\n * ========================================================================\r\n * @method has\r\n * @param {String} topic - (必须)主题名称\r\n * @param {Boolean} [isDirect] - (可选)是否为直接的主题,默认值:true\r\n * @returns {Boolean}\r\n */\r\nconst has = (topic, isDirect = true) => {\r\n return isDirect ? _hasDirectSubscribersFor(topic) : _hasSubscribers(topic)\r\n}\r\n\r\nexport default has\r\n","import _hasDirectSubscribersFor from './_hasDirectSubscribersFor'\r\n\r\n/**\r\n * 判断是否存在包含给定 topic 相关的订阅者信息\r\n * ========================================================================\r\n * @method _hasSubscribers\r\n * @param {String} topic - (必须)订阅主题字符串\r\n * @returns {Boolean}\r\n */\r\nconst _hasSubscribers = (topic) => {\r\n let found = _hasDirectSubscribersFor(topic)\r\n let position = topic.lastIndexOf('.')\r\n\r\n while (!found && position !== -1) {\r\n topic = topic.substring(0, position)\r\n position = topic.lastIndexOf('.')\r\n found = _hasDirectSubscribersFor(topic)\r\n }\r\n\r\n return found\r\n}\r\n\r\nexport default _hasSubscribers\r\n","import isTypedArray from '../types/isTypedArray'\r\nimport _subscribers from './_subscribers'\r\nimport has from './has'\r\nimport _hasDirectSubscribersFor from './_hasDirectSubscribersFor'\r\n\r\n/**\r\n * (异步)发布订阅主题信息\r\n * ========================================================================\r\n * 主题默认是异步发布的。确保在消费者处理主题时,主题的发起者不会被阻止。\r\n * ========================================================================\r\n * @method emit\r\n * @param {String} topic - (必须)主题名称\r\n * @param {Object} [data] - (可选)数据对象\r\n * @param {Boolean} [async] - (可选) 是否异步发布\r\n */\r\nconst emit = (topic, data, async = true) => {\r\n const execute = (topic) => {\r\n if (!_hasDirectSubscribersFor(topic)) {\r\n return false\r\n }\r\n\r\n _subscribers[topic].forEach((subscriber) => {\r\n // 针对 mqtt 消息服务返回的 Uint8Array 类似的 typed arrays 格式的数据\r\n // 采用 toString() 方法转化为普通(JSON)字符串\r\n const message = isTypedArray(data) ? data.toString() : data\r\n\r\n subscriber.callback.call(subscriber.context || subscriber, message)\r\n })\r\n }\r\n const deliver = () => {\r\n let subscriber = topic\r\n let position = topic.lastIndexOf('.')\r\n\r\n while (position !== -1) {\r\n subscriber = subscriber.substring(0, position)\r\n position = subscriber.lastIndexOf('.')\r\n\r\n execute(subscriber)\r\n }\r\n\r\n // 执行 topic 对应的处理器\r\n execute(topic)\r\n // 执行特殊 topic:'*'(监听全部消息的发布)\r\n execute('*')\r\n }\r\n\r\n if (!has(topic)) {\r\n return false\r\n }\r\n\r\n if (async) {\r\n setTimeout(deliver, 10)\r\n } else {\r\n deliver()\r\n }\r\n}\r\n\r\nexport default emit\r\n","import toString from '../lang/toString'\r\n/**\r\n * 判断检测数据是否为 Typed Arrays 类型的数据\r\n * ========================================================================\r\n * @param {*} val\r\n * @returns {boolean}\r\n */\r\nconst isTypedArray = (val) => {\r\n const TYPES = [\r\n '[object Int8Array]',\r\n '[object Uint8Array]',\r\n '[object Uint8ClampedArray]',\r\n '[object Int16Array]',\r\n '[object Uint16Array]',\r\n '[object Int32Array]',\r\n '[object Uint32Array]',\r\n '[object Float32Array]',\r\n '[object Float64Array]',\r\n '[object BigInt64Array]',\r\n '[object BigUint64Array]'\r\n ]\r\n\r\n return TYPES.indexOf(toString(val)) > -1\r\n}\r\n\r\nexport default isTypedArray\r\n","/**\r\n * 生成唯一 id 字符串的函数\r\n * ========================================================================\r\n * @method guid\r\n * @param {String} [prefix] - 生成 id 的前缀字符串\r\n * @return {String} 返回一个表示唯一 id 的字符串\r\n */\r\nconst guid = (() => {\r\n let uuid = 0\r\n\r\n return (prefix) => {\r\n uuid += 1\r\n\r\n return prefix ? prefix + '-' + uuid : 'guid-' + uuid\r\n }\r\n})()\r\n\r\nexport default guid\r\n","import _subscribers from './_subscribers'\r\nimport hasOwn from '../lang/hasOwn'\r\n\r\n/**\r\n * 删除与给定 topic 相同的订阅者信息\r\n * ========================================================================\r\n * @method _removeSubscriber\r\n * @param {String} topic - (必须)订阅主题字符串\r\n * @returns {Boolean}\r\n */\r\nconst _removeSubscriber = (topic) => {\r\n if (!hasOwn(_subscribers, topic)) {\r\n return false\r\n }\r\n\r\n delete _subscribers[topic]\r\n}\r\n\r\nexport default _removeSubscriber\r\n","import has from './has'\r\nimport _removeSubscriber from './_removeSubscriber'\r\nimport _removeSubscriberByToken from './_removeSubscriberByToken'\r\n\r\n/**\r\n * 取消订阅主题\r\n * ========================================================================\r\n * @method off\r\n * @param {String} topic - (必须)订阅的主题\r\n * @param {Function|String} [token] - (可选)订阅主题的处理器函数或者唯一 Id 值\r\n */\r\nconst off = (topic, token) => {\r\n if (!has(topic)) {\r\n return false\r\n }\r\n\r\n if (token) {\r\n _removeSubscriberByToken(token)\r\n } else {\r\n _removeSubscriber(topic)\r\n }\r\n}\r\n\r\nexport default off\r\n","import _subscribers from './_subscribers'\r\nimport _removeSubscriber from './_removeSubscriber'\r\n\r\n/**\r\n * 通过订阅者 token 值删除订阅者信息\r\n * ========================================================================\r\n * @method _removeSubscriberByToken\r\n * @param {String} token - 订阅者 token 字符串\r\n * @returns {boolean}\r\n * @private\r\n */\r\nconst _removeSubscriberByToken = (token) => {\r\n const keys = Object.keys(_subscribers)\r\n let index = -1\r\n\r\n if (!token || keys.length < 1) {\r\n return false\r\n }\r\n\r\n keys.forEach((subject) => {\r\n const subscriber = _subscribers[subject]\r\n let topic\r\n\r\n subscriber.forEach((execution, j) => {\r\n if (execution.callback === token || execution.token === token) {\r\n topic = execution.topic\r\n subscriber.splice(index, j)\r\n }\r\n })\r\n\r\n /* istanbul ignore else */\r\n if (subscriber.length < 1) {\r\n _removeSubscriber(topic)\r\n }\r\n })\r\n}\r\n\r\nexport default _removeSubscriberByToken\r\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\nimport publish from './utils/observer/emit'\r\nimport subscribe from './utils/observer/on'\r\nimport unsubscribe from './utils/observer/off'\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 refresh() {\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 let attrs = this.attr()\r\n\r\n if (options) {\r\n attrs = this.attr(options)\r\n }\r\n\r\n this.destroy().initialize(attrs)\r\n\r\n return this\r\n }\r\n\r\n $emit(event, data) {\r\n publish(event, data)\r\n return this\r\n }\r\n\r\n $on(event, callback) {\r\n subscribe(event, callback, this)\r\n return this\r\n }\r\n\r\n $off(event, callback) {\r\n unsubscribe(event, callback)\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 _subscribers from './_subscribers'\r\nimport isFunction from '../types/isFunction'\r\nimport guid from '../lang/guid'\r\n\r\n/**\r\n * 订阅主题并给出处理器函数\r\n * ========================================================================\r\n * @method on\r\n * @param {String} topic - 必须主题名称\r\n * @param {Function} handler - 必须主题的处理器函数\r\n * @param {Object} [context] - 可选指定 this 执行上下文\r\n * @return {String} - 唯一的 token 字符串例如:'guid-1'。\r\n */\r\nconst on = (topic, handler, context = null) => {\r\n const token = guid()\r\n let subject = typeof topic === 'symbol' ? topic.toString() : topic\r\n\r\n if (!isFunction(handler)) {\r\n return ''\r\n }\r\n\r\n /* istanbul ignore else */\r\n if (!_subscribers[subject]) {\r\n _subscribers[subject] = []\r\n }\r\n\r\n _subscribers[subject].push({\r\n topic: subject,\r\n callback: handler,\r\n context,\r\n token\r\n })\r\n\r\n return token\r\n}\r\n\r\nexport default on\r\n","/**\r\n * timeSlice.js 时间切片功能函数\r\n * ====================================================\r\n * Created By: Yaohaixiao\r\n * Update: 2023.09.04\r\n */\r\nimport isFunction from '../types/isFunction'\r\nimport later from './later'\r\n\r\nconst queue = []\r\nlet isHandling\r\nlet done\r\n\r\n// Shim from https://developers.google.com/web/updates/2015/08/using-requestidlecallback\r\nif (typeof window.requestIdleCallback === 'undefined') {\r\n window.requestIdleCallback = function (cb) {\r\n const start = Date.now()\r\n return later(function () {\r\n cb({\r\n didTimeout: false,\r\n timeRemaining: function () {\r\n return Math.max(0, 50 - (Date.now() - start))\r\n }\r\n })\r\n }, 10)\r\n }\r\n\r\n window.cancelIdleCallback = function (id) {\r\n clearTimeout(id)\r\n }\r\n}\r\n\r\nfunction runIdle(idleDeadline) {\r\n while (idleDeadline.timeRemaining() > 0 && queue.length) {\r\n const fn = queue.shift()\r\n\r\n if (!isFunction(fn)) {\r\n return false\r\n }\r\n\r\n fn()\r\n }\r\n\r\n if (queue.length) {\r\n isHandling = requestIdleCallback(runIdle)\r\n } else {\r\n isHandling = 0\r\n\r\n if (isFunction(done)) {\r\n done()\r\n done = null\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * 时间切片功能函数:主要用于优化长时任务的性能,将长时任务分解成\r\n * 多个短时间任务\r\n * ====================================================\r\n * @param {Function} fn - 需要在空闲时执行的回调函数\r\n * @param {Function} afterComplete - queen 的\r\n * @return {(function(): (boolean|undefined))|*|boolean}\r\n */\r\nconst timeSlice = (fn, afterComplete = null) => {\r\n queue.push(fn)\r\n\r\n if (isFunction(afterComplete)) {\r\n done = afterComplete\r\n }\r\n\r\n if (!isHandling) {\r\n requestIdleCallback(runIdle)\r\n }\r\n}\r\n\r\nexport default timeSlice\r\n","/**\r\n * 获取 DOM 节点相对于窗口的 left (纵坐标)值\r\n * ========================================================================\r\n * @method offsetTop\r\n * @param {HTMLElement} el - DOM 节点\r\n * @returns {Number}\r\n */\r\nconst offsetTop = (el) => {\r\n let top = el.offsetTop\r\n\r\n if (el.offsetParent !== null) {\r\n top += offsetTop(el.offsetParent)\r\n }\r\n\r\n return top\r\n}\r\n\r\nexport default offsetTop\r\n","/**\r\n * 获取 options 节点下匹配 selector 选择器的 DOM 节点\r\n * ========================================================================\r\n * Element.matches() 方法可以用来判断 DOM 元素是否与给定的选择器匹配,事件代理判断是\r\n * 否触发绑定的代理事件回调函数,关键就是使用 Element.matches() 辨别当前事件触发的目\r\n * 标 DOM 元素是否为事件代理所期望触发的目标。\r\n * ========================================================================\r\n * @method matches\r\n * @see https://developer.mozilla.org/en-US/docs/web/api/element/matches\r\n * @param {HTMLElement} el - (必须)DOM 元素\r\n * @param {String} selector - (必须)匹配 DOM 元素的选择器\r\n * @returns {Boolean}\r\n */\r\nconst matches = (el, selector = '') => {\r\n const sel = selector.replace(/^>/i, '')\r\n\r\n if (!selector || !sel || !el) {\r\n return false\r\n }\r\n\r\n /* istanbul ignore else */\r\n if (el.matches) {\r\n return el.matches(sel)\r\n } else if (el.msMatchesSelector) {\r\n return el.msMatchesSelector(sel)\r\n } else {\r\n return false\r\n }\r\n}\r\n\r\nexport default matches\r\n","/**\r\n * 获取 DOM 元素的父节点\r\n * ========================================================================\r\n * @method getParentOrHost\r\n * @param {*|HTMLElement} el - (必须)要获取父节点的 DOM 元素\r\n * @returns {*|HTMLElement}\r\n */\r\nconst getParentOrHost = (el) => {\r\n return el.host && el !== document && el.host.nodeType\r\n ? el.host\r\n : el.parentNode\r\n}\r\n\r\nexport default getParentOrHost\r\n","export const CAPTURE_EVENTS = [\r\n 'focusout',\r\n 'blur',\r\n 'focusin',\r\n 'focus',\r\n 'load',\r\n 'unload',\r\n 'mouseenter',\r\n 'mouseleave'\r\n]\r\n","import { CAPTURE_EVENTS } from './enum'\r\nimport _delete from './_delete'\r\n\r\n/**\r\n * (私有方法)取消 type 类型的代理事件绑定\r\n * ========================================================================\r\n * 如果没有设置 handler,则销毁 this.$options 绑定的所有符合 type 事件类型的事件绑定\r\n * ========================================================================\r\n * @method _off\r\n * @param {HTMLElement} el - (必须)取消事件绑定的 DOM 元素\r\n * @param {String} type - (必须)事件类型\r\n * @param {Function} fn - (必须)事件处理器回调函数\r\n * @private\r\n */\r\nconst _off = (el, type, fn) => {\r\n const capture = CAPTURE_EVENTS.indexOf(type) > -1\r\n\r\n /* istanbul ignore else */\r\n if (fn._delegateListener) {\r\n fn = fn._delegateListener\r\n delete fn._delegateListener\r\n }\r\n\r\n // 移除缓存的 _listeners 数据\r\n _delete(el, type, fn)\r\n\r\n el.removeEventListener(type, fn, capture)\r\n}\r\n\r\nexport default _off\r\n","/**\r\n * 删除 DOM 元素缓存的 _listeners 数据\r\n * ========================================================================\r\n * @method _delete\r\n * @param {HTMLElement} el - 要删除 listener 的 DOM 元素\r\n * @param {String} type - 事件类型(名称)\r\n * @param {Function} [fn] - 事件处理器回调函数\r\n */\r\nconst _delete = function (el, type, fn) {\r\n const listeners = el._listeners\r\n let index = -1\r\n\r\n if (listeners.length < 1) {\r\n return false\r\n }\r\n\r\n // 移除缓存的 _listeners 数据\r\n listeners.forEach((listener, i) => {\r\n const handler = listener.fn\r\n\r\n if (type === listener.type) {\r\n index = i\r\n\r\n if (handler === fn) {\r\n index = i\r\n }\r\n }\r\n })\r\n\r\n /* istanbul ignore else */\r\n if (index > -1) {\r\n listeners.splice(index, 1)\r\n }\r\n}\r\n\r\nexport default _delete\r\n","import isString from '../types/isString'\r\nimport isElement from '../types/isElement'\r\nimport getListeners from './getListeners'\r\nimport _off from './_off'\r\n\r\n/**\r\n * 销毁(type 类型的)代理事件绑定\r\n * ========================================================================\r\n * 1. 设置了事件类型 type,则销毁指定类型的事件绑定,否则清除所有代理事件绑定\r\n * 2. recurse 设置为 true,递归销毁子节点全部事件绑定\r\n * ========================================================================\r\n * @method purgeElement\r\n * @param {HTMLElement|String} el - (必须)DOM 元素或者其选择器\r\n * @param {String|Boolean} type - (必须)事件类型\r\n * @param {Boolean} [recurse] - (可选)是否递归销毁子节点所有事件绑定\r\n */\r\nconst purgeElement = function (el, type, recurse = false) {\r\n const $element = isString(el) ? document.querySelector(el) : el\r\n const $children = $element.childNodes\r\n const listeners = getListeners($element, type)\r\n\r\n listeners.forEach((listener) => {\r\n _off($element, listener.type, listener.fn)\r\n })\r\n\r\n if (\r\n (recurse || type === true || arguments.length === 1) &&\r\n $element &&\r\n $children\r\n ) {\r\n $children.forEach(($child) => {\r\n if (isElement($child)) {\r\n purgeElement($child, type, recurse)\r\n }\r\n })\r\n }\r\n}\r\n\r\nexport default purgeElement\r\n","import isString from '../types/isString'\r\n\r\n/**\r\n * 获取 DOM 元素(type 事件类型)事件绑定信息\r\n * ========================================================================\r\n * 如果设置了事件类型 type, 则返回指定类型的事件绑定信息,否则返回所有事件绑定信息\r\n * ========================================================================\r\n * @methods getListeners\r\n * @param {HTMLElement} el - (必须)要获取事件绑定信息的 DOM 元素\r\n * @param {String} [type] - (可选)事件类型\r\n * @returns {Array} - 已绑定的事件信息\r\n */\r\nconst getListeners = (el, type) => {\r\n let listeners = el._listeners || []\r\n\r\n if (isString(type) && type) {\r\n listeners = listeners.filter((listener) => {\r\n return listener.type === type\r\n })\r\n }\r\n\r\n return listeners\r\n}\r\n\r\nexport default getListeners\r\n","import purgeElement from './purgeElement'\r\nimport isFunction from '../types/isFunction'\r\nimport _off from './_off'\r\n\r\n/**\r\n * 取消 type 类型的代理事件绑定\r\n * ========================================================================\r\n * 如果没有设置 handler,则销毁 this.$options 绑定的所有符合 type 事件类型的事件绑定\r\n * ========================================================================\r\n * @method off\r\n * @param {HTMLElement|Object} el - (必须)取消事件绑定的 DOM 元素\r\n * @param {String} type - (必须)事件类型\r\n * @param {Function} [fn] - (可选)事件处理器回调函数\r\n */\r\nconst off = (el, type, fn) => {\r\n // 如果不设置 fn 参数,默认清除 el 元素上绑定的所有事件处理器\r\n if (!isFunction(fn)) {\r\n purgeElement(el, type)\r\n return false\r\n }\r\n\r\n _off(el, type, fn)\r\n}\r\n\r\nexport default off\r\n","import closest from '../dom/closest'\r\nimport off from './off'\r\nimport getTarget from './getTarget'\r\n\r\nimport { CAPTURE_EVENTS } from './enum'\r\n\r\n/**\r\n * 绑定代理事件\r\n * ========================================================================\r\n * @method on\r\n * @param {HTMLElement|String|Object} el - (必须)绑定代理事件的 DOM 节点\r\n * @param {String} selector - (必须)事件代理目标 DOM 元素的选择器\r\n * @param {String|Function} type - (必须)事件类型或者事件处理器回调函数\r\n * @param {Function|Object} fn - (可选) 事件处理器回调函数或者传递给事件处理器回调函数的数据对象\r\n * @param {Object|Boolean} [data] - (可选)传递给事件处理器回调函数的数据对象或者事件处理器回调函数的 this 上下文指向,\r\n * @param {Object|Boolean} [context] - (可选)事件处理器回调函数的 this 上下文指向,或者是否仅触发一次\r\n * 当设置为 true 时,则事件处理器回调函数的 this 上下文指向为 data 对象\r\n * @param {Boolean} once - (可选)是否仅触发一次\r\n */\r\nconst on = (el, selector, type, fn, data, context, once = false) => {\r\n // CAPTURE_EVENTS 中的特殊事件,采用事件捕获模型\r\n const capture = CAPTURE_EVENTS.indexOf(type) > -1\r\n\r\n const listener = function (evt) {\r\n const target = getTarget(evt)\r\n // 通过 Element.matches 方法获得点击的目标元素\r\n const delegateTarget = closest(target, selector, el)\r\n let overrideContext = context || el\r\n\r\n evt.delegateTarget = delegateTarget\r\n\r\n // 当设置为 true 时,则事件处理器回调函数的\r\n // this 上下文指向为 data 对象\r\n if (context === true) {\r\n overrideContext = data\r\n }\r\n\r\n /* istanbul ignore else */\r\n if (delegateTarget) {\r\n // 仅触发一次\r\n /* istanbul ignore else */\r\n if (once === true) {\r\n off(el, type, listener)\r\n }\r\n\r\n fn.call(overrideContext, evt, data)\r\n }\r\n }\r\n\r\n if (!el) {\r\n return false\r\n }\r\n\r\n if (!el._listeners) {\r\n el._listeners = []\r\n }\r\n\r\n // 缓存 options 元素绑定的事件处理器\r\n el._listeners.push({\r\n el,\r\n selector,\r\n type,\r\n fn: listener,\r\n data,\r\n context,\r\n capture\r\n })\r\n\r\n // 缓存包装后的事件处理器\r\n fn._delegateListener = listener\r\n\r\n el.addEventListener(type, listener, capture)\r\n}\r\n\r\nexport default on\r\n","import resolveTextNode from '../dom/resolveTextNode'\r\n\r\n/**\r\n * 返回触发事件的 target DOM 元素\r\n * ========================================================================\r\n * @method getTarget\r\n * @param {Event} evt - Event 对象\r\n * @return {HTMLElement} - Event 对象的 target DOM 元素\r\n */\r\nconst getTarget = function (evt) {\r\n const target = evt.target\r\n\r\n return resolveTextNode(target)\r\n}\r\n\r\nexport default getTarget\r\n","/**\r\n * 在某些情况下,某些浏览器(例如:Safari 浏览器)会返回实际的目标元素内部的文本节点。\r\n * resolveTextNode() 方法则会返回实际的目标节点。\r\n * ========================================================================\r\n * @method resolveTextNode\r\n * @param {HTMLElement|Text} el - 要解析的节点\r\n * @return {*|HTMLElement} - 实际的目标 DOM 节点\r\n */\r\nconst resolveTextNode = function (el) {\r\n if (el && el.nodeType === 3) {\r\n return el.parentNode\r\n }\r\n\r\n return el\r\n}\r\n\r\nexport default resolveTextNode\r\n","import matches from './matches'\r\nimport getParentOrHost from './getParentOrHost'\r\n\r\n/**\r\n * 获取 options 元素父元素最近的包含 selector 选择器的元素\r\n * ========================================================================\r\n * @method closest\r\n * @param {HTMLElement} el - (必须)DOM 元素\r\n * @param {String} selector - (必须)DOM 元素的选择其\r\n * @param {HTMLElement} [ctx] - (必须)比对的 DOM 元素\r\n * @param {Boolean} [includeCTX] - (必须)是否包含 context DOM 元素\r\n * @returns {null|HTMLElement} - 返回最接近的 DOM 元素\r\n */\r\nconst closest = (el, selector, ctx, includeCTX) => {\r\n const context = ctx || document\r\n\r\n if (!el) {\r\n return null\r\n }\r\n\r\n do {\r\n /* istanbul ignore else */\r\n if (\r\n (selector != null &&\r\n (selector.startsWith('>')\r\n ? el.parentNode === context && matches(el, selector)\r\n : matches(el, selector))) ||\r\n (includeCTX && el === context)\r\n ) {\r\n return el\r\n }\r\n\r\n /* istanbul ignore else */\r\n if (el === context) {\r\n break\r\n }\r\n\r\n /* jshint boss:true */\r\n } while ((el = getParentOrHost(el)))\r\n}\r\n\r\nexport default closest\r\n","/**\r\n * 停止事件(阻止默认行为和阻止事件的捕获或冒泡)\r\n * ========================================================================\r\n * @method stop\r\n * @param {Event} evt - 事件对象\r\n *\r\n * @example\r\n * <div id=\"nav\" class=\"nav\">\r\n * <a id=\"service\" class=\"anchor\" href=\"https://www.yaohaixiao.com/serivce\">Service</a>\r\n * <a id=\"help\" class=\"anchor\" href=\"https://www.yaohaixiao.com/help\">Help</a>\r\n * </div>\r\n *\r\n * const $nav = document.querySelector('#nav')\r\n * const $service = document.querySelector('.anchor')\r\n *\r\n * on($nav, 'click', function(evt) {\r\n * console.log('你点击了导航栏')\r\n * })\r\n *\r\n * on($anchor, 'click', function(evt) {\r\n * console.log('tagName', this.tagName)\r\n *\r\n * // 工作台输出:'a'\r\n * // 不会触发事件冒泡,输出:'你点击了导航栏'\r\n * // 也不会切换到 href 属性的页面,阻止了点击链接的默认行为\r\n * stopEvent(evt)\r\n * })\r\n */\r\nconst stop = function (evt) {\r\n evt.stopPropagation()\r\n evt.preventDefault()\r\n}\r\n\r\nexport default stop\r\n","import DEFAULTS from './defaults'\r\n\r\nconst SYMBOLS = [...DEFAULTS]\r\n\r\nexport default SYMBOLS\r\n","const DEFAULTS = [\r\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>',\r\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>',\r\n '<symbol id=\"outline-icon-menu\" viewBox=\"0 0 1024 1024\"><path d=\"M320 256h640V128H320zM320 576h640V448H320zM320 896h640v-128H320zM64 256h128V128H64zM64 576h128V448H64zM64 896h128v-128H64z\"></path></symbol>',\r\n '<symbol id=\"outline-icon-file\" viewBox=\"0 0 1024 1024\"><path d=\"M320 640h256v128H320z\"></path><path d=\"M320 448h384v128H320z\"></path><path d=\"M640 0l320 320v557.696C960 958.528 909.824 1024 848 1024H176C114.176 1024 64 958.528 64 877.696V146.304C64 65.472 114.176 0 176 0H640z m0 128H192v768h640V320h-192V128z\"></path></symbol>',\r\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>',\r\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>',\r\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>',\r\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>',\r\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>',\r\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>',\r\n '<symbol id=\"outline-icon-print\" viewBox=\"0 0 24 24\"><path d=\"M18 3v3.984h-12v-3.984h12zM18.984 12q0.422 0 0.727-0.281t0.305-0.703-0.305-0.727-0.727-0.305-0.703 0.305-0.281 0.727 0.281 0.703 0.703 0.281zM15.984 18.984v-4.969h-7.969v4.969h7.969zM18.984 8.016q1.219 0 2.109 0.891t0.891 2.109v6h-3.984v3.984h-12v-3.984h-3.984v-6q0-1.219 0.891-2.109t2.109-0.891h13.969z\"></path></symbol>',\r\n '<symbol id=\"outline-icon-info\" viewBox=\"0 0 1024 1024\"><path d=\"M512 384.295982a95.994 95.994 0 0 1 95.994 95.994V928.006a95.994 95.994 0 0 1-191.988 0V480.289982a95.994 95.994 0 0 1 95.994-95.994z m0-128.375977A127.992 127.992 0 1 1 512 0.063996a127.992 127.992 0 0 1 0 255.984001z\"></path></symbol>',\r\n '<symbol id=\"outline-icon-warning\" viewBox=\"0 0 1024 1024\"><path d=\"M512 639.704018a95.994 95.994 0 0 1-95.994-95.994V95.994a95.994 95.994 0 0 1 191.988 0v447.716018a95.994 95.994 0 0 1-95.994 95.994z m0 128.375977A127.992 127.992 0 1 1 512 1023.936004a127.992 127.992 0 0 1 0-255.984001z\"></path></symbol>',\r\n '<symbol id=\"outline-icon-error\" viewBox=\"0 0 1024 1024\"><path d=\"M512.64 376.96L263.744 128 128 263.744l248.96 248.96L128 761.472l135.744 135.808 248.96-248.96 248.832 248.96 135.808-135.808-248.96-248.896 248.96-248.896L761.536 128 512.64 376.96z\"></path></symbol>',\r\n '<symbol id=\"outline-icon-success\" viewBox=\"0 0 1024 1024\"><path d=\"M426.368 580.864l-226.56-226.56L64 489.984l362.048 362.112 0.32-0.32 0.32 0.32 588.288-588.352L879.36 128 426.304 580.864z\"></path></symbol>',\r\n '<symbol id=\"outline-icon-circle-info\" viewBox=\"0 0 1024 1024\"><path d=\"M512 810.666667s-42.666667 4.266667-42.666667-42.666667v-341.333333c0-46.933333 42.666667-42.666667 42.666667-42.666667s42.666667-4.266667 42.666667 42.666667v341.333333c0 46.933333-42.666667 42.666667-42.666667 42.666667z m0 213.333333C228.949333 1024 0 795.050667 0 512S228.949333 0 512 0s512 228.949333 512 512-229.674667 512-512 512z m0-938.666667C276.608 85.333333 85.333333 276.608 85.333333 512s191.274667 426.666667 426.666667 426.666667 426.666667-191.274667 426.666667-426.666667S747.392 85.333333 512 85.333333z m0 213.333334c-23.466667 0-42.666667-19.2-42.666667-42.666667s19.2-42.666667 42.666667-42.666667 42.666667 19.2 42.666667 42.666667-19.2 42.666667-42.666667 42.666667z\"></path></symbol>',\r\n '<symbol id=\"outline-icon-circle-warning\" viewBox=\"0 0 1024 1024\"><path d=\"M512 213.333333s-42.666667-4.266667-42.666667 42.666667v341.333333c0 46.933333 42.666667 42.666667 42.666667 42.666667s42.666667 4.266667 42.666667-42.666667V256c0-46.933333-42.666667-42.666667-42.666667-42.666667z m0-213.333333C228.949333 0 0 228.949333 0 512s228.949333 512 512 512 512-228.949333 512-512S794.325333 0 512 0z m0 938.666667C276.608 938.666667 85.333333 747.392 85.333333 512S276.608 85.333333 512 85.333333s426.666667 191.274667 426.666667 426.666667-191.274667 426.666667-426.666667 426.666667z m0-213.333334c-23.466667 0-42.666667 19.2-42.666667 42.666667s19.2 42.666667 42.666667 42.666667 42.666667-19.2 42.666667-42.666667-19.2-42.666667-42.666667-42.666667z\"></path></symbol>',\r\n '<symbol id=\"outline-icon-circle-error\" viewBox=\"0 0 1024 1024\"><path d=\"M512 0a512 512 0 1 0 512 512 512 512 0 0 0-512-512z m0 955.776A443.84 443.84 0 0 1 512 68.224a443.904 443.904 0 0 1 0 887.552z\"></path><path d=\"M641.664 326.144a32 32 0 0 1 50.304 39.168l-3.52 4.48-306.112 328.064a32 32 0 0 1-50.304-39.168l3.52-4.48 306.112-328.064z\"></path><path d=\"M324.608 337.088a32 32 0 0 1 40.704-5.12l4.48 3.584 328.064 306.112a32 32 0 0 1-39.168 50.304l-4.48-3.52-328.064-306.112a32 32 0 0 1-1.536-45.248z\"></path></symbol>',\r\n '<symbol id=\"outline-icon-circle-success\" viewBox=\"0 0 1024 1024\"><path d=\"M512 0C228.949333 0 0 228.949333 0 512s228.949333 512 512 512 512-228.949333 512-512S794.325333 0 512 0z m0 950.869333C269.909333 950.869333 73.130667 754.090667 73.130667 512 73.130667 269.909333 269.909333 73.130667 512 73.130667c242.090667 0 438.869333 196.778667 438.869333 438.869333 0 242.090667-196.778667 438.869333-438.869333 438.869333z\"></path><path d=\"M737.834667 353.834667a42.666667 42.666667 0 0 1 63.872 56.32l-3.541334 4.010666L486.997333 725.333333a85.333333 85.333333 0 0 1-115.242666 4.992L366.336 725.333333l-140.501333-140.501333a42.666667 42.666667 0 0 1 56.32-63.872l4.010666 3.541333L426.666667 665.002667l311.168-311.168z\"></path></symbol>',\r\n '<symbol id=\"outline-icon-sound\" viewBox=\"0 0 16 16\"><path d=\"M12.757 4.708c-0.406 0.405-1.062 0.405-1.468 0s-0.405-1.062 0-1.468l2.935-2.935c0.406-0.405 1.062-0.405 1.468 0 0.405 0.405 0.405 1.062 0 1.468l-2.935 2.935zM7.996 15.991l-3.996-3.996h-2.997c-0.552 0-0.999-0.447-0.999-0.999v-5.994c0-0.552 0.447-0.999 0.999-0.999h2.997l3.996-3.996c0 0 0.999-0.125 0.999 0.999 0 5.976 0 14.966 0 13.985 0 1.124-0.999 0.999-0.999 0.999zM6.997 4.004l-1.998 1.998h-2.997v3.996h2.997l1.998 1.998v-7.992zM11.992 8.999c-0.552 0-0.999-0.447-0.999-0.999s0.447-0.999 0.999-0.999h2.997c0.552 0 0.999 0.447 0.999 0.999s-0.447 0.999-0.999 0.999h-2.997zM12.757 11.292l2.935 2.935c0.405 0.406 0.405 1.063 0 1.468s-1.062 0.405-1.468 0l-2.935-2.935c-0.405-0.406-0.405-1.063 0-1.468s1.062-0.405 1.468 0z\"></path></symbol>'\r\n]\r\n\r\nexport default DEFAULTS\r\n","import isString from '../types/isString'\r\nimport getSymbol from './getSymbol'\r\nimport SYMBOLS from './symbols'\r\n\r\n/**\r\n *\r\n * @method getSymbols\r\n * @param {String} [name]\r\n * @param {String} [iconSet]\r\n * @returns {string[]|*}\r\n */\r\nconst getSymbols = (name, iconSet = 'icon') => {\r\n if (isString(name)) {\r\n return getSymbol(name, iconSet)\r\n }\r\n\r\n return [...SYMBOLS]\r\n}\r\n\r\nexport default getSymbols\r\n","import SYMBOLS from './symbols'\r\n\r\n/**\r\n * @method getSymbol\r\n * @param {String} name\r\n * @param {String} [iconSet]\r\n * @returns {String}\r\n */\r\nconst getSymbol = (name, iconSet = 'icon') => {\r\n const patternName = /id=\"(.*?)\"/\r\n const patternSet = /^(\\w+)-/\r\n const symbols = SYMBOLS\r\n\r\n return symbols.find((symbol) => {\r\n const names = patternName.exec(symbol)\r\n const fullName = names[1]\r\n const sets = patternSet.exec(fullName)\r\n const setName = sets[1]\r\n const iconName =\r\n iconSet === 'icon' ? `${iconSet}-${name}` : `${iconSet}-icon-${name}`\r\n\r\n return setName === iconSet && fullName === iconName\r\n })\r\n}\r\n\r\nexport default getSymbol\r\n","import add from './add'\r\nimport getSymbols from './getSymbols'\r\n\r\n/**\r\n * 绘制 SVG 图标集\r\n * ========================================================================\r\n * @method paint\r\n * @param {String|Array} symbol\r\n */\r\nconst paint = (symbol = '') => {\r\n const $body = document.body\r\n let $icons = document.querySelector('#outline-icons')\r\n let symbols = []\r\n\r\n add(symbol)\r\n symbols = getSymbols()\r\n\r\n if ($icons) {\r\n $icons.innerHTML = symbols.join('')\r\n } else {\r\n $icons = document.createElement('div')\r\n $icons.innerHTML =\r\n `<svg id=\"outline-icons\" aria-hidden=\"true\" style=\"position:absolute;display:none;width:0;height:0;overflow:hidden;\">` +\r\n `${symbols.join('')}` +\r\n `</svg>`\r\n $body.insertBefore($icons.firstChild, $body.firstChild)\r\n }\r\n}\r\n\r\nexport default paint\r\n","import isArray from '../types/isArray'\r\nimport isString from '../types/isString'\r\nimport SYMBOLS from './symbols'\r\n\r\n/**\r\n * @method add\r\n * @param {Array|String} symbols\r\n * @return {Boolean}\r\n */\r\nconst add = (symbols) => {\r\n if (!symbols) {\r\n return false\r\n }\r\n\r\n if (isArray(symbols) && symbols.length > 0) {\r\n symbols.forEach((symbol) => {\r\n /* istanbul ignore else */\r\n if (SYMBOLS.indexOf(symbol) === -1 && isString(symbol)) {\r\n SYMBOLS.push(symbol)\r\n }\r\n })\r\n } else {\r\n /* istanbul ignore else */\r\n if (isString(symbols)) {\r\n SYMBOLS.push(symbols)\r\n }\r\n }\r\n}\r\n\r\nexport default add\r\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'\r\nimport isObject from './isObject'\r\n\r\nconst isFragment = (fragment) => {\r\n return !!(\r\n isObject(fragment) && toString(fragment) === '[object DocumentFragment]'\r\n )\r\n}\r\n\r\nexport default isFragment\r\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","/**\r\n * 给 DOM 节点设置属性/值\r\n * ========================================================================\r\n * @method setAttribute\r\n * @param {HTMLElement} el - DOM 节点\r\n * @param {String} attr - 属性名称\r\n * @param {String|Number|Boolean} value - 属性值\r\n */\r\nconst setAttribute = (el, attr, value) => {\r\n let tagName = el.tagName.toLowerCase()\r\n\r\n switch (attr) {\r\n case 'style':\r\n el.style.cssText = value\r\n break\r\n case 'value':\r\n if (tagName === 'input' || tagName === 'textarea') {\r\n el.value = value\r\n } else {\r\n el.setAttribute(attr, value)\r\n }\r\n break\r\n case 'htmlFor':\r\n el.setAttribute('for', value)\r\n break\r\n case 'className':\r\n el.className = value\r\n break\r\n case 'innerHTML':\r\n el.innerHTML = value\r\n break\r\n case 'innerText':\r\n el.innerText = value\r\n break\r\n default:\r\n el.setAttribute(attr, value)\r\n break\r\n }\r\n}\r\n\r\nexport default setAttribute\r\n","import isObject from '../types/isObject'\r\nimport hasOwn from '../lang/hasOwn'\r\nimport setAttribute from './setAttribute'\r\n\r\nconst setAttributes = (el, attrs) => {\r\n if (!el || !isObject(attrs)) {\r\n return false\r\n }\r\n\r\n Object.keys(attrs).forEach((attr) => {\r\n const value = attrs[attr]\r\n if (hasOwn(attrs, attr)) {\r\n setAttribute(el, attr, value)\r\n }\r\n })\r\n}\r\n\r\nexport default setAttributes\r\n","import isObject from '../types/isObject'\r\nimport isString from '../types/isString'\r\nimport isArray from '../types/isArray'\r\nimport isDOM from '../types/isDOM'\r\nimport setAttributes from './setAttributes'\r\n\r\n/**\r\n * 创建 DOM 节点,并添加属性和子节点\r\n * ========================================================================\r\n * @method createElement\r\n * @param {String} tagName - 标签名称\r\n * @param {Object|Array|HTMLElement|DocumentFragment|String} attrs - 属性对象或者子节点\r\n * @param {Array|HTMLElement|DocumentFragment|String} [children] - 子节点数组\r\n * @returns {HTMLElement}\r\n */\r\nconst createElement = (tagName, attrs, children) => {\r\n const $fragment = document.createDocumentFragment()\r\n const $el = document.createElement(tagName)\r\n const isValidChild = (child) => {\r\n return isDOM(child) || isString(child)\r\n }\r\n const append = (child) => {\r\n let $child\r\n\r\n if (!isValidChild(child)) {\r\n return false\r\n }\r\n\r\n if (isDOM(child)) {\r\n $child = child\r\n } else if (isString(child)) {\r\n $child = document.createTextNode(child)\r\n }\r\n\r\n $fragment.appendChild($child)\r\n }\r\n\r\n if (isObject(attrs)) {\r\n setAttributes($el, attrs)\r\n } else if (isArray(attrs) && attrs.every((attr) => isValidChild(attr))) {\r\n attrs.forEach((child) => {\r\n append(child)\r\n })\r\n } else if (isDOM(attrs)) {\r\n append(attrs)\r\n } else if (isString(attrs)) {\r\n append(document.createTextNode(attrs))\r\n }\r\n\r\n if (isArray(children)) {\r\n children.forEach((child) => {\r\n append(child)\r\n })\r\n } else {\r\n append(children)\r\n }\r\n\r\n $el.appendChild($fragment)\r\n\r\n return $el\r\n}\r\n\r\nexport default createElement\r\n","import isArray from '../types/isArray'\r\nimport isString from '../types/isString'\r\nimport isSVG from '../types/isSVG'\r\nimport setAttributes from '../dom/setAttributes'\r\n\r\n/**\r\n * 创建 SVG 图标 DOM 元素\r\n * ========================================================================\r\n * @method createElement\r\n * @param {String} name\r\n * @param {Object} [options]\r\n * @param {Number|Array} [options.size]\r\n * @param {String} [options.color]\r\n * @param {String} [options.iconSet]\r\n * @param {Object} [options.attrs]\r\n * @returns {HTMLElement}\r\n */\r\nconst createElement = (name, options = {}) => {\r\n const ICON = 'outline-icon'\r\n const size = options.size || 0\r\n const color = options.color || ''\r\n const iconSet = options.iconSet || ''\r\n const width = isArray(size) ? size[0] : size\r\n const height = isArray(size) ? size[1] : size\r\n const defaultRules = size ? `width:${width}px;height:${height}px;` : ''\r\n const cssRules = color ? defaultRules + `color:${color}` : defaultRules\r\n const attrs = options.attrs || {}\r\n const $icon = document.createElement('i')\r\n let binds = ''\r\n let svg = ''\r\n let $svg\r\n\r\n if (!isString(name)) {\r\n return null\r\n }\r\n\r\n if (isSVG(name)) {\r\n svg = name\r\n } else {\r\n binds =\r\n iconSet && iconSet !== 'icon'\r\n ? `xlink:href=\"#${iconSet}-icon-${name}\"`\r\n : `xlink:href=\"#icon-${name}\"`\r\n svg = `<svg><use ${binds}></use></svg>`\r\n }\r\n\r\n $icon.innerHTML = svg\r\n\r\n if (attrs.className) {\r\n attrs.className = `${ICON} ${attrs.className}`\r\n } else {\r\n attrs.className = ICON\r\n }\r\n\r\n setAttributes($icon, attrs)\r\n\r\n $svg = $icon.querySelector('svg')\r\n setAttributes($svg, {\r\n 'aria-hidden': true,\r\n xmlns: 'http://www.w3.org/2000/svg',\r\n class: 'outline-icon__svg',\r\n width: 200,\r\n height: 200,\r\n style: cssRules\r\n })\r\n\r\n return $icon\r\n}\r\n\r\nexport default createElement\r\n","import isString from './isString'\r\n\r\nconst isSVG = (str) => {\r\n const declaration = '(?:<\\\\?xml[^>]*>\\\\s*)?'\r\n const doctype =\r\n '(?:<\\\\!doctype svg[^>]*\\\\s*(?:\\\\[?(?:\\\\s*<![^>]*>\\\\s*)*\\\\]?)*[^>]*>\\\\s*)?'\r\n const content = '<svg[^>]*>[^]*<\\\\/svg>\\\\s*$'\r\n const svg = `^\\\\s*${declaration}${doctype}${content}\\\\s*$`\r\n const pattern = new RegExp(svg, 'i')\r\n\r\n return isString(str) && pattern.test(str)\r\n}\r\n\r\nexport default isSVG\r\n","import createElement from './createElement'\r\n\r\n/**\r\n * 创建 SVG 图标 DOM 元素\r\n * ========================================================================\r\n * @method icon\r\n * @alias createElement\r\n * @see createElement\r\n * @param {String} name\r\n * @param {Object} [options]\r\n * @param {Number|Array} [options.size]\r\n * @param {String} [options.color]\r\n * @param {String} [options.iconSet]\r\n * @returns {HTMLElement}\r\n */\r\nconst icon = (name, options = {}) => {\r\n return createElement(name, options)\r\n}\r\n\r\nexport default icon\r\n","import trim from '../lang/trim'\r\nimport hasClass from './hasClass'\r\n\r\n/**\r\n * 移除 DOM 节点的 className 样式\r\n * ========================================================================\r\n * @method removeClass\r\n * @param {HTMLElement} el - DOM 节点\r\n * @param {String} className - 样式名称\r\n * @returns {Boolean}\r\n */\r\nconst removeClass = (el, className) => {\r\n let allClass = el.className\r\n let classList\r\n\r\n if (!allClass || !hasClass(el, className)) {\r\n return false\r\n }\r\n\r\n classList = el.classList\r\n\r\n if (classList?.remove) {\r\n classList.remove(className)\r\n } else {\r\n allClass = trim(allClass.replace(className, ''))\r\n el.className = allClass\r\n }\r\n}\r\n\r\nexport default removeClass\r\n","import removeClass from './utils/dom/removeClass'\r\nimport isEmpty from './utils/types/isEmpty'\r\nimport trim from './utils/lang/trim'\r\n\r\nconst _removeHeading = ($heading, hasAnchor = true, isAtStart = true) => {\r\n const CLS_HEADING = 'outline-heading'\r\n const text = $heading.innerHTML\r\n const pattern = /^\\d+(\\.?\\d+)*\\s?/gi\r\n let $anchor\r\n\r\n $heading.innerHTML = text.replace(pattern, '')\r\n $heading.removeAttribute('id')\r\n $heading.removeAttribute('data-id')\r\n\r\n removeClass($heading, CLS_HEADING)\r\n\r\n if (!hasAnchor) {\r\n return false\r\n }\r\n\r\n $anchor = $heading.querySelector(`.${CLS_HEADING}__anchor`)\r\n\r\n if (isAtStart) {\r\n removeClass($heading, `${CLS_HEADING}_start`)\r\n }\r\n\r\n if (isEmpty(trim($heading.className))) {\r\n $heading.removeAttribute('class')\r\n }\r\n\r\n // 存在锚点才移除\r\n if ($anchor) {\r\n $heading.removeChild($anchor)\r\n }\r\n}\r\n\r\nexport default _removeHeading\r\n","import isString from './isString'\r\n/**\r\n * 检测数据是否为空字符串\r\n * ========================================================================\r\n * @method isEmpty\r\n * @param {String} str\r\n * @returns {boolean}\r\n */\r\nconst isEmpty = (str) => {\r\n return isString(str) && str === ''\r\n}\r\n\r\nexport default isEmpty\r\n","import isString from './utils/types/isString'\r\nimport isFunction from './utils/types/isFunction'\r\nimport isElement from './utils/types/isElement'\r\nimport cloneDeep from './utils/lang/cloneDeep'\r\nimport timeSlice from './utils/lang/timeSlice'\r\nimport later from './utils/lang/later'\r\nimport scrollTo from './utils/dom/scrollTo'\r\nimport _getScrollElement from './utils/dom/_getScrollElement'\r\nimport offsetTop from './utils/dom/offsetTop'\r\nimport on from './utils/event/on'\r\nimport off from './utils/event/off'\r\nimport stop from './utils/event/stop'\r\nimport paint from './utils/icons/paint'\r\n\r\nimport _updateHeading from './_updateHeading'\r\nimport _removeHeading from './_removeHeading'\r\nimport getChapters from './getChapters'\r\n\r\nimport Base from './base'\r\n\r\nclass Anchors extends Base {\r\n constructor(options) {\r\n super()\r\n\r\n this._default()\r\n\r\n if (options) {\r\n this.initialize(options)\r\n }\r\n }\r\n\r\n _default() {\r\n this.attrs = cloneDeep(Anchors.DEFAULTS)\r\n\r\n this.$articleElement = null\r\n this.$scrollElement = null\r\n this.$headings = []\r\n\r\n return this\r\n }\r\n\r\n initialize(options) {\r\n let created\r\n let scrollElement\r\n let $articleElement\r\n let articleElement\r\n\r\n this.attr(options)\r\n\r\n articleElement = this.attr('articleElement')\r\n scrollElement = this.attr('scrollElement')\r\n created = this.attr('created')\r\n\r\n if (isString(articleElement)) {\r\n $articleElement = document.querySelector(articleElement)\r\n } else if (isElement(articleElement)) {\r\n $articleElement = articleElement\r\n }\r\n\r\n if (!$articleElement) {\r\n return this\r\n }\r\n\r\n this.$articleElement = $articleElement\r\n this.$scrollElement = _getScrollElement(scrollElement)\r\n this.$headings = this.getHeadings()\r\n\r\n if (this.$headings.length < 1) {\r\n return this\r\n }\r\n\r\n if (isFunction(created)) {\r\n created.call(this)\r\n }\r\n\r\n this.render().addListeners()\r\n\r\n return this\r\n }\r\n\r\n getHeadings() {\r\n const $articleElement = this.$articleElement\r\n const selector = this.attr('selector')\r\n\r\n return [...$articleElement.querySelectorAll(selector)]\r\n }\r\n\r\n count() {\r\n return this.getHeadings().length\r\n }\r\n\r\n render() {\r\n const articleElement = this.attr('articleElement')\r\n const selector = this.attr('selector')\r\n const showCode = this.attr('showCode') || true\r\n const chapterTextFilter = this.attr('chapterTextFilter')\r\n const mounted = this.attr('mounted')\r\n const chapters = getChapters({\r\n articleElement,\r\n selector,\r\n showCode,\r\n chapterTextFilter\r\n })\r\n\r\n paint()\r\n\r\n this._paint(chapters)\r\n\r\n if (isFunction(mounted)) {\r\n mounted.call(this)\r\n }\r\n\r\n return this\r\n }\r\n\r\n erase() {\r\n this._remove()\r\n\r\n return this\r\n }\r\n\r\n _paint(chapters) {\r\n const LIMIT = 400\r\n const hasAnchor = this.attr('hasAnchor')\r\n const isAtStart = this.attr('isAtStart')\r\n const showCode = this.attr('showCode')\r\n const anchorURL = this.attr('anchorURL')\r\n const count = this.count()\r\n const $headings = [...this.$headings]\r\n const update = (headings, group) => {\r\n headings.forEach(($heading, i) => {\r\n const id = i + group * LIMIT\r\n const chapterCode = chapters[id].code\r\n _updateHeading($heading, id, {\r\n hasAnchor,\r\n isAtStart,\r\n showCode,\r\n chapterCode,\r\n anchorURL\r\n })\r\n })\r\n }\r\n let groupIndex = -1\r\n\r\n // 针对超长的文章进行 timeSlice 处理\r\n if (count > LIMIT) {\r\n groupIndex += 1\r\n // 同步绘制 Limit 以内的标题链接(可以确保 50ms 完成绘制)\r\n update($headings.splice(0, LIMIT), 0)\r\n // 采用 timeSlice 处理机制绘制剩余的标题\r\n while ($headings.length > 0) {\r\n const once = $headings.splice(0, LIMIT)\r\n timeSlice(\r\n () => {\r\n update(once, (groupIndex += 1))\r\n },\r\n () => {\r\n this.$emit('anchors:all:paint')\r\n }\r\n )\r\n }\r\n } else {\r\n update($headings, 0)\r\n }\r\n\r\n return this\r\n }\r\n\r\n _remove() {\r\n const hasAnchor = this.attr('hasAnchor')\r\n const isAtStart = this.attr('isAtStart')\r\n const $headings = this.$headings\r\n\r\n $headings.forEach(($heading) => {\r\n _removeHeading($heading, hasAnchor, isAtStart)\r\n })\r\n\r\n return this\r\n }\r\n\r\n refresh(chapters) {\r\n const articleElement = this.attr('articleElement')\r\n const selector = this.attr('selector')\r\n const showCode = this.attr('showCode') || true\r\n const chapterTextFilter = this.attr('chapterTextFilter')\r\n\r\n this.$headings = this.getHeadings()\r\n\r\n this.erase()._paint(\r\n chapters ||\r\n getChapters({\r\n articleElement,\r\n selector,\r\n showCode,\r\n chapterTextFilter\r\n })\r\n )\r\n\r\n return this\r\n }\r\n\r\n scrollTo(top, after) {\r\n const el = this.$scrollElement\r\n\r\n scrollTo(el, top, after)\r\n\r\n return this\r\n }\r\n\r\n destroy() {\r\n const beforeDestroy = this.attr('beforeDestroy')\r\n const afterDestroy = this.attr('afterDestroy')\r\n\r\n if (isFunction(beforeDestroy)) {\r\n beforeDestroy.call(this)\r\n }\r\n\r\n this.removeListeners()._remove()._default()\r\n\r\n if (isFunction(afterDestroy)) {\r\n afterDestroy.call(this)\r\n }\r\n\r\n return this\r\n }\r\n\r\n onAnchorTrigger(evt) {\r\n const anchorURL = this.attr('anchorURL')\r\n const afterScroll = this.attr('afterScroll')\r\n const stickyHeight = this.attr('stickyHeight')\r\n const $anchor = evt.delegateTarget\r\n const $heading = $anchor.parentNode\r\n const top = offsetTop($heading) - (stickyHeight + 10)\r\n const $scrollElement = this.$scrollElement\r\n const min = 0\r\n const max = $scrollElement.scrollHeight - $scrollElement.clientHeight\r\n const after = () => {\r\n if (isFunction(afterScroll)) {\r\n afterScroll.call(this, 'anchor')\r\n }\r\n\r\n later(() => {\r\n this.$emit('toolbar:update', {\r\n top,\r\n min,\r\n max\r\n })\r\n })\r\n }\r\n\r\n this.scrollTo(top, after)\r\n\r\n if (!anchorURL) {\r\n stop(evt)\r\n }\r\n\r\n return this\r\n }\r\n\r\n addListeners() {\r\n const $articleElement = this.$articleElement\r\n\r\n if (this.count() < 1) {\r\n return this\r\n }\r\n\r\n on(\r\n $articleElement,\r\n '.outline-heading__anchor',\r\n 'click',\r\n this.onAnchorTrigger,\r\n this,\r\n true\r\n )\r\n\r\n return this\r\n }\r\n\r\n removeListeners() {\r\n const $articleElement = this.$articleElement\r\n\r\n if (this.count() < 1) {\r\n return this\r\n }\r\n\r\n off($articleElement, 'click', this.onAnchorTrigger)\r\n\r\n return this\r\n }\r\n}\r\n\r\nAnchors.DEFAULTS = (() => {\r\n const OPTIONS = {\r\n scrollElement: 'html,body',\r\n articleElement: '#article',\r\n selector: 'h1,h2,h3,h4,h5,h6',\r\n stickyHeight: 0,\r\n anchorURL: '',\r\n hasAnchor: true,\r\n isAtStart: true,\r\n showCode: false,\r\n created: null,\r\n mounted: null,\r\n afterScroll: null,\r\n beforeDestroy: null,\r\n afterDestroy: null,\r\n chapterTextFilter: null\r\n }\r\n\r\n return cloneDeep(OPTIONS)\r\n})()\r\n\r\nexport default Anchors\r\n","import trim from './utils/lang/trim'\r\nimport createElement from './utils/dom/createElement'\r\nimport setAttributes from './utils/dom/setAttributes'\r\n\r\nimport icon from './utils/icons/icon'\r\n\r\nconst _updateHeading = ($heading, i, options) => {\r\n const CLS_HEADING = 'outline-heading'\r\n const hasAnchor = options.hasAnchor || true\r\n const isAtStart = options.isAtStart || true\r\n const showCode = options.showCode || false\r\n const chapterCode = options.chapterCode || ''\r\n const anchorURL = options.anchorURL || ''\r\n const headingId = `heading-${i}`\r\n const attrs = {\r\n id: headingId,\r\n className: isAtStart ? `${CLS_HEADING} ${CLS_HEADING}_start` : CLS_HEADING,\r\n 'data-id': i\r\n }\r\n const text = trim($heading.innerHTML)\r\n let $anchor\r\n let $icon\r\n\r\n if (showCode) {\r\n attrs.innerHTML = chapterCode + ' ' + text\r\n attrs['data-code'] = chapterCode\r\n }\r\n setAttributes($heading, attrs)\r\n\r\n if (!hasAnchor) {\r\n return false\r\n }\r\n\r\n $icon = icon('hash', { iconSet: 'outline' })\r\n $anchor = createElement(\r\n 'a',\r\n {\r\n id: `anchor-${i}`,\r\n className: `${CLS_HEADING}__anchor anchor-${i}`,\r\n href: anchorURL || `#${headingId}`,\r\n target: anchorURL ? '_blank' : 'self',\r\n 'data-id': i\r\n },\r\n $icon\r\n )\r\n $heading.appendChild($anchor)\r\n}\r\n\r\nexport default _updateHeading\r\n","// HTML 合法的标签\r\nconst TAGS = [\r\n 'a',\r\n 'abbr',\r\n 'address',\r\n 'area',\r\n 'article',\r\n 'aside',\r\n 'audio',\r\n 'b',\r\n 'base',\r\n 'bdi',\r\n 'bdo',\r\n 'blockquote',\r\n 'body',\r\n 'br',\r\n 'button',\r\n 'canvas',\r\n 'caption',\r\n 'cite',\r\n 'code',\r\n 'col',\r\n 'colgroup',\r\n 'data',\r\n 'datalist',\r\n 'dd',\r\n 'del',\r\n 'details',\r\n 'dfn',\r\n 'dialog',\r\n 'div',\r\n 'dl',\r\n 'dt',\r\n 'em',\r\n 'embed',\r\n 'fieldset',\r\n 'figcaption',\r\n 'figure',\r\n 'footer',\r\n 'form',\r\n 'h1',\r\n 'h2',\r\n 'h3',\r\n 'h4',\r\n 'h5',\r\n 'h6',\r\n 'head',\r\n 'header',\r\n 'hgroup',\r\n 'hr',\r\n 'html',\r\n 'i',\r\n 'iframe',\r\n 'img',\r\n 'input',\r\n 'ins',\r\n 'kbd',\r\n 'label',\r\n 'legend',\r\n 'li',\r\n 'link',\r\n 'main',\r\n 'map',\r\n 'mark',\r\n 'math',\r\n 'menu',\r\n 'menuitem',\r\n 'meta',\r\n 'meter',\r\n 'nav',\r\n 'noscript',\r\n 'object',\r\n 'ol',\r\n 'optgroup',\r\n 'option',\r\n 'output',\r\n 'p',\r\n 'param',\r\n 'picture',\r\n 'pre',\r\n 'progress',\r\n 'q',\r\n 'rb',\r\n 'rp',\r\n 'rt',\r\n 'rtc',\r\n 'ruby',\r\n 's',\r\n 'samp',\r\n 'script',\r\n 'search',\r\n 'section',\r\n 'select',\r\n 'slot',\r\n 'small',\r\n 'source',\r\n 'span',\r\n 'strong',\r\n 'style',\r\n 'sub',\r\n 'summary',\r\n 'sup',\r\n 'svg',\r\n 'table',\r\n 'tbody',\r\n 'td',\r\n 'template',\r\n 'textarea',\r\n 'tfoot',\r\n 'th',\r\n 'thead',\r\n 'time',\r\n 'title',\r\n 'tr',\r\n 'track',\r\n 'u',\r\n 'ul',\r\n 'var',\r\n 'video',\r\n 'wbr'\r\n]\r\n\r\nexport default TAGS\r\n","import isString from './isString'\r\nimport trim from '../lang/trim'\r\nimport TAGS from './tags'\r\n\r\n/**\r\n * 检测测试数据是否为合法的 HTML 代码\r\n * ========================================================================\r\n * @method isHTML\r\n * @category Lang\r\n * @see https://github.com/sindresorhus/html-tags\r\n * @see https://github.com/sindresorhus/is-html\r\n * @param {String} str - 要检测的数据\r\n * @returns {Boolean} 'val' 为合法的 HTML 代码,返回 true,否则返回 false\r\n */\r\nconst isHTML = (str) => {\r\n let html\r\n let basic\r\n let full\r\n\r\n if (!isString(str)) {\r\n return false\r\n }\r\n\r\n // 为了提高性能,我们将其限制在合理的长度内。\r\n html = trim(str).slice(0, 1000)\r\n basic = /\\s*<!doctype html>|<html\\b[^>]*>|<body\\b[^>]*>|<x-[^>]+>/i\r\n full = new RegExp(TAGS.map((tag) => `<${tag}\\\\b[^>]*>`).join('|'), 'i')\r\n\r\n return basic.test(html) || full.test(html)\r\n}\r\n\r\nexport default isHTML\r\n","/**\r\n * 移除字符串中的 JavaScript 代码\r\n * ====================================================\r\n * @param {String} str\r\n * @returns {String}\r\n */\r\nconst stripScripts = (str) => {\r\n return str.replace(/<script[^>]*>.*?<\\/script>/gi, '')\r\n}\r\n\r\nexport default stripScripts\r\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'\r\n\r\nlet index = 2000\r\n\r\nconst zIndex = (idx) => {\r\n if (idx) {\r\n index = idx\r\n } else {\r\n index += 1\r\n }\r\n\r\n setProperty('--outline-zIndex', `${index}`)\r\n\r\n return index\r\n}\r\n\r\nexport default zIndex\r\n","import Base from './base'\r\n\r\nimport later from './utils/lang/later'\r\nimport cloneDeep from './utils/lang/cloneDeep'\r\nimport isFunction from './utils/types/isFunction'\r\nimport isDOM from './utils/types/isDOM'\r\nimport isHTML from './utils/types/isHTML'\r\nimport addClass from './utils/dom/addClass'\r\nimport removeClass from './utils/dom/removeClass'\r\nimport html from './utils/dom/html'\r\nimport createElement from './utils/dom/createElement'\r\nimport on from './utils/event/on'\r\nimport off from './utils/event/off'\r\n\r\nimport paint from './utils/icons/paint'\r\nimport icon from './utils/icons/icon'\r\nimport zIndex from './zIndex'\r\n\r\nclass Drawer extends Base {\r\n constructor(options) {\r\n super()\r\n\r\n this._default()\r\n\r\n this.zIndex = 0\r\n\r\n if (options) {\r\n this.initialize(options)\r\n }\r\n }\r\n\r\n _default() {\r\n this.attrs = cloneDeep(Drawer.DEFAULTS)\r\n this.title = ''\r\n this.closed = false\r\n\r\n this.$el = null\r\n this.$modal = null\r\n this.$header = null\r\n this.$title = null\r\n this.$close = null\r\n this.$main = null\r\n this.$footer = null\r\n this.$overlay = null\r\n\r\n return this\r\n }\r\n\r\n initialize(options) {\r\n let created\r\n\r\n this.attr(options)\r\n\r\n this.title = this.attr('title')\r\n created = this.attr('created')\r\n\r\n if (isFunction(created)) {\r\n created.call(this)\r\n }\r\n\r\n this.render().addListeners()\r\n return this\r\n }\r\n\r\n setTitle(title) {\r\n this.attr('title', title)\r\n this.title = title\r\n this.$title.innerHTML = title\r\n\r\n return this\r\n }\r\n\r\n isClosed() {\r\n return this.closed\r\n }\r\n\r\n render() {\r\n const mounted = this.attr('mounted')\r\n const size = this.attr('size')\r\n const placement = this.attr('placement')\r\n const hasClose = this.attr('hasClose')\r\n const hasOverlay = this.attr('hasOverlay')\r\n const hasOffset = this.attr('hasOffset')\r\n const hasPadding = this.attr('hasPadding')\r\n const autoHeight = this.attr('autoHeight')\r\n const overflow = this.attr('overflow')\r\n const customClass = this.attr('customClass')\r\n let mainClassName = 'outline-drawer__main'\r\n let $el\r\n let $modal\r\n let $header\r\n let $title\r\n let $close\r\n let $main\r\n let $footer\r\n let $overlay\r\n\r\n paint()\r\n this.zIndex = zIndex()\r\n\r\n $title = createElement(\r\n 'h2',\r\n {\r\n className: 'outline-drawer__title'\r\n },\r\n this.title\r\n )\r\n this.$title = $title\r\n\r\n if (hasClose) {\r\n $close = createElement(\r\n 'div',\r\n {\r\n className: 'outline-drawer__close'\r\n },\r\n icon('close', { iconSet: 'outline', size: 20 })\r\n )\r\n this.$close = $close\r\n }\r\n\r\n $header = createElement(\r\n 'header',\r\n {\r\n className: 'outline-drawer__header'\r\n },\r\n [$title, $close]\r\n )\r\n this.$header = $header\r\n\r\n if (overflow === 'hidden') {\r\n mainClassName += ' overflow-hidden'\r\n }\r\n\r\n $main = createElement('div', {\r\n className: mainClassName\r\n })\r\n this.$main = $main\r\n\r\n if (!hasPadding) {\r\n addClass($main, 'outline-drawer_full')\r\n }\r\n\r\n $footer = createElement('footer', {\r\n className: 'outline-drawer__footer'\r\n })\r\n this.$footer = $footer\r\n\r\n $modal = createElement(\r\n 'div',\r\n {\r\n className: `outline-drawer__modal outline-drawer_${placement} outline-drawer_${size} outline-drawer_closed`\r\n },\r\n [$header, $main, $footer]\r\n )\r\n this.$modal = $modal\r\n\r\n if (hasOffset) {\r\n addClass($modal, 'outline-drawer_offset')\r\n }\r\n\r\n if (autoHeight) {\r\n addClass($modal, 'outline-drawer_auto')\r\n }\r\n\r\n if (customClass) {\r\n addClass($modal, customClass)\r\n }\r\n\r\n if (hasOverlay) {\r\n $overlay = createElement('div', {\r\n className: 'outline-drawer__overlay'\r\n })\r\n this.$overlay = $overlay\r\n }\r\n\r\n $el = createElement(\r\n 'div',\r\n {\r\n className: `outline-drawer`\r\n },\r\n [$modal, $overlay]\r\n )\r\n this.$el = $el\r\n document.body.appendChild($el)\r\n\r\n if (isFunction(mounted)) {\r\n mounted.call(this)\r\n }\r\n\r\n return this\r\n }\r\n\r\n erase() {\r\n this.$main.innerHTML = ''\r\n return this\r\n }\r\n\r\n _paint(content) {\r\n let $content = null\r\n\r\n if (isFunction(content)) {\r\n $content = content()\r\n } else if (isDOM(content)) {\r\n $content = content\r\n } else if (isHTML(content)) {\r\n $content = html(content)\r\n }\r\n\r\n if ($content) {\r\n this.$main.appendChild($content)\r\n }\r\n\r\n return this\r\n }\r\n\r\n _remove() {\r\n document.body.removeChild(this.$el)\r\n return this\r\n }\r\n\r\n refresh(content) {\r\n this.erase()._paint(content)\r\n return this\r\n }\r\n\r\n open() {\r\n const opened = this.attr('afterOpened')\r\n const $modal = this.$modal\r\n\r\n addClass(this.$el, 'outline-drawer_opened')\r\n removeClass($modal, 'outline-drawer_closed')\r\n addClass($modal, 'outline-drawer_opened')\r\n\r\n later(() => {\r\n this.closed = false\r\n\r\n if (isFunction(opened)) {\r\n opened.call(this)\r\n }\r\n })\r\n\r\n return this\r\n }\r\n\r\n close() {\r\n const closed = this.attr('afterClosed')\r\n const $modal = this.$modal\r\n\r\n removeClass($modal, 'outline-drawer_opened')\r\n addClass($modal, 'outline-drawer_closed')\r\n\r\n later(() => {\r\n removeClass(this.$el, 'outline-drawer_opened')\r\n this.closed = true\r\n\r\n if (isFunction(closed)) {\r\n closed.call(this)\r\n }\r\n })\r\n\r\n return this\r\n }\r\n\r\n toggle() {\r\n const afterToggle = this.attr('afterToggle')\r\n const closed = this.isClosed()\r\n\r\n if (closed) {\r\n this.open()\r\n } else {\r\n this.close()\r\n }\r\n\r\n if (isFunction(afterToggle)) {\r\n later(() => {\r\n afterToggle.call(this, closed)\r\n })\r\n }\r\n\r\n return this\r\n }\r\n\r\n destroy() {\r\n const afterDestroy = this.attr('afterDestroy')\r\n const beforeDestroy = this.attr('beforeDestroy')\r\n let index = this.zIndex\r\n\r\n if (isFunction(beforeDestroy)) {\r\n beforeDestroy.call(this)\r\n }\r\n\r\n this.removeListeners()._remove()._default()\r\n\r\n index -= 1\r\n zIndex(index)\r\n this.zIndex = 0\r\n\r\n if (isFunction(afterDestroy)) {\r\n afterDestroy.call(this)\r\n }\r\n\r\n return this\r\n }\r\n\r\n onClose() {\r\n this.close()\r\n return this\r\n }\r\n\r\n addListeners() {\r\n const hasClose = this.attr('hasClose')\r\n const hasOverlay = this.attr('hasOverlay')\r\n const closeOnClickModal = this.attr('closeOnClickModal')\r\n const $el = this.$el\r\n\r\n if (hasClose) {\r\n on($el, '.outline-drawer__close', 'click', this.onClose, this, true)\r\n }\r\n\r\n if (hasOverlay && closeOnClickModal) {\r\n on($el, '.outline-drawer__overlay', 'click', this.onClose, this, true)\r\n }\r\n\r\n return this\r\n }\r\n\r\n removeListeners() {\r\n const hasClose = this.attr('hasClose')\r\n const hasOverlay = this.attr('hasOverlay')\r\n const $el = this.$el\r\n\r\n if (!hasClose && !hasOverlay) {\r\n return this\r\n }\r\n\r\n off($el, 'click', this.onClose)\r\n\r\n return this\r\n }\r\n}\r\n\r\nDrawer.DEFAULTS = (() => {\r\n const OPTIONS = {\r\n placement: 'rtl',\r\n title: '标题',\r\n size: 'regular',\r\n hasClose: true,\r\n hasOverlay: true,\r\n hasOffset: false,\r\n hasPadding: true,\r\n autoHeight: true,\r\n closeOnClickModal: true,\r\n overflow: 'auto',\r\n created: null,\r\n mounted: null,\r\n afterClosed: null,\r\n afterOpened: null,\r\n afterScroll: null,\r\n beforeDestroy: null,\r\n afterDestroy: null,\r\n afterToggle: null\r\n }\r\n\r\n return cloneDeep(OPTIONS)\r\n})()\r\n\r\nexport default Drawer\r\n","import isHTML from '../types/isHTML'\r\nimport isString from '../types/isString'\r\nimport isElement from '../types/isElement'\r\nimport stripScripts from '../lang/stripScripts'\r\nimport createElement from './createElement'\r\n\r\n/**\r\n * 获取或者设置 DOM 元素的 innerHTML 属性值,或者通过 HTML 字符串,创建 DOM 元素\r\n * ========================================================================\r\n * @method html\r\n * @param {HTMLElement|String} el\r\n * @param {String} [strHTML]\r\n * @return {DocumentFragment|null|*}\r\n */\r\nconst html = (el, strHTML) => {\r\n const $fragment = document.createDocumentFragment()\r\n\r\n if (!el || (!isHTML(el) && !isString(el) && !isElement(el))) {\r\n return null\r\n }\r\n\r\n if (isHTML(el)) {\r\n const template = createElement('div')\r\n let children = []\r\n\r\n template.innerHTML = stripScripts(el)\r\n children = [...template.childNodes]\r\n children.forEach((child) => {\r\n $fragment.appendChild(child)\r\n })\r\n\r\n return $fragment\r\n } else if (isString(strHTML)) {\r\n el.innerHTML = stripScripts(strHTML)\r\n } else {\r\n return el.innerHTML\r\n }\r\n}\r\n\r\nexport default html\r\n","import isFunction from '../types/isFunction'\r\nimport off from './off'\r\n\r\nimport { CAPTURE_EVENTS } from './enum'\r\n\r\n/**\r\n * 绑定事件\r\n * ========================================================================\r\n * @method at\r\n * @param {HTMLElement|String|Object} el - (必须)绑定代理事件的 DOM 节点\r\n * @param {String|Function} type - (必须)事件类型或者事件处理器回调函数\r\n * @param {Function|Object} fn - (必须) 事件处理器回调函数或者传递给事件处理器回调函数的数据对象\r\n * @param {Object|Boolean} [data] - (可选)传递给事件处理器回调函数的数据对象或者事件处理器回调函数的 this 上下文指向,\r\n * @param {Object|Boolean} [context] - (可选)事件处理器回调函数的 this 上下文指向,或者是否仅触发一次\r\n * 当设置为 true 时,则事件处理器回调函数的 this 上下文指向为 data 对象\r\n * @param {Boolean} once - (可选)是否仅触发一次\r\n */\r\nconst at = (el, type, fn, data, context, once = false) => {\r\n // CAPTURE_EVENTS 中的特殊事件,采用事件捕获模型\r\n const capture = CAPTURE_EVENTS.indexOf(type) > -1\r\n const listener = function (evt) {\r\n let overrideContext = context || el\r\n\r\n // 当设置为 true 时,则事件处理器回调函数的\r\n // this 上下文指向为 data 对象\r\n if (context === true) {\r\n overrideContext = data\r\n }\r\n\r\n // 仅触发一次\r\n /* istanbul ignore else */\r\n if (once === true) {\r\n off(el, type, listener)\r\n }\r\n\r\n fn.call(overrideContext, evt, data)\r\n }\r\n\r\n if (!isFunction(fn)) {\r\n return false\r\n }\r\n\r\n if (!el._listeners) {\r\n el._listeners = []\r\n }\r\n\r\n // 缓存 options 元素绑定的事件处理器\r\n el._listeners.push({\r\n el,\r\n type,\r\n fn: listener,\r\n data,\r\n context,\r\n capture\r\n })\r\n\r\n // 缓存包装后的事件处理器\r\n fn._delegateListener = listener\r\n\r\n el.addEventListener(type, listener, capture)\r\n}\r\n\r\nexport default at\r\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 isString from './utils/types/isString'\r\nimport isFunction from './utils/types/isFunction'\r\nimport isElement from './utils/types/isElement'\r\nimport later from './utils/lang/later'\r\nimport at from './utils/event/at'\r\nimport on from './utils/event/on'\r\nimport off from './utils/event/off'\r\nimport stop from './utils/event/stop'\r\nimport createElement from './utils/dom/createElement'\r\nimport scrollTo from './utils/dom/scrollTo'\r\nimport addClass from './utils/dom/addClass'\r\nimport intersection from './utils/dom/intersection'\r\nimport removeClass from './utils/dom/removeClass'\r\nimport offsetTop from './utils/dom/offsetTop'\r\nimport getStyle from './utils/dom/getStyle'\r\nimport setProperty from './utils/dom/setProperty'\r\nimport _getScrollElement from './utils/dom/_getScrollElement'\r\nimport cloneDeep from './utils/lang/cloneDeep'\r\n\r\nimport _paintChapters from './_paintChapters'\r\nimport inBounding from './utils/dom/inBounding'\r\n\r\nimport Base from './base'\r\n\r\nclass Navigator extends Base {\r\n constructor(options) {\r\n super()\r\n\r\n this._default()\r\n\r\n this.scrollTimer = null\r\n this.resizeTimer = null\r\n this.observerTimer = null\r\n this.Observer = null\r\n\r\n if (options) {\r\n this.initialize(options)\r\n }\r\n }\r\n\r\n _default() {\r\n this.attrs = cloneDeep(Navigator.DEFAULTS)\r\n\r\n this.$el = null\r\n this.$title = null\r\n this.$main = null\r\n this.$list = null\r\n this.$placeholder = null\r\n this.$parentElement = null\r\n this.$scrollElement = null\r\n this.$active = null\r\n\r\n this.chapters = []\r\n this.active = 0\r\n this.offsetWidth = 0\r\n this.offsetTop = 0\r\n this.playing = false\r\n this.closed = false\r\n\r\n return this\r\n }\r\n\r\n initialize(options) {\r\n let created\r\n let parentElement\r\n let scrollElement\r\n let $parent\r\n\r\n this.attr(options)\r\n\r\n created = this.attr('created')\r\n parentElement = this.attr('parentElement')\r\n scrollElement = this.attr('scrollElement')\r\n\r\n if (isString(parentElement)) {\r\n $parent = document.querySelector(parentElement)\r\n } else if (isElement(parentElement)) {\r\n $parent = parentElement\r\n }\r\n this.$parentElement = $parent\r\n this.$scrollElement = _getScrollElement(scrollElement)\r\n\r\n this.chapters = this.attr('chapters')\r\n this.closed = this.attr('closed')\r\n this.active = this.attr('active')\r\n\r\n if (isFunction(created)) {\r\n created.call(this)\r\n }\r\n\r\n if (this.chapters.length < 1) {\r\n return this\r\n }\r\n\r\n this.render().addListeners()\r\n\r\n this.$active = document.querySelector(`#chapter-${this.active}`)\r\n\r\n return this\r\n }\r\n\r\n isClosed() {\r\n return this.closed\r\n }\r\n\r\n isSticky() {\r\n const position = this.attr('position')\r\n return position === 'sticky'\r\n }\r\n\r\n isFixed() {\r\n const position = this.attr('position')\r\n return position === 'fixed'\r\n }\r\n\r\n isInside() {\r\n return this.isFixed() || this.isSticky()\r\n }\r\n\r\n isOutside() {\r\n return !this.isInside()\r\n }\r\n\r\n count() {\r\n return this.chapters.length\r\n }\r\n\r\n _paintEdge() {\r\n const $fragment = document.createDocumentFragment()\r\n const STICKY = 'outline-navigator_sticky'\r\n const HIDDEN = 'outline-navigator_hidden'\r\n const title = this.attr('title')\r\n const animationCurrent = this.attr('animationCurrent')\r\n const customClass = this.attr('customClass')\r\n const $parentElement = this.$parentElement\r\n const children = []\r\n const contents = []\r\n let $title = null\r\n let $el\r\n let $main\r\n let $list\r\n let $placeholder\r\n\r\n if (!$parentElement) {\r\n return this\r\n }\r\n\r\n if (this.isInside() && title) {\r\n $title = createElement(\r\n 'h2',\r\n {\r\n className: 'outline-navigator__title'\r\n },\r\n title\r\n )\r\n this.$title = $title\r\n contents.push($title)\r\n }\r\n\r\n $list = createElement('ul', {\r\n // 为优化性能,添加了 _fixed 和 _hidden\r\n // fixed 为了让 $list 脱离流布局\r\n // hidden 让 $list 不可见\r\n className: `outline-navigator__list`\r\n })\r\n this.$list = $list\r\n children.push($list)\r\n\r\n if (animationCurrent) {\r\n $placeholder = createElement('div', {\r\n className: 'outline-navigator__placeholder'\r\n })\r\n this.$placeholder = $placeholder\r\n children.push($placeholder)\r\n }\r\n\r\n $main = createElement(\r\n 'div',\r\n {\r\n className: 'outline-navigator__main'\r\n },\r\n children\r\n )\r\n this.$main = $main\r\n contents.push($main)\r\n\r\n $el = createElement(\r\n 'nav',\r\n {\r\n id: 'outline-navigator',\r\n className: `outline-navigator ${HIDDEN}`\r\n },\r\n contents\r\n )\r\n this.$el = $el\r\n\r\n if (this.isSticky()) {\r\n this.calculateStickyHeight()\r\n addClass($el, STICKY)\r\n }\r\n\r\n if (customClass) {\r\n addClass($el, customClass)\r\n }\r\n $fragment.appendChild($el)\r\n $parentElement.appendChild($fragment)\r\n\r\n return this\r\n }\r\n\r\n render() {\r\n const mounted = this.attr('mounted')\r\n const $parentElement = this.$parentElement\r\n const chapters = this.chapters\r\n const count = this.count()\r\n let $el\r\n\r\n if (!$parentElement || chapters.length < 1) {\r\n return this\r\n }\r\n\r\n if (this.isInside()) {\r\n addClass($parentElement, 'outline-navigator-parent')\r\n }\r\n\r\n this._paintEdge()\r\n $el = this.$el\r\n\r\n this._paint(chapters)\r\n\r\n later(() => {\r\n this.highlight(this.active)\r\n }, 60)\r\n\r\n this.offsetTop = offsetTop($el)\r\n this.offsetWidth = $el.offsetWidth\r\n\r\n if (this.isFixed()) {\r\n this.sticky()\r\n setProperty('--outline-navigator-width', `${this.offsetWidth}px`)\r\n }\r\n\r\n if (isFunction(mounted)) {\r\n mounted.call(this)\r\n }\r\n\r\n if (count < 400) {\r\n this.onObserver()\r\n }\r\n\r\n return this\r\n }\r\n\r\n erase() {\r\n this.$list.innerHTML = ''\r\n\r\n return this\r\n }\r\n\r\n _paint(chapters) {\r\n const HIDDEN = 'outline-navigator_hidden'\r\n const showCode = this.attr('showCode')\r\n const $el = this.$el\r\n const $list = this.$list\r\n\r\n _paintChapters($list, chapters, showCode)\r\n removeClass($el, HIDDEN)\r\n\r\n return this\r\n }\r\n\r\n _remove() {\r\n this.$parentElement.removeChild(this.$el)\r\n return this\r\n }\r\n\r\n refresh(chapters) {\r\n const HIDDEN = 'outline-navigator_hidden'\r\n const $el = this.$el\r\n\r\n removeClass($el, HIDDEN)\r\n this.erase()._paint(chapters)\r\n\r\n return this\r\n }\r\n\r\n _getPlaceholderOffset(index) {\r\n const $main = this.$main\r\n const $list = this.$list\r\n const $anchor = $list.querySelector('.outline-navigator__anchor')\r\n const mainPaddingTop = parseInt(getStyle($main, 'padding-top'), 10)\r\n const mainBorderTop = parseInt(getStyle($main, 'border-top-width'), 10)\r\n const placeholderPaddingTop = parseInt(getStyle($list, 'padding-top'), 10)\r\n const placeholderMarginTop = parseInt(getStyle($list, 'margin-top'), 10)\r\n const placeholderBorderTop = parseInt(\r\n getStyle($list, 'border-top-width'),\r\n 10\r\n )\r\n let height = $anchor.offsetHeight\r\n let offsetTop = 0\r\n let top\r\n\r\n if (mainPaddingTop) {\r\n offsetTop += mainPaddingTop\r\n }\r\n\r\n if (placeholderPaddingTop) {\r\n offsetTop += placeholderPaddingTop\r\n }\r\n\r\n if (placeholderMarginTop) {\r\n offsetTop += placeholderMarginTop\r\n }\r\n\r\n if (mainBorderTop) {\r\n offsetTop += mainBorderTop\r\n }\r\n\r\n if (placeholderBorderTop) {\r\n offsetTop += placeholderBorderTop\r\n }\r\n\r\n top = height * index\r\n\r\n return offsetTop + top\r\n }\r\n\r\n positionPlaceholder(index) {\r\n const $list = this.$list\r\n const $placeholder = this.$placeholder\r\n const $anchor = $list.querySelector('.outline-navigator__anchor')\r\n const animationCurrent = this.attr('animationCurrent')\r\n const height = $anchor.offsetHeight\r\n let offsetTop = 0\r\n\r\n if (!animationCurrent) {\r\n return this\r\n }\r\n\r\n offsetTop = this._getPlaceholderOffset(index)\r\n\r\n $placeholder.style.cssText = `transform: translateY(${offsetTop}px);height:${height}px;`\r\n\r\n return this\r\n }\r\n\r\n highlight(id) {\r\n const $el = this.$el\r\n const animationCurrent = this.attr('animationCurrent')\r\n const position = this.attr('position')\r\n const ACTIVE = 'outline-navigator_active'\r\n const HIGHLIGHT = 'outline-navigator_highlight'\r\n let $parent = position === 'relative' ? this.$parentElement : this.$main\r\n let $anchor = null\r\n let placeholderOffsetTop = 0\r\n\r\n if (!$el) {\r\n return this\r\n }\r\n\r\n $anchor = $el.querySelector(`#chapter__anchor-${id}`)\r\n\r\n if (!$anchor) {\r\n return this\r\n }\r\n\r\n this.active = parseInt($anchor.getAttribute('data-id'), 10)\r\n\r\n if (this.$active) {\r\n removeClass(this.$active, HIGHLIGHT)\r\n removeClass(this.$active, ACTIVE)\r\n }\r\n\r\n this.$active = $anchor\r\n addClass(this.$active, ACTIVE)\r\n\r\n if (animationCurrent) {\r\n this.positionPlaceholder(this.active)\r\n } else {\r\n addClass(this.$active, HIGHLIGHT)\r\n }\r\n\r\n later(() => {\r\n if (!inBounding(this.$active, $parent)) {\r\n placeholderOffsetTop = this._getPlaceholderOffset(this.active)\r\n scrollTo($parent, placeholderOffsetTop)\r\n }\r\n })\r\n\r\n return this\r\n }\r\n\r\n sticky() {\r\n const afterSticky = this.attr('afterSticky')\r\n const FIXED = 'outline-navigator_fixed'\r\n const $el = this.$el\r\n const top = this.offsetTop\r\n const scrollTop = this.$scrollElement.scrollTop\r\n let isStickying\r\n\r\n if (!this.isFixed()) {\r\n return this\r\n }\r\n\r\n isStickying = scrollTop >= top\r\n\r\n if (isStickying) {\r\n addClass($el, FIXED)\r\n } else {\r\n removeClass($el, FIXED)\r\n }\r\n\r\n if (isFunction(afterSticky)) {\r\n afterSticky.call(this, this.isClosed(), isStickying)\r\n }\r\n\r\n return this\r\n }\r\n\r\n calculateStickyHeight() {\r\n const documentElement = document.documentElement\r\n const height = Math.max(\r\n documentElement.clientHeight || 0,\r\n window.innerHeight || 0\r\n )\r\n setProperty('--outline-sticky-height', `${height}px`)\r\n return this\r\n }\r\n\r\n scrollTo(top, after) {\r\n const el = this.$scrollElement\r\n\r\n scrollTo(el, top, after)\r\n\r\n return this\r\n }\r\n\r\n show() {\r\n const FOLDED = 'outline-navigator_folded'\r\n const HIDDEN = 'outline-navigator_hidden'\r\n const opened = this.attr('afterOpened')\r\n const count = this.count()\r\n const $el = this.$el\r\n const $parent = this.$parentElement\r\n\r\n if (this.isInside()) {\r\n if (count > 800) {\r\n removeClass($parent, HIDDEN)\r\n } else {\r\n removeClass($parent, HIDDEN)\r\n later(() => {\r\n removeClass($parent, FOLDED)\r\n }, 30)\r\n }\r\n } else {\r\n removeClass($el, HIDDEN)\r\n }\r\n this.closed = false\r\n\r\n if (isFunction(opened)) {\r\n opened.call(this)\r\n }\r\n\r\n return this\r\n }\r\n\r\n hide() {\r\n const FOLDED = 'outline-navigator_folded'\r\n const HIDDEN = 'outline-navigator_hidden'\r\n const closed = this.attr('afterClosed')\r\n const count = this.count()\r\n const $el = this.$el\r\n const $parent = this.$parentElement\r\n\r\n if (this.isInside()) {\r\n if (count > 800) {\r\n addClass($parent, HIDDEN)\r\n } else {\r\n addClass($parent, FOLDED)\r\n later(() => {\r\n addClass($parent, HIDDEN)\r\n })\r\n }\r\n } else {\r\n addClass($el, HIDDEN)\r\n }\r\n this.closed = true\r\n\r\n if (isFunction(closed)) {\r\n closed.call(this)\r\n }\r\n\r\n return this\r\n }\r\n\r\n toggle() {\r\n const afterToggle = this.attr('afterToggle')\r\n const top = this.offsetTop\r\n const scrollTop = this.$scrollElement.scrollTop\r\n let isStickying\r\n\r\n if (this.isClosed()) {\r\n this.show()\r\n } else {\r\n this.hide()\r\n }\r\n\r\n if (isFunction(afterToggle)) {\r\n later(() => {\r\n isStickying = scrollTop >= top\r\n afterToggle.call(this, this.isClosed(), isStickying)\r\n })\r\n }\r\n\r\n return this\r\n }\r\n\r\n destroy() {\r\n const beforeDestroy = this.attr('beforeDestroy')\r\n const afterDestroy = this.attr('afterDestroy')\r\n\r\n if (isFunction(beforeDestroy)) {\r\n beforeDestroy.call(this)\r\n }\r\n\r\n this.removeListeners()._remove()._default()\r\n\r\n if (this.scrollTimer) {\r\n clearTimeout(this.scrollTimer)\r\n this.scrollTimer = null\r\n }\r\n\r\n if (this.resizeTimer) {\r\n clearTimeout(this.resizeTimer)\r\n this.resizeTimer = null\r\n }\r\n\r\n if (this.observerTimer) {\r\n clearTimeout(this.observerTimer)\r\n this.observerTimer = null\r\n }\r\n\r\n if (this.Observer) {\r\n this.Observer = null\r\n }\r\n\r\n if (isFunction(afterDestroy)) {\r\n afterDestroy.call(this)\r\n }\r\n\r\n return this\r\n }\r\n\r\n onObserver() {\r\n const selector = this.attr('selector')\r\n\r\n this.Observer = intersection(\r\n ($heading) => {\r\n const id = $heading.getAttribute('data-id')\r\n\r\n if (this.playing) {\r\n return false\r\n }\r\n\r\n if (this.observerTimer) {\r\n clearTimeout(this.observerTimer)\r\n }\r\n\r\n this.observerTimer = later(() => {\r\n this.highlight(id)\r\n }, 100)\r\n },\r\n {\r\n selector,\r\n context: this\r\n }\r\n )\r\n\r\n return this\r\n }\r\n\r\n onSelect(evt) {\r\n const stickyHeight = this.attr('stickyHeight')\r\n const $anchor = evt.delegateTarget\r\n const id = $anchor.getAttribute('data-id')\r\n const headingId = $anchor.href.split('#')[1]\r\n const $heading = document.querySelector(`#${headingId}`)\r\n const top = offsetTop($heading) - (stickyHeight + 10)\r\n const min = 0\r\n const max = this.$scrollElement.scrollHeight\r\n const afterScroll = this.attr('afterScroll')\r\n const after = () => {\r\n if (isFunction(afterScroll)) {\r\n afterScroll.call(this, 'chapter')\r\n }\r\n\r\n later(() => {\r\n this.playing = false\r\n this.$emit('toolbar:update', {\r\n top,\r\n min,\r\n max\r\n })\r\n })\r\n }\r\n\r\n this.playing = true\r\n if (this.isFixed()) {\r\n this.sticky()\r\n later(() => {\r\n this.scrollTo(top, after)\r\n this.highlight(id)\r\n }, 10)\r\n } else {\r\n this.scrollTo(top, after)\r\n this.highlight(id)\r\n }\r\n\r\n stop(evt)\r\n\r\n return this\r\n }\r\n\r\n onScroll() {\r\n const $scrollElement = this.$scrollElement\r\n\r\n if (this.scrollTimer) {\r\n clearTimeout(this.scrollTimer)\r\n }\r\n\r\n this.scrollTimer = later(() => {\r\n const top = $scrollElement.scrollTop\r\n const min = 0\r\n const max = $scrollElement.scrollHeight - $scrollElement.clientHeight\r\n\r\n if (this.isFixed()) {\r\n this.sticky()\r\n }\r\n\r\n this.$emit('toolbar:update', {\r\n top,\r\n min,\r\n max\r\n })\r\n }, 100)\r\n\r\n return this\r\n }\r\n\r\n onResize() {\r\n if (this.resizeTimer) {\r\n clearTimeout(this.resizeTimer)\r\n }\r\n\r\n this.resizeTimer = later(() => {\r\n this.calculateStickyHeight()\r\n })\r\n\r\n return this\r\n }\r\n\r\n addListeners() {\r\n const $el = this.$el\r\n const $scrollElement = this.$scrollElement\r\n const tagName = $scrollElement.tagName.toLowerCase()\r\n let $element = $scrollElement\r\n\r\n if (this.count() < 1) {\r\n return this\r\n }\r\n\r\n if (tagName === 'html' || tagName === 'body') {\r\n $element = window\r\n }\r\n\r\n on($el, '.outline-navigator__anchor', 'click', this.onSelect, this, true)\r\n at($element, 'scroll', this.onScroll, this, true)\r\n if (this.isSticky()) {\r\n at(window, 'resize', this.onResize, this, true)\r\n }\r\n this.$on('anchors:all:paint', this.onObserver, this)\r\n\r\n return this\r\n }\r\n\r\n removeListeners() {\r\n const selector = this.attr('selector')\r\n const $el = this.$el\r\n const $scrollElement = this.$scrollElement\r\n const tagName = $scrollElement.tagName.toLowerCase()\r\n let $element = $scrollElement\r\n\r\n if (this.count() < 1) {\r\n return this\r\n }\r\n\r\n if (tagName === 'html' || tagName === 'body') {\r\n $element = window\r\n }\r\n\r\n off($el, 'click', this.onSelect)\r\n off($element, 'scroll', this.onScroll)\r\n if (this.isSticky()) {\r\n off(window, 'resize', this.onResize)\r\n }\r\n this.$off('anchors:all:paint')\r\n\r\n if (this.Observer) {\r\n document.querySelectorAll(selector).forEach((section) => {\r\n this.Observer.unobserve(section)\r\n })\r\n }\r\n\r\n return this\r\n }\r\n}\r\n\r\nNavigator.DEFAULTS = (() => {\r\n const OPTIONS = {\r\n parentElement: '',\r\n scrollElement: '',\r\n selector: '.outline-heading',\r\n active: 0,\r\n closed: false,\r\n showCode: true,\r\n animationCurrent: true,\r\n position: 'relative',\r\n stickyHeight: 0,\r\n chapters: [],\r\n created: null,\r\n mounted: null,\r\n afterClosed: null,\r\n afterOpened: null,\r\n afterScroll: null,\r\n beforeDestroy: null,\r\n afterDestroy: null,\r\n afterSticky: null\r\n }\r\n\r\n return cloneDeep(OPTIONS)\r\n})()\r\n\r\nexport default Navigator\r\n","import createElement from './utils/dom/createElement'\r\nimport timeSlice from './utils/lang/timeSlice'\r\n\r\nconst _paintChapters = ($list, chapters, showCode = false) => {\r\n const LIMIT = 400\r\n const count = chapters.length\r\n const clones = [...chapters]\r\n const paint = (parts) => {\r\n const byId = (id) => $list.querySelector(`#${id}`)\r\n parts.forEach((chapter) => {\r\n const pid = chapter.pid\r\n const id = chapter.id\r\n const code = chapter.code\r\n const rel = chapter.rel\r\n const children = []\r\n const $text = createElement(\r\n 'span',\r\n {\r\n className: 'outline-navigator__text'\r\n },\r\n chapter.text\r\n )\r\n let $link\r\n let $code\r\n let $li\r\n let $subject\r\n let $chapter\r\n\r\n if (showCode) {\r\n $code = createElement(\r\n 'span',\r\n {\r\n className: 'outline-navigator__code',\r\n 'data-id': id\r\n },\r\n chapter.code\r\n )\r\n\r\n children.push($code)\r\n }\r\n\r\n children.push($text)\r\n\r\n $link = createElement(\r\n 'a',\r\n {\r\n id: `chapter__anchor-${id}`,\r\n className: 'outline-navigator__anchor',\r\n href: '#' + rel,\r\n rel: rel,\r\n 'data-id': id,\r\n 'data-code': code\r\n },\r\n children\r\n )\r\n\r\n $li = createElement(\r\n 'li',\r\n {\r\n id: `chapter-${id}`,\r\n className: 'outline-navigator__item',\r\n 'data-id': id,\r\n 'data-code': code\r\n },\r\n $link\r\n )\r\n\r\n if (pid === -1) {\r\n $list.appendChild($li)\r\n } else {\r\n $chapter = byId(`chapter-${pid}`)\r\n $subject = byId(`subject-${pid}`)\r\n\r\n if (!$subject) {\r\n $subject = createElement(\r\n 'ul',\r\n {\r\n id: 'subject-' + pid,\r\n className: 'outline-navigator__subject'\r\n },\r\n $li\r\n )\r\n\r\n $chapter.appendChild($subject)\r\n } else {\r\n $subject.appendChild($li)\r\n }\r\n }\r\n })\r\n }\r\n\r\n if (count > LIMIT) {\r\n // 同步绘制\r\n paint(clones.splice(0, LIMIT))\r\n // 剩余的采用 timeSlice 机制绘制\r\n while (clones.length > 0) {\r\n const once = clones.splice(0, LIMIT)\r\n timeSlice(() => {\r\n paint(once)\r\n })\r\n }\r\n } else {\r\n paint(clones)\r\n }\r\n}\r\n\r\nexport default _paintChapters\r\n","import isElement from '../types/isElement'\r\n\r\n/**\r\n * 检测某个 DOM 节点的位置是否在另个一个 DOM 节点范围内\r\n * ========================================================================\r\n * @method inBounding\r\n * @param {HTMLElement} child\r\n * @param {HTMLElement} parent\r\n * @return {Boolean}\r\n */\r\nconst inBounding = (child, parent) => {\r\n let isInBounding = false\r\n let parentRect\r\n let childRect\r\n\r\n if (!isElement(child) || !isElement(parent)) {\r\n return isInBounding\r\n }\r\n\r\n parentRect = parent.getBoundingClientRect()\r\n childRect = child.getBoundingClientRect()\r\n\r\n console.log('parentRect', parentRect)\r\n console.log('childRect', childRect)\r\n\r\n isInBounding = !!(\r\n childRect.top >= parentRect.top &&\r\n childRect.right <= parentRect.right &&\r\n childRect.bottom <= parentRect.bottom &&\r\n childRect.left >= parentRect.left\r\n )\r\n\r\n console.log('isInBounding', isInBounding)\r\n\r\n return isInBounding\r\n}\r\n\r\nexport default inBounding\r\n","import isFunction from '../types/isFunction'\r\nimport isElement from '../types/isElement'\r\n\r\n/**\r\n * 通用的 IntersectionObserver 观察者处理器\r\n * ========================================================================\r\n * @method intersection\r\n * @param {Function} fn\r\n * @param {Object} [props]\r\n * @param {Object|HTMLElement} [props.root]\r\n * @param {String} [props.selector]\r\n * @param {Object} [props.context]\r\n * @param {String} [props.attr]\r\n * @param {String} [props.rootMargin]\r\n */\r\nconst intersection = (fn, props = {}) => {\r\n const root = props.root || null\r\n const selector = props.selector || '.outline-heading'\r\n const context = props.context || null\r\n const rootMargin = props.rootMargin || '0px 0px -90% 0px'\r\n const options = {\r\n rootMargin: rootMargin\r\n }\r\n // eslint-disable-next-line compat/compat\r\n const Observer = new IntersectionObserver((entries) => {\r\n entries.forEach((entry) => {\r\n if (entry.intersectionRatio > 0) {\r\n if (isFunction(fn)) {\r\n fn.call(context || entry.target, entry.target)\r\n }\r\n }\r\n })\r\n }, options)\r\n const $root = isElement(root) ? root : document\r\n\r\n if (root) {\r\n options.root = root\r\n }\r\n\r\n $root.querySelectorAll(selector).forEach((section) => {\r\n Observer.observe(section)\r\n })\r\n\r\n return Observer\r\n}\r\n\r\nexport default intersection\r\n","import isObject from './isObject'\r\n\r\n/**\r\n * 检测测试数据是否为类似 Object 类型\r\n * ========================================================================\r\n * @method isObjectLike\r\n * @param {Object} val - 要检测的数据\r\n * @returns {Boolean} 'val' 是类似 Object 类型,返回 true,否则返回 false\r\n */\r\nconst isObjectLike = (val) => {\r\n return isObject(val) && val !== null\r\n}\r\n\r\nexport default isObjectLike\r\n","import isObjectLike from './isObjectLike'\r\n\r\n/**\r\n * 检测测试数据是否为普通对象\r\n * ========================================================================\r\n * @method isPlainObject\r\n * @param {Object} val - 要检测的数据\r\n * @returns {Boolean} 'val' 是普通对象,返回 true,否则返回 false\r\n */\r\nconst isPlainObject = (val) => {\r\n const getPrototypeOf = Object.getPrototypeOf\r\n let proto\r\n\r\n // Detect obvious negatives\r\n if (!isObjectLike(val)) {\r\n return false\r\n }\r\n\r\n proto = val.prototype\r\n\r\n // JavaScript 对象分为两种:普通对象和函数对象\r\n // 普通对象:原型是 __proto__,没有 prototype 原型(属性)\r\n // 函数对象:原型是 prototype ,prototype 只存在于函数对象上\r\n if (!proto) {\r\n return true\r\n }\r\n\r\n proto = val\r\n\r\n while (getPrototypeOf(proto) !== null) {\r\n proto = getPrototypeOf(proto)\r\n }\r\n\r\n return getPrototypeOf(val) === proto\r\n}\r\n\r\nexport default isPlainObject\r\n","/**\r\n * 转义字符串中的 HTML 标签\r\n *\r\n * @param {String} str - 需要转义的字符串\r\n * @returns {String}\r\n */\r\nconst encodeHTML = (str) => {\r\n const CHARTS = {\r\n '&': '&amp;',\r\n '<': '&lt;',\r\n '>': '&gt;',\r\n \"'\": '&#39;',\r\n '\"': '&quot;'\r\n }\r\n\r\n return str.replace(/[&<>'\"]/g, (tag) => {\r\n return CHARTS[tag] || tag\r\n })\r\n}\r\n\r\nexport default encodeHTML\r\n","import isString from './utils/types/isString'\r\nimport isPlainObject from './utils/types/isPlainObject'\r\nimport isFunction from './utils/types/isFunction'\r\n\r\nimport extend from './utils/lang/extend'\r\nimport later from './utils/lang/later'\r\nimport stripScripts from './utils/lang/stripScripts'\r\nimport encodeHTML from './utils/lang/encodeHTML'\r\nimport cloneDeep from './utils/lang/cloneDeep'\r\nimport guid from './utils/lang/guid'\r\n\r\nimport createElement from './utils/dom/createElement'\r\nimport addClass from './utils/dom/addClass'\r\nimport removeClass from './utils/dom/removeClass'\r\nimport setAttribute from './utils/dom/setAttribute'\r\nimport setAttributes from './utils/dom/setAttributes'\r\n\r\nimport icon from './utils/icons/icon'\r\nimport paint from './utils/icons/paint'\r\nimport on from './utils/event/on'\r\nimport off from './utils/event/off'\r\n\r\nimport Base from './base'\r\n\r\nconst TYPES = ['info', 'success', 'warning', 'error']\r\nconst instances = []\r\nlet instance\r\n\r\npaint()\r\n\r\nclass Message extends Base {\r\n constructor(options) {\r\n super()\r\n\r\n this._default()\r\n\r\n if (options) {\r\n this.initialize(options)\r\n }\r\n }\r\n\r\n _default() {\r\n this.attrs = cloneDeep(Message.DEFAULTS)\r\n\r\n this.$el = null\r\n this.id = ''\r\n this.closed = false\r\n this.visible = false\r\n this.offset = -50\r\n this.timer = null\r\n this.destroyed = false\r\n\r\n return this\r\n }\r\n\r\n initialize(options) {\r\n this.attr(options)\r\n this.id = this.attr('id')\r\n this.offset = this.attr('offset') || -50\r\n\r\n this.$emit('created', { ...this.attr() })\r\n\r\n this.render().addListeners()\r\n\r\n if (this.attr('visible')) {\r\n this.open()\r\n }\r\n\r\n return this\r\n }\r\n\r\n isClosed() {\r\n return this.closed\r\n }\r\n\r\n isDestroyed() {\r\n return this.destroyed\r\n }\r\n\r\n _getClassName() {\r\n const type = this.attr('type')\r\n const effect = this.attr('effect')\r\n const round = this.attr('round')\r\n const closable = this.attr('closable')\r\n const visible = this.attr('visible')\r\n const customClass = this.attr('customClass')\r\n const className = [\r\n 'outline-message',\r\n `outline-message_${type}`,\r\n `outline-message_${effect}`\r\n ]\r\n\r\n if (round) {\r\n className.push('outline-message_round')\r\n }\r\n\r\n if (!closable) {\r\n className.push('outline-message_full-width')\r\n }\r\n\r\n if (visible) {\r\n className.push('outline-message_visible')\r\n }\r\n\r\n if (customClass) {\r\n className.push(customClass)\r\n }\r\n\r\n return className\r\n }\r\n\r\n render() {\r\n const type = this.attr('type')\r\n const message = this.attr('message')\r\n const effect = this.attr('effect')\r\n const round = this.attr('round')\r\n const closable = this.attr('closable')\r\n const dangerouslyUseHTMLString = this.attr('dangerouslyUseHTMLString')\r\n const className = this._getClassName()\r\n const iconName = effect === 'light' ? `circle-${type}` : type\r\n const children = []\r\n let iconSize = 20\r\n let $type\r\n let $message\r\n let $text\r\n let $close\r\n let $el\r\n\r\n if (round && effect === 'default') {\r\n iconSize = 12\r\n }\r\n\r\n if (effect !== 'plain') {\r\n $type = icon(iconName, {\r\n iconSet: 'outline',\r\n size: iconSize\r\n })\r\n addClass($type, 'outline-message__icon')\r\n children.push($type)\r\n }\r\n\r\n if (!dangerouslyUseHTMLString) {\r\n $text = document.createTextNode(encodeHTML(stripScripts(message)))\r\n } else {\r\n $text = document.createDocumentFragment()\r\n $text.innerHTML = message\r\n }\r\n $message = createElement(\r\n 'p',\r\n {\r\n className: 'outline-message__content'\r\n },\r\n [$text]\r\n )\r\n children.push($message)\r\n\r\n if (closable) {\r\n $close = icon('close', {\r\n iconSet: 'outline',\r\n size: 18\r\n })\r\n addClass($close, 'outline-message__close')\r\n children.push($close)\r\n }\r\n\r\n $el = createElement(\r\n 'div',\r\n {\r\n className: className.join(' ')\r\n },\r\n children\r\n )\r\n $el.style.cssText = `top:-50px;`\r\n this.$el = $el\r\n document.body.appendChild(this.$el)\r\n\r\n this.$emit('mounted')\r\n\r\n return this\r\n }\r\n\r\n _refreshIcon() {\r\n const HIDDEN = '.outline-message_hidden'\r\n const $el = this.$el\r\n let iconSize = 20\r\n let type\r\n let effect\r\n let round\r\n let iconName\r\n let $icon\r\n let $svg\r\n let $use\r\n\r\n if (this.isDestroyed()) {\r\n return this\r\n }\r\n\r\n $icon = $el.querySelector('.outline-icon')\r\n\r\n if (!$icon) {\r\n return this\r\n }\r\n\r\n type = this.attr('type')\r\n effect = this.attr('effect')\r\n round = this.attr('round')\r\n\r\n if (effect === 'plain') {\r\n addClass($icon, HIDDEN)\r\n } else {\r\n removeClass($icon, HIDDEN)\r\n\r\n if (round && effect === 'default') {\r\n iconSize = 12\r\n }\r\n }\r\n\r\n $svg = $icon.querySelector('.outline-icon__svg')\r\n setAttributes($svg, {\r\n style: `width:${iconSize}px;height:${iconSize}px;`\r\n })\r\n\r\n $use = $svg.querySelector('use')\r\n iconName = effect === 'light' ? `circle-${type}` : type\r\n setAttribute($use, 'xlink:href', `#outline-icon-${iconName}`)\r\n\r\n return this\r\n }\r\n\r\n _refreshMessage() {\r\n const $el = this.$el\r\n let $message\r\n let dangerouslyUseHTMLString\r\n let message\r\n let text\r\n\r\n if (this.isDestroyed()) {\r\n return this\r\n }\r\n\r\n $message = $el.querySelector('.outline-message__content')\r\n dangerouslyUseHTMLString = this.attr('dangerouslyUseHTMLString')\r\n message = this.attr('message')\r\n\r\n if (!dangerouslyUseHTMLString) {\r\n text = encodeHTML(stripScripts(message))\r\n } else {\r\n text = message\r\n }\r\n\r\n $message.innerHTML = text\r\n\r\n return this\r\n }\r\n\r\n _refreshClose() {\r\n const HIDDEN = '.outline-message_hidden'\r\n const $el = this.$el\r\n let $close\r\n let closable\r\n\r\n if (this.isDestroyed()) {\r\n return this\r\n }\r\n\r\n $close = $el.querySelector('.outline-message__close')\r\n closable = this.attr('closable')\r\n\r\n if ($close) {\r\n if (closable) {\r\n addClass($close, HIDDEN)\r\n } else {\r\n removeClass($close, HIDDEN)\r\n }\r\n }\r\n\r\n return this\r\n }\r\n\r\n _refreshEl() {\r\n const $el = this.$el\r\n let className\r\n\r\n if (this.isDestroyed()) {\r\n return this\r\n }\r\n\r\n className = this._getClassName()\r\n setAttribute($el, 'className', className.join(' '))\r\n\r\n return this\r\n }\r\n\r\n refresh(options) {\r\n if (!isPlainObject(options)) {\r\n return this\r\n }\r\n\r\n this.attr(options)\r\n ._refreshIcon()\r\n ._refreshMessage()\r\n ._refreshClose()\r\n ._refreshEl()\r\n\r\n return this\r\n }\r\n\r\n clearTimer() {\r\n if (this.isDestroyed()) {\r\n return this\r\n }\r\n\r\n if (this.timer) {\r\n clearTimeout(this.timer)\r\n this.timer = null\r\n }\r\n\r\n return this\r\n }\r\n\r\n startTimer(duration) {\r\n if (this.isDestroyed()) {\r\n return this\r\n }\r\n\r\n this.timer = later(() => {\r\n this.$emit('opened')\r\n this.close()\r\n }, duration * 1000)\r\n\r\n return this\r\n }\r\n\r\n open(options) {\r\n const $el = this.$el\r\n let offset\r\n let duration\r\n let top\r\n let cssRules\r\n\r\n if (this.isDestroyed()) {\r\n return this\r\n }\r\n\r\n if (this.isClosed()) {\r\n this.refresh(options)\r\n }\r\n\r\n offset = this.attr('offset')\r\n duration = this.attr('duration')\r\n top = offset && offset >= this.offset ? offset : this.offset\r\n cssRules = `top:${top}px;`\r\n\r\n this.clearTimer()\r\n\r\n this.$emit('beforeOpen')\r\n\r\n later(() => {\r\n this.visible = true\r\n\r\n addClass($el, 'outline-message_visible')\r\n $el.style.cssText = cssRules\r\n\r\n if (duration > 0) {\r\n this.startTimer(duration)\r\n }\r\n }, 100)\r\n\r\n return this\r\n }\r\n\r\n close() {\r\n const $el = this.$el\r\n const cssRules = `top:-50px;`\r\n let destroyAfterClosed\r\n let beforeClose\r\n\r\n if (this.isDestroyed()) {\r\n return this\r\n }\r\n\r\n destroyAfterClosed = this.attr('destroyAfterClosed')\r\n beforeClose = this.attr('beforeClose')\r\n\r\n if (isFunction(beforeClose)) {\r\n beforeClose.call(this)\r\n }\r\n\r\n $el.style.cssText = cssRules\r\n removeClass($el, 'outline-message_visible')\r\n\r\n this.visible = false\r\n this.closed = true\r\n\r\n later(() => {\r\n this.$emit('closed')\r\n\r\n if (destroyAfterClosed) {\r\n this.destroy()\r\n }\r\n }, 500)\r\n\r\n return this\r\n }\r\n\r\n destroy() {\r\n this.$emit('beforeDestroy')\r\n\r\n if (this.isDestroyed()) {\r\n return this\r\n }\r\n\r\n this.removeListeners()\r\n\r\n document.body.removeChild(this.$el)\r\n\r\n clearTimeout(this.timer)\r\n this._default()\r\n\r\n this.$emit('afterDestroy')\r\n\r\n return this\r\n }\r\n\r\n onMouseEnter() {\r\n this.clearTimer()\r\n return this\r\n }\r\n\r\n onMouseLeave() {\r\n const duration = this.attr('duration')\r\n const delay = this.attr('delay')\r\n\r\n if (duration <= 0) {\r\n return this\r\n }\r\n\r\n this.startTimer(delay)\r\n\r\n return this\r\n }\r\n\r\n onClose() {\r\n this.clearTimer()\r\n this.close()\r\n return this\r\n }\r\n\r\n addListeners() {\r\n const $el = this.$el\r\n\r\n on(\r\n $el,\r\n '.outline-message__content',\r\n 'mouseenter',\r\n this.onMouseEnter,\r\n this,\r\n true\r\n )\r\n on(\r\n $el,\r\n '.outline-message__content',\r\n 'mouseleave',\r\n this.onMouseLeave,\r\n this,\r\n true\r\n )\r\n on($el, '.outline-message__close', 'click', this.onClose, this, true)\r\n\r\n return this\r\n }\r\n\r\n removeListeners() {\r\n const $el = this.$el\r\n\r\n off($el, 'mouseenter', this.onMouseEnter)\r\n off($el, 'mouseleave', this.onMouseLeave)\r\n off($el, 'click', this.onClose)\r\n\r\n return this\r\n }\r\n}\r\n\r\nMessage.DEFAULTS = (() => {\r\n const OPTIONS = {\r\n id: '',\r\n type: 'info',\r\n effect: 'default',\r\n round: false,\r\n offset: 30,\r\n duration: 3,\r\n delay: 2,\r\n message: '',\r\n customClass: '',\r\n closable: true,\r\n visible: true,\r\n dangerouslyUseHTMLString: false,\r\n destroyAfterClosed: true,\r\n beforeClose: null\r\n }\r\n\r\n return cloneDeep(OPTIONS)\r\n})()\r\n\r\nTYPES.forEach((type) => {\r\n Message[type] = (options) => {\r\n const config = {}\r\n const id = guid(`outline-message-`)\r\n const beforeClose = options.beforeClose || null\r\n let offset = options.offset || 30\r\n\r\n if (isString(options)) {\r\n config.message = options\r\n } else {\r\n if (isPlainObject(options)) {\r\n extend(config, options)\r\n }\r\n }\r\n config.id = id\r\n config.type = type\r\n config.offset = offset\r\n config.visible = false\r\n config.beforeClose = () => {\r\n Message.close(id, beforeClose)\r\n }\r\n\r\n instance = new Message(config)\r\n instances.forEach((item) => {\r\n offset += item.$el.offsetHeight + 16\r\n })\r\n instance.offset = offset\r\n instance.open()\r\n instances.push(instance)\r\n\r\n return instance\r\n }\r\n})\r\n\r\n// 关闭指定 id 消息的静态方法\r\nMessage.close = (id, beforeClose) => {\r\n const len = instances.length\r\n let index = -1\r\n let i\r\n let offsetHeight\r\n\r\n instances.forEach((instance, i) => {\r\n // 在 instances 中通过 id 找到要关闭的消息\r\n if (id === instance.id) {\r\n offsetHeight = instance.$el.offsetHeight\r\n index = i\r\n\r\n // 关闭消息\r\n if (isFunction(beforeClose)) {\r\n beforeClose.call(instance)\r\n }\r\n\r\n instances.splice(i, 1)\r\n }\r\n })\r\n\r\n if (len <= 1 || index === -1 || index > instances.length - 1) {\r\n return false\r\n }\r\n\r\n i = index\r\n\r\n // 界面中的消息逐个向上收起\r\n for (; i < len - 1; i += 1) {\r\n const dom = instances[i].$el\r\n\r\n dom.style['top'] = parseInt(dom.style['top'], 10) - offsetHeight - 16 + 'px'\r\n }\r\n}\r\n\r\n// 关闭所有消息的静态方法\r\nMessage.clear = () => {\r\n let i = instances.length - 1\r\n for (; i >= 0; i -= 1) {\r\n instances[i].close()\r\n }\r\n}\r\n\r\nexport default Message\r\n","import isFunction from './utils/types/isFunction'\r\n\r\nclass Command {\r\n constructor(name, action) {\r\n this.name = name\r\n\r\n if (isFunction(action)) {\r\n this.action = action\r\n }\r\n }\r\n\r\n execute() {\r\n this.action()\r\n\r\n return this\r\n }\r\n}\r\n\r\nexport default Command\r\n","import isFunction from './utils/types/isFunction'\r\n\r\nclass Commands {\r\n constructor() {\r\n this.commands = []\r\n }\r\n\r\n get(name) {\r\n return this.commands.find((cmd) => cmd.name === name)\r\n }\r\n\r\n add(command) {\r\n this.commands.push(command)\r\n\r\n return this\r\n }\r\n\r\n del(name) {\r\n const commands = this.commands\r\n const command = commands.find((cmd) => cmd.name === name)\r\n const index = command ? commands.indexOf(command) : -1\r\n\r\n if (index > -1) {\r\n commands.splice(index, 1)\r\n }\r\n\r\n return this\r\n }\r\n\r\n clear() {\r\n this.commands = []\r\n\r\n return this\r\n }\r\n\r\n execute(name) {\r\n const command = this.commands.find((cmd) => cmd.name === name)\r\n\r\n if (isFunction(command?.execute)) {\r\n command.execute()\r\n }\r\n\r\n return this\r\n }\r\n}\r\n\r\nexport default Commands\r\n","import icon from './utils/icons/icon'\r\nimport createElement from './utils/dom/createElement'\r\nimport addClass from './utils/dom/addClass'\r\n\r\nconst _createButton = (button, rounded = true) => {\r\n const $icon = icon(button.icon, {\r\n iconSet: button.iconSet || 'outline',\r\n color: button.color || '',\r\n size: button.size\r\n })\r\n const $anchor = createElement(\r\n 'a',\r\n {\r\n className: `outline-toolbar__anchor`,\r\n href: button.link\r\n },\r\n $icon\r\n )\r\n const $button = createElement(\r\n 'div',\r\n {\r\n className: `outline-toolbar__button ${button.name}`,\r\n 'data-cmd': button.name\r\n },\r\n [button.link ? $anchor : $icon]\r\n )\r\n\r\n addClass($icon, 'outline-toolbar__icon')\r\n\r\n if (rounded) {\r\n addClass($button, 'outline-toolbar_rounded')\r\n }\r\n\r\n if (button.disabled) {\r\n addClass($button, 'outline-toolbar_disabled')\r\n }\r\n\r\n return $button\r\n}\r\n\r\nexport default _createButton\r\n","import isString from './utils/types/isString'\r\nimport isFunction from './utils/types/isFunction'\r\nimport isObject from './utils/types/isObject'\r\nimport isArray from './utils/types/isArray'\r\nimport later from './utils/lang/later'\r\nimport guid from './utils/lang/guid'\r\nimport cloneDeep from './utils/lang/cloneDeep'\r\nimport createElement from './utils/dom/createElement'\r\nimport addClass from './utils/dom/addClass'\r\nimport hasClass from './utils/dom/hasClass'\r\nimport removeClass from './utils/dom/removeClass'\r\nimport on from './utils/event/on'\r\nimport off from './utils/event/off'\r\nimport paint from './utils/icons/paint'\r\n\r\nimport Base from './base'\r\nimport Command from './command'\r\nimport Commands from './commands'\r\n\r\nimport _createButton from './_createButton'\r\n\r\nconst DISABLED = 'outline-toolbar_disabled'\r\nconst HIDDEN = 'outline-toolbar_hidden'\r\n\r\nclass Toolbar extends Base {\r\n constructor(options) {\r\n super()\r\n\r\n this._default()\r\n\r\n if (options) {\r\n this.initialize(options)\r\n }\r\n }\r\n\r\n _default() {\r\n this.attrs = cloneDeep(Toolbar.DEFAULTS)\r\n\r\n this.disabled = false\r\n this.closed = false\r\n\r\n this.$el = null\r\n this.buttons = []\r\n this.commands = null\r\n\r\n return this\r\n }\r\n\r\n initialize(options) {\r\n let created\r\n\r\n this.attr(options)\r\n\r\n this.disabled = this.attr('disabled')\r\n this.closed = this.attr('closed')\r\n this.commands = new Commands()\r\n\r\n created = this.attr('created')\r\n\r\n if (isFunction(created)) {\r\n created.call(this)\r\n }\r\n\r\n this.render().addListeners()\r\n\r\n return this\r\n }\r\n\r\n isDisabled(name) {\r\n let button\r\n\r\n if (name) {\r\n button = this.get(name)\r\n\r\n return button.disabled\r\n }\r\n\r\n return this.disabled\r\n }\r\n\r\n isExist(name) {\r\n const button = this.get(name)\r\n return !!button\r\n }\r\n\r\n isClosed() {\r\n return this.closed\r\n }\r\n\r\n _getCommand(button) {\r\n const _self = this\r\n const { action, name } = button\r\n let command = null\r\n let handler = null\r\n let context\r\n let listener\r\n\r\n if (!action) {\r\n return command\r\n }\r\n\r\n handler = action.handler\r\n context = action.context || this\r\n\r\n if (isFunction(handler)) {\r\n listener = handler\r\n } else if (isString(handler)) {\r\n listener = function () {\r\n _self.$emit(handler, name)\r\n }\r\n }\r\n\r\n if (isFunction(listener)) {\r\n command = new Command(name, listener.bind(context))\r\n }\r\n\r\n return command\r\n }\r\n\r\n get(name) {\r\n return this.buttons.find((button) => button.name === name)\r\n }\r\n\r\n render() {\r\n const mounted = this.attr('mounted')\r\n const buttons = this.attr('buttons') || []\r\n const placement = this.attr('placement')\r\n\r\n paint()\r\n\r\n this.$el = createElement('div', {\r\n id: guid('outline-toolbar'),\r\n className: `outline-toolbar outline-toolbar_${placement}`\r\n })\r\n this._paint(buttons)\r\n document.body.appendChild(this.$el)\r\n\r\n if (this.closed) {\r\n this.hide()\r\n }\r\n\r\n if (this.disabled) {\r\n this.disable()\r\n }\r\n\r\n if (isFunction(mounted)) {\r\n mounted.call(this)\r\n }\r\n\r\n return this\r\n }\r\n\r\n erase() {\r\n this.$el.innerHTML = ''\r\n return this\r\n }\r\n\r\n _paint(buttons) {\r\n const rounded = this.attr('rounded')\r\n const $fragment = document.createDocumentFragment()\r\n\r\n buttons.forEach((button) => {\r\n const $button = _createButton(button, rounded)\r\n const command = this._getCommand(button)\r\n const { name, disabled, context } = button\r\n\r\n $fragment.appendChild($button)\r\n\r\n if (!this.isExist(name)) {\r\n this.buttons.push({\r\n $el: $button,\r\n name,\r\n disabled: disabled || false,\r\n context: context || this\r\n })\r\n\r\n if (command) {\r\n this.commands.add(command)\r\n }\r\n }\r\n })\r\n\r\n this.$el.appendChild($fragment)\r\n\r\n return this\r\n }\r\n\r\n _remove() {\r\n document.body.removeChild(this.$el)\r\n return this\r\n }\r\n\r\n refresh(buttons) {\r\n this.attr({ buttons })\r\n this.erase()._paint(buttons)\r\n return this\r\n }\r\n\r\n add(button) {\r\n const $el = this.$el\r\n const $fragment = document.createDocumentFragment()\r\n const buttons = this.attr('buttons') || []\r\n const { name, disabled, context } = button\r\n const command = this._getCommand(button)\r\n const _add = (button) => {\r\n const $button = _createButton(button)\r\n\r\n $fragment.appendChild($button)\r\n\r\n buttons.push(button)\r\n this.buttons.push({\r\n $el: $button,\r\n name,\r\n disabled: disabled || false,\r\n context: context || this,\r\n command\r\n })\r\n\r\n if (command) {\r\n this.commands.add(command)\r\n }\r\n }\r\n\r\n if (isObject(button)) {\r\n _add(button)\r\n } else if (isArray(button)) {\r\n button.forEach((item) => {\r\n if (isObject(item)) {\r\n _add(item)\r\n }\r\n })\r\n }\r\n $el.appendChild($fragment)\r\n\r\n return this\r\n }\r\n\r\n remove(name) {\r\n const $el = this.$el\r\n const buttons = this.buttons\r\n const button = this.get(name)\r\n let index = -1\r\n\r\n if (!button) {\r\n return this\r\n }\r\n\r\n index = buttons.indexOf(button)\r\n\r\n if (index > -1) {\r\n buttons.splice(index, 1)\r\n this.attrs('buttons').splice(index, 1)\r\n }\r\n\r\n this._disable(name)\r\n $el.removeChild(button.$el)\r\n\r\n return this\r\n }\r\n\r\n _disable(name) {\r\n const button = this.get(name)\r\n const command = this.commands.get(name)\r\n\r\n if (!button || button.disabled) {\r\n return this\r\n }\r\n\r\n button.disabled = true\r\n\r\n if (command) {\r\n this.commands.del(command)\r\n }\r\n\r\n addClass(button.$el, DISABLED)\r\n\r\n return this\r\n }\r\n\r\n _enable(name) {\r\n const button = this.get(name)\r\n const command = this.commands.get(name)\r\n\r\n if (!button || !button.disabled) {\r\n return this\r\n }\r\n\r\n button.disabled = false\r\n\r\n if (command) {\r\n this.commands.add(command)\r\n }\r\n\r\n removeClass(button.$el, DISABLED)\r\n\r\n return this\r\n }\r\n\r\n disable(name) {\r\n const disabled = this.attr('afterDisabled')\r\n\r\n if (name) {\r\n this._disable(name)\r\n } else {\r\n addClass(this.$el, DISABLED)\r\n this.removeListeners()\r\n this.disabled = true\r\n\r\n if (isFunction(disabled)) {\r\n disabled.call(this)\r\n }\r\n }\r\n\r\n return this\r\n }\r\n\r\n enable(name) {\r\n const enabled = this.attr('afterEnabled')\r\n\r\n if (name) {\r\n this._enable(name)\r\n } else {\r\n this.disabled = false\r\n removeClass(this.$el, DISABLED)\r\n this.addListeners()\r\n\r\n if (isFunction(enabled)) {\r\n enabled.call(this)\r\n }\r\n }\r\n\r\n return this\r\n }\r\n\r\n show(name) {\r\n const opened = this.attr('afterOpened')\r\n const button = this.get(name)\r\n const $el = this.$el\r\n\r\n if (name) {\r\n if (!button) {\r\n return this\r\n }\r\n\r\n removeClass(button.$el, HIDDEN)\r\n } else {\r\n removeClass($el, HIDDEN)\r\n this.closed = false\r\n\r\n if (isFunction(opened)) {\r\n later(() => {\r\n opened.call(this)\r\n }, 310)\r\n }\r\n }\r\n\r\n return this\r\n }\r\n\r\n hide(name) {\r\n const closed = this.attr('afterClosed')\r\n const button = this.get(name)\r\n const $el = this.$el\r\n\r\n if (name) {\r\n if (!button) {\r\n return this\r\n }\r\n\r\n addClass(button.$el, HIDDEN)\r\n } else {\r\n addClass($el, HIDDEN)\r\n this.closed = true\r\n\r\n if (isFunction(closed)) {\r\n later(() => {\r\n closed.call(this)\r\n }, 310)\r\n }\r\n }\r\n\r\n return this\r\n }\r\n\r\n toggle(name) {\r\n if (this.isClosed()) {\r\n this.show(name)\r\n } else {\r\n this.hide(name)\r\n }\r\n\r\n return this\r\n }\r\n\r\n highlight(name) {\r\n const button = this.get(name)\r\n const ACTIVE = 'outline-toolbar_active'\r\n let $button\r\n\r\n if (!button) {\r\n return this\r\n }\r\n\r\n $button = button.$el\r\n\r\n if (hasClass($button, ACTIVE)) {\r\n removeClass($button, ACTIVE)\r\n } else {\r\n addClass($button, ACTIVE)\r\n }\r\n\r\n return this\r\n }\r\n\r\n destroy() {\r\n const beforeDestroy = this.attr('beforeDestroy')\r\n const afterDestroy = this.attr('afterDestroy')\r\n\r\n if (isFunction(beforeDestroy)) {\r\n beforeDestroy.call(this)\r\n }\r\n\r\n this.commands.clear()\r\n this.removeListeners()._remove()._default()\r\n\r\n if (isFunction(afterDestroy)) {\r\n afterDestroy.call(this)\r\n }\r\n\r\n return this\r\n }\r\n\r\n execute(name) {\r\n if (this.isDisabled(name)) {\r\n return this\r\n }\r\n\r\n this.commands.execute(name)\r\n\r\n return this\r\n }\r\n\r\n onExecute(evt) {\r\n const $button = evt.delegateTarget\r\n let cmd = ''\r\n\r\n if ($button) {\r\n cmd = $button.getAttribute('data-cmd')\r\n\r\n if (cmd) {\r\n this.execute(cmd)\r\n }\r\n }\r\n\r\n return this\r\n }\r\n\r\n addListeners() {\r\n const buttons = this.attr('buttons') || []\r\n const $el = this.$el\r\n\r\n if (!buttons || buttons.length < 1) {\r\n return this\r\n }\r\n\r\n on($el, `.outline-toolbar__button`, 'click', this.onExecute, this, true)\r\n\r\n return this\r\n }\r\n\r\n removeListeners() {\r\n const buttons = this.attr('buttons') || []\r\n const $el = this.$el\r\n\r\n if (!buttons || buttons.length < 1) {\r\n return this\r\n }\r\n\r\n off($el, '.outline-toolbar__button', this.onExecute)\r\n\r\n return this\r\n }\r\n}\r\n\r\nToolbar.DEFAULTS = (() => {\r\n const OPTIONS = {\r\n placement: 'ltr',\r\n closed: false,\r\n disabled: false,\r\n rounded: true,\r\n buttons: [],\r\n created: null,\r\n mounted: null,\r\n afterClosed: null,\r\n afterOpened: null,\r\n afterDisabled: null,\r\n afterEnabled: null,\r\n beforeDestroy: null,\r\n afterDestroy: null\r\n }\r\n\r\n return cloneDeep(OPTIONS)\r\n})()\r\n\r\nexport default Toolbar\r\n","import publish from './utils/observer/emit'\r\n\r\nclass Speech {\r\n constructor(options) {\r\n this.utterance = new SpeechSynthesisUtterance()\r\n\r\n if (options) {\r\n this.initialize(options)\r\n }\r\n }\r\n\r\n _initialize(options) {\r\n if (options.lang) {\r\n this.setLang(options.lang)\r\n }\r\n\r\n if (options.pitch) {\r\n this.setPitch(options.pitch)\r\n }\r\n\r\n if (options.rate) {\r\n this.setRate(options.rate)\r\n }\r\n\r\n if (options.text) {\r\n this.setText(options.text)\r\n }\r\n\r\n if (options.voice) {\r\n this.setVoice(options.voice)\r\n }\r\n\r\n if (options.volume) {\r\n this.setVolume(options.volume)\r\n }\r\n\r\n return this\r\n }\r\n\r\n initialize(options) {\r\n this._initialize(options)._addListeners()\r\n return this\r\n }\r\n\r\n isSpeaking() {\r\n return speechSynthesis.speaking\r\n }\r\n\r\n isPending() {\r\n return speechSynthesis.pending\r\n }\r\n\r\n isPaused() {\r\n return speechSynthesis.paused\r\n }\r\n\r\n getVoices() {\r\n return speechSynthesis.getVoices()\r\n }\r\n\r\n setLang(lang) {\r\n this.utterance.lang = lang\r\n return this\r\n }\r\n\r\n setPitch(pitch) {\r\n this.utterance.pitch = pitch\r\n return this\r\n }\r\n\r\n setRate(rate) {\r\n this.utterance.rate = rate\r\n return this\r\n }\r\n\r\n setText(text) {\r\n this.utterance.text = text\r\n return this\r\n }\r\n\r\n setVoice(voice) {\r\n this.utterance.voice = voice\r\n return this\r\n }\r\n\r\n setVolume(volume) {\r\n this.utterance.volume = volume\r\n return this\r\n }\r\n\r\n speak(text) {\r\n if (text) {\r\n this.setText(text)\r\n }\r\n\r\n speechSynthesis.speak(this.utterance)\r\n\r\n return this\r\n }\r\n\r\n pause() {\r\n speechSynthesis.pause()\r\n return this\r\n }\r\n\r\n resume() {\r\n speechSynthesis.resume()\r\n return this\r\n }\r\n\r\n cancel() {\r\n speechSynthesis.cancel()\r\n this.setText('')\r\n return this\r\n }\r\n\r\n _addListeners() {\r\n const UTTERANCE_EVENTS = [\r\n 'boundary',\r\n 'end',\r\n 'error',\r\n 'start',\r\n 'mark',\r\n 'pause',\r\n 'resume'\r\n ]\r\n const utterance = this.utterance\r\n const speech = this\r\n\r\n UTTERANCE_EVENTS.forEach((name) => {\r\n utterance[`on${name}`] = (event) => {\r\n publish(name, {\r\n event,\r\n speech\r\n })\r\n }\r\n })\r\n\r\n speechSynthesis.onvoiceschanged = (event) => {\r\n publish('voiceschanged', {\r\n event,\r\n speech\r\n })\r\n }\r\n\r\n return this\r\n }\r\n}\r\n\r\nSpeech.isSupport = (() => {\r\n return 'speechSynthesis' in window\r\n})()\r\n\r\nexport default Speech\r\n","import addClass from './utils/dom/addClass'\r\n\r\nconst _updateSiblingElements = (siblingElement, isPrev) => {\r\n let tagName\r\n let $sibling = siblingElement\r\n\r\n while ($sibling) {\r\n tagName = $sibling.tagName.toLowerCase()\r\n\r\n if (tagName !== 'script' && tagName !== 'style') {\r\n addClass($sibling, 'outline-reader_sibling')\r\n }\r\n\r\n if (isPrev) {\r\n $sibling = $sibling.previousElementSibling\r\n } else {\r\n $sibling = $sibling.nextElementSibling\r\n }\r\n }\r\n}\r\n\r\nexport default _updateSiblingElements\r\n","import cloneDeep from './utils/lang/cloneDeep'\r\nimport later from './utils/lang/later'\r\nimport isString from './utils/types/isString'\r\nimport isElement from './utils/types/isElement'\r\nimport isFunction from './utils/types/isFunction'\r\nimport createElement from './utils/dom/createElement'\r\nimport addClass from './utils/dom/addClass'\r\nimport removeClass from './utils/dom/removeClass'\r\nimport at from './utils/event/at'\r\nimport stop from './utils/event/stop'\r\nimport off from './utils/event/off'\r\n\r\nimport Base from './base'\r\nimport Message from './message'\r\nimport Toolbar from './toolbar'\r\nimport Speech from './speech'\r\n\r\nimport _updateSiblingElements from './_updateSiblingElements'\r\n\r\nconst ENTER_READING_TIP = '进入阅读模式,按 ESC 键可退出阅读模式'\r\n\r\nclass Reader extends Base {\r\n constructor(options) {\r\n super()\r\n\r\n this._default()\r\n\r\n if (options) {\r\n this.initialize(options)\r\n }\r\n }\r\n\r\n _default() {\r\n this.attrs = cloneDeep(Reader.DEFAULTS)\r\n this.reading = false\r\n\r\n this.$target = null\r\n this.$paper = null\r\n this.$title = null\r\n this.$article = null\r\n this.$progress = null\r\n\r\n this.toolbar = null\r\n this.speech = null\r\n\r\n return this\r\n }\r\n\r\n initialize(options) {\r\n let target = null\r\n\r\n this.attr(options)\r\n\r\n target = this.attr('target')\r\n\r\n if (isString(target)) {\r\n this.$target = document.querySelector(target)\r\n } else if (isElement(target)) {\r\n this.$target = target\r\n }\r\n\r\n if (!this.$target) {\r\n return this\r\n }\r\n\r\n if (Speech.isSupport) {\r\n this.speech = new Speech()\r\n }\r\n\r\n this.render().addListeners()\r\n\r\n return this\r\n }\r\n\r\n isSpeaking() {\r\n return this?.speech?.isSpeaking()\r\n }\r\n\r\n render() {\r\n this._renderEdge()._paint(this.$target)\r\n return this\r\n }\r\n\r\n erase() {\r\n this.$article.innerHTML = ''\r\n return this\r\n }\r\n\r\n _paint($content) {\r\n const $fragment = document.createDocumentFragment()\r\n const $children = [...$content.cloneNode(true).children]\r\n\r\n later(() => {\r\n $children.forEach(($child) => {\r\n $fragment.appendChild($child)\r\n })\r\n\r\n this.$article.appendChild($fragment)\r\n })\r\n\r\n return this\r\n }\r\n\r\n _remove() {\r\n const $paper = this.$paper\r\n const toolbar = this.toolbar\r\n\r\n if ($paper) {\r\n document.body.removeChild($paper)\r\n }\r\n\r\n if (toolbar) {\r\n toolbar.destroy()\r\n }\r\n\r\n return this\r\n }\r\n\r\n refresh() {\r\n this.erase()._paint(this.$target)\r\n return this\r\n }\r\n\r\n _renderEdge() {\r\n const $target = this.$target\r\n let title = this.attr('title')\r\n let $paper\r\n let $title\r\n let $article\r\n let $progress\r\n let $sibling\r\n\r\n $title = $target.querySelector('h1')\r\n\r\n if (isElement(title)) {\r\n $title = title\r\n }\r\n\r\n if (isElement($title)) {\r\n title = $title.innerText\r\n }\r\n\r\n $title = createElement(\r\n 'h1',\r\n {\r\n className: 'outline-reader__title'\r\n },\r\n title\r\n )\r\n this.$title = $title\r\n\r\n $article = createElement('article', {\r\n id: 'outline-reader__article',\r\n className: 'outline-reader__article'\r\n })\r\n this.$article = $article\r\n\r\n $progress = createElement('div', {\r\n className: 'outline-reader__progress'\r\n })\r\n this.$progress = $progress\r\n\r\n const buttons = []\r\n\r\n if (Speech.isSupport && this.attr('allowSpeak')) {\r\n buttons.push({\r\n name: 'speak',\r\n icon: 'sound',\r\n size: 20,\r\n action: {\r\n context: this,\r\n handler: this.speak\r\n }\r\n })\r\n }\r\n\r\n buttons.push(\r\n ...[\r\n {\r\n name: 'print',\r\n icon: 'print',\r\n size: 20,\r\n action: {\r\n context: this,\r\n handler: this.print\r\n }\r\n },\r\n {\r\n name: 'exit',\r\n icon: 'close',\r\n size: 20,\r\n action: {\r\n context: this,\r\n handler: this.exit\r\n }\r\n }\r\n ]\r\n )\r\n\r\n this.toolbar = new Toolbar({\r\n placement: 'rtl',\r\n buttons\r\n })\r\n\r\n $paper = createElement(\r\n 'section',\r\n {\r\n id: 'outline-reader',\r\n className: 'outline-reader outline-reader_hidden'\r\n },\r\n [$progress, $title, $article, this.toolbar.$el]\r\n )\r\n this.$paper = $paper\r\n\r\n document.body.appendChild($paper)\r\n\r\n later(() => {\r\n // 设置邻居节点的打印样式\r\n $sibling = $paper.previousElementSibling\r\n _updateSiblingElements($sibling, true)\r\n\r\n $sibling = $paper.nextElementSibling\r\n _updateSiblingElements($sibling)\r\n })\r\n\r\n return this\r\n }\r\n\r\n enter() {\r\n const READER = 'outline-reader'\r\n const READING = `${READER}--reading`\r\n const HIDDEN = `${READER}_hidden`\r\n const $paper = this.$paper\r\n const $siblings = document.querySelectorAll('.outline-reader_sibling')\r\n const enterReadingTip = this.attr('enterReadingTip') || ENTER_READING_TIP\r\n\r\n if (this.reading || !$paper) {\r\n return this\r\n }\r\n\r\n $siblings.forEach(($sibling) => {\r\n addClass($sibling, HIDDEN)\r\n })\r\n addClass($paper, READING)\r\n removeClass($paper, HIDDEN)\r\n this.toolbar.show()\r\n this.reading = true\r\n\r\n Message.info({\r\n round: true,\r\n message: enterReadingTip\r\n })\r\n\r\n this.$emit('enterReading')\r\n\r\n return this\r\n }\r\n\r\n exit() {\r\n const READER = 'outline-reader'\r\n const READING = `${READER}--reading`\r\n const HIDDEN = `${READER}_hidden`\r\n const $paper = this.$paper\r\n const $siblings = document.querySelectorAll('.outline-reader_sibling')\r\n\r\n if (!this.reading || !$paper) {\r\n return this\r\n }\r\n\r\n addClass($paper, HIDDEN)\r\n removeClass($paper, READING)\r\n $siblings.forEach(($sibling) => {\r\n removeClass($sibling, HIDDEN)\r\n })\r\n this.toolbar.hide()\r\n this.reading = false\r\n\r\n this.$emit('exitReading')\r\n\r\n return this\r\n }\r\n\r\n toggle() {\r\n if (this.reading) {\r\n this.exit()\r\n } else {\r\n this.enter()\r\n }\r\n\r\n return this\r\n }\r\n\r\n speak() {\r\n const text = this.$article.innerText\r\n const speech = this.speech\r\n\r\n if (!Speech.isSupport) {\r\n return this\r\n }\r\n\r\n this.toolbar.highlight('speak')\r\n\r\n if (this.isSpeaking()) {\r\n speech.cancel()\r\n } else {\r\n speech.speak(text)\r\n }\r\n\r\n return this\r\n }\r\n\r\n print() {\r\n if (!isFunction(print)) {\r\n return this\r\n }\r\n\r\n print()\r\n\r\n return this\r\n }\r\n\r\n destroy() {\r\n const $paper = this.$paper\r\n\r\n if (!$paper) {\r\n return this\r\n }\r\n\r\n this.removeListeners()._remove()._default()\r\n\r\n return this\r\n }\r\n\r\n onPrint() {\r\n this.print()\r\n return this\r\n }\r\n\r\n onEnterReading() {\r\n this.toggle()\r\n return this\r\n }\r\n\r\n onExitReading(evt) {\r\n const keyCode = evt.keyCode\r\n\r\n if (keyCode === 27 && this.reading) {\r\n this.toggle()\r\n stop(evt)\r\n }\r\n\r\n return this\r\n }\r\n\r\n addListeners() {\r\n const $paper = this.$paper\r\n\r\n if (!$paper) {\r\n return this\r\n }\r\n\r\n at(document, 'keyup', this.onExitReading, this, true)\r\n\r\n this.$on('toolbar:action:print', this.onPrint)\r\n this.$on('toolbar:action:reading', this.onEnterReading)\r\n\r\n return this\r\n }\r\n\r\n removeListeners() {\r\n const $paper = this.$paper\r\n\r\n if (!$paper) {\r\n return this\r\n }\r\n\r\n off(document, 'keyup', this.onExitReading)\r\n\r\n this.$off('toolbar:action:print')\r\n this.$off('toolbar:action:reading')\r\n\r\n return this\r\n }\r\n}\r\n\r\nReader.DEFAULTS = (() => {\r\n const OPTIONS = {\r\n target: '',\r\n title: '',\r\n enterReadingTip: ENTER_READING_TIP,\r\n allowSpeak: false\r\n }\r\n\r\n return cloneDeep(OPTIONS)\r\n})()\r\n\r\nexport default Reader\r\n","import later from './utils/lang/later'\r\nimport cloneDeep from './utils/lang/cloneDeep'\r\nimport isFunction from './utils/types/isFunction'\r\nimport isString from './utils/types/isString'\r\nimport isElement from './utils/types/isElement'\r\nimport addClass from './utils/dom/addClass'\r\nimport scrollTo from './utils/dom/scrollTo'\r\nimport _getScrollElement from './utils/dom/_getScrollElement'\r\n\r\nimport getChapters from './getChapters'\r\n\r\nimport Base from './base'\r\nimport Anchors from './anchors'\r\nimport Drawer from './drawer'\r\nimport Navigator from './navigator'\r\nimport Reader from './reader'\r\nimport Toolbar from './toolbar'\r\n\r\nclass Outline extends Base {\r\n constructor(options) {\r\n super()\r\n\r\n this._default()\r\n\r\n if (options) {\r\n this.initialize(options)\r\n }\r\n }\r\n\r\n _default() {\r\n const options = Outline.DEFAULTS\r\n\r\n this.attrs = cloneDeep(options)\r\n this.$article = null\r\n this.$scrollElement = null\r\n this.buttons = []\r\n\r\n this.anchors = null\r\n this.drawer = null\r\n this.navigator = null\r\n this.reader = null\r\n this.toolbar = null\r\n\r\n return this\r\n }\r\n\r\n initialize(options) {\r\n let articleElement = ''\r\n let scrollElement = ''\r\n let $article = null\r\n\r\n this.attr(options)\r\n\r\n articleElement = this.attr('articleElement')\r\n scrollElement = this.attr('scrollElement')\r\n\r\n if (isString(articleElement)) {\r\n $article = document.querySelector(articleElement)\r\n } else if (isElement(articleElement)) {\r\n $article = articleElement\r\n }\r\n this.$article = $article\r\n this.$scrollElement = _getScrollElement(scrollElement)\r\n\r\n this.$emit('created', { ...this.attr() })\r\n this.render().addListeners()\r\n\r\n return this\r\n }\r\n\r\n getChapters(isTreeStructured = false) {\r\n const articleElement = this.$article\r\n const selector = this.attr('selector')\r\n const showCode = this.attr('showCode') || true\r\n const chapterTextFilter = this.attr('chapterTextFilter')\r\n\r\n return getChapters({\r\n articleElement,\r\n selector,\r\n showCode,\r\n chapterTextFilter,\r\n isTreeStructured\r\n })\r\n }\r\n\r\n count() {\r\n return this.getChapters().length\r\n }\r\n\r\n render() {\r\n const hasToolbar = this.attr('hasToolbar')\r\n const $scrollElement = this.$scrollElement\r\n\r\n this._renderReader()._renderAnchors()._renderNavigator()._renderToolbar()\r\n\r\n if ($scrollElement && hasToolbar) {\r\n this._updateToolbar({\r\n top: $scrollElement.scrollTop,\r\n min: 0,\r\n max: $scrollElement.scrollHeight\r\n })\r\n }\r\n\r\n this.$emit('mounted')\r\n\r\n return this\r\n }\r\n\r\n refresh() {\r\n const chapters = this.getChapters()\r\n\r\n this.anchors.refresh(chapters)\r\n this.navigator.refresh(chapters)\r\n this.reader.refresh()\r\n\r\n return this\r\n }\r\n\r\n _renderReader() {\r\n const option = this.attr('reader')\r\n\r\n if (!option.target) {\r\n return this\r\n }\r\n\r\n addClass(this.$article, 'outline-article')\r\n\r\n this.reader = new Reader(option)\r\n\r\n return this\r\n }\r\n\r\n _renderAnchors() {\r\n const articleElement = this.attr('articleElement')\r\n const selector = this.attr('selector')\r\n const stickyHeight = this.attr('stickyHeight')\r\n const scrollElement = this.attr('scrollElement')\r\n const showCode = this.attr('showCode')\r\n const anchorURL = this.attr('anchorURL')\r\n const afterScroll = this.attr('afterScroll')\r\n const chapterTextFilter = this.attr('chapterTextFilter')\r\n\r\n this.anchors = new Anchors({\r\n articleElement,\r\n stickyHeight,\r\n scrollElement,\r\n selector,\r\n showCode,\r\n anchorURL,\r\n afterScroll,\r\n chapterTextFilter\r\n })\r\n\r\n return this\r\n }\r\n\r\n _renderNavigator() {\r\n const title = this.attr('title')\r\n const stickyHeight = this.attr('stickyHeight')\r\n const scrollElement = this.attr('scrollElement')\r\n const customClass = this.attr('customClass')\r\n const showCode = this.attr('showCode')\r\n const animationCurrent = this.attr('animationCurrent')\r\n const closeOnClickModal = this.attr('closeOnClickModal')\r\n const showNavModalFirst = this.attr('showNavModalFirst')\r\n const position = this.attr('position')\r\n const placement = this.attr('placement')\r\n const afterSticky = this.attr('afterSticky')\r\n const afterToggle = this.attr('afterToggle')\r\n const afterScroll = this.attr('afterScroll')\r\n const count = this.count()\r\n let parentElement = this.attr('parentElement')\r\n let OPTIONS\r\n\r\n if (count < 1) {\r\n return this\r\n }\r\n\r\n OPTIONS = {\r\n scrollElement,\r\n showCode,\r\n animationCurrent,\r\n position,\r\n title,\r\n stickyHeight,\r\n chapters: this.getChapters(),\r\n afterSticky,\r\n afterToggle,\r\n afterScroll\r\n }\r\n\r\n if (position === 'relative') {\r\n this.drawer = new Drawer({\r\n placement,\r\n title,\r\n size: 'tiny',\r\n hasOffset: true,\r\n hasPadding: false,\r\n closeOnClickModal,\r\n customClass,\r\n afterClosed: () => {\r\n const toolbar = this.toolbar\r\n toolbar.toggle()\r\n }\r\n })\r\n parentElement = this.drawer.$main\r\n\r\n if (showNavModalFirst) {\r\n this.drawer.open()\r\n }\r\n } else {\r\n OPTIONS.customClass = customClass\r\n }\r\n\r\n OPTIONS.parentElement = parentElement\r\n this.navigator = new Navigator(OPTIONS)\r\n\r\n return this\r\n }\r\n\r\n _renderToolbar() {\r\n const position = this.attr('position')\r\n const hasToolbar = this.attr('hasToolbar')\r\n const showNavModalFirst = this.attr('showNavModalFirst')\r\n const placement = this.attr('placement')\r\n const homepage = this.attr('homepage')\r\n const git = this.attr('git')\r\n const tags = this.attr('tags')\r\n const issues = this.attr('issues')\r\n const tools = this.attr('tools')\r\n const option = this.attr('reader')\r\n const count = this.count()\r\n const UP = {\r\n name: 'up',\r\n icon: 'up',\r\n size: 20,\r\n action: {\r\n context: this,\r\n handler: this.toTop\r\n }\r\n }\r\n const HOME = {\r\n name: 'homepage',\r\n icon: 'homepage',\r\n size: 20,\r\n link: homepage\r\n }\r\n const GIT = {\r\n name: 'github',\r\n icon: 'github',\r\n size: 20,\r\n link: git\r\n }\r\n const TAGS = {\r\n name: 'tags',\r\n icon: 'tags',\r\n size: 20,\r\n link: tags\r\n }\r\n const ISSUES = {\r\n name: 'issues',\r\n icon: 'issues',\r\n size: 20,\r\n link: issues\r\n }\r\n const MENU = {\r\n name: 'toggle',\r\n icon: 'menu',\r\n size: 18,\r\n action: {\r\n context: this,\r\n handler: this.toggle\r\n }\r\n }\r\n const READING = {\r\n name: 'reading',\r\n icon: 'file',\r\n size: 18,\r\n action: {\r\n context: this,\r\n handler: 'toolbar:action:reading'\r\n }\r\n }\r\n const PRINT = {\r\n name: 'print',\r\n icon: 'print',\r\n size: 20,\r\n action: {\r\n handler: 'toolbar:action:print'\r\n }\r\n }\r\n const DOWN = {\r\n name: 'down',\r\n icon: 'down',\r\n size: 20,\r\n action: {\r\n context: this,\r\n handler: this.toBottom\r\n }\r\n }\r\n const buttons = []\r\n\r\n if (!hasToolbar) {\r\n return this\r\n }\r\n\r\n buttons.push(UP)\r\n if (count > 0) {\r\n buttons.push(MENU)\r\n }\r\n if (homepage) {\r\n buttons.push(HOME)\r\n }\r\n if (git) {\r\n buttons.push(GIT)\r\n }\r\n if (tags) {\r\n buttons.push(TAGS)\r\n }\r\n if (issues) {\r\n buttons.push(ISSUES)\r\n }\r\n if (option.target) {\r\n buttons.push(READING)\r\n if (isFunction(print)) {\r\n buttons.push(PRINT)\r\n }\r\n }\r\n if (tools?.length > 0) {\r\n buttons.push(...tools)\r\n }\r\n buttons.push(DOWN)\r\n this.buttons = [...buttons]\r\n\r\n this.toolbar = new Toolbar({\r\n placement,\r\n buttons\r\n })\r\n\r\n if (position === 'relative' && showNavModalFirst) {\r\n this.toolbar.hide()\r\n }\r\n\r\n return this\r\n }\r\n\r\n addButton(button) {\r\n const toolbar = this.toolbar\r\n const buttons = this.buttons\r\n buttons.splice(-1, 0, button)\r\n toolbar.attr({\r\n buttons\r\n })\r\n toolbar.refresh()\r\n return this\r\n }\r\n\r\n removeButton(name) {\r\n this.toolbar.remove(name)\r\n return this\r\n }\r\n\r\n _updateToolbar({ top, min, max }) {\r\n const toolbar = this.toolbar\r\n const current = Math.ceil(top)\r\n\r\n if (current <= min) {\r\n toolbar.hide('up')\r\n toolbar.show('down')\r\n } else if (current >= max) {\r\n toolbar.hide('down')\r\n toolbar.show('up')\r\n } else if (current > min && current < max) {\r\n toolbar.show('up')\r\n toolbar.show('down')\r\n }\r\n\r\n return this\r\n }\r\n\r\n toTop() {\r\n const afterScroll = this.attr('afterScroll')\r\n const toolbar = this.toolbar\r\n const navigator = this.navigator\r\n const count = this.count()\r\n const afterTop = () => {\r\n toolbar.hide('up')\r\n toolbar.show('down')\r\n\r\n if (count > 0) {\r\n navigator.highlight(0)\r\n navigator.playing = false\r\n scrollTo(navigator.$main, 0)\r\n }\r\n\r\n if (isFunction(afterScroll)) {\r\n afterScroll.call(toolbar, 'up')\r\n }\r\n }\r\n\r\n if (count > 0) {\r\n navigator.playing = true\r\n }\r\n this.scrollTo(0, afterTop)\r\n\r\n return this\r\n }\r\n\r\n toBottom() {\r\n const afterScroll = this.attr('afterScroll')\r\n const $scrollElement = this.$scrollElement\r\n const toolbar = this.toolbar\r\n const navigator = this.navigator\r\n const count = this.count()\r\n const top = Math.floor(\r\n $scrollElement.scrollHeight - $scrollElement.clientHeight\r\n )\r\n const afterDown = () => {\r\n const $main = navigator.$main\r\n toolbar.hide('down')\r\n toolbar.show('up')\r\n\r\n if (count > 0) {\r\n navigator.highlight(count - 1)\r\n scrollTo($main, $main.scrollHeight)\r\n navigator.playing = false\r\n }\r\n\r\n if (isFunction(afterScroll)) {\r\n afterScroll.call(toolbar, 'bottom')\r\n }\r\n }\r\n\r\n if (count > 0) {\r\n navigator.playing = true\r\n }\r\n\r\n this.scrollTo(top, afterDown)\r\n\r\n return this\r\n }\r\n\r\n scrollTo(top, afterScroll) {\r\n scrollTo(this.$scrollElement, top, afterScroll)\r\n return this\r\n }\r\n\r\n enterReading() {\r\n const reader = this.reader\r\n\r\n if (!reader || reader.reading) {\r\n return this\r\n }\r\n\r\n this.toolbar.toggle()\r\n reader.enter()\r\n\r\n return this\r\n }\r\n\r\n exitReading() {\r\n const reader = this.reader\r\n\r\n if (!reader || !reader.reading) {\r\n return this\r\n }\r\n\r\n this.toolbar.toggle()\r\n reader.exit()\r\n\r\n return this\r\n }\r\n\r\n switchReading() {\r\n const reader = this.reader\r\n\r\n if (!reader) {\r\n return this\r\n }\r\n\r\n reader.toggle()\r\n\r\n return this\r\n }\r\n\r\n toggle() {\r\n const position = this.attr('position')\r\n const toolbar = this.toolbar\r\n const drawer = this.drawer\r\n const navigator = this.navigator\r\n const count = this.count()\r\n\r\n if (count < 1) {\r\n return this\r\n }\r\n\r\n if (position !== 'relative') {\r\n navigator.toggle()\r\n toolbar.highlight('toggle')\r\n } else {\r\n toolbar.toggle()\r\n\r\n later(() => {\r\n drawer.toggle()\r\n })\r\n }\r\n\r\n return this\r\n }\r\n\r\n print() {\r\n this.reader.print()\r\n\r\n return this\r\n }\r\n\r\n _destroy() {\r\n const count = this.count()\r\n let anchors = this.anchors\r\n let navigator = this.navigator\r\n let drawer = this.drawer\r\n let reader = this.reader\r\n let toolbar = this.toolbar\r\n let isOutside = false\r\n\r\n this.removeListeners()\r\n\r\n if (reader) {\r\n reader.destroy()\r\n }\r\n\r\n if (count > 0 && navigator) {\r\n isOutside = navigator.isOutside()\r\n\r\n navigator.destroy()\r\n\r\n if (isOutside && drawer) {\r\n drawer.destroy()\r\n }\r\n }\r\n\r\n if (anchors) {\r\n anchors.destroy()\r\n }\r\n\r\n if (toolbar) {\r\n toolbar.destroy()\r\n }\r\n\r\n return this\r\n }\r\n\r\n destroy() {\r\n this.$emit('beforeDestroy')\r\n\r\n this._destroy()._default()\r\n\r\n this.$emit('destroyed')\r\n\r\n return this\r\n }\r\n\r\n onToolbarUpdate({ top, min, max }) {\r\n this._updateToolbar({ top, min, max })\r\n return this\r\n }\r\n\r\n addListeners() {\r\n const hasToolbar = this.attr('hasToolbar')\r\n\r\n if (!hasToolbar) {\r\n return this\r\n }\r\n\r\n this.$on('toolbar:update', this.onToolbarUpdate)\r\n\r\n return this\r\n }\r\n\r\n removeListeners() {\r\n const hasToolbar = this.attr('hasToolbar')\r\n\r\n if (!hasToolbar) {\r\n return this\r\n }\r\n\r\n this.$off('toolbar:update')\r\n\r\n return this\r\n }\r\n}\r\n\r\nOutline.DEFAULTS = (() => {\r\n const OPTIONS = {\r\n articleElement: '#article',\r\n selector: 'h2,h3,h4,h5,h6',\r\n parentElement: '#aside',\r\n scrollElement: 'html,body',\r\n title: '目录',\r\n position: 'relative',\r\n placement: 'rtl',\r\n animationCurrent: true,\r\n showCode: true,\r\n hasToolbar: true,\r\n closeOnClickModal: true,\r\n showNavModalFirst: false,\r\n anchorURL: '',\r\n stickyHeight: 0,\r\n homepage: '',\r\n git: '',\r\n tags: '',\r\n issues: '',\r\n tools: [],\r\n reader: {\r\n target: '',\r\n title: '',\r\n enterReadingTip: '进入阅读模式,按 ESC 键可退出阅读模式',\r\n allowSpeak: false\r\n },\r\n customClass: '',\r\n afterSticky: null,\r\n afterToggle: null,\r\n afterScroll: null,\r\n chapterTextFilter: null\r\n }\r\n\r\n return cloneDeep(OPTIONS)\r\n})()\r\n\r\nif (window?.jQuery) {\r\n const $ = window.jQuery\r\n\r\n // 将 Outline 扩展为一个 jquery 插件\r\n // eslint-disable-next-line no-undef\r\n $.extend($.fn, {\r\n outline: function (options) {\r\n // eslint-disable-next-line no-undef\r\n let $article = $(this)\r\n\r\n return new Outline(\r\n // eslint-disable-next-line no-undef\r\n $.extend({}, options, {\r\n articleElement: $article\r\n })\r\n )\r\n }\r\n })\r\n}\r\n\r\nexport default Outline\r\n"],"names":["toString","val","Object","prototype","apply","isFunction","later","fn","delay","arguments","length","undefined","setTimeout","isObject","o","isArray","Array","cloneDeep","obj","clone","from","assign","keys","forEach","key","isString","str","isElement","nodeName","tagName","nodeType","hasClass","el","className","pattern","RegExp","allClass","classList","contains","exec","addClass","_classList","add","easeInQuad","x","_getScrollElement","$rootElements","$scrollElement","scrollElement","document","querySelector","querySelectorAll","scrollTop","scrollTo","top","afterStop","step","distance","MAX_HEIGHT","scrollHeight","MAX_TOP","stop","play","requestAnimationFrame","trim","replace","getChaptersByHeadings","headings","showCode","chapterTextFilter","previous","level","text","chapters","heading","i","headingLevel","current","parseInt","pid","_getChapterParentIdByDiffer","differ","index","innerHTML","push","id","rel","groups","group","JSON","stringify","cb","code","String","c","subjects","_getChaptersWithCode","getChapters","options","articleElement","selector","isTreeStructured","$article","$headings","filter","toTree","list","nodeKey","parentKey","map","roots","item","children","node","hasOwn","prop","hasOwnProperty","call","extend","origin","source","_subscribers","_hasDirectSubscribersFor","topic","has","found","position","lastIndexOf","substring","_hasSubscribers","emit","data","async","execute","subscriber","message","indexOf","callback","context","deliver","guid","uuid","prefix","_removeSubscriber","off","token","subject","execution","j","splice","_removeSubscriberByToken","Base","constructor","this","attrs","initialize","attr","render","addListeners","value","refresh","destroy","removeListeners","reload","$emit","event","publish","$on","handler","subscribe","$off","unsubscribe","queue","isHandling","done","runIdle","idleDeadline","timeRemaining","shift","requestIdleCallback","window","start","Date","now","didTimeout","Math","max","cancelIdleCallback","clearTimeout","timeSlice","afterComplete","offsetTop","offsetParent","matches","sel","msMatchesSelector","getParentOrHost","host","parentNode","CAPTURE_EVENTS","_off","type","capture","_delegateListener","listeners","_listeners","listener","_delete","removeEventListener","purgeElement","recurse","$element","$children","childNodes","getListeners","$child","on","once","evt","target","getTarget","delegateTarget","closest","ctx","includeCTX","startsWith","overrideContext","addEventListener","stopPropagation","preventDefault","SYMBOLS","getSymbols","name","iconSet","patternName","patternSet","find","symbol","fullName","getSymbol","paint","$body","body","$icons","symbols","join","createElement","insertBefore","firstChild","isDOM","isHTMLCollection","fragment","isTextNode","setAttribute","toLowerCase","style","cssText","innerText","setAttributes","$fragment","createDocumentFragment","$el","isValidChild","child","append","createTextNode","appendChild","every","ICON","size","color","width","height","defaultRules","cssRules","$icon","$svg","binds","svg","test","isSVG","xmlns","class","icon","removeClass","remove","_removeHeading","$heading","hasAnchor","isAtStart","CLS_HEADING","$anchor","removeAttribute","removeChild","Anchors","super","_default","DEFAULTS","$articleElement","created","getHeadings","count","mounted","_paint","erase","_remove","LIMIT","anchorURL","update","chapterCode","_updateHeading","headingId","href","groupIndex","after","beforeDestroy","afterDestroy","onAnchorTrigger","afterScroll","stickyHeight","clientHeight","min","TAGS","isHTML","html","basic","full","slice","tag","stripScripts","setProperty","documentElement","zIndex","idx","Drawer","title","closed","$modal","$header","$title","$close","$main","$footer","$overlay","setTitle","isClosed","placement","hasClose","hasOverlay","hasOffset","hasPadding","autoHeight","overflow","customClass","mainClassName","content","$content","strHTML","template","open","opened","close","toggle","afterToggle","onClose","closeOnClickModal","afterClosed","afterOpened","at","getStyle","ruleName","getComputedStyle","Navigator","scrollTimer","resizeTimer","observerTimer","Observer","$list","$placeholder","$parentElement","$active","active","offsetWidth","playing","parentElement","$parent","isSticky","isFixed","isInside","isOutside","_paintEdge","animationCurrent","contents","calculateStickyHeight","highlight","sticky","onObserver","clones","parts","byId","chapter","$text","$link","$code","$li","$subject","$chapter","_paintChapters","_getPlaceholderOffset","mainPaddingTop","mainBorderTop","placeholderPaddingTop","placeholderMarginTop","placeholderBorderTop","offsetHeight","positionPlaceholder","ACTIVE","HIGHLIGHT","placeholderOffsetTop","getAttribute","inBounding","parent","parentRect","childRect","isInBounding","getBoundingClientRect","console","log","right","bottom","left","afterSticky","FIXED","isStickying","innerHeight","show","HIDDEN","hide","props","root","rootMargin","IntersectionObserver","entries","entry","intersectionRatio","$root","section","observe","intersection","onSelect","split","onScroll","onResize","unobserve","isPlainObject","getPrototypeOf","proto","isObjectLike","encodeHTML","CHARTS","instances","instance","Message","visible","offset","timer","destroyed","isDestroyed","_getClassName","effect","round","closable","dangerouslyUseHTMLString","$type","$message","iconSize","_refreshIcon","iconName","$use","_refreshMessage","_refreshClose","_refreshEl","clearTimer","startTimer","duration","destroyAfterClosed","beforeClose","onMouseEnter","onMouseLeave","config","len","dom","clear","Command","action","Commands","commands","get","cmd","command","del","_createButton","button","rounded","link","$button","disabled","DISABLED","Toolbar","buttons","isDisabled","isExist","_getCommand","_self","bind","disable","_add","_disable","_enable","enable","enabled","onExecute","afterDisabled","afterEnabled","Speech","utterance","SpeechSynthesisUtterance","_initialize","lang","setLang","pitch","setPitch","rate","setRate","setText","voice","setVoice","volume","setVolume","_addListeners","isSpeaking","speechSynthesis","speaking","isPending","pending","isPaused","paused","getVoices","speak","pause","resume","cancel","speech","onvoiceschanged","isSupport","_updateSiblingElements","siblingElement","isPrev","$sibling","previousElementSibling","nextElementSibling","ENTER_READING_TIP","Reader","reading","$target","$paper","$progress","toolbar","_this$speech","_renderEdge","cloneNode","print","exit","enter","READER","READING","$siblings","enterReadingTip","info","onPrint","onEnterReading","onExitReading","keyCode","allowSpeak","Outline","anchors","drawer","navigator","reader","hasToolbar","_renderReader","_renderAnchors","_renderNavigator","_renderToolbar","_updateToolbar","option","showNavModalFirst","OPTIONS","homepage","git","tags","issues","tools","UP","toTop","HOME","GIT","ISSUES","MENU","PRINT","DOWN","toBottom","addButton","removeButton","_ref","ceil","afterTop","floor","afterDown","enterReading","exitReading","switchReading","_destroy","onToolbarUpdate","_ref2","_window","jQuery","$","outline"],"mappings":"wOAOA,MAAMA,EAAYC,GACTC,OAAOC,UAAUH,SAASI,MAAMH,GCCnCI,EAAcJ,GACI,mBAARA,GAAwC,sBAAlBD,EAASC,GCAzCK,EAAQ,SAACC,GAAoB,IAAhBC,EAAKC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAG,IACzB,QAAKJ,EAAWE,IAITK,YAAW,KAChBL,GAAI,GACHC,EACL,ECRMK,EAAYC,IAEG,oB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A,QACA,IACA,OACA,MACA,MACA,aACA,OACA,KACA,SACA,SACA,UACA,OACA,OACA,MACA,WACA,OACA,WACA,KACA,MACA,UACA,MACA,SACA,MACA,KACA,KACA,KACA,QACA,WACA,aACA,SACA,SACA,OACA,KACA,KACA,KACA,KACA,KACA,KACA,OACA,SACA,SACA,KACA,OACA,IACA,SACA,MACA,QACA,MACA,MACA,QACA,SACA,KACA,OACA,OACA,MACA,OACA,OACA,OACA,WACA,OACA,QACA,MACA,WACA,SACA,KACA,WACA,SACA,SACA,IACA,QACA,UACA,MACA,WACA,IACA,KACA,KACA,KACA,MACA,OACA,IACA,OACA,SACA,SACA,UACA,SACA,OACA,QACA,SACA,OACA,SACA,QACA,MACA,UACA,MACA,MACA,QACA,QACA,KACA,WACA,WACA,QACA,KACA,QACA,OACA,QACA,KACA,QACA,IACA,KACA,MACA,QACA,OCzGIC,EAAUzS,IACd,IAAI0S,EACAC,EACAC,EAEJ,QAAK7S,EAASC,KAKd0S,EAAOpQ,EAAKtC,GAAK6S,MAAM,EAAG,KAC1BF,EAAQ,4DACRC,EAAO,IAAInS,OAAO+R,EAAKrN,KAAK2N,GAAS,IAAGA,eAAgBnF,KAAK,KAAM,KAE5DgF,EAAM9C,KAAK6C,IAASE,EAAK/C,KAAK6C,GAAK,ECtBtCK,GAAgB/S,GACbA,EAAIuC,QAAQ,+BAAgC,ICP/CyQ,GAAcA,CAACvN,EAAM4C,KACD9G,SAAS0R,gBACjB5E,MAAM2E,YAAYvN,EAAM4C,EAAM,ECAhD,IAAI7E,GAAQ,IAEZ,MAAM0P,GAAUC,IACVA,EACF3P,GAAQ2P,EAER3P,IAAS,EAGXwP,GAAY,mBAAqB,GAAExP,MAE5BA,ICKT,MAAM4P,WAAevL,EACnBC,YAAYtD,GACVqM,QAEA9I,KAAK+I,WAEL/I,KAAKmL,OAAS,EAEV1O,GACFuD,KAAKE,WAAWzD,EAEpB,CAEAsM,WAcE,OAbA/I,KAAKC,MAAQzI,EAAU6T,GAA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AQ,UAOE,OANAR,KAAKW,MAAM,iBAEXX,KAAKqd,WAAWtU,WAEhB/I,KAAKW,MAAM,aAEJX,IACT,CAEAsd,gBAAeC,GAAoB,IAAnB1jB,IAAEA,EAAG2Q,IAAEA,EAAGvI,IAAEA,GAAKsb,EAE/B,OADAvd,KAAKyb,eAAe,CAAE5hB,MAAK2Q,MAAKvI,QACzBjC,IACT,CAEAK,eAGE,OAFmBL,KAAKG,KAAK,eAM7BH,KAAKc,IAAI,iBAAkBd,KAAKsd,iBAEzBtd,MALEA,IAMX,CAEAS,kBAGE,OAFmBT,KAAKG,KAAK,eAM7BH,KAAKiB,KAAK,kBAEHjB,MALEA,IAMX,EAwCF,GArCA+a,GAAQ/R,SAkCCxR,EAjCS,CACdkF,eAAgB,WAChBC,SAAU,iBACV4R,cAAe,SACfhV,cAAe,YACf+R,MAAO,KACPjN,SAAU,WACV4N,UAAW,MACX6C,kBAAkB,EAClBnU,UAAU,EACVygB,YAAY,EACZhO,mBAAmB,EACnBuO,mBAAmB,EACnBjS,UAAW,GACXY,aAAc,EACduR,SAAU,GACVC,IAAK,GACLC,KAAM,GACNC,OAAQ,GACRC,MAAO,GACPd,OAAQ,CACNjX,OAAQ,GACRoH,MAAO,GACPkP,gBAAiB,wBACjBM,YAAY,GAEdtO,YAAa,GACb8E,YAAa,KACbpE,YAAa,KACb7C,YAAa,KACbzP,kBAAmB,OAMb,QAAV4iB,GAAI7b,cAAA6b,IAAMA,IAANA,GAAQC,OAAQ,CAClB,MAAMC,EAAI/b,OAAO8b,OAIjBC,EAAE7f,OAAO6f,EAAE5mB,GAAI,CACb6mB,QAAS,SAAUlhB,GAEjB,IAAII,EAAW6gB,EAAE1d,MAEjB,OAAO,IAAI+a,GAET2C,EAAE7f,OAAO,CAAE,EAAEpB,EAAS,CACpBC,eAAgBG,IAGtB,GAEJ"}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/liming0101/outline.js.git
git@gitee.com:liming0101/outline.js.git
liming0101
outline.js
outline.js
master

搜索帮助