plggmatic 0.2.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +37 -0
- package/dist/Catalog/index.d.ts +17 -0
- package/dist/Catalog/index.d.ts.map +1 -0
- package/dist/Catalog/model/tool.d.ts +101 -0
- package/dist/Catalog/model/tool.d.ts.map +1 -0
- package/dist/Catalog/usecase/adapter.d.ts +81 -0
- package/dist/Catalog/usecase/adapter.d.ts.map +1 -0
- package/dist/Catalog/usecase/catalog.d.ts +43 -0
- package/dist/Catalog/usecase/catalog.d.ts.map +1 -0
- package/dist/Catalog/usecase/runFlow.d.ts +77 -0
- package/dist/Catalog/usecase/runFlow.d.ts.map +1 -0
- package/dist/Component/index.d.ts +30 -0
- package/dist/Component/index.d.ts.map +1 -0
- package/dist/Component/model/interaction.d.ts +41 -0
- package/dist/Component/model/interaction.d.ts.map +1 -0
- package/dist/Component/model/navItem.d.ts +16 -0
- package/dist/Component/model/navItem.d.ts.map +1 -0
- package/dist/Component/usecase/breadcrumb.d.ts +26 -0
- package/dist/Component/usecase/breadcrumb.d.ts.map +1 -0
- package/dist/Component/usecase/button.d.ts +27 -0
- package/dist/Component/usecase/button.d.ts.map +1 -0
- package/dist/Component/usecase/checkbox.d.ts +20 -0
- package/dist/Component/usecase/checkbox.d.ts.map +1 -0
- package/dist/Component/usecase/colHead.d.ts +28 -0
- package/dist/Component/usecase/colHead.d.ts.map +1 -0
- package/dist/Component/usecase/confirmDialog.d.ts +25 -0
- package/dist/Component/usecase/confirmDialog.d.ts.map +1 -0
- package/dist/Component/usecase/declaredForm.d.ts +89 -0
- package/dist/Component/usecase/declaredForm.d.ts.map +1 -0
- package/dist/Component/usecase/navTree.d.ts +21 -0
- package/dist/Component/usecase/navTree.d.ts.map +1 -0
- package/dist/Component/usecase/selectInput.d.ts +28 -0
- package/dist/Component/usecase/selectInput.d.ts.map +1 -0
- package/dist/Component/usecase/sidebarNav.d.ts +77 -0
- package/dist/Component/usecase/sidebarNav.d.ts.map +1 -0
- package/dist/Component/usecase/textArea.d.ts +22 -0
- package/dist/Component/usecase/textArea.d.ts.map +1 -0
- package/dist/Component/usecase/textInput.d.ts +23 -0
- package/dist/Component/usecase/textInput.d.ts.map +1 -0
- package/dist/Component/usecase/textLink.d.ts +26 -0
- package/dist/Component/usecase/textLink.d.ts.map +1 -0
- package/dist/Component/usecase/themeToggle.d.ts +75 -0
- package/dist/Component/usecase/themeToggle.d.ts.map +1 -0
- package/dist/Component/usecase/toast.d.ts +32 -0
- package/dist/Component/usecase/toast.d.ts.map +1 -0
- package/dist/Component/usecase/typography.d.ts +33 -0
- package/dist/Component/usecase/typography.d.ts.map +1 -0
- package/dist/Declare/model/Action.d.ts +91 -0
- package/dist/Declare/model/Action.d.ts.map +1 -0
- package/dist/Declare/model/Adapter.d.ts +107 -0
- package/dist/Declare/model/Adapter.d.ts.map +1 -0
- package/dist/Declare/model/Collection.d.ts +55 -0
- package/dist/Declare/model/Collection.d.ts.map +1 -0
- package/dist/Declare/model/Declaration.d.ts +27 -0
- package/dist/Declare/model/Declaration.d.ts.map +1 -0
- package/dist/Declare/model/Menu.d.ts +21 -0
- package/dist/Declare/model/Menu.d.ts.map +1 -0
- package/dist/Declare/model/Query.d.ts +56 -0
- package/dist/Declare/model/Query.d.ts.map +1 -0
- package/dist/Declare/model/Row.d.ts +129 -0
- package/dist/Declare/model/Row.d.ts.map +1 -0
- package/dist/Declare/model/Source.d.ts +83 -0
- package/dist/Declare/model/Source.d.ts.map +1 -0
- package/dist/Declare/usecase/apply.d.ts +23 -0
- package/dist/Declare/usecase/apply.d.ts.map +1 -0
- package/dist/Declare/usecase/project.d.ts +66 -0
- package/dist/Declare/usecase/project.d.ts.map +1 -0
- package/dist/Declare/usecase/reconcile.d.ts +63 -0
- package/dist/Declare/usecase/reconcile.d.ts.map +1 -0
- package/dist/Flow/model/forms.d.ts +45 -0
- package/dist/Flow/model/forms.d.ts.map +1 -0
- package/dist/Flow/model/run.d.ts +74 -0
- package/dist/Flow/model/run.d.ts.map +1 -0
- package/dist/Flow/model/script.d.ts +279 -0
- package/dist/Flow/model/script.d.ts.map +1 -0
- package/dist/Flow/usecase/interpret.d.ts +17 -0
- package/dist/Flow/usecase/interpret.d.ts.map +1 -0
- package/dist/Flow/usecase/read.d.ts +46 -0
- package/dist/Flow/usecase/read.d.ts.map +1 -0
- package/dist/Form/index.d.ts +14 -0
- package/dist/Form/index.d.ts.map +1 -0
- package/dist/Form/model/control.d.ts +9 -0
- package/dist/Form/model/control.d.ts.map +1 -0
- package/dist/Form/model/submission.d.ts +30 -0
- package/dist/Form/model/submission.d.ts.map +1 -0
- package/dist/Form/usecase/controlParts.d.ts +30 -0
- package/dist/Form/usecase/controlParts.d.ts.map +1 -0
- package/dist/Form/usecase/formView.d.ts +21 -0
- package/dist/Form/usecase/formView.d.ts.map +1 -0
- package/dist/Form/usecase/parseForm.d.ts +28 -0
- package/dist/Form/usecase/parseForm.d.ts.map +1 -0
- package/dist/Layout/index.d.ts +21 -0
- package/dist/Layout/index.d.ts.map +1 -0
- package/dist/Layout/model/geometry.d.ts +97 -0
- package/dist/Layout/model/geometry.d.ts.map +1 -0
- package/dist/Layout/model/pane.d.ts +15 -0
- package/dist/Layout/model/pane.d.ts.map +1 -0
- package/dist/Layout/model/reveal.d.ts +26 -0
- package/dist/Layout/model/reveal.d.ts.map +1 -0
- package/dist/Layout/usecase/combinators.d.ts +78 -0
- package/dist/Layout/usecase/combinators.d.ts.map +1 -0
- package/dist/Layout/usecase/preference.d.ts +27 -0
- package/dist/Layout/usecase/preference.d.ts.map +1 -0
- package/dist/Layout/usecase/revealColumn.d.ts +39 -0
- package/dist/Layout/usecase/revealColumn.d.ts.map +1 -0
- package/dist/Layout/usecase/workspace.d.ts +58 -0
- package/dist/Layout/usecase/workspace.d.ts.map +1 -0
- package/dist/Meta/model/classHooks.d.ts +141 -0
- package/dist/Meta/model/classHooks.d.ts.map +1 -0
- package/dist/Meta/model/identity.d.ts +16 -0
- package/dist/Meta/model/identity.d.ts.map +1 -0
- package/dist/Navigate/index.d.ts +19 -0
- package/dist/Navigate/index.d.ts.map +1 -0
- package/dist/Navigate/model/Composition.d.ts +50 -0
- package/dist/Navigate/model/Composition.d.ts.map +1 -0
- package/dist/Navigate/model/Trail.d.ts +84 -0
- package/dist/Navigate/model/Trail.d.ts.map +1 -0
- package/dist/Navigate/model/marker.d.ts +44 -0
- package/dist/Navigate/model/marker.d.ts.map +1 -0
- package/dist/Navigate/usecase/compositionUrl.d.ts +63 -0
- package/dist/Navigate/usecase/compositionUrl.d.ts.map +1 -0
- package/dist/Navigate/usecase/navigationScript.d.ts +16 -0
- package/dist/Navigate/usecase/navigationScript.d.ts.map +1 -0
- package/dist/Navigate/usecase/trailUrl.d.ts +61 -0
- package/dist/Navigate/usecase/trailUrl.d.ts.map +1 -0
- package/dist/Render/index.d.ts +18 -0
- package/dist/Render/index.d.ts.map +1 -0
- package/dist/Render/model/mode.d.ts +13 -0
- package/dist/Render/model/mode.d.ts.map +1 -0
- package/dist/Render/model/screen.d.ts +27 -0
- package/dist/Render/model/screen.d.ts.map +1 -0
- package/dist/Render/usecase/advanceColumns.d.ts +41 -0
- package/dist/Render/usecase/advanceColumns.d.ts.map +1 -0
- package/dist/Render/usecase/multiColumn.d.ts +52 -0
- package/dist/Render/usecase/multiColumn.d.ts.map +1 -0
- package/dist/Render/usecase/parts.d.ts +56 -0
- package/dist/Render/usecase/parts.d.ts.map +1 -0
- package/dist/Render/usecase/renderMode.d.ts +17 -0
- package/dist/Render/usecase/renderMode.d.ts.map +1 -0
- package/dist/Render/usecase/singleColumn.d.ts +20 -0
- package/dist/Render/usecase/singleColumn.d.ts.map +1 -0
- package/dist/Schedule/model/Model.d.ts +103 -0
- package/dist/Schedule/model/Model.d.ts.map +1 -0
- package/dist/Schedule/model/Msg.d.ts +131 -0
- package/dist/Schedule/model/Msg.d.ts.map +1 -0
- package/dist/Schedule/model/Scene.d.ts +190 -0
- package/dist/Schedule/model/Scene.d.ts.map +1 -0
- package/dist/Schedule/model/View.d.ts +54 -0
- package/dist/Schedule/model/View.d.ts.map +1 -0
- package/dist/Schedule/usecase/chain.d.ts +16 -0
- package/dist/Schedule/usecase/chain.d.ts.map +1 -0
- package/dist/Schedule/usecase/codec.d.ts +44 -0
- package/dist/Schedule/usecase/codec.d.ts.map +1 -0
- package/dist/Schedule/usecase/lower.d.ts +45 -0
- package/dist/Schedule/usecase/lower.d.ts.map +1 -0
- package/dist/Schedule/usecase/scene.d.ts +16 -0
- package/dist/Schedule/usecase/scene.d.ts.map +1 -0
- package/dist/Schedule/usecase/schedule.d.ts +72 -0
- package/dist/Schedule/usecase/schedule.d.ts.map +1 -0
- package/dist/Schedule/usecase/update.d.ts +39 -0
- package/dist/Schedule/usecase/update.d.ts.map +1 -0
- package/dist/Style/index.d.ts +34 -0
- package/dist/Style/index.d.ts.map +1 -0
- package/dist/Style/model/appearance.d.ts +23 -0
- package/dist/Style/model/appearance.d.ts.map +1 -0
- package/dist/Style/model/breakpoint.d.ts +43 -0
- package/dist/Style/model/breakpoint.d.ts.map +1 -0
- package/dist/Style/model/componentSlot.d.ts +35 -0
- package/dist/Style/model/componentSlot.d.ts.map +1 -0
- package/dist/Style/model/hexColor.d.ts +26 -0
- package/dist/Style/model/hexColor.d.ts.map +1 -0
- package/dist/Style/model/metric.d.ts +35 -0
- package/dist/Style/model/metric.d.ts.map +1 -0
- package/dist/Style/model/palette.d.ts +38 -0
- package/dist/Style/model/palette.d.ts.map +1 -0
- package/dist/Style/model/scheme.d.ts +26 -0
- package/dist/Style/model/scheme.d.ts.map +1 -0
- package/dist/Style/model/syntax.d.ts +54 -0
- package/dist/Style/model/syntax.d.ts.map +1 -0
- package/dist/Style/model/theme.d.ts +68 -0
- package/dist/Style/model/theme.d.ts.map +1 -0
- package/dist/Style/model/token.d.ts +142 -0
- package/dist/Style/model/token.d.ts.map +1 -0
- package/dist/Style/model/typography.d.ts +83 -0
- package/dist/Style/model/typography.d.ts.map +1 -0
- package/dist/Style/model/zIndex.d.ts +25 -0
- package/dist/Style/model/zIndex.d.ts.map +1 -0
- package/dist/Style/usecase/appearanceScript.d.ts +43 -0
- package/dist/Style/usecase/appearanceScript.d.ts.map +1 -0
- package/dist/Style/usecase/chromeCss.d.ts +41 -0
- package/dist/Style/usecase/chromeCss.d.ts.map +1 -0
- package/dist/Style/usecase/contrast.d.ts +3 -0
- package/dist/Style/usecase/contrast.d.ts.map +1 -0
- package/dist/Style/usecase/metricCss.d.ts +17 -0
- package/dist/Style/usecase/metricCss.d.ts.map +1 -0
- package/dist/Style/usecase/reducedMotion.d.ts +20 -0
- package/dist/Style/usecase/reducedMotion.d.ts.map +1 -0
- package/dist/Style/usecase/runwayCss.d.ts +50 -0
- package/dist/Style/usecase/runwayCss.d.ts.map +1 -0
- package/dist/Style/usecase/schemeCss.d.ts +25 -0
- package/dist/Style/usecase/schemeCss.d.ts.map +1 -0
- package/dist/Style/usecase/slotCss.d.ts +73 -0
- package/dist/Style/usecase/slotCss.d.ts.map +1 -0
- package/dist/Style/usecase/syntaxCss.d.ts +14 -0
- package/dist/Style/usecase/syntaxCss.d.ts.map +1 -0
- package/dist/Style/usecase/utilities.d.ts +98 -0
- package/dist/Style/usecase/utilities.d.ts.map +1 -0
- package/dist/Style/usecase/workspaceCss.d.ts +48 -0
- package/dist/Style/usecase/workspaceCss.d.ts.map +1 -0
- package/dist/brand.d.ts +29 -0
- package/dist/brand.d.ts.map +1 -0
- package/dist/columnsEntry.d.ts +27 -0
- package/dist/columnsEntry.d.ts.map +1 -0
- package/dist/columnsEntry.es.js +452 -0
- package/dist/index.d.ts +63 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.es.js +6022 -0
- package/dist/styleEntry.d.ts +34 -0
- package/dist/styleEntry.d.ts.map +1 -0
- package/dist/styleEntry.es.js +1615 -0
- package/package.json +15 -8
package/README.md
CHANGED
|
@@ -114,6 +114,43 @@ in [`packages/plggmatic-example/`](../plggmatic-example/) (`src/declaration.ts`
|
|
|
114
114
|
the design record at
|
|
115
115
|
[`.workaholic/specs/20260704-plggmatic-scheduler-design.md`](../../.workaholic/specs/20260704-plggmatic-scheduler-design.md).
|
|
116
116
|
|
|
117
|
+
## The workspace: a pinned panel, a menu, a strip walked by a trail
|
|
118
|
+
|
|
119
|
+
What corpd, coop-planner and this package's own reference each wrote by hand
|
|
120
|
+
is one capability here. A product supplies its records and what each column
|
|
121
|
+
offers; the rest is the framework's.
|
|
122
|
+
|
|
123
|
+
- **Trail** (`Navigate`): `resolveTrail(resolver)(trail)` walks the steps
|
|
124
|
+
through the product's resolver and stops at the first step a column does
|
|
125
|
+
not offer, so a stale address folds to the deepest state it still names.
|
|
126
|
+
`foldTrail`, `stepFrom` and `restep` are the only ways a trail changes. The
|
|
127
|
+
address is `?x=<step>.<step>.…` (`decodeTrail`, `encodeTrail`,
|
|
128
|
+
`trailQuery`), spelled as corpd spells it; a step's meaning stays the
|
|
129
|
+
product's (`StepCodec`).
|
|
130
|
+
- **Geometry** (`Layout`): `stripGeometry(stripMetrics)(viewport, scroll,
|
|
131
|
+
menu)` gives the menu, column, pinned-panel and seam widths; `stripStyle`
|
|
132
|
+
writes them as custom properties (`stripVar`).
|
|
133
|
+
- **Frame**: `workspace` / `pinnedPanel` / `browser` / `menuColumn` /
|
|
134
|
+
`widthColumn("fit" | "wide" | "read")`, laid out by
|
|
135
|
+
`workspaceCss(theme)(workspaceOptions)` — the menu folds to a rail under
|
|
136
|
+
`menuCompactAttr`, and below `sm` the strip snaps one column per swipe.
|
|
137
|
+
- **Reveal**: `revealTarget` decides where a column comes to rest;
|
|
138
|
+
`revealColumn(strip, column, options)` glides there and yields to the
|
|
139
|
+
reader's first touch, wheel or key.
|
|
140
|
+
- **Sidebar**: `sidebarNav` with `sidebarNavCss` — ruled rows in titled
|
|
141
|
+
groups, the current row inverted, optional numbering and toggle groups.
|
|
142
|
+
- **Preference**: `readPreference` / `savePreference` remember a yes/no (the
|
|
143
|
+
rail) and read as "no" when storage refuses.
|
|
144
|
+
|
|
145
|
+
`packages/plggmatic-example` demo 4 (`demo4.html`) runs all of it together.
|
|
146
|
+
|
|
147
|
+
A product that already draws its own columns takes the logic alone from
|
|
148
|
+
`plggmatic/columns` — the trail and its address, the geometry, the reveal and
|
|
149
|
+
the preference, about 21 KiB, reaching only `plgg`. The package root gathers
|
|
150
|
+
the whole framework into one file, which a bundler that inlines dependencies
|
|
151
|
+
whole would carry into the page (measured on corpd: +490 KiB per entry from
|
|
152
|
+
the root, +27 KiB from `plggmatic/columns`).
|
|
153
|
+
|
|
117
154
|
## Palette override & scheme persistence
|
|
118
155
|
|
|
119
156
|
The color system is a closed role×variant matrix with a **monochrome default**.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The plggmatic Catalog module: the THIRD renderer of the
|
|
3
|
+
* settled {@link import("../Schedule/model/Scene").Scene}
|
|
4
|
+
* (beside the two HTML renderers) — a fold to the engine-
|
|
5
|
+
* owned {@link Tool} catalog (mission point 8, 2026-07-13),
|
|
6
|
+
* plus the fuel-bounded {@link runFlow} the standing
|
|
7
|
+
* `run_flow` tool composes, and a thin, disposable WebMCP
|
|
8
|
+
* adapter over the `navigator.modelContext` proposal. The
|
|
9
|
+
* catalog is transport-neutral DATA; the adapter is the
|
|
10
|
+
* only impure edge and is inert when the API is absent.
|
|
11
|
+
* An explicit named barrel (house style).
|
|
12
|
+
*/
|
|
13
|
+
export { type ToolInput, type ToolEffect, type Tool, nullary, textArg, enumArg, emit, runFlowEffect, tool, nullary$, textArg$, enumArg$, emit$, runFlow$, } from "./model/tool";
|
|
14
|
+
export { rowCap, catalogOf, } from "./usecase/catalog";
|
|
15
|
+
export { type FlowHost, type RunOutcome, flowHost, flowSchemaOf, runFlow, rejected, stalled, ran, rejected$, stalled$, ran$, } from "./usecase/runFlow";
|
|
16
|
+
export { type ToolDescriptor, type CatalogDiff, type ModelContext, descriptorOf, diffCatalog, syncCatalog, invokeWith, detectModelContext, inertModelContext, } from "./usecase/adapter";
|
|
17
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Catalog/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EACL,KAAK,SAAS,EACd,KAAK,UAAU,EACf,KAAK,IAAI,EACT,OAAO,EACP,OAAO,EACP,OAAO,EACP,IAAI,EACJ,aAAa,EACb,IAAI,EACJ,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,KAAK,EACL,QAAQ,GACT,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,MAAM,EACN,SAAS,GACV,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACL,KAAK,QAAQ,EACb,KAAK,UAAU,EACf,QAAQ,EACR,YAAY,EACZ,OAAO,EACP,QAAQ,EACR,OAAO,EACP,GAAG,EACH,SAAS,EACT,QAAQ,EACR,IAAI,GACL,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,YAAY,EACZ,WAAW,EACX,WAAW,EACX,UAAU,EACV,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,mCAAmC,CAAC"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { type SoftStr, type Box, type Icon } from "plgg";
|
|
2
|
+
import { type SchedulerMsg } from "../../Schedule/model/Msg";
|
|
3
|
+
/**
|
|
4
|
+
* A tool's argument schema — the CLOSED engine union the
|
|
5
|
+
* catalog fold emits, kept transport-neutral: the JSON-
|
|
6
|
+
* Schema serialization a WebMCP (or any) adapter needs is
|
|
7
|
+
* the ADAPTER's job, derived from this data. Every v1 tool
|
|
8
|
+
* takes at most one argument, so the union is a single
|
|
9
|
+
* argument slot:
|
|
10
|
+
*
|
|
11
|
+
* - `Nullary` — no argument (a create/row action, whose
|
|
12
|
+
* target is fixed by the scene position).
|
|
13
|
+
* - `TextArg` — one free-text argument (the keyword filter,
|
|
14
|
+
* the `run_flow` script source).
|
|
15
|
+
* - `EnumArg` — one argument drawn from a CLOSED option set
|
|
16
|
+
* (a row-selection id, a declared query choice, a menu
|
|
17
|
+
* section). An EMPTY option set withholds the choices
|
|
18
|
+
* deliberately (the row-cap guard) — never a free string.
|
|
19
|
+
*/
|
|
20
|
+
export type ToolInput = Icon<"Nullary"> | Box<"TextArg", Readonly<{
|
|
21
|
+
name: SoftStr;
|
|
22
|
+
description: SoftStr;
|
|
23
|
+
}>> | Box<"EnumArg", Readonly<{
|
|
24
|
+
name: SoftStr;
|
|
25
|
+
description: SoftStr;
|
|
26
|
+
options: ReadonlyArray<SoftStr>;
|
|
27
|
+
}>>;
|
|
28
|
+
/** A no-argument input. */
|
|
29
|
+
export declare const nullary: () => ToolInput;
|
|
30
|
+
/** A single free-text argument. */
|
|
31
|
+
export declare const textArg: (name: SoftStr, description: SoftStr) => ToolInput;
|
|
32
|
+
/** A single argument drawn from a closed option set. */
|
|
33
|
+
export declare const enumArg: (name: SoftStr, description: SoftStr, options: ReadonlyArray<SoftStr>) => ToolInput;
|
|
34
|
+
/** Matchers for folding a {@link ToolInput}. */
|
|
35
|
+
export declare const nullary$: () => {
|
|
36
|
+
__tag: "Nullary";
|
|
37
|
+
type: "tag";
|
|
38
|
+
body: undefined;
|
|
39
|
+
};
|
|
40
|
+
export declare const textArg$: () => {
|
|
41
|
+
__tag: "TextArg";
|
|
42
|
+
type: "tag";
|
|
43
|
+
body: undefined;
|
|
44
|
+
};
|
|
45
|
+
export declare const enumArg$: () => {
|
|
46
|
+
__tag: "EnumArg";
|
|
47
|
+
type: "tag";
|
|
48
|
+
body: undefined;
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* What invoking a tool does — a CLOSED union so the adapter
|
|
52
|
+
* folds it exhaustively:
|
|
53
|
+
*
|
|
54
|
+
* - `Emit` — lower the (validated) argument onto a single
|
|
55
|
+
* {@link SchedulerMsg} the host dispatches, EXACTLY as
|
|
56
|
+
* the human path does (the same `select`/`queryInput`/
|
|
57
|
+
* `requestAction`/`urlChanged` constructors the renderers
|
|
58
|
+
* wire). A `Nullary` tool ignores the passed `""`.
|
|
59
|
+
* - `RunFlow` — the standing `run_flow` tool: the argument
|
|
60
|
+
* is a flow DSL source the adapter reads, checks, and
|
|
61
|
+
* runs against the current scene (see `runFlow`).
|
|
62
|
+
*/
|
|
63
|
+
export type ToolEffect = Box<"Emit", (arg: SoftStr) => SchedulerMsg> | Icon<"RunFlow">;
|
|
64
|
+
/** Lowers the validated argument onto a scheduler message. */
|
|
65
|
+
export declare const emit: (lower: (arg: SoftStr) => SchedulerMsg) => ToolEffect;
|
|
66
|
+
/** The `run_flow` effect (the argument is a flow source). */
|
|
67
|
+
export declare const runFlowEffect: () => ToolEffect;
|
|
68
|
+
/** Matchers for folding a {@link ToolEffect}. */
|
|
69
|
+
export declare const emit$: () => {
|
|
70
|
+
__tag: "Emit";
|
|
71
|
+
type: "tag";
|
|
72
|
+
body: undefined;
|
|
73
|
+
};
|
|
74
|
+
export declare const runFlow$: () => {
|
|
75
|
+
__tag: "RunFlow";
|
|
76
|
+
type: "tag";
|
|
77
|
+
body: undefined;
|
|
78
|
+
};
|
|
79
|
+
/**
|
|
80
|
+
* One engine-owned tool: a name (the diff/registration
|
|
81
|
+
* key), a human/agent-readable description, its argument
|
|
82
|
+
* schema, and the lowering of a validated argument onto an
|
|
83
|
+
* effect. Pure DATA — a renderer-parallel fold from the
|
|
84
|
+
* settled {@link import("../../Schedule/model/Scene").Scene}
|
|
85
|
+
* produces the catalog; the WebMCP adapter is a thin,
|
|
86
|
+
* disposable skin over this.
|
|
87
|
+
*/
|
|
88
|
+
export type Tool = Readonly<{
|
|
89
|
+
name: SoftStr;
|
|
90
|
+
description: SoftStr;
|
|
91
|
+
input: ToolInput;
|
|
92
|
+
effect: ToolEffect;
|
|
93
|
+
}>;
|
|
94
|
+
/** Constructs a {@link Tool}. */
|
|
95
|
+
export declare const tool: (t: {
|
|
96
|
+
name: SoftStr;
|
|
97
|
+
description: SoftStr;
|
|
98
|
+
input: ToolInput;
|
|
99
|
+
effect: ToolEffect;
|
|
100
|
+
}) => Tool;
|
|
101
|
+
//# sourceMappingURL=tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool.d.ts","sourceRoot":"","sources":["../../../src/Catalog/model/tool.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,GAAG,EACR,KAAK,IAAI,EAIV,MAAM,MAAM,CAAC;AACd,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAEjE;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,MAAM,SAAS,GACjB,IAAI,CAAC,SAAS,CAAC,GACf,GAAG,CACD,SAAS,EACT,QAAQ,CAAC;IACP,IAAI,EAAE,OAAO,CAAC;IACd,WAAW,EAAE,OAAO,CAAC;CACtB,CAAC,CACH,GACD,GAAG,CACD,SAAS,EACT,QAAQ,CAAC;IACP,IAAI,EAAE,OAAO,CAAC;IACd,WAAW,EAAE,OAAO,CAAC;IACrB,OAAO,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;CACjC,CAAC,CACH,CAAC;AAEN,2BAA2B;AAC3B,eAAO,MAAM,OAAO,QAAO,SACV,CAAC;AAElB,mCAAmC;AACnC,eAAO,MAAM,OAAO,SACZ,OAAO,eACA,OAAO,KACnB,SACoC,CAAC;AAExC,wDAAwD;AACxD,eAAO,MAAM,OAAO,SACZ,OAAO,eACA,OAAO,WACX,aAAa,CAAC,OAAO,CAAC,KAC9B,SAC6C,CAAC;AAEjD,gDAAgD;AAChD,eAAO,MAAM,QAAQ;;;;CACC,CAAC;AACvB,eAAO,MAAM,QAAQ;;;;CACC,CAAC;AACvB,eAAO,MAAM,QAAQ;;;;CACC,CAAC;AAEvB;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,UAAU,GAClB,GAAG,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,YAAY,CAAC,GAC3C,IAAI,CAAC,SAAS,CAAC,CAAC;AAEpB,8DAA8D;AAC9D,eAAO,MAAM,IAAI,UACR,CAAC,GAAG,EAAE,OAAO,KAAK,YAAY,KACpC,UAAgC,CAAC;AAEpC,6DAA6D;AAC7D,eAAO,MAAM,aAAa,QAAO,UAChB,CAAC;AAElB,iDAAiD;AACjD,eAAO,MAAM,KAAK;;;;CAA0B,CAAC;AAC7C,eAAO,MAAM,QAAQ;;;;CACC,CAAC;AAEvB;;;;;;;;GAQG;AACH,MAAM,MAAM,IAAI,GAAG,QAAQ,CAAC;IAC1B,IAAI,EAAE,OAAO,CAAC;IACd,WAAW,EAAE,OAAO,CAAC;IACrB,KAAK,EAAE,SAAS,CAAC;IACjB,MAAM,EAAE,UAAU,CAAC;CACpB,CAAC,CAAC;AAEH,iCAAiC;AACjC,eAAO,MAAM,IAAI,MAAO;IACtB,IAAI,EAAE,OAAO,CAAC;IACd,WAAW,EAAE,OAAO,CAAC;IACrB,KAAK,EAAE,SAAS,CAAC;IACjB,MAAM,EAAE,UAAU,CAAC;CACpB,KAAG,IAAS,CAAC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { type SoftStr, type Option } from "plgg";
|
|
2
|
+
import { type SchedulerMsg } from "../../Schedule/model/Msg";
|
|
3
|
+
import { type Tool, type ToolInput } from "../model/tool";
|
|
4
|
+
/**
|
|
5
|
+
* The WebMCP adapter — a deliberately thin, disposable skin
|
|
6
|
+
* that projects the transport-neutral tool catalog onto an
|
|
7
|
+
* in-browser tool host (the `navigator.modelContext` moving
|
|
8
|
+
* proposal). All the durable logic is here as PURE data
|
|
9
|
+
* transforms over a small {@link ModelContext} seam; the
|
|
10
|
+
* feature-detected binding to the real browser API is the
|
|
11
|
+
* only impure edge, and it is inert when the API is absent
|
|
12
|
+
* (the engine is untouched). The transport (HTTP/MCP) stays
|
|
13
|
+
* deferred — this file is meant to be rewritten without
|
|
14
|
+
* touching the fold (sacrificial architecture).
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* The SERIALIZABLE identity of a tool the host registers —
|
|
18
|
+
* everything but the effect (which is invoked by name).
|
|
19
|
+
* Two settles that produce a byte-equal descriptor for a
|
|
20
|
+
* name need no re-registration (the diff key).
|
|
21
|
+
*/
|
|
22
|
+
export type ToolDescriptor = Readonly<{
|
|
23
|
+
name: SoftStr;
|
|
24
|
+
description: SoftStr;
|
|
25
|
+
input: ToolInput;
|
|
26
|
+
}>;
|
|
27
|
+
/** The descriptor of a tool (drops the effect). */
|
|
28
|
+
export declare const descriptorOf: (t: Tool) => ToolDescriptor;
|
|
29
|
+
/**
|
|
30
|
+
* The minimal difference between the registered descriptors
|
|
31
|
+
* and the next catalog: tools to add, names to drop, and
|
|
32
|
+
* tools whose descriptor CHANGED under a stable name
|
|
33
|
+
* (re-registered). Pure and order-preserving.
|
|
34
|
+
*/
|
|
35
|
+
export type CatalogDiff = Readonly<{
|
|
36
|
+
added: ReadonlyArray<Tool>;
|
|
37
|
+
removed: ReadonlyArray<SoftStr>;
|
|
38
|
+
changed: ReadonlyArray<Tool>;
|
|
39
|
+
}>;
|
|
40
|
+
/** Diffs the registered descriptors against the next catalog by name. */
|
|
41
|
+
export declare const diffCatalog: (prev: ReadonlyArray<ToolDescriptor>, next: ReadonlyArray<Tool>) => CatalogDiff;
|
|
42
|
+
/**
|
|
43
|
+
* The in-browser tool host the adapter drives — the subset
|
|
44
|
+
* of the `navigator.modelContext` proposal the catalog
|
|
45
|
+
* uses: register a descriptor with an invocation handler,
|
|
46
|
+
* and unregister by name.
|
|
47
|
+
*/
|
|
48
|
+
export type ModelContext = Readonly<{
|
|
49
|
+
registerTool: (descriptor: ToolDescriptor, invoke: (arg: SoftStr) => void) => void;
|
|
50
|
+
unregisterTool: (name: SoftStr) => void;
|
|
51
|
+
}>;
|
|
52
|
+
/** A no-op host: the adapter is inert (the API is absent). */
|
|
53
|
+
export declare const inertModelContext: ModelContext;
|
|
54
|
+
/**
|
|
55
|
+
* Builds a per-tool invocation handler from the host's
|
|
56
|
+
* dispatch and a flow runner: an `Emit` tool lowers its
|
|
57
|
+
* argument onto a message the host dispatches; the
|
|
58
|
+
* `run_flow` tool hands its argument (a script) to `run`.
|
|
59
|
+
*/
|
|
60
|
+
export declare const invokeWith: (dispatch: (msg: SchedulerMsg) => void, run: (source: SoftStr) => void) => (t: Tool) => (arg: SoftStr) => void;
|
|
61
|
+
/**
|
|
62
|
+
* Applies one catalog settle to the host: unregister
|
|
63
|
+
* dropped names, re-register changed tools (unregister then
|
|
64
|
+
* register), register new tools — the DIFF-MINIMAL update
|
|
65
|
+
* (unchanged tools are left alone). Returns the next
|
|
66
|
+
* descriptor set for the following settle. The `invokerOf`
|
|
67
|
+
* seam wires each registered tool's handler.
|
|
68
|
+
*/
|
|
69
|
+
export declare const syncCatalog: (host: ModelContext, invokerOf: (t: Tool) => (arg: SoftStr) => void, prev: ReadonlyArray<ToolDescriptor>, next: ReadonlyArray<Tool>) => ReadonlyArray<ToolDescriptor>;
|
|
70
|
+
/**
|
|
71
|
+
* Feature-detects `navigator.modelContext` (or any host
|
|
72
|
+
* candidate) WITHOUT an escape hatch: `None` when the
|
|
73
|
+
* object or its `registerTool`/`unregisterTool` methods are
|
|
74
|
+
* absent — the adapter then stays inert. When present, a
|
|
75
|
+
* {@link ModelContext} that FORWARDS to the detected
|
|
76
|
+
* methods (the descriptor + handler passed positionally);
|
|
77
|
+
* the exact payload shape is the disposable part that
|
|
78
|
+
* follows the proposal.
|
|
79
|
+
*/
|
|
80
|
+
export declare const detectModelContext: (candidate: unknown) => Option<ModelContext>;
|
|
81
|
+
//# sourceMappingURL=adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../src/Catalog/usecase/adapter.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,MAAM,EASZ,MAAM,MAAM,CAAC;AACd,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EACL,KAAK,IAAI,EACT,KAAK,SAAS,EAMf,MAAM,8BAA8B,CAAC;AAEtC;;;;;;;;;;;GAWG;AAEH;;;;;GAKG;AACH,MAAM,MAAM,cAAc,GAAG,QAAQ,CAAC;IACpC,IAAI,EAAE,OAAO,CAAC;IACd,WAAW,EAAE,OAAO,CAAC;IACrB,KAAK,EAAE,SAAS,CAAC;CAClB,CAAC,CAAC;AAEH,mDAAmD;AACnD,eAAO,MAAM,YAAY,MACpB,IAAI,KACN,cAID,CAAC;AAwBH;;;;;GAKG;AACH,MAAM,MAAM,WAAW,GAAG,QAAQ,CAAC;IACjC,KAAK,EAAE,aAAa,CAAC,IAAI,CAAC,CAAC;IAC3B,OAAO,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;IAChC,OAAO,EAAE,aAAa,CAAC,IAAI,CAAC,CAAC;CAC9B,CAAC,CAAC;AAEH,yEAAyE;AACzE,eAAO,MAAM,WAAW,SAChB,aAAa,CAAC,cAAc,CAAC,QAC7B,aAAa,CAAC,IAAI,CAAC,KACxB,WA8BD,CAAC;AAEH;;;;;GAKG;AACH,MAAM,MAAM,YAAY,GAAG,QAAQ,CAAC;IAClC,YAAY,EAAE,CACZ,UAAU,EAAE,cAAc,EAC1B,MAAM,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,IAAI,KAC3B,IAAI,CAAC;IACV,cAAc,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;CACzC,CAAC,CAAC;AAEH,8DAA8D;AAC9D,eAAO,MAAM,iBAAiB,EAAE,YAG/B,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,UAAU,aAET,CAAC,GAAG,EAAE,YAAY,KAAK,IAAI,OAChC,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,SAE5B,IAAI,WACF,OAAO,KAAG,IAQb,CAAC;AAEN;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW,SAChB,YAAY,aACP,CAAC,CAAC,EAAE,IAAI,KAAK,CAAC,GAAG,EAAE,OAAO,KAAK,IAAI,QACxC,aAAa,CAAC,cAAc,CAAC,QAC7B,aAAa,CAAC,IAAI,CAAC,KACxB,aAAa,CAAC,cAAc,CAmB9B,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,kBAAkB,cAClB,OAAO,KACjB,MAAM,CAAC,YAAY,CAwBrB,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { type Scene } from "../../Schedule/model/Scene";
|
|
2
|
+
import { type Tool } from "../model/tool";
|
|
3
|
+
/**
|
|
4
|
+
* The fold from the settled {@link Scene} to the engine-
|
|
5
|
+
* owned tool catalog — the THIRD renderer, beside the two
|
|
6
|
+
* HTML renderers: the SAME closed {@link Level} union, the
|
|
7
|
+
* SAME exhaustive `match`, so a new level kind is a compile
|
|
8
|
+
* error here too (mission point 8, 2026-07-13). A tool
|
|
9
|
+
* lowers its validated argument onto the very
|
|
10
|
+
* {@link SchedulerMsg} the renderers' human path dispatches
|
|
11
|
+
* (navigation is `select`/`urlChanged`; the query, actions,
|
|
12
|
+
* and flow are their own messages) — no parallel dispatch.
|
|
13
|
+
*
|
|
14
|
+
* What each level contributes:
|
|
15
|
+
* - `MenuLevel` → one `open_menu` tool whose section enum is
|
|
16
|
+
* the menu labels; choosing one navigates to that section.
|
|
17
|
+
* - `ListLevel` → a `select` tool (its id enum is the
|
|
18
|
+
* VISIBLE rows, capped), the keyword and declared-choice
|
|
19
|
+
* FILTER tools, and the create-action tools the legality
|
|
20
|
+
* projection already left on the scene. A still-loading
|
|
21
|
+
* list contributes NOTHING.
|
|
22
|
+
* - `BoardLevel` → one `jump` tool over the tiles that carry
|
|
23
|
+
* a jump; a loading board contributes nothing.
|
|
24
|
+
* - `DetailLevel` → the row-action tools (update/delete) the
|
|
25
|
+
* legality projection left, targeted at the loaded row.
|
|
26
|
+
* Plus the standing `run_flow` tool at every scene.
|
|
27
|
+
*/
|
|
28
|
+
/**
|
|
29
|
+
* The visible-row cap: a `select` tool enumerates at most
|
|
30
|
+
* this many row ids. Over the cap the choices are WITHHELD
|
|
31
|
+
* (an empty enum) and the description directs the agent to
|
|
32
|
+
* filter first — never a free-string id fallback.
|
|
33
|
+
*/
|
|
34
|
+
export declare const rowCap = 50;
|
|
35
|
+
/**
|
|
36
|
+
* The full tool catalog for a settled scene. The menu is
|
|
37
|
+
* always at level 0; a list/board follows at flow depth
|
|
38
|
+
* `position - 1` (the chain index `select` and the scene
|
|
39
|
+
* addressing use). Loading collections contribute nothing;
|
|
40
|
+
* `run_flow` is always available.
|
|
41
|
+
*/
|
|
42
|
+
export declare const catalogOf: (scene: Scene) => ReadonlyArray<Tool>;
|
|
43
|
+
//# sourceMappingURL=catalog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../../src/Catalog/usecase/catalog.ts"],"names":[],"mappings":"AAWA,OAAO,EACL,KAAK,KAAK,EAYX,MAAM,gCAAgC,CAAC;AASxC,OAAO,EACL,KAAK,IAAI,EAOV,MAAM,8BAA8B,CAAC;AAEtC;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH;;;;;GAKG;AACH,eAAO,MAAM,MAAM,KAAK,CAAC;AAwSzB;;;;;;GAMG;AACH,eAAO,MAAM,SAAS,UACb,KAAK,KACX,aAAa,CAAC,IAAI,CA8BpB,CAAC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { type SoftStr, type Box } from "plgg";
|
|
2
|
+
import { type SemDiagnostic } from "plgg-ir-language";
|
|
3
|
+
import { type Declaration } from "../../Declare/model/Declaration";
|
|
4
|
+
import { type Scene, type ConfirmPrompt } from "../../Schedule/model/Scene";
|
|
5
|
+
import { type SchedulerMsg } from "../../Schedule/model/Msg";
|
|
6
|
+
import { type Model } from "../../Schedule/model/Model";
|
|
7
|
+
import { type Scheduled } from "../../Schedule/usecase/schedule";
|
|
8
|
+
import { type FlowSchema } from "../../Flow/model/forms";
|
|
9
|
+
import { type FlowOutcome } from "../../Flow/model/run";
|
|
10
|
+
/**
|
|
11
|
+
* The pure scheduler seam `run_flow` drives: the current
|
|
12
|
+
* settled {@link Scene}, and a `settle` that folds one
|
|
13
|
+
* {@link SchedulerMsg} into the NEXT seam (the model is
|
|
14
|
+
* threaded inside; the returned `Cmd` is DROPPED — the
|
|
15
|
+
* flow harness is pure, exactly as the scheduler "executes
|
|
16
|
+
* nothing"). {@link flowHost} builds one from a derived
|
|
17
|
+
* program and a model.
|
|
18
|
+
*/
|
|
19
|
+
export type FlowHost = Readonly<{
|
|
20
|
+
scene: Scene;
|
|
21
|
+
settle: (msg: SchedulerMsg) => FlowHost;
|
|
22
|
+
}>;
|
|
23
|
+
/** Builds a {@link FlowHost} from a derived program + model. */
|
|
24
|
+
export declare const flowHost: (scheduled: Scheduled, model: Model) => FlowHost;
|
|
25
|
+
/**
|
|
26
|
+
* The result of a `run_flow` invocation — a closed union so
|
|
27
|
+
* the adapter reports it as a value:
|
|
28
|
+
* - `Rejected` — the reader/checker refused the script;
|
|
29
|
+
* the positioned diagnostics carry source ranges.
|
|
30
|
+
* - `Stalled` — the flow ran to completion but left a
|
|
31
|
+
* destructive action PARKED at its confirmation (no
|
|
32
|
+
* auto-confirm — mission point 8): the caller must
|
|
33
|
+
* dispatch the confirm explicitly.
|
|
34
|
+
* - `Ran` — the flow reached a terminal {@link FlowOutcome}
|
|
35
|
+
* (a value, or a positioned runtime failure).
|
|
36
|
+
*/
|
|
37
|
+
export type RunOutcome = Box<"Rejected", ReadonlyArray<SemDiagnostic>> | Box<"Stalled", ConfirmPrompt> | Box<"Ran", FlowOutcome>;
|
|
38
|
+
/** Constructs a `Rejected` result. */
|
|
39
|
+
export declare const rejected: (diagnostics: ReadonlyArray<SemDiagnostic>) => RunOutcome;
|
|
40
|
+
/** Constructs a `Stalled` result. */
|
|
41
|
+
export declare const stalled: (confirm: ConfirmPrompt) => RunOutcome;
|
|
42
|
+
/** Constructs a `Ran` result. */
|
|
43
|
+
export declare const ran: (outcome: FlowOutcome) => RunOutcome;
|
|
44
|
+
/** Matchers for folding a {@link RunOutcome}. */
|
|
45
|
+
export declare const rejected$: () => {
|
|
46
|
+
__tag: "Rejected";
|
|
47
|
+
type: "tag";
|
|
48
|
+
body: undefined;
|
|
49
|
+
};
|
|
50
|
+
export declare const stalled$: () => {
|
|
51
|
+
__tag: "Stalled";
|
|
52
|
+
type: "tag";
|
|
53
|
+
body: undefined;
|
|
54
|
+
};
|
|
55
|
+
export declare const ran$: () => {
|
|
56
|
+
__tag: "Ran";
|
|
57
|
+
type: "tag";
|
|
58
|
+
body: undefined;
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* Derives the {@link FlowSchema} a flow is checked against
|
|
62
|
+
* from a declaration — every collection's id, its observed
|
|
63
|
+
* field types, and its declared choice ids. The cross-
|
|
64
|
+
* dialect binding set `readFlow` resolves names against.
|
|
65
|
+
*/
|
|
66
|
+
export declare const flowSchemaOf: (declaration: Declaration) => FlowSchema;
|
|
67
|
+
/**
|
|
68
|
+
* `run_flow`: reads + checks a flow DSL source against the
|
|
69
|
+
* schema, then runs it fuel-bounded through the pure host
|
|
70
|
+
* seam — the standing catalog tool the point-8 design
|
|
71
|
+
* names. Total: a rejected script is a `Rejected` value
|
|
72
|
+
* (positioned diagnostics), a parked destructive action is
|
|
73
|
+
* a `Stalled` value, and every runtime error is a `Failed`
|
|
74
|
+
* outcome inside `Ran` — never a throw.
|
|
75
|
+
*/
|
|
76
|
+
export declare const runFlow: (source: SoftStr, schema: FlowSchema, host: FlowHost, fuel?: number) => RunOutcome;
|
|
77
|
+
//# sourceMappingURL=runFlow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runFlow.d.ts","sourceRoot":"","sources":["../../../src/Catalog/usecase/runFlow.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,GAAG,EAMT,MAAM,MAAM,CAAC;AACd,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAwBtD,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,qCAAqC,CAAC;AACvE,OAAO,EACL,KAAK,KAAK,EACV,KAAK,aAAa,EACnB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,qCAAqC,CAAC;AACrE,OAAO,EACL,KAAK,UAAU,EAGhB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,KAAK,WAAW,EAKjB,MAAM,0BAA0B,CAAC;AAOlC;;;;;;;;GAQG;AACH,MAAM,MAAM,QAAQ,GAAG,QAAQ,CAAC;IAC9B,KAAK,EAAE,KAAK,CAAC;IACb,MAAM,EAAE,CAAC,GAAG,EAAE,YAAY,KAAK,QAAQ,CAAC;CACzC,CAAC,CAAC;AAEH,gEAAgE;AAChE,eAAO,MAAM,QAAQ,cACR,SAAS,SACb,KAAK,KACX,QAOD,CAAC;AAEH;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,UAAU,GAClB,GAAG,CAAC,UAAU,EAAE,aAAa,CAAC,aAAa,CAAC,CAAC,GAC7C,GAAG,CAAC,SAAS,EAAE,aAAa,CAAC,GAC7B,GAAG,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;AAE5B,sCAAsC;AACtC,eAAO,MAAM,QAAQ,gBACN,aAAa,CAAC,aAAa,CAAC,KACxC,UAA0C,CAAC;AAE9C,qCAAqC;AACrC,eAAO,MAAM,OAAO,YACT,aAAa,KACrB,UAAqC,CAAC;AAEzC,iCAAiC;AACjC,eAAO,MAAM,GAAG,YACL,WAAW,KACnB,UAAiC,CAAC;AAErC,iDAAiD;AACjD,eAAO,MAAM,SAAS;;;;CACC,CAAC;AACxB,eAAO,MAAM,QAAQ;;;;CACC,CAAC;AACvB,eAAO,MAAM,IAAI;;;;CAAyB,CAAC;AAkH3C;;;;;GAKG;AACH,eAAO,MAAM,YAAY,gBACV,WAAW,KACvB,UAKA,CAAC;AA8CJ;;;;;;;;GAQG;AACH,eAAO,MAAM,OAAO,WACV,OAAO,UACP,UAAU,QACZ,QAAQ,SACR,MAAM,KACX,UAQF,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The plggmatic Component module: the seed set of
|
|
3
|
+
* fundamental components, each a pure `(props) =>
|
|
4
|
+
* Html<Msg>` styled through the token utilities, each
|
|
5
|
+
* carrying exactly one recorded interaction rule (see
|
|
6
|
+
* each function's doc comment). An explicit named barrel
|
|
7
|
+
* (house style); the set is deliberately small — form
|
|
8
|
+
* controls, tables, and overlays arrive in later
|
|
9
|
+
* tickets, each with its own rule. The shared
|
|
10
|
+
* interaction-state vocabulary is defined once in
|
|
11
|
+
* `model/interaction` and imported by all.
|
|
12
|
+
*/
|
|
13
|
+
export { type InteractionState, focusRing, hoverDim, pressDim, } from "./model/interaction";
|
|
14
|
+
export { type ButtonProps, button, } from "./usecase/button";
|
|
15
|
+
export { type TextLinkProps, textLink, } from "./usecase/textLink";
|
|
16
|
+
export { type HeadingLevel, heading, prose, } from "./usecase/typography";
|
|
17
|
+
export { type ThemeToggleProps, themeToggle, staticThemeToggle, themeToggleClass, themeToggleCss, } from "./usecase/themeToggle";
|
|
18
|
+
export { type NavItem } from "./model/navItem";
|
|
19
|
+
export { navTree } from "./usecase/navTree";
|
|
20
|
+
export { type NavGroup, type SidebarNavProps, sidebarNav, sidebarNavClass, sidebarNavCss, sidebarNavRevealScript, } from "./usecase/sidebarNav";
|
|
21
|
+
export { type ColHeadProps, colHead, } from "./usecase/colHead";
|
|
22
|
+
export { type Crumb, breadcrumb, } from "./usecase/breadcrumb";
|
|
23
|
+
export { type TextInputProps, textInput, } from "./usecase/textInput";
|
|
24
|
+
export { type TextAreaProps, textArea, } from "./usecase/textArea";
|
|
25
|
+
export { type SelectOption, type SelectProps, selectInput, } from "./usecase/selectInput";
|
|
26
|
+
export { type CheckboxProps, checkbox, } from "./usecase/checkbox";
|
|
27
|
+
export { type Control, type FormField, type FieldState, type DeclaredFormProps, fieldControl, declaredForm, } from "./usecase/declaredForm";
|
|
28
|
+
export { type ConfirmDialogProps, confirmDialog, } from "./usecase/confirmDialog";
|
|
29
|
+
export { type Tone, type ToastProps, tones, toast, toaster, } from "./usecase/toast";
|
|
30
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Component/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EACL,KAAK,gBAAgB,EACrB,SAAS,EACT,QAAQ,EACR,QAAQ,GACT,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EACL,KAAK,WAAW,EAChB,MAAM,GACP,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EACL,KAAK,aAAa,EAClB,QAAQ,GACT,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACL,KAAK,YAAY,EACjB,OAAO,EACP,KAAK,GACN,MAAM,wCAAwC,CAAC;AAChD,OAAO,EACL,KAAK,gBAAgB,EACrB,WAAW,EACX,iBAAiB,EACjB,gBAAgB,EAChB,cAAc,GACf,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,mCAAmC,CAAC;AACjE,OAAO,EAAE,OAAO,EAAE,MAAM,qCAAqC,CAAC;AAC9D,OAAO,EACL,KAAK,QAAQ,EACb,KAAK,eAAe,EACpB,UAAU,EACV,eAAe,EACf,aAAa,EACb,sBAAsB,GACvB,MAAM,wCAAwC,CAAC;AAChD,OAAO,EACL,KAAK,YAAY,EACjB,OAAO,GACR,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EACL,KAAK,KAAK,EACV,UAAU,GACX,MAAM,wCAAwC,CAAC;AAKhD,OAAO,EACL,KAAK,cAAc,EACnB,SAAS,GACV,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EACL,KAAK,aAAa,EAClB,QAAQ,GACT,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,WAAW,GACZ,MAAM,yCAAyC,CAAC;AACjD,OAAO,EACL,KAAK,aAAa,EAClB,QAAQ,GACT,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,SAAS,EACd,KAAK,UAAU,EACf,KAAK,iBAAiB,EACtB,YAAY,EACZ,YAAY,GACb,MAAM,0CAA0C,CAAC;AAClD,OAAO,EACL,KAAK,kBAAkB,EACvB,aAAa,GACd,MAAM,2CAA2C,CAAC;AACnD,OAAO,EACL,KAAK,IAAI,EACT,KAAK,UAAU,EACf,KAAK,EACL,KAAK,EACL,OAAO,GACR,MAAM,mCAAmC,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { type Variant } from "plgg-view/style";
|
|
2
|
+
/**
|
|
3
|
+
* The standardized interaction states every plggmatic
|
|
4
|
+
* component speaks — defined ONCE here and imported by
|
|
5
|
+
* all, so a button, a link, and a toggle give identical
|
|
6
|
+
* feedback for the same gesture (interaction-design
|
|
7
|
+
* standard). A closed union; a component that invents a
|
|
8
|
+
* new state must add it here, with a rule, not inline.
|
|
9
|
+
*/
|
|
10
|
+
export type InteractionState = "default" | "hover" | "focus" | "active" | "disabled";
|
|
11
|
+
/**
|
|
12
|
+
* THE recorded interaction rule of the framework, shared
|
|
13
|
+
* by every focusable component: a keyboard focus ring
|
|
14
|
+
* that is a real 2px outline offset from the control —
|
|
15
|
+
* a NON-COLOR affordance (geometry, not just a hue), so
|
|
16
|
+
* focus is legible independent of color vision
|
|
17
|
+
* (accessibility-first). Scoped to `:focus-visible` so
|
|
18
|
+
* it appears for keyboard/AT focus but not on mouse
|
|
19
|
+
* press. The ring color is the themed `primary` role, so
|
|
20
|
+
* it reschemes with the UI.
|
|
21
|
+
*/
|
|
22
|
+
export declare const focusRing: Variant;
|
|
23
|
+
/**
|
|
24
|
+
* Shared hover feedback: a slight dim. Kept as opacity
|
|
25
|
+
* (not a new hover color token) so every component dims
|
|
26
|
+
* consistently without expanding the palette before a
|
|
27
|
+
* component needs a dedicated hover role.
|
|
28
|
+
*
|
|
29
|
+
* Scope note (D9 + ticket 05): this opacity-dim rule is
|
|
30
|
+
* the COMPONENT hover feedback — a control dimming under
|
|
31
|
+
* the pointer. It is NOT the qmu inverted-pill THEME idiom
|
|
32
|
+
* (a link/leaf swapping to `primary-base` fill with a
|
|
33
|
+
* neutral-`surface` label), which is expressed through the
|
|
34
|
+
* existing color tokens and recorded in
|
|
35
|
+
* `Style/model/token.ts`'s hover decision, not here. Both
|
|
36
|
+
* rules stand; neither adds a hover color token.
|
|
37
|
+
*/
|
|
38
|
+
export declare const hoverDim: Variant;
|
|
39
|
+
/** Shared press feedback: a deeper dim on `:active`. */
|
|
40
|
+
export declare const pressDim: Variant;
|
|
41
|
+
//# sourceMappingURL=interaction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interaction.d.ts","sourceRoot":"","sources":["../../../src/Component/model/interaction.ts"],"names":[],"mappings":"AAUA,OAAO,EACL,KAAK,OAAO,EAEb,MAAM,iBAAiB,CAAC;AAEzB;;;;;;;GAOG;AACH,MAAM,MAAM,gBAAgB,GACxB,SAAS,GACT,OAAO,GACP,OAAO,GACP,QAAQ,GACR,UAAU,CAAC;AAEf;;;;;;;;;;GAUG;AACH,eAAO,MAAM,SAAS,EAAE,OAMvB,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,QAAQ,EAAE,OAGtB,CAAC;AAEF,wDAAwD;AACxD,eAAO,MAAM,QAAQ,EAAE,OAGtB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type SoftStr, type Option } from "plgg";
|
|
2
|
+
/**
|
|
3
|
+
* One node of a {@link navTree}. `href` is an `Option`
|
|
4
|
+
* (not a nullable string): a `Some` renders a link, a
|
|
5
|
+
* `None` renders a plain section-header label — so a
|
|
6
|
+
* group heading and a leaf link are one recursive type,
|
|
7
|
+
* and "a heading with no link" is expressed in the type,
|
|
8
|
+
* not by an empty string. `children` recurses; a leaf
|
|
9
|
+
* has `[]`.
|
|
10
|
+
*/
|
|
11
|
+
export type NavItem = Readonly<{
|
|
12
|
+
label: SoftStr;
|
|
13
|
+
href: Option<SoftStr>;
|
|
14
|
+
children: ReadonlyArray<NavItem>;
|
|
15
|
+
}>;
|
|
16
|
+
//# sourceMappingURL=navItem.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navItem.d.ts","sourceRoot":"","sources":["../../../src/Component/model/navItem.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,MAAM,CAAC;AAEjD;;;;;;;;GAQG;AACH,MAAM,MAAM,OAAO,GAAG,QAAQ,CAAC;IAC7B,KAAK,EAAE,OAAO,CAAC;IACf,IAAI,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;IACtB,QAAQ,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;CAClC,CAAC,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type SoftStr, type Option } from "plgg";
|
|
2
|
+
import { type Html } from "plgg-view";
|
|
3
|
+
/**
|
|
4
|
+
* One entry of a {@link breadcrumb} trail: a label and an
|
|
5
|
+
* `Option` link target. A `Some` renders a link to the
|
|
6
|
+
* URL that truncates the flow there (navigation, not a
|
|
7
|
+
* mode switch — the workbench's "every crumb but the last
|
|
8
|
+
* links to the URL that truncates the stack"); a `None`
|
|
9
|
+
* renders plain text (a crumb with no shallower address).
|
|
10
|
+
*/
|
|
11
|
+
export type Crumb = Readonly<{
|
|
12
|
+
label: SoftStr;
|
|
13
|
+
to: Option<SoftStr>;
|
|
14
|
+
}>;
|
|
15
|
+
/**
|
|
16
|
+
* The breadcrumb trail — the framework version of the
|
|
17
|
+
* workbench's `breadcrumb`: one crumb per flow position,
|
|
18
|
+
* every crumb but the LAST a link to its truncating URL,
|
|
19
|
+
* the last emphasized plain text, `aria-hidden`
|
|
20
|
+
* separators, all inside a labelled region so assistive
|
|
21
|
+
* tech announces "Breadcrumb". Mirrors the same stack the
|
|
22
|
+
* multi-column renderer walks, so the trail and the
|
|
23
|
+
* columns can never disagree.
|
|
24
|
+
*/
|
|
25
|
+
export declare const breadcrumb: <Msg>(crumbs: ReadonlyArray<Crumb>) => Html<Msg, "div">;
|
|
26
|
+
//# sourceMappingURL=breadcrumb.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"breadcrumb.d.ts","sourceRoot":"","sources":["../../../src/Component/usecase/breadcrumb.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,MAAM,EAEZ,MAAM,MAAM,CAAC;AACd,OAAO,EACL,KAAK,IAAI,EAOV,MAAM,WAAW,CAAC;AAUnB;;;;;;;GAOG;AACH,MAAM,MAAM,KAAK,GAAG,QAAQ,CAAC;IAC3B,KAAK,EAAE,OAAO,CAAC;IACf,EAAE,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;CACrB,CAAC,CAAC;AAEH;;;;;;;;;GASG;AACH,eAAO,MAAM,UAAU,GAAI,GAAG,UACpB,aAAa,CAAC,KAAK,CAAC,KAC3B,IAAI,CAAC,GAAG,EAAE,KAAK,CAgDjB,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type SoftStr } from "plgg";
|
|
2
|
+
import { type Html } from "plgg-view";
|
|
3
|
+
/**
|
|
4
|
+
* A button's props. `onPress` is the typed `Msg` the
|
|
5
|
+
* click produces (components are pure views — no
|
|
6
|
+
* internal state); `disabled` is a real boolean, not a
|
|
7
|
+
* styled look-alike.
|
|
8
|
+
*/
|
|
9
|
+
export type ButtonProps<Msg> = Readonly<{
|
|
10
|
+
label: SoftStr;
|
|
11
|
+
onPress: Msg;
|
|
12
|
+
disabled: boolean;
|
|
13
|
+
}>;
|
|
14
|
+
/**
|
|
15
|
+
* The action component. **Recorded rule**: an action is
|
|
16
|
+
* always a real `<button type="button">` (never a
|
|
17
|
+
* div-with-onclick), and `disabled` is conveyed by MORE
|
|
18
|
+
* than color — the native `disabled` attribute (which
|
|
19
|
+
* also drops it from the tab order) plus a
|
|
20
|
+
* `cursor:not-allowed` and reduced opacity, and the
|
|
21
|
+
* hover/press feedback is withheld. Enabled buttons
|
|
22
|
+
* carry the shared {@link focusRing}/{@link
|
|
23
|
+
* hoverDim}/{@link pressDim} state set. Styled only
|
|
24
|
+
* through token utilities.
|
|
25
|
+
*/
|
|
26
|
+
export declare const button: <Msg>(props: ButtonProps<Msg>) => Html<Msg, "button">;
|
|
27
|
+
//# sourceMappingURL=button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/Component/usecase/button.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,EACL,KAAK,IAAI,EAMV,MAAM,WAAW,CAAC;AAmBnB;;;;;GAKG;AACH,MAAM,MAAM,WAAW,CAAC,GAAG,IAAI,QAAQ,CAAC;IACtC,KAAK,EAAE,OAAO,CAAC;IACf,OAAO,EAAE,GAAG,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC,CAAC;AAEH;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,MAAM,GAAI,GAAG,SACjB,WAAW,CAAC,GAAG,CAAC,KACtB,IAAI,CAAC,GAAG,EAAE,QAAQ,CAwBlB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type SoftStr } from "plgg";
|
|
2
|
+
import { type Html } from "plgg-view";
|
|
3
|
+
/**
|
|
4
|
+
* A CONTROLLED checkbox. `checked` comes from props (the
|
|
5
|
+
* runtime reflects it onto the live `.checked` property);
|
|
6
|
+
* the recorded interaction rule — it dispatches on
|
|
7
|
+
* `onChange` IGNORING the event payload (the state is the
|
|
8
|
+
* model's `checked`, not the DOM's), the oracle's
|
|
9
|
+
* pattern. Labelled by id, `focusRing` on focus, disabled
|
|
10
|
+
* = native attribute + `pm-disabled`.
|
|
11
|
+
*/
|
|
12
|
+
export type CheckboxProps<Msg> = Readonly<{
|
|
13
|
+
name: SoftStr;
|
|
14
|
+
label: SoftStr;
|
|
15
|
+
checked: boolean;
|
|
16
|
+
disabled: boolean;
|
|
17
|
+
onToggle: Msg;
|
|
18
|
+
}>;
|
|
19
|
+
export declare const checkbox: <Msg>(props: CheckboxProps<Msg>) => Html<Msg, "div">;
|
|
20
|
+
//# sourceMappingURL=checkbox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkbox.d.ts","sourceRoot":"","sources":["../../../src/Component/usecase/checkbox.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,EACL,KAAK,IAAI,EAaV,MAAM,WAAW,CAAC;AAWnB;;;;;;;;GAQG;AACH,MAAM,MAAM,aAAa,CAAC,GAAG,IAAI,QAAQ,CAAC;IACxC,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,OAAO,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,GAAG,CAAC;CACf,CAAC,CAAC;AAEH,eAAO,MAAM,QAAQ,GAAI,GAAG,SACnB,aAAa,CAAC,GAAG,CAAC,KACxB,IAAI,CAAC,GAAG,EAAE,KAAK,CAmCf,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type SoftStr, type Option } from "plgg";
|
|
2
|
+
import { type Html } from "plgg-view";
|
|
3
|
+
/**
|
|
4
|
+
* A column's sticky header — the framework version of the
|
|
5
|
+
* pattern the workbench example hand-wrote (`.ex-colhead`):
|
|
6
|
+
* a title, which for a PUSHED column (a `close` URL is
|
|
7
|
+
* present) IS the reset affordance — clicking the title
|
|
8
|
+
* navigates to `close`, collapsing back to this column,
|
|
9
|
+
* because **leaving a column is the same gesture as
|
|
10
|
+
* entering one — a link** (there is no separate close/×
|
|
11
|
+
* button). A root column (no `close`) shows a plain,
|
|
12
|
+
* non-clickable title. The title link is `aria-label`led
|
|
13
|
+
* and rides `style_` (the sole class authority, so its
|
|
14
|
+
* atomic focus-ring classes are not clobbered by a separate
|
|
15
|
+
* `class` attribute); the class hooks are derived from
|
|
16
|
+
* `cssPrefix` (`pm-colhead`/`pm-colhead-title`), styled by
|
|
17
|
+
* the framework chrome CSS.
|
|
18
|
+
*/
|
|
19
|
+
export type ColHeadProps = Readonly<{
|
|
20
|
+
title: SoftStr;
|
|
21
|
+
close: Option<SoftStr>;
|
|
22
|
+
links: ReadonlyArray<Readonly<{
|
|
23
|
+
label: SoftStr;
|
|
24
|
+
href: SoftStr;
|
|
25
|
+
}>>;
|
|
26
|
+
}>;
|
|
27
|
+
export declare const colHead: <Msg>(props: ColHeadProps) => Html<Msg, "div">;
|
|
28
|
+
//# sourceMappingURL=colHead.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"colHead.d.ts","sourceRoot":"","sources":["../../../src/Component/usecase/colHead.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,MAAM,EAEZ,MAAM,MAAM,CAAC;AACd,OAAO,EACL,KAAK,IAAI,EAOV,MAAM,WAAW,CAAC;AASnB;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,YAAY,GAAG,QAAQ,CAAC;IAClC,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;IACvB,KAAK,EAAE,aAAa,CAClB,QAAQ,CAAC;QACP,KAAK,EAAE,OAAO,CAAC;QACf,IAAI,EAAE,OAAO,CAAC;KACf,CAAC,CACH,CAAC;CACH,CAAC,CAAC;AAEH,eAAO,MAAM,OAAO,GAAI,GAAG,SAClB,YAAY,KAClB,IAAI,CAAC,GAAG,EAAE,KAAK,CAoCf,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type SoftStr } from "plgg";
|
|
2
|
+
import { type Html } from "plgg-view";
|
|
3
|
+
/**
|
|
4
|
+
* A modal confirmation for a destructive action — the
|
|
5
|
+
* framework rendering the workbench oracle lacked the
|
|
6
|
+
* a11y for. Backdrop and dialog are SIBLING keyed nodes
|
|
7
|
+
* so an inside-click never bubbles to the backdrop's
|
|
8
|
+
* cancel; the dialog carries `role="dialog"`,
|
|
9
|
+
* `aria-modal="true"`, and `aria-labelledby` wired to its
|
|
10
|
+
* title. A destructive confirm wears the `danger` role.
|
|
11
|
+
* Backdrop-click and Cancel both dispatch `onCancel`;
|
|
12
|
+
* confirm dispatches `onConfirm` — the component owns zero
|
|
13
|
+
* state (the scheduler owns the pending-confirmation).
|
|
14
|
+
*/
|
|
15
|
+
export type ConfirmDialogProps<Msg> = Readonly<{
|
|
16
|
+
title: SoftStr;
|
|
17
|
+
body: SoftStr;
|
|
18
|
+
confirmLabel: SoftStr;
|
|
19
|
+
cancelLabel: SoftStr;
|
|
20
|
+
destructive: boolean;
|
|
21
|
+
onConfirm: Msg;
|
|
22
|
+
onCancel: Msg;
|
|
23
|
+
}>;
|
|
24
|
+
export declare const confirmDialog: <Msg>(props: ConfirmDialogProps<Msg>) => Html<Msg, "div">;
|
|
25
|
+
//# sourceMappingURL=confirmDialog.d.ts.map
|