@html-next/vertical-collection 1.0.0-beta.9 → 2.0.1

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.
Files changed (33) hide show
  1. package/.github/workflows/ci.yml +76 -0
  2. package/CHANGELOG.md +13 -0
  3. package/README.md +30 -48
  4. package/RELEASE.md +60 -0
  5. package/addon/-debug/edge-visualization/debug-mixin.js +5 -9
  6. package/addon/-debug/edge-visualization/visualization.js +2 -2
  7. package/addon/-private/data-view/elements/occluded-content.js +84 -0
  8. package/addon/-private/data-view/{container.js → elements/viewport-container.js} +5 -5
  9. package/addon/-private/data-view/{virtual-component.js → elements/virtual-component.js} +15 -13
  10. package/addon/-private/data-view/radar/dynamic-radar.js +4 -5
  11. package/addon/-private/data-view/radar/radar.js +90 -31
  12. package/addon/-private/data-view/utils/mutation-checkers.js +29 -0
  13. package/addon/-private/data-view/utils/scroll-handler.js +1 -3
  14. package/addon/-private/data-view/utils/supports-passive.js +1 -0
  15. package/addon/-private/data-view/viewport-container.js +70 -0
  16. package/addon/-private/ember-internals/identity.js +1 -5
  17. package/addon/-private/ember-internals/key-for-item.js +1 -5
  18. package/addon/-private/index.js +1 -1
  19. package/addon/-private/utils/document-shim.js +1 -0
  20. package/addon/components/vertical-collection/component.js +31 -84
  21. package/addon/components/vertical-collection/template.hbs +2 -2
  22. package/addon/styles/app.css +7 -6
  23. package/app/components/vertical-collection.js +1 -1
  24. package/app/initializers/debug.js +1 -1
  25. package/config/ember-cli-toolbelts.json +1 -5
  26. package/config/environment.js +0 -1
  27. package/index.js +45 -41
  28. package/package.json +96 -64
  29. package/.npmignore +0 -16
  30. package/app/initializers/vertical-collection-legacy-compat.js +0 -14
  31. package/config/changelog.js +0 -23
  32. package/config/release.js +0 -19
  33. package/yarn.lock +0 -6533
package/index.js CHANGED
@@ -1,26 +1,11 @@
1
- /* eslint-env node */
2
1
  'use strict';
3
2
 
4
3
  const StripClassCallCheckPlugin = require('babel6-plugin-strip-class-callcheck');
5
4
  const Funnel = require('broccoli-funnel');
6
5
  const Rollup = require('broccoli-rollup');
7
- const merge = require('broccoli-merge-trees');
6
+ const merge = require('broccoli-merge-trees');
8
7
  const VersionChecker = require('ember-cli-version-checker');
9
8
 
