@pacem/pacem-ui 2.0.0-cauchy → 2.0.0-davinci

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 (54) hide show
  1. package/dist/browser/pacem-ui.js +57 -10
  2. package/dist/browser/pacem-ui.js.map +1 -1
  3. package/dist/browser/pacem-ui.min.js +2 -2
  4. package/dist/bundle/pacem-ui.min.mjs +39 -38
  5. package/dist/bundle/pacem-ui.mjs +73 -27
  6. package/dist/bundle/pacem-ui.mjs.map +3 -3
  7. package/dist/docs/pacem-ui.json +1 -1
  8. package/dist/esm/adapter.js +1 -1
  9. package/dist/esm/anchor.js +3 -2
  10. package/dist/esm/balloon.js +5 -1
  11. package/dist/esm/binder.js +1 -1
  12. package/dist/esm/blade.js +1 -1
  13. package/dist/esm/bottom-sheet.js +2 -2
  14. package/dist/esm/button.js +3 -2
  15. package/dist/esm/buttonset.js +1 -1
  16. package/dist/esm/calendar.js +1 -1
  17. package/dist/esm/collapse.js +1 -1
  18. package/dist/esm/dialog-abstractions.js +1 -1
  19. package/dist/esm/dialog.js +1 -1
  20. package/dist/esm/divider.js +1 -1
  21. package/dist/esm/icon.js +1 -1
  22. package/dist/esm/image.js +1 -1
  23. package/dist/esm/index-components-ui.js +1 -1
  24. package/dist/esm/index-components.js +1 -1
  25. package/dist/esm/index-iife.js +1 -1
  26. package/dist/esm/index.js +1 -1
  27. package/dist/esm/infinite-scroller.js +1 -1
  28. package/dist/esm/iterative.js +1 -1
  29. package/dist/esm/lightbox-abstractions.js +1 -1
  30. package/dist/esm/lightbox.js +2 -2
  31. package/dist/esm/loader.js +2 -2
  32. package/dist/esm/markdown-svc.js +23 -3
  33. package/dist/esm/markdown.js +1 -1
  34. package/dist/esm/marquee.js +1 -1
  35. package/dist/esm/media-query.js +1 -1
  36. package/dist/esm/menu.js +1 -1
  37. package/dist/esm/pager.js +1 -1
  38. package/dist/esm/picture.js +1 -1
  39. package/dist/esm/progressbar.js +5 -2
  40. package/dist/esm/sidebar.js +5 -2
  41. package/dist/esm/slideshow.js +1 -1
  42. package/dist/esm/social-twitter.js +1 -1
  43. package/dist/esm/sticky-header.js +1 -1
  44. package/dist/esm/tabs.js +1 -1
  45. package/dist/esm/ticker.js +1 -1
  46. package/dist/esm/toast.js +3 -2
  47. package/dist/esm/toc.js +1 -1
  48. package/dist/esm/tuner.js +1 -1
  49. package/dist/esm/types.js +1 -1
  50. package/dist/esm/vibration.js +1 -1
  51. package/dist/esm/view.js +15 -1
  52. package/dist/esm/window.js +1 -1
  53. package/package.json +1 -1
  54. package/typings/index.d.ts +7 -1
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @pacem/pacem-ui v2.0.0-cauchy (https://js.pacem.it)
2
+ * @pacem/pacem-ui v2.0.0-davinci (https://js.pacem.it)
3
3
  * Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -506,7 +506,8 @@
506
506
  ], PacemAnchorElement.prototype, "router", void 0);
507
507
  PacemAnchorElement = __decorate$A([
508
508
  pacemCore.CustomElement({
509
- tagName: pacemCore.P + '-a'
509
+ tagName: pacemCore.P + '-a',
510
+ modifiers: ['hoverable', 'focusable', 'pressable']
510
511
  })
511
512
  ], PacemAnchorElement);
512
513
 
@@ -1080,6 +1081,9 @@
1080
1081
  }
1081
1082
  }
1082
1083
  };
1084
+ __decorate$z([
1085
+ pacemCore.ViewChild(`.${pacemCore.PCSS}-balloon-face`, true, false)
1086
+ ], PacemBalloonElement.prototype, "_face", void 0);
1083
1087
  __decorate$z([
1084
1088
  pacemCore.ViewChild(`.${pacemCore.PCSS}-balloon`)
1085
1089
  ], PacemBalloonElement.prototype, "_container", void 0);
@@ -1100,6 +1104,7 @@
1100
1104
  tagName: pacemCore.P + '-balloon',
1101
1105
  shadow: true,
1102
1106
  template: `<${pacemCore.P}-resize target="{{ :host.target }}" disabled="true" watch-position="true" on-${pacemCore.Components.ResizeEventName}=":host._onLayoutChange($event)"></${pacemCore.P}-resize>
1107
+ <div class="${pacemCore.PCSS}-balloon-face"></div>
1103
1108
  <div class="${pacemCore.PCSS}-balloon"><${pacemCore.P}-resize on-${pacemCore.Components.ResizeEventName}=":host._onLayoutChange($event)" disabled="true" content><slot></slot></${pacemCore.P}-resize></div>
1104
1109
  <div class="corner top-left" part="corner-topleft"></div><div class="corner bottom-left" part="corner-bottomleft"></div><div class="corner top-right" part="corner-topright"></div><div class="corner bottom-right" part="corner-bottomright"></div>`
1105
1110
  })
@@ -2165,7 +2170,7 @@
2165
2170
  pacemCore.ViewChild(pacemCore.P + '-resize[handle]')
2166
2171
  ], PacemBottomSheetElement.prototype, "_handleResizer", void 0);
2167
2172
  __decorate$w([
2168
- pacemCore.ViewChild(pacemCore.P + '-panel.bottom-sheet')
2173
+ pacemCore.ViewChild(pacemCore.P + '-panel.bottom-sheet', true)
2169
2174
  ], PacemBottomSheetElement.prototype, "_sheet", void 0);
2170
2175
  __decorate$w([
2171
2176
  pacemCore.Watch({ emit: false, converter: pacemCore.PropertyConverters.Boolean })
@@ -2357,7 +2362,8 @@
2357
2362
  ], PacemButtonElement.prototype, "confirmationDialog", void 0);
2358
2363
  PacemButtonElement = __decorate$u([
2359
2364
  pacemCore.CustomElement({
2360
- tagName: pacemCore.P + '-button'
2365
+ tagName: pacemCore.P + '-button',
2366
+ modifiers: ['hoverable', 'focusable', 'clickable']
2361
2367
  })
2362
2368
  ], PacemButtonElement);
2363
2369
  //}
@@ -3908,7 +3914,7 @@ css-class="{{ ['hour-start-'+ (^item.hour + 1), 'hour-end-'+ (^item.hour + ^item
3908
3914
  pacemCore.ViewChild('.' + pacemCore.PCSS + '-lightbox-wrapper')
3909
3915
  ], PacemLightboxElement.prototype, "_wrapperElement", void 0);
3910
3916
  __decorate$k([
3911
- pacemCore.ViewChild('.' + pacemCore.PCSS + '-lightbox')
3917
+ pacemCore.ViewChild('.' + pacemCore.PCSS + '-lightbox', true)
3912
3918
  ], PacemLightboxElement.prototype, "_container", void 0);
3913
3919
  __decorate$k([
3914
3920
  pacemCore.ViewChild('slot[name=close]')
@@ -4006,7 +4012,7 @@ css-class="{{ ['hour-start-'+ (^item.hour + 1), 'hour-end-'+ (^item.hour + ^item
4006
4012
  }
4007
4013
  };
4008
4014
  __decorate$j([
4009
- pacemCore.ViewChild('div.' + pacemCore.PCSS + '-spinner')
4015
+ pacemCore.ViewChild('div.' + pacemCore.PCSS + '-spinner', true)
4010
4016
  ], PacemLoaderElement.prototype, "_spinner", void 0);
4011
4017
  __decorate$j([
4012
4018
  pacemCore.ViewChild('div.' + pacemCore.PCSS + '-loader')
@@ -4067,6 +4073,22 @@ css-class="{{ ['hour-start-'+ (^item.hour + 1), 'hour-end-'+ (^item.hour + ^item
4067
4073
  },
4068
4074
  type: 'inline'
4069
4075
  };
4076
+ // routed link: {route}(#router0:/{culture}/pages/next "Next Page"), the router's selector, then the href (formatted by
4077
+ // the router's state), then the optional text (the href when missing)
4078
+ const ANCHOR_RULE = {
4079
+ rule: {
4080
+ exec: (input) => {
4081
+ const arr = /\{route\}\(([^:\s)]+):([^\s")]+)(?:\s+"([^"]*)")?\)/.exec(input);
4082
+ if (arr && arr.length > 2) {
4083
+ return [{
4084
+ type: 'route', raw: arr[0], text: arr[3] || arr[2], index: arr.index, router: arr[1], href: arr[2]
4085
+ }];
4086
+ }
4087
+ return null;
4088
+ }
4089
+ },
4090
+ type: 'inline'
4091
+ };
4070
4092
  const RULES_TO_HTML = (token) => {
4071
4093
  switch (token.type) {
4072
4094
  case 'youtube':
@@ -4075,17 +4097,21 @@ css-class="{{ ['hour-start-'+ (^item.hour + 1), 'hour-end-'+ (^item.hour + ^item
4075
4097
  case 'tweet':
4076
4098
  return `<!-- twitter embed -->
4077
4099
  <${pacemCore.P}-tweetembed tweetid="${token.text}"></${pacemCore.P}-tweetembed>`;
4100
+ case 'route':
4101
+ return `<${pacemCore.P}-a href="${token['href']}" router="${token['router']}">${token.text}</${pacemCore.P}-a>`;
4078
4102
  }
4079
4103
  };
4080
4104
  /**
4081
- * Parses Markdown into HTML, extended with Pacem-specific inline embeds (`{tweet}(id)`, `{yt}(id)`).
4105
+ * Parses Markdown into HTML, extended with Pacem-specific inline embeds (`{tweet}(id)`, `{yt}(id)`) and routed links
4106
+ * (`{route}(#router0:/path "text")`).
4082
4107
  * Fenced code blocks are highlighted by the language-agnostic `Compile.Scanner`, for every language registered in
4083
4108
  * `Compile.Syntaxes` (built-in: javascript/typescript, html/xml, c#, c/c++, json; more can be registered at runtime).
4084
4109
  */
4085
4110
  class MarkdownService {
4086
4111
  #grammar = [
4087
4112
  TWITTER_RULE,
4088
- YOUTUBE_RULE
4113
+ YOUTUBE_RULE,
4114
+ ANCHOR_RULE
4089
4115
  ];
4090
4116
  #md = new pacemFoundation.Compile.Markdown.Parser();
4091
4117
  _escape(md) {
@@ -4791,7 +4817,10 @@ css-class="{{ ['hour-start-'+ (^item.hour + 1), 'hour-end-'+ (^item.hour + ^item
4791
4817
  }
4792
4818
  };
4793
4819
  __decorate$c([
4794
- pacemCore.ViewChild('.progressbar-bar')
4820
+ pacemCore.ViewChild('.progressbar-track', true, false)
4821
+ ], PacemProgressbarElement.prototype, "_face", void 0);
4822
+ __decorate$c([
4823
+ pacemCore.ViewChild('.progressbar-bar', false, true)
4795
4824
  ], PacemProgressbarElement.prototype, "_bar", void 0);
4796
4825
  __decorate$c([
4797
4826
  pacemCore.ViewChild('.progressbar-glow')
@@ -4861,6 +4890,9 @@ css-class="{{ ['hour-start-'+ (^item.hour + 1), 'hour-end-'+ (^item.hour + ^item
4861
4890
  this.#shell = pacemCore.CustomElementUtils.findAncestorShell(this);
4862
4891
  }
4863
4892
  };
4893
+ __decorate$b([
4894
+ pacemCore.ViewChild('.sidebar-drawer', true)
4895
+ ], PacemSidebarElement.prototype, "_drawer", void 0);
4864
4896
  __decorate$b([
4865
4897
  pacemCore.Watch({ converter: pacemCore.PropertyConverters.Boolean })
4866
4898
  ], PacemSidebarElement.prototype, "open", void 0);
@@ -5500,7 +5532,8 @@ css-class="{{ ['hour-start-'+ (^item.hour + 1), 'hour-end-'+ (^item.hour + ^item
5500
5532
  ], PacemToastElement, "toast2", null);
5501
5533
  PacemToastElement = PacemToastElement_1 = __decorate$5([
5502
5534
  pacemCore.CustomElement({
5503
- tagName: pacemCore.P + '-toast'
5535
+ tagName: pacemCore.P + '-toast',
5536
+ modifiers: ['clickable']
5504
5537
  })
5505
5538
  ], PacemToastElement);
5506
5539
 
@@ -5934,6 +5967,8 @@ css-class="{{ ['hour-start-'+ (^item.hour + 1), 'hour-end-'+ (^item.hour + ^item
5934
5967
  let PacemViewElement = class PacemViewElement extends pacemCore.PacemEventTarget {
5935
5968
  constructor() {
5936
5969
  super(...arguments);
5970
+ /** Bumped by every new content: a pending `render` dispatch from superseded content is dropped. */
5971
+ this.#renderVersion = 0;
5937
5972
  this._templateChangeHandler = (evt) => {
5938
5973
  const tmplProxy = evt.target;
5939
5974
  this._setTmpl(tmplProxy.target);
@@ -5951,6 +5986,8 @@ css-class="{{ ['hour-start-'+ (^item.hour + 1), 'hour-end-'+ (^item.hour + ^item
5951
5986
  }, 100 /* tenth of a second limit */);
5952
5987
  };
5953
5988
  }
5989
+ /** Bumped by every new content: a pending `render` dispatch from superseded content is dropped. */
5990
+ #renderVersion;
5954
5991
  propertyChangedCallback(name, old, val, first) {
5955
5992
  super.propertyChangedCallback(name, old, val, first);
5956
5993
  // url
@@ -6015,6 +6052,7 @@ css-class="{{ ['hour-start-'+ (^item.hour + 1), 'hour-end-'+ (^item.hour + ^item
6015
6052
  }
6016
6053
  _setTmpl(tmpl) {
6017
6054
  cancelAnimationFrame(this._renderHandle);
6055
+ this.#renderVersion++;
6018
6056
  // this way, `this._container.innerHTML = ''` instruction will eventually let the page "scroll up"...
6019
6057
  this.innerHTML = '';
6020
6058
  this._dispatchPrerender();
@@ -6087,6 +6125,7 @@ css-class="{{ ['hour-start-'+ (^item.hour + 1), 'hour-end-'+ (^item.hour + ^item
6087
6125
  _manageResult(result) {
6088
6126
  // this way, `this._container.innerHTML = ''` instruction will eventually let the page "scroll up"...
6089
6127
  cancelAnimationFrame(this._renderHandle);
6128
+ const version = ++this.#renderVersion;
6090
6129
  this.scrollTo({ top: 0, left: 0, behavior: 'instant' });
6091
6130
  this.innerHTML = '';
6092
6131
  this._dispatchPrerender();
@@ -6097,12 +6136,20 @@ css-class="{{ ['hour-start-'+ (^item.hour + 1), 'hour-end-'+ (^item.hour + ^item
6097
6136
  // setting fetching to `false` triggers a css class change that could/should cause a css transition to happen
6098
6137
  // TODO: manage to switch to native in a near future (https://developer.mozilla.org/en-US/docs/Web/API/View_Transitions_API or https://youtu.be/oDcb3fvtETs)
6099
6138
  pacemCore.Utils.addAnimationEndCallback(this, () => {
6139
+ if (version !== this.#renderVersion) {
6140
+ return;
6141
+ }
6100
6142
  this._dispatchRender();
6101
6143
  }, ANIM_TIMEOUT);
6102
6144
  });
6103
6145
  }
6104
6146
  #resizeHandle;
6105
6147
  _dispatchRender() {
6148
+ // the view might have been removed meanwhile (e.g. a nested view whose container got re-rendered):
6149
+ // no shell to host the resizer, nothing to notify.
6150
+ if (!this.isConnected) {
6151
+ return;
6152
+ }
6106
6153
  const resizer = new pacemCore.Components.PacemResizeElement();
6107
6154
  resizer.target = this;
6108
6155
  resizer.addEventListener(pacemCore.Components.ResizeEventName, this._debounceDispatchHandler);