@pacem/pacem-fx 1.0.0-bessel → 1.0.0-binet

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/esm/fancy.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @pacem/pacem-fx v1.0.0-bessel (https://js.pacem.it)
2
+ * @pacem/pacem-fx v1.0.0-binet (https://js.pacem.it)
3
3
  * Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -15,15 +15,18 @@ import { PacemFxElement } from './types';
15
15
  const FANCY_CSS = PCSS + "-fancy";
16
16
  const FANCIFY_CSS = PCSS + "-fancify";
17
17
  const DEFAULT_GAP = 20;
18
+ /** Reveals the `target` element's text content word by word, wrapping each word in an animated `<span>`. */
18
19
  let PacemFxFancyElement = class PacemFxFancyElement extends PacemFxElement {
19
20
  constructor() {
20
21
  super(...arguments);
21
22
  this._progress = .0;
22
23
  this._started = false;
23
24
  }
25
+ /** @readonly Gets the current show progress, as a number between `0` and `1`. */
24
26
  get progress() {
25
27
  return this._progress;
26
28
  }
29
+ /** @readonly Gets whether the fancify animation has (fully) started. */
27
30
  get started() {
28
31
  return this._started;
29
32
  }
@@ -72,6 +75,7 @@ let PacemFxFancyElement = class PacemFxFancyElement extends PacemFxElement {
72
75
  }
73
76
  this._textNodes = a;
74
77
  }
78
+ /** Starts (or restarts) the fancify effect on the `target` element. */
75
79
  start() {
76
80
  if (!this.disabled) {
77
81
  this._reset();
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @pacem/pacem-fx v1.0.0-bessel (https://js.pacem.it)
2
+ * @pacem/pacem-fx v1.0.0-binet (https://js.pacem.it)
3
3
  * Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -31,6 +31,7 @@ const SizeOrNumberConverter = {
31
31
  function pctFormatter(v) {
32
32
  return Math.round(v * 1000) / 10 + '%';
33
33
  }
34
+ /** A single color stop within a `PacemFxGradientItemElement` (radial or linear gradient). */
34
35
  let PacemFxGradientStopElement = class PacemFxGradientStopElement extends Components.PacemItemElement {
35
36
  findContainer() {
36
37
  return CustomElementUtils.findAncestor(this, i => i instanceof PacemFxGradientItemElement);
@@ -55,6 +56,7 @@ PacemFxGradientStopElement = __decorate([
55
56
  CustomElement({ tagName: P + '-fx-gradient-stop' })
56
57
  ], PacemFxGradientStopElement);
57
58
  export { PacemFxGradientStopElement };
59
+ /** Base class for gradient-shape elements (radial, linear, ...) hosting `PacemFxGradientStopElement` color stops and producing a CSS gradient string. */
58
60
  export class PacemFxGradientItemElement extends Components.PacemCrossItemsContainerElement {
59
61
  constructor() {
60
62
  super(...arguments);
@@ -88,6 +90,7 @@ export class PacemFxGradientItemElement extends Components.PacemCrossItemsContai
88
90
  _dispatchGradientChange() {
89
91
  this.dispatchEvent(new GradientChangeEvent());
90
92
  }
93
+ /** Builds the CSS color for a stop, applying the given opacity (if in the `0`-`1` range) on top of the base `color`. */
91
94
  buildColor(color, opacity) {
92
95
  if (opacity >= 0 && opacity <= 1) {
93
96
  const clr = Colors.parse(color);
@@ -96,6 +99,7 @@ export class PacemFxGradientItemElement extends Components.PacemCrossItemsContai
96
99
  return color;
97
100
  }
98
101
  }
102
+ /** Radial `<gradient>` shape, hosting one or more `PacemFxGradientStopElement` color stops. */
99
103
  let PacemFxRadialGradientElement = class PacemFxRadialGradientElement extends PacemFxGradientItemElement {
100
104
  doesPropertyTriggerGradientChange(prop) {
101
105
  return ['shape', 'size', 'center', 'items', 'hide', 'disabled'].indexOf(prop) >= 0;
@@ -141,6 +145,7 @@ PacemFxRadialGradientElement = __decorate([
141
145
  CustomElement({ tagName: P + '-fx-gradient-radial' })
142
146
  ], PacemFxRadialGradientElement);
143
147
  export { PacemFxRadialGradientElement };
148
+ /** Linear `<gradient>` shape, hosting one or more `PacemFxGradientStopElement` color stops. */
144
149
  let PacemFxLinearGradientElement = class PacemFxLinearGradientElement extends PacemFxGradientItemElement {
145
150
  doesPropertyTriggerGradientChange(prop) {
146
151
  return ['angle', 'items', 'hide', 'disabled'].indexOf(prop) >= 0;
@@ -169,6 +174,7 @@ PacemFxLinearGradientElement = __decorate([
169
174
  CustomElement({ tagName: P + '-fx-gradient-linear' })
170
175
  ], PacemFxLinearGradientElement);
171
176
  export { PacemFxLinearGradientElement };
177
+ /** Applies a combined CSS gradient (built from its `PacemFxGradientItemElement` children) as the `target` element's background fill or text color. */
172
178
  let PacemFxGradientElement = class PacemFxGradientElement extends Components.PacemItemsContainerElement {
173
179
  constructor() {
174
180
  super(...arguments);
package/dist/esm/hero.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @pacem/pacem-fx v1.0.0-bessel (https://js.pacem.it)
2
+ * @pacem/pacem-fx v1.0.0-binet (https://js.pacem.it)
3
3
  * Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -25,6 +25,7 @@ const rectOrElementConverter = {
25
25
  return PropertyConverters.Json.convert(attr);
26
26
  }
27
27
  };
28
+ /** Animates the `target` element (position and size) between a `from` and a `to` state, "hero"-transition style. */
28
29
  let PacemFxHeroElement = class PacemFxHeroElement extends PacemFxElement {
29
30
  propertyChangedCallback(name, old, val, first) {
30
31
  super.propertyChangedCallback(name, old, val, first);
@@ -82,6 +83,7 @@ let PacemFxHeroElement = class PacemFxHeroElement extends PacemFxElement {
82
83
  }
83
84
  Utils.removeClass(tget, HERO_CSS);
84
85
  }
86
+ /** Reverts the `target` element back to its original (`from`) state and returns a promise resolved once the transition completes. */
85
87
  reset() {
86
88
  //
87
89
  if (Utils.isNull(this._originalState) || Utils.isNull(this._targetState)) {
@@ -93,6 +95,7 @@ let PacemFxHeroElement = class PacemFxHeroElement extends PacemFxElement {
93
95
  this.dispatchEvent(new Event(HERO_OUT));
94
96
  });
95
97
  }
98
+ /** Starts the hero transition to the `to` state and returns a promise resolved once it completes. */
96
99
  start() {
97
100
  if (!this.disabled && !Utils.isNull(this.target)) {
98
101
  let goal;
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @pacem/pacem-fx v1.0.0-bessel (https://js.pacem.it)
2
+ * @pacem/pacem-fx v1.0.0-binet (https://js.pacem.it)
3
3
  * Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @pacem/pacem-fx v1.0.0-bessel (https://js.pacem.it)
2
+ * @pacem/pacem-fx v1.0.0-binet (https://js.pacem.it)
3
3
  * Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @pacem/pacem-fx v1.0.0-bessel (https://js.pacem.it)
2
+ * @pacem/pacem-fx v1.0.0-binet (https://js.pacem.it)
3
3
  * Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
package/dist/esm/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @pacem/pacem-fx v1.0.0-bessel (https://js.pacem.it)
2
+ * @pacem/pacem-fx v1.0.0-binet (https://js.pacem.it)
3
3
  * Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
package/dist/esm/list.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @pacem/pacem-fx v1.0.0-bessel (https://js.pacem.it)
2
+ * @pacem/pacem-fx v1.0.0-binet (https://js.pacem.it)
3
3
  * Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -13,6 +13,7 @@ import { CustomElement, P, PCSS, Utils } from '@pacem/pacem-core';
13
13
  import { PacemFxElement } from './types';
14
14
  //namespace Pacem.Components.Fx {
15
15
  const CSS_CLASS = PCSS + '-fx-list';
16
+ /** Watches the `target` element's children and dispatches `itemadded`/`itemremoved` events as they are mutated, styling the target as an fx list. */
16
17
  let PacemFxListElement = class PacemFxListElement extends PacemFxElement {
17
18
  constructor() {
18
19
  super(...arguments);
package/dist/esm/pulse.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @pacem/pacem-fx v1.0.0-bessel (https://js.pacem.it)
2
+ * @pacem/pacem-fx v1.0.0-binet (https://js.pacem.it)
3
3
  * Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -46,6 +46,7 @@ function ensureCssAnimation(id, args, rx = '0', ry = rx) {
46
46
  }
47
47
  return css;
48
48
  }
49
+ /** Overlays the `target` element with a pulsing (expanding, fading) outline, tracking its position and size. */
49
50
  let PacemFxPulseElement = class PacemFxPulseElement extends PacemFxElement {
50
51
  constructor() {
51
52
  super();
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @pacem/pacem-fx v1.0.0-bessel (https://js.pacem.it)
2
+ * @pacem/pacem-fx v1.0.0-binet (https://js.pacem.it)
3
3
  * Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -14,6 +14,7 @@ import { Point } from '@pacem/pacem-foundation';
14
14
  import { PacemFxElement } from './types';
15
15
  //namespace Pacem.Components.Fx {
16
16
  const RIPPLE_CSS = "ripple";
17
+ /** Produces a Material-style ripple wave, centered on the pointer, on the `target` element's `mousedown`/`touchstart`. */
17
18
  let PacemFxRippleElement = class PacemFxRippleElement extends PacemFxElement {
18
19
  constructor() {
19
20
  super(...arguments);
package/dist/esm/types.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @pacem/pacem-fx v1.0.0-bessel (https://js.pacem.it)
2
+ * @pacem/pacem-fx v1.0.0-binet (https://js.pacem.it)
3
3
  * Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -10,6 +10,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
10
10
  return c > 3 && r && Object.defineProperty(target, key, r), r;
11
11
  };
12
12
  import { Watch, PropertyConverters, PacemEventTarget } from '@pacem/pacem-core';
13
+ /** Base class for `fx` (visual-effect) custom elements: provides the `target` element the effect operates on. */
13
14
  export class PacemFxElement extends PacemEventTarget {
14
15
  }
15
16
  __decorate([
package/package.json CHANGED
@@ -4,6 +4,7 @@
4
4
  "dist/browser/*.*",
5
5
  "dist/bundle/*.*",
6
6
  "dist/esm/*.*",
7
+ "dist/docs/*.*",
7
8
  "typings/*.*",
8
9
  "README.md",
9
10
  "LICENSE",
@@ -24,7 +25,7 @@
24
25
  "types": "./typings/index.d.ts"
25
26
  }
26
27
  },
27
- "version": "1.0.0-bessel",
28
+ "version": "1.0.0-binet",
28
29
  "author": {
29
30
  "name": "Pacem",
30
31
  "url": "https://pacem.it"
@@ -27,14 +27,18 @@ export declare namespace Fx {
27
27
  }
28
28
  }
29
29
 
30
+ /** Contract implemented by every `fx` element: exposes the `target` element the visual effect is applied to. */
30
31
  declare interface PacemFx {
31
32
  target: HTMLElement;
32
33
  }
33
34
 
35
+ /** Base class for `fx` (visual-effect) custom elements: provides the `target` element the effect operates on. */
34
36
  declare abstract class PacemFxElement extends PacemEventTarget implements PacemFx {
37
+ /** Gets or sets the element the visual effect is applied to. */
35
38
  target: HTMLElement;
36
39
  }
37
40
 
41
+ /** Reveals the `target` element's text content word by word, wrapping each word in an animated `<span>`. */
38
42
  declare class PacemFxFancyElement extends PacemFxElement {
39
43
  private _textNodes;
40
44
  private _originalContent;
@@ -42,23 +46,32 @@ declare class PacemFxFancyElement extends PacemFxElement {
42
46
  private _handle1;
43
47
  private _progress;
44
48
  private _started;
49
+ /** @readonly Gets the current show progress, as a number between `0` and `1`. */
45
50
  get progress(): number;
51
+ /** @readonly Gets whether the fancify animation has (fully) started. */
46
52
  get started(): boolean;
53
+ /** Gets or sets whether the `target` element's text should be fancified; toggling it on starts the effect, off resets it. */
47
54
  fancify: boolean;
55
+ /** Gets or sets the delay, in milliseconds, before the first word is revealed. */
48
56
  delay: number;
57
+ /** Gets or sets the delay, in milliseconds, between the reveal of consecutive words. */
49
58
  gap: number;
50
59
  propertyChangedCallback(name: string, old: any, val: any, first?: boolean): void;
51
60
  viewActivatedCallback(): void;
52
61
  disconnectedCallback(): void;
53
62
  private _reset;
54
63
  private _parse;
64
+ /** Starts (or restarts) the fancify effect on the `target` element. */
55
65
  start(): void;
56
66
  private _startShow;
57
67
  private _fancify;
58
68
  }
59
69
 
70
+ /** Applies a combined CSS gradient (built from its `PacemFxGradientItemElement` children) as the `target` element's background fill or text color. */
60
71
  declare class PacemFxGradientElement extends Components_2.PacemItemsContainerElement<PacemFxGradientItemElement> implements PacemFx {
72
+ /** Gets or sets the element the gradient is applied to. */
61
73
  target: HTMLElement;
74
+ /** Gets or sets whether the gradient is applied as a `'fill'` background (default) or as `'text'` color. */
62
75
  mode: 'fill' | 'text';
63
76
  validate(item: PacemFxGradientItemElement): boolean;
64
77
  register(item: PacemFxGradientItemElement): boolean;
@@ -70,6 +83,7 @@ declare class PacemFxGradientElement extends Components_2.PacemItemsContainerEle
70
83
  private _buildGradient;
71
84
  }
72
85
 
86
+ /** Base class for gradient-shape elements (radial, linear, ...) hosting `PacemFxGradientStopElement` color stops and producing a CSS gradient string. */
73
87
  declare abstract class PacemFxGradientItemElement extends Components_2.PacemCrossItemsContainerElement<PacemFxGradientStopElement> {
74
88
  validate(item: PacemFxGradientStopElement): boolean;
75
89
  register(item: PacemFxGradientStopElement): boolean;
@@ -77,23 +91,35 @@ declare abstract class PacemFxGradientItemElement extends Components_2.PacemCros
77
91
  propertyChangedCallback(name: string, old: any, val: any, first?: boolean): void;
78
92
  private _dispatchGradientChangeHandler;
79
93
  private _dispatchGradientChange;
94
+ /** Gets whether a change of the given property must trigger a gradient rebuild. */
80
95
  protected abstract doesPropertyTriggerGradientChange(prop: string): boolean;
96
+ /** Builds the CSS color for a stop, applying the given opacity (if in the `0`-`1` range) on top of the base `color`. */
81
97
  protected buildColor(color: string, opacity?: number): string;
98
+ /** Builds the CSS `<gradient>` function (e.g. `radial-gradient(...)`) representing this element's current state. */
82
99
  abstract buildGradient(): string;
83
100
  }
84
101
 
102
+ /** A single color stop within a `PacemFxGradientItemElement` (radial or linear gradient). */
85
103
  declare class PacemFxGradientStopElement extends Components_2.PacemItemElement {
104
+ /** Gets or sets the stop position, normalized between `0` and `1`. */
86
105
  offset: number;
106
+ /** Gets or sets the stop color (any valid CSS color). */
87
107
  color: string;
108
+ /** Gets or sets the stop opacity, between `0` and `1`. */
88
109
  opacity: number;
89
110
  findContainer(): any;
90
111
  propertyChangedCallback(name: string, old: any, val: any, first?: boolean): void;
91
112
  }
92
113
 
114
+ /** Animates the `target` element (position and size) between a `from` and a `to` state, "hero"-transition style. */
93
115
  declare class PacemFxHeroElement extends PacemFxElement {
116
+ /** Gets or sets whether the hero transition is active; toggling it on starts the effect, off reverts it. */
94
117
  hero: boolean;
118
+ /** Gets or sets the target state (a `Rect`, or an `Element` whose bounds are used) the `target` element transitions to. */
95
119
  to: Rect | Element;
120
+ /** Gets or sets the starting state (a `Rect`, or an `Element` whose bounds are used); defaults to the `target` element's current bounds. */
96
121
  from: Rect | Element;
122
+ /** Gets or sets the transition duration, in milliseconds. */
97
123
  duration: number;
98
124
  propertyChangedCallback(name: string, old: any, val: any, first?: boolean): void;
99
125
  viewActivatedCallback(): void;
@@ -103,11 +129,14 @@ declare class PacemFxHeroElement extends PacemFxElement {
103
129
  private _originalStyle;
104
130
  private _computeFromState;
105
131
  private _resetTarget;
132
+ /** Reverts the `target` element back to its original (`from`) state and returns a promise resolved once the transition completes. */
106
133
  reset(): Promise<void>;
134
+ /** Starts the hero transition to the `to` state and returns a promise resolved once it completes. */
107
135
  start(): Promise<void>;
108
136
  private _animate;
109
137
  }
110
138
 
139
+ /** Linear `<gradient>` shape, hosting one or more `PacemFxGradientStopElement` color stops. */
111
140
  declare class PacemFxLinearGradientElement extends PacemFxGradientItemElement {
112
141
  /** Angle in degrees. */
113
142
  angle: number;
@@ -115,6 +144,7 @@ declare class PacemFxLinearGradientElement extends PacemFxGradientItemElement {
115
144
  buildGradient(): string;
116
145
  }
117
146
 
147
+ /** Watches the `target` element's children and dispatches `itemadded`/`itemremoved` events as they are mutated, styling the target as an fx list. */
118
148
  declare class PacemFxListElement extends PacemFxElement {
119
149
  private _observer;
120
150
  viewActivatedCallback(): void;
@@ -125,6 +155,7 @@ declare class PacemFxListElement extends PacemFxElement {
125
155
  private _setup;
126
156
  }
127
157
 
158
+ /** Overlays the `target` element with a pulsing (expanding, fading) outline, tracking its position and size. */
128
159
  declare class PacemFxPulseElement extends PacemFxElement {
129
160
  #private;
130
161
  constructor();
@@ -140,6 +171,7 @@ declare class PacemFxPulseElement extends PacemFxElement {
140
171
  private _pulse;
141
172
  }
142
173
 
174
+ /** Radial `<gradient>` shape, hosting one or more `PacemFxGradientStopElement` color stops. */
143
175
  declare class PacemFxRadialGradientElement extends PacemFxGradientItemElement {
144
176
  /** Either 'circle' or 'ellipse' (default). */
145
177
  shape: 'circle' | 'ellipse';
@@ -151,6 +183,7 @@ declare class PacemFxRadialGradientElement extends PacemFxGradientItemElement {
151
183
  buildGradient(): string;
152
184
  }
153
185
 
186
+ /** Produces a Material-style ripple wave, centered on the pointer, on the `target` element's `mousedown`/`touchstart`. */
154
187
  declare class PacemFxRippleElement extends PacemFxElement {
155
188
  private _wave;
156
189
  propertyChangedCallback(name: string, old: any, val: any, first?: boolean): void;