@furystack/shades-nipple 4.0.10 → 4.0.12

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,2 @@
1
+ export {};
2
+ //# sourceMappingURL=nipple.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nipple.spec.d.ts","sourceRoot":"","sources":["../src/nipple.spec.tsx"],"names":[],"mappings":""}
@@ -0,0 +1,43 @@
1
+ import { Injector } from '@furystack/inject';
2
+ import { createComponent, initializeShadeRoot } from '@furystack/shades';
3
+ import { NippleComponent } from './nipple.js';
4
+ import { describe, it, expect, afterEach, beforeEach, vi } from 'vitest';
5
+ describe('Nipple', () => {
6
+ beforeEach(() => {
7
+ document.body.innerHTML = '<div id="root"></div>';
8
+ });
9
+ afterEach(() => {
10
+ document.body.innerHTML = '';
11
+ });
12
+ it('Should render with the default settings', () => {
13
+ const injector = new Injector();
14
+ const rootElement = document.getElementById('root');
15
+ initializeShadeRoot({
16
+ injector,
17
+ rootElement,
18
+ jsxElement: createComponent(NippleComponent, { managerOptions: {} }),
19
+ });
20
+ expect(document.body.innerHTML).toBe('<div id="root"><shade-nipple></shade-nipple></div>');
21
+ });
22
+ it('Should attach event properties', async () => {
23
+ const injector = new Injector();
24
+ const rootElement = document.getElementById('root');
25
+ const onStart = vi.fn();
26
+ const onDir = vi.fn();
27
+ const onMove = vi.fn();
28
+ const onEnd = vi.fn();
29
+ initializeShadeRoot({
30
+ injector,
31
+ rootElement,
32
+ jsxElement: createComponent(NippleComponent, { onStart: onStart, onDir: onDir, onMove: onMove, onEnd: onEnd, managerOptions: {} }),
33
+ });
34
+ expect(document.body.innerHTML).toBe('<div id="root"><shade-nipple></shade-nipple></div>');
35
+ const nipple = document.querySelector('shade-nipple');
36
+ expect(nipple.props.onDir).toBe(onDir);
37
+ expect(nipple.props.onEnd).toBe(onEnd);
38
+ expect(nipple.props.onMove).toBe(onMove);
39
+ expect(nipple.props.onStart).toBe(onStart);
40
+ // TODO: Check for pointer events
41
+ });
42
+ });
43
+ //# sourceMappingURL=nipple.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nipple.spec.js","sourceRoot":"","sources":["../src/nipple.spec.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAA;AAExE,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAC7C,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAA;AAExE,QAAQ,CAAC,QAAQ,EAAE,GAAG,EAAE;IACtB,UAAU,CAAC,GAAG,EAAE;QACd,QAAQ,CAAC,IAAI,CAAC,SAAS,GAAG,uBAAuB,CAAA;IACnD,CAAC,CAAC,CAAA;IACF,SAAS,CAAC,GAAG,EAAE;QACb,QAAQ,CAAC,IAAI,CAAC,SAAS,GAAG,EAAE,CAAA;IAC9B,CAAC,CAAC,CAAA;IACF,EAAE,CAAC,yCAAyC,EAAE,GAAG,EAAE;QACjD,MAAM,QAAQ,GAAG,IAAI,QAAQ,EAAE,CAAA;QAC/B,MAAM,WAAW,GAAG,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAmB,CAAA;QAErE,mBAAmB,CAAC;YAClB,QAAQ;YACR,WAAW;YACX,UAAU,EAAE,gBAAC,eAAe,IAAC,cAAc,EAAE,EAAE,GAAI;SACpD,CAAC,CAAA;QACF,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,oDAAoD,CAAC,CAAA;IAC5F,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,gCAAgC,EAAE,KAAK,IAAI,EAAE;QAC9C,MAAM,QAAQ,GAAG,IAAI,QAAQ,EAAE,CAAA;QAC/B,MAAM,WAAW,GAAG,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAmB,CAAA;QAErE,MAAM,OAAO,GAAG,EAAE,CAAC,EAAE,EAAE,CAAA;QACvB,MAAM,KAAK,GAAG,EAAE,CAAC,EAAE,EAAE,CAAA;QACrB,MAAM,MAAM,GAAG,EAAE,CAAC,EAAE,EAAE,CAAA;QACtB,MAAM,KAAK,GAAG,EAAE,CAAC,EAAE,EAAE,CAAA;QAErB,mBAAmB,CAAC;YAClB,QAAQ;YACR,WAAW;YACX,UAAU,EAAE,gBAAC,eAAe,IAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,cAAc,EAAE,EAAE,GAAI;SAClH,CAAC,CAAA;QACF,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,oDAAoD,CAAC,CAAA;QAC1F,MAAM,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,cAAc,CAAsC,CAAA;QAE1F,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QACtC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QACtC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QACxC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QAE1C,iCAAiC;IACnC,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@furystack/shades-nipple",
3
- "version": "4.0.10",
3
+ "version": "4.0.12",
4
4
  "description": "A Nipple component wrapper for FuryStack Shades",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -28,12 +28,12 @@
28
28
  "author": "gallay.lajos@gmail.com",
29
29
  "license": "GPL-2.0",
30
30
  "devDependencies": {
31
- "@furystack/inject": "^8.0.8",
32
- "typescript": "^5.1.6",
33
- "vitest": "^0.34.2"
31
+ "@furystack/inject": "^8.1.1",
32
+ "typescript": "^5.2.2",
33
+ "vitest": "^0.34.6"
34
34
  },
35
35
  "dependencies": {
36
- "@furystack/shades": "^8.0.10",
36
+ "@furystack/shades": "^8.0.12",
37
37
  "nipplejs": "^0.10.1"
38
38
  },
39
39
  "gitHead": "76e1d17a71b981984935c9a7a5791cf61ebf5213"
@@ -1,7 +1,7 @@
1
1
  import { Injector } from '@furystack/inject'
2
2
  import { createComponent, initializeShadeRoot } from '@furystack/shades'
3
- import type { NippleComponentProps } from './nipple'
4
- import { NippleComponent } from './nipple'
3
+ import type { NippleComponentProps } from './nipple.js'
4
+ import { NippleComponent } from './nipple.js'
5
5
  import { describe, it, expect, afterEach, beforeEach, vi } from 'vitest'
6
6
 
7
7
  describe('Nipple', () => {