@kubex/zinc 1.1.35 → 1.1.37
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/custom-elements.json +95 -75
- package/dist/vscode.html-custom-data.json +16 -11
- package/dist/web-types.json +33 -23
- package/dist/zn.d.ts +3 -0
- package/dist/zn.min.js +38 -37
- package/package.json +1 -1
- package/src/components/chat-message/chat-message.component.ts +5 -1
- package/src/components/page/page.scss +1 -1
- package/src/components/settings-container/settings-container.component.ts +16 -3
package/package.json
CHANGED
|
@@ -80,6 +80,9 @@ export default class ZnChatMessage extends ZincElement {
|
|
|
80
80
|
/** Marks the message as initiated by an agent (affects styling and grouping). */
|
|
81
81
|
@property({type: Boolean, reflect: true, attribute: 'agent-initiated'}) agentInitiated = false;
|
|
82
82
|
|
|
83
|
+
/** Hides the sender's name in the message header. */
|
|
84
|
+
@property({type: Boolean, reflect: true, attribute: 'hide-sender'}) hideSender = false;
|
|
85
|
+
|
|
83
86
|
/** Whether any element is assigned to the `attachments` slot — drives the attachments row visibility. */
|
|
84
87
|
@state() private hasAttachments = false;
|
|
85
88
|
|
|
@@ -199,7 +202,8 @@ export default class ZnChatMessage extends ZincElement {
|
|
|
199
202
|
private renderHeader() {
|
|
200
203
|
return html`
|
|
201
204
|
<div part="header" class="message__header">
|
|
202
|
-
|
|
205
|
+
${this.hideSender ? nothing : html`
|
|
206
|
+
<span class="message__sender">${this.sender || (this.customerInitiated ? 'Customer' : 'You')}</span>`}
|
|
203
207
|
${this.time ? html`<span class="message__time">${this.getSentTime()}</span>` : nothing}
|
|
204
208
|
${this.actionType === 'internal' ? html`
|
|
205
209
|
<zn-chip type="info">Internal Note</zn-chip>` : nothing}
|
|
@@ -116,7 +116,7 @@
|
|
|
116
116
|
font-weight: var(--zn-text-h1-font-weight);
|
|
117
117
|
font-size: var(--zn-text-h1-font-size);
|
|
118
118
|
color: rgba(var(--zn-text-panel-title), 100%);
|
|
119
|
-
line-height:
|
|
119
|
+
line-height: var(--zn-spacing-medium);
|
|
120
120
|
margin: 0;
|
|
121
121
|
overflow: hidden;
|
|
122
122
|
white-space: nowrap;
|
|
@@ -15,6 +15,7 @@ interface SettingsContainerFilter {
|
|
|
15
15
|
checked: boolean;
|
|
16
16
|
label: string;
|
|
17
17
|
itemSelector?: string;
|
|
18
|
+
toggleAttribute?: string;
|
|
18
19
|
}
|
|
19
20
|
|
|
20
21
|
/**
|
|
@@ -56,7 +57,9 @@ export default class ZnSettingsContainer extends ZincElement {
|
|
|
56
57
|
config: {childList: true, subtree: true, attributes: true},
|
|
57
58
|
callback: mutations => {
|
|
58
59
|
for (const mutation of mutations) {
|
|
59
|
-
if (mutation.type === 'attributes' &&
|
|
60
|
+
if (mutation.type === 'attributes' &&
|
|
61
|
+
(mutation.attributeName === 'hidden' ||
|
|
62
|
+
this.filters.some(f => f.toggleAttribute === mutation.attributeName))) {
|
|
60
63
|
continue;
|
|
61
64
|
}
|
|
62
65
|
this.scheduleUpdateFilters();
|
|
@@ -159,7 +162,8 @@ export default class ZnSettingsContainer extends ZincElement {
|
|
|
159
162
|
const checked = existingChecked.has(attribute) ? !!existingChecked.get(attribute) : defaultChecked;
|
|
160
163
|
const label = filter.textContent || 'Unnamed Filter';
|
|
161
164
|
const itemSelector = filter.getAttribute('item-selector') || '*';
|
|
162
|
-
|
|
165
|
+
const toggleAttribute = filter.getAttribute('toggle-attribute') || undefined;
|
|
166
|
+
nextFilters.push({attribute, checked, label, itemSelector, toggleAttribute});
|
|
163
167
|
});
|
|
164
168
|
this.filters = nextFilters;
|
|
165
169
|
}
|
|
@@ -173,9 +177,18 @@ export default class ZnSettingsContainer extends ZincElement {
|
|
|
173
177
|
items = this.querySelectorAll(filter.itemSelector + attrAppend);
|
|
174
178
|
}
|
|
175
179
|
items.forEach(item => {
|
|
180
|
+
if (filter.toggleAttribute) {
|
|
181
|
+
if (checked) {
|
|
182
|
+
item.removeAttribute(filter.toggleAttribute);
|
|
183
|
+
} else {
|
|
184
|
+
item.setAttribute(filter.toggleAttribute, 'true');
|
|
185
|
+
}
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
|
|
176
189
|
if (checked) {
|
|
177
190
|
const shouldStayHidden = this.filters.some(f => {
|
|
178
|
-
if (f.attribute === filter.attribute || f.checked) return false;
|
|
191
|
+
if (f.attribute === filter.attribute || f.checked || f.toggleAttribute) return false;
|
|
179
192
|
const fAttrAppend = f.attribute === "*" ? `` : `[${f.attribute}]`;
|
|
180
193
|
let fItems;
|
|
181
194
|
if (f.itemSelector && f.itemSelector.startsWith('>')) {
|