igniteui-webcomponents 6.3.0-beta.1 → 6.3.0

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.
Files changed (129) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/components/chat/chat-input.d.ts +5 -17
  3. package/components/chat/chat-input.js +49 -27
  4. package/components/chat/chat-input.js.map +1 -1
  5. package/components/chat/chat-message.d.ts +3 -3
  6. package/components/chat/chat-message.js +96 -52
  7. package/components/chat/chat-message.js.map +1 -1
  8. package/components/chat/chat-state.d.ts +43 -45
  9. package/components/chat/chat-state.js +67 -74
  10. package/components/chat/chat-state.js.map +1 -1
  11. package/components/chat/chat.d.ts +66 -20
  12. package/components/chat/chat.js +82 -91
  13. package/components/chat/chat.js.map +1 -1
  14. package/components/chat/extras/markdown-renderer.d.ts +2 -2
  15. package/components/chat/extras/markdown-renderer.js +6 -1
  16. package/components/chat/extras/markdown-renderer.js.map +1 -1
  17. package/components/chat/message-attachments.d.ts +2 -2
  18. package/components/chat/message-attachments.js +17 -14
  19. package/components/chat/message-attachments.js.map +1 -1
  20. package/components/chat/themes/chat.base.css.js +1 -1
  21. package/components/chat/themes/chat.base.css.js.map +1 -1
  22. package/components/chat/themes/dark/chat.bootstrap.css.js +1 -1
  23. package/components/chat/themes/dark/chat.bootstrap.css.js.map +1 -1
  24. package/components/chat/themes/dark/chat.fluent.css.js +1 -1
  25. package/components/chat/themes/dark/chat.fluent.css.js.map +1 -1
  26. package/components/chat/themes/dark/chat.indigo.css.js +1 -1
  27. package/components/chat/themes/dark/chat.indigo.css.js.map +1 -1
  28. package/components/chat/themes/dark/chat.material.css.js +1 -1
  29. package/components/chat/themes/dark/chat.material.css.js.map +1 -1
  30. package/components/chat/themes/input.base.css.js +1 -1
  31. package/components/chat/themes/input.base.css.js.map +1 -1
  32. package/components/chat/themes/light/chat.bootstrap.css.js +1 -1
  33. package/components/chat/themes/light/chat.bootstrap.css.js.map +1 -1
  34. package/components/chat/themes/light/chat.indigo.css.js +1 -1
  35. package/components/chat/themes/light/chat.indigo.css.js.map +1 -1
  36. package/components/chat/themes/light/chat.shared.css.js +1 -1
  37. package/components/chat/themes/light/chat.shared.css.js.map +1 -1
  38. package/components/chat/themes/message-attachments.base.css.js +1 -1
  39. package/components/chat/themes/message-attachments.base.css.js.map +1 -1
  40. package/components/chat/themes/message.base.css.js +1 -1
  41. package/components/chat/themes/message.base.css.js.map +1 -1
  42. package/components/chat/themes/shared/chat.bootstrap.css.js +1 -1
  43. package/components/chat/themes/shared/chat.bootstrap.css.js.map +1 -1
  44. package/components/chat/themes/shared/chat.fluent.css.js +1 -1
  45. package/components/chat/themes/shared/chat.fluent.css.js.map +1 -1
  46. package/components/chat/themes/shared/chat.indigo.css.js +1 -1
  47. package/components/chat/themes/shared/chat.indigo.css.js.map +1 -1
  48. package/components/chat/themes/shared/message-attachments/message-attachments.common.css.js +1 -1
  49. package/components/chat/themes/shared/message-attachments/message-attachments.common.css.js.map +1 -1
  50. package/components/chat/types.d.ts +164 -30
  51. package/components/chat/types.js.map +1 -1
  52. package/components/chat/utils.d.ts +3 -4
  53. package/components/chat/utils.js +0 -12
  54. package/components/chat/utils.js.map +1 -1
  55. package/components/checkbox/themes/checkbox.base.css.js +1 -1
  56. package/components/checkbox/themes/checkbox.base.css.js.map +1 -1
  57. package/components/checkbox/themes/switch.base.css.js +1 -1
  58. package/components/checkbox/themes/switch.base.css.js.map +1 -1
  59. package/components/common/i18n/chat.resources.d.ts +3 -0
  60. package/components/common/i18n/chat.resources.js +3 -0
  61. package/components/common/i18n/chat.resources.js.map +1 -1
  62. package/components/common/util.d.ts +3 -0
  63. package/components/common/util.js +9 -1
  64. package/components/common/util.js.map +1 -1
  65. package/components/input/themes/shared/input.bootstrap.css.js +1 -1
  66. package/components/input/themes/shared/input.bootstrap.css.js.map +1 -1
  67. package/components/input/themes/shared/input.indigo.css.js +1 -1
  68. package/components/input/themes/shared/input.indigo.css.js.map +1 -1
  69. package/components/list/themes/header.js +2 -28
  70. package/components/list/themes/header.js.map +1 -1
  71. package/components/list/themes/item.js +6 -20
  72. package/components/list/themes/item.js.map +1 -1
  73. package/components/textarea/themes/shared/textarea.bootstrap.css.js +1 -1
  74. package/components/textarea/themes/shared/textarea.bootstrap.css.js.map +1 -1
  75. package/components/tile-manager/themes/tile-manager.base.css.js +1 -1
  76. package/components/tile-manager/themes/tile-manager.base.css.js.map +1 -1
  77. package/custom-elements.json +2110 -2045
  78. package/igniteui-webcomponents.css-data.json +1 -1
  79. package/igniteui-webcomponents.html-data.json +1 -1
  80. package/package.json +24 -2
  81. package/web-types.json +2 -2
  82. package/components/list/themes/dark/header/list-header.bootstrap.css.d.ts +0 -1
  83. package/components/list/themes/dark/header/list-header.bootstrap.css.js +0 -3
  84. package/components/list/themes/dark/header/list-header.bootstrap.css.js.map +0 -1
  85. package/components/list/themes/dark/header/list-header.fluent.css.d.ts +0 -1
  86. package/components/list/themes/dark/header/list-header.fluent.css.js +0 -3
  87. package/components/list/themes/dark/header/list-header.fluent.css.js.map +0 -1
  88. package/components/list/themes/dark/header/list-header.indigo.css.d.ts +0 -1
  89. package/components/list/themes/dark/header/list-header.indigo.css.js +0 -3
  90. package/components/list/themes/dark/header/list-header.indigo.css.js.map +0 -1
  91. package/components/list/themes/dark/header/list-header.material.css.d.ts +0 -1
  92. package/components/list/themes/dark/header/list-header.material.css.js +0 -3
  93. package/components/list/themes/dark/header/list-header.material.css.js.map +0 -1
  94. package/components/list/themes/dark/item/list-item.bootstrap.css.d.ts +0 -1
  95. package/components/list/themes/dark/item/list-item.bootstrap.css.js +0 -3
  96. package/components/list/themes/dark/item/list-item.bootstrap.css.js.map +0 -1
  97. package/components/list/themes/dark/item/list-item.fluent.css.d.ts +0 -1
  98. package/components/list/themes/dark/item/list-item.fluent.css.js +0 -3
  99. package/components/list/themes/dark/item/list-item.fluent.css.js.map +0 -1
  100. package/components/list/themes/dark/item/list-item.indigo.css.d.ts +0 -1
  101. package/components/list/themes/dark/item/list-item.indigo.css.js +0 -3
  102. package/components/list/themes/dark/item/list-item.indigo.css.js.map +0 -1
  103. package/components/list/themes/dark/item/list-item.material.css.d.ts +0 -1
  104. package/components/list/themes/dark/item/list-item.material.css.js +0 -3
  105. package/components/list/themes/dark/item/list-item.material.css.js.map +0 -1
  106. package/components/list/themes/light/header/list-header.bootstrap.css.d.ts +0 -1
  107. package/components/list/themes/light/header/list-header.bootstrap.css.js +0 -3
  108. package/components/list/themes/light/header/list-header.bootstrap.css.js.map +0 -1
  109. package/components/list/themes/light/header/list-header.fluent.css.d.ts +0 -1
  110. package/components/list/themes/light/header/list-header.fluent.css.js +0 -3
  111. package/components/list/themes/light/header/list-header.fluent.css.js.map +0 -1
  112. package/components/list/themes/light/header/list-header.indigo.css.d.ts +0 -1
  113. package/components/list/themes/light/header/list-header.indigo.css.js +0 -3
  114. package/components/list/themes/light/header/list-header.indigo.css.js.map +0 -1
  115. package/components/list/themes/light/header/list-header.material.css.d.ts +0 -1
  116. package/components/list/themes/light/header/list-header.material.css.js +0 -3
  117. package/components/list/themes/light/header/list-header.material.css.js.map +0 -1
  118. package/components/list/themes/light/item/list-item.bootstrap.css.d.ts +0 -1
  119. package/components/list/themes/light/item/list-item.bootstrap.css.js +0 -3
  120. package/components/list/themes/light/item/list-item.bootstrap.css.js.map +0 -1
  121. package/components/list/themes/light/item/list-item.fluent.css.d.ts +0 -1
  122. package/components/list/themes/light/item/list-item.fluent.css.js +0 -3
  123. package/components/list/themes/light/item/list-item.fluent.css.js.map +0 -1
  124. package/components/list/themes/light/item/list-item.indigo.css.d.ts +0 -1
  125. package/components/list/themes/light/item/list-item.indigo.css.js +0 -3
  126. package/components/list/themes/light/item/list-item.indigo.css.js.map +0 -1
  127. package/components/list/themes/light/item/list-item.material.css.d.ts +0 -1
  128. package/components/list/themes/light/item/list-item.material.css.js +0 -3
  129. package/components/list/themes/light/item/list-item.material.css.js.map +0 -1
