@ankhorage/zora 2.13.0 → 2.13.1

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,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.13.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 400863f: Define Screen scroll ownership explicitly: normal screens own scrolling, while `scroll={false}` preserves a bounded viewport for child-owned scroll and gesture surfaces. Require `@ankhorage/surface` 2.2.1 or newer so Stack preserves direct-child flex and min-size semantics throughout that viewport chain.
8
+
3
9
  ## 2.13.0
4
10
 
5
11
  ### Minor Changes
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
 
4
4
  # ZORA
5
5
 
6
- ![license: MIT](././paradox/badges/license.svg) ![npm: v2.12.0](././paradox/badges/npm.svg) ![runtime: bun](././paradox/badges/runtime.svg) ![typescript: strict](././paradox/badges/typescript.svg) ![eslint: checked](././paradox/badges/eslint.svg) ![prettier: checked](././paradox/badges/prettier.svg) ![build: checked](././paradox/badges/build.svg) ![tests: checked](././paradox/badges/tests.svg) ![docs: paradox](././paradox/badges/docs.svg)
6
+ ![license: MIT](././paradox/badges/license.svg) ![npm: v2.13.0](././paradox/badges/npm.svg) ![runtime: bun](././paradox/badges/runtime.svg) ![typescript: strict](././paradox/badges/typescript.svg) ![eslint: checked](././paradox/badges/eslint.svg) ![prettier: checked](././paradox/badges/prettier.svg) ![build: checked](././paradox/badges/build.svg) ![tests: checked](././paradox/badges/tests.svg) ![docs: paradox](././paradox/badges/docs.svg)
7
7
 
8
8
  Opinionated React Native and React Native Web UI kit built on @ankhorage/surface.
9
9
 
@@ -1,9 +1,11 @@
1
1
  import React from 'react';
2
2
  import type { ScreenProps } from './types';
3
- /***
4
- * Page-level container with standard background and optional scroll behavior.
3
+ /**
4
+ * Outer content boundary for one app screen.
5
5
  *
6
-
6
+ * By default Screen owns normal vertical scrolling. Set `scroll={false}` to preserve a bounded
7
+ * viewport and delegate scroll or gesture ownership to specialized children such as lists, maps,
8
+ * chats, canvases, or editors.
7
9
  */
8
10
  export declare const Screen: (props: ScreenProps) => React.ReactElement | null;
9
11
  //# sourceMappingURL=Screen.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Screen.d.ts","sourceRoot":"","sources":["../../../src/layout/screen/Screen.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAoC3C;;;;GAIG;AACH,eAAO,MAAM,MAAM,mDAAkC,CAAC"}
