@sepveneto/dao 0.1.0 → 0.1.2

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/dao.js CHANGED
@@ -95,7 +95,7 @@ function uid(n = "default") {
95
95
  }
96
96
  var _TextStyle, TextStyle = class n {
97
97
  constructor(j) {
98
- this.uid = uid("textStyle");
98
+ this.uid = uid("textStyle"), this._tick = 0;
99
99
  let M = {
100
100
  ...n.defaultStyle,
101
101
  ...j
@@ -762,6 +762,13 @@ function findMountedTarget(n) {
762
762
  for (let M = 1; M < n.length && n[M].parent === j; ++M) j = n[M];
763
763
  return j;
764
764
  }
765
+ function clearList(n, j) {
766
+ j || (j = 0);
767
+ for (let M = j; M < n.length && n[M]; ++M) n[M] = null;
768
+ }
769
+ function assignWithIgnore(n, j, M = {}) {
770
+ for (let N in j) !M[N] && j[N] !== void 0 && (n[N] = j[N]);
771
+ }
765
772
  var InstructionSet = class {
766
773
  constructor() {
767
774
  this.instructions = [], this.instructionSize = 0;
@@ -774,7 +781,10 @@ var InstructionSet = class {
774
781
  }
775
782
  }, RenderGroup = class {
776
783
  constructor(n) {
777
- this.worldTransform = new Matrix(), this.localTransform = new Matrix(), this.root = null, this.instructionSet = new InstructionSet(), this.structureDidChange = !0, this.renderGroupParent = null, this.renderGroupChildren = [], this.childrenToUpdate = Object.create(null), this.init(n);
784
+ this.worldTransform = new Matrix(), this.localTransform = new Matrix(), this.root = null, this.instructionSet = new InstructionSet(), this.structureDidChange = !0, this.renderGroupParent = null, this.renderGroupChildren = [], this.childrenToUpdate = Object.create(null), this.childrenRenderablesToUpdate = {
785
+ list: [],
786
+ index: 0
787
+ }, this.init(n);
778
788
  }
779
789
  init(n) {
780
790
  this.root = n;
@@ -801,6 +811,9 @@ var InstructionSet = class {
801
811
  let j = this.renderGroupChildren.indexOf(n);
802
812
  j > -1 && this.renderGroupChildren.splice(j, 1), n.renderGroupParent = null;
803
813
  }
814
+ onChildViewUpdate(n) {
815
+ this.childrenRenderablesToUpdate.list[this.childrenRenderablesToUpdate.index++] = n;
816
+ }
804
817
  onChildUpdate(n) {
805
818
  let j = this.childrenToUpdate[n.relativeRenderGroupDepth];
806
819
  j || (j = this.childrenToUpdate[n.relativeRenderGroupDepth] = {
@@ -808,8 +821,11 @@ var InstructionSet = class {
808
821
  list: []
809
822
  }), j.list[j.index++] = n;
810
823
  }
824
+ updateRenderable(n) {
825
+ n.globalDisplayStatus < 7 || (this.instructionSet.renderPipes[n.renderPipeId].updateRenderable(n), n.didViewUpdate = !1);
826
+ }
811
827
  destroy() {
812
- this.root = null, this.instructionSet = null;
828
+ this.root = null, this.childrenRenderablesToUpdate = null, this.childrenToUpdate = null, this.renderGroupChildren = null, this.instructionSet = null;
813
829
  }
814
830
  };
815
831
  function updateBounds(n, j, M) {
@@ -988,15 +1004,7 @@ const effectMixin = {
988
1004
  getLocalBounds() {
989
1005
  return this._localBounds || (this._localBounds = new Bounds()), getLocalBounds(this, this._localBounds), this._localBounds;
990
1006
  }
991
- };
992
- function clearList(n, j) {
993
- j || (j = 0);
994
- for (let M = j; M < n.length && n[M]; ++M) n[M] = null;
995
- }
996
- function assignWithIgnore(n, j, M = {}) {
997
- for (let N in j) !M[N] && j[N] !== void 0 && (n[N] = j[N]);
998
- }
999
- const childrenHelperMixin = { removeChildren(n = 0, j) {
1007
+ }, childrenHelperMixin = { removeChildren(n = 0, j) {
1000
1008
  let M = j == null ? this.children.length : j, N = M - n, P = [];
1001
1009
  if (N > 0 && N <= M) {
1002
1010
  for (let j = M - 1; j >= n; --j) {
@@ -1020,7 +1028,7 @@ function removeItems(n, j, M) {
1020
1028
  const UPDATE_COLOR = 1, UPDATE_BLEND = 2, UPDATE_VISIBLE = 4, UPDATE_TRANSFORM = 8;
1021
1029
  var defaultSkew = new ObservablePoint(null), defaultOrigin = new ObservablePoint(null), defaultScale = new ObservablePoint(null, 1, 1), defaultPivot = new ObservablePoint(null), Container = class extends eventemitter3_default {
1022
1030
  constructor(n = {}) {
1023
- super(), this.destroyed = !1, this.renderGroup = null, this.parentRenderGroup = null, this.parent = null, this.eventMode = "passive", this.hitArea = null, this._position = new ObservablePoint(this, 0, 0), this.includeInBuild = !0, this.didChange = !1, this.isSimple = !0, this.measurable = !0, this.relativeRenderGroupDepth = 0, this._attrUpdateTick = 0, this._localTransformUpdateTick = 0, this._updateFlags = 15, this.localDisplayStatus = 7, this.globalDisplayStatus = 7, this.children = [], this.localTransform = new Matrix(), this.relativeGroupTransform = new Matrix(), this.groupTransform = this.relativeGroupTransform, this._rotation = 0, this._cx = 1, this._sx = 0, this._cy = 0, this._sy = 1, this._skew = defaultSkew, this._scale = defaultScale, this._origin = defaultOrigin, this._pivot = defaultPivot, this.localAlpha = 1, this.groupColor = 16777215, this.localColor = 16777215, this.groupAlpha = 1, this.groupColorAlpha = 4294967295, assignWithIgnore(this, n, {
1031
+ super(), this.destroyed = !1, this.renderGroup = null, this.parentRenderGroup = null, this.parent = null, this.eventMode = "passive", this.hitArea = null, this._position = new ObservablePoint(this, 0, 0), this.includeInBuild = !0, this.didChange = !1, this.didViewUpdate = !1, this.isSimple = !0, this.measurable = !0, this.relativeRenderGroupDepth = 0, this._attrUpdateTick = 0, this._localTransformUpdateTick = 0, this._updateFlags = 15, this.localDisplayStatus = 7, this.globalDisplayStatus = 7, this.children = [], this.localTransform = new Matrix(), this.relativeGroupTransform = new Matrix(), this.groupTransform = this.relativeGroupTransform, this._rotation = 0, this._cx = 1, this._sx = 0, this._cy = 0, this._sy = 1, this._skew = defaultSkew, this._scale = defaultScale, this._origin = defaultOrigin, this._pivot = defaultPivot, this.localAlpha = 1, this.groupColor = 16777215, this.localColor = 16777215, this.groupAlpha = 1, this.groupColorAlpha = 4294967295, assignWithIgnore(this, n, {
1024
1032
  children: !0,
1025
1033
  parent: !0,
1026
1034
  effects: !0
@@ -1266,13 +1274,21 @@ function updateBlendColorVisible(n, j, M) {
1266
1274
  }
1267
1275
  M & 4 && (n.globalDisplayStatus = n.localDisplayStatus & j.globalDisplayStatus), n._updateFlags = 0;
1268
1276
  }
1277
+ function validateRenderables(n, j) {
1278
+ let { list: M, index: N } = n.childrenRenderablesToUpdate, P = !1;
1279
+ for (let n = 0; n < N; ++n) {
1280
+ let N = M[n];
1281
+ if (P = j[N.renderPipeId].validateRenderable(N), P) break;
1282
+ }
1283
+ return n.structureDidChange = P, P;
1284
+ }
1269
1285
  var _RenderGroupSystem, RenderGroupSystem = class {
1270
1286
  constructor(n) {
1271
1287
  this.renderer = n;
1272
1288
  }
1273
1289
  _updateRenderGroup(n) {
1274
1290
  let j = this.renderer, M = j.renderPipes;
1275
- n.instructionSet.renderPipes = M, updateRenderGroupTransform(n), n.structureDidChange && (n.structureDidChange = !1, this._buildInstructions(n, j));
1291
+ n.instructionSet.renderPipes = M, n.structureDidChange ? clearList(n.childrenRenderablesToUpdate.list, 0) : validateRenderables(n, M), updateRenderGroupTransform(n), n.structureDidChange && (n.structureDidChange = !1, this._buildInstructions(n, j)), n.childrenRenderablesToUpdate.index = 0;
1276
1292
  }
1277
1293
  render({ container: n, transform: j }) {
1278
1294
  let M = this.renderer;
@@ -1321,6 +1337,10 @@ var _TextPipe, TextPipe = class {
1321
1337
  }
1322
1338
  this._renderer.renderPipes.batch.addToBatch(M, j);
1323
1339
  }
1340
+ validateRenderable(n) {
1341
+ let j = this._getRuntimeText(n), M = n.styleKey;
1342
+ return j.currentKey === M ? n._didTextUpdate : !0;
1343
+ }
1324
1344
  initCacheText(n) {
1325
1345
  let j = {
1326
1346
  currentKey: "--",
@@ -1355,11 +1375,14 @@ var ViewContainer = class extends Container {
1355
1375
  return this.updateBounds(), this._bounds;
1356
1376
  }
1357
1377
  onViewUpdate() {
1358
- this.renderGroup || this.parentRenderGroup;
1378
+ if (this.didViewUpdate) return;
1379
+ this.didViewUpdate = !0;
1380
+ let n = this.renderGroup || this.parentRenderGroup;
1381
+ n && n.onChildViewUpdate(this);
1359
1382
  }
1360
1383
  collectRenderableSimple(n, j) {
1361
1384
  let M = n[this.renderPipeId];
1362
- M && M.addRenderable && M.addRenderable(this, j);
1385
+ M && M.addRenderable && M.addRenderable(this, j), this.didViewUpdate = !1;
1363
1386
  let N = this.children;
1364
1387
  for (let M = 0; M < N.length; ++M) N[M].collectRenderables(n, j);
1365
1388
  }
@@ -1985,7 +2008,9 @@ var RenderTexture = class n extends Texture {
1985
2008
  set height(n) {
1986
2009
  this._setHeight(n, this.bounds.height);
1987
2010
  }
1988
- onViewUpdate() {}
2011
+ onViewUpdate() {
2012
+ this.didViewUpdate || (this._didTextUpdate = !0), super.onViewUpdate();
2013
+ }
1989
2014
  updateBounds() {
1990
2015
  let n = this._bounds, j = this._anchor, M = TextMetrics.measureText(this._text, this._style), N = M.width, P = M.height;
1991
2016
  n.minX = -j._x * N, n.minY = -j._y * P, n.maxX = n.minX + N, n.maxY = n.minY + P;