4.6 KiB
4.6 KiB
KriUiRegistry Consumer Contract
When implementing or changing frontend UI, use this order:
- Reuse an existing shared component in the project when it already meets the requirement.
- Prefer an approved component from KriUiRegistry.
- Otherwise, prefer a suitable shadcn/ui component.
- Create a custom component only when the preceding options cannot meet the requirement safely.
KriAutoComplete Search Scroll
kri-auto-completeexposesresetScrollOnSearch?: booleanonKriSingleSelect,KriMultiSelect, andMultiSelect. It defaults tofalse, preserving existing behavior.- When enabled, a search value change (including clearing it) resets the option list scroll to the top on the next animation frame in both
filterandinputOnlymodes. Async result updates alone do not trigger another reset.
KriAutoComplete Option Tooltip
kri-auto-completeexposesoptionTooltip?: 'singleLine' | 'wrap'andoptionTooltipClassName?: stringonKriSingleSelect,KriMultiSelect, andMultiSelect. It is off by default, preserving existing behavior.- When enabled, hovering an option shows its full
labelin a right-side tooltip.singleLinestays on one line until the available viewport width;wrapwraps at 28rem. The item depends on the shadcntooltipcomponent and provides its ownTooltipProvider.
KriAutoComplete Search Match
kri-auto-completeexposessearchMatch?: 'fuzzy' | 'contains'onKriSingleSelect,KriMultiSelect, andMultiSelect. It defaults tofuzzy(cmdk's default subsequence scoring), preserving existing behavior.containskeeps only options whose label or value contains the search text as a case-insensitive substring, in the original option order. It applies only whensearchModeisfilter.
KriColorPalette
kri-color-paletteprovidesKriColorPalettewithvalue: string | nullandonChange(value: string | null). Values are uppercase#RRGGBB, or#RRGGBBAAwhen they carry transparency;nullmeans no color.allowAlpha?: booleandefaults tofalse. When disabled, an incoming#RRGGBBAAvalue is still displayed and preserved until the user picks a new color, which produces an opaque#RRGGBB. When enabled, a transparency slider and#RRGGBBAAinput are available.colors,allowCustom,allowClear,disabled,placeholder,className, andaria-labelare optional. A disabled palette never opens.- Color helpers (
parseHexColor,formatHexColor,normalizeHexColor,isLightHexColor) ship incolor-palette/color.ts. Render stored colors as solid backgrounds without extra opacity so they match the palette.
KriEditor Preview Options
- With
enableImageMapandshowPreview, the WYSIWYG preview overlays<area>regions (rect/circle/poly); withoutenableImageMapnothing changes. smsFrameClassName?: stringappends classes to the SMS preview phone frame (for example, overriding the defaulth-[600px]).renderToolbarEndis rendered through an internal slot component; when the prop is provided, the toolbar separator is always shown even if the function returnsnull.- Installed copies may diverge locally; compare against the registry source before reinstalling with overwrite.
KriEditor SMS Preview
changeSmsTypereportsSMS | LMS | MMS. Update consumer callbacks to handleMMS; this widens the previous callback contract.- Attachment presence (
smsHasAttachment) takes priority and reports MMS. Otherwise a title or UTF-8 preview size >=smsMaxBytes(default 90) reports LMS; the remainder reports SMS. LMS/MMS sharelmsMaxBytes(default 2000). - UTF-8 byte counting includes
smsPreviewSuffixand its separating newline, without storing the suffix in the body. - This is a preview. Use the template-save response for saved
tmplatTyand delivery-resultsendTyfor actual per-recipient type after server substitution. Registry updates require updating installed consumer copies.
Required Shared References
Before each related task, read the current contents of every matching reference, even if it was read earlier in the session.
| Task scope | Required reference |
|---|---|
| Installing, upgrading, adapting, or verifying a registry component | .agent-harness/references/kri-ui-registry/installation-and-adaptation.md |
| KriEditor HTML, image-map, sanitizer, or WYSIWYG compatibility | .agent-harness/references/kri-ui-registry/editor-html-compatibility.md |
If a task spans multiple scopes, read every matching reference. Generated files under .agent-harness/references/ are read-only copies; edit KriUiRegistry's .agent/consumer.md or .agent/consumer-references/ and recompose instead.