10
- const path = require('path');
11
-
12
- const BlockScopingTransform = (function() {
13
- let plugin = require('babel-plugin-transform-es2015-block-scoping');
14
-
15
- // adding `baseDir` ensures that broccoli-babel-transpiler does not
16
- // issue a warning and opt out of caching
17
- let pluginPath = require.resolve('babel-plugin-transform-es2015-block-scoping/package');
18
- let pluginBaseDir = path.dirname(pluginPath);
19
- plugin.baseDir = () => pluginBaseDir;
20
-
21
- return plugin;
22
- })();
23
-
24
9
  function isProductionEnv() {
25
10
  const isProd = /production/.test(process.env.EMBER_ENV);
26
11
  const isTest = process.env.EMBER_CLI_TEST_COMMAND;
@@ -29,7 +14,7 @@ function isProductionEnv() {
29
14
  }
30
15
 
31
16
  module.exports = {
32
- name: 'vertical-collection',
17
+ name: require('./package').name,
33
18
 
34
19
  init() {
35
20
  this._super.init && this._super.init.apply(this, arguments);
@@ -37,9 +22,19 @@ module.exports = {
37
22
  this.options = this.options || {};
38
23
  },
39
24
 
25
+ getOutputDirForVersion() {
26
+ let VersionChecker = require('ember-cli-version-checker');
27
+ let checker = new VersionChecker(this);
28
+ let emberCli = checker.for('ember-cli', 'npm');
29
+
30
+ let requiresModulesDir = emberCli.satisfies('< 3.0.0');
31
+
32
+ return requiresModulesDir ? 'modules' : '';
33
+ },
34
+
40
35
  treeForAddon(tree) {
41
36
  let babel = this.addons.find((addon) => addon.name === 'ember-cli-babel');
42
- let withPrivate = new Funnel(tree, { include: ['-private/**'] });
37
+ let withPrivate = new Funnel(tree, { include: ['-private/**'] });
43
38
  let withoutPrivate = new Funnel(tree, {
44
39
  exclude: [
45
40
  '**/**.hbs',
@@ -47,7 +42,7 @@ module.exports = {
47
42
  isProductionEnv() ? '-debug' : false
48
43
  ].filter(Boolean),
49
44
 
50
- destDir: 'vertical-collection'
45
+ destDir: '@html-next/vertical-collection'
51
46
  });
52
47
 
53
48
  let privateTree = babel.transpileTree(withPrivate, {
@@ -67,17 +62,23 @@ module.exports = {
67
62
 
68
63
  privateTree = new Rollup(privateTree, {
69
64
  rollup: {
70
- entry: '-private/index.js',
71
- targets: [
72
- { dest: 'vertical-collection/-private.js', format: 'amd', moduleId: 'vertical-collection/-private' }
65
+ input: '-private/index.js',
66
+ output: [
67
+ {
68
+ file: '@html-next/vertical-collection/-private.js',
69
+ format: 'amd',
70
+ amd: {
71
+ id: '@html-next/vertical-collection/-private'
72
+ }
73
+ }
73
74
  ],
74
75
  external: ['ember', 'ember-raf-scheduler']
75
76
  }
76
77
  });
77
78
 
78
- // the output of treeForAddon is required to be modules/<your files>
79
- publicTree = new Funnel(publicTree, { destDir: 'modules' });
80
- privateTree = new Funnel(privateTree, { destDir: 'modules' });
79
+ let destDir = this.getOutputDirForVersion();
80
+ publicTree = new Funnel(publicTree, { destDir });
81
+ privateTree = new Funnel(privateTree, { destDir });
81
82
 
82
83
  return merge([
83
84
  addonTemplateTree,
@@ -93,17 +94,9 @@ module.exports = {
93
94
  const opts = {
94
95
  loose: true,
95
96
  plugins,
96
- postTransformPlugins: [StripClassCallCheckPlugin],
97
- exclude: [
98
- 'transform-es2015-block-scoping',
99
- 'transform-es2015-typeof-symbol'
100
- ]
97
+ postTransformPlugins: [StripClassCallCheckPlugin]
101
98
  };
102
99
 
103
- opts.plugins.push(
104
- [BlockScopingTransform, { 'throwIfClosureRequired': true }]
105
- );
106
-
107
100
  return opts;
108
101
  },
109
102
  _setupBabelOptions() {
@@ -125,15 +118,15 @@ module.exports = {
125
118
  }
126
119
 
127
120
  if (typeof app.import !== 'function') {
128
- throw new Error('vertical-collection is being used within another addon or engine ' +
129
- 'and is having trouble registering itself to the parent application.');
121
+ throw new Error('vertical-collection is being used within another addon or engine '
122
+ + 'and is having trouble registering itself to the parent application.');
130
123
  }
131
124
 
132
125
  this._env = app.env;
133
126
  this._setupBabelOptions(app.env);
134
127
 
135
128
  if (!/production/.test(app.env) && !/test/.test(app.env)) {
136
- app.import('vendor/debug.css');
129
+ findImporter(this).import('vendor/debug.css');
137
130
  }
138
131
  },
139
132
 
@@ -146,10 +139,21 @@ module.exports = {
146
139
  exclude.push('initializers/debug.js');
147
140
  }
148
141
 
149
- if (this.checker.forEmber().isAbove('1.13.0')) {
150
- exclude.push('initializers/vertical-collection-legacy-compat.js');
151
- }
152
-
153
142
  return new Funnel(tree, { exclude });
154
143
  }
155
144
  };
145
+
146
+ function findImporter(addon) {
147
+ if (typeof addon.import === 'function') {
148
+ // If addon.import() is present (CLI 2.7+) use that
149
+ return addon;
150
+ } else {
151
+ // Otherwise, reuse the _findHost implementation that would power addon.import()
152
+ let current = addon;
153
+ let app;
154
+ do {
155
+ app = current.app || app;
156
+ } while (current.parent.parent && (current = current.parent));
157
+ return app;
158
+ }
159
+ }
package/package.json CHANGED
@@ -1,19 +1,24 @@
1
1
  {
2
2
  "name": "@html-next/vertical-collection",
3
- "version": "1.0.0-beta.9",
3
+ "version": "2.0.1",
4
4
  "description": "infinite-scroll, done right. done.",
5
- "directories": {
6
- "doc": "doc",
7
- "test": "tests"
8
- },
9
- "scripts": {
10
- "build": "ember build",
11
- "start": "ember server",
12
- "test": "ember try:each"
13
- },
14
- "repository": "https://github.com/html-next/vertical-collection.git",
5
+ "keywords": [
6
+ "occlusion",
7
+ "infinite",
8
+ "infinite-scroll",
9
+ "collection",
10
+ "grid",
11
+ "list-view",
12
+ "recycling",
13
+ "cloaking",
14
+ "performance",
15
+ "lists",
16
+ "ember-addon"
17
+ ],
15
18
  "homepage": "https://github.com/html-next/vertical-collection",
16
19
  "bugs": "https://github.com/html-next/vertical-collection/issues",
20
+ "repository": "https://github.com/html-next/vertical-collection.git",
21
+ "license": "MIT",
17
22
  "author": {
18
23
  "name": "Chris Thoburn (@runspired)",
19
24
  "url": "https://runspired.com"
@@ -23,68 +28,95 @@
23
28
  "name": "Chris Garrett (@pzuraq)",
24
29
  "email": "me@pzuraq.com",
25
30
  "url": "https://github.com/pzuraq"
31
+ },
32
+ {
33
+ "name": "Robert Wagner (@rwwagner90)",
34
+ "email": "rwwagner90@gmail.com",
35
+ "url": "https://github.com/rwwagner90"
26
36
  }
27
37
  ],
28
- "license": "MIT",
29
- "devDependencies": {
30
- "broccoli-asset-rev": "^2.4.5",
31
- "ember-cli": "^2.12.2",
32
- "ember-cli-app-version": "^1.0.0",
33
- "ember-cli-changelog": "0.3.4",
34
- "ember-cli-dependency-checker": "^1.3.0",
35
- "ember-cli-eslint": "3.0.0",
36
- "ember-cli-github-pages": "^0.1.2",
37
- "ember-cli-htmlbars-inline-precompile": "^0.4.0-beta.2",
38
- "ember-cli-inject-live-reload": "^1.4.1",
39
- "ember-cli-qunit": "^3.1.0",
40
- "ember-cli-release": "^0.2.9",
41
- "ember-cli-shims": "^1.0.2",
42
- "ember-cli-sri": "^2.1.0",
43
- "ember-cli-uglify": "^1.2.0",
44
- "ember-cli-version-checker": "^1.2.0",
45
- "ember-code-snippet": "^1.1.0",
46
- "ember-data": "^2.12.2",
47
- "ember-disable-prototype-extensions": "^1.1.0",
48
- "ember-disable-proxy-controllers": "^1.0.1",
49
- "ember-export-application-global": "^1.0.5",
50
- "ember-load-initializers": "^0.6.0",
51
- "ember-maybe-import-regenerator": "^0.1.6",
52
- "ember-native-dom-helpers": "^0.5.2",
53
- "ember-perf-timeline": "^1.2.1",
54
- "ember-resolver": "^2.0.3",
55
- "ember-source": "^2.15.0",
56
- "eslint-plugin-ember-suave": "^1.0.0",
57
- "fastboot": "^1.0.0-rc.6",
58
- "loader.js": "^4.2.3"
38
+ "directories": {
39
+ "doc": "doc",
40
+ "test": "tests"
41
+ },
42
+ "scripts": {
43
+ "build": "ember build",
44
+ "lint": "npm-run-all --aggregate-output --continue-on-error --parallel lint:*",
45
+ "lint:hbs": "ember-template-lint .",
46
+ "lint:js": "eslint .",
47
+ "start": "ember serve",
48
+ "test": "npm-run-all lint:* test:*",
49
+ "test:ember": "ember test",
50
+ "test:ember-compatibility": "ember try:each"
59
51
  },
60
52
  "dependencies": {
61
- "babel-plugin-transform-es2015-block-scoping": "^6.24.1",
62
53
  "babel6-plugin-strip-class-callcheck": "^6.0.0",
63
- "broccoli-funnel": "^1.2.0",
64
- "broccoli-merge-trees": "^2.0.0",
65
- "broccoli-rollup": "^1.2.0",
66
- "ember-cli-babel": "^6.0.0-beta.10",
67
- "ember-cli-htmlbars": "^1.1.1",
68
- "ember-compatibility-helpers": "^0.1.2",
69
- "ember-raf-scheduler": "0.1.0"
54
+ "broccoli-funnel": "^2.0.2",
55
+ "broccoli-merge-trees": "^3.0.1",
56
+ "broccoli-rollup": "^4.1.1",
57
+ "ember-cli-babel": "^7.12.0",
58
+ "ember-cli-htmlbars": "^3.0.1",
59
+ "ember-cli-version-checker": "^3.1.3",
60
+ "ember-compatibility-helpers": "^1.2.1",
61
+ "ember-raf-scheduler": "0.2.0"
62
+ },
63
+ "devDependencies": {
64
+ "@ember/optional-features": "^0.7.0",
65
+ "bootstrap": "~3.3.5",
66
+ "broccoli-asset-rev": "^3.0.0",
67
+ "ember-cli": "~3.12.0",
68
+ "ember-cli-app-version": "^3.2.0",
69
+ "ember-cli-dependency-checker": "^3.1.0",
70
+ "ember-cli-eslint": "^5.1.0",
71
+ "ember-cli-fastboot": "^2.1.3",
72
+ "ember-cli-github-pages": "^0.2.2",
73
+ "ember-cli-htmlbars-inline-precompile": "^2.1.0",
74
+ "ember-cli-inject-live-reload": "^2.0.1",
75
+ "ember-cli-sri": "^2.1.1",
76
+ "ember-cli-template-lint": "^1.0.0-beta.1",
77
+ "ember-cli-uglify": "^3.0.0",
78
+ "ember-code-snippet": "^2.4.1",
79
+ "ember-data": "3.11.5",
80
+ "ember-disable-prototype-extensions": "^1.1.3",
81
+ "ember-export-application-global": "^2.0.0",
82
+ "ember-load-initializers": "^2.0.0",
83
+ "ember-native-dom-helpers": "^0.7.0",
84
+ "ember-perf-timeline": "^1.2.1",
85
+ "ember-qunit": "^4.5.1",
86
+ "ember-resolver": "^5.0.1",
87
+ "ember-source": "~3.12.0",
88
+ "ember-source-channel-url": "^2.0.1",
89
+ "ember-try": "^1.2.1",
90
+ "eslint-plugin-ember": "^6.7.1",
91
+ "eslint-plugin-node": "^9.1.0",
92
+ "loader.js": "^4.7.0",
93
+ "npm-run-all": "^4.1.5",
94
+ "qunit-dom": "^0.9.0",
95
+ "release-it": "^14.2.1",
96
+ "release-it-lerna-changelog": "^3.1.0"
70
97
  },
71
98
  "engines": {
72
- "node": ">= 4"
99
+ "node": ">= 10.*"
100
+ },
101
+ "publishConfig": {
102
+ "registry": "https://registry.npmjs.org"
73
103
  },
74
104
  "ember-addon": {
75
105
  "configPath": "tests/dummy/config"
76
106
  },
77
- "keywords": [
78
- "occlusion",
79
- "infinite",
80
- "infinite-scroll",
81
- "collection",
82
- "grid",
83
- "list-view",
84
- "recycling",
85
- "cloaking",
86
- "performance",
87
- "lists",
88
- "ember-addon"
89
- ]
107
+ "release-it": {
108
+ "plugins": {
109
+ "release-it-lerna-changelog": {
110
+ "infile": "CHANGELOG.md",
111
+ "launchEditor": true
112
+ }
113
+ },
114
+ "git": {
115
+ "tagName": "v${version}"
116
+ },
117
+ "github": {
118
+ "release": true,
119
+ "tokenRef": "GITHUB_AUTH"
120
+ }
121
+ }
90
122
  }
package/.npmignore DELETED
@@ -1,16 +0,0 @@
1
- /bower_components
2
- /config/ember-try.js
3
- /dist
4
- /tests
5
- /tmp
6
- **/.gitkeep
7
- .bowerrc
8
- .editorconfig
9
- .ember-cli
10
- .gitignore
11
- .eslintrc.js
12
- .watchmanconfig
13
- .travis.yml
14
- bower.json
15
- ember-cli-build.js
16
- testem.js
@@ -1,14 +0,0 @@
1
- import Ember from 'ember';
2
- import VerticalCollection from 'vertical-collection/components/vertical-collection/component';
3
-
4
- Ember.HTMLBars._registerHelper('vertical-collection', (params, hash, options, env) => {
5
- hash.items = params.pop();
6
-
7
- return env.helpers.view.helperFunction.call(this, [VerticalCollection], hash, options, env);
8
- });
9
-
10
- export default {
11
- name: 'vertical-collection-legacy-compat',
12
-
13
- initialize() {}
14
- };
@@ -1,23 +0,0 @@
1
- /* eslint-env node */
2
-
3
- // For details on each option run `ember help release`
4
- module.exports = {
5
-
6
- // angular style guide: https://github.com/angular/angular.js/blob/v1.4.8/CONTRIBUTING.md#commit
7
- // jquery style guide: https://contribute.jquery.org/commits-and-pull-requests/#commit-guidelines
8
- // ember style guide: https://github.com/emberjs/ember.js/blob/master/CONTRIBUTING.md#commit-tagging
9
- style: 'angular', // 'ember' 'jquery'
10
-
11
- head: 'develop',
12
- base: '-last', // a branch or tag name, `-last` defaults to the version in package.json
13
-
14
- hooks: {
15
- /*
16
- parser: function(commit) { return commit; }
17
- filter: function(commit) { return true; },
18
- groupSort: function(commits) { return { commits: commits }; },
19
- format: function(commit) { return commit.title; },
20
- */
21
- }
22
-
23
- };
package/config/release.js DELETED
@@ -1,19 +0,0 @@
1
- /* eslint-env node */
2
- // var RSVP = require('rsvp');
3
- var generateChangelog = require('ember-cli-changelog/lib/tasks/release-with-changelog');
4
-
5
- // For details on each option run `ember help release`
6
- module.exports = {
7
- // local: true,
8
- // remote: 'some_remote',
9
- // annotation: "Release %@",
10
- // message: "Bumped version to %@",
11
- // manifest: [ 'package.json', 'bower.json', 'someconfig.json' ],
12
- // publish: true,
13
- // strategy: 'date',
14
- // format: 'YYYY-MM-DD',
15
- // timezone: 'America/Los_Angeles',
16
-
17
- beforeCommit: generateChangelog
18
-
19
- };