Compare commits
4
Commits
1b111c0e27
...
e708202f3a
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e708202f3a | ||
|
|
99145e83da | ||
|
|
33a5125abc | ||
|
|
cd8218689c |
+5
-3
@@ -30,11 +30,12 @@ Every page's root is `<Page>` from `@xenia/ui`. It provides:
|
|||||||
</Page>
|
</Page>
|
||||||
```
|
```
|
||||||
|
|
||||||
- `top={<Tabs … />}` keeps a tab strip above the scrolling part (Online orders, Settings). The tab is kept in the address (`?tab=`).
|
- `top={<Tabs … />}` keeps a tab strip above the scrolling part (Online orders, Settings). The tab is kept in the address (`?tab=`). Tabs that don't fit **wrap onto another row**; they are never hidden in a sideways scroll (6F.0, owner 2026-11-23).
|
||||||
- `header={<PageHeader … />}` with `top`: the page's title and description come **first**, then the tabs (Offers & pricing). Each tab then starts with its own head: title, description, its "New" button at the top right.
|
- `header={<PageHeader … />}` with `top`: the page's title and description come **first**, then the tabs (Offers & pricing). Each tab then starts with its own head: title, description, its "New" button at the top right.
|
||||||
- `fit`: the page is exactly the screen's height and doesn't scroll; its `Pane`s do, each on its own (Products). Put them in an element with `x-page__fill`. Phones scroll as usual.
|
- `fit`: the page is exactly the screen's height and doesn't scroll; its `Pane`s do, each on its own (Products). Put them in an element with `x-page__fill`. Phones scroll as usual.
|
||||||
- The scrollbar's room is always kept (`scrollbar-gutter: stable`), so a short tab is exactly as wide as a long one.
|
- The scrollbar's room is always kept (`scrollbar-gutter: stable`), so a short tab is exactly as wide as a long one.
|
||||||
- `width="form"` for settings and forms (centred at `--x-page-form-max`, 880 px). Lists, tables and dashboards use the default (full).
|
- Every page is full width, **Settings included** (6F.0, owner 2026-11-23: an 880 px Settings page looked narrower than the rest and cut its tabs). Settings and other pages of cards put them in `<Columns>`: cards flow top to bottom, then into the next column, each column at least 34rem (two on 1080p, three on an ultrawide, one on a laptop or phone); `x-columns__wide` / `<ColumnsWide>` spans all columns (an intro row, a wide editor). `width="form"` (880 px, centred) stays only for a single form that reads better narrow; no page uses it now.
|
||||||
|
- A settings row (`SettingRow`) keeps its control in a 16rem box on the right: selects and inputs fill it, switches and buttons sit at its right edge.
|
||||||
- **Never** put `p-*`, `max-w-*`, `mx-auto`, `h-full` or `overflow-*` on a page's root, and never nest a second width limit inside it.
|
- **Never** put `p-*`, `max-w-*`, `mx-auto`, `h-full` or `overflow-*` on a page's root, and never nest a second width limit inside it.
|
||||||
- Checked by `tests/e2e/manager_layout.mjs` (1920×1080 and 3440×1440: every page fills / is centred, and scrolls). Add a new page to its `PAGES` list.
|
- Checked by `tests/e2e/manager_layout.mjs` (1920×1080 and 3440×1440: every page fills / is centred, and scrolls). Add a new page to its `PAGES` list.
|
||||||
|
|
||||||
@@ -45,13 +46,14 @@ Every page is on `<Page>` except Inventory → Stock (a placeholder). Two-column
|
|||||||
| Need | Use | Notes |
|
| Need | Use | Notes |
|
||||||
|---|---|---|
|
|---|---|---|
|
||||||
| A page | `Page`, `PageHeader` | §2 |
|
| A page | `Page`, `PageHeader` | §2 |
|
||||||
|
| Cards in columns (settings) | `Columns`, `ColumnsWide` | §2; a card never splits across two columns |
|
||||||
| Filters / actions over a list | `Toolbar`, `ToolbarSpacer` | every control in it the same height; the search box grows |
|
| Filters / actions over a list | `Toolbar`, `ToolbarSpacer` | every control in it the same height; the search box grows |
|
||||||
| Search | `SearchInput` | icon, clear button; `onChange(text)` |
|
| Search | `SearchInput` | icon, clear button; `onChange(text)` |
|
||||||
| Choose one / several | `Dropdown` (`multiple`) | **never a native `<select>` in a toolbar.** Multi: value is an array, `[]` = all (`allLabel`). Options can carry a `dot` (a zone's colour) and a `hint`. Search box from 9 options. Same heights as `Input`. Native `Select` stays only inside forms where the phone's own picker is better |
|
| Choose one / several | `Dropdown` (`multiple`) | **never a native `<select>` in a toolbar.** Multi: value is an array, `[]` = all (`allLabel`). Options can carry a `dot` (a zone's colour) and a `hint`. Search box from 9 options. Same heights as `Input`. Native `Select` stays only inside forms where the phone's own picker is better |
|
||||||
| A small panel under a button | `Popover` (`open`, `anchor` = the button's ref, `onClose`) | a colour picker, an "Add…" menu. Drawn over everything (portal), flips above, stays inside the window: **never an `absolute` panel inside a section** (it is clipped and makes the section scroll) |
|
| A small panel under a button | `Popover` (`open`, `anchor` = the button's ref, `onClose`) | a colour picker, an "Add…" menu. Drawn over everything (portal), flips above, stays inside the window: **never an `absolute` panel inside a section** (it is clipped and makes the section scroll) |
|
||||||
| A colour (a venue's: data) | `ColourField` (`auto`, `opacity`, `presets`) | a field with its swatch and code; its panel (over the page) has 12 ready colours, the picker, the opacity (`#rrggbbaa`) and the code. `auto` = a first choice that leaves it to something else ("As the slide"). **Never** a bare `<input type="color">` |
|
| A colour (a venue's: data) | `ColourField` (`auto`, `opacity`, `presets`) | a field with its swatch and code; its panel (over the page) has 12 ready colours, the picker, the opacity (`#rrggbbaa`) and the code. `auto` = a first choice that leaves it to something else ("As the slide"). **Never** a bare `<input type="color">` |
|
||||||
| An icon from a set | `IconPicker` (`icons` = { key: component }) | a field showing the icon; a grid of the set over the page, "No icon" first |
|
| An icon from a set | `IconPicker` (`icons` = { key: component }) | a field showing the icon; a grid of the set over the page, "No icon" first |
|
||||||
| A whole number (seconds, counts) | `NumberInput` (`min`, `max`, `suffix`) | − / + on its sides, as tall as an input; it may be emptied while typing (`onChange(null)`): the form shows the error and blocks saving. **Never** clamp on every key (the user can't clear the field) |
|
| A whole number (seconds, counts) | `NumberInput` (`min`, `max`, `suffix`) | − / + on its sides, as tall as an input; it may be emptied while typing (`onChange(null)`): the form shows the error and blocks saving. **Never** clamp on every key (the user can't clear the field). With a `min` below 0 a minus may be typed in front |
|
||||||
| A note in a box (what works, a caution) | `Notice` (`tone`, `title`, `icon`, `items` = [{ tone, label, text }]) | a tinted box with a bar on its left; `items` are points with a tone dot and a bold label. **Never** a local `bg-info-soft` paragraph rebuilt per page |
|
| A note in a box (what works, a caution) | `Notice` (`tone`, `title`, `icon`, `items` = [{ tone, label, text }]) | a tinted box with a bar on its left; `items` are points with a tone dot and a bold label. **Never** a local `bg-info-soft` paragraph rebuilt per page |
|
||||||
| A slider with its value | `Slider` (`suffix`) | framed and as tall as the fields beside it; the value sits as close to it as the frame's padding. **Never** a bare `<input type="range">` |
|
| A slider with its value | `Slider` (`suffix`) | framed and as tall as the fields beside it; the value sits as close to it as the frame's padding. **Never** a bare `<input type="range">` |
|
||||||
| Fields that should wrap | `FieldRow` (`min`, `shade` on every other row) | each field keeps its least width; a row that wraps is framed (and tinted with `shade`), a row on one line looks like any row |
|
| Fields that should wrap | `FieldRow` (`min`, `shade` on every other row) | each field keeps its least width; a row that wraps is framed (and tinted with `shade`), a row on one line looks like any row |
|
||||||
|
|||||||
@@ -33,11 +33,12 @@ MODULE = Module(
|
|||||||
ConfigField('orientation', 'enum', default='landscape', choices=('landscape', 'portrait')),
|
ConfigField('orientation', 'enum', default='landscape', choices=('landscape', 'portrait')),
|
||||||
ConfigField('rotation', 'int', default=0, choices=(0, 90, 180, 270)),
|
ConfigField('rotation', 'int', default=0, choices=(0, 90, 180, 270)),
|
||||||
# its picture (6R.13): a slide of another shape keeps its shape (bands) or fills the picture;
|
# its picture (6R.13): a slide of another shape keeps its shape (bands) or fills the picture;
|
||||||
# px cut off each edge of the TV's window (set by Signage > Screens > Calibrate)
|
# px cut off each edge of the TV's window (set by Signage > Screens > Calibrate); below 0 the
|
||||||
|
# picture reaches past that edge of the window the TV reported (owner 2026-11-23)
|
||||||
ConfigField('fit', 'enum', default='keep', choices=('keep', 'stretch'), group='picture'),
|
ConfigField('fit', 'enum', default='keep', choices=('keep', 'stretch'), group='picture'),
|
||||||
ConfigField('area_left', 'int', default=0, min=0, max=4000, group='picture'),
|
ConfigField('area_left', 'int', default=0, min=-2000, max=4000, group='picture'),
|
||||||
ConfigField('area_top', 'int', default=0, min=0, max=4000, group='picture'),
|
ConfigField('area_top', 'int', default=0, min=-2000, max=4000, group='picture'),
|
||||||
ConfigField('area_right', 'int', default=0, min=0, max=4000, group='picture'),
|
ConfigField('area_right', 'int', default=0, min=-2000, max=4000, group='picture'),
|
||||||
ConfigField('area_bottom', 'int', default=0, min=0, max=4000, group='picture'),
|
ConfigField('area_bottom', 'int', default=0, min=-2000, max=4000, group='picture'),
|
||||||
)),
|
)),
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -57,6 +57,7 @@ REVIEWS = "signage.reviews" # the venue's reviews, typed in by hand
|
|||||||
MAX_WIDGETS = "signage.max_widgets" # widgets a slide may hold (owner review 6: Performance; 10 recommended)
|
MAX_WIDGETS = "signage.max_widgets" # widgets a slide may hold (owner review 6: Performance; 10 recommended)
|
||||||
MAX_WIDGETS_CAP = 50 # never more, whatever the setting
|
MAX_WIDGETS_CAP = 50 # never more, whatever the setting
|
||||||
AREA_MAX = 4000 # px a screen's picture area may cut off one edge (6R.13)
|
AREA_MAX = 4000 # px a screen's picture area may cut off one edge (6R.13)
|
||||||
|
AREA_OUT = 2000 # px it may reach past an edge of the window the TV reported (owner 2026-11-23)
|
||||||
AREA_KEYS = ("area_left", "area_top", "area_right", "area_bottom")
|
AREA_KEYS = ("area_left", "area_top", "area_right", "area_bottom")
|
||||||
CALIBRATE_S = 15 * 60 # a calibration nobody ends stops by itself
|
CALIBRATE_S = 15 * 60 # a calibration nobody ends stops by itself
|
||||||
_viewports: dict = {} # device id → {width, height, ratio} (what the TV reported; memory only)
|
_viewports: dict = {} # device id → {width, height, ratio} (what the TV reported; memory only)
|
||||||
@@ -199,19 +200,24 @@ class MenuList(_Strict):
|
|||||||
return out
|
return out
|
||||||
|
|
||||||
|
|
||||||
|
BOX_MAX = 400 # % of the slide a widget's box may reach (owner 2026-11-23)
|
||||||
|
|
||||||
|
|
||||||
class Box(_Strict):
|
class Box(_Strict):
|
||||||
"""Where a widget moved by hand sits (2026-11-21): % of the slide's (or its stack place's) width /
|
"""Where a widget moved by hand sits (2026-11-21): % of the slide's (or its stack place's) width /
|
||||||
height. Owner review 6: it may run off the slide, as long as a strip of it (5 %) stays on it to
|
height. Owner review 6: it may run off the slide, as long as a strip of it (5 %) stays on it to
|
||||||
grab it back; a text, clock, QR… is as big as its content (its height sets the size)."""
|
grab it back; a text, clock, QR… is as big as its content (its height sets the size). Owner
|
||||||
x: float = Field(ge=-100, le=100)
|
2026-11-23: up to four times the slide (a picture made larger than the slide is cut off at its
|
||||||
y: float = Field(ge=-100, le=100)
|
edges, zoomed in)."""
|
||||||
w: float = Field(ge=1, le=100)
|
x: float = Field(ge=-BOX_MAX, le=100)
|
||||||
h: float = Field(ge=1, le=100)
|
y: float = Field(ge=-BOX_MAX, le=100)
|
||||||
|
w: float = Field(ge=1, le=BOX_MAX)
|
||||||
|
h: float = Field(ge=1, le=BOX_MAX)
|
||||||
|
|
||||||
@model_validator(mode="after")
|
@model_validator(mode="after")
|
||||||
def _inside(self):
|
def _inside(self):
|
||||||
self.w = round(min(self.w, 100), 2)
|
self.w = round(self.w, 2)
|
||||||
self.h = round(min(self.h, 100), 2)
|
self.h = round(self.h, 2)
|
||||||
self.x = round(min(max(self.x, 5 - self.w), 95), 2)
|
self.x = round(min(max(self.x, 5 - self.w), 95), 2)
|
||||||
self.y = round(min(max(self.y, 5 - self.h), 95), 2)
|
self.y = round(min(max(self.y, 5 - self.h), 95), 2)
|
||||||
return self
|
return self
|
||||||
@@ -328,6 +334,7 @@ class Widget(_Strict):
|
|||||||
gallery_seconds: int = Field(default=5, ge=3, le=120)
|
gallery_seconds: int = Field(default=5, ge=3, le=120)
|
||||||
gallery_transition: Literal["fade", "slide", "zoom", "none"] = "fade"
|
gallery_transition: Literal["fade", "slide", "zoom", "none"] = "fade"
|
||||||
gallery_fit: Literal["cover", "contain"] = "cover"
|
gallery_fit: Literal["cover", "contain"] = "cover"
|
||||||
|
title_position: Literal["above", "below"] = "above" # its title (`text`) above or below the pictures (owner 2026-11-23)
|
||||||
# more settings (6R.17), every widget: on the element that places it
|
# more settings (6R.17), every widget: on the element that places it
|
||||||
opacity: int = Field(default=100, ge=10, le=100)
|
opacity: int = Field(default=100, ge=10, le=100)
|
||||||
rotation: int = Field(default=0, ge=-180, le=180)
|
rotation: int = Field(default=0, ge=-180, le=180)
|
||||||
@@ -578,10 +585,10 @@ class ScreenBody(BaseModel):
|
|||||||
orientation: Optional[Orientation] = None
|
orientation: Optional[Orientation] = None
|
||||||
rotation: Optional[Literal[0, 90, 180, 270]] = None
|
rotation: Optional[Literal[0, 90, 180, 270]] = None
|
||||||
# its picture area (6R.13): px cut off each edge of the TV's window; how a slide of another shape fits
|
# its picture area (6R.13): px cut off each edge of the TV's window; how a slide of another shape fits
|
||||||
area_left: Optional[int] = Field(default=None, ge=0, le=AREA_MAX)
|
area_left: Optional[int] = Field(default=None, ge=-AREA_OUT, le=AREA_MAX)
|
||||||
area_top: Optional[int] = Field(default=None, ge=0, le=AREA_MAX)
|
area_top: Optional[int] = Field(default=None, ge=-AREA_OUT, le=AREA_MAX)
|
||||||
area_right: Optional[int] = Field(default=None, ge=0, le=AREA_MAX)
|
area_right: Optional[int] = Field(default=None, ge=-AREA_OUT, le=AREA_MAX)
|
||||||
area_bottom: Optional[int] = Field(default=None, ge=0, le=AREA_MAX)
|
area_bottom: Optional[int] = Field(default=None, ge=-AREA_OUT, le=AREA_MAX)
|
||||||
fit: Optional[Literal["keep", "stretch"]] = None
|
fit: Optional[Literal["keep", "stretch"]] = None
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -84,6 +84,16 @@ def test_blank_slides_and_widgets_placed_by_hand(client, owner_h):
|
|||||||
assert clock["size"] == "custom" and clock["box"] == {"x": 90, "y": 5, "w": 20, "h": 10} and clock["align"] == "right"
|
assert clock["size"] == "custom" and clock["box"] == {"x": 90, "y": 5, "w": 20, "h": 10} and clock["align"] == "right"
|
||||||
assert big["box"] == {"x": 95, "y": -15, "w": 30, "h": 20}
|
assert big["box"] == {"x": 95, "y": -15, "w": 30, "h": 20}
|
||||||
assert date["size"] == "medium" and date["box"] is None # a corner: no box, a real size
|
assert date["size"] == "medium" and date["box"] is None # a corner: no box, a real size
|
||||||
|
# owner 2026-11-23: a picture made larger than the slide (cut off at its edges); a gallery's title below
|
||||||
|
r = client.put(f"/api/signage/slides/{s['id']}", headers=owner_h, json={"content": {"widgets": [
|
||||||
|
{"kind": "logo", "position": "custom", "box": {"x": -60, "y": -40, "w": 220, "h": 180}},
|
||||||
|
{"kind": "gallery", "text": "Our dishes", "title_position": "below", "position": "top-left"}]}})
|
||||||
|
logo, gallery = r.json()["content"]["widgets"]
|
||||||
|
assert logo["box"] == {"x": -60, "y": -40, "w": 220, "h": 180}
|
||||||
|
assert gallery["text"] == "Our dishes" and gallery["title_position"] == "below"
|
||||||
|
r = client.put(f"/api/signage/slides/{s['id']}", headers=owner_h, json={"content": {"widgets": [
|
||||||
|
{"kind": "logo", "position": "custom", "box": {"x": 0, "y": 0, "w": 401, "h": 10}}]}})
|
||||||
|
assert err(r) == "signage.content_invalid" # at most four times the slide
|
||||||
r = client.put(f"/api/signage/slides/{s['id']}", headers=owner_h, json={"content": {"widgets": [{"kind": "clock", "position": "custom"}]}})
|
r = client.put(f"/api/signage/slides/{s['id']}", headers=owner_h, json={"content": {"widgets": [{"kind": "clock", "position": "custom"}]}})
|
||||||
assert err(r) == "signage.content_invalid" # placed by hand needs its box
|
assert err(r) == "signage.content_invalid" # placed by hand needs its box
|
||||||
r = client.put(f"/api/signage/slides/{s['id']}", headers=owner_h, json={"content": {"title": "x"}})
|
r = client.put(f"/api/signage/slides/{s['id']}", headers=owner_h, json={"content": {"title": "x"}})
|
||||||
|
|||||||
@@ -55,6 +55,10 @@ def test_a_screens_picture_area_and_calibration(client, owner_h, screens, sent):
|
|||||||
assert ("signage.calibrate", [tv["id"]]) not in sent
|
assert ("signage.calibrate", [tv["id"]]) not in sent
|
||||||
# limits; not a screen
|
# limits; not a screen
|
||||||
assert client.put(f"/api/signage/screens/{tv['id']}", headers=owner_h, json={"area_left": 5000}).status_code == 422
|
assert client.put(f"/api/signage/screens/{tv['id']}", headers=owner_h, json={"area_left": 5000}).status_code == 422
|
||||||
|
# owner 2026-11-23: an edge may reach past the window the TV reported (its real picture is larger)
|
||||||
|
r = client.put(f"/api/signage/screens/{tv['id']}", headers=owner_h, json={"area_left": -60, "area_top": 0})
|
||||||
|
assert r.status_code == 200 and r.json()["area"]["left"] == -60
|
||||||
|
assert client.put(f"/api/signage/screens/{tv['id']}", headers=owner_h, json={"area_left": -2001}).status_code == 422
|
||||||
assert err(client.post("/api/signage/screens/99999/calibrate", headers=owner_h, json={"on": True})) == "signage.not_a_screen"
|
assert err(client.post("/api/signage/screens/99999/calibrate", headers=owner_h, json={"on": True})) == "signage.not_a_screen"
|
||||||
# a screen can't calibrate itself or report for another
|
# a screen can't calibrate itself or report for another
|
||||||
assert client.post(f"/api/signage/screens/{other['id']}/calibrate", headers=tv["h"], json={"on": True}).status_code in (401, 403)
|
assert client.post(f"/api/signage/screens/{other['id']}/calibrate", headers=tv["h"], json={"on": True}).status_code in (401, 403)
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
import { useSearchParams } from 'react-router-dom'
|
import { useSearchParams } from 'react-router-dom'
|
||||||
import { useCan, useModule } from '@xenia/access'
|
import { useCan, useModule } from '@xenia/access'
|
||||||
import { useTranslation } from '@xenia/i18n'
|
import { useTranslation } from '@xenia/i18n'
|
||||||
import { Page, Tabs } from '@xenia/ui'
|
import { Columns, Page, Tabs } from '@xenia/ui'
|
||||||
import PrintingSettings from '../printing/PrintingSettings'
|
import PrintingSettings from '../printing/PrintingSettings'
|
||||||
import CustomerDisplaySettings from './sections/CustomerDisplaySettings'
|
import CustomerDisplaySettings from './sections/CustomerDisplaySettings'
|
||||||
import DevelopmentSettings from './sections/DevelopmentSettings'
|
import DevelopmentSettings from './sections/DevelopmentSettings'
|
||||||
@@ -20,10 +20,10 @@ import IdentitySettings from './sections/IdentitySettings'
|
|||||||
|
|
||||||
const TABS = {
|
const TABS = {
|
||||||
'app-info': () => <SystemSettings />,
|
'app-info': () => <SystemSettings />,
|
||||||
venue: () => <VenueSettings />,
|
venue: () => <Columns><VenueSettings /></Columns>,
|
||||||
identity: () => <IdentitySettings />,
|
identity: () => <IdentitySettings />,
|
||||||
'customer-display': () => <CustomerDisplaySettings />,
|
'customer-display': () => <CustomerDisplaySettings />,
|
||||||
'menu-tablets': () => <MenuTabletSettings />,
|
'menu-tablets': () => <Columns><MenuTabletSettings /></Columns>,
|
||||||
security: () => <SecuritySettings />,
|
security: () => <SecuritySettings />,
|
||||||
operation: () => <OperationSettings />,
|
operation: () => <OperationSettings />,
|
||||||
colours: () => <TableColours />,
|
colours: () => <TableColours />,
|
||||||
@@ -49,8 +49,8 @@ export default function SettingsPage() {
|
|||||||
const active = tabs.includes(params.get('tab')) ? params.get('tab') : tabs[0]
|
const active = tabs.includes(params.get('tab')) ? params.get('tab') : tabs[0]
|
||||||
const Tab = TABS[active]
|
const Tab = TABS[active]
|
||||||
return (
|
return (
|
||||||
// settings are forms: the page's form width, centred (the page rule, 2026-11-20)
|
// full width like every page (6F.0, owner 2026-11-23); each tab's cards sit in <Columns>
|
||||||
<Page testId="settings-page" width="form" aria-label={t('settings.title')}
|
<Page testId="settings-page" aria-label={t('settings.title')}
|
||||||
top={<Tabs size="lg" value={active} onChange={id => setParams({ tab: id }, { replace: true })}
|
top={<Tabs size="lg" value={active} onChange={id => setParams({ tab: id }, { replace: true })}
|
||||||
tabs={tabs.map(id => ({ id, label: t(`settings.tabs.${id}`), testId: `settings-tab-${id}` }))} />}>
|
tabs={tabs.map(id => ({ id, label: t(`settings.tabs.${id}`), testId: `settings-tab-${id}` }))} />}>
|
||||||
<Tab />
|
<Tab />
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
// Settings → Development (plan step 6.14a; was the v1 DevelopmentTab): for testing only. Printing
|
// Settings → Development (plan step 6.14a; was the v1 DevelopmentTab): for testing only. Printing
|
||||||
// "spoof": every print job is dropped silently and the apps behave as if it printed.
|
// "spoof": every print job is dropped silently and the apps behave as if it printed.
|
||||||
import { useTranslation } from '@xenia/i18n'
|
import { useTranslation } from '@xenia/i18n'
|
||||||
import { Spinner, Switch } from '@xenia/ui'
|
import { Columns, Spinner, Switch } from '@xenia/ui'
|
||||||
import { SettingRow, SettingsCard } from './SettingsCard'
|
import { SettingRow, SettingsCard } from './SettingsCard'
|
||||||
import { useSettings } from './useSettings'
|
import { useSettings } from './useSettings'
|
||||||
|
|
||||||
@@ -11,13 +11,13 @@ export default function DevelopmentSettings() {
|
|||||||
if (s.loading) return <div className="py-8 flex justify-center"><Spinner /></div>
|
if (s.loading) return <div className="py-8 flex justify-center"><Spinner /></div>
|
||||||
const spoof = s.get('dev.spoof_printing', 'false') === 'true'
|
const spoof = s.get('dev.spoof_printing', 'false') === 'true'
|
||||||
return (
|
return (
|
||||||
<div className="grid gap-5" data-testid="settings-development">
|
<Columns testId="settings-development">
|
||||||
<p className="rounded-card bg-danger-soft text-danger-ink p-3 text-label" role="note">{t('settings.dev.warning')}</p>
|
<p className="x-columns__wide rounded-card bg-danger-soft text-danger-ink p-3 text-label" role="note">{t('settings.dev.warning')}</p>
|
||||||
<SettingsCard title={t('settings.dev.title')}>
|
<SettingsCard title={t('settings.dev.title')}>
|
||||||
<SettingRow label={t('settings.dev.spoof')} hint={t('settings.dev.spoofHint')} warning={spoof ? t('settings.dev.spoofOn') : undefined}>
|
<SettingRow label={t('settings.dev.spoof')} hint={t('settings.dev.spoofHint')} warning={spoof ? t('settings.dev.spoofOn') : undefined}>
|
||||||
<Switch checked={spoof} disabled={s.saving} onChange={v => s.save('dev.spoof_printing', v)} aria-label={t('settings.dev.spoof')} data-testid="setting-dev.spoof_printing" />
|
<Switch checked={spoof} disabled={s.saving} onChange={v => s.save('dev.spoof_printing', v)} aria-label={t('settings.dev.spoof')} data-testid="setting-dev.spoof_printing" />
|
||||||
</SettingRow>
|
</SettingRow>
|
||||||
</SettingsCard>
|
</SettingsCard>
|
||||||
</div>
|
</Columns>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import toast from 'react-hot-toast'
|
|||||||
import { CheckCircle2, Plus, Trash2, XCircle } from 'lucide-react'
|
import { CheckCircle2, Plus, Trash2, XCircle } from 'lucide-react'
|
||||||
import { errorMessage } from '@xenia/api'
|
import { errorMessage } from '@xenia/api'
|
||||||
import { useTranslation } from '@xenia/i18n'
|
import { useTranslation } from '@xenia/i18n'
|
||||||
import { Button, Field, IconButton, Input, Select, Spinner, Switch } from '@xenia/ui'
|
import { Button, Columns, Field, IconButton, Input, Select, Spinner, Switch } from '@xenia/ui'
|
||||||
import client from '../../../api/client'
|
import client from '../../../api/client'
|
||||||
import { SettingRow, SettingsCard } from './SettingsCard'
|
import { SettingRow, SettingsCard } from './SettingsCard'
|
||||||
import { cleanVatGroups, endLines, readJson } from './settingsLogic'
|
import { cleanVatGroups, endLines, readJson } from './settingsLogic'
|
||||||
@@ -21,9 +21,9 @@ export default function FiscalSettings() {
|
|||||||
if (s.loading) return <div className="py-8 flex justify-center"><Spinner /></div>
|
if (s.loading) return <div className="py-8 flex justify-center"><Spinner /></div>
|
||||||
const on = s.get('fiscal.enabled', 'false') === 'true'
|
const on = s.get('fiscal.enabled', 'false') === 'true'
|
||||||
return (
|
return (
|
||||||
<div className="grid gap-5" data-testid="settings-fiscal">
|
<Columns testId="settings-fiscal">
|
||||||
<SettingsCard title={t('settings.fiscal.title')} description={t('settings.fiscal.intro')}>
|
<SettingsCard title={t('settings.fiscal.title')} description={t('settings.fiscal.intro')}>
|
||||||
<SettingRow label={t('settings.fiscal.enabled')} hint={t('settings.fiscal.enabledHint')}
|
<SettingRow label={t('settings.fiscal.enabled')} hint={t('settings.fiscal.enabledHint')} tip={t('settings.fiscal.enabledTip')}
|
||||||
warning={on ? t('settings.fiscal.onWarning') : undefined}>
|
warning={on ? t('settings.fiscal.onWarning') : undefined}>
|
||||||
<Switch checked={on} disabled={s.saving} onChange={v => s.save('fiscal.enabled', v)} aria-label={t('settings.fiscal.enabled')} data-testid="setting-fiscal.enabled" />
|
<Switch checked={on} disabled={s.saving} onChange={v => s.save('fiscal.enabled', v)} aria-label={t('settings.fiscal.enabled')} data-testid="setting-fiscal.enabled" />
|
||||||
</SettingRow>
|
</SettingRow>
|
||||||
@@ -37,7 +37,7 @@ export default function FiscalSettings() {
|
|||||||
<Folders s={s} />
|
<Folders s={s} />
|
||||||
<EndMessage s={s} />
|
<EndMessage s={s} />
|
||||||
<VatGroups s={s} />
|
<VatGroups s={s} />
|
||||||
</div>
|
</Columns>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import { Plus, Trash2 } from 'lucide-react'
|
|||||||
import { errorMessage } from '@xenia/api'
|
import { errorMessage } from '@xenia/api'
|
||||||
import { useCan } from '@xenia/access'
|
import { useCan } from '@xenia/access'
|
||||||
import { useTranslation } from '@xenia/i18n'
|
import { useTranslation } from '@xenia/i18n'
|
||||||
import { Button, ColourField, Dropdown, Field, IconButton, Input, Spinner, Switch } from '@xenia/ui'
|
import { Button, ColourField, Columns, Dropdown, Field, IconButton, Input, Spinner, Switch } from '@xenia/ui'
|
||||||
import { wifiQr } from '@xenia/signage/logic'
|
import { wifiQr } from '@xenia/signage/logic'
|
||||||
import client from '../../../api/client'
|
import client from '../../../api/client'
|
||||||
import MediaField from '../../media/MediaField'
|
import MediaField from '../../media/MediaField'
|
||||||
@@ -50,8 +50,8 @@ function IdentityForm({ saved }) {
|
|||||||
const qr = wifiQr(wifi)
|
const qr = wifiQr(wifi)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="grid gap-5" data-testid="settings-identity">
|
<Columns testId="settings-identity">
|
||||||
<div className="flex flex-wrap items-center gap-3">
|
<div className="x-columns__wide flex flex-wrap items-center gap-3">
|
||||||
<p className="text-label text-ink-2 flex-1 min-w-[16rem]">{t('identity.intro')}</p>
|
<p className="text-label text-ink-2 flex-1 min-w-[16rem]">{t('identity.intro')}</p>
|
||||||
{dirty && <span className="text-label text-ink-3">{t('identity.unsaved')}</span>}
|
{dirty && <span className="text-label text-ink-3">{t('identity.unsaved')}</span>}
|
||||||
<Button variant="secondary" disabled={!dirty || busy} onClick={() => setD(structuredClone(saved))}>{t('identity.undo')}</Button>
|
<Button variant="secondary" disabled={!dirty || busy} onClick={() => setD(structuredClone(saved))}>{t('identity.undo')}</Button>
|
||||||
@@ -141,6 +141,6 @@ function IdentityForm({ saved }) {
|
|||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
</SettingsCard>
|
</SettingsCard>
|
||||||
</div>
|
</Columns>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import { ArrowDown, ArrowUp, Plus, RefreshCw, Trash2 } from 'lucide-react'
|
|||||||
import { useModule } from '@xenia/access'
|
import { useModule } from '@xenia/access'
|
||||||
import { errorMessage } from '@xenia/api'
|
import { errorMessage } from '@xenia/api'
|
||||||
import { useTranslation } from '@xenia/i18n'
|
import { useTranslation } from '@xenia/i18n'
|
||||||
import { Button, IconButton, Input, Spinner, Switch } from '@xenia/ui'
|
import { Button, Columns, IconButton, InfoTip, Input, Spinner, Switch } from '@xenia/ui'
|
||||||
import client from '../../../api/client'
|
import client from '../../../api/client'
|
||||||
import QuickMessages from './QuickMessages'
|
import QuickMessages from './QuickMessages'
|
||||||
import RolePermissions from './RolePermissions'
|
import RolePermissions from './RolePermissions'
|
||||||
@@ -26,19 +26,19 @@ export default function OperationSettings() {
|
|||||||
const chat = useModule('chat')
|
const chat = useModule('chat')
|
||||||
const qrMenu = useModule('connect_menu')
|
const qrMenu = useModule('connect_menu')
|
||||||
return (
|
return (
|
||||||
<div className="grid gap-5" data-testid="settings-operation">
|
<Columns testId="settings-operation">
|
||||||
<RolePermissions />
|
<RolePermissions />
|
||||||
{ordering && <OrderingSettings />}
|
{ordering && <OrderingSettings />}
|
||||||
{ordering && <TableFlags />}
|
{ordering && <TableFlags />}
|
||||||
{chat && <QuickMessages />}
|
{chat && <QuickMessages />}
|
||||||
{qrMenu && <MenuSync />}
|
{qrMenu && <MenuSync />}
|
||||||
</div>
|
</Columns>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
function Toggle({ s, k, fallback = 'false', label, hint }) {
|
function Toggle({ s, k, fallback = 'false', label, hint, tip }) {
|
||||||
return (
|
return (
|
||||||
<SettingRow label={label} hint={hint}>
|
<SettingRow label={label} hint={hint} tip={tip}>
|
||||||
<Switch checked={s.get(k, fallback) === 'true'} disabled={s.saving} onChange={v => s.save(k, v)} aria-label={label} data-testid={`setting-${k}`} />
|
<Switch checked={s.get(k, fallback) === 'true'} disabled={s.saving} onChange={v => s.save(k, v)} aria-label={label} data-testid={`setting-${k}`} />
|
||||||
</SettingRow>
|
</SettingRow>
|
||||||
)
|
)
|
||||||
@@ -51,18 +51,18 @@ function OrderingSettings() {
|
|||||||
const o = k => t(`settings.ops.${k}`)
|
const o = k => t(`settings.ops.${k}`)
|
||||||
return (<>
|
return (<>
|
||||||
<SettingsCard title={o('staffTitle')} description={o('staffIntro')} testId="settings-staff">
|
<SettingsCard title={o('staffTitle')} description={o('staffIntro')} testId="settings-staff">
|
||||||
<Toggle s={s} k="shifts.waiter_self_start" fallback="true" label={o('selfStart')} hint={o('selfStartHint')} />
|
<Toggle s={s} k="shifts.waiter_self_start" fallback="true" label={o('selfStart')} hint={o('selfStartHint')} tip={o('selfStartTip')} />
|
||||||
<Toggle s={s} k="shifts.waiter_self_end" fallback="true" label={o('selfEnd')} hint={o('selfEndHint')} />
|
<Toggle s={s} k="shifts.waiter_self_end" fallback="true" label={o('selfEnd')} hint={o('selfEndHint')} tip={o('selfEndTip')} />
|
||||||
<Toggle s={s} k="shifts.hide_revenue_from_waiters" label={o('hideTakings')} hint={o('hideTakingsHint')} />
|
<Toggle s={s} k="shifts.hide_revenue_from_waiters" label={o('hideTakings')} hint={o('hideTakingsHint')} tip={o('hideTakingsTip')} />
|
||||||
</SettingsCard>
|
</SettingsCard>
|
||||||
<SettingsCard title={o('paymentsTitle')} testId="settings-payments">
|
<SettingsCard title={o('paymentsTitle')} testId="settings-payments">
|
||||||
<Toggle s={s} k="payments.card_enabled" label={o('card')} hint={o('cardHint')} />
|
<Toggle s={s} k="payments.card_enabled" label={o('card')} hint={o('cardHint')} tip={o('cardTip')} />
|
||||||
</SettingsCard>
|
</SettingsCard>
|
||||||
<SettingsCard title={o('ordersTitle')} description={o('ordersIntro')} testId="settings-orders">
|
<SettingsCard title={o('ordersTitle')} description={o('ordersIntro')} testId="settings-orders">
|
||||||
<Toggle s={s} k="orders.auto_close_on_full_payment" label={o('autoClose')} hint={o('autoCloseHint')} />
|
<Toggle s={s} k="orders.auto_close_on_full_payment" label={o('autoClose')} hint={o('autoCloseHint')} tip={o('autoCloseTip')} />
|
||||||
<Toggle s={s} k="orders.close_with_unpaid" label={t('settings.operation.closeUnpaid')} hint={t('settings.operation.closeUnpaidHint')} />
|
<Toggle s={s} k="orders.close_with_unpaid" label={t('settings.operation.closeUnpaid')} hint={t('settings.operation.closeUnpaidHint')} tip={t('settings.operation.closeUnpaidTip')} />
|
||||||
<Toggle s={s} k="orders.bypass_kds_serve" label={o('bypassKds')} hint={o('bypassKdsHint')} />
|
<Toggle s={s} k="orders.bypass_kds_serve" label={o('bypassKds')} hint={o('bypassKdsHint')} tip={o('bypassKdsTip')} />
|
||||||
<Toggle s={s} k="orders.courses_enabled" label={o('courses')} hint={o('coursesHint')} />
|
<Toggle s={s} k="orders.courses_enabled" label={o('courses')} hint={o('coursesHint')} tip={o('coursesTip')} />
|
||||||
{s.get('orders.courses_enabled') === 'true' && <Courses s={s} />}
|
{s.get('orders.courses_enabled') === 'true' && <Courses s={s} />}
|
||||||
<QuickNotes s={s} />
|
<QuickNotes s={s} />
|
||||||
</SettingsCard>
|
</SettingsCard>
|
||||||
@@ -104,7 +104,7 @@ function QuickNotes({ s }) {
|
|||||||
const add = () => { if (typed.trim()) { save([...notes, typed]); setTyped('') } }
|
const add = () => { if (typed.trim()) { save([...notes, typed]); setTyped('') } }
|
||||||
return (
|
return (
|
||||||
<div className="px-5 py-3 grid gap-2" data-testid="settings-quick-notes">
|
<div className="px-5 py-3 grid gap-2" data-testid="settings-quick-notes">
|
||||||
<span className="text-body font-medium text-ink">{t('settings.ops.quickNotes')}</span>
|
<span className="flex items-center gap-1 text-body font-medium text-ink">{t('settings.ops.quickNotes')}<InfoTip>{t('settings.ops.quickNotesTip')}</InfoTip></span>
|
||||||
<span className="text-label text-ink-2 -mt-1">{t('settings.ops.quickNotesHint')}</span>
|
<span className="text-label text-ink-2 -mt-1">{t('settings.ops.quickNotesHint')}</span>
|
||||||
{notes.map((n, i) => (
|
{notes.map((n, i) => (
|
||||||
<div key={`${i}-${n}`} className="flex items-center gap-2">
|
<div key={`${i}-${n}`} className="flex items-center gap-2">
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import toast from 'react-hot-toast'
|
|||||||
import { Copy, RefreshCw } from 'lucide-react'
|
import { Copy, RefreshCw } from 'lucide-react'
|
||||||
import { errorMessage } from '@xenia/api'
|
import { errorMessage } from '@xenia/api'
|
||||||
import { useTranslation } from '@xenia/i18n'
|
import { useTranslation } from '@xenia/i18n'
|
||||||
import { Button, IconButton, Select, Spinner, Switch } from '@xenia/ui'
|
import { Button, Columns, IconButton, Select, Spinner, Switch } from '@xenia/ui'
|
||||||
import client from '../../../api/client'
|
import client from '../../../api/client'
|
||||||
import { useLiveQuery } from '../../../live/useLiveQuery'
|
import { useLiveQuery } from '../../../live/useLiveQuery'
|
||||||
import { Pill } from '../../overview/parts'
|
import { Pill } from '../../overview/parts'
|
||||||
@@ -19,11 +19,11 @@ import { useSettings } from './useSettings'
|
|||||||
|
|
||||||
export default function SecuritySettings() {
|
export default function SecuritySettings() {
|
||||||
return (
|
return (
|
||||||
<div className="grid gap-5" data-testid="settings-security">
|
<Columns testId="settings-security">
|
||||||
<SignInSettings />
|
<SignInSettings />
|
||||||
<IdleSettings />
|
<IdleSettings />
|
||||||
<RecoveryCodes />
|
<RecoveryCodes />
|
||||||
</div>
|
</Columns>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -39,7 +39,7 @@ function IdleSettings() {
|
|||||||
const options = current => [...new Set([...IDLE_STEPS, current])].sort((a, b) => a - b).map(v => ({ value: String(v), label: span(v) }))
|
const options = current => [...new Set([...IDLE_STEPS, current])].sort((a, b) => a - b).map(v => ({ value: String(v), label: span(v) }))
|
||||||
return (
|
return (
|
||||||
<SettingsCard title={t('settings.security.idleTitle')} description={t('settings.security.idleIntro')} testId="settings-idle">
|
<SettingsCard title={t('settings.security.idleTitle')} description={t('settings.security.idleIntro')} testId="settings-idle">
|
||||||
<SettingRow label={t('settings.security.lock')} hint={t('settings.security.lockHint')}>
|
<SettingRow label={t('settings.security.lock')} hint={t('settings.security.lockHint')} tip={t('settings.security.lockTip')}>
|
||||||
<Switch checked={lock} disabled={s.saving} onChange={v => s.save('security.auto_lock', v)} aria-label={t('settings.security.lock')} data-testid="setting-security.auto_lock" />
|
<Switch checked={lock} disabled={s.saving} onChange={v => s.save('security.auto_lock', v)} aria-label={t('settings.security.lock')} data-testid="setting-security.auto_lock" />
|
||||||
</SettingRow>
|
</SettingRow>
|
||||||
{lock && (
|
{lock && (
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ export function SettingRow({ label, hint, tip, children, warning, htmlFor }) {
|
|||||||
</div>
|
</div>
|
||||||
{hint && <p className="text-label text-ink-2 mt-0.5">{hint}</p>}
|
{hint && <p className="text-label text-ink-2 mt-0.5">{hint}</p>}
|
||||||
</div>
|
</div>
|
||||||
<div className="sm:w-64 shrink-0">{children}</div>
|
<div className="sm:w-64 shrink-0 flex sm:justify-end [&>*]:max-w-full [&>.x-select]:w-full [&>.x-dropdown]:w-full [&>.x-input]:w-full">{children}</div>
|
||||||
</div>
|
</div>
|
||||||
{warning && <p className="mt-2 rounded-control bg-warning-soft text-warning-ink text-label px-3 py-2" role="note">{warning}</p>}
|
{warning && <p className="mt-2 rounded-control bg-warning-soft text-warning-ink text-label px-3 py-2" role="note">{warning}</p>}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -46,23 +46,23 @@ export default function SignInSettings() {
|
|||||||
<SettingRow label={t('settings.signIn.autofill')} hint={t('settings.signIn.autofillHint')}>
|
<SettingRow label={t('settings.signIn.autofill')} hint={t('settings.signIn.autofillHint')}>
|
||||||
{toggle('security.autofill_username', 'true', t('settings.signIn.autofill'))}
|
{toggle('security.autofill_username', 'true', t('settings.signIn.autofill'))}
|
||||||
</SettingRow>
|
</SettingRow>
|
||||||
<SettingRow label={t('settings.signIn.waiter')} htmlFor={idWaiter}
|
<SettingRow label={t('settings.signIn.waiter')} htmlFor={idWaiter} tip={t('settings.signIn.waiterTip')}
|
||||||
warning={waiterMode === 'tap' ? t('settings.signIn.waiterTapWarning') : undefined}>
|
warning={waiterMode === 'tap' ? t('settings.signIn.waiterTapWarning') : undefined}>
|
||||||
{select('auth.waiter_login_mode', 'pin', opts(['pin', 'password', 'tap'], 'settings.mode'), idWaiter)}
|
{select('auth.waiter_login_mode', 'pin', opts(['pin', 'password', 'tap'], 'settings.mode'), idWaiter)}
|
||||||
</SettingRow>
|
</SettingRow>
|
||||||
<SettingRow label={t('settings.signIn.requireUsername')} hint={t('settings.signIn.requireUsernameHint')}>
|
<SettingRow label={t('settings.signIn.requireUsername')} hint={t('settings.signIn.requireUsernameHint')} tip={t('settings.signIn.requireUsernameTip')}>
|
||||||
{toggle('auth.waiter_require_username', 'false', t('settings.signIn.requireUsername'))}
|
{toggle('auth.waiter_require_username', 'false', t('settings.signIn.requireUsername'))}
|
||||||
</SettingRow>
|
</SettingRow>
|
||||||
<SettingRow label={t('settings.signIn.device')} htmlFor={idDevice} hint={t('settings.signIn.deviceHint')}>
|
<SettingRow label={t('settings.signIn.device')} htmlFor={idDevice} hint={t('settings.signIn.deviceHint')} tip={t('settings.signIn.deviceTip')}>
|
||||||
{select('auth.default_login_mode', 'pin', opts(['pin', 'password', 'tap', 'none'], 'settings.mode'), idDevice)}
|
{select('auth.default_login_mode', 'pin', opts(['pin', 'password', 'tap', 'none'], 'settings.mode'), idDevice)}
|
||||||
</SettingRow>
|
</SettingRow>
|
||||||
<SettingRow label={t('settings.signIn.singleManager')} htmlFor={idSingleManager} tip={t('settings.signIn.singleTip')}>
|
<SettingRow label={t('settings.signIn.singleManager')} htmlFor={idSingleManager} tip={t('settings.signIn.singleTip')}>
|
||||||
{select('auth.single_session_manager', 'off', opts(SESSION_RULES, 'settings.session'), idSingleManager)}
|
{select('auth.single_session_manager', 'off', opts(SESSION_RULES, 'settings.session'), idSingleManager)}
|
||||||
</SettingRow>
|
</SettingRow>
|
||||||
<SettingRow label={t('settings.signIn.singleWaiter')} htmlFor={idSingleWaiter}>
|
<SettingRow label={t('settings.signIn.singleWaiter')} htmlFor={idSingleWaiter} tip={t('settings.signIn.singleTip')}>
|
||||||
{select('auth.single_session_waiter', 'off', opts(SESSION_RULES, 'settings.session'), idSingleWaiter)}
|
{select('auth.single_session_waiter', 'off', opts(SESSION_RULES, 'settings.session'), idSingleWaiter)}
|
||||||
</SettingRow>
|
</SettingRow>
|
||||||
<SettingRow label={t('settings.signIn.idle')} htmlFor={idIdle} hint={t('settings.signIn.idleHint')}>
|
<SettingRow label={t('settings.signIn.idle')} htmlFor={idIdle} hint={t('settings.signIn.idleHint')} tip={t('settings.signIn.idleTip')}>
|
||||||
{select('auth.idle_days', '14', idleOptions, idIdle)}
|
{select('auth.idle_days', '14', idleOptions, idIdle)}
|
||||||
</SettingRow>
|
</SettingRow>
|
||||||
</SettingsCard>
|
</SettingsCard>
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import { Lock, LockOpen, QrCode as QrIcon, RefreshCw } from 'lucide-react'
|
|||||||
import { useAccess } from '@xenia/access'
|
import { useAccess } from '@xenia/access'
|
||||||
import { errorMessage } from '@xenia/api'
|
import { errorMessage } from '@xenia/api'
|
||||||
import { useFormat, useTranslation } from '@xenia/i18n'
|
import { useFormat, useTranslation } from '@xenia/i18n'
|
||||||
import { Button, Dialog, Input, Spinner } from '@xenia/ui'
|
import { Button, Columns, Dialog, Input, Spinner } from '@xenia/ui'
|
||||||
import { QrCode } from '@xenia/ui/qr'
|
import { QrCode } from '@xenia/ui/qr'
|
||||||
import client from '../../../api/client'
|
import client from '../../../api/client'
|
||||||
import { useLiveQuery } from '../../../live/useLiveQuery'
|
import { useLiveQuery } from '../../../live/useLiveQuery'
|
||||||
@@ -43,7 +43,7 @@ export default function SystemSettings() {
|
|||||||
const counts = ['categories', 'products', 'tables', 'table_groups', 'managers', 'waiters']
|
const counts = ['categories', 'products', 'tables', 'table_groups', 'managers', 'waiters']
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="grid gap-5" data-testid="settings-system">
|
<Columns testId="settings-system">
|
||||||
<SettingsCard title={t('settings.system.title')}>
|
<SettingsCard title={t('settings.system.title')}>
|
||||||
<SettingRow label={t('settings.system.version')}>
|
<SettingRow label={t('settings.system.version')}>
|
||||||
<span className="flex flex-wrap items-center gap-2 text-body font-semibold text-ink" data-testid="system-version">
|
<span className="flex flex-wrap items-center gap-2 text-body font-semibold text-ink" data-testid="system-version">
|
||||||
@@ -106,7 +106,7 @@ export default function SystemSettings() {
|
|||||||
</div>
|
</div>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
)}
|
)}
|
||||||
</div>
|
</Columns>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -132,7 +132,7 @@ function LanAccess({ status, onQr }) {
|
|||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<SettingRow label={t('settings.lan.address')} hint={!ip ? t('settings.lan.unknown') : info && info.detection !== 'ok' && editing == null ? t(`settings.lan.detection.${info.detection}`, { defaultValue: '' }) : undefined}>
|
<SettingRow label={t('settings.lan.address')} tip={t('settings.lan.addressTip')} hint={!ip ? t('settings.lan.unknown') : info && info.detection !== 'ok' && editing == null ? t(`settings.lan.detection.${info.detection}`, { defaultValue: '' }) : undefined}>
|
||||||
{editing != null ? (
|
{editing != null ? (
|
||||||
<span className="grid gap-2">
|
<span className="grid gap-2">
|
||||||
<Input value={editing} autoFocus className="font-mono" placeholder={info?.detected || '192.168.1.50'} onChange={e => setEditing(e.target.value)}
|
<Input value={editing} autoFocus className="font-mono" placeholder={info?.detected || '192.168.1.50'} onChange={e => setEditing(e.target.value)}
|
||||||
|
|||||||
@@ -29,12 +29,12 @@ export default function VenueSettings() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<SettingsCard title={t('settings.venue.title')} testId="settings-venue">
|
<SettingsCard title={t('settings.venue.title')} testId="settings-venue">
|
||||||
<SettingRow label={t('settings.venue.language')} htmlFor={langId} hint={t('settings.venue.languageHint')}>
|
<SettingRow label={t('settings.venue.language')} htmlFor={langId} hint={t('settings.venue.languageHint')} tip={t('settings.venue.languageTip')}>
|
||||||
<Select id={langId} value={s.get('venue.language', 'en')} disabled={s.saving} data-testid="setting-venue.language"
|
<Select id={langId} value={s.get('venue.language', 'en')} disabled={s.saving} data-testid="setting-venue.language"
|
||||||
onChange={e => s.save('venue.language', e.target.value)}
|
onChange={e => s.save('venue.language', e.target.value)}
|
||||||
options={(languages || ['en', 'el']).map(l => ({ value: l, label: LANGUAGE_NAMES[l] || l }))} />
|
options={(languages || ['en', 'el']).map(l => ({ value: l, label: LANGUAGE_NAMES[l] || l }))} />
|
||||||
</SettingRow>
|
</SettingRow>
|
||||||
<SettingRow label={t('settings.venue.timezone')} htmlFor={tzId}
|
<SettingRow label={t('settings.venue.timezone')} htmlFor={tzId} tip={t('settings.venue.timezoneTip')}
|
||||||
hint={t('settings.venue.timezoneHint', { time: f.formatTime(new Date()) })}>
|
hint={t('settings.venue.timezoneHint', { time: f.formatTime(new Date()) })}>
|
||||||
<Select id={tzId} value={tz} disabled={s.saving} data-testid="setting-venue.timezone"
|
<Select id={tzId} value={tz} disabled={s.saving} data-testid="setting-venue.timezone"
|
||||||
onChange={e => s.save('venue.timezone', e.target.value)}
|
onChange={e => s.save('venue.timezone', e.target.value)}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
// expected (short / over / even), then "End the shift".
|
// expected (short / over / even), then "End the shift".
|
||||||
import { useState } from 'react'
|
import { useState } from 'react'
|
||||||
import { useTranslation, useFormat, parseNumber } from '@xenia/i18n'
|
import { useTranslation, useFormat, parseNumber } from '@xenia/i18n'
|
||||||
import { Button, Dialog, Field, Input, Spinner, Textarea, cx } from '@xenia/ui'
|
import { Button, Dialog, Field, InfoTip, Input, Spinner, Textarea, cx } from '@xenia/ui'
|
||||||
import client from '../../api/client'
|
import client from '../../api/client'
|
||||||
import { useLiveQuery } from '../../live/useLiveQuery'
|
import { useLiveQuery } from '../../live/useLiveQuery'
|
||||||
import { ITEM_KINDS, cashCheck, hourBuckets, itemKind, itemShown, quickAmounts, shiftCounts, shiftMoney, shiftPairs } from './overviewLogic'
|
import { ITEM_KINDS, cashCheck, hourBuckets, itemKind, itemShown, quickAmounts, shiftCounts, shiftMoney, shiftPairs } from './overviewLogic'
|
||||||
@@ -127,7 +127,7 @@ export default function ShiftDialog({ shift, mode, onClose, onConfirm, busy }) {
|
|||||||
{closing && step === 2 && (
|
{closing && step === 2 && (
|
||||||
<div className="grid gap-3">
|
<div className="grid gap-3">
|
||||||
<h3 className="text-title font-semibold text-ink">{t('overview.shift.handover')}</h3>
|
<h3 className="text-title font-semibold text-ink">{t('overview.shift.handover')}</h3>
|
||||||
<Field label={t('overview.shift.counted')} hint={t('overview.shift.countedHint')}>
|
<Field label={t('overview.shift.counted')} info={<InfoTip>{t('overview.shift.countedTip')}</InfoTip>} hint={t('overview.shift.countedHint')}>
|
||||||
<Input inputMode="decimal" autoFocus value={counted} onChange={e => setCounted(e.target.value)}
|
<Input inputMode="decimal" autoFocus value={counted} onChange={e => setCounted(e.target.value)}
|
||||||
placeholder={String(money.expected.toFixed(2))} data-testid="shift-counted" />
|
placeholder={String(money.expected.toFixed(2))} data-testid="shift-counted" />
|
||||||
</Field>
|
</Field>
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import { MonitorSmartphone, Plus } from 'lucide-react'
|
|||||||
import { DeviceSupport } from './DeviceSupport'
|
import { DeviceSupport } from './DeviceSupport'
|
||||||
import { errorMessage, parseError } from '@xenia/api'
|
import { errorMessage, parseError } from '@xenia/api'
|
||||||
import { useTranslation, useFormat } from '@xenia/i18n'
|
import { useTranslation, useFormat } from '@xenia/i18n'
|
||||||
import { Button, Dialog, EmptyState, Field, Input, Page, Select, Spinner } from '@xenia/ui'
|
import { Button, Dialog, EmptyState, Field, InfoTip, Input, Page, Select, Spinner } from '@xenia/ui'
|
||||||
import client from '../../api/client'
|
import client from '../../api/client'
|
||||||
import DeviceConfigFields from './DeviceConfigFields'
|
import DeviceConfigFields from './DeviceConfigFields'
|
||||||
import { configInitial, deviceStatus, deviceUsage, hasRoom, linkTargets, normalizeCode } from './devicesLogic'
|
import { configInitial, deviceStatus, deviceUsage, hasRoom, linkTargets, normalizeCode } from './devicesLogic'
|
||||||
@@ -258,7 +258,7 @@ function PairDialog({ apps, usage, devices, appName, limitLabel, initialApp, onC
|
|||||||
<Input value={name} onChange={e => setName(e.target.value)} placeholder={t('devices.form.namePlaceholder')} maxLength={60} />
|
<Input value={name} onChange={e => setName(e.target.value)} placeholder={t('devices.form.namePlaceholder')} maxLength={60} />
|
||||||
</Field>
|
</Field>
|
||||||
{modes && (
|
{modes && (
|
||||||
<Field label={t('devices.form.signIn')}>
|
<Field label={t('devices.form.signIn')} info={<InfoTip>{t('devices.form.signInTip')}</InfoTip>}>
|
||||||
<Select value={mode} onChange={e => setMode(e.target.value)} options={modes} />
|
<Select value={mode} onChange={e => setMode(e.target.value)} options={modes} />
|
||||||
</Field>
|
</Field>
|
||||||
)}
|
)}
|
||||||
@@ -304,7 +304,7 @@ function EditDialog({ device, apps, devices, onClose, onSave }) {
|
|||||||
<Input value={name} onChange={e => setName(e.target.value)} maxLength={60} />
|
<Input value={name} onChange={e => setName(e.target.value)} maxLength={60} />
|
||||||
</Field>
|
</Field>
|
||||||
{modes && (
|
{modes && (
|
||||||
<Field label={t('devices.form.signIn')}>
|
<Field label={t('devices.form.signIn')} info={<InfoTip>{t('devices.form.signInTip')}</InfoTip>}>
|
||||||
<Select value={mode} onChange={e => setMode(e.target.value)} options={modes} />
|
<Select value={mode} onChange={e => setMode(e.target.value)} options={modes} />
|
||||||
</Field>
|
</Field>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -1,15 +1,16 @@
|
|||||||
// Settings → Printing (plan step 6.10; replaces the v1 "Print fonts" tab): when managers are
|
// Settings → Printing (plan step 6.10; replaces the v1 "Print fonts" tab): when managers are
|
||||||
// told about tickets that keep failing, the printers, and the tickets' look and beep.
|
// told about tickets that keep failing, the printers, and the tickets' look and beep.
|
||||||
|
import { Columns } from '@xenia/ui'
|
||||||
import PrintAlertSetting from '../Settings/sections/PrintAlertSetting'
|
import PrintAlertSetting from '../Settings/sections/PrintAlertSetting'
|
||||||
import PrintersCard from './PrintersCard'
|
import PrintersCard from './PrintersCard'
|
||||||
import TicketSettings from './TicketSettings'
|
import TicketSettings from './TicketSettings'
|
||||||
|
|
||||||
export default function PrintingSettings() {
|
export default function PrintingSettings() {
|
||||||
return (
|
return (
|
||||||
<div className="grid gap-5" data-testid="printing-settings">
|
<Columns testId="printing-settings">
|
||||||
<PrintersCard />
|
<PrintersCard />
|
||||||
<PrintAlertSetting />
|
<PrintAlertSetting />
|
||||||
<TicketSettings />
|
<TicketSettings />
|
||||||
</div>
|
</Columns>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ export function InfoTab({ form, set, setForm, categories, prepZones }) {
|
|||||||
</Field>
|
</Field>
|
||||||
<Tags tags={form.tags} onChange={v => set('tags', v)} />
|
<Tags tags={form.tags} onChange={v => set('tags', v)} />
|
||||||
<div className="grid gap-3 grid-cols-2">
|
<div className="grid gap-3 grid-cols-2">
|
||||||
<Field label={t('products.editor.unit')} hint={WEIGHED.has(form.unit_type) ? t('products.editor.unitWeighed') : undefined}>
|
<Field label={t('products.editor.unit')} info={<InfoTip>{t('products.editor.unitTip')}</InfoTip>} hint={WEIGHED.has(form.unit_type) ? t('products.editor.unitWeighed') : undefined}>
|
||||||
<Dropdown value={form.unit_type} onChange={v => set('unit_type', v)} data-testid="product-unit" options={UNITS.map(u => ({ value: u, label: t(`products.unit.${u}`) }))} />
|
<Dropdown value={form.unit_type} onChange={v => set('unit_type', v)} data-testid="product-unit" options={UNITS.map(u => ({ value: u, label: t(`products.unit.${u}`) }))} />
|
||||||
</Field>
|
</Field>
|
||||||
<Field label={t('products.editor.price')} required>
|
<Field label={t('products.editor.price')} required>
|
||||||
@@ -41,8 +41,8 @@ export function InfoTab({ form, set, setForm, categories, prepZones }) {
|
|||||||
<CategoriesField form={form} setForm={setForm} categories={categories} />
|
<CategoriesField form={form} setForm={setForm} categories={categories} />
|
||||||
<PrepZonesField form={form} set={set} prepZones={prepZones} />
|
<PrepZonesField form={form} set={set} prepZones={prepZones} />
|
||||||
<AllergensField value={form.allergens} onChange={v => set('allergens', v)} />
|
<AllergensField value={form.allergens} onChange={v => set('allergens', v)} />
|
||||||
<Switch checked={form.is_available} onChange={v => set('is_available', v)} label={t('products.editor.available')} description={t('products.editor.availableHint')} />
|
<Switch checked={form.is_available} onChange={v => set('is_available', v)} label={t('products.editor.available')} info={<InfoTip>{t('products.editor.availableTip')}</InfoTip>} description={t('products.editor.availableHint')} />
|
||||||
<Switch checked={form.quick_add_enabled} onChange={v => set('quick_add_enabled', v)} label={t('products.editor.quickAdd')} description={t('products.editor.quickAddHint')} />
|
<Switch checked={form.quick_add_enabled} onChange={v => set('quick_add_enabled', v)} label={t('products.editor.quickAdd')} info={<InfoTip>{t('products.editor.quickAddTip')}</InfoTip>} description={t('products.editor.quickAddHint')} />
|
||||||
<MediaField value={form.image} onChange={image => set('image', image)} nameAfter={shownText(form.names, venue, form.name)} label={t('media.photo')} testid="product-photo" />
|
<MediaField value={form.image} onChange={image => set('image', image)} nameAfter={shownText(form.names, venue, form.name)} label={t('media.photo')} testid="product-photo" />
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
@@ -158,7 +158,7 @@ export function CostTab({ form, set, setForm }) {
|
|||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
{form.cost_mode === 'simple' ? (
|
{form.cost_mode === 'simple' ? (
|
||||||
<Field label={t('products.editor.costPerUnit')}><PriceInput className="w-full" value={form.cost_simple} onChange={v => set('cost_simple', v)} label={t('products.editor.costPerUnit')} /></Field>
|
<Field label={t('products.editor.costPerUnit')} info={<InfoTip>{t('products.editor.costTip')}</InfoTip>}><PriceInput className="w-full" value={form.cost_simple} onChange={v => set('cost_simple', v)} label={t('products.editor.costPerUnit')} /></Field>
|
||||||
) : (
|
) : (
|
||||||
<div className="grid gap-2">
|
<div className="grid gap-2">
|
||||||
{form.cost_breakdown.map((e, i) => (
|
{form.cost_breakdown.map((e, i) => (
|
||||||
@@ -190,7 +190,7 @@ export function FiscalTab({ form, set, vatGroups }) {
|
|||||||
<Field label={t('products.editor.fiscalName')} hint={t('products.editor.fiscalNameHint')}>
|
<Field label={t('products.editor.fiscalName')} hint={t('products.editor.fiscalNameHint')}>
|
||||||
<Input className="font-mono uppercase" maxLength={30} value={form.fiscal_name} onChange={e => set('fiscal_name', e.target.value.toUpperCase())} placeholder={form.name.toUpperCase()} />
|
<Input className="font-mono uppercase" maxLength={30} value={form.fiscal_name} onChange={e => set('fiscal_name', e.target.value.toUpperCase())} placeholder={form.name.toUpperCase()} />
|
||||||
</Field>
|
</Field>
|
||||||
<Field label={t('products.editor.vatGroup')} error={!form.fiscal_vat_group_id ? t('products.editor.vatGroupNeeded') : undefined}>
|
<Field label={t('products.editor.vatGroup')} info={<InfoTip>{t('products.editor.vatGroupTip')}</InfoTip>} error={!form.fiscal_vat_group_id ? t('products.editor.vatGroupNeeded') : undefined}>
|
||||||
{vatGroups.length === 0
|
{vatGroups.length === 0
|
||||||
? <p className="text-label text-warning-ink">{t('products.editor.noVatGroups')}</p>
|
? <p className="text-label text-warning-ink">{t('products.editor.noVatGroups')}</p>
|
||||||
: <Select value={form.fiscal_vat_group_id ?? ''} onChange={e => set('fiscal_vat_group_id', e.target.value ? Number(e.target.value) : null)}>
|
: <Select value={form.fiscal_vat_group_id ?? ''} onChange={e => set('fiscal_vat_group_id', e.target.value ? Number(e.target.value) : null)}>
|
||||||
|
|||||||
@@ -3,6 +3,10 @@
|
|||||||
// pixel by pixel (or in steps of 10 / 50 px), or a preset sets the largest box of a common shape in
|
// pixel by pixel (or in steps of 10 / 50 px), or a preset sets the largest box of a common shape in
|
||||||
// the middle of the TV's window (it reports its size). Every change reaches the TV at once; closing
|
// the middle of the TV's window (it reports its size). Every change reaches the TV at once; closing
|
||||||
// ends the calibration (the TV also stops by itself after 15 min).
|
// ends the calibration (the TV also stops by itself after 15 min).
|
||||||
|
// Owner 2026-11-23: every row centred; "Each click moves" above its choice; the window size is
|
||||||
|
// marked as the one the TV reported (recognised), and an edge may go past it (below 0 px) when the
|
||||||
|
// TV's real picture is larger; "on" is sent again a moment after opening (the TV shows the outline
|
||||||
|
// the first time).
|
||||||
import { useCallback, useEffect, useRef, useState } from 'react'
|
import { useCallback, useEffect, useRef, useState } from 'react'
|
||||||
import toast from 'react-hot-toast'
|
import toast from 'react-hot-toast'
|
||||||
import { errorMessage } from '@xenia/api'
|
import { errorMessage } from '@xenia/api'
|
||||||
@@ -15,6 +19,7 @@ import { ShapeMark } from './ShapeField'
|
|||||||
const EDGES = ['top', 'right', 'bottom', 'left']
|
const EDGES = ['top', 'right', 'bottom', 'left']
|
||||||
const PRESETS = ['full', '16:9', '16:10', '21:9', '32:9', '4:3', '9:16']
|
const PRESETS = ['full', '16:9', '16:10', '21:9', '32:9', '4:3', '9:16']
|
||||||
const SAVE_MS = 200
|
const SAVE_MS = 200
|
||||||
|
const OUT = 2000 // px an edge may reach past the recognised window
|
||||||
|
|
||||||
export default function CalibrateDialog({ screen, onClose, onSaved }) {
|
export default function CalibrateDialog({ screen, onClose, onSaved }) {
|
||||||
const { t } = useTranslation('manager')
|
const { t } = useTranslation('manager')
|
||||||
@@ -30,7 +35,8 @@ export default function CalibrateDialog({ screen, onClose, onSaved }) {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const mine = ++alive.current
|
const mine = ++alive.current
|
||||||
api.calibrateScreen(screen.id, true).catch(err => toast.error(errorMessage(err, t)))
|
api.calibrateScreen(screen.id, true).catch(err => toast.error(errorMessage(err, t)))
|
||||||
return () => { setTimeout(() => { if (alive.current === mine) api.calibrateScreen(screen.id, false).catch(() => {}) }, 300) }
|
const again = setTimeout(() => { if (alive.current === mine) api.calibrateScreen(screen.id, true).catch(() => {}) }, 1500)
|
||||||
|
return () => { clearTimeout(again); setTimeout(() => { if (alive.current === mine) api.calibrateScreen(screen.id, false).catch(() => {}) }, 300) }
|
||||||
}, [screen.id]) // eslint-disable-line react-hooks/exhaustive-deps
|
}, [screen.id]) // eslint-disable-line react-hooks/exhaustive-deps
|
||||||
// the TV's window size (it reports it when it starts and when it changes)
|
// the TV's window size (it reports it when it starts and when it changes)
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -54,15 +60,20 @@ export default function CalibrateDialog({ screen, onClose, onSaved }) {
|
|||||||
useEffect(() => () => clearTimeout(timer.current), [])
|
useEffect(() => () => clearTimeout(timer.current), [])
|
||||||
const win = viewport ? { w: viewport.width, h: viewport.height } : null
|
const win = viewport ? { w: viewport.width, h: viewport.height } : null
|
||||||
const pic = win ? pictureArea(win, area) : null
|
const pic = win ? pictureArea(win, area) : null
|
||||||
const setEdge = (edge, v) => change({ ...area, [edge]: Math.max(0, Math.min(4000, v ?? 0)) })
|
const setEdge = (edge, v) => change({ ...area, [edge]: Math.max(-OUT, Math.min(4000, v ?? 0)) })
|
||||||
|
|
||||||
// the diagram: the TV's window and the picture inside it, to scale
|
// the diagram: the recognised window (dashed) and the picture, to scale; a picture reaching past
|
||||||
|
// the window makes the drawing as large as both
|
||||||
|
const bounds = win && pic ? {
|
||||||
|
x: Math.min(0, pic.left), y: Math.min(0, pic.top),
|
||||||
|
r: Math.max(win.w, pic.left + pic.width), b: Math.max(win.h, pic.top + pic.height),
|
||||||
|
} : null
|
||||||
const W = 320
|
const W = 320
|
||||||
const H = win ? Math.round(W * win.h / win.w) : 180
|
const H = bounds ? Math.round(W * (bounds.b - bounds.y) / (bounds.r - bounds.x)) : 180
|
||||||
const k = win ? W / win.w : 0
|
const k = bounds ? W / (bounds.r - bounds.x) : 0
|
||||||
const edge = e => (
|
const edge = e => (
|
||||||
<Field label={t(`signage.calibrate.edges.${e}`)} className="w-36">
|
<Field label={t(`signage.calibrate.edges.${e}`)} className="w-36">
|
||||||
<NumberInput size="sm" value={area[e]} min={0} max={4000} step={step} suffix="px" onChange={v => setEdge(e, v)} data-testid={`signage-calibrate-${e}`} />
|
<NumberInput size="sm" value={area[e]} min={-OUT} max={4000} step={step} suffix="px" onChange={v => setEdge(e, v)} data-testid={`signage-calibrate-${e}`} />
|
||||||
</Field>
|
</Field>
|
||||||
)
|
)
|
||||||
return (
|
return (
|
||||||
@@ -71,13 +82,17 @@ export default function CalibrateDialog({ screen, onClose, onSaved }) {
|
|||||||
<Button variant="secondary" onClick={() => change({ left: 0, top: 0, right: 0, bottom: 0 })} data-testid="signage-calibrate-reset">{t('signage.calibrate.reset')}</Button>
|
<Button variant="secondary" onClick={() => change({ left: 0, top: 0, right: 0, bottom: 0 })} data-testid="signage-calibrate-reset">{t('signage.calibrate.reset')}</Button>
|
||||||
<Button onClick={onClose} data-testid="signage-calibrate-done">{t('signage.calibrate.done')}</Button>
|
<Button onClick={onClose} data-testid="signage-calibrate-done">{t('signage.calibrate.done')}</Button>
|
||||||
</>}>
|
</>}>
|
||||||
<div className="grid gap-5" data-testid="signage-calibrate-dialog">
|
<div className="grid gap-5 justify-items-center text-center" data-testid="signage-calibrate-dialog">
|
||||||
<p className="text-label text-ink-2" data-testid="signage-calibrate-window">
|
<div className="grid gap-1 justify-items-center">
|
||||||
{win ? t('signage.calibrate.window', { w: win.w, h: win.h, shape: shapeName(win.w, win.h) }) : t('signage.calibrate.waiting')}
|
<span className="text-caption font-medium text-ink-3 uppercase tracking-wide">{t('signage.calibrate.recognised')}</span>
|
||||||
</p>
|
<p className="text-body-lg font-semibold text-ink tabular-nums" data-testid="signage-calibrate-window">
|
||||||
<div className="grid gap-2">
|
{win ? t('signage.calibrate.window', { w: win.w, h: win.h, shape: shapeName(win.w, win.h) }) : t('signage.calibrate.waiting')}
|
||||||
|
</p>
|
||||||
|
{win && <p className="text-caption text-ink-3 max-w-md">{t('signage.calibrate.recognisedHint')}</p>}
|
||||||
|
</div>
|
||||||
|
<div className="grid gap-2 justify-items-center">
|
||||||
<span className="text-label font-medium text-ink">{t('signage.calibrate.presets')}</span>
|
<span className="text-label font-medium text-ink">{t('signage.calibrate.presets')}</span>
|
||||||
<div className="flex flex-wrap gap-1.5">
|
<div className="flex flex-wrap justify-center gap-1.5">
|
||||||
{PRESETS.map(p => (
|
{PRESETS.map(p => (
|
||||||
<Button key={p} size="sm" variant="secondary" disabled={!win} onClick={() => change(presetInsets(win, p))} data-preset={p}
|
<Button key={p} size="sm" variant="secondary" disabled={!win} onClick={() => change(presetInsets(win, p))} data-preset={p}
|
||||||
icon={p === 'full' ? undefined : <ShapeMark shape={p} size={16} />}>
|
icon={p === 'full' ? undefined : <ShapeMark shape={p} size={16} />}>
|
||||||
@@ -86,7 +101,7 @@ export default function CalibrateDialog({ screen, onClose, onSaved }) {
|
|||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex flex-wrap items-center gap-3">
|
<div className="grid gap-2 justify-items-center">
|
||||||
<span className="text-label font-medium text-ink">{t('signage.calibrate.step')}</span>
|
<span className="text-label font-medium text-ink">{t('signage.calibrate.step')}</span>
|
||||||
<Segmented value={step} onChange={setStep} options={[1, 10, 50].map(n => ({ value: n, label: `${n} px` }))} data-testid="signage-calibrate-step" />
|
<Segmented value={step} onChange={setStep} options={[1, 10, 50].map(n => ({ value: n, label: `${n} px` }))} data-testid="signage-calibrate-step" />
|
||||||
</div>
|
</div>
|
||||||
@@ -94,13 +109,15 @@ export default function CalibrateDialog({ screen, onClose, onSaved }) {
|
|||||||
{edge('top')}
|
{edge('top')}
|
||||||
<div className="flex items-center gap-3 flex-wrap justify-center">
|
<div className="flex items-center gap-3 flex-wrap justify-center">
|
||||||
{edge('left')}
|
{edge('left')}
|
||||||
<div className="relative rounded-control border border-line-strong bg-surface-2" style={{ width: W, height: H }} aria-hidden="true">
|
<div className="relative rounded-control bg-surface-2" style={{ width: W, height: H }} aria-hidden="true" data-testid="signage-calibrate-diagram">
|
||||||
{pic && (
|
{pic && bounds && <>
|
||||||
<div className="absolute border-2 border-accent bg-accent-soft grid place-items-center text-caption text-accent-ink tabular-nums"
|
<div className="absolute border-2 border-accent bg-accent-soft grid place-items-center text-caption text-accent-ink tabular-nums"
|
||||||
style={{ left: pic.left * k, top: pic.top * k, width: pic.width * k, height: pic.height * k }}>
|
style={{ left: (pic.left - bounds.x) * k, top: (pic.top - bounds.y) * k, width: pic.width * k, height: pic.height * k }}>
|
||||||
{Math.round(pic.width)} × {Math.round(pic.height)}
|
{Math.round(pic.width)} × {Math.round(pic.height)}
|
||||||
</div>
|
</div>
|
||||||
)}
|
<div className="absolute border border-dashed border-line-strong rounded-[2px] pointer-events-none"
|
||||||
|
style={{ left: -bounds.x * k, top: -bounds.y * k, width: win.w * k, height: win.h * k }} />
|
||||||
|
</>}
|
||||||
</div>
|
</div>
|
||||||
{edge('right')}
|
{edge('right')}
|
||||||
</div>
|
</div>
|
||||||
@@ -109,7 +126,9 @@ export default function CalibrateDialog({ screen, onClose, onSaved }) {
|
|||||||
<p className="text-label text-ink-2 text-center" data-testid="signage-calibrate-picture">
|
<p className="text-label text-ink-2 text-center" data-testid="signage-calibrate-picture">
|
||||||
{pic ? t('signage.calibrate.picture', { w: Math.round(pic.width), h: Math.round(pic.height), shape: shapeName(pic.width, pic.height) }) : ''}
|
{pic ? t('signage.calibrate.picture', { w: Math.round(pic.width), h: Math.round(pic.height), shape: shapeName(pic.width, pic.height) }) : ''}
|
||||||
</p>
|
</p>
|
||||||
|
<p className="text-caption text-ink-3 max-w-md">{t('signage.calibrate.edgesHint')}</p>
|
||||||
{EDGES.some(e => area[e] > 0) && <p className="text-caption text-ink-3">{t('signage.calibrate.outside')}</p>}
|
{EDGES.some(e => area[e] > 0) && <p className="text-caption text-ink-3">{t('signage.calibrate.outside')}</p>}
|
||||||
|
{EDGES.some(e => area[e] < 0) && <p className="text-caption text-warning-ink" data-testid="signage-calibrate-past">{t('signage.calibrate.past')}</p>}
|
||||||
</div>
|
</div>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -0,0 +1,98 @@
|
|||||||
|
// A widget's "Text and colours" (owner review 5, 2026-11-21; owner 2026-11-23: everything about its
|
||||||
|
// text and colours in one place): its text colour (text and pictures; empty = the slide's), a plate
|
||||||
|
// behind it, its font, bold / italic / underline, text size and weight, a highlight behind the text,
|
||||||
|
// its shadow (and the shadow's colour); a QR code's dots and background; a picture's (logo, gallery)
|
||||||
|
// border. A menu, a stack and a shape have none (their own look / their main settings).
|
||||||
|
import { useState } from 'react'
|
||||||
|
import { Bold, ChevronDown, Italic, Palette, Underline } from 'lucide-react'
|
||||||
|
import { useTranslation } from '@xenia/i18n'
|
||||||
|
import { ColourField, Dropdown, Field, FieldRow, Segmented, Slider } from '@xenia/ui'
|
||||||
|
import { FONT_KEYS, FRAMED, lookKind, WIDGET_COLOURS } from './signageLogic'
|
||||||
|
|
||||||
|
// which widgets have text (their colour, font, style, size, weight, highlight)
|
||||||
|
const TEXT_KINDS = ['name', 'date', 'clock', 'message', 'text', 'qr', 'weather', 'ticker', 'countdown', 'hours', 'wifi', 'contact', 'reviews', 'gallery']
|
||||||
|
const WEIGHTS = [100, 200, 300, 400, 500, 600, 700, 800, 900]
|
||||||
|
|
||||||
|
export default function LookFields({ w, set }) {
|
||||||
|
const { t } = useTranslation('manager')
|
||||||
|
const [open, setOpen] = useState(false)
|
||||||
|
if (!lookKind(w.kind)) return null
|
||||||
|
const text = TEXT_KINDS.includes(w.kind)
|
||||||
|
const framed = FRAMED.includes(w.kind)
|
||||||
|
const m = 'signage.more'
|
||||||
|
const changed = !!(w.colour || w.background_colour || w.font || w.bold != null || w.italic || w.underline || (w.text_size && w.text_size !== 100) || w.qr_colour || w.qr_background
|
||||||
|
|| w.weight || w.highlight || (w.shadow && w.shadow !== 'none') || (framed && (w.border_width || w.border_radius)))
|
||||||
|
const styles = [w.bold !== false && 'bold', w.italic && 'italic', w.underline && 'underline'].filter(Boolean)
|
||||||
|
return (
|
||||||
|
<div className="grid gap-2" data-testid="signage-widget-look">
|
||||||
|
<button type="button" onClick={() => setOpen(o => !o)} aria-expanded={open} data-testid="signage-widget-look-toggle"
|
||||||
|
className="justify-self-start flex items-center gap-1.5 text-label font-medium text-ink-2 hover:text-ink">
|
||||||
|
<Palette size={15} aria-hidden="true" />{t('signage.widgets.look')}
|
||||||
|
{changed && <span className="w-1.5 h-1.5 rounded-full bg-accent" aria-hidden="true" />}
|
||||||
|
<ChevronDown size={15} className={`transition-transform duration-fast ${open ? 'rotate-180' : ''}`} aria-hidden="true" />
|
||||||
|
</button>
|
||||||
|
{open && (
|
||||||
|
<FieldRow className="-mx-3" min="10rem">
|
||||||
|
{text && <ColourField label={t('signage.widgets.colour')} value={w.colour || WIDGET_COLOURS.text} onChange={colour => set({ colour })} testId="signage-widget-colour"
|
||||||
|
auto={{ label: t('signage.widgets.asSlide'), on: !w.colour, pick: () => set({ colour: null }) }} />}
|
||||||
|
<ColourField label={t('signage.widgets.plate')} value={w.background_colour || WIDGET_COLOURS.plate} onChange={background_colour => set({ background_colour })} testId="signage-widget-plate"
|
||||||
|
auto={{ label: t('signage.widgets.noPlate'), on: !w.background_colour, pick: () => set({ background_colour: null }) }} />
|
||||||
|
{text && <>
|
||||||
|
<Field label={t('signage.font')}>
|
||||||
|
<Dropdown value={w.font || ''} onChange={v => set({ font: v || null })} data-testid="signage-widget-font"
|
||||||
|
options={[{ value: '', label: t('signage.widgets.asSlide') }, ...FONT_KEYS.map(x => ({ value: x, label: t(`signage.fonts.${x}`) }))]} />
|
||||||
|
</Field>
|
||||||
|
<Field label={t('signage.look.f.widget.style')}>
|
||||||
|
<Segmented multiple fill value={styles} data-testid="signage-widget-style"
|
||||||
|
onChange={list => set({ bold: list.includes('bold') ? null : false, italic: list.includes('italic'), underline: list.includes('underline') })}
|
||||||
|
options={[['bold', Bold], ['italic', Italic], ['underline', Underline]].map(([v, Icon]) => (
|
||||||
|
{ value: v, icon: <Icon size={16} aria-hidden="true" />, ariaLabel: t(`signage.look.${v}`), testId: `signage-widget-${v}` }))} />
|
||||||
|
</Field>
|
||||||
|
<Slider label={t('signage.widgets.textSize')} value={w.text_size || 100} min={50} max={200} step={10} suffix="%" onChange={text_size => set({ text_size })} testId="signage-widget-text-size" />
|
||||||
|
<Field label={t(`${m}.weight`)}>
|
||||||
|
<Dropdown value={w.weight || ''} onChange={v => set({ weight: v === '' ? null : Number(v) })} data-testid="signage-more-weight"
|
||||||
|
options={[{ value: '', label: t(`${m}.usual`) }, ...WEIGHTS.map(n => ({ value: n, label: t(`${m}.weights.${n}`) }))]} />
|
||||||
|
</Field>
|
||||||
|
<ColourField label={t(`${m}.highlight`)} value={w.highlight || WIDGET_COLOURS.plate} onChange={highlight => set({ highlight })} testId="signage-more-highlight"
|
||||||
|
auto={{ label: t(`${m}.noHighlight`), on: !w.highlight, pick: () => set({ highlight: null }) }} />
|
||||||
|
</>}
|
||||||
|
<ShadowFields w={w} set={set} />
|
||||||
|
{(w.kind === 'qr' || w.kind === 'wifi') && <>
|
||||||
|
<ColourField label={t('signage.widgets.qrColour')} value={w.qr_colour || WIDGET_COLOURS.qr} onChange={qr_colour => set({ qr_colour })} testId="signage-widget-qr-colour" opacity={false} />
|
||||||
|
<ColourField label={t('signage.widgets.qrBackground')} value={w.qr_background || WIDGET_COLOURS.qrBackground} onChange={qr_background => set({ qr_background })} testId="signage-widget-qr-background" />
|
||||||
|
</>}
|
||||||
|
{framed && <BorderFields w={w} set={set} />}
|
||||||
|
</FieldRow>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
/** A widget's shadow and its colour (here, or under More settings for a widget without Text and colours). */
|
||||||
|
export function ShadowFields({ w, set }) {
|
||||||
|
const { t } = useTranslation('manager')
|
||||||
|
const m = 'signage.more'
|
||||||
|
return (<>
|
||||||
|
<Field label={t(`${m}.shadow`)}>
|
||||||
|
<Dropdown value={w.shadow || 'none'} onChange={shadow => set({ shadow })} data-testid="signage-more-shadow"
|
||||||
|
options={['none', 'soft', 'strong', 'glow'].map(x => ({ value: x, label: t(`${m}.shadows.${x}`) }))} />
|
||||||
|
</Field>
|
||||||
|
{w.shadow && w.shadow !== 'none' && (
|
||||||
|
<ColourField label={t(`${m}.shadowColour`)} value={w.shadow_colour || WIDGET_COLOURS.plate} onChange={shadow_colour => set({ shadow_colour })}
|
||||||
|
auto={{ label: t(`${m}.usual`), on: !w.shadow_colour, pick: () => set({ shadow_colour: null }) }} />
|
||||||
|
)}
|
||||||
|
</>)
|
||||||
|
}
|
||||||
|
|
||||||
|
/** A widget's border: its width, colour and rounded corners. */
|
||||||
|
export function BorderFields({ w, set }) {
|
||||||
|
const { t } = useTranslation('manager')
|
||||||
|
const m = 'signage.more'
|
||||||
|
return (<>
|
||||||
|
<Slider label={t(`${m}.border`)} value={w.border_width || 0} min={0} max={20} onChange={border_width => set({ border_width })} testId="signage-more-border" />
|
||||||
|
{w.border_width > 0 && (
|
||||||
|
<ColourField label={t(`${m}.borderColour`)} value={w.border_colour || WIDGET_COLOURS.text} onChange={border_colour => set({ border_colour })} />
|
||||||
|
)}
|
||||||
|
<Slider label={t(`${m}.radius`)} value={w.border_radius || 0} min={0} max={100} step={5} onChange={border_radius => set({ border_radius })} />
|
||||||
|
</>)
|
||||||
|
}
|
||||||
@@ -2,27 +2,26 @@
|
|||||||
// for every widget its opacity, rotation (steps or any angle), shadow, border and an entrance
|
// for every widget its opacity, rotation (steps or any angle), shadow, border and an entrance
|
||||||
// animation; a logo's fit; for texts the weight, a highlight behind them and typing themselves out;
|
// animation; a logo's fit; for texts the weight, a highlight behind them and typing themselves out;
|
||||||
// date and clock formats; a logo in the middle of a QR code. The TV draws them (Slides.jsx `fx`,
|
// date and clock formats; a logo in the middle of a QR code. The TV draws them (Slides.jsx `fx`,
|
||||||
// `animate`, `dateText`).
|
// `animate`, `dateText`). Owner 2026-11-23: the weight, highlight and shadow moved to "Text and
|
||||||
|
// colours" (LookFields; the shadow stays here for a menu, a stack, a shape), a logo's / gallery's
|
||||||
|
// border too, the date's and clock's formats to their main settings.
|
||||||
import { useState } from 'react'
|
import { useState } from 'react'
|
||||||
import { ChevronDown, SlidersHorizontal } from 'lucide-react'
|
import { ChevronDown, SlidersHorizontal } from 'lucide-react'
|
||||||
import { useTranslation } from '@xenia/i18n'
|
import { useTranslation } from '@xenia/i18n'
|
||||||
import { ColourField, Dropdown, Field, FieldRow, Segmented, Slider, Switch } from '@xenia/ui'
|
import { Dropdown, Field, FieldRow, Segmented, Slider, Switch } from '@xenia/ui'
|
||||||
|
import { BorderFields, ShadowFields } from './LookFields'
|
||||||
import { MediaPick } from './SignageFields'
|
import { MediaPick } from './SignageFields'
|
||||||
import { moreChanged, WIDGET_COLOURS } from './signageLogic'
|
import { FRAMED, lookKind, moreChanged } from './signageLogic'
|
||||||
|
|
||||||
const TEXTS = ['name', 'date', 'clock', 'message', 'text', 'countdown', 'hours', 'wifi', 'contact', 'ticker', 'reviews', 'weather']
|
|
||||||
const TYPED = ['name', 'message', 'text']
|
const TYPED = ['name', 'message', 'text']
|
||||||
const ANIMATIONS = ['none', 'fade', 'rise', 'drop', 'slide-left', 'slide-right', 'zoom', 'pop', 'pulse', 'float']
|
const ANIMATIONS = ['none', 'fade', 'rise', 'drop', 'slide-left', 'slide-right', 'zoom', 'pop', 'pulse', 'float']
|
||||||
const DELAYS = [0, 5, 10, 15, 20, 30, 50]
|
const DELAYS = [0, 5, 10, 15, 20, 30, 50]
|
||||||
const WEIGHTS = [100, 200, 300, 400, 500, 600, 700, 800, 900]
|
|
||||||
const DATE_FORMATS = ['long', 'weekday_day_month', 'day_month', 'weekday', 'numeric', 'numeric_short', 'iso']
|
|
||||||
|
|
||||||
export default function MoreSettings({ w, set, media = {}, onMedia }) {
|
export default function MoreSettings({ w, set, media = {}, onMedia }) {
|
||||||
const { t } = useTranslation('manager')
|
const { t } = useTranslation('manager')
|
||||||
const [open, setOpen] = useState(false)
|
const [open, setOpen] = useState(false)
|
||||||
const k = 'signage.more'
|
const k = 'signage.more'
|
||||||
const text = TEXTS.includes(w.kind)
|
const look = lookKind(w.kind)
|
||||||
const numeric = ['numeric', 'numeric_short', 'iso'].includes(w.date_format)
|
|
||||||
return (
|
return (
|
||||||
<div className="grid gap-2" data-testid="signage-widget-more">
|
<div className="grid gap-2" data-testid="signage-widget-more">
|
||||||
<button type="button" onClick={() => setOpen(o => !o)} aria-expanded={open} data-testid="signage-widget-more-toggle"
|
<button type="button" onClick={() => setOpen(o => !o)} aria-expanded={open} data-testid="signage-widget-more-toggle"
|
||||||
@@ -39,19 +38,8 @@ export default function MoreSettings({ w, set, media = {}, onMedia }) {
|
|||||||
options={[0, 90, 180, -90].map(r => ({ value: r, label: `${r}°` }))} data-testid="signage-more-rotation-steps" />
|
options={[0, 90, 180, -90].map(r => ({ value: r, label: `${r}°` }))} data-testid="signage-more-rotation-steps" />
|
||||||
</Field>
|
</Field>
|
||||||
<Slider label={t(`${k}.angle`)} value={w.rotation || 0} min={-180} max={180} step={1} suffix="°" onChange={rotation => set({ rotation })} testId="signage-more-rotation" />
|
<Slider label={t(`${k}.angle`)} value={w.rotation || 0} min={-180} max={180} step={1} suffix="°" onChange={rotation => set({ rotation })} testId="signage-more-rotation" />
|
||||||
<Field label={t(`${k}.shadow`)}>
|
{!look && <ShadowFields w={w} set={set} />}
|
||||||
<Dropdown value={w.shadow || 'none'} onChange={shadow => set({ shadow })} data-testid="signage-more-shadow"
|
{!FRAMED.includes(w.kind) && <BorderFields w={w} set={set} />}
|
||||||
options={['none', 'soft', 'strong', 'glow'].map(x => ({ value: x, label: t(`${k}.shadows.${x}`) }))} />
|
|
||||||
</Field>
|
|
||||||
{w.shadow && w.shadow !== 'none' && (
|
|
||||||
<ColourField label={t(`${k}.shadowColour`)} value={w.shadow_colour || WIDGET_COLOURS.plate} onChange={shadow_colour => set({ shadow_colour })}
|
|
||||||
auto={{ label: t(`${k}.usual`), on: !w.shadow_colour, pick: () => set({ shadow_colour: null }) }} />
|
|
||||||
)}
|
|
||||||
<Slider label={t(`${k}.border`)} value={w.border_width || 0} min={0} max={20} onChange={border_width => set({ border_width })} testId="signage-more-border" />
|
|
||||||
{w.border_width > 0 && (
|
|
||||||
<ColourField label={t(`${k}.borderColour`)} value={w.border_colour || WIDGET_COLOURS.text} onChange={border_colour => set({ border_colour })} />
|
|
||||||
)}
|
|
||||||
<Slider label={t(`${k}.radius`)} value={w.border_radius || 0} min={0} max={100} step={5} onChange={border_radius => set({ border_radius })} />
|
|
||||||
<Field label={t(`${k}.animation`)}>
|
<Field label={t(`${k}.animation`)}>
|
||||||
<Dropdown value={w.animation || 'none'} onChange={animation => set({ animation })} data-testid="signage-more-animation"
|
<Dropdown value={w.animation || 'none'} onChange={animation => set({ animation })} data-testid="signage-more-animation"
|
||||||
options={ANIMATIONS.map(x => ({ value: x, label: t(`${k}.animations.${x}`) }))} />
|
options={ANIMATIONS.map(x => ({ value: x, label: t(`${k}.animations.${x}`) }))} />
|
||||||
@@ -68,46 +56,17 @@ export default function MoreSettings({ w, set, media = {}, onMedia }) {
|
|||||||
options={['contain', 'cover', 'fill'].map(x => ({ value: x, label: t(`${k}.fits.${x}`) }))} />
|
options={['contain', 'cover', 'fill'].map(x => ({ value: x, label: t(`${k}.fits.${x}`) }))} />
|
||||||
</Field>
|
</Field>
|
||||||
)}
|
)}
|
||||||
{text && (
|
|
||||||
<Field label={t(`${k}.weight`)}>
|
|
||||||
<Dropdown value={w.weight || ''} onChange={v => set({ weight: v === '' ? null : Number(v) })} data-testid="signage-more-weight"
|
|
||||||
options={[{ value: '', label: t(`${k}.usual`) }, ...WEIGHTS.map(n => ({ value: n, label: t(`${k}.weights.${n}`) }))]} />
|
|
||||||
</Field>
|
|
||||||
)}
|
|
||||||
{text && (
|
|
||||||
<ColourField label={t(`${k}.highlight`)} value={w.highlight || WIDGET_COLOURS.plate} onChange={highlight => set({ highlight })} testId="signage-more-highlight"
|
|
||||||
auto={{ label: t(`${k}.noHighlight`), on: !w.highlight, pick: () => set({ highlight: null }) }} />
|
|
||||||
)}
|
|
||||||
{TYPED.includes(w.kind) && (
|
{TYPED.includes(w.kind) && (
|
||||||
<Field label={t(`${k}.typing`)}>
|
<Field label={t(`${k}.typing`)}>
|
||||||
<Switch boxed className="h-control" checked={w.text_effect === 'typewriter'} onChange={on => set({ text_effect: on ? 'typewriter' : 'none' })}
|
<Switch boxed className="h-control" checked={w.text_effect === 'typewriter'} onChange={on => set({ text_effect: on ? 'typewriter' : 'none' })}
|
||||||
label={t(`${k}.typewriter`)} data-testid="signage-more-typewriter" />
|
label={t(`${k}.typewriter`)} data-testid="signage-more-typewriter" />
|
||||||
</Field>
|
</Field>
|
||||||
)}
|
)}
|
||||||
{w.kind === 'date' && (
|
{w.kind === 'clock' && (
|
||||||
<Field label={t(`${k}.dateFormat`)}>
|
|
||||||
<Dropdown value={w.date_format || (w.date_style === 'short' ? 'numeric' : 'long')} onChange={date_format => set({ date_format })} data-testid="signage-more-date-format"
|
|
||||||
options={DATE_FORMATS.map(x => ({ value: x, label: t(`${k}.dateFormats.${x}`) }))} />
|
|
||||||
</Field>
|
|
||||||
)}
|
|
||||||
{w.kind === 'date' && numeric && (
|
|
||||||
<Field label={t(`${k}.separator`)}>
|
|
||||||
<Segmented fill value={w.date_separator || (w.date_format === 'iso' ? '-' : '/')} onChange={date_separator => set({ date_separator })}
|
|
||||||
options={['/', '.', '-', ' '].map(x => ({ value: x, label: x === ' ' ? t(`${k}.space`) : x }))} />
|
|
||||||
</Field>
|
|
||||||
)}
|
|
||||||
{w.kind === 'clock' && <>
|
|
||||||
<Field label={t(`${k}.clockFormat`)}>
|
|
||||||
<Segmented fill value={w.clock_format || '24'} onChange={clock_format => set({ clock_format })} data-testid="signage-more-clock-format"
|
|
||||||
options={['24', '12'].map(x => ({ value: x, label: t(`${k}.clockFormats.${x}`) }))} />
|
|
||||||
</Field>
|
|
||||||
<Field label={t(`${k}.separator`)}>
|
|
||||||
<Segmented fill value={w.clock_separator || ':'} onChange={clock_separator => set({ clock_separator })} options={[':', '.'].map(x => ({ value: x, label: x }))} />
|
|
||||||
</Field>
|
|
||||||
<Field label={t(`${k}.blink`)}>
|
<Field label={t(`${k}.blink`)}>
|
||||||
<Switch boxed className="h-control" checked={!!w.clock_blink} onChange={clock_blink => set({ clock_blink })} label={t(`${k}.blinkLabel`)} />
|
<Switch boxed className="h-control" checked={!!w.clock_blink} onChange={clock_blink => set({ clock_blink })} label={t(`${k}.blinkLabel`)} />
|
||||||
</Field>
|
</Field>
|
||||||
</>}
|
)}
|
||||||
{w.kind === 'qr' && (
|
{w.kind === 'qr' && (
|
||||||
<div className="col-span-full">
|
<div className="col-span-full">
|
||||||
<MediaPick kind="image" label={t(`${k}.qrLogo`)} value={w.media_id} entry={media[String(w.media_id)]} testid="signage-more-qr-logo"
|
<MediaPick kind="image" label={t(`${k}.qrLogo`)} value={w.media_id} entry={media[String(w.media_id)]} testid="signage-more-qr-logo"
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { useEffect, useState } from 'react'
|
|||||||
import { ArrowLeft, ArrowRight, Film, Plus, X } from 'lucide-react'
|
import { ArrowLeft, ArrowRight, Film, Plus, X } from 'lucide-react'
|
||||||
import { Link } from 'react-router-dom'
|
import { Link } from 'react-router-dom'
|
||||||
import { useTranslation } from '@xenia/i18n'
|
import { useTranslation } from '@xenia/i18n'
|
||||||
import { Button, ColourField, Dropdown, Field, IconButton, Input, Notice, NumberInput, Segmented, Slider, Switch } from '@xenia/ui'
|
import { Button, ColourField, Dropdown, Field, IconButton, InfoTip, Input, Notice, NumberInput, Segmented, Slider, Switch } from '@xenia/ui'
|
||||||
import { listFolders } from '../media/mediaApi'
|
import { listFolders } from '../media/mediaApi'
|
||||||
import MediaPicker from '../media/MediaPicker'
|
import MediaPicker from '../media/MediaPicker'
|
||||||
import { useHours, useIdentity } from '../../shell/useIdentity'
|
import { useHours, useIdentity } from '../../shell/useIdentity'
|
||||||
@@ -84,7 +84,7 @@ export function MoreInlineFields({ w, set }) {
|
|||||||
}
|
}
|
||||||
if (w.kind === 'gallery') {
|
if (w.kind === 'gallery') {
|
||||||
return (<>
|
return (<>
|
||||||
<Field label={t(`${k}.gallery.source`)}>
|
<Field label={t(`${k}.gallery.source`)} className="col-span-2">
|
||||||
<Segmented fill value={w.gallery_source || 'pictures'} onChange={gallery_source => set({ gallery_source })} data-testid="signage-widget-gallery-source"
|
<Segmented fill value={w.gallery_source || 'pictures'} onChange={gallery_source => set({ gallery_source })} data-testid="signage-widget-gallery-source"
|
||||||
options={['pictures', 'folder'].map(v => ({ value: v, label: t(`${k}.gallery.sources.${v}`) }))} />
|
options={['pictures', 'folder'].map(v => ({ value: v, label: t(`${k}.gallery.sources.${v}`) }))} />
|
||||||
</Field>
|
</Field>
|
||||||
@@ -99,11 +99,19 @@ export function MoreInlineFields({ w, set }) {
|
|||||||
<Dropdown value={w.gallery_fit || 'cover'} onChange={gallery_fit => set({ gallery_fit })}
|
<Dropdown value={w.gallery_fit || 'cover'} onChange={gallery_fit => set({ gallery_fit })}
|
||||||
options={[{ value: 'cover', label: t('signage.fits.cover') }, { value: 'contain', label: t('signage.fits.contain') }]} />
|
options={[{ value: 'cover', label: t('signage.fits.cover') }, { value: 'contain', label: t('signage.fits.contain') }]} />
|
||||||
</Field>
|
</Field>
|
||||||
|
{/* its title, above or below the pictures (owner 2026-11-23) */}
|
||||||
|
<Field label={t(`${k}.gallery.title`)}>
|
||||||
|
<Input value={w.text || ''} maxLength={120} placeholder={t(`${k}.gallery.titlePlaceholder`)} onChange={e => set({ text: e.target.value || null })} data-testid="signage-widget-gallery-title" />
|
||||||
|
</Field>
|
||||||
|
<Field label={t(`${k}.gallery.titleAt`)}>
|
||||||
|
<Segmented fill value={w.title_position || 'above'} onChange={title_position => set({ title_position })} data-testid="signage-widget-gallery-title-at"
|
||||||
|
options={['above', 'below'].map(v => ({ value: v, label: t(`${k}.gallery.titleAts.${v}`) }))} />
|
||||||
|
</Field>
|
||||||
</>)
|
</>)
|
||||||
}
|
}
|
||||||
if (w.kind === 'reviews') {
|
if (w.kind === 'reviews') {
|
||||||
return (<>
|
return (<>
|
||||||
<Field label={t(`${k}.reviews.min`)}>
|
<Field label={t(`${k}.reviews.min`)} className="col-span-2">
|
||||||
<Segmented fill value={w.reviews_min || 4} onChange={reviews_min => set({ reviews_min })} data-testid="signage-widget-reviews-min"
|
<Segmented fill value={w.reviews_min || 4} onChange={reviews_min => set({ reviews_min })} data-testid="signage-widget-reviews-min"
|
||||||
options={[1, 2, 3, 4, 5].map(n => ({ value: n, label: `${n}+` }))} />
|
options={[1, 2, 3, 4, 5].map(n => ({ value: n, label: `${n}+` }))} />
|
||||||
</Field>
|
</Field>
|
||||||
@@ -176,7 +184,7 @@ export function MoreBelowFields({ w, set, media = {}, onMedia }) {
|
|||||||
options={['full', 'hide'].map(v => ({ value: v, label: t(`${k}.countdown.waitingModes.${v}`) }))} />
|
options={['full', 'hide'].map(v => ({ value: v, label: t(`${k}.countdown.waitingModes.${v}`) }))} />
|
||||||
</Field>
|
</Field>
|
||||||
)}
|
)}
|
||||||
<Field label={t(`${k}.countdown.done`)} hint={t(`${k}.countdown.doneHint`)}>
|
<Field label={t(`${k}.countdown.done`)} info={<InfoTip>{t(`${k}.countdown.doneHint`)}</InfoTip>}>
|
||||||
<Input value={w.countdown_done || ''} maxLength={80} placeholder={t(`${k}.countdown.donePlaceholder`)} onChange={e => set({ countdown_done: e.target.value || null, countdown_done_hide: !e.target.value })} />
|
<Input value={w.countdown_done || ''} maxLength={80} placeholder={t(`${k}.countdown.donePlaceholder`)} onChange={e => set({ countdown_done: e.target.value || null, countdown_done_hide: !e.target.value })} />
|
||||||
</Field>
|
</Field>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -24,24 +24,32 @@
|
|||||||
// in layers: the card at the top is the widget drawn over the others, so a new widget goes on top
|
// in layers: the card at the top is the widget drawn over the others, so a new widget goes on top
|
||||||
// (last in the slide's list, first here); the arrows bring a widget forward / send it backward.
|
// (last in the slide's list, first here); the arrows bring a widget forward / send it backward.
|
||||||
// Up to the venue's limit (10 recommended; Signage → Message & settings → Performance).
|
// Up to the venue's limit (10 recommended; Signage → Message & settings → Performance).
|
||||||
|
// Owner 2026-11-23: a card is its main settings (the row and what needs more room under it: a
|
||||||
|
// picture, a gallery's pictures, the weather's details, a countdown's start and end…), then "Text
|
||||||
|
// and colours" (LookFields: every text, colour, shadow and highlight setting), then More settings.
|
||||||
|
// Alignment only where it lines something up: texts of several lines (Enter makes a new line in a
|
||||||
|
// text or the message), the hours, contact details, Wi-Fi (its code left / right / above), the
|
||||||
|
// weather laid out in rows, reviews, a countdown's title, a QR's caption, a gallery's title; inside
|
||||||
|
// a stack's part it also places the widget in its part.
|
||||||
import { Fragment, useEffect, useRef, useState } from 'react'
|
import { Fragment, useEffect, useRef, useState } from 'react'
|
||||||
import {
|
import {
|
||||||
AlignCenter, AlignLeft, AlignRight, AlignVerticalJustifyCenter, AlignVerticalJustifyEnd, AlignVerticalJustifyStart, ArrowDown, ArrowUp, Bold, Italic, Palette, RotateCcw, Underline, BookImage, CalendarDays, ChevronDown, Clock, CloudSun, Columns3, GripVertical,
|
AlignCenter, AlignLeft, AlignRight, AlignVerticalJustifyCenter, AlignVerticalJustifyEnd, AlignVerticalJustifyStart, ArrowDown, ArrowUp, RotateCcw, BookImage, CalendarDays, ChevronDown, Clock, CloudSun, Columns3, GripVertical,
|
||||||
ImageIcon, LayoutList, MessageSquare, Plus, QrCode, Rows3, Store, Trash2, Type, UtensilsCrossed,
|
ImageIcon, LayoutList, MessageSquare, Plus, QrCode, Rows3, Store, Trash2, Type, UtensilsCrossed,
|
||||||
CalendarClock, Contact, GalleryHorizontal, MessageSquareQuote, MoveHorizontal, Shapes, Timer, Wifi,
|
CalendarClock, Contact, GalleryHorizontal, MessageSquareQuote, MoveHorizontal, Shapes, Timer, Wifi,
|
||||||
} from 'lucide-react'
|
} from 'lucide-react'
|
||||||
import { cellWidgets, evenShares, setShare } from '@xenia/signage'
|
import { cellWidgets, evenShares, setShare } from '@xenia/signage'
|
||||||
import { useTranslation } from '@xenia/i18n'
|
import { useTranslation } from '@xenia/i18n'
|
||||||
import { Button, ColourField, Dialog, Dropdown, Field, FieldRow, IconButton, Input, Popover, Segmented, Slider, Switch } from '@xenia/ui'
|
import { Button, Dialog, Dropdown, Field, IconButton, Input, Popover, Segmented, Switch, Textarea } from '@xenia/ui'
|
||||||
import MessageOfTheDay from './MessageOfTheDay'
|
import MessageOfTheDay from './MessageOfTheDay'
|
||||||
import { usePerformance } from './usePerformance'
|
import { usePerformance } from './usePerformance'
|
||||||
import * as api from './signageApi'
|
import * as api from './signageApi'
|
||||||
|
import LookFields from './LookFields'
|
||||||
import MenuEditor from './MenuEditor'
|
import MenuEditor from './MenuEditor'
|
||||||
import MoreSettings from './MoreSettings'
|
import MoreSettings from './MoreSettings'
|
||||||
import { MoreBelowFields as MoreBelow, MoreInlineFields as MoreInline } from './MoreWidgetFields'
|
import { MoreBelowFields as MoreBelow, MoreInlineFields as MoreInline } from './MoreWidgetFields'
|
||||||
import { MediaPick, Section } from './SignageFields'
|
import { MediaPick, Section } from './SignageFields'
|
||||||
import {
|
import {
|
||||||
CELL_KINDS, cellWidget, WEATHER_DETAILS, WEATHER_LAYOUTS, fillPlace, FONT_KEYS, WIDGET_COLOURS, moved, newWidget, pickedAfterMove, presetWidget, WEATHER_CHOICES, weatherChoice, WIDGET_KINDS, WIDGET_POSITIONS,
|
CELL_KINDS, cellWidget, WEATHER_DETAILS, WEATHER_LAYOUTS, fillPlace, moved, newWidget, pickedAfterMove, presetWidget, WEATHER_CHOICES, weatherChoice, WIDGET_KINDS, WIDGET_POSITIONS,
|
||||||
} from './signageLogic'
|
} from './signageLogic'
|
||||||
|
|
||||||
const ICON = { logo: ImageIcon, name: Store, date: CalendarDays, clock: Clock, message: MessageSquare, text: Type, qr: QrCode, weather: CloudSun, menu: UtensilsCrossed, hstack: Columns3, vstack: Rows3,
|
const ICON = { logo: ImageIcon, name: Store, date: CalendarDays, clock: Clock, message: MessageSquare, text: Type, qr: QrCode, weather: CloudSun, menu: UtensilsCrossed, hstack: Columns3, vstack: Rows3,
|
||||||
@@ -50,6 +58,23 @@ const MORE_KINDS = ['shape', 'ticker', 'countdown', 'hours', 'wifi', 'contact',
|
|||||||
const iconOf = w => (w.kind === 'stack' ? (w.direction === 'column' ? Rows3 : Columns3) : ICON[w.kind] || LayoutList)
|
const iconOf = w => (w.kind === 'stack' ? (w.direction === 'column' ? Rows3 : Columns3) : ICON[w.kind] || LayoutList)
|
||||||
const kindLabel = (t, w) => t(`signage.widgets.kinds.${w.kind === 'stack' ? (w.direction === 'column' ? 'vstack' : 'hstack') : w.kind}`)
|
const kindLabel = (t, w) => t(`signage.widgets.kinds.${w.kind === 'stack' ? (w.direction === 'column' ? 'vstack' : 'hstack') : w.kind}`)
|
||||||
const ROW = 'grid gap-4 items-end grid-cols-[repeat(auto-fill,minmax(11rem,1fr))]'
|
const ROW = 'grid gap-4 items-end grid-cols-[repeat(auto-fill,minmax(11rem,1fr))]'
|
||||||
|
const DATE_FORMATS = ['long', 'weekday_day_month', 'day_month', 'weekday', 'numeric', 'numeric_short', 'iso']
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether the alignment lines something up (owner 2026-11-23): a widget of several lines or parts;
|
||||||
|
* one line (a name, date, clock), a picture, a scrolling text, a shape, a menu or a stack: no (each
|
||||||
|
* is exactly as big as what it shows, or fills its place). In a stack's part it also places the
|
||||||
|
* widget in its part, so there every widget but a stack, a menu, a scrolling text and a shape has it.
|
||||||
|
*/
|
||||||
|
function alignable(w, inPart = false) {
|
||||||
|
if (['stack', 'menu', 'ticker', 'shape'].includes(w.kind)) return false
|
||||||
|
if (inPart) return true
|
||||||
|
if (['logo', 'name', 'date', 'clock'].includes(w.kind)) return false
|
||||||
|
if (w.kind === 'weather') return (w.weather_layout || 'row') !== 'row'
|
||||||
|
if (w.kind === 'gallery' || w.kind === 'countdown') return !!w.text
|
||||||
|
if (w.kind === 'qr') return !!w.qr_caption
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
let library = null // the Slides library (for stacks' parts), read once
|
let library = null // the Slides library (for stacks' parts), read once
|
||||||
|
|
||||||
@@ -135,13 +160,13 @@ export default function WidgetsEditor({ widgets = [], onChange, media, onMedia,
|
|||||||
options={[...['small', 'medium', 'large'].map(s => ({ value: s, label: t(`signage.widgets.sizes.${s}`) })),
|
options={[...['small', 'medium', 'large'].map(s => ({ value: s, label: t(`signage.widgets.sizes.${s}`) })),
|
||||||
...(custom ? [{ value: 'custom', label: t('signage.widgets.custom') }] : [])]} />
|
...(custom ? [{ value: 'custom', label: t('signage.widgets.custom') }] : [])]} />
|
||||||
</Field>
|
</Field>
|
||||||
{w.kind !== 'stack' && <AlignField w={w} set={patch => set(i, patch)} />}
|
{alignable(w) && <AlignField w={w} set={patch => set(i, patch)} />}
|
||||||
<InlineFields w={w} set={patch => set(i, patch)} />
|
<InlineFields w={w} set={patch => set(i, patch)} />
|
||||||
</div>
|
</div>
|
||||||
<LookFields w={w} set={patch => set(i, patch)} />
|
|
||||||
<MoreSettings w={w} set={patch => set(i, patch)} media={media} onMedia={onMedia} />
|
|
||||||
<BelowFields w={w} set={patch => set(i, patch)} media={media} onMedia={onMedia} extras={extras} path={String(i)} depth={0}
|
<BelowFields w={w} set={patch => set(i, patch)} media={media} onMedia={onMedia} extras={extras} path={String(i)} depth={0}
|
||||||
selected={selected} onSelect={onSelect} />
|
selected={selected} onSelect={onSelect} />
|
||||||
|
<LookFields w={w} set={patch => set(i, patch)} />
|
||||||
|
<MoreSettings w={w} set={patch => set(i, patch)} media={media} onMedia={onMedia} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
@@ -179,64 +204,12 @@ function VerticalField({ w, set }) {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
// which widgets have text (their colour, font, style and size), a QR code's own colours, a plate
|
|
||||||
const TEXT_KINDS = ['name', 'date', 'clock', 'message', 'text', 'qr', 'weather', 'ticker', 'countdown', 'hours', 'wifi', 'contact', 'reviews']
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A widget's own look (owner review 5), folded under "Text and colours": its colour (text and
|
|
||||||
* pictures; empty = the slide's), a plate behind it, its font, bold / italic / underline and text
|
|
||||||
* size; a QR code's dots and background. A logo has only the plate; a menu has its own look.
|
|
||||||
*/
|
|
||||||
function LookFields({ w, set }) {
|
|
||||||
const { t } = useTranslation('manager')
|
|
||||||
const [open, setOpen] = useState(false)
|
|
||||||
if (w.kind === 'menu' || w.kind === 'stack' || w.kind === 'shape') return null
|
|
||||||
const text = TEXT_KINDS.includes(w.kind)
|
|
||||||
const changed = !!(w.colour || w.background_colour || w.font || w.bold != null || w.italic || w.underline || (w.text_size && w.text_size !== 100) || w.qr_colour || w.qr_background)
|
|
||||||
const styles = [w.bold !== false && 'bold', w.italic && 'italic', w.underline && 'underline'].filter(Boolean)
|
|
||||||
return (
|
|
||||||
<div className="grid gap-2" data-testid="signage-widget-look">
|
|
||||||
<button type="button" onClick={() => setOpen(o => !o)} aria-expanded={open} data-testid="signage-widget-look-toggle"
|
|
||||||
className="justify-self-start flex items-center gap-1.5 text-label font-medium text-ink-2 hover:text-ink">
|
|
||||||
<Palette size={15} aria-hidden="true" />{t(text ? 'signage.widgets.look' : 'signage.widgets.plateOnly')}
|
|
||||||
{changed && <span className="w-1.5 h-1.5 rounded-full bg-accent" aria-hidden="true" />}
|
|
||||||
<ChevronDown size={15} className={`transition-transform duration-fast ${open ? 'rotate-180' : ''}`} aria-hidden="true" />
|
|
||||||
</button>
|
|
||||||
{open && (
|
|
||||||
<FieldRow className="-mx-3" min="10rem">
|
|
||||||
{text && <ColourField label={t('signage.widgets.colour')} value={w.colour || WIDGET_COLOURS.text} onChange={colour => set({ colour })} testId="signage-widget-colour"
|
|
||||||
auto={{ label: t('signage.widgets.asSlide'), on: !w.colour, pick: () => set({ colour: null }) }} />}
|
|
||||||
<ColourField label={t('signage.widgets.plate')} value={w.background_colour || WIDGET_COLOURS.plate} onChange={background_colour => set({ background_colour })} testId="signage-widget-plate"
|
|
||||||
auto={{ label: t('signage.widgets.noPlate'), on: !w.background_colour, pick: () => set({ background_colour: null }) }} />
|
|
||||||
{text && <>
|
|
||||||
<Field label={t('signage.font')}>
|
|
||||||
<Dropdown value={w.font || ''} onChange={v => set({ font: v || null })} data-testid="signage-widget-font"
|
|
||||||
options={[{ value: '', label: t('signage.widgets.asSlide') }, ...FONT_KEYS.map(x => ({ value: x, label: t(`signage.fonts.${x}`) }))]} />
|
|
||||||
</Field>
|
|
||||||
<Field label={t('signage.look.f.widget.style')}>
|
|
||||||
<Segmented multiple fill value={styles} data-testid="signage-widget-style"
|
|
||||||
onChange={list => set({ bold: list.includes('bold') ? null : false, italic: list.includes('italic'), underline: list.includes('underline') })}
|
|
||||||
options={[['bold', Bold], ['italic', Italic], ['underline', Underline]].map(([v, Icon]) => (
|
|
||||||
{ value: v, icon: <Icon size={16} aria-hidden="true" />, ariaLabel: t(`signage.look.${v}`), testId: `signage-widget-${v}` }))} />
|
|
||||||
</Field>
|
|
||||||
<Slider label={t('signage.widgets.textSize')} value={w.text_size || 100} min={50} max={200} step={10} suffix="%" onChange={text_size => set({ text_size })} testId="signage-widget-text-size" />
|
|
||||||
</>}
|
|
||||||
{(w.kind === 'qr' || w.kind === 'wifi') && <>
|
|
||||||
<ColourField label={t('signage.widgets.qrColour')} value={w.qr_colour || WIDGET_COLOURS.qr} onChange={qr_colour => set({ qr_colour })} testId="signage-widget-qr-colour" opacity={false} />
|
|
||||||
<ColourField label={t('signage.widgets.qrBackground')} value={w.qr_background || WIDGET_COLOURS.qrBackground} onChange={qr_background => set({ qr_background })} testId="signage-widget-qr-background" />
|
|
||||||
</>}
|
|
||||||
</FieldRow>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
/** The message of the day's hint, and the message itself changed right here (owner review 5). */
|
/** The message of the day's hint, and the message itself changed right here (owner review 5). */
|
||||||
function MessageHint() {
|
function MessageHint() {
|
||||||
const { t } = useTranslation('manager')
|
const { t } = useTranslation('manager')
|
||||||
const [open, setOpen] = useState(false)
|
const [open, setOpen] = useState(false)
|
||||||
return (
|
return (
|
||||||
<div className="flex flex-wrap items-center gap-2 -mt-2">
|
<div className="flex flex-wrap items-center gap-2">
|
||||||
<p className="text-caption text-ink-3 flex-1 min-w-[12rem]">{t('signage.widgets.ownTextHint')}</p>
|
<p className="text-caption text-ink-3 flex-1 min-w-[12rem]">{t('signage.widgets.ownTextHint')}</p>
|
||||||
<Button size="sm" variant="secondary" onClick={() => setOpen(true)} data-testid="signage-widget-message-open">{t('signage.widgets.changeMessage')}</Button>
|
<Button size="sm" variant="secondary" onClick={() => setOpen(true)} data-testid="signage-widget-message-open">{t('signage.widgets.changeMessage')}</Button>
|
||||||
{open && (
|
{open && (
|
||||||
@@ -252,35 +225,36 @@ function MessageHint() {
|
|||||||
/** The options only some widgets have, on the same row as where / size / alignment. */
|
/** The options only some widgets have, on the same row as where / size / alignment. */
|
||||||
function InlineFields({ w, set }) {
|
function InlineFields({ w, set }) {
|
||||||
const { t } = useTranslation('manager')
|
const { t } = useTranslation('manager')
|
||||||
|
const m = 'signage.more'
|
||||||
if (MORE_KINDS.includes(w.kind)) return <MoreInline w={w} set={set} />
|
if (MORE_KINDS.includes(w.kind)) return <MoreInline w={w} set={set} />
|
||||||
if (w.kind === 'message') {
|
|
||||||
return (
|
|
||||||
<Field label={t('signage.widgets.ownText')} className="col-span-2">
|
|
||||||
<Input value={w.text || ''} maxLength={200} placeholder={t('signage.widgets.ownTextPlaceholder')} onChange={e => set({ text: e.target.value || null })} data-testid="signage-widget-text" />
|
|
||||||
</Field>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
if (w.kind === 'text') {
|
|
||||||
return (
|
|
||||||
<Field label={t('signage.widgets.theText')} className="col-span-2">
|
|
||||||
<Input value={w.text || ''} maxLength={200} onChange={e => set({ text: e.target.value || null })} data-testid="signage-widget-own-text" />
|
|
||||||
</Field>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
if (w.kind === 'date') {
|
if (w.kind === 'date') {
|
||||||
return (
|
const format = w.date_format || (w.date_style === 'short' ? 'numeric' : 'long')
|
||||||
<Field label={t('signage.widgets.dateStyle')}>
|
return (<>
|
||||||
<Dropdown value={w.date_style || 'long'} onChange={date_style => set({ date_style })}
|
<Field label={t(`${m}.dateFormat`)} className="col-span-2">
|
||||||
options={[{ value: 'long', label: t('signage.widgets.dateLong') }, { value: 'short', label: t('signage.widgets.dateShort') }]} />
|
<Dropdown value={format} onChange={date_format => set({ date_format })} data-testid="signage-more-date-format"
|
||||||
|
options={DATE_FORMATS.map(x => ({ value: x, label: t(`${m}.dateFormats.${x}`) }))} />
|
||||||
</Field>
|
</Field>
|
||||||
)
|
{['numeric', 'numeric_short', 'iso'].includes(format) && (
|
||||||
|
<Field label={t(`${m}.separator`)}>
|
||||||
|
<Segmented fill value={w.date_separator || (format === 'iso' ? '-' : '/')} onChange={date_separator => set({ date_separator })}
|
||||||
|
options={['/', '.', '-', ' '].map(x => ({ value: x, label: x === ' ' ? t(`${m}.space`) : x }))} />
|
||||||
|
</Field>
|
||||||
|
)}
|
||||||
|
</>)
|
||||||
}
|
}
|
||||||
if (w.kind === 'clock') {
|
if (w.kind === 'clock') {
|
||||||
return (
|
return (<>
|
||||||
|
<Field label={t(`${m}.clockFormat`)}>
|
||||||
|
<Segmented fill value={w.clock_format || '24'} onChange={clock_format => set({ clock_format })} data-testid="signage-more-clock-format"
|
||||||
|
options={['24', '12'].map(x => ({ value: x, label: t(`${m}.clockFormats.${x}`) }))} />
|
||||||
|
</Field>
|
||||||
|
<Field label={t(`${m}.separator`)}>
|
||||||
|
<Segmented fill value={w.clock_separator || ':'} onChange={clock_separator => set({ clock_separator })} options={[':', '.'].map(x => ({ value: x, label: x }))} />
|
||||||
|
</Field>
|
||||||
<Field label={t('signage.widgets.clockShows')}>
|
<Field label={t('signage.widgets.clockShows')}>
|
||||||
<Switch boxed className="h-control" checked={!!w.clock_seconds} onChange={on => set({ clock_seconds: on })} label={t('signage.widgets.seconds')} data-testid="signage-widget-seconds" />
|
<Switch boxed className="h-control" checked={!!w.clock_seconds} onChange={on => set({ clock_seconds: on })} label={t('signage.widgets.seconds')} data-testid="signage-widget-seconds" />
|
||||||
</Field>
|
</Field>
|
||||||
)
|
</>)
|
||||||
}
|
}
|
||||||
if (w.kind === 'qr') {
|
if (w.kind === 'qr') {
|
||||||
return (
|
return (
|
||||||
@@ -323,7 +297,23 @@ function BelowFields({ w, set, media, onMedia, extras, path, depth, selected, on
|
|||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
if (w.kind === 'message') return <MessageHint />
|
if (w.kind === 'message') {
|
||||||
|
return (
|
||||||
|
<div className="grid gap-3">
|
||||||
|
<Field label={t('signage.widgets.ownText')} hint={t('signage.widgets.enterHint')}>
|
||||||
|
<Textarea rows={2} value={w.text || ''} maxLength={500} placeholder={t('signage.widgets.ownTextPlaceholder')} onChange={e => set({ text: e.target.value || null })} data-testid="signage-widget-text" />
|
||||||
|
</Field>
|
||||||
|
<MessageHint />
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
if (w.kind === 'text') {
|
||||||
|
return (
|
||||||
|
<Field label={t('signage.widgets.theText')} hint={t('signage.widgets.enterHint')}>
|
||||||
|
<Textarea rows={2} value={w.text || ''} maxLength={500} onChange={e => set({ text: e.target.value || null })} data-testid="signage-widget-own-text" />
|
||||||
|
</Field>
|
||||||
|
)
|
||||||
|
}
|
||||||
if (w.kind === 'weather') {
|
if (w.kind === 'weather') {
|
||||||
return (
|
return (
|
||||||
<div className="grid gap-3">
|
<div className="grid gap-3">
|
||||||
@@ -488,14 +478,14 @@ function StackFields({ w, set, media, onMedia, extras, path, depth, selected, on
|
|||||||
? <Button variant="secondary" icon={<RotateCcw size={14} />} onClick={() => setW(fillPlace(x))} data-testid="signage-cell-fill">{t('signage.widgets.backInPlace')}</Button>
|
? <Button variant="secondary" icon={<RotateCcw size={14} />} onClick={() => setW(fillPlace(x))} data-testid="signage-cell-fill">{t('signage.widgets.backInPlace')}</Button>
|
||||||
: <span className="h-control flex items-center text-label text-ink-2" data-testid="signage-cell-place">{t('signage.widgets.fillsPlace')}</span>}
|
: <span className="h-control flex items-center text-label text-ink-2" data-testid="signage-cell-place">{t('signage.widgets.fillsPlace')}</span>}
|
||||||
</Field>
|
</Field>
|
||||||
<AlignField w={x} set={setW} testid="signage-cell-align" />
|
{alignable(x, true) && <AlignField w={x} set={setW} testid="signage-cell-align" />}
|
||||||
<VerticalField w={x} set={setW} />
|
<VerticalField w={x} set={setW} />
|
||||||
<InlineFields w={x} set={setW} />
|
<InlineFields w={x} set={setW} />
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
<BelowFields w={x} set={setW} media={media} onMedia={onMedia} extras={extras} path={wp} depth={depth + 1} selected={selected} onSelect={onSelect} />
|
||||||
<LookFields w={x} set={setW} />
|
<LookFields w={x} set={setW} />
|
||||||
<MoreSettings w={x} set={setW} media={media} onMedia={onMedia} />
|
<MoreSettings w={x} set={setW} media={media} onMedia={onMedia} />
|
||||||
<BelowFields w={x} set={setW} media={media} onMedia={onMedia} extras={extras} path={wp} depth={depth + 1} selected={selected} onSelect={onSelect} />
|
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
})}
|
})}
|
||||||
|
|||||||
@@ -417,8 +417,16 @@ export const LETTER_SPACINGS = [-0.05, -0.02, 0.02, 0.05, 0.1, 0.15, 0.2, 0.3]
|
|||||||
// a widget's "More settings" (6R.17)
|
// a widget's "More settings" (6R.17)
|
||||||
/** Has any of these been changed from the usual? (the dot on the toggle) */
|
/** Has any of these been changed from the usual? (the dot on the toggle) */
|
||||||
export function moreChanged(w) {
|
export function moreChanged(w) {
|
||||||
return !!((w.opacity ?? 100) < 100 || w.rotation || (w.shadow && w.shadow !== 'none') || w.border_width || w.border_radius
|
// owner 2026-11-23: text, colours, shadow and highlight are under "Text and colours" (a picture's
|
||||||
|| (w.animation && w.animation !== 'none') || w.weight || w.highlight || (w.text_effect && w.text_effect !== 'none')
|
// border too), the date's and clock's formats among their main settings
|
||||||
|| w.date_format || w.date_separator || w.clock_format === '12' || (w.clock_separator && w.clock_separator !== ':') || w.clock_blink
|
const look = lookKind(w.kind)
|
||||||
|
return !!((w.opacity ?? 100) < 100 || w.rotation || (!look && w.shadow && w.shadow !== 'none')
|
||||||
|
|| (!FRAMED.includes(w.kind) && (w.border_width || w.border_radius))
|
||||||
|
|| (w.animation && w.animation !== 'none') || (w.text_effect && w.text_effect !== 'none') || w.clock_blink
|
||||||
|| (w.kind === 'qr' && w.media_id) || (w.fit && w.fit !== 'contain'))
|
|| (w.kind === 'qr' && w.media_id) || (w.fit && w.fit !== 'contain'))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** The widgets with "Text and colours" (all but a menu, a stack and a shape: those have their own look). */
|
||||||
|
export const lookKind = kind => !['menu', 'stack', 'shape'].includes(kind)
|
||||||
|
/** The pictures whose border is under "Text and colours" (owner 2026-11-23). */
|
||||||
|
export const FRAMED = ['logo', 'gallery']
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import { Camera, Trash2 } from 'lucide-react'
|
|||||||
import { useAccess } from '@xenia/access'
|
import { useAccess } from '@xenia/access'
|
||||||
import { errorMessage } from '@xenia/api'
|
import { errorMessage } from '@xenia/api'
|
||||||
import { LANGUAGE_NAMES, useTranslation } from '@xenia/i18n'
|
import { LANGUAGE_NAMES, useTranslation } from '@xenia/i18n'
|
||||||
import { Button, Dialog, Field, Input, Select, Textarea } from '@xenia/ui'
|
import { Button, Dialog, Field, InfoTip, Input, Select, Textarea } from '@xenia/ui'
|
||||||
import client from '../../api/client'
|
import client from '../../api/client'
|
||||||
import { Avatar } from '../overview/parts'
|
import { Avatar } from '../overview/parts'
|
||||||
import { ROLES, displayName, staffBody, staffForm, staffProblems } from './staffLogic'
|
import { ROLES, displayName, staffBody, staffForm, staffProblems } from './staffLogic'
|
||||||
@@ -67,7 +67,7 @@ export default function StaffDialog({ member, onClose, onSaved }) {
|
|||||||
<Field label={t('staff.username')} required hint={t('staff.usernameHint')} error={err('username')}>
|
<Field label={t('staff.username')} required hint={t('staff.usernameHint')} error={err('username')}>
|
||||||
<Input value={form.username} autoCapitalize="none" onChange={e => set('username', e.target.value)} data-testid="staff-username" />
|
<Input value={form.username} autoCapitalize="none" onChange={e => set('username', e.target.value)} data-testid="staff-username" />
|
||||||
</Field>
|
</Field>
|
||||||
<Field label={t('staff.role')} hint={isNew ? t('staff.roleHintNew') : t('staff.roleHintEdit')}>
|
<Field label={t('staff.role')} info={<InfoTip>{t('staff.roleTip')}</InfoTip>} hint={isNew ? t('staff.roleHintNew') : t('staff.roleHintEdit')}>
|
||||||
<Select value={form.role} onChange={e => set('role', e.target.value)} data-testid="staff-role"
|
<Select value={form.role} onChange={e => set('role', e.target.value)} data-testid="staff-role"
|
||||||
options={roles.map(r => ({ value: r, label: t(`roles.${r}`) }))} />
|
options={roles.map(r => ({ value: r, label: t(`roles.${r}`) }))} />
|
||||||
</Field>
|
</Field>
|
||||||
|
|||||||
@@ -123,7 +123,11 @@ test('owner review 6: a box off the slide (a strip stays), a tight box scaled ke
|
|||||||
test("a widget's More settings: changed or as usual (6R.17)", () => {
|
test("a widget's More settings: changed or as usual (6R.17)", () => {
|
||||||
assert.equal(moreChanged({ kind: 'clock' }), false)
|
assert.equal(moreChanged({ kind: 'clock' }), false)
|
||||||
assert.equal(moreChanged({ kind: 'clock', opacity: 100, shadow: 'none', animation: 'none', clock_separator: ':' }), false)
|
assert.equal(moreChanged({ kind: 'clock', opacity: 100, shadow: 'none', animation: 'none', clock_separator: ':' }), false)
|
||||||
assert.equal(moreChanged({ kind: 'clock', clock_format: '12' }), true)
|
assert.equal(moreChanged({ kind: 'clock', clock_format: '12' }), false) // a main setting since 2026-11-23
|
||||||
|
assert.equal(moreChanged({ kind: 'clock', shadow: 'soft', weight: 300, highlight: '#ff0000' }), false) // under Text and colours
|
||||||
|
assert.equal(moreChanged({ kind: 'shape', shadow: 'soft' }), true) // a shape has no Text and colours
|
||||||
|
assert.equal(moreChanged({ kind: 'gallery', border_width: 4 }), false) // a picture's border: Text and colours
|
||||||
|
assert.equal(moreChanged({ kind: 'clock', border_width: 4 }), true)
|
||||||
assert.equal(moreChanged({ kind: 'date', rotation: -15 }), true)
|
assert.equal(moreChanged({ kind: 'date', rotation: -15 }), true)
|
||||||
assert.equal(moreChanged({ kind: 'qr', media_id: 4 }), true)
|
assert.equal(moreChanged({ kind: 'qr', media_id: 4 }), true)
|
||||||
assert.equal(moreChanged({ kind: 'logo', media_id: 4 }), false)
|
assert.equal(moreChanged({ kind: 'logo', media_id: 4 }), false)
|
||||||
|
|||||||
@@ -220,7 +220,8 @@
|
|||||||
"none": "Κανένα",
|
"none": "Κανένα",
|
||||||
"linkHint": "Για παράδειγμα μια οθόνη πελάτη που δείχνει την παραγγελία ενός ταμείου πάγκου.",
|
"linkHint": "Για παράδειγμα μια οθόνη πελάτη που δείχνει την παραγγελία ενός ταμείου πάγκου.",
|
||||||
"full": "{{label}}: η άδεια επιτρέπει {{max}} και χρησιμοποιούνται όλα. Αφαιρέστε μία ή ζητήστε μεγαλύτερη άδεια.",
|
"full": "{{label}}: η άδεια επιτρέπει {{max}} και χρησιμοποιούνται όλα. Αφαιρέστε μία ή ζητήστε μεγαλύτερη άδεια.",
|
||||||
"noApps": "Καμία εφαρμογή συσκευών δεν είναι ενεργή. Ενεργοποιήστε μία πρώτα από τις Εφαρμογές."
|
"noApps": "Καμία εφαρμογή συσκευών δεν είναι ενεργή. Ενεργοποιήστε μία πρώτα από τις Εφαρμογές.",
|
||||||
|
"signInTip": "PIN ή κωδικός: ο καθένας συνδέεται. Πάτημα στο όνομα: ο καθένας αλλάζει χρήστη χωρίς μυστικό (κοινό ταμείο). Κανένας: η οθόνη δουλεύει χωρίς χρήστη (οθόνη κουζίνας)."
|
||||||
},
|
},
|
||||||
"actions": {
|
"actions": {
|
||||||
"rename": "Μετονομασία",
|
"rename": "Μετονομασία",
|
||||||
@@ -409,7 +410,11 @@
|
|||||||
"idleHint": "Ημέρες χωρίς χρήση της εφαρμογής (διαχείριση, εφαρμογή σερβιτόρων και συζευγμένες συσκευές). Την επόμενη φορά συνδέονται ξανά.",
|
"idleHint": "Ημέρες χωρίς χρήση της εφαρμογής (διαχείριση, εφαρμογή σερβιτόρων και συζευγμένες συσκευές). Την επόμενη φορά συνδέονται ξανά.",
|
||||||
"idleDays_one": "{{count}} ημέρα χωρίς χρήση",
|
"idleDays_one": "{{count}} ημέρα χωρίς χρήση",
|
||||||
"idleDays_other": "{{count}} ημέρες χωρίς χρήση",
|
"idleDays_other": "{{count}} ημέρες χωρίς χρήση",
|
||||||
"idleNever": "Ποτέ"
|
"idleNever": "Ποτέ",
|
||||||
|
"waiterTip": "PIN: γρήγορο, λίγα ψηφία. Κωδικός: πιο ασφαλής, πιο αργός. Πάτημα στο όνομα: καθόλου μυστικό, γι' αυτό λειτουργεί μόνο σε συσκευές που συνδέσατε, ποτέ σε προσωπικά κινητά.",
|
||||||
|
"requireUsernameTip": "Το κινητό δεν δείχνει πια τη λίστα του προσωπικού: όποιος πιάσει ένα κινητό δεν βλέπει ποιοι δουλεύουν εδώ ούτε δοκιμάζει το PIN συναδέλφου.",
|
||||||
|
"deviceTip": "Πάτημα στο όνομα: ο καθένας αλλάζει χρήστη σε κοινή οθόνη χωρίς μυστικό (ένα πολυσύχναστο ταμείο). Κανένας: η οθόνη δουλεύει χωρίς χρήστη (μια οθόνη κουζίνας που βλέπουν όλοι).",
|
||||||
|
"idleTip": "Μετράει σε μέρες, όχι λεπτά: ένα κινητό που έμεινε συνδεδεμένο εβδομάδες αποσυνδέεται. Για κλείδωμα του πίνακα μετά από λίγα λεπτά, δείτε «Όταν ο πίνακας δεν χρησιμοποιείται»."
|
||||||
},
|
},
|
||||||
"venue": {
|
"venue": {
|
||||||
"title": "Κατάστημα",
|
"title": "Κατάστημα",
|
||||||
@@ -427,7 +432,9 @@
|
|||||||
"rose": "Ροζ",
|
"rose": "Ροζ",
|
||||||
"identity": "Η ταυτότητα του καταστήματος (το πρώτο χρώμα της)"
|
"identity": "Η ταυτότητα του καταστήματος (το πρώτο χρώμα της)"
|
||||||
},
|
},
|
||||||
"identityNoColour": "Η ταυτότητα του καταστήματος δεν έχει χρώματα ακόμη (Ρυθμίσεις → Ταυτότητα): τα κινητά μένουν πορτοκαλί και οι οθόνες κρατούν το δικό τους χρώμα μέχρι να αποκτήσει."
|
"identityNoColour": "Η ταυτότητα του καταστήματος δεν έχει χρώματα ακόμη (Ρυθμίσεις → Ταυτότητα): τα κινητά μένουν πορτοκαλί και οι οθόνες κρατούν το δικό τους χρώμα μέχρι να αποκτήσει.",
|
||||||
|
"languageTip": "Ο καθένας μπορεί να διαλέξει τη δική του γλώσσα στο προφίλ του. Τα δελτία κουζίνας τυπώνονται στη γλώσσα κάθε χώρου προετοιμασίας (Εκτύπωση → χώροι), αλλιώς σε αυτήν.",
|
||||||
|
"timezoneTip": "Ορίζει σε ποια μέρα ανήκει μια πώληση και τις ώρες σε δελτία και αναφορές. Αλλάξτε τη μόνο αν το κατάστημα βρίσκεται πράγματι σε άλλη ζώνη ώρας."
|
||||||
},
|
},
|
||||||
"print": {
|
"print": {
|
||||||
"title": "Ειδοποιήσεις εκτύπωσης",
|
"title": "Ειδοποιήσεις εκτύπωσης",
|
||||||
@@ -439,7 +446,8 @@
|
|||||||
},
|
},
|
||||||
"operation": {
|
"operation": {
|
||||||
"closeUnpaid": "Κλείσιμο τραπεζιού με απλήρωτα",
|
"closeUnpaid": "Κλείσιμο τραπεζιού με απλήρωτα",
|
||||||
"closeUnpaidHint": "Ανενεργό: το κλείσιμο τραπεζιού με απλήρωτα ζητά πρώτα την πληρωμή και μετά το κλείνει. Ενεργό: κλείνει και τα απλήρωτα καταγράφονται ως απλήρωτα."
|
"closeUnpaidHint": "Ανενεργό: το κλείσιμο τραπεζιού με απλήρωτα ζητά πρώτα την πληρωμή και μετά το κλείνει. Ενεργό: κλείνει και τα απλήρωτα καταγράφονται ως απλήρωτα.",
|
||||||
|
"closeUnpaidTip": "Ό,τι κλείνει έτσι μένει στο ιστορικό της παραγγελίας ως απλήρωτο, δεν χάνεται τίποτα· απλώς δεν μετράει στις πωλήσεις."
|
||||||
},
|
},
|
||||||
"title": "Ρυθμίσεις",
|
"title": "Ρυθμίσεις",
|
||||||
"save": "Αποθήκευση",
|
"save": "Αποθήκευση",
|
||||||
@@ -507,7 +515,8 @@
|
|||||||
"waiters": "Σερβιτόροι (Wi-Fi)",
|
"waiters": "Σερβιτόροι (Wi-Fi)",
|
||||||
"waitersHint": "Τα κινητά στο ίδιο Wi-Fi ανοίγουν αυτή, ή σαρώνουν το QR.",
|
"waitersHint": "Τα κινητά στο ίδιο Wi-Fi ανοίγουν αυτή, ή σαρώνουν το QR.",
|
||||||
"qrCaption": "Σαρώστε με την κάμερα του κινητού: ανοίγει την εφαρμογή σερβιτόρου. Το κινητό πρέπει να είναι στο ίδιο Wi-Fi.",
|
"qrCaption": "Σαρώστε με την κάμερα του κινητού: ανοίγει την εφαρμογή σερβιτόρου. Το κινητό πρέπει να είναι στο ίδιο Wi-Fi.",
|
||||||
"manager": "Υπεύθυνοι (Wi-Fi)"
|
"manager": "Υπεύθυνοι (Wi-Fi)",
|
||||||
|
"addressTip": "Η διεύθυνση που χρησιμοποιούν κινητά και οθόνες για να βρουν αυτόν τον διακομιστή στο Wi-Fi του καταστήματος. Βρίσκεται μόνη της· γράψτε την μόνο αν η εμφανιζόμενη είναι λάθος (π.χ. υπολογιστής με δύο κάρτες δικτύου)."
|
||||||
},
|
},
|
||||||
"transfer": {
|
"transfer": {
|
||||||
"title": "Εξαγωγή και εισαγωγή",
|
"title": "Εξαγωγή και εισαγωγή",
|
||||||
@@ -568,7 +577,8 @@
|
|||||||
"replaceYes": "Νέοι κωδικοί",
|
"replaceYes": "Νέοι κωδικοί",
|
||||||
"remake": "Νέοι κωδικοί",
|
"remake": "Νέοι κωδικοί",
|
||||||
"make": "Δημιουργία κωδικών ανάκτησης",
|
"make": "Δημιουργία κωδικών ανάκτησης",
|
||||||
"recoveryHow": "Φυλάξτε τους σε ασφαλές μέρος. Στη σελίδα σύνδεσης: το όνομα χρήστη και ένας κωδικός αντί για τον κωδικό πρόσβασης."
|
"recoveryHow": "Φυλάξτε τους σε ασφαλές μέρος. Στη σελίδα σύνδεσης: το όνομα χρήστη και ένας κωδικός αντί για τον κωδικό πρόσβασης.",
|
||||||
|
"lockTip": "Το κλείδωμα κρατά τον υπεύθυνο συνδεδεμένο: η οθόνη ζητά PIN για να συνεχίσει. Καλό για πίνακα σε κοινόχρηστο υπολογιστή."
|
||||||
},
|
},
|
||||||
"ops": {
|
"ops": {
|
||||||
"staffTitle": "Σερβιτόροι",
|
"staffTitle": "Σερβιτόροι",
|
||||||
@@ -607,7 +617,15 @@
|
|||||||
"syncNow": "Αποστολή τώρα",
|
"syncNow": "Αποστολή τώρα",
|
||||||
"syncNowHint": "Αντί να περιμένετε την επόμενη φορά.",
|
"syncNowHint": "Αντί να περιμένετε την επόμενη φορά.",
|
||||||
"sync": "Αποστολή",
|
"sync": "Αποστολή",
|
||||||
"synced": "Το μενού στάλθηκε"
|
"synced": "Το μενού στάλθηκε",
|
||||||
|
"selfStartTip": "Ναι: οι σερβιτόροι ξεκινούν τη βάρδια από το κινητό τους και γράφουν τα μετρητά με τα οποία ξεκινούν. Όχι: δεν παίρνουν παραγγελίες μέχρι να ξεκινήσει τη βάρδια ένας υπεύθυνος από την Επισκόπηση.",
|
||||||
|
"selfEndTip": "Ναι: οι σερβιτόροι κλείνουν τη βάρδια από το κινητό τους. Όχι: μόνο ένας υπεύθυνος την κλείνει, από την Επισκόπηση, όπου μετράει τα μετρητά που παραδίδουν: κάθε βάρδια κλείνει με καταμέτρηση.",
|
||||||
|
"hideTakingsTip": "Οι σερβιτόροι βλέπουν κανονικά τραπέζια και παραγγελίες· κρύβονται μόνο τα χρήματα της βάρδιας (τι εισέπραξαν, τι πρέπει να παραδώσουν). Οι υπεύθυνοι τα βλέπουν πάντα.",
|
||||||
|
"cardTip": "Μια πληρωμή με κάρτα καταγράφεται ως κάρτα, άρα δεν μετράει στα μετρητά που παραδίδει ο σερβιτόρος. Η χρέωση γίνεται κανονικά στο τερματικό της τράπεζας: το Xenia δεν επικοινωνεί μαζί του.",
|
||||||
|
"autoCloseTip": "Ναι: το τραπέζι ελευθερώνεται για νέους πελάτες αμέσως μετά την τελευταία πληρωμή. Όχι: το κλείνει ο σερβιτόρος, χρήσιμο όταν οι πελάτες μένουν και ίσως παραγγείλουν ξανά.",
|
||||||
|
"bypassKdsTip": "Για καταστήματα χωρίς οθόνες κουζίνας ή όπου κανείς δεν σημειώνει τα πιάτα ως σερβιρισμένα. Η εφαρμογή σερβιτόρων τότε δεν περιμένει «έτοιμο» ή «σερβιρίστηκε».",
|
||||||
|
"coursesTip": "Κάθε γραμμή παίρνει ένα πιάτο σειράς και το χρώμα του φαίνεται στα δελτία και στις οθόνες κουζίνας, ώστε η κουζίνα να τα ετοιμάζει με τη σειρά. Ορίστε τα παρακάτω, με τη σειρά που σερβίρονται.",
|
||||||
|
"quickNotesTip": "Η σημείωση τυπώνεται στο δελτίο κουζίνας κάτω από το είδος και φαίνεται στην οθόνη κουζίνας."
|
||||||
},
|
},
|
||||||
"flags": {
|
"flags": {
|
||||||
"title": "Σημάνσεις τραπεζιών",
|
"title": "Σημάνσεις τραπεζιών",
|
||||||
@@ -712,7 +730,8 @@
|
|||||||
"vatName": "Όνομα",
|
"vatName": "Όνομα",
|
||||||
"vatNameHint": "π.χ. Φαγητό, Ποτά, Αλκοόλ",
|
"vatNameHint": "π.χ. Φαγητό, Ποτά, Αλκοόλ",
|
||||||
"removeVat": "Αφαίρεση ομάδας",
|
"removeVat": "Αφαίρεση ομάδας",
|
||||||
"addVat": "Προσθήκη ομάδας"
|
"addVat": "Προσθήκη ομάδας",
|
||||||
|
"enabledTip": "Κάθε πληρωμή στέλνει τότε απόδειξη στον φορολογικό μηχανισμό. Κάθε προϊόν χρειάζεται ομάδα ΦΠΑ για να πληρωθεί (η επεξεργασία προϊόντος προειδοποιεί)."
|
||||||
},
|
},
|
||||||
"dev": {
|
"dev": {
|
||||||
"warning": "Μόνο για δοκιμές. Μην τα αφήνετε ενεργά ενώ λειτουργεί το κατάστημα.",
|
"warning": "Μόνο για δοκιμές. Μην τα αφήνετε ενεργά ενώ λειτουργεί το κατάστημα.",
|
||||||
@@ -1541,7 +1560,7 @@
|
|||||||
"dragHint": "Η λίστα είναι σε επίπεδα: το widget στην κορυφή σχεδιάζεται πάνω από τα από κάτω, και ένα νέο widget μπαίνει στην κορυφή. Διαλέξτε ένα widget στην προεπισκόπηση ή εδώ, σύρετέ το (ή με τα βέλη) για να το μετακινήσετε και από τις λαβές για να αλλάξετε το μέγεθος· η θέση και το μέγεθος γράφουν τότε «Προσαρμοσμένο».",
|
"dragHint": "Η λίστα είναι σε επίπεδα: το widget στην κορυφή σχεδιάζεται πάνω από τα από κάτω, και ένα νέο widget μπαίνει στην κορυφή. Διαλέξτε ένα widget στην προεπισκόπηση ή εδώ, σύρετέ το (ή με τα βέλη) για να το μετακινήσετε και από τις λαβές για να αλλάξετε το μέγεθος· η θέση και το μέγεθος γράφουν τότε «Προσαρμοσμένο».",
|
||||||
"custom": "Προσαρμοσμένο",
|
"custom": "Προσαρμοσμένο",
|
||||||
"align": "Στοίχιση",
|
"align": "Στοίχιση",
|
||||||
"alignAuto": "Αυτόματη",
|
"alignAuto": "Auto",
|
||||||
"dateStyle": "Μορφή",
|
"dateStyle": "Μορφή",
|
||||||
"canvas": "Τα widgets της διαφάνειας: σύρετε ένα για μετακίνηση, τις λαβές για μέγεθος, τα βέλη για μικρές κινήσεις",
|
"canvas": "Τα widgets της διαφάνειας: σύρετε ένα για μετακίνηση, τις λαβές για μέγεθος, τα βέλη για μικρές κινήσεις",
|
||||||
"earlier": "Πάνω (σχεδιάζεται κάτω από τα επόμενα)",
|
"earlier": "Πάνω (σχεδιάζεται κάτω από τα επόμενα)",
|
||||||
@@ -1594,8 +1613,7 @@
|
|||||||
"backInPlace": "Πίσω σε στοίχιση",
|
"backInPlace": "Πίσω σε στοίχιση",
|
||||||
"vertical": "Κάθετη στοίχιση",
|
"vertical": "Κάθετη στοίχιση",
|
||||||
"look": "Κείμενο και χρώματα",
|
"look": "Κείμενο και χρώματα",
|
||||||
"plateOnly": "Φόντο πίσω του",
|
"colour": "Χρώμα κειμένου",
|
||||||
"colour": "Χρώμα",
|
|
||||||
"asSlide": "Όπως η διαφάνεια",
|
"asSlide": "Όπως η διαφάνεια",
|
||||||
"plate": "Φόντο πίσω του",
|
"plate": "Φόντο πίσω του",
|
||||||
"noPlate": "Κανένα",
|
"noPlate": "Κανένα",
|
||||||
@@ -1633,8 +1651,8 @@
|
|||||||
"text": "Το κείμενο",
|
"text": "Το κείμενο",
|
||||||
"direction": "Κινείται",
|
"direction": "Κινείται",
|
||||||
"directions": {
|
"directions": {
|
||||||
"left": "Προς τα αριστερά",
|
"left": "Αριστερά",
|
||||||
"right": "Προς τα δεξιά"
|
"right": "Δεξιά"
|
||||||
},
|
},
|
||||||
"speed": "Ταχύτητα"
|
"speed": "Ταχύτητα"
|
||||||
},
|
},
|
||||||
@@ -1717,7 +1735,14 @@
|
|||||||
"noFolders": "Δεν υπάρχουν φάκελοι πολυμέσων ακόμη.",
|
"noFolders": "Δεν υπάρχουν φάκελοι πολυμέσων ακόμη.",
|
||||||
"toMedia": "Φτιάξτε έναν στη σελίδα Πολυμέσα",
|
"toMedia": "Φτιάξτε έναν στη σελίδα Πολυμέσα",
|
||||||
"add": "Προσθήκη εικόνων ή βίντεο",
|
"add": "Προσθήκη εικόνων ή βίντεο",
|
||||||
"empty": "Η συλλογή είναι άδεια ακόμη: μένει κρυφή."
|
"empty": "Η συλλογή είναι άδεια ακόμη: μένει κρυφή.",
|
||||||
|
"title": "Τίτλος",
|
||||||
|
"titlePlaceholder": "Κανένας",
|
||||||
|
"titleAt": "Ο τίτλος μπαίνει",
|
||||||
|
"titleAts": {
|
||||||
|
"above": "Από πάνω",
|
||||||
|
"below": "Από κάτω"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"weatherLayout": "Διάταξη",
|
"weatherLayout": "Διάταξη",
|
||||||
"weatherLayouts": {
|
"weatherLayouts": {
|
||||||
@@ -1741,7 +1766,8 @@
|
|||||||
"weatherHours": "Ώρες",
|
"weatherHours": "Ώρες",
|
||||||
"weatherPlace": "Η τοποθεσία",
|
"weatherPlace": "Η τοποθεσία",
|
||||||
"weatherPlaceLabel": "Δείχνει το όνομά της",
|
"weatherPlaceLabel": "Δείχνει το όνομά της",
|
||||||
"logoFromIdentity": "Χωρίς εικόνα: εμφανίζεται το λογότυπο του καταστήματος (Ρυθμίσεις → Ταυτότητα)."
|
"logoFromIdentity": "Χωρίς εικόνα: εμφανίζεται το λογότυπο του καταστήματος (Ρυθμίσεις → Ταυτότητα).",
|
||||||
|
"enterHint": "Με Enter αλλάζει γραμμή."
|
||||||
},
|
},
|
||||||
"tabs": {
|
"tabs": {
|
||||||
"playlists": "Λίστες",
|
"playlists": "Λίστες",
|
||||||
@@ -1986,21 +2012,25 @@
|
|||||||
"open": "Βαθμονόμηση εικόνας",
|
"open": "Βαθμονόμηση εικόνας",
|
||||||
"title": "Βαθμονόμηση εικόνας: {{name}}",
|
"title": "Βαθμονόμηση εικόνας: {{name}}",
|
||||||
"intro": "Η τηλεόραση δείχνει τώρα τις άκρες της εικόνας με τέσσερα βέλη προς τα έξω. Μετακινήστε κάθε άκρη μέχρι το βέλος της να ακουμπά την άκρη της οθόνης ή διαλέξτε σχήμα. Οι αλλαγές φαίνονται αμέσως στην τηλεόραση.",
|
"intro": "Η τηλεόραση δείχνει τώρα τις άκρες της εικόνας με τέσσερα βέλη προς τα έξω. Μετακινήστε κάθε άκρη μέχρι το βέλος της να ακουμπά την άκρη της οθόνης ή διαλέξτε σχήμα. Οι αλλαγές φαίνονται αμέσως στην τηλεόραση.",
|
||||||
"window": "Το παράθυρο της τηλεόρασης: {{w}} × {{h}} px ({{shape}}).",
|
"window": "{{w}} × {{h}} px ({{shape}})",
|
||||||
"waiting": "Αναμονή για το μέγεθος της τηλεόρασης… Είναι ανοιχτή και δείχνει ψηφιακή σήμανση;",
|
"waiting": "Αναμονή για το μέγεθος της τηλεόρασης… Είναι ανοιχτή και δείχνει ψηφιακή σήμανση;",
|
||||||
"presets": "Σχήματα",
|
"presets": "Σχήματα",
|
||||||
"full": "Όλη η οθόνη",
|
"full": "Όλη η οθόνη",
|
||||||
"step": "Κάθε κλικ μετακινεί",
|
"step": "Κάθε κλικ μετακινεί",
|
||||||
"edges": {
|
"edges": {
|
||||||
"top": "Πάνω άκρη μέσα",
|
"top": "Πάνω άκρη",
|
||||||
"right": "Δεξιά άκρη μέσα",
|
"right": "Δεξιά άκρη",
|
||||||
"bottom": "Κάτω άκρη μέσα",
|
"bottom": "Κάτω άκρη",
|
||||||
"left": "Αριστερή άκρη μέσα"
|
"left": "Αριστερή άκρη"
|
||||||
},
|
},
|
||||||
"picture": "Η εικόνα: {{w}} × {{h}} px ({{shape}})",
|
"picture": "Η εικόνα: {{w}} × {{h}} px ({{shape}})",
|
||||||
"outside": "Έξω από την εικόνα η τηλεόραση μένει μαύρη.",
|
"outside": "Έξω από την εικόνα η τηλεόραση μένει μαύρη.",
|
||||||
"reset": "Ξανά όλη η οθόνη",
|
"reset": "Ξανά όλη η οθόνη",
|
||||||
"done": "Τέλος"
|
"done": "Τέλος",
|
||||||
|
"recognised": "Ανάλυση που αναγνωρίστηκε",
|
||||||
|
"recognisedHint": "Το μέγεθος που ανέφερε η ίδια η τηλεόραση. Αν η πραγματική της εικόνα είναι μεγαλύτερη ή μικρότερη, αλλάξτε την εδώ με τις άκρες από κάτω.",
|
||||||
|
"edgesHint": "Θετικός αριθμός φέρνει την άκρη μέσα· αρνητικός τη σπρώχνει έξω, πέρα από την ανάλυση που αναγνωρίστηκε.",
|
||||||
|
"past": "Μέρος της εικόνας περνά πλέον πέρα από την ανάλυση που αναγνωρίστηκε: αν η τηλεόραση δεν έχει πραγματικά εικόνα εκεί, αυτό το κομμάτι κόβεται."
|
||||||
},
|
},
|
||||||
"reviews": {
|
"reviews": {
|
||||||
"title": "Κριτικές",
|
"title": "Κριτικές",
|
||||||
@@ -2200,7 +2230,8 @@
|
|||||||
"made_one": "Έφτιαξε · {{count}} παραγγελία",
|
"made_one": "Έφτιαξε · {{count}} παραγγελία",
|
||||||
"made_other": "Έφτιαξε · {{count}} παραγγελίες",
|
"made_other": "Έφτιαξε · {{count}} παραγγελίες",
|
||||||
"paidItems": "Πληρώθηκαν",
|
"paidItems": "Πληρώθηκαν",
|
||||||
"onTab": "Σε καρτέλα"
|
"onTab": "Σε καρτέλα",
|
||||||
|
"countedTip": "Γράψτε τι παραδίδει ο σερβιτόρος, με κόμμα ή τελεία για τα λεπτά. Συγκρίνεται με τα μετρητά που αναμένονται από τη βάρδια, όπως φαίνονται παραπάνω."
|
||||||
},
|
},
|
||||||
"cash": {
|
"cash": {
|
||||||
"even": "Ισοσκελισμένο",
|
"even": "Ισοσκελισμένο",
|
||||||
@@ -2756,7 +2787,12 @@
|
|||||||
"altPrices": "Εναλλακτικές τιμές",
|
"altPrices": "Εναλλακτικές τιμές",
|
||||||
"altPricesHint": "Αποθηκεύστε πρώτα το προϊόν.",
|
"altPricesHint": "Αποθηκεύστε πρώτα το προϊόν.",
|
||||||
"langOf": "Γλώσσα",
|
"langOf": "Γλώσσα",
|
||||||
"mainLang": "{{language}} (κύρια)"
|
"mainLang": "{{language}} (κύρια)",
|
||||||
|
"unitTip": "Τα τεμάχια μετριούνται (2 μπίρες). Οι μονάδες βάρους ή όγκου ζητούν ποσότητα στην παραγγελία (0,5 κιλά) και η τιμή είναι ανά μονάδα.",
|
||||||
|
"availableTip": "Όχι: εξαφανίζεται από τα μενού των σερβιτόρων και του ταμείου μέχρι να το ενεργοποιήσετε ξανά (τελείωσε για σήμερα). Τίποτε άλλο δεν αλλάζει.",
|
||||||
|
"quickAddTip": "Ναι: ένα πάτημα στη λίστα του σερβιτόρου το προσθέτει κατευθείαν, χωρίς να ανοίξουν οι επιλογές του. Αφήστε το κλειστό για προϊόντα που χρειάζονται επιλογή (ψήσιμο, συνοδευτικά).",
|
||||||
|
"vatGroupTip": "Ο συντελεστής ΦΠΑ που χρησιμοποιεί η φορολογική απόδειξη για το προϊόν. Χρειάζεται για να πληρωθεί όσο ο φορολογικός μηχανισμός είναι ενεργός.",
|
||||||
|
"costTip": "Τι σας κοστίζει μία μονάδα (υλικά, συσκευασία). Οι αναφορές το χρησιμοποιούν για το κέρδος· προϊόντα χωρίς κόστος κάνουν το κέρδος κατώτερη εκτίμηση."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"menuTabletSettings": {
|
"menuTabletSettings": {
|
||||||
@@ -3711,7 +3747,8 @@
|
|||||||
"zonesBody": "Το κινητό του και ο χάρτης τραπεζιών δείχνουν μόνο τα τραπέζια αυτών των ζωνών.",
|
"zonesBody": "Το κινητό του και ο χάρτης τραπεζιών δείχνουν μόνο τα τραπέζια αυτών των ζωνών.",
|
||||||
"noGroups": "Δεν υπάρχουν ζώνες ακόμα (Διαχείριση → Τραπέζια).",
|
"noGroups": "Δεν υπάρχουν ζώνες ακόμα (Διαχείριση → Τραπέζια).",
|
||||||
"noZonesWarn": "Χωρίς ζώνη δεν βλέπει κανένα τραπέζι.",
|
"noZonesWarn": "Χωρίς ζώνη δεν βλέπει κανένα τραπέζι.",
|
||||||
"zonesSaved": "Οι ζώνες αποθηκεύτηκαν: {{name}}"
|
"zonesSaved": "Οι ζώνες αποθηκεύτηκαν: {{name}}",
|
||||||
|
"roleTip": "Ο ρόλος δίνει στο άτομο τα δικαιώματα του ρόλου (Ρυθμίσεις → Λειτουργία → Τι επιτρέπεται σε κάθε ρόλο). Τα δικαιώματα ενός ατόμου αλλάζουν και ξεχωριστά."
|
||||||
},
|
},
|
||||||
"schedule": {
|
"schedule": {
|
||||||
"title": "Πρόγραμμα",
|
"title": "Πρόγραμμα",
|
||||||
|
|||||||
@@ -220,7 +220,8 @@
|
|||||||
"none": "None",
|
"none": "None",
|
||||||
"linkHint": "For example a customer display that shows a counter POS's order.",
|
"linkHint": "For example a customer display that shows a counter POS's order.",
|
||||||
"full": "{{label}}: the license allows {{max}}, all in use. Remove one or ask for a bigger license.",
|
"full": "{{label}}: the license allows {{max}}, all in use. Remove one or ask for a bigger license.",
|
||||||
"noApps": "No device app is turned on. Turn one on in Apps first."
|
"noApps": "No device app is turned on. Turn one on in Apps first.",
|
||||||
|
"signInTip": "PIN or password: each person signs in. Tap your name: anyone switches user without a secret (a shared counter). None: the screen works without a user (a kitchen display)."
|
||||||
},
|
},
|
||||||
"actions": {
|
"actions": {
|
||||||
"rename": "Rename",
|
"rename": "Rename",
|
||||||
@@ -409,7 +410,11 @@
|
|||||||
"idleHint": "Days without using the app (manager, waiter app and paired devices). They sign in again next time.",
|
"idleHint": "Days without using the app (manager, waiter app and paired devices). They sign in again next time.",
|
||||||
"idleDays_one": "{{count}} day without use",
|
"idleDays_one": "{{count}} day without use",
|
||||||
"idleDays_other": "{{count}} days without use",
|
"idleDays_other": "{{count}} days without use",
|
||||||
"idleNever": "Never"
|
"idleNever": "Never",
|
||||||
|
"waiterTip": "PIN: fast, a few digits. Password: safer, slower to type. Tap your name: no secret at all, so it works only on devices you paired, never on personal phones.",
|
||||||
|
"requireUsernameTip": "The phone no longer lists the staff: someone who picks up a phone can't see who works here or try a colleague's PIN.",
|
||||||
|
"deviceTip": "Tap your name: anyone switches user on a shared screen without a secret (a busy counter). None: the screen works without a user (a kitchen display everyone watches).",
|
||||||
|
"idleTip": "Counted in days, not minutes: a phone left signed in for weeks gets signed out. To lock the dashboard after minutes, see \"When the dashboard isn't used\"."
|
||||||
},
|
},
|
||||||
"venue": {
|
"venue": {
|
||||||
"title": "Venue",
|
"title": "Venue",
|
||||||
@@ -427,7 +432,9 @@
|
|||||||
"rose": "Rose",
|
"rose": "Rose",
|
||||||
"identity": "The venue's identity (its first colour)"
|
"identity": "The venue's identity (its first colour)"
|
||||||
},
|
},
|
||||||
"identityNoColour": "The venue's identity has no colours yet (Settings → Identity): the phones stay amber and the screens keep their own colour until it has one."
|
"identityNoColour": "The venue's identity has no colours yet (Settings → Identity): the phones stay amber and the screens keep their own colour until it has one.",
|
||||||
|
"languageTip": "Each person can choose their own language on their profile. Kitchen tickets print in each prep zone's language (Printing → prep zones), else in this one.",
|
||||||
|
"timezoneTip": "Decides which day a sale belongs to, and the times on tickets and reports. Change it only if the venue really is in another time zone."
|
||||||
},
|
},
|
||||||
"print": {
|
"print": {
|
||||||
"title": "Print alerts",
|
"title": "Print alerts",
|
||||||
@@ -439,7 +446,8 @@
|
|||||||
},
|
},
|
||||||
"operation": {
|
"operation": {
|
||||||
"closeUnpaid": "Close a table with unpaid items",
|
"closeUnpaid": "Close a table with unpaid items",
|
||||||
"closeUnpaidHint": "Off: closing a table with unpaid items asks for the payment first, then closes it. On: it closes and the unpaid items are recorded as unpaid."
|
"closeUnpaidHint": "Off: closing a table with unpaid items asks for the payment first, then closes it. On: it closes and the unpaid items are recorded as unpaid.",
|
||||||
|
"closeUnpaidTip": "Items written off this way stay in the order's history as unpaid, so nothing disappears; they just don't count as sales."
|
||||||
},
|
},
|
||||||
"title": "Settings",
|
"title": "Settings",
|
||||||
"save": "Save",
|
"save": "Save",
|
||||||
@@ -507,7 +515,8 @@
|
|||||||
"waiters": "Waiters (Wi-Fi)",
|
"waiters": "Waiters (Wi-Fi)",
|
||||||
"waitersHint": "Phones on the same Wi-Fi open this, or scan the QR.",
|
"waitersHint": "Phones on the same Wi-Fi open this, or scan the QR.",
|
||||||
"qrCaption": "Scan with the phone's camera: it opens the waiter app. The phone must be on the same Wi-Fi.",
|
"qrCaption": "Scan with the phone's camera: it opens the waiter app. The phone must be on the same Wi-Fi.",
|
||||||
"manager": "Managers (Wi-Fi)"
|
"manager": "Managers (Wi-Fi)",
|
||||||
|
"addressTip": "The address the phones and screens use to reach this server on the venue's Wi-Fi. It's found by itself; type it only if the one shown is wrong (e.g. a PC with two network cards)."
|
||||||
},
|
},
|
||||||
"transfer": {
|
"transfer": {
|
||||||
"title": "Export and import",
|
"title": "Export and import",
|
||||||
@@ -568,7 +577,8 @@
|
|||||||
"replaceYes": "Make new codes",
|
"replaceYes": "Make new codes",
|
||||||
"remake": "Make new codes",
|
"remake": "Make new codes",
|
||||||
"make": "Make recovery codes",
|
"make": "Make recovery codes",
|
||||||
"recoveryHow": "Keep them somewhere safe. On the sign-in page: your username and a code instead of the password."
|
"recoveryHow": "Keep them somewhere safe. On the sign-in page: your username and a code instead of the password.",
|
||||||
|
"lockTip": "Locking keeps the manager signed in: the screen asks for a PIN to go on. Good for a dashboard on a shared PC."
|
||||||
},
|
},
|
||||||
"ops": {
|
"ops": {
|
||||||
"staffTitle": "Waiters",
|
"staffTitle": "Waiters",
|
||||||
@@ -607,7 +617,15 @@
|
|||||||
"syncNow": "Send it now",
|
"syncNow": "Send it now",
|
||||||
"syncNowHint": "Instead of waiting for the next time.",
|
"syncNowHint": "Instead of waiting for the next time.",
|
||||||
"sync": "Send",
|
"sync": "Send",
|
||||||
"synced": "The menu was sent"
|
"synced": "The menu was sent",
|
||||||
|
"selfStartTip": "On: waiters start their shift from their phone and type the cash they start with. Off: they can't take orders until a manager starts their shift on the Overview.",
|
||||||
|
"selfEndTip": "On: waiters end their shift from their phone. Off: only a manager ends it, on the Overview, where the cash they hand over is counted, so every shift ends with a count.",
|
||||||
|
"hideTakingsTip": "Waiters still see their tables and orders; only their shift's money (what they took, what they should hand over) is hidden. Managers always see it.",
|
||||||
|
"cardTip": "A card payment is recorded as card, so it isn't part of the cash the waiter hands over. Charge the card on the bank's terminal as usual: Xenia doesn't talk to it.",
|
||||||
|
"autoCloseTip": "On: the table is free for new customers right after the last payment. Off: the waiter closes it, useful when customers stay and may order again.",
|
||||||
|
"bypassKdsTip": "For venues without kitchen screens, or where nobody marks dishes as served. The waiter app then doesn't wait for \"ready\" or \"served\".",
|
||||||
|
"coursesTip": "Each line gets a course and its colour shows on tickets and kitchen screens, so the kitchen prepares them in order. Set the courses below, in the order they are served.",
|
||||||
|
"quickNotesTip": "The note prints on the kitchen ticket under the item and shows on the kitchen screen."
|
||||||
},
|
},
|
||||||
"flags": {
|
"flags": {
|
||||||
"title": "Table flags",
|
"title": "Table flags",
|
||||||
@@ -712,7 +730,8 @@
|
|||||||
"vatName": "Name",
|
"vatName": "Name",
|
||||||
"vatNameHint": "e.g. Food, Drinks, Alcohol",
|
"vatNameHint": "e.g. Food, Drinks, Alcohol",
|
||||||
"removeVat": "Remove this group",
|
"removeVat": "Remove this group",
|
||||||
"addVat": "Add a group"
|
"addVat": "Add a group",
|
||||||
|
"enabledTip": "Every payment then sends a receipt to the fiscal device. Each product needs a VAT group before it can be paid (the product editor warns)."
|
||||||
},
|
},
|
||||||
"dev": {
|
"dev": {
|
||||||
"warning": "For testing only. Don't leave these on while the venue is working.",
|
"warning": "For testing only. Don't leave these on while the venue is working.",
|
||||||
@@ -1594,8 +1613,7 @@
|
|||||||
"backInPlace": "Back to aligned",
|
"backInPlace": "Back to aligned",
|
||||||
"vertical": "Vertical alignment",
|
"vertical": "Vertical alignment",
|
||||||
"look": "Text and colours",
|
"look": "Text and colours",
|
||||||
"plateOnly": "Background plate",
|
"colour": "Text colour",
|
||||||
"colour": "Colour",
|
|
||||||
"asSlide": "As the slide",
|
"asSlide": "As the slide",
|
||||||
"plate": "Background plate",
|
"plate": "Background plate",
|
||||||
"noPlate": "None",
|
"noPlate": "None",
|
||||||
@@ -1633,8 +1651,8 @@
|
|||||||
"text": "The text",
|
"text": "The text",
|
||||||
"direction": "Moves",
|
"direction": "Moves",
|
||||||
"directions": {
|
"directions": {
|
||||||
"left": "To the left",
|
"left": "Left",
|
||||||
"right": "To the right"
|
"right": "Right"
|
||||||
},
|
},
|
||||||
"speed": "Speed"
|
"speed": "Speed"
|
||||||
},
|
},
|
||||||
@@ -1717,7 +1735,14 @@
|
|||||||
"noFolders": "No media folders yet.",
|
"noFolders": "No media folders yet.",
|
||||||
"toMedia": "Make one on the Media page",
|
"toMedia": "Make one on the Media page",
|
||||||
"add": "Add pictures or videos",
|
"add": "Add pictures or videos",
|
||||||
"empty": "Nothing in the gallery yet: it stays hidden."
|
"empty": "Nothing in the gallery yet: it stays hidden.",
|
||||||
|
"title": "Title",
|
||||||
|
"titlePlaceholder": "None",
|
||||||
|
"titleAt": "Title goes",
|
||||||
|
"titleAts": {
|
||||||
|
"above": "Above",
|
||||||
|
"below": "Below"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"weatherLayout": "Layout",
|
"weatherLayout": "Layout",
|
||||||
"weatherLayouts": {
|
"weatherLayouts": {
|
||||||
@@ -1741,7 +1766,8 @@
|
|||||||
"weatherHours": "Hours",
|
"weatherHours": "Hours",
|
||||||
"weatherPlace": "The place",
|
"weatherPlace": "The place",
|
||||||
"weatherPlaceLabel": "Show its name",
|
"weatherPlaceLabel": "Show its name",
|
||||||
"logoFromIdentity": "No picture chosen: the venue's logo (Settings → Identity) shows."
|
"logoFromIdentity": "No picture chosen: the venue's logo (Settings → Identity) shows.",
|
||||||
|
"enterHint": "Enter starts a new line."
|
||||||
},
|
},
|
||||||
"tabs": {
|
"tabs": {
|
||||||
"playlists": "Playlists",
|
"playlists": "Playlists",
|
||||||
@@ -1986,21 +2012,25 @@
|
|||||||
"open": "Calibrate the picture",
|
"open": "Calibrate the picture",
|
||||||
"title": "Calibrate the picture: {{name}}",
|
"title": "Calibrate the picture: {{name}}",
|
||||||
"intro": "The TV now shows its picture's edges with four arrows pointing out. Move each edge until its arrow just touches the edge of the screen, or pick a shape. Changes show on the TV at once.",
|
"intro": "The TV now shows its picture's edges with four arrows pointing out. Move each edge until its arrow just touches the edge of the screen, or pick a shape. Changes show on the TV at once.",
|
||||||
"window": "The TV's window: {{w}} × {{h}} px ({{shape}}).",
|
"window": "{{w}} × {{h}} px ({{shape}})",
|
||||||
"waiting": "Waiting for the TV to tell its size… Is it on and showing signage?",
|
"waiting": "Waiting for the TV to tell its size… Is it on and showing signage?",
|
||||||
"presets": "Shapes",
|
"presets": "Shapes",
|
||||||
"full": "Whole screen",
|
"full": "Whole screen",
|
||||||
"step": "Each click moves",
|
"step": "Each click moves",
|
||||||
"edges": {
|
"edges": {
|
||||||
"top": "Top edge in",
|
"top": "Top edge",
|
||||||
"right": "Right edge in",
|
"right": "Right edge",
|
||||||
"bottom": "Bottom edge in",
|
"bottom": "Bottom edge",
|
||||||
"left": "Left edge in"
|
"left": "Left edge"
|
||||||
},
|
},
|
||||||
"picture": "The picture: {{w}} × {{h}} px ({{shape}})",
|
"picture": "The picture: {{w}} × {{h}} px ({{shape}})",
|
||||||
"outside": "Outside the picture the TV stays black.",
|
"outside": "Outside the picture the TV stays black.",
|
||||||
"reset": "Whole screen again",
|
"reset": "Whole screen again",
|
||||||
"done": "Done"
|
"done": "Done",
|
||||||
|
"recognised": "Recognised resolution",
|
||||||
|
"recognisedHint": "The size the TV reported for itself. If its real picture is larger or smaller, change it right here with the edges below.",
|
||||||
|
"edgesHint": "A positive number moves that edge in; a negative one pushes it out, past the recognised resolution.",
|
||||||
|
"past": "Part of the picture now reaches past the recognised resolution: if the TV really has no picture there, that part is cut off."
|
||||||
},
|
},
|
||||||
"reviews": {
|
"reviews": {
|
||||||
"title": "Reviews",
|
"title": "Reviews",
|
||||||
@@ -2200,7 +2230,8 @@
|
|||||||
"made_one": "Made · {{count}} order",
|
"made_one": "Made · {{count}} order",
|
||||||
"made_other": "Made · {{count}} orders",
|
"made_other": "Made · {{count}} orders",
|
||||||
"paidItems": "Paid",
|
"paidItems": "Paid",
|
||||||
"onTab": "Put on a tab"
|
"onTab": "Put on a tab",
|
||||||
|
"countedTip": "Type what the waiter hands over, with a comma or a dot for the cents. It is compared with the cash expected from their shift, shown above."
|
||||||
},
|
},
|
||||||
"cash": {
|
"cash": {
|
||||||
"even": "Balanced",
|
"even": "Balanced",
|
||||||
@@ -2756,7 +2787,12 @@
|
|||||||
"altPrices": "Edit alternate prices",
|
"altPrices": "Edit alternate prices",
|
||||||
"altPricesHint": "Save the product first.",
|
"altPricesHint": "Save the product first.",
|
||||||
"langOf": "Language",
|
"langOf": "Language",
|
||||||
"mainLang": "{{language}} (main)"
|
"mainLang": "{{language}} (main)",
|
||||||
|
"unitTip": "Pieces are counted (2 beers). Weighed or measured units ask for an amount when ordered (0.5 kg) and the price is per unit.",
|
||||||
|
"availableTip": "Off: it disappears from the waiters' and the counter's menus until you switch it back on (sold out today). Nothing else about it changes.",
|
||||||
|
"quickAddTip": "On: one tap in the waiter's product list adds it straight to the order without opening its choices. Leave it off for products whose choices must be picked (cooking, sides).",
|
||||||
|
"vatGroupTip": "The VAT rate the fiscal receipt uses for this product. Needed before it can be paid while the fiscal device is on.",
|
||||||
|
"costTip": "What one unit costs you (ingredients, packaging). Reports use it for the profit; products without a cost make the profit a lower estimate."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"menuTabletSettings": {
|
"menuTabletSettings": {
|
||||||
@@ -3711,7 +3747,8 @@
|
|||||||
"zonesBody": "Their phone and the table map only show these zones' tables.",
|
"zonesBody": "Their phone and the table map only show these zones' tables.",
|
||||||
"noGroups": "There are no zones yet (Management → Tables).",
|
"noGroups": "There are no zones yet (Management → Tables).",
|
||||||
"noZonesWarn": "With no zone they see no tables.",
|
"noZonesWarn": "With no zone they see no tables.",
|
||||||
"zonesSaved": "Zones of {{name}} saved"
|
"zonesSaved": "Zones of {{name}} saved",
|
||||||
|
"roleTip": "The role gives the person that role's permissions (Settings → Operation → What each role may do). One person's permissions can still be changed on their own."
|
||||||
},
|
},
|
||||||
"schedule": {
|
"schedule": {
|
||||||
"title": "Schedule",
|
"title": "Schedule",
|
||||||
|
|||||||
@@ -167,6 +167,7 @@ const CORNER = {
|
|||||||
'bottom-right': { bottom: cq(3), right: cq(3), alignItems: 'flex-end' },
|
'bottom-right': { bottom: cq(3), right: cq(3), alignItems: 'flex-end' },
|
||||||
}
|
}
|
||||||
const SELF = { left: 'flex-start', center: 'center', right: 'flex-end' }
|
const SELF = { left: 'flex-start', center: 'center', right: 'flex-end' }
|
||||||
|
const GRID = { left: 'start', center: 'center', right: 'end' } // a grid's items, by the widget's alignment
|
||||||
const placedBy = w => (w.position === 'custom' && w.box ? (TIGHT.includes(w.kind) ? 'tight' : true) : false)
|
const placedBy = w => (w.position === 'custom' && w.box ? (TIGHT.includes(w.kind) ? 'tight' : true) : false)
|
||||||
const VSELF = { top: 'flex-start', middle: 'center', bottom: 'flex-end', auto: 'center' }
|
const VSELF = { top: 'flex-start', middle: 'center', bottom: 'flex-end', auto: 'center' }
|
||||||
/** A widget's own colour and the plate behind it (owner review 5); `pad`: a plate that hugs it. */
|
/** A widget's own colour and the plate behind it (owner review 5); `pad`: a plate that hugs it. */
|
||||||
@@ -265,7 +266,7 @@ export function Widgets({ widgets, media, venue, now, colour, extras, embed }) {
|
|||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
const own = w.align && w.align !== 'auto' ? { alignItems: SELF[w.align], textAlign: w.align } : {}
|
const own = w.align && w.align !== 'auto' ? { alignItems: SELF[w.align], textAlign: w.align } : { textAlign: widgetAlign(w) }
|
||||||
return (
|
return (
|
||||||
<div key={i} data-widget={i} ref={animate(w)} className="absolute" style={{ ...CORNER[w.position], ...own, display: 'flex', flexDirection: 'column', color: colour || '#fff', ...plate(w, true), ...fx(w, CORNER[w.position].transform) }}>
|
<div key={i} data-widget={i} ref={animate(w)} className="absolute" style={{ ...CORNER[w.position], ...own, display: 'flex', flexDirection: 'column', color: colour || '#fff', ...plate(w, true), ...fx(w, CORNER[w.position].transform) }}>
|
||||||
{body}
|
{body}
|
||||||
@@ -283,9 +284,10 @@ const OBJECT_POSITION = { left: 'left center', center: 'center', right: 'right c
|
|||||||
* the slide at size medium); `fit`: the widget fills its place instead (fitUnit: a stack's part);
|
* the slide at size medium); `fit`: the widget fills its place instead (fitUnit: a stack's part);
|
||||||
* fit 'tight' (owner review 6): placed by hand, its box is exactly its content: the box's height
|
* fit 'tight' (owner review 6): placed by hand, its box is exactly its content: the box's height
|
||||||
* (× its text size) sets the size and its width follows. `path`: the widget's place in the slide
|
* (× its text size) sets the size and its width follows. `path`: the widget's place in the slide
|
||||||
* ("2", "2.1.0" inside a stack), for its extras.
|
* ("2", "2.1.0" inside a stack), for its extras. `align`: how its lines line up with each other (owner
|
||||||
|
* 2026-11-23: the lines of a text, the rows of the hours or contact details, the weather's parts…).
|
||||||
*/
|
*/
|
||||||
function widgetBody(w, ctx, fit, path) {
|
function widgetBody(w, ctx, fit, path, align = widgetAlign(w)) {
|
||||||
const { media, venue, now, fmt, extras } = ctx
|
const { media, venue, now, fmt, extras } = ctx
|
||||||
const { formatDate, formatTime } = fmt
|
const { formatDate, formatTime } = fmt
|
||||||
const x = extras[path] || {}
|
const x = extras[path] || {}
|
||||||
@@ -300,10 +302,12 @@ function widgetBody(w, ctx, fit, path) {
|
|||||||
}
|
}
|
||||||
const text = (u, size, weight = 700) => ({ fontSize: u(size), fontWeight: w.weight || (w.bold === false ? 400 : w.bold ? Math.max(weight, 800) : weight), lineHeight: 1.15,
|
const text = (u, size, weight = 700) => ({ fontSize: u(size), fontWeight: w.weight || (w.bold === false ? 400 : w.bold ? Math.max(weight, 800) : weight), lineHeight: 1.15,
|
||||||
...(w.highlight ? { background: w.highlight, padding: '0.05em 0.25em', borderRadius: '0.15em', boxDecorationBreak: 'clone', WebkitBoxDecorationBreak: 'clone' } : {}),
|
...(w.highlight ? { background: w.highlight, padding: '0.05em 0.25em', borderRadius: '0.15em', boxDecorationBreak: 'clone', WebkitBoxDecorationBreak: 'clone' } : {}),
|
||||||
textShadow: w.background_colour ? undefined : `0 ${cq(0.2)} ${cq(0.8)} rgba(0,0,0,0.35)`, whiteSpace: fit ? 'nowrap' : undefined,
|
textShadow: w.background_colour ? undefined : `0 ${cq(0.2)} ${cq(0.8)} rgba(0,0,0,0.35)`, whiteSpace: fit ? 'pre' : 'pre-line',
|
||||||
...(w.font ? { fontFamily: FONTS[w.font] } : {}), ...(w.italic ? { fontStyle: 'italic' } : {}), ...(w.underline ? { textDecoration: 'underline' } : {}) })
|
...(w.font ? { fontFamily: FONTS[w.font] } : {}), ...(w.italic ? { fontStyle: 'italic' } : {}), ...(w.underline ? { textDecoration: 'underline' } : {}) })
|
||||||
|
// a text of several lines (Enter, owner 2026-11-23): sized by its longest line and how many there are
|
||||||
const line = (str, testid, weight) => {
|
const line = (str, testid, weight) => {
|
||||||
const u = unit(3.4 * 1.15, textWidth(str.length, 3.4))
|
const rows = str.split('\n')
|
||||||
|
const u = unit(3.4 * 1.15 * rows.length, textWidth(Math.max(...rows.map(r => r.length)), 3.4))
|
||||||
return <span style={text(u, 3.4, weight)} data-testid={testid}>{w.text_effect === 'typewriter' ? <TypeText text={str} /> : str}</span>
|
return <span style={text(u, 3.4, weight)} data-testid={testid}>{w.text_effect === 'typewriter' ? <TypeText text={str} /> : str}</span>
|
||||||
}
|
}
|
||||||
// a menu or a stack fills a box: its own, or (in a corner / bar) one of a usual size
|
// a menu or a stack fills a box: its own, or (in a corner / bar) one of a usual size
|
||||||
@@ -353,7 +357,7 @@ function widgetBody(w, ctx, fit, path) {
|
|||||||
const caption = w.qr_caption ? 2.4 * 1.15 + 0.8 : 0
|
const caption = w.qr_caption ? 2.4 * 1.15 + 0.8 : 0
|
||||||
const u = unit(16 + caption, Math.max(16, w.qr_caption ? textWidth(w.qr_caption.length, 2.4) : 0))
|
const u = unit(16 + caption, Math.max(16, w.qr_caption ? textWidth(w.qr_caption.length, 2.4) : 0))
|
||||||
return (
|
return (
|
||||||
<div style={{ display: 'flex', flexDirection: 'column', alignItems: 'center', gap: u(0.8) }} data-testid="signage-w-qr" data-link={link}>
|
<div style={{ display: 'flex', flexDirection: 'column', alignItems: SELF[align], textAlign: align, gap: u(0.8) }} data-testid="signage-w-qr" data-link={link}>
|
||||||
<div style={{ background: w.qr_background || '#fff', padding: u(1), borderRadius: u(1), lineHeight: 0 }}>
|
<div style={{ background: w.qr_background || '#fff', padding: u(1), borderRadius: u(1), lineHeight: 0 }}>
|
||||||
<QRCodeSVG value={link} size={256} fgColor={w.qr_colour || '#000000'} bgColor={w.qr_background || '#ffffff'} style={{ width: u(14), height: u(14) }}
|
<QRCodeSVG value={link} size={256} fgColor={w.qr_colour || '#000000'} bgColor={w.qr_background || '#ffffff'} style={{ width: u(14), height: u(14) }}
|
||||||
level={logo ? 'H' : 'M'} imageSettings={logo ? { src: logo.src, width: 64, height: 64, excavate: true } : undefined} />
|
level={logo ? 'H' : 'M'} imageSettings={logo ? { src: logo.src, width: 64, height: 64, excavate: true } : undefined} />
|
||||||
@@ -362,7 +366,7 @@ function widgetBody(w, ctx, fit, path) {
|
|||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
if (w.kind === 'weather') return weatherBody(w, venue?.weather, unit, text, formatDate, ctx.t)
|
if (w.kind === 'weather') return weatherBody(w, venue?.weather, unit, text, formatDate, ctx.t, align)
|
||||||
if (w.kind === 'menu') return boxed(<MenuWidget board={w.board || {}} menu={x.menu} now={now} badges={venue?.badges} />, 'menu')
|
if (w.kind === 'menu') return boxed(<MenuWidget board={w.board || {}} menu={x.menu} now={now} badges={venue?.badges} />, 'menu')
|
||||||
if (w.kind === 'stack') return boxed(<Stack w={w} path={path} ctx={ctx} />, 'stack')
|
if (w.kind === 'stack') return boxed(<Stack w={w} path={path} ctx={ctx} />, 'stack')
|
||||||
// 6R.15
|
// 6R.15
|
||||||
@@ -382,26 +386,26 @@ function widgetBody(w, ctx, fit, path) {
|
|||||||
const label = w.text || ''
|
const label = w.text || ''
|
||||||
const u = unit((label ? 2.4 * 1.15 + 0.4 : 0) + 6 * 1.1, Math.max(textWidth(digits.length, 6) * 0.9, label ? textWidth(label.length, 2.4) : 0))
|
const u = unit((label ? 2.4 * 1.15 + 0.4 : 0) + 6 * 1.1, Math.max(textWidth(digits.length, 6) * 0.9, label ? textWidth(label.length, 2.4) : 0))
|
||||||
return (
|
return (
|
||||||
<div style={{ display: 'flex', flexDirection: 'column', alignItems: 'inherit', gap: u(0.4) }} data-testid="signage-w-countdown" data-state={st.state} data-left={st.left}>
|
<div style={{ display: 'flex', flexDirection: 'column', alignItems: SELF[align], textAlign: align, gap: u(0.4) }} data-testid="signage-w-countdown" data-state={st.state} data-left={st.left}>
|
||||||
{label && <span style={text(u, 2.4, 600)}>{label}</span>}
|
{label && <span style={text(u, 2.4, 600)}>{label}</span>}
|
||||||
<span style={{ ...text(u, 6, 800), lineHeight: 1.1, fontVariantNumeric: 'tabular-nums' }}>{digits}</span>
|
<span style={{ ...text(u, 6, 800), lineHeight: 1.1, fontVariantNumeric: 'tabular-nums' }}>{digits}</span>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
if (w.kind === 'hours') return hoursBody(w, ctx, unit, text)
|
if (w.kind === 'hours') return hoursBody(w, ctx, unit, text, align)
|
||||||
if (w.kind === 'wifi') return wifiBody(w, venue?.identity?.wifi, unit, text)
|
if (w.kind === 'wifi') return wifiBody(w, venue?.identity?.wifi, unit, text, align)
|
||||||
if (w.kind === 'contact') return contactBody(w, venue?.identity?.contact, unit, text)
|
if (w.kind === 'contact') return contactBody(w, venue?.identity?.contact, unit, text, align)
|
||||||
if (w.kind === 'gallery') {
|
if (w.kind === 'gallery') {
|
||||||
const ids = w.gallery_source === 'folder' ? (x.gallery || []) : (w.media_ids || [])
|
const ids = w.gallery_source === 'folder' ? (x.gallery || []) : (w.media_ids || [])
|
||||||
const items = ids.map(id => media(id)).filter(Boolean)
|
const items = ids.map(id => media(id)).filter(Boolean)
|
||||||
if (!items.length) return null
|
if (!items.length) return null
|
||||||
return boxed(<Gallery w={w} items={items} now={now} />, 'gallery')
|
return boxed(<Gallery w={w} items={items} now={now} title={w.text ? text(n => cq(+(n * ts).toFixed(3), 'h'), 9, 700) : null} align={align} />, 'gallery')
|
||||||
}
|
}
|
||||||
if (w.kind === 'reviews') {
|
if (w.kind === 'reviews') {
|
||||||
const list = (venue?.reviews || []).filter(r => r.stars >= (w.reviews_min || 4))
|
const list = (venue?.reviews || []).filter(r => r.stars >= (w.reviews_min || 4))
|
||||||
if (!list.length) return null
|
if (!list.length) return null
|
||||||
const r = list[pageAt(list.length, w.reviews_seconds || 8, now.getTime())]
|
const r = list[pageAt(list.length, w.reviews_seconds || 8, now.getTime())]
|
||||||
return boxed(<ReviewBody w={w} r={r} fmt={fmt} n={list.length} />, 'reviews')
|
return boxed(<ReviewBody w={w} r={r} fmt={fmt} n={list.length} align={align} />, 'reviews')
|
||||||
}
|
}
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
@@ -440,8 +444,11 @@ const GALLERY_IN = {
|
|||||||
zoom: [{ opacity: 0, transform: 'scale(1.12)' }, { opacity: 1, transform: 'scale(1)' }],
|
zoom: [{ opacity: 0, transform: 'scale(1.12)' }, { opacity: 1, transform: 'scale(1)' }],
|
||||||
}
|
}
|
||||||
|
|
||||||
/** A gallery (6R.16): its pictures and videos one after another, each for its seconds, coming in with its transition. */
|
/**
|
||||||
function Gallery({ w, items, now }) {
|
* A gallery (6R.16): its pictures and videos one after another, each for its seconds, coming in with
|
||||||
|
* its transition; its title above or below them (owner 2026-11-23), `title` = the title's text style.
|
||||||
|
*/
|
||||||
|
function Gallery({ w, items, now, title, align }) {
|
||||||
const i = pageAt(items.length, w.gallery_seconds || 5, now.getTime())
|
const i = pageAt(items.length, w.gallery_seconds || 5, now.getTime())
|
||||||
const m = items[i]
|
const m = items[i]
|
||||||
const el = useRef(null)
|
const el = useRef(null)
|
||||||
@@ -453,11 +460,15 @@ function Gallery({ w, items, now }) {
|
|||||||
}, [i, frames])
|
}, [i, frames])
|
||||||
const fit = { width: '100%', height: '100%', objectFit: w.gallery_fit || 'cover', display: 'block' }
|
const fit = { width: '100%', height: '100%', objectFit: w.gallery_fit || 'cover', display: 'block' }
|
||||||
return (
|
return (
|
||||||
<div style={{ width: '100%', height: '100%', overflow: 'hidden', position: 'relative' }} data-testid="signage-w-gallery" data-index={i} data-count={items.length}>
|
<div style={{ width: '100%', height: '100%', display: 'flex', flexDirection: w.title_position === 'below' ? 'column-reverse' : 'column', gap: title ? '2%' : 0 }}
|
||||||
<div key={`${i}-${m.src}`} ref={el} style={{ position: 'absolute', top: 0, right: 0, bottom: 0, left: 0 }}>
|
data-testid="signage-w-gallery" data-index={i} data-count={items.length}>
|
||||||
{m.kind === 'video'
|
{title && <div style={{ ...title, flexShrink: 0, textAlign: align, overflow: 'hidden', textOverflow: 'ellipsis' }} data-testid="signage-w-gallery-title">{w.text}</div>}
|
||||||
? <video src={m.src} poster={m.poster} muted autoPlay loop playsInline style={fit} />
|
<div style={{ flex: '1 1 0%', minHeight: 0, overflow: 'hidden', position: 'relative' }}>
|
||||||
: <img src={m.src} alt="" style={fit} />}
|
<div key={`${i}-${m.src}`} ref={el} style={{ position: 'absolute', top: 0, right: 0, bottom: 0, left: 0 }}>
|
||||||
|
{m.kind === 'video'
|
||||||
|
? <video src={m.src} poster={m.poster} muted autoPlay loop playsInline style={fit} />
|
||||||
|
: <img src={m.src} alt="" style={fit} />}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
@@ -467,7 +478,7 @@ function Gallery({ w, items, now }) {
|
|||||||
* One of the venue's reviews (6R.19), the next one every few seconds: its stars, what they wrote,
|
* One of the venue's reviews (6R.19), the next one every few seconds: its stars, what they wrote,
|
||||||
* who and where. It fills its place: the text is sized from the place's size and the review's length.
|
* who and where. It fills its place: the text is sized from the place's size and the review's length.
|
||||||
*/
|
*/
|
||||||
function ReviewBody({ w, r, fmt, n }) {
|
function ReviewBody({ w, r, fmt, n, align }) {
|
||||||
const box = useRef(null)
|
const box = useRef(null)
|
||||||
const [size, setSize] = useState(null)
|
const [size, setSize] = useState(null)
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -483,15 +494,17 @@ function ReviewBody({ w, r, fmt, n }) {
|
|||||||
const who = [w.reviews_name !== false && r.name, r.source, r.date && fmt.formatDate(`${r.date}T12:00:00Z`, 'date')].filter(Boolean).join(' · ')
|
const who = [w.reviews_name !== false && r.name, r.source, r.date && fmt.formatDate(`${r.date}T12:00:00Z`, 'date')].filter(Boolean).join(' · ')
|
||||||
const font = { ...(w.font ? { fontFamily: FONTS[w.font] } : {}), ...(w.italic ? { fontStyle: 'italic' } : {}) }
|
const font = { ...(w.font ? { fontFamily: FONTS[w.font] } : {}), ...(w.italic ? { fontStyle: 'italic' } : {}) }
|
||||||
return (
|
return (
|
||||||
<div ref={box} style={{ width: '100%', height: '100%', overflow: 'hidden', display: 'flex', flexDirection: 'column', justifyContent: 'center', gap: f * 0.35, ...font }}
|
<div ref={box} style={{ width: '100%', height: '100%', overflow: 'hidden', display: 'flex', flexDirection: 'column', justifyContent: 'center', textAlign: align, gap: f * 0.35, ...font }}
|
||||||
data-testid="signage-w-reviews" data-count={n} data-name={r.name}>
|
data-testid="signage-w-reviews" data-count={n} data-name={r.name}>
|
||||||
{size && <>
|
{size && <>
|
||||||
{w.reviews_stars !== false && (
|
{w.reviews_stars !== false && (
|
||||||
<div style={{ display: 'flex', gap: f * 0.15, justifyContent: 'inherit' }} aria-label={`${r.stars}/5`}>
|
<div style={{ display: 'flex', gap: f * 0.15, justifyContent: SELF[align] }} aria-label={`${r.stars}/5`}>
|
||||||
{[1, 2, 3, 4, 5].map(i => <Star key={i} style={{ width: f * 1.1, height: f * 1.1, color: STAR, fill: i <= r.stars ? STAR : 'none', opacity: i <= r.stars ? 1 : 0.4 }} aria-hidden="true" />)}
|
{[1, 2, 3, 4, 5].map(i => <Star key={i} style={{ width: f * 1.1, height: f * 1.1, color: STAR, fill: i <= r.stars ? STAR : 'none', opacity: i <= r.stars ? 1 : 0.4 }} aria-hidden="true" />)}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<div style={{ fontSize: f, lineHeight: 1.35, fontWeight: w.bold ? 700 : 500, ...(w.underline ? { textDecoration: 'underline' } : {}) }}>“{r.text}”</div>
|
<div style={{ fontSize: f, lineHeight: 1.35, fontWeight: w.weight || (w.bold ? 700 : 500), ...(w.underline ? { textDecoration: 'underline' } : {}) }}>
|
||||||
|
<span style={w.highlight ? { background: w.highlight, padding: '0.05em 0.25em', borderRadius: '0.15em', boxDecorationBreak: 'clone', WebkitBoxDecorationBreak: 'clone' } : undefined}>“{r.text}”</span>
|
||||||
|
</div>
|
||||||
{who && <div style={{ fontSize: f * 0.72, fontWeight: 700, opacity: 0.85 }}>— {who}</div>}
|
{who && <div style={{ fontSize: f * 0.72, fontWeight: 700, opacity: 0.85 }}>— {who}</div>}
|
||||||
</>}
|
</>}
|
||||||
</div>
|
</div>
|
||||||
@@ -563,7 +576,7 @@ const MONDAY = '2026-11-16' // a Monday: day names from the venue'
|
|||||||
const dayShort = (fmt, i) => fmt.formatDate(`2026-11-${16 + i}T12:00:00Z`, 'weekday').slice(0, 3)
|
const dayShort = (fmt, i) => fmt.formatDate(`2026-11-${16 + i}T12:00:00Z`, 'weekday').slice(0, 3)
|
||||||
|
|
||||||
/** The opening hours (6R.15): the week (days with the same hours on one line) or today; today stands out. */
|
/** The opening hours (6R.15): the week (days with the same hours on one line) or today; today stands out. */
|
||||||
function hoursBody(w, ctx, unit, text) {
|
function hoursBody(w, ctx, unit, text, align = 'left') {
|
||||||
const { venue, now, fmt, t } = ctx
|
const { venue, now, fmt, t } = ctx
|
||||||
const hours = venue?.hours
|
const hours = venue?.hours
|
||||||
if (!hours?.set) return null
|
if (!hours?.set) return null
|
||||||
@@ -573,14 +586,15 @@ function hoursBody(w, ctx, unit, text) {
|
|||||||
const spansText = r => (r.spans.length ? r.spans.map(x => `${x.from}–${x.to}`).join(', ') : t('signage.closed'))
|
const spansText = r => (r.spans.length ? r.spans.map(x => `${x.from}–${x.to}`).join(', ') : t('signage.closed'))
|
||||||
const widest = Math.max(...rows.map(r => daysText(r).length + 2 + spansText(r).length), w.text ? w.text.length : 0)
|
const widest = Math.max(...rows.map(r => daysText(r).length + 2 + spansText(r).length), w.text ? w.text.length : 0)
|
||||||
const u = unit((rows.length + (w.text ? 1.3 : 0)) * 3 * 1.35, textWidth(widest, 3))
|
const u = unit((rows.length + (w.text ? 1.3 : 0)) * 3 * 1.35, textWidth(widest, 3))
|
||||||
|
// lined up (owner 2026-11-23): left / right: both columns to that side; centre: they meet in the middle
|
||||||
return (
|
return (
|
||||||
<div style={{ display: 'grid', gridTemplateColumns: 'auto auto', columnGap: u(2), rowGap: u(0.4), alignItems: 'baseline', textAlign: 'left' }}
|
<div style={{ display: 'grid', gridTemplateColumns: 'auto auto', columnGap: u(2), rowGap: u(0.4), alignItems: 'baseline' }}
|
||||||
data-testid="signage-w-hours" data-rows={rows.length} data-start={MONDAY}>
|
data-testid="signage-w-hours" data-rows={rows.length} data-start={MONDAY} data-align={align}>
|
||||||
{w.text && <span style={{ ...text(u, 3.4, 800), gridColumn: '1 / -1' }}>{w.text}</span>}
|
{w.text && <span style={{ ...text(u, 3.4, 800), gridColumn: '1 / -1', textAlign: align }}>{w.text}</span>}
|
||||||
{rows.map(r => (
|
{rows.map(r => (
|
||||||
<span key={r.days.join()} style={{ display: 'contents' }} data-today={r.today ? 'true' : undefined}>
|
<span key={r.days.join()} style={{ display: 'contents' }} data-today={r.today ? 'true' : undefined}>
|
||||||
<span style={{ ...text(u, 3, r.today ? 800 : 600), opacity: r.today || w.hours_style === 'today' ? 1 : 0.85 }}>{daysText(r)}</span>
|
<span style={{ ...text(u, 3, r.today ? 800 : 600), opacity: r.today || w.hours_style === 'today' ? 1 : 0.85, textAlign: align === 'left' ? 'left' : 'right' }}>{daysText(r)}</span>
|
||||||
<span style={{ ...text(u, 3, r.today ? 800 : 500), fontVariantNumeric: 'tabular-nums' }}>{spansText(r)}</span>
|
<span style={{ ...text(u, 3, r.today ? 800 : 500), fontVariantNumeric: 'tabular-nums', textAlign: align === 'right' ? 'right' : 'left' }}>{spansText(r)}</span>
|
||||||
</span>
|
</span>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
@@ -588,24 +602,29 @@ function hoursBody(w, ctx, unit, text) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** The guests' Wi-Fi (6R.15, from the identity): its code to join, the network and the password. */
|
/** The guests' Wi-Fi (6R.15, from the identity): its code to join, the network and the password. */
|
||||||
function wifiBody(w, wifi, unit, text) {
|
function wifiBody(w, wifi, unit, text, align = 'left') {
|
||||||
if (!wifi?.ssid) return null
|
if (!wifi?.ssid) return null
|
||||||
const qr = w.wifi_qr !== false ? wifiQr(wifi) : ''
|
const qr = w.wifi_qr !== false ? wifiQr(wifi) : ''
|
||||||
const pw = w.wifi_password !== false && wifi.security !== 'nopass' && wifi.password ? wifi.password : ''
|
const pw = w.wifi_password !== false && wifi.security !== 'nopass' && wifi.password ? wifi.password : ''
|
||||||
const lines = [wifi.ssid, pw, wifi.note].filter(Boolean)
|
const lines = [wifi.ssid, pw, wifi.note].filter(Boolean)
|
||||||
const chars = Math.max(...lines.map(l => l.length)) + 2
|
const chars = Math.max(...lines.map(l => l.length)) + 2
|
||||||
const u = unit(Math.max(qr ? 13 : 0, lines.length * 3.4 * 1.35), (qr ? 14.5 : 0) + textWidth(chars, 3.4))
|
// the code on the left (left), on the right (right), above the text (centre: owner 2026-11-23)
|
||||||
|
const stacked = align === 'center' && qr
|
||||||
|
const u = stacked ? unit(13 + 1.5 + lines.length * 3.4 * 1.35, Math.max(13, textWidth(chars, 3.4)))
|
||||||
|
: unit(Math.max(qr ? 13 : 0, lines.length * 3.4 * 1.35), (qr ? 14.5 : 0) + textWidth(chars, 3.4))
|
||||||
const icon = { width: u(3), height: u(3), flexShrink: 0 }
|
const icon = { width: u(3), height: u(3), flexShrink: 0 }
|
||||||
|
const row = { display: 'flex', alignItems: 'center', gap: u(0.8), justifyContent: SELF[align] }
|
||||||
return (
|
return (
|
||||||
<div style={{ display: 'flex', alignItems: 'center', gap: u(1.5), textAlign: 'left' }} data-testid="signage-w-wifi">
|
<div style={{ display: 'flex', flexDirection: stacked ? 'column' : align === 'right' ? 'row-reverse' : 'row', alignItems: 'center', gap: u(1.5), textAlign: align }}
|
||||||
|
data-testid="signage-w-wifi" data-align={align}>
|
||||||
{qr && (
|
{qr && (
|
||||||
<div style={{ background: w.qr_background || '#fff', padding: u(0.7), borderRadius: u(0.8), lineHeight: 0 }}>
|
<div style={{ background: w.qr_background || '#fff', padding: u(0.7), borderRadius: u(0.8), lineHeight: 0 }}>
|
||||||
<QRCodeSVG value={qr} size={256} fgColor={w.qr_colour || '#000000'} bgColor={w.qr_background || '#ffffff'} style={{ width: u(11.5), height: u(11.5) }} />
|
<QRCodeSVG value={qr} size={256} fgColor={w.qr_colour || '#000000'} bgColor={w.qr_background || '#ffffff'} style={{ width: u(11.5), height: u(11.5) }} />
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<div style={{ display: 'grid', gap: u(0.5) }}>
|
<div style={{ display: 'grid', gap: u(0.5), justifyItems: GRID[align] }}>
|
||||||
<span style={{ display: 'flex', alignItems: 'center', gap: u(0.8), ...text(u, 3.4, 800) }}><Wifi style={icon} aria-hidden="true" />{wifi.ssid}</span>
|
<span style={{ ...row, ...text(u, 3.4, 800) }}><Wifi style={icon} aria-hidden="true" />{wifi.ssid}</span>
|
||||||
{pw && <span style={{ display: 'flex', alignItems: 'center', gap: u(0.8), ...text(u, 3.4, 600) }}><Lock style={icon} aria-hidden="true" />{pw}</span>}
|
{pw && <span style={{ ...row, ...text(u, 3.4, 600) }}><Lock style={icon} aria-hidden="true" />{pw}</span>}
|
||||||
{wifi.note && <span style={{ ...text(u, 2.6, 500), opacity: 0.85 }}>{wifi.note}</span>}
|
{wifi.note && <span style={{ ...text(u, 2.6, 500), opacity: 0.85 }}>{wifi.note}</span>}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -616,12 +635,12 @@ const CONTACT_ICONS = { phone: Phone, phone2: Phone, email: Mail, address: MapPi
|
|||||||
instagram: Camera, tiktok: Music, tripadvisor: Star, whatsapp: MessageCircle, viber: MessageCircle }
|
instagram: Camera, tiktok: Music, tripadvisor: Star, whatsapp: MessageCircle, viber: MessageCircle }
|
||||||
|
|
||||||
/** The venue's contact details (6R.15, from the identity): the chosen ones that are set, one a line with an icon. */
|
/** The venue's contact details (6R.15, from the identity): the chosen ones that are set, one a line with an icon. */
|
||||||
function contactBody(w, contact, unit, text) {
|
function contactBody(w, contact, unit, text, align = 'left') {
|
||||||
const rows = (w.contact_fields || ['phone', 'website', 'instagram']).filter(k => contact?.[k]).map(k => [k, contact[k]])
|
const rows = (w.contact_fields || ['phone', 'website', 'instagram']).filter(k => contact?.[k]).map(k => [k, contact[k]])
|
||||||
if (!rows.length) return null
|
if (!rows.length) return null
|
||||||
const u = unit(rows.length * 3.2 * 1.4, textWidth(Math.max(...rows.map(([, v]) => v.length)) + 2, 3.2))
|
const u = unit(rows.length * 3.2 * 1.4, textWidth(Math.max(...rows.map(([, v]) => v.length)) + 2, 3.2))
|
||||||
return (
|
return (
|
||||||
<div style={{ display: 'grid', gap: u(0.6), textAlign: 'left' }} data-testid="signage-w-contact" data-rows={rows.length}>
|
<div style={{ display: 'grid', gap: u(0.6), justifyItems: GRID[align], textAlign: align }} data-testid="signage-w-contact" data-rows={rows.length} data-align={align}>
|
||||||
{rows.map(([k, v]) => {
|
{rows.map(([k, v]) => {
|
||||||
const Icon = CONTACT_ICONS[k] || Globe
|
const Icon = CONTACT_ICONS[k] || Globe
|
||||||
return (
|
return (
|
||||||
@@ -640,7 +659,7 @@ function contactBody(w, contact, unit, text) {
|
|||||||
* next hours; with the details chosen (feels like, humidity, wind, rain chance, sunrise / sunset,
|
* next hours; with the details chosen (feels like, humidity, wind, rain chance, sunrise / sunset,
|
||||||
* UV, in words) and the place's name. Older forecasts without the details just leave them out.
|
* UV, in words) and the place's name. Older forecasts without the details just leave them out.
|
||||||
*/
|
*/
|
||||||
function weatherBody(w, wx, unit, text, formatDate, t) {
|
function weatherBody(w, wx, unit, text, formatDate, t, align = 'left') {
|
||||||
if (!wx || wx.temperature == null) return null // no internet / no place: hidden (5.4c)
|
if (!wx || wx.temperature == null) return null // no internet / no place: hidden (5.4c)
|
||||||
const from = w.weather_from || 0
|
const from = w.weather_from || 0
|
||||||
const style = w.weather_style || 'both'
|
const style = w.weather_style || 'both'
|
||||||
@@ -678,7 +697,7 @@ function weatherBody(w, wx, unit, text, formatDate, t) {
|
|||||||
if (!hours.length) return null
|
if (!hours.length) return null
|
||||||
const u = unit((place ? 3.2 : 0) + 3 + 5 + 3.6, hours.length * 9)
|
const u = unit((place ? 3.2 : 0) + 3 + 5 + 3.6, hours.length * 9)
|
||||||
return (
|
return (
|
||||||
<div style={{ display: 'grid', gap: u(0.6) }} data-testid="signage-w-weather" data-layout="hourly">
|
<div style={{ display: 'grid', gap: u(0.6), justifyItems: GRID[align] }} data-testid="signage-w-weather" data-layout="hourly">
|
||||||
{place && <span style={text(u, 2.6, 700)}>{place}</span>}
|
{place && <span style={text(u, 2.6, 700)}>{place}</span>}
|
||||||
<div style={{ display: 'flex', gap: u(1.5) }}>
|
<div style={{ display: 'flex', gap: u(1.5) }}>
|
||||||
{hours.map(h => {
|
{hours.map(h => {
|
||||||
@@ -699,7 +718,7 @@ function weatherBody(w, wx, unit, text, formatDate, t) {
|
|||||||
const list = days.slice(from, from + (w.weather_days || 3))
|
const list = days.slice(from, from + (w.weather_days || 3))
|
||||||
const u = unit((place ? 3.4 : 0) + list.length * 4.4, tw(4, 3) + 5 + tw(11, 3) + (want.has('rain') ? tw(5, 3) : 0) + 4)
|
const u = unit((place ? 3.4 : 0) + list.length * 4.4, tw(4, 3) + 5 + tw(11, 3) + (want.has('rain') ? tw(5, 3) : 0) + 4)
|
||||||
return (
|
return (
|
||||||
<div style={{ display: 'grid', gap: u(0.5) }} data-testid="signage-w-weather" data-layout="list">
|
<div style={{ display: 'grid', gap: u(0.5), justifyItems: GRID[align] }} data-testid="signage-w-weather" data-layout="list">
|
||||||
{place && <span style={text(u, 2.8, 700)}>{place}</span>}
|
{place && <span style={text(u, 2.8, 700)}>{place}</span>}
|
||||||
<div style={{ display: 'grid', gridTemplateColumns: `auto auto auto${want.has('rain') ? ' auto' : ''}`, columnGap: u(1.6), rowGap: u(0.6), alignItems: 'center' }}>
|
<div style={{ display: 'grid', gridTemplateColumns: `auto auto auto${want.has('rain') ? ' auto' : ''}`, columnGap: u(1.6), rowGap: u(0.6), alignItems: 'center' }}>
|
||||||
{list.map((d, n) => {
|
{list.map((d, n) => {
|
||||||
@@ -737,7 +756,7 @@ function weatherBody(w, wx, unit, text, formatDate, t) {
|
|||||||
const width = Math.max((pic ? 9 : 0) + (deg ? tw(main.label.length, 6) : 0), card ? detailW * 2 * 2.4 * 0.6 + 3 : tw(detailW, 2.6), tw(16, 2.4), place ? tw(place.length, 2.8) : 0)
|
const width = Math.max((pic ? 9 : 0) + (deg ? tw(main.label.length, 6) : 0), card ? detailW * 2 * 2.4 * 0.6 + 3 : tw(detailW, 2.6), tw(16, 2.4), place ? tw(place.length, 2.8) : 0)
|
||||||
const u = unit(lines * 4.2 + 3, width + 2)
|
const u = unit(lines * 4.2 + 3, width + 2)
|
||||||
return (
|
return (
|
||||||
<div style={{ display: 'grid', gap: u(0.8), justifyItems: 'inherit', ...(card ? { padding: u(1.5), borderRadius: u(1.5), background: w.background_colour ? undefined : 'rgba(0,0,0,0.28)' } : {}) }}
|
<div style={{ display: 'grid', gap: u(0.8), justifyItems: GRID[align], textAlign: align, ...(card ? { padding: u(1.5), borderRadius: u(1.5), background: w.background_colour ? undefined : 'rgba(0,0,0,0.28)' } : {}) }}
|
||||||
data-testid="signage-w-weather" data-layout={layout} data-style={style} data-from={from}>
|
data-testid="signage-w-weather" data-layout={layout} data-style={style} data-from={from}>
|
||||||
{place && <span style={{ ...text(u, 2.8, 700), opacity: 0.9 }}>{place}</span>}
|
{place && <span style={{ ...text(u, 2.8, 700), opacity: 0.9 }}>{place}</span>}
|
||||||
<div style={{ display: 'flex', alignItems: 'center', gap: u(1.5) }}>
|
<div style={{ display: 'flex', alignItems: 'center', gap: u(1.5) }}>
|
||||||
@@ -746,11 +765,11 @@ function weatherBody(w, wx, unit, text, formatDate, t) {
|
|||||||
</div>
|
</div>
|
||||||
{words && <span style={{ ...text(u, 2.8, 600), opacity: 0.9 }} data-testid="signage-weather-words">{words}</span>}
|
{words && <span style={{ ...text(u, 2.8, 600), opacity: 0.9 }} data-testid="signage-weather-words">{words}</span>}
|
||||||
{details.length > 0 && (
|
{details.length > 0 && (
|
||||||
<div style={{ display: 'grid', gridTemplateColumns: card ? 'auto auto' : 'auto', columnGap: u(2), rowGap: u(0.5) }}>
|
<div style={{ display: 'grid', gridTemplateColumns: card ? 'auto auto' : 'auto', columnGap: u(2), rowGap: u(0.5), justifyItems: GRID[align] }}>
|
||||||
{detailEls({ u, s: 2.6 }, u(0.6))}
|
{detailEls({ u, s: 2.6 }, u(0.6))}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{rest.length > 0 && <div style={{ display: card ? 'flex' : 'grid', gap: u(card ? 1.6 : 0.4), flexWrap: 'wrap' }}>{restEls(u, 2.4)}</div>}
|
{rest.length > 0 && <div style={{ display: card ? 'flex' : 'grid', gap: u(card ? 1.6 : 0.4), flexWrap: 'wrap', justifyContent: SELF[align], justifyItems: GRID[align] }}>{restEls(u, 2.4)}</div>}
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -820,7 +839,7 @@ function Stack({ w, path, ctx }) {
|
|||||||
const wp = `${cp}.${k}`
|
const wp = `${cp}.${k}`
|
||||||
const own = cw.position === 'custom' && cw.box
|
const own = cw.position === 'custom' && cw.box
|
||||||
const align = cw.align && cw.align !== 'auto' ? cw.align : 'center'
|
const align = cw.align && cw.align !== 'auto' ? cw.align : 'center'
|
||||||
const body = widgetBody(cw, ctx, own && TIGHT.includes(cw.kind) ? 'tight' : true, wp)
|
const body = widgetBody(cw, ctx, own && TIGHT.includes(cw.kind) ? 'tight' : true, wp, align)
|
||||||
return (
|
return (
|
||||||
<div key={k} style={{ flex: '1 1 0%', minWidth: 0, minHeight: 0, overflow: 'hidden', containerType: 'size', position: 'relative',
|
<div key={k} style={{ flex: '1 1 0%', minWidth: 0, minHeight: 0, overflow: 'hidden', containerType: 'size', position: 'relative',
|
||||||
...(own ? {} : { display: 'flex', alignItems: VSELF[cw.vertical] || 'center', justifyContent: SELF[align], textAlign: align }) }}
|
...(own ? {} : { display: 'flex', alignItems: VSELF[cw.vertical] || 'center', justifyContent: SELF[align], textAlign: align }) }}
|
||||||
|
|||||||
@@ -481,10 +481,11 @@ export function fitBox(W, H, ratio) {
|
|||||||
|
|
||||||
/** A screen's picture area in its window: the window minus the calibrated insets (never smaller than 50 px). */
|
/** A screen's picture area in its window: the window minus the calibrated insets (never smaller than 50 px). */
|
||||||
export function pictureArea(win, area = {}) {
|
export function pictureArea(win, area = {}) {
|
||||||
const l = Math.max(0, area.left || 0)
|
// below 0 an edge reaches past the window the TV reported (owner 2026-11-23): that part is cut off
|
||||||
const t = Math.max(0, area.top || 0)
|
const l = area.left || 0
|
||||||
const width = Math.max(50, win.w - l - Math.max(0, area.right || 0))
|
const t = area.top || 0
|
||||||
const height = Math.max(50, win.h - t - Math.max(0, area.bottom || 0))
|
const width = Math.max(50, win.w - l - (area.right || 0))
|
||||||
|
const height = Math.max(50, win.h - t - (area.bottom || 0))
|
||||||
return { left: l, top: t, width, height }
|
return { left: l, top: t, width, height }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -264,6 +264,8 @@ test('slide shapes: custom ratios, the canvas, the box a slide keeps on any scre
|
|||||||
assert.deepEqual([c.left, c.top, c.width, c.height], [0, 60, 1920, 1080])
|
assert.deepEqual([c.left, c.top, c.width, c.height], [0, 60, 1920, 1080])
|
||||||
// calibration: the window minus the insets; the presets centre a shape
|
// calibration: the window minus the insets; the presets centre a shape
|
||||||
assert.deepEqual(pictureArea({ w: 1920, h: 1080 }, { left: 10, top: 0, right: 30, bottom: 20 }), { left: 10, top: 0, width: 1880, height: 1060 })
|
assert.deepEqual(pictureArea({ w: 1920, h: 1080 }, { left: 10, top: 0, right: 30, bottom: 20 }), { left: 10, top: 0, width: 1880, height: 1060 })
|
||||||
|
// below 0 an edge reaches past the window the TV reported (owner 2026-11-23)
|
||||||
|
assert.deepEqual(pictureArea({ w: 1920, h: 1080 }, { left: -40, top: -10, right: -40, bottom: 0 }), { left: -40, top: -10, width: 2000, height: 1090 })
|
||||||
assert.deepEqual(presetInsets({ w: 2560, h: 1080 }, '16:9'), { left: 320, top: 0, right: 320, bottom: 0 })
|
assert.deepEqual(presetInsets({ w: 2560, h: 1080 }, '16:9'), { left: 320, top: 0, right: 320, bottom: 0 })
|
||||||
assert.deepEqual(presetInsets({ w: 1920, h: 1080 }, 'full'), { left: 0, top: 0, right: 0, bottom: 0 })
|
assert.deepEqual(presetInsets({ w: 1920, h: 1080 }, 'full'), { left: 0, top: 0, right: 0, bottom: 0 })
|
||||||
assert.equal(shapeName(2560, 1080), '21:9')
|
assert.equal(shapeName(2560, 1080), '21:9')
|
||||||
|
|||||||
@@ -409,6 +409,11 @@
|
|||||||
.x-page--fit .x-page__body > * { flex-shrink: 0; }
|
.x-page--fit .x-page__body > * { flex-shrink: 0; }
|
||||||
.x-page--fit .x-page__body > .x-page__fill { flex: 1 1 0; min-height: 0; grid-template-rows: minmax(0, 1fr); align-items: stretch; }
|
.x-page--fit .x-page__body > .x-page__fill { flex: 1 1 0; min-height: 0; grid-template-rows: minmax(0, 1fr); align-items: stretch; }
|
||||||
}
|
}
|
||||||
|
/* cards in columns (6F.0): settings and forms on a full-width page */
|
||||||
|
.x-columns { columns: var(--x-columns-min, 34rem); column-gap: var(--x-page-gap); }
|
||||||
|
.x-columns > * { break-inside: avoid; margin-bottom: var(--x-page-gap); }
|
||||||
|
.x-columns > *:last-child { margin-bottom: 0; }
|
||||||
|
.x-columns > .x-columns__wide { column-span: all; }
|
||||||
.x-page-header { display: flex; flex-wrap: wrap; align-items: center; gap: var(--x-space-3); }
|
.x-page-header { display: flex; flex-wrap: wrap; align-items: center; gap: var(--x-space-3); }
|
||||||
.x-page-header__titles { flex: 1; min-width: 0; }
|
.x-page-header__titles { flex: 1; min-width: 0; }
|
||||||
.x-page-header__title { margin: 0; display: flex; align-items: center; gap: var(--x-space-1); font-size: var(--x-text-title); line-height: var(--x-leading-title); font-weight: var(--x-weight-semibold); color: var(--x-ink); }
|
.x-page-header__title { margin: 0; display: flex; align-items: center; gap: var(--x-space-1); font-size: var(--x-text-title); line-height: var(--x-leading-title); font-weight: var(--x-weight-semibold); color: var(--x-ink); }
|
||||||
@@ -641,8 +646,8 @@
|
|||||||
/* ── Tabs ────────────────────────────────────────────────────────────────── */
|
/* ── Tabs ────────────────────────────────────────────────────────────────── */
|
||||||
.x-tabs { display: flex; align-items: center; gap: var(--x-space-2); box-shadow: inset 0 calc(-1 * var(--x-border-width)) 0 var(--x-line); }
|
.x-tabs { display: flex; align-items: center; gap: var(--x-space-2); box-shadow: inset 0 calc(-1 * var(--x-border-width)) 0 var(--x-line); }
|
||||||
.x-page__top .x-tabs { box-shadow: none; }
|
.x-page__top .x-tabs { box-shadow: none; }
|
||||||
.x-tabs__list { flex: 1; min-width: 0; display: flex; gap: var(--x-space-1); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
|
/* tabs that don't fit wrap onto another row: never hidden in a sideways scroll (6F.0, 2026-11-23) */
|
||||||
.x-tabs__list::-webkit-scrollbar { display: none; }
|
.x-tabs__list { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: var(--x-space-1); }
|
||||||
.x-tabs__tab {
|
.x-tabs__tab {
|
||||||
display: inline-flex; align-items: center; gap: var(--x-space-1-5); flex-shrink: 0;
|
display: inline-flex; align-items: center; gap: var(--x-space-1-5); flex-shrink: 0;
|
||||||
padding: var(--x-space-2-5) var(--x-space-3); border: 0; background: transparent;
|
padding: var(--x-space-2-5) var(--x-space-3); border: 0; background: transparent;
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ export function Segmented({ options = [], value, onChange, size = 'md', fill = f
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tabs with an underline: a page's or a dialog's sections. Scrolls sideways when they don't fit,
|
* Tabs with an underline: a page's or a dialog's sections. Tabs that don't fit wrap onto another row (6F.0),
|
||||||
* never up and down. tabs: [{ id, label, badge?, warn?, testId? }].
|
* never up and down. tabs: [{ id, label, badge?, warn?, testId? }].
|
||||||
* <Tabs tabs={tabs} value={tab} onChange={setTab} />
|
* <Tabs tabs={tabs} value={tab} onChange={setTab} />
|
||||||
* end: an element at the right end of the strip (a refresh button…).
|
* end: an element at the right end of the strip (a refresh button…).
|
||||||
|
|||||||
@@ -5,11 +5,17 @@ import { useLabels } from './labels.js'
|
|||||||
|
|
||||||
const GAP = 8
|
const GAP = 8
|
||||||
const MARGIN = 8
|
const MARGIN = 8
|
||||||
|
/** How long the pointer rests on the "i" before its tip opens (owner 2026-11-23, plan 6F.1a).
|
||||||
|
* A click or a tap opens it at once. */
|
||||||
|
export const INFOTIP_HOVER_MS = 1500
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The "(i)" help tip next to a setting or label (D-12: every manager page gets them).
|
* The "(i)" help tip next to a setting or label (D-12: every manager page gets them).
|
||||||
* Opens while the pointer rests on it (2026-11-20) and on click/tap (touch screens: a tap keeps
|
* Opens when the pointer has rested on it for 1.5 s (INFOTIP_HOVER_MS; leaving earlier cancels it), and
|
||||||
* it open), closes on Escape, a click outside, a second click or the pointer leaving. Placed above the button, or below when there's no room.
|
* at once on click / tap (it then stays open: touch screens). Closes on Escape, a click outside, a
|
||||||
|
* second click, or the pointer leaving the "i" and the tip (a hover-opened tip). Placed above the
|
||||||
|
* button, or below when there's no room. The same component in the manager, the waiter app and the
|
||||||
|
* terminal (6F.1a).
|
||||||
*
|
*
|
||||||
* <label>Alert after failures <InfoTip>How many failed print attempts before managers are notified. 0 turns it off.</InfoTip></label>
|
* <label>Alert after failures <InfoTip>How many failed print attempts before managers are notified. 0 turns it off.</InfoTip></label>
|
||||||
*
|
*
|
||||||
@@ -20,11 +26,22 @@ export function InfoTip({ children, label, side = 'top', className }) {
|
|||||||
const [pinned, setPinned] = useState(false)
|
const [pinned, setPinned] = useState(false)
|
||||||
const [hover, setHover] = useState(false)
|
const [hover, setHover] = useState(false)
|
||||||
const leaveTimer = useRef(null)
|
const leaveTimer = useRef(null)
|
||||||
|
const enterTimer = useRef(null)
|
||||||
const open = pinned || hover
|
const open = pinned || hover
|
||||||
const setOpen = v => { setPinned(v); if (!v) setHover(false) }
|
const setOpen = v => { clearTimeout(enterTimer.current); setPinned(v); if (!v) setHover(false) }
|
||||||
const enter = () => { clearTimeout(leaveTimer.current); setHover(true) }
|
// the pointer on the "i": open after the delay; on the open tip: keep it open
|
||||||
const leave = () => { clearTimeout(leaveTimer.current); leaveTimer.current = setTimeout(() => setHover(false), 120) }
|
const enter = () => {
|
||||||
useEffect(() => () => clearTimeout(leaveTimer.current), [])
|
clearTimeout(leaveTimer.current)
|
||||||
|
if (hover) return
|
||||||
|
clearTimeout(enterTimer.current)
|
||||||
|
enterTimer.current = setTimeout(() => setHover(true), INFOTIP_HOVER_MS)
|
||||||
|
}
|
||||||
|
const stay = () => clearTimeout(leaveTimer.current)
|
||||||
|
const leave = () => {
|
||||||
|
clearTimeout(enterTimer.current); clearTimeout(leaveTimer.current)
|
||||||
|
leaveTimer.current = setTimeout(() => setHover(false), 120)
|
||||||
|
}
|
||||||
|
useEffect(() => () => { clearTimeout(leaveTimer.current); clearTimeout(enterTimer.current) }, [])
|
||||||
const [pos, setPos] = useState(null)
|
const [pos, setPos] = useState(null)
|
||||||
const button = useRef(null)
|
const button = useRef(null)
|
||||||
const tip = useRef(null)
|
const tip = useRef(null)
|
||||||
@@ -89,7 +106,7 @@ export function InfoTip({ children, label, side = 'top', className }) {
|
|||||||
ref={tip}
|
ref={tip}
|
||||||
id={id}
|
id={id}
|
||||||
role="tooltip"
|
role="tooltip"
|
||||||
onPointerEnter={enter}
|
onPointerEnter={stay}
|
||||||
onPointerLeave={leave}
|
onPointerLeave={leave}
|
||||||
className={cx('x-infotip__popover', pos && (pos.above ? 'x-infotip__popover--above' : 'x-infotip__popover--below'))}
|
className={cx('x-infotip__popover', pos && (pos.above ? 'x-infotip__popover--above' : 'x-infotip__popover--below'))}
|
||||||
style={pos ? { top: pos.top, left: pos.left, '--x-arrow-x': `${pos.arrow}px` } : { top: 0, left: 0, visibility: 'hidden' }}
|
style={pos ? { top: pos.top, left: pos.left, '--x-arrow-x': `${pos.arrow}px` } : { top: 0, left: 0, visibility: 'hidden' }}
|
||||||
|
|||||||
@@ -11,11 +11,14 @@ const Icon = ({ d }) => (
|
|||||||
* <NumberInput value={seconds} min={1} max={3600} onChange={setSeconds} suffix="s" />
|
* <NumberInput value={seconds} min={1} max={3600} onChange={setSeconds} suffix="s" />
|
||||||
* The field may be emptied while typing: onChange(null). The form shows its own error for an empty
|
* The field may be emptied while typing: onChange(null). The form shows its own error for an empty
|
||||||
* value and keeps it from being saved. A value over `max` is brought down; under `min`, brought up
|
* value and keeps it from being saved. A value over `max` is brought down; under `min`, brought up
|
||||||
* when the field is left. Inside a <Field> it takes the field's id.
|
* when the field is left. Inside a <Field> it takes the field's id. With a `min` below 0 a minus
|
||||||
|
* may be typed in front (2026-11-23).
|
||||||
*/
|
*/
|
||||||
export function NumberInput({ value, onChange, min = 0, max = Infinity, step = 1, suffix, size = 'md', invalid = false, disabled = false, className, id, ...rest }) {
|
export function NumberInput({ value, onChange, min = 0, max = Infinity, step = 1, suffix, size = 'md', invalid = false, disabled = false, className, id, ...rest }) {
|
||||||
const labels = useLabels()
|
const labels = useLabels()
|
||||||
const [focus, setFocus] = useState(false)
|
const [focus, setFocus] = useState(false)
|
||||||
|
const [draft, setDraft] = useState(null) // "-" typed, no digits yet
|
||||||
|
const signed = min < 0
|
||||||
const n = value === '' || value == null ? null : Number(value)
|
const n = value === '' || value == null ? null : Number(value)
|
||||||
const clamp = v => Math.min(max, Math.max(min, v))
|
const clamp = v => Math.min(max, Math.max(min, v))
|
||||||
const stepBy = d => onChange?.(clamp((n ?? min) + d))
|
const stepBy = d => onChange?.(clamp((n ?? min) + d))
|
||||||
@@ -24,14 +27,16 @@ export function NumberInput({ value, onChange, min = 0, max = Infinity, step = 1
|
|||||||
<button type="button" className="x-number__btn" onClick={() => stepBy(-step)} disabled={disabled || (n != null && n <= min)} aria-label={labels.decrease} tabIndex={-1}>
|
<button type="button" className="x-number__btn" onClick={() => stepBy(-step)} disabled={disabled || (n != null && n <= min)} aria-label={labels.decrease} tabIndex={-1}>
|
||||||
<Icon d="M5 12h14" />
|
<Icon d="M5 12h14" />
|
||||||
</button>
|
</button>
|
||||||
<input id={id} type="text" inputMode="numeric" className="x-number__input" value={n == null ? '' : String(n)} disabled={disabled}
|
<input id={id} type="text" inputMode={signed ? 'text' : 'numeric'} className="x-number__input" value={draft ?? (n == null ? '' : String(n))} disabled={disabled}
|
||||||
aria-invalid={invalid || undefined}
|
aria-invalid={invalid || undefined}
|
||||||
onChange={e => {
|
onChange={e => {
|
||||||
|
const minus = signed && /^\s*-/.test(e.target.value)
|
||||||
const digits = e.target.value.replace(/\D/g, '')
|
const digits = e.target.value.replace(/\D/g, '')
|
||||||
onChange?.(digits === '' ? null : Math.min(max, Number(digits)))
|
setDraft(minus && digits === '' ? '-' : null)
|
||||||
|
onChange?.(digits === '' ? null : Math.min(max, (minus ? -1 : 1) * Number(digits)))
|
||||||
}}
|
}}
|
||||||
onFocus={() => setFocus(true)}
|
onFocus={() => setFocus(true)}
|
||||||
onBlur={() => { setFocus(false); if (n != null && n < min) onChange?.(min) }}
|
onBlur={() => { setFocus(false); setDraft(null); if (n != null && n < min) onChange?.(min) }}
|
||||||
onKeyDown={e => {
|
onKeyDown={e => {
|
||||||
if (e.key === 'ArrowUp') { e.preventDefault(); stepBy(step) }
|
if (e.key === 'ArrowUp') { e.preventDefault(); stepBy(step) }
|
||||||
if (e.key === 'ArrowDown') { e.preventDefault(); stepBy(-step) }
|
if (e.key === 'ArrowDown') { e.preventDefault(); stepBy(-step) }
|
||||||
|
|||||||
@@ -75,3 +75,21 @@ export function Pane({ header, footer, sunken = false, as: Tag = 'section', clas
|
|||||||
</Tag>
|
</Tag>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Cards in columns (2026-11-23, plan 6F.0): a full-width page of settings or forms keeps each card
|
||||||
|
* at a readable width. Cards flow top to bottom, then into the next column; a column is at least
|
||||||
|
* `min` wide (default 34rem), so a 1080p screen shows two, an ultrawide three, a phone one.
|
||||||
|
* A child with `x-columns__wide` (or wrapped in <ColumnsWide>) spans every column (a header row,
|
||||||
|
* a wide table).
|
||||||
|
* <Columns testId="settings-operation"><SettingsCard …/><SettingsCard …/></Columns>
|
||||||
|
*/
|
||||||
|
export function Columns({ min, className, testId, style, children, ...rest }) {
|
||||||
|
return (
|
||||||
|
<div className={cx('x-columns', className)} data-testid={testId}
|
||||||
|
style={min ? { ...style, '--x-columns-min': min } : style} {...rest}>{children}</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
export function ColumnsWide({ className, children, ...rest }) {
|
||||||
|
return <div className={cx('x-columns__wide', className)} {...rest}>{children}</div>
|
||||||
|
}
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ export { PrintArea, PrintSheet } from './components/PrintArea.jsx'
|
|||||||
export { ToastProvider } from './components/Toast.jsx'
|
export { ToastProvider } from './components/Toast.jsx'
|
||||||
export { useToast } from './components/toastContext.js'
|
export { useToast } from './components/toastContext.js'
|
||||||
export { PinPad } from './components/PinPad.jsx'
|
export { PinPad } from './components/PinPad.jsx'
|
||||||
export { InfoTip } from './components/InfoTip.jsx'
|
export { INFOTIP_HOVER_MS, InfoTip } from './components/InfoTip.jsx'
|
||||||
export { EmptyState } from './components/EmptyState.jsx'
|
export { EmptyState } from './components/EmptyState.jsx'
|
||||||
export { Spinner } from './components/Spinner.jsx'
|
export { Spinner } from './components/Spinner.jsx'
|
||||||
export { Field, Input, Textarea, Select } from './components/Field.jsx'
|
export { Field, Input, Textarea, Select } from './components/Field.jsx'
|
||||||
@@ -31,7 +31,7 @@ export { Slider } from './components/Slider.jsx'
|
|||||||
export { NumberInput } from './components/NumberInput.jsx'
|
export { NumberInput } from './components/NumberInput.jsx'
|
||||||
export { Notice } from './components/Notice.jsx'
|
export { Notice } from './components/Notice.jsx'
|
||||||
export { IconPicker } from './components/IconPicker.jsx'
|
export { IconPicker } from './components/IconPicker.jsx'
|
||||||
export { Page, PageHeader, Pane, Toolbar, ToolbarSpacer } from './components/Page.jsx'
|
export { Columns, ColumnsWide, Page, PageHeader, Pane, Toolbar, ToolbarSpacer } from './components/Page.jsx'
|
||||||
export { SearchInput, FilterChip, Segmented, Tabs } from './components/Controls.jsx'
|
export { SearchInput, FilterChip, Segmented, Tabs } from './components/Controls.jsx'
|
||||||
export { Switch } from './components/Switch.jsx'
|
export { Switch } from './components/Switch.jsx'
|
||||||
export { Stepper } from './components/Stepper.jsx'
|
export { Stepper } from './components/Stepper.jsx'
|
||||||
|
|||||||
@@ -72,12 +72,14 @@ export default function SignageApp() {
|
|||||||
const { t } = useTranslation('terminal')
|
const { t } = useTranslation('terminal')
|
||||||
const { offline } = useDevice()
|
const { offline } = useDevice()
|
||||||
const [data, setData] = useState(readCache)
|
const [data, setData] = useState(readCache)
|
||||||
|
const [calib, setCalib] = useState(null) // the last signage.calibrate, until the next answer
|
||||||
const [now, setNow] = useState(() => new Date())
|
const [now, setNow] = useState(() => new Date())
|
||||||
|
|
||||||
const load = useCallback(async () => {
|
const load = useCallback(async () => {
|
||||||
try {
|
try {
|
||||||
const { data: d } = await client.get('/api/signage/screen', quiet)
|
const { data: d } = await client.get('/api/signage/screen', quiet)
|
||||||
setData(prev => (prev?.version === d.version ? prev : d))
|
setData(prev => (prev?.version === d.version ? prev : d))
|
||||||
|
setCalib(null) // the answer is newer than any calibration event before it
|
||||||
writeCache(d)
|
writeCache(d)
|
||||||
} catch { /* keep playing what we have */ }
|
} catch { /* keep playing what we have */ }
|
||||||
}, [])
|
}, [])
|
||||||
@@ -100,8 +102,9 @@ export default function SignageApp() {
|
|||||||
}, [])
|
}, [])
|
||||||
useEffect(() => { report() }, [report, win.w, win.h])
|
useEffect(() => { report() }, [report, win.w, win.h])
|
||||||
useLiveEvent('ready', report)
|
useLiveEvent('ready', report)
|
||||||
const [calib, setCalib] = useState(null) // the last signage.calibrate: { on, area }
|
// the last signage.calibrate: { on, area }; the screen's answer is asked for too (owner 2026-11-23:
|
||||||
useLiveEvent('signage.calibrate', d => setCalib({ on: !!d?.on, area: d?.area || null }))
|
// the outline must show the first time, even when the event comes before the TV is listening)
|
||||||
|
useLiveEvent('signage.calibrate', d => { setCalib({ on: !!d?.on, area: d?.area || null }); load() })
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!calib?.on) return undefined
|
if (!calib?.on) return undefined
|
||||||
const id = setTimeout(() => setCalib({ on: false, area: null }), CALIBRATE_MS)
|
const id = setTimeout(() => setCalib({ on: false, area: null }), CALIBRATE_MS)
|
||||||
@@ -120,6 +123,12 @@ export default function SignageApp() {
|
|||||||
const tz = data?.schedule?.timezone
|
const tz = data?.schedule?.timezone
|
||||||
const screen = data?.screen
|
const screen = data?.screen
|
||||||
const calibrating = calib ? calib.on : !!screen?.calibrating
|
const calibrating = calib ? calib.on : !!screen?.calibrating
|
||||||
|
// while calibrating, the answer every few seconds (an edge moved while an event was missed)
|
||||||
|
useEffect(() => {
|
||||||
|
if (!calibrating) return undefined
|
||||||
|
const id = setInterval(load, 4000)
|
||||||
|
return () => clearInterval(id)
|
||||||
|
}, [calibrating, load])
|
||||||
const pic = pictureArea(win, (calib?.on && calib.area) || screen?.area)
|
const pic = pictureArea(win, (calib?.on && calib.area) || screen?.area)
|
||||||
const frame = frameSize(screen?.rotation, pic)
|
const frame = frameSize(screen?.rotation, pic)
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -23,10 +23,11 @@ const PAGES = [
|
|||||||
'management/approvals', 'management/schedule', 'management/prep-zones', 'management/pricing', 'management/pricing?tab=channels',
|
'management/approvals', 'management/schedule', 'management/prep-zones', 'management/pricing', 'management/pricing?tab=channels',
|
||||||
'management/products', 'management/tables', 'management/tables?tab=floor', 'management/scenes', 'management/signage?tab=playlists', 'management/signage?tab=schedules', 'inventory/throwaways', 'notes',
|
'management/products', 'management/tables', 'management/tables?tab=floor', 'management/scenes', 'management/signage?tab=playlists', 'management/signage?tab=schedules', 'inventory/throwaways', 'notes',
|
||||||
'reports/today', 'reports/store', 'devices', 'license', 'apps', 'settings?tab=operation',
|
'reports/today', 'reports/store', 'devices', 'license', 'apps', 'settings?tab=operation',
|
||||||
|
'settings?tab=security', 'settings?tab=identity', 'settings?tab=print-fonts', 'settings?tab=venue',
|
||||||
]
|
]
|
||||||
const SHOTS = ['dashboard', 'tables', 'tables?view=qr', 'online-orders?tab=settings', 'crm/contacts', 'crm/customers', 'financials/expenses',
|
const SHOTS = ['dashboard', 'tables', 'tables?view=qr', 'online-orders?tab=settings', 'crm/contacts', 'crm/customers', 'financials/expenses',
|
||||||
'management/products', 'management/tables?tab=floor', 'management/pricing?tab=channels', 'financials/tabs', 'management/staff']
|
'management/products', 'management/tables?tab=floor', 'management/pricing?tab=channels', 'financials/tabs', 'management/staff', 'settings?tab=operation']
|
||||||
const SCREENS = [{ id: '1080p', width: 1920, height: 1080 }, { id: 'ultrawide', width: 3440, height: 1440 }]
|
const SCREENS = [{ id: '1080p', width: 1920, height: 1080 }, { id: 'ultrawide', width: 3440, height: 1440 }, { id: 'laptop', width: 1366, height: 768 }]
|
||||||
const MODULES = ['connect_orders', 'connect_menu', 'crm', 'tabs', 'expenses', 'inventory', 'notes', 'chat', 'reservations', 'pricing', 'signage', 'staff_planning']
|
const MODULES = ['connect_orders', 'connect_menu', 'crm', 'tabs', 'expenses', 'inventory', 'notes', 'chat', 'reservations', 'pricing', 'signage', 'staff_planning']
|
||||||
|
|
||||||
const backend = await startBackend({ port: 8067, siteId: 'test-site-1', env: { LICENSE_MODE: 'off' } })
|
const backend = await startBackend({ port: 8067, siteId: 'test-site-1', env: { LICENSE_MODE: 'off' } })
|
||||||
@@ -69,7 +70,7 @@ try {
|
|||||||
// the area: the scroller without its scrollbar's room (kept on every page, 2026-11-21)
|
// the area: the scroller without its scrollbar's room (kept on every page, 2026-11-21)
|
||||||
const b = body.getBoundingClientRect(); const s = scroll.getBoundingClientRect()
|
const b = body.getBoundingClientRect(); const s = scroll.getBoundingClientRect()
|
||||||
const a = { left: s.left, right: s.left + scroll.clientWidth, width: scroll.clientWidth }
|
const a = { left: s.left, right: s.left + scroll.clientWidth, width: scroll.clientWidth }
|
||||||
// a form page (settings) is centred at its own width
|
// a form page (width="form": none left since 6F.0) is centred at its own width
|
||||||
const form = body.classList.contains('x-page__body--form')
|
const form = body.classList.contains('x-page__body--form')
|
||||||
return { form, left: b.left - a.left, right: a.right - b.right, width: b.width, area: a.width, cap: 2200,
|
return { form, left: b.left - a.left, right: a.right - b.right, width: b.width, area: a.width, cap: 2200,
|
||||||
scrolls: scroll.scrollHeight <= scroll.clientHeight + 1 || getComputedStyle(scroll).overflowY === 'auto' }
|
scrolls: scroll.scrollHeight <= scroll.clientHeight + 1 || getComputedStyle(scroll).overflowY === 'auto' }
|
||||||
@@ -82,6 +83,15 @@ try {
|
|||||||
}
|
}
|
||||||
r.check(`${screen.id}: every page fills its area up to 2200 px, centred, and scrolls`, bad.length === 0, bad.join('\n'))
|
r.check(`${screen.id}: every page fills its area up to 2200 px, centred, and scrolls`, bad.length === 0, bad.join('\n'))
|
||||||
|
|
||||||
|
// Settings (6F.0, owner 2026-11-23): full width like every page, and every tab's button inside
|
||||||
|
// the window (tabs that don't fit wrap onto another row, never hidden in a sideways scroll)
|
||||||
|
await page.goto(`${APP}/settings`)
|
||||||
|
await page.getByTestId('settings-page').waitFor()
|
||||||
|
const tabsIn = await page.evaluate(() => [...document.querySelectorAll('[data-testid^="settings-tab-"]')]
|
||||||
|
.map(e => { const b = e.getBoundingClientRect(); return { id: e.dataset.testid, in: b.left >= 0 && b.right <= innerWidth && b.width > 0 } }))
|
||||||
|
r.check(`${screen.id}: settings: every tab is visible (${tabsIn.length})`, tabsIn.length >= 8 && tabsIn.every(x => x.in),
|
||||||
|
JSON.stringify(tabsIn.filter(x => !x.in)))
|
||||||
|
|
||||||
// Products (2026-11-21): the page doesn't scroll, its two panes do, each on its own
|
// Products (2026-11-21): the page doesn't scroll, its two panes do, each on its own
|
||||||
await page.goto(`${APP}/management/products`)
|
await page.goto(`${APP}/management/products`)
|
||||||
await page.getByTestId('products-panel').waitFor()
|
await page.getByTestId('products-panel').waitFor()
|
||||||
|
|||||||
@@ -270,6 +270,7 @@ try {
|
|||||||
await mgr.getByTestId('signage-add-slide').click()
|
await mgr.getByTestId('signage-add-slide').click()
|
||||||
await mgr.getByTestId('signage-template-menuBoard').click()
|
await mgr.getByTestId('signage-template-menuBoard').click()
|
||||||
await mgr.getByTestId('signage-menu-editor').waitFor({ timeout: 10_000 })
|
await mgr.getByTestId('signage-menu-editor').waitFor({ timeout: 10_000 })
|
||||||
|
await mgr.locator('.x-overlay').waitFor({ state: 'detached', timeout: 5000 }).catch(() => {}) // the "Add a slide" dialog has gone
|
||||||
await mgr.getByTestId('signage-menu-select').click()
|
await mgr.getByTestId('signage-menu-select').click()
|
||||||
await mgr.getByRole('option', { name: 'Chosen categories and products' }).click()
|
await mgr.getByRole('option', { name: 'Chosen categories and products' }).click()
|
||||||
await mgr.locator(`[data-testid="signage-menu-category"][data-name="${catA.name}"]`).click()
|
await mgr.locator(`[data-testid="signage-menu-category"][data-name="${catA.name}"]`).click()
|
||||||
@@ -573,6 +574,13 @@ try {
|
|||||||
const plus = mgr.getByTestId('signage-calibrate-top').locator('xpath=..').locator('button').last()
|
const plus = mgr.getByTestId('signage-calibrate-top').locator('xpath=..').locator('button').last()
|
||||||
await plus.click(); await plus.click()
|
await plus.click(); await plus.click()
|
||||||
r.check('6R.13: …the top edge moved in 2 px with + (the TV follows)', await waitFor(async () => (await areaNow()) === '150,2,960,538', 8000, 200) === true, String(await areaNow()))
|
r.check('6R.13: …the top edge moved in 2 px with + (the TV follows)', await waitFor(async () => (await areaNow()) === '150,2,960,538', 8000, 200) === true, String(await areaNow()))
|
||||||
|
// 2026-11-23: an edge may go past the recognised window (a negative number)
|
||||||
|
const left = mgr.getByTestId('signage-calibrate-left')
|
||||||
|
await left.fill('-40'); await left.press('Tab')
|
||||||
|
r.check('2026-11-23: an edge pushed past the recognised window (-40 px): the picture on the TV reaches past it',
|
||||||
|
await waitFor(async () => (await areaNow()) === '-40,2,1150,538', 8000, 200) === true && await mgr.getByTestId('signage-calibrate-past').isVisible(), String(await areaNow()))
|
||||||
|
await left.fill('150'); await left.press('Tab')
|
||||||
|
await waitFor(async () => (await areaNow()) === '150,2,960,538', 8000, 200)
|
||||||
await mgr.screenshot({ path: path.join(OUT, 'signage-calibrate.png') })
|
await mgr.screenshot({ path: path.join(OUT, 'signage-calibrate.png') })
|
||||||
await tv.screenshot({ path: path.join(OUT, 'signage-calibrate-tv.png') })
|
await tv.screenshot({ path: path.join(OUT, 'signage-calibrate-tv.png') })
|
||||||
await mgr.getByTestId('signage-calibrate-done').click()
|
await mgr.getByTestId('signage-calibrate-done').click()
|
||||||
|
|||||||
+16
-2
@@ -18,6 +18,8 @@ const log = openSync(path.join(OUT, `vite-${PORT}.log`), 'w')
|
|||||||
const vite = spawn('npx', ['vite', '--port', String(PORT), '--strictPort'], {
|
const vite = spawn('npx', ['vite', '--port', String(PORT), '--strictPort'], {
|
||||||
cwd: path.join(CS, 'manager_dashboard'), shell: process.platform === 'win32', detached: process.platform !== 'win32',
|
cwd: path.join(CS, 'manager_dashboard'), shell: process.platform === 'win32', detached: process.platform !== 'win32',
|
||||||
stdio: ['ignore', log, log],
|
stdio: ['ignore', log, log],
|
||||||
|
// no backend on purpose: a stack left running on :8000 (Docker, another venue's language) must not leak in
|
||||||
|
env: { ...process.env, XENIA_BACKEND: 'http://127.0.0.1:9' },
|
||||||
})
|
})
|
||||||
const browser = await chromium.launch(BROWSER_CHANNEL ? { channel: BROWSER_CHANNEL } : {})
|
const browser = await chromium.launch(BROWSER_CHANNEL ? { channel: BROWSER_CHANNEL } : {})
|
||||||
let r = reporter('ui: @xenia/ui components (gallery)')
|
let r = reporter('ui: @xenia/ui components (gallery)')
|
||||||
@@ -95,10 +97,22 @@ try {
|
|||||||
await stepper.getByRole('button', { name: 'More' }).click()
|
await stepper.getByRole('button', { name: 'More' }).click()
|
||||||
r.check('stepper: + is disabled at the last step', (await stepper.textContent()).includes('60s') && await stepper.getByRole('button', { name: 'More' }).isDisabled())
|
r.check('stepper: + is disabled at the last step', (await stepper.textContent()).includes('60s') && await stepper.getByRole('button', { name: 'More' }).isDisabled())
|
||||||
|
|
||||||
// InfoTip
|
// InfoTip (6F.1a): 1.5 s on hover, at once on click
|
||||||
const tip = p.getByRole('button', { name: 'More info' }).first()
|
const tip = p.getByRole('button', { name: 'More info' }).first()
|
||||||
|
await tip.hover()
|
||||||
|
await sleep(700)
|
||||||
|
r.check('infotip: hovering 0.7 s: still closed', !(await p.getByRole('tooltip').isVisible()))
|
||||||
|
await p.mouse.move(5, 300)
|
||||||
|
await sleep(1200)
|
||||||
|
r.check('infotip: leaving before 1.5 s cancels it', !(await p.getByRole('tooltip').isVisible()))
|
||||||
|
await tip.hover()
|
||||||
|
await sleep(1800)
|
||||||
|
r.check('infotip: hovering 1.5 s opens it', await p.getByRole('tooltip').isVisible())
|
||||||
|
await p.mouse.move(5, 300)
|
||||||
|
await sleep(400)
|
||||||
|
r.check('infotip: leaving closes a hover-opened tip', !(await p.getByRole('tooltip').isVisible()))
|
||||||
await tip.click()
|
await tip.click()
|
||||||
r.check('infotip: opens', await p.getByRole('tooltip').isVisible())
|
r.check('infotip: a click opens it at once', await p.getByRole('tooltip').isVisible())
|
||||||
await p.keyboard.press('Escape')
|
await p.keyboard.press('Escape')
|
||||||
r.check('infotip: Escape closes, focus back', !(await p.getByRole('tooltip').isVisible()) && (await active()) === 'More info')
|
r.check('infotip: Escape closes, focus back', !(await p.getByRole('tooltip').isVisible()) && (await active()) === 'More info')
|
||||||
await tip.click(); await p.mouse.click(5, 300)
|
await tip.click(); await p.mouse.click(5, 300)
|
||||||
|
|||||||
Reference in New Issue
Block a user