@n8n/composables 1.12.0 → 1.13.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.
- package/dist/useDeviceSupport.cjs +0 -2
- package/dist/useDeviceSupport.cjs.map +1 -1
- package/dist/{useDeviceSupport.d.ts → useDeviceSupport.d.mts} +1 -1
- package/dist/{useDeviceSupport.js → useDeviceSupport.mjs} +1 -1
- package/dist/useDeviceSupport.mjs.map +1 -0
- package/dist/useShortKeyPress.cjs +0 -3
- package/dist/useShortKeyPress.cjs.map +1 -1
- package/dist/{useShortKeyPress.d.ts → useShortKeyPress.d.mts} +1 -1
- package/dist/{useShortKeyPress.js → useShortKeyPress.mjs} +1 -1
- package/dist/useShortKeyPress.mjs.map +1 -0
- package/dist/useThrottleWithReactiveDelay.cjs +0 -3
- package/dist/useThrottleWithReactiveDelay.cjs.map +1 -1
- package/dist/{useThrottleWithReactiveDelay.d.ts → useThrottleWithReactiveDelay.d.mts} +1 -1
- package/dist/{useThrottleWithReactiveDelay.js → useThrottleWithReactiveDelay.mjs} +1 -1
- package/dist/useThrottleWithReactiveDelay.mjs.map +1 -0
- package/package.json +6 -6
- package/dist/chunk-CUT6urMc.cjs +0 -30
- package/dist/useDeviceSupport.js.map +0 -1
- package/dist/useShortKeyPress.js.map +0 -1
- package/dist/useThrottleWithReactiveDelay.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDeviceSupport.cjs","names":[],"sources":["../src/useDeviceSupport.ts"],"sourcesContent":["import { computed, ref } from 'vue';\n\nexport function useDeviceSupport() {\n\t/**\n\t * Check if the device is a touch device but exclude devices that have a fine pointer (mouse or track-pad)\n\t * - `fine` will check for an accurate pointing device. Examples include mice, touch-pads, and drawing styluses\n\t * - `coarse` will check for a pointing device of limited accuracy. Examples include touchscreens and motion-detection sensors\n\t * - `any-pointer` will check for the presence of any pointing device, if there are multiple of them\n\t */\n\tconst isTouchDevice = ref(\n\t\twindow.matchMedia('(any-pointer: coarse)').matches &&\n\t\t\t!window.matchMedia('(any-pointer: fine)').matches,\n\t);\n\tconst userAgent = ref(navigator.userAgent.toLowerCase());\n\n\tconst isIOs = ref(\n\t\tuserAgent.value.includes('iphone') ||\n\t\t\tuserAgent.value.includes('ipad') ||\n\t\t\tuserAgent.value.includes('ipod'),\n\t);\n\tconst isAndroidOs = ref(userAgent.value.includes('android'));\n\tconst isMacOs = ref(userAgent.value.includes('macintosh') || isIOs.value);\n\tconst isMobileDevice = ref(isIOs.value || isAndroidOs.value);\n\n\tconst controlKeyCode = ref(isMacOs.value ? 'Meta' : 'Control');\n\tconst controlKeyText = computed(() => (isMacOs.value ? '⌘' : 'Ctrl'));\n\n\tfunction isCtrlKeyPressed(e: MouseEvent | KeyboardEvent): boolean {\n\t\tif (isMacOs.value) {\n\t\t\treturn (e as KeyboardEvent).metaKey;\n\t\t}\n\t\treturn (e as KeyboardEvent).ctrlKey;\n\t}\n\n\treturn {\n\t\tuserAgent: userAgent.value,\n\t\tisTouchDevice: isTouchDevice.value,\n\t\tisAndroidOs: isAndroidOs.value,\n\t\tisIOs: isIOs.value,\n\t\tisMacOs: isMacOs.value,\n\t\tisMobileDevice: isMobileDevice.value,\n\t\tcontrolKeyCode: controlKeyCode.value,\n\t\tcontrolKeyText,\n\t\tisCtrlKeyPressed,\n\t};\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useDeviceSupport.cjs","names":[],"sources":["../src/useDeviceSupport.ts"],"sourcesContent":["import { computed, ref } from 'vue';\n\nexport function useDeviceSupport() {\n\t/**\n\t * Check if the device is a touch device but exclude devices that have a fine pointer (mouse or track-pad)\n\t * - `fine` will check for an accurate pointing device. Examples include mice, touch-pads, and drawing styluses\n\t * - `coarse` will check for a pointing device of limited accuracy. Examples include touchscreens and motion-detection sensors\n\t * - `any-pointer` will check for the presence of any pointing device, if there are multiple of them\n\t */\n\tconst isTouchDevice = ref(\n\t\twindow.matchMedia('(any-pointer: coarse)').matches &&\n\t\t\t!window.matchMedia('(any-pointer: fine)').matches,\n\t);\n\tconst userAgent = ref(navigator.userAgent.toLowerCase());\n\n\tconst isIOs = ref(\n\t\tuserAgent.value.includes('iphone') ||\n\t\t\tuserAgent.value.includes('ipad') ||\n\t\t\tuserAgent.value.includes('ipod'),\n\t);\n\tconst isAndroidOs = ref(userAgent.value.includes('android'));\n\tconst isMacOs = ref(userAgent.value.includes('macintosh') || isIOs.value);\n\tconst isMobileDevice = ref(isIOs.value || isAndroidOs.value);\n\n\tconst controlKeyCode = ref(isMacOs.value ? 'Meta' : 'Control');\n\tconst controlKeyText = computed(() => (isMacOs.value ? '⌘' : 'Ctrl'));\n\n\tfunction isCtrlKeyPressed(e: MouseEvent | KeyboardEvent): boolean {\n\t\tif (isMacOs.value) {\n\t\t\treturn (e as KeyboardEvent).metaKey;\n\t\t}\n\t\treturn (e as KeyboardEvent).ctrlKey;\n\t}\n\n\treturn {\n\t\tuserAgent: userAgent.value,\n\t\tisTouchDevice: isTouchDevice.value,\n\t\tisAndroidOs: isAndroidOs.value,\n\t\tisIOs: isIOs.value,\n\t\tisMacOs: isMacOs.value,\n\t\tisMobileDevice: isMobileDevice.value,\n\t\tcontrolKeyCode: controlKeyCode.value,\n\t\tcontrolKeyText,\n\t\tisCtrlKeyPressed,\n\t};\n}\n"],"mappings":";;;AAEA,SAAgB,mBAAmB;;;;;;;CAOlC,MAAM,6BACL,OAAO,WAAW,wBAAwB,CAAC,WAC1C,CAAC,OAAO,WAAW,sBAAsB,CAAC,QAC3C;CACD,MAAM,yBAAgB,UAAU,UAAU,aAAa,CAAC;CAExD,MAAM,qBACL,UAAU,MAAM,SAAS,SAAS,IACjC,UAAU,MAAM,SAAS,OAAO,IAChC,UAAU,MAAM,SAAS,OAAO,CACjC;CACD,MAAM,2BAAkB,UAAU,MAAM,SAAS,UAAU,CAAC;CAC5D,MAAM,uBAAc,UAAU,MAAM,SAAS,YAAY,IAAI,MAAM,MAAM;CACzE,MAAM,8BAAqB,MAAM,SAAS,YAAY,MAAM;CAE5D,MAAM,8BAAqB,QAAQ,QAAQ,SAAS,UAAU;CAC9D,MAAM,yCAAiC,QAAQ,QAAQ,MAAM,OAAQ;CAErE,SAAS,iBAAiB,GAAwC;AACjE,MAAI,QAAQ,MACX,QAAQ,EAAoB;AAE7B,SAAQ,EAAoB;;AAG7B,QAAO;EACN,WAAW,UAAU;EACrB,eAAe,cAAc;EAC7B,aAAa,YAAY;EACzB,OAAO,MAAM;EACb,SAAS,QAAQ;EACjB,gBAAgB,eAAe;EAC/B,gBAAgB,eAAe;EAC/B;EACA;EACA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDeviceSupport.mjs","names":[],"sources":["../src/useDeviceSupport.ts"],"sourcesContent":["import { computed, ref } from 'vue';\n\nexport function useDeviceSupport() {\n\t/**\n\t * Check if the device is a touch device but exclude devices that have a fine pointer (mouse or track-pad)\n\t * - `fine` will check for an accurate pointing device. Examples include mice, touch-pads, and drawing styluses\n\t * - `coarse` will check for a pointing device of limited accuracy. Examples include touchscreens and motion-detection sensors\n\t * - `any-pointer` will check for the presence of any pointing device, if there are multiple of them\n\t */\n\tconst isTouchDevice = ref(\n\t\twindow.matchMedia('(any-pointer: coarse)').matches &&\n\t\t\t!window.matchMedia('(any-pointer: fine)').matches,\n\t);\n\tconst userAgent = ref(navigator.userAgent.toLowerCase());\n\n\tconst isIOs = ref(\n\t\tuserAgent.value.includes('iphone') ||\n\t\t\tuserAgent.value.includes('ipad') ||\n\t\t\tuserAgent.value.includes('ipod'),\n\t);\n\tconst isAndroidOs = ref(userAgent.value.includes('android'));\n\tconst isMacOs = ref(userAgent.value.includes('macintosh') || isIOs.value);\n\tconst isMobileDevice = ref(isIOs.value || isAndroidOs.value);\n\n\tconst controlKeyCode = ref(isMacOs.value ? 'Meta' : 'Control');\n\tconst controlKeyText = computed(() => (isMacOs.value ? '⌘' : 'Ctrl'));\n\n\tfunction isCtrlKeyPressed(e: MouseEvent | KeyboardEvent): boolean {\n\t\tif (isMacOs.value) {\n\t\t\treturn (e as KeyboardEvent).metaKey;\n\t\t}\n\t\treturn (e as KeyboardEvent).ctrlKey;\n\t}\n\n\treturn {\n\t\tuserAgent: userAgent.value,\n\t\tisTouchDevice: isTouchDevice.value,\n\t\tisAndroidOs: isAndroidOs.value,\n\t\tisIOs: isIOs.value,\n\t\tisMacOs: isMacOs.value,\n\t\tisMobileDevice: isMobileDevice.value,\n\t\tcontrolKeyCode: controlKeyCode.value,\n\t\tcontrolKeyText,\n\t\tisCtrlKeyPressed,\n\t};\n}\n"],"mappings":";;;AAEA,SAAgB,mBAAmB;;;;;;;CAOlC,MAAM,gBAAgB,IACrB,OAAO,WAAW,wBAAwB,CAAC,WAC1C,CAAC,OAAO,WAAW,sBAAsB,CAAC,QAC3C;CACD,MAAM,YAAY,IAAI,UAAU,UAAU,aAAa,CAAC;CAExD,MAAM,QAAQ,IACb,UAAU,MAAM,SAAS,SAAS,IACjC,UAAU,MAAM,SAAS,OAAO,IAChC,UAAU,MAAM,SAAS,OAAO,CACjC;CACD,MAAM,cAAc,IAAI,UAAU,MAAM,SAAS,UAAU,CAAC;CAC5D,MAAM,UAAU,IAAI,UAAU,MAAM,SAAS,YAAY,IAAI,MAAM,MAAM;CACzE,MAAM,iBAAiB,IAAI,MAAM,SAAS,YAAY,MAAM;CAE5D,MAAM,iBAAiB,IAAI,QAAQ,QAAQ,SAAS,UAAU;CAC9D,MAAM,iBAAiB,eAAgB,QAAQ,QAAQ,MAAM,OAAQ;CAErE,SAAS,iBAAiB,GAAwC;AACjE,MAAI,QAAQ,MACX,QAAQ,EAAoB;AAE7B,SAAQ,EAAoB;;AAG7B,QAAO;EACN,WAAW,UAAU;EACrB,eAAe,cAAc;EAC7B,aAAa,YAAY;EACzB,OAAO,MAAM;EACb,SAAS,QAAQ;EACjB,gBAAgB,eAAe;EAC/B,gBAAgB,eAAe;EAC/B;EACA;EACA"}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
const require_chunk = require('./chunk-CUT6urMc.cjs');
|
|
2
1
|
let vue = require("vue");
|
|
3
|
-
vue = require_chunk.__toESM(vue);
|
|
4
2
|
let __vueuse_core = require("@vueuse/core");
|
|
5
|
-
__vueuse_core = require_chunk.__toESM(__vueuse_core);
|
|
6
3
|
|
|
7
4
|
//#region src/useShortKeyPress.ts
|
|
8
5
|
function useShortKeyPress(key, fn, { dedupe = true, threshold = 300, disabled = false }) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useShortKeyPress.cjs","names":[],"sources":["../src/useShortKeyPress.ts"],"sourcesContent":["import { onKeyDown, onKeyUp } from '@vueuse/core';\nimport type { KeyFilter } from '@vueuse/core';\nimport { ref, unref } from 'vue';\nimport type { MaybeRefOrGetter } from 'vue';\n\nexport function useShortKeyPress(\n\tkey: KeyFilter,\n\tfn: () => void,\n\t{\n\t\tdedupe = true,\n\t\tthreshold = 300,\n\t\tdisabled = false,\n\t}: {\n\t\tdedupe?: boolean;\n\t\tthreshold?: number;\n\t\tdisabled?: MaybeRefOrGetter<boolean>;\n\t},\n) {\n\tconst keyDownTime = ref<number | null>(null);\n\n\tonKeyDown(\n\t\tkey,\n\t\t() => {\n\t\t\tif (unref(disabled)) return;\n\n\t\t\tkeyDownTime.value = Date.now();\n\t\t},\n\t\t{\n\t\t\tdedupe,\n\t\t},\n\t);\n\n\tonKeyUp(key, () => {\n\t\tif (unref(disabled) || !keyDownTime.value) return;\n\n\t\tconst isShortPress = Date.now() - keyDownTime.value < threshold;\n\t\tif (isShortPress) {\n\t\t\tfn();\n\t\t}\n\t});\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useShortKeyPress.cjs","names":[],"sources":["../src/useShortKeyPress.ts"],"sourcesContent":["import { onKeyDown, onKeyUp } from '@vueuse/core';\nimport type { KeyFilter } from '@vueuse/core';\nimport { ref, unref } from 'vue';\nimport type { MaybeRefOrGetter } from 'vue';\n\nexport function useShortKeyPress(\n\tkey: KeyFilter,\n\tfn: () => void,\n\t{\n\t\tdedupe = true,\n\t\tthreshold = 300,\n\t\tdisabled = false,\n\t}: {\n\t\tdedupe?: boolean;\n\t\tthreshold?: number;\n\t\tdisabled?: MaybeRefOrGetter<boolean>;\n\t},\n) {\n\tconst keyDownTime = ref<number | null>(null);\n\n\tonKeyDown(\n\t\tkey,\n\t\t() => {\n\t\t\tif (unref(disabled)) return;\n\n\t\t\tkeyDownTime.value = Date.now();\n\t\t},\n\t\t{\n\t\t\tdedupe,\n\t\t},\n\t);\n\n\tonKeyUp(key, () => {\n\t\tif (unref(disabled) || !keyDownTime.value) return;\n\n\t\tconst isShortPress = Date.now() - keyDownTime.value < threshold;\n\t\tif (isShortPress) {\n\t\t\tfn();\n\t\t}\n\t});\n}\n"],"mappings":";;;;AAKA,SAAgB,iBACf,KACA,IACA,EACC,SAAS,MACT,YAAY,KACZ,WAAW,SAMX;CACD,MAAM,2BAAiC,KAAK;AAE5C,8BACC,WACM;AACL,qBAAU,SAAS,CAAE;AAErB,cAAY,QAAQ,KAAK,KAAK;IAE/B,EACC,QACA,CACD;AAED,4BAAQ,WAAW;AAClB,qBAAU,SAAS,IAAI,CAAC,YAAY,MAAO;AAG3C,MADqB,KAAK,KAAK,GAAG,YAAY,QAAQ,UAErD,KAAI;GAEJ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useShortKeyPress.mjs","names":[],"sources":["../src/useShortKeyPress.ts"],"sourcesContent":["import { onKeyDown, onKeyUp } from '@vueuse/core';\nimport type { KeyFilter } from '@vueuse/core';\nimport { ref, unref } from 'vue';\nimport type { MaybeRefOrGetter } from 'vue';\n\nexport function useShortKeyPress(\n\tkey: KeyFilter,\n\tfn: () => void,\n\t{\n\t\tdedupe = true,\n\t\tthreshold = 300,\n\t\tdisabled = false,\n\t}: {\n\t\tdedupe?: boolean;\n\t\tthreshold?: number;\n\t\tdisabled?: MaybeRefOrGetter<boolean>;\n\t},\n) {\n\tconst keyDownTime = ref<number | null>(null);\n\n\tonKeyDown(\n\t\tkey,\n\t\t() => {\n\t\t\tif (unref(disabled)) return;\n\n\t\t\tkeyDownTime.value = Date.now();\n\t\t},\n\t\t{\n\t\t\tdedupe,\n\t\t},\n\t);\n\n\tonKeyUp(key, () => {\n\t\tif (unref(disabled) || !keyDownTime.value) return;\n\n\t\tconst isShortPress = Date.now() - keyDownTime.value < threshold;\n\t\tif (isShortPress) {\n\t\t\tfn();\n\t\t}\n\t});\n}\n"],"mappings":";;;;AAKA,SAAgB,iBACf,KACA,IACA,EACC,SAAS,MACT,YAAY,KACZ,WAAW,SAMX;CACD,MAAM,cAAc,IAAmB,KAAK;AAE5C,WACC,WACM;AACL,MAAI,MAAM,SAAS,CAAE;AAErB,cAAY,QAAQ,KAAK,KAAK;IAE/B,EACC,QACA,CACD;AAED,SAAQ,WAAW;AAClB,MAAI,MAAM,SAAS,IAAI,CAAC,YAAY,MAAO;AAG3C,MADqB,KAAK,KAAK,GAAG,YAAY,QAAQ,UAErD,KAAI;GAEJ"}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
const require_chunk = require('./chunk-CUT6urMc.cjs');
|
|
2
1
|
let vue = require("vue");
|
|
3
|
-
vue = require_chunk.__toESM(vue);
|
|
4
2
|
let __vueuse_core = require("@vueuse/core");
|
|
5
|
-
__vueuse_core = require_chunk.__toESM(__vueuse_core);
|
|
6
3
|
|
|
7
4
|
//#region src/useThrottleWithReactiveDelay.ts
|
|
8
5
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useThrottleWithReactiveDelay.cjs","names":[],"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":"
|
|
1
|
+
{"version":3,"file":"useThrottleWithReactiveDelay.cjs","names":[],"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":";;;;;;;AAMA,SAAgB,6BAAgC,OAAe,OAAmC;CACjG,MAAM,gCAAuB,MAAM,MAAM;AAEzC,gBACC,yCAEE,WAAc;AACd,YAAU,QAAQ;IAEnB,OACA,MACA,KACA,EACD,EAAE,WAAW,MAAM,CACnB;AAED,QAAO"}
|
|
@@ -4,4 +4,4 @@ import { Ref, ShallowRef } from "vue";
|
|
|
4
4
|
declare function useThrottleWithReactiveDelay<T>(state: Ref<T>, delay: Ref<number>): ShallowRef<T>;
|
|
5
5
|
//#endregion
|
|
6
6
|
export { useThrottleWithReactiveDelay };
|
|
7
|
-
//# sourceMappingURL=useThrottleWithReactiveDelay.d.
|
|
7
|
+
//# sourceMappingURL=useThrottleWithReactiveDelay.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useThrottleWithReactiveDelay.mjs","names":[],"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":";;;;;;;AAMA,SAAgB,6BAAgC,OAAe,OAAmC;CACjG,MAAM,YAAY,WAAW,MAAM,MAAM;AAEzC,OACC,OACA,eACE,WAAc;AACd,YAAU,QAAQ;IAEnB,OACA,MACA,KACA,EACD,EAAE,WAAW,MAAM,CACnB;AAED,QAAO"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@n8n/composables",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.13.0",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
7
7
|
"LICENSE.md",
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
],
|
|
10
10
|
"exports": {
|
|
11
11
|
"./*": {
|
|
12
|
-
"types": "./dist/*.d.
|
|
13
|
-
"import": "./dist/*.
|
|
12
|
+
"types": "./dist/*.d.mts",
|
|
13
|
+
"import": "./dist/*.mjs",
|
|
14
14
|
"require": "./dist/*.cjs"
|
|
15
15
|
}
|
|
16
16
|
},
|
|
@@ -22,14 +22,14 @@
|
|
|
22
22
|
"@vue/tsconfig": "^0.7.0",
|
|
23
23
|
"@vueuse/core": "^10.11.0",
|
|
24
24
|
"vue": "^3.5.13",
|
|
25
|
-
"tsdown": "^0.
|
|
25
|
+
"tsdown": "^0.16.5",
|
|
26
26
|
"typescript": "5.9.2",
|
|
27
27
|
"vite": "npm:rolldown-vite@latest",
|
|
28
28
|
"vitest": "^3.1.3",
|
|
29
29
|
"vue-tsc": "^2.2.8",
|
|
30
|
+
"@n8n/eslint-config": "0.0.1",
|
|
30
31
|
"@n8n/typescript-config": "1.3.0",
|
|
31
|
-
"@n8n/vitest-config": "1.5.0"
|
|
32
|
-
"@n8n/eslint-config": "0.0.1"
|
|
32
|
+
"@n8n/vitest-config": "1.5.0"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
35
|
"@vueuse/core": "^10.11.0",
|
package/dist/chunk-CUT6urMc.cjs
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
//#region rolldown:runtime
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __copyProps = (to, from, except, desc) => {
|
|
9
|
-
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
10
|
-
key = keys[i];
|
|
11
|
-
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
12
|
-
get: ((k) => from[k]).bind(null, key),
|
|
13
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
19
|
-
value: mod,
|
|
20
|
-
enumerable: true
|
|
21
|
-
}) : target, mod));
|
|
22
|
-
|
|
23
|
-
//#endregion
|
|
24
|
-
|
|
25
|
-
Object.defineProperty(exports, '__toESM', {
|
|
26
|
-
enumerable: true,
|
|
27
|
-
get: function () {
|
|
28
|
-
return __toESM;
|
|
29
|
-
}
|
|
30
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useDeviceSupport.js","names":[],"sources":["../src/useDeviceSupport.ts"],"sourcesContent":["import { computed, ref } from 'vue';\n\nexport function useDeviceSupport() {\n\t/**\n\t * Check if the device is a touch device but exclude devices that have a fine pointer (mouse or track-pad)\n\t * - `fine` will check for an accurate pointing device. Examples include mice, touch-pads, and drawing styluses\n\t * - `coarse` will check for a pointing device of limited accuracy. Examples include touchscreens and motion-detection sensors\n\t * - `any-pointer` will check for the presence of any pointing device, if there are multiple of them\n\t */\n\tconst isTouchDevice = ref(\n\t\twindow.matchMedia('(any-pointer: coarse)').matches &&\n\t\t\t!window.matchMedia('(any-pointer: fine)').matches,\n\t);\n\tconst userAgent = ref(navigator.userAgent.toLowerCase());\n\n\tconst isIOs = ref(\n\t\tuserAgent.value.includes('iphone') ||\n\t\t\tuserAgent.value.includes('ipad') ||\n\t\t\tuserAgent.value.includes('ipod'),\n\t);\n\tconst isAndroidOs = ref(userAgent.value.includes('android'));\n\tconst isMacOs = ref(userAgent.value.includes('macintosh') || isIOs.value);\n\tconst isMobileDevice = ref(isIOs.value || isAndroidOs.value);\n\n\tconst controlKeyCode = ref(isMacOs.value ? 'Meta' : 'Control');\n\tconst controlKeyText = computed(() => (isMacOs.value ? '⌘' : 'Ctrl'));\n\n\tfunction isCtrlKeyPressed(e: MouseEvent | KeyboardEvent): boolean {\n\t\tif (isMacOs.value) {\n\t\t\treturn (e as KeyboardEvent).metaKey;\n\t\t}\n\t\treturn (e as KeyboardEvent).ctrlKey;\n\t}\n\n\treturn {\n\t\tuserAgent: userAgent.value,\n\t\tisTouchDevice: isTouchDevice.value,\n\t\tisAndroidOs: isAndroidOs.value,\n\t\tisIOs: isIOs.value,\n\t\tisMacOs: isMacOs.value,\n\t\tisMobileDevice: isMobileDevice.value,\n\t\tcontrolKeyCode: controlKeyCode.value,\n\t\tcontrolKeyText,\n\t\tisCtrlKeyPressed,\n\t};\n}\n"],"mappings":";;;AAEA,SAAgB,mBAAmB;;;;;;;CAOlC,MAAM,gBAAgB,IACrB,OAAO,WAAW,wBAAwB,CAAC,WAC1C,CAAC,OAAO,WAAW,sBAAsB,CAAC,QAC3C;CACD,MAAM,YAAY,IAAI,UAAU,UAAU,aAAa,CAAC;CAExD,MAAM,QAAQ,IACb,UAAU,MAAM,SAAS,SAAS,IACjC,UAAU,MAAM,SAAS,OAAO,IAChC,UAAU,MAAM,SAAS,OAAO,CACjC;CACD,MAAM,cAAc,IAAI,UAAU,MAAM,SAAS,UAAU,CAAC;CAC5D,MAAM,UAAU,IAAI,UAAU,MAAM,SAAS,YAAY,IAAI,MAAM,MAAM;CACzE,MAAM,iBAAiB,IAAI,MAAM,SAAS,YAAY,MAAM;CAE5D,MAAM,iBAAiB,IAAI,QAAQ,QAAQ,SAAS,UAAU;CAC9D,MAAM,iBAAiB,eAAgB,QAAQ,QAAQ,MAAM,OAAQ;CAErE,SAAS,iBAAiB,GAAwC;AACjE,MAAI,QAAQ,MACX,QAAQ,EAAoB;AAE7B,SAAQ,EAAoB;;AAG7B,QAAO;EACN,WAAW,UAAU;EACrB,eAAe,cAAc;EAC7B,aAAa,YAAY;EACzB,OAAO,MAAM;EACb,SAAS,QAAQ;EACjB,gBAAgB,eAAe;EAC/B,gBAAgB,eAAe;EAC/B;EACA;EACA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useShortKeyPress.js","names":[],"sources":["../src/useShortKeyPress.ts"],"sourcesContent":["import { onKeyDown, onKeyUp } from '@vueuse/core';\nimport type { KeyFilter } from '@vueuse/core';\nimport { ref, unref } from 'vue';\nimport type { MaybeRefOrGetter } from 'vue';\n\nexport function useShortKeyPress(\n\tkey: KeyFilter,\n\tfn: () => void,\n\t{\n\t\tdedupe = true,\n\t\tthreshold = 300,\n\t\tdisabled = false,\n\t}: {\n\t\tdedupe?: boolean;\n\t\tthreshold?: number;\n\t\tdisabled?: MaybeRefOrGetter<boolean>;\n\t},\n) {\n\tconst keyDownTime = ref<number | null>(null);\n\n\tonKeyDown(\n\t\tkey,\n\t\t() => {\n\t\t\tif (unref(disabled)) return;\n\n\t\t\tkeyDownTime.value = Date.now();\n\t\t},\n\t\t{\n\t\t\tdedupe,\n\t\t},\n\t);\n\n\tonKeyUp(key, () => {\n\t\tif (unref(disabled) || !keyDownTime.value) return;\n\n\t\tconst isShortPress = Date.now() - keyDownTime.value < threshold;\n\t\tif (isShortPress) {\n\t\t\tfn();\n\t\t}\n\t});\n}\n"],"mappings":";;;;AAKA,SAAgB,iBACf,KACA,IACA,EACC,SAAS,MACT,YAAY,KACZ,WAAW,SAMX;CACD,MAAM,cAAc,IAAmB,KAAK;AAE5C,WACC,WACM;AACL,MAAI,MAAM,SAAS,CAAE;AAErB,cAAY,QAAQ,KAAK,KAAK;IAE/B,EACC,QACA,CACD;AAED,SAAQ,WAAW;AAClB,MAAI,MAAM,SAAS,IAAI,CAAC,YAAY,MAAO;AAG3C,MADqB,KAAK,KAAK,GAAG,YAAY,QAAQ,UAErD,KAAI;GAEJ"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useThrottleWithReactiveDelay.js","names":[],"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":";;;;;;;AAMA,SAAgB,6BAAgC,OAAe,OAAmC;CACjG,MAAM,YAAY,WAAW,MAAM,MAAM;AAEzC,OACC,OACA,eACE,WAAc;AACd,YAAU,QAAQ;IAEnB,OACA,MACA,KACA,EACD,EAAE,WAAW,MAAM,CACnB;AAED,QAAO"}
|