@memberjunction/ng-composer 6.1.0-edge.0 → 6.1.0-edge.2
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/lib/components/mention/mention-dropdown.component.d.ts +4 -2
- package/dist/lib/components/mention/mention-dropdown.component.d.ts.map +1 -1
- package/dist/lib/components/mention/mention-dropdown.component.js +21 -7
- package/dist/lib/components/mention/mention-dropdown.component.js.map +1 -1
- package/dist/lib/components/mention/mention-editor.component.d.ts +73 -1
- package/dist/lib/components/mention/mention-editor.component.d.ts.map +1 -1
- package/dist/lib/components/mention/mention-editor.component.js +267 -21
- package/dist/lib/components/mention/mention-editor.component.js.map +1 -1
- package/dist/lib/components/message/message-input-box.component.d.ts +103 -42
- package/dist/lib/components/message/message-input-box.component.d.ts.map +1 -1
- package/dist/lib/components/message/message-input-box.component.js +221 -119
- package/dist/lib/components/message/message-input-box.component.js.map +1 -1
- package/dist/lib/events/composer-events.d.ts +40 -0
- package/dist/lib/events/composer-events.d.ts.map +1 -0
- package/dist/lib/events/composer-events.js +40 -0
- package/dist/lib/events/composer-events.js.map +1 -0
- package/dist/public-api.d.ts +1 -0
- package/dist/public-api.d.ts.map +1 -1
- package/dist/public-api.js +2 -0
- package/dist/public-api.js.map +1 -1
- package/package.json +8 -8
|
@@ -2,6 +2,7 @@ import { EventEmitter } from '@angular/core';
|
|
|
2
2
|
import { IMetadataProvider, UserInfo } from '@memberjunction/core';
|
|
3
3
|
import { ComposerTriggerProvider, MentionSuggestion } from '../../composer-trigger-provider';
|
|
4
4
|
import { MentionEditorComponent, PendingAttachment } from '../mention/mention-editor.component';
|
|
5
|
+
import { BeforeSkillsOpenedEventArgs } from '../../events/composer-events';
|
|
5
6
|
import * as i0 from "@angular/core";
|
|
6
7
|
/**
|
|
7
8
|
* Reusable message input box component (presentational)
|
|
@@ -20,89 +21,149 @@ import * as i0 from "@angular/core";
|
|
|
20
21
|
*/
|
|
21
22
|
export declare class MessageInputBoxComponent {
|
|
22
23
|
mentionEditor?: MentionEditorComponent;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
Placeholder: string;
|
|
25
|
+
Disabled: boolean;
|
|
26
|
+
Value: string;
|
|
27
|
+
ShowCharacterCount: boolean;
|
|
27
28
|
/** Master switch for all mention/command triggers (pass-through to the mention editor). */
|
|
28
|
-
|
|
29
|
+
EnableMentions: boolean;
|
|
29
30
|
/** Explicit trigger-provider list (pass-through to the mention editor; explicit list wins over discovery). */
|
|
30
31
|
TriggerProviders: ComposerTriggerProvider[] | null;
|
|
31
32
|
/** Discovery-mode filter: provider Keys to skip (pass-through to the mention editor). */
|
|
32
33
|
ExcludedTriggerKeys: string[];
|
|
33
34
|
/** Optional metadata provider scoping this composer (pass-through to the mention editor). */
|
|
34
35
|
Provider: IMetadataProvider | null;
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
36
|
+
CurrentUser?: UserInfo;
|
|
37
|
+
Rows: number;
|
|
38
|
+
EnableAttachments: boolean;
|
|
39
|
+
MaxAttachments: number;
|
|
40
|
+
MaxAttachmentSizeBytes: number;
|
|
41
|
+
AcceptedFileTypes: string;
|
|
41
42
|
/** Shows the in-composer mic button when true. */
|
|
42
|
-
|
|
43
|
+
EnableRealtime: boolean;
|
|
43
44
|
/** Whether a realtime voice session is currently active (mic renders in its active state). */
|
|
44
|
-
|
|
45
|
-
/** Whether a voice session can be started right now (mic
|
|
46
|
-
|
|
45
|
+
VoiceActive: boolean;
|
|
46
|
+
/** Whether a voice session can be started right now (mic Disabled when false). */
|
|
47
|
+
CanStartRealtime: boolean;
|
|
47
48
|
/** Shows the in-composer Plan Mode toggle button when true. */
|
|
48
|
-
|
|
49
|
+
EnablePlanMode: boolean;
|
|
49
50
|
/** Current Plan Mode toggle state (renders the button in its active state). */
|
|
50
|
-
|
|
51
|
+
PlanModeActive: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Shows the in-composer Skills button when true.
|
|
54
|
+
*
|
|
55
|
+
* Gated separately from `EnableMentions` because a host can have the `/` trigger active and
|
|
56
|
+
* still not want the button — but the common case is that a composer offering skill commands
|
|
57
|
+
* should advertise them, since `/` is otherwise invisible.
|
|
58
|
+
*/
|
|
59
|
+
EnableSkills: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* True while the skill dropdown is open, driving the button's expanded state.
|
|
62
|
+
*
|
|
63
|
+
* Note the ARIA differs from Plan Mode next to it, deliberately: Plan Mode is a toggle BUTTON
|
|
64
|
+
* (a mode that stays on), so `aria-pressed` is right there. This one opens a popup, so it is
|
|
65
|
+
* `aria-expanded` + `aria-haspopup`. Using `aria-pressed` here would have a screen reader
|
|
66
|
+
* announce "pressed" for something that actually just revealed a list.
|
|
67
|
+
*
|
|
68
|
+
* DERIVED, not an @Input, and this is the difference from Plan Mode. Plan Mode's active state is
|
|
69
|
+
* a persisted user preference the host owns and threads down. "Is the skill dropdown open" is
|
|
70
|
+
* intrinsic to this composer, so an @Input would be an API the host cannot meaningfully answer
|
|
71
|
+
* and would leave the button permanently unpressed if nobody bound it.
|
|
72
|
+
*/
|
|
73
|
+
get SkillsActive(): boolean;
|
|
51
74
|
/** Composer lost focus — hosts persist drafts on this. */
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
75
|
+
Blurred: EventEmitter<void>;
|
|
76
|
+
TextSubmitted: EventEmitter<string>;
|
|
77
|
+
ValueChange: EventEmitter<string>;
|
|
78
|
+
AttachmentsChanged: EventEmitter<PendingAttachment[]>;
|
|
79
|
+
AttachmentError: EventEmitter<string>;
|
|
80
|
+
AttachmentClicked: EventEmitter<PendingAttachment>;
|
|
58
81
|
/** Emitted when the user clicks the mic button to start/stop a voice session. */
|
|
59
|
-
|
|
82
|
+
VoiceRequested: EventEmitter<void>;
|
|
60
83
|
/**
|
|
61
84
|
* Emitted when the user clicks the small caret next to the phone button — the host opens the
|
|
62
85
|
* voice agent/model picker so call options (which agent, which voice model) stay reachable
|
|
63
86
|
* without adding friction to the plain phone click's instant-start path.
|
|
64
87
|
*/
|
|
65
|
-
|
|
88
|
+
VoiceOptionsRequested: EventEmitter<void>;
|
|
66
89
|
/** Emitted when the user clicks the in-composer Plan Mode toggle button. */
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
90
|
+
PlanModeToggle: EventEmitter<void>;
|
|
91
|
+
/**
|
|
92
|
+
* Fired BEFORE the Skills button opens the dropdown. Flip `Cancel` to veto — a host gating
|
|
93
|
+
* skills by entitlement, or surfacing them elsewhere, blocks it here.
|
|
94
|
+
*
|
|
95
|
+
* A pair rather than a lone emitter because this is an ACTION a host might reasonably refuse
|
|
96
|
+
* (UI_LAYERING_GUIDE section 6, rule 1). Handlers must be synchronous; `Cancel` travels back
|
|
97
|
+
* through EventEmitter's synchronous dispatch.
|
|
98
|
+
*/
|
|
99
|
+
BeforeSkillsOpened: EventEmitter<BeforeSkillsOpenedEventArgs>;
|
|
100
|
+
/**
|
|
101
|
+
* Fired AFTER the dropdown actually opened. Not emitted on the canceled path, and not emitted
|
|
102
|
+
* when no active provider owns the trigger — so a host counting this counts dropdowns the user
|
|
103
|
+
* saw, rather than clicks.
|
|
104
|
+
*/
|
|
105
|
+
AfterSkillsOpened: EventEmitter<void>;
|
|
106
|
+
/**
|
|
107
|
+
* Open the skill-command dropdown, the same one `/` opens.
|
|
108
|
+
*
|
|
109
|
+
* Routed through the editor's OpenTrigger rather than a parallel menu so permission filtering,
|
|
110
|
+
* per-skill icons and chip insertion all stay in one implementation.
|
|
111
|
+
*/
|
|
112
|
+
/**
|
|
113
|
+
* NOTE: the template pairs this with
|
|
114
|
+
* `(mousedown)="$event.preventDefault(); $event.stopPropagation()"`, and BOTH halves are
|
|
115
|
+
* load-bearing.
|
|
116
|
+
*
|
|
117
|
+
* `preventDefault` — a <button> takes focus on mousedown, which blurs the editor, and the editor
|
|
118
|
+
* closes its dropdown 200ms after losing focus. Without it the menu opened and then shut itself.
|
|
119
|
+
*
|
|
120
|
+
* `stopPropagation` — the editor's click-away listener is on `document:mousedown` and exempts only
|
|
121
|
+
* presses inside the EDITOR's host. This button is a sibling of `<mj-mention-editor>`, so a press
|
|
122
|
+
* on it read as an outside press: mousedown closed the dropdown, then click saw `SkillsActive`
|
|
123
|
+
* already false and reopened it. The menu blinked, could not be dismissed by the button that
|
|
124
|
+
* opened it, and the Before/After pair fired on every click — the exact over-counting the toggle
|
|
125
|
+
* branch below exists to prevent. Stopping propagation states that this press belongs to the
|
|
126
|
+
* dropdown machinery.
|
|
127
|
+
*/
|
|
128
|
+
OnSkillsClick(event?: Event): void;
|
|
129
|
+
OnRealtimeClick(): void;
|
|
130
|
+
OnRealtimeOptionsClick(): void;
|
|
131
|
+
get CanSend(): boolean;
|
|
71
132
|
/**
|
|
72
|
-
* Handle
|
|
133
|
+
* Handle Value changes from MentionEditorComponent
|
|
73
134
|
*/
|
|
74
|
-
|
|
135
|
+
OnValueChange(newValue: string): void;
|
|
75
136
|
/**
|
|
76
137
|
* Handle attachment changes from MentionEditorComponent
|
|
77
138
|
*/
|
|
78
|
-
|
|
139
|
+
OnAttachmentsChanged(attachments: PendingAttachment[]): void;
|
|
79
140
|
/**
|
|
80
141
|
* Handle attachment errors from MentionEditorComponent
|
|
81
142
|
*/
|
|
82
|
-
|
|
143
|
+
OnAttachmentError(error: string): void;
|
|
83
144
|
/**
|
|
84
145
|
* Handle attachment click from MentionEditorComponent
|
|
85
146
|
*/
|
|
86
|
-
|
|
147
|
+
OnAttachmentClicked(attachment: PendingAttachment): void;
|
|
87
148
|
/**
|
|
88
149
|
* Handle Enter key from MentionEditorComponent
|
|
89
150
|
* Extracts plain text with JSON-encoded mentions for message submission
|
|
90
151
|
*/
|
|
91
|
-
|
|
152
|
+
OnEnterPressed(_text: string): void;
|
|
92
153
|
/**
|
|
93
154
|
* Handle mention selection from MentionEditorComponent
|
|
94
155
|
*/
|
|
95
|
-
|
|
156
|
+
OnMentionSelected(suggestion: MentionSuggestion): void;
|
|
96
157
|
/**
|
|
97
158
|
* Send the message
|
|
98
159
|
* Extracts plain text with JSON-encoded mentions for proper persistence
|
|
99
160
|
*/
|
|
100
|
-
|
|
161
|
+
OnSendClick(): void;
|
|
101
162
|
/**
|
|
102
163
|
* Handle clicks on the container - focus the mention editor
|
|
103
164
|
* Only moves cursor to end if clicking outside the contentEditable area
|
|
104
165
|
*/
|
|
105
|
-
|
|
166
|
+
OnContainerClick(event: MouseEvent): void;
|
|
106
167
|
/**
|
|
107
168
|
* Public method to focus the input programmatically
|
|
108
169
|
*/
|
|
@@ -114,7 +175,7 @@ export declare class MessageInputBoxComponent {
|
|
|
114
175
|
/**
|
|
115
176
|
* Get mention chip data including configuration presets
|
|
116
177
|
*/
|
|
117
|
-
|
|
178
|
+
GetMentionChipsData(): Array<{
|
|
118
179
|
id: string;
|
|
119
180
|
type: string;
|
|
120
181
|
name: string;
|
|
@@ -124,11 +185,11 @@ export declare class MessageInputBoxComponent {
|
|
|
124
185
|
/**
|
|
125
186
|
* Get pending attachments from the editor
|
|
126
187
|
*/
|
|
127
|
-
|
|
188
|
+
GetPendingAttachments(): PendingAttachment[];
|
|
128
189
|
/**
|
|
129
190
|
* Open file picker programmatically
|
|
130
191
|
*/
|
|
131
|
-
|
|
192
|
+
OpenFilePicker(): void;
|
|
132
193
|
/**
|
|
133
194
|
* Add an artifact as a pending attachment (called by parent after artifact selection)
|
|
134
195
|
*/
|
|
@@ -140,6 +201,6 @@ export declare class MessageInputBoxComponent {
|
|
|
140
201
|
artifactVersionId?: string;
|
|
141
202
|
}): PendingAttachment | undefined;
|
|
142
203
|
static ɵfac: i0.ɵɵFactoryDeclaration<MessageInputBoxComponent, never>;
|
|
143
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<MessageInputBoxComponent, "mj-message-input-box", never, { "
|
|
204
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MessageInputBoxComponent, "mj-message-input-box", never, { "Placeholder": { "alias": "Placeholder"; "required": false; }; "Disabled": { "alias": "Disabled"; "required": false; }; "Value": { "alias": "Value"; "required": false; }; "ShowCharacterCount": { "alias": "ShowCharacterCount"; "required": false; }; "EnableMentions": { "alias": "EnableMentions"; "required": false; }; "TriggerProviders": { "alias": "TriggerProviders"; "required": false; }; "ExcludedTriggerKeys": { "alias": "ExcludedTriggerKeys"; "required": false; }; "Provider": { "alias": "Provider"; "required": false; }; "CurrentUser": { "alias": "CurrentUser"; "required": false; }; "Rows": { "alias": "Rows"; "required": false; }; "EnableAttachments": { "alias": "EnableAttachments"; "required": false; }; "MaxAttachments": { "alias": "MaxAttachments"; "required": false; }; "MaxAttachmentSizeBytes": { "alias": "MaxAttachmentSizeBytes"; "required": false; }; "AcceptedFileTypes": { "alias": "AcceptedFileTypes"; "required": false; }; "EnableRealtime": { "alias": "EnableRealtime"; "required": false; }; "VoiceActive": { "alias": "VoiceActive"; "required": false; }; "CanStartRealtime": { "alias": "CanStartRealtime"; "required": false; }; "EnablePlanMode": { "alias": "EnablePlanMode"; "required": false; }; "PlanModeActive": { "alias": "PlanModeActive"; "required": false; }; "EnableSkills": { "alias": "EnableSkills"; "required": false; }; }, { "Blurred": "Blurred"; "TextSubmitted": "TextSubmitted"; "ValueChange": "ValueChange"; "AttachmentsChanged": "AttachmentsChanged"; "AttachmentError": "AttachmentError"; "AttachmentClicked": "AttachmentClicked"; "VoiceRequested": "VoiceRequested"; "VoiceOptionsRequested": "VoiceOptionsRequested"; "PlanModeToggle": "PlanModeToggle"; "BeforeSkillsOpened": "BeforeSkillsOpened"; "AfterSkillsOpened": "AfterSkillsOpened"; }, never, never, false, never>;
|
|
144
205
|
}
|
|
145
206
|
//# sourceMappingURL=message-input-box.component.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message-input-box.component.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/message/message-input-box.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,YAAY,EAAa,MAAM,eAAe,CAAC;AAClF,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACnE,OAAO,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAC7F,OAAO,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;;
|
|
1
|
+
{"version":3,"file":"message-input-box.component.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/message/message-input-box.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,YAAY,EAAa,MAAM,eAAe,CAAC;AAClF,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACnE,OAAO,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAC7F,OAAO,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAChG,OAAO,EAAE,2BAA2B,EAAE,MAAM,8BAA8B,CAAC;;AAE3E;;;;;;;;;;;;;;GAcG;AACH,qBAMa,wBAAwB;IACP,aAAa,CAAC,EAAE,sBAAsB,CAAC;IAE1D,WAAW,EAAE,MAAM,CAAsD;IACzE,QAAQ,EAAE,OAAO,CAAS;IAC1B,KAAK,EAAE,MAAM,CAAM;IACnB,kBAAkB,EAAE,OAAO,CAAS;IAC7C,2FAA2F;IAClF,cAAc,EAAE,OAAO,CAAQ;IACxC,8GAA8G;IACrG,gBAAgB,EAAE,uBAAuB,EAAE,GAAG,IAAI,CAAQ;IACnE,yFAAyF;IAChF,mBAAmB,EAAE,MAAM,EAAE,CAAM;IAC5C,6FAA6F;IACpF,QAAQ,EAAE,iBAAiB,GAAG,IAAI,CAAQ;IAC1C,WAAW,CAAC,EAAE,QAAQ,CAAC;IACvB,IAAI,EAAE,MAAM,CAAK;IAGjB,iBAAiB,EAAE,OAAO,CAAQ;IAClC,cAAc,EAAE,MAAM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