@ankhorage/zora 21.0.22 → 21.0.23
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 +9 -0
- package/README.md +36 -184
- package/dist/features/button/adapters/inbound/Button.d.ts +0 -4
- package/dist/features/button/adapters/inbound/Button.d.ts.map +1 -1
- package/dist/features/button/adapters/inbound/Button.js +0 -4
- package/dist/features/button/adapters/inbound/Button.js.map +1 -1
- package/dist/features/card/adapters/inbound/Card.d.ts +0 -4
- package/dist/features/card/adapters/inbound/Card.d.ts.map +1 -1
- package/dist/features/card/adapters/inbound/Card.js +0 -4
- package/dist/features/card/adapters/inbound/Card.js.map +1 -1
- package/dist/features/empty-state/adapters/inbound/EmptyState.d.ts +0 -4
- package/dist/features/empty-state/adapters/inbound/EmptyState.d.ts.map +1 -1
- package/dist/features/empty-state/adapters/inbound/EmptyState.js +0 -4
- package/dist/features/empty-state/adapters/inbound/EmptyState.js.map +1 -1
- package/dist/features/form/text-input/adapters/inbound/TextInput.d.ts +0 -4
- package/dist/features/form/text-input/adapters/inbound/TextInput.d.ts.map +1 -1
- package/dist/features/form/text-input/adapters/inbound/TextInput.js +0 -4
- package/dist/features/form/text-input/adapters/inbound/TextInput.js.map +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/GraphView.d.ts +5 -5
- package/dist/features/graph-view/adapters/inbound/web-artifact/GraphView.js +5 -5
- package/dist/features/graph-view/adapters/inbound/web-artifact/GraphView.js.map +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/compactGraphSpacing.d.ts +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/compactGraphSpacing.js +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/compactGraphSpacing.js.map +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/createGraphController.js +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/createGraphController.js.map +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/createGraphLoopSizer.d.ts +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/createGraphLoopSizer.js +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/createGraphLoopSizer.js.map +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/createGraphRuntime.js +7 -7
- package/dist/features/graph-view/adapters/inbound/web-artifact/createGraphRuntime.js.map +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/getGraphGeometryKey.d.ts +0 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/getGraphGeometryKey.d.ts.map +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/getGraphGeometryKey.js +0 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/getGraphGeometryKey.js.map +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/getGraphTopologyKey.d.ts +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/getGraphTopologyKey.js +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/getGraphTopologyKey.js.map +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/hasGraphLayoutChanged.d.ts +0 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/hasGraphLayoutChanged.d.ts.map +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/hasGraphLayoutChanged.js +0 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/hasGraphLayoutChanged.js.map +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/runDetachedGraphLayout.d.ts +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/runDetachedGraphLayout.js +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/runDetachedGraphLayout.js.map +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/sizeGraphNodesToLabels.d.ts +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/sizeGraphNodesToLabels.js +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/sizeGraphNodesToLabels.js.map +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/syncGraphElements.d.ts +0 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/syncGraphElements.d.ts.map +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/syncGraphElements.js +0 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/syncGraphElements.js.map +1 -1
- package/dist/features/tree-view/adapters/inbound/TreeView.d.ts +1 -1
- package/dist/features/tree-view/adapters/inbound/TreeView.js +1 -1
- package/dist/features/tree-view/adapters/inbound/TreeView.js.map +1 -1
- package/dist/features/tree-view/adapters/inbound/web-artifact/TreeView.d.ts +1 -1
- package/dist/features/tree-view/adapters/inbound/web-artifact/TreeView.js +1 -1
- package/dist/features/tree-view/adapters/inbound/web-artifact/TreeView.js.map +1 -1
- package/dist/features/typography/adapters/inbound/Heading.d.ts +0 -4
- package/dist/features/typography/adapters/inbound/Heading.d.ts.map +1 -1
- package/dist/features/typography/adapters/inbound/Heading.js +0 -4
- package/dist/features/typography/adapters/inbound/Heading.js.map +1 -1
- package/dist/features/typography/adapters/inbound/Text.d.ts +0 -4
- package/dist/features/typography/adapters/inbound/Text.d.ts.map +1 -1
- package/dist/features/typography/adapters/inbound/Text.js +0 -4
- package/dist/features/typography/adapters/inbound/Text.js.map +1 -1
- package/package.json +4 -7
- package/src/features/button/adapters/inbound/Button.tsx +0 -4
- package/src/features/card/adapters/inbound/Card.tsx +0 -4
- package/src/features/empty-state/adapters/inbound/EmptyState.tsx +0 -4
- package/src/features/form/text-input/adapters/inbound/TextInput.tsx +0 -4
- package/src/features/graph-view/adapters/inbound/web-artifact/GraphView.tsx +5 -5
- package/src/features/graph-view/adapters/inbound/web-artifact/compactGraphSpacing.ts +1 -1
- package/src/features/graph-view/adapters/inbound/web-artifact/createGraphController.ts +1 -1
- package/src/features/graph-view/adapters/inbound/web-artifact/createGraphLoopSizer.ts +1 -1
- package/src/features/graph-view/adapters/inbound/web-artifact/createGraphRuntime.ts +7 -7
- package/src/features/graph-view/adapters/inbound/web-artifact/getGraphGeometryKey.ts +0 -1
- package/src/features/graph-view/adapters/inbound/web-artifact/getGraphTopologyKey.ts +1 -1
- package/src/features/graph-view/adapters/inbound/web-artifact/hasGraphLayoutChanged.ts +0 -1
- package/src/features/graph-view/adapters/inbound/web-artifact/runDetachedGraphLayout.ts +1 -1
- package/src/features/graph-view/adapters/inbound/web-artifact/sizeGraphNodesToLabels.ts +1 -1
- package/src/features/graph-view/adapters/inbound/web-artifact/syncGraphElements.ts +0 -1
- package/src/features/tree-view/adapters/inbound/TreeView.tsx +1 -1
- package/src/features/tree-view/adapters/inbound/web-artifact/TreeView.tsx +1 -1
- package/src/features/typography/adapters/inbound/Heading.tsx +0 -4
- package/src/features/typography/adapters/inbound/Text.tsx +0 -4
- package/web-dist/components/graph-view/GraphView.d.ts +5 -5
- package/web-dist/components/tree-view/TreeView.d.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 21.0.23
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 112ecba: Align ZORA documentation sources with the canonical Paradox metadata policy so release-owned documentation can regenerate successfully.
|
|
8
|
+
- df60dff: Reuse the canonical portable-path conversion from @ankhorage/utility/node/path.
|
|
9
|
+
- d8157f4: Remove the ZORA-owned Next.js and Playwright acceptance dependencies so consumer frameworks remain downstream application ownership.
|
|
10
|
+
- ebd6f97: Update Ankhorage dependencies: `@ankhorage/paradox`, `@ankhorage/utility`.
|
|
11
|
+
|
|
3
12
|
## 21.0.22
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -3,47 +3,33 @@
|
|
|
3
3
|
|
|
4
4
|
# @ankhorage/zora
|
|
5
5
|
|
|
6
|
-
         
