// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

import 'package:angular/angular.dart';
import 'package:angular_components/model/ui/highlighted_text_model.dart';

/// A component that presents a list of [HighlightedTextSegment]s.
///
/// Example parent component:
///
///     var highlighter = new TextHighlighter();
///     var segments = highlighter.highlight(text, ['search', 'tokens']);
///
/// And template:
///
///     <highlighted-text [segments]="segments"></highlighted-text>
///
/// Use [HighlightedValueComponent] for highlighting a value instead of
/// providing segments as required by this component.
@Component(
  selector: 'highlighted-text',
  templateUrl: 'highlighted_text.html',
  styleUrls: const ['highlighted_text.scss.css'],
  directives: const [NgFor],
  changeDetection: ChangeDetectionStrategy.OnPush,
  // TODO(google): Change to `Visibility.local` to reduce code size.
  visibility: Visibility.all,
)
class HighlightedTextComponent {
  /// List of [HighlightedTextSegment]s to present.
  @Input()
  List<HighlightedTextSegment> segments;
}

// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

import 'package:angular/angular.dart';
import 'package:angular_components/model/ui/highlighted_text_model.dart';

/// A component that presents a list of [HighlightedTextSegment]s.
///
/// Example parent component:
///
///     var highlighter = new TextHighlighter();
///     var segments = highlighter.highlight(text, ['search', 'tokens']);
///
/// And template:
///
///     <highlighted-text [segments]="segments"></highlighted-text>
///
/// Use [HighlightedValueComponent] for highlighting a value instead of
/// providing segments as required by this component.
@Component(
  selector: 'highlighted-text',
  templateUrl: 'highlighted_text.html',
  styleUrls: const ['highlighted_text.scss.css'],
  directives: const [NgFor],
  changeDetection: ChangeDetectionStrategy.OnPush,
)
class HighlightedTextComponent {
  /// List of [HighlightedTextSegment]s to present.
  @Input()
  List<HighlightedTextSegment> segments;
}

Remove visibility.all from @Component annotations. This is potentially BREAKING change.
Remove visibility.all from @Component annotations. This is potentially BREAKING
change.

Please review carefully. Breakage will only be caught if the code is covered by
tests. Reject this change if you believe it breaks you.

If the component needs to be injected anywhere in the app, you can get a
runtime exception after this change. This should be caught by tests using your
components, and fixing the issue should be trivial, as the exceptions have good
error messages, such as "No provider found for FooComponent".

PiperOrigin-RevId: 190966716
