@praxisui/rich-content 8.0.0-beta.19 → 8.0.0-beta.20
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 +142 -6
- package/fesm2022/praxisui-rich-content.mjs +11583 -185
- package/index.d.ts +263 -7
- package/package.json +4 -2
package/README.md
CHANGED
|
@@ -63,11 +63,18 @@ instead of creating local rich-content JSON editors.
|
|
|
63
63
|
|
|
64
64
|
The canonical editor provides structured block authoring for common top-level
|
|
65
65
|
nodes (`text`, `badge`, `icon`, `image`, `metric`, `progress`, `compose`,
|
|
66
|
-
`link`, `card`, `
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
66
|
+
`link`, `actionButton`, `card`, `callout`, `ctaGroup`, `keyValueList`,
|
|
67
|
+
`emptyState`, `propertySheet`, `statGroup`, `tabs`, `recordSummary`, `lookupResult`, `lookupCard`, `relatedRecord`,
|
|
68
|
+
`actionCard`, `collapsibleCard`, `disclosure`, `accordion`, `formLauncher`, `mediaBlock`,
|
|
69
|
+
`timeline` and `preset`), including add, reorder, inline removal confirmation
|
|
70
|
+
and field-level editing. It also supports nested authoring for
|
|
71
|
+
`card.content[]`, named card slots, `compose.items[]`, `timeline.items[]` and
|
|
72
|
+
governed action collections such as `callout.actions[]`,
|
|
73
|
+
`recordSummary.actions[]`, `lookupCard.secondaryActions[]`, `actionCard.secondaryActions[]` and
|
|
74
|
+
`disclosure.actions[]`, plus governed preset selection from
|
|
75
|
+
`PRAXIS_RICH_BLOCK_PRESETS`. Common node metadata such as `testId`,
|
|
76
|
+
`className`, capability-gated visibility (`requiresCapabilities` and
|
|
77
|
+
`capabilityMode`), a simple `visibleWhen` equality rule and one safe inline
|
|
71
78
|
style declaration can be edited visually. Advanced JSON remains available for
|
|
72
79
|
less common nested fields and deep structures, but it is no longer the only
|
|
73
80
|
authoring path.
|
|
@@ -102,6 +109,134 @@ Apply/Save. Hosts that need the same checks outside the settings panel can use
|
|
|
102
109
|
unsupported document versions, unknown node types, unsafe URLs, unsafe style
|
|
103
110
|
values and malformed nested nodes before persistence.
|
|
104
111
|
|
|
112
|
+
### Timeline authoring
|
|
113
|
+
|
|
114
|
+
`timeline` is a governed rich-content block, not a local page-builder widget.
|
|
115
|
+
The public document contract supports node-level presentation fields
|
|
116
|
+
`orientation`, `order`, `position`, `connectorVariant`, `connectorColor`,
|
|
117
|
+
`markerVariant`, `markerColor` and `markerStyle`, plus item-level `opposite`
|
|
118
|
+
and `oppositeExpr` content. `orientation` accepts `vertical` or `horizontal`;
|
|
119
|
+
`order` accepts `normal` or `reverse`, allowing hosts and agents to publish the
|
|
120
|
+
same lifecycle data as a vertical document flow, a horizontal process rail or a
|
|
121
|
+
reverse chronological activity stream without reshaping `timeline.items[]`.
|
|
122
|
+
Timeline items may override `connectorVariant`, `connectorColor`, `markerColor`
|
|
123
|
+
and `markerStyle` when a specific step needs status or exception emphasis.
|
|
124
|
+
These fields are available through the canonical rich-content editor, validated
|
|
125
|
+
by `validateRichContentDocument()` and consumed directly by the runtime
|
|
126
|
+
renderer.
|
|
127
|
+
|
|
128
|
+
Use timeline node settings when the host needs to publish lifecycle, workflow or
|
|
129
|
+
operational history as portable `RichContentDocument` JSON. Use item-level
|
|
130
|
+
fields such as `title`, `subtitle`, `meta`, `icon`, `badge` and `opposite` for
|
|
131
|
+
display data, with `*Expr` variants when the values come from the widget
|
|
132
|
+
context.
|
|
133
|
+
|
|
134
|
+
## Semantic blocks and interactive surfaces
|
|
135
|
+
|
|
136
|
+
`@praxisui/rich-content` now supports a broader contract for configuration-first
|
|
137
|
+
platform surfaces:
|
|
138
|
+
|
|
139
|
+
- semantic editorial blocks such as `callout`, `keyValueList`, `emptyState`,
|
|
140
|
+
`recordSummary`, `statGroup`, `tabs`, `lookupResult`, `lookupCard`, `relatedRecord`, `actionCard`, `collapsibleCard`,
|
|
141
|
+
`disclosure` and `accordion`
|
|
142
|
+
- interactive buttons through `actionButton`, mediated by
|
|
143
|
+
`hostCapabilities.dispatchAction(...)`
|
|
144
|
+
- governed action surfaces such as `lookupCard`, `relatedRecord`, `actionCard` and `formLauncher`, which keep
|
|
145
|
+
the document canonical while delegating execution to host capabilities
|
|
146
|
+
- capability-gated visibility through `requiresCapabilities` and
|
|
147
|
+
`capabilityMode`
|
|
148
|
+
- richer `card` composition through semantic surface fields (`variant`, `tone`,
|
|
149
|
+
`size`, `density`, `orientation`), optional `media`, `headerAction`,
|
|
150
|
+
whole-card `interaction`, accessibility overrides and named slots (`header`,
|
|
151
|
+
`body`, `footer`, `actions`, `aside`) while preserving the required
|
|
152
|
+
`content[]` path for existing consumers
|
|
153
|
+
|
|
154
|
+
This keeps purely visual content (`card`, `callout`, `keyValueList`) distinct
|
|
155
|
+
from host-mediated interaction (`actionButton`) without introducing ad hoc host
|
|
156
|
+
JSON.
|
|
157
|
+
|
|
158
|
+
Example semantic card surface:
|
|
159
|
+
|
|
160
|
+
```ts
|
|
161
|
+
const document: RichContentDocument = {
|
|
162
|
+
kind: 'praxis.rich-content',
|
|
163
|
+
version: '1.0.0',
|
|
164
|
+
nodes: [
|
|
165
|
+
{
|
|
166
|
+
type: 'card',
|
|
167
|
+
titleExpr: '${decision.title}',
|
|
168
|
+
subtitleExpr: '${decision.source}',
|
|
169
|
+
variant: 'elevated',
|
|
170
|
+
tone: 'info',
|
|
171
|
+
size: 'lg',
|
|
172
|
+
orientation: 'horizontal',
|
|
173
|
+
media: {
|
|
174
|
+
kind: 'icon',
|
|
175
|
+
icon: 'psychology',
|
|
176
|
+
label: 'AI-authored decision surface',
|
|
177
|
+
placement: 'leading',
|
|
178
|
+
},
|
|
179
|
+
interaction: {
|
|
180
|
+
mode: 'action',
|
|
181
|
+
action: { actionId: 'decision.open' },
|
|
182
|
+
},
|
|
183
|
+
accessibility: {
|
|
184
|
+
role: 'button',
|
|
185
|
+
ariaLabel: 'Open decision surface',
|
|
186
|
+
},
|
|
187
|
+
content: [
|
|
188
|
+
{ type: 'text', textExpr: '${decision.summary}' },
|
|
189
|
+
],
|
|
190
|
+
},
|
|
191
|
+
],
|
|
192
|
+
};
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
## Governed presets
|
|
196
|
+
|
|
197
|
+
The preset registry still uses `PRAXIS_RICH_BLOCK_PRESETS`, and the lib now also
|
|
198
|
+
publishes `providePraxisDefaultRichBlockPresets()` with a small canonical starter
|
|
199
|
+
set for configuration-first hosts:
|
|
200
|
+
|
|
201
|
+
- `callout-guidance`
|
|
202
|
+
- `empty-state-launcher`
|
|
203
|
+
- `record-summary-compact`
|
|
204
|
+
|
|
205
|
+
For widget hosts such as `@praxisui/page-builder`, the component metadata also
|
|
206
|
+
publishes insertion presets through `ComponentDocMeta.insertionPresets`. The
|
|
207
|
+
current canonical starter set is:
|
|
208
|
+
|
|
209
|
+
- `editorial-card`
|
|
210
|
+
- `callout-guidance`
|
|
211
|
+
- `cta-group`
|
|
212
|
+
- `knowledge-surface`
|
|
213
|
+
- `lookup-card`
|
|
214
|
+
- `related-record`
|
|
215
|
+
- `action-card`
|
|
216
|
+
- `approval-audit-surface`
|
|
217
|
+
- `approval-decision-surface`
|
|
218
|
+
- `approval-review-surface`
|
|
219
|
+
- `approval-sla-triage-surface`
|
|
220
|
+
- `approval-delegation-exception-surface`
|
|
221
|
+
- `employee-insight-surface`
|
|
222
|
+
- `hr-compensation-review-surface`
|
|
223
|
+
- `hr-performance-review-surface`
|
|
224
|
+
- `hr-promotion-review-surface`
|
|
225
|
+
- `hr-offboarding-surface`
|
|
226
|
+
- `hr-succession-planning-surface`
|
|
227
|
+
- `hr-leave-absence-surface`
|
|
228
|
+
- `hr-internal-mobility-surface`
|
|
229
|
+
- `onboarding-journey-surface`
|
|
230
|
+
- `onboarding-equipment-access-recovery-surface`
|
|
231
|
+
- `onboarding-day-30-coaching-surface`
|
|
232
|
+
- `onboarding-manager-follow-up-surface`
|
|
233
|
+
- `onboarding-readiness-surface`
|
|
234
|
+
- `stat-group`
|
|
235
|
+
- `timeline-surface`
|
|
236
|
+
- `tabs-surface`
|
|
237
|
+
|
|
238
|
+
Hosts can use the defaults directly or provide their own governed preset pack.
|
|
239
|
+
|
|
105
240
|
## Agentic Authoring Contract
|
|
106
241
|
|
|
107
242
|
`@praxisui/rich-content` publishes an executable `ComponentAuthoringManifest`
|
|
@@ -110,7 +245,8 @@ through `PRAXIS_RICH_CONTENT_AUTHORING_MANIFEST`.
|
|
|
110
245
|
The manifest treats rich content as structured `RichContentDocument` data, not
|
|
111
246
|
HTML or markdown patches. It governs document replacement, block add/remove,
|
|
112
247
|
block order, text updates, canonical link nodes, common node metadata,
|
|
113
|
-
`mediaBlock` fields, `timeline.items[]`, preset refs
|
|
248
|
+
`mediaBlock` fields, timeline node settings, `timeline.items[]`, preset refs
|
|
249
|
+
and sanitization policy.
|
|
114
250
|
Security-sensitive policy edits and destructive removals require confirmation
|
|
115
251
|
before a patch can be compiled.
|
|
116
252
|
|