sitevision-cli 1.0.0-beta.30 → 1.0.0-beta.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.0.0-beta.31
4
+
5
+ - The help panel (`?`) now starts with a short guide to the pane you are in:
6
+ what it shows, how the values relate, and which keys apply. The Config guide
7
+ explains how local, shared and workspace settings layer on top of each
8
+ other. The panel scrolls when it does not fit.
9
+ - Updated dependencies.
10
+
3
11
  ## 1.0.0-beta.30
4
12
 
5
13
  - Dev and watch no longer rebuild on file events that change nothing, such as
@@ -1,6 +1,9 @@
1
1
  import { type Hint } from './Frame.js';
2
- export declare function HelpPanel({ here, height, onClose, }: {
2
+ import type { Tab } from './actions.js';
3
+ export type Where = Tab | 'nav' | 'workspace';
4
+ export declare function HelpPanel({ here, where, height, onClose, }: {
3
5
  here: Hint[];
6
+ where: Where;
4
7
  height: number;
5
8
  onClose: () => void;
6
9
  }): import("react").JSX.Element;
@@ -1,9 +1,56 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Box, Text, useInput } from 'ink';
2
+ import { useEffect, useRef, useState } from 'react';
3
+ import { Box, Text, measureElement, useInput } from 'ink';
3
4
  import { t } from '../utils/i18n.js';
4
5
  import { ACCENT } from './Frame.js';
5
6
  import { actions } from './actions.js';
6
7
  import { GROUPS } from './CommandPalette.js';
8
+ // What the pane you are in does, beyond the key list. One entry per paragraph.
9
+ const GUIDE = {
10
+ nav: {
11
+ title: 'Navigator',
12
+ text: [
13
+ 'Typing filters the app list. ↑↓ move, Enter selects the app and moves focus to the content pane. Action keys such as d or p only work there; in the navigator they search.',
14
+ 'The last row is Workspace settings: the shared root config that every app inherits.',
15
+ ],
16
+ },
17
+ workspace: {
18
+ title: 'Workspace settings',
19
+ text: [
20
+ "The root .dev_properties.json shared by every app, with the root package.json defaults underneath. Fill in site, auth and environments once; an app's own config overrides only what differs.",
21
+ 'Same keys as the Config tab: Enter edits and saves, Esc cancels, ←→ or space cycles choices.',
22
+ ],
23
+ },
24
+ overview: {
25
+ title: 'Overview',
26
+ text: [
27
+ 'Each status line names the key that fixes it: i installs dependencies, e opens Config, y syncs package.json, / sets up signing.',
28
+ 'The badge in the top bar is the active environment: green for the base, yellow for others, red for production. v cycles it.',
29
+ ],
30
+ },
31
+ config: {
32
+ title: 'Config',
33
+ text: [
34
+ 'Values come in layers and the source is shown next to each: your local .dev_properties.json wins, shared package.json values sit underneath, and in a workspace the root config underneath that. Environments add on top of the base and override only what differs.',
35
+ 'Enter edits and saves a field, Esc cancels, ←→ or space cycles choices, Ctrl+O lists the addons on the site. y copies shared values into package.json for the team.',
36
+ 'Passwords and secrets go to the OS keychain, never to a file. Leave them empty to be asked on each run.',
37
+ ],
38
+ },
39
+ versions: {
40
+ title: 'Versions',
41
+ text: [
42
+ "The versions uploaded to the addon on the active environment's site, the domain in the top bar. v switches environment.",
43
+ '↑↓ select, a activates the selected version, r refreshes. Production deploys activate on their own.',
44
+ ],
45
+ },
46
+ log: {
47
+ title: 'Log',
48
+ text: [
49
+ 'Output from build, sign, deploy, dev and watch for the selected app. Dev and watch keep running while you switch apps; K stops them.',
50
+ '↑↓ scroll, PgUp/PgDn page, f jumps to the end, x toggles line wrap.',
51
+ ],
52
+ },
53
+ };
7
54
  const MOVE = [
8
55
  ['Tab', 'switch pane'],
9
56
  ['1–4', 'tabs'],
@@ -15,17 +62,34 @@ const MOVE = [
15
62
  function Row({ keys, label }) {
16
63
  return (_jsxs(Text, { wrap: "truncate", children: [_jsx(Text, { bold: true, color: ACCENT, children: keys.padEnd(6) }), label] }));
17
64
  }
18
- export function HelpPanel({ here, height, onClose, }) {
65
+ export function HelpPanel({ here, where, height, onClose, }) {
66
+ const inner = useRef(null);
67
+ const [top, setTop] = useState(0);
68
+ const [total, setTotal] = useState(0);
69
+ useEffect(() => {
70
+ if (inner.current)
71
+ setTotal(measureElement(inner.current).height);
72
+ });
73
+ const visible = Math.max(1, height - 1);
74
+ const max = Math.max(0, total - visible);
19
75
  useInput((input, key) => {
20
76
  if (key.escape || key.return || input === '?' || input === 'q')
21
77
  onClose();
78
+ else if (key.upArrow)
79
+ setTop(n => Math.max(0, n - 1));
80
+ else if (key.downArrow)
81
+ setTop(n => Math.min(max, n + 1));
82
+ else if (key.pageUp)
83
+ setTop(n => Math.max(0, n - visible));
84
+ else if (key.pageDown)
85
+ setTop(n => Math.min(max, n + visible));
22
86
  });
23
87
  // Only keys not already listed elsewhere, e.g. f and x on the Log tab.
24
88
  const local = here.filter(hint => actions.every(action => action.key !== hint.key) &&
25
89
  MOVE.every(([keys]) => keys !== hint.key));
26
- return (_jsxs(Box, { flexDirection: "column", paddingX: 1, height: height, overflow: "hidden", children: [_jsxs(Text, { children: [_jsx(Text, { bold: true, children: t('Keys') }), _jsxs(Text, { dimColor: true, children: [" \u00B7 ", t('Esc close')] })] }), _jsxs(Box, { flexWrap: "wrap", columnGap: 4, children: [_jsx(Box, { flexDirection: "column", marginTop: 1, children: GROUPS.map(group => (_jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { bold: true, dimColor: true, children: t(group.label) }), actions.flatMap(action => action.group === group.id && action.key
27
- ? [
28
- _jsx(Row, { keys: action.key, label: t(action.label) }, action.id),
29
- ]
30
- : [])] }, group.id))) }), _jsxs(Box, { flexDirection: "column", marginTop: 1, children: [local.length > 0 && (_jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [_jsx(Text, { bold: true, dimColor: true, children: t('Here') }), local.map(hint => (_jsx(Row, { keys: hint.key, label: hint.label }, hint.key + hint.label)))] })), _jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { bold: true, dimColor: true, children: t('Move around') }), MOVE.map(([keys, label]) => (_jsx(Row, { keys: keys, label: t(label) }, keys + label)))] })] })] })] }));
90
+ return (_jsxs(Box, { flexDirection: "column", paddingX: 1, height: height, overflow: "hidden", children: [_jsxs(Text, { children: [_jsx(Text, { bold: true, children: t(GUIDE[where].title) }), _jsxs(Text, { dimColor: true, children: [' · ', max > 0 ? t('↑↓ scroll · Esc close') : t('Esc close')] })] }), _jsx(Box, { flexDirection: "column", overflow: "hidden", height: visible, children: _jsxs(Box, { ref: inner, flexDirection: "column", flexShrink: 0, marginTop: -top, children: [GUIDE[where].text.map(line => (_jsx(Text, { wrap: "wrap", children: t(line) }, line))), _jsx(Box, { marginTop: 1, children: _jsx(Text, { bold: true, children: t('Keys') }) }), _jsxs(Box, { flexWrap: "wrap", columnGap: 4, children: [_jsx(Box, { flexDirection: "column", children: GROUPS.map(group => (_jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { bold: true, dimColor: true, children: t(group.label) }), actions.flatMap(action => action.group === group.id && action.key
91
+ ? [
92
+ _jsx(Row, { keys: action.key, label: t(action.label) }, action.id),
93
+ ]
94
+ : [])] }, group.id))) }), _jsxs(Box, { flexDirection: "column", children: [local.length > 0 && (_jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [_jsx(Text, { bold: true, dimColor: true, children: t('Here') }), local.map(hint => (_jsx(Row, { keys: hint.key, label: hint.label }, hint.key + hint.label)))] })), _jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { bold: true, dimColor: true, children: t('Move around') }), MOVE.map(([keys, label]) => (_jsx(Row, { keys: keys, label: t(label) }, keys + label)))] })] })] })] }) })] }));
31
95
  }
