Skip to content

Commit

Permalink
Merge pull request #1 from leftyio/sync_master_compatible
Browse files Browse the repository at this point in the history
Sync master compatible
  • Loading branch information
GZGavinZhao authored Oct 23, 2021
2 parents d555f6c + 42b862c commit c080632
Show file tree
Hide file tree
Showing 124 changed files with 721 additions and 532 deletions.
17 changes: 17 additions & 0 deletions .firebaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"projects": {
"default": "angulardart-community"
},
"targets": {
"angulardart-community": {
"hosting": {
"main": [
"www.angulardart.xyz"
],
"gallery": [
"angulardart-gallery"
]
}
}
}
}
10 changes: 7 additions & 3 deletions .github/workflows/dart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ name: Dart CI
on:
push:
branches:
- compatible
# - dev
- dev
- master
pull_request:

defaults:
Expand All @@ -18,5 +18,9 @@ jobs:
steps:
- uses: dart-lang/[email protected]
- uses: actions/[email protected]
- name: Install mono_repo
run: dart pub global activate mono_repo
- name: Fetch dependencies
run: dart pub global run mono_repo pub get
- name: Analyze files
run: dart analyze
run: dart analyze
31 changes: 31 additions & 0 deletions .github/workflows/firebase-hosting-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# This file was auto-generated by the Firebase CLI
# https://github.com/firebase/firebase-tools

name: Deploy to Firebase Hosting on merge
'on':
push:
branches:
- master

defaults:
run:
shell: bash

jobs:
build_and_deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Setup Dart SDK
uses: dart-lang/[email protected]

- run: dart pub get && dart run build_runner build -o build --release
working-directory: examples/angular_components_example

- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_ANGULARDART_COMMUNITY }}'
channelId: live
projectId: angulardart-community
28 changes: 28 additions & 0 deletions .github/workflows/firebase-hosting-pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# This file was auto-generated by the Firebase CLI
# https://github.com/firebase/firebase-tools

name: Deploy to Firebase Hosting on PR
'on': pull_request

defaults:
run:
shell: bash

jobs:
build_and_preview:
if: '${{ github.event.pull_request.head.repo.full_name == github.repository }}'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Setup Dart SDK
uses: dart-lang/[email protected]

- run: dart pub get && dart run build_runner build -o build
working-directory: examples/angular_components_example

- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_ANGULARDART_COMMUNITY }}'
projectId: angulardart-community
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,7 @@ doc/api/

## Misc ##
.metals/
.vscode

# Firebase related
.firebase/
5 changes: 5 additions & 0 deletions .jsbeautifyrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"indent_size": 2,
"indent_char": " ",
"wrap_attributes": "preserve-aligned"
}
2 changes: 1 addition & 1 deletion analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
analyzer:
errors:
# Allow importing .template.dart files without an [explicit] analyzer error.
#uri_has_not_been_generated: ignore
uri_has_not_been_generated: ignore
# Ignore our own deprecated symbols (too noisy).
deprecated_member_use_from_same_package: ignore

Expand Down
41 changes: 28 additions & 13 deletions angular_components/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,30 @@
include: package:lints/recommended.yaml

