@n8n/composables 1.10.0 → 1.11.0

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.
@@ -0,0 +1,23 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/useThrottleWithReactiveDelay.ts
2
+ var _core = require('@vueuse/core');
3
+ var _vue = require('vue');
4
+ function useThrottleWithReactiveDelay(state, delay) {
5
+ const throttled = _vue.shallowRef.call(void 0, state.value);
6
+ _vue.watch.call(void 0,
7
+ state,
8
+ _core.useThrottleFn.call(void 0,
9
+ (latest) => {
10
+ throttled.value = latest;
11
+ },
12
+ delay,
13
+ true,
14
+ true
15
+ ),
16
+ { immediate: true }
17
+ );
18
+ return throttled;
19
+ }
20
+
21
+
22
+ exports.useThrottleWithReactiveDelay = useThrottleWithReactiveDelay;
23
+ //# sourceMappingURL=useThrottleWithReactiveDelay.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/home/runner/work/n8n/n8n/packages/frontend/@n8n/composables/dist/useThrottleWithReactiveDelay.cjs","../src/useThrottleWithReactiveDelay.ts"],"names":[],"mappings":"AAAA;ACAA,oCAA8B;AAC9B,0BAA6D;AAKtD,SAAS,4BAAA,CAAgC,KAAA,EAAe,KAAA,EAAmC;AACjG,EAAA,MAAM,UAAA,EAAY,6BAAA,KAAW,CAAM,KAAK,CAAA;AAExC,EAAA,wBAAA;AAAA,IACC,KAAA;AAAA,IACA,iCAAA;AAAA,MACC,CAAC,MAAA,EAAA,GAAc;AACd,QAAA,SAAA,CAAU,MAAA,EAAQ,MAAA;AAAA,MACnB,CAAA;AAAA,MACA,KAAA;AAAA,MACA,IAAA;AAAA,MACA;AAAA,IACD,CAAA;AAAA,IACA,EAAE,SAAA,EAAW,KAAK;AAAA,EACnB,CAAA;AAEA,EAAA,OAAO,SAAA;AACR;ADJA;AACE;AACF,oEAAC","file":"/home/runner/work/n8n/n8n/packages/frontend/@n8n/composables/dist/useThrottleWithReactiveDelay.cjs","sourcesContent":[null,"import { useThrottleFn } from '@vueuse/core';\nimport { shallowRef, watch, type Ref, type ShallowRef } from 'vue';\n\n/**\n * Similar to `useThrottle` from @vueuse/core, but with changeable delay\n */\nexport function useThrottleWithReactiveDelay<T>(state: Ref<T>, delay: Ref<number>): ShallowRef<T> {\n\tconst throttled = shallowRef(state.value);\n\n\twatch(\n\t\tstate,\n\t\tuseThrottleFn(\n\t\t\t(latest: T) => {\n\t\t\t\tthrottled.value = latest;\n\t\t\t},\n\t\t\tdelay,\n\t\t\ttrue,\n\t\t\ttrue,\n\t\t),\n\t\t{ immediate: true },\n\t);\n\n\treturn throttled;\n}\n"]}
@@ -0,0 +1,5 @@
1
+ import { Ref, ShallowRef } from 'vue';
2
+
3
+ declare function useThrottleWithReactiveDelay<T>(state: Ref<T>, delay: Ref<number>): ShallowRef<T>;
4
+
5
+ export { useThrottleWithReactiveDelay };
@@ -0,0 +1,5 @@
1
+ import { Ref, ShallowRef } from 'vue';
2
+
3
+ declare function useThrottleWithReactiveDelay<T>(state: Ref<T>, delay: Ref<number>): ShallowRef<T>;
4
+
5
+ export { useThrottleWithReactiveDelay };
@@ -0,0 +1,23 @@
1
+ // src/useThrottleWithReactiveDelay.ts
2
+ import { useThrottleFn } from "@vueuse/core";
3
+ import { shallowRef, watch } from "vue";
4
+ function useThrottleWithReactiveDelay(state, delay) {
5
+ const throttled = shallowRef(state.value);
6
+ watch(
7
+ state,
8
+ useThrottleFn(
9
+ (latest) => {
10
+ throttled.value = latest;
11
+ },
12
+ delay,
13
+ true,
14
+ true
15
+ ),
16
+ { immediate: true }
17
+ );
18
+ return throttled;
19
+ }
20
+ export {
21
+ useThrottleWithReactiveDelay
22
+ };
23
+ //# sourceMappingURL=useThrottleWithReactiveDelay.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/useThrottleWithReactiveDelay.ts"],"sourcesContent":["import { useThrottleFn } from '@vueuse/core';\nimport { shallowRef, watch, type Ref, type ShallowRef } from 'vue';\n\n/**\n * Similar to `useThrottle` from @vueuse/core, but with changeable delay\n */\nexport function useThrottleWithReactiveDelay<T>(state: Ref<T>, delay: Ref<number>): ShallowRef<T> {\n\tconst throttled = shallowRef(state.value);\n\n\twatch(\n\t\tstate,\n\t\tuseThrottleFn(\n\t\t\t(latest: T) => {\n\t\t\t\tthrottled.value = latest;\n\t\t\t},\n\t\t\tdelay,\n\t\t\ttrue,\n\t\t\ttrue,\n\t\t),\n\t\t{ immediate: true },\n\t);\n\n\treturn throttled;\n}\n"],"mappings":";AAAA,SAAS,qBAAqB;AAC9B,SAAS,YAAY,aAAwC;AAKtD,SAAS,6BAAgC,OAAe,OAAmC;AACjG,QAAM,YAAY,WAAW,MAAM,KAAK;AAExC;AAAA,IACC;AAAA,IACA;AAAA,MACC,CAAC,WAAc;AACd,kBAAU,QAAQ;AAAA,MACnB;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACD;AAAA,IACA,EAAE,WAAW,KAAK;AAAA,EACnB;AAEA,SAAO;AACR;","names":[]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@n8n/composables",
3
3
  "type": "module",
4
- "version": "1.10.0",
4
+ "version": "1.11.0",
5
5
  "files": [
6
6
  "dist",
7
7
  "LICENSE.md",