@@ -432,6 +432,7 @@ export function Shell({ apps: initialApps, workspaceRoot, version, minimal = fal
432
432
  ['/', 'commands'],
433
433
  ['q', 'quit'],
434
434
  ]);
435
+ const where = focus === 'nav' && !settings ? 'nav' : settings ? 'workspace' : tab;
435
436
  const hereHints = focus === 'nav' && !settings
436
437
  ? navHints
437
438
  : settings
@@ -507,6 +508,7 @@ export function Shell({ apps: initialApps, workspaceRoot, version, minimal = fal
507
508
  renderOverlay(overlay, {
508
509
  project,
509
510
  here: hereHints,
511
+ where,
510
512
  closeOverlay,
511
513
  run,
512
514
  notify,
@@ -542,7 +544,7 @@ export function Shell({ apps: initialApps, workspaceRoot, version, minimal = fal
542
544
  : t(' · shared .dev_properties.json at the root') })] })) : (_jsx(TabBar, { tab: tab, narrow: narrow, focused: focus === 'content' })), _jsx(Box, { flexDirection: "column", height: contentHeight, overflow: "hidden", alignItems: "flex-start", children: content })] })] }), _jsx(BottomBar, { hints: hints, right: right }), popover && (_jsx(Popover, { columns: columns, rows: frameRows, width: popoverWidth, height: popoverHeight, children: popover }))] }));
