@angular/language-service 11.0.7 → 11.0.8

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/bundles/ivy.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v11.0.7
2
+ * @license Angular v11.0.8
3
3
  * Copyright Google LLC All Rights Reserved.
4
4
  * License: MIT
5
5
  */
@@ -19649,7 +19649,7 @@ define(['exports', 'os', 'typescript', 'fs', 'constants', 'stream', 'util', 'ass
19649
19649
  * Use of this source code is governed by an MIT-style license that can be
19650
19650
  * found in the LICENSE file at https://angular.io/license
19651
19651
  */
19652
- const VERSION$1 = new Version('11.0.7');
19652
+ const VERSION$1 = new Version('11.0.8');
19653
19653
 
19654
19654
  /**
19655
19655
  * @license
@@ -20284,7 +20284,7 @@ define(['exports', 'os', 'typescript', 'fs', 'constants', 'stream', 'util', 'ass
20284
20284
  * Use of this source code is governed by an MIT-style license that can be
20285
20285
  * found in the LICENSE file at https://angular.io/license
20286
20286
  */
20287
- const VERSION$2 = new Version('11.0.7');
20287
+ const VERSION$2 = new Version('11.0.8');
20288
20288
 
20289
20289
  /**
20290
20290
  * @license
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v11.0.7
2
+ * @license Angular v11.0.8
3
3
  * Copyright Google LLC All Rights Reserved.
4
4
  * License: MIT
5
5
  */
@@ -18446,7 +18446,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
18446
18446
  * Use of this source code is governed by an MIT-style license that can be
18447
18447
  * found in the LICENSE file at https://angular.io/license
18448
18448
  */
18449
- const VERSION$1 = new Version('11.0.7');
18449
+ const VERSION$1 = new Version('11.0.8');
18450
18450
 
18451
18451
  /**
18452
18452
  * @license
@@ -26943,6 +26943,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
26943
26943
  // T_HOST is index 6
26944
26944
  // We already have this constants in LView, we don't need to re-create it.
26945
26945
  const NATIVE = 7;
26946
+ const VIEW_REFS = 8;
26946
26947
  const MOVED_VIEWS = 9;
26947
26948
  /**
26948
26949
  * Size of LContainer's header. Represents the index after which all views in the
@@ -29167,6 +29168,15 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
29167
29168
  * Use of this source code is governed by an MIT-style license that can be
29168
29169
  * found in the LICENSE file at https://angular.io/license
29169
29170
  */
29171
+ function removeFromArray(arr, index) {
29172
+ // perf: array.pop is faster than array.splice!
29173
+ if (index >= arr.length - 1) {
29174
+ return arr.pop();
29175
+ }
29176
+ else {
29177
+ return arr.splice(index, 1)[0];
29178
+ }
29179
+ }
29170
29180
  function newArray$1(size, value) {
29171
29181
  const list = [];
29172
29182
  for (let i = 0; i < size; i++) {
@@ -30129,6 +30139,22 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
30129
30139
  renderer.createElementNS(namespace, name);
30130
30140
  }
30131
30141
  }
30142
+ /**
30143
+ * Removes all DOM elements associated with a view.
30144
+ *
30145
+ * Because some root nodes of the view may be containers, we sometimes need
30146
+ * to propagate deeply into the nested containers to remove all elements in the
30147
+ * views beneath it.
30148
+ *
30149
+ * @param tView The `TView' of the `LView` from which elements should be added or removed
30150
+ * @param lView The view from which elements should be added or removed
30151
+ */
30152
+ function removeViewFromContainer(tView, lView) {
30153
+ const renderer = lView[RENDERER];
30154
+ applyView(tView, lView, renderer, 2 /* Detach */, null, null);
30155
+ lView[HOST] = null;
30156
+ lView[T_HOST] = null;
30157
+ }
30132
30158
  /**
30133
30159
  * Detach a `LView` from the DOM by detaching its nodes.
30134
30160
  *
@@ -30206,6 +30232,43 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
30206
30232
  }
30207
30233
  movedViews.splice(declarationViewIndex, 1);
30208
30234
  }
30235
+ /**
30236
+ * Detaches a view from a container.
30237
+ *
30238
+ * This method removes the view from the container's array of active views. It also
30239
+ * removes the view's elements from the DOM.
30240
+ *
30241
+ * @param lContainer The container from which to detach a view
30242
+ * @param removeIndex The index of the view to detach
30243
+ * @returns Detached LView instance.
30244
+ */
30245
+ function detachView(lContainer, removeIndex) {
30246
+ if (lContainer.length <= CONTAINER_HEADER_OFFSET)
30247
+ return;
30248
+ const indexInContainer = CONTAINER_HEADER_OFFSET + removeIndex;
30249
+ const viewToDetach = lContainer[indexInContainer];
30250
+ if (viewToDetach) {
30251
+ const declarationLContainer = viewToDetach[DECLARATION_LCONTAINER];
30252
+ if (declarationLContainer !== null && declarationLContainer !== lContainer) {
30253
+ detachMovedView(declarationLContainer, viewToDetach);
30254
+ }
30255
+ if (removeIndex > 0) {
30256
+ lContainer[indexInContainer - 1][NEXT] = viewToDetach[NEXT];
30257
+ }
30258
+ const removedLView = removeFromArray(lContainer, CONTAINER_HEADER_OFFSET + removeIndex);
30259
+ removeViewFromContainer(viewToDetach[TVIEW], viewToDetach);
30260
+ // notify query that a view has been removed
30261
+ const lQueries = removedLView[QUERIES];
30262
+ if (lQueries !== null) {
30263
+ lQueries.detachView(removedLView[TVIEW]);
30264
+ }
30265
+ viewToDetach[PARENT] = null;
30266
+ viewToDetach[NEXT] = null;
30267
+ // Unsets the attached flag
30268
+ viewToDetach[FLAGS] &= ~128 /* Attached */;
30269
+ }
30270
+ return viewToDetach;
30271
+ }
30209
30272
  /**
30210
30273
  * A standalone function which destroys an LView,
30211
30274
  * conducting clean up (e.g. removing listeners, calling onDestroys).
@@ -34344,7 +34407,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
34344
34407
  /**
34345
34408
  * @publicApi
34346
34409
  */
34347
- const VERSION$2 = new Version$1('11.0.7');
34410
+ const VERSION$2 = new Version$1('11.0.8');
34348
34411
 
34349
34412
  /**
34350
34413
  * @license
@@ -35503,7 +35566,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
35503
35566
  this._lView = _lView;
35504
35567
  this._cdRefInjectingView = _cdRefInjectingView;
35505
35568
  this._appRef = null;
35506
- this._viewContainerRef = null;
35569
+ this._attachedToViewContainer = false;
35507
35570
  }
35508
35571
  get rootNodes() {
35509
35572
  const lView = this._lView;
@@ -35520,12 +35583,19 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
35520
35583
  if (this._appRef) {
35521
35584
  this._appRef.detachView(this);
35522
35585
  }
35523
- else if (this._viewContainerRef) {
35524
- const index = this._viewContainerRef.indexOf(this);
35525
- if (index > -1) {
35526
- this._viewContainerRef.detach(index);
35586
+ else if (this._attachedToViewContainer) {
35587
+ const parent = this._lView[PARENT];
35588
+ if (isLContainer(parent)) {
35589
+ const viewRefs = parent[VIEW_REFS];
35590
+ const index = viewRefs ? viewRefs.indexOf(this) : -1;
35591
+ if (index > -1) {
35592
+ ngDevMode &&
35593
+ assertEqual(index, parent.indexOf(this._lView) - CONTAINER_HEADER_OFFSET, 'An attached view should be in the same position within its container as its ViewRef in the VIEW_REFS array.');
35594
+ detachView(parent, index);
35595
+ removeFromArray(viewRefs, index);
35596
+ }
35527
35597
  }
35528
- this._viewContainerRef = null;
35598
+ this._attachedToViewContainer = false;
35529
35599
  }
35530
35600
  destroyLView(this._lView[TVIEW], this._lView);
35531
35601
  }
@@ -35717,18 +35787,18 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
35717
35787
  checkNoChanges() {
35718
35788
  checkNoChangesInternal(this._lView[TVIEW], this._lView, this.context);
35719
35789
  }
35720
- attachToViewContainerRef(vcRef) {
35790
+ attachToViewContainerRef() {
35721
35791
  if (this._appRef) {
35722
35792
  throw new Error('This view is already attached directly to the ApplicationRef!');
35723
35793
  }
35724
- this._viewContainerRef = vcRef;
35794
+ this._attachedToViewContainer = true;
35725
35795
  }
35726
35796
  detachFromAppRef() {
35727
35797
  this._appRef = null;
35728
35798
  renderDetachView(this._lView[TVIEW], this._lView);
35729
35799
  }
35730
35800
  attachToAppRef(appRef) {
35731
- if (this._viewContainerRef) {
35801
+ if (this._attachedToViewContainer) {
35732
35802
  throw new Error('This view is already attached to a ViewContainer!');
35733
35803
  }
35734
35804
  this._appRef = appRef;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/language-service",
3
- "version": "11.0.7",
3
+ "version": "11.0.8",
4
4
  "description": "Angular - language services",
5
5
  "main": "./bundles/language-service.js",
6
6
  "typings": "./index.d.ts",