@mapples/render 1.6.0-beta.20260929074057 → 1.6.0-beta.20260929132300

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/CHANGELOG.md CHANGED
@@ -1,9 +1,10 @@
1
1
  # @mapples/render
2
2
 
3
- ## 1.6.0-beta.20260929074057
3
+ ## 1.6.0-beta.20260929132300
4
4
 
5
5
  ### Minor Changes
6
6
 
7
+ - 7339399: Designed navigator chrome. A tabs navigator's `TabBarOptions.componentUuid` and a drawer's `DrawerOptions.componentUuid` name a saved component that renders the bar or the drawer content, and `TabBarOptions.native` asks the exported app for expo-router's `NativeTabs`. `@mapples/render` carries the contract (`NavigatorChromeContext`, `useNavigatorChrome`): the navigator's routes as items with a label, an active flag and an icon renderer, plus `select`, `close` and the safe-area insets. Two new `@mapples/components` elements read it — `TabBarItems` (one tab per route, pill, labels, badges' tones) and `DrawerItems` (one row per route) — and show a notice when the component is not a navigator's design yet; `@mapples/components` now peers on `@mapples/render`. `@mapples/navigation` mounts a design through `TabBarHost` / `DrawerContentHost` (React Navigation's `tabBar` / `drawerContent`, reading only their props so an exported app uses them as-is) when `MapplesNavigation` is given the `chrome` map, and keeps `visible: false` working for a custom bar. The Creator canvas draws a designed tab bar on every screen frame with its measured height as the bottom inset, a platform-styled placeholder for a native bar, frames a chrome master on the components surface at the chrome's shape with the navigator's routes flowing in, and labels storyboard sections with their design. `create_navigator_chrome` creates and assigns a starter design; `set_navigator_options` accepts the new fields.
7
8
  - a6c5872: All `@mapples/*` runtime packages now share one version and are versioned and published together from `mapplesorg/mapples-kit`; `mapples-open-kit` is a read-only mirror of the source.
8
9
 
9
10
  ## 1.3.0
@@ -0,0 +1,67 @@
1
+ import { ReactNode } from 'react';
2
+ /** What a chrome item's icon renderer receives — the same shape React Navigation hands `tabBarIcon`. */
3
+ export interface NavigatorChromeIconProps {
4
+ color?: string;
5
+ size?: number;
6
+ }
7
+ /**
8
+ * One route of the navigator a chrome component draws: a tab of a tabs
9
+ * navigator, or a row of a drawer.
10
+ *
11
+ * @interface NavigatorChromeItem
12
+ */
13
+ export interface NavigatorChromeItem {
14
+ /**
15
+ * Host-opaque identity of the route — React Navigation's `route.key` in a
16
+ * running app, the navigation document's route id on the Creator canvas.
17
+ * Passed back to {@link NavigatorChrome.select}.
18
+ */
19
+ routeId: string;
20
+ /** The label the route shows (tab label, drawer label or route name). */
21
+ label: string;
22
+ /** Whether this route is the focused one. */
23
+ active: boolean;
24
+ /**
25
+ * Renders the route's icon in the colour and size the chrome asks for.
26
+ * Absent when the route has no icon. A renderer rather than an asset
27
+ * reference, because the canvas mounts no render provider and an exported
28
+ * app never sees `ref(icon:…)` values.
29
+ */
30
+ renderIcon?: (props: NavigatorChromeIconProps) => ReactNode;
31
+ }
32
+ /**
33
+ * The contract between a navigator and the saved component that renders its
34
+ * chrome (a custom tab bar or drawer content). The host — React Navigation's
35
+ * `tabBar` / `drawerContent` at runtime, the frame or the components surface
36
+ * in the Creator — provides it; `TabBarItems` and `DrawerItems` from
37
+ * `@mapples/components` read it.
38
+ *
39
+ * @interface NavigatorChrome
40
+ */
41
+ export interface NavigatorChrome {
42
+ /** Which chrome this is: a tabs navigator's bar or a drawer's content. */
43
+ kind: 'tabs' | 'drawer';
44
+ /** The navigator's routes in display order. */
45
+ items: NavigatorChromeItem[];
46
+ /** `routeId` of the focused route, when one is. */
47
+ activeRouteId?: string;
48
+ /** Focus a route — switch the tab, or navigate and close the drawer. */
49
+ select: (routeId: string) => void;
50
+ /** Close the drawer. Only a drawer host provides it. */
51
+ close?: () => void;
52
+ /** Safe-area room the chrome sits against (a tab bar pads its bottom by it). */
53
+ insets: {
54
+ top: number;
55
+ bottom: number;
56
+ };
57
+ }
58
+ /**
59
+ * Carries the {@link NavigatorChrome} a host provides down to the chrome
60
+ * elements. `undefined` outside a host — a chrome element then knows it is
61
+ * not attached to any navigator.
62
+ */
63
+ declare const NavigatorChromeContext: import("react").Context<NavigatorChrome | undefined>;
64
+ /** Provider a chrome host wraps the saved component with. */
65
+ export declare const NavigatorChromeProvider: import("react").Provider<NavigatorChrome | undefined>;
66
+ export default NavigatorChromeContext;
67
+ //# sourceMappingURL=NavigatorChromeContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NavigatorChromeContext.d.ts","sourceRoot":"","sources":["../../src/context/NavigatorChromeContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,SAAS,EAAE,MAAM,OAAO,CAAC;AAEjD,wGAAwG;AACxG,MAAM,WAAW,wBAAwB;IACvC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;;;GAKG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB,yEAAyE;IACzE,KAAK,EAAE,MAAM,CAAC;IACd,6CAA6C;IAC7C,MAAM,EAAE,OAAO,CAAC;IAChB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,wBAAwB,KAAK,SAAS,CAAC;CAC7D;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,eAAe;IAC9B,0EAA0E;IAC1E,IAAI,EAAE,MAAM,GAAG,QAAQ,CAAC;IACxB,+CAA+C;IAC/C,KAAK,EAAE,mBAAmB,EAAE,CAAC;IAC7B,mDAAmD;IACnD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,wEAAwE;IACxE,MAAM,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,wDAAwD;IACxD,KAAK,CAAC,EAAE,MAAM,IAAI,CAAC;IACnB,gFAAgF;IAChF,MAAM,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;CACzC;AAED;;;;GAIG;AACH,QAAA,MAAM,sBAAsB,sDAE3B,CAAC;AAEF,6DAA6D;AAC7D,eAAO,MAAM,uBAAuB,uDAAkC,CAAC;AAEvE,eAAe,sBAAsB,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { createContext } from 'react';
2
+ /**
3
+ * Carries the {@link NavigatorChrome} a host provides down to the chrome
4
+ * elements. `undefined` outside a host — a chrome element then knows it is
5
+ * not attached to any navigator.
6
+ */
7
+ const NavigatorChromeContext = createContext(undefined);
8
+ /** Provider a chrome host wraps the saved component with. */
9
+ export const NavigatorChromeProvider = NavigatorChromeContext.Provider;
10
+ export default NavigatorChromeContext;
11
+ //# sourceMappingURL=NavigatorChromeContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NavigatorChromeContext.js","sourceRoot":"","sources":["../../src/context/NavigatorChromeContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAa,MAAM,OAAO,CAAC;AA0DjD;;;;GAIG;AACH,MAAM,sBAAsB,GAAG,aAAa,CAC1C,SAAS,CACV,CAAC;AAEF,6DAA6D;AAC7D,MAAM,CAAC,MAAM,uBAAuB,GAAG,sBAAsB,CAAC,QAAQ,CAAC;AAEvE,eAAe,sBAAsB,CAAC"}
@@ -1,3 +1,5 @@
1
1
  export { default as RenderContext } from './RenderContext';
2
2
  export * from './RenderContext';
3
+ export { default as NavigatorChromeContext } from './NavigatorChromeContext';
4
+ export * from './NavigatorChromeContext';
3
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/context/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3D,cAAc,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/context/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3D,cAAc,iBAAiB,CAAC;AAChC,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAC7E,cAAc,0BAA0B,CAAC"}
@@ -1,3 +1,5 @@
1
1
  export { default as RenderContext } from './RenderContext';
2
2
  export * from './RenderContext';
3
+ export { default as NavigatorChromeContext } from './NavigatorChromeContext';
4
+ export * from './NavigatorChromeContext';
3
5
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/context/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3D,cAAc,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/context/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3D,cAAc,iBAAiB,CAAC;AAChC,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAC7E,cAAc,0BAA0B,CAAC"}
@@ -1,3 +1,5 @@
1
1
  export { default as useRender } from './useRender';
2
2
  export { default as useConditionalStyled } from './useConditionalStyled';
3
+ export { default as useNavigatorChrome } from './useNavigatorChrome';
4
+ export * from './useNavigatorChrome';
3
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,wBAAwB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACzE,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AACrE,cAAc,sBAAsB,CAAC"}
@@ -1,3 +1,5 @@
1
1
  export { default as useRender } from './useRender';
2
2
  export { default as useConditionalStyled } from './useConditionalStyled';
3
+ export { default as useNavigatorChrome } from './useNavigatorChrome';
4
+ export * from './useNavigatorChrome';
3
5
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,wBAAwB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACzE,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AACrE,cAAc,sBAAsB,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { NavigatorChrome } from '../context/NavigatorChromeContext';
2
+ /**
3
+ * The navigator chrome a host provides, or `undefined` when the component is
4
+ * not mounted as a navigator's chrome. The library's chrome elements use this
5
+ * to tell the designer they are not attached yet instead of failing.
6
+ */
7
+ export declare const useOptionalNavigatorChrome: () => NavigatorChrome | undefined;
8
+ /**
9
+ * The navigator chrome a host provides.
10
+ *
11
+ * @throws When no `NavigatorChromeProvider` is above — the component is not
12
+ * mounted as a navigator's tab bar or drawer content.
13
+ */
14
+ declare const useNavigatorChrome: () => NavigatorChrome;
15
+ export default useNavigatorChrome;
16
+ //# sourceMappingURL=useNavigatorChrome.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useNavigatorChrome.d.ts","sourceRoot":"","sources":["../../src/hooks/useNavigatorChrome.ts"],"names":[],"mappings":"AAEA,OAA+B,EAC7B,eAAe,EAChB,MAAM,mCAAmC,CAAC;AAE3C;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,QAAO,eAAe,GAAG,SAC5B,CAAC;AAErC;;;;;GAKG;AACH,QAAA,MAAM,kBAAkB,QAAO,eAQ9B,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { useContext } from 'react';
2
+ import NavigatorChromeContext from '../context/NavigatorChromeContext';
3
+ /**
4
+ * The navigator chrome a host provides, or `undefined` when the component is
5
+ * not mounted as a navigator's chrome. The library's chrome elements use this
6
+ * to tell the designer they are not attached yet instead of failing.
7
+ */
8
+ export const useOptionalNavigatorChrome = () => useContext(NavigatorChromeContext);
9
+ /**
10
+ * The navigator chrome a host provides.
11
+ *
12
+ * @throws When no `NavigatorChromeProvider` is above — the component is not
13
+ * mounted as a navigator's tab bar or drawer content.
14
+ */
15
+ const useNavigatorChrome = () => {
16
+ const chrome = useContext(NavigatorChromeContext);
17
+ if (!chrome) {
18
+ throw new Error('useNavigatorChrome: no navigator chrome — the component is not mounted as a tab bar or drawer content');
19
+ }
20
+ return chrome;
21
+ };
22
+ export default useNavigatorChrome;
23
+ //# sourceMappingURL=useNavigatorChrome.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useNavigatorChrome.js","sourceRoot":"","sources":["../../src/hooks/useNavigatorChrome.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEnC,OAAO,sBAEN,MAAM,mCAAmC,CAAC;AAE3C;;;;GAIG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,GAAgC,EAAE,CAC1E,UAAU,CAAC,sBAAsB,CAAC,CAAC;AAErC;;;;;GAKG;AACH,MAAM,kBAAkB,GAAG,GAAoB,EAAE;IAC/C,MAAM,MAAM,GAAG,UAAU,CAAC,sBAAsB,CAAC,CAAC;IAClD,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CACb,uGAAuG,CACxG,CAAC;IACJ,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mapples/render",
3
- "version": "1.6.0-beta.20260929074057",
3
+ "version": "1.6.0-beta.20260929132300",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {