pacem 0.51.4-diophantus → 0.51.4-euler

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 (57) hide show
  1. package/dist/css/pacem-dark-content.min.css +1 -1
  2. package/dist/css/pacem-dark-shell.min.css +1 -1
  3. package/dist/css/pacem-dark.min.css +1 -1
  4. package/dist/css/pacem-light-content.min.css +1 -1
  5. package/dist/css/pacem-light-shell.min.css +1 -1
  6. package/dist/css/pacem-light.min.css +1 -1
  7. package/dist/css/pacem-phousys-content.min.css +1 -1
  8. package/dist/css/pacem-phousys-shell.min.css +1 -1
  9. package/dist/css/pacem-phousys.min.css +1 -1
  10. package/dist/js/azure-maps.d.ts +1 -1
  11. package/dist/js/pacem-2d.d.ts +1 -1
  12. package/dist/js/pacem-2d.js +1 -1
  13. package/dist/js/pacem-2d.min.js +1 -1
  14. package/dist/js/pacem-3d.d.ts +1 -1
  15. package/dist/js/pacem-3d.js +1 -1
  16. package/dist/js/pacem-3d.min.js +1 -1
  17. package/dist/js/pacem-charts.d.ts +1 -1
  18. package/dist/js/pacem-charts.js +1 -1
  19. package/dist/js/pacem-charts.min.js +1 -1
  20. package/dist/js/pacem-cms.d.ts +1 -1
  21. package/dist/js/pacem-cms.js +1 -1
  22. package/dist/js/pacem-cms.min.js +1 -1
  23. package/dist/js/pacem-core.d.ts +26 -3
  24. package/dist/js/pacem-core.js +120 -59
  25. package/dist/js/pacem-core.min.js +2 -2
  26. package/dist/js/pacem-foundation.d.ts +4 -5
  27. package/dist/js/pacem-foundation.js +68 -35
  28. package/dist/js/pacem-foundation.min.js +2 -2
  29. package/dist/js/pacem-fx.d.ts +1 -1
  30. package/dist/js/pacem-fx.js +1 -1
  31. package/dist/js/pacem-fx.min.js +1 -1
  32. package/dist/js/pacem-logging.d.ts +1 -1
  33. package/dist/js/pacem-logging.js +1 -1
  34. package/dist/js/pacem-logging.min.js +1 -1
  35. package/dist/js/pacem-maps.d.ts +1 -1
  36. package/dist/js/pacem-maps.js +1 -1
  37. package/dist/js/pacem-maps.min.js +1 -1
  38. package/dist/js/pacem-media.d.ts +1 -1
  39. package/dist/js/pacem-media.js +1 -1
  40. package/dist/js/pacem-media.min.js +1 -1
  41. package/dist/js/pacem-networking.d.ts +1 -1
  42. package/dist/js/pacem-networking.js +1 -1
  43. package/dist/js/pacem-networking.min.js +1 -1
  44. package/dist/js/pacem-numerical.d.ts +1 -1
  45. package/dist/js/pacem-numerical.js +1 -1
  46. package/dist/js/pacem-numerical.min.js +1 -1
  47. package/dist/js/pacem-plus.d.ts +1 -1
  48. package/dist/js/pacem-plus.js +1 -1
  49. package/dist/js/pacem-plus.min.js +1 -1
  50. package/dist/js/pacem-scaffolding.d.ts +1 -1
  51. package/dist/js/pacem-scaffolding.js +1 -1
  52. package/dist/js/pacem-scaffolding.min.js +1 -1
  53. package/dist/js/pacem-ui.d.ts +1 -1
  54. package/dist/js/pacem-ui.js +1 -1
  55. package/dist/js/pacem-ui.min.js +1 -1
  56. package/dist/js/swagger-types.d.ts +1 -1
  57. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.51.4-diophantus (https://js.pacem.it)
2
+ * pacem v0.51.4-euler (https://js.pacem.it)
3
3
  * Copyright 2025 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.51.4-diophantus (https://js.pacem.it)
2
+ * pacem v0.51.4-euler (https://js.pacem.it)
3
3
  * Copyright 2025 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.51.4-diophantus (https://js.pacem.it)
2
+ * pacem v0.51.4-euler (https://js.pacem.it)
3
3
  * Copyright 2025 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.51.4-diophantus (https://js.pacem.it)
2
+ * pacem v0.51.4-euler (https://js.pacem.it)
3
3
  * Copyright 2025 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.51.4-diophantus (https://js.pacem.it)
2
+ * pacem v0.51.4-euler (https://js.pacem.it)
3
3
  * Copyright 2025 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.51.4-diophantus (https://js.pacem.it)
2
+ * pacem v0.51.4-euler (https://js.pacem.it)
3
3
  * Copyright 2025 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.51.4-diophantus (https://js.pacem.it)
2
+ * pacem v0.51.4-euler (https://js.pacem.it)
3
3
  * Copyright 2025 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.51.4-diophantus (https://js.pacem.it)
2
+ * pacem v0.51.4-euler (https://js.pacem.it)
3
3
  * Copyright 2025 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.51.4-diophantus (https://js.pacem.it)
2
+ * pacem v0.51.4-euler (https://js.pacem.it)
3
3
  * Copyright 2025 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.51.4-diophantus (https://js.pacem.it)
2
+ * pacem v0.51.4-euler (https://js.pacem.it)
3
3
  * Copyright 2025 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.51.4-diophantus (https://js.pacem.it)
2
+ * pacem v0.51.4-euler (https://js.pacem.it)
3
3
  * Copyright 2025 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.51.4-diophantus (https://js.pacem.it)
2
+ * pacem v0.51.4-euler (https://js.pacem.it)
3
3
  * Copyright 2025 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.51.4-diophantus (https://js.pacem.it)
2
+ * pacem v0.51.4-euler (https://js.pacem.it)
3
3
  * Copyright 2025 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.51.4-diophantus (https://js.pacem.it)
2
+ * pacem v0.51.4-euler (https://js.pacem.it)
3
3
  * Copyright 2025 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.51.4-diophantus (https://js.pacem.it)
2
+ * pacem v0.51.4-euler (https://js.pacem.it)
3
3
  * Copyright 2025 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.51.4-diophantus (https://js.pacem.it)
2
+ * pacem v0.51.4-euler (https://js.pacem.it)
3
3
  * Copyright 2025 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.51.4-diophantus (https://js.pacem.it)
2
+ * pacem v0.51.4-euler (https://js.pacem.it)
3
3
  * Copyright 2025 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.51.4-diophantus (https://js.pacem.it)
2
+ * pacem v0.51.4-euler (https://js.pacem.it)
3
3
  * Copyright 2025 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.51.4-diophantus (https://js.pacem.it)
2
+ * pacem v0.51.4-euler (https://js.pacem.it)
3
3
  * Copyright 2025 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.51.4-diophantus (https://js.pacem.it)
2
+ * pacem v0.51.4-euler (https://js.pacem.it)
3
3
  * Copyright 2025 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.51.4-diophantus (https://js.pacem.it)
2
+ * pacem v0.51.4-euler (https://js.pacem.it)
3
3
  * Copyright 2025 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.51.4-diophantus (https://js.pacem.it)
2
+ * pacem v0.51.4-euler (https://js.pacem.it)
3
3
  * Copyright 2025 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.51.4-diophantus (https://js.pacem.it)
2
+ * pacem v0.51.4-euler (https://js.pacem.it)
3
3
  * Copyright 2025 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -139,6 +139,22 @@ declare namespace Pacem {
139
139
  [key: string]: string;
140
140
  };
141
141
  };
142
+ export type RouterState = {
143
+ [key: string]: string;
144
+ } & {
145
+ $pathname: string;
146
+ $path: string;
147
+ $querystring?: string;
148
+ $query: {
149
+ [key: string]: string;
150
+ };
151
+ $hash?: string;
152
+ };
153
+ type RouteMetadata = {
154
+ name: string;
155
+ optional: boolean;
156
+ index: number;
157
+ };
142
158
  /** To be replaced when Cookie Store API types will be included in TypeScript. */
143
159
  export type CookieData = {
144
160
  name: string;
@@ -408,6 +424,15 @@ declare namespace Pacem {
408
424
  }, removeNullEntries?: boolean, hash?: boolean) => string;
409
425
  parseQuery: (query?: string | Location) => Record<string, string>;
410
426
  hasMandatoryTemplateSegments: (url: any) => boolean;
427
+ parseRoute: (pathTemplate: string) => RouteMetadata[];
428
+ split: (url: string) => {
429
+ protocol?: string;
430
+ domain?: string;
431
+ path: string;
432
+ query?: string;
433
+ hash?: string;
434
+ };
435
+ parseState: (metadata: RouteMetadata[], url: string, path?: string, query?: string, hash?: string) => RouterState;
411
436
  };
412
437
  /**
413
438
  * Ensures the proper parsing of Web API results, including deprecated/legacy Pacem wrapped results.
@@ -1494,8 +1519,6 @@ declare namespace Pacem.Components {
1494
1519
  private _parseTemplate;
1495
1520
  private _segmentateUrl;
1496
1521
  private _parseState;
1497
- private _parseHash;
1498
- private _parseQuery;
1499
1522
  }
1500
1523
  }
1501
1524
  declare namespace Pacem.Components {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.51.4-diophantus (https://js.pacem.it)
2
+ * pacem v0.51.4-euler (https://js.pacem.it)
3
3
  * Copyright 2025 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -282,6 +282,8 @@ var Pacem;
282
282
  evt.preventDefault();
283
283
  evt.stopPropagation();
284
284
  };
285
+ const SEGMENT_PATTERN = /^\/[^\/]+/;
286
+ const ROUTE_SEGMENT_PATTERN = /\/\{([a-z\$_][\w]*)\??\}/;
285
287
  class Utils {
286
288
  static get core() {
287
289
  const root = window['Pacem'];
@@ -1202,6 +1204,91 @@ var Pacem;
1202
1204
  },
1203
1205
  hasMandatoryTemplateSegments: function (url) {
1204
1206
  return /(^|\/)\{\.*\}(\/|$)/.test(url);
1207
+ },
1208
+ parseRoute: function (pathTemplate) {
1209
+ let tmpl = pathTemplate;
1210
+ const trunks = [];
1211
+ if (!Utils.isNullOrEmpty(tmpl)) {
1212
+ let res;
1213
+ let j = 0;
1214
+ while ((res = SEGMENT_PATTERN.exec(tmpl)) != null) {
1215
+ const item = res[0];
1216
+ const res1 = ROUTE_SEGMENT_PATTERN.exec(item);
1217
+ if (!Utils.isNullOrEmpty(res1)) {
1218
+ const prop = res1[1];
1219
+ trunks.push({ name: prop, optional: item.charAt(item.length - 2) === '?', index: j });
1220
+ }
1221
+ tmpl = tmpl.substring(res.index + item.length);
1222
+ j++;
1223
+ }
1224
+ }
1225
+ return trunks;
1226
+ },
1227
+ split: function (url) {
1228
+ const URL_PATTERN = /^((https?:)?\/\/[^\/]+)?([^\?#]+)(\?[^#]*)?(#[^#]*)?$/;
1229
+ const regArr = URL_PATTERN.exec(url);
1230
+ if (!regArr /*|| regArr.length <= 3*/) {
1231
+ return null;
1232
+ }
1233
+ return { domain: regArr[2] ?? '', protocol: regArr[1] ?? '', path: regArr[3] ?? '', query: regArr[4] ?? '', hash: regArr[5] ?? '' };
1234
+ },
1235
+ parseState: function (metadata, url, path, query, hash) {
1236
+ let fullPath = url;
1237
+ if (Utils.isNullOrEmpty(path)) {
1238
+ const split = Utils.URIs.split(url);
1239
+ path = split.path;
1240
+ if (Utils.isNullOrEmpty(query)) {
1241
+ query = split.query ?? '';
1242
+ }
1243
+ if (Utils.isNullOrEmpty(hash)) {
1244
+ hash = split.hash ?? '';
1245
+ }
1246
+ fullPath = path + query + hash;
1247
+ }
1248
+ const parseHash = (hash) => {
1249
+ const ndx = hash.indexOf('#');
1250
+ if (ndx !== 0) {
1251
+ return null;
1252
+ }
1253
+ return hash.substring(ndx + 1);
1254
+ };
1255
+ const parseQuery = (search) => {
1256
+ const ndx = search.indexOf('?');
1257
+ if (ndx === 0) {
1258
+ return Utils.URIs.parseQuery(search.substring(ndx + 1));
1259
+ }
1260
+ return {};
1261
+ };
1262
+ let obj = {
1263
+ $path: fullPath,
1264
+ $pathname: path,
1265
+ $querystring: query.length > 0 ? query.substring(1) : query,
1266
+ $query: parseQuery(query),
1267
+ $hash: parseHash(hash)
1268
+ }, i = 0;
1269
+ const tmpl = metadata.slice();
1270
+ if (!Utils.isNullOrEmpty(tmpl)) {
1271
+ let res;
1272
+ while ((res = SEGMENT_PATTERN.exec(path)) != null) {
1273
+ const v = res[0];
1274
+ const tmplIndex = tmpl.findIndex(t => t.index === i);
1275
+ if (tmplIndex >= 0) {
1276
+ const tmplItem = tmpl[tmplIndex];
1277
+ const { name: prop } = tmplItem;
1278
+ Object.defineProperty(obj, prop, { enumerable: true, value: v.substring(1) });
1279
+ // remove used value
1280
+ tmpl.splice(tmplIndex, 1);
1281
+ }
1282
+ i++;
1283
+ path = path.substring(res.index + v.length);
1284
+ }
1285
+ }
1286
+ for (let k = 0; k < tmpl.length; k++) {
1287
+ if (!tmpl[k].optional) {
1288
+ throw `Must provide "${tmpl[k].name}" route value.`;
1289
+ }
1290
+ }
1291
+ return obj;
1205
1292
  }
1206
1293
  }; }
1207
1294
  /**
@@ -3262,6 +3349,29 @@ var Pacem;
3262
3349
  function escapeRegExp(string) {
3263
3350
  return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
3264
3351
  }
3352
+ function buildDiffOptions(modeOrOutput, outputOrCssAdd, cssAddOrRemove, cssRemoveIfAny) {
3353
+ let mode = 'char';
3354
+ let output = 'full';
3355
+ let cssAdd;
3356
+ let cssRemove;
3357
+ if (['line', 'word', 'char'].includes(modeOrOutput)) {
3358
+ mode = modeOrOutput;
3359
+ output = outputOrCssAdd;
3360
+ cssAdd = cssAddOrRemove;
3361
+ cssRemove = cssRemoveIfAny;
3362
+ }
3363
+ else {
3364
+ output = modeOrOutput;
3365
+ cssAdd = outputOrCssAdd;
3366
+ cssRemove = cssAddOrRemove;
3367
+ }
3368
+ return {
3369
+ mode,
3370
+ output,
3371
+ cssAdd: cssAdd ?? 'fill-green-container',
3372
+ cssRemove: cssRemove ?? 'fill-red-container',
3373
+ };
3374
+ }
3265
3375
  class Transforms {
3266
3376
  static highlight(src, query, css = Pacem.PCSS + '-highlight') {
3267
3377
  if (!query || !src)
@@ -3280,14 +3390,15 @@ var Pacem;
3280
3390
  }
3281
3391
  return output;
3282
3392
  }
3283
- static diff(a, b, mode = 'full', cssAdd = 'fill-green-container', cssRemove = 'fill-red-container') {
3284
- const tokens = Pacem.Utils.diff(a, b);
3393
+ static diff(a, b, modeOrOutput = 'full', outputOrCssAdd, cssAddOrRemove, cssRemoveIfAny) {
3394
+ const { mode, output, cssAdd, cssRemove } = buildDiffOptions(modeOrOutput, outputOrCssAdd, cssAddOrRemove, cssRemoveIfAny);
3395
+ const tokens = Pacem.Utils.diff(a, b, mode);
3285
3396
  return tokens.reduce((acc, token) => {
3286
3397
  const t = token.type;
3287
3398
  if (t === '=') {
3288
3399
  acc += token.value;
3289
3400
  }
3290
- else if (t === '+' && mode !== 'left' || t === '-' && mode !== 'right') {
3401
+ else if (t === '+' && output !== 'left' || t === '-' && output !== 'right') {
3291
3402
  const lines = token.value.split(/\r?\n/);
3292
3403
  const lUpperBound = lines.length - 1;
3293
3404
  for (let l = 0; l <= lUpperBound; l++) {
@@ -5751,7 +5862,6 @@ var Pacem;
5751
5862
  var Components;
5752
5863
  (function (Components) {
5753
5864
  const CHECK_PATTERN = /^([\w\.]:)?\/\/[^\/]+/;
5754
- const URL_PATTERN = /^((https?:)?\/\/[^\/]+)?([^\?#]+)(\?[^#]*)?(#[^#]*)?$/;
5755
5865
  let PacemRouterElement = class PacemRouterElement extends Components.PacemEventTarget {
5756
5866
  constructor() {
5757
5867
  super(...arguments);
@@ -5881,67 +5991,18 @@ var Pacem;
5881
5991
  if (!Pacem.Utils.isNullOrEmpty(this.#template)) {
5882
5992
  return this.#template;
5883
5993
  }
5884
- const trunks = [];
5885
- if (!Pacem.Utils.isNullOrEmpty(tmpl)) {
5886
- let res;
5887
- while ((res = /\/\{([a-z\$_][\w]*)\??\}/g.exec(tmpl)) != null) {
5888
- const prop = res[1], item = res[0];
5889
- trunks.push({ name: prop, optional: item.charAt(item.length - 2) === '?' });
5890
- tmpl = tmpl.substring(res.index + item.length);
5891
- }
5892
- }
5893
- return this.#template = trunks;
5994
+ return this.#template = Pacem.Utils.URIs.parseRoute(tmpl);
5894
5995
  }
5895
5996
  _segmentateUrl(url) {
5896
- const regArr = URL_PATTERN.exec(url);
5897
- if (!regArr || regArr.length <= 3) {
5997
+ const retval = Pacem.Utils.URIs.split(url);
5998
+ if (Pacem.Utils.isNullOrEmpty(retval.path)) {
5898
5999
  return null;
5899
6000
  }
5900
- return { path: regArr[3], query: regArr[4] || '', hash: regArr[5] || '' };
6001
+ return retval;
5901
6002
  }
5902
6003
  _parseState(fullPath, path, query, hash) {
5903
- var obj = {
5904
- $path: fullPath,
5905
- $pathname: path,
5906
- $querystring: query.length > 0 ? query.substring(1) : query,
5907
- $query: this._parseQuery(query),
5908
- $hash: this._parseHash(hash)
5909
- }, i = 0;
5910
6004
  const tmpl = this._parseTemplate();
5911
- if (!Pacem.Utils.isNullOrEmpty(tmpl)) {
5912
- const pattern = /^\/[^\/]+/;
5913
- let res;
5914
- while ((res = pattern.exec(path)) != null) {
5915
- const v = res[0];
5916
- if (i >= tmpl.length) {
5917
- throw `Length mismatch: cannot compare provided path with current template.`;
5918
- }
5919
- const prop = tmpl[i];
5920
- Object.defineProperty(obj, prop.name, { enumerable: true, value: v.substring(1) });
5921
- i++;
5922
- path = path.substring(res.index + v.length);
5923
- }
5924
- }
5925
- for (let k = i; k < tmpl.length; k++) {
5926
- if (!tmpl[k].optional) {
5927
- throw `Must provide "${tmpl[k].name}" route value.`;
5928
- }
5929
- }
5930
- return obj;
5931
- }
5932
- _parseHash(hash) {
5933
- const ndx = hash.indexOf('#');
5934
- if (ndx !== 0) {
5935
- return null;
5936
- }
5937
- return hash.substring(ndx + 1);
5938
- }
5939
- _parseQuery(search) {
5940
- const ndx = search.indexOf('?');
5941
- if (ndx === 0) {
5942
- return Pacem.Utils.URIs.parseQuery(search.substring(ndx + 1));
5943
- }
5944
- return {};
6005
+ return Pacem.Utils.URIs.parseState(tmpl, fullPath, path, query, hash);
5945
6006
  }
5946
6007
  };
5947
6008
  __decorate([