mirror of
https://github.com/Cacti/cacti.git
synced 2026-10-23 03:27:02 +09:00
deps: update hotkeys-js to 4.0.8 with compatible browser assets (#8343)
* deps(deps): bump hotkeys-js from 3.10.1 to 4.0.8 Bumps [hotkeys-js](https://github.com/jaywcjlove/hotkeys-js) from 3.10.1 to 4.0.8. - [Release notes](https://github.com/jaywcjlove/hotkeys-js/releases) - [Commits](https://github.com/jaywcjlove/hotkeys-js/compare/v3.10.1...v4.0.8) --- updated-dependencies: - dependency-name: hotkeys-js dependency-version: 4.0.8 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * fix(build): use hotkeys v4 browser artifact paths Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> --------- Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Thomas Vincent <thomasvincent@gmail.com>
This commit is contained in:
1 parent
76a916cf03
commit
5229064a22
4 files changed
+44
-8
No files matched your search
+2
-2
@@ -24,8 +24,8 @@ export const assetMap = Object.freeze({
|
||||
'node_modules/moment/min/moment.min.js': 'include/js/vendor/moment/moment.min.js',
|
||||
'node_modules/moment/LICENSE': 'include/js/vendor/moment/LICENSE',
|
||||
'node_modules/daterangepicker/daterangepicker.js': 'include/js/vendor/daterangepicker/daterangepicker.js',
|
||||
'node_modules/hotkeys-js/dist/hotkeys.js': 'include/js/vendor/hotkeys/hotkeys.js',
|
||||
'node_modules/hotkeys-js/dist/hotkeys.min.js': 'include/js/vendor/hotkeys/hotkeys.min.js',
|
||||
'node_modules/hotkeys-js/dist/hotkeys-js.umd.cjs': 'include/js/vendor/hotkeys/hotkeys.js',
|
||||
'node_modules/hotkeys-js/dist/hotkeys-js.min.js': 'include/js/vendor/hotkeys/hotkeys.min.js',
|
||||
'node_modules/hotkeys-js/LICENSE': 'include/js/vendor/hotkeys/LICENSE',
|
||||
'node_modules/mark.js/dist/jquery.mark.js': 'include/js/vendor/mark/jquery.mark.js',
|
||||
'node_modules/jstree/dist/jstree.js': 'include/js/jstree.js',
|
||||
|
||||
Generated
+8
-5
@@ -16,7 +16,7 @@
|
||||
"d3": "7.9.0",
|
||||
"daterangepicker": "3.1.0",
|
||||
"dompurify": "3.4.16",
|
||||
"hotkeys-js": "3.10.1",
|
||||
"hotkeys-js": "4.0.8",
|
||||
"htmx.org": "2.0.11",
|
||||
"jquery": "4.0.0",
|
||||
"jquery-ui": "1.14.2",
|
||||
@@ -585,10 +585,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/hotkeys-js": {
|
||||
"version": "3.10.1",
|
||||
"resolved": "https://registry.npmjs.org/hotkeys-js/-/hotkeys-js-3.10.1.tgz",
|
||||
"integrity": "sha512-mshqjgTqx8ee0qryHvRgZaZDxTwxam/2yTQmQlqAWS3+twnq1jsY9Yng9zB7lWq6WRrjTbTOc7knNwccXQiAjQ==",
|
||||
"license": "MIT"
|
||||
"version": "4.0.8",
|
||||
"resolved": "https://registry.npmjs.org/hotkeys-js/-/hotkeys-js-4.0.8.tgz",
|
||||
"integrity": "sha512-A0nu5ZU7cN8nEx3uGUHrv1WnJvjPFUw4Cfxj8pLyR5AIg14ACP4D0YZ+5JHAPjlvUbPbgok56+XTZWjscYCV4A==",
|
||||
"license": "MIT",
|
||||
"funding": {
|
||||
"url": "https://jaywcjlove.github.io/#/sponsor"
|
||||
}
|
||||
},
|
||||
"node_modules/htmx.org": {
|
||||
"version": "2.0.11",
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@
|
||||
"daterangepicker": "3.1.0",
|
||||
"dompurify": "3.4.16",
|
||||
"htmx.org": "2.0.11",
|
||||
"hotkeys-js": "3.10.1",
|
||||
"hotkeys-js": "4.0.8",
|
||||
"jquery": "4.0.0",
|
||||
"jquery-ui": "1.14.2",
|
||||
"jquery-ui-touch-punch": "0.2.3",
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import { readFileSync } from 'node:fs';
|
||||
import { resolve } from 'node:path';
|
||||
import { test } from 'node:test';
|
||||
import vm from 'node:vm';
|
||||
|
||||
const root = resolve(import.meta.dirname, '../..');
|
||||
const dependencies = JSON.parse(readFileSync(resolve(root, 'package.json'), 'utf8')).dependencies;
|
||||
|
||||
test('the pinned Chart build loads through Cacti\'s classic script tag', () => {
|
||||
const context = { window: {}, self: {} };
|
||||
const source = readFileSync(resolve(root, 'include/js/Chart.js'), 'utf8');
|
||||
vm.runInNewContext(source, context);
|
||||
assert.equal(typeof context.Chart, 'function');
|
||||
assert.ok(source.includes('Chart.js v' + dependencies['chart.js']));
|
||||
if (context.Chart.version !== undefined) assert.equal(context.Chart.version, dependencies['chart.js']);
|
||||
});
|
||||
|
||||
for (const name of ['hotkeys.js', 'hotkeys.min.js']) {
|
||||
test(`${name} preserves shortcut registration, triggering, and removal`, () => {
|
||||
const target = { addEventListener() {}, removeEventListener() {} };
|
||||
const context = { window: { ...target }, document: { ...target } };
|
||||
vm.runInNewContext(readFileSync(resolve(root, 'include/js/vendor/hotkeys', name), 'utf8'), context);
|
||||
const hotkeys = context.window.hotkeys;
|
||||
assert.equal(typeof hotkeys, 'function');
|
||||
let calls = 0;
|
||||
hotkeys('ctrl+g', () => { calls++; });
|
||||
hotkeys.trigger('ctrl+g');
|
||||
hotkeys.unbind('ctrl+g');
|
||||
hotkeys.trigger('ctrl+g');
|
||||
assert.equal(calls, 1);
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user