@buffcore/admin-shell 0.8.43 → 0.8.45

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.
Files changed (157) hide show
  1. package/dist/components/Markdown.d.ts +9 -3
  2. package/dist/components/Markdown.js +84 -34
  3. package/dist/components/Sheet.d.ts +5 -1
  4. package/dist/components/Sheet.js +8 -2
  5. package/dist/components/TextArea.d.ts +3 -1
  6. package/dist/components/TextArea.js +3 -3
  7. package/dist/components/icons.d.ts +1 -0
  8. package/dist/components/icons.js +1 -0
  9. package/dist/workbench/app/ServedPrototype.d.ts +2 -0
  10. package/dist/workbench/app/ServedPrototype.js +11 -1
  11. package/dist/workbench/app/__snapshots__/places-dom.test.tsx.snap +30 -3
  12. package/dist/workbench/app/actions.d.ts +4 -2
  13. package/dist/workbench/app/actions.js +9 -4
  14. package/dist/workbench/app/brief-short.d.ts +14 -0
  15. package/dist/workbench/app/brief-short.js +103 -0
  16. package/dist/workbench/app/chat-session.d.ts +5 -5
  17. package/dist/workbench/app/chat-session.js +8 -3
  18. package/dist/workbench/app/chat.d.ts +17 -4
  19. package/dist/workbench/app/chat.js +9 -4
  20. package/dist/workbench/app/frame.js +5 -1
  21. package/dist/workbench/app/loop.js +2 -18
  22. package/dist/workbench/app/pages.js +10 -2
  23. package/dist/workbench/app/prototype.js +3 -0
  24. package/dist/workbench/app/test/loop-fixture.d.ts +13 -1
  25. package/dist/workbench/app/useStudio.d.ts +2 -1
  26. package/dist/workbench/studio/frame/AgentPanel.js +24 -1
  27. package/dist/workbench/studio/frame/Composer.js +13 -10
  28. package/dist/workbench/studio/frame/PanelList.js +1 -1
  29. package/dist/workbench/studio/frame/Segmented.d.ts +3 -1
  30. package/dist/workbench/studio/frame/Segmented.js +4 -3
  31. package/dist/workbench/studio/frame/SettingsSheet.js +10 -9
  32. package/dist/workbench/studio/frame/StudioFrame.js +7 -6
  33. package/dist/workbench/studio/frame/StudioRegions.js +4 -1
  34. package/dist/workbench/studio/frame/TurnControls.d.ts +2 -1
  35. package/dist/workbench/studio/frame/TurnControls.js +4 -1
  36. package/dist/workbench/studio/frame/layout.d.ts +2 -0
  37. package/dist/workbench/studio/frame/layout.js +2 -0
  38. package/dist/workbench/studio/frame/panelControls.d.ts +21 -1
  39. package/dist/workbench/studio/frame/scrollbars.d.ts +1 -0
  40. package/dist/workbench/studio/frame/scrollbars.js +12 -0
  41. package/dist/workbench/studio/frame/useTurnDraft.d.ts +22 -2
  42. package/dist/workbench/studio/frame/useTurnDraft.js +48 -16
  43. package/dist/workbench/studio/i18n/frame.en.d.ts +3 -0
  44. package/dist/workbench/studio/i18n/frame.en.js +4 -1
  45. package/dist/workbench/studio/i18n/frame.es.json +4 -1
  46. package/dist/workbench/studio/i18n/index.js +6 -0
  47. package/dist/workbench/studio/i18n/loop.en.d.ts +11 -38
  48. package/dist/workbench/studio/i18n/loop.en.js +11 -38
  49. package/dist/workbench/studio/i18n/loop.es.json +11 -38
  50. package/dist/workbench/studio/i18n/marks.en.d.ts +41 -0
  51. package/dist/workbench/studio/i18n/marks.en.js +42 -0
  52. package/dist/workbench/studio/i18n/marks.es.json +40 -0
  53. package/dist/workbench/studio/i18n/start.en.d.ts +5 -0
  54. package/dist/workbench/studio/i18n/start.en.js +7 -2
  55. package/dist/workbench/studio/i18n/start.es.json +7 -2
  56. package/dist/workbench/studio/i18n/workspace.en.d.ts +45 -0
  57. package/dist/workbench/studio/i18n/workspace.en.js +46 -0
  58. package/dist/workbench/studio/i18n/workspace.es.json +44 -0
  59. package/dist/workbench/studio/loop/BriefDocument.d.ts +9 -6
  60. package/dist/workbench/studio/loop/BriefDocument.js +48 -76
  61. package/dist/workbench/studio/loop/BriefLists.d.ts +11 -0
  62. package/dist/workbench/studio/loop/BriefLists.js +42 -0
  63. package/dist/workbench/studio/loop/BriefPage.d.ts +6 -2
  64. package/dist/workbench/studio/loop/BriefPage.js +32 -4
  65. package/dist/workbench/studio/loop/BriefReading.d.ts +19 -0
  66. package/dist/workbench/studio/loop/BriefReading.js +22 -0
  67. package/dist/workbench/studio/loop/BriefSection.d.ts +22 -0
  68. package/dist/workbench/studio/loop/BriefSection.js +47 -0
  69. package/dist/workbench/studio/loop/BriefWho.d.ts +6 -0
  70. package/dist/workbench/studio/loop/BriefWho.js +56 -0
  71. package/dist/workbench/studio/loop/CanvasBar.d.ts +0 -1
  72. package/dist/workbench/studio/loop/CanvasBar.js +2 -3
  73. package/dist/workbench/studio/loop/ConsoleFrame.d.ts +13 -0
  74. package/dist/workbench/studio/loop/ConsoleFrame.js +29 -0
  75. package/dist/workbench/studio/loop/NotThisCard.d.ts +6 -1
  76. package/dist/workbench/studio/loop/NotThisCard.js +28 -20
  77. package/dist/workbench/studio/loop/ProtoJourneys.d.ts +1 -8
  78. package/dist/workbench/studio/loop/ProtoJourneys.js +0 -14
  79. package/dist/workbench/studio/loop/PrototypeApp.d.ts +12 -1
  80. package/dist/workbench/studio/loop/PrototypeApp.js +30 -13
  81. package/dist/workbench/studio/loop/PrototypeAttempt.d.ts +2 -1
  82. package/dist/workbench/studio/loop/PrototypeAttempt.js +94 -29
  83. package/dist/workbench/studio/loop/PrototypePage.d.ts +4 -2
  84. package/dist/workbench/studio/loop/PrototypePage.js +25 -1
  85. package/dist/workbench/studio/loop/PrototypePreview.d.ts +35 -6
  86. package/dist/workbench/studio/loop/PrototypePreview.js +127 -76
  87. package/dist/workbench/studio/loop/PrototypePreviewSlot.d.ts +13 -0
  88. package/dist/workbench/studio/loop/PrototypePreviewSlot.js +23 -0
  89. package/dist/workbench/studio/loop/PrototypeScenes.d.ts +1 -1
  90. package/dist/workbench/studio/loop/ServedPlanning.js +1 -1
  91. package/dist/workbench/studio/loop/StudioLoop.d.ts +7 -2
  92. package/dist/workbench/studio/loop/StudioLoop.js +4 -10
  93. package/dist/workbench/studio/loop/WorkspaceBar.d.ts +15 -0
  94. package/dist/workbench/studio/loop/WorkspaceBar.js +52 -0
  95. package/dist/workbench/studio/loop/WorkspaceJourneys.d.ts +17 -0
  96. package/dist/workbench/studio/loop/WorkspaceJourneys.js +99 -0
  97. package/dist/workbench/studio/loop/WorkspaceLeft.d.ts +14 -0
  98. package/dist/workbench/studio/loop/WorkspaceLeft.js +42 -0
  99. package/dist/workbench/studio/loop/WorkspaceStage.d.ts +24 -0
  100. package/dist/workbench/studio/loop/WorkspaceStage.js +142 -0
  101. package/dist/workbench/studio/loop/WorkspaceSteps.d.ts +20 -0
  102. package/dist/workbench/studio/loop/WorkspaceSteps.js +96 -0
  103. package/dist/workbench/studio/loop/moments.js +0 -3
  104. package/dist/workbench/studio/loop/prototype-bridge.d.ts +8 -0
  105. package/dist/workbench/studio/loop/prototype-bridge.js +16 -0
  106. package/dist/workbench/studio/loop/prototype-document.d.ts +9 -0
  107. package/dist/workbench/studio/loop/prototype-document.js +90 -2
  108. package/dist/workbench/studio/loop/prototype-part.d.ts +43 -0
  109. package/dist/workbench/studio/loop/prototype-part.js +104 -0
  110. package/dist/workbench/studio/loop/types.d.ts +26 -26
  111. package/dist/workbench/studio/loop/types.js +0 -3
  112. package/dist/workbench/studio/loop/usePrototypeFrame.d.ts +6 -1
  113. package/dist/workbench/studio/loop/usePrototypeFrame.js +4 -0
  114. package/dist/workbench/studio/loop/workspace-journeys.d.ts +22 -0
  115. package/dist/workbench/studio/loop/workspace-journeys.js +63 -0
  116. package/dist/workbench/studio/loop/workspace-state.d.ts +94 -0
  117. package/dist/workbench/studio/loop/workspace-state.js +50 -0
  118. package/dist/workbench/studio/marks/ChangeList.d.ts +7 -0
  119. package/dist/workbench/studio/marks/ChangeList.js +70 -0
  120. package/dist/workbench/studio/marks/MarkHint.d.ts +18 -0
  121. package/dist/workbench/studio/marks/MarkHint.js +58 -0
  122. package/dist/workbench/studio/marks/MarkNumber.d.ts +6 -0
  123. package/dist/workbench/studio/marks/MarkNumber.js +24 -0
  124. package/dist/workbench/studio/marks/MarksLayer.d.ts +15 -0
  125. package/dist/workbench/studio/marks/MarksLayer.js +144 -0
  126. package/dist/workbench/studio/marks/PinNote.d.ts +13 -0
  127. package/dist/workbench/studio/marks/PinNote.js +49 -0
  128. package/dist/workbench/studio/marks/QueuedChanges.d.ts +6 -0
  129. package/dist/workbench/studio/marks/QueuedChanges.js +51 -0
  130. package/dist/workbench/studio/marks/WorkspaceMarks.d.ts +15 -0
  131. package/dist/workbench/studio/marks/WorkspaceMarks.js +67 -0
  132. package/dist/workbench/studio/marks/marks-message.d.ts +13 -0
  133. package/dist/workbench/studio/marks/marks-message.js +93 -0
  134. package/dist/workbench/studio/marks/marks.d.ts +105 -0
  135. package/dist/workbench/studio/marks/marks.js +133 -0
  136. package/dist/workbench/studio/marks/useMarking.d.ts +36 -0
  137. package/dist/workbench/studio/marks/useMarking.js +111 -0
  138. package/dist/workbench/studio/marks/useSendMarks.d.ts +18 -0
  139. package/dist/workbench/studio/marks/useSendMarks.js +80 -0
  140. package/dist/workbench/studio/types.d.ts +2 -0
  141. package/dist/workbench/studio/work/StudioLater.js +0 -1
  142. package/dist/workbench/studio/work/work-test-data.d.ts +6 -0
  143. package/package.json +6 -6
  144. package/dist/workbench/studio/loop/FsPlan.d.ts +0 -7
  145. package/dist/workbench/studio/loop/FsPlan.js +0 -64
  146. package/dist/workbench/studio/loop/FsStage.d.ts +0 -6
  147. package/dist/workbench/studio/loop/FsStage.js +0 -74
  148. package/dist/workbench/studio/loop/FsToolbar.d.ts +0 -6
  149. package/dist/workbench/studio/loop/FsToolbar.js +0 -61
  150. package/dist/workbench/studio/loop/FullScreen.d.ts +0 -5
  151. package/dist/workbench/studio/loop/FullScreen.js +0 -89
  152. package/dist/workbench/studio/loop/PrototypePreviewMenus.d.ts +0 -18
  153. package/dist/workbench/studio/loop/PrototypePreviewMenus.js +0 -75
  154. package/dist/workbench/studio/loop/PrototypePreviewToolbar.d.ts +0 -27
  155. package/dist/workbench/studio/loop/PrototypePreviewToolbar.js +0 -52
  156. package/dist/workbench/studio/loop/fsViews.d.ts +0 -12
  157. package/dist/workbench/studio/loop/fsViews.js +0 -6
