@wise/art 0.0.0-experimental-718543f → 0.0.0-experimental-2292385
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/illustrations3d/Illustration3D.d.ts +1 -1
- package/dist/illustrations3d/Illustration3D.d.ts.map +1 -1
- package/dist/illustrations3d/utils.d.ts +2 -1
- package/dist/illustrations3d/utils.d.ts.map +1 -1
- package/dist/index.esm.js +25 -19
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +25 -19
- package/dist/index.js.map +1 -1
- package/package.json +3 -2
- package/src/illustrations3d/Illustration3D.css +1 -1
- package/src/illustrations3d/Illustration3D.tsx +15 -24
- package/src/illustrations3d/utils.ts +10 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LargeSize, MediumSize, SmallSize } from '../common';
|
|
2
|
-
export type Illustration3DNames = 'lock' | 'globe' | 'confetti' | 'check-mark' | 'digital-card' | 'graph' | 'jars' | 'marble-card' | 'plane' | 'interest';
|
|
2
|
+
export type Illustration3DNames = 'lock' | 'globe' | 'confetti' | 'check-mark' | 'digital-card' | 'graph' | 'jars' | 'marble-card' | 'plane' | 'digital-card' | 'interest';
|
|
3
3
|
export type Props = {
|
|
4
4
|
name: Illustration3DNames;
|
|
5
5
|
size?: SmallSize | MediumSize | LargeSize;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Illustration3D.d.ts","sourceRoot":"","sources":["../../src/illustrations3d/Illustration3D.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAqB,MAAM,WAAW,CAAC;AAKhF,MAAM,MAAM,mBAAmB,GAC3B,MAAM,GACN,OAAO,GACP,UAAU,GACV,YAAY,GACZ,cAAc,GACd,OAAO,GACP,MAAM,GACN,aAAa,GACb,OAAO,GACP,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"Illustration3D.d.ts","sourceRoot":"","sources":["../../src/illustrations3d/Illustration3D.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAqB,MAAM,WAAW,CAAC;AAKhF,MAAM,MAAM,mBAAmB,GAC3B,MAAM,GACN,OAAO,GACP,UAAU,GACV,YAAY,GACZ,cAAc,GACd,OAAO,GACP,MAAM,GACN,aAAa,GACb,OAAO,GACP,cAAc,GACd,UAAU,CAAC;AAEf,MAAM,MAAM,KAAK,GAAG;IAClB,IAAI,EAAE,mBAAmB,CAAC;IAC1B,IAAI,CAAC,EAAE,SAAS,GAAG,UAAU,GAAG,SAAS,CAAC;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAQF,QAAA,MAAM,cAAc,GAAI,2BAA0C,KAAK,gCAwEtE,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { IllustrationNames } from '../illustrations/metadata';
|
|
2
|
+
import { Illustration3DNames } from './Illustration3D';
|
|
2
3
|
export declare function useBattery(): {
|
|
3
4
|
level: number;
|
|
4
5
|
};
|
|
5
6
|
export declare function isBatteryLow(batteryLevel: number): boolean;
|
|
6
7
|
export declare const isWebGL2Available: () => boolean;
|
|
7
8
|
export declare function isConnectionSlow(): boolean;
|
|
8
|
-
export declare function defineSrc(asset:
|
|
9
|
+
export declare function defineSrc(asset: Illustration3DNames): string;
|
|
9
10
|
export declare function isIllustrationSupport3D(asset: IllustrationNames): boolean;
|
|
10
11
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/illustrations3d/utils.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/illustrations3d/utils.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAEvD,wBAAgB,UAAU;WACgC,MAAM;EAwB/D;AAED,wBAAgB,YAAY,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAE1D;AAED,eAAO,MAAM,iBAAiB,eAQ7B,CAAC;AAEF,wBAAgB,gBAAgB,IAAI,OAAO,CAa1C;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,mBAAmB,GAAG,MAAM,CAS5D;AAkBD,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAEzE"}
|
package/dist/index.esm.js
CHANGED
|
@@ -62,12 +62,12 @@ const Illustration = /*#__PURE__*/forwardRef(({
|
|
|
62
62
|
width: imageSizes[SMALL],
|
|
63
63
|
height: imageSizes[SMALL],
|
|
64
64
|
media: "(max-width: 575px)",
|
|
65
|
-
srcSet: `${defineSrc(name, SMALL, '1x')}, ${defineSrc(name, SMALL, '2x')} 2x`
|
|
65
|
+
srcSet: `${defineSrc$1(name, SMALL, '1x')}, ${defineSrc$1(name, SMALL, '2x')} 2x`
|
|
66
66
|
}), size !== Sizes.MEDIUM ? /*#__PURE__*/jsx("source", {
|
|
67
67
|
width: imageSizes[MEDIUM],
|
|
68
68
|
height: imageSizes[MEDIUM],
|
|
69
69
|
media: "(max-width: 992px)",
|
|
70
|
-
srcSet: `${defineSrc(name, MEDIUM, '1x')}, ${defineSrc(name, MEDIUM, '2x')} 2x`
|
|
70
|
+
srcSet: `${defineSrc$1(name, MEDIUM, '1x')}, ${defineSrc$1(name, MEDIUM, '2x')} 2x`
|
|
71
71
|
}) : null]
|
|
72
72
|
}) : null, /*#__PURE__*/jsx("img", {
|
|
73
73
|
id: id,
|
|
@@ -76,14 +76,14 @@ const Illustration = /*#__PURE__*/forwardRef(({
|
|
|
76
76
|
"data-testid": `wds-${name}-illustration`,
|
|
77
77
|
className: clsx(`wds-illustration wds-illustration-${name}`, className, !disablePadding && 'wds-illustration-padding'),
|
|
78
78
|
loading: loading,
|
|
79
|
-
src: defineSrc(name, size, '1x'),
|
|
80
|
-
srcSet: `${defineSrc(name, size, '2x')} 2x`,
|
|
79
|
+
src: defineSrc$1(name, size, '1x'),
|
|
80
|
+
srcSet: `${defineSrc$1(name, size, '2x')} 2x`,
|
|
81
81
|
width: imageSizes[size],
|
|
82
82
|
height: imageSizes[size]
|
|
83
83
|
})]
|
|
84
84
|
}) : null;
|
|
85
85
|
});
|
|
86
|
-
function defineSrc(illustration, size, descriptor) {
|
|
86
|
+
function defineSrc$1(illustration, size, descriptor) {
|
|
87
87
|
return `https://wise.com/web-art/assets/illustrations/${illustration}-${size}@${descriptor}.webp`;
|
|
88
88
|
}
|
|
89
89
|
|
|
@@ -258,16 +258,21 @@ function isConnectionSlow() {
|
|
|
258
258
|
navigator?.connection?.saveData === true
|
|
259
259
|
);
|
|
260
260
|
}
|
|
261
|
+
function defineSrc(asset) {
|
|
262
|
+
const mapNameToFile = {
|
|
263
|
+
'check-mark': 'checkMark',
|
|
264
|
+
'marble-card': 'marbleWithCard',
|
|
265
|
+
'digital-card': 'digitalCard'
|
|
266
|
+
};
|
|
267
|
+
// return `https://wise.com/web-art/assets/illustrations3d/${asset}`;
|
|
268
|
+
return `scenes/${mapNameToFile[asset] || asset}.html`;
|
|
269
|
+
// return `https://wise.com/web-art/assets/illustrations3d/scene/${asset}`;
|
|
270
|
+
}
|
|
261
271
|
const illustration3DNames = ['lock', 'globe', 'confetti', 'check-mark', 'flower', 'graph', 'jars', 'magnifying-glass', 'marble', 'marble-card', 'multi-currency', 'plane', 'interest'];
|
|
262
272
|
function isIllustrationSupport3D(asset) {
|
|
263
273
|
return illustration3DNames.includes(asset);
|
|
264
274
|
}
|
|
265
275
|
|
|
266
|
-
const mapFileToName = {
|
|
267
|
-
'check-mark': 'checkMark',
|
|
268
|
-
'marble-card': 'marbleWithCard',
|
|
269
|
-
'digital-card': 'digitalCard'
|
|
270
|
-
};
|
|
271
276
|
var RenderMode;
|
|
272
277
|
(function (RenderMode) {
|
|
273
278
|
RenderMode[RenderMode["INIT"] = 0] = "INIT";
|
|
@@ -302,13 +307,15 @@ const Illustration3D = ({
|
|
|
302
307
|
let animationFrameId;
|
|
303
308
|
(function rotationModalOnMouseMove() {
|
|
304
309
|
animationFrameId = window.requestAnimationFrame(rotationModalOnMouseMove);
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
310
|
+
if (mouseRef.current) {
|
|
311
|
+
const dx = mouseRef.current.x / window.innerWidth - 0.5;
|
|
312
|
+
const dy = mouseRef.current.y / window.innerHeight - 0.5;
|
|
313
|
+
const iframeWindow = iframeRef.current?.contentWindow;
|
|
314
|
+
if (iframeWindow?.setRotation) {
|
|
315
|
+
iframeWindow.setRotation(dy, dx, 0);
|
|
316
|
+
}
|
|
317
|
+
} else {
|
|
318
|
+
return;
|
|
312
319
|
}
|
|
313
320
|
})();
|
|
314
321
|
return () => {
|
|
@@ -316,7 +323,6 @@ const Illustration3D = ({
|
|
|
316
323
|
window.cancelAnimationFrame(animationFrameId);
|
|
317
324
|
};
|
|
318
325
|
}, []);
|
|
319
|
-
const modelSrc = `scenes/${mapFileToName[name] || name}.html`;
|
|
320
326
|
return /*#__PURE__*/jsx("div", {
|
|
321
327
|
className: clsx(`wds-illustration-3d wds-illustration-3d-${name} wds-illustration-3d-${inintrinsicSize}`, className),
|
|
322
328
|
"aria-hidden": true,
|
|
@@ -324,7 +330,7 @@ const Illustration3D = ({
|
|
|
324
330
|
ref: iframeRef,
|
|
325
331
|
height: ImageSizes[inintrinsicSize],
|
|
326
332
|
width: ImageSizes[inintrinsicSize],
|
|
327
|
-
src:
|
|
333
|
+
src: defineSrc(name)
|
|
328
334
|
}) : /*#__PURE__*/jsx(Illustration, {
|
|
329
335
|
name: name,
|
|
330
336
|
size: size,
|
package/dist/index.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":["../src/flags/metadata.ts","../src/flags/Flag.tsx","../src/illustrations/Illustration.tsx","../src/illustrations/metadata.ts","../src/illustrations3d/utils.ts","../src/illustrations3d/Illustration3D.tsx"],"sourcesContent":["/*\n *\n * DON'T MODIFY THIS FILE IT'S AUTO GENERATED\n * See: `scripts/generate-flags-metadata.mjs`\n *\n */\n\n\n export const DETAILED_FLAG_CODES = ['zm', 'va', 'uy', 'us', 'ug', 'tw', 'tv', 'tm', 'sv', 'sm', 'si', 'sg', 'py', 'pt', 'ph', 'pe', 'pa', 'om', 'nz', 'np', 'ni', 'mz', 'my', 'mx', 'mt', 'mh', 'md', 'ls', 'lk', 'li', 'ki', 'ke', 'je', 'in', 'im', 'hr', 'hn', 'hm', 'hk', 'gt', 'gi', 'gg', 'fj', 'eur', 'es', 'eg', 'do', 'cn', 'by', 'br', 'bn', 'bf', 'ba', 'az', 'au', 'ar', 'an', 'am', 'al', 'ad'];","import { clsx } from 'clsx';\nimport { useEffect, useState } from 'react';\n\nimport { DETAILED_FLAG_CODES } from './metadata';\n\nexport interface FlagProps {\n /**\n * Two-letter country code (ISO 3166-1 alpha-2) or three-letter currency code (ISO 4217).\n */\n code: string;\n\n /**\n * Width and height to reserve for the underlying image, in pixels. A detailed variant is shown from 150px and above.\n */\n intrinsicSize?: number;\n className?: string;\n loading?: 'lazy' | 'eager';\n}\n\nconst unknownFlagName = 'wise';\n\nexport const Flag = ({\n code,\n intrinsicSize = 64,\n className = undefined,\n loading = 'lazy',\n}: FlagProps) => {\n const [fallback, setFallback] = useState<'simple' | 'unknown' | null>(null);\n useEffect(() => {\n setFallback(null);\n }, [code]);\n\n const detailed = intrinsicSize >= 150;\n // Only get detailed svg if we know it exists, to avoid the performance hit of failing requests\n const name =\n fallback !== 'unknown'\n ? `${code.toLowerCase()}${\n fallback == null &&\n detailed &&\n DETAILED_FLAG_CODES.includes(code.toLowerCase())\n ? '-detailed'\n : ''\n }`\n : unknownFlagName;\n\n return (\n <img\n className={clsx('wds-flag', `wds-flag-${name}`, className)}\n src={\n process.env.NODE_ENV === 'web-art-dev'\n ? `${name}.svg`\n : `https://wise.com/web-art/assets/flags/${name}.svg`\n }\n loading={loading}\n alt=\"\"\n width={intrinsicSize}\n height={intrinsicSize}\n onError={() => {\n setFallback((prev) =>\n prev == null && detailed ? 'simple' : 'unknown',\n );\n }}\n />\n );\n};\n","import { clsx } from 'clsx';\nimport { forwardRef } from 'react';\n\nimport {\n type LargeSize,\n type MediumSize,\n type SmallSize,\n type Descriptors,\n Sizes,\n} from './../common';\nimport type { IllustrationNames } from './metadata';\n\n// Picking only a few props from Image element to avoid breaking change\n// as in future underlying element might change\ntype ImgProps = Pick<React.ImgHTMLAttributes<HTMLImageElement>, 'id' | 'className'>;\n\nexport type IllustrationSizes = LargeSize | MediumSize | SmallSize;\n\nexport type Props = {\n name: IllustrationNames;\n alt?: string;\n size?: IllustrationSizes;\n loading?: 'eager' | 'lazy';\n disablePadding?: boolean;\n} & ImgProps;\n\nconst imageSizes = {\n [Sizes.SMALL]: 200,\n [Sizes.MEDIUM]: 300,\n [Sizes.LARGE]: 500,\n};\n\nconst Illustration = forwardRef<HTMLImageElement, Props>(\n (\n {\n id,\n name,\n alt = '',\n loading = 'eager',\n className,\n size = Sizes.MEDIUM,\n disablePadding = false,\n }: Props,\n ref,\n ) => {\n const { SMALL, MEDIUM } = Sizes;\n\n return name ? (\n <picture>\n {size === Sizes.LARGE || size === Sizes.MEDIUM ? (\n <>\n <source\n width={imageSizes[SMALL]}\n height={imageSizes[SMALL]}\n media=\"(max-width: 575px)\"\n srcSet={`${defineSrc(name, SMALL, '1x')}, ${defineSrc(name, SMALL, '2x')} 2x`}\n />\n {size !== Sizes.MEDIUM ? (\n <source\n width={imageSizes[MEDIUM]}\n height={imageSizes[MEDIUM]}\n media=\"(max-width: 992px)\"\n srcSet={`${defineSrc(name, MEDIUM, '1x')}, ${defineSrc(name, MEDIUM, '2x')} 2x`}\n />\n ) : null}\n </>\n ) : null}\n\n <img\n id={id}\n ref={ref}\n alt={alt}\n data-testid={`wds-${name}-illustration`}\n className={clsx(\n 'wds-illustration',\n `wds-illustration-${name}`,\n { 'wds-illustration-padding': !disablePadding },\n className,\n )}\n loading={loading}\n src={defineSrc(name, size, '1x')}\n srcSet={`${defineSrc(name, size, '2x')} 2x`}\n width={imageSizes[size]}\n height={imageSizes[size]}\n />\n </picture>\n ) : null;\n },\n);\n\nfunction defineSrc(illustration: string, size: IllustrationSizes, descriptor: Descriptors) {\n return `https://wise.com/web-art/assets/illustrations/${illustration}-${size}@${descriptor}.webp`;\n}\n\nexport default Illustration;\n","/*\n *\n * DON'T MODIFY THIS FILE IT'S AUTO GENERATED\n * See: `scripts/generate-i10s-metadata.mjs`\n *\n */\n \n \n export enum Assets {\n WALLET = 'wallet',TWO_INVITE_LETTERS_OPENED = 'two-invite-letters-opened',TOOL = 'tool',TARGET_PLATFORM = 'target-platform',STOPWATCH_PLATFORM = 'stopwatch-platform',SPEECH_BUBBLE = 'speech-bubble',SKIP_AUTHENTICATION = 'skip-authentication',SHOPPING_BAG = 'shopping-bag',SATELLITE_PLATFORM = 'satellite-platform',SAND_TIMER_BUSINESS = 'sand-timer-business',SAND_TIMER = 'sand-timer',REMINDER_LETTER = 'reminder-letter',RED_PACKET = 'red-packet',RECEIVE_BUSINESS = 'receive-business',RECEIVE = 'receive',QUESTION_MARK_BUSINESS = 'question-mark-business',QUESTION_MARK = 'question-mark',PUZZLE_PIECES_BUSINESS = 'puzzle-pieces-business',PUZZLE_PIECES = 'puzzle-pieces',PLANE_BUSINESS = 'plane-business',PLANE_2 = 'plane-2',PLANE = 'plane',PIE_CHART_BUSINESS = 'pie-chart-business',PIE_CHART = 'pie-chart',PHONES = 'phones',PERSONAL_CARD = 'personal-card',PERCENTAGE_BUSINESS = 'percentage-business',PERCENTAGE = 'percentage',PASSKEY = 'passkey',PALM_TREE = 'palm-tree',ONE_INVITE_LETTER_OPENED = 'one-invite-letter-opened',MULTI_CURRENCY_BUSINESS = 'multi-currency-business',MULTI_CURRENCY = 'multi-currency',MEGAPHONE = 'megaphone',MARBLE_CARD_FLAG_ONLY_BUSINESS = 'marble-card-flag-only-business',MARBLE_CARD_FLAG_ONLY = 'marble-card-flag-only',MARBLE_CARD_BUSINESS_FLAG_ONLY = 'marble-card-business-flag-only',MARBLE_CARD_BUSINESS = 'marble-card-business',MARBLE_CARD = 'marble-card',MARBLE_BUSINESS = 'marble-business',MARBLE = 'marble',MAP = 'map',MAGNIFYING_GLASS_BUSINESS = 'magnifying-glass-business',MAGNIFYING_GLASS = 'magnifying-glass',LOCK_PLATFORM = 'lock-platform',LOCK_BUSINESS = 'lock-business',LOCK = 'lock',LIGHT_BULB_BUSINESS = 'light-bulb-business',LIGHT_BULB = 'light-bulb',KEY_BUSINESS = 'key-business',KEY = 'key',JARS = 'jars',INVITE_LETTER = 'invite-letter',INTEREST = 'interest',INFINITE = 'infinite',ID_CARD = 'id-card',HOUSE = 'house',HEART_5 = 'heart-5',HEART_4 = 'heart-4',HEART_3 = 'heart-3',HEART_2 = 'heart-2',HEART = 'heart',HEADSET_BUSINESS = 'headset-business',HEADSET = 'headset',GRAPH_BUSINESS = 'graph-business',GRAPH = 'graph',GLOBE = 'globe',GIFT_BOX = 'gift-box',GET_PAID_WITH_CARD_BUSINESS = 'get-paid-with-card-business',GEAR_BUSINESS = 'gear-business',GEAR = 'gear',FLOWER = 'flower',FLAG = 'flag',EXCLAMATION_MARK_BUSINESS = 'exclamation-mark-business',EXCLAMATION_MARK = 'exclamation-mark',EMAIL_SUCCESS_BUSINESS = 'email-success-business',EMAIL_SUCCESS = 'email-success',EMAIL = 'email',ELECTRIC_PLUG = 'electric-plug',ECO_CARD = 'eco-card',DOOR = 'door',DOCUMENTS_FOLDER_BUSINESS = 'documents-folder-business',DOCUMENTS = 'documents',DIGITAL_CARD_BUSINESS = 'digital-card-business',DIGITAL_CARD_2 = 'digital-card-2',DIGITAL_CARD = 'digital-card',COOKIE = 'cookie',CONVERT_BUSINESS = 'convert-business',CONVERT = 'convert',CONSTRUCTION_FENCE = 'construction-fence',CONFETTI_BUSINESS = 'confetti-business',CONFETTI = 'confetti',COIN_PILE_UP_BUSINESS = 'coin-pile-up-business',COIN_PILE_UP = 'coin-pile-up',COIN_PILE_DOWN_BUSINESS = 'coin-pile-down-business',COIN_PILE_DOWN = 'coin-pile-down',CLOSED_WINDOW = 'closed-window',CHECK_MARK_BUSINESS = 'check-mark-business',CHECK_MARK = 'check-mark',CALENDAR_BUSINESS = 'calendar-business',CALENDAR = 'calendar',CALCULATOR_BUSINESS = 'calculator-business',BUSINESS_CARD_BUSINESS = 'business-card-business',BUSINESS_CARD = 'business-card',BRIEFCASE_BUSINESS = 'briefcase-business',BRIEFCASE = 'briefcase',BELL_BUSINESS = 'bell-business',BELL = 'bell',BATCH_PAYMENTS_BUSINESS = 'batch-payments-business',BACKPACK = 'backpack',APP_MARKETPLACE_BUSINESS = 'app-marketplace-business',API_INTEGRATIONS_BUSINESS = 'api-integrations-business'\n }\n \n export type IllustrationNames = 'wallet' | 'two-invite-letters-opened' | 'tool' | 'target-platform' | 'stopwatch-platform' | 'speech-bubble' | 'skip-authentication' | 'shopping-bag' | 'satellite-platform' | 'sand-timer-business' | 'sand-timer' | 'reminder-letter' | 'red-packet' | 'receive-business' | 'receive' | 'question-mark-business' | 'question-mark' | 'puzzle-pieces-business' | 'puzzle-pieces' | 'plane-business' | 'plane-2' | 'plane' | 'pie-chart-business' | 'pie-chart' | 'phones' | 'personal-card' | 'percentage-business' | 'percentage' | 'passkey' | 'palm-tree' | 'one-invite-letter-opened' | 'multi-currency-business' | 'multi-currency' | 'megaphone' | 'marble-card-flag-only-business' | 'marble-card-flag-only' | 'marble-card-business-flag-only' | 'marble-card-business' | 'marble-card' | 'marble-business' | 'marble' | 'map' | 'magnifying-glass-business' | 'magnifying-glass' | 'lock-platform' | 'lock-business' | 'lock' | 'light-bulb-business' | 'light-bulb' | 'key-business' | 'key' | 'jars' | 'invite-letter' | 'interest' | 'infinite' | 'id-card' | 'house' | 'heart-5' | 'heart-4' | 'heart-3' | 'heart-2' | 'heart' | 'headset-business' | 'headset' | 'graph-business' | 'graph' | 'globe' | 'gift-box' | 'get-paid-with-card-business' | 'gear-business' | 'gear' | 'flower' | 'flag' | 'exclamation-mark-business' | 'exclamation-mark' | 'email-success-business' | 'email-success' | 'email' | 'electric-plug' | 'eco-card' | 'door' | 'documents-folder-business' | 'documents' | 'digital-card-business' | 'digital-card-2' | 'digital-card' | 'cookie' | 'convert-business' | 'convert' | 'construction-fence' | 'confetti-business' | 'confetti' | 'coin-pile-up-business' | 'coin-pile-up' | 'coin-pile-down-business' | 'coin-pile-down' | 'closed-window' | 'check-mark-business' | 'check-mark' | 'calendar-business' | 'calendar' | 'calculator-business' | 'business-card-business' | 'business-card' | 'briefcase-business' | 'briefcase' | 'bell-business' | 'bell' | 'batch-payments-business' | 'backpack' | 'app-marketplace-business' | 'api-integrations-business'","import { useState, useEffect } from 'react';\n\nimport type { IllustrationNames } from '../illustrations/metadata';\n\nexport function useBattery() {\n const [batteryData, setBatteryData] = useState<{ level: number }>({ level: 1.0 });\n\n useEffect(() => {\n const getBatteryData = async () => {\n // @ts-expect-error .getBattery exists in Navigator interface\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call\n const battery = await navigator.getBattery();\n\n setBatteryData({\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n level: battery?.level,\n });\n };\n // Check if the browser supports the Battery API\n if (\n 'getBattery' in navigator &&\n navigator.getBattery !== undefined &&\n typeof navigator.getBattery === 'function'\n ) {\n void getBatteryData();\n }\n }, []);\n\n return batteryData;\n}\n\nexport function isBatteryLow(batteryLevel: number): boolean {\n return batteryLevel < 0.2;\n}\n\nexport const isWebGL2Available = () => {\n try {\n const canvas = document.createElement('canvas');\n return !!(window.WebGL2RenderingContext && canvas.getContext('webgl2'));\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n } catch (e) {\n return false;\n }\n};\n\nexport function isConnectionSlow(): boolean {\n // @ts-expect-error .connection prop exists in Navigator interface\n const { connection } = window.navigator;\n if (connection === undefined) {\n return false;\n }\n return (\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n ['slow-2g', '2g'].includes(connection?.effectiveType as string) ||\n // @ts-expect-error Property 'connection' does exist on type 'Navigator'\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n navigator?.connection?.saveData === true\n );\n}\n\nexport function defineSrc(asset: string): string {\n return `https://wise.com/web-art/assets/illustrations3d/${asset}`;\n}\n\nconst illustration3DNames = [\n 'lock',\n 'globe',\n 'confetti',\n 'check-mark',\n 'flower',\n 'graph',\n 'jars',\n 'magnifying-glass',\n 'marble',\n 'marble-card',\n 'multi-currency',\n 'plane',\n 'interest',\n];\n\nexport function isIllustrationSupport3D(asset: IllustrationNames): boolean {\n return illustration3DNames.includes(asset);\n}\n","import { clsx } from 'clsx';\nimport {\n useEffect,\n useState,\n useRef,\n} from 'react';\n\nimport { LargeSize, MediumSize, SmallSize, Sizes, ImageSizes } from '../common';\nimport Illustration, { Assets } from '../illustrations';\n\nimport { useBattery, isConnectionSlow, isBatteryLow, isWebGL2Available } from './utils';\n\nexport type Illustration3DNames =\n | 'lock'\n | 'globe'\n | 'confetti'\n | 'check-mark'\n | 'digital-card'\n | 'graph'\n | 'jars'\n | 'marble-card'\n | 'plane'\n | 'interest';\n\nconst mapFileToName: Record<Illustration3DNames, string> = {\n 'check-mark': 'checkMark',\n 'marble-card': 'marbleWithCard',\n 'digital-card': 'digitalCard',\n};\n\nexport type Props = {\n name: Illustration3DNames;\n size?: SmallSize | MediumSize | LargeSize;\n className?: string;\n};\n\nenum RenderMode {\n INIT,\n FALLBACK,\n ASSET_3D,\n}\n\nconst Illustration3D = ({ name, size = Sizes.MEDIUM, className }: Props) => {\n const [renderMode, setRenderMode] = useState<RenderMode>(RenderMode.INIT);\n const [inintrinsicSize, setInintrinsicSize] = useState<Props['size']>(size);\n const batteryData = useBattery();\n const iframeRef = useRef<HTMLIFrameElement>(null);\n const mouseRef = useRef<{ x: number; y: number } | null>(null);\n\n useEffect(() => {\n setRenderMode(\n isConnectionSlow() || isBatteryLow(batteryData.level) || !isWebGL2Available()\n ? RenderMode.FALLBACK\n : RenderMode.ASSET_3D,\n );\n const isMobile: boolean =\n (typeof window !== undefined && window?.matchMedia('(max-width: 575px)')?.matches) ?? false;\n if (isMobile) {\n setInintrinsicSize(Sizes.SMALL);\n }\n }, [batteryData]);\n\n useEffect(() => {\n const handleMouseMove = (event: MouseEvent) => {\n mouseRef.current = { x: event.pageX, y: event.pageY };\n };\n\n window.addEventListener('mousemove', handleMouseMove);\n\n let animationFrameId: number;\n\n (function rotationModalOnMouseMove() {\n animationFrameId = window.requestAnimationFrame(rotationModalOnMouseMove);\n\n const mouse = mouseRef.current;\n if (!mouse) return;\n\n const dx = mouse.x / window.innerWidth - 0.5;\n const dy = mouse.y / window.innerHeight - 0.5;\n\n const iframeWindow = iframeRef.current?.contentWindow as\n | (WindowProxy & { setRotation?: (x: number, y: number, z: number) => void })\n | null;\n\n if (iframeWindow?.setRotation) {\n iframeWindow.setRotation(dy, dx, 0);\n }\n })();\n\n return () => {\n window.removeEventListener('mousemove', handleMouseMove);\n window.cancelAnimationFrame(animationFrameId);\n };\n }, []);\n\n const modelSrc = `scenes/${mapFileToName[name] || name}.html`;\n return (\n <div\n className={clsx(\n 'wds-illustration-3d',\n `wds-illustration-3d-${name}`,\n `wds-illustration-3d-${inintrinsicSize as string}`,\n className,\n )}\n aria-hidden\n >\n {renderMode === RenderMode.INIT ? null : renderMode === RenderMode.ASSET_3D ? (\n <iframe\n ref={iframeRef}\n height={ImageSizes[inintrinsicSize]}\n width={ImageSizes[inintrinsicSize]}\n src={modelSrc}\n />\n ) : (\n <Illustration name={name} size={size} alt=\"\" />\n )}\n </div>\n );\n};\n\nexport default Illustration3D;\n"],"names":["DETAILED_FLAG_CODES","unknownFlagName","Flag","code","intrinsicSize","className","undefined","loading","fallback","setFallback","useState","useEffect","detailed","name","toLowerCase","includes","_jsx","clsx","src","process","env","NODE_ENV","alt","width","height","onError","prev","imageSizes","Sizes","SMALL","MEDIUM","LARGE","Illustration","forwardRef","id","size","disablePadding","ref","_jsxs","children","_Fragment","media","srcSet","defineSrc","illustration","descriptor","Assets","useBattery","batteryData","setBatteryData","level","getBatteryData","battery","navigator","getBattery","isBatteryLow","batteryLevel","isWebGL2Available","canvas","document","createElement","window","WebGL2RenderingContext","getContext","e","isConnectionSlow","connection","effectiveType","saveData","illustration3DNames","isIllustrationSupport3D","asset","mapFileToName","RenderMode","Illustration3D","renderMode","setRenderMode","INIT","inintrinsicSize","setInintrinsicSize","iframeRef","useRef","mouseRef","FALLBACK","ASSET_3D","isMobile","matchMedia","matches","handleMouseMove","event","current","x","pageX","y","pageY","addEventListener","animationFrameId","rotationModalOnMouseMove","requestAnimationFrame","mouse","dx","innerWidth","dy","innerHeight","iframeWindow","contentWindow","setRotation","removeEventListener","cancelAnimationFrame","modelSrc","ImageSizes"],"mappings":";;;;;AAAA;;;;;AAKI;AAGK,MAAMA,mBAAmB,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,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AACJ,EAAE,EAAEF,EAAE,EAAE,CAAC,CAAC;AACrC,MAAA;AACF,IAAA,CAAC,GAAG;AAEJ,IAAA,OAAO,MAAK;AACVvC,MAAAA,MAAM,CAAC8C,mBAAmB,CAAC,WAAW,EAAEnB,eAAe,CAAC;AACxD3B,MAAAA,MAAM,CAAC+C,oBAAoB,CAACZ,gBAAgB,CAAC;IAC/C,CAAC;EACH,CAAC,EAAE,EAAE,CAAC;EAEN,MAAMa,QAAQ,GAAG,CAAA,OAAA,EAAUrC,aAAa,CAAC3D,IAAI,CAAC,IAAIA,IAAI,CAAA,KAAA,CAAO;AAC7D,EAAA,oBACEG,GAAA,CAAA,KAAA,EAAA;IACEX,SAAS,EAAEY,IAAI,CAAA,CAAA,wCAAA,EAEUJ,IAAI,wBACJiE,eAAyB,CAAA,CAAA,EAChDzE,SAAS,CACT;IACF,aAAA,EAAA,IAAW;AAAAkC,IAAAA,QAAA,EAEVoC,UAAU,KAAKF,UAAU,CAACI,IAAI,GAAG,IAAI,GAAGF,UAAU,KAAKF,UAAU,CAACW,QAAQ,gBACzEpE,GAAA,CAAA,QAAA,EAAA;AACEqB,MAAAA,GAAG,EAAE2C,SAAU;AACfxD,MAAAA,MAAM,EAAEsF,UAAU,CAAChC,eAAe,CAAE;AACpCvD,MAAAA,KAAK,EAAEuF,UAAU,CAAChC,eAAe,CAAE;AACnC5D,MAAAA,GAAG,EAAE2F;AAAS,KAAA,CACd,gBAEF7F,GAAA,CAACgB,YAAY,EAAA;AAACnB,MAAAA,IAAI,EAAEA,IAAK;AAACsB,MAAAA,IAAI,EAAEA,IAAK;AAACb,MAAAA,GAAG,EAAC;KAAE;AAC7C,GACE,CAAC;AAEV;;;;"}
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../src/flags/metadata.ts","../src/flags/Flag.tsx","../src/illustrations/Illustration.tsx","../src/illustrations/metadata.ts","../src/illustrations3d/utils.ts","../src/illustrations3d/Illustration3D.tsx"],"sourcesContent":["/*\n *\n * DON'T MODIFY THIS FILE IT'S AUTO GENERATED\n * See: `scripts/generate-flags-metadata.mjs`\n *\n */\n\n\n export const DETAILED_FLAG_CODES = ['zm', 'va', 'uy', 'us', 'ug', 'tw', 'tv', 'tm', 'sv', 'sm', 'si', 'sg', 'py', 'pt', 'ph', 'pe', 'pa', 'om', 'nz', 'np', 'ni', 'mz', 'my', 'mx', 'mt', 'mh', 'md', 'ls', 'lk', 'li', 'ki', 'ke', 'je', 'in', 'im', 'hr', 'hn', 'hm', 'hk', 'gt', 'gi', 'gg', 'fj', 'eur', 'es', 'eg', 'do', 'cn', 'by', 'br', 'bn', 'bf', 'ba', 'az', 'au', 'ar', 'an', 'am', 'al', 'ad'];","import { clsx } from 'clsx';\nimport { useEffect, useState } from 'react';\n\nimport { DETAILED_FLAG_CODES } from './metadata';\n\nexport interface FlagProps {\n /**\n * Two-letter country code (ISO 3166-1 alpha-2) or three-letter currency code (ISO 4217).\n */\n code: string;\n\n /**\n * Width and height to reserve for the underlying image, in pixels. A detailed variant is shown from 150px and above.\n */\n intrinsicSize?: number;\n className?: string;\n loading?: 'lazy' | 'eager';\n}\n\nconst unknownFlagName = 'wise';\n\nexport const Flag = ({\n code,\n intrinsicSize = 64,\n className = undefined,\n loading = 'lazy',\n}: FlagProps) => {\n const [fallback, setFallback] = useState<'simple' | 'unknown' | null>(null);\n useEffect(() => {\n setFallback(null);\n }, [code]);\n\n const detailed = intrinsicSize >= 150;\n // Only get detailed svg if we know it exists, to avoid the performance hit of failing requests\n const name =\n fallback !== 'unknown'\n ? `${code.toLowerCase()}${\n fallback == null &&\n detailed &&\n DETAILED_FLAG_CODES.includes(code.toLowerCase())\n ? '-detailed'\n : ''\n }`\n : unknownFlagName;\n\n return (\n <img\n className={clsx('wds-flag', `wds-flag-${name}`, className)}\n src={\n process.env.NODE_ENV === 'web-art-dev'\n ? `${name}.svg`\n : `https://wise.com/web-art/assets/flags/${name}.svg`\n }\n loading={loading}\n alt=\"\"\n width={intrinsicSize}\n height={intrinsicSize}\n onError={() => {\n setFallback((prev) =>\n prev == null && detailed ? 'simple' : 'unknown',\n );\n }}\n />\n );\n};\n","import { clsx } from 'clsx';\nimport { forwardRef } from 'react';\n\nimport {\n type LargeSize,\n type MediumSize,\n type SmallSize,\n type Descriptors,\n Sizes,\n} from './../common';\nimport type { IllustrationNames } from './metadata';\n\n// Picking only a few props from Image element to avoid breaking change\n// as in future underlying element might change\ntype ImgProps = Pick<React.ImgHTMLAttributes<HTMLImageElement>, 'id' | 'className'>;\n\nexport type IllustrationSizes = LargeSize | MediumSize | SmallSize;\n\nexport type Props = {\n name: IllustrationNames;\n alt?: string;\n size?: IllustrationSizes;\n loading?: 'eager' | 'lazy';\n disablePadding?: boolean;\n} & ImgProps;\n\nconst imageSizes = {\n [Sizes.SMALL]: 200,\n [Sizes.MEDIUM]: 300,\n [Sizes.LARGE]: 500,\n};\n\nconst Illustration = forwardRef<HTMLImageElement, Props>(\n (\n {\n id,\n name,\n alt = '',\n loading = 'eager',\n className,\n size = Sizes.MEDIUM,\n disablePadding = false,\n }: Props,\n ref,\n ) => {\n const { SMALL, MEDIUM } = Sizes;\n\n return name ? (\n <picture>\n {size === Sizes.LARGE || size === Sizes.MEDIUM ? (\n <>\n <source\n width={imageSizes[SMALL]}\n height={imageSizes[SMALL]}\n media=\"(max-width: 575px)\"\n srcSet={`${defineSrc(name, SMALL, '1x')}, ${defineSrc(name, SMALL, '2x')} 2x`}\n />\n {size !== Sizes.MEDIUM ? (\n <source\n width={imageSizes[MEDIUM]}\n height={imageSizes[MEDIUM]}\n media=\"(max-width: 992px)\"\n srcSet={`${defineSrc(name, MEDIUM, '1x')}, ${defineSrc(name, MEDIUM, '2x')} 2x`}\n />\n ) : null}\n </>\n ) : null}\n\n <img\n id={id}\n ref={ref}\n alt={alt}\n data-testid={`wds-${name}-illustration`}\n className={clsx(\n 'wds-illustration',\n `wds-illustration-${name}`,\n { 'wds-illustration-padding': !disablePadding },\n className,\n )}\n loading={loading}\n src={defineSrc(name, size, '1x')}\n srcSet={`${defineSrc(name, size, '2x')} 2x`}\n width={imageSizes[size]}\n height={imageSizes[size]}\n />\n </picture>\n ) : null;\n },\n);\n\nfunction defineSrc(illustration: string, size: IllustrationSizes, descriptor: Descriptors) {\n return `https://wise.com/web-art/assets/illustrations/${illustration}-${size}@${descriptor}.webp`;\n}\n\nexport default Illustration;\n","/*\n *\n * DON'T MODIFY THIS FILE IT'S AUTO GENERATED\n * See: `scripts/generate-i10s-metadata.mjs`\n *\n */\n \n \n export enum Assets {\n WALLET = 'wallet',TWO_INVITE_LETTERS_OPENED = 'two-invite-letters-opened',TOOL = 'tool',TARGET_PLATFORM = 'target-platform',STOPWATCH_PLATFORM = 'stopwatch-platform',SPEECH_BUBBLE = 'speech-bubble',SKIP_AUTHENTICATION = 'skip-authentication',SHOPPING_BAG = 'shopping-bag',SATELLITE_PLATFORM = 'satellite-platform',SAND_TIMER_BUSINESS = 'sand-timer-business',SAND_TIMER = 'sand-timer',REMINDER_LETTER = 'reminder-letter',RED_PACKET = 'red-packet',RECEIVE_BUSINESS = 'receive-business',RECEIVE = 'receive',QUESTION_MARK_BUSINESS = 'question-mark-business',QUESTION_MARK = 'question-mark',PUZZLE_PIECES_BUSINESS = 'puzzle-pieces-business',PUZZLE_PIECES = 'puzzle-pieces',PLANE_BUSINESS = 'plane-business',PLANE_2 = 'plane-2',PLANE = 'plane',PIE_CHART_BUSINESS = 'pie-chart-business',PIE_CHART = 'pie-chart',PHONES = 'phones',PERSONAL_CARD = 'personal-card',PERCENTAGE_BUSINESS = 'percentage-business',PERCENTAGE = 'percentage',PASSKEY = 'passkey',PALM_TREE = 'palm-tree',ONE_INVITE_LETTER_OPENED = 'one-invite-letter-opened',MULTI_CURRENCY_BUSINESS = 'multi-currency-business',MULTI_CURRENCY = 'multi-currency',MEGAPHONE = 'megaphone',MARBLE_CARD_FLAG_ONLY_BUSINESS = 'marble-card-flag-only-business',MARBLE_CARD_FLAG_ONLY = 'marble-card-flag-only',MARBLE_CARD_BUSINESS_FLAG_ONLY = 'marble-card-business-flag-only',MARBLE_CARD_BUSINESS = 'marble-card-business',MARBLE_CARD = 'marble-card',MARBLE_BUSINESS = 'marble-business',MARBLE = 'marble',MAP = 'map',MAGNIFYING_GLASS_BUSINESS = 'magnifying-glass-business',MAGNIFYING_GLASS = 'magnifying-glass',LOCK_PLATFORM = 'lock-platform',LOCK_BUSINESS = 'lock-business',LOCK = 'lock',LIGHT_BULB_BUSINESS = 'light-bulb-business',LIGHT_BULB = 'light-bulb',KEY_BUSINESS = 'key-business',KEY = 'key',JARS = 'jars',INVITE_LETTER = 'invite-letter',INTEREST = 'interest',INFINITE = 'infinite',ID_CARD = 'id-card',HOUSE = 'house',HEART_5 = 'heart-5',HEART_4 = 'heart-4',HEART_3 = 'heart-3',HEART_2 = 'heart-2',HEART = 'heart',HEADSET_BUSINESS = 'headset-business',HEADSET = 'headset',GRAPH_BUSINESS = 'graph-business',GRAPH = 'graph',GLOBE = 'globe',GIFT_BOX = 'gift-box',GET_PAID_WITH_CARD_BUSINESS = 'get-paid-with-card-business',GEAR_BUSINESS = 'gear-business',GEAR = 'gear',FLOWER = 'flower',FLAG = 'flag',EXCLAMATION_MARK_BUSINESS = 'exclamation-mark-business',EXCLAMATION_MARK = 'exclamation-mark',EMAIL_SUCCESS_BUSINESS = 'email-success-business',EMAIL_SUCCESS = 'email-success',EMAIL = 'email',ELECTRIC_PLUG = 'electric-plug',ECO_CARD = 'eco-card',DOOR = 'door',DOCUMENTS_FOLDER_BUSINESS = 'documents-folder-business',DOCUMENTS = 'documents',DIGITAL_CARD_BUSINESS = 'digital-card-business',DIGITAL_CARD_2 = 'digital-card-2',DIGITAL_CARD = 'digital-card',COOKIE = 'cookie',CONVERT_BUSINESS = 'convert-business',CONVERT = 'convert',CONSTRUCTION_FENCE = 'construction-fence',CONFETTI_BUSINESS = 'confetti-business',CONFETTI = 'confetti',COIN_PILE_UP_BUSINESS = 'coin-pile-up-business',COIN_PILE_UP = 'coin-pile-up',COIN_PILE_DOWN_BUSINESS = 'coin-pile-down-business',COIN_PILE_DOWN = 'coin-pile-down',CLOSED_WINDOW = 'closed-window',CHECK_MARK_BUSINESS = 'check-mark-business',CHECK_MARK = 'check-mark',CALENDAR_BUSINESS = 'calendar-business',CALENDAR = 'calendar',CALCULATOR_BUSINESS = 'calculator-business',BUSINESS_CARD_BUSINESS = 'business-card-business',BUSINESS_CARD = 'business-card',BRIEFCASE_BUSINESS = 'briefcase-business',BRIEFCASE = 'briefcase',BELL_BUSINESS = 'bell-business',BELL = 'bell',BATCH_PAYMENTS_BUSINESS = 'batch-payments-business',BACKPACK = 'backpack',APP_MARKETPLACE_BUSINESS = 'app-marketplace-business',API_INTEGRATIONS_BUSINESS = 'api-integrations-business'\n }\n \n export type IllustrationNames = 'wallet' | 'two-invite-letters-opened' | 'tool' | 'target-platform' | 'stopwatch-platform' | 'speech-bubble' | 'skip-authentication' | 'shopping-bag' | 'satellite-platform' | 'sand-timer-business' | 'sand-timer' | 'reminder-letter' | 'red-packet' | 'receive-business' | 'receive' | 'question-mark-business' | 'question-mark' | 'puzzle-pieces-business' | 'puzzle-pieces' | 'plane-business' | 'plane-2' | 'plane' | 'pie-chart-business' | 'pie-chart' | 'phones' | 'personal-card' | 'percentage-business' | 'percentage' | 'passkey' | 'palm-tree' | 'one-invite-letter-opened' | 'multi-currency-business' | 'multi-currency' | 'megaphone' | 'marble-card-flag-only-business' | 'marble-card-flag-only' | 'marble-card-business-flag-only' | 'marble-card-business' | 'marble-card' | 'marble-business' | 'marble' | 'map' | 'magnifying-glass-business' | 'magnifying-glass' | 'lock-platform' | 'lock-business' | 'lock' | 'light-bulb-business' | 'light-bulb' | 'key-business' | 'key' | 'jars' | 'invite-letter' | 'interest' | 'infinite' | 'id-card' | 'house' | 'heart-5' | 'heart-4' | 'heart-3' | 'heart-2' | 'heart' | 'headset-business' | 'headset' | 'graph-business' | 'graph' | 'globe' | 'gift-box' | 'get-paid-with-card-business' | 'gear-business' | 'gear' | 'flower' | 'flag' | 'exclamation-mark-business' | 'exclamation-mark' | 'email-success-business' | 'email-success' | 'email' | 'electric-plug' | 'eco-card' | 'door' | 'documents-folder-business' | 'documents' | 'digital-card-business' | 'digital-card-2' | 'digital-card' | 'cookie' | 'convert-business' | 'convert' | 'construction-fence' | 'confetti-business' | 'confetti' | 'coin-pile-up-business' | 'coin-pile-up' | 'coin-pile-down-business' | 'coin-pile-down' | 'closed-window' | 'check-mark-business' | 'check-mark' | 'calendar-business' | 'calendar' | 'calculator-business' | 'business-card-business' | 'business-card' | 'briefcase-business' | 'briefcase' | 'bell-business' | 'bell' | 'batch-payments-business' | 'backpack' | 'app-marketplace-business' | 'api-integrations-business'","import { useState, useEffect } from 'react';\n\nimport type { IllustrationNames } from '../illustrations/metadata';\nimport { Illustration3DNames } from './Illustration3D';\n\nexport function useBattery() {\n const [batteryData, setBatteryData] = useState<{ level: number }>({ level: 1.0 });\n\n useEffect(() => {\n const getBatteryData = async () => {\n // @ts-expect-error .getBattery exists in Navigator interface\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call\n const battery = await navigator.getBattery();\n\n setBatteryData({\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n level: battery?.level,\n });\n };\n // Check if the browser supports the Battery API\n if (\n 'getBattery' in navigator &&\n navigator.getBattery !== undefined &&\n typeof navigator.getBattery === 'function'\n ) {\n void getBatteryData();\n }\n }, []);\n\n return batteryData;\n}\n\nexport function isBatteryLow(batteryLevel: number): boolean {\n return batteryLevel < 0.2;\n}\n\nexport const isWebGL2Available = () => {\n try {\n const canvas = document.createElement('canvas');\n return !!(window.WebGL2RenderingContext && canvas.getContext('webgl2'));\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n } catch (e) {\n return false;\n }\n};\n\nexport function isConnectionSlow(): boolean {\n // @ts-expect-error .connection prop exists in Navigator interface\n const { connection } = window.navigator;\n if (connection === undefined) {\n return false;\n }\n return (\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n ['slow-2g', '2g'].includes(connection?.effectiveType as string) ||\n // @ts-expect-error Property 'connection' does exist on type 'Navigator'\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n navigator?.connection?.saveData === true\n );\n}\n\nexport function defineSrc(asset: Illustration3DNames): string {\n const mapNameToFile: Record<Illustration3DNames, string> = {\n 'check-mark': 'checkMark',\n 'marble-card': 'marbleWithCard',\n 'digital-card': 'digitalCard',\n };\n // return `https://wise.com/web-art/assets/illustrations3d/${asset}`;\n return `scenes/${mapNameToFile[asset] || asset}.html`;\n // return `https://wise.com/web-art/assets/illustrations3d/scene/${asset}`;\n}\n\nconst illustration3DNames = [\n 'lock',\n 'globe',\n 'confetti',\n 'check-mark',\n 'flower',\n 'graph',\n 'jars',\n 'magnifying-glass',\n 'marble',\n 'marble-card',\n 'multi-currency',\n 'plane',\n 'interest',\n];\n\nexport function isIllustrationSupport3D(asset: IllustrationNames): boolean {\n return illustration3DNames.includes(asset);\n}\n","import { clsx } from 'clsx';\nimport {\n useEffect,\n useState,\n useRef,\n} from 'react';\n\nimport { LargeSize, MediumSize, SmallSize, Sizes, ImageSizes } from '../common';\nimport Illustration, { Assets } from '../illustrations';\n\nimport { useBattery, isConnectionSlow, isBatteryLow, isWebGL2Available, defineSrc } from './utils';\n\nexport type Illustration3DNames =\n | 'lock'\n | 'globe'\n | 'confetti'\n | 'check-mark'\n | 'digital-card'\n | 'graph'\n | 'jars'\n | 'marble-card'\n | 'plane'\n | 'digital-card'\n | 'interest';\n\nexport type Props = {\n name: Illustration3DNames;\n size?: SmallSize | MediumSize | LargeSize;\n className?: string;\n};\n\nenum RenderMode {\n INIT,\n FALLBACK,\n ASSET_3D,\n}\n\nconst Illustration3D = ({ name, size = Sizes.MEDIUM, className }: Props) => {\n const [renderMode, setRenderMode] = useState<RenderMode>(RenderMode.INIT);\n const [inintrinsicSize, setInintrinsicSize] = useState<Props['size']>(size);\n const batteryData = useBattery();\n const iframeRef = useRef<HTMLIFrameElement>(null);\n const mouseRef = useRef<{ x: number; y: number } | null>(null);\n\n useEffect(() => {\n setRenderMode(\n isConnectionSlow() || isBatteryLow(batteryData.level) || !isWebGL2Available()\n ? RenderMode.FALLBACK\n : RenderMode.ASSET_3D,\n );\n const isMobile: boolean =\n (typeof window !== undefined && window?.matchMedia('(max-width: 575px)')?.matches) ?? false;\n if (isMobile) {\n setInintrinsicSize(Sizes.SMALL);\n }\n }, [batteryData]);\n\n useEffect(() => {\n const handleMouseMove = (event: MouseEvent) => {\n mouseRef.current = { x: event.pageX, y: event.pageY };\n };\n window.addEventListener('mousemove', handleMouseMove);\n\n let animationFrameId: number;\n\n (function rotationModalOnMouseMove() {\n animationFrameId = window.requestAnimationFrame(rotationModalOnMouseMove);\n if (mouseRef.current) {\n const dx = mouseRef.current.x / window.innerWidth - 0.5;\n const dy = mouseRef.current.y / window.innerHeight - 0.5;\n\n const iframeWindow = iframeRef.current?.contentWindow as\n | (WindowProxy & { setRotation?: (x: number, y: number, z: number) => void })\n | null;\n\n if (iframeWindow?.setRotation) {\n iframeWindow.setRotation(dy, dx, 0);\n }\n } else { return; }\n })();\n\n return () => {\n window.removeEventListener('mousemove', handleMouseMove);\n window.cancelAnimationFrame(animationFrameId);\n };\n }, []);\n\n return (\n <div\n className={clsx(\n 'wds-illustration-3d',\n `wds-illustration-3d-${name}`,\n `wds-illustration-3d-${inintrinsicSize as string}`,\n className,\n )}\n aria-hidden\n >\n {renderMode === RenderMode.INIT ? null : renderMode === RenderMode.ASSET_3D ? (\n <iframe\n ref={iframeRef}\n height={ImageSizes[inintrinsicSize]}\n width={ImageSizes[inintrinsicSize]}\n src={defineSrc(name)}\n />\n ) : (\n <Illustration name={name} size={size} alt=\"\" />\n )}\n </div>\n );\n};\n\nexport default Illustration3D;\n"],"names":["DETAILED_FLAG_CODES","unknownFlagName","Flag","code","intrinsicSize","className","undefined","loading","fallback","setFallback","useState","useEffect","detailed","name","toLowerCase","includes","_jsx","clsx","src","process","env","NODE_ENV","alt","width","height","onError","prev","imageSizes","Sizes","SMALL","MEDIUM","LARGE","Illustration","forwardRef","id","size","disablePadding","ref","_jsxs","children","_Fragment","media","srcSet","defineSrc","illustration","descriptor","Assets","useBattery","batteryData","setBatteryData","level","getBatteryData","battery","navigator","getBattery","isBatteryLow","batteryLevel","isWebGL2Available","canvas","document","createElement","window","WebGL2RenderingContext","getContext","e","isConnectionSlow","connection","effectiveType","saveData","asset","mapNameToFile","illustration3DNames","isIllustrationSupport3D","RenderMode","Illustration3D","renderMode","setRenderMode","INIT","inintrinsicSize","setInintrinsicSize","iframeRef","useRef","mouseRef","FALLBACK","ASSET_3D","isMobile","matchMedia","matches","handleMouseMove","event","current","x","pageX","y","pageY","addEventListener","animationFrameId","rotationModalOnMouseMove","requestAnimationFrame","dx","innerWidth","dy","innerHeight","iframeWindow","contentWindow","setRotation","removeEventListener","cancelAnimationFrame","ImageSizes"],"mappings":";;;;;AAAA;;;;;AAKI;AAGK,MAAMA,mBAAmB,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAA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Y,CAACE,WAAW,CAACJ,EAAE,EAAEF,EAAE,EAAE,CAAC,CAAC;AACrC,QAAA;AACF,MAAA,CAAC,MAAM;AAAE,QAAA;AAAQ,MAAA;AACnB,IAAA,CAAC,GAAG;AAEJ,IAAA,OAAO,MAAK;AACVtC,MAAAA,MAAM,CAAC6C,mBAAmB,CAAC,WAAW,EAAElB,eAAe,CAAC;AACxD3B,MAAAA,MAAM,CAAC8C,oBAAoB,CAACX,gBAAgB,CAAC;IAC/C,CAAC;EACH,CAAC,EAAE,EAAE,CAAC;AAEN,EAAA,oBACEhF,GAAA,CAAA,KAAA,EAAA;IACEX,SAAS,EAAEY,IAAI,CAAA,CAAA,wCAAA,EAEUJ,IAAI,wBACJiE,eAAyB,CAAA,CAAA,EAChDzE,SAAS,CACT;IACF,aAAA,EAAA,IAAW;AAAAkC,IAAAA,QAAA,EAEVoC,UAAU,KAAKF,UAAU,CAACI,IAAI,GAAG,IAAI,GAAGF,UAAU,KAAKF,UAAU,CAACW,QAAQ,gBACzEpE,GAAA,CAAA,QAAA,EAAA;AACEqB,MAAAA,GAAG,EAAE2C,SAAU;AACfxD,MAAAA,MAAM,EAAEoF,UAAU,CAAC9B,eAAe,CAAE;AACpCvD,MAAAA,KAAK,EAAEqF,UAAU,CAAC9B,eAAe,CAAE;MACnC5D,GAAG,EAAEyB,SAAS,CAAC9B,IAAI;AAAE,MACrB,gBAEFG,GAAA,CAACgB,YAAY,EAAA;AAACnB,MAAAA,IAAI,EAAEA,IAAK;AAACsB,MAAAA,IAAI,EAAEA,IAAK;AAACb,MAAAA,GAAG,EAAC;KAAE;AAC7C,GACE,CAAC;AAEV;;;;"}
|
package/dist/index.js
CHANGED
|
@@ -64,12 +64,12 @@ const Illustration = /*#__PURE__*/react.forwardRef(({
|
|
|
64
64
|
width: imageSizes[SMALL],
|
|
65
65
|
height: imageSizes[SMALL],
|
|
66
66
|
media: "(max-width: 575px)",
|
|
67
|
-
srcSet: `${defineSrc(name, SMALL, '1x')}, ${defineSrc(name, SMALL, '2x')} 2x`
|
|
67
|
+
srcSet: `${defineSrc$1(name, SMALL, '1x')}, ${defineSrc$1(name, SMALL, '2x')} 2x`
|
|
68
68
|
}), size !== common.Sizes.MEDIUM ? /*#__PURE__*/jsxRuntime.jsx("source", {
|
|
69
69
|
width: imageSizes[MEDIUM],
|
|
70
70
|
height: imageSizes[MEDIUM],
|
|
71
71
|
media: "(max-width: 992px)",
|
|
72
|
-
srcSet: `${defineSrc(name, MEDIUM, '1x')}, ${defineSrc(name, MEDIUM, '2x')} 2x`
|
|
72
|
+
srcSet: `${defineSrc$1(name, MEDIUM, '1x')}, ${defineSrc$1(name, MEDIUM, '2x')} 2x`
|
|
73
73
|
}) : null]
|
|
74
74
|
}) : null, /*#__PURE__*/jsxRuntime.jsx("img", {
|
|
75
75
|
id: id,
|
|
@@ -78,14 +78,14 @@ const Illustration = /*#__PURE__*/react.forwardRef(({
|
|
|
78
78
|
"data-testid": `wds-${name}-illustration`,
|
|
79
79
|
className: clsx.clsx(`wds-illustration wds-illustration-${name}`, className, !disablePadding && 'wds-illustration-padding'),
|
|
80
80
|
loading: loading,
|
|
81
|
-
src: defineSrc(name, size, '1x'),
|
|
82
|
-
srcSet: `${defineSrc(name, size, '2x')} 2x`,
|
|
81
|
+
src: defineSrc$1(name, size, '1x'),
|
|
82
|
+
srcSet: `${defineSrc$1(name, size, '2x')} 2x`,
|
|
83
83
|
width: imageSizes[size],
|
|
84
84
|
height: imageSizes[size]
|
|
85
85
|
})]
|
|
86
86
|
}) : null;
|
|
87
87
|
});
|
|
88
|
-
function defineSrc(illustration, size, descriptor) {
|
|
88
|
+
function defineSrc$1(illustration, size, descriptor) {
|
|
89
89
|
return `https://wise.com/web-art/assets/illustrations/${illustration}-${size}@${descriptor}.webp`;
|
|
90
90
|
}
|
|
91
91
|
|
|
@@ -260,16 +260,21 @@ function isConnectionSlow() {
|
|
|
260
260
|
navigator?.connection?.saveData === true
|
|
261
261
|
);
|
|
262
262
|
}
|
|
263
|
+
function defineSrc(asset) {
|
|
264
|
+
const mapNameToFile = {
|
|
265
|
+
'check-mark': 'checkMark',
|
|
266
|
+
'marble-card': 'marbleWithCard',
|
|
267
|
+
'digital-card': 'digitalCard'
|
|
268
|
+
};
|
|
269
|
+
// return `https://wise.com/web-art/assets/illustrations3d/${asset}`;
|
|
270
|
+
return `scenes/${mapNameToFile[asset] || asset}.html`;
|
|
271
|
+
// return `https://wise.com/web-art/assets/illustrations3d/scene/${asset}`;
|
|
272
|
+
}
|
|
263
273
|
const illustration3DNames = ['lock', 'globe', 'confetti', 'check-mark', 'flower', 'graph', 'jars', 'magnifying-glass', 'marble', 'marble-card', 'multi-currency', 'plane', 'interest'];
|
|
264
274
|
function isIllustrationSupport3D(asset) {
|
|
265
275
|
return illustration3DNames.includes(asset);
|
|
266
276
|
}
|
|
267
277
|
|
|
268
|
-
const mapFileToName = {
|
|
269
|
-
'check-mark': 'checkMark',
|
|
270
|
-
'marble-card': 'marbleWithCard',
|
|
271
|
-
'digital-card': 'digitalCard'
|
|
272
|
-
};
|
|
273
278
|
var RenderMode;
|
|
274
279
|
(function (RenderMode) {
|
|
275
280
|
RenderMode[RenderMode["INIT"] = 0] = "INIT";
|
|
@@ -304,13 +309,15 @@ const Illustration3D = ({
|
|
|
304
309
|
let animationFrameId;
|
|
305
310
|
(function rotationModalOnMouseMove() {
|
|
306
311
|
animationFrameId = window.requestAnimationFrame(rotationModalOnMouseMove);
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
312
|
+
if (mouseRef.current) {
|
|
313
|
+
const dx = mouseRef.current.x / window.innerWidth - 0.5;
|
|
314
|
+
const dy = mouseRef.current.y / window.innerHeight - 0.5;
|
|
315
|
+
const iframeWindow = iframeRef.current?.contentWindow;
|
|
316
|
+
if (iframeWindow?.setRotation) {
|
|
317
|
+
iframeWindow.setRotation(dy, dx, 0);
|
|
318
|
+
}
|
|
319
|
+
} else {
|
|
320
|
+
return;
|
|
314
321
|
}
|
|
315
322
|
})();
|
|
316
323
|
return () => {
|
|
@@ -318,7 +325,6 @@ const Illustration3D = ({
|
|
|
318
325
|
window.cancelAnimationFrame(animationFrameId);
|
|
319
326
|
};
|
|
320
327
|
}, []);
|
|
321
|
-
const modelSrc = `scenes/${mapFileToName[name] || name}.html`;
|
|
322
328
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
323
329
|
className: clsx.clsx(`wds-illustration-3d wds-illustration-3d-${name} wds-illustration-3d-${inintrinsicSize}`, className),
|
|
324
330
|
"aria-hidden": true,
|
|
@@ -326,7 +332,7 @@ const Illustration3D = ({
|
|
|
326
332
|
ref: iframeRef,
|
|
327
333
|
height: common.ImageSizes[inintrinsicSize],
|
|
328
334
|
width: common.ImageSizes[inintrinsicSize],
|
|
329
|
-
src:
|
|
335
|
+
src: defineSrc(name)
|
|
330
336
|
}) : /*#__PURE__*/jsxRuntime.jsx(Illustration, {
|
|
331
337
|
name: name,
|
|
332
338
|
size: size,
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/flags/metadata.ts","../src/flags/Flag.tsx","../src/illustrations/Illustration.tsx","../src/illustrations/metadata.ts","../src/illustrations3d/utils.ts","../src/illustrations3d/Illustration3D.tsx"],"sourcesContent":["/*\n *\n * DON'T MODIFY THIS FILE IT'S AUTO GENERATED\n * See: `scripts/generate-flags-metadata.mjs`\n *\n */\n\n\n export const DETAILED_FLAG_CODES = ['zm', 'va', 'uy', 'us', 'ug', 'tw', 'tv', 'tm', 'sv', 'sm', 'si', 'sg', 'py', 'pt', 'ph', 'pe', 'pa', 'om', 'nz', 'np', 'ni', 'mz', 'my', 'mx', 'mt', 'mh', 'md', 'ls', 'lk', 'li', 'ki', 'ke', 'je', 'in', 'im', 'hr', 'hn', 'hm', 'hk', 'gt', 'gi', 'gg', 'fj', 'eur', 'es', 'eg', 'do', 'cn', 'by', 'br', 'bn', 'bf', 'ba', 'az', 'au', 'ar', 'an', 'am', 'al', 'ad'];","import { clsx } from 'clsx';\nimport { useEffect, useState } from 'react';\n\nimport { DETAILED_FLAG_CODES } from './metadata';\n\nexport interface FlagProps {\n /**\n * Two-letter country code (ISO 3166-1 alpha-2) or three-letter currency code (ISO 4217).\n */\n code: string;\n\n /**\n * Width and height to reserve for the underlying image, in pixels. A detailed variant is shown from 150px and above.\n */\n intrinsicSize?: number;\n className?: string;\n loading?: 'lazy' | 'eager';\n}\n\nconst unknownFlagName = 'wise';\n\nexport const Flag = ({\n code,\n intrinsicSize = 64,\n className = undefined,\n loading = 'lazy',\n}: FlagProps) => {\n const [fallback, setFallback] = useState<'simple' | 'unknown' | null>(null);\n useEffect(() => {\n setFallback(null);\n }, [code]);\n\n const detailed = intrinsicSize >= 150;\n // Only get detailed svg if we know it exists, to avoid the performance hit of failing requests\n const name =\n fallback !== 'unknown'\n ? `${code.toLowerCase()}${\n fallback == null &&\n detailed &&\n DETAILED_FLAG_CODES.includes(code.toLowerCase())\n ? '-detailed'\n : ''\n }`\n : unknownFlagName;\n\n return (\n <img\n className={clsx('wds-flag', `wds-flag-${name}`, className)}\n src={\n process.env.NODE_ENV === 'web-art-dev'\n ? `${name}.svg`\n : `https://wise.com/web-art/assets/flags/${name}.svg`\n }\n loading={loading}\n alt=\"\"\n width={intrinsicSize}\n height={intrinsicSize}\n onError={() => {\n setFallback((prev) =>\n prev == null && detailed ? 'simple' : 'unknown',\n );\n }}\n />\n );\n};\n","import { clsx } from 'clsx';\nimport { forwardRef } from 'react';\n\nimport {\n type LargeSize,\n type MediumSize,\n type SmallSize,\n type Descriptors,\n Sizes,\n} from './../common';\nimport type { IllustrationNames } from './metadata';\n\n// Picking only a few props from Image element to avoid breaking change\n// as in future underlying element might change\ntype ImgProps = Pick<React.ImgHTMLAttributes<HTMLImageElement>, 'id' | 'className'>;\n\nexport type IllustrationSizes = LargeSize | MediumSize | SmallSize;\n\nexport type Props = {\n name: IllustrationNames;\n alt?: string;\n size?: IllustrationSizes;\n loading?: 'eager' | 'lazy';\n disablePadding?: boolean;\n} & ImgProps;\n\nconst imageSizes = {\n [Sizes.SMALL]: 200,\n [Sizes.MEDIUM]: 300,\n [Sizes.LARGE]: 500,\n};\n\nconst Illustration = forwardRef<HTMLImageElement, Props>(\n (\n {\n id,\n name,\n alt = '',\n loading = 'eager',\n className,\n size = Sizes.MEDIUM,\n disablePadding = false,\n }: Props,\n ref,\n ) => {\n const { SMALL, MEDIUM } = Sizes;\n\n return name ? (\n <picture>\n {size === Sizes.LARGE || size === Sizes.MEDIUM ? (\n <>\n <source\n width={imageSizes[SMALL]}\n height={imageSizes[SMALL]}\n media=\"(max-width: 575px)\"\n srcSet={`${defineSrc(name, SMALL, '1x')}, ${defineSrc(name, SMALL, '2x')} 2x`}\n />\n {size !== Sizes.MEDIUM ? (\n <source\n width={imageSizes[MEDIUM]}\n height={imageSizes[MEDIUM]}\n media=\"(max-width: 992px)\"\n srcSet={`${defineSrc(name, MEDIUM, '1x')}, ${defineSrc(name, MEDIUM, '2x')} 2x`}\n />\n ) : null}\n </>\n ) : null}\n\n <img\n id={id}\n ref={ref}\n alt={alt}\n data-testid={`wds-${name}-illustration`}\n className={clsx(\n 'wds-illustration',\n `wds-illustration-${name}`,\n { 'wds-illustration-padding': !disablePadding },\n className,\n )}\n loading={loading}\n src={defineSrc(name, size, '1x')}\n srcSet={`${defineSrc(name, size, '2x')} 2x`}\n width={imageSizes[size]}\n height={imageSizes[size]}\n />\n </picture>\n ) : null;\n },\n);\n\nfunction defineSrc(illustration: string, size: IllustrationSizes, descriptor: Descriptors) {\n return `https://wise.com/web-art/assets/illustrations/${illustration}-${size}@${descriptor}.webp`;\n}\n\nexport default Illustration;\n","/*\n *\n * DON'T MODIFY THIS FILE IT'S AUTO GENERATED\n * See: `scripts/generate-i10s-metadata.mjs`\n *\n */\n \n \n export enum Assets {\n WALLET = 'wallet',TWO_INVITE_LETTERS_OPENED = 'two-invite-letters-opened',TOOL = 'tool',TARGET_PLATFORM = 'target-platform',STOPWATCH_PLATFORM = 'stopwatch-platform',SPEECH_BUBBLE = 'speech-bubble',SKIP_AUTHENTICATION = 'skip-authentication',SHOPPING_BAG = 'shopping-bag',SATELLITE_PLATFORM = 'satellite-platform',SAND_TIMER_BUSINESS = 'sand-timer-business',SAND_TIMER = 'sand-timer',REMINDER_LETTER = 'reminder-letter',RED_PACKET = 'red-packet',RECEIVE_BUSINESS = 'receive-business',RECEIVE = 'receive',QUESTION_MARK_BUSINESS = 'question-mark-business',QUESTION_MARK = 'question-mark',PUZZLE_PIECES_BUSINESS = 'puzzle-pieces-business',PUZZLE_PIECES = 'puzzle-pieces',PLANE_BUSINESS = 'plane-business',PLANE_2 = 'plane-2',PLANE = 'plane',PIE_CHART_BUSINESS = 'pie-chart-business',PIE_CHART = 'pie-chart',PHONES = 'phones',PERSONAL_CARD = 'personal-card',PERCENTAGE_BUSINESS = 'percentage-business',PERCENTAGE = 'percentage',PASSKEY = 'passkey',PALM_TREE = 'palm-tree',ONE_INVITE_LETTER_OPENED = 'one-invite-letter-opened',MULTI_CURRENCY_BUSINESS = 'multi-currency-business',MULTI_CURRENCY = 'multi-currency',MEGAPHONE = 'megaphone',MARBLE_CARD_FLAG_ONLY_BUSINESS = 'marble-card-flag-only-business',MARBLE_CARD_FLAG_ONLY = 'marble-card-flag-only',MARBLE_CARD_BUSINESS_FLAG_ONLY = 'marble-card-business-flag-only',MARBLE_CARD_BUSINESS = 'marble-card-business',MARBLE_CARD = 'marble-card',MARBLE_BUSINESS = 'marble-business',MARBLE = 'marble',MAP = 'map',MAGNIFYING_GLASS_BUSINESS = 'magnifying-glass-business',MAGNIFYING_GLASS = 'magnifying-glass',LOCK_PLATFORM = 'lock-platform',LOCK_BUSINESS = 'lock-business',LOCK = 'lock',LIGHT_BULB_BUSINESS = 'light-bulb-business',LIGHT_BULB = 'light-bulb',KEY_BUSINESS = 'key-business',KEY = 'key',JARS = 'jars',INVITE_LETTER = 'invite-letter',INTEREST = 'interest',INFINITE = 'infinite',ID_CARD = 'id-card',HOUSE = 'house',HEART_5 = 'heart-5',HEART_4 = 'heart-4',HEART_3 = 'heart-3',HEART_2 = 'heart-2',HEART = 'heart',HEADSET_BUSINESS = 'headset-business',HEADSET = 'headset',GRAPH_BUSINESS = 'graph-business',GRAPH = 'graph',GLOBE = 'globe',GIFT_BOX = 'gift-box',GET_PAID_WITH_CARD_BUSINESS = 'get-paid-with-card-business',GEAR_BUSINESS = 'gear-business',GEAR = 'gear',FLOWER = 'flower',FLAG = 'flag',EXCLAMATION_MARK_BUSINESS = 'exclamation-mark-business',EXCLAMATION_MARK = 'exclamation-mark',EMAIL_SUCCESS_BUSINESS = 'email-success-business',EMAIL_SUCCESS = 'email-success',EMAIL = 'email',ELECTRIC_PLUG = 'electric-plug',ECO_CARD = 'eco-card',DOOR = 'door',DOCUMENTS_FOLDER_BUSINESS = 'documents-folder-business',DOCUMENTS = 'documents',DIGITAL_CARD_BUSINESS = 'digital-card-business',DIGITAL_CARD_2 = 'digital-card-2',DIGITAL_CARD = 'digital-card',COOKIE = 'cookie',CONVERT_BUSINESS = 'convert-business',CONVERT = 'convert',CONSTRUCTION_FENCE = 'construction-fence',CONFETTI_BUSINESS = 'confetti-business',CONFETTI = 'confetti',COIN_PILE_UP_BUSINESS = 'coin-pile-up-business',COIN_PILE_UP = 'coin-pile-up',COIN_PILE_DOWN_BUSINESS = 'coin-pile-down-business',COIN_PILE_DOWN = 'coin-pile-down',CLOSED_WINDOW = 'closed-window',CHECK_MARK_BUSINESS = 'check-mark-business',CHECK_MARK = 'check-mark',CALENDAR_BUSINESS = 'calendar-business',CALENDAR = 'calendar',CALCULATOR_BUSINESS = 'calculator-business',BUSINESS_CARD_BUSINESS = 'business-card-business',BUSINESS_CARD = 'business-card',BRIEFCASE_BUSINESS = 'briefcase-business',BRIEFCASE = 'briefcase',BELL_BUSINESS = 'bell-business',BELL = 'bell',BATCH_PAYMENTS_BUSINESS = 'batch-payments-business',BACKPACK = 'backpack',APP_MARKETPLACE_BUSINESS = 'app-marketplace-business',API_INTEGRATIONS_BUSINESS = 'api-integrations-business'\n }\n \n export type IllustrationNames = 'wallet' | 'two-invite-letters-opened' | 'tool' | 'target-platform' | 'stopwatch-platform' | 'speech-bubble' | 'skip-authentication' | 'shopping-bag' | 'satellite-platform' | 'sand-timer-business' | 'sand-timer' | 'reminder-letter' | 'red-packet' | 'receive-business' | 'receive' | 'question-mark-business' | 'question-mark' | 'puzzle-pieces-business' | 'puzzle-pieces' | 'plane-business' | 'plane-2' | 'plane' | 'pie-chart-business' | 'pie-chart' | 'phones' | 'personal-card' | 'percentage-business' | 'percentage' | 'passkey' | 'palm-tree' | 'one-invite-letter-opened' | 'multi-currency-business' | 'multi-currency' | 'megaphone' | 'marble-card-flag-only-business' | 'marble-card-flag-only' | 'marble-card-business-flag-only' | 'marble-card-business' | 'marble-card' | 'marble-business' | 'marble' | 'map' | 'magnifying-glass-business' | 'magnifying-glass' | 'lock-platform' | 'lock-business' | 'lock' | 'light-bulb-business' | 'light-bulb' | 'key-business' | 'key' | 'jars' | 'invite-letter' | 'interest' | 'infinite' | 'id-card' | 'house' | 'heart-5' | 'heart-4' | 'heart-3' | 'heart-2' | 'heart' | 'headset-business' | 'headset' | 'graph-business' | 'graph' | 'globe' | 'gift-box' | 'get-paid-with-card-business' | 'gear-business' | 'gear' | 'flower' | 'flag' | 'exclamation-mark-business' | 'exclamation-mark' | 'email-success-business' | 'email-success' | 'email' | 'electric-plug' | 'eco-card' | 'door' | 'documents-folder-business' | 'documents' | 'digital-card-business' | 'digital-card-2' | 'digital-card' | 'cookie' | 'convert-business' | 'convert' | 'construction-fence' | 'confetti-business' | 'confetti' | 'coin-pile-up-business' | 'coin-pile-up' | 'coin-pile-down-business' | 'coin-pile-down' | 'closed-window' | 'check-mark-business' | 'check-mark' | 'calendar-business' | 'calendar' | 'calculator-business' | 'business-card-business' | 'business-card' | 'briefcase-business' | 'briefcase' | 'bell-business' | 'bell' | 'batch-payments-business' | 'backpack' | 'app-marketplace-business' | 'api-integrations-business'","import { useState, useEffect } from 'react';\n\nimport type { IllustrationNames } from '../illustrations/metadata';\n\nexport function useBattery() {\n const [batteryData, setBatteryData] = useState<{ level: number }>({ level: 1.0 });\n\n useEffect(() => {\n const getBatteryData = async () => {\n // @ts-expect-error .getBattery exists in Navigator interface\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call\n const battery = await navigator.getBattery();\n\n setBatteryData({\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n level: battery?.level,\n });\n };\n // Check if the browser supports the Battery API\n if (\n 'getBattery' in navigator &&\n navigator.getBattery !== undefined &&\n typeof navigator.getBattery === 'function'\n ) {\n void getBatteryData();\n }\n }, []);\n\n return batteryData;\n}\n\nexport function isBatteryLow(batteryLevel: number): boolean {\n return batteryLevel < 0.2;\n}\n\nexport const isWebGL2Available = () => {\n try {\n const canvas = document.createElement('canvas');\n return !!(window.WebGL2RenderingContext && canvas.getContext('webgl2'));\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n } catch (e) {\n return false;\n }\n};\n\nexport function isConnectionSlow(): boolean {\n // @ts-expect-error .connection prop exists in Navigator interface\n const { connection } = window.navigator;\n if (connection === undefined) {\n return false;\n }\n return (\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n ['slow-2g', '2g'].includes(connection?.effectiveType as string) ||\n // @ts-expect-error Property 'connection' does exist on type 'Navigator'\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n navigator?.connection?.saveData === true\n );\n}\n\nexport function defineSrc(asset: string): string {\n return `https://wise.com/web-art/assets/illustrations3d/${asset}`;\n}\n\nconst illustration3DNames = [\n 'lock',\n 'globe',\n 'confetti',\n 'check-mark',\n 'flower',\n 'graph',\n 'jars',\n 'magnifying-glass',\n 'marble',\n 'marble-card',\n 'multi-currency',\n 'plane',\n 'interest',\n];\n\nexport function isIllustrationSupport3D(asset: IllustrationNames): boolean {\n return illustration3DNames.includes(asset);\n}\n","import { clsx } from 'clsx';\nimport {\n useEffect,\n useState,\n useRef,\n} from 'react';\n\nimport { LargeSize, MediumSize, SmallSize, Sizes, ImageSizes } from '../common';\nimport Illustration, { Assets } from '../illustrations';\n\nimport { useBattery, isConnectionSlow, isBatteryLow, isWebGL2Available } from './utils';\n\nexport type Illustration3DNames =\n | 'lock'\n | 'globe'\n | 'confetti'\n | 'check-mark'\n | 'digital-card'\n | 'graph'\n | 'jars'\n | 'marble-card'\n | 'plane'\n | 'interest';\n\nconst mapFileToName: Record<Illustration3DNames, string> = {\n 'check-mark': 'checkMark',\n 'marble-card': 'marbleWithCard',\n 'digital-card': 'digitalCard',\n};\n\nexport type Props = {\n name: Illustration3DNames;\n size?: SmallSize | MediumSize | LargeSize;\n className?: string;\n};\n\nenum RenderMode {\n INIT,\n FALLBACK,\n ASSET_3D,\n}\n\nconst Illustration3D = ({ name, size = Sizes.MEDIUM, className }: Props) => {\n const [renderMode, setRenderMode] = useState<RenderMode>(RenderMode.INIT);\n const [inintrinsicSize, setInintrinsicSize] = useState<Props['size']>(size);\n const batteryData = useBattery();\n const iframeRef = useRef<HTMLIFrameElement>(null);\n const mouseRef = useRef<{ x: number; y: number } | null>(null);\n\n useEffect(() => {\n setRenderMode(\n isConnectionSlow() || isBatteryLow(batteryData.level) || !isWebGL2Available()\n ? RenderMode.FALLBACK\n : RenderMode.ASSET_3D,\n );\n const isMobile: boolean =\n (typeof window !== undefined && window?.matchMedia('(max-width: 575px)')?.matches) ?? false;\n if (isMobile) {\n setInintrinsicSize(Sizes.SMALL);\n }\n }, [batteryData]);\n\n useEffect(() => {\n const handleMouseMove = (event: MouseEvent) => {\n mouseRef.current = { x: event.pageX, y: event.pageY };\n };\n\n window.addEventListener('mousemove', handleMouseMove);\n\n let animationFrameId: number;\n\n (function rotationModalOnMouseMove() {\n animationFrameId = window.requestAnimationFrame(rotationModalOnMouseMove);\n\n const mouse = mouseRef.current;\n if (!mouse) return;\n\n const dx = mouse.x / window.innerWidth - 0.5;\n const dy = mouse.y / window.innerHeight - 0.5;\n\n const iframeWindow = iframeRef.current?.contentWindow as\n | (WindowProxy & { setRotation?: (x: number, y: number, z: number) => void })\n | null;\n\n if (iframeWindow?.setRotation) {\n iframeWindow.setRotation(dy, dx, 0);\n }\n })();\n\n return () => {\n window.removeEventListener('mousemove', handleMouseMove);\n window.cancelAnimationFrame(animationFrameId);\n };\n }, []);\n\n const modelSrc = `scenes/${mapFileToName[name] || name}.html`;\n return (\n <div\n className={clsx(\n 'wds-illustration-3d',\n `wds-illustration-3d-${name}`,\n `wds-illustration-3d-${inintrinsicSize as string}`,\n className,\n )}\n aria-hidden\n >\n {renderMode === RenderMode.INIT ? null : renderMode === RenderMode.ASSET_3D ? (\n <iframe\n ref={iframeRef}\n height={ImageSizes[inintrinsicSize]}\n width={ImageSizes[inintrinsicSize]}\n src={modelSrc}\n />\n ) : (\n <Illustration name={name} size={size} alt=\"\" />\n )}\n </div>\n );\n};\n\nexport default Illustration3D;\n"],"names":["DETAILED_FLAG_CODES","unknownFlagName","Flag","code","intrinsicSize","className","undefined","loading","fallback","setFallback","useState","useEffect","detailed","name","toLowerCase","includes","_jsx","clsx","src","process","env","NODE_ENV","alt","width","height","onError","prev","imageSizes","Sizes","SMALL","MEDIUM","LARGE","Illustration","forwardRef","id","size","disablePadding","ref","_jsxs","children","_Fragment","media","srcSet","defineSrc","illustration","descriptor","Assets","useBattery","batteryData","setBatteryData","level","getBatteryData","battery","navigator","getBattery","isBatteryLow","batteryLevel","isWebGL2Available","canvas","document","createElement","window","WebGL2RenderingContext","getContext","e","isConnectionSlow","connection","effectiveType","saveData","illustration3DNames","isIllustrationSupport3D","asset","mapFileToName","RenderMode","Illustration3D","renderMode","setRenderMode","INIT","inintrinsicSize","setInintrinsicSize","iframeRef","useRef","mouseRef","FALLBACK","ASSET_3D","isMobile","matchMedia","matches","handleMouseMove","event","current","x","pageX","y","pageY","addEventListener","animationFrameId","rotationModalOnMouseMove","requestAnimationFrame","mouse","dx","innerWidth","dy","innerHeight","iframeWindow","contentWindow","setRotation","removeEventListener","cancelAnimationFrame","modelSrc","ImageSizes"],"mappings":";;;;;;;AAAA;;;;;AAKI;AAGK,MAAMA,mBAAmB,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC;;ACW9Y,MAAMC,eAAe,GAAG,MAAM;AAEvB,MAAMC,IAAI,GAAGA,CAAC;EACnBC,IAAI;AACJC,EAAAA,aAAa,GAAG,EAAE;AAClBC,EAAAA,SAAS,GAAGC,SAAS;AACrBC,EAAAA,OAAO,GAAG;AAAM,CACN,KAAI;EACd,MAAM,CAACC,QAAQ,EAAEC,WAAW,CAAC,GAAGC,cAAQ,CAA8B,IAAI,CAAC;AAC3EC,EAAAA,eAAS,CAAC,MAAK;IACbF,WAAW,CAAC,IAAI,CAAC;AACnB,E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AAA,QAAA,EAEVoC,UAAU,KAAKF,UAAU,CAACI,IAAI,GAAG,IAAI,GAAGF,UAAU,KAAKF,UAAU,CAACW,QAAQ,gBACzEpE,cAAA,CAAA,QAAA,EAAA;AACEqB,MAAAA,GAAG,EAAE2C,SAAU;AACfxD,MAAAA,MAAM,EAAEsF,iBAAU,CAAChC,eAAe,CAAE;AACpCvD,MAAAA,KAAK,EAAEuF,iBAAU,CAAChC,eAAe,CAAE;AACnC5D,MAAAA,GAAG,EAAE2F;AAAS,KAAA,CACd,gBAEF7F,cAAA,CAACgB,YAAY,EAAA;AAACnB,MAAAA,IAAI,EAAEA,IAAK;AAACsB,MAAAA,IAAI,EAAEA,IAAK;AAACb,MAAAA,GAAG,EAAC;KAAE;AAC7C,GACE,CAAC;AAEV;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/flags/metadata.ts","../src/flags/Flag.tsx","../src/illustrations/Illustration.tsx","../src/illustrations/metadata.ts","../src/illustrations3d/utils.ts","../src/illustrations3d/Illustration3D.tsx"],"sourcesContent":["/*\n *\n * DON'T MODIFY THIS FILE IT'S AUTO GENERATED\n * See: `scripts/generate-flags-metadata.mjs`\n *\n */\n\n\n export const DETAILED_FLAG_CODES = ['zm', 'va', 'uy', 'us', 'ug', 'tw', 'tv', 'tm', 'sv', 'sm', 'si', 'sg', 'py', 'pt', 'ph', 'pe', 'pa', 'om', 'nz', 'np', 'ni', 'mz', 'my', 'mx', 'mt', 'mh', 'md', 'ls', 'lk', 'li', 'ki', 'ke', 'je', 'in', 'im', 'hr', 'hn', 'hm', 'hk', 'gt', 'gi', 'gg', 'fj', 'eur', 'es', 'eg', 'do', 'cn', 'by', 'br', 'bn', 'bf', 'ba', 'az', 'au', 'ar', 'an', 'am', 'al', 'ad'];","import { clsx } from 'clsx';\nimport { useEffect, useState } from 'react';\n\nimport { DETAILED_FLAG_CODES } from './metadata';\n\nexport interface FlagProps {\n /**\n * Two-letter country code (ISO 3166-1 alpha-2) or three-letter currency code (ISO 4217).\n */\n code: string;\n\n /**\n * Width and height to reserve for the underlying image, in pixels. A detailed variant is shown from 150px and above.\n */\n intrinsicSize?: number;\n className?: string;\n loading?: 'lazy' | 'eager';\n}\n\nconst unknownFlagName = 'wise';\n\nexport const Flag = ({\n code,\n intrinsicSize = 64,\n className = undefined,\n loading = 'lazy',\n}: FlagProps) => {\n const [fallback, setFallback] = useState<'simple' | 'unknown' | null>(null);\n useEffect(() => {\n setFallback(null);\n }, [code]);\n\n const detailed = intrinsicSize >= 150;\n // Only get detailed svg if we know it exists, to avoid the performance hit of failing requests\n const name =\n fallback !== 'unknown'\n ? `${code.toLowerCase()}${\n fallback == null &&\n detailed &&\n DETAILED_FLAG_CODES.includes(code.toLowerCase())\n ? '-detailed'\n : ''\n }`\n : unknownFlagName;\n\n return (\n <img\n className={clsx('wds-flag', `wds-flag-${name}`, className)}\n src={\n process.env.NODE_ENV === 'web-art-dev'\n ? `${name}.svg`\n : `https://wise.com/web-art/assets/flags/${name}.svg`\n }\n loading={loading}\n alt=\"\"\n width={intrinsicSize}\n height={intrinsicSize}\n onError={() => {\n setFallback((prev) =>\n prev == null && detailed ? 'simple' : 'unknown',\n );\n }}\n />\n );\n};\n","import { clsx } from 'clsx';\nimport { forwardRef } from 'react';\n\nimport {\n type LargeSize,\n type MediumSize,\n type SmallSize,\n type Descriptors,\n Sizes,\n} from './../common';\nimport type { IllustrationNames } from './metadata';\n\n// Picking only a few props from Image element to avoid breaking change\n// as in future underlying element might change\ntype ImgProps = Pick<React.ImgHTMLAttributes<HTMLImageElement>, 'id' | 'className'>;\n\nexport type IllustrationSizes = LargeSize | MediumSize | SmallSize;\n\nexport type Props = {\n name: IllustrationNames;\n alt?: string;\n size?: IllustrationSizes;\n loading?: 'eager' | 'lazy';\n disablePadding?: boolean;\n} & ImgProps;\n\nconst imageSizes = {\n [Sizes.SMALL]: 200,\n [Sizes.MEDIUM]: 300,\n [Sizes.LARGE]: 500,\n};\n\nconst Illustration = forwardRef<HTMLImageElement, Props>(\n (\n {\n id,\n name,\n alt = '',\n loading = 'eager',\n className,\n size = Sizes.MEDIUM,\n disablePadding = false,\n }: Props,\n ref,\n ) => {\n const { SMALL, MEDIUM } = Sizes;\n\n return name ? (\n <picture>\n {size === Sizes.LARGE || size === Sizes.MEDIUM ? (\n <>\n <source\n width={imageSizes[SMALL]}\n height={imageSizes[SMALL]}\n media=\"(max-width: 575px)\"\n srcSet={`${defineSrc(name, SMALL, '1x')}, ${defineSrc(name, SMALL, '2x')} 2x`}\n />\n {size !== Sizes.MEDIUM ? (\n <source\n width={imageSizes[MEDIUM]}\n height={imageSizes[MEDIUM]}\n media=\"(max-width: 992px)\"\n srcSet={`${defineSrc(name, MEDIUM, '1x')}, ${defineSrc(name, MEDIUM, '2x')} 2x`}\n />\n ) : null}\n </>\n ) : null}\n\n <img\n id={id}\n ref={ref}\n alt={alt}\n data-testid={`wds-${name}-illustration`}\n className={clsx(\n 'wds-illustration',\n `wds-illustration-${name}`,\n { 'wds-illustration-padding': !disablePadding },\n className,\n )}\n loading={loading}\n src={defineSrc(name, size, '1x')}\n srcSet={`${defineSrc(name, size, '2x')} 2x`}\n width={imageSizes[size]}\n height={imageSizes[size]}\n />\n </picture>\n ) : null;\n },\n);\n\nfunction defineSrc(illustration: string, size: IllustrationSizes, descriptor: Descriptors) {\n return `https://wise.com/web-art/assets/illustrations/${illustration}-${size}@${descriptor}.webp`;\n}\n\nexport default Illustration;\n","/*\n *\n * DON'T MODIFY THIS FILE IT'S AUTO GENERATED\n * See: `scripts/generate-i10s-metadata.mjs`\n *\n */\n \n \n export enum Assets {\n WALLET = 'wallet',TWO_INVITE_LETTERS_OPENED = 'two-invite-letters-opened',TOOL = 'tool',TARGET_PLATFORM = 'target-platform',STOPWATCH_PLATFORM = 'stopwatch-platform',SPEECH_BUBBLE = 'speech-bubble',SKIP_AUTHENTICATION = 'skip-authentication',SHOPPING_BAG = 'shopping-bag',SATELLITE_PLATFORM = 'satellite-platform',SAND_TIMER_BUSINESS = 'sand-timer-business',SAND_TIMER = 'sand-timer',REMINDER_LETTER = 'reminder-letter',RED_PACKET = 'red-packet',RECEIVE_BUSINESS = 'receive-business',RECEIVE = 'receive',QUESTION_MARK_BUSINESS = 'question-mark-business',QUESTION_MARK = 'question-mark',PUZZLE_PIECES_BUSINESS = 'puzzle-pieces-business',PUZZLE_PIECES = 'puzzle-pieces',PLANE_BUSINESS = 'plane-business',PLANE_2 = 'plane-2',PLANE = 'plane',PIE_CHART_BUSINESS = 'pie-chart-business',PIE_CHART = 'pie-chart',PHONES = 'phones',PERSONAL_CARD = 'personal-card',PERCENTAGE_BUSINESS = 'percentage-business',PERCENTAGE = 'percentage',PASSKEY = 'passkey',PALM_TREE = 'palm-tree',ONE_INVITE_LETTER_OPENED = 'one-invite-letter-opened',MULTI_CURRENCY_BUSINESS = 'multi-currency-business',MULTI_CURRENCY = 'multi-currency',MEGAPHONE = 'megaphone',MARBLE_CARD_FLAG_ONLY_BUSINESS = 'marble-card-flag-only-business',MARBLE_CARD_FLAG_ONLY = 'marble-card-flag-only',MARBLE_CARD_BUSINESS_FLAG_ONLY = 'marble-card-business-flag-only',MARBLE_CARD_BUSINESS = 'marble-card-business',MARBLE_CARD = 'marble-card',MARBLE_BUSINESS = 'marble-business',MARBLE = 'marble',MAP = 'map',MAGNIFYING_GLASS_BUSINESS = 'magnifying-glass-business',MAGNIFYING_GLASS = 'magnifying-glass',LOCK_PLATFORM = 'lock-platform',LOCK_BUSINESS = 'lock-business',LOCK = 'lock',LIGHT_BULB_BUSINESS = 'light-bulb-business',LIGHT_BULB = 'light-bulb',KEY_BUSINESS = 'key-business',KEY = 'key',JARS = 'jars',INVITE_LETTER = 'invite-letter',INTEREST = 'interest',INFINITE = 'infinite',ID_CARD = 'id-card',HOUSE = 'house',HEART_5 = 'heart-5',HEART_4 = 'heart-4',HEART_3 = 'heart-3',HEART_2 = 'heart-2',HEART = 'heart',HEADSET_BUSINESS = 'headset-business',HEADSET = 'headset',GRAPH_BUSINESS = 'graph-business',GRAPH = 'graph',GLOBE = 'globe',GIFT_BOX = 'gift-box',GET_PAID_WITH_CARD_BUSINESS = 'get-paid-with-card-business',GEAR_BUSINESS = 'gear-business',GEAR = 'gear',FLOWER = 'flower',FLAG = 'flag',EXCLAMATION_MARK_BUSINESS = 'exclamation-mark-business',EXCLAMATION_MARK = 'exclamation-mark',EMAIL_SUCCESS_BUSINESS = 'email-success-business',EMAIL_SUCCESS = 'email-success',EMAIL = 'email',ELECTRIC_PLUG = 'electric-plug',ECO_CARD = 'eco-card',DOOR = 'door',DOCUMENTS_FOLDER_BUSINESS = 'documents-folder-business',DOCUMENTS = 'documents',DIGITAL_CARD_BUSINESS = 'digital-card-business',DIGITAL_CARD_2 = 'digital-card-2',DIGITAL_CARD = 'digital-card',COOKIE = 'cookie',CONVERT_BUSINESS = 'convert-business',CONVERT = 'convert',CONSTRUCTION_FENCE = 'construction-fence',CONFETTI_BUSINESS = 'confetti-business',CONFETTI = 'confetti',COIN_PILE_UP_BUSINESS = 'coin-pile-up-business',COIN_PILE_UP = 'coin-pile-up',COIN_PILE_DOWN_BUSINESS = 'coin-pile-down-business',COIN_PILE_DOWN = 'coin-pile-down',CLOSED_WINDOW = 'closed-window',CHECK_MARK_BUSINESS = 'check-mark-business',CHECK_MARK = 'check-mark',CALENDAR_BUSINESS = 'calendar-business',CALENDAR = 'calendar',CALCULATOR_BUSINESS = 'calculator-business',BUSINESS_CARD_BUSINESS = 'business-card-business',BUSINESS_CARD = 'business-card',BRIEFCASE_BUSINESS = 'briefcase-business',BRIEFCASE = 'briefcase',BELL_BUSINESS = 'bell-business',BELL = 'bell',BATCH_PAYMENTS_BUSINESS = 'batch-payments-business',BACKPACK = 'backpack',APP_MARKETPLACE_BUSINESS = 'app-marketplace-business',API_INTEGRATIONS_BUSINESS = 'api-integrations-business'\n }\n \n export type IllustrationNames = 'wallet' | 'two-invite-letters-opened' | 'tool' | 'target-platform' | 'stopwatch-platform' | 'speech-bubble' | 'skip-authentication' | 'shopping-bag' | 'satellite-platform' | 'sand-timer-business' | 'sand-timer' | 'reminder-letter' | 'red-packet' | 'receive-business' | 'receive' | 'question-mark-business' | 'question-mark' | 'puzzle-pieces-business' | 'puzzle-pieces' | 'plane-business' | 'plane-2' | 'plane' | 'pie-chart-business' | 'pie-chart' | 'phones' | 'personal-card' | 'percentage-business' | 'percentage' | 'passkey' | 'palm-tree' | 'one-invite-letter-opened' | 'multi-currency-business' | 'multi-currency' | 'megaphone' | 'marble-card-flag-only-business' | 'marble-card-flag-only' | 'marble-card-business-flag-only' | 'marble-card-business' | 'marble-card' | 'marble-business' | 'marble' | 'map' | 'magnifying-glass-business' | 'magnifying-glass' | 'lock-platform' | 'lock-business' | 'lock' | 'light-bulb-business' | 'light-bulb' | 'key-business' | 'key' | 'jars' | 'invite-letter' | 'interest' | 'infinite' | 'id-card' | 'house' | 'heart-5' | 'heart-4' | 'heart-3' | 'heart-2' | 'heart' | 'headset-business' | 'headset' | 'graph-business' | 'graph' | 'globe' | 'gift-box' | 'get-paid-with-card-business' | 'gear-business' | 'gear' | 'flower' | 'flag' | 'exclamation-mark-business' | 'exclamation-mark' | 'email-success-business' | 'email-success' | 'email' | 'electric-plug' | 'eco-card' | 'door' | 'documents-folder-business' | 'documents' | 'digital-card-business' | 'digital-card-2' | 'digital-card' | 'cookie' | 'convert-business' | 'convert' | 'construction-fence' | 'confetti-business' | 'confetti' | 'coin-pile-up-business' | 'coin-pile-up' | 'coin-pile-down-business' | 'coin-pile-down' | 'closed-window' | 'check-mark-business' | 'check-mark' | 'calendar-business' | 'calendar' | 'calculator-business' | 'business-card-business' | 'business-card' | 'briefcase-business' | 'briefcase' | 'bell-business' | 'bell' | 'batch-payments-business' | 'backpack' | 'app-marketplace-business' | 'api-integrations-business'","import { useState, useEffect } from 'react';\n\nimport type { IllustrationNames } from '../illustrations/metadata';\nimport { Illustration3DNames } from './Illustration3D';\n\nexport function useBattery() {\n const [batteryData, setBatteryData] = useState<{ level: number }>({ level: 1.0 });\n\n useEffect(() => {\n const getBatteryData = async () => {\n // @ts-expect-error .getBattery exists in Navigator interface\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call\n const battery = await navigator.getBattery();\n\n setBatteryData({\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n level: battery?.level,\n });\n };\n // Check if the browser supports the Battery API\n if (\n 'getBattery' in navigator &&\n navigator.getBattery !== undefined &&\n typeof navigator.getBattery === 'function'\n ) {\n void getBatteryData();\n }\n }, []);\n\n return batteryData;\n}\n\nexport function isBatteryLow(batteryLevel: number): boolean {\n return batteryLevel < 0.2;\n}\n\nexport const isWebGL2Available = () => {\n try {\n const canvas = document.createElement('canvas');\n return !!(window.WebGL2RenderingContext && canvas.getContext('webgl2'));\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n } catch (e) {\n return false;\n }\n};\n\nexport function isConnectionSlow(): boolean {\n // @ts-expect-error .connection prop exists in Navigator interface\n const { connection } = window.navigator;\n if (connection === undefined) {\n return false;\n }\n return (\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n ['slow-2g', '2g'].includes(connection?.effectiveType as string) ||\n // @ts-expect-error Property 'connection' does exist on type 'Navigator'\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n navigator?.connection?.saveData === true\n );\n}\n\nexport function defineSrc(asset: Illustration3DNames): string {\n const mapNameToFile: Record<Illustration3DNames, string> = {\n 'check-mark': 'checkMark',\n 'marble-card': 'marbleWithCard',\n 'digital-card': 'digitalCard',\n };\n // return `https://wise.com/web-art/assets/illustrations3d/${asset}`;\n return `scenes/${mapNameToFile[asset] || asset}.html`;\n // return `https://wise.com/web-art/assets/illustrations3d/scene/${asset}`;\n}\n\nconst illustration3DNames = [\n 'lock',\n 'globe',\n 'confetti',\n 'check-mark',\n 'flower',\n 'graph',\n 'jars',\n 'magnifying-glass',\n 'marble',\n 'marble-card',\n 'multi-currency',\n 'plane',\n 'interest',\n];\n\nexport function isIllustrationSupport3D(asset: IllustrationNames): boolean {\n return illustration3DNames.includes(asset);\n}\n","import { clsx } from 'clsx';\nimport {\n useEffect,\n useState,\n useRef,\n} from 'react';\n\nimport { LargeSize, MediumSize, SmallSize, Sizes, ImageSizes } from '../common';\nimport Illustration, { Assets } from '../illustrations';\n\nimport { useBattery, isConnectionSlow, isBatteryLow, isWebGL2Available, defineSrc } from './utils';\n\nexport type Illustration3DNames =\n | 'lock'\n | 'globe'\n | 'confetti'\n | 'check-mark'\n | 'digital-card'\n | 'graph'\n | 'jars'\n | 'marble-card'\n | 'plane'\n | 'digital-card'\n | 'interest';\n\nexport type Props = {\n name: Illustration3DNames;\n size?: SmallSize | MediumSize | LargeSize;\n className?: string;\n};\n\nenum RenderMode {\n INIT,\n FALLBACK,\n ASSET_3D,\n}\n\nconst Illustration3D = ({ name, size = Sizes.MEDIUM, className }: Props) => {\n const [renderMode, setRenderMode] = useState<RenderMode>(RenderMode.INIT);\n const [inintrinsicSize, setInintrinsicSize] = useState<Props['size']>(size);\n const batteryData = useBattery();\n const iframeRef = useRef<HTMLIFrameElement>(null);\n const mouseRef = useRef<{ x: number; y: number } | null>(null);\n\n useEffect(() => {\n setRenderMode(\n isConnectionSlow() || isBatteryLow(batteryData.level) || !isWebGL2Available()\n ? RenderMode.FALLBACK\n : RenderMode.ASSET_3D,\n );\n const isMobile: boolean =\n (typeof window !== undefined && window?.matchMedia('(max-width: 575px)')?.matches) ?? false;\n if (isMobile) {\n setInintrinsicSize(Sizes.SMALL);\n }\n }, [batteryData]);\n\n useEffect(() => {\n const handleMouseMove = (event: MouseEvent) => {\n mouseRef.current = { x: event.pageX, y: event.pageY };\n };\n window.addEventListener('mousemove', handleMouseMove);\n\n let animationFrameId: number;\n\n (function rotationModalOnMouseMove() {\n animationFrameId = window.requestAnimationFrame(rotationModalOnMouseMove);\n if (mouseRef.current) {\n const dx = mouseRef.current.x / window.innerWidth - 0.5;\n const dy = mouseRef.current.y / window.innerHeight - 0.5;\n\n const iframeWindow = iframeRef.current?.contentWindow as\n | (WindowProxy & { setRotation?: (x: number, y: number, z: number) => void })\n | null;\n\n if (iframeWindow?.setRotation) {\n iframeWindow.setRotation(dy, dx, 0);\n }\n } else { return; }\n })();\n\n return () => {\n window.removeEventListener('mousemove', handleMouseMove);\n window.cancelAnimationFrame(animationFrameId);\n };\n }, []);\n\n return (\n <div\n className={clsx(\n 'wds-illustration-3d',\n `wds-illustration-3d-${name}`,\n `wds-illustration-3d-${inintrinsicSize as string}`,\n className,\n )}\n aria-hidden\n >\n {renderMode === RenderMode.INIT ? null : renderMode === RenderMode.ASSET_3D ? (\n <iframe\n ref={iframeRef}\n height={ImageSizes[inintrinsicSize]}\n width={ImageSizes[inintrinsicSize]}\n src={defineSrc(name)}\n />\n ) : (\n <Illustration name={name} size={size} alt=\"\" />\n )}\n </div>\n );\n};\n\nexport default Illustration3D;\n"],"names":["DETAILED_FLAG_CODES","unknownFlagName","Flag","code","intrinsicSize","className","undefined","loading","fallback","setFallback","useState","useEffect","detailed","name","toLowerCase","includes","_jsx","clsx","src","process","env","NODE_ENV","alt","width","height","onError","prev","imageSizes","Sizes","SMALL","MEDIUM","LARGE","Illustration","forwardRef","id","size","disablePadding","ref","_jsxs","children","_Fragment","media","srcSet","defineSrc","illustration","descriptor","Assets","useBattery","batteryData","setBatteryData","level","getBatteryData","battery","navigator","getBattery","isBatteryLow","batteryLevel","isWebGL2Available","canvas","document","createElement","window","WebGL2RenderingContext","getContext","e","isConnectionSlow","connection","effectiveType","saveData","asset","mapNameToFile","illustration3DNames","isIllustrationSupport3D","RenderMode","Illustration3D","renderMode","setRenderMode","INIT","inintrinsicSize","setInintrinsicSize","iframeRef","useRef","mouseRef","FALLBACK","ASSET_3D","isMobile","matchMedia","matches","handleMouseMove","event","current","x","pageX","y","pageY","addEventListener","animationFrameId","rotationModalOnMouseMove","requestAnimationFrame","dx","innerWidth","dy","innerHeight","iframeWindow","contentWindow","setRotation","removeEventListener","cancelAnimationFrame","ImageSizes"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F,UAAU,CAACI,IAAI,GAAG,IAAI,GAAGF,UAAU,KAAKF,UAAU,CAACW,QAAQ,gBACzEpE,cAAA,CAAA,QAAA,EAAA;AACEqB,MAAAA,GAAG,EAAE2C,SAAU;AACfxD,MAAAA,MAAM,EAAEoF,iBAAU,CAAC9B,eAAe,CAAE;AACpCvD,MAAAA,KAAK,EAAEqF,iBAAU,CAAC9B,eAAe,CAAE;MACnC5D,GAAG,EAAEyB,SAAS,CAAC9B,IAAI;AAAE,MACrB,gBAEFG,cAAA,CAACgB,YAAY,EAAA;AAACnB,MAAAA,IAAI,EAAEA,IAAK;AAACsB,MAAAA,IAAI,EAAEA,IAAK;AAACb,MAAAA,GAAG,EAAC;KAAE;AAC7C,GACE,CAAC;AAEV;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wise/art",
|
|
3
|
-
"version": "0.0.0-experimental-
|
|
3
|
+
"version": "0.0.0-experimental-2292385",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "React library for art elements in UI",
|
|
6
6
|
"homepage": "https://github.com/transferwise/web-art#readme",
|
|
@@ -95,7 +95,8 @@
|
|
|
95
95
|
},
|
|
96
96
|
"scripts": {
|
|
97
97
|
"setup": "pnpm install && pnpm build",
|
|
98
|
-
"load-3d-i10s": "rm -rf s3-bucket/illustrations3d/ && node ./scripts/load-3d-i10s.mjs && pnpm load-riv",
|
|
98
|
+
"load-3d-i10s": "rm -rf s3-bucket/illustrations3d/ && node ./scripts/load-3d-i10s.mjs && pnpm 3d-v2 && pnpm load-riv",
|
|
99
|
+
"3d-v2": "cp -R node_modules/3d-assets/build/mobileBundle/ s3-bucket/illustrations3d && rm -f s3-bucket/illustrations3d/index.html",
|
|
99
100
|
"load-riv": "copyfiles -u 1 assets/*.riv s3-bucket/illustrations3d/rive",
|
|
100
101
|
"load-i10s": "copyfiles -u 3 node_modules/wise-atoms/illustrations/**/*.png temp",
|
|
101
102
|
"load-flags": "rm -rf s3-bucket/flags/* && pnpm load-country-flags && pnpm load-currency-flags && pnpm transform-flags && pnpm convert-flags-svg-to-png",
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
import { LargeSize, MediumSize, SmallSize, Sizes, ImageSizes } from '../common';
|
|
9
9
|
import Illustration, { Assets } from '../illustrations';
|
|
10
10
|
|
|
11
|
-
import { useBattery, isConnectionSlow, isBatteryLow, isWebGL2Available } from './utils';
|
|
11
|
+
import { useBattery, isConnectionSlow, isBatteryLow, isWebGL2Available, defineSrc } from './utils';
|
|
12
12
|
|
|
13
13
|
export type Illustration3DNames =
|
|
14
14
|
| 'lock'
|
|
@@ -20,14 +20,9 @@ export type Illustration3DNames =
|
|
|
20
20
|
| 'jars'
|
|
21
21
|
| 'marble-card'
|
|
22
22
|
| 'plane'
|
|
23
|
+
| 'digital-card'
|
|
23
24
|
| 'interest';
|
|
24
25
|
|
|
25
|
-
const mapFileToName: Record<Illustration3DNames, string> = {
|
|
26
|
-
'check-mark': 'checkMark',
|
|
27
|
-
'marble-card': 'marbleWithCard',
|
|
28
|
-
'digital-card': 'digitalCard',
|
|
29
|
-
};
|
|
30
|
-
|
|
31
26
|
export type Props = {
|
|
32
27
|
name: Illustration3DNames;
|
|
33
28
|
size?: SmallSize | MediumSize | LargeSize;
|
|
@@ -64,27 +59,24 @@ const Illustration3D = ({ name, size = Sizes.MEDIUM, className }: Props) => {
|
|
|
64
59
|
const handleMouseMove = (event: MouseEvent) => {
|
|
65
60
|
mouseRef.current = { x: event.pageX, y: event.pageY };
|
|
66
61
|
};
|
|
67
|
-
|
|
68
62
|
window.addEventListener('mousemove', handleMouseMove);
|
|
69
63
|
|
|
70
64
|
let animationFrameId: number;
|
|
71
65
|
|
|
72
66
|
(function rotationModalOnMouseMove() {
|
|
73
67
|
animationFrameId = window.requestAnimationFrame(rotationModalOnMouseMove);
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
iframeWindow.setRotation(dy, dx, 0);
|
|
87
|
-
}
|
|
68
|
+
if (mouseRef.current) {
|
|
69
|
+
const dx = mouseRef.current.x / window.innerWidth - 0.5;
|
|
70
|
+
const dy = mouseRef.current.y / window.innerHeight - 0.5;
|
|
71
|
+
|
|
72
|
+
const iframeWindow = iframeRef.current?.contentWindow as
|
|
73
|
+
| (WindowProxy & { setRotation?: (x: number, y: number, z: number) => void })
|
|
74
|
+
| null;
|
|
75
|
+
|
|
76
|
+
if (iframeWindow?.setRotation) {
|
|
77
|
+
iframeWindow.setRotation(dy, dx, 0);
|
|
78
|
+
}
|
|
79
|
+
} else { return; }
|
|
88
80
|
})();
|
|
89
81
|
|
|
90
82
|
return () => {
|
|
@@ -93,7 +85,6 @@ const Illustration3D = ({ name, size = Sizes.MEDIUM, className }: Props) => {
|
|
|
93
85
|
};
|
|
94
86
|
}, []);
|
|
95
87
|
|
|
96
|
-
const modelSrc = `scenes/${mapFileToName[name] || name}.html`;
|
|
97
88
|
return (
|
|
98
89
|
<div
|
|
99
90
|
className={clsx(
|
|
@@ -109,7 +100,7 @@ const Illustration3D = ({ name, size = Sizes.MEDIUM, className }: Props) => {
|
|
|
109
100
|
ref={iframeRef}
|
|
110
101
|
height={ImageSizes[inintrinsicSize]}
|
|
111
102
|
width={ImageSizes[inintrinsicSize]}
|
|
112
|
-
src={
|
|
103
|
+
src={defineSrc(name)}
|
|
113
104
|
/>
|
|
114
105
|
) : (
|
|
115
106
|
<Illustration name={name} size={size} alt="" />
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useState, useEffect } from 'react';
|
|
2
2
|
|
|
3
3
|
import type { IllustrationNames } from '../illustrations/metadata';
|
|
4
|
+
import { Illustration3DNames } from './Illustration3D';
|
|
4
5
|
|
|
5
6
|
export function useBattery() {
|
|
6
7
|
const [batteryData, setBatteryData] = useState<{ level: number }>({ level: 1.0 });
|
|
@@ -58,8 +59,15 @@ export function isConnectionSlow(): boolean {
|
|
|
58
59
|
);
|
|
59
60
|
}
|
|
60
61
|
|
|
61
|
-
export function defineSrc(asset:
|
|
62
|
-
|
|
62
|
+
export function defineSrc(asset: Illustration3DNames): string {
|
|
63
|
+
const mapNameToFile: Record<Illustration3DNames, string> = {
|
|
64
|
+
'check-mark': 'checkMark',
|
|
65
|
+
'marble-card': 'marbleWithCard',
|
|
66
|
+
'digital-card': 'digitalCard',
|
|
67
|
+
};
|
|
68
|
+
// return `https://wise.com/web-art/assets/illustrations3d/${asset}`;
|
|
69
|
+
return `scenes/${mapNameToFile[asset] || asset}.html`;
|
|
70
|
+
// return `https://wise.com/web-art/assets/illustrations3d/scene/${asset}`;
|
|
63
71
|
}
|
|
64
72
|
|
|
65
73
|
const illustration3DNames = [
|