@esposter/shared 2.29.0 → 2.30.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.
package/dist/index.d.ts CHANGED
@@ -2329,7 +2329,7 @@ declare const MENTION_TYPE = "mention";
2329
2329
  declare const MENTION_HERE_ID = "@here";
2330
2330
  declare const MENTION_EVERYONE_ID = "@everyone";
2331
2331
  //#endregion
2332
- //#region ../../node_modules/.pnpm/node-html-parser@8.0.1/node_modules/node-html-parser/dist/void-tag.d.ts
2332
+ //#region ../../node_modules/.pnpm/node-html-parser@8.0.3/node_modules/node-html-parser/dist/void-tag.d.ts
2333
2333
  declare class VoidTag {
2334
2334
  addClosingSlash: boolean;
2335
2335
  private voidTags;
@@ -2338,14 +2338,14 @@ declare class VoidTag {
2338
2338
  isVoidElement(tag: string): boolean;
2339
2339
  }
2340
2340
  //#endregion
2341
- //#region ../../node_modules/.pnpm/node-html-parser@8.0.1/node_modules/node-html-parser/dist/nodes/type.d.ts
2341
+ //#region ../../node_modules/.pnpm/node-html-parser@8.0.3/node_modules/node-html-parser/dist/nodes/type.d.ts
2342
2342
  declare enum NodeType {
2343
2343
  ELEMENT_NODE = 1,
2344
2344
  TEXT_NODE = 3,
2345
2345
  COMMENT_NODE = 8
2346
2346
  }
2347
2347
  //#endregion
2348
- //#region ../../node_modules/.pnpm/node-html-parser@8.0.1/node_modules/node-html-parser/dist/nodes/node.d.ts
2348
+ //#region ../../node_modules/.pnpm/node-html-parser@8.0.3/node_modules/node-html-parser/dist/nodes/node.d.ts
2349
2349
  /**
2350
2350
  * Node Class as base class for TextNode and HTMLElement.
2351
2351
  */
@@ -2369,7 +2369,7 @@ declare abstract class Node {
2369
2369
  set textContent(val: string);
2370
2370
  }
2371
2371
  //#endregion
2372
- //#region ../../node_modules/.pnpm/node-html-parser@8.0.1/node_modules/node-html-parser/dist/nodes/html.d.ts
2372
+ //#region ../../node_modules/.pnpm/node-html-parser@8.0.3/node_modules/node-html-parser/dist/nodes/html.d.ts
2373
2373
  interface KeyAttributes {
2374
2374
  id?: string;
2375
2375
  class?: string;
package/dist/index.js CHANGED
@@ -1563,7 +1563,7 @@ var init_dist = __esmMin((() => {
1563
1563
  })(EncodingMode || (EncodingMode = {}));
1564
1564
  }));
1565
1565
  //#endregion
1566
- //#region ../../node_modules/.pnpm/node-html-parser@8.0.1/node_modules/node-html-parser/dist/nodes/node.js
1566
+ //#region ../../node_modules/.pnpm/node-html-parser@8.0.3/node_modules/node-html-parser/dist/nodes/node.js
1567
1567
  var require_node$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
1568
1568
  Object.defineProperty(exports, "__esModule", { value: true });
1569
1569
  const entities_1 = (init_dist(), __toCommonJS(dist_exports));
@@ -1607,7 +1607,7 @@ var require_node$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
1607
1607
  exports.default = Node;
1608
1608
  }));
1609
1609
  //#endregion