@@ -0,0 +1,15 @@
1
+ import type { IconName } from '../../../components/icons.ts';
2
+ import type { ProtoView } from './protoView.ts';
3
+ import { type WorkspaceTool } from './workspace-state.tsx';
4
+ type Device = NonNullable<ProtoView['device']>;
5
+ type Orientation = NonNullable<ProtoView['orientation']>;
6
+ export declare const TOOL_ICON: Record<WorkspaceTool, IconName>;
7
+ export declare const DEVICE_ICON: Record<Device, IconName>;
8
+ export declare function WorkspaceBar({ device, orientation, narrow, onDevice, onOrientation, }: {
9
+ device: Device;
10
+ orientation: Orientation;
11
+ narrow: boolean;
12
+ onDevice?: (device: Device) => void;
13
+ onOrientation?: (orientation: Orientation) => void;
14
+ }): import("react").JSX.Element;
15
+ export {};
@@ -0,0 +1,52 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ // The workspace's bar: what you look at (Customer app | Console, Mobile | Tablet | Desktop, Rotate
3
+ // for the tablet) and what a click on the app does (Select | Comment | Draw | Area).
4
+ import { useT } from '@buffcore/i18n/react';
5
+ import { visuallyHidden } from '../../../components/field.js';
6
+ import { Icon } from '../../../components/Icon.js';
7
+ import { IconButton } from '../../../components/IconButton.js';
8
+ import { Segmented } from '../frame/Segmented.js';
9
+ import { useWorkspace, WORKSPACE_TOOLS } from './workspace-state.js';
10
+ export const TOOL_ICON = {
11
+ select: 'mouse-pointer',
12
+ comment: 'message-square',
13
+ draw: 'pencil',
14
+ area: 'layers',
15
+ };
16
+ export const DEVICE_ICON = {
17
+ mobile: 'smartphone',
18
+ tablet: 'tablet',
19
+ desktop: 'monitor',
20
+ };
21
+ /** An icon and its word; on a phone-wide studio the word is for screen readers only. */
22
+ function Labelled({ icon, text, short }) {
23
+ return (_jsxs("span", { style: { display: 'inline-flex', alignItems: 'center', gap: 'var(--space-1)' }, children: [_jsx(Icon, { name: icon, size: "var(--icon-sm)" }), short ? _jsx("span", { style: visuallyHidden, children: text }) : text] }));
24
+ }
25
+ export function WorkspaceBar({ device, orientation, narrow, onDevice, onOrientation, }) {
26
+ const t = useT();
27
+ const space = useWorkspace();
28
+ return (_jsxs("div", { "data-workspace-bar": true, "data-prototype-focus-group": "toolbar", style: {
29
+ display: 'flex',
30
+ flexWrap: 'wrap',
31
+ alignItems: 'center',
32
+ gap: 'var(--space-2) var(--space-3)',
33
+ padding: 'var(--space-2) var(--space-4)',
34
+ borderBlockEnd: 'var(--border-width-hairline) solid var(--border-hairline)',
35
+ background: 'var(--surface-page)',
36
+ minInlineSize: 0,
37
+ }, children: [_jsx(Segmented, { label: t('studio.workspace.where'), value: space.app, tall: narrow, onChange: space.setApp, options: [
38
+ {
39
+ value: 'app',
40
+ label: _jsx(Labelled, { icon: "smartphone", text: t('studio.workspace.app') }),
41
+ },
42
+ {
43
+ value: 'console',
44
+ label: _jsx(Labelled, { icon: "monitor", text: t('studio.workspace.console') }),
45
+ },
46
+ ] }), _jsx(Segmented, { label: t('studio.workspace.device'), value: device, tall: narrow, onChange: onDevice, options: ['mobile', 'tablet', 'desktop'].map((choice) => ({
47
+ value: choice,
48
+ label: (_jsx(Labelled, { icon: DEVICE_ICON[choice], text: t(`studio.workspace.device.${choice}`), short: narrow })),
49
+ })) }), device === 'tablet' && (_jsx(IconButton, { icon: "rotate-ccw", size: narrow ? 'md' : 'sm', label: t('studio.workspace.rotate'), pressed: orientation === 'landscape', disabled: !onOrientation, onClick: () => onOrientation?.(orientation === 'landscape' ? 'portrait' : 'landscape') })), _jsx("span", { style: { flex: 1 } }), _jsx("div", { role: "toolbar", "aria-label": t('studio.workspace.tools'), style: { display: 'flex', gap: 'var(--space-1)' }, children: WORKSPACE_TOOLS.map((tool) => (_jsx(IconButton, { icon: TOOL_ICON[tool], label: t(`studio.workspace.tool.${tool}`), pressed: space.tool === tool, size: narrow ? 'md' : 'sm', variant: "secondary",
50
+ // The console is not pictured yet: the line above the device says so.
51
+ disabled: space.app === 'console' && tool !== 'select', onClick: () => space.setTool(tool) }, tool))) })] }));
52
+ }
@@ -0,0 +1,17 @@
1
+ import type { CSSProperties } from 'react';
2
+ import type { WorkspaceGroup, WorkspaceJourney } from './workspace-journeys.ts';
3
+ export declare const rowButton: CSSProperties;
4
+ /** A row at full touch size on a phone-wide studio. */
5
+ export declare function useRowButton(): CSSProperties;
6
+ /** A step's name, or "Step n" where the plan names none. */
7
+ export declare function useStepName(): (journey: WorkspaceJourney, step: number) => string;
8
+ export interface JourneyListProps {
9
+ groups: readonly WorkspaceGroup[];
10
+ /** The open journey (its id and app) and the step it is on. */
11
+ open?: WorkspaceJourney;
12
+ step: number;
13
+ onOpen: (journey: WorkspaceJourney) => void;
14
+ /** Jump to a step of the open journey; none while it cannot move (the app is not ready). */
15
+ onStep?: (step: number) => void;
16
+ }
17
+ export declare function JourneyList({ groups, open, step, onOpen, onStep }: JourneyListProps): import("react").JSX.Element;
@@ -0,0 +1,99 @@
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ // The workspace's journeys, by who does them and in which app; the open one lists its steps to jump
3
+ // to. A journey the running app plays is played; a console journey is followed by hand.
4
+ import { formatNumber, isRtl } from '@buffcore/i18n';
5
+ import { useLocale, useT } from '@buffcore/i18n/react';
6
+ import { Icon } from '../../../components/Icon.js';
7
+ import { captionText } from '../../../components/styles.js';
8
+ import { usePrototypeNarrow } from '../frame/layout.js';
9
+ const caps = {
10
+ ...captionText,
11
+ margin: 0,
12
+ display: 'flex',
13
+ gap: 'var(--space-2)',
14
+ alignItems: 'center',
15
+ textTransform: 'uppercase',
16
+ letterSpacing: 'var(--tracking-caps)',
17
+ };
18
+ export const rowButton = {
19
+ display: 'flex',
20
+ alignItems: 'center',
21
+ gap: 'var(--space-2)',
22
+ inlineSize: '100%',
23
+ minBlockSize: 'var(--control-sm)',
24
+ padding: 'var(--space-1) var(--space-2)',
25
+ border: 0,
26
+ borderRadius: 'var(--radius-control)',
27
+ background: 'transparent',
28
+ color: 'var(--text-body)',
29
+ fontFamily: 'var(--font-body)',
30
+ fontSize: 'var(--font-size-label)',
31
+ lineHeight: 'var(--line-height-label)',
32
+ textAlign: 'start',
33
+ cursor: 'pointer',
34
+ };
35
+ /** A row at full touch size on a phone-wide studio. */
36
+ export function useRowButton() {
37
+ return usePrototypeNarrow() ? { ...rowButton, minBlockSize: 'var(--control-md)' } : rowButton;
38
+ }
39
+ /** A step's name, or "Step n" where the plan names none. */
40
+ export function useStepName() {
41
+ const t = useT();
42
+ const { locale } = useLocale();
43
+ return (journey, step) => journey.steps[step] || t('studio.workspace.stepName', { n: formatNumber(locale, step + 1) });
44
+ }
45
+ function Steps({ journey, step, onStep, }) {
46
+ const t = useT();
47
+ const { locale } = useLocale();
48
+ const name = useStepName();
49
+ const row = useRowButton();
50
+ return (_jsx("ol", { "aria-label": t('studio.workspace.steps', { journey: journey.name }), style: {
51
+ listStyle: 'none',
52
+ margin: 0,
53
+ padding: 0,
54
+ display: 'grid',
55
+ gap: 'var(--space-1)',
56
+ paddingInlineStart: 'var(--space-5)',
57
+ }, children: journey.steps.map((_, n) => {
58
+ const on = !!onStep && n === step;
59
+ return (_jsx("li", { children: _jsxs("button", { type: "button", "aria-current": on ? 'step' : undefined, "aria-label": t('studio.workspace.stepGo', {
60
+ n: formatNumber(locale, n + 1),
61
+ name: name(journey, n),
62
+ }), disabled: !onStep, onClick: () => onStep?.(n), style: {
63
+ ...row,
64
+ cursor: onStep ? 'pointer' : 'default',
65
+ background: on ? 'var(--brand-tint)' : 'transparent',
66
+ color: on ? 'var(--brand-ink)' : 'var(--text-body)',
67
+ fontWeight: on ? 'var(--weight-bold)' : 'var(--weight-regular)',
68
+ }, children: [_jsx("span", { "aria-hidden": "true", style: {
69
+ ...captionText,
70
+ inlineSize: 'var(--space-5)',
71
+ display: 'inline-flex',
72
+ justifyContent: 'center',
73
+ color: 'inherit',
74
+ }, children: onStep && n < step ? (_jsx(Icon, { name: "check", size: "var(--icon-sm)" })) : (formatNumber(locale, n + 1)) }), _jsx("span", { style: { minInlineSize: 0, overflowWrap: 'anywhere' }, children: name(journey, n) })] }) }, n));
75
+ }) }));
76
+ }
77
+ export function JourneyList({ groups, open, step, onOpen, onStep }) {
78
+ const t = useT();
79
+ const { locale } = useLocale();
80
+ // A closed journey's chevron points along the reading direction.
81
+ const closed = isRtl(locale) ? 'chevron-left' : 'chevron-right';
82
+ const row = useRowButton();
83
+ if (groups.length === 0)
84
+ return _jsx("p", { style: { margin: 0 }, children: t('studio.workspace.none') });
85
+ return (_jsx("div", { style: { display: 'grid', gap: 'var(--space-4)', alignContent: 'start' }, children: groups.map((group) => {
86
+ const app = t(group.where === 'app' ? 'studio.workspace.app' : 'studio.workspace.console');
87
+ const label = group.role
88
+ ? t('studio.workspace.group', { role: group.role, app })
89
+ : t('studio.workspace.other', { app });
90
+ return (_jsxs("section", { "aria-label": label, style: { display: 'grid', gap: 'var(--space-1)' }, children: [_jsxs("h3", { style: caps, children: [_jsx(Icon, { name: group.where === 'app' ? 'smartphone' : 'monitor', size: "var(--icon-sm)" }), label] }), group.journeys.map((journey) => {
91
+ const opened = open?.id === journey.id && open.where === journey.where;
92
+ return (_jsxs("div", { style: { display: 'grid', gap: 'var(--space-1)' }, children: [_jsxs("button", { type: "button", "aria-expanded": opened, "data-journey-choice": journey.key, "data-journey-plan": journey.key ? undefined : journey.id, onClick: () => onOpen(journey), style: {
93
+ ...row,
94
+ color: 'var(--text-strong)',
95
+ fontWeight: opened ? 'var(--weight-bold)' : 'var(--weight-medium)',
96
+ }, children: [_jsx(Icon, { name: opened ? 'chevron-down' : closed, size: "var(--icon-sm)" }), _jsx("span", { translate: "no", style: { flex: 1, minInlineSize: 0 }, children: journey.name }), _jsx("span", { "aria-hidden": "true", style: captionText, children: formatNumber(locale, journey.steps.length) })] }), opened && (_jsxs(_Fragment, { children: [_jsx(Steps, { journey: journey, step: step, onStep: onStep }), journey.where === 'app' && !journey.key && (_jsx("p", { style: { ...captionText, margin: 0 }, children: t('studio.workspace.notPlayable') })), journey.where === 'console' && (_jsx("p", { style: { ...captionText, margin: 0 }, children: t('studio.workspace.byHand') }))] }))] }, journey.id));
97
+ })] }, `${group.where}:${group.role ?? ''}`));
98
+ }) }));
99
+ }
@@ -0,0 +1,14 @@
1
+ import type { Left } from './prototype-bridge.ts';
2
+ import type { DataState } from './protoView.ts';
3
+ import { type JourneyListProps } from './WorkspaceJourneys.tsx';
4
+ export interface WorkspaceLeftProps extends JourneyListProps {
5
+ /** The running app answered: when it plays no journey, the list says so. */
6
+ ready?: boolean;
7
+ left?: readonly Left[];
8
+ data?: DataState;
9
+ dataStates?: readonly DataState[];
10
+ onData?: (data: DataState) => void;
11
+ /** Opens the help for an app whose sign-in needs its own tab. */
12
+ onSignInHelp?: () => void;
13
+ }
14
+ export declare function WorkspaceLeft({ ready, left, data, dataStates, onData, onSignInHelp, ...journeys }: WorkspaceLeftProps): import("react").JSX.Element;
@@ -0,0 +1,42 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ // The workspace's left side: Journeys and Screens a tab apart, the sample data's state at the foot.
3
+ // On a phone-wide studio the same content is the Journeys sheet.
4
+ import { sceneUrl } from '@buffcore/config';
5
+ import { useLocale, useT } from '@buffcore/i18n/react';
6
+ import { useState } from 'react';
7
+ import { Button } from '../../../components/Button.js';
8
+ import { Select } from '../../../components/Select.js';
9
+ import { Tabs } from '../../../components/Tabs.js';
10
+ import { pageMode } from '../frame/layout.js';
11
+ import { LeftOut } from './PrototypeLeftOut.js';
12
+ import { JourneyList, useRowButton } from './WorkspaceJourneys.js';
13
+ import { useWorkspace } from './workspace-state.js';
14
+ function Screens() {
15
+ const t = useT();
16
+ const { locale } = useLocale();
17
+ const space = useWorkspace();
18
+ const row = useRowButton();
19
+ const base = space.app === 'app' ? space.setup.appUrl : space.setup.consoleUrl;
20
+ const screens = space.setup.screens?.[space.app] ?? [];
21
+ if (!base || screens.length === 0)
22
+ return _jsx("p", { style: { margin: 0 }, children: t('studio.workspace.screens.none') });
23
+ const look = { theme: '', mode: pageMode() ?? 'light', locale };
24
+ return (_jsx("ul", { style: { listStyle: 'none', margin: 0, padding: 0, display: 'grid' }, children: screens.map((screen) => (_jsx("li", { children: _jsx("a", { href: sceneUrl(base.replace(/\/+$/, ''), screen.scene, look), target: "_blank", rel: "noopener noreferrer", "aria-label": t('studio.workspace.screens.open', { screen: screen.label }), style: { ...row, color: 'var(--brand-ink)', textDecoration: 'none' }, children: _jsx("span", { translate: "no", style: { minInlineSize: 0, overflowWrap: 'anywhere' }, children: screen.label }) }) }, screen.scene))) }));
25
+ }
26
+ export function WorkspaceLeft({ ready, left, data, dataStates, onData, onSignInHelp, ...journeys }) {
27
+ const t = useT();
28
+ const [tab, setTab] = useState('journeys');
29
+ const offered = dataStates ?? [];
30
+ return (_jsxs("div", { "data-workspace-left": true, style: {
31
+ minBlockSize: 0,
32
+ display: 'grid',
33
+ gridTemplateRows: 'auto minmax(0, 1fr) auto',
34
+ gap: 'var(--space-4)',
35
+ }, children: [_jsx(Tabs, { label: t('studio.workspace.left'), value: tab, onChange: setTab, tabs: [
36
+ ['journeys', t('studio.workspace.journeys')],
37
+ ['screens', t('studio.workspace.screens')],
38
+ ] }), _jsx("div", { "data-workspace-list": true, style: { minBlockSize: 0, overflow: 'auto', display: 'grid', alignContent: 'start' }, children: tab === 'journeys' ? (_jsxs("div", { style: { display: 'grid', gap: 'var(--space-3)' }, children: [ready && !journeys.groups.some((group) => group.journeys.some((j) => j.key)) && (_jsx("p", { style: { margin: 0 }, children: t('studio.prototype.none') })), _jsx(JourneyList, { ...journeys }), _jsx(LeftOut, { left: left })] })) : (_jsx(Screens, {})) }), _jsxs("div", { style: { display: 'grid', gap: 'var(--space-2)' }, children: [_jsx("div", { title: offered.length ? undefined : t('simple.data.unavailable'), children: _jsx(Select, { label: t('studio.workspace.data'), size: "sm", value: data && offered.includes(data) ? data : (offered[0] ?? 'full'), disabled: !onData || offered.length === 0, onChange: (value) => onData?.(value), options: (offered.length ? offered : ['full']).map((state) => ({
39
+ value: state,
40
+ label: t(`simple.data.${state}`),
41
+ })) }) }), onSignInHelp && (_jsx(Button, { variant: "ghost", icon: "circle-help", onClick: onSignInHelp, style: { justifySelf: 'start' }, children: t('simple.options.signin') }))] })] }));
42
+ }
@@ -0,0 +1,24 @@
1
+ import { type ReactNode } from 'react';
2
+ import type { ProtoView } from './protoView.ts';
3
+ import { type WorkspaceStage as Stage } from './workspace-state.tsx';
4
+ type Device = NonNullable<ProtoView['device']>;
5
+ type Orientation = NonNullable<ProtoView['orientation']>;
6
+ /** Each device's screen in CSS pixels, upright. */
7
+ export declare const DEVICE_SIZES: Record<Device, {
8
+ w: number;
9
+ h: number;
10
+ }>;
11
+ export declare function deviceSize(device: Device, orientation: Orientation): {
12
+ w: number;
13
+ h: number;
14
+ };
15
+ export declare function WorkspaceStage({ device, orientation, narrow, app, where, partAt, show, below, }: Pick<Stage, 'partAt' | 'show'> & {
16
+ device: Device;
17
+ orientation: Orientation;
18
+ narrow: boolean;
19
+ /** The customer app's frame, or what stands in for it. */
20
+ app: ReactNode;
21
+ where: Stage['where'];
22
+ below?: ReactNode;
23
+ }): import("react").JSX.Element;
24
+ export {};
@@ -0,0 +1,142 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ // The workspace's stage: the shown app in its device, at the device's own size and zoomed to the
3
+ // room it has, with the line saying what you see above it and the journey's step bar under it.
4
+ // The customer app and the console are two frames: the hidden one stays loaded, so switching keeps
5
+ // each one's step and never reloads it.
6
+ import { isRtl } from '@buffcore/i18n';
7
+ import { useLocale, useT } from '@buffcore/i18n/react';
8
+ import { useLayoutEffect, useMemo, useRef, useState, useSyncExternalStore, } from 'react';
9
+ import { Icon } from '../../../components/Icon.js';
10
+ import { captionText } from '../../../components/styles.js';
11
+ import { NARROW_BELOW } from '../frame/layout.js';
12
+ import { MarkHint } from '../marks/MarkHint.js';
13
+ import { ConsoleFrame } from './ConsoleFrame.js';
14
+ import { useWorkspace, WorkspaceStageContext, } from './workspace-state.js';
15
+ /** Each device's screen in CSS pixels, upright. */
16
+ export const DEVICE_SIZES = {
17
+ mobile: { w: 390, h: 844 },
18
+ tablet: { w: 820, h: 1180 },
19
+ desktop: { w: 1024, h: 640 },
20
+ };
21
+ export function deviceSize(device, orientation) {
22
+ const { w, h } = DEVICE_SIZES[device];
23
+ return device === 'tablet' && orientation === 'landscape' ? { w: h, h: w } : { w, h };
24
+ }
25
+ /** The zoom that fits the screen in the room (never above its own size); 1 where unmeasured. */
26
+ function useFit(w, h) {
27
+ const room = useRef(null);
28
+ const [zoom, setZoom] = useState(1);
29
+ useLayoutEffect(() => {
30
+ const el = room.current;
31
+ if (!el || typeof ResizeObserver === 'undefined')
32
+ return;
33
+ const fit = () => {
34
+ const { width, height } = el.getBoundingClientRect();
35
+ if (width > 0 && height > 0)
36
+ setZoom(Math.min(width / w, height / h, 1));
37
+ };
38
+ fit();
39
+ const watch = new ResizeObserver(fit);
40
+ watch.observe(el);
41
+ return () => watch.disconnect();
42
+ }, [w, h]);
43
+ return { room, zoom };
44
+ }
45
+ const COARSE = '(pointer: coarse)';
46
+ const watchPointer = (update) => {
47
+ const list = globalThis.matchMedia?.(COARSE);
48
+ list?.addEventListener('change', update);
49
+ return () => list?.removeEventListener('change', update);
50
+ };
51
+ /** Whether a finger is the pointer, so the hint says tap rather than click. */
52
+ function useTouch() {
53
+ return useSyncExternalStore(watchPointer, () => globalThis.matchMedia?.(COARSE).matches ?? false, () => false);
54
+ }
55
+ const layer = { position: 'absolute', inset: 0 };
56
+ // The bezel is drawn by a rule, so a page served before the frame measures its width draws a
57
+ // phone-wide studio's phone without one from the first paint (a tablet or desktop keeps it).
58
+ const bezel = `
59
+ [data-preview-device]:not([data-preview-device="unframed"]) {
60
+ border: var(--border-width-panel) solid var(--border-default);
61
+ border-radius: var(--radius-overlay);
62
+ box-shadow: var(--shadow-panel);
63
+ }
64
+ [data-preview-device="mobile"] { border-radius: var(--radius-xl); }
65
+ @media (width < ${NARROW_BELOW}px) {
66
+ [data-preview-device="mobile"]:not([data-prototype-layout-known] *) {
67
+ border: 0;
68
+ border-radius: 0;
69
+ box-shadow: none;
70
+ }
71
+ }`;
72
+ export function WorkspaceStage({ device, orientation, narrow, app, where, partAt, show, below, }) {
73
+ const t = useT();
74
+ const { locale } = useLocale();
75
+ const space = useWorkspace();
76
+ const touch = useTouch();
77
+ // On a phone-wide studio a phone's app takes the page, without a bezel; a tablet or a desktop
78
+ // is drawn in its bezel, zoomed to fit.
79
+ const bare = narrow && device === 'mobile';
80
+ const { w, h } = deviceSize(device, orientation);
81
+ const fit = useFit(w, h);
82
+ const zoom = bare ? 1 : fit.zoom;
83
+ const [screen, setScreen] = useState(null);
84
+ const stage = useMemo(() => ({
85
+ tool: space.tool,
86
+ app: space.app,
87
+ device,
88
+ orientation,
89
+ screen,
90
+ zoom,
91
+ where,
92
+ partAt,
93
+ show,
94
+ }), [space.tool, space.app, device, orientation, screen, zoom, where, partAt, show]);
95
+ const shown = t(space.app === 'app' ? 'studio.workspace.app' : 'studio.workspace.console');
96
+ return (_jsx(WorkspaceStageContext.Provider, { value: stage, children: _jsxs("div", { "data-workspace-stage": true, style: {
97
+ display: 'grid',
98
+ gridTemplateRows: 'auto minmax(0, 1fr) auto',
99
+ gap: 'var(--space-3)',
100
+ minBlockSize: 0,
101
+ minInlineSize: 0,
102
+ padding: bare
103
+ ? 'var(--space-2) 0 0'
104
+ : narrow
105
+ ? 'var(--space-3)'
106
+ : 'var(--space-4) var(--space-6)',
107
+ backgroundImage: 'radial-gradient(var(--border-hairline) 1px, transparent 1px)',
108
+ backgroundSize: 'var(--space-4) var(--space-4)',
109
+ }, children: [_jsxs("p", { "data-workspace-where": true, style: {
110
+ ...captionText,
111
+ margin: 0,
112
+ display: 'flex',
113
+ flexWrap: 'wrap',
114
+ gap: 'var(--space-2)',
115
+ alignItems: 'center',
116
+ justifyContent: 'center',
117
+ // A phone's bare app takes the full width; the line keeps off the edges.
118
+ paddingInline: bare ? 'var(--space-3)' : 0,
119
+ }, children: [_jsx(Icon, { name: space.app === 'app' ? 'smartphone' : 'monitor', size: "var(--icon-sm)" }), t('studio.workspace.screen', {
120
+ app: shown,
121
+ screen: where.screen,
122
+ device: t(`studio.workspace.device.${device}`),
123
+ }), _jsx(MarkHint, { tool: space.tool, touch: touch, console: space.app === 'console' })] }), _jsx("style", { children: bezel }), _jsx("div", { ref: fit.room, style: { minBlockSize: 0, minInlineSize: 0, display: 'grid', placeItems: 'center' }, children: _jsxs("section", { "data-preview-device": bare ? 'unframed' : device, "aria-label": t('simple.frame'), style: {
124
+ position: 'relative',
125
+ boxSizing: 'content-box',
126
+ inlineSize: bare ? '100%' : w * zoom,
127
+ blockSize: bare ? '100%' : h * zoom,
128
+ // Paint containment clips the scaled screen to the bezel without counting the
129
+ // screen's own (unscaled) size as overflow.
130
+ contain: 'paint',
131
+ background: 'var(--surface-canvas)',
132
+ }, children: [_jsxs("div", { ref: setScreen, "data-workspace-screen": true, style: bare
133
+ ? layer
134
+ : {
135
+ ...layer,
136
+ inlineSize: w,
137
+ blockSize: h,
138
+ transform: `scale(${zoom})`,
139
+ // Scaled from the start corner, which the screen sits in.
140
+ transformOrigin: isRtl(locale) ? '100% 0' : '0 0',
141
+ }, children: [_jsx("div", { hidden: space.app !== 'app', style: layer, children: _jsx("div", { style: { blockSize: '100%', overflow: 'auto' }, children: app }) }), space.consoleShown && (_jsx("div", { hidden: space.app !== 'console', style: layer, children: space.setup.console ?? _jsx(ConsoleFrame, { url: space.setup.consoleUrl }) }))] }), space.setup.overlay] }) }), below] }) }));
142
+ }
@@ -0,0 +1,20 @@
1
+ export interface WorkspacePlay {
2
+ journey: string;
3
+ step: number;
4
+ total: number;
5
+ caption: string;
6
+ /** The app is not ready to move yet; the buttons stay but do nothing. */
7
+ pending?: boolean;
8
+ onStep: (step: number) => void;
9
+ }
10
+ /** How long Play shows each step before the next. */
11
+ export declare const PLAY_EVERY = 2500;
12
+ export declare function StepBar({ play, context }: {
13
+ play: WorkspacePlay;
14
+ context: string;
15
+ }): import("react").JSX.Element;
16
+ /** The foot bar on a phone-wide studio: the app takes the page above it. */
17
+ export declare function FootBar({ play, onJourneys }: {
18
+ play?: WorkspacePlay;
19
+ onJourneys: () => void;
20
+ }): import("react").JSX.Element;
@@ -0,0 +1,96 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ // The journey's step bar, under the device and never over it (Back, where you are, Play, Next), and
3
+ // on a phone-wide studio the bar at the app's foot (Journeys, Back, the step, Next, Changes).
4
+ import { formatNumber, isRtl } from '@buffcore/i18n';
5
+ import { useLocale, useT } from '@buffcore/i18n/react';
6
+ import { useContext, useEffect, useState } from 'react';
7
+ import { Button } from '../../../components/Button.js';
8
+ import { IconButton } from '../../../components/IconButton.js';
9
+ import { captionText } from '../../../components/styles.js';
10
+ import { StudioPaneContext } from '../frame/layout.js';
11
+ import { useWorkspace } from './workspace-state.js';
12
+ /** How long Play shows each step before the next. */
13
+ export const PLAY_EVERY = 2500;
14
+ /**
15
+ * Play's state belongs to one journey in one place: `context` names it (the app, the journey, the
16
+ * device), and any switch of it stops Play, so a timer never moves another journey's steps.
17
+ */
18
+ function useAutoPlay({ step, total, pending, onStep }, context) {
19
+ const [state, setState] = useState({ context, playing: false });
20
+ // A switch forgets Play, so coming back to the same journey does not start it again.
21
+ if (state.context !== context)
22
+ setState({ context, playing: false });
23
+ const playing = state.context === context && state.playing;
24
+ const last = step >= total - 1;
25
+ useEffect(() => {
26
+ if (!playing || pending)
27
+ return;
28
+ if (last) {
29
+ setState({ context, playing: false });
30
+ return;
31
+ }
32
+ const timer = setTimeout(() => onStep(step + 1), PLAY_EVERY);
33
+ return () => clearTimeout(timer);
34
+ }, [playing, pending, last, step, onStep, context]);
35
+ return { playing, toggle: () => setState({ context, playing: !playing && !last }) };
36
+ }
37
+ function Where({ play, named }) {
38
+ const t = useT();
39
+ const { locale } = useLocale();
40
+ const n = formatNumber(locale, play.step + 1);
41
+ const total = formatNumber(locale, play.total);
42
+ return (_jsxs("span", { "aria-live": "polite", style: { display: 'grid', textAlign: 'center', minInlineSize: 0 }, children: [_jsx("strong", { style: { ...captionText, color: 'var(--text-strong)', overflowWrap: 'anywhere' }, children: named
43
+ ? t('studio.workspace.stepOf', { journey: play.journey, n, total })
44
+ : t('simple.try.step', { n, total }) }), _jsx("span", { style: {
45
+ ...captionText,
46
+ ...(named
47
+ ? { overflowWrap: 'anywhere' }
48
+ : { overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }),
49
+ }, children: play.caption })] }));
50
+ }
51
+ const bar = {
52
+ boxSizing: 'border-box',
53
+ display: 'grid',
54
+ alignItems: 'center',
55
+ gap: 'var(--space-2)',
56
+ padding: 'var(--space-2)',
57
+ background: 'var(--surface-panel)',
58
+ };
59
+ export function StepBar({ play, context }) {
60
+ const t = useT();
61
+ const { locale } = useLocale();
62
+ const rtl = isRtl(locale);
63
+ const auto = useAutoPlay(play, context);
64
+ const go = (step) => {
65
+ if (!play.pending)
66
+ play.onStep(step);
67
+ };
68
+ return (_jsxs("section", { "data-prototype-focus-group": true, "data-preview-player": true, "aria-label": t('simple.player'), style: {
69
+ ...bar,
70
+ inlineSize: '100%',
71
+ maxInlineSize: 'calc(var(--space-6) * 24)',
72
+ justifySelf: 'center',
73
+ gridTemplateColumns: 'auto minmax(0, 1fr) auto auto',
74
+ border: 'var(--border-width-hairline) solid var(--border-default)',
75
+ borderRadius: 'var(--radius-panel)',
76
+ }, children: [_jsx(Button, { variant: "secondary", size: "sm", icon: rtl ? 'chevron-right' : 'chevron-left', disabled: play.step === 0, "aria-disabled": play.pending || undefined, onClick: () => go(play.step - 1), children: t('simple.player.back') }), _jsx(Where, { play: play, named: true }), _jsx(IconButton, { icon: auto.playing ? 'pause' : 'play', size: "sm", label: t(auto.playing ? 'studio.workspace.pause' : 'studio.workspace.play'), pressed: auto.playing, disabled: !auto.playing && play.step >= play.total - 1, onClick: auto.toggle }), _jsx(Button, { variant: "tonal", size: "sm", iconEnd: rtl ? 'chevron-left' : 'chevron-right', disabled: play.step >= play.total - 1, "aria-disabled": play.pending || undefined, onClick: () => go(play.step + 1), children: t('simple.player.next') })] }));
77
+ }
78
+ /** The foot bar on a phone-wide studio: the app takes the page above it. */
79
+ export function FootBar({ play, onJourneys }) {
80
+ const t = useT();
81
+ const { locale } = useLocale();
82
+ const rtl = isRtl(locale);
83
+ const showPane = useContext(StudioPaneContext);
84
+ const count = useWorkspace().setup.changes ?? 0;
85
+ const go = (step) => {
86
+ if (play && !play.pending)
87
+ play.onStep(step);
88
+ };
89
+ return (_jsxs("section", { "data-prototype-focus-group": true, "data-workspace-foot": true, "data-preview-player": play ? '' : undefined, "aria-label": t('simple.player'), style: {
90
+ ...bar,
91
+ gridTemplateColumns: 'auto auto minmax(0, 1fr) auto auto',
92
+ padding: 'var(--space-2) var(--space-3)',
93
+ borderBlockStart: 'var(--border-width-hairline) solid var(--border-hairline)',
94
+ background: 'var(--surface-page)',
95
+ }, children: [_jsx(IconButton, { icon: "list-checks", variant: "secondary", label: t('studio.workspace.journeys'), onClick: onJourneys }), _jsx(IconButton, { icon: rtl ? 'chevron-right' : 'chevron-left', label: t('simple.player.back'), disabled: !play || play.step === 0, onClick: () => play && go(play.step - 1) }), play ? _jsx(Where, { play: play, named: false }) : _jsx("span", {}), _jsx(IconButton, { icon: rtl ? 'chevron-left' : 'chevron-right', label: t('simple.player.next'), disabled: !play || play.step >= play.total - 1, onClick: () => play && go(play.step + 1) }), _jsx(Button, { variant: count ? 'primary' : 'secondary', icon: "message-square", "aria-label": count ? t('studio.workspace.changes.count', { count }) : undefined, disabled: !showPane, onClick: () => showPane?.('agent'), children: count ? formatNumber(locale, count) : t('studio.workspace.changes') })] }));
96
+ }
@@ -31,7 +31,4 @@ export const MOMENTS = {
31
31
  'proto-states': guide('prototype', 'prototype', { onChange: true }),
32
32
  'proto-lanes': { page: 'prototype', rail: places, level: 'guide' },
33
33
  'proto-drift': { page: 'prototype', rail: places, level: 'guide' },
34
- 'fs-tablet': guide('prototype', 'prototype', { onChange: true, cover: true }),
35
- 'fs-overview': guide('prototype', 'prototype', { onChange: true, cover: true }),
36
- 'fs-change': guide('prototype', 'prototype', { onChange: true, cover: true }),
37
34
  };
