@kosdev-code/kos-ddk-cli 0.1.0-dev.67 → 0.1.0-dev.72
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/agent-plugin/kos-ddk-tools/.claude-plugin/plugin.json +1 -1
- package/agent-plugin/kos-ddk-tools/plugin.json +1 -1
- package/agent-plugin/kos-ddk-tools/reference/reference.json +9 -2
- package/agent-plugin/kos-ddk-tools/skills/build-ddk-plugin/SKILL.md +13 -2
- package/agent-plugin/kos-ddk-tools/skills/ddk-config-page/SKILL.md +89 -0
- package/agent-plugin/kos-ddk-tools/templates/utility/__nameDashCase__.tsx__template__ +2 -2
- package/guides/config-property-cards.md +45 -0
- package/guides/ddk-dev.md +12 -0
- package/package.json +2 -2
- package/reference/reference.json +9 -2
- package/templates/utility/__nameDashCase__.tsx__template__ +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kos-ddk-tools",
|
|
3
|
-
"version": "0.1.0-dev.
|
|
3
|
+
"version": "0.1.0-dev.72",
|
|
4
4
|
"description": "KOS DDK plugin authoring (kos-ddk) MCP server: plugin projects, extension-point contributions and overrides of the standard ones.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "kosdev-code"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
|
|
3
3
|
"name": "kos-ddk-tools",
|
|
4
|
-
"version": "0.1.0-dev.
|
|
4
|
+
"version": "0.1.0-dev.72",
|
|
5
5
|
"description": "KOS DDK plugin authoring (kos-ddk) MCP server: plugin projects, extension-point contributions and overrides of the standard ones.",
|
|
6
6
|
"license": "MIT"
|
|
7
7
|
}
|
|
@@ -19219,14 +19219,21 @@
|
|
|
19219
19219
|
"name": "ddk-index",
|
|
19220
19220
|
"title": "KOS DDK reference index",
|
|
19221
19221
|
"description": "Start here: the DDK extension points, component libraries and design system, and which tool or resource covers each.",
|
|
19222
|
-
"body": "# KOS DDK reference\n\nA DDK plugin contributes to extension points in its `.kos.json` and renders DDK components inside them. Plugins compose components; the design tokens belong to the DDK app and its themes.\n\n## Extension points\n\n- ddk://extension-point/ddk.cui — CUI (Consumer User Interface), `contributes.cui`\n- ddk://extension-point/ddk.dashboard.detail — Dashboard Detail, `contributes.dashboardDetail`\n- ddk://extension-point/ddk.dashboard.macro-summary — Dashboard Macro Summary, `contributes.dashboardMacroSummary`\n- ddk://extension-point/ddk.dashboard.pump-detail — Dashboard Pump Detail, `contributes.dashboardPumpDetail`\n- ddk://extension-point/ddk.dashboard.pump-summary — Dashboard Pump Summary, `contributes.dashboardPumpSummary`\n- ddk://extension-point/ddk.dashboard.summary — Dashboard Summary, `contributes.dashboardSummary`\n- ddk://extension-point/ddk.nav.view — Navigation Views, `contributes.navViews`\n- ddk://extension-point/ddk.ncui.utilities — Utilities, `contributes.utilities`\n- ddk://extension-point/ddk.setup — Setup Steps, `contributes.setupStep`\n- ddk://extension-point/ddk.trouble.action — Trouble Actions, `contributes.troubleActions`\n\n## Components\n\n- `@kosdev-code/kos-ddk-components`: 161 components and styled parts\n- `@kosdev-code/kos-ddk-model-components`: 89 components and styled parts\n\nlist_ddk_components finds them; describe_ddk_component gives one's props, the components and hooks it uses, and every token it reads.\n\n## Design system\n\n- ddk://design/base — DDK DESIGN.md\n- ddk://design/flex-eu — DDK Flex EU DESIGN.md\n- ddk://design/compact — DDK Compact DESIGN.md\n\nChange tokens only to create a new component (component tokens) or a theme (semantic tokens).\n\n## Guides\n\n- ddk://guide/ddk-dev — Testing plugins against a running DDK\n- ddk://guide/getting-started — Getting started with the DDK CLI\n- ddk://guide/storybook — Developing DDK contributions in Storybook\n- ddk://guide/descriptor-project — NCUI descriptor projects\n\nfind_ddk_capability maps a need to the extension point, the component and the tool."
|
|
19222
|
+
"body": "# KOS DDK reference\n\nA DDK plugin contributes to extension points in its `.kos.json` and renders DDK components inside them. Plugins compose components; the design tokens belong to the DDK app and its themes.\n\n## Extension points\n\n- ddk://extension-point/ddk.cui — CUI (Consumer User Interface), `contributes.cui`\n- ddk://extension-point/ddk.dashboard.detail — Dashboard Detail, `contributes.dashboardDetail`\n- ddk://extension-point/ddk.dashboard.macro-summary — Dashboard Macro Summary, `contributes.dashboardMacroSummary`\n- ddk://extension-point/ddk.dashboard.pump-detail — Dashboard Pump Detail, `contributes.dashboardPumpDetail`\n- ddk://extension-point/ddk.dashboard.pump-summary — Dashboard Pump Summary, `contributes.dashboardPumpSummary`\n- ddk://extension-point/ddk.dashboard.summary — Dashboard Summary, `contributes.dashboardSummary`\n- ddk://extension-point/ddk.nav.view — Navigation Views, `contributes.navViews`\n- ddk://extension-point/ddk.ncui.utilities — Utilities, `contributes.utilities`\n- ddk://extension-point/ddk.setup — Setup Steps, `contributes.setupStep`\n- ddk://extension-point/ddk.trouble.action — Trouble Actions, `contributes.troubleActions`\n\n## Components\n\n- `@kosdev-code/kos-ddk-components`: 161 components and styled parts\n- `@kosdev-code/kos-ddk-model-components`: 89 components and styled parts\n\nlist_ddk_components finds them; describe_ddk_component gives one's props, the components and hooks it uses, and every token it reads.\n\n## Design system\n\n- ddk://design/base — DDK DESIGN.md\n- ddk://design/flex-eu — DDK Flex EU DESIGN.md\n- ddk://design/compact — DDK Compact DESIGN.md\n\nChange tokens only to create a new component (component tokens) or a theme (semantic tokens).\n\n## Guides\n\n- ddk://guide/config-property-cards — Configuration property cards\n- ddk://guide/ddk-dev — Testing plugins against a running DDK\n- ddk://guide/getting-started — Getting started with the DDK CLI\n- ddk://guide/storybook — Developing DDK contributions in Storybook\n- ddk://guide/descriptor-project — NCUI descriptor projects\n\nfind_ddk_capability maps a need to the extension point, the component and the tool."
|
|
19223
|
+
},
|
|
19224
|
+
{
|
|
19225
|
+
"uri": "ddk://guide/config-property-cards",
|
|
19226
|
+
"name": "ddk-guide-config-property-cards",
|
|
19227
|
+
"title": "Configuration property cards",
|
|
19228
|
+
"description": "The ConfigProp* cards in kos-ddk-model-components that show and edit a KosConfigProperty, ConfigPropertyInput choosing a card from the schema type, and when cards write (immediately, or batched with StagedChangesProvider).",
|
|
19229
|
+
"body": "# Configuration property cards\n\n`@kosdev-code/kos-ddk-model-components` has one card per kind of configuration value.\nEach takes a `configProperty` (a `KosConfigProperty`), reads its value with\n`useConfigProperty`, and writes it back with `configProperty.updateProperty`.\n\n| Card | Property | Renders |\n| ---- | -------- | ------- |\n| `ConfigPropToggleCard` | boolean | a toggle, Enabled / Disabled |\n| `ConfigPropSwitchCard` | string | a segmented switch (`SwitchCard`) over the `options` you pass |\n| `ConfigPropPickerCard` | enum, or a property with options | a picker (`PickerCard`) of the property's options |\n| `ConfigPropInputCard` | string or number | a text input with the property's unit; `displayOptions` `min`/`max` validate it |\n| `ConfigPropInputRangeCard` | int or double | a number input within its range |\n| `ConfigPropTimePickerCard` | a time of day, in seconds | a time picker |\n| `ConfigPropInfoCard` | string | the value, read-only |\n| `ConfigPropSingleInputEnableCard` | any, plus a boolean | one input that a toggle (`enabledConfigProperty`) enables |\n| `ConfigPropMultiInputEnableCard` | several, plus a boolean | several inputs behind one enabling toggle |\n\nThe cards take the props of the DDK card they wrap (`label`, `float`, `collapse` and so\non). Lay them out in a `TabContainer`, with a `SettingsSubheading` per group.\n\n## Letting the schema choose: ConfigPropertyInput\n\n`ConfigPropertyInput` renders the card for the property's `schemaType`: boolean → toggle,\nint and double → input range, String → input, enum → picker. Without a `label` it\ntranslates the property id in the `config-properties` namespace. In compact mode the input\nand picker cards take the compact style. Pass `factory` to map types to other cards.\n\n## When a card writes\n\nEach card writes its property as soon as it changes.\n\nFor an interaction whose edits must be applied together, wrap the page in\n`StagedChangesProvider` (or `withStagedChanges`). Cards that support staging then keep\nthe new value instead of writing it; `useStagedChanges()` gives `saveChanges()` to write\nevery staged value and `clearStagedChanges()` to drop them. `ConfigPropToggleCard` and\n`ConfigPropTimePickerCard` stage; the other cards write straight away even inside the\nprovider."
|
|
19223
19230
|
},
|
|
19224
19231
|
{
|
|
19225
19232
|
"uri": "ddk://guide/ddk-dev",
|
|
19226
19233
|
"name": "ddk-guide-ddk-dev",
|
|
19227
19234
|
"title": "Testing plugins against a running DDK",
|
|
19228
19235
|
"description": "Serving DDK plugin projects with kosui ddk:dev for a running device or simulator to load with ?pluginDevServers=, choosing plugins and scenarios.",
|
|
19229
|
-
"body": "# Testing plugins against a running DDK\n\n`ddk:dev` starts the dev server of each DDK plugin project and prints the URL that loads\nthem into a running DDK, without access to the DDK host source.\n\n```sh\nkosui ddk:dev --device http://192.168.1.50:8081\nkosui ddk:dev --plugins my-plugin --device http://192.168.1.50:8081\nkosui ddk:dev --scenario compact --device http://192.168.1.50:8081\n```\n\nWithout `--plugins` or `--scenario` it starts every DDK plugin project. `--plugins`\ntakes project names or aliases; `--scenario` names a set in the workspace `.kos.json`:\n\n```json\n{\n \"development\": {\n \"ddkScenarios\": {\n \"standard\": [\"kos-ddk-standard-plugin\", \"beverage-pour\"],\n \"compact\": [\"kos-ddk-compact-plugin\", \"beverage-pour\"]\n }\n }\n}\n```\n\nThe device loads the plugins with `?pluginDevServers=`; an override wins over the\nstandard contribution only when the device's DDK resolves its slots by rank.\n\n## The URL it prints\n\n`--device` is the URL of the DDK UI on the device or simulator, either its origin or the\npage itself. Given the origin, the printed URL opens the NCUI page,\n`/app/kosdev.ddk/ncui/index.html`, which is where devices and the simulator serve it. The\nprinted URL adds `?pluginDevServers=` with one `http://<address>:<port>` per plugin, from\nthe `port` of its `serve` target. The address is `localhost` when the device is local and\nthe machine's LAN IPv4 address otherwise, so a device on the network can reach the dev\nservers. Without `--device` it prints a `<device-url>` template.\n\nEvery plugin needs `options.port` on its `serve` target; `ddk:dev` refuses a plugin\nwithout one."
|
|
19236
|
+
"body": "# Testing plugins against a running DDK\n\n`ddk:dev` starts the dev server of each DDK plugin project and prints the URL that loads\nthem into a running DDK, without access to the DDK host source.\n\n```sh\nkosui ddk:dev --device http://192.168.1.50:8081\nkosui ddk:dev --plugins my-plugin --device http://192.168.1.50:8081\nkosui ddk:dev --scenario compact --device http://192.168.1.50:8081\n```\n\nWithout `--plugins` or `--scenario` it starts every DDK plugin project. `--plugins`\ntakes project names or aliases; `--scenario` names a set in the workspace `.kos.json`:\n\n```json\n{\n \"development\": {\n \"ddkScenarios\": {\n \"standard\": [\"kos-ddk-standard-plugin\", \"beverage-pour\"],\n \"compact\": [\"kos-ddk-compact-plugin\", \"beverage-pour\"]\n }\n }\n}\n```\n\nThe device loads the plugins with `?pluginDevServers=`; an override wins over the\nstandard contribution only when the device's DDK resolves its slots by rank.\n\n## The URL it prints\n\n`--device` is the URL of the DDK UI on the device or simulator, either its origin or the\npage itself. Given the origin, the printed URL opens the NCUI page,\n`/app/kosdev.ddk/ncui/index.html`, which is where devices and the simulator serve it. The\nprinted URL adds `?pluginDevServers=` with one `http://<address>:<port>` per plugin, from\nthe `port` of its `serve` target. The address is `localhost` when the device is local and\nthe machine's LAN IPv4 address otherwise, so a device on the network can reach the dev\nservers. Without `--device` it prints a `<device-url>` template.\n\nEvery plugin needs `options.port` on its `serve` target; `ddk:dev` refuses a plugin\nwithout one.\n\n## Translations\n\nThe DDK app serves the translation namespaces of the plugins in `?pluginDevServers=`\nfrom their dev servers, which serve the plugin's `src/assets/locales` at\n`/assets/locales/<locale>/<namespace>.json`. Each contribution command adds its keys to\n`src/assets/locales/en/<plugin>.json`, so labels show before the plugin's KAB is\ninstalled. Every other namespace still comes from the device.\n\nA DDK app without this lists a plugin's namespace only once its KAB is installed, so its\nlabels show as their keys (`<plugin>.<name>.utility.title`) and the console warns\n`namespace <plugin> not found in descriptor`."
|
|
19230
19237
|
},
|
|
19231
19238
|
{
|
|
19232
19239
|
"uri": "ddk://guide/getting-started",
|
|
@@ -27,7 +27,8 @@ component content. Never hand-edit the contributions or experiences the tools wr
|
|
|
27
27
|
|
|
28
28
|
3. **The extension point.** Read `ddk://extension-point/{id}`: its contribution fields,
|
|
29
29
|
the props your component receives and the standard contributions. A Settings tab
|
|
30
|
-
is a navigation view: `add_nav_view` with a `settings.<name>` descriptor.
|
|
30
|
+
is a navigation view: `add_nav_view` with a `settings.<name>` descriptor. A page that
|
|
31
|
+
edits device configuration (most Settings tabs) follows the `ddk-config-page` skill.
|
|
31
32
|
|
|
32
33
|
4. **Replacing a standard contribution.** `list_ddk_contributions` lists the ones an
|
|
33
34
|
override can replace. Pass the id as `override`: the tool takes its slot and gives
|
|
@@ -59,7 +60,17 @@ component content. Never hand-edit the contributions or experiences the tools wr
|
|
|
59
60
|
|
|
60
61
|
8. **Develop it.** In Storybook with the `ddk-storybook` skill. Against a running device
|
|
61
62
|
or simulator with `kosui ddk:dev` (`ddk://guide/ddk-dev`); that is where an override
|
|
62
|
-
is seen replacing the standard contribution.
|
|
63
|
+
is seen replacing the standard contribution. In `ddk:dev`:
|
|
64
|
+
- Serve the descriptor project before opening the URL, unless its KAB is installed:
|
|
65
|
+
`kosui fixtures serve` in the workspace, and add
|
|
66
|
+
`&kosMock=on&kosFixtureServer=&kosSetup=<descriptor-project>` to the printed URL.
|
|
67
|
+
A new slot shows only once the descriptor lists it, and so does an override of a
|
|
68
|
+
slot only the descriptor project adds (`carbTank` with `carb`).
|
|
69
|
+
- Log in with a role the slot lists: Utilities and Settings are technician-only in
|
|
70
|
+
the standard descriptor.
|
|
71
|
+
- Show pump cards and pump details on a holder with no active troubles; a holder's
|
|
72
|
+
troubles take the place of its card body and detail. Storybook's container picks a
|
|
73
|
+
holder with the `dashboardKey`.
|
|
63
74
|
|
|
64
75
|
9. **Validate.** `validate_ddk_plugin` checks the fields against each point's schema,
|
|
65
76
|
ranks, experiences and their component files, overrides that do not win and tokens
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ddk-config-page
|
|
3
|
+
description: >-
|
|
4
|
+
Build a DDK Settings tab or any DDK page that shows or edits device configuration:
|
|
5
|
+
model the configuration (SettingsModel, the plugin's own @kosConfigProperty fields,
|
|
6
|
+
one model per repeated entry such as cup sizes with prop keys, or a whole
|
|
7
|
+
@kosConfigBean for batched edits), hand the model to the page, and render the
|
|
8
|
+
ConfigProp* cards. Use when asked about DDK configuration input components, config
|
|
9
|
+
property cards, cup sizes, or a page that changes dispenser settings.
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Build a DDK page on configuration properties
|
|
13
|
+
|
|
14
|
+
The page renders configuration that lives on a model; the model binds it to the device.
|
|
15
|
+
The cards are described in `ddk://guide/config-property-cards`.
|
|
16
|
+
|
|
17
|
+
## Steps
|
|
18
|
+
|
|
19
|
+
1. **Contribute the page.** A Settings tab is a navigation view: `add_nav_view` with a
|
|
20
|
+
`settings.<name>` descriptor (build-ddk-plugin skill).
|
|
21
|
+
|
|
22
|
+
2. **Choose the mode.**
|
|
23
|
+
- **Config properties** (the usual case): the model has one `@kosConfigProperty` per
|
|
24
|
+
value. Each is a typed `KosConfigProperty` with unit conversion, formatting and
|
|
25
|
+
`options`, and each card writes its own property.
|
|
26
|
+
- **A config bean**: the model holds the whole bean at a path with `@kosConfigBean`
|
|
27
|
+
(`kos://decorator/kosConfigBean`): `values`, the schema, and `updateProperty(key,
|
|
28
|
+
value)`, which posts the whole bean. Use it when the page edits a set of values and
|
|
29
|
+
applies them together, or walks the schema. No unit conversion.
|
|
30
|
+
|
|
31
|
+
3. **Model the configuration.**
|
|
32
|
+
- DDK settings (date and time formats, water and beverage visibility) are already on
|
|
33
|
+
`SettingsModel`.
|
|
34
|
+
- Your own values: find the config path and attribute on a live device with the
|
|
35
|
+
kos-device tools, then add each with `add_config_property` (build-kos-model skill).
|
|
36
|
+
Never hand-write the decorator.
|
|
37
|
+
- **Repeated entries** (cup sizes and the like: `cups.0.*` … `cups.4.*` in one bean):
|
|
38
|
+
one model type whose attributes carry a prop key, and a container that creates an
|
|
39
|
+
instance per entry (`kos://guide/prop-keys`):
|
|
40
|
+
|
|
41
|
+
```typescript
|
|
42
|
+
const PROP_INDEX = createPropKey<CupModel>("index");
|
|
43
|
+
|
|
44
|
+
@kosConfigProperty({ path: PATH, attribute: `cups.${PROP_INDEX}.volume` })
|
|
45
|
+
volume!: KosConfigProperty<number>;
|
|
46
|
+
|
|
47
|
+
constructor(modelId: string, options: CupOptions) {
|
|
48
|
+
this.id = modelId;
|
|
49
|
+
this.index = options.index.toString(); // set before the properties resolve
|
|
50
|
+
}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
The container (`add_container_support`, singleton) builds the instances in `init`
|
|
54
|
+
(`Cup.instance(id).options({ index }).build()`, then `addModel`), registers `Cup`
|
|
55
|
+
with `addRelatedModel`, and adds the views the UI needs (enabled cups sorted by
|
|
56
|
+
volume, the largest cup).
|
|
57
|
+
- A bean: add `@kosConfigBean` by hand; no codegen tool writes it.
|
|
58
|
+
|
|
59
|
+
4. **Give the page the model.** Wrap it in a `with…` higher-order component or call a
|
|
60
|
+
`use…` hook that loads the model: `withSettings` from kos-ddk-model-components for
|
|
61
|
+
`SettingsModel`, and the same pair for your own model (`withCupContainer` /
|
|
62
|
+
`useCupContainer`).
|
|
63
|
+
|
|
64
|
+
5. **Render it.** One card per property (`ddk://guide/config-property-cards`), or
|
|
65
|
+
`ConfigPropertyInput` to let the schema choose. For repeated entries, one card group
|
|
66
|
+
per instance:
|
|
67
|
+
|
|
68
|
+
```tsx
|
|
69
|
+
const { model: cupContainer } = useCupContainer();
|
|
70
|
+
return cupContainer?.allCups.map((cup) => (
|
|
71
|
+
<Card key={cup.id}>
|
|
72
|
+
<ConfigPropInputCard configProperty={cup.name} label={t("portion")} />
|
|
73
|
+
<ConfigPropInputCard configProperty={cup.volume} label={t("portion-size")} />
|
|
74
|
+
<ConfigPropToggleCard configProperty={cup.enabled} />
|
|
75
|
+
</Card>
|
|
76
|
+
));
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
For a bean, build the form from `values` and `getSchemaForProperty(key)`, keep the
|
|
80
|
+
edits in the page until Save, then write them with `updateProperty`.
|
|
81
|
+
|
|
82
|
+
6. **Decide when edits are written.** Cards write as each value changes. To apply a
|
|
83
|
+
page's edits together, wrap it in `StagedChangesProvider` and call `saveChanges()`
|
|
84
|
+
from its Save action; only the toggle and time-picker cards stage
|
|
85
|
+
(`ddk://guide/config-property-cards`).
|
|
86
|
+
|
|
87
|
+
7. **Develop and check it.** In Storybook the page reads and writes the simulator's real
|
|
88
|
+
configuration (ddk-storybook skill). In `kosui ddk:dev`, log in as technician: Settings
|
|
89
|
+
is technician-only in the standard descriptor.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import styled from '@emotion/styled';
|
|
2
2
|
import {
|
|
3
|
-
<% if (layout !== "fullscreen") { -%>
|
|
3
|
+
<% if (locals.layout !== "fullscreen") { -%>
|
|
4
4
|
Button,
|
|
5
5
|
Content,
|
|
6
6
|
Footer,
|
|
@@ -29,7 +29,7 @@ const <%= namePascalCase %>Container = styled.section`
|
|
|
29
29
|
width: 100%;
|
|
30
30
|
`;
|
|
31
31
|
|
|
32
|
-
<% if (layout === "fullscreen") { -%>
|
|
32
|
+
<% if (locals.layout === "fullscreen") { -%>
|
|
33
33
|
/** A fullscreen utility: it covers the display and closes from its header. */
|
|
34
34
|
export const <%= namePascalCase %>: Experience = kosComponent(({ onComplete }) => {
|
|
35
35
|
const { t } = useKosTranslation('<%= appProject %>');
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
---
|
|
2
|
+
uri: ddk://guide/config-property-cards
|
|
3
|
+
name: ddk-guide-config-property-cards
|
|
4
|
+
title: Configuration property cards
|
|
5
|
+
description: The ConfigProp* cards in kos-ddk-model-components that show and edit a KosConfigProperty, ConfigPropertyInput choosing a card from the schema type, and when cards write (immediately, or batched with StagedChangesProvider).
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Configuration property cards
|
|
9
|
+
|
|
10
|
+
`@kosdev-code/kos-ddk-model-components` has one card per kind of configuration value.
|
|
11
|
+
Each takes a `configProperty` (a `KosConfigProperty`), reads its value with
|
|
12
|
+
`useConfigProperty`, and writes it back with `configProperty.updateProperty`.
|
|
13
|
+
|
|
14
|
+
| Card | Property | Renders |
|
|
15
|
+
| ---- | -------- | ------- |
|
|
16
|
+
| `ConfigPropToggleCard` | boolean | a toggle, Enabled / Disabled |
|
|
17
|
+
| `ConfigPropSwitchCard` | string | a segmented switch (`SwitchCard`) over the `options` you pass |
|
|
18
|
+
| `ConfigPropPickerCard` | enum, or a property with options | a picker (`PickerCard`) of the property's options |
|
|
19
|
+
| `ConfigPropInputCard` | string or number | a text input with the property's unit; `displayOptions` `min`/`max` validate it |
|
|
20
|
+
| `ConfigPropInputRangeCard` | int or double | a number input within its range |
|
|
21
|
+
| `ConfigPropTimePickerCard` | a time of day, in seconds | a time picker |
|
|
22
|
+
| `ConfigPropInfoCard` | string | the value, read-only |
|
|
23
|
+
| `ConfigPropSingleInputEnableCard` | any, plus a boolean | one input that a toggle (`enabledConfigProperty`) enables |
|
|
24
|
+
| `ConfigPropMultiInputEnableCard` | several, plus a boolean | several inputs behind one enabling toggle |
|
|
25
|
+
|
|
26
|
+
The cards take the props of the DDK card they wrap (`label`, `float`, `collapse` and so
|
|
27
|
+
on). Lay them out in a `TabContainer`, with a `SettingsSubheading` per group.
|
|
28
|
+
|
|
29
|
+
## Letting the schema choose: ConfigPropertyInput
|
|
30
|
+
|
|
31
|
+
`ConfigPropertyInput` renders the card for the property's `schemaType`: boolean → toggle,
|
|
32
|
+
int and double → input range, String → input, enum → picker. Without a `label` it
|
|
33
|
+
translates the property id in the `config-properties` namespace. In compact mode the input
|
|
34
|
+
and picker cards take the compact style. Pass `factory` to map types to other cards.
|
|
35
|
+
|
|
36
|
+
## When a card writes
|
|
37
|
+
|
|
38
|
+
Each card writes its property as soon as it changes.
|
|
39
|
+
|
|
40
|
+
For an interaction whose edits must be applied together, wrap the page in
|
|
41
|
+
`StagedChangesProvider` (or `withStagedChanges`). Cards that support staging then keep
|
|
42
|
+
the new value instead of writing it; `useStagedChanges()` gives `saveChanges()` to write
|
|
43
|
+
every staged value and `clearStagedChanges()` to drop them. `ConfigPropToggleCard` and
|
|
44
|
+
`ConfigPropTimePickerCard` stage; the other cards write straight away even inside the
|
|
45
|
+
provider.
|
package/guides/ddk-dev.md
CHANGED
|
@@ -45,3 +45,15 @@ servers. Without `--device` it prints a `<device-url>` template.
|
|
|
45
45
|
|
|
46
46
|
Every plugin needs `options.port` on its `serve` target; `ddk:dev` refuses a plugin
|
|
47
47
|
without one.
|
|
48
|
+
|
|
49
|
+
## Translations
|
|
50
|
+
|
|
51
|
+
The DDK app serves the translation namespaces of the plugins in `?pluginDevServers=`
|
|
52
|
+
from their dev servers, which serve the plugin's `src/assets/locales` at
|
|
53
|
+
`/assets/locales/<locale>/<namespace>.json`. Each contribution command adds its keys to
|
|
54
|
+
`src/assets/locales/en/<plugin>.json`, so labels show before the plugin's KAB is
|
|
55
|
+
installed. Every other namespace still comes from the device.
|
|
56
|
+
|
|
57
|
+
A DDK app without this lists a plugin's namespace only once its KAB is installed, so its
|
|
58
|
+
labels show as their keys (`<plugin>.<name>.utility.title`) and the console warns
|
|
59
|
+
`namespace <plugin> not found in descriptor`.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kosdev-code/kos-ddk-cli",
|
|
3
|
-
"version": "0.1.0-dev.
|
|
3
|
+
"version": "0.1.0-dev.72",
|
|
4
4
|
"description": "DDK commands for kosui: plugin projects and DDK extension-point contributions.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"kosui": {
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
},
|
|
28
28
|
"kos": {
|
|
29
29
|
"build": {
|
|
30
|
-
"gitHash": "
|
|
30
|
+
"gitHash": "7b6007fe34bf59d0ca34fd94b151869b4c29d5c6"
|
|
31
31
|
}
|
|
32
32
|
},
|
|
33
33
|
"publishConfig": {
|
package/reference/reference.json
CHANGED
|
@@ -19219,14 +19219,21 @@
|
|
|
19219
19219
|
"name": "ddk-index",
|
|
19220
19220
|
"title": "KOS DDK reference index",
|
|
19221
19221
|
"description": "Start here: the DDK extension points, component libraries and design system, and which tool or resource covers each.",
|
|
19222
|
-
"body": "# KOS DDK reference\n\nA DDK plugin contributes to extension points in its `.kos.json` and renders DDK components inside them. Plugins compose components; the design tokens belong to the DDK app and its themes.\n\n## Extension points\n\n- ddk://extension-point/ddk.cui — CUI (Consumer User Interface), `contributes.cui`\n- ddk://extension-point/ddk.dashboard.detail — Dashboard Detail, `contributes.dashboardDetail`\n- ddk://extension-point/ddk.dashboard.macro-summary — Dashboard Macro Summary, `contributes.dashboardMacroSummary`\n- ddk://extension-point/ddk.dashboard.pump-detail — Dashboard Pump Detail, `contributes.dashboardPumpDetail`\n- ddk://extension-point/ddk.dashboard.pump-summary — Dashboard Pump Summary, `contributes.dashboardPumpSummary`\n- ddk://extension-point/ddk.dashboard.summary — Dashboard Summary, `contributes.dashboardSummary`\n- ddk://extension-point/ddk.nav.view — Navigation Views, `contributes.navViews`\n- ddk://extension-point/ddk.ncui.utilities — Utilities, `contributes.utilities`\n- ddk://extension-point/ddk.setup — Setup Steps, `contributes.setupStep`\n- ddk://extension-point/ddk.trouble.action — Trouble Actions, `contributes.troubleActions`\n\n## Components\n\n- `@kosdev-code/kos-ddk-components`: 161 components and styled parts\n- `@kosdev-code/kos-ddk-model-components`: 89 components and styled parts\n\nlist_ddk_components finds them; describe_ddk_component gives one's props, the components and hooks it uses, and every token it reads.\n\n## Design system\n\n- ddk://design/base — DDK DESIGN.md\n- ddk://design/flex-eu — DDK Flex EU DESIGN.md\n- ddk://design/compact — DDK Compact DESIGN.md\n\nChange tokens only to create a new component (component tokens) or a theme (semantic tokens).\n\n## Guides\n\n- ddk://guide/ddk-dev — Testing plugins against a running DDK\n- ddk://guide/getting-started — Getting started with the DDK CLI\n- ddk://guide/storybook — Developing DDK contributions in Storybook\n- ddk://guide/descriptor-project — NCUI descriptor projects\n\nfind_ddk_capability maps a need to the extension point, the component and the tool."
|
|
19222
|
+
"body": "# KOS DDK reference\n\nA DDK plugin contributes to extension points in its `.kos.json` and renders DDK components inside them. Plugins compose components; the design tokens belong to the DDK app and its themes.\n\n## Extension points\n\n- ddk://extension-point/ddk.cui — CUI (Consumer User Interface), `contributes.cui`\n- ddk://extension-point/ddk.dashboard.detail — Dashboard Detail, `contributes.dashboardDetail`\n- ddk://extension-point/ddk.dashboard.macro-summary — Dashboard Macro Summary, `contributes.dashboardMacroSummary`\n- ddk://extension-point/ddk.dashboard.pump-detail — Dashboard Pump Detail, `contributes.dashboardPumpDetail`\n- ddk://extension-point/ddk.dashboard.pump-summary — Dashboard Pump Summary, `contributes.dashboardPumpSummary`\n- ddk://extension-point/ddk.dashboard.summary — Dashboard Summary, `contributes.dashboardSummary`\n- ddk://extension-point/ddk.nav.view — Navigation Views, `contributes.navViews`\n- ddk://extension-point/ddk.ncui.utilities — Utilities, `contributes.utilities`\n- ddk://extension-point/ddk.setup — Setup Steps, `contributes.setupStep`\n- ddk://extension-point/ddk.trouble.action — Trouble Actions, `contributes.troubleActions`\n\n## Components\n\n- `@kosdev-code/kos-ddk-components`: 161 components and styled parts\n- `@kosdev-code/kos-ddk-model-components`: 89 components and styled parts\n\nlist_ddk_components finds them; describe_ddk_component gives one's props, the components and hooks it uses, and every token it reads.\n\n## Design system\n\n- ddk://design/base — DDK DESIGN.md\n- ddk://design/flex-eu — DDK Flex EU DESIGN.md\n- ddk://design/compact — DDK Compact DESIGN.md\n\nChange tokens only to create a new component (component tokens) or a theme (semantic tokens).\n\n## Guides\n\n- ddk://guide/config-property-cards — Configuration property cards\n- ddk://guide/ddk-dev — Testing plugins against a running DDK\n- ddk://guide/getting-started — Getting started with the DDK CLI\n- ddk://guide/storybook — Developing DDK contributions in Storybook\n- ddk://guide/descriptor-project — NCUI descriptor projects\n\nfind_ddk_capability maps a need to the extension point, the component and the tool."
|
|
19223
|
+
},
|
|
19224
|
+
{
|
|
19225
|
+
"uri": "ddk://guide/config-property-cards",
|
|
19226
|
+
"name": "ddk-guide-config-property-cards",
|
|
19227
|
+
"title": "Configuration property cards",
|
|
19228
|
+
"description": "The ConfigProp* cards in kos-ddk-model-components that show and edit a KosConfigProperty, ConfigPropertyInput choosing a card from the schema type, and when cards write (immediately, or batched with StagedChangesProvider).",
|
|
19229
|
+
"body": "# Configuration property cards\n\n`@kosdev-code/kos-ddk-model-components` has one card per kind of configuration value.\nEach takes a `configProperty` (a `KosConfigProperty`), reads its value with\n`useConfigProperty`, and writes it back with `configProperty.updateProperty`.\n\n| Card | Property | Renders |\n| ---- | -------- | ------- |\n| `ConfigPropToggleCard` | boolean | a toggle, Enabled / Disabled |\n| `ConfigPropSwitchCard` | string | a segmented switch (`SwitchCard`) over the `options` you pass |\n| `ConfigPropPickerCard` | enum, or a property with options | a picker (`PickerCard`) of the property's options |\n| `ConfigPropInputCard` | string or number | a text input with the property's unit; `displayOptions` `min`/`max` validate it |\n| `ConfigPropInputRangeCard` | int or double | a number input within its range |\n| `ConfigPropTimePickerCard` | a time of day, in seconds | a time picker |\n| `ConfigPropInfoCard` | string | the value, read-only |\n| `ConfigPropSingleInputEnableCard` | any, plus a boolean | one input that a toggle (`enabledConfigProperty`) enables |\n| `ConfigPropMultiInputEnableCard` | several, plus a boolean | several inputs behind one enabling toggle |\n\nThe cards take the props of the DDK card they wrap (`label`, `float`, `collapse` and so\non). Lay them out in a `TabContainer`, with a `SettingsSubheading` per group.\n\n## Letting the schema choose: ConfigPropertyInput\n\n`ConfigPropertyInput` renders the card for the property's `schemaType`: boolean → toggle,\nint and double → input range, String → input, enum → picker. Without a `label` it\ntranslates the property id in the `config-properties` namespace. In compact mode the input\nand picker cards take the compact style. Pass `factory` to map types to other cards.\n\n## When a card writes\n\nEach card writes its property as soon as it changes.\n\nFor an interaction whose edits must be applied together, wrap the page in\n`StagedChangesProvider` (or `withStagedChanges`). Cards that support staging then keep\nthe new value instead of writing it; `useStagedChanges()` gives `saveChanges()` to write\nevery staged value and `clearStagedChanges()` to drop them. `ConfigPropToggleCard` and\n`ConfigPropTimePickerCard` stage; the other cards write straight away even inside the\nprovider."
|
|
19223
19230
|
},
|
|
19224
19231
|
{
|
|
19225
19232
|
"uri": "ddk://guide/ddk-dev",
|
|
19226
19233
|
"name": "ddk-guide-ddk-dev",
|
|
19227
19234
|
"title": "Testing plugins against a running DDK",
|
|
19228
19235
|
"description": "Serving DDK plugin projects with kosui ddk:dev for a running device or simulator to load with ?pluginDevServers=, choosing plugins and scenarios.",
|
|
19229
|
-
"body": "# Testing plugins against a running DDK\n\n`ddk:dev` starts the dev server of each DDK plugin project and prints the URL that loads\nthem into a running DDK, without access to the DDK host source.\n\n```sh\nkosui ddk:dev --device http://192.168.1.50:8081\nkosui ddk:dev --plugins my-plugin --device http://192.168.1.50:8081\nkosui ddk:dev --scenario compact --device http://192.168.1.50:8081\n```\n\nWithout `--plugins` or `--scenario` it starts every DDK plugin project. `--plugins`\ntakes project names or aliases; `--scenario` names a set in the workspace `.kos.json`:\n\n```json\n{\n \"development\": {\n \"ddkScenarios\": {\n \"standard\": [\"kos-ddk-standard-plugin\", \"beverage-pour\"],\n \"compact\": [\"kos-ddk-compact-plugin\", \"beverage-pour\"]\n }\n }\n}\n```\n\nThe device loads the plugins with `?pluginDevServers=`; an override wins over the\nstandard contribution only when the device's DDK resolves its slots by rank.\n\n## The URL it prints\n\n`--device` is the URL of the DDK UI on the device or simulator, either its origin or the\npage itself. Given the origin, the printed URL opens the NCUI page,\n`/app/kosdev.ddk/ncui/index.html`, which is where devices and the simulator serve it. The\nprinted URL adds `?pluginDevServers=` with one `http://<address>:<port>` per plugin, from\nthe `port` of its `serve` target. The address is `localhost` when the device is local and\nthe machine's LAN IPv4 address otherwise, so a device on the network can reach the dev\nservers. Without `--device` it prints a `<device-url>` template.\n\nEvery plugin needs `options.port` on its `serve` target; `ddk:dev` refuses a plugin\nwithout one."
|
|
19236
|
+
"body": "# Testing plugins against a running DDK\n\n`ddk:dev` starts the dev server of each DDK plugin project and prints the URL that loads\nthem into a running DDK, without access to the DDK host source.\n\n```sh\nkosui ddk:dev --device http://192.168.1.50:8081\nkosui ddk:dev --plugins my-plugin --device http://192.168.1.50:8081\nkosui ddk:dev --scenario compact --device http://192.168.1.50:8081\n```\n\nWithout `--plugins` or `--scenario` it starts every DDK plugin project. `--plugins`\ntakes project names or aliases; `--scenario` names a set in the workspace `.kos.json`:\n\n```json\n{\n \"development\": {\n \"ddkScenarios\": {\n \"standard\": [\"kos-ddk-standard-plugin\", \"beverage-pour\"],\n \"compact\": [\"kos-ddk-compact-plugin\", \"beverage-pour\"]\n }\n }\n}\n```\n\nThe device loads the plugins with `?pluginDevServers=`; an override wins over the\nstandard contribution only when the device's DDK resolves its slots by rank.\n\n## The URL it prints\n\n`--device` is the URL of the DDK UI on the device or simulator, either its origin or the\npage itself. Given the origin, the printed URL opens the NCUI page,\n`/app/kosdev.ddk/ncui/index.html`, which is where devices and the simulator serve it. The\nprinted URL adds `?pluginDevServers=` with one `http://<address>:<port>` per plugin, from\nthe `port` of its `serve` target. The address is `localhost` when the device is local and\nthe machine's LAN IPv4 address otherwise, so a device on the network can reach the dev\nservers. Without `--device` it prints a `<device-url>` template.\n\nEvery plugin needs `options.port` on its `serve` target; `ddk:dev` refuses a plugin\nwithout one.\n\n## Translations\n\nThe DDK app serves the translation namespaces of the plugins in `?pluginDevServers=`\nfrom their dev servers, which serve the plugin's `src/assets/locales` at\n`/assets/locales/<locale>/<namespace>.json`. Each contribution command adds its keys to\n`src/assets/locales/en/<plugin>.json`, so labels show before the plugin's KAB is\ninstalled. Every other namespace still comes from the device.\n\nA DDK app without this lists a plugin's namespace only once its KAB is installed, so its\nlabels show as their keys (`<plugin>.<name>.utility.title`) and the console warns\n`namespace <plugin> not found in descriptor`."
|
|
19230
19237
|
},
|
|
19231
19238
|
{
|
|
19232
19239
|
"uri": "ddk://guide/getting-started",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import styled from '@emotion/styled';
|
|
2
2
|
import {
|
|
3
|
-
<% if (layout !== "fullscreen") { -%>
|
|
3
|
+
<% if (locals.layout !== "fullscreen") { -%>
|
|
4
4
|
Button,
|
|
5
5
|
Content,
|
|
6
6
|
Footer,
|
|
@@ -29,7 +29,7 @@ const <%= namePascalCase %>Container = styled.section`
|
|
|
29
29
|
width: 100%;
|
|
30
30
|
`;
|
|
31
31
|
|
|
32
|
-
<% if (layout === "fullscreen") { -%>
|
|
32
|
+
<% if (locals.layout === "fullscreen") { -%>
|
|
33
33
|
/** A fullscreen utility: it covers the display and closes from its header. */
|
|
34
34
|
export const <%= namePascalCase %>: Experience = kosComponent(({ onComplete }) => {
|
|
35
35
|
const { t } = useKosTranslation('<%= appProject %>');
|