#include: package:pedantic/analysis_options.1.8.0.yaml
#analyzer:
# errors:
# dead_code: warning
# todo: ignore
# unused_element: warning
# unused_import: warning
# unused_local_variable: warning
# uri_has_not_been_generated: ignore
# deprecated_member_use_from_same_package: ignore
#linter:
# rules:
# - prefer_generic_function_type_aliases
analyzer:
errors:
# Happen a lots with angular
uri_has_not_been_generated: ignore
###############
constant_identifier_names: ignore
annotate_overrides: ignore
unnecessary_this: ignore
unnecessary_brace_in_string_interps: ignore
prefer_final_fields: ignore
prefer_collection_literals: ignore
prefer_conditional_assignment: ignore
use_function_type_syntax_for_parameters: ignore
prefer_void_to_null: ignore
implementation_imports: ignore
avoid_function_literals_in_foreach_calls: ignore
unused_field: ignore
prefer_typing_uninitialized_variables: ignore
avoid_renaming_method_parameters: ignore
non_constant_identifier_names: ignore
prefer_function_declarations_over_variables: ignore
unnecessary_string_interpolations: ignore
avoid_returning_null_for_void: ignore
prefer_if_null_operators: ignore
overridden_fields: ignore
prefer_for_elements_to_map_fromIterable: ignore
prefer_spread_collections: ignore
prefer_initializing_formals: ignore
2 changes: 1 addition & 1 deletion angular_components/lib/angular_components.dart
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ const List<dynamic> materialDirectives = [
DateRangeEditorComponent,
DateRangeInputComponent,
DeferredContentDirective,
displayNameRendererDirective,
DisplayNameRendererDirective,
DropdownSelectValueAccessor,
DropdownButtonComponent,
DropdownMenuComponent,
Expand Down
4 changes: 3 additions & 1 deletion angular_components/lib/app_layout/layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// 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.

@use "sass:math";

/// Styles provided to more easily layout an application.
/// This includes:
/// material-drawer (persistent and permanent)
Expand All @@ -14,7 +16,7 @@
$mat-toolbar-mobile-breakpoint: 599px;
$mat-drawer-border: 1px solid $mat-border-light;
// Desktop spec calls for 24px margins have each element contribute half.
$mat-desktop-drawer-margin: 3 * $mat-grid / 2;
$mat-desktop-drawer-margin: 3 * math.div($mat-grid , 2);
// Mobile spec calls for 16px margins have each element contribute half.
$mat-mobile-drawer-margin: $mat-grid;

Expand Down
5 changes: 3 additions & 2 deletions angular_components/lib/css/_core_material.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// 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.
@use "sass:math";


// Grid
Expand Down Expand Up @@ -76,7 +77,7 @@ $mat-grid-type: 4px;
background-repeat: no-repeat;
background-size: $icon-size $icon-size;
height: $background-size;
padding: (($background-size - $icon-size) / 2);
padding: (math.div(($background-size - $icon-size) , 2));
width: $background-size;
}

Expand Down Expand Up @@ -145,7 +146,7 @@ $mat-grid-type: 4px;
width: $button-size;

@if $circle {
border-radius: $button-size / 2;
border-radius: math.div($button-size , 2);
}

// Light theme - default
Expand Down
3 changes: 2 additions & 1 deletion angular_components/lib/css/_typography_material.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// 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.
@use "sass:math";

// Typography constants
// https://material.io/design/typography
Expand Down Expand Up @@ -46,7 +47,7 @@ $mat-font-leading-caption: 20px;

// Converts tracking to letter-spacing.
@function font-tracking($tracking) {
@return ($tracking / 1000) * 1em;
@return (math.div($tracking , 1000)) * 1em;
}

// Prevents text from wrapping.
Expand Down
3 changes: 2 additions & 1 deletion angular_components/lib/css/mdc_web/card/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
@use "sass:math";

@import "../elevation/mixins";
@import "../featuretargeting/functions";
Expand Down Expand Up @@ -315,7 +316,7 @@
&::before {
@include mdc-feature-targets($feat-structure) {
// This clever trick brought to you by: http://www.mademyday.de/css-height-equals-width-with-pure-css.html
margin-top: percentage($y / $x);
margin-top: percentage(math.div($y , $x));
}
}
}
Expand Down
9 changes: 5 additions & 4 deletions angular_components/lib/css/mdc_web/ripple/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
@use "sass:math";

@import "../animation/functions";
@import "../animation/variables";
Expand Down Expand Up @@ -412,9 +413,9 @@
#{$ripple-target}::before,
#{$ripple-target}::after {
@include mdc-feature-targets($feat-struture) {
top: calc(50% - #{$radius / 2});
top: calc(50% - #{math.div($radius , 2)});
/* @noflip */
left: calc(50% - #{$radius / 2});
left: calc(50% - #{math.div($radius , 2)});
width: $radius;
height: $radius;
}
Expand All @@ -424,9 +425,9 @@
#{$ripple-target}::before,
#{$ripple-target}::after {
@include mdc-feature-targets($feat-struture) {
top: var(--mdc-ripple-top, calc(50% - #{$radius / 2}));
top: var(--mdc-ripple-top, calc(50% - #{math.div($radius , 2)}));
/* @noflip */
left: var(--mdc-ripple-left, calc(50% - #{$radius / 2}));
left: var(--mdc-ripple-left, calc(50% - #{math.div($radius , 2)}));
width: var(--mdc-ripple-fg-size, $radius);
height: var(--mdc-ripple-fg-size, $radius);
}
Expand Down
5 changes: 3 additions & 2 deletions angular_components/lib/css/mdc_web/shape/_functions.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
@use "sass:math";

@import "./variables";

Expand Down Expand Up @@ -171,9 +172,9 @@
@function mdc-shape-resolve-percentage-for-corner_($component-height, $radius) {
@if type-of($radius) == "number" and unit($radius) == "%" {
// Converts the percentage to number without unit. Example: 50% => 50.
$percentage: $radius / ($radius * 0 + 1);
$percentage: math.div($radius , ($radius * 0 + 1));

@return $component-height * ($percentage / 100);
@return $component-height * (math.div($percentage , 100));
} @else {
@return $radius;
}
Expand Down
3 changes: 2 additions & 1 deletion angular_components/lib/css/mdc_web/theme/_functions.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
@use "sass:math";

@import "./constants";

Expand All @@ -38,7 +39,7 @@
$backLum: mdc-theme-luminance($back) + .05;
$foreLum: mdc-theme-luminance($front) + .05;

@return max($backLum, $foreLum) / min($backLum, $foreLum);
@return math.div(max($backLum, $foreLum) , min($backLum, $foreLum));
}

// Determine whether the color is "light" or "dark".
Expand Down
22 changes: 1 addition & 21 deletions angular_components/lib/dynamic_component/dynamic_component.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import 'package:angular_components/model/ui/has_renderer.dart';
changeDetection: ChangeDetectionStrategy.OnPush,
)
class DynamicComponent implements OnDestroy, AfterChanges {
final SlowComponentLoader _slowComponentLoader;
final ComponentLoader _componentLoader;
final _onLoadController = StreamController<ComponentRef>();

Expand Down Expand Up @@ -47,7 +46,7 @@ class DynamicComponent implements OnDestroy, AfterChanges {
@Output()
Stream<ComponentRef> get onLoad => _onLoadController.stream;

DynamicComponent(this._slowComponentLoader, this._componentLoader);
DynamicComponent(this._componentLoader);

/// Returns the loaded dynamic component reference.
ComponentRef get childComponent => _childComponent;
Expand Down Expand Up @@ -113,25 +112,6 @@ class DynamicComponent implements OnDestroy, AfterChanges {
_componentFactory, _viewContainerRef);
_onLoadController.add(_childComponent);
_updateChildComponent();
} else if (_componentType != null) {
// TODO(google): Remove this code once componentType is no longer used.
Type loadType = _componentType;
_slowComponentLoader
.loadNextToLocation(loadType, _viewContainerRef)
.then((ComponentRef componentRef) {
if (loadType != _componentType) {
// During the load time, the component type has changed,
// and the type we just loaded is no longer valid.
componentRef.destroy();
return;
}
if (_childComponent != null) {
throw 'Attempting to overwrite a dynamic component';
}
_childComponent = componentRef;
_onLoadController.add(componentRef);
_updateChildComponent();
});
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import 'dart:html';

import 'package:angular/angular.dart';
import 'package:angular/meta.dart';
import 'package:angular_components/utils/browser/dom_service/dom_service.dart';
import 'package:meta/meta.dart';

Expand Down
Loading

0 comments on commit c080632

Please sign in to comment.