@kg-ui/kg-ui-plus 0.1.30 → 0.1.32
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/es/KgCopilot/CopiCanvas/FilePreview.vue.mjs +7 -0
- package/dist/es/KgCopilot/CopiCanvas/FilePreview.vue2.mjs +81 -0
- package/dist/es/KgCopilot/CopiCanvas/FilePreview.vue3.mjs +4 -0
- package/dist/es/KgCopilot/CopiCanvas/FileSkeletion.vue.mjs +96 -0
- package/dist/es/KgCopilot/CopiCanvas/FileSkeletion.vue2.mjs +4 -0
- package/dist/es/KgCopilot/CopiCanvas/InitWrap.vue.mjs +7 -0
- package/dist/es/KgCopilot/CopiCanvas/InitWrap.vue2.mjs +41 -0
- package/dist/es/KgCopilot/CopiCanvas/InitWrap.vue3.mjs +4 -0
- package/dist/es/KgCopilot/CopiCanvas/index.vue.mjs +7 -0
- package/dist/es/KgCopilot/CopiCanvas/index.vue2.mjs +52 -0
- package/dist/es/KgCopilot/CopiCanvas/index.vue3.mjs +4 -0
- package/dist/es/KgCopilot/CopiFooter/SearchInput/InputFootTool.vue.mjs +7 -0
- package/dist/es/KgCopilot/CopiFooter/SearchInput/InputFootTool.vue2.mjs +61 -0
- package/dist/es/KgCopilot/CopiFooter/SearchInput/InputFootTool.vue3.mjs +4 -0
- package/dist/es/KgCopilot/CopiFooter/SearchInput/SelectPluginByKey.vue2.mjs +1 -1
- package/dist/es/KgCopilot/CopiFooter/SearchInput/index.vue.mjs +1 -1
- package/dist/es/KgCopilot/CopiFooter/SearchInput/index.vue2.mjs +34 -22
- package/dist/es/KgCopilot/CopiFooter/SearchInput/index.vue3.mjs +2 -2
- package/dist/es/KgCopilot/CopiFooter/index.vue.mjs +1 -1
- package/dist/es/KgCopilot/CopiFooter/index.vue3.mjs +2 -2
- package/dist/es/KgCopilot/dialogue/SuggestMessage.vue.mjs +7 -0
- package/dist/es/KgCopilot/dialogue/SuggestMessage.vue2.mjs +50 -0
- package/dist/es/KgCopilot/dialogue/SuggestMessage.vue3.mjs +4 -0
- package/dist/es/KgCopilot/dialogue/index.vue.mjs +1 -1
- package/dist/es/KgCopilot/dialogue/index.vue2.mjs +10 -4
- package/dist/es/KgCopilot/dialogue/index.vue3.mjs +2 -2
- package/dist/es/KgCopilot/dialogue/messageParse/fileBox.vue.mjs +19 -5
- package/dist/es/KgCopilot/dialogue/messageParse/fileBox.vue2.mjs +2 -2
- package/dist/es/KgCopilot/dialogue/messageParse/readMd.vue2.mjs +1 -1
- package/dist/es/KgCopilot/historyRecord/index.vue.mjs +1 -1
- package/dist/es/KgCopilot/historyRecord/index.vue2.mjs +6 -6
- package/dist/es/KgCopilot/historyRecord/index.vue3.mjs +2 -2
- package/dist/es/KgCopilot/index.vue.mjs +1 -1
- package/dist/es/KgCopilot/index.vue2.mjs +62 -39
- package/dist/es/KgCopilot/index.vue3.mjs +2 -2
- package/dist/es/_virtual/_commonjs-dynamic-modules.mjs +6 -0
- package/dist/es/_virtual/jszip.min.mjs +13 -0
- package/dist/es/api/copilot.mjs +8 -0
- package/dist/es/assets/empty.png.mjs +4 -0
- package/dist/es/directives/heighlight/index.mjs +27 -27
- package/dist/es/home/LFilter/FilterHead.vue.mjs +1 -1
- package/dist/es/node_modules/.pnpm/@iconify-icons_ep@1.2.12/node_modules/@iconify-icons/ep/folder-opened.mjs +8 -0
- package/dist/es/node_modules/.pnpm/@iconify-icons_ep@1.2.12/node_modules/@iconify-icons/ep/notebook.mjs +8 -0
- package/dist/es/node_modules/.pnpm/@iconify-icons_ep@1.2.12/node_modules/@iconify-icons/ep/reading.mjs +8 -0
- package/dist/es/node_modules/.pnpm/@vueuse_core@9.13.0_vue@3.2.45/node_modules/@vueuse/core/index.mjs +8 -1
- package/dist/es/node_modules/.pnpm/@vueuse_shared@9.13.0_vue@3.2.45/node_modules/@vueuse/shared/index.mjs +115 -2
- package/dist/es/node_modules/.pnpm/call-bind-apply-helpers@1.0.1/node_modules/call-bind-apply-helpers/actualApply.mjs +12 -0
- package/dist/es/node_modules/.pnpm/call-bind-apply-helpers@1.0.1/node_modules/call-bind-apply-helpers/functionApply.mjs +12 -0
- package/dist/es/node_modules/.pnpm/call-bind-apply-helpers@1.0.1/node_modules/call-bind-apply-helpers/functionCall.mjs +4 -0
- package/dist/es/node_modules/.pnpm/call-bind-apply-helpers@1.0.1/node_modules/call-bind-apply-helpers/index.mjs +17 -0
- package/dist/es/node_modules/.pnpm/call-bind-apply-helpers@1.0.1/node_modules/call-bind-apply-helpers/reflectApply.mjs +4 -0
- package/dist/es/node_modules/.pnpm/call-bound@1.0.3/node_modules/call-bound/index.mjs +18 -0
- package/dist/es/node_modules/.pnpm/docx-preview@0.3.3/node_modules/docx-preview/dist/docx-preview.mjs +3877 -0
- package/dist/es/node_modules/.pnpm/{dompurify@3.1.5 → dompurify@3.2.3}/node_modules/dompurify/dist/purify.es.mjs +78 -87
- package/dist/es/node_modules/.pnpm/dunder-proto@1.0.1/node_modules/dunder-proto/get.mjs +37 -0
- package/dist/es/node_modules/.pnpm/es-define-property@1.0.1/node_modules/es-define-property/index.mjs +12 -0
- package/dist/es/node_modules/.pnpm/es-object-atoms@1.0.0/node_modules/es-object-atoms/index.mjs +4 -0
- package/dist/es/node_modules/.pnpm/{get-intrinsic@1.2.4 → get-intrinsic@1.2.6}/node_modules/get-intrinsic/index.mjs +43 -24
- package/dist/es/node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/gOPD.mjs +4 -0
- package/dist/es/node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/index.mjs +13 -0
- package/dist/es/node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/index.mjs +29 -0
- package/dist/es/node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/shams.mjs +59 -0
- package/dist/es/node_modules/.pnpm/hasown@2.0.2/node_modules/hasown/index.mjs +13 -5
- package/dist/es/node_modules/.pnpm/{highlight.js@11.9.0 → highlight.js@11.11.1}/node_modules/highlight.js/es/languages/apache.mjs +4 -0
- package/dist/es/node_modules/.pnpm/{highlight.js@11.9.0 → highlight.js@11.11.1}/node_modules/highlight.js/es/languages/bash.mjs +20 -2
- package/dist/es/node_modules/.pnpm/{highlight.js@11.9.0 → highlight.js@11.11.1}/node_modules/highlight.js/es/languages/basic.mjs +7 -1
- package/dist/es/node_modules/.pnpm/{highlight.js@11.9.0 → highlight.js@11.11.1}/node_modules/highlight.js/es/languages/c.mjs +19 -4
- package/dist/es/node_modules/.pnpm/{highlight.js@11.9.0 → highlight.js@11.11.1}/node_modules/highlight.js/es/languages/css.mjs +214 -8
- package/dist/es/node_modules/.pnpm/{highlight.js@11.9.0 → highlight.js@11.11.1}/node_modules/highlight.js/es/languages/dart.mjs +10 -2
- package/dist/es/node_modules/.pnpm/{highlight.js@11.9.0 → highlight.js@11.11.1}/node_modules/highlight.js/es/languages/erlang.mjs +48 -6
- package/dist/es/node_modules/.pnpm/{highlight.js@11.9.0 → highlight.js@11.11.1}/node_modules/highlight.js/es/languages/go.mjs +23 -3
- package/dist/es/node_modules/.pnpm/{highlight.js@11.9.0 → highlight.js@11.11.1}/node_modules/highlight.js/es/languages/java.mjs +3 -1
- package/dist/es/node_modules/.pnpm/{highlight.js@11.9.0 → highlight.js@11.11.1}/node_modules/highlight.js/es/languages/javascript.mjs +15 -11
- package/dist/es/node_modules/.pnpm/{highlight.js@11.9.0 → highlight.js@11.11.1}/node_modules/highlight.js/es/languages/json.mjs +1 -0
- package/dist/es/node_modules/.pnpm/{highlight.js@11.9.0 → highlight.js@11.11.1}/node_modules/highlight.js/es/languages/markdown.mjs +7 -1
- package/dist/es/node_modules/.pnpm/{highlight.js@11.9.0 → highlight.js@11.11.1}/node_modules/highlight.js/es/languages/php.mjs +16 -2
- package/dist/es/node_modules/.pnpm/{highlight.js@11.9.0 → highlight.js@11.11.1}/node_modules/highlight.js/es/languages/python.mjs +3 -1
- package/dist/es/node_modules/.pnpm/{highlight.js@11.9.0 → highlight.js@11.11.1}/node_modules/highlight.js/es/languages/ruby.mjs +1 -1
- package/dist/es/node_modules/.pnpm/{highlight.js@11.9.0 → highlight.js@11.11.1}/node_modules/highlight.js/es/languages/stylus.mjs +214 -8
- package/dist/es/node_modules/.pnpm/{highlight.js@11.9.0 → highlight.js@11.11.1}/node_modules/highlight.js/es/languages/swift.mjs +60 -14
- package/dist/es/node_modules/.pnpm/{highlight.js@11.9.0 → highlight.js@11.11.1}/node_modules/highlight.js/es/languages/typescript.mjs +45 -18
- package/dist/es/node_modules/.pnpm/{highlight.js@11.9.0 → highlight.js@11.11.1}/node_modules/highlight.js/lib/core.mjs +8 -8
- package/dist/es/node_modules/.pnpm/jszip@3.10.1/node_modules/jszip/dist/jszip.min.mjs +2649 -0
- package/dist/es/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/abs.mjs +4 -0
- package/dist/es/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/floor.mjs +4 -0
- package/dist/es/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/max.mjs +4 -0
- package/dist/es/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/min.mjs +4 -0
- package/dist/es/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/pow.mjs +4 -0
- package/dist/es/node_modules/.pnpm/{object-inspect@1.13.1 → object-inspect@1.13.3}/node_modules/object-inspect/index.mjs +17 -4
- package/dist/es/node_modules/.pnpm/qs@6.11.0/node_modules/qs/lib/stringify.mjs +1 -1
- package/dist/es/node_modules/.pnpm/side-channel-list@1.0.0/node_modules/side-channel-list/index.mjs +92 -0
- package/dist/es/node_modules/.pnpm/side-channel-map@1.0.1/node_modules/side-channel-map/index.mjs +56 -0
- package/dist/es/node_modules/.pnpm/side-channel-weakmap@1.0.2/node_modules/side-channel-weakmap/index.mjs +74 -0
- package/dist/es/node_modules/.pnpm/side-channel@1.1.0/node_modules/side-channel/index.mjs +40 -0
- package/dist/es/store/modules/copilot.mjs +68 -8
- package/dist/es/style.css +1 -1
- package/dist/es/utils/http/index.mjs +1 -1
- package/package.json +3 -2
- package/dist/es/_virtual/index.mjs +0 -13
- package/dist/es/node_modules/.pnpm/call-bind@1.0.7/node_modules/call-bind/callBound.mjs +0 -16
- package/dist/es/node_modules/.pnpm/call-bind@1.0.7/node_modules/call-bind/index.mjs +0 -36
- package/dist/es/node_modules/.pnpm/define-data-property@1.1.4/node_modules/define-data-property/index.mjs +0 -48
- package/dist/es/node_modules/.pnpm/es-define-property@1.0.0/node_modules/es-define-property/index.mjs +0 -22
- package/dist/es/node_modules/.pnpm/gopd@1.0.1/node_modules/gopd/index.mjs +0 -14
- package/dist/es/node_modules/.pnpm/has-property-descriptors@1.0.2/node_modules/has-property-descriptors/index.mjs +0 -19
- package/dist/es/node_modules/.pnpm/has-proto@1.0.3/node_modules/has-proto/index.mjs +0 -11
- package/dist/es/node_modules/.pnpm/has-symbols@1.0.3/node_modules/has-symbols/index.mjs +0 -21
- package/dist/es/node_modules/.pnpm/has-symbols@1.0.3/node_modules/has-symbols/shams.mjs +0 -48
- package/dist/es/node_modules/.pnpm/set-function-length@1.2.2/node_modules/set-function-length/index.mjs +0 -54
- package/dist/es/node_modules/.pnpm/side-channel@1.0.6/node_modules/side-channel/index.mjs +0 -115
- /package/dist/es/node_modules/.pnpm/{@iconify-icons_ep@1.2.7 → @iconify-icons_ep@1.2.12}/node_modules/@iconify-icons/ep/arrow-left.mjs +0 -0
- /package/dist/es/node_modules/.pnpm/{@iconify-icons_ep@1.2.7 → @iconify-icons_ep@1.2.12}/node_modules/@iconify-icons/ep/arrow-right.mjs +0 -0
- /package/dist/es/node_modules/.pnpm/{@iconify-icons_ep@1.2.7 → @iconify-icons_ep@1.2.12}/node_modules/@iconify-icons/ep/check.mjs +0 -0
- /package/dist/es/node_modules/.pnpm/{@iconify-icons_ep@1.2.7 → @iconify-icons_ep@1.2.12}/node_modules/@iconify-icons/ep/close.mjs +0 -0
- /package/dist/es/node_modules/.pnpm/{@iconify-icons_ep@1.2.7 → @iconify-icons_ep@1.2.12}/node_modules/@iconify-icons/ep/delete.mjs +0 -0
- /package/dist/es/node_modules/.pnpm/{@iconify-icons_ep@1.2.7 → @iconify-icons_ep@1.2.12}/node_modules/@iconify-icons/ep/edit.mjs +0 -0
- /package/dist/es/node_modules/.pnpm/{@iconify-icons_ep@1.2.7 → @iconify-icons_ep@1.2.12}/node_modules/@iconify-icons/ep/promotion.mjs +0 -0
- /package/dist/es/node_modules/.pnpm/{@iconify-icons_ep@1.2.7 → @iconify-icons_ep@1.2.12}/node_modules/@iconify-icons/ep/search.mjs +0 -0
- /package/dist/es/node_modules/.pnpm/{highlight.js@11.9.0 → highlight.js@11.11.1}/node_modules/highlight.js/es/core.mjs +0 -0
- /package/dist/es/node_modules/.pnpm/{highlight.js@11.9.0 → highlight.js@11.11.1}/node_modules/highlight.js/es/languages/django.mjs +0 -0
- /package/dist/es/node_modules/.pnpm/{highlight.js@11.9.0 → highlight.js@11.11.1}/node_modules/highlight.js/es/languages/dns.mjs +0 -0
- /package/dist/es/node_modules/.pnpm/{highlight.js@11.9.0 → highlight.js@11.11.1}/node_modules/highlight.js/es/languages/dos.mjs +0 -0
- /package/dist/es/node_modules/.pnpm/{highlight.js@11.9.0 → highlight.js@11.11.1}/node_modules/highlight.js/es/languages/dust.mjs +0 -0
- /package/dist/es/node_modules/.pnpm/{highlight.js@11.9.0 → highlight.js@11.11.1}/node_modules/highlight.js/es/languages/http.mjs +0 -0
- /package/dist/es/node_modules/.pnpm/{highlight.js@11.9.0 → highlight.js@11.11.1}/node_modules/highlight.js/es/languages/nginx.mjs +0 -0
- /package/dist/es/node_modules/.pnpm/{highlight.js@11.9.0 → highlight.js@11.11.1}/node_modules/highlight.js/es/languages/xml.mjs +0 -0
- /package/dist/es/node_modules/.pnpm/{highlight.js@11.9.0 → highlight.js@11.11.1}/node_modules/highlight.js/styles/sunburst.css.mjs +0 -0
@@ -0,0 +1,8 @@
|
|
1
|
+
const data = {
|
2
|
+
"width": 1024,
|
3
|
+
"height": 1024,
|
4
|
+
"body": '<path fill="currentColor" d="M878.08 448H241.92l-96 384h636.16l96-384zM832 384v-64H485.76L357.504 192H128v448l57.92-231.744A32 32 0 0 1 216.96 384H832zm-24.96 512H96a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32h287.872l128.384 128H864a32 32 0 0 1 32 32v96h23.04a32 32 0 0 1 31.04 39.744l-112 448A32 32 0 0 1 807.04 896z"/>'
|
5
|
+
};
|
6
|
+
export {
|
7
|
+
data as default
|
8
|
+
};
|
@@ -0,0 +1,8 @@
|
|
1
|
+
const data = {
|
2
|
+
"width": 1024,
|
3
|
+
"height": 1024,
|
4
|
+
"body": '<path fill="currentColor" d="M192 128v768h640V128H192zm-32-64h704a32 32 0 0 1 32 32v832a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V96a32 32 0 0 1 32-32z"/><path fill="currentColor" d="M672 128h64v768h-64zM96 192h128q32 0 32 32t-32 32H96q-32 0-32-32t32-32zm0 192h128q32 0 32 32t-32 32H96q-32 0-32-32t32-32zm0 192h128q32 0 32 32t-32 32H96q-32 0-32-32t32-32zm0 192h128q32 0 32 32t-32 32H96q-32 0-32-32t32-32z"/>'
|
5
|
+
};
|
6
|
+
export {
|
7
|
+
data as default
|
8
|
+
};
|
@@ -0,0 +1,8 @@
|
|
1
|
+
const data = {
|
2
|
+
"width": 1024,
|
3
|
+
"height": 1024,
|
4
|
+
"body": '<path fill="currentColor" d="m512 863.36l384-54.848v-638.72L525.568 222.72a96 96 0 0 1-27.136 0L128 169.792v638.72l384 54.848zM137.024 106.432l370.432 52.928a32 32 0 0 0 9.088 0l370.432-52.928A64 64 0 0 1 960 169.792v638.72a64 64 0 0 1-54.976 63.36l-388.48 55.488a32 32 0 0 1-9.088 0l-388.48-55.488A64 64 0 0 1 64 808.512v-638.72a64 64 0 0 1 73.024-63.36z"/><path fill="currentColor" d="M480 192h64v704h-64z"/>'
|
5
|
+
};
|
6
|
+
export {
|
7
|
+
data as default
|
8
|
+
};
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { identity, isFunction, isDef } from "../../../../@vueuse_shared@9.13.0_vue@3.2.45/node_modules/@vueuse/shared/index.mjs";
|
2
|
-
import { isClient } from "../../../../@vueuse_shared@9.13.0_vue@3.2.45/node_modules/@vueuse/shared/index.mjs";
|
2
|
+
import { createFilterWrapper, debounceFilter, isClient, noop, resolveUnref, throttleFilter, useDebounceFn, useThrottleFn } from "../../../../@vueuse_shared@9.13.0_vue@3.2.45/node_modules/@vueuse/shared/index.mjs";
|
3
3
|
import { getCurrentInstance, ref, watch, computed } from "vue";
|
4
4
|
function cloneFnJSON(source) {
|
5
5
|
return JSON.parse(JSON.stringify(source));
|
@@ -103,9 +103,16 @@ function useVModel(props, key, emit, options = {}) {
|
|
103
103
|
export {
|
104
104
|
SwipeDirection,
|
105
105
|
cloneFnJSON,
|
106
|
+
createFilterWrapper,
|
107
|
+
debounceFilter,
|
106
108
|
identity,
|
107
109
|
isClient,
|
108
110
|
isDef,
|
109
111
|
isFunction,
|
112
|
+
noop,
|
113
|
+
resolveUnref,
|
114
|
+
throttleFilter,
|
115
|
+
useDebounceFn,
|
116
|
+
useThrottleFn,
|
110
117
|
useVModel
|
111
118
|
};
|
@@ -1,15 +1,128 @@
|
|
1
|
-
import "vue";
|
1
|
+
import { unref } from "vue";
|
2
2
|
var _a;
|
3
3
|
const isClient = typeof window !== "undefined";
|
4
4
|
const isDef = (val) => typeof val !== "undefined";
|
5
5
|
const isFunction = (val) => typeof val === "function";
|
6
|
+
const noop = () => {
|
7
|
+
};
|
6
8
|
isClient && ((_a = window == null ? void 0 : window.navigator) == null ? void 0 : _a.userAgent) && /iP(ad|hone|od)/.test(window.navigator.userAgent);
|
9
|
+
function resolveUnref(r) {
|
10
|
+
return typeof r === "function" ? r() : unref(r);
|
11
|
+
}
|
12
|
+
function createFilterWrapper(filter, fn) {
|
13
|
+
function wrapper(...args) {
|
14
|
+
return new Promise((resolve, reject) => {
|
15
|
+
Promise.resolve(filter(() => fn.apply(this, args), { fn, thisArg: this, args })).then(resolve).catch(reject);
|
16
|
+
});
|
17
|
+
}
|
18
|
+
return wrapper;
|
19
|
+
}
|
20
|
+
function debounceFilter(ms, options = {}) {
|
21
|
+
let timer;
|
22
|
+
let maxTimer;
|
23
|
+
let lastRejector = noop;
|
24
|
+
const _clearTimeout = (timer2) => {
|
25
|
+
clearTimeout(timer2);
|
26
|
+
lastRejector();
|
27
|
+
lastRejector = noop;
|
28
|
+
};
|
29
|
+
const filter = (invoke) => {
|
30
|
+
const duration = resolveUnref(ms);
|
31
|
+
const maxDuration = resolveUnref(options.maxWait);
|
32
|
+
if (timer)
|
33
|
+
_clearTimeout(timer);
|
34
|
+
if (duration <= 0 || maxDuration !== void 0 && maxDuration <= 0) {
|
35
|
+
if (maxTimer) {
|
36
|
+
_clearTimeout(maxTimer);
|
37
|
+
maxTimer = null;
|
38
|
+
}
|
39
|
+
return Promise.resolve(invoke());
|
40
|
+
}
|
41
|
+
return new Promise((resolve, reject) => {
|
42
|
+
lastRejector = options.rejectOnCancel ? reject : resolve;
|
43
|
+
if (maxDuration && !maxTimer) {
|
44
|
+
maxTimer = setTimeout(() => {
|
45
|
+
if (timer)
|
46
|
+
_clearTimeout(timer);
|
47
|
+
maxTimer = null;
|
48
|
+
resolve(invoke());
|
49
|
+
}, maxDuration);
|
50
|
+
}
|
51
|
+
timer = setTimeout(() => {
|
52
|
+
if (maxTimer)
|
53
|
+
_clearTimeout(maxTimer);
|
54
|
+
maxTimer = null;
|
55
|
+
resolve(invoke());
|
56
|
+
}, duration);
|
57
|
+
});
|
58
|
+
};
|
59
|
+
return filter;
|
60
|
+
}
|
61
|
+
function throttleFilter(ms, trailing = true, leading = true, rejectOnCancel = false) {
|
62
|
+
let lastExec = 0;
|
63
|
+
let timer;
|
64
|
+
let isLeading = true;
|
65
|
+
let lastRejector = noop;
|
66
|
+
let lastValue;
|
67
|
+
const clear = () => {
|
68
|
+
if (timer) {
|
69
|
+
clearTimeout(timer);
|
70
|
+
timer = void 0;
|
71
|
+
lastRejector();
|
72
|
+
lastRejector = noop;
|
73
|
+
}
|
74
|
+
};
|
75
|
+
const filter = (_invoke) => {
|
76
|
+
const duration = resolveUnref(ms);
|
77
|
+
const elapsed = Date.now() - lastExec;
|
78
|
+
const invoke = () => {
|
79
|
+
return lastValue = _invoke();
|
80
|
+
};
|
81
|
+
clear();
|
82
|
+
if (duration <= 0) {
|
83
|
+
lastExec = Date.now();
|
84
|
+
return invoke();
|
85
|
+
}
|
86
|
+
if (elapsed > duration && (leading || !isLeading)) {
|
87
|
+
lastExec = Date.now();
|
88
|
+
invoke();
|
89
|
+
} else if (trailing) {
|
90
|
+
lastValue = new Promise((resolve, reject) => {
|
91
|
+
lastRejector = rejectOnCancel ? reject : resolve;
|
92
|
+
timer = setTimeout(() => {
|
93
|
+
lastExec = Date.now();
|
94
|
+
isLeading = true;
|
95
|
+
resolve(invoke());
|
96
|
+
clear();
|
97
|
+
}, Math.max(0, duration - elapsed));
|
98
|
+
});
|
99
|
+
}
|
100
|
+
if (!leading && !timer)
|
101
|
+
timer = setTimeout(() => isLeading = true, duration);
|
102
|
+
isLeading = false;
|
103
|
+
return lastValue;
|
104
|
+
};
|
105
|
+
return filter;
|
106
|
+
}
|
7
107
|
function identity(arg) {
|
8
108
|
return arg;
|
9
109
|
}
|
110
|
+
function useDebounceFn(fn, ms = 200, options = {}) {
|
111
|
+
return createFilterWrapper(debounceFilter(ms, options), fn);
|
112
|
+
}
|
113
|
+
function useThrottleFn(fn, ms = 200, trailing = false, leading = true, rejectOnCancel = false) {
|
114
|
+
return createFilterWrapper(throttleFilter(ms, trailing, leading, rejectOnCancel), fn);
|
115
|
+
}
|
10
116
|
export {
|
117
|
+
createFilterWrapper,
|
118
|
+
debounceFilter,
|
11
119
|
identity,
|
12
120
|
isClient,
|
13
121
|
isDef,
|
14
|
-
isFunction
|
122
|
+
isFunction,
|
123
|
+
noop,
|
124
|
+
resolveUnref,
|
125
|
+
throttleFilter,
|
126
|
+
useDebounceFn,
|
127
|
+
useThrottleFn
|
15
128
|
};
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import functionBind from "../../../function-bind@1.1.2/node_modules/function-bind/index.mjs";
|
2
|
+
import { __require as requireFunctionApply } from "./functionApply.mjs";
|
3
|
+
import functionCall from "./functionCall.mjs";
|
4
|
+
import reflectApply from "./reflectApply.mjs";
|
5
|
+
var bind = functionBind;
|
6
|
+
var $apply = requireFunctionApply();
|
7
|
+
var $call = functionCall;
|
8
|
+
var $reflectApply = reflectApply;
|
9
|
+
var actualApply = $reflectApply || bind.call($call, $apply);
|
10
|
+
export {
|
11
|
+
actualApply as default
|
12
|
+
};
|
@@ -0,0 +1,12 @@
|
|
1
|
+
var functionApply;
|
2
|
+
var hasRequiredFunctionApply;
|
3
|
+
function requireFunctionApply() {
|
4
|
+
if (hasRequiredFunctionApply)
|
5
|
+
return functionApply;
|
6
|
+
hasRequiredFunctionApply = 1;
|
7
|
+
functionApply = Function.prototype.apply;
|
8
|
+
return functionApply;
|
9
|
+
}
|
10
|
+
export {
|
11
|
+
requireFunctionApply as __require
|
12
|
+
};
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import functionBind from "../../../function-bind@1.1.2/node_modules/function-bind/index.mjs";
|
2
|
+
import type from "../../../es-errors@1.3.0/node_modules/es-errors/type.mjs";
|
3
|
+
import functionCall from "./functionCall.mjs";
|
4
|
+
import actualApply from "./actualApply.mjs";
|
5
|
+
var bind = functionBind;
|
6
|
+
var $TypeError = type;
|
7
|
+
var $call = functionCall;
|
8
|
+
var $actualApply = actualApply;
|
9
|
+
var callBindApplyHelpers = function callBindBasic(args) {
|
10
|
+
if (args.length < 1 || typeof args[0] !== "function") {
|
11
|
+
throw new $TypeError("a function is required");
|
12
|
+
}
|
13
|
+
return $actualApply(bind, $call, args);
|
14
|
+
};
|
15
|
+
export {
|
16
|
+
callBindApplyHelpers as default
|
17
|
+
};
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import getIntrinsic from "../../../get-intrinsic@1.2.6/node_modules/get-intrinsic/index.mjs";
|
2
|
+
import callBindApplyHelpers from "../../../call-bind-apply-helpers@1.0.1/node_modules/call-bind-apply-helpers/index.mjs";
|
3
|
+
var GetIntrinsic = getIntrinsic;
|
4
|
+
var callBindBasic = callBindApplyHelpers;
|
5
|
+
var $indexOf = callBindBasic([GetIntrinsic("%String.prototype.indexOf%")]);
|
6
|
+
var callBound = function callBoundIntrinsic(name, allowMissing) {
|
7
|
+
var intrinsic = (
|
8
|
+
/** @type {Parameters<typeof callBindBasic>[0][0]} */
|
9
|
+
GetIntrinsic(name, !!allowMissing)
|
10
|
+
);
|
11
|
+
if (typeof intrinsic === "function" && $indexOf(name, ".prototype.") > -1) {
|
12
|
+
return callBindBasic([intrinsic]);
|
13
|
+
}
|
14
|
+
return intrinsic;
|
15
|
+
};
|
16
|
+
export {
|
17
|
+
callBound as default
|
18
|
+
};
|