@blueking/ai-ui-sdk 0.0.15-beta.2 → 0.0.15-beta.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/images/ai.png +0 -0
- package/dist/assets/images/user.png +0 -0
- package/dist/assets/svg/picture-fail.svg +1 -0
- package/dist/common/util.d.ts +10 -0
- package/dist/common/util.js +34 -0
- package/dist/component/render-image/index.script.vue.js +37 -0
- package/dist/component/render-image/index.vue.d.ts +6 -0
- package/dist/component/render-image/index.vue.js +3 -0
- package/dist/component/render-input/index.script.vue.js +205 -0
- package/dist/component/render-input/index.vue.css +134 -0
- package/dist/component/render-input/index.vue.d.ts +18 -0
- package/dist/component/render-input/index.vue.js +5 -0
- package/dist/component/render-input/render-drag.script.vue.js +61 -0
- package/dist/component/render-input/render-drag.vue.css +32 -0
- package/dist/component/render-input/render-drag.vue.d.ts +13 -0
- package/dist/component/render-input/render-drag.vue.js +5 -0
- package/dist/component/render-input/render-quill.script.vue.js +197 -0
- package/dist/component/render-input/render-quill.vue.css +27 -0
- package/dist/component/render-input/render-quill.vue.d.ts +24 -0
- package/dist/component/render-input/render-quill.vue.js +4 -0
- package/dist/component/render-knowledge-icon/index.script.vue.js +40 -0
- package/dist/component/render-knowledge-icon/index.vue.css +4 -0
- package/dist/component/render-knowledge-icon/index.vue.d.ts +14 -0
- package/dist/component/render-knowledge-icon/index.vue.js +5 -0
- package/dist/component/render-markdown/mark-down-code.d.ts +2 -0
- package/dist/component/render-markdown/mark-down-code.js +171 -0
- package/dist/component/render-markdown/mark-down-emoji.d.ts +2 -0
- package/dist/component/render-markdown/mark-down-emoji.js +4 -0
- package/dist/component/render-markdown/mark-down.d.ts +74 -0
- package/dist/component/render-markdown/mark-down.js +147 -0
- package/dist/component/render-markdown/mark-down.postcss.css +131 -0
- package/dist/component/render-message/index.d.ts +61 -0
- package/dist/component/render-message/index.js +110 -0
- package/dist/component/render-message/openai-message.script.vue.js +215 -0
- package/dist/component/render-message/openai-message.vue.css +98 -0
- package/dist/component/render-message/openai-message.vue.d.ts +15 -0
- package/dist/component/render-message/openai-message.vue.js +5 -0
- package/dist/component/render-message/skeleton-message.script.vue.js +7 -0
- package/dist/component/render-message/skeleton-message.vue.css +7 -0
- package/dist/component/render-message/skeleton-message.vue.d.ts +2 -0
- package/dist/component/render-message/skeleton-message.vue.js +6 -0
- package/dist/component/render-message/system-message.script.vue.js +17 -0
- package/dist/component/render-message/system-message.vue.css +20 -0
- package/dist/component/render-message/system-message.vue.d.ts +6 -0
- package/dist/component/render-message/system-message.vue.js +5 -0
- package/dist/component/render-message/time-message.script.vue.js +41 -0
- package/dist/component/render-message/time-message.vue.css +14 -0
- package/dist/component/render-message/time-message.vue.d.ts +6 -0
- package/dist/component/render-message/time-message.vue.js +5 -0
- package/dist/component/render-message/token-expired-message.script.vue.js +78 -0
- package/dist/component/render-message/token-expired-message.vue.css +60 -0
- package/dist/component/render-message/token-expired-message.vue.d.ts +15 -0
- package/dist/component/render-message/token-expired-message.vue.js +5 -0
- package/dist/component/render-message/user-message.script.vue.js +230 -0
- package/dist/component/render-message/user-message.vue.css +100 -0
- package/dist/component/render-message/user-message.vue.d.ts +21 -0
- package/dist/component/render-message/user-message.vue.js +5 -0
- package/dist/component/render-stop/index.script.vue.js +24 -0
- package/dist/component/render-stop/index.vue.css +20 -0
- package/dist/component/render-stop/index.vue.d.ts +6 -0
- package/dist/component/render-stop/index.vue.js +5 -0
- package/dist/css/fonts/iconcool.eot +0 -0
- package/dist/css/fonts/iconcool.svg +30 -0
- package/dist/css/fonts/iconcool.ttf +0 -0
- package/dist/css/fonts/iconcool.woff +0 -0
- package/dist/css/iconcool.js +1 -1
- package/dist/css/style.css +34 -4
- package/dist/event/index.js +2 -1
- package/dist/hooks/use-chat.d.ts +7 -8
- package/dist/hooks/use-chat.js +82 -28
- package/dist/hooks/use-click-proxy.js +1 -1
- package/dist/hooks/use-http.d.ts +1 -0
- package/dist/hooks/use-http.js +4 -0
- package/dist/hooks/use-mouse-drag.d.ts +13 -0
- package/dist/hooks/use-mouse-drag.js +59 -0
- package/dist/hooks/use-reference-doc.js +4 -4
- package/dist/http/fetch/error-interceptor.js +23 -2
- package/dist/http/fetch/index.js +5 -6
- package/dist/http/helper/agent.d.ts +7 -0
- package/dist/http/helper/agent.js +8 -0
- package/dist/http/helper/session.js +1 -1
- package/dist/main.d.ts +5 -0
- package/dist/main.js +6 -0
- package/dist/node_modules/bkui-vue/lib/icon/angle-double-down-line.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/angle-double-left-line.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/angle-double-left.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/angle-double-right-line.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/angle-double-right.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/angle-double-up-line.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/angle-down-fill.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/angle-down-line.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/angle-down.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/angle-left.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/angle-right.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/angle-up-fill.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/angle-up.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/archive-fill.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/arrows-left.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/arrows-right.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/assistant.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/audio-fill.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/bk.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/circle.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/close-line.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/close.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/code.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/cog-shape.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/collapse-left.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/copy-shape.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/copy.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/data-shape.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/del.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/doc-fill.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/done.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/down-shape.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/down-small.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/edit-line.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/ellipsis.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/enlarge-line.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/error.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/excel-fill.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/exclamation-circle-shape.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/eye.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/filliscreen-line.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/fix-line.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/fix-shape.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/folder-open.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/folder-shape-open.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/folder-shape.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/folder.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/funnel.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/grag-fill.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/help-document-fill.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/help-fill.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/help.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/image-fill.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/img-error.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/img-placehoulder.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/index.js +113 -0
- package/dist/node_modules/bkui-vue/lib/icon/info-line.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/info.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/left-shape.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/left-turn-line.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/loading.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/narrow-line.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/original.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/pdf-fill.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/play-shape.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/plus.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/ppt-fill.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/qq.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/right-shape.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/right-turn-line.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/search.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/share.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/spinner.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/success.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/switcher-loading.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/text-all.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/text-file.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/text-fill.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/transfer.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/tree-application-shape.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/unfull-screen.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/unvisible.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/up-shape.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/upload.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/video-fill.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/warn.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/weixin-pro.js +191 -0
- package/dist/node_modules/bkui-vue/lib/icon/weixin.js +191 -0
- package/dist/node_modules/bkui-vue/lib/styles/reset.css +309 -0
- package/dist/node_modules/call-bind/index.js +24 -0
- package/dist/node_modules/call-bind-apply-helpers/actualApply.js +10 -0
- package/dist/node_modules/call-bind-apply-helpers/applyBind.js +10 -0
- package/dist/node_modules/call-bind-apply-helpers/functionApply.js +4 -0
- package/dist/node_modules/call-bind-apply-helpers/functionCall.js +4 -0
- package/dist/node_modules/call-bind-apply-helpers/index.js +15 -0
- package/dist/node_modules/call-bind-apply-helpers/reflectApply.js +4 -0
- package/dist/node_modules/call-bound/index.js +19 -0
- package/dist/node_modules/deep-equal/index.js +112 -0
- package/dist/node_modules/define-data-property/index.js +56 -0
- package/dist/node_modules/define-properties/index.js +47 -0
- package/dist/node_modules/dunder-proto/get.js +30 -0
- package/dist/node_modules/es-define-property/index.js +14 -0
- package/dist/node_modules/es-errors/eval.js +4 -0
- package/dist/node_modules/es-errors/index.js +4 -0
- package/dist/node_modules/es-errors/range.js +4 -0
- package/dist/node_modules/es-errors/ref.js +4 -0
- package/dist/node_modules/es-errors/syntax.js +4 -0
- package/dist/node_modules/es-errors/type.js +4 -0
- package/dist/node_modules/es-errors/uri.js +4 -0
- package/dist/node_modules/es-object-atoms/index.js +4 -0
- package/dist/node_modules/extend/index.js +117 -0
- package/dist/node_modules/fast-diff/diff.js +738 -0
- package/dist/node_modules/function-bind/implementation.js +84 -0
- package/dist/node_modules/function-bind/index.js +5 -0
- package/dist/node_modules/functions-have-names/index.js +31 -0
- package/dist/node_modules/get-intrinsic/index.js +378 -0
- package/dist/node_modules/get-proto/Object.getPrototypeOf.js +6 -0
- package/dist/node_modules/get-proto/Reflect.getPrototypeOf.js +4 -0
- package/dist/node_modules/get-proto/index.js +27 -0
- package/dist/node_modules/gopd/gOPD.js +4 -0
- package/dist/node_modules/gopd/index.js +15 -0
- package/dist/node_modules/has-property-descriptors/index.js +22 -0
- package/dist/node_modules/has-symbols/index.js +14 -0
- package/dist/node_modules/has-symbols/shams.js +45 -0
- package/dist/node_modules/has-tostringtag/shams.js +8 -0
- package/dist/node_modules/hasown/index.js +8 -0
- package/dist/node_modules/is-arguments/index.js +44 -0
- package/dist/node_modules/is-date-object/index.js +27 -0
- package/dist/node_modules/is-regex/index.js +69 -0
- package/dist/node_modules/math-intrinsics/abs.js +4 -0
- package/dist/node_modules/math-intrinsics/floor.js +4 -0
- package/dist/node_modules/math-intrinsics/isNaN.js +6 -0
- package/dist/node_modules/math-intrinsics/max.js +4 -0
- package/dist/node_modules/math-intrinsics/min.js +4 -0
- package/dist/node_modules/math-intrinsics/pow.js +4 -0
- package/dist/node_modules/math-intrinsics/round.js +4 -0
- package/dist/node_modules/math-intrinsics/sign.js +11 -0
- package/dist/node_modules/object-is/implementation.js +19 -0
- package/dist/node_modules/object-is/index.js +18 -0
- package/dist/node_modules/object-is/polyfill.js +7 -0
- package/dist/node_modules/object-is/shim.js +14 -0
- package/dist/node_modules/object-keys/implementation.js +122 -0
- package/dist/node_modules/object-keys/index.js +32 -0
- package/dist/node_modules/object-keys/isArguments.js +17 -0
- package/dist/node_modules/quill/dist/quill.js +11562 -0
- package/dist/node_modules/quill/dist/quill.snow.css +945 -0
- package/dist/node_modules/quill-delta/lib/delta.js +344 -0
- package/dist/node_modules/quill-delta/lib/op.js +155 -0
- package/dist/node_modules/regexp.prototype.flags/implementation.js +39 -0
- package/dist/node_modules/regexp.prototype.flags/index.js +18 -0
- package/dist/node_modules/regexp.prototype.flags/polyfill.js +39 -0
- package/dist/node_modules/regexp.prototype.flags/shim.js +26 -0
- package/dist/node_modules/set-function-length/index.js +42 -0
- package/dist/node_modules/set-function-name/index.js +23 -0
- package/dist/node_modules/x-mavon-editor/dist/css/index.css +1 -0
- package/dist/node_modules/x-mavon-editor/dist/font/fontello.eot +0 -0
- package/dist/node_modules/x-mavon-editor/dist/font/fontello.svg +72 -0
- package/dist/node_modules/x-mavon-editor/dist/font/fontello.ttf +0 -0
- package/dist/node_modules/x-mavon-editor/dist/font/fontello.woff +0 -0
- package/dist/node_modules/x-mavon-editor/dist/font/fontello.woff2 +0 -0
- package/dist/node_modules/x-mavon-editor/dist/highlightjs/highlight.min.js +1150 -0
- package/dist/node_modules/x-mavon-editor/dist/highlightjs/languages/bash.min.js +20 -0
- package/dist/node_modules/x-mavon-editor/dist/highlightjs/languages/css.min.js +31 -0
- package/dist/node_modules/x-mavon-editor/dist/highlightjs/languages/go.min.js +14 -0
- package/dist/node_modules/x-mavon-editor/dist/highlightjs/languages/java.min.js +37 -0
- package/dist/node_modules/x-mavon-editor/dist/highlightjs/languages/javascript.min.js +76 -0
- package/dist/node_modules/x-mavon-editor/dist/highlightjs/languages/json.min.js +7 -0
- package/dist/node_modules/x-mavon-editor/dist/highlightjs/languages/markdown.min.js +31 -0
- package/dist/node_modules/x-mavon-editor/dist/highlightjs/languages/perl.min.js +36 -0
- package/dist/node_modules/x-mavon-editor/dist/highlightjs/languages/php.min.js +37 -0
- package/dist/node_modules/x-mavon-editor/dist/highlightjs/languages/python.min.js +42 -0
- package/dist/node_modules/x-mavon-editor/dist/highlightjs/languages/ruby.min.js +48 -0
- package/dist/node_modules/x-mavon-editor/dist/highlightjs/languages/sql.min.js +17 -0
- package/dist/node_modules/x-mavon-editor/dist/highlightjs/languages/swift.min.js +60 -0
- package/dist/node_modules/x-mavon-editor/dist/highlightjs/languages/typescript.min.js +92 -0
- package/dist/node_modules/x-mavon-editor/dist/highlightjs/languages/xml.min.js +28 -0
- package/dist/node_modules/x-mavon-editor/dist/highlightjs/styles/atom-one-dark.min.css +1 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_AMS-Regular.ttf +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_AMS-Regular.woff +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_AMS-Regular.woff2 +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Caligraphic-Bold.ttf +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Caligraphic-Bold.woff +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Caligraphic-Regular.ttf +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Caligraphic-Regular.woff +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Fraktur-Bold.ttf +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Fraktur-Bold.woff +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Fraktur-Regular.ttf +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Fraktur-Regular.woff +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Main-Bold.ttf +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Main-Bold.woff +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Main-Bold.woff2 +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Main-BoldItalic.ttf +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Main-BoldItalic.woff +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Main-Italic.ttf +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Main-Italic.woff +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Main-Italic.woff2 +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Main-Regular.ttf +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Main-Regular.woff +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Main-Regular.woff2 +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Math-BoldItalic.ttf +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Math-BoldItalic.woff +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Math-Italic.ttf +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Math-Italic.woff +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Math-Italic.woff2 +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_SansSerif-Bold.ttf +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_SansSerif-Bold.woff +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_SansSerif-Italic.ttf +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_SansSerif-Italic.woff +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_SansSerif-Regular.ttf +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_SansSerif-Regular.woff +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Script-Regular.ttf +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Script-Regular.woff +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Script-Regular.woff2 +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Size1-Regular.ttf +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Size1-Regular.woff +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Size1-Regular.woff2 +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Size2-Regular.ttf +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Size2-Regular.woff +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Size2-Regular.woff2 +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Size3-Regular.ttf +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Size3-Regular.woff +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Size3-Regular.woff2 +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Size4-Regular.ttf +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Size4-Regular.woff +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Size4-Regular.woff2 +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Typewriter-Regular.ttf +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Typewriter-Regular.woff +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/katex.min.css +1 -0
- package/dist/node_modules/x-mavon-editor/dist/katex/katex.min.js +1 -0
- package/dist/node_modules/x-mavon-editor/dist/markdown/github-markdown.min.css +2 -0
- package/dist/node_modules/x-mavon-editor/dist/mavon-editor.js +31 -0
- package/dist/types/agent.d.ts +8 -0
- package/dist/types/enum.d.ts +6 -1
- package/dist/types/enum.js +7 -1
- package/dist/types/model.d.ts +14 -0
- package/dist/types/session.d.ts +4 -2
- package/package.json +10 -4
@@ -0,0 +1,344 @@
|
|
1
|
+
var diff = require('../../fast-diff/diff.js');
|
2
|
+
var equal = require('../../deep-equal/index.js');
|
3
|
+
var extend = require('../../extend/index.js');
|
4
|
+
var op = require('./op.js');
|
5
|
+
|
6
|
+
|
7
|
+
var NULL_CHARACTER = String.fromCharCode(0); // Placeholder char for embed in diff()
|
8
|
+
|
9
|
+
|
10
|
+
var Delta = function (ops) {
|
11
|
+
// Assume we are given a well formed ops
|
12
|
+
if (Array.isArray(ops)) {
|
13
|
+
this.ops = ops;
|
14
|
+
} else if (ops != null && Array.isArray(ops.ops)) {
|
15
|
+
this.ops = ops.ops;
|
16
|
+
} else {
|
17
|
+
this.ops = [];
|
18
|
+
}
|
19
|
+
};
|
20
|
+
|
21
|
+
|
22
|
+
Delta.prototype.insert = function (text, attributes) {
|
23
|
+
var newOp = {};
|
24
|
+
if (text.length === 0) return this;
|
25
|
+
newOp.insert = text;
|
26
|
+
if (attributes != null && typeof attributes === 'object' && Object.keys(attributes).length > 0) {
|
27
|
+
newOp.attributes = attributes;
|
28
|
+
}
|
29
|
+
return this.push(newOp);
|
30
|
+
};
|
31
|
+
|
32
|
+
Delta.prototype['delete'] = function (length) {
|
33
|
+
if (length <= 0) return this;
|
34
|
+
return this.push({ 'delete': length });
|
35
|
+
};
|
36
|
+
|
37
|
+
Delta.prototype.retain = function (length, attributes) {
|
38
|
+
if (length <= 0) return this;
|
39
|
+
var newOp = { retain: length };
|
40
|
+
if (attributes != null && typeof attributes === 'object' && Object.keys(attributes).length > 0) {
|
41
|
+
newOp.attributes = attributes;
|
42
|
+
}
|
43
|
+
return this.push(newOp);
|
44
|
+
};
|
45
|
+
|
46
|
+
Delta.prototype.push = function (newOp) {
|
47
|
+
var index = this.ops.length;
|
48
|
+
var lastOp = this.ops[index - 1];
|
49
|
+
newOp = extend(true, {}, newOp);
|
50
|
+
if (typeof lastOp === 'object') {
|
51
|
+
if (typeof newOp['delete'] === 'number' && typeof lastOp['delete'] === 'number') {
|
52
|
+
this.ops[index - 1] = { 'delete': lastOp['delete'] + newOp['delete'] };
|
53
|
+
return this;
|
54
|
+
}
|
55
|
+
// Since it does not matter if we insert before or after deleting at the same index,
|
56
|
+
// always prefer to insert first
|
57
|
+
if (typeof lastOp['delete'] === 'number' && newOp.insert != null) {
|
58
|
+
index -= 1;
|
59
|
+
lastOp = this.ops[index - 1];
|
60
|
+
if (typeof lastOp !== 'object') {
|
61
|
+
this.ops.unshift(newOp);
|
62
|
+
return this;
|
63
|
+
}
|
64
|
+
}
|
65
|
+
if (equal(newOp.attributes, lastOp.attributes)) {
|
66
|
+
if (typeof newOp.insert === 'string' && typeof lastOp.insert === 'string') {
|
67
|
+
this.ops[index - 1] = { insert: lastOp.insert + newOp.insert };
|
68
|
+
if (typeof newOp.attributes === 'object') this.ops[index - 1].attributes = newOp.attributes
|
69
|
+
return this;
|
70
|
+
} else if (typeof newOp.retain === 'number' && typeof lastOp.retain === 'number') {
|
71
|
+
this.ops[index - 1] = { retain: lastOp.retain + newOp.retain };
|
72
|
+
if (typeof newOp.attributes === 'object') this.ops[index - 1].attributes = newOp.attributes
|
73
|
+
return this;
|
74
|
+
}
|
75
|
+
}
|
76
|
+
}
|
77
|
+
if (index === this.ops.length) {
|
78
|
+
this.ops.push(newOp);
|
79
|
+
} else {
|
80
|
+
this.ops.splice(index, 0, newOp);
|
81
|
+
}
|
82
|
+
return this;
|
83
|
+
};
|
84
|
+
|
85
|
+
Delta.prototype.chop = function () {
|
86
|
+
var lastOp = this.ops[this.ops.length - 1];
|
87
|
+
if (lastOp && lastOp.retain && !lastOp.attributes) {
|
88
|
+
this.ops.pop();
|
89
|
+
}
|
90
|
+
return this;
|
91
|
+
};
|
92
|
+
|
93
|
+
Delta.prototype.filter = function (predicate) {
|
94
|
+
return this.ops.filter(predicate);
|
95
|
+
};
|
96
|
+
|
97
|
+
Delta.prototype.forEach = function (predicate) {
|
98
|
+
this.ops.forEach(predicate);
|
99
|
+
};
|
100
|
+
|
101
|
+
Delta.prototype.map = function (predicate) {
|
102
|
+
return this.ops.map(predicate);
|
103
|
+
};
|
104
|
+
|
105
|
+
Delta.prototype.partition = function (predicate) {
|
106
|
+
var passed = [], failed = [];
|
107
|
+
this.forEach(function(op) {
|
108
|
+
var target = predicate(op) ? passed : failed;
|
109
|
+
target.push(op);
|
110
|
+
});
|
111
|
+
return [passed, failed];
|
112
|
+
};
|
113
|
+
|
114
|
+
Delta.prototype.reduce = function (predicate, initial) {
|
115
|
+
return this.ops.reduce(predicate, initial);
|
116
|
+
};
|
117
|
+
|
118
|
+
Delta.prototype.changeLength = function () {
|
119
|
+
return this.reduce(function (length, elem) {
|
120
|
+
if (elem.insert) {
|
121
|
+
return length + op.length(elem);
|
122
|
+
} else if (elem.delete) {
|
123
|
+
return length - elem.delete;
|
124
|
+
}
|
125
|
+
return length;
|
126
|
+
}, 0);
|
127
|
+
};
|
128
|
+
|
129
|
+
Delta.prototype.length = function () {
|
130
|
+
return this.reduce(function (length, elem) {
|
131
|
+
return length + op.length(elem);
|
132
|
+
}, 0);
|
133
|
+
};
|
134
|
+
|
135
|
+
Delta.prototype.slice = function (start, end) {
|
136
|
+
start = start || 0;
|
137
|
+
if (typeof end !== 'number') end = Infinity;
|
138
|
+
var ops = [];
|
139
|
+
var iter = op.iterator(this.ops);
|
140
|
+
var index = 0;
|
141
|
+
while (index < end && iter.hasNext()) {
|
142
|
+
var nextOp;
|
143
|
+
if (index < start) {
|
144
|
+
nextOp = iter.next(start - index);
|
145
|
+
} else {
|
146
|
+
nextOp = iter.next(end - index);
|
147
|
+
ops.push(nextOp);
|
148
|
+
}
|
149
|
+
index += op.length(nextOp);
|
150
|
+
}
|
151
|
+
return new Delta(ops);
|
152
|
+
};
|
153
|
+
|
154
|
+
|
155
|
+
Delta.prototype.compose = function (other) {
|
156
|
+
var thisIter = op.iterator(this.ops);
|
157
|
+
var otherIter = op.iterator(other.ops);
|
158
|
+
var ops = [];
|
159
|
+
var firstOther = otherIter.peek();
|
160
|
+
if (firstOther != null && typeof firstOther.retain === 'number' && firstOther.attributes == null) {
|
161
|
+
var firstLeft = firstOther.retain;
|
162
|
+
while (thisIter.peekType() === 'insert' && thisIter.peekLength() <= firstLeft) {
|
163
|
+
firstLeft -= thisIter.peekLength();
|
164
|
+
ops.push(thisIter.next());
|
165
|
+
}
|
166
|
+
if (firstOther.retain - firstLeft > 0) {
|
167
|
+
otherIter.next(firstOther.retain - firstLeft);
|
168
|
+
}
|
169
|
+
}
|
170
|
+
var delta = new Delta(ops);
|
171
|
+
while (thisIter.hasNext() || otherIter.hasNext()) {
|
172
|
+
if (otherIter.peekType() === 'insert') {
|
173
|
+
delta.push(otherIter.next());
|
174
|
+
} else if (thisIter.peekType() === 'delete') {
|
175
|
+
delta.push(thisIter.next());
|
176
|
+
} else {
|
177
|
+
var length = Math.min(thisIter.peekLength(), otherIter.peekLength());
|
178
|
+
var thisOp = thisIter.next(length);
|
179
|
+
var otherOp = otherIter.next(length);
|
180
|
+
if (typeof otherOp.retain === 'number') {
|
181
|
+
var newOp = {};
|
182
|
+
if (typeof thisOp.retain === 'number') {
|
183
|
+
newOp.retain = length;
|
184
|
+
} else {
|
185
|
+
newOp.insert = thisOp.insert;
|
186
|
+
}
|
187
|
+
// Preserve null when composing with a retain, otherwise remove it for inserts
|
188
|
+
var attributes = op.attributes.compose(thisOp.attributes, otherOp.attributes, typeof thisOp.retain === 'number');
|
189
|
+
if (attributes) newOp.attributes = attributes;
|
190
|
+
delta.push(newOp);
|
191
|
+
|
192
|
+
// Optimization if rest of other is just retain
|
193
|
+
if (!otherIter.hasNext() && equal(delta.ops[delta.ops.length - 1], newOp)) {
|
194
|
+
var rest = new Delta(thisIter.rest());
|
195
|
+
return delta.concat(rest).chop();
|
196
|
+
}
|
197
|
+
|
198
|
+
// Other op should be delete, we could be an insert or retain
|
199
|
+
// Insert + delete cancels out
|
200
|
+
} else if (typeof otherOp['delete'] === 'number' && typeof thisOp.retain === 'number') {
|
201
|
+
delta.push(otherOp);
|
202
|
+
}
|
203
|
+
}
|
204
|
+
}
|
205
|
+
return delta.chop();
|
206
|
+
};
|
207
|
+
|
208
|
+
Delta.prototype.concat = function (other) {
|
209
|
+
var delta = new Delta(this.ops.slice());
|
210
|
+
if (other.ops.length > 0) {
|
211
|
+
delta.push(other.ops[0]);
|
212
|
+
delta.ops = delta.ops.concat(other.ops.slice(1));
|
213
|
+
}
|
214
|
+
return delta;
|
215
|
+
};
|
216
|
+
|
217
|
+
Delta.prototype.diff = function (other, index) {
|
218
|
+
if (this.ops === other.ops) {
|
219
|
+
return new Delta();
|
220
|
+
}
|
221
|
+
var strings = [this, other].map(function (delta) {
|
222
|
+
return delta.map(function (op) {
|
223
|
+
if (op.insert != null) {
|
224
|
+
return typeof op.insert === 'string' ? op.insert : NULL_CHARACTER;
|
225
|
+
}
|
226
|
+
var prep = (delta === other) ? 'on' : 'with';
|
227
|
+
throw new Error('diff() called ' + prep + ' non-document');
|
228
|
+
}).join('');
|
229
|
+
});
|
230
|
+
var delta = new Delta();
|
231
|
+
var diffResult = diff(strings[0], strings[1], index);
|
232
|
+
var thisIter = op.iterator(this.ops);
|
233
|
+
var otherIter = op.iterator(other.ops);
|
234
|
+
diffResult.forEach(function (component) {
|
235
|
+
var length = component[1].length;
|
236
|
+
while (length > 0) {
|
237
|
+
var opLength = 0;
|
238
|
+
switch (component[0]) {
|
239
|
+
case diff.INSERT:
|
240
|
+
opLength = Math.min(otherIter.peekLength(), length);
|
241
|
+
delta.push(otherIter.next(opLength));
|
242
|
+
break;
|
243
|
+
case diff.DELETE:
|
244
|
+
opLength = Math.min(length, thisIter.peekLength());
|
245
|
+
thisIter.next(opLength);
|
246
|
+
delta['delete'](opLength);
|
247
|
+
break;
|
248
|
+
case diff.EQUAL:
|
249
|
+
opLength = Math.min(thisIter.peekLength(), otherIter.peekLength(), length);
|
250
|
+
var thisOp = thisIter.next(opLength);
|
251
|
+
var otherOp = otherIter.next(opLength);
|
252
|
+
if (equal(thisOp.insert, otherOp.insert)) {
|
253
|
+
delta.retain(opLength, op.attributes.diff(thisOp.attributes, otherOp.attributes));
|
254
|
+
} else {
|
255
|
+
delta.push(otherOp)['delete'](opLength);
|
256
|
+
}
|
257
|
+
break;
|
258
|
+
}
|
259
|
+
length -= opLength;
|
260
|
+
}
|
261
|
+
});
|
262
|
+
return delta.chop();
|
263
|
+
};
|
264
|
+
|
265
|
+
Delta.prototype.eachLine = function (predicate, newline) {
|
266
|
+
newline = newline || '\n';
|
267
|
+
var iter = op.iterator(this.ops);
|
268
|
+
var line = new Delta();
|
269
|
+
var i = 0;
|
270
|
+
while (iter.hasNext()) {
|
271
|
+
if (iter.peekType() !== 'insert') return;
|
272
|
+
var thisOp = iter.peek();
|
273
|
+
var start = op.length(thisOp) - iter.peekLength();
|
274
|
+
var index = typeof thisOp.insert === 'string' ?
|
275
|
+
thisOp.insert.indexOf(newline, start) - start : -1;
|
276
|
+
if (index < 0) {
|
277
|
+
line.push(iter.next());
|
278
|
+
} else if (index > 0) {
|
279
|
+
line.push(iter.next(index));
|
280
|
+
} else {
|
281
|
+
if (predicate(line, iter.next(1).attributes || {}, i) === false) {
|
282
|
+
return;
|
283
|
+
}
|
284
|
+
i += 1;
|
285
|
+
line = new Delta();
|
286
|
+
}
|
287
|
+
}
|
288
|
+
if (line.length() > 0) {
|
289
|
+
predicate(line, {}, i);
|
290
|
+
}
|
291
|
+
};
|
292
|
+
|
293
|
+
Delta.prototype.transform = function (other, priority) {
|
294
|
+
priority = !!priority;
|
295
|
+
if (typeof other === 'number') {
|
296
|
+
return this.transformPosition(other, priority);
|
297
|
+
}
|
298
|
+
var thisIter = op.iterator(this.ops);
|
299
|
+
var otherIter = op.iterator(other.ops);
|
300
|
+
var delta = new Delta();
|
301
|
+
while (thisIter.hasNext() || otherIter.hasNext()) {
|
302
|
+
if (thisIter.peekType() === 'insert' && (priority || otherIter.peekType() !== 'insert')) {
|
303
|
+
delta.retain(op.length(thisIter.next()));
|
304
|
+
} else if (otherIter.peekType() === 'insert') {
|
305
|
+
delta.push(otherIter.next());
|
306
|
+
} else {
|
307
|
+
var length = Math.min(thisIter.peekLength(), otherIter.peekLength());
|
308
|
+
var thisOp = thisIter.next(length);
|
309
|
+
var otherOp = otherIter.next(length);
|
310
|
+
if (thisOp['delete']) {
|
311
|
+
// Our delete either makes their delete redundant or removes their retain
|
312
|
+
continue;
|
313
|
+
} else if (otherOp['delete']) {
|
314
|
+
delta.push(otherOp);
|
315
|
+
} else {
|
316
|
+
// We retain either their retain or insert
|
317
|
+
delta.retain(length, op.attributes.transform(thisOp.attributes, otherOp.attributes, priority));
|
318
|
+
}
|
319
|
+
}
|
320
|
+
}
|
321
|
+
return delta.chop();
|
322
|
+
};
|
323
|
+
|
324
|
+
Delta.prototype.transformPosition = function (index, priority) {
|
325
|
+
priority = !!priority;
|
326
|
+
var thisIter = op.iterator(this.ops);
|
327
|
+
var offset = 0;
|
328
|
+
while (thisIter.hasNext() && offset <= index) {
|
329
|
+
var length = thisIter.peekLength();
|
330
|
+
var nextType = thisIter.peekType();
|
331
|
+
thisIter.next();
|
332
|
+
if (nextType === 'delete') {
|
333
|
+
index -= Math.min(length, index - offset);
|
334
|
+
continue;
|
335
|
+
} else if (nextType === 'insert' && (offset < index || !priority)) {
|
336
|
+
index += length;
|
337
|
+
}
|
338
|
+
offset += length;
|
339
|
+
}
|
340
|
+
return index;
|
341
|
+
};
|
342
|
+
|
343
|
+
|
344
|
+
module.exports = Delta;
|
@@ -0,0 +1,155 @@
|
|
1
|
+
var equal = require('../../deep-equal/index.js');
|
2
|
+
var extend = require('../../extend/index.js');
|
3
|
+
|
4
|
+
|
5
|
+
var lib = {
|
6
|
+
attributes: {
|
7
|
+
compose: function (a, b, keepNull) {
|
8
|
+
if (typeof a !== 'object') a = {};
|
9
|
+
if (typeof b !== 'object') b = {};
|
10
|
+
var attributes = extend(true, {}, b);
|
11
|
+
if (!keepNull) {
|
12
|
+
attributes = Object.keys(attributes).reduce(function (copy, key) {
|
13
|
+
if (attributes[key] != null) {
|
14
|
+
copy[key] = attributes[key];
|
15
|
+
}
|
16
|
+
return copy;
|
17
|
+
}, {});
|
18
|
+
}
|
19
|
+
for (var key in a) {
|
20
|
+
if (a[key] !== undefined && b[key] === undefined) {
|
21
|
+
attributes[key] = a[key];
|
22
|
+
}
|
23
|
+
}
|
24
|
+
return Object.keys(attributes).length > 0 ? attributes : undefined;
|
25
|
+
},
|
26
|
+
|
27
|
+
diff: function(a, b) {
|
28
|
+
if (typeof a !== 'object') a = {};
|
29
|
+
if (typeof b !== 'object') b = {};
|
30
|
+
var attributes = Object.keys(a).concat(Object.keys(b)).reduce(function (attributes, key) {
|
31
|
+
if (!equal(a[key], b[key])) {
|
32
|
+
attributes[key] = b[key] === undefined ? null : b[key];
|
33
|
+
}
|
34
|
+
return attributes;
|
35
|
+
}, {});
|
36
|
+
return Object.keys(attributes).length > 0 ? attributes : undefined;
|
37
|
+
},
|
38
|
+
|
39
|
+
transform: function (a, b, priority) {
|
40
|
+
if (typeof a !== 'object') return b;
|
41
|
+
if (typeof b !== 'object') return undefined;
|
42
|
+
if (!priority) return b; // b simply overwrites us without priority
|
43
|
+
var attributes = Object.keys(b).reduce(function (attributes, key) {
|
44
|
+
if (a[key] === undefined) attributes[key] = b[key]; // null is a valid value
|
45
|
+
return attributes;
|
46
|
+
}, {});
|
47
|
+
return Object.keys(attributes).length > 0 ? attributes : undefined;
|
48
|
+
}
|
49
|
+
},
|
50
|
+
|
51
|
+
iterator: function (ops) {
|
52
|
+
return new Iterator(ops);
|
53
|
+
},
|
54
|
+
|
55
|
+
length: function (op) {
|
56
|
+
if (typeof op['delete'] === 'number') {
|
57
|
+
return op['delete'];
|
58
|
+
} else if (typeof op.retain === 'number') {
|
59
|
+
return op.retain;
|
60
|
+
} else {
|
61
|
+
return typeof op.insert === 'string' ? op.insert.length : 1;
|
62
|
+
}
|
63
|
+
}
|
64
|
+
};
|
65
|
+
|
66
|
+
|
67
|
+
function Iterator(ops) {
|
68
|
+
this.ops = ops;
|
69
|
+
this.index = 0;
|
70
|
+
this.offset = 0;
|
71
|
+
};
|
72
|
+
|
73
|
+
Iterator.prototype.hasNext = function () {
|
74
|
+
return this.peekLength() < Infinity;
|
75
|
+
};
|
76
|
+
|
77
|
+
Iterator.prototype.next = function (length) {
|
78
|
+
if (!length) length = Infinity;
|
79
|
+
var nextOp = this.ops[this.index];
|
80
|
+
if (nextOp) {
|
81
|
+
var offset = this.offset;
|
82
|
+
var opLength = lib.length(nextOp)
|
83
|
+
if (length >= opLength - offset) {
|
84
|
+
length = opLength - offset;
|
85
|
+
this.index += 1;
|
86
|
+
this.offset = 0;
|
87
|
+
} else {
|
88
|
+
this.offset += length;
|
89
|
+
}
|
90
|
+
if (typeof nextOp['delete'] === 'number') {
|
91
|
+
return { 'delete': length };
|
92
|
+
} else {
|
93
|
+
var retOp = {};
|
94
|
+
if (nextOp.attributes) {
|
95
|
+
retOp.attributes = nextOp.attributes;
|
96
|
+
}
|
97
|
+
if (typeof nextOp.retain === 'number') {
|
98
|
+
retOp.retain = length;
|
99
|
+
} else if (typeof nextOp.insert === 'string') {
|
100
|
+
retOp.insert = nextOp.insert.substr(offset, length);
|
101
|
+
} else {
|
102
|
+
// offset should === 0, length should === 1
|
103
|
+
retOp.insert = nextOp.insert;
|
104
|
+
}
|
105
|
+
return retOp;
|
106
|
+
}
|
107
|
+
} else {
|
108
|
+
return { retain: Infinity };
|
109
|
+
}
|
110
|
+
};
|
111
|
+
|
112
|
+
Iterator.prototype.peek = function () {
|
113
|
+
return this.ops[this.index];
|
114
|
+
};
|
115
|
+
|
116
|
+
Iterator.prototype.peekLength = function () {
|
117
|
+
if (this.ops[this.index]) {
|
118
|
+
// Should never return 0 if our index is being managed correctly
|
119
|
+
return lib.length(this.ops[this.index]) - this.offset;
|
120
|
+
} else {
|
121
|
+
return Infinity;
|
122
|
+
}
|
123
|
+
};
|
124
|
+
|
125
|
+
Iterator.prototype.peekType = function () {
|
126
|
+
if (this.ops[this.index]) {
|
127
|
+
if (typeof this.ops[this.index]['delete'] === 'number') {
|
128
|
+
return 'delete';
|
129
|
+
} else if (typeof this.ops[this.index].retain === 'number') {
|
130
|
+
return 'retain';
|
131
|
+
} else {
|
132
|
+
return 'insert';
|
133
|
+
}
|
134
|
+
}
|
135
|
+
return 'retain';
|
136
|
+
};
|
137
|
+
|
138
|
+
Iterator.prototype.rest = function () {
|
139
|
+
if (!this.hasNext()) {
|
140
|
+
return [];
|
141
|
+
} else if (this.offset === 0) {
|
142
|
+
return this.ops.slice(this.index);
|
143
|
+
} else {
|
144
|
+
var offset = this.offset;
|
145
|
+
var index = this.index;
|
146
|
+
var next = this.next();
|
147
|
+
var rest = this.ops.slice(this.index);
|
148
|
+
this.offset = offset;
|
149
|
+
this.index = index;
|
150
|
+
return [next].concat(rest);
|
151
|
+
}
|
152
|
+
};
|
153
|
+
|
154
|
+
|
155
|
+
module.exports = lib;
|
@@ -0,0 +1,39 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
var setFunctionName = require('../set-function-name/index.js');
|
4
|
+
var $TypeError = require('../es-errors/type.js');
|
5
|
+
|
6
|
+
var $Object = Object;
|
7
|
+
|
8
|
+
module.exports = setFunctionName(function flags() {
|
9
|
+
if (this == null || this !== $Object(this)) {
|
10
|
+
throw new $TypeError('RegExp.prototype.flags getter called on non-object');
|
11
|
+
}
|
12
|
+
var result = '';
|
13
|
+
if (this.hasIndices) {
|
14
|
+
result += 'd';
|
15
|
+
}
|
16
|
+
if (this.global) {
|
17
|
+
result += 'g';
|
18
|
+
}
|
19
|
+
if (this.ignoreCase) {
|
20
|
+
result += 'i';
|
21
|
+
}
|
22
|
+
if (this.multiline) {
|
23
|
+
result += 'm';
|
24
|
+
}
|
25
|
+
if (this.dotAll) {
|
26
|
+
result += 's';
|
27
|
+
}
|
28
|
+
if (this.unicode) {
|
29
|
+
result += 'u';
|
30
|
+
}
|
31
|
+
if (this.unicodeSets) {
|
32
|
+
result += 'v';
|
33
|
+
}
|
34
|
+
if (this.sticky) {
|
35
|
+
result += 'y';
|
36
|
+
}
|
37
|
+
return result;
|
38
|
+
}, 'get flags', true);
|
39
|
+
|
@@ -0,0 +1,18 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
var define = require('../define-properties/index.js');
|
4
|
+
var callBind = require('../call-bind/index.js');
|
5
|
+
|
6
|
+
var implementation = require('./implementation.js');
|
7
|
+
var getPolyfill = require('./polyfill.js');
|
8
|
+
var shim = require('./shim.js');
|
9
|
+
|
10
|
+
var flagsBound = callBind(getPolyfill());
|
11
|
+
|
12
|
+
define(flagsBound, {
|
13
|
+
getPolyfill: getPolyfill,
|
14
|
+
implementation: implementation,
|
15
|
+
shim: shim
|
16
|
+
});
|
17
|
+
|
18
|
+
module.exports = flagsBound;
|
@@ -0,0 +1,39 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
var implementation = require('./implementation.js');
|
4
|
+
|
5
|
+
var supportsDescriptors = require('../define-properties/index.js').supportsDescriptors;
|
6
|
+
var $gOPD = Object.getOwnPropertyDescriptor;
|
7
|
+
|
8
|
+
module.exports = function getPolyfill() {
|
9
|
+
if (supportsDescriptors && (/a/mig).flags === 'gim') {
|
10
|
+
var descriptor = $gOPD(RegExp.prototype, 'flags');
|
11
|
+
if (
|
12
|
+
descriptor
|
13
|
+
&& typeof descriptor.get === 'function'
|
14
|
+
&& 'dotAll' in RegExp.prototype
|
15
|
+
&& 'hasIndices' in RegExp.prototype
|
16
|
+
) {
|
17
|
+
/* eslint getter-return: 0 */
|
18
|
+
var calls = '';
|
19
|
+
var o = {};
|
20
|
+
Object.defineProperty(o, 'hasIndices', {
|
21
|
+
get: function () {
|
22
|
+
calls += 'd';
|
23
|
+
}
|
24
|
+
});
|
25
|
+
Object.defineProperty(o, 'sticky', {
|
26
|
+
get: function () {
|
27
|
+
calls += 'y';
|
28
|
+
}
|
29
|
+
});
|
30
|
+
|
31
|
+
descriptor.get.call(o);
|
32
|
+
|
33
|
+
if (calls === 'dy') {
|
34
|
+
return descriptor.get;
|
35
|
+
}
|
36
|
+
}
|
37
|
+
}
|
38
|
+
return implementation;
|
39
|
+
};
|
@@ -0,0 +1,26 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
var supportsDescriptors = require('../define-properties/index.js').supportsDescriptors;
|
4
|
+
var getPolyfill = require('./polyfill.js');
|
5
|
+
var gOPD = require('../gopd/index.js');
|
6
|
+
var defineProperty = Object.defineProperty;
|
7
|
+
var $TypeError = require('../es-errors/index.js');
|
8
|
+
var getProto = require('../get-proto/index.js');
|
9
|
+
var regex = /a/;
|
10
|
+
|
11
|
+
module.exports = function shimFlags() {
|
12
|
+
if (!supportsDescriptors || !getProto) {
|
13
|
+
throw new $TypeError('RegExp.prototype.flags requires a true ES5 environment that supports property descriptors');
|
14
|
+
}
|
15
|
+
var polyfill = getPolyfill();
|
16
|
+
var proto = getProto(regex);
|
17
|
+
var descriptor = gOPD(proto, 'flags');
|
18
|
+
if (!descriptor || descriptor.get !== polyfill) {
|
19
|
+
defineProperty(proto, 'flags', {
|
20
|
+
configurable: true,
|
21
|
+
enumerable: false,
|
22
|
+
get: polyfill
|
23
|
+
});
|
24
|
+
}
|
25
|
+
return polyfill;
|
26
|
+
};
|
@@ -0,0 +1,42 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
var GetIntrinsic = require('../get-intrinsic/index.js');
|
4
|
+
var define = require('../define-data-property/index.js');
|
5
|
+
var hasDescriptors = require('../has-property-descriptors/index.js')();
|
6
|
+
var gOPD = require('../gopd/index.js');
|
7
|
+
|
8
|
+
var $TypeError = require('../es-errors/type.js');
|
9
|
+
var $floor = GetIntrinsic('%Math.floor%');
|
10
|
+
|
11
|
+
/** @type {import('.')} */
|
12
|
+
module.exports = function setFunctionLength(fn, length) {
|
13
|
+
if (typeof fn !== 'function') {
|
14
|
+
throw new $TypeError('`fn` is not a function');
|
15
|
+
}
|
16
|
+
if (typeof length !== 'number' || length < 0 || length > 0xFFFFFFFF || $floor(length) !== length) {
|
17
|
+
throw new $TypeError('`length` must be a positive 32-bit integer');
|
18
|
+
}
|
19
|
+
|
20
|
+
var loose = arguments.length > 2 && !!arguments[2];
|
21
|
+
|
22
|
+
var functionLengthIsConfigurable = true;
|
23
|
+
var functionLengthIsWritable = true;
|
24
|
+
if ('length' in fn && gOPD) {
|
25
|
+
var desc = gOPD(fn, 'length');
|
26
|
+
if (desc && !desc.configurable) {
|
27
|
+
functionLengthIsConfigurable = false;
|
28
|
+
}
|
29
|
+
if (desc && !desc.writable) {
|
30
|
+
functionLengthIsWritable = false;
|
31
|
+
}
|
32
|
+
}
|
33
|
+
|
34
|
+
if (functionLengthIsConfigurable || functionLengthIsWritable || !loose) {
|
35
|
+
if (hasDescriptors) {
|
36
|
+
define(/** @type {Parameters<define>[0]} */ (fn), 'length', length, true, true);
|
37
|
+
} else {
|
38
|
+
define(/** @type {Parameters<define>[0]} */ (fn), 'length', length);
|
39
|
+
}
|
40
|
+
}
|
41
|
+
return fn;
|
42
|
+
};
|
@@ -0,0 +1,23 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
var define = require('../define-data-property/index.js');
|
4
|
+
var hasDescriptors = require('../has-property-descriptors/index.js')();
|
5
|
+
var functionsHaveConfigurableNames = require('../functions-have-names/index.js').functionsHaveConfigurableNames();
|
6
|
+
|
7
|
+
var $TypeError = require('../es-errors/type.js');
|
8
|
+
|
9
|
+
/** @type {import('.')} */
|
10
|
+
module.exports = function setFunctionName(fn, name) {
|
11
|
+
if (typeof fn !== 'function') {
|
12
|
+
throw new $TypeError('`fn` is not a function');
|
13
|
+
}
|
14
|
+
var loose = arguments.length > 2 && !!arguments[2];
|
15
|
+
if (!loose || functionsHaveConfigurableNames) {
|
16
|
+
if (hasDescriptors) {
|
17
|
+
define(/** @type {Parameters<define>[0]} */ (fn), 'name', name, true, true);
|
18
|
+
} else {
|
19
|
+
define(/** @type {Parameters<define>[0]} */ (fn), 'name', name);
|
20
|
+
}
|
21
|
+
}
|
22
|
+
return fn;
|
23
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
.auto-textarea-wrapper[data-v-152346ef]{height:100%}.markdown-body strong{font-weight:bolder}.markdown-body .hljs-center{text-align:center}.markdown-body .hljs-right{text-align:right}.markdown-body .hljs-left{text-align:left}.markdown-body .hljs{overflow:auto}@font-face{font-family:fontello;src:url(../font/fontello.eot);src:url(../font/fontello.eot) format("embedded-opentype"),url(../font/fontello.woff2) format("woff2"),url(../font/fontello.woff) format("woff"),url(../font/fontello.ttf) format("truetype"),url(../font/fontello.svg) format("svg");font-weight:400;font-style:normal}[class*=" fa-mavon-"]:before,[class^=fa-mavon-]:before{font-family:fontello;font-style:normal;font-weight:400;speak:none;display:inline-block;text-decoration:inherit;width:1em;margin-right:.2em;text-align:center;font-variant:normal;text-transform:none;line-height:1em;margin-left:.2em;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.fa-mavon-bold:before{content:"\e800"}.fa-mavon-italic:before{content:"\e801"}.fa-mavon-thumb-tack:before{content:"\e802"}.fa-mavon-link:before{content:"\e803"}.fa-mavon-picture-o:before{content:"\e804"}.fa-mavon-repeat:before{content:"\e805"}.fa-mavon-undo:before{content:"\e806"}.fa-mavon-trash-o:before{content:"\e807"}.fa-mavon-floppy-o:before{content:"\e808"}.fa-mavon-compress:before{content:"\e809"}.fa-mavon-eye:before{content:"\e80a"}.fa-mavon-eye-slash:before{content:"\e80b"}.fa-mavon-question-circle:before{content:"\e80c"}.fa-mavon-times:before{content:"\e80d"}.fa-mavon-align-left:before{content:"\e80f"}.fa-mavon-align-center:before{content:"\e810"}.fa-mavon-align-right:before{content:"\e811"}.fa-mavon-arrows-alt:before{content:"\f0b2"}.fa-mavon-bars:before{content:"\f0c9"}.fa-mavon-list-ul:before{content:"\f0ca"}.fa-mavon-list-ol:before{content:"\f0cb"}.fa-mavon-strikethrough:before{content:"\f0cc"}.fa-mavon-underline:before{content:"\f0cd"}.fa-mavon-table:before{content:"\f0ce"}.fa-mavon-columns:before{content:"\f0db"}.fa-mavon-quote-left:before{content:"\f10d"}.fa-mavon-code:before{content:"\f121"}.fa-mavon-superscript:before{content:"\f12b"}.fa-mavon-subscript:before{content:"\f12c"}.fa-mavon-header:before{content:"\f1dc"}.fa-mavon-window-maximize:before{content:"\f2d0"}
|
Binary file
|