@@ -108,6 +108,14 @@ export declare function prototypeReady(data: unknown, expected: {
108
108
  navigation: string;
109
109
  document: string;
110
110
  }): PrototypeDiscovery | undefined;
111
+ /**
112
+ * The app says, on its private port and before its reply, that it plays the studio's show
113
+ * messages. An app without it (an older app-shell) is reloaded at each step instead.
114
+ */
115
+ export declare function prototypePlayer(data: unknown, expected: {
116
+ navigation: string;
117
+ document: string;
118
+ }): boolean;
111
119
  /** Heartbeats renew an existing proof; they never discover journeys or enable a waiting frame. */
112
120
  export declare function prototypeHeartbeat(data: unknown, expected: {
113
121
  navigation: string;
@@ -218,6 +218,22 @@ export function prototypeReady(data, expected) {
218
218
  const reply = prototypeReply(data, expected);
219
219
  return reply && 'discovery' in reply ? reply.discovery : undefined;
220
220
  }
221
+ const player = z.strictObject({
222
+ type: z.literal('ape:prototype:player'),
223
+ version: z.literal(2),
224
+ navigation: z.string().uuid(),
225
+ document: z.string().uuid(),
226
+ });
227
+ /**
228
+ * The app says, on its private port and before its reply, that it plays the studio's show
229
+ * messages. An app without it (an older app-shell) is reloaded at each step instead.
230
+ */
231
+ export function prototypePlayer(data, expected) {
232
+ const answer = player.safeParse(payload(data, 512));
233
+ return (answer.success &&
234
+ answer.data.navigation === expected.navigation &&
235
+ answer.data.document === expected.document);
236
+ }
221
237
  /** Heartbeats renew an existing proof; they never discover journeys or enable a waiting frame. */
222
238
  export function prototypeHeartbeat(data, expected) {
223
239
  const answer = heartbeat.safeParse(payload(data, 512));
@@ -1,4 +1,11 @@
1
1
  import { type FrameCause, type PrototypeDiscovery } from './prototype-bridge.ts';
2
+ import { type PrototypePart } from './prototype-part.ts';
3
+ /** What the studio asks the framed app to show: a journey at a step, or a preview data state. */
4
+ export type PrototypeShow = {
5
+ journey?: string;
6
+ step?: number;
7
+ data?: string;
8
+ };
2
9
  /** silent: a hello and then no reply and no beat. reply: the app's reply was refused whole (see cause). */
3
10
  export type FrameFailure = 'failed' | 'cookies' | 'silent' | 'reply';
4
11
  export type FrameAnswer = Partial<PrototypeDiscovery> & {
@@ -15,6 +22,8 @@ type Input = {
15
22
  };
16
23
  export declare function watchPrototypeDocument(input: Input): {
17
24
  alive: () => boolean;
25
+ show: (choice: PrototypeShow) => boolean;
26
+ partAt: (x: number, y: number) => Promise<PrototypePart | undefined>;
18
27
  fail: (failure?: FrameFailure, cause?: FrameCause) => void;
19
28
  timedOutSilently: () => boolean;
20
29
  close: () => void;