1
+ {"version":3,"file":"Screen.d.ts","sourceRoot":"","sources":["../../../src/layout/screen/Screen.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAiC3C;;;;;;GAMG;AACH,eAAO,MAAM,MAAM,mDAAkC,CAAC"}
@@ -4,25 +4,27 @@ import { Box, Container, Stack } from '../../foundation';
4
4
  import { resolvePageMaxWidth } from '../../internal/recipes';
5
5
  import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
6
6
  function ScreenInner({ themeId: _themeId, mode: _mode, interactionPolicy: _interactionPolicy, children, footer, scroll = true, width = 'default', testID, }) {
7
- const content = (<Container maxWidth={resolvePageMaxWidth(width)} py="xl" testID={testID}>
8
- <Stack gap="l">
7
+ if (!scroll) {
8
+ return (<Box bg="background" flex={1} minHeight={0} minWidth={0} testID={testID}>
9
9
  {children}
10
10
  {footer}
11
- </Stack>
12
- </Container>);
13
- if (!scroll) {
14
- return (<Box bg="background" flex={1}>
15
- {content}
16
11
  </Box>);
17
12
  }
18
- return (<ScrollArea bg="background" style={{ flex: 1 }}>
19
- {content}
13
+ return (<ScrollArea bg="background" style={{ flex: 1, minHeight: 0, minWidth: 0 }}>
14
+ <Container maxWidth={resolvePageMaxWidth(width)} py="xl" testID={testID}>
15
+ <Stack gap="l">
16
+ {children}
17
+ {footer}
18
+ </Stack>
19
+ </Container>
20
20
  </ScrollArea>);
21
21
  }
22
- /***
23
- * Page-level container with standard background and optional scroll behavior.
22
+ /**
23
+ * Outer content boundary for one app screen.
24
24
  *
25
-
25
+ * By default Screen owns normal vertical scrolling. Set `scroll={false}` to preserve a bounded
26
+ * viewport and delegate scroll or gesture ownership to specialized children such as lists, maps,
27
+ * chats, canvases, or editors.
26
28
  */
27
29
  export const Screen = withZoraThemeScope(ScreenInner);
28
30
  //# sourceMappingURL=Screen.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Screen.js","sourceRoot":"","sources":["../../../src/layout/screen/Screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAGpE,SAAS,WAAW,CAAC,EACnB,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAE,KAAK,EACX,iBAAiB,EAAE,kBAAkB,EACrC,QAAQ,EACR,MAAM,EACN,MAAM,GAAG,IAAI,EACb,KAAK,GAAG,SAAS,EACjB,MAAM,GACM;IACZ,MAAM,OAAO,GAAG,CACd,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CACtE;MAAA,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CACZ;QAAA,CAAC,QAAQ,CACT;QAAA,CAAC,MAAM,CACT;MAAA,EAAE,KAAK,CACT;IAAA,EAAE,SAAS,CAAC,CACb,CAAC;IAEF,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO,CACL,CAAC,GAAG,CAAC,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAC3B;QAAA,CAAC,OAAO,CACV;MAAA,EAAE,GAAG,CAAC,CACP,CAAC;IACJ,CAAC;IAED,OAAO,CACL,CAAC,UAAU,CAAC,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,CAC7C;MAAA,CAAC,OAAO,CACV;IAAA,EAAE,UAAU,CAAC,CACd,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,kBAAkB,CAAC,WAAW,CAAC,CAAC","sourcesContent":["import { ScrollArea } from '@ankhorage/surface';\nimport React from 'react';\n\nimport { Box, Container, Stack } from '../../foundation';\nimport { resolvePageMaxWidth } from '../../internal/recipes';\nimport { withZoraThemeScope } from '../../theme/withZoraThemeScope';\nimport type { ScreenProps } from './types';\n\nfunction ScreenInner({\n themeId: _themeId,\n mode: _mode,\n interactionPolicy: _interactionPolicy,\n children,\n footer,\n scroll = true,\n width = 'default',\n testID,\n}: ScreenProps) {\n const content = (\n <Container maxWidth={resolvePageMaxWidth(width)} py=\"xl\" testID={testID}>\n <Stack gap=\"l\">\n {children}\n {footer}\n </Stack>\n </Container>\n );\n\n if (!scroll) {\n return (\n <Box bg=\"background\" flex={1}>\n {content}\n </Box>\n );\n }\n\n return (\n <ScrollArea bg=\"background\" style={{ flex: 1 }}>\n {content}\n </ScrollArea>\n );\n}\n\n/***\n * Page-level container with standard background and optional scroll behavior.\n *\n \n */\nexport const Screen = withZoraThemeScope(ScreenInner);\n"]}
1
+ {"version":3,"file":"Screen.js","sourceRoot":"","sources":["../../../src/layout/screen/Screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,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AM,GAAG,kBAAkB,CAAC,WAAW,CAAC,CAAC","sourcesContent":["import { ScrollArea } from '@ankhorage/surface';\nimport React from 'react';\n\nimport { Box, Container, Stack } from '../../foundation';\nimport { resolvePageMaxWidth } from '../../internal/recipes';\nimport { withZoraThemeScope } from '../../theme/withZoraThemeScope';\nimport type { ScreenProps } from './types';\n\nfunction ScreenInner({\n themeId: _themeId,\n mode: _mode,\n interactionPolicy: _interactionPolicy,\n children,\n footer,\n scroll = true,\n width = 'default',\n testID,\n}: ScreenProps) {\n if (!scroll) {\n return (\n <Box bg=\"background\" flex={1} minHeight={0} minWidth={0} testID={testID}>\n {children}\n {footer}\n </Box>\n );\n }\n\n return (\n <ScrollArea bg=\"background\" style={{ flex: 1, minHeight: 0, minWidth: 0 }}>\n <Container maxWidth={resolvePageMaxWidth(width)} py=\"xl\" testID={testID}>\n <Stack gap=\"l\">\n {children}\n {footer}\n </Stack>\n </Container>\n </ScrollArea>\n );\n}\n\n/**\n * Outer content boundary for one app screen.\n *\n * By default Screen owns normal vertical scrolling. Set `scroll={false}` to preserve a bounded\n * viewport and delegate scroll or gesture ownership to specialized children such as lists, maps,\n * chats, canvases, or editors.\n */\nexport const Screen = withZoraThemeScope(ScreenInner);\n"]}
@@ -1,7 +1,7 @@
1
1
  export declare function useZoraTheme(): {
2
2
  theme: import("@ankhorage/surface").SurfaceTheme;
3
3
  mode: "light" | "dark";
4
- setThemeConfig: (config: Partial<import("@ankhorage/surface").ThemeConfig>) => void;
4
+ setThemeConfig: (config: Partial<import("@ankhorage/contracts").ThemeConfig>) => void;
5
5
  setMode: (mode: "light" | "dark") => void;
6
6
  _hasProvider?: boolean;
7
7
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ankhorage/zora",
3
3
  "type": "module",
4
- "version": "2.13.0",
4
+ "version": "2.13.1",
5
5
  "description": "Opinionated React Native and React Native Web UI kit built on @ankhorage/surface.",
6
6
  "homepage": "https://github.com/ankhorage/zora#readme",
7
7
  "bugs": {
@@ -43,7 +43,7 @@
43
43
  "dependencies": {
44
44
  "@ankhorage/color-theory": "^0.0.8",
45
45
  "@ankhorage/contracts": "^7.6.0",
46
- "@ankhorage/surface": "^2.2.0"
46
+ "@ankhorage/surface": "^2.2.1"
47
47
  },
48
48
  "files": [
49
49
  "dist",
@@ -0,0 +1,22 @@
1
+ import { readFile } from 'node:fs/promises';
2
+
3
+ import { describe, expect, it } from 'bun:test';
4
+
5
+ describe('Screen scroll ownership contract', () => {
6
+ it('keeps scroll=false as a bounded delegated viewport', async () => {
7
+ const source = await readFile(new URL('./Screen.tsx', import.meta.url), 'utf8');
8
+
9
+ expect(source).toContain('if (!scroll)');
10
+ expect(source).toContain('flex={1} minHeight={0} minWidth={0}');
11
+ expect(source).toContain('{children}');
12
+ expect(source).not.toContain('{content}');
13
+ });
14
+
15
+ it('keeps normal scrolling owned by Screen', async () => {
16
+ const source = await readFile(new URL('./Screen.tsx', import.meta.url), 'utf8');
17
+
18
+ expect(source).toContain('<ScrollArea');
19
+ expect(source).toContain('style={{ flex: 1, minHeight: 0, minWidth: 0 }}');
20
+ expect(source).toContain('<Container maxWidth={resolvePageMaxWidth(width)}');
21
+ });
22
+ });
@@ -16,33 +16,32 @@ function ScreenInner({
16
16
  width = 'default',
17
17
  testID,
18
18
  }: ScreenProps) {
19
- const content = (
20
- <Container maxWidth={resolvePageMaxWidth(width)} py="xl" testID={testID}>
21
- <Stack gap="l">
22
- {children}
23
- {footer}
24
- </Stack>
25
- </Container>
26
- );
27
-
28
19
  if (!scroll) {
29
20
  return (
30
- <Box bg="background" flex={1}>
31
- {content}
21
+ <Box bg="background" flex={1} minHeight={0} minWidth={0} testID={testID}>
22
+ {children}
23
+ {footer}
32
24
  </Box>
33
25
  );
34
26
  }
35
27
 
36
28
  return (
37
- <ScrollArea bg="background" style={{ flex: 1 }}>
38
- {content}
29
+ <ScrollArea bg="background" style={{ flex: 1, minHeight: 0, minWidth: 0 }}>
30
+ <Container maxWidth={resolvePageMaxWidth(width)} py="xl" testID={testID}>
31
+ <Stack gap="l">
32
+ {children}
33
+ {footer}
34
+ </Stack>
35
+ </Container>
39
36
  </ScrollArea>
40
37
  );
41
38
  }
42
39
 
43
- /***
44
- * Page-level container with standard background and optional scroll behavior.
40
+ /**
41
+ * Outer content boundary for one app screen.
45
42
  *
46
-
43
+ * By default Screen owns normal vertical scrolling. Set `scroll={false}` to preserve a bounded
44
+ * viewport and delegate scroll or gesture ownership to specialized children such as lists, maps,
45
+ * chats, canvases, or editors.
47
46
  */
48
47
  export const Screen = withZoraThemeScope(ScreenInner);