@ttt-productions/chat-core 0.9.0 → 0.10.1

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.
@@ -6,7 +6,7 @@
6
6
  * what a "user" or "entity" is. The consumer parameterizes `TKind` to its own
7
7
  * union and supplies one `MentionProvider` per kind.
8
8
  *
9
- * Wire format — mentions are encoded inline in the message's `text` field as
9
+ * Wire format — mentions are encoded inline in the message's `text` field as
10
10
  * `@[kind:id|displayText]` tokens. The renderer parses them out at display
11
11
  * time. No schema change to ChatMessage.
12
12
  *
@@ -14,7 +14,7 @@
14
14
  * autocomplete rows (`renderResult`) lives in @ttt-productions/chat-react.
15
15
  */
16
16
  /**
17
- * Resolved mention — the value that ends up in the wire token after the user
17
+ * Resolved mention — the value that ends up in the wire token after the user
18
18
  * selects an autocomplete result.
19
19
  *
20
20
  * `kind` is the discriminator supplied by the consumer (e.g. `'member'`, `'tag'`); `id` is the
@@ -40,15 +40,15 @@ export type ParsedSegment<TKind extends string = string> = {
40
40
  /**
41
41
  * Provider supplying autocomplete results for one mention kind.
42
42
  *
43
- * - `kind` — the discriminator. Must match `MentionRef.kind` for results
43
+ * - `kind` — the discriminator. Must match `MentionRef.kind` for results
44
44
  * returned by `search`.
45
- * - `label` — human-readable label for the section / tab.
46
- * - `search` — async query. Receives the current query string (after the
45
+ * - `label` — human-readable label for the section / tab.
46
+ * - `search` — async query. Receives the current query string (after the
47
47
  * trigger character), the consumer-supplied `context`, and an optional
48
48
  * `signal` for cancellation. Returns up to whatever limit the provider
49
49
  * chooses; the chat UI renders all returned results.
50
50
  *
51
- * `TContext` is consumer-owned — pass anything you need inside `search`
51
+ * `TContext` is consumer-owned — pass anything you need inside `search`
52
52
  * (Firestore db, current user id, surface-specific filters). The mention
53
53
  * system never inspects it.
54
54
  *
@@ -70,7 +70,7 @@ export type MentionProvider<TKind extends string = string, TContext = unknown> =
70
70
  * recent picks when the user opens the dropdown without typing a query
71
71
  * (or after typing fewer than the configured minimum characters).
72
72
  *
73
- * `getRecent` MAY be async — the autocomplete renders a spinner while it
73
+ * `getRecent` MAY be async — the autocomplete renders a spinner while it
74
74
  * resolves. `recordUse` is fired after a successful selection so consumers
75
75
  * can persist usage.
76
76
  */
@@ -83,8 +83,8 @@ export type RecentMentionsAdapter<TKind extends string = string> = {
83
83
  * text buffer. Tracked in component state so positionally-collocated mentions
84
84
  * with the same display string disambiguate on send.
85
85
  *
86
- * - `start` / `end` — character offsets into the current textarea value.
87
- * - `ref` — the resolved MentionRef.
86
+ * - `start` / `end` — character offsets into the current textarea value.
87
+ * - `ref` — the resolved MentionRef.
88
88
  */
89
89
  export type MentionAnchor<TKind extends string = string> = {
90
90
  start: number;
@@ -6,7 +6,7 @@
6
6
  * what a "user" or "entity" is. The consumer parameterizes `TKind` to its own
7
7
  * union and supplies one `MentionProvider` per kind.
8
8
  *
9
- * Wire format — mentions are encoded inline in the message's `text` field as
9
+ * Wire format — mentions are encoded inline in the message's `text` field as
10
10
  * `@[kind:id|displayText]` tokens. The renderer parses them out at display
11
11
  * time. No schema change to ChatMessage.
12
12
  *
package/dist/types.d.ts CHANGED
@@ -19,6 +19,9 @@ export type ChatMessageV1 = {
19
19
  attachment?: ChatAttachment;
20
20
  replyTo?: ReplyTo;
21
21
  isSystemMessage?: boolean;
22
+ /** Moderation tombstone flag on the stored message (backend-written); consumers
23
+ * render a tombstone instead of the content when true. */
24
+ hidden?: boolean;
22
25
  meta?: Record<string, unknown>;
23
26
  };
24
27
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAY7E,YAAY,EAAE,cAAc,EAAE,CAAC;AAM/B,MAAM,MAAM,MAAM,GAAG,MAAM,CAAC;AAE5B,MAAM,MAAM,YAAY,GAAG;IACzB,cAAc,EAAE,MAAM,EAAE,CAAC;I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AC;IAC7E,eAAe,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9D,cAAc,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC7D,CAAC;AAMF,iEAAiE;AACjE,eAAO,MAAM,aAAa,MAAM,CAAC;AAMjC;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;AAEnE;;;;;GAKG;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC"}
package/dist/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAuGA,+CAA+C;AAC/C,kDAAkD;AAClD,+CAA+C;AAE/C,iEAAiE;AACjE,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,CAAC"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AA0GA,+CAA+C;AAC/C,kDAAkD;AAClD,+CAA+C;AAE/C,iEAAiE;AACjE,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ttt-productions/chat-core",
3
- "version": "0.9.0",
3
+ "version": "0.10.1",
4
4
  "description": "Pure chat contracts, mention parser/serializer, and grouping helpers for TTT Productions apps (no React, no Firebase)",
5
5
  "repository": {
6
6
  "type": "git",
@@ -28,7 +28,7 @@
28
28
  "prepublishOnly": "npm run clean && npm run build"
29
29
  },
30
30
  "dependencies": {
31
- "@ttt-productions/chat-schemas": "^0.8.0"
31
+ "@ttt-productions/chat-schemas": "^0.9.0"
32
32
  },
33
33
  "devDependencies": {
34
34
  "typescript": "^5.8.3"