@corto-ai/gds-angular 2.1.5-test.7 → 2.1.5-test.8
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/README.md
CHANGED
|
@@ -30,11 +30,11 @@ If you plan to only use the stylesheet/fonts for this library, we recommend impl
|
|
|
30
30
|
|
|
31
31
|
## CDN Assets
|
|
32
32
|
|
|
33
|
-
- All brands combined: <https://cdn.test.cortoaws.com/style/gds/2.1.5-test.
|
|
34
|
-
- Acctivity: <https://cdn.test.cortoaws.com/style/gds/2.1.5-test.
|
|
35
|
-
- CORTO: <https://cdn.test.cortoaws.com/style/gds/2.1.5-test.
|
|
36
|
-
- LawY: <https://cdn.test.cortoaws.com/style/gds/2.1.5-test.
|
|
37
|
-
- LEAP: <https://cdn.test.cortoaws.com/style/gds/2.1.5-test.
|
|
33
|
+
- All brands combined: <https://cdn.test.cortoaws.com/style/gds/2.1.5-test.8/css/all.css>
|
|
34
|
+
- Acctivity: <https://cdn.test.cortoaws.com/style/gds/2.1.5-test.8/css/acctivity.css>
|
|
35
|
+
- CORTO: <https://cdn.test.cortoaws.com/style/gds/2.1.5-test.8/css/corto.css>
|
|
36
|
+
- LawY: <https://cdn.test.cortoaws.com/style/gds/2.1.5-test.8/css/lawy.css>
|
|
37
|
+
- LEAP: <https://cdn.test.cortoaws.com/style/gds/2.1.5-test.8/css/leap.css>
|
|
38
38
|
|
|
39
39
|
## Library `@layer`s
|
|
40
40
|
|
|
@@ -9253,6 +9253,9 @@ class GdsMessageInputComponent {
|
|
|
9253
9253
|
...(ngDevMode ? [{ debugName: "sendButtonAriaLabel" }] : /* istanbul ignore next */ []));
|
|
9254
9254
|
cancelButtonAriaLabel = input('Cancel message', /* @ts-ignore */
|
|
9255
9255
|
...(ngDevMode ? [{ debugName: "cancelButtonAriaLabel" }] : /* istanbul ignore next */ []));
|
|
9256
|
+
/** Provisional text shown inline while it is still being recognized. Never part of `value`. */
|
|
9257
|
+
interimText = input('', /* @ts-ignore */
|
|
9258
|
+
...(ngDevMode ? [{ debugName: "interimText" }] : /* istanbul ignore next */ []));
|
|
9256
9259
|
sent = output();
|
|
9257
9260
|
canceled = output();
|
|
9258
9261
|
changed = output();
|
|
@@ -9268,6 +9271,11 @@ class GdsMessageInputComponent {
|
|
|
9268
9271
|
...(ngDevMode ? [{ debugName: "slot" }] : /* istanbul ignore next */ []));
|
|
9269
9272
|
hasChildren = computed(() => this.slot().nativeElement.children.length > 0, /* @ts-ignore */
|
|
9270
9273
|
...(ngDevMode ? [{ debugName: "hasChildren" }] : /* istanbul ignore next */ []));
|
|
9274
|
+
/** Last caret position seen inside the editor, so text can still be inserted after focus is lost. */
|
|
9275
|
+
#caret;
|
|
9276
|
+
#interim;
|
|
9277
|
+
#viewReady = signal(false, /* @ts-ignore */
|
|
9278
|
+
...(ngDevMode ? [{ debugName: "#viewReady" }] : /* istanbul ignore next */ []));
|
|
9271
9279
|
icon = computed(() => {
|
|
9272
9280
|
const mode = this.mode();
|
|
9273
9281
|
switch (mode) {
|
|
@@ -9288,6 +9296,7 @@ class GdsMessageInputComponent {
|
|
|
9288
9296
|
...(ngDevMode ? [{ debugName: "iconAriaLabel" }] : /* istanbul ignore next */ []));
|
|
9289
9297
|
constructor() {
|
|
9290
9298
|
afterNextRender(() => {
|
|
9299
|
+
this.#viewReady.set(true);
|
|
9291
9300
|
const initial = this.value();
|
|
9292
9301
|
if (!initial) {
|
|
9293
9302
|
return;
|
|
@@ -9296,6 +9305,28 @@ class GdsMessageInputComponent {
|
|
|
9296
9305
|
this.isEmpty.set(false);
|
|
9297
9306
|
});
|
|
9298
9307
|
}
|
|
9308
|
+
#renderInterim = effect(() => {
|
|
9309
|
+
const text = this.interimText();
|
|
9310
|
+
if (!this.#viewReady()) {
|
|
9311
|
+
return;
|
|
9312
|
+
}
|
|
9313
|
+
untracked(() => this.#applyInterim(text));
|
|
9314
|
+
}, /* @ts-ignore */
|
|
9315
|
+
...(ngDevMode ? [{ debugName: "#renderInterim" }] : /* istanbul ignore next */ []));
|
|
9316
|
+
captureCaret() {
|
|
9317
|
+
if (!this.#viewReady()) {
|
|
9318
|
+
return;
|
|
9319
|
+
}
|
|
9320
|
+
const selection = document.getSelection();
|
|
9321
|
+
if (!selection?.rangeCount) {
|
|
9322
|
+
return;
|
|
9323
|
+
}
|
|
9324
|
+
const range = selection.getRangeAt(0);
|
|
9325
|
+
if (!this.editor().nativeElement.contains(range.commonAncestorContainer)) {
|
|
9326
|
+
return;
|
|
9327
|
+
}
|
|
9328
|
+
this.#caret = range.cloneRange();
|
|
9329
|
+
}
|
|
9299
9330
|
handleInput() {
|
|
9300
9331
|
const editor = this.editor().nativeElement;
|
|
9301
9332
|
const value = this.#serializeContentEditable(editor);
|
|
@@ -9333,6 +9364,8 @@ class GdsMessageInputComponent {
|
|
|
9333
9364
|
this.hovering.set(type === 'mouseenter');
|
|
9334
9365
|
}
|
|
9335
9366
|
clear() {
|
|
9367
|
+
this.#caret = undefined;
|
|
9368
|
+
this.#interim = undefined;
|
|
9336
9369
|
this.editor().nativeElement.replaceChildren();
|
|
9337
9370
|
this.handleInput();
|
|
9338
9371
|
}
|
|
@@ -9359,6 +9392,94 @@ class GdsMessageInputComponent {
|
|
|
9359
9392
|
this.handleInput();
|
|
9360
9393
|
});
|
|
9361
9394
|
};
|
|
9395
|
+
/** Inserts at the last known caret position, falling back to appending when there is none. */
|
|
9396
|
+
insertTextAtCaret = (text) => {
|
|
9397
|
+
if (!text) {
|
|
9398
|
+
return;
|
|
9399
|
+
}
|
|
9400
|
+
const editor = this.editor().nativeElement;
|
|
9401
|
+
// While provisional text is on screen it is the anchor, so committed text lands where the user
|
|
9402
|
+
// sees it rather than at a caret they may have since moved.
|
|
9403
|
+
const range = this.#interimRange() ?? this.#resolveCaretRange(editor);
|
|
9404
|
+
if (!range) {
|
|
9405
|
+
this.appendText(text);
|
|
9406
|
+
return;
|
|
9407
|
+
}
|
|
9408
|
+
const textNode = document.createTextNode(text);
|
|
9409
|
+
range.deleteContents();
|
|
9410
|
+
range.insertNode(textNode);
|
|
9411
|
+
// Advance past the inserted text so consecutive inserts read in the order they were spoken.
|
|
9412
|
+
const next = document.createRange();
|
|
9413
|
+
next.setStartAfter(textNode);
|
|
9414
|
+
next.collapse(true);
|
|
9415
|
+
this.#caret = next;
|
|
9416
|
+
setTimeout(() => {
|
|
9417
|
+
editor.focus();
|
|
9418
|
+
this.#placeCaretAfter(textNode);
|
|
9419
|
+
this.handleInput();
|
|
9420
|
+
});
|
|
9421
|
+
};
|
|
9422
|
+
#resolveCaretRange = (editor) => {
|
|
9423
|
+
const caret = this.#caret;
|
|
9424
|
+
// An empty editor may hold a browser inserted <br>; appendText already normalizes that.
|
|
9425
|
+
if (!caret || this.#isContentEditableEmpty(editor)) {
|
|
9426
|
+
return undefined;
|
|
9427
|
+
}
|
|
9428
|
+
// The saved range is stale once its container has been removed, e.g. after clear().
|
|
9429
|
+
if (!editor.contains(caret.startContainer)) {
|
|
9430
|
+
return undefined;
|
|
9431
|
+
}
|
|
9432
|
+
// Never write inside a mention chip or other non-editable node.
|
|
9433
|
+
const element = caret.startContainer instanceof HTMLElement ? caret.startContainer : caret.startContainer.parentElement;
|
|
9434
|
+
if (element?.closest('[contenteditable="false"]')) {
|
|
9435
|
+
return undefined;
|
|
9436
|
+
}
|
|
9437
|
+
return caret.cloneRange();
|
|
9438
|
+
};
|
|
9439
|
+
#placeCaretAfter = (textNode) => {
|
|
9440
|
+
const caret = document.createRange();
|
|
9441
|
+
caret.setStartAfter(textNode);
|
|
9442
|
+
caret.collapse(true);
|
|
9443
|
+
const selection = window.getSelection();
|
|
9444
|
+
selection?.removeAllRanges();
|
|
9445
|
+
selection?.addRange(caret);
|
|
9446
|
+
};
|
|
9447
|
+
#interimRange = () => {
|
|
9448
|
+
const interim = this.#interim;
|
|
9449
|
+
if (!interim?.isConnected) {
|
|
9450
|
+
return undefined;
|
|
9451
|
+
}
|
|
9452
|
+
const range = document.createRange();
|
|
9453
|
+
range.setStartBefore(interim);
|
|
9454
|
+
range.collapse(true);
|
|
9455
|
+
return range;
|
|
9456
|
+
};
|
|
9457
|
+
#applyInterim = (text) => {
|
|
9458
|
+
const editor = this.editor().nativeElement;
|
|
9459
|
+
if (!text) {
|
|
9460
|
+
this.#interim?.remove();
|
|
9461
|
+
this.#interim = undefined;
|
|
9462
|
+
this.isEmpty.set(this.#isContentEditableEmpty(editor));
|
|
9463
|
+
return;
|
|
9464
|
+
}
|
|
9465
|
+
if (!this.#interim?.isConnected) {
|
|
9466
|
+
const node = document.createElement('span');
|
|
9467
|
+
node.dataset['interim'] = '';
|
|
9468
|
+
node.setAttribute('contenteditable', 'false');
|
|
9469
|
+
node.className = 'gds-text-placeholder';
|
|
9470
|
+
const range = this.#resolveCaretRange(editor);
|
|
9471
|
+
if (range) {
|
|
9472
|
+
range.collapse(true);
|
|
9473
|
+
range.insertNode(node);
|
|
9474
|
+
}
|
|
9475
|
+
else {
|
|
9476
|
+
editor.appendChild(node);
|
|
9477
|
+
}
|
|
9478
|
+
this.#interim = node;
|
|
9479
|
+
}
|
|
9480
|
+
this.#interim.textContent = text;
|
|
9481
|
+
this.isEmpty.set(false);
|
|
9482
|
+
};
|
|
9362
9483
|
#serializeContentEditable = (editor) => {
|
|
9363
9484
|
const parts = [];
|
|
9364
9485
|
const walk = (node) => {
|
|
@@ -9369,6 +9490,10 @@ class GdsMessageInputComponent {
|
|
|
9369
9490
|
if (!(node instanceof HTMLElement)) {
|
|
9370
9491
|
return;
|
|
9371
9492
|
}
|
|
9493
|
+
// Provisional dictation text is displayed but is not part of the message.
|
|
9494
|
+
if (node.dataset['interim'] !== undefined) {
|
|
9495
|
+
return;
|
|
9496
|
+
}
|
|
9372
9497
|
if (node.getAttribute('contenteditable') === 'false') {
|
|
9373
9498
|
parts.push(node.textContent ?? '');
|
|
9374
9499
|
return;
|
|
@@ -9392,7 +9517,7 @@ class GdsMessageInputComponent {
|
|
|
9392
9517
|
selection?.addRange(caret);
|
|
9393
9518
|
};
|
|
9394
9519
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: GdsMessageInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
9395
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.0.8", type: GdsMessageInputComponent, isStandalone: true, selector: "gds-message-input", inputs: { mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, suppressClearOnSubmit: { classPropertyName: "suppressClearOnSubmit", publicName: "suppressClearOnSubmit", isSignal: true, isRequired: false, transformFunction: null }, suppressEnterSubmit: { classPropertyName: "suppressEnterSubmit", publicName: "suppressEnterSubmit", isSignal: true, isRequired: false, transformFunction: null }, enableIcon: { classPropertyName: "enableIcon", publicName: "enableIcon", isSignal: true, isRequired: false, transformFunction: null }, disableSubmit: { classPropertyName: "disableSubmit", publicName: "disableSubmit", isSignal: true, isRequired: false, transformFunction: null }, textareaAriaLabel: { classPropertyName: "textareaAriaLabel", publicName: "textareaAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, sendButtonAriaLabel: { classPropertyName: "sendButtonAriaLabel", publicName: "sendButtonAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, cancelButtonAriaLabel: { classPropertyName: "cancelButtonAriaLabel", publicName: "cancelButtonAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { sent: "sent", canceled: "canceled", changed: "changed", value: "valueChange" }, host: { properties: { "attr.aria-disabled": "disabled()", "class.gds-background-disabled": "disabled()", "class.gds-padding-block-end-2xs": "hasChildren()" }, classAttribute: "\n gds-display-flex\n gds-flex-column\n gds-gap-sm\n gds-border\n gds-border-color-default\n gds-radius-lg\n gds-padding-xs\n gds-padding-inline-2xs\n gds-background-white\n gds-position-relative\n gds-overflow-hidden\n\n gds-mobile-radius-sm\n gds-mobile-padding-0\n " }, viewQueries: [{ propertyName: "editor", first: true, predicate: ["editor"], descendants: true, isSignal: true }, { propertyName: "slot", first: true, predicate: ["slot"], descendants: true, isSignal: true }], ngImport: i0, template: "<ng-content select=\"[header]\" />\n<div class=\"\n gds-display-flex\n gds-min-width-0\n gds-width-100-parent\n\">\n <div class=\"\n gds-display-flex\n gds-flex-column\n gds-gap-sm\n gds-width-100-parent\n \">\n <div\n #editor\n class=\"\n editor\n gds-break-word\n gds-flex-1\n gds-min-height-md-rem\n gds-min-width-0\n gds-mobile-padding-block-2xs\n gds-mobile-text-input-mobile\n gds-outline-none\n gds-padding-block-3xs\n gds-padding-inline-2xs\n gds-position-relative\n gds-scrollable-vertically\n gds-text-input\n gds-text-primary\n textarea\n \"\n [ngClass]=\"{ 'gds-padding-inline-end-md': !hasChildren() }\"\n tabindex=\"0\"\n role=\"textbox\"\n aria-multiline=\"true\"\n [attr.contenteditable]=\"disabled() ? false : 'plaintext-only'\"\n [attr.aria-label]=\"textareaAriaLabel()\"\n [attr.aria-placeholder]=\"placeholder()\"\n [attr.data-placeholder]=\"placeholder()\"\n [attr.data-empty]=\"isEmpty()\"\n (input)=\"handleInput()\"\n (keydown.enter)=\"handleEnter($event)\"\n ></div>\n <div\n #slot\n class=\"gds-display-contents\"\n [ngClass]=\"{ 'gds-display-none': !hasChildren() }\"\n >\n <ng-content select=\"[footer]\" />\n </div>\n </div>\n <button\n gds-icon-button\n class=\"\n gds-align-self-end\n gds-background-none\n gds-margin-block-end-0\n gds-mobile-right-0\n gds-padding-0\n gds-right-2xs\n trailing-icon\n \"\n variant=\"primary\"\n [disabled]=\"(disabled() && !enableIcon()) || disableSubmit()\"\n (clicked)=\"handleSubmit()\"\n (mouseenter)=\"iconHoveringChanged($event)\"\n (mouseleave)=\"iconHoveringChanged($event)\"\n [attr.aria-label]=\"iconAriaLabel()\"\n >\n <gds-icon\n [key]=\"icon()\"\n class=\"\n gds-icon-size-xs\n gds-mobile-icon-size-2xs\n \"\n />\n </button>\n</div>\n", styles: ["@layer design-system{:host ::ng-deep input:focus,:host ::ng-deep textarea:focus{outline:none}:host:focus-within,:host.is-controlled{isolation:isolate;position:relative}:host:focus-within:before,:host.is-controlled:before{z-index:-1;content:\"\";position:absolute;inset:0;border-bottom:var(--gds-borderWidth-lg) solid var(--gds-palette-border-selected);border-radius:var(--gds-borderRadius-xs)}:is(body[isMobile=true]) :host .textarea{--placeholder-color: var(--gds-palette-text-default-placeholder)}:is(body[isMobile=true]) :host .trailing-icon:focus-visible{outline-offset:calc(var(--gds-spacing-3xs) * -1)}:host[aria-disabled=true]{cursor:not-allowed}:host .trailing-icon{border-color:transparent;box-sizing:content-box}:host .editor{max-height:calc(8 * var(--gds-lineHeight-body));white-space:pre-wrap}:host .editor[data-empty=true]:before{content:attr(data-placeholder);position:absolute;inset:0;padding:inherit;color:var(--placeholder-color, var(--gds-palette-text-default-placeholder));pointer-events:none}}\n"], dependencies: [{ kind: "component", type: GdsIconComponent, selector: "gds-icon", inputs: ["key", "width", "height", "color"] }, { kind: "component", type: GdsIconButtonComponent, selector: "button[gds-icon-button]", inputs: ["tooltipLabel"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
9520
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.0.8", type: GdsMessageInputComponent, isStandalone: true, selector: "gds-message-input", inputs: { mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, suppressClearOnSubmit: { classPropertyName: "suppressClearOnSubmit", publicName: "suppressClearOnSubmit", isSignal: true, isRequired: false, transformFunction: null }, suppressEnterSubmit: { classPropertyName: "suppressEnterSubmit", publicName: "suppressEnterSubmit", isSignal: true, isRequired: false, transformFunction: null }, enableIcon: { classPropertyName: "enableIcon", publicName: "enableIcon", isSignal: true, isRequired: false, transformFunction: null }, disableSubmit: { classPropertyName: "disableSubmit", publicName: "disableSubmit", isSignal: true, isRequired: false, transformFunction: null }, textareaAriaLabel: { classPropertyName: "textareaAriaLabel", publicName: "textareaAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, sendButtonAriaLabel: { classPropertyName: "sendButtonAriaLabel", publicName: "sendButtonAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, cancelButtonAriaLabel: { classPropertyName: "cancelButtonAriaLabel", publicName: "cancelButtonAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, interimText: { classPropertyName: "interimText", publicName: "interimText", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { sent: "sent", canceled: "canceled", changed: "changed", value: "valueChange" }, host: { listeners: { "document:selectionchange": "captureCaret()" }, properties: { "attr.aria-disabled": "disabled()", "class.gds-background-disabled": "disabled()", "class.gds-padding-block-end-2xs": "hasChildren()" }, classAttribute: "\n gds-display-flex\n gds-flex-column\n gds-gap-sm\n gds-border\n gds-border-color-default\n gds-radius-lg\n gds-padding-xs\n gds-padding-inline-2xs\n gds-background-white\n gds-position-relative\n gds-overflow-hidden\n\n gds-mobile-radius-sm\n gds-mobile-padding-0\n " }, viewQueries: [{ propertyName: "editor", first: true, predicate: ["editor"], descendants: true, isSignal: true }, { propertyName: "slot", first: true, predicate: ["slot"], descendants: true, isSignal: true }], ngImport: i0, template: "<ng-content select=\"[header]\" />\n<div class=\"\n gds-display-flex\n gds-min-width-0\n gds-width-100-parent\n\">\n <div class=\"\n gds-display-flex\n gds-flex-column\n gds-gap-sm\n gds-width-100-parent\n \">\n <div\n #editor\n class=\"\n editor\n gds-break-word\n gds-flex-1\n gds-min-height-md-rem\n gds-min-width-0\n gds-mobile-padding-block-2xs\n gds-mobile-text-input-mobile\n gds-outline-none\n gds-padding-block-3xs\n gds-padding-inline-2xs\n gds-position-relative\n gds-scrollable-vertically\n gds-text-input\n gds-text-primary\n textarea\n \"\n [ngClass]=\"{ 'gds-padding-inline-end-md': !hasChildren() }\"\n tabindex=\"0\"\n role=\"textbox\"\n aria-multiline=\"true\"\n [attr.contenteditable]=\"disabled() ? false : 'plaintext-only'\"\n [attr.aria-label]=\"textareaAriaLabel()\"\n [attr.aria-placeholder]=\"placeholder()\"\n [attr.data-placeholder]=\"placeholder()\"\n [attr.data-empty]=\"isEmpty()\"\n (input)=\"handleInput()\"\n (keydown.enter)=\"handleEnter($event)\"\n ></div>\n <div\n #slot\n class=\"gds-display-contents\"\n [ngClass]=\"{ 'gds-display-none': !hasChildren() }\"\n >\n <ng-content select=\"[footer]\" />\n </div>\n </div>\n <button\n gds-icon-button\n class=\"\n gds-align-self-end\n gds-background-none\n gds-margin-block-end-0\n gds-mobile-right-0\n gds-padding-0\n gds-right-2xs\n trailing-icon\n \"\n variant=\"primary\"\n [disabled]=\"(disabled() && !enableIcon()) || disableSubmit()\"\n (clicked)=\"handleSubmit()\"\n (mouseenter)=\"iconHoveringChanged($event)\"\n (mouseleave)=\"iconHoveringChanged($event)\"\n [attr.aria-label]=\"iconAriaLabel()\"\n >\n <gds-icon\n [key]=\"icon()\"\n class=\"\n gds-icon-size-xs\n gds-mobile-icon-size-2xs\n \"\n />\n </button>\n</div>\n", styles: ["@layer design-system{:host ::ng-deep input:focus,:host ::ng-deep textarea:focus{outline:none}:host:focus-within,:host.is-controlled{isolation:isolate;position:relative}:host:focus-within:before,:host.is-controlled:before{z-index:-1;content:\"\";position:absolute;inset:0;border-bottom:var(--gds-borderWidth-lg) solid var(--gds-palette-border-selected);border-radius:var(--gds-borderRadius-xs)}:is(body[isMobile=true]) :host .textarea{--placeholder-color: var(--gds-palette-text-default-placeholder)}:is(body[isMobile=true]) :host .trailing-icon:focus-visible{outline-offset:calc(var(--gds-spacing-3xs) * -1)}:host[aria-disabled=true]{cursor:not-allowed}:host .trailing-icon{border-color:transparent;box-sizing:content-box}:host .editor{max-height:calc(8 * var(--gds-lineHeight-body));white-space:pre-wrap}:host .editor[data-empty=true]:before{content:attr(data-placeholder);position:absolute;inset:0;padding:inherit;color:var(--placeholder-color, var(--gds-palette-text-default-placeholder));pointer-events:none}}\n"], dependencies: [{ kind: "component", type: GdsIconComponent, selector: "gds-icon", inputs: ["key", "width", "height", "color"] }, { kind: "component", type: GdsIconButtonComponent, selector: "button[gds-icon-button]", inputs: ["tooltipLabel"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
9396
9521
|
}
|
|
9397
9522
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: GdsMessageInputComponent, decorators: [{
|
|
9398
9523
|
type: Component,
|
|
@@ -9415,9 +9540,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
|
|
|
9415
9540
|
gds-mobile-padding-0
|
|
9416
9541
|
`,
|
|
9417
9542
|
'[class.gds-background-disabled]': 'disabled()',
|
|
9418
|
-
'[class.gds-padding-block-end-2xs]': 'hasChildren()'
|
|
9543
|
+
'[class.gds-padding-block-end-2xs]': 'hasChildren()',
|
|
9544
|
+
'(document:selectionchange)': 'captureCaret()'
|
|
9419
9545
|
}, template: "<ng-content select=\"[header]\" />\n<div class=\"\n gds-display-flex\n gds-min-width-0\n gds-width-100-parent\n\">\n <div class=\"\n gds-display-flex\n gds-flex-column\n gds-gap-sm\n gds-width-100-parent\n \">\n <div\n #editor\n class=\"\n editor\n gds-break-word\n gds-flex-1\n gds-min-height-md-rem\n gds-min-width-0\n gds-mobile-padding-block-2xs\n gds-mobile-text-input-mobile\n gds-outline-none\n gds-padding-block-3xs\n gds-padding-inline-2xs\n gds-position-relative\n gds-scrollable-vertically\n gds-text-input\n gds-text-primary\n textarea\n \"\n [ngClass]=\"{ 'gds-padding-inline-end-md': !hasChildren() }\"\n tabindex=\"0\"\n role=\"textbox\"\n aria-multiline=\"true\"\n [attr.contenteditable]=\"disabled() ? false : 'plaintext-only'\"\n [attr.aria-label]=\"textareaAriaLabel()\"\n [attr.aria-placeholder]=\"placeholder()\"\n [attr.data-placeholder]=\"placeholder()\"\n [attr.data-empty]=\"isEmpty()\"\n (input)=\"handleInput()\"\n (keydown.enter)=\"handleEnter($event)\"\n ></div>\n <div\n #slot\n class=\"gds-display-contents\"\n [ngClass]=\"{ 'gds-display-none': !hasChildren() }\"\n >\n <ng-content select=\"[footer]\" />\n </div>\n </div>\n <button\n gds-icon-button\n class=\"\n gds-align-self-end\n gds-background-none\n gds-margin-block-end-0\n gds-mobile-right-0\n gds-padding-0\n gds-right-2xs\n trailing-icon\n \"\n variant=\"primary\"\n [disabled]=\"(disabled() && !enableIcon()) || disableSubmit()\"\n (clicked)=\"handleSubmit()\"\n (mouseenter)=\"iconHoveringChanged($event)\"\n (mouseleave)=\"iconHoveringChanged($event)\"\n [attr.aria-label]=\"iconAriaLabel()\"\n >\n <gds-icon\n [key]=\"icon()\"\n class=\"\n gds-icon-size-xs\n gds-mobile-icon-size-2xs\n \"\n />\n </button>\n</div>\n", styles: ["@layer design-system{:host ::ng-deep input:focus,:host ::ng-deep textarea:focus{outline:none}:host:focus-within,:host.is-controlled{isolation:isolate;position:relative}:host:focus-within:before,:host.is-controlled:before{z-index:-1;content:\"\";position:absolute;inset:0;border-bottom:var(--gds-borderWidth-lg) solid var(--gds-palette-border-selected);border-radius:var(--gds-borderRadius-xs)}:is(body[isMobile=true]) :host .textarea{--placeholder-color: var(--gds-palette-text-default-placeholder)}:is(body[isMobile=true]) :host .trailing-icon:focus-visible{outline-offset:calc(var(--gds-spacing-3xs) * -1)}:host[aria-disabled=true]{cursor:not-allowed}:host .trailing-icon{border-color:transparent;box-sizing:content-box}:host .editor{max-height:calc(8 * var(--gds-lineHeight-body));white-space:pre-wrap}:host .editor[data-empty=true]:before{content:attr(data-placeholder);position:absolute;inset:0;padding:inherit;color:var(--placeholder-color, var(--gds-palette-text-default-placeholder));pointer-events:none}}\n"] }]
|
|
9420
|
-
}], ctorParameters: () => [], propDecorators: { mode: [{ type: i0.Input, args: [{ isSignal: true, alias: "mode", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], suppressClearOnSubmit: [{ type: i0.Input, args: [{ isSignal: true, alias: "suppressClearOnSubmit", required: false }] }], suppressEnterSubmit: [{ type: i0.Input, args: [{ isSignal: true, alias: "suppressEnterSubmit", required: false }] }], enableIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "enableIcon", required: false }] }], disableSubmit: [{ type: i0.Input, args: [{ isSignal: true, alias: "disableSubmit", required: false }] }], textareaAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "textareaAriaLabel", required: false }] }], sendButtonAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "sendButtonAriaLabel", required: false }] }], cancelButtonAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "cancelButtonAriaLabel", required: false }] }], sent: [{ type: i0.Output, args: ["sent"] }], canceled: [{ type: i0.Output, args: ["canceled"] }], changed: [{ type: i0.Output, args: ["changed"] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], editor: [{ type: i0.ViewChild, args: ['editor', { isSignal: true }] }], slot: [{ type: i0.ViewChild, args: ['slot', { isSignal: true }] }] } });
|
|
9546
|
+
}], ctorParameters: () => [], propDecorators: { mode: [{ type: i0.Input, args: [{ isSignal: true, alias: "mode", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], suppressClearOnSubmit: [{ type: i0.Input, args: [{ isSignal: true, alias: "suppressClearOnSubmit", required: false }] }], suppressEnterSubmit: [{ type: i0.Input, args: [{ isSignal: true, alias: "suppressEnterSubmit", required: false }] }], enableIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "enableIcon", required: false }] }], disableSubmit: [{ type: i0.Input, args: [{ isSignal: true, alias: "disableSubmit", required: false }] }], textareaAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "textareaAriaLabel", required: false }] }], sendButtonAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "sendButtonAriaLabel", required: false }] }], cancelButtonAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "cancelButtonAriaLabel", required: false }] }], interimText: [{ type: i0.Input, args: [{ isSignal: true, alias: "interimText", required: false }] }], sent: [{ type: i0.Output, args: ["sent"] }], canceled: [{ type: i0.Output, args: ["canceled"] }], changed: [{ type: i0.Output, args: ["changed"] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], editor: [{ type: i0.ViewChild, args: ['editor', { isSignal: true }] }], slot: [{ type: i0.ViewChild, args: ['slot', { isSignal: true }] }] } });
|
|
9421
9547
|
|
|
9422
9548
|
class GdsChatPromptComponent {
|
|
9423
9549
|
label = input.required(/* @ts-ignore */
|