1610
- //#region ../../node_modules/.pnpm/node-html-parser@8.0.1/node_modules/node-html-parser/dist/nodes/type.js
1610
+ //#region ../../node_modules/.pnpm/node-html-parser@8.0.3/node_modules/node-html-parser/dist/nodes/type.js
1611
1611
  var require_type = /* @__PURE__ */ __commonJSMin(((exports) => {
1612
1612
  Object.defineProperty(exports, "__esModule", { value: true });
1613
1613
  var NodeType;
@@ -1619,7 +1619,7 @@ var require_type = /* @__PURE__ */ __commonJSMin(((exports) => {
1619
1619
  exports.default = NodeType;
1620
1620
  }));
1621
1621
  //#endregion
1622
- //#region ../../node_modules/.pnpm/node-html-parser@8.0.1/node_modules/node-html-parser/dist/nodes/comment.js
1622
+ //#region ../../node_modules/.pnpm/node-html-parser@8.0.3/node_modules/node-html-parser/dist/nodes/comment.js
1623
1623
  var require_comment$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
1624
1624
  var __importDefault = exports && exports.__importDefault || function(mod) {
1625
1625
  return mod && mod.__esModule ? mod : { "default": mod };
@@ -8011,7 +8011,7 @@ var require_lib$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
8011
8011
  });
8012
8012
  }));
8013
8013
  //#endregion
