@kubex/zinc 1.1.175 → 1.1.177

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.
@@ -4113,7 +4113,7 @@
4113
4113
  "text": "string"
4114
4114
  },
4115
4115
  "default": "''",
4116
- "description": "The message body as an HTML string. When set, it is sanitized (scripts and event\nhandlers stripped), newlines become line breaks and bare URLs become links. When\nomitted the default slot is rendered instead.",
4116
+ "description": "The message body as an HTML string. When set, it is sanitized down to formatting tags and\nhttp(s) or mailto links, newlines become line breaks and bare URLs become links. When\nomitted the default slot is rendered instead.",
4117
4117
  "attribute": "message"
4118
4118
  },
4119
4119
  {
@@ -4254,7 +4254,7 @@
4254
4254
  "text": "string"
4255
4255
  },
4256
4256
  "default": "''",
4257
- "description": "The message body as an HTML string. When set, it is sanitized (scripts and event\nhandlers stripped), newlines become line breaks and bare URLs become links. When\nomitted the default slot is rendered instead.",
4257
+ "description": "The message body as an HTML string. When set, it is sanitized down to formatting tags and\nhttp(s) or mailto links, newlines become line breaks and bare URLs become links. When\nomitted the default slot is rendered instead.",
4258
4258
  "fieldName": "message"
4259
4259
  },
4260
4260
  {
@@ -53936,7 +53936,7 @@
53936
53936
  "package": {
53937
53937
  "name": "@kubex/zinc",
53938
53938
  "description": "A collection of web components for building web applications based off of @shoelace-style/Shoelace",
53939
- "version": "1.1.175",
53939
+ "version": "1.1.177",
53940
53940
  "author": "",
53941
53941
  "license": "MIT"
53942
53942
  }
@@ -557,7 +557,7 @@
557
557
  },
558
558
  {
559
559
  "name": "message",
560
- "description": "The message body as an HTML string. When set, it is sanitized (scripts and event\nhandlers stripped), newlines become line breaks and bare URLs become links. When\nomitted the default slot is rendered instead.",
560
+ "description": "The message body as an HTML string. When set, it is sanitized down to formatting tags and\nhttp(s) or mailto links, newlines become line breaks and bare URLs become links. When\nomitted the default slot is rendered instead.",
561
561
  "values": []
562
562
  },
563
563
  {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
3
3
  "name": "@kubex/zinc",
4
- "version": "1.1.175",
4
+ "version": "1.1.177",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
@@ -1148,7 +1148,7 @@
1148
1148
  },
1149
1149
  {
1150
1150
  "name": "message",
1151
- "description": "The message body as an HTML string. When set, it is sanitized (scripts and event\nhandlers stripped), newlines become line breaks and bare URLs become links. When\nomitted the default slot is rendered instead.",
1151
+ "description": "The message body as an HTML string. When set, it is sanitized down to formatting tags and\nhttp(s) or mailto links, newlines become line breaks and bare URLs become links. When\nomitted the default slot is rendered instead.",
1152
1152
  "value": { "type": "string", "default": "''" }
1153
1153
  },
1154
1154
  {
@@ -1214,7 +1214,7 @@
1214
1214
  },
1215
1215
  {
1216
1216
  "name": "message",
1217
- "description": "The message body as an HTML string. When set, it is sanitized (scripts and event\nhandlers stripped), newlines become line breaks and bare URLs become links. When\nomitted the default slot is rendered instead.",
1217
+ "description": "The message body as an HTML string. When set, it is sanitized down to formatting tags and\nhttp(s) or mailto links, newlines become line breaks and bare URLs become links. When\nomitted the default slot is rendered instead.",
1218
1218
  "type": "string"
1219
1219
  },
1220
1220
  {
package/dist/zn.d.ts CHANGED
@@ -1568,8 +1568,18 @@ declare module "components/button-group/index" {
1568
1568
  }
1569
1569
  }
1570
1570
  }
1571
+ declare module "utilities/sanitize-html" {
1572
+ /**
1573
+ * Sanitizes untrusted HTML down to formatting tags, keeping only a link's href when it is http(s) or mailto.
1574
+ * Tags in `keep` are allowed as they are, so a block such as `pre` isn't turned into a paragraph.
1575
+ */
1576
+ export function sanitizeHtml(source: string, keep?: string[]): string;
1577
+ }
1571
1578
  declare module "components/chat-message/clean-message" {
1572
- /** Strip scripts and event/handler attributes from an untrusted HTML string. */
1579
+ /**
1580
+ * Sanitizes an untrusted chat message, turning newlines into breaks and bare URLs into links first so the
1581
+ * links are vetted too.
1582
+ */
1573
1583
  export function cleanHTML(message: string): string;
1574
1584
  }
1575
1585
  declare module "components/chat-message/chat-message.component" {
@@ -1615,8 +1625,8 @@ declare module "components/chat-message/chat-message.component" {
1615
1625
  /** The sender's name, also used for the avatar. */
1616
1626
  sender: string;
1617
1627
  /**
1618
- * The message body as an HTML string. When set, it is sanitized (scripts and event
1619
- * handlers stripped), newlines become line breaks and bare URLs become links. When
1628
+ * The message body as an HTML string. When set, it is sanitized down to formatting tags and
1629
+ * http(s) or mailto links, newlines become line breaks and bare URLs become links. When
1620
1630
  * omitted the default slot is rendered instead.
1621
1631
  */
1622
1632
  message: string;
@@ -8936,14 +8946,11 @@ declare module "components/split-button/index" {
8936
8946
  }
8937
8947
  }
8938
8948
  }
8939
- declare module "components/content-block/sanitize-html" {
8949
+ declare module "components/content-block/html-text" {
8940
8950
  /** Whether a plain-text body is really HTML source. `<br>` alone doesn't count. */
8941
8951
  export function looksLikeHtml(text: string): boolean;
8942
- /**
8943
- * Rebuilds untrusted HTML from an allowlist of formatting tags. Attributes are never copied,
8944
- * except a link's href when it is http(s) or mailto.
8945
- */
8946
- export function sanitizeHtml(source: string): string;
8952
+ /** Plain text of a body that may be HTML source or text holding encoded entities like `&nbsp;`. */
8953
+ export function htmlToText(source: string): string;
8947
8954
  }
8948
8955
  declare module "components/content-block/content-block.component" {
8949
8956
  import ZincElement from "internal/zinc-element";