@wise/art 2.7.0-beta.1 → 2.7.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.
Files changed (118) hide show
  1. package/dist/Illustration.css +0 -19
  2. package/dist/common.d.ts +0 -5
  3. package/dist/common.d.ts.map +1 -1
  4. package/dist/index.d.ts +0 -3
  5. package/dist/index.d.ts.map +1 -1
  6. package/dist/index.esm.js +158 -4
  7. package/dist/index.esm.js.map +1 -1
  8. package/dist/index.js +155 -15
  9. package/dist/index.js.map +1 -1
  10. package/package.json +5 -11
  11. package/src/common.ts +0 -6
  12. package/src/illustrations/Illustration.css +0 -19
  13. package/src/index.ts +0 -5
  14. package/dist/CheckMark-365a1dc6.js +0 -39
  15. package/dist/CheckMark-365a1dc6.js.map +0 -1
  16. package/dist/CheckMark-5b996187.esm.js +0 -37
  17. package/dist/CheckMark-5b996187.esm.js.map +0 -1
  18. package/dist/Confetti-b6bfa95b.js +0 -36
  19. package/dist/Confetti-b6bfa95b.js.map +0 -1
  20. package/dist/Confetti-c865d663.esm.js +0 -34
  21. package/dist/Confetti-c865d663.esm.js.map +0 -1
  22. package/dist/Flower-1987844c.esm.js +0 -27
  23. package/dist/Flower-1987844c.esm.js.map +0 -1
  24. package/dist/Flower-385aa337.js +0 -29
  25. package/dist/Flower-385aa337.js.map +0 -1
  26. package/dist/Globe-b5acfedf.js +0 -45
  27. package/dist/Globe-b5acfedf.js.map +0 -1
  28. package/dist/Globe-df8b4bbd.esm.js +0 -43
  29. package/dist/Globe-df8b4bbd.esm.js.map +0 -1
  30. package/dist/Graph-bc618890.js +0 -33
  31. package/dist/Graph-bc618890.js.map +0 -1
  32. package/dist/Graph-e48b9d55.esm.js +0 -31
  33. package/dist/Graph-e48b9d55.esm.js.map +0 -1
  34. package/dist/Jars-b371f7ec.esm.js +0 -50
  35. package/dist/Jars-b371f7ec.esm.js.map +0 -1
  36. package/dist/Jars-b80056b7.js +0 -52
  37. package/dist/Jars-b80056b7.js.map +0 -1
  38. package/dist/Lock-0d8008b7.esm.js +0 -41
  39. package/dist/Lock-0d8008b7.esm.js.map +0 -1
  40. package/dist/Lock-841864c6.js +0 -43
  41. package/dist/Lock-841864c6.js.map +0 -1
  42. package/dist/MagnifyingGlass-7b6dda3b.esm.js +0 -30
  43. package/dist/MagnifyingGlass-7b6dda3b.esm.js.map +0 -1
  44. package/dist/MagnifyingGlass-de98441e.js +0 -32
  45. package/dist/MagnifyingGlass-de98441e.js.map +0 -1
  46. package/dist/Marble-5a115e95.esm.js +0 -42
  47. package/dist/Marble-5a115e95.esm.js.map +0 -1
  48. package/dist/Marble-c42785f3.js +0 -44
  49. package/dist/Marble-c42785f3.js.map +0 -1
  50. package/dist/MarbleCard-1792cf0c.esm.js +0 -45
  51. package/dist/MarbleCard-1792cf0c.esm.js.map +0 -1
  52. package/dist/MarbleCard-50b56966.js +0 -47
  53. package/dist/MarbleCard-50b56966.js.map +0 -1
  54. package/dist/MultiCurrency-4735dbb2.esm.js +0 -61
  55. package/dist/MultiCurrency-4735dbb2.esm.js.map +0 -1
  56. package/dist/MultiCurrency-fcf4b9a2.js +0 -63
  57. package/dist/MultiCurrency-fcf4b9a2.js.map +0 -1
  58. package/dist/Plane-1e15b49c.esm.js +0 -37
  59. package/dist/Plane-1e15b49c.esm.js.map +0 -1
  60. package/dist/Plane-91b11234.js +0 -39
  61. package/dist/Plane-91b11234.js.map +0 -1
  62. package/dist/Scene-3830de67.esm.js +0 -48
  63. package/dist/Scene-3830de67.esm.js.map +0 -1
  64. package/dist/Scene-fa187d3a.js +0 -50
  65. package/dist/Scene-fa187d3a.js.map +0 -1
  66. package/dist/illustrations3d/Illustration3d.d.ts +0 -11
  67. package/dist/illustrations3d/Illustration3d.d.ts.map +0 -1
  68. package/dist/illustrations3d/Scene.d.ts +0 -9
  69. package/dist/illustrations3d/Scene.d.ts.map +0 -1
  70. package/dist/illustrations3d/index.d.ts +0 -5
  71. package/dist/illustrations3d/index.d.ts.map +0 -1
  72. package/dist/illustrations3d/models/CheckMark.d.ts +0 -4
  73. package/dist/illustrations3d/models/CheckMark.d.ts.map +0 -1
  74. package/dist/illustrations3d/models/Confetti.d.ts +0 -4
  75. package/dist/illustrations3d/models/Confetti.d.ts.map +0 -1
  76. package/dist/illustrations3d/models/Flower.d.ts +0 -4
  77. package/dist/illustrations3d/models/Flower.d.ts.map +0 -1
  78. package/dist/illustrations3d/models/Globe.d.ts +0 -4
  79. package/dist/illustrations3d/models/Globe.d.ts.map +0 -1
  80. package/dist/illustrations3d/models/Graph.d.ts +0 -4
  81. package/dist/illustrations3d/models/Graph.d.ts.map +0 -1
  82. package/dist/illustrations3d/models/Jars.d.ts +0 -4
  83. package/dist/illustrations3d/models/Jars.d.ts.map +0 -1
  84. package/dist/illustrations3d/models/Lock.d.ts +0 -4
  85. package/dist/illustrations3d/models/Lock.d.ts.map +0 -1
  86. package/dist/illustrations3d/models/MagnifyingGlass.d.ts +0 -4
  87. package/dist/illustrations3d/models/MagnifyingGlass.d.ts.map +0 -1
  88. package/dist/illustrations3d/models/Marble.d.ts +0 -4
  89. package/dist/illustrations3d/models/Marble.d.ts.map +0 -1
  90. package/dist/illustrations3d/models/MarbleCard.d.ts +0 -4
  91. package/dist/illustrations3d/models/MarbleCard.d.ts.map +0 -1
  92. package/dist/illustrations3d/models/MultiCurrency.d.ts +0 -4
  93. package/dist/illustrations3d/models/MultiCurrency.d.ts.map +0 -1
  94. package/dist/illustrations3d/models/Plane.d.ts +0 -4
  95. package/dist/illustrations3d/models/Plane.d.ts.map +0 -1
  96. package/dist/illustrations3d/utils.d.ts +0 -9
  97. package/dist/illustrations3d/utils.d.ts.map +0 -1
  98. package/dist/index-36ff762e.js +0 -332
  99. package/dist/index-36ff762e.js.map +0 -1
  100. package/dist/index-76341731.esm.js +0 -325
  101. package/dist/index-76341731.esm.js.map +0 -1
  102. package/src/illustrations3d/Illustration3d.stories.tsx +0 -89
  103. package/src/illustrations3d/Illustration3d.tsx +0 -133
  104. package/src/illustrations3d/Scene.tsx +0 -54
  105. package/src/illustrations3d/index.ts +0 -6
  106. package/src/illustrations3d/models/CheckMark.tsx +0 -30
  107. package/src/illustrations3d/models/Confetti.tsx +0 -29
  108. package/src/illustrations3d/models/Flower.tsx +0 -24
  109. package/src/illustrations3d/models/Globe.tsx +0 -41
  110. package/src/illustrations3d/models/Graph.tsx +0 -26
  111. package/src/illustrations3d/models/Jars.tsx +0 -47
  112. package/src/illustrations3d/models/Lock.tsx +0 -38
  113. package/src/illustrations3d/models/MagnifyingGlass.tsx +0 -30
  114. package/src/illustrations3d/models/Marble.tsx +0 -47
  115. package/src/illustrations3d/models/MarbleCard.tsx +0 -50
  116. package/src/illustrations3d/models/MultiCurrency.tsx +0 -58
  117. package/src/illustrations3d/models/Plane.tsx +0 -33
  118. package/src/illustrations3d/utils.ts +0 -68