@@ -2,7 +2,7 @@ import type IgcChatComponent from './chat.js';
2
2
  /**
3
3
  * Represents a single chat message in the conversation.
4
4
  */
5
- export interface IgcMessage {
5
+ export interface IgcChatMessage {
6
6
  /**
7
7
  * A unique identifier for the message.
8
8
  */
@@ -23,7 +23,7 @@ export interface IgcMessage {
23
23
  * Optional list of attachments associated with the message,
24
24
  * such as images, files, or links.
25
25
  */
26
- attachments?: IgcMessageAttachment[];
26
+ attachments?: IgcChatMessageAttachment[];
27
27
  /**
28
28
  * Optional list of reactions associated with the message.
29
29
  */
@@ -32,7 +32,7 @@ export interface IgcMessage {
32
32
  /**
33
33
  * Represents an attachment associated with a chat message.
34
34
  */
35
- export interface IgcMessageAttachment {
35
+ export interface IgcChatMessageAttachment {
36
36
  /**
37
37
  * A unique identifier for the attachment.
38
38
  */
@@ -106,43 +106,177 @@ export type IgcChatOptions = {
106
106
  *
107
107
  * Default is `"below-messages"`.
108
108
  */
109
- suggestionsPosition?: 'below-input' | 'below-messages';
109
+ suggestionsPosition?: ChatSuggestionsPosition;
110
110
  /**
111
111
  * Time in milliseconds to wait before dispatching a stop typing event.
112
112
  * Default is `3000`.
113
113
  */
114
114
  stopTypingDelay?: number;
115
- renderers?: Partial<ChatRenderers>;
116
- };
117
- export type ChatRenderers = {
118
- attachment?: ChatTemplateRenderer<AttachmentRendererContext>;
119
- attachmentContent?: ChatTemplateRenderer<AttachmentRendererContext>;
120
- attachmentHeader?: ChatTemplateRenderer<AttachmentRendererContext>;
121
- fileUploadButton?: ChatTemplateRenderer<ChatRendererContext>;
122
- input?: ChatTemplateRenderer<InputRendererContext>;
123
- inputActions?: ChatTemplateRenderer<ChatRendererContext>;
124
- inputAttachments?: ChatTemplateRenderer<InputRendererContext>;
125
- message?: ChatTemplateRenderer<MessageRendererContext>;
126
- messageActions?: ChatTemplateRenderer<MessageRendererContext>;
127
- messageAttachments?: ChatTemplateRenderer<MessageRendererContext>;
128
- messageContent?: ChatTemplateRenderer<MessageRendererContext>;
129
- messageHeader?: ChatTemplateRenderer<MessageRendererContext>;
130
- typingIndicator?: ChatTemplateRenderer<ChatRendererContext>;
131
- sendButton?: ChatTemplateRenderer<ChatRendererContext>;
132
- suggestionPrefix?: ChatTemplateRenderer<ChatRendererContext>;
115
+ /**
116
+ * A boolean flag that, when `true`, enables a **quick and dirty workaround** for styling
117
+ * components rendered within the Shadow DOM, from custom message renderers, by allowing them
118
+ * to inherit styles from the document's root. This can be useful for developers who prefer not to handle
119
+ * Shadow DOM encapsulation, but it is **not the recommended approach**.
120
+ *
121
+ * It is highly advised to use standard Web Component styling methods first, in this order:
122
+ *
123
+ * 1. **CSS Variables and Parts API**: Use the exposed `::part` API with custom CSS variables to style
124
+ * your content in your custom renderers.
125
+ *
126
+ * 2. **`link` elements**: For larger style sheets, link them directly within the Shadow DOM to maintain
127
+ * encapsulation.
128
+ *
129
+ * 3. **Inline `<style>` tags**: Use these for small, self-contained styles within a template.
130
+ *
131
+ * This property should be used as a **last resort** as it can lead to **style leakage**, where
132
+ * global styles unexpectedly bleed into the component, breaking encapsulation and causing
133
+ * unpredictable visual issues.
134
+ *
135
+ * **WARNING**: This is a once time shot. Changing this property in runtime won't reflect
136
+ * its value.
137
+ */
138
+ adoptRootStyles?: boolean;
139
+ /**
140
+ * An object containing a collection of custom renderers for different parts of the chat UI.
141
+ */
142
+ renderers?: ChatRenderers;
133
143
  };
144
+ /**
145
+ * Represents a user's reaction to a specific chat message.
146
+ */
147
+ export interface IgcChatMessageReaction {
148
+ /**
149
+ * The chat message that the reaction is associated with.
150
+ */
151
+ message: IgcChatMessage;
152
+ /**
153
+ * The string representation of the reaction, such as an emoji or a string;
154
+ */
155
+ reaction: string;
156
+ }
157
+ /**
158
+ * A collection of optional rendering functions that allow for custom UI rendering.
159
+ * Each property is a function that takes a context object and returns a template result.
160
+ */
161
+ export interface ChatRenderers {
162
+ /**
163
+ * Custom renderer for a single chat message attachment.
164
+ */
165
+ attachment?: ChatTemplateRenderer<ChatAttachmentRenderContext>;
166
+ /**
167
+ * Custom renderer for the content of an attachment.
168
+ */
169
+ attachmentContent?: ChatTemplateRenderer<ChatAttachmentRenderContext>;
170
+ /**
171
+ * Custom renderer for the header of an attachment.
172
+ */
173
+ attachmentHeader?: ChatTemplateRenderer<ChatAttachmentRenderContext>;
174
+ /**
175
+ * Custom renderer for the file upload button in the input area.
176
+ */
177
+ fileUploadButton?: ChatTemplateRenderer<ChatRenderContext>;
178
+ /**
179
+ * Custom renderer for the main chat input field.
180
+ */
181
+ input?: ChatTemplateRenderer<ChatInputRenderContext>;
182
+ /**
183
+ * Custom renderer for the actions container within the input area.
184
+ */
185
+ inputActions?: ChatTemplateRenderer<ChatRenderContext>;
186
+ /**
187
+ * Custom renderer for the actions at the end of the input area.
188
+ */
189
+ inputActionsEnd?: ChatTemplateRenderer<ChatRenderContext>;
190
+ /**
191
+ * Custom renderer for the actions at the start of the input area.
192
+ */
193
+ inputActionsStart?: ChatTemplateRenderer<ChatRenderContext>;
194
+ /**
195
+ * Custom renderer for the attachment previews within the input field.
196
+ */
197
+ inputAttachments?: ChatTemplateRenderer<ChatInputRenderContext>;
198
+ /**
199
+ * Custom renderer for an entire chat message bubble.
200
+ */
201
+ message?: ChatTemplateRenderer<ChatMessageRenderContext>;
202
+ /**
203
+ * Custom renderer for message-specific actions (e.g., reply or delete buttons).
204
+ */
205
+ messageActions?: ChatTemplateRenderer<ChatMessageRenderContext>;
206
+ /**
207
+ * Custom renderer for the attachments associated with a message.
208
+ */
209
+ messageAttachments?: ChatTemplateRenderer<ChatMessageRenderContext>;
210
+ /**
211
+ * Custom renderer for the main text and content of a message.
212
+ */
213
+ messageContent?: ChatTemplateRenderer<ChatMessageRenderContext>;
214
+ /**
215
+ * Custom renderer for the header of a message, including sender and timestamp.
216
+ */
217
+ messageHeader?: ChatTemplateRenderer<ChatMessageRenderContext>;
218
+ /**
219
+ * Custom renderer for the "is typing" indicator.
220
+ */
221
+ typingIndicator?: ChatTemplateRenderer<ChatRenderContext>;
222
+ /**
223
+ * Custom renderer for the message send button.
224
+ */
225
+ sendButton?: ChatTemplateRenderer<ChatRenderContext>;
226
+ /**
227
+ * Custom renderer for the prefix text shown before suggestions.
228
+ */
229
+ suggestionPrefix?: ChatTemplateRenderer<ChatRenderContext>;
230
+ }
231
+ /**
232
+ * A generic type for a function that serves as a custom renderer.
233
+ * It takes a context object of type T and returns a template result.
234
+ */
134
235
  export type ChatTemplateRenderer<T> = (ctx: T) => unknown;
135
- export interface ChatRendererContext {
136
- defaults: ChatRenderers;
236
+ /**
237
+ * A string literal type defining the two possible positions for chat suggestions.
238
+ */
239
+ export type ChatSuggestionsPosition = 'below-input' | 'below-messages';
240
+ /**
241
+ * The base context object passed to custom renderer functions, containing the chat component instance.
242
+ */
243
+ export interface ChatRenderContext {
244
+ /**
245
+ * The instance of the IgcChatComponent.
246
+ */
137
247
  instance: IgcChatComponent;
138
248
  }
139
- export interface InputRendererContext extends ChatRendererContext {
140
- attachments: IgcMessageAttachment[];
249
+ /**
250
+ * The context object for renderers that deal with the chat input area.
251
+ * It extends the base context with input-specific properties.
252
+ */
253
+ export interface ChatInputRenderContext extends ChatRenderContext {
254
+ /**
255
+ * The list of attachments currently in the input area.
256
+ */
257
+ attachments: IgcChatMessageAttachment[];
258
+ /**
259
+ * The current value of the input field.
260
+ */
141
261
  value: string;
142
262
  }
143
- export interface MessageRendererContext extends ChatRendererContext {
144
- message: IgcMessage;
263
+ /**
264
+ * The context object for renderers that deal with a specific chat message.
265
+ * It extends the base context with the message data.
266
+ */
267
+ export interface ChatMessageRenderContext extends ChatRenderContext {
268
+ /**
269
+ * The specific chat message being rendered.
270
+ */
271
+ message: IgcChatMessage;
145
272
  }
146
- export interface AttachmentRendererContext extends MessageRendererContext {
147
- attachment: IgcMessageAttachment;
273
+ /**
274
+ * The context object for renderers that deal with a specific attachment within a message.
275
+ * It extends the message context with the attachment data.
276
+ */
277
+ export interface ChatAttachmentRenderContext extends ChatMessageRenderContext {
278
+ /**
279
+ * The specific attachment being rendered.
280
+ */
281
+ attachment: IgcChatMessageAttachment;
148
282
  }
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/chat/types.ts"],"names":[],"mappings":"","sourcesContent":["import type IgcChatComponent from './chat.js';\n\n/**\n * Represents a single chat message in the conversation.\n */\nexport interface IgcMessage {\n /**\n * A unique identifier for the message.\n */\n id: string;\n\n /**\n * The textual content of the message.\n */\n text: string;\n\n /**\n * The identifier or name of the sender of the message.\n */\n sender: string;\n\n /**\n * The timestamp indicating when the message was sent.\n */\n timestamp?: string;\n\n /**\n * Optional list of attachments associated with the message,\n * such as images, files, or links.\n */\n attachments?: IgcMessageAttachment[];\n\n /**\n * Optional list of reactions associated with the message.\n */\n reactions?: string[];\n}\n\n/**\n * Represents an attachment associated with a chat message.\n */\nexport interface IgcMessageAttachment {\n /**\n * A unique identifier for the attachment.\n */\n id: string;\n\n /**\n * The display name of the attachment (e.g. file name).\n */\n name: string;\n\n /**\n * The URL from which the attachment can be downloaded or viewed.\n * Typically used for attachments stored on a server or CDN.\n */\n url?: string;\n\n /**\n * The actual File object, if the attachment was provided locally (e.g. via upload).\n */\n file?: File;\n\n /**\n * The MIME type or a custom type identifier for the attachment (e.g. \"image/png\", \"pdf\", \"audio\").\n */\n type?: string;\n\n /**\n * Optional URL to a thumbnail preview of the attachment (e.g. for images or videos).\n */\n thumbnail?: string;\n}\n\n/**\n * Configuration options for customizing the behavior and appearance of the chat component.\n */\nexport type IgcChatOptions = {\n /**\n * The ID of the current user. Used to differentiate between incoming and outgoing messages.\n */\n currentUserId?: string;\n /**\n * If `true`, prevents the chat from automatically scrolling to the latest message.\n */\n disableAutoScroll?: boolean;\n /**\n * If `true`, disables the ability to upload and send attachments.\n * Defaults to `false`.\n */\n disableInputAttachments?: boolean;\n /**\n * Indicates whether the other user is currently typing a message.\n */\n isTyping?: boolean;\n /**\n * The accepted files that could be attached.\n * Defines the file types as a list of comma-separated values (e.g. \"image/*,.pdf\") that the file input should accept.\n */\n acceptedFiles?: string;\n /**\n * Optional header text to display at the top of the chat component.\n */\n headerText?: string;\n /**\n * Optional placeholder text for the chat input area.\n * Provides a hint to the user about what they can type (e.g. \"Type a message...\").\n */\n inputPlaceholder?: string;\n /**\n * Suggested text snippets or quick replies that can be shown as user-selectable options.\n */\n suggestions?: string[];\n /**\n * Controls the position of the chat suggestions within the component layout.\n *\n * - `\"below-input\"`: Renders suggestions below the chat input area.\n * - `\"below-messages\"`: Renders suggestions below the chat messages area.\n *\n * Default is `\"below-messages\"`.\n */\n suggestionsPosition?: 'below-input' | 'below-messages';\n /**\n * Time in milliseconds to wait before dispatching a stop typing event.\n * Default is `3000`.\n */\n stopTypingDelay?: number;\n\n renderers?: Partial<ChatRenderers>;\n};\n\nexport type ChatRenderers = {\n attachment?: ChatTemplateRenderer<AttachmentRendererContext>;\n attachmentContent?: ChatTemplateRenderer<AttachmentRendererContext>;\n attachmentHeader?: ChatTemplateRenderer<AttachmentRendererContext>;\n fileUploadButton?: ChatTemplateRenderer<ChatRendererContext>;\n input?: ChatTemplateRenderer<InputRendererContext>;\n inputActions?: ChatTemplateRenderer<ChatRendererContext>;\n inputAttachments?: ChatTemplateRenderer<InputRendererContext>;\n message?: ChatTemplateRenderer<MessageRendererContext>;\n messageActions?: ChatTemplateRenderer<MessageRendererContext>;\n messageAttachments?: ChatTemplateRenderer<MessageRendererContext>;\n messageContent?: ChatTemplateRenderer<MessageRendererContext>;\n messageHeader?: ChatTemplateRenderer<MessageRendererContext>;\n typingIndicator?: ChatTemplateRenderer<ChatRendererContext>;\n sendButton?: ChatTemplateRenderer<ChatRendererContext>;\n suggestionPrefix?: ChatTemplateRenderer<ChatRendererContext>;\n};\n\nexport type ChatTemplateRenderer<T> = (ctx: T) => unknown;\n\nexport interface ChatRendererContext {\n defaults: ChatRenderers;\n instance: IgcChatComponent;\n}\n\nexport interface InputRendererContext extends ChatRendererContext {\n attachments: IgcMessageAttachment[];\n value: string;\n}\n\nexport interface MessageRendererContext extends ChatRendererContext {\n message: IgcMessage;\n}\n\nexport interface AttachmentRendererContext extends MessageRendererContext {\n attachment: IgcMessageAttachment;\n}\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/chat/types.ts"],"names":[],"mappings":"","sourcesContent":["import type IgcChatComponent from './chat.js';\n\n/**\n * Represents a single chat message in the conversation.\n */\nexport interface IgcChatMessage {\n /**\n * A unique identifier for the message.\n */\n id: string;\n\n /**\n * The textual content of the message.\n */\n text: string;\n\n /**\n * The identifier or name of the sender of the message.\n */\n sender: string;\n\n /**\n * The timestamp indicating when the message was sent.\n */\n timestamp?: string;\n\n /**\n * Optional list of attachments associated with the message,\n * such as images, files, or links.\n */\n attachments?: IgcChatMessageAttachment[];\n\n /**\n * Optional list of reactions associated with the message.\n */\n reactions?: string[];\n}\n\n/**\n * Represents an attachment associated with a chat message.\n */\nexport interface IgcChatMessageAttachment {\n /**\n * A unique identifier for the attachment.\n */\n id: string;\n\n /**\n * The display name of the attachment (e.g. file name).\n */\n name: string;\n\n /**\n * The URL from which the attachment can be downloaded or viewed.\n * Typically used for attachments stored on a server or CDN.\n */\n url?: string;\n\n /**\n * The actual File object, if the attachment was provided locally (e.g. via upload).\n */\n file?: File;\n\n /**\n * The MIME type or a custom type identifier for the attachment (e.g. \"image/png\", \"pdf\", \"audio\").\n */\n type?: string;\n\n /**\n * Optional URL to a thumbnail preview of the attachment (e.g. for images or videos).\n */\n thumbnail?: string;\n}\n\n/**\n * Configuration options for customizing the behavior and appearance of the chat component.\n */\nexport type IgcChatOptions = {\n /**\n * The ID of the current user. Used to differentiate between incoming and outgoing messages.\n */\n currentUserId?: string;\n /**\n * If `true`, prevents the chat from automatically scrolling to the latest message.\n */\n disableAutoScroll?: boolean;\n /**\n * If `true`, disables the ability to upload and send attachments.\n * Defaults to `false`.\n */\n disableInputAttachments?: boolean;\n /**\n * Indicates whether the other user is currently typing a message.\n */\n isTyping?: boolean;\n /**\n * The accepted files that could be attached.\n * Defines the file types as a list of comma-separated values (e.g. \"image/*,.pdf\") that the file input should accept.\n */\n acceptedFiles?: string;\n /**\n * Optional header text to display at the top of the chat component.\n */\n headerText?: string;\n /**\n * Optional placeholder text for the chat input area.\n * Provides a hint to the user about what they can type (e.g. \"Type a message...\").\n */\n inputPlaceholder?: string;\n /**\n * Suggested text snippets or quick replies that can be shown as user-selectable options.\n */\n suggestions?: string[];\n /**\n * Controls the position of the chat suggestions within the component layout.\n *\n * - `\"below-input\"`: Renders suggestions below the chat input area.\n * - `\"below-messages\"`: Renders suggestions below the chat messages area.\n *\n * Default is `\"below-messages\"`.\n */\n suggestionsPosition?: ChatSuggestionsPosition;\n /**\n * Time in milliseconds to wait before dispatching a stop typing event.\n * Default is `3000`.\n */\n stopTypingDelay?: number;\n\n /**\n * A boolean flag that, when `true`, enables a **quick and dirty workaround** for styling\n * components rendered within the Shadow DOM, from custom message renderers, by allowing them\n * to inherit styles from the document's root. This can be useful for developers who prefer not to handle\n * Shadow DOM encapsulation, but it is **not the recommended approach**.\n *\n * It is highly advised to use standard Web Component styling methods first, in this order:\n *\n * 1. **CSS Variables and Parts API**: Use the exposed `::part` API with custom CSS variables to style\n * your content in your custom renderers.\n *\n * 2. **`link` elements**: For larger style sheets, link them directly within the Shadow DOM to maintain\n * encapsulation.\n *\n * 3. **Inline `<style>` tags**: Use these for small, self-contained styles within a template.\n *\n * This property should be used as a **last resort** as it can lead to **style leakage**, where\n * global styles unexpectedly bleed into the component, breaking encapsulation and causing\n * unpredictable visual issues.\n *\n * **WARNING**: This is a once time shot. Changing this property in runtime won't reflect\n * its value.\n */\n adoptRootStyles?: boolean;\n\n /**\n * An object containing a collection of custom renderers for different parts of the chat UI.\n */\n renderers?: ChatRenderers;\n};\n\n/**\n * Represents a user's reaction to a specific chat message.\n */\nexport interface IgcChatMessageReaction {\n /**\n * The chat message that the reaction is associated with.\n */\n message: IgcChatMessage;\n /**\n * The string representation of the reaction, such as an emoji or a string;\n */\n reaction: string;\n}\n\n/**\n * A collection of optional rendering functions that allow for custom UI rendering.\n * Each property is a function that takes a context object and returns a template result.\n */\nexport interface ChatRenderers {\n /**\n * Custom renderer for a single chat message attachment.\n */\n attachment?: ChatTemplateRenderer<ChatAttachmentRenderContext>;\n /**\n * Custom renderer for the content of an attachment.\n */\n attachmentContent?: ChatTemplateRenderer<ChatAttachmentRenderContext>;\n /**\n * Custom renderer for the header of an attachment.\n */\n attachmentHeader?: ChatTemplateRenderer<ChatAttachmentRenderContext>;\n /**\n * Custom renderer for the file upload button in the input area.\n */\n fileUploadButton?: ChatTemplateRenderer<ChatRenderContext>;\n /**\n * Custom renderer for the main chat input field.\n */\n input?: ChatTemplateRenderer<ChatInputRenderContext>;\n /**\n * Custom renderer for the actions container within the input area.\n */\n inputActions?: ChatTemplateRenderer<ChatRenderContext>;\n /**\n * Custom renderer for the actions at the end of the input area.\n */\n inputActionsEnd?: ChatTemplateRenderer<ChatRenderContext>;\n /**\n * Custom renderer for the actions at the start of the input area.\n */\n inputActionsStart?: ChatTemplateRenderer<ChatRenderContext>;\n /**\n * Custom renderer for the attachment previews within the input field.\n */\n inputAttachments?: ChatTemplateRenderer<ChatInputRenderContext>;\n /**\n * Custom renderer for an entire chat message bubble.\n */\n message?: ChatTemplateRenderer<ChatMessageRenderContext>;\n /**\n * Custom renderer for message-specific actions (e.g., reply or delete buttons).\n */\n messageActions?: ChatTemplateRenderer<ChatMessageRenderContext>;\n /**\n * Custom renderer for the attachments associated with a message.\n */\n messageAttachments?: ChatTemplateRenderer<ChatMessageRenderContext>;\n /**\n * Custom renderer for the main text and content of a message.\n */\n messageContent?: ChatTemplateRenderer<ChatMessageRenderContext>;\n /**\n * Custom renderer for the header of a message, including sender and timestamp.\n */\n messageHeader?: ChatTemplateRenderer<ChatMessageRenderContext>;\n /**\n * Custom renderer for the \"is typing\" indicator.\n */\n typingIndicator?: ChatTemplateRenderer<ChatRenderContext>;\n /**\n * Custom renderer for the message send button.\n */\n sendButton?: ChatTemplateRenderer<ChatRenderContext>;\n /**\n * Custom renderer for the prefix text shown before suggestions.\n */\n suggestionPrefix?: ChatTemplateRenderer<ChatRenderContext>;\n}\n\n/**\n * A generic type for a function that serves as a custom renderer.\n * It takes a context object of type T and returns a template result.\n */\nexport type ChatTemplateRenderer<T> = (ctx: T) => unknown;\n\n/**\n * A string literal type defining the two possible positions for chat suggestions.\n */\nexport type ChatSuggestionsPosition = 'below-input' | 'below-messages';\n\n/**\n * The base context object passed to custom renderer functions, containing the chat component instance.\n */\nexport interface ChatRenderContext {\n /**\n * The instance of the IgcChatComponent.\n */\n instance: IgcChatComponent;\n}\n\n/**\n * The context object for renderers that deal with the chat input area.\n * It extends the base context with input-specific properties.\n */\nexport interface ChatInputRenderContext extends ChatRenderContext {\n /**\n * The list of attachments currently in the input area.\n */\n attachments: IgcChatMessageAttachment[];\n /**\n * The current value of the input field.\n */\n value: string;\n}\n\n/**\n * The context object for renderers that deal with a specific chat message.\n * It extends the base context with the message data.\n */\nexport interface ChatMessageRenderContext extends ChatRenderContext {\n /**\n * The specific chat message being rendered.\n */\n message: IgcChatMessage;\n}\n\n/**\n * The context object for renderers that deal with a specific attachment within a message.\n * It extends the message context with the attachment data.\n */\nexport interface ChatAttachmentRenderContext extends ChatMessageRenderContext {\n /**\n * The specific attachment being rendered.\n */\n attachment: IgcChatMessageAttachment;\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  import type IgcChatMessageComponent from './chat-message.js';
2
- import type { IgcMessageAttachment } from './types.js';
2
+ import type { IgcChatMessageAttachment } from './types.js';
3
3
  export type ChatAcceptedFileTypes = {
4
4
  extensions: Set<string>;
5
5
  mimeTypes: Set<string>;
@@ -10,8 +10,7 @@ export declare function parseAcceptedFileTypes(fileTypes: string): ChatAcceptedF
10
10
  export declare function isAcceptedFileType(file: File, accepted: ChatAcceptedFileTypes | null): boolean;
11
11
  export declare function getChatAcceptedFiles(event: DragEvent, accepted: ChatAcceptedFileTypes | null): File[];
12
12
  export declare function getIconName(fileType?: string): "attach_document" | "attach_image";
13
- export declare function createAttachmentURL(attachment: IgcMessageAttachment): string;
13
+ export declare function createAttachmentURL(attachment: IgcChatMessageAttachment): string;
14
14
  export declare function getFileExtension(name: string): string;
15
- export declare function isImageAttachment(attachment: IgcMessageAttachment | File): boolean;
16
- export declare function showChatActionsTooltip(target: Element, message: string): void;
15
+ export declare function isImageAttachment(attachment: IgcChatMessageAttachment | File): boolean;
17
16
  export declare function chatMessageAdoptPageStyles(message: IgcChatMessageComponent): void;
@@ -1,7 +1,5 @@
1
1
  import { adoptStyles } from 'lit';
2
2
  import { last } from '../common/util.js';
3
- import IgcTooltipComponent from '../tooltip/tooltip.js';
4
- let actionsTooltip;
5
3
  export const ChatFileTypeIcons = new Map(Object.entries({
6
4
  css: 'file_css',
7
5
  csv: 'file_csv',
@@ -66,16 +64,6 @@ export function isImageAttachment(attachment) {
66
64
  }
67
65
  return Boolean(attachment.type === 'image' || attachment.file?.type.startsWith('image/'));
68
66
  }
69
- export function showChatActionsTooltip(target, message) {
70
- if (!actionsTooltip) {
71
- actionsTooltip = document.createElement(IgcTooltipComponent.tagName);
72
- actionsTooltip.hideTriggers = 'pointerleave,click,blur';
73
- actionsTooltip.hideDelay = 100;
74
- document.body.appendChild(actionsTooltip);
75
- }
76
- actionsTooltip.message = message;
77
- actionsTooltip.show(target);
78
- }
79
67
  export function chatMessageAdoptPageStyles(message) {
80
68
  const sheets = [];
81
69
  for (const sheet of document.styleSheets) {
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/components/chat/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAmB,MAAM,KAAK,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,mBAAmB,MAAM,uBAAuB,CAAC;AAIxD,IAAI,cAAmC,CAAC;AAQxC,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,GAAG,CACtC,MAAM,CAAC,OAAO,CAAC;IACb,GAAG,EAAE,UAAU;IACf,GAAG,E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AAK,MAAM,KAAK,IAAI,QAAQ,CAAC,WAAW,EAAE,CAAC;QACzC,IAAI,CAAC;YACH,MAAM,WAAW,GAAG,IAAI,aAAa,EAAE,CAAC;YACxC,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,QAAQ,EAAE,CAAC;gBAClC,WAAW,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YACvC,CAAC;YACD,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAC3B,CAAC;QAAC,MAAM,CAAC,CAAA,CAAC;IACZ,CAAC;IAED,MAAM,IAAI,GAAG,OAAO,CAAC,WAAgC,CAAC;IACtD,WAAW,CAAC,OAAO,CAAC,UAAW,EAAE,CAAC,GAAG,IAAI,CAAC,aAAa,EAAE,GAAG,MAAM,CAAC,CAAC,CAAC;AACvE,CAAC","sourcesContent":["import { adoptStyles, type LitElement } from 'lit';\nimport { last } from '../common/util.js';\nimport IgcTooltipComponent from '../tooltip/tooltip.js';\nimport type IgcChatMessageComponent from './chat-message.js';\nimport type { IgcMessageAttachment } from './types.js';\n\nlet actionsTooltip: IgcTooltipComponent;\n\nexport type ChatAcceptedFileTypes = {\n extensions: Set<string>;\n mimeTypes: Set<string>;\n wildcardTypes: Set<string>;\n};\n\nexport const ChatFileTypeIcons = new Map(\n Object.entries({\n css: 'file_css',\n csv: 'file_csv',\n doc: 'file_doc',\n docx: 'file_doc',\n htm: 'file_htm',\n html: 'file_html',\n js: 'file_js',\n json: 'file_json',\n pdf: 'file_pdf',\n rtf: 'file_rtf',\n svg: 'file_svg',\n txt: 'file_txt',\n url: 'file_link',\n xls: 'file_xls',\n xlsx: 'file_xls',\n xml: 'file_xml',\n zip: 'file_zip',\n default: 'file_generic',\n })\n);\n\nexport function parseAcceptedFileTypes(\n fileTypes: string\n): ChatAcceptedFileTypes {\n const types = fileTypes.split(',').map((each) => each.trim().toLowerCase());\n return {\n extensions: new Set(types.filter((t) => t.startsWith('.'))),\n mimeTypes: new Set(\n types.filter((t) => !t.startsWith('.') && !t.endsWith('/*'))\n ),\n wildcardTypes: new Set(\n types.filter((t) => t.endsWith('/*')).map((t) => t.slice(0, -2))\n ),\n };\n}\n\nexport function isAcceptedFileType(\n file: File,\n accepted: ChatAcceptedFileTypes | null\n): boolean {\n if (!(accepted && file)) {\n return true;\n }\n\n const { extensions, mimeTypes, wildcardTypes } = accepted;\n const fileType = file.type.toLowerCase();\n const fileExtension = `.${last(file.name.split('.'))?.toLowerCase()}`;\n const [fileBaseType] = fileType.split('/');\n\n return (\n extensions.has(fileExtension) ||\n mimeTypes.has(fileType) ||\n wildcardTypes.has(fileBaseType)\n );\n}\n\nexport function getChatAcceptedFiles(\n event: DragEvent,\n accepted: ChatAcceptedFileTypes | null\n): File[] {\n return Array.from(event.dataTransfer?.items ?? [])\n .filter(\n (item) =>\n item.kind === 'file' && isAcceptedFileType(item.getAsFile()!, accepted)\n )\n .map((item) => item.getAsFile()!);\n}\n\nexport function getIconName(fileType?: string) {\n return fileType?.startsWith('image') ? 'attach_image' : 'attach_document';\n}\n\nexport function createAttachmentURL(attachment: IgcMessageAttachment): string {\n if (attachment.file) {\n return URL.createObjectURL(attachment.file);\n }\n\n return attachment.url || '';\n}\n\nexport function getFileExtension(name: string): string {\n const parts = name.split('.');\n return parts.length > 1 ? last(parts) : '';\n}\n\nexport function isImageAttachment(\n attachment: IgcMessageAttachment | File\n): boolean {\n if (attachment instanceof File) {\n return attachment.type.startsWith('image/');\n }\n\n return Boolean(\n attachment.type === 'image' || attachment.file?.type.startsWith('image/')\n );\n}\n\nexport function showChatActionsTooltip(target: Element, message: string): void {\n if (!actionsTooltip) {\n actionsTooltip = document.createElement(IgcTooltipComponent.tagName);\n actionsTooltip.hideTriggers = 'pointerleave,click,blur';\n actionsTooltip.hideDelay = 100;\n document.body.appendChild(actionsTooltip);\n }\n actionsTooltip.message = message;\n actionsTooltip.show(target);\n}\n\n// REVIEW: Maybe put that behind a configuration flag as this is nasty.\nexport function chatMessageAdoptPageStyles(\n message: IgcChatMessageComponent\n): void {\n const sheets: CSSStyleSheet[] = [];\n\n for (const sheet of document.styleSheets) {\n try {\n const constructed = new CSSStyleSheet();\n for (const rule of sheet.cssRules) {\n constructed.insertRule(rule.cssText);\n }\n sheets.push(constructed);\n } catch {}\n }\n\n const ctor = message.constructor as typeof LitElement;\n adoptStyles(message.shadowRoot!, [...ctor.elementStyles, ...sheets]);\n}\n"]}
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/components/chat/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAmB,MAAM,KAAK,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAUzC,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,GAAG,CACtC,MAAM,CAAC,OAAO,CAAC;IACb,GAAG,EAAE,UAAU;IACf,GAAG,EAAE,UAAU;IACf,GAAG,EAAE,UAAU;IACf,IAAI,EAAE,UAAU;IAChB,GAAG,EAAE,UAAU;IACf,IAAI,EAAE,WAAW;IACjB,EAAE,EAAE,SAAS;IACb,IAAI,EAAE,WAAW;IACjB,GAAG,EAAE,UAAU;IACf,GAAG,EAAE,UAAU;IACf,GAAG,EAAE,UAAU;IACf,GAAG,EAAE,UAAU;IACf,GAAG,EAAE,WAAW;IAChB,GAAG,EAAE,UAAU;IACf,IAAI,EAAE,UAAU;IAChB,GAAG,EAAE,UAAU;IACf,GAAG,EAAE,UAAU;IACf,OAAO,EAAE,cAAc;CACxB,CAAC,CACH,CAAC;AAEF,MAAM,UAAU,sBAAsB,CACpC,SAAiB;IAEjB,MAAM,KAAK,GAAG,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC;IAC5E,OAAO;QACL,UAAU,EAAE,IAAI,GAAG,CAAC,KAAK,CAAC,MAAM,CA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AAC,QAAQ,CAAC,CAC1E,CAAC;AACJ,CAAC;AAGD,MAAM,UAAU,0BAA0B,CACxC,OAAgC;IAEhC,MAAM,MAAM,GAAoB,EAAE,CAAC;IAEnC,KAAK,MAAM,KAAK,IAAI,QAAQ,CAAC,WAAW,EAAE,CAAC;QACzC,IAAI,CAAC;YACH,MAAM,WAAW,GAAG,IAAI,aAAa,EAAE,CAAC;YACxC,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,QAAQ,EAAE,CAAC;gBAClC,WAAW,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YACvC,CAAC;YACD,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAC3B,CAAC;QAAC,MAAM,CAAC,CAAA,CAAC;IACZ,CAAC;IAED,MAAM,IAAI,GAAG,OAAO,CAAC,WAAgC,CAAC;IACtD,WAAW,CAAC,OAAO,CAAC,UAAW,EAAE,CAAC,GAAG,IAAI,CAAC,aAAa,EAAE,GAAG,MAAM,CAAC,CAAC,CAAC;AACvE,CAAC","sourcesContent":["import { adoptStyles, type LitElement } from 'lit';\nimport { last } from '../common/util.js';\nimport type IgcChatMessageComponent from './chat-message.js';\nimport type { IgcChatMessageAttachment } from './types.js';\n\nexport type ChatAcceptedFileTypes = {\n extensions: Set<string>;\n mimeTypes: Set<string>;\n wildcardTypes: Set<string>;\n};\n\nexport const ChatFileTypeIcons = new Map(\n Object.entries({\n css: 'file_css',\n csv: 'file_csv',\n doc: 'file_doc',\n docx: 'file_doc',\n htm: 'file_htm',\n html: 'file_html',\n js: 'file_js',\n json: 'file_json',\n pdf: 'file_pdf',\n rtf: 'file_rtf',\n svg: 'file_svg',\n txt: 'file_txt',\n url: 'file_link',\n xls: 'file_xls',\n xlsx: 'file_xls',\n xml: 'file_xml',\n zip: 'file_zip',\n default: 'file_generic',\n })\n);\n\nexport function parseAcceptedFileTypes(\n fileTypes: string\n): ChatAcceptedFileTypes {\n const types = fileTypes.split(',').map((each) => each.trim().toLowerCase());\n return {\n extensions: new Set(types.filter((t) => t.startsWith('.'))),\n mimeTypes: new Set(\n types.filter((t) => !t.startsWith('.') && !t.endsWith('/*'))\n ),\n wildcardTypes: new Set(\n types.filter((t) => t.endsWith('/*')).map((t) => t.slice(0, -2))\n ),\n };\n}\n\nexport function isAcceptedFileType(\n file: File,\n accepted: ChatAcceptedFileTypes | null\n): boolean {\n if (!(accepted && file)) {\n return true;\n }\n\n const { extensions, mimeTypes, wildcardTypes } = accepted;\n const fileType = file.type.toLowerCase();\n const fileExtension = `.${last(file.name.split('.'))?.toLowerCase()}`;\n const [fileBaseType] = fileType.split('/');\n\n return (\n extensions.has(fileExtension) ||\n mimeTypes.has(fileType) ||\n wildcardTypes.has(fileBaseType)\n );\n}\n\nexport function getChatAcceptedFiles(\n event: DragEvent,\n accepted: ChatAcceptedFileTypes | null\n): File[] {\n return Array.from(event.dataTransfer?.items ?? [])\n .filter(\n (item) =>\n item.kind === 'file' && isAcceptedFileType(item.getAsFile()!, accepted)\n )\n .map((item) => item.getAsFile()!);\n}\n\nexport function getIconName(fileType?: string) {\n return fileType?.startsWith('image') ? 'attach_image' : 'attach_document';\n}\n\nexport function createAttachmentURL(\n attachment: IgcChatMessageAttachment\n): string {\n if (attachment.file) {\n return URL.createObjectURL(attachment.file);\n }\n\n return attachment.url || '';\n}\n\nexport function getFileExtension(name: string): string {\n const parts = name.split('.');\n return parts.length > 1 ? last(parts) : '';\n}\n\nexport function isImageAttachment(\n attachment: IgcChatMessageAttachment | File\n): boolean {\n if (attachment instanceof File) {\n return attachment.type.startsWith('image/');\n }\n\n return Boolean(\n attachment.type === 'image' || attachment.file?.type.startsWith('image/')\n );\n}\n\n// REVIEW: Maybe put that behind a configuration flag as this is nasty.\nexport function chatMessageAdoptPageStyles(\n message: IgcChatMessageComponent\n): void {\n const sheets: CSSStyleSheet[] = [];\n\n for (const sheet of document.styleSheets) {\n try {\n const constructed = new CSSStyleSheet();\n for (const rule of sheet.cssRules) {\n constructed.insertRule(rule.cssText);\n }\n sheets.push(constructed);\n } catch {}\n }\n\n const ctor = message.constructor as typeof LitElement;\n adoptStyles(message.shadowRoot!, [...ctor.elementStyles, ...sheets]);\n}\n"]}
@@ -1,3 +1,3 @@
1
1
  import { css } from 'lit';
2
- export const styles = css `:host{--is-large: clamp(0, (var(--component-size, 1) + 1) - var(--ig-size-large, 3), 1);--is-medium: min( clamp(0, (var(--component-size, 1) + 1) - var(--ig-size-medium, 2), 1), clamp(0, var(--ig-size-large, 3) - var(--component-size, 1), 1) );--is-small: clamp(0, var(--ig-size-medium) - var(--component-size, 1), 1);position:relative;box-sizing:border-box;scrollbar-width:var(--ig-scrollbar-size, var(--sb-size));scrollbar-color:var(--ig-scrollbar-thumb-background, var(--sb-thumb-bg-color)) var(--ig-scrollbar-track-background, var(--sb-track-bg-color))}:host ::-webkit-scrollbar{width:var(--ig-scrollbar-size, var(--sb-size));height:var(--ig-scrollbar-size, var(--sb-size));background:var(--ig-scrollbar-track-background, var(--sb-track-bg-color))}:host ::-webkit-scrollbar-thumb{background:var(--ig-scrollbar-thumb-background, var(--sb-thumb-bg-color))}:host *,:host *::before,:host *::after{box-sizing:border-box}:host([hidden]),[hidden]{display:none !important}:host{display:inline-flex;flex-direction:column;font-family:var(--ig-font-family)}input[type=checkbox]{position:absolute;width:1px;height:1px;margin:-1px;border:none;clip:rect(0, 0, 0, 0);outline:0;pointer-events:none;overflow:hidden;-webkit-appearance:none;-moz-appearance:none;appearance:none}[part~=control]{--size: 1.25rem;width:var(--size);height:var(--size);min-width:var(--size);position:relative;display:inline-flex;-webkit-user-select:none;-moz-user-select:none;user-select:none}[part~=control]::after{position:absolute;content:"";left:50%;top:50%;transform:translate(-50%, -50%);width:var(--size);height:var(--size);transition:all .15s ease-in}[part~=label]{display:inline-block;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;word-wrap:break-all;transition:color .2s ease-in-out}[part~=base]{gap:.5rem}[part~=indicator]{--indicator-size: 1.125rem;display:flex;align-items:center;justify-content:center;position:absolute;inset:0;stroke-linecap:square;stroke-width:var(--mark-stroke, 3);stroke-dasharray:24;stroke-dashoffset:24;fill:none;opacity:0;z-index:1;transform-origin:center}[part~=indicator] svg{width:var(--indicator-size);height:var(--indicator-size)}label{display:flex;align-items:center;cursor:pointer;flex-flow:row nowrap}[part="indicator checked"]{transition:all .2s ease-out;stroke-dashoffset:0;opacity:1}:host([indeterminate]) [part~=indicator]{stroke-dashoffset:41;opacity:1;transform:rotate(45deg) scale(0.45) translateX(-0.25rem)}:host([indeterminate]) [part~=indicator] svg{width:100%;height:100%}:host([disabled]),:host(:disabled){-webkit-user-select:none;-moz-user-select:none;user-select:none;cursor:initial;pointer-events:none}:host([label-position=before]) [part~=label]{order:-1}`;
2
+ export const styles = css `:host{--is-large: clamp(0, (var(--component-size, 1) + 1) - var(--ig-size-large, 3), 1);--is-medium: min( clamp(0, (var(--component-size, 1) + 1) - var(--ig-size-medium, 2), 1), clamp(0, var(--ig-size-large, 3) - var(--component-size, 1), 1) );--is-small: clamp(0, var(--ig-size-medium) - var(--component-size, 1), 1);position:relative;box-sizing:border-box;scrollbar-width:var(--ig-scrollbar-size, var(--sb-size));scrollbar-color:var(--ig-scrollbar-thumb-background, var(--sb-thumb-bg-color)) var(--ig-scrollbar-track-background, var(--sb-track-bg-color))}:host ::-webkit-scrollbar{width:var(--ig-scrollbar-size, var(--sb-size));height:var(--ig-scrollbar-size, var(--sb-size));background:var(--ig-scrollbar-track-background, var(--sb-track-bg-color))}:host ::-webkit-scrollbar-thumb{background:var(--ig-scrollbar-thumb-background, var(--sb-thumb-bg-color))}:host *,:host *::before,:host *::after{box-sizing:border-box}:host([hidden]),[hidden]{display:none !important}:host{display:inline-flex;flex-direction:column;font-family:var(--ig-font-family)}input[type=checkbox]{position:absolute;width:1px;height:1px;margin:-1px;border:none;clip:rect(0, 0, 0, 0);outline:0;pointer-events:none;overflow:hidden;-webkit-appearance:none;-moz-appearance:none;appearance:none}[part~=control]{--size: 1.25rem;width:var(--size);height:var(--size);min-width:var(--size);position:relative;display:inline-flex;-webkit-user-select:none;-moz-user-select:none;user-select:none}[part~=control]::after{position:absolute;content:"";left:50%;top:50%;transform:translate(-50%, -50%);width:var(--size);height:var(--size);transition:all .15s ease-in}[part~=label]{display:inline-block;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;overflow-wrap:break-all;transition:color .2s ease-in-out}[part~=base]{gap:.5rem}[part~=indicator]{--indicator-size: 1.125rem;display:flex;align-items:center;justify-content:center;position:absolute;inset:0;stroke-linecap:square;stroke-width:var(--mark-stroke, 3);stroke-dasharray:24;stroke-dashoffset:24;fill:none;opacity:0;z-index:1;transform-origin:center}[part~=indicator] svg{width:var(--indicator-size);height:var(--indicator-size)}label{display:flex;align-items:center;cursor:pointer;flex-flow:row nowrap}[part="indicator checked"]{transition:all .2s ease-out;stroke-dashoffset:0;opacity:1}:host([indeterminate]) [part~=indicator]{stroke-dashoffset:41;opacity:1;transform:rotate(45deg) scale(0.45) translateX(-0.25rem)}:host([indeterminate]) [part~=indicator] svg{width:100%;height:100%}:host([disabled]),:host(:disabled){-webkit-user-select:none;-moz-user-select:none;user-select:none;cursor:initial;pointer-events:none}:host([label-position=before]) [part~=label]{order:-1}`;
3
3
  //# sourceMappingURL=checkbox.base.css.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"checkbox.base.css.js","sourceRoot":"","sources":["../../../../src/components/checkbox/themes/checkbox.base.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA,2pFAA2pF,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css`:host{--is-large: clamp(0, (var(--component-size, 1) + 1) - var(--ig-size-large, 3), 1);--is-medium: min( clamp(0, (var(--component-size, 1) + 1) - var(--ig-size-medium, 2), 1), clamp(0, var(--ig-size-large, 3) - var(--component-size, 1), 1) );--is-small: clamp(0, var(--ig-size-medium) - var(--component-size, 1), 1);position:relative;box-sizing:border-box;scrollbar-width:var(--ig-scrollbar-size, var(--sb-size));scrollbar-color:var(--ig-scrollbar-thumb-background, var(--sb-thumb-bg-color)) var(--ig-scrollbar-track-background, var(--sb-track-bg-color))}:host ::-webkit-scrollbar{width:var(--ig-scrollbar-size, var(--sb-size));height:var(--ig-scrollbar-size, var(--sb-size));background:var(--ig-scrollbar-track-background, var(--sb-track-bg-color))}:host ::-webkit-scrollbar-thumb{background:var(--ig-scrollbar-thumb-background, var(--sb-thumb-bg-color))}:host *,:host *::before,:host *::after{box-sizing:border-box}:host([hidden]),[hidden]{display:none !important}:host{display:inline-flex;flex-direction:column;font-family:var(--ig-font-family)}input[type=checkbox]{position:absolute;width:1px;height:1px;margin:-1px;border:none;clip:rect(0, 0, 0, 0);outline:0;pointer-events:none;overflow:hidden;-webkit-appearance:none;-moz-appearance:none;appearance:none}[part~=control]{--size: 1.25rem;width:var(--size);height:var(--size);min-width:var(--size);position:relative;display:inline-flex;-webkit-user-select:none;-moz-user-select:none;user-select:none}[part~=control]::after{position:absolute;content:\"\";left:50%;top:50%;transform:translate(-50%, -50%);width:var(--size);height:var(--size);transition:all .15s ease-in}[part~=label]{display:inline-block;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;word-wrap:break-all;transition:color .2s ease-in-out}[part~=base]{gap:.5rem}[part~=indicator]{--indicator-size: 1.125rem;display:flex;align-items:center;justify-content:center;position:absolute;inset:0;stroke-linecap:square;stroke-width:var(--mark-stroke, 3);stroke-dasharray:24;stroke-dashoffset:24;fill:none;opacity:0;z-index:1;transform-origin:center}[part~=indicator] svg{width:var(--indicator-size);height:var(--indicator-size)}label{display:flex;align-items:center;cursor:pointer;flex-flow:row nowrap}[part=\"indicator checked\"]{transition:all .2s ease-out;stroke-dashoffset:0;opacity:1}:host([indeterminate]) [part~=indicator]{stroke-dashoffset:41;opacity:1;transform:rotate(45deg) scale(0.45) translateX(-0.25rem)}:host([indeterminate]) [part~=indicator] svg{width:100%;height:100%}:host([disabled]),:host(:disabled){-webkit-user-select:none;-moz-user-select:none;user-select:none;cursor:initial;pointer-events:none}:host([label-position=before]) [part~=label]{order:-1}`;\n"]}
1
+ {"version":3,"file":"checkbox.base.css.js","sourceRoot":"","sources":["../../../../src/components/checkbox/themes/checkbox.base.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA,+pFAA+pF,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css`:host{--is-large: clamp(0, (var(--component-size, 1) + 1) - var(--ig-size-large, 3), 1);--is-medium: min( clamp(0, (var(--component-size, 1) + 1) - var(--ig-size-medium, 2), 1), clamp(0, var(--ig-size-large, 3) - var(--component-size, 1), 1) );--is-small: clamp(0, var(--ig-size-medium) - var(--component-size, 1), 1);position:relative;box-sizing:border-box;scrollbar-width:var(--ig-scrollbar-size, var(--sb-size));scrollbar-color:var(--ig-scrollbar-thumb-background, var(--sb-thumb-bg-color)) var(--ig-scrollbar-track-background, var(--sb-track-bg-color))}:host ::-webkit-scrollbar{width:var(--ig-scrollbar-size, var(--sb-size));height:var(--ig-scrollbar-size, var(--sb-size));background:var(--ig-scrollbar-track-background, var(--sb-track-bg-color))}:host ::-webkit-scrollbar-thumb{background:var(--ig-scrollbar-thumb-background, var(--sb-thumb-bg-color))}:host *,:host *::before,:host *::after{box-sizing:border-box}:host([hidden]),[hidden]{display:none !important}:host{display:inline-flex;flex-direction:column;font-family:var(--ig-font-family)}input[type=checkbox]{position:absolute;width:1px;height:1px;margin:-1px;border:none;clip:rect(0, 0, 0, 0);outline:0;pointer-events:none;overflow:hidden;-webkit-appearance:none;-moz-appearance:none;appearance:none}[part~=control]{--size: 1.25rem;width:var(--size);height:var(--size);min-width:var(--size);position:relative;display:inline-flex;-webkit-user-select:none;-moz-user-select:none;user-select:none}[part~=control]::after{position:absolute;content:\"\";left:50%;top:50%;transform:translate(-50%, -50%);width:var(--size);height:var(--size);transition:all .15s ease-in}[part~=label]{display:inline-block;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;overflow-wrap:break-all;transition:color .2s ease-in-out}[part~=base]{gap:.5rem}[part~=indicator]{--indicator-size: 1.125rem;display:flex;align-items:center;justify-content:center;position:absolute;inset:0;stroke-linecap:square;stroke-width:var(--mark-stroke, 3);stroke-dasharray:24;stroke-dashoffset:24;fill:none;opacity:0;z-index:1;transform-origin:center}[part~=indicator] svg{width:var(--indicator-size);height:var(--indicator-size)}label{display:flex;align-items:center;cursor:pointer;flex-flow:row nowrap}[part=\"indicator checked\"]{transition:all .2s ease-out;stroke-dashoffset:0;opacity:1}:host([indeterminate]) [part~=indicator]{stroke-dashoffset:41;opacity:1;transform:rotate(45deg) scale(0.45) translateX(-0.25rem)}:host([indeterminate]) [part~=indicator] svg{width:100%;height:100%}:host([disabled]),:host(:disabled){-webkit-user-select:none;-moz-user-select:none;user-select:none;cursor:initial;pointer-events:none}:host([label-position=before]) [part~=label]{order:-1}`;\n"]}
@@ -1,3 +1,3 @@
1
1
  import { css } from 'lit';
2
- export const styles = css `:host{--is-large: clamp(0, (var(--component-size, 1) + 1) - var(--ig-size-large, 3), 1);--is-medium: min( clamp(0, (var(--component-size, 1) + 1) - var(--ig-size-medium, 2), 1), clamp(0, var(--ig-size-large, 3) - var(--component-size, 1), 1) );--is-small: clamp(0, var(--ig-size-medium) - var(--component-size, 1), 1);position:relative;box-sizing:border-box;scrollbar-width:var(--ig-scrollbar-size, var(--sb-size));scrollbar-color:var(--ig-scrollbar-thumb-background, var(--sb-thumb-bg-color)) var(--ig-scrollbar-track-background, var(--sb-track-bg-color))}:host ::-webkit-scrollbar{width:var(--ig-scrollbar-size, var(--sb-size));height:var(--ig-scrollbar-size, var(--sb-size));background:var(--ig-scrollbar-track-background, var(--sb-track-bg-color))}:host ::-webkit-scrollbar-thumb{background:var(--ig-scrollbar-thumb-background, var(--sb-thumb-bg-color))}:host *,:host *::before,:host *::after{box-sizing:border-box}:host([hidden]),[hidden]{display:none !important}:host{display:inline-flex;flex-direction:column;font-family:var(--ig-font-family)}input[type=checkbox]{position:absolute;width:1px;height:1px;margin:-1px;border:none;clip:rect(0, 0, 0, 0);outline:0;pointer-events:none;overflow:hidden;-webkit-appearance:none;-moz-appearance:none;appearance:none}[part~=base]{display:flex;flex-flow:row nowrap;align-items:center;cursor:pointer;gap:var(--label-gap)}[part~=control]{display:flex;flex-shrink:0;align-items:center;-webkit-user-select:none;-moz-user-select:none;user-select:none}[part~=thumb]{position:relative;animation-duration:.2s;animation-fill-mode:none}[part~=control],[part~=thumb]{transition:all .2s ease-in-out}[part~=thumb][part~=checked]{animation-duration:.2s;animation-fill-mode:forwards}[part~=label]{display:inline-block;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;word-wrap:break-word}:host([disabled]),:host(:disabled){-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none;cursor:initial}:host([label-position=before]) [part~=label]{order:-1}@keyframes thumb-on{from{margin-inline-start:var(--thumb-offset)}to{margin-inline-start:calc(var(--size) - var(--thumb-size))}}@keyframes thumb-off{from{margin-inline-start:calc(var(--size) - var(--thumb-size))}to{margin-inline-start:var(--thumb-offset)}}`;
2
+ export const styles = css `:host{--is-large: clamp(0, (var(--component-size, 1) + 1) - var(--ig-size-large, 3), 1);--is-medium: min( clamp(0, (var(--component-size, 1) + 1) - var(--ig-size-medium, 2), 1), clamp(0, var(--ig-size-large, 3) - var(--component-size, 1), 1) );--is-small: clamp(0, var(--ig-size-medium) - var(--component-size, 1), 1);position:relative;box-sizing:border-box;scrollbar-width:var(--ig-scrollbar-size, var(--sb-size));scrollbar-color:var(--ig-scrollbar-thumb-background, var(--sb-thumb-bg-color)) var(--ig-scrollbar-track-background, var(--sb-track-bg-color))}:host ::-webkit-scrollbar{width:var(--ig-scrollbar-size, var(--sb-size));height:var(--ig-scrollbar-size, var(--sb-size));background:var(--ig-scrollbar-track-background, var(--sb-track-bg-color))}:host ::-webkit-scrollbar-thumb{background:var(--ig-scrollbar-thumb-background, var(--sb-thumb-bg-color))}:host *,:host *::before,:host *::after{box-sizing:border-box}:host([hidden]),[hidden]{display:none !important}:host{display:inline-flex;flex-direction:column;font-family:var(--ig-font-family)}input[type=checkbox]{position:absolute;width:1px;height:1px;margin:-1px;border:none;clip:rect(0, 0, 0, 0);outline:0;pointer-events:none;overflow:hidden;-webkit-appearance:none;-moz-appearance:none;appearance:none}[part~=base]{display:flex;flex-flow:row nowrap;align-items:center;cursor:pointer;gap:var(--label-gap)}[part~=control]{display:flex;flex-shrink:0;align-items:center;-webkit-user-select:none;-moz-user-select:none;user-select:none}[part~=thumb]{position:relative;animation-duration:.2s;animation-fill-mode:none}[part~=control],[part~=thumb]{transition:all .2s ease-in-out}[part~=thumb][part~=checked]{animation-duration:.2s;animation-fill-mode:forwards}[part~=label]{display:inline-block;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;overflow-wrap:break-word}:host([disabled]),:host(:disabled){-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none;cursor:initial}:host([label-position=before]) [part~=label]{order:-1}@keyframes thumb-on{from{margin-inline-start:var(--thumb-offset)}to{margin-inline-start:calc(var(--size) - var(--thumb-size))}}@keyframes thumb-off{from{margin-inline-start:calc(var(--size) - var(--thumb-size))}to{margin-inline-start:var(--thumb-offset)}}`;
3
3
  //# sourceMappingURL=switch.base.css.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"switch.base.css.js","sourceRoot":"","sources":["../../../../src/components/checkbox/themes/switch.base.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA,qvEAAqvE,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css`:host{--is-large: clamp(0, (var(--component-size, 1) + 1) - var(--ig-size-large, 3), 1);--is-medium: min( clamp(0, (var(--component-size, 1) + 1) - var(--ig-size-medium, 2), 1), clamp(0, var(--ig-size-large, 3) - var(--component-size, 1), 1) );--is-small: clamp(0, var(--ig-size-medium) - var(--component-size, 1), 1);position:relative;box-sizing:border-box;scrollbar-width:var(--ig-scrollbar-size, var(--sb-size));scrollbar-color:var(--ig-scrollbar-thumb-background, var(--sb-thumb-bg-color)) var(--ig-scrollbar-track-background, var(--sb-track-bg-color))}:host ::-webkit-scrollbar{width:var(--ig-scrollbar-size, var(--sb-size));height:var(--ig-scrollbar-size, var(--sb-size));background:var(--ig-scrollbar-track-background, var(--sb-track-bg-color))}:host ::-webkit-scrollbar-thumb{background:var(--ig-scrollbar-thumb-background, var(--sb-thumb-bg-color))}:host *,:host *::before,:host *::after{box-sizing:border-box}:host([hidden]),[hidden]{display:none !important}:host{display:inline-flex;flex-direction:column;font-family:var(--ig-font-family)}input[type=checkbox]{position:absolute;width:1px;height:1px;margin:-1px;border:none;clip:rect(0, 0, 0, 0);outline:0;pointer-events:none;overflow:hidden;-webkit-appearance:none;-moz-appearance:none;appearance:none}[part~=base]{display:flex;flex-flow:row nowrap;align-items:center;cursor:pointer;gap:var(--label-gap)}[part~=control]{display:flex;flex-shrink:0;align-items:center;-webkit-user-select:none;-moz-user-select:none;user-select:none}[part~=thumb]{position:relative;animation-duration:.2s;animation-fill-mode:none}[part~=control],[part~=thumb]{transition:all .2s ease-in-out}[part~=thumb][part~=checked]{animation-duration:.2s;animation-fill-mode:forwards}[part~=label]{display:inline-block;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;word-wrap:break-word}:host([disabled]),:host(:disabled){-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none;cursor:initial}:host([label-position=before]) [part~=label]{order:-1}@keyframes thumb-on{from{margin-inline-start:var(--thumb-offset)}to{margin-inline-start:calc(var(--size) - var(--thumb-size))}}@keyframes thumb-off{from{margin-inline-start:calc(var(--size) - var(--thumb-size))}to{margin-inline-start:var(--thumb-offset)}}`;\n"]}
1
+ {"version":3,"file":"switch.base.css.js","sourceRoot":"","sources":["../../../../src/components/checkbox/themes/switch.base.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA,yvEAAyvE,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css`:host{--is-large: clamp(0, (var(--component-size, 1) + 1) - var(--ig-size-large, 3), 1);--is-medium: min( clamp(0, (var(--component-size, 1) + 1) - var(--ig-size-medium, 2), 1), clamp(0, var(--ig-size-large, 3) - var(--component-size, 1), 1) );--is-small: clamp(0, var(--ig-size-medium) - var(--component-size, 1), 1);position:relative;box-sizing:border-box;scrollbar-width:var(--ig-scrollbar-size, var(--sb-size));scrollbar-color:var(--ig-scrollbar-thumb-background, var(--sb-thumb-bg-color)) var(--ig-scrollbar-track-background, var(--sb-track-bg-color))}:host ::-webkit-scrollbar{width:var(--ig-scrollbar-size, var(--sb-size));height:var(--ig-scrollbar-size, var(--sb-size));background:var(--ig-scrollbar-track-background, var(--sb-track-bg-color))}:host ::-webkit-scrollbar-thumb{background:var(--ig-scrollbar-thumb-background, var(--sb-thumb-bg-color))}:host *,:host *::before,:host *::after{box-sizing:border-box}:host([hidden]),[hidden]{display:none !important}:host{display:inline-flex;flex-direction:column;font-family:var(--ig-font-family)}input[type=checkbox]{position:absolute;width:1px;height:1px;margin:-1px;border:none;clip:rect(0, 0, 0, 0);outline:0;pointer-events:none;overflow:hidden;-webkit-appearance:none;-moz-appearance:none;appearance:none}[part~=base]{display:flex;flex-flow:row nowrap;align-items:center;cursor:pointer;gap:var(--label-gap)}[part~=control]{display:flex;flex-shrink:0;align-items:center;-webkit-user-select:none;-moz-user-select:none;user-select:none}[part~=thumb]{position:relative;animation-duration:.2s;animation-fill-mode:none}[part~=control],[part~=thumb]{transition:all .2s ease-in-out}[part~=thumb][part~=checked]{animation-duration:.2s;animation-fill-mode:forwards}[part~=label]{display:inline-block;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;overflow-wrap:break-word}:host([disabled]),:host(:disabled){-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none;cursor:initial}:host([label-position=before]) [part~=label]{order:-1}@keyframes thumb-on{from{margin-inline-start:var(--thumb-offset)}to{margin-inline-start:calc(var(--size) - var(--thumb-size))}}@keyframes thumb-off{from{margin-inline-start:calc(var(--size) - var(--thumb-size))}to{margin-inline-start:var(--thumb-offset)}}`;\n"]}
@@ -4,5 +4,8 @@ export interface IgcChatResourceStrings {
4
4
  reactionLike: string;
5
5
  reactionDislike: string;
6
6
  reactionRegenerate: string;
7
+ attachmentLabel: string;
8
+ attachmentsListLabel: string;
9
+ messageCopied: string;
7
10
  }
8
11
  export declare const IgcChatResourceStringEN: IgcChatResourceStrings;
@@ -4,5 +4,8 @@ export const IgcChatResourceStringEN = {
4
4
  reactionLike: 'Like',
5
5
  reactionDislike: 'Dislike',
6
6
  reactionRegenerate: 'Regenerate',
7
+ attachmentLabel: 'Attachment',
8
+ attachmentsListLabel: 'Attachments',
9
+ messageCopied: 'Message copied to clipboard',
7
10
  };
8
11
  //# sourceMappingURL=chat.resources.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"chat.resources.js","sourceRoot":"","sources":["../../../../src/components/common/i18n/chat.resources.ts"],"names":[],"mappings":"AASA,MAAM,CAAC,MAAM,uBAAuB,GAA2B;IAC7D,iBAAiB,EAAE,aAAa;IAChC,YAAY,EAAE,MAAM;IACpB,YAAY,EAAE,MAAM;IACpB,eAAe,EAAE,SAAS;IAC1B,kBAAkB,EAAE,YAAY;CACjC,CAAC","sourcesContent":["/* blazorSuppress */\nexport interface IgcChatResourceStrings {\n suggestionsHeader: string;\n reactionCopy: string;\n reactionLike: string;\n reactionDislike: string;\n reactionRegenerate: string;\n}\n\nexport const IgcChatResourceStringEN: IgcChatResourceStrings = {\n suggestionsHeader: 'Suggestions',\n reactionCopy: 'Copy',\n reactionLike: 'Like',\n reactionDislike: 'Dislike',\n reactionRegenerate: 'Regenerate',\n};\n"]}
1
+ {"version":3,"file":"chat.resources.js","sourceRoot":"","sources":["../../../../src/components/common/i18n/chat.resources.ts"],"names":[],"mappings":"AAYA,MAAM,CAAC,MAAM,uBAAuB,GAA2B;IAC7D,iBAAiB,EAAE,aAAa;IAChC,YAAY,EAAE,MAAM;IACpB,YAAY,EAAE,MAAM;IACpB,eAAe,EAAE,SAAS;IAC1B,kBAAkB,EAAE,YAAY;IAChC,eAAe,EAAE,YAAY;IAC7B,oBAAoB,EAAE,aAAa;IACnC,aAAa,EAAE,6BAA6B;CAC7C,CAAC","sourcesContent":["/* blazorSuppress */\nexport interface IgcChatResourceStrings {\n suggestionsHeader: string;\n reactionCopy: string;\n reactionLike: string;\n reactionDislike: string;\n reactionRegenerate: string;\n attachmentLabel: string;\n attachmentsListLabel: string;\n messageCopied: string;\n}\n\nexport const IgcChatResourceStringEN: IgcChatResourceStrings = {\n suggestionsHeader: 'Suggestions',\n reactionCopy: 'Copy',\n reactionLike: 'Like',\n reactionDislike: 'Dislike',\n reactionRegenerate: 'Regenerate',\n attachmentLabel: 'Attachment',\n attachmentsListLabel: 'Attachments',\n messageCopied: 'Message copied to clipboard',\n};\n"]}
@@ -1,3 +1,4 @@
1
+ import { type TemplateResult } from 'lit';
1
2
  import type IgcFileInputComponent from '../file-input/file-input.js';
2
3
  export declare const asPercent: (part: number, whole: number) => number;
3
4
  export declare const clamp: (number: number, min: number, max: number) => number;
@@ -138,4 +139,6 @@ export declare function toMerged<T extends Record<PropertyKey, any>, S extends R
138
139
  export declare function bindIf<T>(assertion: unknown, value: T): NonNullable<T>;
139
140
  export declare function nanoid(size?: number): string;
140
141
  export declare function hasFiles(input: HTMLInputElement | IgcFileInputComponent): boolean;
142
+ /** @internal */
143
+ export declare function trimmedHtml(strings: TemplateStringsArray, ...values: unknown[]): TemplateResult;
141
144
  export {};
@@ -1,4 +1,4 @@
1
- import { isServer, nothing } from 'lit';
1
+ import { html, isServer, nothing } from 'lit';
2
2
  export const asPercent = (part, whole) => (part / whole) * 100;
3
3
  export const clamp = (number, min, max) => Math.max(min, Math.min(number, max));
4
4
  export function numberOfDecimals(number) {
@@ -380,4 +380,12 @@ export function nanoid(size = 21) {
380
380
  export function hasFiles(input) {
381
381
  return input.files != null && input.files.length > 0;
382
382
  }
383
+ const trimmedCache = new WeakMap();
384
+ export function trimmedHtml(strings, ...values) {
385
+ if (!trimmedCache.has(strings)) {
386
+ const trimmedStrings = strings.map((s) => s.trim().replaceAll('\n', ''));
387
+ trimmedCache.set(strings, Object.assign([...trimmedStrings], { raw: [...strings.raw] }));
388
+ }
389
+ return html(trimmedCache.get(strings), ...values);
390
+ }
383
391
  //# sourceMappingURL=util.js.map