|
|
7
7
|
|
|
8
8
|
Opinionated React Native and React Native Web UI kit built on @ankhorage/surface.
|
|
9
9
|
|
|
10
10
|
## Usage
|
|
11
11
|
|
|
12
|
-
###
|
|
12
|
+
### CLI
|
|
13
|
+
|
|
14
|
+
Ankhorage packages expose their command-line interface through `ankh`. Use `ankh --help` to discover available package commands, or run a package command with `--help` for package-specific usage.
|
|
15
|
+
|
|
16
|
+
```zsh
|
|
17
|
+
# Install the Ankhorage CLI
|
|
18
|
+
bun add --global @ankhorage/ankh
|
|
19
|
+
|
|
20
|
+
# Show usage information for zora
|
|
21
|
+
ankh zora --help
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
### Basic App
|
|
25
|
+
|
|
26
|
+
ZORA app root with optional runtime capabilities and adaptive UI.
|
|
13
27
|
|
|
14
28
|
Enable only the runtime capabilities the app uses. `toast` installs the host consumed by
|
|
15
29
|
`useToast()`. `bottomSheet` installs the native BottomSheet host; DatePicker and TimePicker use
|
|
16
30
|
that host on native and automatically use Popover on web.
|
|
17
31
|
|
|
18
|
-
Source: `examples/basic-app/App.tsx`
|
|
19
|
-
|
|
20
32
|
```tsx
|
|
21
|
-
import {
|
|
22
|
-
AppBar,
|
|
23
|
-
AppShell,
|
|
24
|
-
BottomSheet,
|
|
25
|
-
Button,
|
|
26
|
-
DatePicker,
|
|
27
|
-
Screen,
|
|
28
|
-
ScreenSection,
|
|
29
|
-
Text,
|
|
30
|
-
TimePicker,
|
|
31
|
-
useToast,
|
|
32
|
-
View,
|
|
33
|
-
ZoraProvider,
|
|
34
|
-
type ZoraTheme,
|
|
35
|
-
} from '@ankhorage/zora';
|
|
36
|
-
import React from 'react';
|
|
37
|
-
import { GestureHandlerRootView } from 'react-native-gesture-handler';
|
|
38
|
-
|
|
39
|
-
const basicTheme: ZoraTheme = {
|
|
40
|
-
id: 'basic-app',
|
|
41
|
-
name: 'Basic app',
|
|
42
|
-
appCategory: 'developer_tools',
|
|
43
|
-
primaryColor: '#0b6e99',
|
|
44
|
-
harmony: 'analogous',
|
|
45
|
-
};
|
|
46
|
-
|
|
47
33
|
export default function BasicApp() {
|
|
48
34
|
return (
|
|
49
35
|
<GestureHandlerRootView style={{ flex: 1 }}>
|
|
@@ -64,169 +50,35 @@ export default function BasicApp() {
|
|
|
64
50
|
</GestureHandlerRootView>
|
|
65
51
|
);
|
|
66
52
|
}
|
|
67
|
-
|
|
68
|
-
/*** Demonstrates toast feedback and adaptive picker presentation. */
|
|
69
|
-
function UsageContent() {
|
|
70
|
-
const { showToast } = useToast();
|
|
71
|
-
const [date, setDate] = React.useState<string | null>(null);
|
|
72
|
-
const [time, setTime] = React.useState<string | null>(null);
|
|
73
|
-
|
|
74
|
-
return (
|
|
75
|
-
<View gap="m">
|
|
76
|
-
<Text variant="lead">Runtime capabilities are opt-in at the app root.</Text>
|
|
77
|
-
<Button
|
|
78
|
-
onPress={() =>
|
|
79
|
-
showToast({
|
|
80
|
-
description: 'ToastProvider is installed by ZoraProvider.',
|
|
81
|
-
status: 'success',
|
|
82
|
-
title: 'Saved',
|
|
83
|
-
})
|
|
84
|
-
}
|
|
85
|
-
>
|
|
86
|
-
Show toast
|
|
87
|
-
</Button>
|
|
88
|
-
<DatePicker label="Date" onValueChange={setDate} value={date} />
|
|
89
|
-
<TimePicker label="Time" onValueChange={setTime} value={time} />
|
|
90
|
-
</View>
|
|
91
|
-
);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
/***
|
|
95
|
-
* Direct native BottomSheet usage.
|
|
96
|
-
*
|
|
97
|
-
* Render this inside `<ZoraProvider bottomSheet>` on native. Web pickers do not need this host;
|
|
98
|
-
* their platform adapters use Popover instead.
|
|
99
|
-
*
|
|
100
|
-
* @usage
|
|
101
|
-
* @readme
|
|
102
|
-
*/
|
|
103
|
-
export function NativeBottomSheetExample() {
|
|
104
|
-
const [open, setOpen] = React.useState(false);
|
|
105
|
-
|
|
106
|
-
return (
|
|
107
|
-
<View gap="m">
|
|
108
|
-
<Button onPress={() => setOpen(true)}>Open native bottom sheet</Button>
|
|
109
|
-
<BottomSheet onDismiss={() => setOpen(false)} open={open}>
|
|
110
|
-
<View gap="s" p="m">
|
|
111
|
-
<Text variant="label">Bottom sheet content</Text>
|
|
112
|
-
<Button onPress={() => setOpen(false)} variant="ghost">
|
|
113
|
-
Close
|
|
114
|
-
</Button>
|
|
115
|
-
</View>
|
|
116
|
-
</BottomSheet>
|
|
117
|
-
</View>
|
|
118
|
-
);
|
|
119
|
-
}
|
|
120
53
|
```
|
|
121
54
|
|
|
122
|
-
|
|
55
|
+
This package contains 4 additional examples. See the generated documentation for the complete set.
|
|
123
56
|
|
|
124
|
-
|
|
125
|
-
their platform adapters use Popover instead.
|
|
57
|
+
## Configuration
|
|
126
58
|
|
|
127
|
-
|
|
59
|
+
### Example
|
|
128
60
|
|
|
129
|
-
```
|
|
130
|
-
import {
|
|
131
|
-
AppBar,
|
|
132
|
-
AppShell,
|
|
133
|
-
BottomSheet,
|
|
134
|
-
Button,
|
|
135
|
-
DatePicker,
|
|
136
|
-
Screen,
|
|
137
|
-
ScreenSection,
|
|
138
|
-
Text,
|
|
139
|
-
TimePicker,
|
|
140
|
-
useToast,
|
|
141
|
-
View,
|
|
142
|
-
ZoraProvider,
|
|
143
|
-
type ZoraTheme,
|
|
144
|
-
} from '@ankhorage/zora';
|
|
145
|
-
import React from 'react';
|
|
146
|
-
import { GestureHandlerRootView } from 'react-native-gesture-handler';
|
|
147
|
-
|
|
148
|
-
const basicTheme: ZoraTheme = {
|
|
149
|
-
id: 'basic-app',
|
|
150
|
-
name: 'Basic app',
|
|
151
|
-
appCategory: 'developer_tools',
|
|
152
|
-
primaryColor: '#0b6e99',
|
|
153
|
-
harmony: 'analogous',
|
|
154
|
-
};
|
|
155
|
-
|
|
156
|
-
/***
|
|
157
|
-
* ZORA app root with optional runtime capabilities and adaptive UI.
|
|
158
|
-
*
|
|
159
|
-
* Enable only the runtime capabilities the app uses. `toast` installs the host consumed by
|
|
160
|
-
* `useToast()`. `bottomSheet` installs the native BottomSheet host; DatePicker and TimePicker use
|
|
161
|
-
* that host on native and automatically use Popover on web.
|
|
162
|
-
*
|
|
163
|
-
* @usage
|
|
164
|
-
* @readme
|
|
165
|
-
*/
|
|
166
|
-
export default function BasicApp() {
|
|
167
|
-
return (
|
|
168
|
-
<GestureHandlerRootView style={{ flex: 1 }}>
|
|
169
|
-
<ZoraProvider
|
|
170
|
-
bottomSheet
|
|
171
|
-
initialMode="light"
|
|
172
|
-
theme={basicTheme}
|
|
173
|
-
toast={{ defaultDuration: 4000 }}
|
|
174
|
-
>
|
|
175
|
-
<AppShell header={<AppBar title="Dashboard" subtitle="Welcome to ZORA" />}>
|
|
176
|
-
<Screen>
|
|
177
|
-
<ScreenSection>
|
|
178
|
-
<UsageContent />
|
|
179
|
-
</ScreenSection>
|
|
180
|
-
</Screen>
|
|
181
|
-
</AppShell>
|
|
182
|
-
</ZoraProvider>
|
|
183
|
-
</GestureHandlerRootView>
|
|
184
|
-
);
|
|
185
|
-
}
|
|
61
|
+
```ts
|
|
62
|
+
import { defineParadoxConfig } from '@ankhorage/paradox';
|
|
186
63
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
const { showToast } = useToast();
|
|
190
|
-
const [date, setDate] = React.useState<string | null>(null);
|
|
191
|
-
const [time, setTime] = React.useState<string | null>(null);
|
|
64
|
+
export default defineParadoxConfig({
|
|
65
|
+
mode: 'write',
|
|
192
66
|
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
showToast({
|
|
199
|
-
description: 'ToastProvider is installed by ZoraProvider.',
|
|
200
|
-
status: 'success',
|
|
201
|
-
title: 'Saved',
|
|
202
|
-
})
|
|
203
|
-
}
|
|
204
|
-
>
|
|
205
|
-
Show toast
|
|
206
|
-
</Button>
|
|
207
|
-
<DatePicker label="Date" onValueChange={setDate} value={date} />
|
|
208
|
-
<TimePicker label="Time" onValueChange={setTime} value={time} />
|
|
209
|
-
</View>
|
|
210
|
-
);
|
|
211
|
-
}
|
|
67
|
+
docs: {
|
|
68
|
+
usage: {
|
|
69
|
+
entrypoints: ['examples/basic-app/App.tsx'],
|
|
70
|
+
},
|
|
71
|
+
},
|
|
212
72
|
|
|
213
|
-
|
|
214
|
-
|
|
73
|
+
package: {
|
|
74
|
+
root: '.',
|
|
75
|
+
entrypoints: ['src/index.ts'],
|
|
76
|
+
},
|
|
215
77
|
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
<View gap="s" p="m">
|
|
221
|
-
<Text variant="label">Bottom sheet content</Text>
|
|
222
|
-
<Button onPress={() => setOpen(false)} variant="ghost">
|
|
223
|
-
Close
|
|
224
|
-
</Button>
|
|
225
|
-
</View>
|
|
226
|
-
</BottomSheet>
|
|
227
|
-
</View>
|
|
228
|
-
);
|
|
229
|
-
}
|
|
78
|
+
output: {
|
|
79
|
+
dir: './paradox',
|
|
80
|
+
},
|
|
81
|
+
});
|
|
230
82
|
```
|
|
231
83
|
|
|
232
84
|
## Generated documentation
|
|
@@ -6,10 +6,6 @@ import type { ButtonProps } from '../../../../types/button';
|
|
|
6
6
|
* Use `Button` for explicit user actions that should follow ZORA's semantic color,
|
|
7
7
|
* variant, and size recipes across React Native and React Native Web.
|
|
8
8
|
*
|
|
9
|
-
* @example Basic action
|
|
10
|
-
* ```tsx
|
|
11
|
-
* <Button color="primary" variant="solid" onPress={save}>Save</Button>
|
|
12
|
-
* ```
|
|
13
9
|
*/
|
|
14
10
|
export declare const Button: (props: ButtonProps) => React.ReactElement | null;
|
|
15
11
|
//# sourceMappingURL=Button.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../../../src/features/button/adapters/inbound/Button.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAI5D
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../../../src/features/button/adapters/inbound/Button.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAI5D;;;;;;GAMG;AACH,eAAO,MAAM,MAAM,mDAAkC,CAAC"}
|
|
@@ -9,10 +9,6 @@ import { resolveButtonThemeRecipe } from '../../utils/resolveButtonThemeRecipe';
|
|
|
9
9
|
* Use `Button` for explicit user actions that should follow ZORA's semantic color,
|
|
10
10
|
* variant, and size recipes across React Native and React Native Web.
|
|
11
11
|
*
|
|
12
|
-
* @example Basic action
|
|
13
|
-
* ```tsx
|
|
14
|
-
* <Button color="primary" variant="solid" onPress={save}>Save</Button>
|
|
15
|
-
* ```
|
|
16
12
|
*/
|
|
17
13
|
export const Button = withZoraThemeScope(ButtonInner);
|
|
18
14
|
function ButtonInner({ themeId: _themeId, mode: _mode, color, variant, size, interactionPolicy, ...props }) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../../../src/features/button/adapters/inbound/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,oDAAoD,CAAC;AACxF,OAAO,EAAE,kBAAkB,EAAE,MAAM,+CAA+C,CAAC;AACnF,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAChF
|
|
1
|
+
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../../../src/features/button/adapters/inbound/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,oDAAoD,CAAC;AACxF,OAAO,EAAE,kBAAkB,EAAE,MAAM,+CAA+C,CAAC;AACnF,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAChF;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,kBAAkB,CAAC,WAAW,CAAC,CAAC;AAEtD,SAAS,WAAW,CAAC,EACnB,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAE,KAAK,EACX,KAAK,EACL,OAAO,EACP,IAAI,EACJ,iBAAiB,EACjB,GAAG,KAAK,EACI;IACZ,MAAM,WAAW,GAAG,kBAAkB,CAAC,QAAQ,CAAC,CAAC;IACjD,MAAM,MAAM,GAAG,wBAAwB,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,CAAC;IAE/E,OAAO,CACL,CAAC,aAAa,CACZ,IAAI,KAAK,CAAC,CACV,KAAK,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CACpB,IAAI,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAClB,OAAO,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CACxB,iBAAiB,CAAC,CAAC,iBAAiB,CAAC,EACrC,CACH,CAAC;AACJ,CAAC","sourcesContent":["import { Button as SurfaceButton } from '@ankhorage/surface';\nimport React from 'react';\n\nimport type { ButtonProps } from '../../../../types/button';\nimport { withZoraThemeScope } from '../../../theme/adapters/inbound/withZoraThemeScope';\nimport { useZoraThemeRecipe } from '../../../theme/composition/useZoraThemeRecipe';\nimport { resolveButtonThemeRecipe } from '../../utils/resolveButtonThemeRecipe';\n/***\n * Theme-aware action control for primary, secondary, destructive, and neutral actions.\n *\n * Use `Button` for explicit user actions that should follow ZORA's semantic color,\n * variant, and size recipes across React Native and React Native Web.\n *\n */\nexport const Button = withZoraThemeScope(ButtonInner);\n\nfunction ButtonInner({\n themeId: _themeId,\n mode: _mode,\n color,\n variant,\n size,\n interactionPolicy,\n ...props\n}: ButtonProps) {\n const themeFields = useZoraThemeRecipe('Button');\n const recipe = resolveButtonThemeRecipe({ color, variant, size, themeFields });\n\n return (\n <SurfaceButton\n {...props}\n color={recipe.color}\n size={recipe.size}\n variant={recipe.variant}\n interactionPolicy={interactionPolicy}\n />\n );\n}\n"]}
|
|
@@ -6,10 +6,6 @@ import type { CardProps } from '../../../../types/card';
|
|
|
6
6
|
* Use `Card` for reusable content blocks that should inherit ZORA spacing,
|
|
7
7
|
* radius, tone, and responsive header layout without hand-assembling primitives.
|
|
8
8
|
*
|
|
9
|
-
* @example Content card
|
|
10
|
-
* ```tsx
|
|
11
|
-
* <Card title="Project" description="Latest activity">...</Card>
|
|
12
|
-
* ```
|
|
13
9
|
*/
|
|
14
10
|
export declare const Card: (props: CardProps) => React.ReactElement | null;
|
|
15
11
|
//# sourceMappingURL=Card.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Card.d.ts","sourceRoot":"","sources":["../../../../../src/features/card/adapters/inbound/Card.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAQxD
|
|
1
|
+
{"version":3,"file":"Card.d.ts","sourceRoot":"","sources":["../../../../../src/features/card/adapters/inbound/Card.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAQxD;;;;;;GAMG;AACH,eAAO,MAAM,IAAI,iDAAgC,CAAC"}
|
|
@@ -13,10 +13,6 @@ import { resolveCardVariant } from '../../utils/resolveCardVariant';
|
|
|
13
13
|
* Use `Card` for reusable content blocks that should inherit ZORA spacing,
|
|
14
14
|
* radius, tone, and responsive header layout without hand-assembling primitives.
|
|
15
15
|
*
|
|
16
|
-
* @example Content card
|
|
17
|
-
* ```tsx
|
|
18
|
-
* <Card title="Project" description="Latest activity">...</Card>
|
|
19
|
-
* ```
|
|
20
16
|
*/
|
|
21
17
|
export const Card = withZoraThemeScope(CardInner);
|
|
22
18
|
function CardInner({ themeId: _themeId, mode: _mode, children, title, description, eyebrow, actions, footer, tone, compact, padding, radius, onPress, interactionPolicy, ...props }) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Card.js","sourceRoot":"","sources":["../../../../../src/features/card/adapters/inbound/Card.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,IAAI,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,oDAAoD,CAAC;AACxF,OAAO,EAAE,kBAAkB,EAAE,MAAM,+CAA+C,CAAC;AACnF,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAClD,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE
|
|
1
|
+
{"version":3,"file":"Card.js","sourceRoot":"","sources":["../../../../../src/features/card/adapters/inbound/Card.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,IAAI,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,oDAAoD,CAAC;AACxF,OAAO,EAAE,kBAAkB,EAAE,MAAM,+CAA+C,CAAC;AACnF,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAClD,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAAE,kBAAkB,EAAE,MAAM,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AAE,IAAI,CACN;YAAA,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAC1C;UAAA,EAAE,IAAI,CAAC,CACR,CAAC,CAAC,CAAC,IAAI,CAER;;QAAA,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAE1C;;QAAA,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CACnD;MAAA,EAAE,IAAI,CACR;IAAA,EAAE,WAAW,CAAC,CACf,CAAC;AACJ,CAAC","sourcesContent":["import { Card as SurfaceCard } from '@ankhorage/surface';\nimport React from 'react';\n\nimport type { CardProps } from '../../../../types/card';\nimport { View } from '../../../layout/public';\nimport { withZoraThemeScope } from '../../../theme/adapters/inbound/withZoraThemeScope';\nimport { useZoraThemeRecipe } from '../../../theme/composition/useZoraThemeRecipe';\nimport { Heading } from '../../../typography/public';\nimport { Text } from '../../../typography/public';\nimport { resolveCardThemeRecipe } from '../../utils/resolveCardThemeRecipe';\nimport { resolveCardVariant } from '../../utils/resolveCardVariant';\n/***\n * Structured content container with built-in heading, description, actions, and footer slots.\n *\n * Use `Card` for reusable content blocks that should inherit ZORA spacing,\n * radius, tone, and responsive header layout without hand-assembling primitives.\n *\n */\nexport const Card = withZoraThemeScope(CardInner);\n\nfunction CardInner({\n themeId: _themeId,\n mode: _mode,\n children,\n title,\n description,\n eyebrow,\n actions,\n footer,\n tone,\n compact,\n padding,\n radius,\n onPress,\n interactionPolicy,\n ...props\n}: CardProps) {\n const themeFields = useZoraThemeRecipe('Card');\n const recipe = resolveCardThemeRecipe({ tone, compact, padding, radius, themeFields });\n const hasHeader = [eyebrow, title, description, actions].some((item) => item != null);\n const hasFooter = footer !== undefined;\n const gap = recipe.compact ? 's' : 'm';\n const isInteractive = Boolean(onPress) && !actions;\n const passive = interactionPolicy === 'passive';\n\n return (\n <SurfaceCard\n {...props}\n onPress={isInteractive && !passive ? onPress : undefined}\n p={recipe.padding}\n radius={recipe.radius}\n variant={resolveCardVariant(recipe.tone)}\n >\n <View gap={gap}>\n {hasHeader ? (\n <View\n align={{ base: 'flex-start', md: 'center' }}\n direction={{ base: 'column', md: 'row' }}\n gap=\"m\"\n justify=\"space-between\"\n >\n <View flex={{ md: 1 }} width={{ base: '100%', md: 'auto' }}>\n <View gap=\"xs\">\n {eyebrow ? (\n <Text emphasis=\"muted\" variant=\"caption\" weight=\"semiBold\">\n {eyebrow}\n </Text>\n ) : null}\n {title ? <Heading level={recipe.compact ? 4 : 3}>{title}</Heading> : null}\n {description ? (\n <Text emphasis=\"muted\" variant=\"bodySmall\">\n {description}\n </Text>\n ) : null}\n </View>\n </View>\n {actions ? <View>{actions}</View> : null}\n </View>\n ) : null}\n\n {children ? <View>{children}</View> : null}\n\n {hasFooter ? <View pt=\"xs\">{footer}</View> : null}\n </View>\n </SurfaceCard>\n );\n}\n"]}
|
|
@@ -7,10 +7,6 @@ import type { EmptyStateProps } from '../../../../types/empty-state';
|
|
|
7
7
|
* so apps can guide users without custom card and button wiring.
|
|
8
8
|
*
|
|
9
9
|
|
|
10
|
-
* @example Empty project list
|
|
11
|
-
* ```tsx
|
|
12
|
-
* <EmptyState title="No projects yet" primaryAction={{ label: 'Create project', onPress }} />
|
|
13
|
-
* ```
|
|
14
10
|
*/
|
|
15
11
|
export declare const EmptyState: (props: EmptyStateProps) => React.ReactElement | null;
|
|
16
12
|
//# sourceMappingURL=EmptyState.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmptyState.d.ts","sourceRoot":"","sources":["../../../../../src/features/empty-state/adapters/inbound/EmptyState.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AA2DrE
|
|
1
|
+
{"version":3,"file":"EmptyState.d.ts","sourceRoot":"","sources":["../../../../../src/features/empty-state/adapters/inbound/EmptyState.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AA2DrE;;;;;;;GAOG;AACH,eAAO,MAAM,UAAU,uDAAsC,CAAC"}
|
|
@@ -25,10 +25,6 @@ function EmptyStateInner({ themeId: _themeId, mode: _mode, interactionPolicy, ti
|
|
|
25
25
|
* so apps can guide users without custom card and button wiring.
|
|
26
26
|
*
|
|
27
27
|
|
|
28
|
-
* @example Empty project list
|
|
29
|
-
* ```tsx
|
|
30
|
-
* <EmptyState title="No projects yet" primaryAction={{ label: 'Create project', onPress }} />
|
|
31
|
-
* ```
|
|
32
28
|
*/
|
|
33
29
|
export const EmptyState = withZoraThemeScope(EmptyStateInner);
|
|
34
30
|
//# sourceMappingURL=EmptyState.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmptyState.js","sourceRoot":"","sources":["../../../../../src/features/empty-state/adapters/inbound/EmptyState.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,oDAAoD,CAAC;AAExF,SAAS,eAAe,CAAC,EACvB,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAE,KAAK,EACX,iBAAiB,EACjB,KAAK,EACL,WAAW,EACX,OAAO,EACP,aAAa,EACb,eAAe,EACf,MAAM,EACN,MAAM,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C,CAAC,IAAI,CACR;QAAA,CAAC,MAAM,CACT;MAAA,EAAE,IAAI,CACR;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC;AAED
|
|
1
|
+
{"version":3,"file":"EmptyState.js","sourceRoot":"","sources":["../../../../../src/features/empty-state/adapters/inbound/EmptyState.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,oDAAoD,CAAC;AAExF,SAAS,eAAe,CAAC,EACvB,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAE,KAAK,EACX,iBAAiB,EACjB,KAAK,EACL,WAAW,EACX,OAAO,EACP,aAAa,EACb,eAAe,EACf,MAAM,EACN,MAAM,GACU;IAChB,OAAO,CACL,CAAC,IAAI,CACH,OAAO,CACP,WAAW,CAAC,CAAC,WAAW,CAAC,CACzB,OAAO,CAAC,CAAC,OAAO,CAAC,CACjB,iBAAiB,CAAC,CAAC,iBAAiB,CAAC,CACrC,MAAM,CAAC,CAAC,MAAM,CAAC,CACf,KAAK,CAAC,CAAC,KAAK,CAAC,CACb,IAAI,CAAC,QAAQ,CAEb;MAAA,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CACX;QAAA,CAAC,aAAa,IAAI,eAAe,CAAC,CAAC,CAAC,CAClC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,GAAG,CAAC,GAAG,CACrD;YAAA,CAAC,aAAa,CAAC,CAAC,CAAC,CACf,CAAC,MAAM,CACL,iBAAiB,CAAC,CAAC,iBAAiB,CAAC,CACrC,OAAO,CAAC,CAAC,aAAa,CAAC,OAAO,CAAC,CAC/B,OAAO,CAAC,CAAC,aAAa,CAAC,OAAO,CAAC,CAC/B,KAAK,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,CAE3B;gBAAA,CAAC,aAAa,CAAC,KAAK,CACtB;cAAA,EAAE,MAAM,CAAC,CACV,CAAC,CAAC,CAAC,IAAI,CACR;YAAA,CAAC,eAAe,CAAC,CAAC,CAAC,CACjB,CAAC,MAAM,CACL,iBAAiB,CAAC,CAAC,iBAAiB,CAAC,CACrC,OAAO,CAAC,CAAC,eAAe,CAAC,OAAO,IAAI,MAAM,CAAC,CAC3C,OAAO,CAAC,CAAC,eAAe,CAAC,OAAO,CAAC,CACjC,KAAK,CAAC,CAAC,eAAe,CAAC,KAAK,IAAI,SAAS,CAAC,CAE1C;gBAAA,CAAC,eAAe,CAAC,KAAK,CACxB;cAAA,EAAE,MAAM,CAAC,CACV,CAAC,CAAC,CAAC,IAAI,CACV;UAAA,EAAE,IAAI,CAAC,CACR,CAAC,CAAC,CAAC,IAAI,CACR;QAAA,CAAC,MAAM,CACT;MAAA,EAAE,IAAI,CACR;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,kBAAkB,CAAC,eAAe,CAAC,CAAC","sourcesContent":["import React from 'react';\n\nimport type { EmptyStateProps } from '../../../../types/empty-state';\nimport { Button } from '../../../button/public';\nimport { Card } from '../../../card/public';\nimport { View } from '../../../layout/public';\nimport { withZoraThemeScope } from '../../../theme/adapters/inbound/withZoraThemeScope';\n\nfunction EmptyStateInner({\n themeId: _themeId,\n mode: _mode,\n interactionPolicy,\n title,\n description,\n eyebrow,\n primaryAction,\n secondaryAction,\n footer,\n testID,\n}: EmptyStateProps) {\n return (\n <Card\n compact\n description={description}\n eyebrow={eyebrow}\n interactionPolicy={interactionPolicy}\n testID={testID}\n title={title}\n tone=\"subtle\"\n >\n <View gap=\"m\">\n {primaryAction || secondaryAction ? (\n <View direction={{ base: 'column', md: 'row' }} gap=\"s\">\n {primaryAction ? (\n <Button\n interactionPolicy={interactionPolicy}\n variant={primaryAction.variant}\n onPress={primaryAction.onPress}\n color={primaryAction.color}\n >\n {primaryAction.label}\n </Button>\n ) : null}\n {secondaryAction ? (\n <Button\n interactionPolicy={interactionPolicy}\n variant={secondaryAction.variant ?? 'soft'}\n onPress={secondaryAction.onPress}\n color={secondaryAction.color ?? 'neutral'}\n >\n {secondaryAction.label}\n </Button>\n ) : null}\n </View>\n ) : null}\n {footer}\n </View>\n </Card>\n );\n}\n\n/***\n * Reusable fallback state for empty lists, missing data, or first-run experiences.\n *\n * `EmptyState` combines concise copy with optional primary and secondary actions\n * so apps can guide users without custom card and button wiring.\n *\n \n */\nexport const EmptyState = withZoraThemeScope(EmptyStateInner);\n"]}
|
|
@@ -5,10 +5,6 @@ import type { TextInputProps } from '../../../../../types/text-input';
|
|
|
5
5
|
*
|
|
6
6
|
* Use `TextInput` for single-line, multiline, and password form controls with ZORA styling.
|
|
7
7
|
*
|
|
8
|
-
* @example Search input
|
|
9
|
-
* ```tsx
|
|
10
|
-
* <TextInput placeholder="Search" leadingIcon={{ name: 'search-outline' }} />
|
|
11
|
-
* ```
|
|
12
8
|
*/
|
|
13
9
|
export declare const TextInput: (props: TextInputProps) => React.ReactElement | null;
|
|
14
10
|
//# sourceMappingURL=TextInput.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextInput.d.ts","sourceRoot":"","sources":["../../../../../../src/features/form/text-input/adapters/inbound/TextInput.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAoDtE
|
|
1
|
+
{"version":3,"file":"TextInput.d.ts","sourceRoot":"","sources":["../../../../../../src/features/form/text-input/adapters/inbound/TextInput.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAoDtE;;;;;GAKG;AACH,eAAO,MAAM,SAAS,sDAAqC,CAAC"}
|
|
@@ -15,10 +15,6 @@ function TextInputInner({ themeId: _themeId, mode: _mode, size = 'l', leadingIco
|
|
|
15
15
|
*
|
|
16
16
|
* Use `TextInput` for single-line, multiline, and password form controls with ZORA styling.
|
|
17
17
|
*
|
|
18
|
-
* @example Search input
|
|
19
|
-
* ```tsx
|
|
20
|
-
* <TextInput placeholder="Search" leadingIcon={{ name: 'search-outline' }} />
|
|
21
|
-
* ```
|
|
22
18
|
*/
|
|
23
19
|
export const TextInput = withZoraThemeScope(TextInputInner);
|
|
24
20
|
//# sourceMappingURL=TextInput.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextInput.js","sourceRoot":"","sources":["../../../../../../src/features/form/text-input/adapters/inbound/TextInput.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,IAAI,WAAW,EAAE,SAAS,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACxF,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAC;AACzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,uDAAuD,CAAC;AAC3F,OAAO,EAAE,YAAY,EAAE,MAAM,4CAA4C,CAAC;AAE1E,SAAS,cAAc,CAAC,EACtB,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAE,KAAK,EACX,IAAI,GAAG,GAAG,EACV,WAAW,EACX,YAAY,EACZ,cAAc,EACd,QAAQ,EACR,QAAQ,EACR,iBAAiB,EACjB,GAAG,KAAK,EACO;IACf,MAAM,EAAE,KAAK,EAAE,GAAG,YAAY,EAAE,CAAC;IACjC,MAAM,QAAQ,GAAG,eAAe,CAAC,IAAI,CA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CAAC,cAAc,CAAC,IAAI,CAAC,CAC1B,iBAAiB,CAAC,CAAC,iBAAiB,CAAC,CACrC,KAAK,CAAC,CAAC,cAAc,CAAC,KAAK,CAAC,CAC5B,QAAQ,CAAC,CAAC,QAAQ,IAAI,QAAQ,CAAC,CAC/B,OAAO,CAAC,OAAO,CACf,IAAI,CAAC,CAAC,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAChC,KAAK,CAAC,SAAS,CACf,OAAO,CAAC,CAAC,cAAc,CAAC,OAAO,CAAC,EAChC,CACH,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CACjB,CAAC,WAAW,CAAC,IAAI,YAAY,CAAC,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,EAAG,CACpE,CAAC,CAAC,CAAC,SACN,CAAC,EACD,CACH,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,kBAAkB,CAAC,cAAc,CAAC,CAAC","sourcesContent":["import { Icon as SurfaceIcon, TextInput as SurfaceTextInput } from '@ankhorage/surface';\nimport React from 'react';\n\nimport type { TextInputProps } from '../../../../../types/text-input';\nimport { IconButton } from '../../../../button/public';\nimport { resolveIconSize } from '../../../../icon/utils/resolveIconSize';\nimport { withZoraThemeScope } from '../../../../theme/adapters/inbound/withZoraThemeScope';\nimport { useZoraTheme } from '../../../../theme/composition/useZoraTheme';\n\nfunction TextInputInner({\n themeId: _themeId,\n mode: _mode,\n size = 'l',\n leadingIcon,\n trailingIcon,\n trailingAction,\n disabled,\n readOnly,\n interactionPolicy,\n ...props\n}: TextInputProps) {\n const { theme } = useZoraTheme();\n const iconSize = resolveIconSize(size);\n const iconColor = theme.semantics.content.muted;\n\n return (\n <SurfaceTextInput\n {...props}\n disabled={disabled}\n interactionPolicy={interactionPolicy}\n leadingAccessory={\n leadingIcon ? <SurfaceIcon {...leadingIcon} color={iconColor} size={iconSize} /> : undefined\n }\n readOnly={readOnly}\n size={size}\n trailingAccessory={\n trailingAction ? (\n <IconButton\n icon={trailingAction.icon}\n interactionPolicy={interactionPolicy}\n label={trailingAction.label}\n disabled={disabled ?? readOnly}\n variant=\"ghost\"\n size={size === 'l' ? 'm' : size}\n color=\"neutral\"\n onPress={trailingAction.onPress}\n />\n ) : trailingIcon ? (\n <SurfaceIcon {...trailingIcon} color={iconColor} size={iconSize} />\n ) : undefined\n }\n />\n );\n}\n\n/***\n * Theme-aware text input with semantic sizing and optional leading/trailing icon slots.\n *\n * Use `TextInput` for single-line, multiline, and password form controls with ZORA styling.\n *\n */\nexport const TextInput = withZoraThemeScope(TextInputInner);\n"]}
|
|
@@ -97,13 +97,13 @@ export interface GraphViewProps {
|
|
|
97
97
|
export type GraphViewCallbacks = Pick<GraphViewProps, 'onEdgeEvent' | 'onLayoutComplete' | 'onNodeEvent' | 'onReady' | 'onViewportChange' | 'onSpacingFactorChange'>;
|
|
98
98
|
/***
|
|
99
99
|
* Render a browser graph while one runtime owns Cytoscape layout, viewport, and disposal.
|
|
100
|
-
*
|
|
100
|
+
* zoomMode Use `fit-relative` to make controller zoom, events and min/max limits relative
|
|
101
101
|
* to the visible-node fit (1 = fit). The default `absolute` keeps engine-space zoom units.
|
|
102
|
-
*
|
|
102
|
+
* sizeNodesToLabels Opt in to renderer-measured plain labels, including bold and Unicode
|
|
103
103
|
* text. Keep padding in styleRules. Compound and rich-node dimensions retain their existing owners.
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
*
|
|
104
|
+
* minReadableLabelSize Expand the manual zoom ceiling until plain labels reach this CSS-pixel size.
|
|
105
|
+
* maxFitLabelSize Cap automatic fitting at this plain-label CSS-pixel size, leaving whitespace for tiny graphs.
|
|
106
|
+
* onSpacingFactorChange Receive the spacing accepted by explicit fit({ optimizeSpacing: true }).
|
|
107
107
|
* Ordinary zoom never adjusts spacing or relayouts. Explicit optimization preserves layout ordering
|
|
108
108
|
* and uses bounded collision checks including labels and compound siblings; it can recover uniformly
|
|
109
109
|
* cramped layouts but cannot repair non-uniform overlaps.
|
|
@@ -3,13 +3,13 @@ import { createGraphRuntime } from './createGraphRuntime';
|
|
|
3
3
|
import { GraphNodeOverlay } from './GraphNodeOverlay';
|
|
4
4
|
/***
|
|
5
5
|
* Render a browser graph while one runtime owns Cytoscape layout, viewport, and disposal.
|
|
6
|
-
*
|
|
6
|
+
* zoomMode Use `fit-relative` to make controller zoom, events and min/max limits relative
|
|
7
7
|
* to the visible-node fit (1 = fit). The default `absolute` keeps engine-space zoom units.
|
|
8
|
-
*
|
|
8
|
+
* sizeNodesToLabels Opt in to renderer-measured plain labels, including bold and Unicode
|
|
9
9
|
* text. Keep padding in styleRules. Compound and rich-node dimensions retain their existing owners.
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
10
|
+
* minReadableLabelSize Expand the manual zoom ceiling until plain labels reach this CSS-pixel size.
|
|
11
|
+
* maxFitLabelSize Cap automatic fitting at this plain-label CSS-pixel size, leaving whitespace for tiny graphs.
|
|
12
|
+
* onSpacingFactorChange Receive the spacing accepted by explicit fit({ optimizeSpacing: true }).
|
|
13
13
|
* Ordinary zoom never adjusts spacing or relayouts. Explicit optimization preserves layout ordering
|
|
14
14
|
* and uses bounded collision checks including labels and compound siblings; it can recover uniformly
|
|
15
15
|
* cramped layouts but cannot repair non-uniform overlaps.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GraphView.js","sourceRoot":"","sources":["../../../../../../src/features/graph-view/adapters/inbound/web-artifact/GraphView.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,kBAAkB,EAAqB,MAAM,sBAAsB,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAwHtD;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,SAAS,CAAC,KAA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U,CAAC,CAAC,CAAC;AACvC,CAAC;AAED,uEAAuE;AACvE,SAAS,aAAa,CAAC,KAAqB;IAC1C,OAAO;QACL,WAAW,EAAE,KAAK,CAAC,WAAW;QAC9B,gBAAgB,EAAE,KAAK,CAAC,gBAAgB;QACxC,WAAW,EAAE,KAAK,CAAC,WAAW;QAC9B,OAAO,EAAE,KAAK,CAAC,OAAO;QACtB,gBAAgB,EAAE,KAAK,CAAC,gBAAgB;QACxC,qBAAqB,EAAE,KAAK,CAAC,qBAAqB;KACnD,CAAC;AACJ,CAAC","sourcesContent":["import type { CytoscapeOptions } from 'cytoscape';\nimport React from 'react';\n\nimport { createGraphRuntime, type GraphRuntime } from './createGraphRuntime';\nimport { GraphNodeOverlay } from './GraphNodeOverlay';\n\nexport type GraphViewLayoutName = 'breadthfirst' | 'circle' | 'concentric' | 'elk' | 'grid';\nexport type GraphViewElementEventType =\n 'press' | 'double-press' | 'select' | 'unselect' | 'pointer-enter' | 'pointer-leave';\n\nexport interface GraphViewNode {\n readonly id: string;\n readonly label?: string;\n readonly parentId?: string;\n readonly classes?: string;\n readonly data?: Readonly<Record<string, unknown>>;\n}\n\nexport interface GraphViewEdge {\n readonly id?: string;\n readonly source: string;\n readonly target: string;\n readonly classes?: string;\n readonly data?: Readonly<Record<string, unknown>>;\n}\n\nexport interface GraphViewStyleRule {\n readonly selector: string;\n readonly style: Readonly<Record<string, unknown>>;\n}\n\nexport interface GraphViewPoint {\n readonly x: number;\n readonly y: number;\n}\n\nexport interface GraphViewSize {\n readonly width: number;\n readonly height: number;\n}\n\nexport interface GraphViewNodeRenderContext {\n readonly hovered: boolean;\n readonly node: GraphViewNode;\n readonly selected: boolean;\n readonly zoom: number;\n}\n\nexport interface GraphViewRenderedNode {\n readonly hovered: boolean;\n readonly id: string;\n readonly position: GraphViewPoint;\n readonly selected: boolean;\n readonly zoom: number;\n}\n\nexport interface GraphViewViewport {\n readonly zoom: number;\n readonly pan: GraphViewPoint;\n}\n\nexport interface GraphViewFitOptions {\n /** Optimize existing layout spacing without rerunning its algorithm; whole-graph fits only. */\n readonly optimizeSpacing?: boolean;\n readonly nodeIds?: readonly string[];\n readonly padding?: number;\n}\n\nexport interface GraphViewElementEvent {\n readonly id: string;\n readonly type: GraphViewElementEventType;\n}\n\nexport interface GraphViewController {\n fit(options?: GraphViewFitOptions): void;\n getViewport(): GraphViewViewport;\n getZoomRange(): { readonly min: number; readonly max: number };\n setPan(pan: GraphViewPoint): void;\n setZoom(zoom: number): void;\n zoomBy(factor: number): void;\n}\n\nexport interface GraphViewProps {\n readonly nodes: readonly GraphViewNode[];\n readonly edges: readonly GraphViewEdge[];\n readonly layout?: GraphViewLayoutName;\n readonly layoutOptions?: Readonly<Record<string, unknown>>;\n readonly spacingFactor?: number;\n readonly styleRules?: readonly GraphViewStyleRule[];\n readonly selectedNodeIds?: readonly string[];\n readonly renderNode?: (context: GraphViewNodeRenderContext) => React.ReactNode;\n readonly getNodeSize?: (node: GraphViewNode) => GraphViewSize | undefined;\n readonly fitPadding?: number;\n readonly minZoom?: number;\n readonly maxZoom?: number;\n readonly minReadableLabelSize?: number;\n readonly maxFitLabelSize?: number;\n /** Zoom values and bounds use the full-node fit as 1 when fit-relative is selected. */\n readonly zoomMode?: 'absolute' | 'fit-relative';\n /** Measure plain labels before layout instead of estimating width from character count. */\n readonly sizeNodesToLabels?: boolean;\n readonly className?: string;\n readonly style?: React.CSSProperties;\n readonly ariaLabel?: string;\n readonly onReady?: (controller: GraphViewController) => void;\n readonly onLayoutComplete?: (controller: GraphViewController) => void;\n readonly onNodeEvent?: (event: GraphViewElementEvent) => void;\n readonly onEdgeEvent?: (event: GraphViewElementEvent) => void;\n readonly onViewportChange?: (viewport: GraphViewViewport) => void;\n readonly onSpacingFactorChange?: (spacingFactor: number) => void;\n}\n\nexport type GraphViewCallbacks = Pick<\n GraphViewProps,\n | 'onEdgeEvent'\n | 'onLayoutComplete'\n | 'onNodeEvent'\n | 'onReady'\n | 'onViewportChange'\n | 'onSpacingFactorChange'\n>;\n\ntype GraphContainer = NonNullable<CytoscapeOptions['container']>;\n\n/***\n * Render a browser graph while one runtime owns Cytoscape layout, viewport, and disposal.\n * @config zoomMode Use `fit-relative` to make controller zoom, events and min/max limits relative\n * to the visible-node fit (1 = fit). The default `absolute` keeps engine-space zoom units.\n * @config sizeNodesToLabels Opt in to renderer-measured plain labels, including bold and Unicode\n * text. Keep padding in styleRules. Compound and rich-node dimensions retain their existing owners.\n * @config minReadableLabelSize Expand the manual zoom ceiling until plain labels reach this CSS-pixel size.\n * @config maxFitLabelSize Cap automatic fitting at this plain-label CSS-pixel size, leaving whitespace for tiny graphs.\n * @config onSpacingFactorChange Receive the spacing accepted by explicit fit({ optimizeSpacing: true }).\n * Ordinary zoom never adjusts spacing or relayouts. Explicit optimization preserves layout ordering\n * and uses bounded collision checks including labels and compound siblings; it can recover uniformly\n * cramped layouts but cannot repair non-uniform overlaps.\n */\nexport function GraphView(props: GraphViewProps) {\n const { containerRef, renderedNodes, runtimeRef } = useGraphViewRuntime(props);\n\n return (\n <div\n aria-label={props.ariaLabel ?? 'Graph'}\n className={props.className}\n role=\"application\"\n style={{\n height: '100%',\n minHeight: 0,\n minWidth: 0,\n position: 'relative',\n width: '100%',\n ...props.style,\n }}\n >\n <div ref={containerRef} style={{ height: '100%', width: '100%' }} />\n {props.renderNode ? (\n <GraphNodeOverlay\n nodes={props.nodes}\n renderedNodes={renderedNodes}\n renderNode={props.renderNode}\n onNodeEvent={(id, type) => runtimeRef.current?.handleOverlayNodeEvent(id, type)}\n onNodeSize={(id, size) => runtimeRef.current?.setNodeSize(id, size)}\n />\n ) : null}\n </div>\n );\n}\n\n/*** Compose React synchronization around the single imperative graph runtime. */\nfunction useGraphViewRuntime(props: GraphViewProps) {\n const containerRef = React.useRef<GraphContainer | null>(null);\n const runtimeRef = React.useRef<GraphRuntime | null>(null);\n const callbacksRef = useGraphCallbacksRef(props);\n const [renderedNodes, setRenderedNodes] = React.useState<readonly GraphViewRenderedNode[]>([]);\n\n useRuntimeLifecycle(containerRef, runtimeRef, callbacksRef);\n useRuntimeGraphUpdate(runtimeRef, props);\n useRuntimeSelection(runtimeRef, props.selectedNodeIds);\n useRenderedNodeSubscription(runtimeRef, props.renderNode, setRenderedNodes);\n useKnownNodeSizes(runtimeRef, props.nodes, props.getNodeSize);\n\n return { containerRef, renderedNodes, runtimeRef };\n}\n\n/*** Keep the callback ref current without mutating refs during render. */\nfunction useGraphCallbacksRef(props: GraphViewProps) {\n const callbacksRef = React.useRef<GraphViewCallbacks>(readCallbacks(props));\n const {\n onEdgeEvent,\n onLayoutComplete,\n onNodeEvent,\n onReady,\n onViewportChange,\n onSpacingFactorChange,\n } = props;\n\n React.useEffect(() => {\n callbacksRef.current = {\n onEdgeEvent,\n onLayoutComplete,\n onNodeEvent,\n onReady,\n onViewportChange,\n onSpacingFactorChange,\n };\n }, [\n onEdgeEvent,\n onLayoutComplete,\n onNodeEvent,\n onReady,\n onViewportChange,\n onSpacingFactorChange,\n ]);\n\n return callbacksRef;\n}\n\n/*** Create and dispose the runtime only with the underlying browser container lifetime. */\nfunction useRuntimeLifecycle(\n containerRef: { current: GraphContainer | null },\n runtimeRef: { current: GraphRuntime | null },\n callbacksRef: { current: GraphViewCallbacks },\n) {\n React.useEffect(() => {\n const container = containerRef.current;\n if (container === null) return;\n const runtime = createGraphRuntime(container, callbacksRef);\n runtimeRef.current = runtime;\n return () => {\n runtime.destroy();\n runtimeRef.current = null;\n };\n }, [callbacksRef, containerRef, runtimeRef]);\n}\n\n/*** Synchronize graph data and layout policy without exposing Cytoscape to React. */\nfunction useRuntimeGraphUpdate(\n runtimeRef: { current: GraphRuntime | null },\n props: GraphViewProps,\n) {\n const {\n edges,\n fitPadding,\n layout,\n layoutOptions,\n maxZoom,\n minReadableLabelSize,\n maxFitLabelSize,\n minZoom,\n zoomMode,\n sizeNodesToLabels,\n nodes,\n renderNode,\n spacingFactor,\n styleRules,\n } = props;\n\n React.useEffect(() => {\n runtimeRef.current?.update({\n edges,\n fitPadding,\n layout,\n layoutOptions,\n maxZoom,\n minReadableLabelSize,\n maxFitLabelSize,\n minZoom,\n zoomMode,\n sizeNodesToLabels,\n nodes,\n richNodeRendering: renderNode !== undefined,\n spacingFactor,\n styleRules,\n });\n }, [\n edges,\n fitPadding,\n layout,\n layoutOptions,\n maxZoom,\n minReadableLabelSize,\n maxFitLabelSize,\n minZoom,\n zoomMode,\n sizeNodesToLabels,\n nodes,\n renderNode,\n runtimeRef,\n spacingFactor,\n styleRules,\n ]);\n}\n\n/*** Synchronize optional controlled selection independently from graph layout. */\nfunction useRuntimeSelection(\n runtimeRef: { current: GraphRuntime | null },\n selectedNodeIds: readonly string[] | undefined,\n) {\n React.useEffect(() => {\n runtimeRef.current?.setSelectedNodeIds(selectedNodeIds);\n }, [runtimeRef, selectedNodeIds]);\n}\n\n/*** Subscribe the optional rich-node overlay to rendered runtime positions. */\nfunction useRenderedNodeSubscription(\n runtimeRef: { current: GraphRuntime | null },\n renderNode: GraphViewProps['renderNode'],\n setRenderedNodes: (nodes: readonly GraphViewRenderedNode[]) => void,\n) {\n React.useEffect(() => {\n const runtime = runtimeRef.current;\n if (runtime === null || renderNode === undefined) {\n setRenderedNodes([]);\n return;\n }\n return runtime.subscribeRenderedNodes(setRenderedNodes);\n }, [renderNode, runtimeRef, setRenderedNodes]);\n}\n\n/*** Seed known rich-node dimensions without requiring DOM measurement. */\nfunction useKnownNodeSizes(\n runtimeRef: { current: GraphRuntime | null },\n nodes: readonly GraphViewNode[],\n getNodeSize: GraphViewProps['getNodeSize'],\n) {\n React.useEffect(() => {\n const runtime = runtimeRef.current;\n if (runtime === null || getNodeSize === undefined) return;\n for (const node of nodes) {\n const size = getNodeSize(node);\n if (size) runtime.setNodeSize(node.id, size);\n }\n }, [getNodeSize, nodes, runtimeRef]);\n}\n\n/*** Read callback props for the initial runtime callback-ref value. */\nfunction readCallbacks(props: GraphViewProps): GraphViewCallbacks {\n return {\n onEdgeEvent: props.onEdgeEvent,\n onLayoutComplete: props.onLayoutComplete,\n onNodeEvent: props.onNodeEvent,\n onReady: props.onReady,\n onViewportChange: props.onViewportChange,\n onSpacingFactorChange: props.onSpacingFactorChange,\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"GraphView.js","sourceRoot":"","sources":["../../../../../../src/features/graph-view/adapters/inbound/web-artifact/GraphView.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,kBAAkB,EAAqB,MAAM,sBAAsB,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAwHtD;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,SAAS,CAAC,KAAqB;IAC7C,MAAM,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,mBAAmB,CAAC,KAAK,CAAC,CAAC;IAE/E,OAAO,CACL,CAAC,GAAG,CACF,UAAU,CAAC,CAAC,KAAK,CAAC,SAAS,IAAI,OAAO,CAAC,CACvC,SAAS,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,CAC3B,IAAI,CAAC,aAAa,CAClB,KAAK,CAAC,CAAC;YACL,MAAM,EAAE,MAAM;YACd,SAAS,EAAE,CAAC;YACZ,QAAQ,EAAE,CAAC;YACX,QAAQ,EAAE,UAAU;YACpB,KAAK,EAAE,MAAM;YACb,GAAG,KAAK,CAAC,KAAK;SACf,CAAC,CAEF;MAAA,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,YAAY,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,EACjE;MAAA,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAClB,CAAC,gBAAgB,CACf,KAAK,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CACnB,aAAa,CAAC,CAAC,aAAa,CAAC,CAC7B,UAAU,CAAC,CAAC,KAAK,CAAC,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4C,EAC5C,KAA+B,EAC/B,WAA0C;IAE1C,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,MAAM,OAAO,GAAG,UAAU,CAAC,OAAO,CAAC;QACnC,IAAI,OAAO,KAAK,IAAI,IAAI,WAAW,KAAK,SAAS;YAAE,OAAO;QAC1D,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YACzB,MAAM,IAAI,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;YAC/B,IAAI,IAAI;gBAAE,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;QAC/C,CAAC;IACH,CAAC,EAAE,CAAC,WAAW,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC;AACvC,CAAC;AAED,uEAAuE;AACvE,SAAS,aAAa,CAAC,KAAqB;IAC1C,OAAO;QACL,WAAW,EAAE,KAAK,CAAC,WAAW;QAC9B,gBAAgB,EAAE,KAAK,CAAC,gBAAgB;QACxC,WAAW,EAAE,KAAK,CAAC,WAAW;QAC9B,OAAO,EAAE,KAAK,CAAC,OAAO;QACtB,gBAAgB,EAAE,KAAK,CAAC,gBAAgB;QACxC,qBAAqB,EAAE,KAAK,CAAC,qBAAqB;KACnD,CAAC;AACJ,CAAC","sourcesContent":["import type { CytoscapeOptions } from 'cytoscape';\nimport React from 'react';\n\nimport { createGraphRuntime, type GraphRuntime } from './createGraphRuntime';\nimport { GraphNodeOverlay } from './GraphNodeOverlay';\n\nexport type GraphViewLayoutName = 'breadthfirst' | 'circle' | 'concentric' | 'elk' | 'grid';\nexport type GraphViewElementEventType =\n 'press' | 'double-press' | 'select' | 'unselect' | 'pointer-enter' | 'pointer-leave';\n\nexport interface GraphViewNode {\n readonly id: string;\n readonly label?: string;\n readonly parentId?: string;\n readonly classes?: string;\n readonly data?: Readonly<Record<string, unknown>>;\n}\n\nexport interface GraphViewEdge {\n readonly id?: string;\n readonly source: string;\n readonly target: string;\n readonly classes?: string;\n readonly data?: Readonly<Record<string, unknown>>;\n}\n\nexport interface GraphViewStyleRule {\n readonly selector: string;\n readonly style: Readonly<Record<string, unknown>>;\n}\n\nexport interface GraphViewPoint {\n readonly x: number;\n readonly y: number;\n}\n\nexport interface GraphViewSize {\n readonly width: number;\n readonly height: number;\n}\n\nexport interface GraphViewNodeRenderContext {\n readonly hovered: boolean;\n readonly node: GraphViewNode;\n readonly selected: boolean;\n readonly zoom: number;\n}\n\nexport interface GraphViewRenderedNode {\n readonly hovered: boolean;\n readonly id: string;\n readonly position: GraphViewPoint;\n readonly selected: boolean;\n readonly zoom: number;\n}\n\nexport interface GraphViewViewport {\n readonly zoom: number;\n readonly pan: GraphViewPoint;\n}\n\nexport interface GraphViewFitOptions {\n /** Optimize existing layout spacing without rerunning its algorithm; whole-graph fits only. */\n readonly optimizeSpacing?: boolean;\n readonly nodeIds?: readonly string[];\n readonly padding?: number;\n}\n\nexport interface GraphViewElementEvent {\n readonly id: string;\n readonly type: GraphViewElementEventType;\n}\n\nexport interface GraphViewController {\n fit(options?: GraphViewFitOptions): void;\n getViewport(): GraphViewViewport;\n getZoomRange(): { readonly min: number; readonly max: number };\n setPan(pan: GraphViewPoint): void;\n setZoom(zoom: number): void;\n zoomBy(factor: number): void;\n}\n\nexport interface GraphViewProps {\n readonly nodes: readonly GraphViewNode[];\n readonly edges: readonly GraphViewEdge[];\n readonly layout?: GraphViewLayoutName;\n readonly layoutOptions?: Readonly<Record<string, unknown>>;\n readonly spacingFactor?: number;\n readonly styleRules?: readonly GraphViewStyleRule[];\n readonly selectedNodeIds?: readonly string[];\n readonly renderNode?: (context: GraphViewNodeRenderContext) => React.ReactNode;\n readonly getNodeSize?: (node: GraphViewNode) => GraphViewSize | undefined;\n readonly fitPadding?: number;\n readonly minZoom?: number;\n readonly maxZoom?: number;\n readonly minReadableLabelSize?: number;\n readonly maxFitLabelSize?: number;\n /** Zoom values and bounds use the full-node fit as 1 when fit-relative is selected. */\n readonly zoomMode?: 'absolute' | 'fit-relative';\n /** Measure plain labels before layout instead of estimating width from character count. */\n readonly sizeNodesToLabels?: boolean;\n readonly className?: string;\n readonly style?: React.CSSProperties;\n readonly ariaLabel?: string;\n readonly onReady?: (controller: GraphViewController) => void;\n readonly onLayoutComplete?: (controller: GraphViewController) => void;\n readonly onNodeEvent?: (event: GraphViewElementEvent) => void;\n readonly onEdgeEvent?: (event: GraphViewElementEvent) => void;\n readonly onViewportChange?: (viewport: GraphViewViewport) => void;\n readonly onSpacingFactorChange?: (spacingFactor: number) => void;\n}\n\nexport type GraphViewCallbacks = Pick<\n GraphViewProps,\n | 'onEdgeEvent'\n | 'onLayoutComplete'\n | 'onNodeEvent'\n | 'onReady'\n | 'onViewportChange'\n | 'onSpacingFactorChange'\n>;\n\ntype GraphContainer = NonNullable<CytoscapeOptions['container']>;\n\n/***\n * Render a browser graph while one runtime owns Cytoscape layout, viewport, and disposal.\n * zoomMode Use `fit-relative` to make controller zoom, events and min/max limits relative\n * to the visible-node fit (1 = fit). The default `absolute` keeps engine-space zoom units.\n * sizeNodesToLabels Opt in to renderer-measured plain labels, including bold and Unicode\n * text. Keep padding in styleRules. Compound and rich-node dimensions retain their existing owners.\n * minReadableLabelSize Expand the manual zoom ceiling until plain labels reach this CSS-pixel size.\n * maxFitLabelSize Cap automatic fitting at this plain-label CSS-pixel size, leaving whitespace for tiny graphs.\n * onSpacingFactorChange Receive the spacing accepted by explicit fit({ optimizeSpacing: true }).\n * Ordinary zoom never adjusts spacing or relayouts. Explicit optimization preserves layout ordering\n * and uses bounded collision checks including labels and compound siblings; it can recover uniformly\n * cramped layouts but cannot repair non-uniform overlaps.\n */\nexport function GraphView(props: GraphViewProps) {\n const { containerRef, renderedNodes, runtimeRef } = useGraphViewRuntime(props);\n\n return (\n <div\n aria-label={props.ariaLabel ?? 'Graph'}\n className={props.className}\n role=\"application\"\n style={{\n height: '100%',\n minHeight: 0,\n minWidth: 0,\n position: 'relative',\n width: '100%',\n ...props.style,\n }}\n >\n <div ref={containerRef} style={{ height: '100%', width: '100%' }} />\n {props.renderNode ? (\n <GraphNodeOverlay\n nodes={props.nodes}\n renderedNodes={renderedNodes}\n renderNode={props.renderNode}\n onNodeEvent={(id, type) => runtimeRef.current?.handleOverlayNodeEvent(id, type)}\n onNodeSize={(id, size) => runtimeRef.current?.setNodeSize(id, size)}\n />\n ) : null}\n </div>\n );\n}\n\n/*** Compose React synchronization around the single imperative graph runtime. */\nfunction useGraphViewRuntime(props: GraphViewProps) {\n const containerRef = React.useRef<GraphContainer | null>(null);\n const runtimeRef = React.useRef<GraphRuntime | null>(null);\n const callbacksRef = useGraphCallbacksRef(props);\n const [renderedNodes, setRenderedNodes] = React.useState<readonly GraphViewRenderedNode[]>([]);\n\n useRuntimeLifecycle(containerRef, runtimeRef, callbacksRef);\n useRuntimeGraphUpdate(runtimeRef, props);\n useRuntimeSelection(runtimeRef, props.selectedNodeIds);\n useRenderedNodeSubscription(runtimeRef, props.renderNode, setRenderedNodes);\n useKnownNodeSizes(runtimeRef, props.nodes, props.getNodeSize);\n\n return { containerRef, renderedNodes, runtimeRef };\n}\n\n/*** Keep the callback ref current without mutating refs during render. */\nfunction useGraphCallbacksRef(props: GraphViewProps) {\n const callbacksRef = React.useRef<GraphViewCallbacks>(readCallbacks(props));\n const {\n onEdgeEvent,\n onLayoutComplete,\n onNodeEvent,\n onReady,\n onViewportChange,\n onSpacingFactorChange,\n } = props;\n\n React.useEffect(() => {\n callbacksRef.current = {\n onEdgeEvent,\n onLayoutComplete,\n onNodeEvent,\n onReady,\n onViewportChange,\n onSpacingFactorChange,\n };\n }, [\n onEdgeEvent,\n onLayoutComplete,\n onNodeEvent,\n onReady,\n onViewportChange,\n onSpacingFactorChange,\n ]);\n\n return callbacksRef;\n}\n\n/*** Create and dispose the runtime only with the underlying browser container lifetime. */\nfunction useRuntimeLifecycle(\n containerRef: { current: GraphContainer | null },\n runtimeRef: { current: GraphRuntime | null },\n callbacksRef: { current: GraphViewCallbacks },\n) {\n React.useEffect(() => {\n const container = containerRef.current;\n if (container === null) return;\n const runtime = createGraphRuntime(container, callbacksRef);\n runtimeRef.current = runtime;\n return () => {\n runtime.destroy();\n runtimeRef.current = null;\n };\n }, [callbacksRef, containerRef, runtimeRef]);\n}\n\n/*** Synchronize graph data and layout policy without exposing Cytoscape to React. */\nfunction useRuntimeGraphUpdate(\n runtimeRef: { current: GraphRuntime | null },\n props: GraphViewProps,\n) {\n const {\n edges,\n fitPadding,\n layout,\n layoutOptions,\n maxZoom,\n minReadableLabelSize,\n maxFitLabelSize,\n minZoom,\n zoomMode,\n sizeNodesToLabels,\n nodes,\n renderNode,\n spacingFactor,\n styleRules,\n } = props;\n\n React.useEffect(() => {\n runtimeRef.current?.update({\n edges,\n fitPadding,\n layout,\n layoutOptions,\n maxZoom,\n minReadableLabelSize,\n maxFitLabelSize,\n minZoom,\n zoomMode,\n sizeNodesToLabels,\n nodes,\n richNodeRendering: renderNode !== undefined,\n spacingFactor,\n styleRules,\n });\n }, [\n edges,\n fitPadding,\n layout,\n layoutOptions,\n maxZoom,\n minReadableLabelSize,\n maxFitLabelSize,\n minZoom,\n zoomMode,\n sizeNodesToLabels,\n nodes,\n renderNode,\n runtimeRef,\n spacingFactor,\n styleRules,\n ]);\n}\n\n/*** Synchronize optional controlled selection independently from graph layout. */\nfunction useRuntimeSelection(\n runtimeRef: { current: GraphRuntime | null },\n selectedNodeIds: readonly string[] | undefined,\n) {\n React.useEffect(() => {\n runtimeRef.current?.setSelectedNodeIds(selectedNodeIds);\n }, [runtimeRef, selectedNodeIds]);\n}\n\n/*** Subscribe the optional rich-node overlay to rendered runtime positions. */\nfunction useRenderedNodeSubscription(\n runtimeRef: { current: GraphRuntime | null },\n renderNode: GraphViewProps['renderNode'],\n setRenderedNodes: (nodes: readonly GraphViewRenderedNode[]) => void,\n) {\n React.useEffect(() => {\n const runtime = runtimeRef.current;\n if (runtime === null || renderNode === undefined) {\n setRenderedNodes([]);\n return;\n }\n return runtime.subscribeRenderedNodes(setRenderedNodes);\n }, [renderNode, runtimeRef, setRenderedNodes]);\n}\n\n/*** Seed known rich-node dimensions without requiring DOM measurement. */\nfunction useKnownNodeSizes(\n runtimeRef: { current: GraphRuntime | null },\n nodes: readonly GraphViewNode[],\n getNodeSize: GraphViewProps['getNodeSize'],\n) {\n React.useEffect(() => {\n const runtime = runtimeRef.current;\n if (runtime === null || getNodeSize === undefined) return;\n for (const node of nodes) {\n const size = getNodeSize(node);\n if (size) runtime.setNodeSize(node.id, size);\n }\n }, [getNodeSize, nodes, runtimeRef]);\n}\n\n/*** Read callback props for the initial runtime callback-ref value. */\nfunction readCallbacks(props: GraphViewProps): GraphViewCallbacks {\n return {\n onEdgeEvent: props.onEdgeEvent,\n onLayoutComplete: props.onLayoutComplete,\n onNodeEvent: props.onNodeEvent,\n onReady: props.onReady,\n onViewportChange: props.onViewportChange,\n onSpacingFactorChange: props.onSpacingFactorChange,\n };\n}\n"]}
|
|
@@ -2,7 +2,7 @@ import type { Core } from 'cytoscape';
|
|
|
2
2
|
/***
|
|
3
3
|
* Optimize settled layout spacing around readable label bounds instead of full node clearance.
|
|
4
4
|
* Compound containment stays intentional while sibling groups retain non-overlapping boundaries.
|
|
5
|
-
*
|
|
5
|
+
* Cytoscape geometry is measured once, then bounded pure numeric trials reuse the
|
|
6
6
|
* immutable snapshot. No layout reruns, zoom work, or intermediate frames are painted.
|
|
7
7
|
*/
|
|
8
8
|
export declare function compactGraphSpacing(cy: Core, spacingFactor: number): number;
|
|
@@ -7,7 +7,7 @@ const SEARCH_ITERATIONS = 8;
|
|
|
7
7
|
/***
|
|
8
8
|
* Optimize settled layout spacing around readable label bounds instead of full node clearance.
|
|
9
9
|
* Compound containment stays intentional while sibling groups retain non-overlapping boundaries.
|
|
10
|
-
*
|
|
10
|
+
* Cytoscape geometry is measured once, then bounded pure numeric trials reuse the
|
|
11
11
|
* immutable snapshot. No layout reruns, zoom work, or intermediate frames are painted.
|
|
12
12
|
*/
|
|
13
13
|
export function compactGraphSpacing(cy, spacingFactor) {
|