@mapples/app 1.1.1 → 1.1.3
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/MapplesApp.d.ts +2 -2
- package/dist/MapplesApp.d.ts.map +1 -1
- package/dist/MapplesApp.js +15 -3
- package/dist/MapplesApp.js.map +1 -1
- package/package.json +1 -1
package/dist/MapplesApp.d.ts
CHANGED
|
@@ -14,10 +14,10 @@ export interface MapplesAppProps {
|
|
|
14
14
|
assets?: AnyObject;
|
|
15
15
|
/** Optional navigation map (Mapples action `routeName` → expo-router href) for navigation actions */
|
|
16
16
|
navigation?: NavigationMap;
|
|
17
|
-
/** Whether to show a loading indicator while fonts are loading */
|
|
18
|
-
showFontLoadingIndicator?: boolean;
|
|
19
17
|
/** Custom loading indicator component to display while fonts are loading */
|
|
20
18
|
FontLoadingIndicator?: JSX.Element;
|
|
19
|
+
/** Font loaded callback **/
|
|
20
|
+
onFontLoaded?: () => void;
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
23
|
* The main MapplesApp component that provides the core Mapples ecosystem functionality.
|
package/dist/MapplesApp.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapplesApp.d.ts","sourceRoot":"","sources":["../src/MapplesApp.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,iBAAiB,EAAE,GAAG,
|
|
1
|
+
{"version":3,"file":"MapplesApp.d.ts","sourceRoot":"","sources":["../src/MapplesApp.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,iBAAiB,EAAE,GAAG,EAAa,MAAM,OAAO,CAAC;AAG9D,OAAO,EAAE,SAAS,EAAkB,MAAM,iBAAiB,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAyB,MAAM,gBAAgB,CAAC;AAazE,OAAO,EAAE,aAAa,EAAsB,MAAM,qBAAqB,CAAC;AAGxE;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,kFAAkF;IAClF,KAAK,CAAC,EAAE,gBAAgB,CAAC;IACzB,kFAAkF;IAClF,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,qGAAqG;IACrG,UAAU,CAAC,EAAE,aAAa,CAAC;IAC3B,4EAA4E;IAC5E,oBAAoB,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IACnC,4BAA4B;IAC5B,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;CAC3B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,QAAA,MAAM,UAAU,EAAE,EAAE,CAAC,iBAAiB,CAAC,eAAe,CAAC,CAsCtD,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
package/dist/MapplesApp.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { useEffect } from 'react';
|
|
1
2
|
import { Components } from '@mapples/components';
|
|
2
3
|
import { RenderProvider } from '@mapples/render';
|
|
3
4
|
import { StyleProvider, Styler } from '@mapples/style';
|
|
@@ -55,10 +56,21 @@ import { remapFonts } from './utils';
|
|
|
55
56
|
* }
|
|
56
57
|
* ```
|
|
57
58
|
*/
|
|
58
|
-
const MapplesApp = ({ children, style, assets, navigation,
|
|
59
|
+
const MapplesApp = ({ children, style, assets, navigation, FontLoadingIndicator, onFontLoaded, }) => {
|
|
59
60
|
const [loaded] = useFonts(remapFonts(assets || assetsConfig));
|
|
60
|
-
|
|
61
|
-
|
|
61
|
+
useEffect(() => {
|
|
62
|
+
if (loaded && onFontLoaded) {
|
|
63
|
+
onFontLoaded();
|
|
64
|
+
}
|
|
65
|
+
}, [loaded, onFontLoaded]);
|
|
66
|
+
// Gate the entire subtree on font readiness regardless of `onFontLoaded`.
|
|
67
|
+
// Otherwise `children` mount on the first render with `loaded === false`,
|
|
68
|
+
// laying out `Text` with the fallback font; components that don't re-render
|
|
69
|
+
// after `loaded` flips keep the fallback (the intermittent "not all fonts"
|
|
70
|
+
// race). Returning here blocks until fonts are ready; `onFontLoaded` still
|
|
71
|
+
// fires from the effect above so consumers can hide their splash in sync.
|
|
72
|
+
if (!loaded) {
|
|
73
|
+
return FontLoadingIndicator ?? null;
|
|
62
74
|
}
|
|
63
75
|
return (<StyleProvider style={Styler.init(style || styleConfig)}>
|
|
64
76
|
<RenderProvider components={{ ...Components, ...UIComponents }} assets={assets || assetsConfig}>
|
package/dist/MapplesApp.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapplesApp.js","sourceRoot":"","sources":["../src/MapplesApp.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MapplesApp.js","sourceRoot":"","sources":["../src/MapplesApp.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA8B,SAAS,EAAE,MAAM,OAAO,CAAC;AAE9D,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAa,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAO,EAAoB,aAAa,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,aAAa;AACb,gDAAgD;AAChD,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAC3C,aAAa;AACb,gDAAgD;AAChD,OAAO,gBAAgB,MAAM,qBAAqB,CAAC;AACnD,aAAa;AACb,gDAAgD;AAChD,OAAO,WAAW,MAAM,gBAAgB,CAAC;AAEzC,OAAO,EAAiB,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACxE,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAoBrC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,MAAM,UAAU,GAA2C,CAAC,EAC1D,QAAQ,EACR,KAAK,EACL,MAAM,EACN,UAAU,EACV,oBAAoB,EACpB,YAAY,G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