@pacem/pacem-core 1.0.0-abel → 1.0.0-amaldi

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.
@@ -1,3 +1,8 @@
1
+ /*!
2
+ * @pacem/pacem-core v1.0.0-amaldi (https://js.pacem.it)
3
+ * Pacem (https://pacem.it)
4
+ * Licensed under Apache-2.0
5
+ */
1
6
  import { CustomTypedEvent } from './events';
2
7
  export class CurrentIndexChangeEvent extends CustomTypedEvent {
3
8
  constructor(args) {
@@ -1,3 +1,8 @@
1
+ /*!
2
+ * @pacem/pacem-core v1.0.0-amaldi (https://js.pacem.it)
3
+ * Pacem (https://pacem.it)
4
+ * Licensed under Apache-2.0
5
+ */
1
6
  /// <reference path="events.ts" />
2
7
  import { CustomTypedEvent } from './events';
3
8
  //namespace Pacem {
@@ -1,3 +1,8 @@
1
+ /*!
2
+ * @pacem/pacem-core v1.0.0-amaldi (https://js.pacem.it)
3
+ * Pacem (https://pacem.it)
4
+ * Licensed under Apache-2.0
5
+ */
1
6
  import { Utils } from './utils';
2
7
  /**
3
8
  * Default, and essentially ONLY, property comparer for equalitycheck
@@ -1,3 +1,8 @@
1
+ /*!
2
+ * @pacem/pacem-core v1.0.0-amaldi (https://js.pacem.it)
3
+ * Pacem (https://pacem.it)
4
+ * Licensed under Apache-2.0
5
+ */
1
6
  /// <reference path="utils.ts" />
2
7
  import { Utils } from "./utils";
3
8
  import { Point, Size, Rect } from '@pacem/pacem-foundation';
@@ -1,3 +1,8 @@
1
+ /*!
2
+ * @pacem/pacem-core v1.0.0-amaldi (https://js.pacem.it)
3
+ * Pacem (https://pacem.it)
4
+ * Licensed under Apache-2.0
5
+ */
1
6
  import { WATCH_PROPS_VAR, INSTANCE_BINDINGS_VAR, INSTANCE_HOST_VAR } from './types';
2
7
  import { P } from './prefix';
3
8
  import { Utils } from './utils';
@@ -1,3 +1,8 @@
1
+ /*!
2
+ * @pacem/pacem-core v1.0.0-amaldi (https://js.pacem.it)
3
+ * Pacem (https://pacem.it)
4
+ * Licensed under Apache-2.0
5
+ */
1
6
  import { WATCH_PROPS_VAR, INSTANCE_BINDINGS_VAR, INSTANCE_HOST_VAR } from './types';
2
7
  import { P } from './prefix';
3
8
  import { Utils } from './utils';
@@ -344,22 +349,36 @@ export const CustomElement = (config) => {
344
349
  const prop = CustomElementUtils.kebabToCamel(plainAttrName);
345
350
  // when module scripts (esm) are involved you're at risk trying to process bindings too early, causing errors when - for instance - global variables are referenced.
346
351
  // nevertheless, setting moduleProofBindings to `true` prevents early attribute evaluation with startup issues
347
- // let's keep it false (legacy bheavior)
352
+ // let's keep it false (legacy behavior)
348
353
  const moduleProofBindings = false; // TODO: allow to configure
349
354
  if (binding) {
350
355
  let value = CustomElementUtils.parseBindingAttribute(val, _this);
351
356
  if (value instanceof Expression) {
352
- if (value.independent && !moduleProofBindings) {
353
- // constant expression, just assign its value
357
+ const executeRightAway = () => {
354
358
  _this[prop] = value.evaluate();
355
359
  processBinding(_this, prop /* remove eventual old bindings */);
356
- }
357
- else {
360
+ };
361
+ const executeDelayed = () => {
358
362
  var bindings = GET_VAL(_this, INSTANCE_BINDINGS_VAR, []);
359
363
  bindings.push(plainAttrName);
360
364
  if (!value.pending) {
361
365
  processBinding(_this, prop, value);
362
366
  }
367
+ };
368
+ if (value.independent && !moduleProofBindings) {
369
+ try {
370
+ // constant expression, just assign its value
371
+ executeRightAway();
372
+ }
373
+ catch (e) {
374
+ // there might be problems between loading and execution of the code
375
+ // let's give it another chance
376
+ console.warn(`Error occurred in early binding evaluation:\n${val}\n${e.message ?? e}`);
377
+ executeDelayed();
378
+ }
379
+ }
380
+ else {
381
+ executeDelayed();
363
382
  }
364
383
  }
365
384
  else {
@@ -1,3 +1,8 @@
1
+ /*!
2
+ * @pacem/pacem-core v1.0.0-amaldi (https://js.pacem.it)
3
+ * Pacem (https://pacem.it)
4
+ * Licensed under Apache-2.0
5
+ */
1
6
  //namespace Pacem {
2
7
  export const Defaults = {
3
8
  USE_SHADOW_ROOT: /*'attachShadow' in Element.prototype &&*/ false /* <- wait until html-imports */
@@ -1,3 +1,8 @@
1
+ /*!
2
+ * @pacem/pacem-core v1.0.0-amaldi (https://js.pacem.it)
3
+ * Pacem (https://pacem.it)
4
+ * Licensed under Apache-2.0
5
+ */
1
6
  /// <reference path="utils-customevent.ts" />
2
7
  import { Utils } from './utils';
3
8
  import { CustomEventUtils } from './utils-customevent';
@@ -1,3 +1,8 @@
1
+ /*!
2
+ * @pacem/pacem-core v1.0.0-amaldi (https://js.pacem.it)
3
+ * Pacem (https://pacem.it)
4
+ * Licensed under Apache-2.0
5
+ */
1
6
  /// <reference path="converters.ts" />
2
7
  /// <reference path="decorators.ts" />
3
8
  /// <reference path="logger.ts" />
@@ -1,3 +1,8 @@
1
+ /*!
2
+ * @pacem/pacem-core v1.0.0-amaldi (https://js.pacem.it)
3
+ * Pacem (https://pacem.it)
4
+ * Licensed under Apache-2.0
5
+ */
1
6
  /// <reference path="types.ts" />
2
7
  /// <reference path="utils.ts" />
3
8
  /// <reference path="utils-customelement.ts" />
@@ -1 +1,6 @@
1
+ /*!
2
+ * @pacem/pacem-core v1.0.0-amaldi (https://js.pacem.it)
3
+ * Pacem (https://pacem.it)
4
+ * Licensed under Apache-2.0
5
+ */
1
6
  export * from './animations';
@@ -1 +1,6 @@
1
+ /*!
2
+ * @pacem/pacem-core v1.0.0-amaldi (https://js.pacem.it)
3
+ * Pacem (https://pacem.it)
4
+ * Licensed under Apache-2.0
5
+ */
1
6
  export * from './components/index.behaviors';
@@ -1 +1,6 @@
1
+ /*!
2
+ * @pacem/pacem-core v1.0.0-amaldi (https://js.pacem.it)
3
+ * Pacem (https://pacem.it)
4
+ * Licensed under Apache-2.0
5
+ */
1
6
  export * from './components';
@@ -1,3 +1,8 @@
1
+ /*!
2
+ * @pacem/pacem-core v1.0.0-amaldi (https://js.pacem.it)
3
+ * Pacem (https://pacem.it)
4
+ * Licensed under Apache-2.0
5
+ */
1
6
  import { DeepMerger } from '@pacem/pacem-foundation';
2
7
  import * as Output from './index';
3
8
  DeepMerger.merge(Output);
@@ -1 +1,6 @@
1
+ /*!
2
+ * @pacem/pacem-core v1.0.0-amaldi (https://js.pacem.it)
3
+ * Pacem (https://pacem.it)
4
+ * Licensed under Apache-2.0
5
+ */
1
6
  export * from './logger';
@@ -1 +1,6 @@
1
+ /*!
2
+ * @pacem/pacem-core v1.0.0-amaldi (https://js.pacem.it)
3
+ * Pacem (https://pacem.it)
4
+ * Licensed under Apache-2.0
5
+ */
1
6
  export * from './net';
@@ -1,3 +1,8 @@
1
+ /*!
2
+ * @pacem/pacem-core v1.0.0-amaldi (https://js.pacem.it)
3
+ * Pacem (https://pacem.it)
4
+ * Licensed under Apache-2.0
5
+ */
1
6
  export * from './trees';
2
7
  export * from './utils';
3
8
  export * from './utils-customelement';
@@ -1 +1,6 @@
1
+ /*!
2
+ * @pacem/pacem-core v1.0.0-amaldi (https://js.pacem.it)
3
+ * Pacem (https://pacem.it)
4
+ * Licensed under Apache-2.0
5
+ */
1
6
  export * from './ui';
package/dist/esm/index.js CHANGED
@@ -1,3 +1,8 @@
1
+ /*!
2
+ * @pacem/pacem-core v1.0.0-amaldi (https://js.pacem.it)
3
+ * Pacem (https://pacem.it)
4
+ * Licensed under Apache-2.0
5
+ */
1
6
  export * as Animations from './index-animations';
2
7
  export * as Net from './index-net';
3
8
  export * as UI from './index-ui';
@@ -1,3 +1,8 @@
1
+ /*!
2
+ * @pacem/pacem-core v1.0.0-amaldi (https://js.pacem.it)
3
+ * Pacem (https://pacem.it)
4
+ * Licensed under Apache-2.0
5
+ */
1
6
  //namespace Pacem.Logging {
2
7
  export var LogLevel;
3
8
  (function (LogLevel) {
@@ -1,3 +1,8 @@
1
+ /*!
2
+ * @pacem/pacem-core v1.0.0-amaldi (https://js.pacem.it)
3
+ * Pacem (https://pacem.it)
4
+ * Licensed under Apache-2.0
5
+ */
1
6
  //namespace Pacem {
2
7
  var root;
3
8
  /** the overall customelement prefix */
@@ -1,3 +1,8 @@
1
+ /*!
2
+ * @pacem/pacem-core v1.0.0-amaldi (https://js.pacem.it)
3
+ * Pacem (https://pacem.it)
4
+ * Licensed under Apache-2.0
5
+ */
1
6
  //namespace Pacem {
2
7
  export class DeferPromise {
3
8
  constructor() {
package/dist/esm/regex.js CHANGED
@@ -1,3 +1,8 @@
1
+ /*!
2
+ * @pacem/pacem-core v1.0.0-amaldi (https://js.pacem.it)
3
+ * Pacem (https://pacem.it)
4
+ * Licensed under Apache-2.0
5
+ */
1
6
  //namespace Pacem.RegularExpressions {
2
7
  export const EMPTY_MATCHER = /a^/;
3
8
  export class Regex {
@@ -1,3 +1,8 @@
1
+ /*!
2
+ * @pacem/pacem-core v1.0.0-amaldi (https://js.pacem.it)
3
+ * Pacem (https://pacem.it)
4
+ * Licensed under Apache-2.0
5
+ */
1
6
  import { Utils } from './utils';
2
7
  //namespace Pacem {
3
8
  const EXPIRATION_FIELD = '_exp';
@@ -1,3 +1,8 @@
1
+ /*!
2
+ * @pacem/pacem-core v1.0.0-amaldi (https://js.pacem.it)
3
+ * Pacem (https://pacem.it)
4
+ * Licensed under Apache-2.0
5
+ */
1
6
  //namespace Pacem {
2
7
  export class TemplateElement extends HTMLElement {
3
8
  }
@@ -1,3 +1,8 @@
1
+ /*!
2
+ * @pacem/pacem-core v1.0.0-amaldi (https://js.pacem.it)
3
+ * Pacem (https://pacem.it)
4
+ * Licensed under Apache-2.0
5
+ */
1
6
  /// <reference path="decorators.ts" />
2
7
  //namespace Pacem {
3
8
  var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
package/dist/esm/types.js CHANGED
@@ -1,3 +1,8 @@
1
+ /*!
2
+ * @pacem/pacem-core v1.0.0-amaldi (https://js.pacem.it)
3
+ * Pacem (https://pacem.it)
4
+ * Licensed under Apache-2.0
5
+ */
1
6
  /// <reference path="events.ts" />
2
7
  export const Type = Function;
3
8
  ;
@@ -1,3 +1,8 @@
1
+ /*!
2
+ * @pacem/pacem-core v1.0.0-amaldi (https://js.pacem.it)
3
+ * Pacem (https://pacem.it)
4
+ * Licensed under Apache-2.0
5
+ */
1
6
  /// <reference path="expression.ts" />
2
7
  /// <reference path="promise.ts" />
3
8
  /// <reference path="prefix.ts" />
@@ -1,3 +1,8 @@
1
+ /*!
2
+ * @pacem/pacem-core v1.0.0-amaldi (https://js.pacem.it)
3
+ * Pacem (https://pacem.it)
4
+ * Licensed under Apache-2.0
5
+ */
1
6
  import { Utils } from './utils';
2
7
  export var EventKeyModifier;
3
8
  (function (EventKeyModifier) {
package/dist/esm/utils.js CHANGED
@@ -1,3 +1,8 @@
1
+ /*!
2
+ * @pacem/pacem-core v1.0.0-amaldi (https://js.pacem.it)
3
+ * Pacem (https://pacem.it)
4
+ * Licensed under Apache-2.0
5
+ */
1
6
  import { Keys, Dates, Colors, Strings, Blobs, Imaging, NullChecker, detect } from '@pacem/pacem-foundation';
2
7
  import { Json } from './trees/json';
3
8
  import { DeepCloner } from './trees/deepcloner';
package/package.json CHANGED
@@ -23,7 +23,7 @@
23
23
  "types": "./typings/index.d.ts"
24
24
  }
25
25
  },
26
- "version": "1.0.0-abel",
26
+ "version": "1.0.0-amaldi",
27
27
  "author": {
28
28
  "name": "Pacem",
29
29
  "url": "https://pacem.it"