@@ -1,58 +0,0 @@
1
- import { useGLTF, useAnimations } from '@react-three/drei';
2
- import { useFrame, useLoader } from '@react-three/fiber';
3
- import { useRef } from 'react';
4
- import { ObjectLoader, TextureLoader, Color } from 'three';
5
-
6
- import { defineSrc } from '../utils';
7
-
8
- const MultiCurrency = () => {
9
- const ref = useRef();
10
- const model = useGLTF(defineSrc(`multi-currency.gltf`));
11
-
12
- const lights = useLoader(ObjectLoader, defineSrc('multi-currency-light.json'));
13
- const wiseLogo = useLoader(TextureLoader, defineSrc('wise-flag-map-bump.jpg'));
14
-
15
- const animatedMaps = [];
16
-
17
- model.scene.traverse((child) => {
18
- if (child.name.includes('Note')) {
19
- child.castShadow = true;
20
- child.receiveShadow = true;
21
- }
22
-
23
- if (child.name.startsWith('Coin_') && child.isMesh) {
24
- const { material } = child;
25
- material.bumpMap = wiseLogo;
26
- material.bumpMap.flipY = false;
27
- material.bumpScale = 1;
28
- material.color = new Color(0.49, 0.49, 0.49);
29
- child.castShadow = false;
30
- child.receiveShadow = false;
31
- }
32
-
33
- if (child.name.startsWith('NoteBase_') && child.isMesh) {
34
- animatedMaps.push(child.material.map);
35
- }
36
-
37
- if (child.name.includes('Wise') && child.isMesh) {
38
- animatedMaps.push(child.material.map);
39
- }
40
- });
41
-
42
- const { mixer, clips } = useAnimations(model.animations, ref);
43
- useFrame(() => {
44
- animatedMaps.forEach((animatedMap) => {
45
- animatedMap.offset.x += 0.001;
46
- });
47
- mixer.clipAction(clips[0]).play();
48
- });
49
-
50
- return (
51
- <>
52
- <primitive ref={ref} position={[-0.5, -10, 0]} scale={1.3} object={model.scene} />
53
- <primitive object={lights} />
54
- </>
55
- );
56
- };
57
-
58
- export default MultiCurrency;
@@ -1,33 +0,0 @@
1
- import { useGLTF, useAnimations } from '@react-three/drei';
2
- import { useFrame, useLoader } from '@react-three/fiber';
3
- import { useRef } from 'react';
4
- import { ObjectLoader } from 'three';
5
-
6
- import { defineSrc } from '../utils';
7
-
8
- const Plane = () => {
9
- const ref = useRef();
10
- const model = useGLTF(defineSrc('plane.gltf'));
11
-
12
- const lights = useLoader(ObjectLoader, defineSrc('plane-light.json'));
13
- const plane = model.scene.getObjectByName('Plane_6_update');
14
-
15
- const { mixer, clips } = useAnimations(model.animations, ref);
16
- useFrame(() => {
17
- model.materials['Tapestry WebGL'].map.offset.y += 0.018;
18
-
19
- plane.position.x = 0.45;
20
-
21
- plane.position.y = 7.5;
22
- mixer.clipAction(clips[0]).play();
23
- });
24
-
25
- return (
26
- <>
27
- <primitive ref={ref} scale={1.3} position={[0, -7, 0]} object={model.scene} />
28
- <primitive object={lights} />
29
- </>
30
- );
31
- };
32
-
33
- export default Plane;
@@ -1,68 +0,0 @@
1
- import { useState, useEffect } from 'react';
2
-
3
- import type { IllustrationNames } from '../illustrations/metadata';
4
-
5
- export function useBattery() {
6
- const [batteryData, setBatteryData] = useState<{ level: number }>({ level: 1.0 });
7
-
8
- useEffect(() => {
9
- const getBatteryData = async () => {
10
- // @ts-expect-error .getBattery exists in Navigator interface
11
- // eslint-disable-next-line @typescript-eslint/no-unsafe-call
12
- const battery = await navigator.getBattery();
13
-
14
- setBatteryData({
15
- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
16
- level: battery?.level,
17
- });
18
- };
19
- // Check if the browser supports the Battery API
20
- if ('getBattery' in navigator) {
21
- void getBatteryData();
22
- }
23
- }, []);
24
-
25
- return batteryData;
26
- }
27
-
28
- export function isBatteryLow(batteryLevel: number): boolean {
29
- return batteryLevel < 0.2;
30
- }
31
-
32
- export function isConnectionSlow(): boolean {
33
- // @ts-expect-error .connection prop exists in Navigator interface
34
- const { connection } = window.navigator;
35
- if (connection === undefined) {
36
- return false;
37
- }
38
- return (
39
- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
40
- ['slow-2g', '2g'].includes(connection?.effectiveType as string) ||
41
- // @ts-expect-error Property 'connection' does exist on type 'Navigator'
42
- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
43
- navigator?.connection?.saveData === true
44
- );
45
- }
46
-
47
- export function defineSrc(asset: string): string {
48
- return `https://wise.com/web-art/assets/illustrations3d/${asset}`;
49
- }
50
-
51
- const illustration3dNames = [
52
- 'lock',
53
- 'globe',
54
- 'confetti',
55
- 'check-mark',
56
- 'flower',
57
- 'graph',
58
- 'jars',
59
- 'magnifying-glass',
60
- 'marble',
61
- 'marble-card',
62
- 'multi-currency',
63
- 'plane',
64
- ];
65
-
66
- export function is3dIllustrationSupported(asset: IllustrationNames): boolean {
67
- return illustration3dNames.includes(asset);
68
- }