@mcp-elements/angular 0.1.0 → 0.1.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.
- package/dist/index.d.ts +506 -0
- package/dist/index.js +2714 -0
- package/dist/index.js.map +1 -0
- package/package.json +28 -11
- package/src/accordion.component.ts +0 -74
- package/src/ai-badge.component.ts +0 -26
- package/src/alert.component.ts +0 -25
- package/src/avatar.component.ts +0 -24
- package/src/badge.component.ts +0 -17
- package/src/button.component.ts +0 -27
- package/src/card.component.ts +0 -46
- package/src/chat-bubble.component.ts +0 -53
- package/src/chips.component.ts +0 -33
- package/src/counter.component.ts +0 -48
- package/src/dialog.component.ts +0 -42
- package/src/drawer.component.ts +0 -48
- package/src/dropdown-menu.component.ts +0 -62
- package/src/feedback.component.ts +0 -71
- package/src/index.ts +0 -86
- package/src/input.component.ts +0 -46
- package/src/loader.component.ts +0 -12
- package/src/mcp/index.ts +0 -9
- package/src/mcp/mcp-app-frame.component.ts +0 -60
- package/src/mcp/mcp-consent-dialog.component.ts +0 -63
- package/src/mcp/mcp-resource-browser.component.ts +0 -86
- package/src/mcp/mcp-scope-inspector.component.ts +0 -81
- package/src/mcp/mcp-server-status.component.ts +0 -44
- package/src/mcp/mcp-tool-call.component.ts +0 -105
- package/src/mcp/mcp-tool-form.component.ts +0 -127
- package/src/password-input.component.ts +0 -35
- package/src/popover.component.ts +0 -40
- package/src/progress.component.ts +0 -20
- package/src/prompt-input.component.ts +0 -70
- package/src/select.component.ts +0 -106
- package/src/separator.component.ts +0 -15
- package/src/skeleton.component.ts +0 -11
- package/src/source-card.component.ts +0 -34
- package/src/streaming-text.component.ts +0 -43
- package/src/suggestion-chips.component.ts +0 -23
- package/src/switch.component.ts +0 -32
- package/src/tabs.component.ts +0 -95
- package/src/textarea.component.ts +0 -22
- package/src/toast.component.ts +0 -62
- package/src/tooltip.directive.ts +0 -63
package/dist/index.js
ADDED
|
@@ -0,0 +1,2714 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
|
|
4
|
+
// src/button.component.ts
|
|
5
|
+
import { Component, computed, input } from "@angular/core";
|
|
6
|
+
function _ts_decorate(decorators, target, key, desc) {
|
|
7
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
9
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
10
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
11
|
+
}
|
|
12
|
+
__name(_ts_decorate, "_ts_decorate");
|
|
13
|
+
var SnxButtonComponent = class {
|
|
14
|
+
static {
|
|
15
|
+
__name(this, "SnxButtonComponent");
|
|
16
|
+
}
|
|
17
|
+
variant = input("primary");
|
|
18
|
+
size = input("md");
|
|
19
|
+
disabled = input(false);
|
|
20
|
+
type = input("button");
|
|
21
|
+
class = input("");
|
|
22
|
+
classes = computed(() => [
|
|
23
|
+
"mcpe-btn",
|
|
24
|
+
`mcpe-btn-${this.variant()}`,
|
|
25
|
+
`mcpe-btn-${this.size()}`,
|
|
26
|
+
this.class()
|
|
27
|
+
].filter(Boolean).join(" "));
|
|
28
|
+
};
|
|
29
|
+
SnxButtonComponent = _ts_decorate([
|
|
30
|
+
Component({
|
|
31
|
+
selector: "mcpe-button",
|
|
32
|
+
standalone: true,
|
|
33
|
+
template: `
|
|
34
|
+
<button [class]="classes()" [disabled]="disabled()" [type]="type()">
|
|
35
|
+
<ng-content />
|
|
36
|
+
</button>
|
|
37
|
+
`
|
|
38
|
+
})
|
|
39
|
+
], SnxButtonComponent);
|
|
40
|
+
|
|
41
|
+
// src/badge.component.ts
|
|
42
|
+
import { Component as Component2, computed as computed2, input as input2 } from "@angular/core";
|
|
43
|
+
function _ts_decorate2(decorators, target, key, desc) {
|
|
44
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
45
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
46
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
47
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
48
|
+
}
|
|
49
|
+
__name(_ts_decorate2, "_ts_decorate");
|
|
50
|
+
var SnxBadgeComponent = class {
|
|
51
|
+
static {
|
|
52
|
+
__name(this, "SnxBadgeComponent");
|
|
53
|
+
}
|
|
54
|
+
variant = input2("default");
|
|
55
|
+
class = input2("");
|
|
56
|
+
classes = computed2(() => [
|
|
57
|
+
"mcpe-badge",
|
|
58
|
+
`mcpe-badge-${this.variant()}`,
|
|
59
|
+
this.class()
|
|
60
|
+
].filter(Boolean).join(" "));
|
|
61
|
+
};
|
|
62
|
+
SnxBadgeComponent = _ts_decorate2([
|
|
63
|
+
Component2({
|
|
64
|
+
selector: "mcpe-badge",
|
|
65
|
+
standalone: true,
|
|
66
|
+
template: `<span [class]="classes()"><ng-content /></span>`
|
|
67
|
+
})
|
|
68
|
+
], SnxBadgeComponent);
|
|
69
|
+
|
|
70
|
+
// src/card.component.ts
|
|
71
|
+
import { Component as Component3, input as input3, computed as computed3 } from "@angular/core";
|
|
72
|
+
function _ts_decorate3(decorators, target, key, desc) {
|
|
73
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
74
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
75
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
76
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
77
|
+
}
|
|
78
|
+
__name(_ts_decorate3, "_ts_decorate");
|
|
79
|
+
var SnxCardComponent = class {
|
|
80
|
+
static {
|
|
81
|
+
__name(this, "SnxCardComponent");
|
|
82
|
+
}
|
|
83
|
+
class = input3("");
|
|
84
|
+
classes = computed3(() => [
|
|
85
|
+
"mcpe-card",
|
|
86
|
+
this.class()
|
|
87
|
+
].filter(Boolean).join(" "));
|
|
88
|
+
};
|
|
89
|
+
SnxCardComponent = _ts_decorate3([
|
|
90
|
+
Component3({
|
|
91
|
+
selector: "mcpe-card",
|
|
92
|
+
standalone: true,
|
|
93
|
+
template: `<div [class]="classes()"><ng-content /></div>`
|
|
94
|
+
})
|
|
95
|
+
], SnxCardComponent);
|
|
96
|
+
var SnxCardHeaderComponent = class {
|
|
97
|
+
static {
|
|
98
|
+
__name(this, "SnxCardHeaderComponent");
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
SnxCardHeaderComponent = _ts_decorate3([
|
|
102
|
+
Component3({
|
|
103
|
+
selector: "mcpe-card-header",
|
|
104
|
+
standalone: true,
|
|
105
|
+
template: `<div class="mcpe-card-header"><ng-content /></div>`
|
|
106
|
+
})
|
|
107
|
+
], SnxCardHeaderComponent);
|
|
108
|
+
var SnxCardTitleComponent = class {
|
|
109
|
+
static {
|
|
110
|
+
__name(this, "SnxCardTitleComponent");
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
SnxCardTitleComponent = _ts_decorate3([
|
|
114
|
+
Component3({
|
|
115
|
+
selector: "mcpe-card-title",
|
|
116
|
+
standalone: true,
|
|
117
|
+
template: `<h3 class="mcpe-card-title"><ng-content /></h3>`
|
|
118
|
+
})
|
|
119
|
+
], SnxCardTitleComponent);
|
|
120
|
+
var SnxCardDescriptionComponent = class {
|
|
121
|
+
static {
|
|
122
|
+
__name(this, "SnxCardDescriptionComponent");
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
SnxCardDescriptionComponent = _ts_decorate3([
|
|
126
|
+
Component3({
|
|
127
|
+
selector: "mcpe-card-description",
|
|
128
|
+
standalone: true,
|
|
129
|
+
template: `<p class="mcpe-card-description"><ng-content /></p>`
|
|
130
|
+
})
|
|
131
|
+
], SnxCardDescriptionComponent);
|
|
132
|
+
var SnxCardContentComponent = class {
|
|
133
|
+
static {
|
|
134
|
+
__name(this, "SnxCardContentComponent");
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
SnxCardContentComponent = _ts_decorate3([
|
|
138
|
+
Component3({
|
|
139
|
+
selector: "mcpe-card-content",
|
|
140
|
+
standalone: true,
|
|
141
|
+
template: `<div class="mcpe-card-content"><ng-content /></div>`
|
|
142
|
+
})
|
|
143
|
+
], SnxCardContentComponent);
|
|
144
|
+
var SnxCardFooterComponent = class {
|
|
145
|
+
static {
|
|
146
|
+
__name(this, "SnxCardFooterComponent");
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
SnxCardFooterComponent = _ts_decorate3([
|
|
150
|
+
Component3({
|
|
151
|
+
selector: "mcpe-card-footer",
|
|
152
|
+
standalone: true,
|
|
153
|
+
template: `<div class="mcpe-card-footer"><ng-content /></div>`
|
|
154
|
+
})
|
|
155
|
+
], SnxCardFooterComponent);
|
|
156
|
+
|
|
157
|
+
// src/input.component.ts
|
|
158
|
+
import { Component as Component4, input as input4, computed as computed4, forwardRef } from "@angular/core";
|
|
159
|
+
import { NG_VALUE_ACCESSOR } from "@angular/forms";
|
|
160
|
+
function _ts_decorate4(decorators, target, key, desc) {
|
|
161
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
162
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
163
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
164
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
165
|
+
}
|
|
166
|
+
__name(_ts_decorate4, "_ts_decorate");
|
|
167
|
+
var SnxInputComponent = class {
|
|
168
|
+
static {
|
|
169
|
+
__name(this, "SnxInputComponent");
|
|
170
|
+
}
|
|
171
|
+
type = input4("text");
|
|
172
|
+
placeholder = input4("");
|
|
173
|
+
disabled = input4(false);
|
|
174
|
+
value = input4("");
|
|
175
|
+
class = input4("");
|
|
176
|
+
classes = computed4(() => [
|
|
177
|
+
"mcpe-input",
|
|
178
|
+
this.class()
|
|
179
|
+
].filter(Boolean).join(" "));
|
|
180
|
+
onChange = /* @__PURE__ */ __name(() => {
|
|
181
|
+
}, "onChange");
|
|
182
|
+
onTouched = /* @__PURE__ */ __name(() => {
|
|
183
|
+
}, "onTouched");
|
|
184
|
+
onInput(event) {
|
|
185
|
+
const value = event.target.value;
|
|
186
|
+
this.onChange(value);
|
|
187
|
+
}
|
|
188
|
+
writeValue(value) {
|
|
189
|
+
}
|
|
190
|
+
registerOnChange(fn) {
|
|
191
|
+
this.onChange = fn;
|
|
192
|
+
}
|
|
193
|
+
registerOnTouched(fn) {
|
|
194
|
+
this.onTouched = fn;
|
|
195
|
+
}
|
|
196
|
+
};
|
|
197
|
+
SnxInputComponent = _ts_decorate4([
|
|
198
|
+
Component4({
|
|
199
|
+
selector: "mcpe-input",
|
|
200
|
+
standalone: true,
|
|
201
|
+
template: `
|
|
202
|
+
<input
|
|
203
|
+
[class]="classes()"
|
|
204
|
+
[type]="type()"
|
|
205
|
+
[placeholder]="placeholder()"
|
|
206
|
+
[disabled]="disabled()"
|
|
207
|
+
[value]="value()"
|
|
208
|
+
(input)="onInput($event)"
|
|
209
|
+
(blur)="onTouched()"
|
|
210
|
+
/>
|
|
211
|
+
`,
|
|
212
|
+
providers: [
|
|
213
|
+
{
|
|
214
|
+
provide: NG_VALUE_ACCESSOR,
|
|
215
|
+
useExisting: forwardRef(() => SnxInputComponent),
|
|
216
|
+
multi: true
|
|
217
|
+
}
|
|
218
|
+
]
|
|
219
|
+
})
|
|
220
|
+
], SnxInputComponent);
|
|
221
|
+
|
|
222
|
+
// src/textarea.component.ts
|
|
223
|
+
import { Component as Component5, input as input5, computed as computed5 } from "@angular/core";
|
|
224
|
+
function _ts_decorate5(decorators, target, key, desc) {
|
|
225
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
226
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
227
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
228
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
229
|
+
}
|
|
230
|
+
__name(_ts_decorate5, "_ts_decorate");
|
|
231
|
+
var SnxTextareaComponent = class {
|
|
232
|
+
static {
|
|
233
|
+
__name(this, "SnxTextareaComponent");
|
|
234
|
+
}
|
|
235
|
+
placeholder = input5("");
|
|
236
|
+
disabled = input5(false);
|
|
237
|
+
rows = input5(3);
|
|
238
|
+
class = input5("");
|
|
239
|
+
classes = computed5(() => [
|
|
240
|
+
"mcpe-textarea",
|
|
241
|
+
this.class()
|
|
242
|
+
].filter(Boolean).join(" "));
|
|
243
|
+
};
|
|
244
|
+
SnxTextareaComponent = _ts_decorate5([
|
|
245
|
+
Component5({
|
|
246
|
+
selector: "mcpe-textarea",
|
|
247
|
+
standalone: true,
|
|
248
|
+
template: `
|
|
249
|
+
<textarea
|
|
250
|
+
[class]="classes()"
|
|
251
|
+
[placeholder]="placeholder()"
|
|
252
|
+
[disabled]="disabled()"
|
|
253
|
+
[rows]="rows()"
|
|
254
|
+
><ng-content /></textarea>
|
|
255
|
+
`
|
|
256
|
+
})
|
|
257
|
+
], SnxTextareaComponent);
|
|
258
|
+
|
|
259
|
+
// src/avatar.component.ts
|
|
260
|
+
import { Component as Component6, input as input6, computed as computed6, signal } from "@angular/core";
|
|
261
|
+
function _ts_decorate6(decorators, target, key, desc) {
|
|
262
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
263
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
264
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
265
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
266
|
+
}
|
|
267
|
+
__name(_ts_decorate6, "_ts_decorate");
|
|
268
|
+
var SnxAvatarComponent = class {
|
|
269
|
+
static {
|
|
270
|
+
__name(this, "SnxAvatarComponent");
|
|
271
|
+
}
|
|
272
|
+
src = input6("");
|
|
273
|
+
alt = input6("");
|
|
274
|
+
fallback = input6("");
|
|
275
|
+
class = input6("");
|
|
276
|
+
hasError = signal(false);
|
|
277
|
+
classes = computed6(() => [
|
|
278
|
+
"mcpe-avatar",
|
|
279
|
+
this.class()
|
|
280
|
+
].filter(Boolean).join(" "));
|
|
281
|
+
};
|
|
282
|
+
SnxAvatarComponent = _ts_decorate6([
|
|
283
|
+
Component6({
|
|
284
|
+
selector: "mcpe-avatar",
|
|
285
|
+
standalone: true,
|
|
286
|
+
template: `
|
|
287
|
+
<div [class]="classes()">
|
|
288
|
+
@if (src() && !hasError()) {
|
|
289
|
+
<img [src]="src()" [alt]="alt()" class="mcpe-avatar-image" (error)="hasError.set(true)" />
|
|
290
|
+
} @else {
|
|
291
|
+
<span class="mcpe-avatar-fallback">{{ fallback() }}</span>
|
|
292
|
+
}
|
|
293
|
+
</div>
|
|
294
|
+
`
|
|
295
|
+
})
|
|
296
|
+
], SnxAvatarComponent);
|
|
297
|
+
|
|
298
|
+
// src/separator.component.ts
|
|
299
|
+
import { Component as Component7, input as input7, computed as computed7 } from "@angular/core";
|
|
300
|
+
function _ts_decorate7(decorators, target, key, desc) {
|
|
301
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
302
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
303
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
304
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
305
|
+
}
|
|
306
|
+
__name(_ts_decorate7, "_ts_decorate");
|
|
307
|
+
var SnxSeparatorComponent = class {
|
|
308
|
+
static {
|
|
309
|
+
__name(this, "SnxSeparatorComponent");
|
|
310
|
+
}
|
|
311
|
+
orientation = input7("horizontal");
|
|
312
|
+
class = input7("");
|
|
313
|
+
classes = computed7(() => [
|
|
314
|
+
"mcpe-separator",
|
|
315
|
+
`mcpe-separator-${this.orientation()}`,
|
|
316
|
+
this.class()
|
|
317
|
+
].filter(Boolean).join(" "));
|
|
318
|
+
};
|
|
319
|
+
SnxSeparatorComponent = _ts_decorate7([
|
|
320
|
+
Component7({
|
|
321
|
+
selector: "mcpe-separator",
|
|
322
|
+
standalone: true,
|
|
323
|
+
template: `<div [class]="classes()" role="separator" [attr.aria-orientation]="orientation()"></div>`
|
|
324
|
+
})
|
|
325
|
+
], SnxSeparatorComponent);
|
|
326
|
+
|
|
327
|
+
// src/skeleton.component.ts
|
|
328
|
+
import { Component as Component8, input as input8, computed as computed8 } from "@angular/core";
|
|
329
|
+
function _ts_decorate8(decorators, target, key, desc) {
|
|
330
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
331
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
332
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
333
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
334
|
+
}
|
|
335
|
+
__name(_ts_decorate8, "_ts_decorate");
|
|
336
|
+
var SnxSkeletonComponent = class {
|
|
337
|
+
static {
|
|
338
|
+
__name(this, "SnxSkeletonComponent");
|
|
339
|
+
}
|
|
340
|
+
class = input8("");
|
|
341
|
+
classes = computed8(() => [
|
|
342
|
+
"mcpe-skeleton",
|
|
343
|
+
this.class()
|
|
344
|
+
].filter(Boolean).join(" "));
|
|
345
|
+
};
|
|
346
|
+
SnxSkeletonComponent = _ts_decorate8([
|
|
347
|
+
Component8({
|
|
348
|
+
selector: "mcpe-skeleton",
|
|
349
|
+
standalone: true,
|
|
350
|
+
template: `<div [class]="classes()"></div>`
|
|
351
|
+
})
|
|
352
|
+
], SnxSkeletonComponent);
|
|
353
|
+
|
|
354
|
+
// src/dialog.component.ts
|
|
355
|
+
import { Component as Component9, input as input9, output, signal as signal2 } from "@angular/core";
|
|
356
|
+
function _ts_decorate9(decorators, target, key, desc) {
|
|
357
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
358
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
359
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
360
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
361
|
+
}
|
|
362
|
+
__name(_ts_decorate9, "_ts_decorate");
|
|
363
|
+
var SnxDialogComponent = class {
|
|
364
|
+
static {
|
|
365
|
+
__name(this, "SnxDialogComponent");
|
|
366
|
+
}
|
|
367
|
+
modal = input9(true);
|
|
368
|
+
open = signal2(false);
|
|
369
|
+
openChange = output();
|
|
370
|
+
toggle() {
|
|
371
|
+
this.open.update((v) => !v);
|
|
372
|
+
this.openChange.emit(this.open());
|
|
373
|
+
}
|
|
374
|
+
close() {
|
|
375
|
+
this.open.set(false);
|
|
376
|
+
this.openChange.emit(false);
|
|
377
|
+
}
|
|
378
|
+
show() {
|
|
379
|
+
this.open.set(true);
|
|
380
|
+
this.openChange.emit(true);
|
|
381
|
+
}
|
|
382
|
+
};
|
|
383
|
+
SnxDialogComponent = _ts_decorate9([
|
|
384
|
+
Component9({
|
|
385
|
+
selector: "mcpe-dialog",
|
|
386
|
+
standalone: true,
|
|
387
|
+
template: `
|
|
388
|
+
@if (open()) {
|
|
389
|
+
<div class="mcpe-dialog-overlay" (click)="close()"></div>
|
|
390
|
+
<div
|
|
391
|
+
#content
|
|
392
|
+
class="mcpe-dialog-content"
|
|
393
|
+
role="dialog"
|
|
394
|
+
[attr.aria-modal]="modal()"
|
|
395
|
+
(keydown.escape)="close()"
|
|
396
|
+
>
|
|
397
|
+
<ng-content />
|
|
398
|
+
<button class="mcpe-dialog-close" (click)="close()" aria-label="Close">✕</button>
|
|
399
|
+
</div>
|
|
400
|
+
}
|
|
401
|
+
`
|
|
402
|
+
})
|
|
403
|
+
], SnxDialogComponent);
|
|
404
|
+
|
|
405
|
+
// src/tabs.component.ts
|
|
406
|
+
import { Component as Component10, input as input10, output as output2, signal as signal3, computed as computed9, effect } from "@angular/core";
|
|
407
|
+
import { createTabs } from "@mcp-elements/core";
|
|
408
|
+
function _ts_decorate10(decorators, target, key, desc) {
|
|
409
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
410
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
411
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
412
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
413
|
+
}
|
|
414
|
+
__name(_ts_decorate10, "_ts_decorate");
|
|
415
|
+
function _ts_metadata(k, v) {
|
|
416
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
417
|
+
}
|
|
418
|
+
__name(_ts_metadata, "_ts_metadata");
|
|
419
|
+
var SnxTabsComponent = class {
|
|
420
|
+
static {
|
|
421
|
+
__name(this, "SnxTabsComponent");
|
|
422
|
+
}
|
|
423
|
+
items = input10([]);
|
|
424
|
+
defaultValue = input10("");
|
|
425
|
+
activeValue = signal3("");
|
|
426
|
+
api = computed9(() => createTabs(this.items(), {
|
|
427
|
+
defaultValue: this.defaultValue(),
|
|
428
|
+
onValueChange: /* @__PURE__ */ __name((v) => this.activeValue.set(v), "onValueChange")
|
|
429
|
+
}));
|
|
430
|
+
constructor() {
|
|
431
|
+
effect(() => {
|
|
432
|
+
const def = this.defaultValue();
|
|
433
|
+
const items = this.items();
|
|
434
|
+
if (def) {
|
|
435
|
+
this.activeValue.set(def);
|
|
436
|
+
} else if (items.length > 0) {
|
|
437
|
+
this.activeValue.set(items[0].value);
|
|
438
|
+
}
|
|
439
|
+
});
|
|
440
|
+
}
|
|
441
|
+
getTabProps(value) {
|
|
442
|
+
return this.api().getTriggerProps(value, this.activeValue());
|
|
443
|
+
}
|
|
444
|
+
getPanelProps(value) {
|
|
445
|
+
return this.api().getPanelProps(value, this.activeValue());
|
|
446
|
+
}
|
|
447
|
+
isActive(value) {
|
|
448
|
+
return this.activeValue() === value;
|
|
449
|
+
}
|
|
450
|
+
select(value) {
|
|
451
|
+
this.activeValue.set(value);
|
|
452
|
+
}
|
|
453
|
+
};
|
|
454
|
+
SnxTabsComponent = _ts_decorate10([
|
|
455
|
+
Component10({
|
|
456
|
+
selector: "mcpe-tabs",
|
|
457
|
+
standalone: true,
|
|
458
|
+
template: `<div><ng-content /></div>`
|
|
459
|
+
}),
|
|
460
|
+
_ts_metadata("design:type", Function),
|
|
461
|
+
_ts_metadata("design:paramtypes", [])
|
|
462
|
+
], SnxTabsComponent);
|
|
463
|
+
var SnxTabsListComponent = class {
|
|
464
|
+
static {
|
|
465
|
+
__name(this, "SnxTabsListComponent");
|
|
466
|
+
}
|
|
467
|
+
};
|
|
468
|
+
SnxTabsListComponent = _ts_decorate10([
|
|
469
|
+
Component10({
|
|
470
|
+
selector: "mcpe-tabs-list",
|
|
471
|
+
standalone: true,
|
|
472
|
+
template: `<div role="tablist" class="mcpe-tabs-list"><ng-content /></div>`
|
|
473
|
+
})
|
|
474
|
+
], SnxTabsListComponent);
|
|
475
|
+
var SnxTabsTriggerComponent = class {
|
|
476
|
+
static {
|
|
477
|
+
__name(this, "SnxTabsTriggerComponent");
|
|
478
|
+
}
|
|
479
|
+
isActive = input10(false);
|
|
480
|
+
onClick = output2();
|
|
481
|
+
class = input10("");
|
|
482
|
+
classes = computed9(() => [
|
|
483
|
+
"mcpe-tabs-trigger",
|
|
484
|
+
this.isActive() ? "mcpe-tabs-trigger-active" : "",
|
|
485
|
+
this.class()
|
|
486
|
+
].filter(Boolean).join(" "));
|
|
487
|
+
};
|
|
488
|
+
SnxTabsTriggerComponent = _ts_decorate10([
|
|
489
|
+
Component10({
|
|
490
|
+
selector: "mcpe-tabs-trigger",
|
|
491
|
+
standalone: true,
|
|
492
|
+
template: `
|
|
493
|
+
<button
|
|
494
|
+
role="tab"
|
|
495
|
+
[class]="classes()"
|
|
496
|
+
[attr.aria-selected]="isActive()"
|
|
497
|
+
[attr.tabindex]="isActive() ? 0 : -1"
|
|
498
|
+
(click)="onClick.emit()"
|
|
499
|
+
>
|
|
500
|
+
<ng-content />
|
|
501
|
+
</button>
|
|
502
|
+
`
|
|
503
|
+
})
|
|
504
|
+
], SnxTabsTriggerComponent);
|
|
505
|
+
var SnxTabsContentComponent = class {
|
|
506
|
+
static {
|
|
507
|
+
__name(this, "SnxTabsContentComponent");
|
|
508
|
+
}
|
|
509
|
+
isActive = input10(false);
|
|
510
|
+
};
|
|
511
|
+
SnxTabsContentComponent = _ts_decorate10([
|
|
512
|
+
Component10({
|
|
513
|
+
selector: "mcpe-tabs-content",
|
|
514
|
+
standalone: true,
|
|
515
|
+
template: `
|
|
516
|
+
@if (isActive()) {
|
|
517
|
+
<div role="tabpanel" class="mcpe-tabs-content"><ng-content /></div>
|
|
518
|
+
}
|
|
519
|
+
`
|
|
520
|
+
})
|
|
521
|
+
], SnxTabsContentComponent);
|
|
522
|
+
|
|
523
|
+
// src/accordion.component.ts
|
|
524
|
+
import { Component as Component11, input as input11, output as output3, signal as signal4, computed as computed10 } from "@angular/core";
|
|
525
|
+
import { createAccordion } from "@mcp-elements/core";
|
|
526
|
+
function _ts_decorate11(decorators, target, key, desc) {
|
|
527
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
528
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
529
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
530
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
531
|
+
}
|
|
532
|
+
__name(_ts_decorate11, "_ts_decorate");
|
|
533
|
+
var SnxAccordionComponent = class {
|
|
534
|
+
static {
|
|
535
|
+
__name(this, "SnxAccordionComponent");
|
|
536
|
+
}
|
|
537
|
+
items = input11([]);
|
|
538
|
+
type = input11("single");
|
|
539
|
+
collapsible = input11(false);
|
|
540
|
+
expandedValues = signal4([]);
|
|
541
|
+
api = computed10(() => createAccordion(this.items(), {
|
|
542
|
+
type: this.type(),
|
|
543
|
+
collapsible: this.collapsible(),
|
|
544
|
+
onValueChange: /* @__PURE__ */ __name((v) => this.expandedValues.set(v), "onValueChange")
|
|
545
|
+
}));
|
|
546
|
+
isExpanded(value) {
|
|
547
|
+
return this.expandedValues().includes(value);
|
|
548
|
+
}
|
|
549
|
+
toggle(value) {
|
|
550
|
+
const props = this.api().getTriggerProps(value, this.expandedValues());
|
|
551
|
+
props.onClick();
|
|
552
|
+
}
|
|
553
|
+
};
|
|
554
|
+
SnxAccordionComponent = _ts_decorate11([
|
|
555
|
+
Component11({
|
|
556
|
+
selector: "mcpe-accordion",
|
|
557
|
+
standalone: true,
|
|
558
|
+
template: `<div><ng-content /></div>`
|
|
559
|
+
})
|
|
560
|
+
], SnxAccordionComponent);
|
|
561
|
+
var SnxAccordionItemComponent = class {
|
|
562
|
+
static {
|
|
563
|
+
__name(this, "SnxAccordionItemComponent");
|
|
564
|
+
}
|
|
565
|
+
};
|
|
566
|
+
SnxAccordionItemComponent = _ts_decorate11([
|
|
567
|
+
Component11({
|
|
568
|
+
selector: "mcpe-accordion-item",
|
|
569
|
+
standalone: true,
|
|
570
|
+
template: `<div class="mcpe-accordion-item"><ng-content /></div>`
|
|
571
|
+
})
|
|
572
|
+
], SnxAccordionItemComponent);
|
|
573
|
+
var SnxAccordionTriggerComponent = class {
|
|
574
|
+
static {
|
|
575
|
+
__name(this, "SnxAccordionTriggerComponent");
|
|
576
|
+
}
|
|
577
|
+
isExpanded = input11(false);
|
|
578
|
+
onClick = output3();
|
|
579
|
+
};
|
|
580
|
+
SnxAccordionTriggerComponent = _ts_decorate11([
|
|
581
|
+
Component11({
|
|
582
|
+
selector: "mcpe-accordion-trigger",
|
|
583
|
+
standalone: true,
|
|
584
|
+
template: `
|
|
585
|
+
<h3>
|
|
586
|
+
<button
|
|
587
|
+
[class]="'mcpe-accordion-trigger'"
|
|
588
|
+
[attr.aria-expanded]="isExpanded()"
|
|
589
|
+
(click)="onClick.emit()"
|
|
590
|
+
>
|
|
591
|
+
<ng-content />
|
|
592
|
+
<svg class="mcpe-accordion-chevron" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
593
|
+
<path d="m6 9 6 6 6-6" />
|
|
594
|
+
</svg>
|
|
595
|
+
</button>
|
|
596
|
+
</h3>
|
|
597
|
+
`
|
|
598
|
+
})
|
|
599
|
+
], SnxAccordionTriggerComponent);
|
|
600
|
+
var SnxAccordionContentComponent = class {
|
|
601
|
+
static {
|
|
602
|
+
__name(this, "SnxAccordionContentComponent");
|
|
603
|
+
}
|
|
604
|
+
isExpanded = input11(false);
|
|
605
|
+
};
|
|
606
|
+
SnxAccordionContentComponent = _ts_decorate11([
|
|
607
|
+
Component11({
|
|
608
|
+
selector: "mcpe-accordion-content",
|
|
609
|
+
standalone: true,
|
|
610
|
+
template: `
|
|
611
|
+
@if (isExpanded()) {
|
|
612
|
+
<div role="region" class="mcpe-accordion-content"><ng-content /></div>
|
|
613
|
+
}
|
|
614
|
+
`
|
|
615
|
+
})
|
|
616
|
+
], SnxAccordionContentComponent);
|
|
617
|
+
|
|
618
|
+
// src/select.component.ts
|
|
619
|
+
import { Component as Component12, input as input12, output as output4, signal as signal5, computed as computed11, viewChild } from "@angular/core";
|
|
620
|
+
function _ts_decorate12(decorators, target, key, desc) {
|
|
621
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
622
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
623
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
624
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
625
|
+
}
|
|
626
|
+
__name(_ts_decorate12, "_ts_decorate");
|
|
627
|
+
var SnxSelectComponent = class {
|
|
628
|
+
static {
|
|
629
|
+
__name(this, "SnxSelectComponent");
|
|
630
|
+
}
|
|
631
|
+
options = input12([]);
|
|
632
|
+
placeholder = input12("Select...");
|
|
633
|
+
valueChange = output4();
|
|
634
|
+
isOpen = signal5(false);
|
|
635
|
+
selectedValue = signal5(null);
|
|
636
|
+
highlightedIndex = signal5(0);
|
|
637
|
+
container = viewChild("container");
|
|
638
|
+
selectedLabel = computed11(() => {
|
|
639
|
+
const val = this.selectedValue();
|
|
640
|
+
return this.options().find((o) => o.value === val)?.label ?? "";
|
|
641
|
+
});
|
|
642
|
+
toggle() {
|
|
643
|
+
this.isOpen.update((v) => !v);
|
|
644
|
+
}
|
|
645
|
+
selectOption(option) {
|
|
646
|
+
if (option.disabled) return;
|
|
647
|
+
this.selectedValue.set(option.value);
|
|
648
|
+
this.valueChange.emit(option.value);
|
|
649
|
+
this.isOpen.set(false);
|
|
650
|
+
}
|
|
651
|
+
getItemClasses(option, index) {
|
|
652
|
+
return [
|
|
653
|
+
"mcpe-select-item",
|
|
654
|
+
index === this.highlightedIndex() ? "mcpe-select-item-active" : "",
|
|
655
|
+
option.value === this.selectedValue() ? "mcpe-select-item-selected" : ""
|
|
656
|
+
].filter(Boolean).join(" ");
|
|
657
|
+
}
|
|
658
|
+
onKeyDown(event) {
|
|
659
|
+
const opts = this.options().filter((o) => !o.disabled);
|
|
660
|
+
if (event.key === "ArrowDown") {
|
|
661
|
+
event.preventDefault();
|
|
662
|
+
if (!this.isOpen()) {
|
|
663
|
+
this.isOpen.set(true);
|
|
664
|
+
return;
|
|
665
|
+
}
|
|
666
|
+
this.highlightedIndex.update((i) => (i + 1) % opts.length);
|
|
667
|
+
} else if (event.key === "ArrowUp") {
|
|
668
|
+
event.preventDefault();
|
|
669
|
+
this.highlightedIndex.update((i) => (i - 1 + opts.length) % opts.length);
|
|
670
|
+
} else if (event.key === "Enter" || event.key === " ") {
|
|
671
|
+
event.preventDefault();
|
|
672
|
+
if (this.isOpen()) {
|
|
673
|
+
const opt = opts[this.highlightedIndex()];
|
|
674
|
+
if (opt) this.selectOption(opt);
|
|
675
|
+
} else {
|
|
676
|
+
this.isOpen.set(true);
|
|
677
|
+
}
|
|
678
|
+
} else if (event.key === "Escape") {
|
|
679
|
+
this.isOpen.set(false);
|
|
680
|
+
}
|
|
681
|
+
}
|
|
682
|
+
onDocumentClick(event) {
|
|
683
|
+
const el = this.container()?.nativeElement;
|
|
684
|
+
if (el && !el.contains(event.target)) {
|
|
685
|
+
this.isOpen.set(false);
|
|
686
|
+
}
|
|
687
|
+
}
|
|
688
|
+
};
|
|
689
|
+
SnxSelectComponent = _ts_decorate12([
|
|
690
|
+
Component12({
|
|
691
|
+
selector: "mcpe-select",
|
|
692
|
+
standalone: true,
|
|
693
|
+
template: `
|
|
694
|
+
<div class="relative" #container>
|
|
695
|
+
<button
|
|
696
|
+
class="mcpe-select-trigger"
|
|
697
|
+
[attr.aria-expanded]="isOpen()"
|
|
698
|
+
aria-haspopup="listbox"
|
|
699
|
+
(click)="toggle()"
|
|
700
|
+
(keydown)="onKeyDown($event)"
|
|
701
|
+
>
|
|
702
|
+
<span>{{ selectedLabel() || placeholder() }}</span>
|
|
703
|
+
<svg class="h-4 w-4 opacity-50" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
704
|
+
<path d="m6 9 6 6 6-6" />
|
|
705
|
+
</svg>
|
|
706
|
+
</button>
|
|
707
|
+
@if (isOpen()) {
|
|
708
|
+
<div class="mcpe-select-content absolute top-full mt-1 w-full">
|
|
709
|
+
<div class="mcpe-select-viewport" role="listbox">
|
|
710
|
+
@for (option of options(); track option.value; let i = $index) {
|
|
711
|
+
<div
|
|
712
|
+
role="option"
|
|
713
|
+
[attr.aria-selected]="option.value === selectedValue()"
|
|
714
|
+
[attr.aria-disabled]="option.disabled"
|
|
715
|
+
[class]="getItemClasses(option, i)"
|
|
716
|
+
(click)="selectOption(option)"
|
|
717
|
+
(mouseenter)="highlightedIndex.set(i)"
|
|
718
|
+
>
|
|
719
|
+
{{ option.label }}
|
|
720
|
+
</div>
|
|
721
|
+
}
|
|
722
|
+
</div>
|
|
723
|
+
</div>
|
|
724
|
+
}
|
|
725
|
+
</div>
|
|
726
|
+
`,
|
|
727
|
+
host: {
|
|
728
|
+
"(document:click)": "onDocumentClick($event)"
|
|
729
|
+
}
|
|
730
|
+
})
|
|
731
|
+
], SnxSelectComponent);
|
|
732
|
+
|
|
733
|
+
// src/tooltip.directive.ts
|
|
734
|
+
import { Directive, input as input13, HostListener, ElementRef, Renderer2 } from "@angular/core";
|
|
735
|
+
function _ts_decorate13(decorators, target, key, desc) {
|
|
736
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
737
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
738
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
739
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
740
|
+
}
|
|
741
|
+
__name(_ts_decorate13, "_ts_decorate");
|
|
742
|
+
function _ts_metadata2(k, v) {
|
|
743
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
744
|
+
}
|
|
745
|
+
__name(_ts_metadata2, "_ts_metadata");
|
|
746
|
+
var SnxTooltipDirective = class {
|
|
747
|
+
static {
|
|
748
|
+
__name(this, "SnxTooltipDirective");
|
|
749
|
+
}
|
|
750
|
+
el;
|
|
751
|
+
renderer;
|
|
752
|
+
mcpeTooltip = input13("");
|
|
753
|
+
tooltipDelay = input13(700);
|
|
754
|
+
tooltipEl = null;
|
|
755
|
+
timeoutId = null;
|
|
756
|
+
constructor(el, renderer) {
|
|
757
|
+
this.el = el;
|
|
758
|
+
this.renderer = renderer;
|
|
759
|
+
}
|
|
760
|
+
onShow() {
|
|
761
|
+
this.clearDelay();
|
|
762
|
+
this.timeoutId = setTimeout(() => this.show(), this.tooltipDelay());
|
|
763
|
+
}
|
|
764
|
+
onHide() {
|
|
765
|
+
this.clearDelay();
|
|
766
|
+
this.hide();
|
|
767
|
+
}
|
|
768
|
+
show() {
|
|
769
|
+
if (this.tooltipEl) return;
|
|
770
|
+
this.tooltipEl = this.renderer.createElement("div");
|
|
771
|
+
this.renderer.addClass(this.tooltipEl, "mcpe-tooltip-content");
|
|
772
|
+
this.renderer.setStyle(this.tooltipEl, "position", "absolute");
|
|
773
|
+
this.renderer.setStyle(this.tooltipEl, "bottom", "100%");
|
|
774
|
+
this.renderer.setStyle(this.tooltipEl, "left", "50%");
|
|
775
|
+
this.renderer.setStyle(this.tooltipEl, "transform", "translateX(-50%)");
|
|
776
|
+
this.renderer.setStyle(this.tooltipEl, "margin-bottom", "0.5rem");
|
|
777
|
+
const text = this.renderer.createText(this.mcpeTooltip());
|
|
778
|
+
this.renderer.appendChild(this.tooltipEl, text);
|
|
779
|
+
this.renderer.setStyle(this.el.nativeElement, "position", "relative");
|
|
780
|
+
this.renderer.appendChild(this.el.nativeElement, this.tooltipEl);
|
|
781
|
+
}
|
|
782
|
+
hide() {
|
|
783
|
+
if (this.tooltipEl) {
|
|
784
|
+
this.renderer.removeChild(this.el.nativeElement, this.tooltipEl);
|
|
785
|
+
this.tooltipEl = null;
|
|
786
|
+
}
|
|
787
|
+
}
|
|
788
|
+
clearDelay() {
|
|
789
|
+
if (this.timeoutId !== null) {
|
|
790
|
+
clearTimeout(this.timeoutId);
|
|
791
|
+
this.timeoutId = null;
|
|
792
|
+
}
|
|
793
|
+
}
|
|
794
|
+
ngOnDestroy() {
|
|
795
|
+
this.clearDelay();
|
|
796
|
+
this.hide();
|
|
797
|
+
}
|
|
798
|
+
};
|
|
799
|
+
_ts_decorate13([
|
|
800
|
+
HostListener("mouseenter"),
|
|
801
|
+
HostListener("focus"),
|
|
802
|
+
_ts_metadata2("design:type", Function),
|
|
803
|
+
_ts_metadata2("design:paramtypes", []),
|
|
804
|
+
_ts_metadata2("design:returntype", void 0)
|
|
805
|
+
], SnxTooltipDirective.prototype, "onShow", null);
|
|
806
|
+
_ts_decorate13([
|
|
807
|
+
HostListener("mouseleave"),
|
|
808
|
+
HostListener("blur"),
|
|
809
|
+
_ts_metadata2("design:type", Function),
|
|
810
|
+
_ts_metadata2("design:paramtypes", []),
|
|
811
|
+
_ts_metadata2("design:returntype", void 0)
|
|
812
|
+
], SnxTooltipDirective.prototype, "onHide", null);
|
|
813
|
+
SnxTooltipDirective = _ts_decorate13([
|
|
814
|
+
Directive({
|
|
815
|
+
selector: "[mcpeTooltip]",
|
|
816
|
+
standalone: true
|
|
817
|
+
}),
|
|
818
|
+
_ts_metadata2("design:type", Function),
|
|
819
|
+
_ts_metadata2("design:paramtypes", [
|
|
820
|
+
typeof ElementRef === "undefined" ? Object : ElementRef,
|
|
821
|
+
typeof Renderer2 === "undefined" ? Object : Renderer2
|
|
822
|
+
])
|
|
823
|
+
], SnxTooltipDirective);
|
|
824
|
+
|
|
825
|
+
// src/popover.component.ts
|
|
826
|
+
import { Component as Component13, signal as signal6, viewChild as viewChild2 } from "@angular/core";
|
|
827
|
+
function _ts_decorate14(decorators, target, key, desc) {
|
|
828
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
829
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
830
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
831
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
832
|
+
}
|
|
833
|
+
__name(_ts_decorate14, "_ts_decorate");
|
|
834
|
+
var SnxPopoverComponent = class {
|
|
835
|
+
static {
|
|
836
|
+
__name(this, "SnxPopoverComponent");
|
|
837
|
+
}
|
|
838
|
+
isOpen = signal6(false);
|
|
839
|
+
container = viewChild2("container");
|
|
840
|
+
toggle() {
|
|
841
|
+
this.isOpen.update((v) => !v);
|
|
842
|
+
}
|
|
843
|
+
close() {
|
|
844
|
+
this.isOpen.set(false);
|
|
845
|
+
}
|
|
846
|
+
show() {
|
|
847
|
+
this.isOpen.set(true);
|
|
848
|
+
}
|
|
849
|
+
onDocumentClick(event) {
|
|
850
|
+
const el = this.container()?.nativeElement;
|
|
851
|
+
if (el && !el.contains(event.target)) {
|
|
852
|
+
this.isOpen.set(false);
|
|
853
|
+
}
|
|
854
|
+
}
|
|
855
|
+
};
|
|
856
|
+
SnxPopoverComponent = _ts_decorate14([
|
|
857
|
+
Component13({
|
|
858
|
+
selector: "mcpe-popover",
|
|
859
|
+
standalone: true,
|
|
860
|
+
template: `
|
|
861
|
+
<div class="relative inline-block" #container>
|
|
862
|
+
<div (click)="toggle()">
|
|
863
|
+
<ng-content select="[trigger]" />
|
|
864
|
+
</div>
|
|
865
|
+
@if (isOpen()) {
|
|
866
|
+
<div
|
|
867
|
+
class="mcpe-popover-content absolute top-full mt-2"
|
|
868
|
+
role="dialog"
|
|
869
|
+
(keydown.escape)="close()"
|
|
870
|
+
>
|
|
871
|
+
<ng-content />
|
|
872
|
+
</div>
|
|
873
|
+
}
|
|
874
|
+
</div>
|
|
875
|
+
`,
|
|
876
|
+
host: {
|
|
877
|
+
"(document:click)": "onDocumentClick($event)"
|
|
878
|
+
}
|
|
879
|
+
})
|
|
880
|
+
], SnxPopoverComponent);
|
|
881
|
+
|
|
882
|
+
// src/toast.component.ts
|
|
883
|
+
import { Component as Component14, Injectable, signal as signal7 } from "@angular/core";
|
|
884
|
+
function _ts_decorate15(decorators, target, key, desc) {
|
|
885
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
886
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
887
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
888
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
889
|
+
}
|
|
890
|
+
__name(_ts_decorate15, "_ts_decorate");
|
|
891
|
+
function _ts_metadata3(k, v) {
|
|
892
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
893
|
+
}
|
|
894
|
+
__name(_ts_metadata3, "_ts_metadata");
|
|
895
|
+
var SnxToastService = class {
|
|
896
|
+
static {
|
|
897
|
+
__name(this, "SnxToastService");
|
|
898
|
+
}
|
|
899
|
+
toasts = signal7([]);
|
|
900
|
+
counter = 0;
|
|
901
|
+
show(toast, duration = 5e3) {
|
|
902
|
+
const id = `toast-${++this.counter}`;
|
|
903
|
+
this.toasts.update((t) => [
|
|
904
|
+
...t,
|
|
905
|
+
{
|
|
906
|
+
id,
|
|
907
|
+
...toast
|
|
908
|
+
}
|
|
909
|
+
]);
|
|
910
|
+
if (duration > 0) {
|
|
911
|
+
setTimeout(() => this.dismiss(id), duration);
|
|
912
|
+
}
|
|
913
|
+
return id;
|
|
914
|
+
}
|
|
915
|
+
success(title, description) {
|
|
916
|
+
return this.show({
|
|
917
|
+
title,
|
|
918
|
+
description,
|
|
919
|
+
variant: "success"
|
|
920
|
+
});
|
|
921
|
+
}
|
|
922
|
+
error(title, description) {
|
|
923
|
+
return this.show({
|
|
924
|
+
title,
|
|
925
|
+
description,
|
|
926
|
+
variant: "destructive"
|
|
927
|
+
});
|
|
928
|
+
}
|
|
929
|
+
dismiss(id) {
|
|
930
|
+
this.toasts.update((t) => t.filter((x) => x.id !== id));
|
|
931
|
+
}
|
|
932
|
+
};
|
|
933
|
+
SnxToastService = _ts_decorate15([
|
|
934
|
+
Injectable({
|
|
935
|
+
providedIn: "root"
|
|
936
|
+
})
|
|
937
|
+
], SnxToastService);
|
|
938
|
+
var SnxToasterComponent = class {
|
|
939
|
+
static {
|
|
940
|
+
__name(this, "SnxToasterComponent");
|
|
941
|
+
}
|
|
942
|
+
toastService;
|
|
943
|
+
constructor(toastService) {
|
|
944
|
+
this.toastService = toastService;
|
|
945
|
+
}
|
|
946
|
+
};
|
|
947
|
+
SnxToasterComponent = _ts_decorate15([
|
|
948
|
+
Component14({
|
|
949
|
+
selector: "mcpe-toaster",
|
|
950
|
+
standalone: true,
|
|
951
|
+
template: `
|
|
952
|
+
<div class="mcpe-toaster mcpe-toaster-bottom-right">
|
|
953
|
+
@for (t of toastService.toasts(); track t.id) {
|
|
954
|
+
<div
|
|
955
|
+
[class]="'mcpe-toast group' + (t.variant === 'destructive' ? ' mcpe-toast-destructive' : '') + (t.variant === 'success' ? ' mcpe-toast-success' : '')"
|
|
956
|
+
>
|
|
957
|
+
<div class="flex-1">
|
|
958
|
+
@if (t.title) { <div class="mcpe-toast-title">{{ t.title }}</div> }
|
|
959
|
+
@if (t.description) { <div class="mcpe-toast-description">{{ t.description }}</div> }
|
|
960
|
+
</div>
|
|
961
|
+
<button class="mcpe-toast-close" (click)="toastService.dismiss(t.id)" aria-label="Close">
|
|
962
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
963
|
+
<path d="M18 6 6 18" /><path d="m6 6 12 12" />
|
|
964
|
+
</svg>
|
|
965
|
+
</button>
|
|
966
|
+
</div>
|
|
967
|
+
}
|
|
968
|
+
</div>
|
|
969
|
+
`
|
|
970
|
+
}),
|
|
971
|
+
_ts_metadata3("design:type", Function),
|
|
972
|
+
_ts_metadata3("design:paramtypes", [
|
|
973
|
+
typeof SnxToastService === "undefined" ? Object : SnxToastService
|
|
974
|
+
])
|
|
975
|
+
], SnxToasterComponent);
|
|
976
|
+
|
|
977
|
+
// src/drawer.component.ts
|
|
978
|
+
import { Component as Component15, input as input14, output as output5, signal as signal8 } from "@angular/core";
|
|
979
|
+
function _ts_decorate16(decorators, target, key, desc) {
|
|
980
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
981
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
982
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
983
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
984
|
+
}
|
|
985
|
+
__name(_ts_decorate16, "_ts_decorate");
|
|
986
|
+
var SnxDrawerComponent = class {
|
|
987
|
+
static {
|
|
988
|
+
__name(this, "SnxDrawerComponent");
|
|
989
|
+
}
|
|
990
|
+
side = input14("right");
|
|
991
|
+
open = signal8(false);
|
|
992
|
+
openChange = output5();
|
|
993
|
+
show() {
|
|
994
|
+
this.open.set(true);
|
|
995
|
+
this.openChange.emit(true);
|
|
996
|
+
}
|
|
997
|
+
close() {
|
|
998
|
+
this.open.set(false);
|
|
999
|
+
this.openChange.emit(false);
|
|
1000
|
+
}
|
|
1001
|
+
toggle() {
|
|
1002
|
+
this.open.update((v) => !v);
|
|
1003
|
+
this.openChange.emit(this.open());
|
|
1004
|
+
}
|
|
1005
|
+
};
|
|
1006
|
+
SnxDrawerComponent = _ts_decorate16([
|
|
1007
|
+
Component15({
|
|
1008
|
+
selector: "mcpe-drawer",
|
|
1009
|
+
standalone: true,
|
|
1010
|
+
template: `
|
|
1011
|
+
@if (open()) {
|
|
1012
|
+
<div class="mcpe-drawer-overlay" (click)="close()"></div>
|
|
1013
|
+
<div
|
|
1014
|
+
[class]="'mcpe-drawer-content mcpe-drawer-content-' + side()"
|
|
1015
|
+
role="dialog"
|
|
1016
|
+
aria-modal="true"
|
|
1017
|
+
(keydown.escape)="close()"
|
|
1018
|
+
>
|
|
1019
|
+
<ng-content />
|
|
1020
|
+
<button class="mcpe-drawer-close" (click)="close()" aria-label="Close">
|
|
1021
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
1022
|
+
<path d="M18 6 6 18" /><path d="m6 6 12 12" />
|
|
1023
|
+
</svg>
|
|
1024
|
+
</button>
|
|
1025
|
+
</div>
|
|
1026
|
+
}
|
|
1027
|
+
`
|
|
1028
|
+
})
|
|
1029
|
+
], SnxDrawerComponent);
|
|
1030
|
+
var SnxDrawerHeaderComponent = class {
|
|
1031
|
+
static {
|
|
1032
|
+
__name(this, "SnxDrawerHeaderComponent");
|
|
1033
|
+
}
|
|
1034
|
+
};
|
|
1035
|
+
SnxDrawerHeaderComponent = _ts_decorate16([
|
|
1036
|
+
Component15({
|
|
1037
|
+
selector: "mcpe-drawer-header",
|
|
1038
|
+
standalone: true,
|
|
1039
|
+
template: `<div class="mcpe-drawer-header"><ng-content /></div>`
|
|
1040
|
+
})
|
|
1041
|
+
], SnxDrawerHeaderComponent);
|
|
1042
|
+
var SnxDrawerFooterComponent = class {
|
|
1043
|
+
static {
|
|
1044
|
+
__name(this, "SnxDrawerFooterComponent");
|
|
1045
|
+
}
|
|
1046
|
+
};
|
|
1047
|
+
SnxDrawerFooterComponent = _ts_decorate16([
|
|
1048
|
+
Component15({
|
|
1049
|
+
selector: "mcpe-drawer-footer",
|
|
1050
|
+
standalone: true,
|
|
1051
|
+
template: `<div class="mcpe-drawer-footer"><ng-content /></div>`
|
|
1052
|
+
})
|
|
1053
|
+
], SnxDrawerFooterComponent);
|
|
1054
|
+
var SnxDrawerTitleComponent = class {
|
|
1055
|
+
static {
|
|
1056
|
+
__name(this, "SnxDrawerTitleComponent");
|
|
1057
|
+
}
|
|
1058
|
+
};
|
|
1059
|
+
SnxDrawerTitleComponent = _ts_decorate16([
|
|
1060
|
+
Component15({
|
|
1061
|
+
selector: "mcpe-drawer-title",
|
|
1062
|
+
standalone: true,
|
|
1063
|
+
template: `<h2 class="mcpe-drawer-title"><ng-content /></h2>`
|
|
1064
|
+
})
|
|
1065
|
+
], SnxDrawerTitleComponent);
|
|
1066
|
+
var SnxDrawerDescriptionComponent = class {
|
|
1067
|
+
static {
|
|
1068
|
+
__name(this, "SnxDrawerDescriptionComponent");
|
|
1069
|
+
}
|
|
1070
|
+
};
|
|
1071
|
+
SnxDrawerDescriptionComponent = _ts_decorate16([
|
|
1072
|
+
Component15({
|
|
1073
|
+
selector: "mcpe-drawer-description",
|
|
1074
|
+
standalone: true,
|
|
1075
|
+
template: `<p class="mcpe-drawer-description"><ng-content /></p>`
|
|
1076
|
+
})
|
|
1077
|
+
], SnxDrawerDescriptionComponent);
|
|
1078
|
+
var SnxDrawerBodyComponent = class {
|
|
1079
|
+
static {
|
|
1080
|
+
__name(this, "SnxDrawerBodyComponent");
|
|
1081
|
+
}
|
|
1082
|
+
};
|
|
1083
|
+
SnxDrawerBodyComponent = _ts_decorate16([
|
|
1084
|
+
Component15({
|
|
1085
|
+
selector: "mcpe-drawer-body",
|
|
1086
|
+
standalone: true,
|
|
1087
|
+
template: `<div class="mcpe-drawer-body"><ng-content /></div>`
|
|
1088
|
+
})
|
|
1089
|
+
], SnxDrawerBodyComponent);
|
|
1090
|
+
|
|
1091
|
+
// src/dropdown-menu.component.ts
|
|
1092
|
+
import { Component as Component16, input as input15, signal as signal9, viewChild as viewChild3 } from "@angular/core";
|
|
1093
|
+
function _ts_decorate17(decorators, target, key, desc) {
|
|
1094
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1095
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
1096
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1097
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1098
|
+
}
|
|
1099
|
+
__name(_ts_decorate17, "_ts_decorate");
|
|
1100
|
+
var SnxDropdownMenuComponent = class {
|
|
1101
|
+
static {
|
|
1102
|
+
__name(this, "SnxDropdownMenuComponent");
|
|
1103
|
+
}
|
|
1104
|
+
items = input15([]);
|
|
1105
|
+
isOpen = signal9(false);
|
|
1106
|
+
container = viewChild3("container");
|
|
1107
|
+
toggle() {
|
|
1108
|
+
this.isOpen.update((v) => !v);
|
|
1109
|
+
}
|
|
1110
|
+
close() {
|
|
1111
|
+
this.isOpen.set(false);
|
|
1112
|
+
}
|
|
1113
|
+
selectItem(item) {
|
|
1114
|
+
if (!item.disabled) this.isOpen.set(false);
|
|
1115
|
+
}
|
|
1116
|
+
onDocumentClick(event) {
|
|
1117
|
+
const el = this.container()?.nativeElement;
|
|
1118
|
+
if (el && !el.contains(event.target)) this.isOpen.set(false);
|
|
1119
|
+
}
|
|
1120
|
+
};
|
|
1121
|
+
SnxDropdownMenuComponent = _ts_decorate17([
|
|
1122
|
+
Component16({
|
|
1123
|
+
selector: "mcpe-dropdown-menu",
|
|
1124
|
+
standalone: true,
|
|
1125
|
+
template: `
|
|
1126
|
+
<div class="relative inline-block" #container>
|
|
1127
|
+
<div (click)="toggle()">
|
|
1128
|
+
<ng-content select="[trigger]" />
|
|
1129
|
+
</div>
|
|
1130
|
+
@if (isOpen()) {
|
|
1131
|
+
<div class="mcpe-dropdown-menu-content absolute top-full mt-1 right-0" role="menu">
|
|
1132
|
+
@for (item of items(); track item.id) {
|
|
1133
|
+
@if (item.type === 'separator') {
|
|
1134
|
+
<div class="mcpe-dropdown-menu-separator" role="separator"></div>
|
|
1135
|
+
} @else if (item.type === 'label') {
|
|
1136
|
+
<div class="mcpe-dropdown-menu-label">{{ item.label }}</div>
|
|
1137
|
+
} @else {
|
|
1138
|
+
<div
|
|
1139
|
+
role="menuitem"
|
|
1140
|
+
[class]="'mcpe-dropdown-menu-item' + (item.disabled ? ' opacity-50 pointer-events-none' : '')"
|
|
1141
|
+
(click)="selectItem(item)"
|
|
1142
|
+
[attr.aria-disabled]="item.disabled"
|
|
1143
|
+
>
|
|
1144
|
+
<span class="flex-1">{{ item.label }}</span>
|
|
1145
|
+
@if (item.shortcut) {
|
|
1146
|
+
<span class="mcpe-dropdown-menu-shortcut">{{ item.shortcut }}</span>
|
|
1147
|
+
}
|
|
1148
|
+
</div>
|
|
1149
|
+
}
|
|
1150
|
+
}
|
|
1151
|
+
</div>
|
|
1152
|
+
}
|
|
1153
|
+
</div>
|
|
1154
|
+
`,
|
|
1155
|
+
host: {
|
|
1156
|
+
"(document:click)": "onDocumentClick($event)"
|
|
1157
|
+
}
|
|
1158
|
+
})
|
|
1159
|
+
], SnxDropdownMenuComponent);
|
|
1160
|
+
|
|
1161
|
+
// src/switch.component.ts
|
|
1162
|
+
import { Component as Component17, input as input16, output as output6, signal as signal10 } from "@angular/core";
|
|
1163
|
+
function _ts_decorate18(decorators, target, key, desc) {
|
|
1164
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1165
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
1166
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1167
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1168
|
+
}
|
|
1169
|
+
__name(_ts_decorate18, "_ts_decorate");
|
|
1170
|
+
var SnxSwitchComponent = class {
|
|
1171
|
+
static {
|
|
1172
|
+
__name(this, "SnxSwitchComponent");
|
|
1173
|
+
}
|
|
1174
|
+
checked = signal10(false);
|
|
1175
|
+
disabled = input16(false);
|
|
1176
|
+
checkedChange = output6();
|
|
1177
|
+
toggle() {
|
|
1178
|
+
if (this.disabled()) return;
|
|
1179
|
+
this.checked.update((v) => !v);
|
|
1180
|
+
this.checkedChange.emit(this.checked());
|
|
1181
|
+
}
|
|
1182
|
+
};
|
|
1183
|
+
SnxSwitchComponent = _ts_decorate18([
|
|
1184
|
+
Component17({
|
|
1185
|
+
selector: "mcpe-switch",
|
|
1186
|
+
standalone: true,
|
|
1187
|
+
template: `
|
|
1188
|
+
<button
|
|
1189
|
+
type="button"
|
|
1190
|
+
role="switch"
|
|
1191
|
+
[attr.aria-checked]="checked()"
|
|
1192
|
+
[attr.aria-disabled]="disabled()"
|
|
1193
|
+
[disabled]="disabled()"
|
|
1194
|
+
[class]="'mcpe-switch'"
|
|
1195
|
+
(click)="toggle()"
|
|
1196
|
+
(keydown.space)="$event.preventDefault(); toggle()"
|
|
1197
|
+
(keydown.enter)="$event.preventDefault(); toggle()"
|
|
1198
|
+
>
|
|
1199
|
+
<span class="mcpe-switch-thumb"></span>
|
|
1200
|
+
</button>
|
|
1201
|
+
`
|
|
1202
|
+
})
|
|
1203
|
+
], SnxSwitchComponent);
|
|
1204
|
+
|
|
1205
|
+
// src/progress.component.ts
|
|
1206
|
+
import { Component as Component18, input as input17, computed as computed12 } from "@angular/core";
|
|
1207
|
+
function _ts_decorate19(decorators, target, key, desc) {
|
|
1208
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1209
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
1210
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1211
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1212
|
+
}
|
|
1213
|
+
__name(_ts_decorate19, "_ts_decorate");
|
|
1214
|
+
var SnxProgressComponent = class {
|
|
1215
|
+
static {
|
|
1216
|
+
__name(this, "SnxProgressComponent");
|
|
1217
|
+
}
|
|
1218
|
+
value = input17(0);
|
|
1219
|
+
max = input17(100);
|
|
1220
|
+
transform = computed12(() => {
|
|
1221
|
+
const pct = Math.min(Math.max(this.value() / this.max() * 100, 0), 100);
|
|
1222
|
+
return `translateX(-${100 - pct}%)`;
|
|
1223
|
+
});
|
|
1224
|
+
};
|
|
1225
|
+
SnxProgressComponent = _ts_decorate19([
|
|
1226
|
+
Component18({
|
|
1227
|
+
selector: "mcpe-progress",
|
|
1228
|
+
standalone: true,
|
|
1229
|
+
template: `
|
|
1230
|
+
<div class="mcpe-progress" role="progressbar"
|
|
1231
|
+
[attr.aria-valuenow]="value()" [attr.aria-valuemin]="0" [attr.aria-valuemax]="max()">
|
|
1232
|
+
<div class="mcpe-progress-indicator" [style.transform]="transform()"></div>
|
|
1233
|
+
</div>
|
|
1234
|
+
`
|
|
1235
|
+
})
|
|
1236
|
+
], SnxProgressComponent);
|
|
1237
|
+
|
|
1238
|
+
// src/loader.component.ts
|
|
1239
|
+
import { Component as Component19, input as input18, computed as computed13 } from "@angular/core";
|
|
1240
|
+
function _ts_decorate20(decorators, target, key, desc) {
|
|
1241
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1242
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
1243
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1244
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1245
|
+
}
|
|
1246
|
+
__name(_ts_decorate20, "_ts_decorate");
|
|
1247
|
+
var SnxLoaderComponent = class {
|
|
1248
|
+
static {
|
|
1249
|
+
__name(this, "SnxLoaderComponent");
|
|
1250
|
+
}
|
|
1251
|
+
size = input18("md");
|
|
1252
|
+
variant = input18("primary");
|
|
1253
|
+
classes = computed13(() => `mcpe-loader mcpe-loader-${this.size()} mcpe-loader-${this.variant()}`);
|
|
1254
|
+
};
|
|
1255
|
+
SnxLoaderComponent = _ts_decorate20([
|
|
1256
|
+
Component19({
|
|
1257
|
+
selector: "mcpe-loader",
|
|
1258
|
+
standalone: true,
|
|
1259
|
+
template: `<div [class]="classes()" role="status" aria-label="Loading"><span class="sr-only">Loading...</span></div>`
|
|
1260
|
+
})
|
|
1261
|
+
], SnxLoaderComponent);
|
|
1262
|
+
|
|
1263
|
+
// src/chips.component.ts
|
|
1264
|
+
import { Component as Component20, input as input19, output as output7, computed as computed14 } from "@angular/core";
|
|
1265
|
+
function _ts_decorate21(decorators, target, key, desc) {
|
|
1266
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1267
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
1268
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1269
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1270
|
+
}
|
|
1271
|
+
__name(_ts_decorate21, "_ts_decorate");
|
|
1272
|
+
var SnxChipComponent = class {
|
|
1273
|
+
static {
|
|
1274
|
+
__name(this, "SnxChipComponent");
|
|
1275
|
+
}
|
|
1276
|
+
variant = input19("default");
|
|
1277
|
+
removable = input19(false);
|
|
1278
|
+
remove = output7();
|
|
1279
|
+
classes = computed14(() => [
|
|
1280
|
+
"mcpe-chip",
|
|
1281
|
+
`mcpe-chip-${this.variant()}`,
|
|
1282
|
+
this.removable() ? "mcpe-chip-removable" : ""
|
|
1283
|
+
].filter(Boolean).join(" "));
|
|
1284
|
+
};
|
|
1285
|
+
SnxChipComponent = _ts_decorate21([
|
|
1286
|
+
Component20({
|
|
1287
|
+
selector: "mcpe-chip",
|
|
1288
|
+
standalone: true,
|
|
1289
|
+
template: `
|
|
1290
|
+
<span [class]="classes()">
|
|
1291
|
+
<ng-content />
|
|
1292
|
+
@if (removable()) {
|
|
1293
|
+
<button type="button" class="mcpe-chip-remove" (click)="remove.emit()" aria-label="Remove">
|
|
1294
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
1295
|
+
<path d="M18 6 6 18" /><path d="m6 6 12 12" />
|
|
1296
|
+
</svg>
|
|
1297
|
+
</button>
|
|
1298
|
+
}
|
|
1299
|
+
</span>
|
|
1300
|
+
`
|
|
1301
|
+
})
|
|
1302
|
+
], SnxChipComponent);
|
|
1303
|
+
var SnxChipsComponent = class {
|
|
1304
|
+
static {
|
|
1305
|
+
__name(this, "SnxChipsComponent");
|
|
1306
|
+
}
|
|
1307
|
+
};
|
|
1308
|
+
SnxChipsComponent = _ts_decorate21([
|
|
1309
|
+
Component20({
|
|
1310
|
+
selector: "mcpe-chips",
|
|
1311
|
+
standalone: true,
|
|
1312
|
+
template: `<div class="mcpe-chips"><ng-content /></div>`
|
|
1313
|
+
})
|
|
1314
|
+
], SnxChipsComponent);
|
|
1315
|
+
|
|
1316
|
+
// src/password-input.component.ts
|
|
1317
|
+
import { Component as Component21, input as input20, signal as signal11 } from "@angular/core";
|
|
1318
|
+
function _ts_decorate22(decorators, target, key, desc) {
|
|
1319
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1320
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
1321
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1322
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1323
|
+
}
|
|
1324
|
+
__name(_ts_decorate22, "_ts_decorate");
|
|
1325
|
+
var SnxPasswordInputComponent = class {
|
|
1326
|
+
static {
|
|
1327
|
+
__name(this, "SnxPasswordInputComponent");
|
|
1328
|
+
}
|
|
1329
|
+
placeholder = input20("");
|
|
1330
|
+
disabled = input20(false);
|
|
1331
|
+
showPassword = signal11(false);
|
|
1332
|
+
};
|
|
1333
|
+
SnxPasswordInputComponent = _ts_decorate22([
|
|
1334
|
+
Component21({
|
|
1335
|
+
selector: "mcpe-password-input",
|
|
1336
|
+
standalone: true,
|
|
1337
|
+
template: `
|
|
1338
|
+
<div class="mcpe-password-input-wrapper">
|
|
1339
|
+
<input
|
|
1340
|
+
[type]="showPassword() ? 'text' : 'password'"
|
|
1341
|
+
class="mcpe-password-input"
|
|
1342
|
+
[placeholder]="placeholder()"
|
|
1343
|
+
[disabled]="disabled()"
|
|
1344
|
+
/>
|
|
1345
|
+
<button type="button" class="mcpe-password-toggle" (click)="showPassword.update(v => !v)"
|
|
1346
|
+
[attr.aria-label]="showPassword() ? 'Hide password' : 'Show password'" tabindex="-1">
|
|
1347
|
+
@if (showPassword()) {
|
|
1348
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
1349
|
+
<path d="M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24" />
|
|
1350
|
+
<line x1="1" y1="1" x2="23" y2="23" />
|
|
1351
|
+
</svg>
|
|
1352
|
+
} @else {
|
|
1353
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
1354
|
+
<path d="M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z" />
|
|
1355
|
+
<circle cx="12" cy="12" r="3" />
|
|
1356
|
+
</svg>
|
|
1357
|
+
}
|
|
1358
|
+
</button>
|
|
1359
|
+
</div>
|
|
1360
|
+
`
|
|
1361
|
+
})
|
|
1362
|
+
], SnxPasswordInputComponent);
|
|
1363
|
+
|
|
1364
|
+
// src/counter.component.ts
|
|
1365
|
+
import { Component as Component22, input as input21, output as output8, signal as signal12 } from "@angular/core";
|
|
1366
|
+
function _ts_decorate23(decorators, target, key, desc) {
|
|
1367
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1368
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
1369
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1370
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1371
|
+
}
|
|
1372
|
+
__name(_ts_decorate23, "_ts_decorate");
|
|
1373
|
+
var SnxCounterComponent = class {
|
|
1374
|
+
static {
|
|
1375
|
+
__name(this, "SnxCounterComponent");
|
|
1376
|
+
}
|
|
1377
|
+
value = signal12(0);
|
|
1378
|
+
min = input21(0);
|
|
1379
|
+
max = input21(99);
|
|
1380
|
+
step = input21(1);
|
|
1381
|
+
disabled = input21(false);
|
|
1382
|
+
valueChange = output8();
|
|
1383
|
+
decrement() {
|
|
1384
|
+
this.value.update((v) => Math.max(this.min(), v - this.step()));
|
|
1385
|
+
this.valueChange.emit(this.value());
|
|
1386
|
+
}
|
|
1387
|
+
increment() {
|
|
1388
|
+
this.value.update((v) => Math.min(this.max(), v + this.step()));
|
|
1389
|
+
this.valueChange.emit(this.value());
|
|
1390
|
+
}
|
|
1391
|
+
onInput(event) {
|
|
1392
|
+
const num = parseInt(event.target.value, 10);
|
|
1393
|
+
if (!isNaN(num)) {
|
|
1394
|
+
this.value.set(Math.max(this.min(), Math.min(this.max(), num)));
|
|
1395
|
+
this.valueChange.emit(this.value());
|
|
1396
|
+
}
|
|
1397
|
+
}
|
|
1398
|
+
};
|
|
1399
|
+
SnxCounterComponent = _ts_decorate23([
|
|
1400
|
+
Component22({
|
|
1401
|
+
selector: "mcpe-counter",
|
|
1402
|
+
standalone: true,
|
|
1403
|
+
template: `
|
|
1404
|
+
<div class="mcpe-counter">
|
|
1405
|
+
<button type="button" class="mcpe-counter-button" (click)="decrement()"
|
|
1406
|
+
[disabled]="disabled() || value() <= min()" aria-label="Decrease">
|
|
1407
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
1408
|
+
<path d="M5 12h14" />
|
|
1409
|
+
</svg>
|
|
1410
|
+
</button>
|
|
1411
|
+
<input type="text" inputmode="numeric" class="mcpe-counter-input"
|
|
1412
|
+
[value]="value()" (change)="onInput($event)" [disabled]="disabled()" aria-label="Count" />
|
|
1413
|
+
<button type="button" class="mcpe-counter-button" (click)="increment()"
|
|
1414
|
+
[disabled]="disabled() || value() >= max()" aria-label="Increase">
|
|
1415
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
1416
|
+
<path d="M5 12h14" /><path d="M12 5v14" />
|
|
1417
|
+
</svg>
|
|
1418
|
+
</button>
|
|
1419
|
+
</div>
|
|
1420
|
+
`
|
|
1421
|
+
})
|
|
1422
|
+
], SnxCounterComponent);
|
|
1423
|
+
|
|
1424
|
+
// src/alert.component.ts
|
|
1425
|
+
import { Component as Component23, input as input22, computed as computed15 } from "@angular/core";
|
|
1426
|
+
function _ts_decorate24(decorators, target, key, desc) {
|
|
1427
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1428
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
1429
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1430
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1431
|
+
}
|
|
1432
|
+
__name(_ts_decorate24, "_ts_decorate");
|
|
1433
|
+
var SnxAlertComponent = class {
|
|
1434
|
+
static {
|
|
1435
|
+
__name(this, "SnxAlertComponent");
|
|
1436
|
+
}
|
|
1437
|
+
variant = input22("default");
|
|
1438
|
+
classes = computed15(() => `mcpe-alert mcpe-alert-${this.variant()}`);
|
|
1439
|
+
};
|
|
1440
|
+
SnxAlertComponent = _ts_decorate24([
|
|
1441
|
+
Component23({
|
|
1442
|
+
selector: "mcpe-alert",
|
|
1443
|
+
standalone: true,
|
|
1444
|
+
template: `<div [class]="classes()" role="alert"><ng-content /></div>`
|
|
1445
|
+
})
|
|
1446
|
+
], SnxAlertComponent);
|
|
1447
|
+
var SnxAlertTitleComponent = class {
|
|
1448
|
+
static {
|
|
1449
|
+
__name(this, "SnxAlertTitleComponent");
|
|
1450
|
+
}
|
|
1451
|
+
};
|
|
1452
|
+
SnxAlertTitleComponent = _ts_decorate24([
|
|
1453
|
+
Component23({
|
|
1454
|
+
selector: "mcpe-alert-title",
|
|
1455
|
+
standalone: true,
|
|
1456
|
+
template: `<h5 class="mcpe-alert-title"><ng-content /></h5>`
|
|
1457
|
+
})
|
|
1458
|
+
], SnxAlertTitleComponent);
|
|
1459
|
+
var SnxAlertDescriptionComponent = class {
|
|
1460
|
+
static {
|
|
1461
|
+
__name(this, "SnxAlertDescriptionComponent");
|
|
1462
|
+
}
|
|
1463
|
+
};
|
|
1464
|
+
SnxAlertDescriptionComponent = _ts_decorate24([
|
|
1465
|
+
Component23({
|
|
1466
|
+
selector: "mcpe-alert-description",
|
|
1467
|
+
standalone: true,
|
|
1468
|
+
template: `<div class="mcpe-alert-description"><ng-content /></div>`
|
|
1469
|
+
})
|
|
1470
|
+
], SnxAlertDescriptionComponent);
|
|
1471
|
+
|
|
1472
|
+
// src/prompt-input.component.ts
|
|
1473
|
+
import { Component as Component24, input as input23, output as output9, computed as computed16 } from "@angular/core";
|
|
1474
|
+
function _ts_decorate25(decorators, target, key, desc) {
|
|
1475
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1476
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
1477
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1478
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1479
|
+
}
|
|
1480
|
+
__name(_ts_decorate25, "_ts_decorate");
|
|
1481
|
+
var SnxPromptInputComponent = class {
|
|
1482
|
+
static {
|
|
1483
|
+
__name(this, "SnxPromptInputComponent");
|
|
1484
|
+
}
|
|
1485
|
+
class = input23("");
|
|
1486
|
+
classes = computed16(() => [
|
|
1487
|
+
"mcpe-prompt-input",
|
|
1488
|
+
this.class()
|
|
1489
|
+
].filter(Boolean).join(" "));
|
|
1490
|
+
};
|
|
1491
|
+
SnxPromptInputComponent = _ts_decorate25([
|
|
1492
|
+
Component24({
|
|
1493
|
+
selector: "mcpe-prompt-input",
|
|
1494
|
+
standalone: true,
|
|
1495
|
+
template: `<div [class]="classes()"><ng-content /></div>`
|
|
1496
|
+
})
|
|
1497
|
+
], SnxPromptInputComponent);
|
|
1498
|
+
var SnxPromptInputTextareaComponent = class {
|
|
1499
|
+
static {
|
|
1500
|
+
__name(this, "SnxPromptInputTextareaComponent");
|
|
1501
|
+
}
|
|
1502
|
+
placeholder = input23("");
|
|
1503
|
+
rows = input23(3);
|
|
1504
|
+
};
|
|
1505
|
+
SnxPromptInputTextareaComponent = _ts_decorate25([
|
|
1506
|
+
Component24({
|
|
1507
|
+
selector: "mcpe-prompt-input-textarea",
|
|
1508
|
+
standalone: true,
|
|
1509
|
+
template: `<textarea class="mcpe-prompt-input-textarea" [placeholder]="placeholder()" [rows]="rows()"></textarea>`
|
|
1510
|
+
})
|
|
1511
|
+
], SnxPromptInputTextareaComponent);
|
|
1512
|
+
var SnxPromptInputFooterComponent = class {
|
|
1513
|
+
static {
|
|
1514
|
+
__name(this, "SnxPromptInputFooterComponent");
|
|
1515
|
+
}
|
|
1516
|
+
};
|
|
1517
|
+
SnxPromptInputFooterComponent = _ts_decorate25([
|
|
1518
|
+
Component24({
|
|
1519
|
+
selector: "mcpe-prompt-input-footer",
|
|
1520
|
+
standalone: true,
|
|
1521
|
+
template: `<div class="mcpe-prompt-input-footer"><ng-content /></div>`
|
|
1522
|
+
})
|
|
1523
|
+
], SnxPromptInputFooterComponent);
|
|
1524
|
+
var SnxPromptInputActionsComponent = class {
|
|
1525
|
+
static {
|
|
1526
|
+
__name(this, "SnxPromptInputActionsComponent");
|
|
1527
|
+
}
|
|
1528
|
+
};
|
|
1529
|
+
SnxPromptInputActionsComponent = _ts_decorate25([
|
|
1530
|
+
Component24({
|
|
1531
|
+
selector: "mcpe-prompt-input-actions",
|
|
1532
|
+
standalone: true,
|
|
1533
|
+
template: `<div class="mcpe-prompt-input-actions"><ng-content /></div>`
|
|
1534
|
+
})
|
|
1535
|
+
], SnxPromptInputActionsComponent);
|
|
1536
|
+
var SnxPromptInputCharCountComponent = class {
|
|
1537
|
+
static {
|
|
1538
|
+
__name(this, "SnxPromptInputCharCountComponent");
|
|
1539
|
+
}
|
|
1540
|
+
count = input23(0);
|
|
1541
|
+
max = input23(void 0);
|
|
1542
|
+
};
|
|
1543
|
+
SnxPromptInputCharCountComponent = _ts_decorate25([
|
|
1544
|
+
Component24({
|
|
1545
|
+
selector: "mcpe-prompt-input-char-count",
|
|
1546
|
+
standalone: true,
|
|
1547
|
+
template: `<span class="mcpe-prompt-input-char-count">{{ count() }}@if (max()) { / {{ max() }} }</span>`
|
|
1548
|
+
})
|
|
1549
|
+
], SnxPromptInputCharCountComponent);
|
|
1550
|
+
var SnxPromptInputAttachmentsComponent = class {
|
|
1551
|
+
static {
|
|
1552
|
+
__name(this, "SnxPromptInputAttachmentsComponent");
|
|
1553
|
+
}
|
|
1554
|
+
};
|
|
1555
|
+
SnxPromptInputAttachmentsComponent = _ts_decorate25([
|
|
1556
|
+
Component24({
|
|
1557
|
+
selector: "mcpe-prompt-input-attachments",
|
|
1558
|
+
standalone: true,
|
|
1559
|
+
template: `<div class="mcpe-prompt-input-attachments"><ng-content /></div>`
|
|
1560
|
+
})
|
|
1561
|
+
], SnxPromptInputAttachmentsComponent);
|
|
1562
|
+
var SnxPromptInputAttachmentComponent = class {
|
|
1563
|
+
static {
|
|
1564
|
+
__name(this, "SnxPromptInputAttachmentComponent");
|
|
1565
|
+
}
|
|
1566
|
+
remove = output9();
|
|
1567
|
+
};
|
|
1568
|
+
SnxPromptInputAttachmentComponent = _ts_decorate25([
|
|
1569
|
+
Component24({
|
|
1570
|
+
selector: "mcpe-prompt-input-attachment",
|
|
1571
|
+
standalone: true,
|
|
1572
|
+
template: `
|
|
1573
|
+
<span class="mcpe-prompt-input-attachment">
|
|
1574
|
+
<ng-content />
|
|
1575
|
+
<button type="button" class="mcpe-prompt-input-attachment-remove" (click)="remove.emit()" aria-label="Remove">
|
|
1576
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
1577
|
+
<path d="M18 6 6 18" /><path d="m6 6 12 12" />
|
|
1578
|
+
</svg>
|
|
1579
|
+
</button>
|
|
1580
|
+
</span>
|
|
1581
|
+
`
|
|
1582
|
+
})
|
|
1583
|
+
], SnxPromptInputAttachmentComponent);
|
|
1584
|
+
|
|
1585
|
+
// src/chat-bubble.component.ts
|
|
1586
|
+
import { Component as Component25, input as input24, computed as computed17 } from "@angular/core";
|
|
1587
|
+
function _ts_decorate26(decorators, target, key, desc) {
|
|
1588
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1589
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
1590
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1591
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1592
|
+
}
|
|
1593
|
+
__name(_ts_decorate26, "_ts_decorate");
|
|
1594
|
+
var SnxChatBubbleComponent = class {
|
|
1595
|
+
static {
|
|
1596
|
+
__name(this, "SnxChatBubbleComponent");
|
|
1597
|
+
}
|
|
1598
|
+
variant = input24("ai");
|
|
1599
|
+
class = input24("");
|
|
1600
|
+
classes = computed17(() => [
|
|
1601
|
+
"mcpe-chat-bubble",
|
|
1602
|
+
`mcpe-chat-bubble-${this.variant()}`,
|
|
1603
|
+
this.class()
|
|
1604
|
+
].filter(Boolean).join(" "));
|
|
1605
|
+
};
|
|
1606
|
+
SnxChatBubbleComponent = _ts_decorate26([
|
|
1607
|
+
Component25({
|
|
1608
|
+
selector: "mcpe-chat-bubble",
|
|
1609
|
+
standalone: true,
|
|
1610
|
+
template: `<div [class]="classes()"><ng-content /></div>`
|
|
1611
|
+
})
|
|
1612
|
+
], SnxChatBubbleComponent);
|
|
1613
|
+
var SnxChatBubbleAvatarComponent = class {
|
|
1614
|
+
static {
|
|
1615
|
+
__name(this, "SnxChatBubbleAvatarComponent");
|
|
1616
|
+
}
|
|
1617
|
+
src = input24.required();
|
|
1618
|
+
alt = input24("");
|
|
1619
|
+
};
|
|
1620
|
+
SnxChatBubbleAvatarComponent = _ts_decorate26([
|
|
1621
|
+
Component25({
|
|
1622
|
+
selector: "mcpe-chat-bubble-avatar",
|
|
1623
|
+
standalone: true,
|
|
1624
|
+
template: `<img class="mcpe-chat-bubble-avatar" [src]="src()" [alt]="alt()" />`
|
|
1625
|
+
})
|
|
1626
|
+
], SnxChatBubbleAvatarComponent);
|
|
1627
|
+
var SnxChatBubbleContentComponent = class {
|
|
1628
|
+
static {
|
|
1629
|
+
__name(this, "SnxChatBubbleContentComponent");
|
|
1630
|
+
}
|
|
1631
|
+
};
|
|
1632
|
+
SnxChatBubbleContentComponent = _ts_decorate26([
|
|
1633
|
+
Component25({
|
|
1634
|
+
selector: "mcpe-chat-bubble-content",
|
|
1635
|
+
standalone: true,
|
|
1636
|
+
template: `<div class="mcpe-chat-bubble-content"><ng-content /></div>`
|
|
1637
|
+
})
|
|
1638
|
+
], SnxChatBubbleContentComponent);
|
|
1639
|
+
var SnxChatBubbleTimestampComponent = class {
|
|
1640
|
+
static {
|
|
1641
|
+
__name(this, "SnxChatBubbleTimestampComponent");
|
|
1642
|
+
}
|
|
1643
|
+
};
|
|
1644
|
+
SnxChatBubbleTimestampComponent = _ts_decorate26([
|
|
1645
|
+
Component25({
|
|
1646
|
+
selector: "mcpe-chat-bubble-timestamp",
|
|
1647
|
+
standalone: true,
|
|
1648
|
+
template: `<span class="mcpe-chat-bubble-timestamp"><ng-content /></span>`
|
|
1649
|
+
})
|
|
1650
|
+
], SnxChatBubbleTimestampComponent);
|
|
1651
|
+
var SnxChatBubbleTypingComponent = class {
|
|
1652
|
+
static {
|
|
1653
|
+
__name(this, "SnxChatBubbleTypingComponent");
|
|
1654
|
+
}
|
|
1655
|
+
};
|
|
1656
|
+
SnxChatBubbleTypingComponent = _ts_decorate26([
|
|
1657
|
+
Component25({
|
|
1658
|
+
selector: "mcpe-chat-bubble-typing",
|
|
1659
|
+
standalone: true,
|
|
1660
|
+
template: `
|
|
1661
|
+
<div class="mcpe-chat-bubble-typing">
|
|
1662
|
+
<span class="mcpe-chat-bubble-typing-dot"></span>
|
|
1663
|
+
<span class="mcpe-chat-bubble-typing-dot"></span>
|
|
1664
|
+
<span class="mcpe-chat-bubble-typing-dot"></span>
|
|
1665
|
+
</div>
|
|
1666
|
+
`
|
|
1667
|
+
})
|
|
1668
|
+
], SnxChatBubbleTypingComponent);
|
|
1669
|
+
|
|
1670
|
+
// src/ai-badge.component.ts
|
|
1671
|
+
import { Component as Component26, input as input25, computed as computed18 } from "@angular/core";
|
|
1672
|
+
function _ts_decorate27(decorators, target, key, desc) {
|
|
1673
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1674
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
1675
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1676
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1677
|
+
}
|
|
1678
|
+
__name(_ts_decorate27, "_ts_decorate");
|
|
1679
|
+
var SnxAiBadgeComponent = class {
|
|
1680
|
+
static {
|
|
1681
|
+
__name(this, "SnxAiBadgeComponent");
|
|
1682
|
+
}
|
|
1683
|
+
variant = input25("default");
|
|
1684
|
+
showIcon = input25(true);
|
|
1685
|
+
class = input25("");
|
|
1686
|
+
classes = computed18(() => [
|
|
1687
|
+
"mcpe-ai-badge",
|
|
1688
|
+
`mcpe-ai-badge-${this.variant()}`,
|
|
1689
|
+
this.class()
|
|
1690
|
+
].filter(Boolean).join(" "));
|
|
1691
|
+
};
|
|
1692
|
+
SnxAiBadgeComponent = _ts_decorate27([
|
|
1693
|
+
Component26({
|
|
1694
|
+
selector: "mcpe-ai-badge",
|
|
1695
|
+
standalone: true,
|
|
1696
|
+
template: `
|
|
1697
|
+
<span [class]="classes()">
|
|
1698
|
+
@if (showIcon()) {
|
|
1699
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
1700
|
+
<path d="M12 3l1.912 5.813a2 2 0 0 0 1.275 1.275L21 12l-5.813 1.912a2 2 0 0 0-1.275 1.275L12 21l-1.912-5.813a2 2 0 0 1-1.275-1.275L3 12l5.813-1.912a2 2 0 0 1 1.275-1.275L12 3z" />
|
|
1701
|
+
</svg>
|
|
1702
|
+
}
|
|
1703
|
+
<ng-content />
|
|
1704
|
+
</span>
|
|
1705
|
+
`
|
|
1706
|
+
})
|
|
1707
|
+
], SnxAiBadgeComponent);
|
|
1708
|
+
|
|
1709
|
+
// src/suggestion-chips.component.ts
|
|
1710
|
+
import { Component as Component27, input as input26, computed as computed19 } from "@angular/core";
|
|
1711
|
+
function _ts_decorate28(decorators, target, key, desc) {
|
|
1712
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1713
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
1714
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1715
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1716
|
+
}
|
|
1717
|
+
__name(_ts_decorate28, "_ts_decorate");
|
|
1718
|
+
var SnxSuggestionChipsComponent = class {
|
|
1719
|
+
static {
|
|
1720
|
+
__name(this, "SnxSuggestionChipsComponent");
|
|
1721
|
+
}
|
|
1722
|
+
};
|
|
1723
|
+
SnxSuggestionChipsComponent = _ts_decorate28([
|
|
1724
|
+
Component27({
|
|
1725
|
+
selector: "mcpe-suggestion-chips",
|
|
1726
|
+
standalone: true,
|
|
1727
|
+
template: `<div class="mcpe-suggestion-chips"><ng-content /></div>`
|
|
1728
|
+
})
|
|
1729
|
+
], SnxSuggestionChipsComponent);
|
|
1730
|
+
var SnxSuggestionChipComponent = class {
|
|
1731
|
+
static {
|
|
1732
|
+
__name(this, "SnxSuggestionChipComponent");
|
|
1733
|
+
}
|
|
1734
|
+
variant = input26("default");
|
|
1735
|
+
class = input26("");
|
|
1736
|
+
classes = computed19(() => [
|
|
1737
|
+
"mcpe-suggestion-chip",
|
|
1738
|
+
`mcpe-suggestion-chip-${this.variant()}`,
|
|
1739
|
+
this.class()
|
|
1740
|
+
].filter(Boolean).join(" "));
|
|
1741
|
+
};
|
|
1742
|
+
SnxSuggestionChipComponent = _ts_decorate28([
|
|
1743
|
+
Component27({
|
|
1744
|
+
selector: "mcpe-suggestion-chip",
|
|
1745
|
+
standalone: true,
|
|
1746
|
+
template: `<button [class]="classes()" type="button"><ng-content /></button>`
|
|
1747
|
+
})
|
|
1748
|
+
], SnxSuggestionChipComponent);
|
|
1749
|
+
|
|
1750
|
+
// src/source-card.component.ts
|
|
1751
|
+
import { Component as Component28, input as input27 } from "@angular/core";
|
|
1752
|
+
function _ts_decorate29(decorators, target, key, desc) {
|
|
1753
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1754
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
1755
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1756
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1757
|
+
}
|
|
1758
|
+
__name(_ts_decorate29, "_ts_decorate");
|
|
1759
|
+
var SnxSourceCardsComponent = class {
|
|
1760
|
+
static {
|
|
1761
|
+
__name(this, "SnxSourceCardsComponent");
|
|
1762
|
+
}
|
|
1763
|
+
};
|
|
1764
|
+
SnxSourceCardsComponent = _ts_decorate29([
|
|
1765
|
+
Component28({
|
|
1766
|
+
selector: "mcpe-source-cards",
|
|
1767
|
+
standalone: true,
|
|
1768
|
+
template: `<div class="mcpe-source-cards"><ng-content /></div>`
|
|
1769
|
+
})
|
|
1770
|
+
], SnxSourceCardsComponent);
|
|
1771
|
+
var SnxSourceCardComponent = class {
|
|
1772
|
+
static {
|
|
1773
|
+
__name(this, "SnxSourceCardComponent");
|
|
1774
|
+
}
|
|
1775
|
+
href = input27.required();
|
|
1776
|
+
favicon = input27("");
|
|
1777
|
+
title = input27("");
|
|
1778
|
+
domain = input27("");
|
|
1779
|
+
index = input27(void 0);
|
|
1780
|
+
};
|
|
1781
|
+
SnxSourceCardComponent = _ts_decorate29([
|
|
1782
|
+
Component28({
|
|
1783
|
+
selector: "mcpe-source-card",
|
|
1784
|
+
standalone: true,
|
|
1785
|
+
template: `
|
|
1786
|
+
<a [href]="href()" class="mcpe-source-card" target="_blank" rel="noopener noreferrer">
|
|
1787
|
+
@if (favicon()) {
|
|
1788
|
+
<img class="mcpe-source-card-favicon" [src]="favicon()" [alt]="domain()" />
|
|
1789
|
+
}
|
|
1790
|
+
<div class="mcpe-source-card-body">
|
|
1791
|
+
<p class="mcpe-source-card-title">{{ title() }}</p>
|
|
1792
|
+
<p class="mcpe-source-card-domain">{{ domain() }}</p>
|
|
1793
|
+
</div>
|
|
1794
|
+
@if (index()) {
|
|
1795
|
+
<span class="mcpe-source-card-index">{{ index() }}</span>
|
|
1796
|
+
}
|
|
1797
|
+
</a>
|
|
1798
|
+
`
|
|
1799
|
+
})
|
|
1800
|
+
], SnxSourceCardComponent);
|
|
1801
|
+
|
|
1802
|
+
// src/streaming-text.component.ts
|
|
1803
|
+
import { Component as Component29 } from "@angular/core";
|
|
1804
|
+
function _ts_decorate30(decorators, target, key, desc) {
|
|
1805
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1806
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
1807
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1808
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1809
|
+
}
|
|
1810
|
+
__name(_ts_decorate30, "_ts_decorate");
|
|
1811
|
+
var SnxStreamingTextComponent = class {
|
|
1812
|
+
static {
|
|
1813
|
+
__name(this, "SnxStreamingTextComponent");
|
|
1814
|
+
}
|
|
1815
|
+
};
|
|
1816
|
+
SnxStreamingTextComponent = _ts_decorate30([
|
|
1817
|
+
Component29({
|
|
1818
|
+
selector: "mcpe-streaming-text",
|
|
1819
|
+
standalone: true,
|
|
1820
|
+
template: `<div class="mcpe-streaming-text-cursor"><ng-content /></div>`
|
|
1821
|
+
})
|
|
1822
|
+
], SnxStreamingTextComponent);
|
|
1823
|
+
var SnxStreamingTextFadeInComponent = class {
|
|
1824
|
+
static {
|
|
1825
|
+
__name(this, "SnxStreamingTextFadeInComponent");
|
|
1826
|
+
}
|
|
1827
|
+
};
|
|
1828
|
+
SnxStreamingTextFadeInComponent = _ts_decorate30([
|
|
1829
|
+
Component29({
|
|
1830
|
+
selector: "mcpe-streaming-text-fade-in",
|
|
1831
|
+
standalone: true,
|
|
1832
|
+
template: `<span class="mcpe-streaming-text-fade-in"><ng-content /></span>`
|
|
1833
|
+
})
|
|
1834
|
+
], SnxStreamingTextFadeInComponent);
|
|
1835
|
+
var SnxStreamingTextWordComponent = class {
|
|
1836
|
+
static {
|
|
1837
|
+
__name(this, "SnxStreamingTextWordComponent");
|
|
1838
|
+
}
|
|
1839
|
+
};
|
|
1840
|
+
SnxStreamingTextWordComponent = _ts_decorate30([
|
|
1841
|
+
Component29({
|
|
1842
|
+
selector: "mcpe-streaming-text-word",
|
|
1843
|
+
standalone: true,
|
|
1844
|
+
template: `<span class="mcpe-streaming-text-word"><ng-content /></span>`
|
|
1845
|
+
})
|
|
1846
|
+
], SnxStreamingTextWordComponent);
|
|
1847
|
+
var SnxStreamingTextLineComponent = class {
|
|
1848
|
+
static {
|
|
1849
|
+
__name(this, "SnxStreamingTextLineComponent");
|
|
1850
|
+
}
|
|
1851
|
+
};
|
|
1852
|
+
SnxStreamingTextLineComponent = _ts_decorate30([
|
|
1853
|
+
Component29({
|
|
1854
|
+
selector: "mcpe-streaming-text-line",
|
|
1855
|
+
standalone: true,
|
|
1856
|
+
template: `<div class="mcpe-streaming-text-line"><ng-content /></div>`
|
|
1857
|
+
})
|
|
1858
|
+
], SnxStreamingTextLineComponent);
|
|
1859
|
+
var SnxStreamingTextSkeletonComponent = class {
|
|
1860
|
+
static {
|
|
1861
|
+
__name(this, "SnxStreamingTextSkeletonComponent");
|
|
1862
|
+
}
|
|
1863
|
+
};
|
|
1864
|
+
SnxStreamingTextSkeletonComponent = _ts_decorate30([
|
|
1865
|
+
Component29({
|
|
1866
|
+
selector: "mcpe-streaming-text-skeleton",
|
|
1867
|
+
standalone: true,
|
|
1868
|
+
template: `<div class="mcpe-streaming-text-skeleton"><ng-content /></div>`
|
|
1869
|
+
})
|
|
1870
|
+
], SnxStreamingTextSkeletonComponent);
|
|
1871
|
+
var SnxStreamingTextSkeletonLineComponent = class {
|
|
1872
|
+
static {
|
|
1873
|
+
__name(this, "SnxStreamingTextSkeletonLineComponent");
|
|
1874
|
+
}
|
|
1875
|
+
};
|
|
1876
|
+
SnxStreamingTextSkeletonLineComponent = _ts_decorate30([
|
|
1877
|
+
Component29({
|
|
1878
|
+
selector: "mcpe-streaming-text-skeleton-line",
|
|
1879
|
+
standalone: true,
|
|
1880
|
+
template: `<div class="mcpe-streaming-text-skeleton-line"></div>`
|
|
1881
|
+
})
|
|
1882
|
+
], SnxStreamingTextSkeletonLineComponent);
|
|
1883
|
+
|
|
1884
|
+
// src/feedback.component.ts
|
|
1885
|
+
import { Component as Component30, input as input28, computed as computed20 } from "@angular/core";
|
|
1886
|
+
function _ts_decorate31(decorators, target, key, desc) {
|
|
1887
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1888
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
1889
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1890
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1891
|
+
}
|
|
1892
|
+
__name(_ts_decorate31, "_ts_decorate");
|
|
1893
|
+
var SnxFeedbackComponent = class {
|
|
1894
|
+
static {
|
|
1895
|
+
__name(this, "SnxFeedbackComponent");
|
|
1896
|
+
}
|
|
1897
|
+
};
|
|
1898
|
+
SnxFeedbackComponent = _ts_decorate31([
|
|
1899
|
+
Component30({
|
|
1900
|
+
selector: "mcpe-feedback",
|
|
1901
|
+
standalone: true,
|
|
1902
|
+
template: `<div class="mcpe-feedback"><ng-content /></div>`
|
|
1903
|
+
})
|
|
1904
|
+
], SnxFeedbackComponent);
|
|
1905
|
+
var SnxFeedbackButtonComponent = class {
|
|
1906
|
+
static {
|
|
1907
|
+
__name(this, "SnxFeedbackButtonComponent");
|
|
1908
|
+
}
|
|
1909
|
+
feedbackType = input28.required({
|
|
1910
|
+
alias: "type"
|
|
1911
|
+
});
|
|
1912
|
+
selected = input28(false);
|
|
1913
|
+
class = input28("");
|
|
1914
|
+
classes = computed20(() => [
|
|
1915
|
+
"mcpe-feedback-btn",
|
|
1916
|
+
`mcpe-feedback-btn-${this.feedbackType()}`,
|
|
1917
|
+
this.selected() ? "mcpe-feedback-btn-selected" : "",
|
|
1918
|
+
this.class()
|
|
1919
|
+
].filter(Boolean).join(" "));
|
|
1920
|
+
};
|
|
1921
|
+
SnxFeedbackButtonComponent = _ts_decorate31([
|
|
1922
|
+
Component30({
|
|
1923
|
+
selector: "mcpe-feedback-btn",
|
|
1924
|
+
standalone: true,
|
|
1925
|
+
template: `
|
|
1926
|
+
<button [class]="classes()" type="button">
|
|
1927
|
+
@if (feedbackType() === 'up') {
|
|
1928
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
1929
|
+
<path d="M7 10v12"/><path d="M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z"/>
|
|
1930
|
+
</svg>
|
|
1931
|
+
} @else {
|
|
1932
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
1933
|
+
<path d="M17 14V2"/><path d="M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z"/>
|
|
1934
|
+
</svg>
|
|
1935
|
+
}
|
|
1936
|
+
</button>
|
|
1937
|
+
`
|
|
1938
|
+
})
|
|
1939
|
+
], SnxFeedbackButtonComponent);
|
|
1940
|
+
var SnxFeedbackSeparatorComponent = class {
|
|
1941
|
+
static {
|
|
1942
|
+
__name(this, "SnxFeedbackSeparatorComponent");
|
|
1943
|
+
}
|
|
1944
|
+
};
|
|
1945
|
+
SnxFeedbackSeparatorComponent = _ts_decorate31([
|
|
1946
|
+
Component30({
|
|
1947
|
+
selector: "mcpe-feedback-separator",
|
|
1948
|
+
standalone: true,
|
|
1949
|
+
template: `<span class="mcpe-feedback-separator"></span>`
|
|
1950
|
+
})
|
|
1951
|
+
], SnxFeedbackSeparatorComponent);
|
|
1952
|
+
var SnxFeedbackFormComponent = class {
|
|
1953
|
+
static {
|
|
1954
|
+
__name(this, "SnxFeedbackFormComponent");
|
|
1955
|
+
}
|
|
1956
|
+
};
|
|
1957
|
+
SnxFeedbackFormComponent = _ts_decorate31([
|
|
1958
|
+
Component30({
|
|
1959
|
+
selector: "mcpe-feedback-form",
|
|
1960
|
+
standalone: true,
|
|
1961
|
+
template: `<div class="mcpe-feedback-form"><ng-content /></div>`
|
|
1962
|
+
})
|
|
1963
|
+
], SnxFeedbackFormComponent);
|
|
1964
|
+
var SnxFeedbackInputComponent = class {
|
|
1965
|
+
static {
|
|
1966
|
+
__name(this, "SnxFeedbackInputComponent");
|
|
1967
|
+
}
|
|
1968
|
+
placeholder = input28("Add a comment...");
|
|
1969
|
+
};
|
|
1970
|
+
SnxFeedbackInputComponent = _ts_decorate31([
|
|
1971
|
+
Component30({
|
|
1972
|
+
selector: "mcpe-feedback-input",
|
|
1973
|
+
standalone: true,
|
|
1974
|
+
template: `<input class="mcpe-feedback-input" [placeholder]="placeholder()" />`
|
|
1975
|
+
})
|
|
1976
|
+
], SnxFeedbackInputComponent);
|
|
1977
|
+
var SnxFeedbackSubmitComponent = class {
|
|
1978
|
+
static {
|
|
1979
|
+
__name(this, "SnxFeedbackSubmitComponent");
|
|
1980
|
+
}
|
|
1981
|
+
};
|
|
1982
|
+
SnxFeedbackSubmitComponent = _ts_decorate31([
|
|
1983
|
+
Component30({
|
|
1984
|
+
selector: "mcpe-feedback-submit",
|
|
1985
|
+
standalone: true,
|
|
1986
|
+
template: `<button class="mcpe-feedback-submit" type="button"><ng-content /></button>`
|
|
1987
|
+
})
|
|
1988
|
+
], SnxFeedbackSubmitComponent);
|
|
1989
|
+
|
|
1990
|
+
// src/mcp/mcp-server-status.component.ts
|
|
1991
|
+
import { Component as Component31, input as input29, computed as computed21 } from "@angular/core";
|
|
1992
|
+
import { cn } from "@mcp-elements/core";
|
|
1993
|
+
function _ts_decorate32(decorators, target, key, desc) {
|
|
1994
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1995
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
1996
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1997
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1998
|
+
}
|
|
1999
|
+
__name(_ts_decorate32, "_ts_decorate");
|
|
2000
|
+
var STATUS_LABELS = {
|
|
2001
|
+
connected: "Connected",
|
|
2002
|
+
connecting: "Connecting",
|
|
2003
|
+
disconnected: "Disconnected",
|
|
2004
|
+
error: "Error"
|
|
2005
|
+
};
|
|
2006
|
+
var McpeMcpServerStatusComponent = class {
|
|
2007
|
+
static {
|
|
2008
|
+
__name(this, "McpeMcpServerStatusComponent");
|
|
2009
|
+
}
|
|
2010
|
+
status = input29.required();
|
|
2011
|
+
serverName = input29();
|
|
2012
|
+
class = input29("");
|
|
2013
|
+
classes = computed21(() => cn("mcpe-mcp-server-status", `mcpe-mcp-server-status-${this.status()}`, this.class()));
|
|
2014
|
+
label = computed21(() => {
|
|
2015
|
+
const s = this.serverName();
|
|
2016
|
+
const statusLabel = STATUS_LABELS[this.status()];
|
|
2017
|
+
return s ? `${s} \xB7 ${statusLabel}` : statusLabel;
|
|
2018
|
+
});
|
|
2019
|
+
ariaLabel = computed21(() => {
|
|
2020
|
+
const s = this.serverName();
|
|
2021
|
+
const statusLabel = STATUS_LABELS[this.status()];
|
|
2022
|
+
return s ? `${s}: ${statusLabel}` : statusLabel;
|
|
2023
|
+
});
|
|
2024
|
+
};
|
|
2025
|
+
McpeMcpServerStatusComponent = _ts_decorate32([
|
|
2026
|
+
Component31({
|
|
2027
|
+
selector: "mcpe-mcp-server-status",
|
|
2028
|
+
standalone: true,
|
|
2029
|
+
template: `
|
|
2030
|
+
<span
|
|
2031
|
+
[class]="classes()"
|
|
2032
|
+
role="status"
|
|
2033
|
+
aria-live="polite"
|
|
2034
|
+
[attr.aria-label]="ariaLabel()"
|
|
2035
|
+
>
|
|
2036
|
+
<span class="mcpe-mcp-server-status-dot" aria-hidden="true"></span>
|
|
2037
|
+
{{ label() }}
|
|
2038
|
+
</span>
|
|
2039
|
+
`
|
|
2040
|
+
})
|
|
2041
|
+
], McpeMcpServerStatusComponent);
|
|
2042
|
+
|
|
2043
|
+
// src/mcp/mcp-tool-call.component.ts
|
|
2044
|
+
import { Component as Component32, input as input30, output as output10, signal as signal13, effect as effect2, computed as computed22 } from "@angular/core";
|
|
2045
|
+
import { CommonModule } from "@angular/common";
|
|
2046
|
+
import { cn as cn2 } from "@mcp-elements/core";
|
|
2047
|
+
function _ts_decorate33(decorators, target, key, desc) {
|
|
2048
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2049
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
2050
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
2051
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2052
|
+
}
|
|
2053
|
+
__name(_ts_decorate33, "_ts_decorate");
|
|
2054
|
+
function _ts_metadata4(k, v) {
|
|
2055
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
2056
|
+
}
|
|
2057
|
+
__name(_ts_metadata4, "_ts_metadata");
|
|
2058
|
+
var STATUS_LABELS2 = {
|
|
2059
|
+
idle: "idle",
|
|
2060
|
+
pending: "pending",
|
|
2061
|
+
running: "running",
|
|
2062
|
+
done: "done",
|
|
2063
|
+
error: "error",
|
|
2064
|
+
cancelled: "cancelled"
|
|
2065
|
+
};
|
|
2066
|
+
var McpeMcpToolCallComponent = class {
|
|
2067
|
+
static {
|
|
2068
|
+
__name(this, "McpeMcpToolCallComponent");
|
|
2069
|
+
}
|
|
2070
|
+
state = input30.required();
|
|
2071
|
+
toolName = input30();
|
|
2072
|
+
args = input30();
|
|
2073
|
+
onRetry = output10();
|
|
2074
|
+
class = input30("");
|
|
2075
|
+
statusLabels = STATUS_LABELS2;
|
|
2076
|
+
snap = signal13({
|
|
2077
|
+
status: "idle"
|
|
2078
|
+
});
|
|
2079
|
+
_unsub;
|
|
2080
|
+
constructor() {
|
|
2081
|
+
effect2(() => {
|
|
2082
|
+
this._unsub?.();
|
|
2083
|
+
const s = this.state();
|
|
2084
|
+
this.snap.set({
|
|
2085
|
+
status: s.status,
|
|
2086
|
+
tool: s.tool,
|
|
2087
|
+
args: s.args,
|
|
2088
|
+
result: s.result,
|
|
2089
|
+
error: s.error,
|
|
2090
|
+
startedAt: s.startedAt,
|
|
2091
|
+
endedAt: s.endedAt
|
|
2092
|
+
});
|
|
2093
|
+
this._unsub = s.subscribe((snapshot) => this.snap.set({
|
|
2094
|
+
...snapshot
|
|
2095
|
+
}));
|
|
2096
|
+
});
|
|
2097
|
+
}
|
|
2098
|
+
ngOnDestroy() {
|
|
2099
|
+
this._unsub?.();
|
|
2100
|
+
}
|
|
2101
|
+
classes = computed22(() => cn2("mcpe-mcp-tool-call", this.class()));
|
|
2102
|
+
badgeClass = computed22(() => cn2("mcpe-mcp-tool-call-badge", `mcpe-mcp-tool-call-badge-${this.snap().status}`));
|
|
2103
|
+
displayName = computed22(() => this.snap().tool ?? this.toolName() ?? "unknown");
|
|
2104
|
+
displayArgs = computed22(() => this.snap().args ?? this.args());
|
|
2105
|
+
textBlocks = computed22(() => this.snap().result?.content.filter((c) => c.type === "text").map((c) => c.text) ?? []);
|
|
2106
|
+
};
|
|
2107
|
+
McpeMcpToolCallComponent = _ts_decorate33([
|
|
2108
|
+
Component32({
|
|
2109
|
+
selector: "mcpe-mcp-tool-call",
|
|
2110
|
+
standalone: true,
|
|
2111
|
+
imports: [
|
|
2112
|
+
CommonModule
|
|
2113
|
+
],
|
|
2114
|
+
template: `
|
|
2115
|
+
<div [class]="classes()">
|
|
2116
|
+
<!-- Header -->
|
|
2117
|
+
<div class="mcpe-mcp-tool-call-header">
|
|
2118
|
+
<div class="mcpe-mcp-tool-call-name">
|
|
2119
|
+
<span class="mcpe-mcp-tool-call-icon" aria-hidden="true">fn</span>
|
|
2120
|
+
<span class="mcpe-mcp-tool-call-title">{{ displayName() }}</span>
|
|
2121
|
+
</div>
|
|
2122
|
+
<span [class]="badgeClass()">
|
|
2123
|
+
@if (snap().status === 'running') {
|
|
2124
|
+
<svg class="animate-spin h-3 w-3" fill="none" viewBox="0 0 24 24" aria-hidden="true">
|
|
2125
|
+
<circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"/>
|
|
2126
|
+
<path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"/>
|
|
2127
|
+
</svg>
|
|
2128
|
+
}
|
|
2129
|
+
{{ statusLabels[snap().status] }}
|
|
2130
|
+
</span>
|
|
2131
|
+
</div>
|
|
2132
|
+
<!-- Args -->
|
|
2133
|
+
@if (displayArgs()) {
|
|
2134
|
+
<pre class="mcpe-mcp-tool-call-args">{{ displayArgs() | json }}</pre>
|
|
2135
|
+
}
|
|
2136
|
+
<!-- Progress bar -->
|
|
2137
|
+
@if (snap().status === 'running') {
|
|
2138
|
+
<div class="mcpe-mcp-tool-call-progress" role="progressbar" aria-label="Tool running">
|
|
2139
|
+
<div class="mcpe-mcp-tool-call-progress-bar" style="width: 60%"></div>
|
|
2140
|
+
</div>
|
|
2141
|
+
}
|
|
2142
|
+
<!-- Result -->
|
|
2143
|
+
@if (snap().status === 'done' && snap().result) {
|
|
2144
|
+
<div class="mcpe-mcp-tool-call-result mcpe-mcp-tool-call-result-done">
|
|
2145
|
+
@for (block of textBlocks(); track $index) {
|
|
2146
|
+
<p class="whitespace-pre-wrap text-sm">{{ block }}</p>
|
|
2147
|
+
}
|
|
2148
|
+
</div>
|
|
2149
|
+
}
|
|
2150
|
+
<!-- Error -->
|
|
2151
|
+
@if (snap().status === 'error' && snap().error) {
|
|
2152
|
+
<div class="mcpe-mcp-tool-call-result mcpe-mcp-tool-call-result-error">
|
|
2153
|
+
<p class="text-sm">{{ snap().error?.message }}</p>
|
|
2154
|
+
<button (click)="onRetry.emit()" class="text-xs underline underline-offset-2">Retry</button>
|
|
2155
|
+
</div>
|
|
2156
|
+
}
|
|
2157
|
+
</div>
|
|
2158
|
+
`
|
|
2159
|
+
}),
|
|
2160
|
+
_ts_metadata4("design:type", Function),
|
|
2161
|
+
_ts_metadata4("design:paramtypes", [])
|
|
2162
|
+
], McpeMcpToolCallComponent);
|
|
2163
|
+
|
|
2164
|
+
// src/mcp/mcp-tool-form.component.ts
|
|
2165
|
+
import { Component as Component33, input as input31, output as output11, signal as signal14, computed as computed23 } from "@angular/core";
|
|
2166
|
+
import { CommonModule as CommonModule2 } from "@angular/common";
|
|
2167
|
+
import { cn as cn3, schemaToFields } from "@mcp-elements/core";
|
|
2168
|
+
function _ts_decorate34(decorators, target, key, desc) {
|
|
2169
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2170
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
2171
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
2172
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2173
|
+
}
|
|
2174
|
+
__name(_ts_decorate34, "_ts_decorate");
|
|
2175
|
+
var McpeMcpToolFormComponent = class {
|
|
2176
|
+
static {
|
|
2177
|
+
__name(this, "McpeMcpToolFormComponent");
|
|
2178
|
+
}
|
|
2179
|
+
schema = input31.required();
|
|
2180
|
+
loading = input31(false);
|
|
2181
|
+
submitLabel = input31("Run");
|
|
2182
|
+
class = input31("");
|
|
2183
|
+
onSubmit = output11();
|
|
2184
|
+
fields = computed23(() => schemaToFields(this.schema()));
|
|
2185
|
+
values = signal14({});
|
|
2186
|
+
ngOnInit() {
|
|
2187
|
+
const defaults = {};
|
|
2188
|
+
for (const f of this.fields()) {
|
|
2189
|
+
if (f.defaultValue !== void 0) defaults[f.key] = f.defaultValue;
|
|
2190
|
+
}
|
|
2191
|
+
this.values.set(defaults);
|
|
2192
|
+
}
|
|
2193
|
+
classes = computed23(() => cn3("mcpe-mcp-tool-form", this.class()));
|
|
2194
|
+
setValue(key, value) {
|
|
2195
|
+
this.values.update((v) => ({
|
|
2196
|
+
...v,
|
|
2197
|
+
[key]: value
|
|
2198
|
+
}));
|
|
2199
|
+
}
|
|
2200
|
+
onInputChange(key, event) {
|
|
2201
|
+
this.setValue(key, event.target.value);
|
|
2202
|
+
}
|
|
2203
|
+
onNumberChange(key, event) {
|
|
2204
|
+
this.setValue(key, event.target.valueAsNumber);
|
|
2205
|
+
}
|
|
2206
|
+
onCheckChange(key, event) {
|
|
2207
|
+
this.setValue(key, event.target.checked);
|
|
2208
|
+
}
|
|
2209
|
+
getStr(key) {
|
|
2210
|
+
const v = this.values()[key];
|
|
2211
|
+
return v == null ? "" : String(v);
|
|
2212
|
+
}
|
|
2213
|
+
getBool(key) {
|
|
2214
|
+
return Boolean(this.values()[key]);
|
|
2215
|
+
}
|
|
2216
|
+
labelClass(field) {
|
|
2217
|
+
return cn3("mcpe-mcp-tool-form-label", field.required ? "mcpe-mcp-tool-form-label-required" : "");
|
|
2218
|
+
}
|
|
2219
|
+
inputType(field) {
|
|
2220
|
+
switch (field.kind) {
|
|
2221
|
+
case "email":
|
|
2222
|
+
return "email";
|
|
2223
|
+
case "url":
|
|
2224
|
+
return "url";
|
|
2225
|
+
case "date":
|
|
2226
|
+
return "date";
|
|
2227
|
+
default:
|
|
2228
|
+
return "text";
|
|
2229
|
+
}
|
|
2230
|
+
}
|
|
2231
|
+
handleSubmit() {
|
|
2232
|
+
this.onSubmit.emit(this.values());
|
|
2233
|
+
}
|
|
2234
|
+
};
|
|
2235
|
+
McpeMcpToolFormComponent = _ts_decorate34([
|
|
2236
|
+
Component33({
|
|
2237
|
+
selector: "mcpe-mcp-tool-form",
|
|
2238
|
+
standalone: true,
|
|
2239
|
+
imports: [
|
|
2240
|
+
CommonModule2
|
|
2241
|
+
],
|
|
2242
|
+
template: `
|
|
2243
|
+
<form [class]="classes()" (ngSubmit)="handleSubmit()">
|
|
2244
|
+
@if (fields().length === 0) {
|
|
2245
|
+
<p class="text-sm text-muted-foreground">This tool takes no inputs.</p>
|
|
2246
|
+
}
|
|
2247
|
+
@for (field of fields(); track field.key) {
|
|
2248
|
+
<div class="mcpe-mcp-tool-form-field">
|
|
2249
|
+
<label
|
|
2250
|
+
[for]="field.key"
|
|
2251
|
+
[class]="labelClass(field)"
|
|
2252
|
+
>{{ field.label }}</label>
|
|
2253
|
+
@switch (field.kind) {
|
|
2254
|
+
@case ('switch') {
|
|
2255
|
+
<input type="checkbox" [id]="field.key" class="mcpe-switch"
|
|
2256
|
+
[checked]="getBool(field.key)"
|
|
2257
|
+
(change)="onCheckChange(field.key, $event)" />
|
|
2258
|
+
}
|
|
2259
|
+
@case ('select') {
|
|
2260
|
+
<select [id]="field.key" class="mcpe-select"
|
|
2261
|
+
[value]="getStr(field.key)"
|
|
2262
|
+
(change)="onInputChange(field.key, $event)">
|
|
2263
|
+
<option value="">Select\u2026</option>
|
|
2264
|
+
@for (opt of field.options ?? []; track opt.value) {
|
|
2265
|
+
<option [value]="opt.value">{{ opt.label }}</option>
|
|
2266
|
+
}
|
|
2267
|
+
</select>
|
|
2268
|
+
}
|
|
2269
|
+
@case ('textarea') {
|
|
2270
|
+
<textarea [id]="field.key" class="mcpe-textarea" rows="4"
|
|
2271
|
+
[value]="getStr(field.key)"
|
|
2272
|
+
(input)="onInputChange(field.key, $event)"></textarea>
|
|
2273
|
+
}
|
|
2274
|
+
@case ('number') {
|
|
2275
|
+
<input type="number" [id]="field.key" class="mcpe-input"
|
|
2276
|
+
[value]="getStr(field.key)"
|
|
2277
|
+
(input)="onNumberChange(field.key, $event)" />
|
|
2278
|
+
}
|
|
2279
|
+
@default {
|
|
2280
|
+
<input [type]="inputType(field)" [id]="field.key" class="mcpe-input"
|
|
2281
|
+
[value]="getStr(field.key)"
|
|
2282
|
+
(input)="onInputChange(field.key, $event)" />
|
|
2283
|
+
}
|
|
2284
|
+
}
|
|
2285
|
+
@if (field.help) {
|
|
2286
|
+
<p class="mcpe-mcp-tool-form-help">{{ field.help }}</p>
|
|
2287
|
+
}
|
|
2288
|
+
</div>
|
|
2289
|
+
}
|
|
2290
|
+
<div class="mcpe-mcp-tool-form-submit">
|
|
2291
|
+
<button type="submit" class="mcpe-btn mcpe-btn-primary mcpe-btn-sm" [disabled]="loading()">
|
|
2292
|
+
{{ loading() ? 'Running\u2026' : submitLabel() }}
|
|
2293
|
+
</button>
|
|
2294
|
+
</div>
|
|
2295
|
+
</form>
|
|
2296
|
+
`
|
|
2297
|
+
})
|
|
2298
|
+
], McpeMcpToolFormComponent);
|
|
2299
|
+
|
|
2300
|
+
// src/mcp/mcp-consent-dialog.component.ts
|
|
2301
|
+
import { Component as Component34, input as input32, output as output12, computed as computed24 } from "@angular/core";
|
|
2302
|
+
import { CommonModule as CommonModule3 } from "@angular/common";
|
|
2303
|
+
import { parseScopes } from "@mcp-elements/core";
|
|
2304
|
+
function _ts_decorate35(decorators, target, key, desc) {
|
|
2305
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2306
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
2307
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
2308
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2309
|
+
}
|
|
2310
|
+
__name(_ts_decorate35, "_ts_decorate");
|
|
2311
|
+
var McpeMcpConsentDialogComponent = class {
|
|
2312
|
+
static {
|
|
2313
|
+
__name(this, "McpeMcpConsentDialogComponent");
|
|
2314
|
+
}
|
|
2315
|
+
open = input32.required();
|
|
2316
|
+
serverName = input32.required();
|
|
2317
|
+
serverIcon = input32();
|
|
2318
|
+
scopes = input32([]);
|
|
2319
|
+
onApprove = output12();
|
|
2320
|
+
onDeny = output12();
|
|
2321
|
+
parsedScopes = computed24(() => parseScopes(this.scopes().join(" ")));
|
|
2322
|
+
approve() {
|
|
2323
|
+
this.onApprove.emit();
|
|
2324
|
+
}
|
|
2325
|
+
deny() {
|
|
2326
|
+
this.onDeny.emit();
|
|
2327
|
+
}
|
|
2328
|
+
};
|
|
2329
|
+
McpeMcpConsentDialogComponent = _ts_decorate35([
|
|
2330
|
+
Component34({
|
|
2331
|
+
selector: "mcpe-mcp-consent-dialog",
|
|
2332
|
+
standalone: true,
|
|
2333
|
+
imports: [
|
|
2334
|
+
CommonModule3
|
|
2335
|
+
],
|
|
2336
|
+
template: `
|
|
2337
|
+
@if (open()) {
|
|
2338
|
+
<div class="mcpe-dialog-overlay" (click)="deny()"></div>
|
|
2339
|
+
<div class="mcpe-dialog-content" role="dialog" aria-modal="true" [attr.aria-label]="'Allow ' + serverName() + '?'">
|
|
2340
|
+
<!-- Server info -->
|
|
2341
|
+
<div class="mcpe-mcp-consent-dialog-server">
|
|
2342
|
+
<div class="mcpe-mcp-consent-dialog-icon" aria-hidden="true">
|
|
2343
|
+
@if (serverIcon()) {
|
|
2344
|
+
<img [src]="serverIcon()" alt="" class="h-full w-full object-cover" />
|
|
2345
|
+
} @else {
|
|
2346
|
+
{{ serverName()[0]?.toUpperCase() ?? '?' }}
|
|
2347
|
+
}
|
|
2348
|
+
</div>
|
|
2349
|
+
<div>
|
|
2350
|
+
<p class="mcpe-mcp-consent-dialog-server-name">{{ serverName() }}</p>
|
|
2351
|
+
<p class="mcpe-mcp-consent-dialog-server-meta">is requesting access to</p>
|
|
2352
|
+
</div>
|
|
2353
|
+
</div>
|
|
2354
|
+
<!-- Scopes -->
|
|
2355
|
+
<div class="mcpe-mcp-consent-dialog-scopes" role="list" aria-label="Requested permissions">
|
|
2356
|
+
@for (s of parsedScopes(); track s.raw) {
|
|
2357
|
+
<div class="mcpe-mcp-consent-dialog-scope-item" role="listitem">
|
|
2358
|
+
<div class="flex-1 min-w-0">
|
|
2359
|
+
<p class="mcpe-mcp-consent-dialog-scope-resource">{{ s.resource }}</p>
|
|
2360
|
+
<div class="mcpe-mcp-consent-dialog-scope-perms">
|
|
2361
|
+
@for (p of s.permissions; track p) {
|
|
2362
|
+
<span class="mcpe-mcp-consent-dialog-scope-perm">{{ p }}</span>
|
|
2363
|
+
}
|
|
2364
|
+
</div>
|
|
2365
|
+
</div>
|
|
2366
|
+
</div>
|
|
2367
|
+
}
|
|
2368
|
+
</div>
|
|
2369
|
+
<!-- Actions -->
|
|
2370
|
+
<div class="mcpe-mcp-consent-dialog-actions">
|
|
2371
|
+
<button class="mcpe-btn mcpe-btn-outline flex-1" (click)="deny()">Deny</button>
|
|
2372
|
+
<button class="mcpe-btn mcpe-btn-primary flex-1" (click)="approve()">Allow</button>
|
|
2373
|
+
</div>
|
|
2374
|
+
</div>
|
|
2375
|
+
}
|
|
2376
|
+
`
|
|
2377
|
+
})
|
|
2378
|
+
], McpeMcpConsentDialogComponent);
|
|
2379
|
+
|
|
2380
|
+
// src/mcp/mcp-scope-inspector.component.ts
|
|
2381
|
+
import { Component as Component35, input as input33, signal as signal15, computed as computed25 } from "@angular/core";
|
|
2382
|
+
import { CommonModule as CommonModule4 } from "@angular/common";
|
|
2383
|
+
import { cn as cn4, parseScopes as parseScopes2 } from "@mcp-elements/core";
|
|
2384
|
+
function _ts_decorate36(decorators, target, key, desc) {
|
|
2385
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2386
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
2387
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
2388
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2389
|
+
}
|
|
2390
|
+
__name(_ts_decorate36, "_ts_decorate");
|
|
2391
|
+
var McpeMcpScopeInspectorComponent = class {
|
|
2392
|
+
static {
|
|
2393
|
+
__name(this, "McpeMcpScopeInspectorComponent");
|
|
2394
|
+
}
|
|
2395
|
+
scopes = input33("");
|
|
2396
|
+
descriptions = input33({});
|
|
2397
|
+
class = input33("");
|
|
2398
|
+
openKeys = signal15(/* @__PURE__ */ new Set());
|
|
2399
|
+
parsedScopes = computed25(() => {
|
|
2400
|
+
const s = this.scopes();
|
|
2401
|
+
return typeof s === "string" ? parseScopes2(s) : s;
|
|
2402
|
+
});
|
|
2403
|
+
classes = computed25(() => cn4("mcpe-mcp-scope-inspector", this.class()));
|
|
2404
|
+
toggle(key) {
|
|
2405
|
+
this.openKeys.update((prev) => {
|
|
2406
|
+
const next = new Set(prev);
|
|
2407
|
+
if (next.has(key)) next.delete(key);
|
|
2408
|
+
else next.add(key);
|
|
2409
|
+
return next;
|
|
2410
|
+
});
|
|
2411
|
+
}
|
|
2412
|
+
isOpen(key) {
|
|
2413
|
+
return this.openKeys().has(key);
|
|
2414
|
+
}
|
|
2415
|
+
chevronClass(key) {
|
|
2416
|
+
return cn4("mcpe-mcp-scope-inspector-chevron", this.isOpen(key) ? "mcpe-mcp-scope-inspector-chevron-open" : "");
|
|
2417
|
+
}
|
|
2418
|
+
getDescription(s) {
|
|
2419
|
+
const d = this.descriptions();
|
|
2420
|
+
return d[s.raw] ?? d[s.resource] ?? s.description;
|
|
2421
|
+
}
|
|
2422
|
+
};
|
|
2423
|
+
McpeMcpScopeInspectorComponent = _ts_decorate36([
|
|
2424
|
+
Component35({
|
|
2425
|
+
selector: "mcpe-mcp-scope-inspector",
|
|
2426
|
+
standalone: true,
|
|
2427
|
+
imports: [
|
|
2428
|
+
CommonModule4
|
|
2429
|
+
],
|
|
2430
|
+
template: `
|
|
2431
|
+
<div [class]="classes()" role="list">
|
|
2432
|
+
@for (s of parsedScopes(); track s.raw) {
|
|
2433
|
+
<div class="mcpe-mcp-scope-inspector-item" role="listitem">
|
|
2434
|
+
<button
|
|
2435
|
+
type="button"
|
|
2436
|
+
class="mcpe-mcp-scope-inspector-trigger"
|
|
2437
|
+
[attr.aria-expanded]="isOpen(s.raw)"
|
|
2438
|
+
(click)="toggle(s.raw)"
|
|
2439
|
+
>
|
|
2440
|
+
<div class="flex items-center gap-3">
|
|
2441
|
+
<span class="mcpe-mcp-scope-inspector-resource">{{ s.resource }}</span>
|
|
2442
|
+
<div class="mcpe-mcp-scope-inspector-perms">
|
|
2443
|
+
@for (p of s.permissions; track p) {
|
|
2444
|
+
<span class="mcpe-mcp-scope-inspector-perm">{{ p }}</span>
|
|
2445
|
+
}
|
|
2446
|
+
</div>
|
|
2447
|
+
</div>
|
|
2448
|
+
<svg
|
|
2449
|
+
[class]="chevronClass(s.raw)"
|
|
2450
|
+
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"
|
|
2451
|
+
fill="none" stroke="currentColor" stroke-width="2"
|
|
2452
|
+
stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
|
2453
|
+
<path d="m6 9 6 6 6-6"/>
|
|
2454
|
+
</svg>
|
|
2455
|
+
</button>
|
|
2456
|
+
@if (isOpen(s.raw) && getDescription(s)) {
|
|
2457
|
+
<div role="region" class="mcpe-mcp-scope-inspector-body">
|
|
2458
|
+
{{ getDescription(s) }}
|
|
2459
|
+
</div>
|
|
2460
|
+
}
|
|
2461
|
+
</div>
|
|
2462
|
+
}
|
|
2463
|
+
</div>
|
|
2464
|
+
`
|
|
2465
|
+
})
|
|
2466
|
+
], McpeMcpScopeInspectorComponent);
|
|
2467
|
+
|
|
2468
|
+
// src/mcp/mcp-resource-browser.component.ts
|
|
2469
|
+
import { Component as Component36, input as input34, output as output13, computed as computed26 } from "@angular/core";
|
|
2470
|
+
import { CommonModule as CommonModule5 } from "@angular/common";
|
|
2471
|
+
import { cn as cn5 } from "@mcp-elements/core";
|
|
2472
|
+
function _ts_decorate37(decorators, target, key, desc) {
|
|
2473
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2474
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
2475
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
2476
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2477
|
+
}
|
|
2478
|
+
__name(_ts_decorate37, "_ts_decorate");
|
|
2479
|
+
function mimeTypeLabel(mimeType) {
|
|
2480
|
+
if (!mimeType) return "res";
|
|
2481
|
+
if (mimeType.includes("json")) return "json";
|
|
2482
|
+
if (mimeType.includes("text")) return "txt";
|
|
2483
|
+
if (mimeType.includes("image")) return "img";
|
|
2484
|
+
if (mimeType.includes("pdf")) return "pdf";
|
|
2485
|
+
return mimeType.split("/")[1]?.slice(0, 4) ?? "res";
|
|
2486
|
+
}
|
|
2487
|
+
__name(mimeTypeLabel, "mimeTypeLabel");
|
|
2488
|
+
var McpeMcpResourceBrowserComponent = class {
|
|
2489
|
+
static {
|
|
2490
|
+
__name(this, "McpeMcpResourceBrowserComponent");
|
|
2491
|
+
}
|
|
2492
|
+
resources = input34([]);
|
|
2493
|
+
selectedUri = input34();
|
|
2494
|
+
loading = input34(false);
|
|
2495
|
+
class = input34("");
|
|
2496
|
+
onSelect = output13();
|
|
2497
|
+
skeletonItems = [
|
|
2498
|
+
1,
|
|
2499
|
+
2,
|
|
2500
|
+
3,
|
|
2501
|
+
4
|
|
2502
|
+
];
|
|
2503
|
+
classes = computed26(() => cn5("mcpe-mcp-resource-browser", this.class()));
|
|
2504
|
+
itemClass(uri) {
|
|
2505
|
+
return cn5("mcpe-mcp-resource-browser-item w-full text-left", this.selectedUri() === uri ? "mcpe-mcp-resource-browser-item-selected" : "");
|
|
2506
|
+
}
|
|
2507
|
+
mimeLabel(mimeType) {
|
|
2508
|
+
return mimeTypeLabel(mimeType);
|
|
2509
|
+
}
|
|
2510
|
+
select(r) {
|
|
2511
|
+
this.onSelect.emit(r);
|
|
2512
|
+
}
|
|
2513
|
+
};
|
|
2514
|
+
McpeMcpResourceBrowserComponent = _ts_decorate37([
|
|
2515
|
+
Component36({
|
|
2516
|
+
selector: "mcpe-mcp-resource-browser",
|
|
2517
|
+
standalone: true,
|
|
2518
|
+
imports: [
|
|
2519
|
+
CommonModule5
|
|
2520
|
+
],
|
|
2521
|
+
template: `
|
|
2522
|
+
@if (loading()) {
|
|
2523
|
+
<div [class]="classes()">
|
|
2524
|
+
@for (n of skeletonItems; track n) {
|
|
2525
|
+
<div class="flex items-center gap-3 px-3 py-2.5">
|
|
2526
|
+
<div class="h-8 w-8 rounded-md animate-pulse bg-muted"></div>
|
|
2527
|
+
<div class="h-4 flex-1 rounded animate-pulse bg-muted"></div>
|
|
2528
|
+
</div>
|
|
2529
|
+
}
|
|
2530
|
+
</div>
|
|
2531
|
+
} @else if (resources().length === 0) {
|
|
2532
|
+
<div [class]="classes()">
|
|
2533
|
+
<p class="mcpe-mcp-resource-browser-empty">No resources available</p>
|
|
2534
|
+
</div>
|
|
2535
|
+
} @else {
|
|
2536
|
+
<div [class]="classes()" role="list">
|
|
2537
|
+
@for (r of resources(); track r.uri) {
|
|
2538
|
+
<button
|
|
2539
|
+
type="button"
|
|
2540
|
+
role="listitem"
|
|
2541
|
+
[class]="itemClass(r.uri)"
|
|
2542
|
+
[attr.aria-selected]="selectedUri() === r.uri"
|
|
2543
|
+
[attr.aria-label]="r.name"
|
|
2544
|
+
(click)="select(r)"
|
|
2545
|
+
>
|
|
2546
|
+
<span class="mcpe-mcp-resource-browser-icon" aria-hidden="true">{{ mimeLabel(r.mimeType) }}</span>
|
|
2547
|
+
<span class="mcpe-mcp-resource-browser-name">{{ r.name }}</span>
|
|
2548
|
+
@if (r.mimeType) {
|
|
2549
|
+
<span class="mcpe-mcp-resource-browser-type">{{ r.mimeType.split('/')[0] }}</span>
|
|
2550
|
+
}
|
|
2551
|
+
</button>
|
|
2552
|
+
}
|
|
2553
|
+
</div>
|
|
2554
|
+
}
|
|
2555
|
+
`
|
|
2556
|
+
})
|
|
2557
|
+
], McpeMcpResourceBrowserComponent);
|
|
2558
|
+
|
|
2559
|
+
// src/mcp/mcp-app-frame.component.ts
|
|
2560
|
+
import { Component as Component37, input as input35, output as output14, effect as effect3, computed as computed27, viewChild as viewChild4 } from "@angular/core";
|
|
2561
|
+
import { cn as cn6, createAppBridge } from "@mcp-elements/core";
|
|
2562
|
+
function _ts_decorate38(decorators, target, key, desc) {
|
|
2563
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2564
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
2565
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
2566
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2567
|
+
}
|
|
2568
|
+
__name(_ts_decorate38, "_ts_decorate");
|
|
2569
|
+
function _ts_metadata5(k, v) {
|
|
2570
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
2571
|
+
}
|
|
2572
|
+
__name(_ts_metadata5, "_ts_metadata");
|
|
2573
|
+
var McpeMcpAppFrameComponent = class {
|
|
2574
|
+
static {
|
|
2575
|
+
__name(this, "McpeMcpAppFrameComponent");
|
|
2576
|
+
}
|
|
2577
|
+
src = input35.required();
|
|
2578
|
+
height = input35(480);
|
|
2579
|
+
sandbox = input35("allow-scripts allow-same-origin");
|
|
2580
|
+
class = input35("");
|
|
2581
|
+
onMessage = output14();
|
|
2582
|
+
frame = viewChild4("frame");
|
|
2583
|
+
_unsub;
|
|
2584
|
+
_removeListener;
|
|
2585
|
+
constructor() {
|
|
2586
|
+
effect3(() => {
|
|
2587
|
+
this._cleanup();
|
|
2588
|
+
const bridge = createAppBridge({
|
|
2589
|
+
postMessage: /* @__PURE__ */ __name((env) => {
|
|
2590
|
+
this.frame()?.nativeElement?.contentWindow?.postMessage(env, "*");
|
|
2591
|
+
}, "postMessage")
|
|
2592
|
+
});
|
|
2593
|
+
const unsub = bridge.onMessage((env) => this.onMessage.emit(env));
|
|
2594
|
+
const handler = /* @__PURE__ */ __name((e) => bridge.receive(e.data), "handler");
|
|
2595
|
+
window.addEventListener("message", handler);
|
|
2596
|
+
this._unsub = unsub;
|
|
2597
|
+
this._removeListener = () => window.removeEventListener("message", handler);
|
|
2598
|
+
});
|
|
2599
|
+
}
|
|
2600
|
+
_cleanup() {
|
|
2601
|
+
this._unsub?.();
|
|
2602
|
+
this._removeListener?.();
|
|
2603
|
+
this._unsub = void 0;
|
|
2604
|
+
this._removeListener = void 0;
|
|
2605
|
+
}
|
|
2606
|
+
ngOnDestroy() {
|
|
2607
|
+
this._cleanup();
|
|
2608
|
+
}
|
|
2609
|
+
classes = computed27(() => cn6("mcpe-mcp-app-frame", this.class()));
|
|
2610
|
+
};
|
|
2611
|
+
McpeMcpAppFrameComponent = _ts_decorate38([
|
|
2612
|
+
Component37({
|
|
2613
|
+
selector: "mcpe-mcp-app-frame",
|
|
2614
|
+
standalone: true,
|
|
2615
|
+
template: `
|
|
2616
|
+
<div [class]="classes()">
|
|
2617
|
+
<iframe
|
|
2618
|
+
#frame
|
|
2619
|
+
[src]="src()"
|
|
2620
|
+
[sandbox]="sandbox()"
|
|
2621
|
+
[style.height.px]="height()"
|
|
2622
|
+
title="MCP App"
|
|
2623
|
+
aria-label="MCP App frame"
|
|
2624
|
+
style="display:block;width:100%;border:none"
|
|
2625
|
+
></iframe>
|
|
2626
|
+
</div>
|
|
2627
|
+
`
|
|
2628
|
+
}),
|
|
2629
|
+
_ts_metadata5("design:type", Function),
|
|
2630
|
+
_ts_metadata5("design:paramtypes", [])
|
|
2631
|
+
], McpeMcpAppFrameComponent);
|
|
2632
|
+
export {
|
|
2633
|
+
McpeMcpAppFrameComponent,
|
|
2634
|
+
McpeMcpConsentDialogComponent,
|
|
2635
|
+
McpeMcpResourceBrowserComponent,
|
|
2636
|
+
McpeMcpScopeInspectorComponent,
|
|
2637
|
+
McpeMcpServerStatusComponent,
|
|
2638
|
+
McpeMcpToolCallComponent,
|
|
2639
|
+
McpeMcpToolFormComponent,
|
|
2640
|
+
SnxAccordionComponent,
|
|
2641
|
+
SnxAccordionContentComponent,
|
|
2642
|
+
SnxAccordionItemComponent,
|
|
2643
|
+
SnxAccordionTriggerComponent,
|
|
2644
|
+
SnxAiBadgeComponent,
|
|
2645
|
+
SnxAlertComponent,
|
|
2646
|
+
SnxAlertDescriptionComponent,
|
|
2647
|
+
SnxAlertTitleComponent,
|
|
2648
|
+
SnxAvatarComponent,
|
|
2649
|
+
SnxBadgeComponent,
|
|
2650
|
+
SnxButtonComponent,
|
|
2651
|
+
SnxCardComponent,
|
|
2652
|
+
SnxCardContentComponent,
|
|
2653
|
+
SnxCardDescriptionComponent,
|
|
2654
|
+
SnxCardFooterComponent,
|
|
2655
|
+
SnxCardHeaderComponent,
|
|
2656
|
+
SnxCardTitleComponent,
|
|
2657
|
+
SnxChatBubbleAvatarComponent,
|
|
2658
|
+
SnxChatBubbleComponent,
|
|
2659
|
+
SnxChatBubbleContentComponent,
|
|
2660
|
+
SnxChatBubbleTimestampComponent,
|
|
2661
|
+
SnxChatBubbleTypingComponent,
|
|
2662
|
+
SnxChipComponent,
|
|
2663
|
+
SnxChipsComponent,
|
|
2664
|
+
SnxCounterComponent,
|
|
2665
|
+
SnxDialogComponent,
|
|
2666
|
+
SnxDrawerBodyComponent,
|
|
2667
|
+
SnxDrawerComponent,
|
|
2668
|
+
SnxDrawerDescriptionComponent,
|
|
2669
|
+
SnxDrawerFooterComponent,
|
|
2670
|
+
SnxDrawerHeaderComponent,
|
|
2671
|
+
SnxDrawerTitleComponent,
|
|
2672
|
+
SnxDropdownMenuComponent,
|
|
2673
|
+
SnxFeedbackButtonComponent,
|
|
2674
|
+
SnxFeedbackComponent,
|
|
2675
|
+
SnxFeedbackFormComponent,
|
|
2676
|
+
SnxFeedbackInputComponent,
|
|
2677
|
+
SnxFeedbackSeparatorComponent,
|
|
2678
|
+
SnxFeedbackSubmitComponent,
|
|
2679
|
+
SnxInputComponent,
|
|
2680
|
+
SnxLoaderComponent,
|
|
2681
|
+
SnxPasswordInputComponent,
|
|
2682
|
+
SnxPopoverComponent,
|
|
2683
|
+
SnxProgressComponent,
|
|
2684
|
+
SnxPromptInputActionsComponent,
|
|
2685
|
+
SnxPromptInputAttachmentComponent,
|
|
2686
|
+
SnxPromptInputAttachmentsComponent,
|
|
2687
|
+
SnxPromptInputCharCountComponent,
|
|
2688
|
+
SnxPromptInputComponent,
|
|
2689
|
+
SnxPromptInputFooterComponent,
|
|
2690
|
+
SnxPromptInputTextareaComponent,
|
|
2691
|
+
SnxSelectComponent,
|
|
2692
|
+
SnxSeparatorComponent,
|
|
2693
|
+
SnxSkeletonComponent,
|
|
2694
|
+
SnxSourceCardComponent,
|
|
2695
|
+
SnxSourceCardsComponent,
|
|
2696
|
+
SnxStreamingTextComponent,
|
|
2697
|
+
SnxStreamingTextFadeInComponent,
|
|
2698
|
+
SnxStreamingTextLineComponent,
|
|
2699
|
+
SnxStreamingTextSkeletonComponent,
|
|
2700
|
+
SnxStreamingTextSkeletonLineComponent,
|
|
2701
|
+
SnxStreamingTextWordComponent,
|
|
2702
|
+
SnxSuggestionChipComponent,
|
|
2703
|
+
SnxSuggestionChipsComponent,
|
|
2704
|
+
SnxSwitchComponent,
|
|
2705
|
+
SnxTabsComponent,
|
|
2706
|
+
SnxTabsContentComponent,
|
|
2707
|
+
SnxTabsListComponent,
|
|
2708
|
+
SnxTabsTriggerComponent,
|
|
2709
|
+
SnxTextareaComponent,
|
|
2710
|
+
SnxToastService,
|
|
2711
|
+
SnxToasterComponent,
|
|
2712
|
+
SnxTooltipDirective
|
|
2713
|
+
};
|
|
2714
|
+
//# sourceMappingURL=index.js.map
|