@opencxh/ui-kit 3.137.12 → 3.140.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/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1228 -1113
- package/dist/index.js.map +1 -1
- package/dist/src/content/ArtifactView.d.ts +33 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/utils/text.d.ts +20 -0
- package/package.json +1 -1
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ArtifactBlock, ArtifactRuntime } from '@opencxh/domain';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* Tekent een artefact: read-only, en inert by construction.
|
|
5
|
+
*
|
|
6
|
+
* Drie dingen maken dat waar, en ze horen alle drie bij elkaar:
|
|
7
|
+
*
|
|
8
|
+
* 1. **Eén `switch` over `type`, met `default: null`.** Een blok dat deze
|
|
9
|
+
* renderer niet kent verdwijnt in plaats van de pagina mee te nemen — dezelfde
|
|
10
|
+
* regel als de tijdlijn-renderer, zodat een nieuwere schrijver naast een
|
|
11
|
+
* oudere shell kan bestaan.
|
|
12
|
+
* 2. **Nergens `dangerouslySetInnerHTML`.** Tekst gaat door {@link RichText} met
|
|
13
|
+
* `as="markdown"`, wat de HTML-tak van dat component *uitschakelt* in plaats
|
|
14
|
+
* van erop te vertrouwen dat de heuristiek de goede kiest. Die markdown-tak
|
|
15
|
+
* (react-markdown) emit geen rauwe HTML, dus er is niets om te saniteren.
|
|
16
|
+
* 3. **`runtime` wordt gecontroleerd, niet aangenomen.** Vandaag bestaat alleen
|
|
17
|
+
* `"inert"`; als er ooit een tweede waarde komt, weigert deze renderer hem
|
|
18
|
+
* zichtbaar in plaats van hem stilzwijgend als veilig te tekenen.
|
|
19
|
+
*
|
|
20
|
+
* ## Waar de grens tussen RichText en platte tekst ligt
|
|
21
|
+
*
|
|
22
|
+
* Bloktekst (alinea, citaat, callout, opsomming) mag inline markdown dragen en
|
|
23
|
+
* gaat door `RichText`. Tabelcellen en KPI-waarden niet: dat zijn *waarden*, geen
|
|
24
|
+
* proza, en een react-markdown-parse per cel is bij tweehonderd rijen keer twaalf
|
|
25
|
+
* kolommen een parse-storm om vet dat er niet hoort te staan.
|
|
26
|
+
*/
|
|
27
|
+
export interface ArtifactViewProps {
|
|
28
|
+
blocks: ArtifactBlock[];
|
|
29
|
+
/** Alles behalve `"inert"` wordt geweigerd. Zie de klassenoot hierboven. */
|
|
30
|
+
runtime?: ArtifactRuntime;
|
|
31
|
+
className?: string;
|
|
32
|
+
}
|
|
33
|
+
export declare function ArtifactView({ blocks, runtime, className }: ArtifactViewProps): React.JSX.Element;
|
package/dist/src/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export { cn, createSizes, createVariants } from './utils/cn';
|
|
|
2
2
|
export { useAnchoredPosition, type AnchoredPositionOptions } from './utils/useAnchoredPosition';
|
|
3
3
|
export { IDENTITY_TONE_COUNT, identityDotClass, identityPlateClass, identityTone, type IdentityTone } from './utils/identity';
|
|
4
4
|
export { catTone, type CatTone } from './utils/catTone';
|
|
5
|
+
export { normalizeText, text } from './utils/text';
|
|
5
6
|
export { MeetingGrid, type MeetingGridProps } from './meeting/MeetingGrid';
|
|
6
7
|
export { ParticipantTile, type ParticipantTileProps } from './meeting/ParticipantTile';
|
|
7
8
|
export { VideoSurface, type VideoSurfaceProps } from './meeting/VideoSurface';
|
|
@@ -35,6 +36,7 @@ export { ProgressBar, type ProgressBarProps } from './feedback/ProgressBar';
|
|
|
35
36
|
export { Spinner, type SpinnerProps } from './feedback/Spinner';
|
|
36
37
|
export { StatusDot, type StatusDotProps } from './feedback/StatusDot';
|
|
37
38
|
export { StepIndicator, type StepIndicatorProps } from './feedback/StepIndicator';
|
|
39
|
+
export { ArtifactView, type ArtifactViewProps } from './content/ArtifactView';
|
|
38
40
|
export { AssistantCard, type AssistantCardProps } from './content/AssistantCard';
|
|
39
41
|
export { Avatar, type AvatarProps, type AvatarTone } from './content/Avatar';
|
|
40
42
|
export { AvatarStack, type AvatarStackPerson, type AvatarStackProps } from './content/AvatarStack';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Coerce an unknown value to text.
|
|
3
|
+
*
|
|
4
|
+
* Every input component in this kit declares its `value` as `string`, and every
|
|
5
|
+
* one of them is fed straight out of form data, which is `any`. A field whose
|
|
6
|
+
* entity type is numeric therefore arrives as a number — `eylo-voip`'s time
|
|
7
|
+
* rules do exactly that (`interval?: number`, `days?: number[]`) — and the two
|
|
8
|
+
* failure modes are both silent from the type system's side:
|
|
9
|
+
*
|
|
10
|
+
* - a hard `TypeError: (…).trim is not a function` the moment anything calls a
|
|
11
|
+
* string method on it;
|
|
12
|
+
* - a comparison that simply never matches, because `1 === "1"` is false, so a
|
|
13
|
+
* stored option renders as unselected with no error at all.
|
|
14
|
+
*
|
|
15
|
+
* `null` and `undefined` become `""` so callers can treat "absent" and "empty"
|
|
16
|
+
* alike, which is what a text input does anyway.
|
|
17
|
+
*/
|
|
18
|
+
export declare const text: (value: unknown) => string;
|
|
19
|
+
/** {@link text} folded to a comparable key: trimmed and lower-cased. */
|
|
20
|
+
export declare const normalizeText: (value: unknown) => string;
|