@furystack/shades 8.0.10 → 8.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.
- package/esm/component-factory.spec.d.ts +2 -0
- package/esm/component-factory.spec.d.ts.map +1 -0
- package/esm/component-factory.spec.js +80 -0
- package/esm/component-factory.spec.js.map +1 -0
- package/esm/components/lazy-load.spec.d.ts +2 -0
- package/esm/components/lazy-load.spec.d.ts.map +1 -0
- package/esm/components/lazy-load.spec.js +76 -0
- package/esm/components/lazy-load.spec.js.map +1 -0
- package/esm/components/route-link.spec.d.ts +2 -0
- package/esm/components/route-link.spec.d.ts.map +1 -0
- package/esm/components/route-link.spec.js +33 -0
- package/esm/components/route-link.spec.js.map +1 -0
- package/esm/components/router.spec.d.ts +2 -0
- package/esm/components/router.spec.d.ts.map +1 -0
- package/esm/components/router.spec.js +89 -0
- package/esm/components/router.spec.js.map +1 -0
- package/esm/services/location-service.js +21 -18
- package/esm/services/location-service.js.map +1 -1
- package/esm/services/location-service.spec.d.ts +2 -0
- package/esm/services/location-service.spec.d.ts.map +1 -0
- package/esm/services/location-service.spec.js +90 -0
- package/esm/services/location-service.spec.js.map +1 -0
- package/esm/services/resource-manager.js +21 -23
- package/esm/services/resource-manager.js.map +1 -1
- package/esm/services/resource-manager.spec.d.ts +2 -0
- package/esm/services/resource-manager.spec.d.ts.map +1 -0
- package/esm/services/resource-manager.spec.js +31 -0
- package/esm/services/resource-manager.spec.js.map +1 -0
- package/esm/services/screen-service.js +32 -31
- package/esm/services/screen-service.js.map +1 -1
- package/esm/services/screen-service.spec.d.ts +2 -0
- package/esm/services/screen-service.spec.d.ts.map +1 -0
- package/esm/services/screen-service.spec.js +28 -0
- package/esm/services/screen-service.spec.js.map +1 -0
- package/esm/shade-resources.integration.spec.d.ts +2 -0
- package/esm/shade-resources.integration.spec.d.ts.map +1 -0
- package/esm/shade-resources.integration.spec.js +58 -0
- package/esm/shade-resources.integration.spec.js.map +1 -0
- package/esm/shade.js +80 -74
- package/esm/shade.js.map +1 -1
- package/esm/shades.integration.spec.d.ts +2 -0
- package/esm/shades.integration.spec.d.ts.map +1 -0
- package/esm/shades.integration.spec.js +254 -0
- package/esm/shades.integration.spec.js.map +1 -0
- package/package.json +8 -8
- package/src/component-factory.spec.tsx +2 -2
- package/src/components/lazy-load.spec.tsx +4 -2
- package/src/components/route-link.spec.tsx +4 -2
- package/src/components/router.spec.tsx +5 -3
- package/src/services/location-service.spec.ts +1 -1
- package/src/services/resource-manager.spec.ts +1 -1
- package/src/services/screen-service.spec.ts +1 -1
- package/src/shade-resources.integration.spec.tsx +3 -3
- package/src/shades.integration.spec.tsx +3 -3
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ObservableValue, using } from '@furystack/utils';
|
|
2
|
+
import { ResourceManager } from './resource-manager.js';
|
|
3
|
+
import { describe, it, expect } from 'vitest';
|
|
4
|
+
describe('ResourceManager', () => {
|
|
5
|
+
it('Should return an observable from cache', () => {
|
|
6
|
+
using(new ResourceManager(), (rm) => {
|
|
7
|
+
const o = new ObservableValue(1);
|
|
8
|
+
const [value1] = rm.useObservable('test', o, () => {
|
|
9
|
+
/** ignore */
|
|
10
|
+
});
|
|
11
|
+
const [value2] = rm.useObservable('test', o, () => {
|
|
12
|
+
/** ignore */
|
|
13
|
+
});
|
|
14
|
+
expect(value1).toBe(value2);
|
|
15
|
+
expect(o.getObservers().length).toBe(1);
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
it('Should return a disposable from cache', () => {
|
|
19
|
+
using(new ResourceManager(), (rm) => {
|
|
20
|
+
const d = {
|
|
21
|
+
dispose: () => {
|
|
22
|
+
/** ignore */
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
const d1 = rm.useDisposable('test', () => d);
|
|
26
|
+
const d2 = rm.useDisposable('test', () => d);
|
|
27
|
+
expect(d1).toBe(d2);
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
//# sourceMappingURL=resource-manager.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resource-manager.spec.js","sourceRoot":"","sources":["../../src/services/resource-manager.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AACvD,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC7C,QAAQ,CAAC,iBAAiB,EAAE,GAAG,EAAE;IAC/B,EAAE,CAAC,wCAAwC,EAAE,GAAG,EAAE;QAChD,KAAK,CAAC,IAAI,eAAe,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE;YAClC,MAAM,CAAC,GAAG,IAAI,eAAe,CAAC,CAAC,CAAC,CAAA;YAChC,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,aAAa,CAAC,MAAM,EAAE,CAAC,EAAE,GAAG,EAAE;gBAChD,aAAa;YACf,CAAC,CAAC,CAAA;YACF,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,aAAa,CAAC,MAAM,EAAE,CAAC,EAAE,GAAG,EAAE;gBAChD,aAAa;YACf,CAAC,CAAC,CAAA;YAEF,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;YAE3B,MAAM,CAAC,CAAC,CAAC,YAAY,EAAE,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;QACzC,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,uCAAuC,EAAE,GAAG,EAAE;QAC/C,KAAK,CAAC,IAAI,eAAe,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE;YAClC,MAAM,CAAC,GAAG;gBACR,OAAO,EAAE,GAAG,EAAE;oBACZ,aAAa;gBACf,CAAC;aACF,CAAA;YACD,MAAM,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,CAAA;YAC5C,MAAM,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,CAAA;YAE5C,MAAM,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;QACrB,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
|
@@ -13,13 +13,43 @@ export const ScreenSizes = ['xs', 'sm', 'md', 'lg', 'xl'];
|
|
|
13
13
|
/**
|
|
14
14
|
* Service for handling screen size changes
|
|
15
15
|
*/
|
|
16
|
-
|
|
16
|
+
let ScreenService = class ScreenService {
|
|
17
|
+
getOrientation = () => (window.matchMedia?.('(orientation:landscape').matches ? 'landscape' : 'portrait');
|
|
18
|
+
/**
|
|
19
|
+
* The definitions of the breakpoints
|
|
20
|
+
*/
|
|
21
|
+
breakpoints = {
|
|
22
|
+
xl: { minSize: 1920 },
|
|
23
|
+
lg: { minSize: 1280 },
|
|
24
|
+
md: { minSize: 960 },
|
|
25
|
+
sm: { minSize: 600 },
|
|
26
|
+
xs: { minSize: 0 },
|
|
27
|
+
};
|
|
17
28
|
dispose() {
|
|
18
29
|
window.removeEventListener('resize', this.onResizeListener);
|
|
19
30
|
}
|
|
31
|
+
/**
|
|
32
|
+
* Observers for the current screen size. Will refresh on resize
|
|
33
|
+
*/
|
|
34
|
+
screenSize = {
|
|
35
|
+
atLeast: {
|
|
36
|
+
xs: new ObservableValue(this.screenSizeAtLeast('xs')),
|
|
37
|
+
sm: new ObservableValue(this.screenSizeAtLeast('sm')),
|
|
38
|
+
md: new ObservableValue(this.screenSizeAtLeast('md')),
|
|
39
|
+
lg: new ObservableValue(this.screenSizeAtLeast('lg')),
|
|
40
|
+
xl: new ObservableValue(this.screenSizeAtLeast('xl')),
|
|
41
|
+
},
|
|
42
|
+
};
|
|
20
43
|
screenSizeAtLeast(size) {
|
|
21
44
|
return window.innerWidth >= this.breakpoints[size].minSize;
|
|
22
45
|
}
|
|
46
|
+
/**
|
|
47
|
+
* Observable value for tracking the screen orientation
|
|
48
|
+
*/
|
|
49
|
+
orientation = new ObservableValue(this.getOrientation());
|
|
50
|
+
onResizeListener = () => {
|
|
51
|
+
this.refreshValues();
|
|
52
|
+
};
|
|
23
53
|
refreshValues() {
|
|
24
54
|
this.orientation.setValue(this.getOrientation());
|
|
25
55
|
ScreenSizes.forEach((size) => {
|
|
@@ -27,36 +57,6 @@ export let ScreenService = class ScreenService {
|
|
|
27
57
|
});
|
|
28
58
|
}
|
|
29
59
|
constructor() {
|
|
30
|
-
this.getOrientation = () => (window.matchMedia?.('(orientation:landscape').matches ? 'landscape' : 'portrait');
|
|
31
|
-
/**
|
|
32
|
-
* The definitions of the breakpoints
|
|
33
|
-
*/
|
|
34
|
-
this.breakpoints = {
|
|
35
|
-
xl: { minSize: 1920 },
|
|
36
|
-
lg: { minSize: 1280 },
|
|
37
|
-
md: { minSize: 960 },
|
|
38
|
-
sm: { minSize: 600 },
|
|
39
|
-
xs: { minSize: 0 },
|
|
40
|
-
};
|
|
41
|
-
/**
|
|
42
|
-
* Observers for the current screen size. Will refresh on resize
|
|
43
|
-
*/
|
|
44
|
-
this.screenSize = {
|
|
45
|
-
atLeast: {
|
|
46
|
-
xs: new ObservableValue(this.screenSizeAtLeast('xs')),
|
|
47
|
-
sm: new ObservableValue(this.screenSizeAtLeast('sm')),
|
|
48
|
-
md: new ObservableValue(this.screenSizeAtLeast('md')),
|
|
49
|
-
lg: new ObservableValue(this.screenSizeAtLeast('lg')),
|
|
50
|
-
xl: new ObservableValue(this.screenSizeAtLeast('xl')),
|
|
51
|
-
},
|
|
52
|
-
};
|
|
53
|
-
/**
|
|
54
|
-
* Observable value for tracking the screen orientation
|
|
55
|
-
*/
|
|
56
|
-
this.orientation = new ObservableValue(this.getOrientation());
|
|
57
|
-
this.onResizeListener = () => {
|
|
58
|
-
this.refreshValues();
|
|
59
|
-
};
|
|
60
60
|
window.addEventListener('resize', this.onResizeListener);
|
|
61
61
|
this.refreshValues();
|
|
62
62
|
}
|
|
@@ -65,4 +65,5 @@ ScreenService = __decorate([
|
|
|
65
65
|
Injectable({ lifetime: 'singleton' }),
|
|
66
66
|
__metadata("design:paramtypes", [])
|
|
67
67
|
], ScreenService);
|
|
68
|
+
export { ScreenService };
|
|
68
69
|
//# sourceMappingURL=screen-service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"screen-service.js","sourceRoot":"","sources":["../../src/services/screen-service.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAE9C,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAElD,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAU,CAAA;AAMlE;;GAEG;AAEI,
|
|
1
|
+
{"version":3,"file":"screen-service.js","sourceRoot":"","sources":["../../src/services/screen-service.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAE9C,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAElD,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAU,CAAA;AAMlE;;GAEG;AAEI,IAAM,aAAa,GAAnB,MAAM,aAAa;IAChB,cAAc,GAAG,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC,wBAAwB,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,UAAU,CAAC,CAAA;IAEjH;;OAEG;IACa,WAAW,GAA+C;QACxE,EAAE,EAAE,EAAE,OAAO,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AI,EAAE,EAAE;YAC3B,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAA;QACtE,CAAC,CAAC,CAAA;IACJ,CAAC;IAED;QACE,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,IAAI,CAAC,gBAAgB,CAAC,CAAA;QACxD,IAAI,CAAC,aAAa,EAAE,CAAA;IACtB,CAAC;CACF,CAAA;AAzDY,aAAa;IADzB,UAAU,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC;;GACzB,aAAa,CAyDzB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"screen-service.spec.d.ts","sourceRoot":"","sources":["../../src/services/screen-service.spec.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { TextEncoder, TextDecoder } from 'util';
|
|
2
|
+
global.TextEncoder = TextEncoder;
|
|
3
|
+
global.TextDecoder = TextDecoder;
|
|
4
|
+
import { Injector } from '@furystack/inject';
|
|
5
|
+
import { usingAsync } from '@furystack/utils';
|
|
6
|
+
import { ScreenService } from './screen-service.js';
|
|
7
|
+
import { describe, it, expect, beforeEach, afterEach } from 'vitest';
|
|
8
|
+
describe('ScreenService', () => {
|
|
9
|
+
beforeEach(() => {
|
|
10
|
+
document.body.innerHTML = '<div id="root"></div>';
|
|
11
|
+
});
|
|
12
|
+
afterEach(() => {
|
|
13
|
+
document.body.innerHTML = '';
|
|
14
|
+
});
|
|
15
|
+
it('Shuld be constructed', async () => {
|
|
16
|
+
await usingAsync(new Injector(), async (i) => {
|
|
17
|
+
const s = i.getInstance(ScreenService);
|
|
18
|
+
expect(s).toBeInstanceOf(ScreenService);
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
it('Shuld update state on events', async () => {
|
|
22
|
+
await usingAsync(new Injector(), async (i) => {
|
|
23
|
+
i.getInstance(ScreenService);
|
|
24
|
+
/** TODO */
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
//# sourceMappingURL=screen-service.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"screen-service.spec.js","sourceRoot":"","sources":["../../src/services/screen-service.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,MAAM,CAAA;AAE/C,MAAM,CAAC,WAAW,GAAG,WAAW,CAAA;AAChC,MAAM,CAAC,WAAW,GAAG,WAAkB,CAAA;AAEvC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACnD,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAEpE,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;IAC7B,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;IAEF,EAAE,CAAC,sBAAsB,EAAE,KAAK,IAAI,EAAE;QACpC,MAAM,UAAU,CAAC,IAAI,QAAQ,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE;YAC3C,MAAM,CAAC,GAAG,CAAC,CAAC,WAAW,CAAC,aAAa,CAAC,CAAA;YACtC,MAAM,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,aAAa,CAAC,CAAA;QACzC,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,8BAA8B,EAAE,KAAK,IAAI,EAAE;QAC5C,MAAM,UAAU,CAAC,IAAI,QAAQ,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE;YAC3C,CAAC,CAAC,WAAW,CAAC,aAAa,CAAC,CAAA;YAC5B,WAAW;QACb,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shade-resources.integration.spec.d.ts","sourceRoot":"","sources":["../src/shade-resources.integration.spec.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Injector } from '@furystack/inject';
|
|
2
|
+
import { TextEncoder, TextDecoder } from 'util';
|
|
3
|
+
global.TextEncoder = TextEncoder;
|
|
4
|
+
global.TextDecoder = TextDecoder;
|
|
5
|
+
import { initializeShadeRoot } from './initialize.js';
|
|
6
|
+
import { Shade } from './shade.js';
|
|
7
|
+
import { createComponent } from './shade-component.js';
|
|
8
|
+
import { ObservableValue } from '@furystack/utils';
|
|
9
|
+
import { describe, it, expect, afterEach, beforeEach, vi } from 'vitest';
|
|
10
|
+
describe('Shade Resources integration tests', () => {
|
|
11
|
+
beforeEach(() => {
|
|
12
|
+
document.body.innerHTML = '<div id="root"></div>';
|
|
13
|
+
});
|
|
14
|
+
afterEach(() => {
|
|
15
|
+
document.body.innerHTML = '';
|
|
16
|
+
});
|
|
17
|
+
it('Should update the component based on a custom observable value change', () => {
|
|
18
|
+
const injector = new Injector();
|
|
19
|
+
const rootElement = document.getElementById('root');
|
|
20
|
+
const renderCounter = vi.fn();
|
|
21
|
+
const obs1 = new ObservableValue(0);
|
|
22
|
+
const obs2 = new ObservableValue('a');
|
|
23
|
+
const ExampleComponent = Shade({
|
|
24
|
+
render: ({ useObservable }) => {
|
|
25
|
+
const [value1] = useObservable('obs1', obs1);
|
|
26
|
+
const [value2] = useObservable('obs2', obs2);
|
|
27
|
+
renderCounter();
|
|
28
|
+
return (createComponent("div", null,
|
|
29
|
+
createComponent("div", { id: "val1" }, value1),
|
|
30
|
+
createComponent("div", { id: "val2" }, value2)));
|
|
31
|
+
},
|
|
32
|
+
shadowDomName: 'shades-example-resource',
|
|
33
|
+
});
|
|
34
|
+
expect(obs1.getObservers().length).toBe(0);
|
|
35
|
+
expect(obs2.getObservers().length).toBe(0);
|
|
36
|
+
initializeShadeRoot({
|
|
37
|
+
injector,
|
|
38
|
+
rootElement,
|
|
39
|
+
jsxElement: createComponent(ExampleComponent, null),
|
|
40
|
+
});
|
|
41
|
+
expect(document.body.innerHTML).toBe('<div id="root"><shades-example-resource><div><div id="val1">0</div><div id="val2">a</div></div></shades-example-resource></div>');
|
|
42
|
+
expect(obs1.getObservers().length).toBe(1);
|
|
43
|
+
expect(obs2.getObservers().length).toBe(1);
|
|
44
|
+
expect(renderCounter).toBeCalledTimes(1);
|
|
45
|
+
obs1.setValue(1);
|
|
46
|
+
expect(document.body.innerHTML).toBe('<div id="root"><shades-example-resource><div><div id="val1">1</div><div id="val2">a</div></div></shades-example-resource></div>');
|
|
47
|
+
expect(renderCounter).toBeCalledTimes(2);
|
|
48
|
+
obs2.setValue('b');
|
|
49
|
+
expect(document.body.innerHTML).toBe('<div id="root"><shades-example-resource><div><div id="val1">1</div><div id="val2">b</div></div></shades-example-resource></div>');
|
|
50
|
+
const element = document.querySelector('shades-example-resource');
|
|
51
|
+
expect(element.getRenderCount()).toBe(3);
|
|
52
|
+
document.body.innerHTML = '';
|
|
53
|
+
expect(obs1.getObservers().length).toBe(0);
|
|
54
|
+
expect(obs2.getObservers().length).toBe(0);
|
|
55
|
+
expect(renderCounter).toBeCalledTimes(3);
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
//# sourceMappingURL=shade-resources.integration.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shade-resources.integration.spec.js","sourceRoot":"","sources":["../src/shade-resources.integration.spec.tsx"],"names":[],"mappings":"AAAA,OA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CAAC,GAAG,CAAC,CAAA;QAClB,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,IAAI,CAClC,iIAAiI,CAClI,CAAA;QAED,MAAM,OAAO,GAAG,QAAQ,CAAC,aAAa,CAAC,yBAAyB,CAAgB,CAAA;QAChF,MAAM,CAAC,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;QAExC,QAAQ,CAAC,IAAI,CAAC,SAAS,GAAG,EAAE,CAAA;QAE5B,MAAM,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;QAC1C,MAAM,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;QAE1C,MAAM,CAAC,aAAa,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,CAAA;IAC1C,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
package/esm/shade.js
CHANGED
|
@@ -14,86 +14,14 @@ export const Shade = (o) => {
|
|
|
14
14
|
if (!existing) {
|
|
15
15
|
const ElementBase = o.elementBase || HTMLElement;
|
|
16
16
|
customElements.define(customElementName, class extends ElementBase {
|
|
17
|
-
|
|
18
|
-
super(...arguments);
|
|
19
|
-
this._renderCount = 0;
|
|
20
|
-
this.resourceManager = new ResourceManager();
|
|
21
|
-
/**
|
|
22
|
-
* @param options Options for rendering the component
|
|
23
|
-
* @returns the JSX element
|
|
24
|
-
*/
|
|
25
|
-
this.render = (options) => {
|
|
26
|
-
this._renderCount++;
|
|
27
|
-
return o.render(options);
|
|
28
|
-
};
|
|
29
|
-
/**
|
|
30
|
-
* @returns values for the current render options
|
|
31
|
-
*/
|
|
32
|
-
this.getRenderOptions = () => {
|
|
33
|
-
const renderOptions = {
|
|
34
|
-
props: this.props,
|
|
35
|
-
injector: this.injector,
|
|
36
|
-
children: this.shadeChildren,
|
|
37
|
-
element: this,
|
|
38
|
-
renderCount: this._renderCount,
|
|
39
|
-
useObservable: (key, obesrvable, callback, getLast) => this.resourceManager.useObservable(key, obesrvable, callback || (() => this.updateComponent()), getLast),
|
|
40
|
-
useState: (key, initialValue) => this.resourceManager.useState(key, initialValue, this.updateComponent.bind(this)),
|
|
41
|
-
useSearchState: (key, initialValue) => this.resourceManager.useObservable(`useSearchState-${key}`, this.injector.getInstance(LocationService).useSearchParam(key, initialValue), () => this.updateComponent()),
|
|
42
|
-
useStoredState: (key, initialValue, storageArea = localStorage) => {
|
|
43
|
-
const getFromStorage = () => {
|
|
44
|
-
const value = storageArea?.getItem(key);
|
|
45
|
-
return value ? JSON.parse(value) : initialValue;
|
|
46
|
-
};
|
|
47
|
-
const setToStorage = (value) => {
|
|
48
|
-
if (JSON.stringify(value) !== storageArea?.getItem(key)) {
|
|
49
|
-
const newValue = JSON.stringify(value);
|
|
50
|
-
storageArea?.setItem(key, newValue);
|
|
51
|
-
}
|
|
52
|
-
if (JSON.stringify(observable.getValue()) !== JSON.stringify(value)) {
|
|
53
|
-
observable.setValue(value);
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
const observable = this.resourceManager.useDisposable(`useStoredState-${key}`, () => new ObservableValue(getFromStorage()));
|
|
57
|
-
const updateFromStorageEvent = (e) => {
|
|
58
|
-
e.key === key &&
|
|
59
|
-
e.storageArea === storageArea &&
|
|
60
|
-
setToStorage((e.newValue && JSON.parse(e.newValue)) || initialValue);
|
|
61
|
-
};
|
|
62
|
-
this.resourceManager.useDisposable(`useStoredState-${key}-storage-event`, () => {
|
|
63
|
-
window.addEventListener('storage', updateFromStorageEvent);
|
|
64
|
-
const channelName = `useStoredState-broadcast-channel`;
|
|
65
|
-
const messageChannel = new BroadcastChannel(channelName);
|
|
66
|
-
messageChannel.onmessage = (e) => {
|
|
67
|
-
if (e.data.key === key) {
|
|
68
|
-
setToStorage(e.data.value);
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
const subscription = observable.subscribe((value) => {
|
|
72
|
-
messageChannel.postMessage({ key, value });
|
|
73
|
-
});
|
|
74
|
-
return {
|
|
75
|
-
dispose: () => {
|
|
76
|
-
window.removeEventListener('storage', updateFromStorageEvent);
|
|
77
|
-
subscription.dispose();
|
|
78
|
-
messageChannel.close();
|
|
79
|
-
},
|
|
80
|
-
};
|
|
81
|
-
});
|
|
82
|
-
observable.subscribe(setToStorage);
|
|
83
|
-
return this.resourceManager.useObservable(`useStoredState-${key}`, observable, () => this.updateComponent());
|
|
84
|
-
},
|
|
85
|
-
useDisposable: this.resourceManager.useDisposable.bind(this.resourceManager),
|
|
86
|
-
};
|
|
87
|
-
return renderOptions;
|
|
88
|
-
};
|
|
89
|
-
this.cleanup = undefined;
|
|
90
|
-
}
|
|
17
|
+
_renderCount = 0;
|
|
91
18
|
/**
|
|
92
19
|
* @returns the current render count
|
|
93
20
|
*/
|
|
94
21
|
getRenderCount() {
|
|
95
22
|
return this._renderCount;
|
|
96
23
|
}
|
|
24
|
+
resourceManager = new ResourceManager();
|
|
97
25
|
connectedCallback() {
|
|
98
26
|
o.onAttach?.(this.getRenderOptions());
|
|
99
27
|
this.callConstructed();
|
|
@@ -103,6 +31,82 @@ export const Shade = (o) => {
|
|
|
103
31
|
this.resourceManager.dispose();
|
|
104
32
|
this.cleanup?.();
|
|
105
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* Will be triggered when updating the external props object
|
|
36
|
+
*/
|
|
37
|
+
props;
|
|
38
|
+
/**
|
|
39
|
+
* Will be updated when on children change
|
|
40
|
+
*/
|
|
41
|
+
shadeChildren;
|
|
42
|
+
/**
|
|
43
|
+
* @param options Options for rendering the component
|
|
44
|
+
* @returns the JSX element
|
|
45
|
+
*/
|
|
46
|
+
render = (options) => {
|
|
47
|
+
this._renderCount++;
|
|
48
|
+
return o.render(options);
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* @returns values for the current render options
|
|
52
|
+
*/
|
|
53
|
+
getRenderOptions = () => {
|
|
54
|
+
const renderOptions = {
|
|
55
|
+
props: this.props,
|
|
56
|
+
injector: this.injector,
|
|
57
|
+
children: this.shadeChildren,
|
|
58
|
+
element: this,
|
|
59
|
+
renderCount: this._renderCount,
|
|
60
|
+
useObservable: (key, obesrvable, callback, getLast) => this.resourceManager.useObservable(key, obesrvable, callback || (() => this.updateComponent()), getLast),
|
|
61
|
+
useState: (key, initialValue) => this.resourceManager.useState(key, initialValue, this.updateComponent.bind(this)),
|
|
62
|
+
useSearchState: (key, initialValue) => this.resourceManager.useObservable(`useSearchState-${key}`, this.injector.getInstance(LocationService).useSearchParam(key, initialValue), () => this.updateComponent()),
|
|
63
|
+
useStoredState: (key, initialValue, storageArea = localStorage) => {
|
|
64
|
+
const getFromStorage = () => {
|
|
65
|
+
const value = storageArea?.getItem(key);
|
|
66
|
+
return value ? JSON.parse(value) : initialValue;
|
|
67
|
+
};
|
|
68
|
+
const setToStorage = (value) => {
|
|
69
|
+
if (JSON.stringify(value) !== storageArea?.getItem(key)) {
|
|
70
|
+
const newValue = JSON.stringify(value);
|
|
71
|
+
storageArea?.setItem(key, newValue);
|
|
72
|
+
}
|
|
73
|
+
if (JSON.stringify(observable.getValue()) !== JSON.stringify(value)) {
|
|
74
|
+
observable.setValue(value);
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
const observable = this.resourceManager.useDisposable(`useStoredState-${key}`, () => new ObservableValue(getFromStorage()));
|
|
78
|
+
const updateFromStorageEvent = (e) => {
|
|
79
|
+
e.key === key &&
|
|
80
|
+
e.storageArea === storageArea &&
|
|
81
|
+
setToStorage((e.newValue && JSON.parse(e.newValue)) || initialValue);
|
|
82
|
+
};
|
|
83
|
+
this.resourceManager.useDisposable(`useStoredState-${key}-storage-event`, () => {
|
|
84
|
+
window.addEventListener('storage', updateFromStorageEvent);
|
|
85
|
+
const channelName = `useStoredState-broadcast-channel`;
|
|
86
|
+
const messageChannel = new BroadcastChannel(channelName);
|
|
87
|
+
messageChannel.onmessage = (e) => {
|
|
88
|
+
if (e.data.key === key) {
|
|
89
|
+
setToStorage(e.data.value);
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
const subscription = observable.subscribe((value) => {
|
|
93
|
+
messageChannel.postMessage({ key, value });
|
|
94
|
+
});
|
|
95
|
+
return {
|
|
96
|
+
dispose: () => {
|
|
97
|
+
window.removeEventListener('storage', updateFromStorageEvent);
|
|
98
|
+
subscription.dispose();
|
|
99
|
+
messageChannel.close();
|
|
100
|
+
},
|
|
101
|
+
};
|
|
102
|
+
});
|
|
103
|
+
observable.subscribe(setToStorage);
|
|
104
|
+
return this.resourceManager.useObservable(`useStoredState-${key}`, observable, () => this.updateComponent());
|
|
105
|
+
},
|
|
106
|
+
useDisposable: this.resourceManager.useDisposable.bind(this.resourceManager),
|
|
107
|
+
};
|
|
108
|
+
return renderOptions;
|
|
109
|
+
};
|
|
106
110
|
/**
|
|
107
111
|
* Updates the component in the DOM.
|
|
108
112
|
*/
|
|
@@ -135,6 +139,8 @@ export const Shade = (o) => {
|
|
|
135
139
|
this.cleanup = cleanupResult;
|
|
136
140
|
}
|
|
137
141
|
}
|
|
142
|
+
cleanup = undefined;
|
|
143
|
+
_injector;
|
|
138
144
|
getInjectorFromParent() {
|
|
139
145
|
let parent = this.parentElement;
|
|
140
146
|
while (parent) {
|
package/esm/shade.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shade.js","sourceRoot":"","sources":["../src/shade.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAElD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAE5C,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AA8ChE;;;;GAIG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,CAAS,CAAuB,EAAE,EAAE;I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