@opencxh/ui-kit 3.178.0 → 3.179.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 +3 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +673 -664
- package/dist/index.js.map +1 -1
- package/dist/src/input/MentionComposer.d.ts +8 -2
- package/dist/src/utils/mentionChip.d.ts +20 -0
- package/package.json +1 -1
|
@@ -10,8 +10,14 @@ export interface MentionPerson {
|
|
|
10
10
|
export interface MentionComposerProps {
|
|
11
11
|
/** Seed HTML, sanitised before it lands. Mention chips survive if they carry `data-mention-id`. */
|
|
12
12
|
initialContent?: string;
|
|
13
|
-
/**
|
|
14
|
-
|
|
13
|
+
/**
|
|
14
|
+
* Plain text, the ids of the chips still standing in it, and the sanitised HTML.
|
|
15
|
+
*
|
|
16
|
+
* Persist the HTML next to the text, never instead of it: everything that reads a comment
|
|
17
|
+
* without rendering it — an AI prompt, a search index, a notification, the native app —
|
|
18
|
+
* wants the plain text, and only the surface that draws chips wants the markup.
|
|
19
|
+
*/
|
|
20
|
+
onChange: (plainText: string, mentionIds: string[], html: string) => void;
|
|
15
21
|
people: MentionPerson[];
|
|
16
22
|
placeholder?: string;
|
|
17
23
|
/** Cmd/Ctrl+Enter. Omitted means the shortcut does nothing. */
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How a mention chip looks, as descendant utilities.
|
|
3
|
+
*
|
|
4
|
+
* **The chip element itself carries no `class`** — only `data-mention-id`. Comment HTML is
|
|
5
|
+
* persisted, and class names baked into stored markup would freeze today's design tokens in
|
|
6
|
+
* the database: a token rename would leave every old comment styled by a class that no longer
|
|
7
|
+
* exists. The attribute is the contract, the styling is applied by whoever renders it.
|
|
8
|
+
*
|
|
9
|
+
* Used by both ends: the composer (so a chip looks the same while you type) and `RichText`
|
|
10
|
+
* (so it still looks the same once posted).
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* `info-soft`, not the `beta-container` the chip used to carry: that one is a hand-written
|
|
14
|
+
* rule in `global.css`, not an `@theme` token, so Tailwind can generate `.bg-beta-container`
|
|
15
|
+
* but not the `[&_…]:bg-beta-container` **variant** this needs. Verified against a compile:
|
|
16
|
+
* both tokens here resolve, and the chip would otherwise have been silently unstyled.
|
|
17
|
+
*/
|
|
18
|
+
export declare const MENTION_CHIP_CLASSES: string;
|
|
19
|
+
/** DOMPurify must keep the marker attribute, or a sanitised chip is just text. */
|
|
20
|
+
export declare const MENTION_SANITIZE_ATTR = "data-mention-id";
|