dom_tools 1.2.5

  • Readme
  • Changelog
  • Installing
  • 40

dom_tools #

DOM rich elements and tools

Usage #

A simple usage example:

import 'package:dom_tools/dom_tools.dart';

main() {

  // Example of an image that only loads when visualized in viewport: 

  TrackElementInViewport tracker = TrackElementInViewport() ;
  var imageElement = ImageElement() ;
  
  tracker.track(imageElement, onEnterViewport: (elem) {
    imageElement.src = 'http://api.host/path/to/image' ;
  });

}

Features and bugs #

Please file feature requests and bugs at the issue tracker.

Author #

Graciliano M. Passos: gmpassos@GitHub.

License #

Dart free & open-source license.

1.2.5 #

  • isOrientationInPortraitMode(), isOrientationInLandscapeMode()
  • onOrientationchange()
  • swiss_knife: ^2.3.7

1.2.4 #

  • CSSThemeSet
  • TrackElementInViewport (refactor)
  • TrackElementValue (new)
  • TrackElementResize (new): based in ResizeObserver or TrackElementValue depending of platform.
  • swiss_knife: ^2.3.4

1.2.3 #

  • CSS tools.
  • Document: markdown and coding highlight.
  • html_unescape: ^1.0.1+3
  • markdown: ^2.1.3
  • highlight: ^0.5.0
  • enum_to_string: ^1.0.8

1.2.2 #

  • DataStorageType: browser transparent storage over IdbFactory or window.sessionStorage.
  • json_object_mapper: ^1.0.0
  • swiss_knife: ^2.3.1

1.2.1 #

  • CanvasImageViewer.cropPerspective.

1.2.0 #

  • CanvasImageViewer support for perspective filter.
  • Caches: ImageScaledCache, ImagePerspectiveFilterCache.

1.0.1 #

  • CSS functions: applyCSS(), defineCSS(), hasCSS()
  • Class Color (from dart:ui).
  • Class CanvasImageViewer.

1.0.0 #

  • Initial version, created by Stagehand

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  dom_tools: ^1.2.5

2. Install it

You can install packages from the command line:

with pub:


$ pub get

Alternatively, your editor might support pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:dom_tools/dom_tools.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
60
Health:
Code health derived from static analysis. [more]
7
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
40
Overall:
Weighted score of the above. [more]
40
Learn more about scoring.

We analyzed this package on Jul 5, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.13

Health issues and suggestions

Fix lib/src/dom_data_storage.dart. (-86.72 points)

Analysis of lib/src/dom_data_storage.dart failed with 7 errors, 1 hint, including:

line 5 col 8: Target of URI doesn't exist: 'package:swiss_knife/swiss_knife_browser.dart'.

line 136 col 9: Undefined class 'EventStream'.

line 136 col 36: The method 'EventStream' isn't defined for the type '_PersistentSimpleStorage'.

line 242 col 9: Undefined class 'EventStream'.

line 242 col 36: The method 'EventStream' isn't defined for the type '_DBSimpleStorage'.

Fix lib/src/dom_tools_document.dart. (-43.75 points)

Analysis of lib/src/dom_tools_document.dart failed with 2 errors:

line 6 col 8: Target of URI doesn't exist: 'package:swiss_knife/swiss_knife_browser.dart'.

line 188 col 10: The function 'createDivInline' isn't defined.

Fix lib/src/dom_tools_base.dart. (-1 points)

Analysis of lib/src/dom_tools_base.dart reported 2 hints:

line 3 col 8: Unused import: 'dart:async'.

line 7 col 8: Unused import: 'package:swiss_knife/swiss_knife.dart'.

Fix additional 5 files with analysis or formatting issues. (-1 points)

Additional issues in the following files:

  • lib/src/dom_tools_paint.dart (2 hints)
  • lib/dom_tools.dart (Run dartfmt to format lib/dom_tools.dart.)
  • lib/src/dom_tools_css.dart (Run dartfmt to format lib/src/dom_tools_css.dart.)
  • lib/src/dom_tools_track.dart (Run dartfmt to format lib/src/dom_tools_track.dart.)
  • lib/src/perspective_filter.dart (Run dartfmt to format lib/src/perspective_filter.dart.)

Maintenance issues and suggestions

No valid SDK. (-20 points)

The analysis could not detect a valid SDK that can use this package.

Support latest dependencies. (-10 points)

The version constraint in pubspec.yaml does not support the latest published versions for 1 dependency (highlight).

The package description is too short. (-20 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and dom_tools.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.7.0 <3.0.0
enum_to_string ^1.0.8 1.0.9
highlight ^0.5.0 0.5.0 0.6.0
html_unescape ^1.0.1+3 1.0.1+3
intl ^0.16.0 0.16.1
json_object_mapper ^1.0.0 1.0.0
markdown ^2.1.3 2.1.5
swiss_knife ^2.3.7 2.5.3
Transitive dependencies
args 1.6.0
charcode 1.1.3
collection 1.14.13
path 1.7.0
resource_portable 2.1.7
typed_data 1.2.0
Dev dependencies
pedantic ^1.8.0
test ^1.6.0