8014
- //#region ../../node_modules/.pnpm/node-html-parser@8.0.1/node_modules/node-html-parser/dist/back.js
8014
+ //#region ../../node_modules/.pnpm/node-html-parser@8.0.3/node_modules/node-html-parser/dist/back.js
8015
8015
  var require_back = /* @__PURE__ */ __commonJSMin(((exports) => {
8016
8016
  Object.defineProperty(exports, "__esModule", { value: true });
8017
8017
  function arr_back(arr) {
@@ -8020,7 +8020,7 @@ var require_back = /* @__PURE__ */ __commonJSMin(((exports) => {
8020
8020
  exports.default = arr_back;
8021
8021
  }));
8022
8022
  //#endregion
8023
- //#region ../../node_modules/.pnpm/node-html-parser@8.0.1/node_modules/node-html-parser/dist/matcher.js
8023
+ //#region ../../node_modules/.pnpm/node-html-parser@8.0.3/node_modules/node-html-parser/dist/matcher.js
8024
8024
  var require_matcher = /* @__PURE__ */ __commonJSMin(((exports) => {
8025
8025
  var __importDefault = exports && exports.__importDefault || function(mod) {
8026
8026
  return mod && mod.__esModule ? mod : { "default": mod };
@@ -8116,7 +8116,7 @@ var require_matcher = /* @__PURE__ */ __commonJSMin(((exports) => {
8116
8116
  };
8117
8117
  }));
8118
8118
  //#endregion
8119
- //#region ../../node_modules/.pnpm/node-html-parser@8.0.1/node_modules/node-html-parser/dist/void-tag.js
8119
+ //#region ../../node_modules/.pnpm/node-html-parser@8.0.3/node_modules/node-html-parser/dist/void-tag.js
8120
8120
  var require_void_tag = /* @__PURE__ */ __commonJSMin(((exports) => {
8121
8121
  Object.defineProperty(exports, "__esModule", { value: true });
8122
8122
  var VoidTag = class {
@@ -8157,7 +8157,7 @@ var require_void_tag = /* @__PURE__ */ __commonJSMin(((exports) => {
8157
8157
  exports.default = VoidTag;
8158
8158
  }));
8159
8159
  //#endregion
8160
- //#region ../../node_modules/.pnpm/node-html-parser@8.0.1/node_modules/node-html-parser/dist/nodes/text.js
8160
+ //#region ../../node_modules/.pnpm/node-html-parser@8.0.3/node_modules/node-html-parser/dist/nodes/text.js
8161
8161
  var require_text = /* @__PURE__ */ __commonJSMin(((exports) => {
8162
8162
  var __importDefault = exports && exports.__importDefault || function(mod) {
8163
8163
  return mod && mod.__esModule ? mod : { "default": mod };
@@ -8251,7 +8251,7 @@ var require_text = /* @__PURE__ */ __commonJSMin(((exports) => {
8251
8251
  }
8252
8252
  }));
8253
8253
  //#endregion
8254
- //#region ../../node_modules/.pnpm/node-html-parser@8.0.1/node_modules/node-html-parser/dist/nodes/html.js
8254
+ //#region ../../node_modules/.pnpm/node-html-parser@8.0.3/node_modules/node-html-parser/dist/nodes/html.js
8255
8255
  var require_html = /* @__PURE__ */ __commonJSMin(((exports) => {
8256
8256
  var __importDefault = exports && exports.__importDefault || function(mod) {
8257
8257
  return mod && mod.__esModule ? mod : { "default": mod };
@@ -8388,7 +8388,7 @@ var require_html = /* @__PURE__ */ __commonJSMin(((exports) => {
8388
8388
  */
8389
8389
  quoteAttribute(attr) {
8390
8390
  if (attr == null) return "null";
8391
- return JSON.stringify(attr.replace(/"/g, """)).replace(/\\t/g, " ").replace(/\\n/g, "\n").replace(/\\r/g, "\r").replace(/\\/g, "");
8391
+ return `"${attr.replace(/"/g, """)}"`;
8392
8392
  }
8393
8393
  /**
8394
8394
  * Creates an instance of HTMLElement.
@@ -9024,6 +9024,7 @@ var require_html = /* @__PURE__ */ __commonJSMin(((exports) => {
9024
9024
  };
9025
9025
  exports.default = HTMLElement;
9026
9026
  const kMarkupPattern = /<!--[\s\S]*?-->|<(\/?)([a-zA-Z][-.:0-9_a-zA-Z@\xB7\xC0-\xD6\xD8-\xF6\u00F8-\u03A1\u03A3-\u03D9\u03DB-\u03EF\u03F7-\u03FF\u0400-\u04FF\u0500-\u052F\u1D00-\u1D2B\u1D6B-\u1D77\u1D79-\u1D9A\u1E00-\u1E9B\u1F00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2126\u212A-\u212B\u2132\u214E\u2160-\u2188\u2C60-\u2C7F\uA722-\uA787\uA78B-\uA78E\uA790-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA7FF\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64-\uAB65\uFB00-\uFB06\uFB13-\uFB17\uFF21-\uFF3A\uFF41-\uFF5A\x37F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]*)((?:\s+[^>]*?(?:(?:'[^']*')|(?:"[^"]*"))?)*)\s*(\/?)>/gu;
9027
+ const kMarkupPatternWithCDATA = /<!--[\s\S]*?-->|<!\[CDATA\[[\s\S]*?\]\]>|<(\/?)([a-zA-Z][-.:0-9_a-zA-Z@\xB7\xC0-\xD6\xD8-\xF6\u00F8-\u03A1\u03A3-\u03D9\u03DB-\u03EF\u03F7-\u03FF\u0400-\u04FF\u0500-\u052F\u1D00-\u1D2B\u1D6B-\u1D77\u1D79-\u1D9A\u1E00-\u1E9B\u1F00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2126\u212A-\u212B\u2132\u214E\u2160-\u2188\u2C60-\u2C7F\uA722-\uA787\uA78B-\uA78E\uA790-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA7FF\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64-\uAB65\uFB00-\uFB06\uFB13-\uFB17\uFF21-\uFF3A\uFF41-\uFF5A\x37F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]*)((?:\s+[^>]*?(?:(?:'[^']*')|(?:"[^"]*"))?)*)\s*(\/?)>/gu;
9027
9028
  const kAttributePattern = /(?:^|\s)(id|class)\s*=\s*((?:'[^']*')|(?:"[^"]*")|\S+)/gi;
9028
9029
  const kElementsClosedByOpening = {
9029
9030
  li: {
@@ -9216,6 +9217,8 @@ var require_html = /* @__PURE__ */ __commonJSMin(((exports) => {
9216
9217
  function base_parse(data, options = {}) {
9217
9218
  var _a, _b;
9218
9219
  const voidTag = new void_tag_1.default((_a = options === null || options === void 0 ? void 0 : options.voidTag) === null || _a === void 0 ? void 0 : _a.closingSlash, (_b = options === null || options === void 0 ? void 0 : options.voidTag) === null || _b === void 0 ? void 0 : _b.tags);
9220
+ const hasCDATA = data.includes("<![CDATA[");
9221
+ const markupPattern = hasCDATA ? kMarkupPatternWithCDATA : kMarkupPattern;
9219
9222
  const elements = options.blockTextElements || {
9220
9223
  script: true,
9221
9224
  noscript: true,
@@ -9242,18 +9245,23 @@ var require_html = /* @__PURE__ */ __commonJSMin(((exports) => {
9242
9245
  const { lowerCaseTagName, fixNestedATags } = options;
9243
9246
  const dataEndPos = data.length - 27;
9244
9247
  const frameFlagOffset = 27;
9245
- while (match = kMarkupPattern.exec(data)) {
9248
+ markupPattern.lastIndex = 0;
9249
+ while (match = markupPattern.exec(data)) {
9246
9250
  let { 0: matchText, 1: leadingSlash, 2: tagName, 3: attributes, 4: closingSlash } = match;
9247
9251
  const matchLength = matchText.length;
9248
- const tagStartPos = kMarkupPattern.lastIndex - matchLength;
9249
- const tagEndPos = kMarkupPattern.lastIndex;
9252
+ const tagStartPos = markupPattern.lastIndex - matchLength;
9253
+ const tagEndPos = markupPattern.lastIndex;
9250
9254
  if (lastTextPos > -1) {
9251
9255
  if (lastTextPos + matchLength < tagEndPos) {
9252
9256
  const text = data.substring(lastTextPos, tagStartPos);
9253
9257
  currentParent.appendChild(new text_1.default(text, currentParent, createRange(lastTextPos, tagStartPos)));
9254
9258
  }
9255
9259
  }
9256
- lastTextPos = kMarkupPattern.lastIndex;
9260
+ lastTextPos = markupPattern.lastIndex;
9261
+ if (hasCDATA && matchText.startsWith("<![CDATA[")) {
9262
+ currentParent.appendChild(new text_1.default(matchText, currentParent, createRange(tagStartPos, tagEndPos)));
9263
+ continue;
9264
+ }
9257
9265
  if (tagName === frameflag) continue;
9258
9266
  if (matchText[1] === "!") {
9259
9267
  if (options.comment) {
@@ -9284,21 +9292,21 @@ var require_html = /* @__PURE__ */ __commonJSMin(((exports) => {
9284
9292
  }
9285
9293
  noNestedTagIndex = stack.length;
9286
9294
  }
9287
- const tagEndPos = kMarkupPattern.lastIndex;
9295
+ const tagEndPos = markupPattern.lastIndex;
9288
9296
  const tagStartPos = tagEndPos - matchLength;
9289
9297
  currentParent = currentParent.appendChild(new HTMLElement(tagName, attrs, attributes.slice(1), null, createRange(tagStartPos, tagEndPos), voidTag, options));
9290
9298
  stack.push(currentParent);
9291
9299
  if (is_block_text_element(tagName)) {
9292
9300
  const closeMarkup = `</${tagName}>`;
9293
- const closeIndex = lowerCaseTagName ? data.toLocaleLowerCase().indexOf(closeMarkup, kMarkupPattern.lastIndex) : data.indexOf(closeMarkup, kMarkupPattern.lastIndex);
9301
+ const closeIndex = lowerCaseTagName ? data.toLocaleLowerCase().indexOf(closeMarkup, markupPattern.lastIndex) : data.indexOf(closeMarkup, markupPattern.lastIndex);
9294
9302
  const textEndPos = closeIndex === -1 ? dataEndPos : closeIndex;
9295
9303
  if (element_should_be_ignore(tagName)) {
9296
9304
  const text = data.substring(tagEndPos, textEndPos);
9297
9305
  if (text.length > 0 && /\S/.test(text)) currentParent.appendChild(new text_1.default(text, currentParent, createRange(tagEndPos, textEndPos)));
9298
9306
  }
9299
- if (closeIndex === -1) lastTextPos = kMarkupPattern.lastIndex = data.length + 1;
9307
+ if (closeIndex === -1) lastTextPos = markupPattern.lastIndex = data.length + 1;
9300
9308
  else {
9301
- lastTextPos = kMarkupPattern.lastIndex = closeIndex + closeMarkup.length;
9309
+ lastTextPos = markupPattern.lastIndex = closeIndex + closeMarkup.length;
9302
9310
  leadingSlash = "/";
9303
9311
  }
9304
9312
  }
@@ -9400,7 +9408,7 @@ var require_html = /* @__PURE__ */ __commonJSMin(((exports) => {
9400
9408
  }
9401
9409
  }));
9402
9410
  //#endregion
9403
- //#region ../../node_modules/.pnpm/node-html-parser@8.0.1/node_modules/node-html-parser/dist/parse.js
9411
+ //#region ../../node_modules/.pnpm/node-html-parser@8.0.3/node_modules/node-html-parser/dist/parse.js
9404
9412
  var require_parse$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
9405
9413
  Object.defineProperty(exports, "__esModule", { value: true });
9406
9414
  exports.default = void 0;
@@ -9413,7 +9421,7 @@ var require_parse$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
9413
9421
  });
9414
9422
  }));
9415
9423
  //#endregion
9416
- //#region ../../node_modules/.pnpm/node-html-parser@8.0.1/node_modules/node-html-parser/dist/valid.js
9424
+ //#region ../../node_modules/.pnpm/node-html-parser@8.0.3/node_modules/node-html-parser/dist/valid.js
9417
9425
  var require_valid = /* @__PURE__ */ __commonJSMin(((exports) => {
9418
9426
  Object.defineProperty(exports, "__esModule", { value: true });
9419
9427
  const html_1 = require_html();
@@ -12711,7 +12719,7 @@ var require_document = /* @__PURE__ */ __commonJSMin(((exports, module) => {
12711
12719
  Document.default = Document;
12712
12720
  }));
12713
12721
  //#endregion
12714
- //#region ../../node_modules/.pnpm/nanoid@3.3.14/node_modules/nanoid/non-secure/index.cjs
12722
+ //#region ../../node_modules/.pnpm/nanoid@3.3.15/node_modules/nanoid/non-secure/index.cjs
12715
12723
  var require_non_secure = /* @__PURE__ */ __commonJSMin(((exports, module) => {
12716
12724
  let urlAlphabet = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
12717
12725
  let customAlphabet = (alphabet, defaultSize = 21) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@esposter/shared",
3
- "version": "2.29.0",
3
+ "version": "2.30.0",
4
4
  "description": "A library that contains shared typescript code.",
5
5
  "homepage": "https://github.com/Esposter/Esposter/blob/main/packages/shared#readme",
6
6
  "bugs": {
@@ -33,17 +33,16 @@
33
33
  },
34
34
  "dependencies": {
35
35
  "neverthrow": "^8.2.0",
36
- "node-html-parser": "^8.0.1",
36
+ "node-html-parser": "^8.0.3",
37
37
  "sanitize-html": "^2.17.5"
38
38
  },
39
39
  "devDependencies": {
40
40
  "@azure/data-tables": "^13.3.2",
41
- "@esposter/configuration": "2.29.0",
41
+ "@esposter/configuration": "2.30.0",
42
42
  "@types/node": "^26.0.0",
43
43
  "@types/sanitize-html": "^2.16.1",
44
- "@vitest/coverage-v8": "^4.1.9",
45
44
  "ctix": "^2.8.1",
46
- "rolldown": "^1.1.2",
45
+ "rolldown": "^1.1.3",
47
46
  "type-fest": "^5.7.0",
48
47
  "vitest": "^4.1.9"
49
48
  },
@@ -52,5 +51,5 @@
52
51
  "vue": "^3.5.38",
53
52
  "zod": "^4.4.3"
54
53
  },
55
- "gitHead": "0166c5a9bea8b089ce37499f66b8d8095f4b4b23"
54
+ "gitHead": "0938fc7009df474354d43acd121f07c8e2fc7171"
56
55
  }