543
545
  }
544
546
  function renderOverlay(overlay, env) {
545
- const { project, here, closeOverlay, run, notify, loadAddons, height, rerender, openWorkspace, } = env;
547
+ const { project, here, where, closeOverlay, run, notify, loadAddons, height, rerender, openWorkspace, } = env;
546
548
  switch (overlay.kind) {
547
549
  case 'palette':
548
550
  return (_jsx(CommandPalette, { project: project, onRun: run, onClose: closeOverlay, height: height }));
@@ -580,7 +582,7 @@ function renderOverlay(overlay, env) {
580
582
  overlay.resolve(null);
581
583
  } }));
582
584
  case 'help':
583
- return _jsx(HelpPanel, { here: here, height: height, onClose: closeOverlay });
585
+ return (_jsx(HelpPanel, { here: here, where: where, height: height, onClose: closeOverlay }));
584
586
  case 'changelog':
585
587
  return (_jsx(ChangelogPanel, { since: overlay.since, height: height, onClose: closeOverlay }));
586
588
  case 'settings':
@@ -103,6 +103,20 @@ const sv = {
103
103
  'switch pane': 'byt panel',
104
104
  tabs: 'flikar',
105
105
  help: 'hjälp',
106
+ // Help guide
107
+ 'Typing filters the app list. ↑↓ move, Enter selects the app and moves focus to the content pane. Action keys such as d or p only work there; in the navigator they search.': 'Skriv för att filtrera applistan. ↑↓ flyttar, Enter väljer appen och flyttar fokus till innehållspanelen. Åtgärdstangenter som d eller p fungerar bara där; i navigatorn söker de.',
108
+ 'The last row is Workspace settings: the shared root config that every app inherits.': 'Sista raden är Arbetsytans inställningar: den delade rotkonfigurationen som alla appar ärver.',
109
+ "The root .dev_properties.json shared by every app, with the root package.json defaults underneath. Fill in site, auth and environments once; an app's own config overrides only what differs.": 'Rotens .dev_properties.json som delas av alla appar, med rotens package.json som standardvärden under. Fyll i webbplats, autentisering och miljöer en gång; en apps egen konfig skriver bara över det som skiljer.',
110
+ 'Same keys as the Config tab: Enter edits and saves, Esc cancels, ←→ or space cycles choices.': 'Samma tangenter som Konfig-fliken: Enter redigerar och sparar, Esc avbryter, ←→ eller mellanslag bläddrar bland val.',
111
+ 'Each status line names the key that fixes it: i installs dependencies, e opens Config, y syncs package.json, / sets up signing.': 'Varje statusrad anger tangenten som åtgärdar den: i installerar beroenden, e öppnar Konfig, y synkar package.json, / sätter upp signering.',
112
+ 'The badge in the top bar is the active environment: green for the base, yellow for others, red for production. v cycles it.': 'Märket i toppraden är den aktiva miljön: grönt för basen, gult för övriga, rött för produktion. v växlar.',
113
+ 'Values come in layers and the source is shown next to each: your local .dev_properties.json wins, shared package.json values sit underneath, and in a workspace the root config underneath that. Environments add on top of the base and override only what differs.': 'Värden kommer i lager och källan visas bredvid varje: din lokala .dev_properties.json vinner, delade värden i package.json ligger under, och i en arbetsyta rotkonfigurationen under det. Miljöer läggs ovanpå basen och skriver bara över det som skiljer.',
114
+ 'Enter edits and saves a field, Esc cancels, ←→ or space cycles choices, Ctrl+O lists the addons on the site. y copies shared values into package.json for the team.': 'Enter redigerar och sparar ett fält, Esc avbryter, ←→ eller mellanslag bläddrar bland val, Ctrl+O listar webbplatsens tillägg. y kopierar delade värden till package.json för teamet.',
115
+ 'Passwords and secrets go to the OS keychain, never to a file. Leave them empty to be asked on each run.': 'Lösenord och hemligheter sparas i nyckelringen, aldrig i en fil. Lämna dem tomma för att bli tillfrågad varje gång.',
116
+ "The versions uploaded to the addon on the active environment's site, the domain in the top bar. v switches environment.": 'Versionerna som laddats upp till tillägget på den aktiva miljöns webbplats, domänen i toppraden. v byter miljö.',
117
+ '↑↓ select, a activates the selected version, r refreshes. Production deploys activate on their own.': '↑↓ väljer, a aktiverar vald version, r uppdaterar. Produktionsdriftsättningar aktiverar själva.',
118
+ 'Output from build, sign, deploy, dev and watch for the selected app. Dev and watch keep running while you switch apps; K stops them.': 'Utdata från build, sign, deploy, dev och watch för vald app. Dev och watch fortsätter köra medan du byter app; K stoppar dem.',
119
+ '↑↓ scroll, PgUp/PgDn page, f jumps to the end, x toggles line wrap.': '↑↓ scrollar, PgUp/PgDn bläddrar sida, f hoppar till slutet, x växlar radbrytning.',
106
120
  "What's new": 'Nyheter',
107
121
  'changelog for every release': 'ändringslogg för varje version',
108
122
  Changelog: 'Ändringslogg',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sitevision-cli",
3
- "version": "1.0.0-beta.30",
3
+ "version": "1.0.0-beta.31",
4
4
  "license": "MIT",
5
5
  "bin": {
6
6
  "svc": "dist/cli.js"