@testgorilla/tgo-ui 8.8.0 → 8.9.1

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/mcp/server.mjs CHANGED
@@ -3104,6 +3104,9 @@ var require_utils = __commonJS({
3104
3104
  "use strict";
3105
3105
  var isUUID = RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu);
3106
3106
  var isIPv4 = RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);
3107
+ var isHexPair = RegExp.prototype.test.bind(/^[\da-f]{2}$/iu);
3108
+ var isUnreserved = RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu);
3109
+ var isPathCharacter = RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);
3107
3110
  function stringArrayToHexStripped(input) {
3108
3111
  let acc = "";
3109
3112
  let code = 0;
@@ -3296,27 +3299,77 @@ var require_utils = __commonJS({
3296
3299
  }
3297
3300
  return output.join("");
3298
3301
  }
3299
- function normalizeComponentEncoding(component, esc2) {
3300
- const func = esc2 !== true ? escape : unescape;
3301
- if (component.scheme !== void 0) {
3302
- component.scheme = func(component.scheme);
3303
- }
3304
- if (component.userinfo !== void 0) {
3305
- component.userinfo = func(component.userinfo);
3306
- }
3307
- if (component.host !== void 0) {
3308
- component.host = func(component.host);
3302
+ var HOST_DELIMS = { "@": "%40", "/": "%2F", "?": "%3F", "#": "%23", ":": "%3A" };
3303
+ var HOST_DELIM_RE = /[@/?#:]/g;
3304
+ var HOST_DELIM_NO_COLON_RE = /[@/?#]/g;
3305
+ function reescapeHostDelimiters(host, isIP) {
3306
+ const re = isIP ? HOST_DELIM_NO_COLON_RE : HOST_DELIM_RE;
3307
+ re.lastIndex = 0;
3308
+ return host.replace(re, (ch) => HOST_DELIMS[ch]);
3309
+ }
3310
+ function normalizePercentEncoding(input, decodeUnreserved = false) {
3311
+ if (input.indexOf("%") === -1) {
3312
+ return input;
3309
3313
  }
3310
- if (component.path !== void 0) {
3311
- component.path = func(component.path);
3314
+ let output = "";
3315
+ for (let i = 0; i < input.length; i++) {
3316
+ if (input[i] === "%" && i + 2 < input.length) {
3317
+ const hex = input.slice(i + 1, i + 3);
3318
+ if (isHexPair(hex)) {
3319
+ const normalizedHex = hex.toUpperCase();
3320
+ const decoded = String.fromCharCode(parseInt(normalizedHex, 16));
3321
+ if (decodeUnreserved && isUnreserved(decoded)) {
3322
+ output += decoded;
3323
+ } else {
3324
+ output += "%" + normalizedHex;
3325
+ }
3326
+ i += 2;
3327
+ continue;
3328
+ }
3329
+ }
3330
+ output += input[i];
3312
3331
  }
3313
- if (component.query !== void 0) {
3314
- component.query = func(component.query);
3332
+ return output;
3333
+ }
3334
+ function normalizePathEncoding(input) {
3335
+ let output = "";
3336
+ for (let i = 0; i < input.length; i++) {
3337
+ if (input[i] === "%" && i + 2 < input.length) {
3338
+ const hex = input.slice(i + 1, i + 3);
3339
+ if (isHexPair(hex)) {
3340
+ const normalizedHex = hex.toUpperCase();
3341
+ const decoded = String.fromCharCode(parseInt(normalizedHex, 16));
3342
+ if (decoded !== "." && isUnreserved(decoded)) {
3343
+ output += decoded;
3344
+ } else {
3345
+ output += "%" + normalizedHex;
3346
+ }
3347
+ i += 2;
3348
+ continue;
3349
+ }
3350
+ }
3351
+ if (isPathCharacter(input[i])) {
3352
+ output += input[i];
3353
+ } else {
3354
+ output += escape(input[i]);
3355
+ }
3315
3356
  }
3316
- if (component.fragment !== void 0) {
3317
- component.fragment = func(component.fragment);
3357
+ return output;
3358
+ }
3359
+ function escapePreservingEscapes(input) {
3360
+ let output = "";
3361
+ for (let i = 0; i < input.length; i++) {
3362
+ if (input[i] === "%" && i + 2 < input.length) {
3363
+ const hex = input.slice(i + 1, i + 3);
3364
+ if (isHexPair(hex)) {
3365
+ output += "%" + hex.toUpperCase();
3366
+ i += 2;
3367
+ continue;
3368
+ }
3369
+ }
3370
+ output += escape(input[i]);
3318
3371
  }
3319
- return component;
3372
+ return output;
3320
3373
  }
3321
3374
  function recomposeAuthority(component) {
3322
3375
  const uriTokens = [];
@@ -3331,7 +3384,7 @@ var require_utils = __commonJS({
3331
3384
  if (ipV6res.isIPV6 === true) {
3332
3385
  host = `[${ipV6res.escapedHost}]`;
3333
3386
  } else {
3334
- host = component.host;
3387
+ host = reescapeHostDelimiters(host, false);
3335
3388
  }
3336
3389
  }
3337
3390
  uriTokens.push(host);
@@ -3345,7 +3398,10 @@ var require_utils = __commonJS({
3345
3398
  module.exports = {
3346
3399
  nonSimpleDomain,
3347
3400
  recomposeAuthority,
3348
- normalizeComponentEncoding,
3401
+ reescapeHostDelimiters,
3402
+ normalizePercentEncoding,
3403
+ normalizePathEncoding,
3404
+ escapePreservingEscapes,
3349
3405
  removeDotSegments,
3350
3406
  isIPv4,
3351
3407
  isUUID,
@@ -3569,12 +3625,12 @@ var require_schemes = __commonJS({
3569
3625
  var require_fast_uri = __commonJS({
3570
3626
  "node_modules/fast-uri/index.js"(exports, module) {
3571
3627
  "use strict";
3572
- var { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizeComponentEncoding, isIPv4, nonSimpleDomain } = require_utils();
3628
+ var { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizePercentEncoding, normalizePathEncoding, escapePreservingEscapes, reescapeHostDelimiters, isIPv4, nonSimpleDomain } = require_utils();
3573
3629
  var { SCHEMES, getSchemeHandler } = require_schemes();
3574
3630
  function normalize(uri, options) {
3575
3631
  if (typeof uri === "string") {
3576
3632
  uri = /** @type {T} */
3577
- serialize(parse3(uri, options), options);
3633
+ normalizeString(uri, options);
3578
3634
  } else if (typeof uri === "object") {
3579
3635
  uri = /** @type {T} */
3580
3636
  parse3(serialize(uri, options), options);
@@ -3641,19 +3697,9 @@ var require_fast_uri = __commonJS({
3641
3697
  return target;
3642
3698
  }
3643
3699
  function equal(uriA, uriB, options) {
3644
- if (typeof uriA === "string") {
3645
- uriA = unescape(uriA);
3646
- uriA = serialize(normalizeComponentEncoding(parse3(uriA, options), true), { ...options, skipEscape: true });
3647
- } else if (typeof uriA === "object") {
3648
- uriA = serialize(normalizeComponentEncoding(uriA, true), { ...options, skipEscape: true });
3649
- }
3650
- if (typeof uriB === "string") {
3651
- uriB = unescape(uriB);
3652
- uriB = serialize(normalizeComponentEncoding(parse3(uriB, options), true), { ...options, skipEscape: true });
3653
- } else if (typeof uriB === "object") {
3654
- uriB = serialize(normalizeComponentEncoding(uriB, true), { ...options, skipEscape: true });
3655
- }
3656
- return uriA.toLowerCase() === uriB.toLowerCase();
3700
+ const normalizedA = normalizeComparableURI(uriA, options);
3701
+ const normalizedB = normalizeComparableURI(uriB, options);
3702
+ return normalizedA !== void 0 && normalizedB !== void 0 && normalizedA.toLowerCase() === normalizedB.toLowerCase();
3657
3703
  }
3658
3704
  function serialize(cmpts, opts) {
3659
3705
  const component = {
@@ -3678,12 +3724,12 @@ var require_fast_uri = __commonJS({
3678
3724
  if (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(component, options);
3679
3725
  if (component.path !== void 0) {
3680
3726
  if (!options.skipEscape) {
3681
- component.path = escape(component.path);
3727
+ component.path = escapePreservingEscapes(component.path);
3682
3728
  if (component.scheme !== void 0) {
3683
3729
  component.path = component.path.split("%3A").join(":");
3684
3730
  }
3685
3731
  } else {
3686
- component.path = unescape(component.path);
3732
+ component.path = normalizePercentEncoding(component.path);
3687
3733
  }
3688
3734
  }
3689
3735
  if (options.reference !== "suffix" && component.scheme) {
@@ -3718,7 +3764,16 @@ var require_fast_uri = __commonJS({
3718
3764
  return uriTokens.join("");
3719
3765
  }
3720
3766
  var URI_PARSE = /^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;
3721
- function parse3(uri, opts) {
3767
+ function getParseError(parsed, matches) {
3768
+ if (matches[2] !== void 0 && parsed.path && parsed.path[0] !== "/") {
3769
+ return 'URI path must start with "/" when authority is present.';
3770
+ }
3771
+ if (typeof parsed.port === "number" && (parsed.port < 0 || parsed.port > 65535)) {
3772
+ return "URI port is malformed.";
3773
+ }
3774
+ return void 0;
3775
+ }
3776
+ function parseWithStatus(uri, opts) {
3722
3777
  const options = Object.assign({}, opts);
3723
3778
  const parsed = {
3724
3779
  scheme: void 0,
@@ -3729,6 +3784,7 @@ var require_fast_uri = __commonJS({
3729
3784
  query: void 0,
3730
3785
  fragment: void 0
3731
3786
  };
3787
+ let malformedAuthorityOrPort = false;
3732
3788
  let isIP = false;
3733
3789
  if (options.reference === "suffix") {
3734
3790
  if (options.scheme) {
@@ -3749,6 +3805,11 @@ var require_fast_uri = __commonJS({
3749
3805
  if (isNaN(parsed.port)) {
3750
3806
  parsed.port = matches[5];
3751
3807
  }
3808
+ const parseError = getParseError(parsed, matches);
3809
+ if (parseError !== void 0) {
3810
+ parsed.error = parsed.error || parseError;
3811
+ malformedAuthorityOrPort = true;
3812
+ }
3752
3813
  if (parsed.host) {
3753
3814
  const ipv4result = isIPv4(parsed.host);
3754
3815
  if (ipv4result === false) {
@@ -3787,14 +3848,18 @@ var require_fast_uri = __commonJS({
3787
3848
  parsed.scheme = unescape(parsed.scheme);
3788
3849
  }
3789
3850
  if (parsed.host !== void 0) {
3790
- parsed.host = unescape(parsed.host);
3851
+ parsed.host = reescapeHostDelimiters(unescape(parsed.host), isIP);
3791
3852
  }
3792
3853
  }
3793
3854
  if (parsed.path) {
3794
- parsed.path = escape(unescape(parsed.path));
3855
+ parsed.path = normalizePathEncoding(parsed.path);
3795
3856
  }
3796
3857
  if (parsed.fragment) {
3797
- parsed.fragment = encodeURI(decodeURIComponent(parsed.fragment));
3858
+ try {
3859
+ parsed.fragment = encodeURI(decodeURIComponent(parsed.fragment));
3860
+ } catch {
3861
+ parsed.error = parsed.error || "URI malformed";
3862
+ }
3798
3863
  }
3799
3864
  }
3800
3865
  if (schemeHandler && schemeHandler.parse) {
@@ -3803,7 +3868,29 @@ var require_fast_uri = __commonJS({
3803
3868
  } else {
3804
3869
  parsed.error = parsed.error || "URI can not be parsed.";
3805
3870
  }
3806
- return parsed;
3871
+ return { parsed, malformedAuthorityOrPort };
3872
+ }
3873
+ function parse3(uri, opts) {
3874
+ return parseWithStatus(uri, opts).parsed;
3875
+ }
3876
+ function normalizeString(uri, opts) {
3877
+ return normalizeStringWithStatus(uri, opts).normalized;
3878
+ }
3879
+ function normalizeStringWithStatus(uri, opts) {
3880
+ const { parsed, malformedAuthorityOrPort } = parseWithStatus(uri, opts);
3881
+ return {
3882
+ normalized: malformedAuthorityOrPort ? uri : serialize(parsed, opts),
3883
+ malformedAuthorityOrPort
3884
+ };
3885
+ }
3886
+ function normalizeComparableURI(uri, opts) {
3887
+ if (typeof uri === "string") {
3888
+ const { normalized, malformedAuthorityOrPort } = normalizeStringWithStatus(uri, opts);
3889
+ return malformedAuthorityOrPort ? void 0 : normalized;
3890
+ }
3891
+ if (typeof uri === "object") {
3892
+ return serialize(uri, opts);
3893
+ }
3807
3894
  }
3808
3895
  var fastUri = {
3809
3896
  SCHEMES,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@testgorilla/tgo-ui",
3
- "version": "8.8.0",
3
+ "version": "8.9.1",
4
4
  "license": "proprietary-license",
5
5
  "lint-staged": {
6
6
  "{projects,components}/**/*.ts": [
@@ -176,12 +176,12 @@ ui-autocomplete {
176
176
  }
177
177
 
178
178
  .mat-mdc-optgroup {
179
- .mdc-list-item__primary-text {
179
+ .mat-mdc-optgroup-label .mdc-list-item__primary-text {
180
180
  color: $black !important;
181
181
  text-transform: lowercase;
182
182
  }
183
183
 
184
- .mdc-list-item__primary-text:first-letter {
184
+ .mat-mdc-optgroup-label .mdc-list-item__primary-text:first-letter {
185
185
  text-transform: uppercase !important;
186
186
  }
187
187
  }