@ankhorage/studio 0.15.0 → 0.16.0
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/README.md +1 -1
- package/dist/contractGuards.d.ts.map +1 -1
- package/dist/contractGuards.js +4 -2
- package/dist/contractGuards.js.map +1 -1
- package/dist/core/StudioProvider.d.ts.map +1 -1
- package/dist/core/StudioProvider.js +87 -10
- package/dist/core/StudioProvider.js.map +1 -1
- package/dist/host/layout/auth/resolveAuthLayoutPlan.js +2 -2
- package/dist/host/layout/auth/resolveAuthLayoutPlan.js.map +1 -1
- package/dist/host/layout/layoutGenerator.js +3 -3
- package/dist/host/layout/layoutGenerator.js.map +1 -1
- package/dist/host/layout/templates/navigation.js +4 -10
- package/dist/host/layout/templates/navigation.js.map +1 -1
- package/dist/host/layout/templates/rootLayout.d.ts.map +1 -1
- package/dist/host/layout/templates/rootLayout.js +11 -7
- package/dist/host/layout/templates/rootLayout.js.map +1 -1
- package/dist/host/orchestrator/templates.d.ts.map +1 -1
- package/dist/host/orchestrator/templates.js +1 -11
- package/dist/host/orchestrator/templates.js.map +1 -1
- package/dist/host/templateRegistry/index.d.ts.map +1 -1
- package/dist/host/templateRegistry/index.js +2 -17
- package/dist/host/templateRegistry/index.js.map +1 -1
- package/dist/index.d.ts +6 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/manifestNavigatorPreviewModel.js +1 -1
- package/dist/manifestNavigatorPreviewModel.js.map +1 -1
- package/dist/manifestState.d.ts +59 -2
- package/dist/manifestState.d.ts.map +1 -1
- package/dist/manifestState.js +336 -51
- package/dist/manifestState.js.map +1 -1
- package/dist/routeUtils.d.ts +1 -2
- package/dist/routeUtils.d.ts.map +1 -1
- package/dist/routeUtils.js +6 -44
- package/dist/routeUtils.js.map +1 -1
- package/dist/studioAdminRouteModel.d.ts +7 -1
- package/dist/studioAdminRouteModel.d.ts.map +1 -1
- package/dist/studioAdminRouteModel.js +54 -0
- package/dist/studioAdminRouteModel.js.map +1 -1
- package/dist/ui/admin/AnkhAdminPage.d.ts.map +1 -1
- package/dist/ui/admin/AnkhAdminPage.js +5 -1
- package/dist/ui/admin/AnkhAdminPage.js.map +1 -1
- package/dist/ui/admin/AnkhAdminShell.d.ts.map +1 -1
- package/dist/ui/admin/AnkhAdminShell.js +5 -2
- package/dist/ui/admin/AnkhAdminShell.js.map +1 -1
- package/dist/ui/admin/pages/ScreenDetailAdminPage.d.ts +6 -0
- package/dist/ui/admin/pages/ScreenDetailAdminPage.d.ts.map +1 -0
- package/dist/ui/admin/pages/ScreenDetailAdminPage.js +86 -0
- package/dist/ui/admin/pages/ScreenDetailAdminPage.js.map +1 -0
- package/dist/ui/admin/pages/ScreensAdminPage.d.ts +3 -0
- package/dist/ui/admin/pages/ScreensAdminPage.d.ts.map +1 -0
- package/dist/ui/admin/pages/ScreensAdminPage.js +99 -0
- package/dist/ui/admin/pages/ScreensAdminPage.js.map +1 -0
- package/dist/ui/admin/pages/screens/screensAdminActions.d.ts +28 -0
- package/dist/ui/admin/pages/screens/screensAdminActions.d.ts.map +1 -0
- package/dist/ui/admin/pages/screens/screensAdminActions.js +22 -0
- package/dist/ui/admin/pages/screens/screensAdminActions.js.map +1 -0
- package/package.json +3 -3
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Button, ButtonGroup, Card, ListRow, ListSection, Text } from '@ankhorage/zora';
|
|
3
|
+
import { useRouter } from 'expo-router';
|
|
4
|
+
import React, { useMemo } from 'react';
|
|
5
|
+
import { StyleSheet, View } from 'react-native';
|
|
6
|
+
import { useStudio } from '../../../core/StudioContext';
|
|
7
|
+
import { deriveStudioScreenNavigationModel, resolveStudioScreenAppPath, } from '../../../manifestState';
|
|
8
|
+
import { createStudioAdminRoutePath } from '../../../studioAdminRouteModel';
|
|
9
|
+
import { AdminHeader, AdminScroll } from '../adminPagePrimitives';
|
|
10
|
+
export function ScreenDetailAdminPage({ screenId }) {
|
|
11
|
+
const studio = useStudio();
|
|
12
|
+
const router = useRouter();
|
|
13
|
+
const model = useMemo(() => (studio.manifest ? deriveStudioScreenNavigationModel(studio.manifest) : null), [studio.manifest]);
|
|
14
|
+
const screensPath = createStudioAdminRoutePath({ routeId: 'screens' });
|
|
15
|
+
const openScreens = () => {
|
|
16
|
+
if (screensPath)
|
|
17
|
+
router.push(screensPath);
|
|
18
|
+
};
|
|
19
|
+
if (!screenId) {
|
|
20
|
+
return (_jsxs(AdminScroll, { children: [_jsx(AdminHeader, { title: "Invalid screen route", description: "This URL does not contain one valid encoded ScreenSpec.id." }), _jsx(Button, { variant: "outline", onPress: openScreens, children: "Back to Screens" })] }));
|
|
21
|
+
}
|
|
22
|
+
if (!model) {
|
|
23
|
+
return (_jsxs(AdminScroll, { children: [_jsx(AdminHeader, { title: "Screen detail", description: "Canonical screen metadata is unavailable until the manifest loads." }), _jsx(Card, { compact: true, title: "Requested screen ID", children: _jsx(Text, { children: screenId }) })] }));
|
|
24
|
+
}
|
|
25
|
+
const matchingEntries = model.screens.filter((candidate) => candidate.screenId === screenId);
|
|
26
|
+
if (matchingEntries.length > 1) {
|
|
27
|
+
return (_jsxs(AdminScroll, { children: [_jsx(AdminHeader, { title: "Screen identity is ambiguous", description: "Multiple screen registry entries use this stable ScreenSpec.id. Studio will not select one arbitrarily." }), _jsx(Card, { compact: true, title: "Ambiguous stable screen ID", children: _jsx(Text, { children: screenId }) }), _jsx(Button, { variant: "outline", onPress: openScreens, children: "Back to Screens" })] }));
|
|
28
|
+
}
|
|
29
|
+
const [entry] = matchingEntries;
|
|
30
|
+
if (!entry) {
|
|
31
|
+
return (_jsxs(AdminScroll, { children: [_jsx(AdminHeader, { title: "Screen not found", description: "The requested screen is missing or was deleted from the canonical manifest." }), _jsx(Card, { compact: true, title: "Requested stable screen ID", children: _jsx(Text, { children: screenId }) }), _jsx(Button, { variant: "outline", onPress: openScreens, children: "Back to Screens" })] }));
|
|
32
|
+
}
|
|
33
|
+
const appPath = resolveStudioScreenAppPath(model, entry.screenId);
|
|
34
|
+
const label = entry.screen.title ?? entry.screen.name;
|
|
35
|
+
const openAppScreen = () => {
|
|
36
|
+
if (appPath)
|
|
37
|
+
router.replace(appPath);
|
|
38
|
+
};
|
|
39
|
+
return (_jsxs(AdminScroll, { children: [_jsx(AdminHeader, { title: label, description: "Canonical screen metadata and every manifest route reference for this stable screen ID." }), _jsxs(Card, { title: "Screen metadata", description: "Identity comes only from ScreenSpec.id.", children: [_jsx(MetadataFact, { label: "Stable screen ID", value: entry.screen.id }), _jsx(MetadataFact, { label: "Name", value: entry.screen.name }), _jsx(MetadataFact, { label: "Title", value: entry.screen.title ?? 'Not set' }), _jsx(MetadataFact, { label: "Description", value: entry.screen.description ?? 'Not set' })] }), _jsxs(ButtonGroup, { orientation: "responsive", align: "start", children: [_jsx(Button, { variant: "outline", onPress: openScreens, children: "Back to Screens" }), appPath ? _jsx(Button, { onPress: openAppScreen, children: "Open app screen" }) : null] }), !appPath ? _jsx(AppPathUnavailable, { entry: entry }) : null, _jsx(ListSection, { title: "Route references", description: formatRouteReferenceSummary(entry.routeReferences.length), children: entry.routeReferences.length === 0 ? (_jsx(ListRow, { title: "Unrouted screen", description: "This screen exists canonically but has no navigator route reference.", variant: "card" })) : (entry.routeReferences.map((reference, index) => (_jsx(RouteReferenceRow, { reference: reference, index: index }, `${formatRoutePath(reference.parentPath)}:${reference.route.name}:${index}`)))) })] }));
|
|
40
|
+
}
|
|
41
|
+
function MetadataFact(props) {
|
|
42
|
+
return (_jsxs(View, { style: styles.fact, children: [_jsx(Text, { color: "neutral", emphasis: "muted", variant: "caption", children: props.label }), _jsx(Text, { children: props.value })] }));
|
|
43
|
+
}
|
|
44
|
+
function AppPathUnavailable({ entry }) {
|
|
45
|
+
let description = 'This screen has no route reference, so there is no app pathname to open.';
|
|
46
|
+
if (entry.routeReferences.length > 1) {
|
|
47
|
+
description = `This screen has ${entry.routeReferences.length} route references. Studio will not choose one arbitrarily.`;
|
|
48
|
+
}
|
|
49
|
+
else if (entry.routeReferences.length === 1) {
|
|
50
|
+
description =
|
|
51
|
+
'The canonical route reference does not resolve to one concrete, unambiguous app pathname because it is dynamic or collides with another route pattern.';
|
|
52
|
+
}
|
|
53
|
+
return _jsx(Card, { compact: true, title: "Open app screen unavailable", description: description });
|
|
54
|
+
}
|
|
55
|
+
function RouteReferenceRow(props) {
|
|
56
|
+
const { reference } = props;
|
|
57
|
+
const primaryVisibility = reference.isPrimaryNavigatorMember
|
|
58
|
+
? `${reference.showInPrimaryNavigation ? 'Visible' : 'Hidden'}${reference.navigatorType === 'stack' ? ' (Stack has no primary-navigation chrome)' : ''}`
|
|
59
|
+
: 'Not applicable to this nested navigator reference';
|
|
60
|
+
const initialRoute = reference.isPrimaryNavigatorMember
|
|
61
|
+
? reference.isPrimaryInitialRoute
|
|
62
|
+
? 'Yes'
|
|
63
|
+
: 'No'
|
|
64
|
+
: 'Not applicable outside the primary navigator';
|
|
65
|
+
return (_jsx(ListRow, { title: reference.route.label ?? reference.route.name, meta: `Reference ${props.index + 1}`, variant: "card", description: _jsxs(View, { style: styles.referenceFacts, children: [_jsx(MetadataFact, { label: "Route key", value: reference.route.name }), _jsx(MetadataFact, { label: "Declared route path", value: reference.route.path ?? 'Derived from route key' }), _jsx(MetadataFact, { label: "Canonical pathname/pattern", value: reference.pathnamePattern }), _jsx(MetadataFact, { label: "Navigator parent", value: formatRoutePath(reference.parentPath) }), _jsx(MetadataFact, { label: "Navigator type", value: reference.navigatorType }), _jsx(MetadataFact, { label: "Sibling order", value: String(reference.siblingIndex + 1) }), _jsx(MetadataFact, { label: "Primary navigator member", value: reference.isPrimaryNavigatorMember ? 'Yes' : 'No' }), _jsx(MetadataFact, { label: "Primary-navigation visibility", value: primaryVisibility }), _jsx(MetadataFact, { label: "Primary initial route", value: initialRoute })] }) }));
|
|
66
|
+
}
|
|
67
|
+
function formatRouteReferenceSummary(count) {
|
|
68
|
+
if (count === 0)
|
|
69
|
+
return 'No route references resolve to this screen.';
|
|
70
|
+
if (count === 1)
|
|
71
|
+
return 'One canonical route reference resolves to this screen.';
|
|
72
|
+
return `${count} canonical route references resolve to this screen; each is shown separately.`;
|
|
73
|
+
}
|
|
74
|
+
function formatRoutePath(routePath) {
|
|
75
|
+
return routePath.length === 0 ? 'root' : routePath.join('/');
|
|
76
|
+
}
|
|
77
|
+
const styles = StyleSheet.create({
|
|
78
|
+
fact: {
|
|
79
|
+
gap: 2,
|
|
80
|
+
},
|
|
81
|
+
referenceFacts: {
|
|
82
|
+
gap: 10,
|
|
83
|
+
paddingTop: 4,
|
|
84
|
+
},
|
|
85
|
+
});
|
|
86
|
+
//# sourceMappingURL=ScreenDetailAdminPage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScreenDetailAdminPage.js","sourceRoot":"","sources":["../../../../src/ui/admin/pages/ScreenDetailAdminPage.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACxF,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEhD,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AACxD,OAAO,EACL,iCAAiC,EACjC,0BAA0B,GAG3B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAC;AAC5E,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAMlE,MAAM,UAAU,qBAAqB,CAAC,EAAE,QAAQ,EAA8B;IAC5E,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAC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C,KAAa;IAChD,IAAI,KAAK,KAAK,CAAC;QAAE,OAAO,6CAA6C,CAAC;IACtE,IAAI,KAAK,KAAK,CAAC;QAAE,OAAO,wDAAwD,CAAC;IACjF,OAAO,GAAG,KAAK,+EAA+E,CAAC;AACjG,CAAC;AAED,SAAS,eAAe,CAAC,SAA4B;IACnD,OAAO,SAAS,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC/D,CAAC;AAED,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,IAAI,EAAE;QACJ,GAAG,EAAE,CAAC;KACP;IACD,cAAc,EAAE;QACd,GAAG,EAAE,EAAE;QACP,UAAU,EAAE,CAAC;KACd;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScreensAdminPage.d.ts","sourceRoot":"","sources":["../../../../src/ui/admin/pages/ScreensAdminPage.tsx"],"names":[],"mappings":"AAaA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAyBjD,wBAAgB,gBAAgB,sBAqI/B"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { NAVIGATOR_TYPES } from '@ankhorage/contracts';
|
|
3
|
+
import { Button, ButtonGroup, Card, ConfirmDialog, Input, ListRow, ListSection, Select, SwitchField, Text, } from '@ankhorage/zora';
|
|
4
|
+
import React, { useMemo, useState } from 'react';
|
|
5
|
+
import { useRouter } from 'expo-router';
|
|
6
|
+
import { StyleSheet, View } from 'react-native';
|
|
7
|
+
import { useStudio } from '../../../core/StudioContext';
|
|
8
|
+
import { deriveStudioScreenNavigationModel, findNavigatorAtPath, } from '../../../manifestState';
|
|
9
|
+
import { createStudioScreenRoutePath } from '../../../studioAdminRouteModel';
|
|
10
|
+
import { AdminHeader, AdminScroll } from '../adminPagePrimitives';
|
|
11
|
+
import { applyScreensAdminAction } from './screens/screensAdminActions';
|
|
12
|
+
const NAVIGATOR_OPTIONS = NAVIGATOR_TYPES.map((value) => ({
|
|
13
|
+
value,
|
|
14
|
+
label: value[0]?.toUpperCase() + value.slice(1),
|
|
15
|
+
}));
|
|
16
|
+
export function ScreensAdminPage() {
|
|
17
|
+
const studio = useStudio();
|
|
18
|
+
const router = useRouter();
|
|
19
|
+
const [newScreenName, setNewScreenName] = useState('');
|
|
20
|
+
const [pendingDelete, setPendingDelete] = useState(null);
|
|
21
|
+
const model = useMemo(() => (studio.manifest ? deriveStudioScreenNavigationModel(studio.manifest) : null), [studio.manifest]);
|
|
22
|
+
const dispatch = (action) => applyScreensAdminAction(studio, action);
|
|
23
|
+
const createScreen = () => {
|
|
24
|
+
const name = newScreenName.trim();
|
|
25
|
+
if (!name)
|
|
26
|
+
return;
|
|
27
|
+
dispatch({ type: 'create-screen', name });
|
|
28
|
+
setNewScreenName('');
|
|
29
|
+
};
|
|
30
|
+
const confirmDelete = () => {
|
|
31
|
+
if (!pendingDelete)
|
|
32
|
+
return;
|
|
33
|
+
dispatch({ type: 'delete-screen', screenId: pendingDelete.screenId });
|
|
34
|
+
setPendingDelete(null);
|
|
35
|
+
};
|
|
36
|
+
if (!studio.manifest || !model) {
|
|
37
|
+
return (_jsx(AdminScroll, { children: _jsx(AdminHeader, { title: "Screens", description: "Screens and primary app navigation are unavailable until the manifest loads." }) }));
|
|
38
|
+
}
|
|
39
|
+
const manifest = studio.manifest;
|
|
40
|
+
return (_jsxs(_Fragment, { children: [_jsxs(AdminScroll, { children: [_jsx(AdminHeader, { title: "Screens", description: "Manage canonical screens and how direct routes participate in primary app navigation." }), _jsxs(Card, { title: "Primary navigator", description: "Changes preserve the existing nested route tree.", children: [_jsxs(View, { style: styles.field, children: [_jsx(Text, { variant: "bodySmall", weight: "semiBold", children: "Navigator type" }), _jsx(Select, { value: model.primaryNavigator.type, options: NAVIGATOR_OPTIONS, onValueChange: (navigatorType) => dispatch({ type: 'set-navigator-type', navigatorType }) })] }), _jsxs(Text, { color: "neutral", emphasis: "muted", variant: "caption", children: ["Primary navigator path: ", formatParentPath(model.primaryNavigatorPath)] })] }), _jsx(Card, { title: "Create screen", description: "New screens are routed in the primary navigator.", children: _jsxs(View, { style: styles.createRow, children: [_jsx(View, { style: styles.createInput, children: _jsx(Input, { accessibilityLabel: "New screen name", placeholder: "Screen name", value: newScreenName, onChangeText: setNewScreenName, onSubmitEditing: createScreen }) }), _jsx(Button, { disabled: !newScreenName.trim(), onPress: createScreen, children: "Create screen" })] }) }), model.diagnostics.length > 0 ? (_jsx(ListSection, { title: "Navigation diagnostics", description: "Resolve these manifest states before relying on ambiguous route mutations.", children: model.diagnostics.map((diagnostic, index) => (_jsx(ListRow, { title: diagnostic.code, description: diagnostic.message, meta: formatParentPath(diagnostic.parentPath), variant: "card" }, `${diagnostic.code}:${diagnostic.routeName ?? diagnostic.screenId ?? index}`))) })) : null, _jsx(ListSection, { title: "Screens", description: `${model.screens.length} canonical screen${model.screens.length === 1 ? '' : 's'}. Route existence and primary-navigation visibility are separate.`, children: model.screens.map((entry, index) => (_jsx(ScreenOverviewRow, { entry: entry, screenCount: model.screens.length, manifest: manifest, dispatch: dispatch, onOpenDetail: (screenId) => router.push(createStudioScreenRoutePath(screenId)), onRequestDelete: setPendingDelete }, `${entry.screenId}:${index}`))) })] }), _jsx(ConfirmDialog, { visible: pendingDelete !== null, title: "Delete screen?", description: pendingDelete
|
|
41
|
+
? `Delete ${pendingDelete.label}, all of its route references, and bindings owned by its node tree?`
|
|
42
|
+
: undefined, confirmLabel: "Delete screen", confirmColor: "danger", onCancel: () => setPendingDelete(null), onConfirm: confirmDelete })] }));
|
|
43
|
+
}
|
|
44
|
+
function ScreenOverviewRow(props) {
|
|
45
|
+
const { entry } = props;
|
|
46
|
+
const label = entry.screen.title ?? entry.screen.name;
|
|
47
|
+
const canDelete = props.screenCount > 1;
|
|
48
|
+
return (_jsx(ListRow, { title: label, meta: entry.screenId, variant: "card", action: _jsxs(ButtonGroup, { orientation: "responsive", align: "end", children: [_jsx(Button, { variant: "outline", onPress: () => props.onOpenDetail(entry.screenId), children: "Details" }), _jsx(Button, { color: "danger", variant: "ghost", disabled: !canDelete, onPress: () => props.onRequestDelete({ screenId: entry.screenId, label }), children: "Delete" })] }), description: _jsxs(View, { style: styles.screenDetails, children: [entry.screen.name !== label ? (_jsxs(Text, { color: "neutral", variant: "bodySmall", children: ["Name: ", entry.screen.name] })) : null, !canDelete ? (_jsx(Text, { color: "neutral", emphasis: "muted", variant: "caption", children: "The final remaining screen cannot be deleted." })) : null, entry.routeReferences.length === 0 ? (_jsx(Text, { color: "neutral", emphasis: "muted", variant: "bodySmall", children: "Unrouted screen" })) : (entry.routeReferences.map((reference) => (_jsx(ScreenRouteReferenceControls, { reference: reference, siblingCount: findNavigatorAtPath(props.manifest.navigator, reference.parentPath)?.routes
|
|
49
|
+
.length ?? 0, dispatch: props.dispatch }, `${formatParentPath(reference.parentPath)}:${reference.route.name}`))))] }) }));
|
|
50
|
+
}
|
|
51
|
+
function ScreenRouteReferenceControls(props) {
|
|
52
|
+
const { reference } = props;
|
|
53
|
+
const routeContext = `${formatParentPath(reference.parentPath)} · ${reference.navigatorType}`;
|
|
54
|
+
return (_jsxs(Card, { compact: true, title: reference.route.label ?? reference.route.name, description: routeContext, children: [_jsxs(View, { style: styles.routeFacts, children: [_jsxs(Text, { color: "neutral", variant: "bodySmall", children: ["Path: ", reference.pathnamePattern] }), _jsxs(Text, { color: "neutral", variant: "bodySmall", children: ["Route key: ", reference.route.name, " \u00B7 Order ", reference.siblingIndex + 1] })] }), reference.isPrimaryNavigatorMember ? (_jsxs(_Fragment, { children: [_jsx(SwitchField, { label: "Visible in primary navigation", description: "Hidden routes remain valid and programmatically navigable.", value: reference.showInPrimaryNavigation, onValueChange: (showInPrimaryNavigation) => props.dispatch({
|
|
55
|
+
type: 'set-primary-navigation-visibility',
|
|
56
|
+
parentPath: reference.parentPath,
|
|
57
|
+
routeName: reference.route.name,
|
|
58
|
+
showInPrimaryNavigation,
|
|
59
|
+
}) }), _jsxs(ButtonGroup, { orientation: "responsive", align: "start", children: [_jsx(Button, { variant: "outline", disabled: reference.isPrimaryInitialRoute, onPress: () => props.dispatch({
|
|
60
|
+
type: 'set-initial-route',
|
|
61
|
+
routeName: reference.route.name,
|
|
62
|
+
}), children: reference.isPrimaryInitialRoute ? 'Initial route' : 'Set as initial' }), _jsx(Button, { color: "neutral", variant: "ghost", disabled: reference.siblingIndex === 0, onPress: () => props.dispatch({
|
|
63
|
+
type: 'move-route',
|
|
64
|
+
parentPath: reference.parentPath,
|
|
65
|
+
routeName: reference.route.name,
|
|
66
|
+
toIndex: reference.siblingIndex - 1,
|
|
67
|
+
}), children: "Move up" }), _jsx(Button, { color: "neutral", variant: "ghost", disabled: reference.siblingIndex >= props.siblingCount - 1, onPress: () => props.dispatch({
|
|
68
|
+
type: 'move-route',
|
|
69
|
+
parentPath: reference.parentPath,
|
|
70
|
+
routeName: reference.route.name,
|
|
71
|
+
toIndex: reference.siblingIndex + 1,
|
|
72
|
+
}), children: "Move down" })] })] })) : (_jsx(Text, { color: "neutral", emphasis: "muted", variant: "caption", children: "Nested route reference. ADM 8 does not provide arbitrary nested navigator editing." }))] }));
|
|
73
|
+
}
|
|
74
|
+
function formatParentPath(parentPath) {
|
|
75
|
+
return parentPath.length === 0 ? 'root' : parentPath.join('/');
|
|
76
|
+
}
|
|
77
|
+
const styles = StyleSheet.create({
|
|
78
|
+
createRow: {
|
|
79
|
+
alignItems: 'center',
|
|
80
|
+
flexDirection: 'row',
|
|
81
|
+
flexWrap: 'wrap',
|
|
82
|
+
gap: 12,
|
|
83
|
+
},
|
|
84
|
+
createInput: {
|
|
85
|
+
flexGrow: 1,
|
|
86
|
+
minWidth: 220,
|
|
87
|
+
},
|
|
88
|
+
field: {
|
|
89
|
+
gap: 8,
|
|
90
|
+
},
|
|
91
|
+
routeFacts: {
|
|
92
|
+
gap: 4,
|
|
93
|
+
},
|
|
94
|
+
screenDetails: {
|
|
95
|
+
gap: 10,
|
|
96
|
+
paddingTop: 4,
|
|
97
|
+
},
|
|
98
|
+
});
|
|
99
|
+
//# sourceMappingURL=ScreensAdminPage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScreensAdminPage.js","sourceRoot":"","sources":["../../../../src/ui/admin/pages/ScreensAdminPage.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,eAAe,EAAsB,MAAM,sBAAsB,CAAC;AAC3E,OAAO,EACL,MAAM,EACN,WAAW,EACX,IAAI,EACJ,aAAa,EACb,KAAK,EACL,OAAO,EACP,WAAW,EACX,MAAM,EACN,WAAW,EACX,IAAI,GACL,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEhD,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AACxD,OAAO,EACL,iCAAiC,EACjC,mBAAmB,GAGpB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,2BAA2B,EAAE,MAAM,gCAAgC,CAAC;AAC7E,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AAExE,MAAM,iBAAiB,GAAG,eAAe,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IACxD,KAAK;IACL,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;CAChD,CAAC,CAA8D,CAAC;AAOjE,MAAM,UAAU,gBAAgB;I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;IACD,aAAa,EAAE;QACb,GAAG,EAAE,EAAE;QACP,UAAU,EAAE,CAAC;KACd;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { NavigatorType } from '@ankhorage/contracts';
|
|
2
|
+
import type { StudioContextValue } from '../../../../index';
|
|
3
|
+
export type ScreensAdminAction = {
|
|
4
|
+
type: 'create-screen';
|
|
5
|
+
name: string;
|
|
6
|
+
} | {
|
|
7
|
+
type: 'delete-screen';
|
|
8
|
+
screenId: string;
|
|
9
|
+
} | {
|
|
10
|
+
type: 'set-navigator-type';
|
|
11
|
+
navigatorType: NavigatorType;
|
|
12
|
+
} | {
|
|
13
|
+
type: 'set-initial-route';
|
|
14
|
+
routeName: string;
|
|
15
|
+
} | {
|
|
16
|
+
type: 'set-primary-navigation-visibility';
|
|
17
|
+
parentPath: string[];
|
|
18
|
+
routeName: string;
|
|
19
|
+
showInPrimaryNavigation: boolean;
|
|
20
|
+
} | {
|
|
21
|
+
type: 'move-route';
|
|
22
|
+
parentPath: string[];
|
|
23
|
+
routeName: string;
|
|
24
|
+
toIndex: number;
|
|
25
|
+
};
|
|
26
|
+
export type ScreensAdminMutationTarget = Pick<StudioContextValue, 'addScreen' | 'deleteScreen' | 'moveRoute' | 'setNavigatorInitialRoute' | 'setNavigatorType' | 'setRoutePrimaryNavigationVisibility'>;
|
|
27
|
+
export declare function applyScreensAdminAction(target: ScreensAdminMutationTarget, action: ScreensAdminAction): void;
|
|
28
|
+
//# sourceMappingURL=screensAdminActions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"screensAdminActions.d.ts","sourceRoot":"","sources":["../../../../../src/ui/admin/pages/screens/screensAdminActions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAE5D,MAAM,MAAM,kBAAkB,GAC1B;IAAE,IAAI,EAAE,eAAe,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACvC;IAAE,IAAI,EAAE,eAAe,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GAC3C;IAAE,IAAI,EAAE,oBAAoB,CAAC;IAAC,aAAa,EAAE,aAAa,CAAA;CAAE,GAC5D;IAAE,IAAI,EAAE,mBAAmB,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,GAChD;IACE,IAAI,EAAE,mCAAmC,CAAC;IAC1C,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,uBAAuB,EAAE,OAAO,CAAC;CAClC,GACD;IAAE,IAAI,EAAE,YAAY,CAAC;IAAC,UAAU,EAAE,MAAM,EAAE,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAErF,MAAM,MAAM,0BAA0B,GAAG,IAAI,CAC3C,kBAAkB,EAChB,WAAW,GACX,cAAc,GACd,WAAW,GACX,0BAA0B,GAC1B,kBAAkB,GAClB,qCAAqC,CACxC,CAAC;AAEF,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,0BAA0B,EAClC,MAAM,EAAE,kBAAkB,GACzB,IAAI,CAwBN"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export function applyScreensAdminAction(target, action) {
|
|
2
|
+
switch (action.type) {
|
|
3
|
+
case 'create-screen':
|
|
4
|
+
target.addScreen(action.name);
|
|
5
|
+
return;
|
|
6
|
+
case 'delete-screen':
|
|
7
|
+
target.deleteScreen(action.screenId);
|
|
8
|
+
return;
|
|
9
|
+
case 'set-navigator-type':
|
|
10
|
+
target.setNavigatorType(action.navigatorType);
|
|
11
|
+
return;
|
|
12
|
+
case 'set-initial-route':
|
|
13
|
+
target.setNavigatorInitialRoute(action.routeName);
|
|
14
|
+
return;
|
|
15
|
+
case 'set-primary-navigation-visibility':
|
|
16
|
+
target.setRoutePrimaryNavigationVisibility(action.parentPath, action.routeName, action.showInPrimaryNavigation);
|
|
17
|
+
return;
|
|
18
|
+
case 'move-route':
|
|
19
|
+
target.moveRoute(action.parentPath, action.routeName, action.toIndex);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=screensAdminActions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"screensAdminActions.js","sourceRoot":"","sources":["../../../../../src/ui/admin/pages/screens/screensAdminActions.ts"],"names":[],"mappings":"AA2BA,MAAM,UAAU,uBAAuB,CACrC,MAAkC,EAClC,MAA0B;IAE1B,QAAQ,MAAM,CAAC,IAAI,EAAE,CAAC;QACpB,KAAK,eAAe;YAClB,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;YAC9B,OAAO;QACT,KAAK,eAAe;YAClB,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;YACrC,OAAO;QACT,KAAK,oBAAoB;YACvB,MAAM,CAAC,gBAAgB,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;YAC9C,OAAO;QACT,KAAK,mBAAmB;YACtB,MAAM,CAAC,wBAAwB,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;YAClD,OAAO;QACT,KAAK,mCAAmC;YACtC,MAAM,CAAC,mCAAmC,CACxC,MAAM,CAAC,UAAU,EACjB,MAAM,CAAC,SAAS,EAChB,MAAM,CAAC,uBAAuB,CAC/B,CAAC;YACF,OAAO;QACT,KAAK,YAAY;YACf,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;IAC1E,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ankhorage/studio",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.0",
|
|
4
4
|
"description": "Studio authoring package for Ankhorage apps",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://github.com/ankhorage/studio#readme",
|
|
@@ -231,7 +231,7 @@
|
|
|
231
231
|
],
|
|
232
232
|
"dependencies": {
|
|
233
233
|
"@ankhorage/color-theory": "^0.0.8",
|
|
234
|
-
"@ankhorage/contracts": "^
|
|
234
|
+
"@ankhorage/contracts": "^5.0.0",
|
|
235
235
|
"@ankhorage/data-sources": "^1.0.1",
|
|
236
236
|
"@ankhorage/expo-runtime": "^1.0.0",
|
|
237
237
|
"@ankhorage/infra": "^2.0.1",
|
|
@@ -242,7 +242,7 @@
|
|
|
242
242
|
"@ankhorage/runtime": "^1.0.0",
|
|
243
243
|
"@ankhorage/supabase-auth": "^1.1.2",
|
|
244
244
|
"@ankhorage/supabase-vault": "^0.2.4",
|
|
245
|
-
"@ankhorage/templates": "^
|
|
245
|
+
"@ankhorage/templates": "^5.0.0",
|
|
246
246
|
"@ankhorage/zora": "^2.9.3",
|
|
247
247
|
"@ankhorage/zora-chess": "^0.1.2",
|
|
248
248
|
"@ankhorage/zora-tabletop": "^0.0.5",
|