@html-next/vertical-collection 4.0.2 → 5.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 (46) hide show
  1. package/dist/-private/index.js +2 -0
  2. package/dist/-private/index.js.map +1 -0
  3. package/dist/index.js +513 -0
  4. package/dist/index.js.map +1 -0
  5. package/{addon/styles/app.css → dist/occluded-content.css} +11 -1
  6. package/dist/static-radar-D0EvnYLd.js +1676 -0
  7. package/dist/static-radar-D0EvnYLd.js.map +1 -0
  8. package/package.json +64 -79
  9. package/{addon → src}/-private/data-view/elements/occluded-content.js +1 -1
  10. package/{addon/-private/data-view → src/-private/data-view/elements}/viewport-container.js +35 -25
  11. package/{addon → src}/-private/data-view/elements/virtual-component.js +13 -5
  12. package/{addon → src}/-private/data-view/radar/dynamic-radar.js +41 -40
  13. package/{addon → src}/-private/data-view/radar/radar.js +211 -112
  14. package/{addon → src}/-private/data-view/radar/static-radar.js +19 -7
  15. package/{addon → src}/-private/data-view/skip-list.js +20 -21
  16. package/{addon → src}/-private/data-view/utils/insert-range-before.js +6 -1
  17. package/{addon → src}/-private/data-view/utils/mutation-checkers.js +12 -4
  18. package/src/-private/data-view/utils/object-at.js +10 -0
  19. package/{addon → src}/-private/data-view/utils/scroll-handler.js +19 -9
  20. package/{addon → src}/-private/data-view/utils/supports-passive.js +2 -2
  21. package/{addon/-private/data-view/elements → src/-private/data-view}/viewport-container.js +35 -25
  22. package/{addon → src}/-private/ember-internals/key-for-item.js +9 -3
  23. package/{addon → src}/-private/index.js +8 -8
  24. package/{addon → src}/-private/utils/element/closest.js +8 -2
  25. package/{addon → src}/-private/utils/element/estimate-element-height.js +11 -5
  26. package/{addon/components/vertical-collection/component.js → src/components/vertical-collection.gjs} +155 -71
  27. package/src/index.js +3 -0
  28. package/src/occluded-content.css +39 -0
  29. package/.github/workflows/ci.yml +0 -102
  30. package/CHANGELOG.md +0 -176
  31. package/README.md +0 -122
  32. package/RELEASE.md +0 -74
  33. package/addon/-private/data-view/utils/object-at.js +0 -7
  34. package/addon/components/vertical-collection/template.hbs +0 -13
  35. package/app/components/vertical-collection.js +0 -1
  36. package/bin/restore-env.sh +0 -1
  37. package/bin/run-tests-with-retry.sh +0 -24
  38. package/bin/stash-env.sh +0 -1
  39. package/config/ember-cli-toolbelts.json +0 -1
  40. package/config/environment.js +0 -5
  41. package/index.js +0 -157
  42. package/vendor/debug.css +0 -62
  43. /package/{addon → src}/-private/data-view/utils/round-to.js +0 -0
  44. /package/{addon → src}/-private/ember-internals/identity.js +0 -0
  45. /package/{addon → src}/-private/utils/document-shim.js +0 -0
  46. /package/{addon → src}/-private/utils/element/get-scaled-client-rect.js +0 -0
package/CHANGELOG.md DELETED
@@ -1,176 +0,0 @@
1
- Changelog
2
- =========
3
-
4
-
5
-
6
-
7
- ## v4.0.2 (2022-11-17)
8
-
9
- #### :bug: Bug Fix
10
- * [#396](https://github.com/html-next/vertical-collection/pull/396) Fix build for ember-source 4.0+ ([@wagenet](https://github.com/wagenet))
11
-
12
- #### Committers: 1
13
- - Peter Wagenet ([@wagenet](https://github.com/wagenet))
14
-
15
- ## v4.0.1 (2022-11-07)
16
-
17
- #### :memo: Documentation
18
- * [#381](https://github.com/html-next/vertical-collection/pull/381) Fix README ([@runspired](https://github.com/runspired))
19
-
20
- #### Committers: 4
21
- - Alex Navasardyan ([@twokul](https://github.com/twokul))
22
- - Chris Thoburn ([@runspired](https://github.com/runspired))
23
- - Matthew Beale ([@mixonic](https://github.com/mixonic))
24
- - [@Atrue](https://github.com/Atrue)
25
-
26
-
27
- ## v4.0.0 (2022-09-12)
28
-
29
- * Drops support for Ember < 3.12-LTS.
30
- * Drops support for Ember CLI 2.x. https://github.com/html-next/vertical-collection/pull/379
31
- * No change in Node support.
32
- * Drop the positional param for `items` on the vertical collection component.
33
- * Drop ember-compatibility-helpers https://github.com/html-next/vertical-collection/pull/375
34
- * Refactor a bunch of debug code to DEBUG https://github.com/html-next/vertical-collection/pull/388
35
- * Adopt angle bracket invocation
36
- * Adopt native getters
37
-
38
-
39
- ## v4.0.0-beta.2 (2022-09-08)
40
-
41
-
42
- ## v4.0.0-beta.1 (2022-09-07)
43
-
44
-
45
- ## v4.0.0-beta.0 (2022-08-28)
46
-
47
- * Drop support for Ember versions prior to 3.12
48
- * Drop support for Ember CLI 2.x
49
- * Adopt native getters
50
- * Adopt angle bracket invocation
51
- * Drop positional param argument for `item`
52
-
53
-
54
- ## v3.1.0 (2022-08-04)
55
-
56
- #### :rocket: Enhancement
57
- * [#380](https://github.com/html-next/vertical-collection/pull/380) fix: enable parallel builds ([@runspired](https://github.com/runspired))
58
-
59
- #### :bug: Bug Fix
60
- * [#380](https://github.com/html-next/vertical-collection/pull/380) fix: enable parallel builds ([@runspired](https://github.com/runspired))
61
- * [#358](https://github.com/html-next/vertical-collection/pull/358) Delete virtual element ([@Atrue](https://github.com/Atrue))
62
-
63
- #### Committers: 3
64
- - Chris Thoburn ([@runspired](https://github.com/runspired))
65
- - Matthew Beale ([@mixonic](https://github.com/mixonic))
66
- - [@Atrue](https://github.com/Atrue)
67
-
68
- ## v3.0.0 (2022-05-03)
69
-
70
-
71
- ## v3.0.0-1 (2022-03-01)
72
-
73
-
74
- ## v3.0.0-0 (2021-12-09)
75
-
76
- #### What's new
77
-
78
- * Drop support for Ember < 2.18, add support for Ember 4.0+ (#343) (3343ecc)
79
- * 4 retries on CI, 1s sleep (#352) (4a75d99)
80
- * Extend timeout for base tests, tweak retry (#351) (8fff4c7)
81
- * Remove implicit this in tests (#349) (5f58de6)
82
-
83
-
84
- ## v2.1.0 (2021-12-09)
85
-
86
- Changelog:
87
-
88
- * Upgrade ember-cli and dev deps (#348) (e8924e9)
89
- * Drop Ember global use in favor of native API (#347) (d101d8a)
90
- * Proper runloop imports (#346) (a765241)
91
- * Remove property fallback lookup (no implicit this) (#345) (506d798)
92
- * Modernize `htmlSafe` module imports / More cleanup (#344) (32e9460)
93
- * Update CI for vertical-collection v2 (#342) (5613faa)
94
-
95
-
96
- ## v2.0.1 (2021-12-07)
97
-
98
- #### :bug: Bug Fix
99
- * [#322](https://github.com/html-next/vertical-collection/pull/322) Remove comma in selector list in css ([@CubeSquared](https://github.com/CubeSquared))
100
-
101
- #### :house: Internal
102
- * [#336](https://github.com/html-next/vertical-collection/pull/336) Add rwjblue release-it setup ([@rwwagner90](https://github.com/rwwagner90))
103
-
104
- #### Committers: 2
105
- - Matthew Jacobs ([@CubeSquared](https://github.com/CubeSquared))
106
- - Robert Wagner ([@rwwagner90](https://github.com/rwwagner90))
107
-
108
-
109
- ## 0.5.5
110
-
111
- ### Pull Requests
112
-
113
- - [#128](https://github.com/runspired/smoke-and-mirrors/pull/128) **fix**: only update scroll handler length when elements array changes *by [adamjmcgrath](https://github.com/adamjmcgrath)*
114
- - [#126](https://github.com/runspired/smoke-and-mirrors/pull/126) **fix**: update height after render when the item is shown *by [adamjmcgrath](https://github.com/adamjmcgrath)*
115
- - [#136](https://github.com/runspired/smoke-and-mirrors/pull/136) New Release *by [Chris Thoburn](https://github.com/runspired)*
116
- - [#137](https://github.com/runspired/smoke-and-mirrors/pull/137) 0.5.5 *by [Chris Thoburn](https://github.com/runspired)*
117
-
118
- #### Commits
119
-
120
- - [dc04f499](https://github.com/runspired/smoke-and-mirrors/commit/dc04f49924e5b3379df4d97692e5405ad8c393a6) **feat(code-stripping)**: remove classCallChecks for perf, strip unused code from builds *by [Chris Thoburn](https://github.com/runspired)*
121
- - [bf1c02b4](https://github.com/runspired/smoke-and-mirrors/commit/bf1c02b4fa4c5d32c3bad0df9ab3a9e2086184a5) **fix(scroll-handler)**: only update scroll handler length when elements array changes *by [adamjmcgrath](https://github.com/adamjmcgrath)*
122
- - [c6399038](https://github.com/runspired/smoke-and-mirrors/commit/c6399038759d46b234f585f48b8e52a1434a1b46) **fix(vertical-item)**: update height after render when the item is shown *by [adamjmcgrath](https://github.com/adamjmcgrath)*
123
- - [441f7635](https://github.com/runspired/smoke-and-mirrors/commit/441f76359695439ce91bae21cc34309409b6e0bc) **fix(readme)**: cleanup style *by [Chris Thoburn](https://github.com/runspired)*
124
-
125
- ## 0.5.4
126
-
127
- ### Pull Requests
128
-
129
- - [#106](https://github.com/runspired/smoke-and-mirrors/pull/106) Patch Release *by [Chris Thoburn](https://github.com/runspired)*
130
- - [#107](https://github.com/runspired/smoke-and-mirrors/pull/107) fix addon dependency issue *by [Chris Thoburn](https://github.com/runspired)*
131
-
132
- ## 0.5.3
133
-
134
- ## 0.5.2
135
-
136
- ### Pull Requests
137
-
138
- - [#105](https://github.com/runspired/smoke-and-mirrors/pull/105) Fixing links to runspired blog *by [pete_the_pete](https://github.com/pete-the-pete)*
139
- - [#107](https://github.com/runspired/smoke-and-mirrors/pull/107) fix addon dependency issue *by [Chris Thoburn](https://github.com/runspired)*
140
-
141
- ## 0.5.1
142
-
143
- ### Pull Requests
144
-
145
- - [#102](https://github.com/runspired/smoke-and-mirrors/pull/102) patch log output *by [Chris Thoburn](https://github.com/runspired)*
146
- - [#104](https://github.com/runspired/smoke-and-mirrors/pull/104) Include ember-getowner-polyfill in dependencies. *by [Chris Thoburn](https://github.com/runspired)*
147
-
148
- ## 0.5.0
149
-
150
- ### Pull Requests
151
-
152
- - [#100](https://github.com/runspired/smoke-and-mirrors/pull/100) Released 0.4.7 *by [Chris Thoburn](https://github.com/runspired)*
153
-
154
- #### Commits
155
-
156
- - [fc36460c](https://github.com/runspired/smoke-and-mirrors/commit/fc36460c463da33e53c72c6374373e25b3fde996) **fix(changelog)**: updates changelog from last release *by [Chris Thoburn](https://github.com/runspired)*
157
- - [132216e5](https://github.com/runspired/smoke-and-mirrors/commit/132216e5acc0fdd0754a23323ffe97ee6018f2c9) **fix(container)**: use getOwner to resolve deprecation *by [Chris Thoburn](https://github.com/runspired)*
158
- - [e68fcb43](https://github.com/runspired/smoke-and-mirrors/commit/e68fcb43f19517c976ec0cd31b0e3dfe4ee0babe) **fix(visualizer)**: improves teardown *by [Chris Thoburn](https://github.com/runspired)*
159
- - [90138118](https://github.com/runspired/smoke-and-mirrors/commit/90138118c154144c7c29f5d8abab2a60f0d7571d) **fix(geography)**: ensures that destroy sequence completes before update sequence *by [Chris Thoburn](https://github.com/runspired)*
160
- - [a6afb468](https://github.com/runspired/smoke-and-mirrors/commit/a6afb46808a3caa7424c09687d80ed658015c995) **fix(geography)**: don't cycle if we don't have any components *by [Chris Thoburn](https://github.com/runspired)*
161
-
162
- ## 0.4.7
163
-
164
- - [c4aabc20](https://github.com/runspired/smoke-and-mirrors/commit/c4aabc209f2d42668c12b5c121a363384c7b42c4) **fix(changelog-config)**: generate changelog from the develop branch *by [Chris Thoburn](https://github.com/runspired)*
165
- - [917e2e8c](https://github.com/runspired/smoke-and-mirrors/commit/917e2e8c2886116092f38fefb8bf5da2dd70adca) **fix(vertical-collection)**: removes template logic that crept in from smart-collection *by [Chris Thoburn](https://github.com/runspired)*
166
- - [#97](https://github.com/runspired/smoke-and-mirrors/pull/97) Chore/dependencies *by [Chris Thoburn](https://github.com/runspired/chore)*
167
- - [#99](https://github.com/runspired/smoke-and-mirrors/pull/99) Fix (Firefox) *by [Chris Thoburn](https://github.com/runspired)*
168
-
169
- ## 0.4.6
170
-
171
- ## 0.0.0
172
-
173
- - Hold Your Horses,
174
- - Pack Your Parachutes,
175
- - We're Coming,
176
- - But we haven't released anything yet.
package/README.md DELETED
@@ -1,122 +0,0 @@
1
- # vertical-collection
2
-
3
- [![Greenkeeper badge](https://badges.greenkeeper.io/html-next/vertical-collection.svg)](https://greenkeeper.io/)
4
-
5
- [![Build Status](https://travis-ci.org/html-next/vertical-collection.svg)](https://travis-ci.org/html-next/vertical-collection)
6
-
7
- Infinite Scroll and Occlusion at > 60FPS
8
-
9
- `vertical-collection` is an `ember-addon` that is part of the `smoke-and-mirrors` framework. It
10
- focuses on improving initial and re-render performance in high-stress situations by providing a
11
- component for performant lists and `svelte renders` to match a core belief:
12
- **Don't render the universe, render the scene.**
13
-
14
- #### TL;DR svelte render: the fewer things you need to render, the faster your renders will be.
15
-
16
- Your web page is a universe, your viewport is the scene. Much like you wouldn't expect a video game to render
17
- out-of-scene content, your application should smartly cull the content it doesn't need to care about. Trimming
18
- excess content lets the browser perform both initial renders and re-renders at far higher frame-rates, as the only
19
- content it needs to focus on for layout is the content the user can see.
20
-
21
- `vertical-collection` augments your existing app, it doesn't ask you to rewrite layouts or logic in order to use it.
22
- It will try its best to allow you to keep the conventions, structures, and layouts you want.
23
-
24
- ## Install
25
-
26
- ```bash
27
- ember install @html-next/vertical-collection
28
- ```
29
-
30
- ## Usage
31
-
32
- ```htmlbars
33
- <VerticalCollection
34
- @items={{items}}
35
- @tagName="ul"
36
- @estimateHeight={{50}}
37
- @staticHeight={{false}}
38
- @bufferSize={{1}}
39
- @renderAll={{false}}
40
- @renderFromLast={{false}}
41
- @idForFirstItem={{idForFirstItem}}
42
- @firstReached={{firstReachedCallback}}
43
- @lastReached={{lastReachedCallback}}
44
- @firstVisibleChanged={{firstVisibleChangedCallback}}
45
- @lastVisibleChanged={{lastVisibleChangedCallback}}
46
- as |item i|>
47
- <li>
48
- {{item.number}} {{i}}
49
- </li>
50
- </VerticalCollection>
51
- ```
52
-
53
- ### Actions
54
-
55
- `firstReached` - Triggered when scroll reaches the first element in the collection
56
-
57
- `lastReached`- Triggered when scroll reaches the last element in the collection
58
-
59
- `firstVisibleChanged` - Triggered when the first element in the viewport changes
60
-
61
- `lastVisibleChanged` - Triggered when the last element in the viewport changes
62
-
63
- ## Support Matrix
64
-
65
- | `vertical-collection` version | Supported Ember versions | Supported Node versions |
66
- | ----------------------------- | ------------------------ | ----------------------- |
67
- | `^v1.x.x` | `v1.12.0 - v3.8.x` | `?` |
68
- | `^v2.x.x` | `v2.8.0 - v3.26.x` | `v12 - ?` |
69
- | `^v3.x.x` | `v2.18.0+` | `v14+` |
70
- | `^v4.x.x` | `v3.12.0+` | `v14+` |
71
-
72
- ## Support, Questions, Collaboration
73
-
74
- Join the [Ember community on Discord](https://discord.gg/zT3asNS)
75
-
76
- ## Features
77
-
78
- ### Infinite Scroll (bi-directional)
79
-
80
- Infinite scroll that remains performant even for very long lists is easily achievable
81
- with the [`vertical-collection`](http://html-next.github.io/vertical-collection/#/settings).
82
- It works via a scrollable div or scrollable body.
83
-
84
- - [bi-directional scrollable div](http://html-next.github.io/vertical-collection/#/examples/infinite-scroll)
85
- - [scrollable body](http://html-next.github.io/vertical-collection/#/examples/scrollable-body)
86
- - [dynamic content sizes](http://html-next.github.io/vertical-collection/#/examples/flexible-layout)
87
- - [as a table](http://html-next.github.io/vertical-collection/#/examples/dbmon)
88
-
89
- ### Svelte Everything
90
-
91
- If it can be trimmer, vertical-collection likes to trim it.
92
-
93
- ## Status
94
-
95
- [Changelog](./CHANGELOG.md)
96
-
97
- [![Build Status](https://travis-ci.org/html-next/vertical-collection.svg)](https://travis-ci.org/html-next/vertical-collection)
98
- [![dependencies](https://david-dm.org/html-next/vertical-collection.svg)](https://david-dm.org/html-next/vertical-collection)
99
- [![devDependency Status](https://david-dm.org/html-next/vertical-collection/dev-status.svg)](https://david-dm.org/html-next/vertical-collection#info=devDependencies)
100
- [![Coverage Status](https://coveralls.io/repos/html-next/vertical-collection/badge.svg?branch=master&service=github)](https://coveralls.io/github/html-next/vertical-collection?branch=master)
101
-
102
- ## Documentation
103
-
104
- For updated documentation and demos see [http://html-next.github.io/vertical-collection/](http://html-next.github.io/vertical-collection/)
105
-
106
- ## Contributing
107
-
108
- - Open an Issue for discussion first if you're unsure a feature/fix is wanted.
109
- - Branch off of `master` (default branch)
110
- - Use descriptive branch names (e.g. `<type>/<short-description>`)
111
- - PR against `master` (default branch).
112
-
113
- ### Testing
114
-
115
- Make sure you register the test waiter from [ember-raf-scheduler](https://github.com/html-next/ember-raf-scheduler). So `ember-test-helpers`'s `wait` is aware of the scheduled updates.
116
-
117
- An example can be found [here](https://github.com/html-next/vertical-collection/blob/master/tests/test-helper.js#L2)
118
-
119
- License
120
- ------------------------------------------------------------------------------
121
-
122
- This project is licensed under the [MIT License](LICENSE.md).
package/RELEASE.md DELETED
@@ -1,74 +0,0 @@
1
- # Release Process
2
-
3
- Releases are mostly automated using
4
- [release-it](https://github.com/release-it/release-it/) and
5
- [lerna-changelog](https://github.com/lerna/lerna-changelog/).
6
-
7
- ## Preparation
8
-
9
- Since the majority of the actual release process is automated, the primary
10
- remaining task prior to releasing is confirming that all pull requests that
11
- have been merged since the last release have been labeled with the appropriate
12
- `lerna-changelog` labels and the titles have been updated to ensure they
13
- represent something that would make sense to our users. Some great information
14
- on why this is important can be found at
15
- [keepachangelog.com](https://keepachangelog.com/en/1.0.0/), but the overall
16
- guiding principle here is that changelogs are for humans, not machines.
17
-
18
- When reviewing merged PR's the labels to be used are:
19
-
20
- * breaking - Used when the PR is considered a breaking change.
21
- * enhancement - Used when the PR adds a new feature or enhancement.
22
- * bug - Used when the PR fixes a bug included in a previous release.
23
- * documentation - Used when the PR adds or updates documentation.
24
- * internal - Used for internal changes that still require a mention in the
25
- changelog/release notes.
26
-
27
- ## Release
28
-
29
- Once the prep work is completed, the actual release is straight forward:
30
-
31
- * First, ensure that you have installed your projects dependencies:
32
-
33
- ```sh
34
- yarn install
35
- ```
36
-
37
- * Second, ensure that you have obtained a
38
- [GitHub personal access token][generate-token] with the `repo` scope (no
39
- other permissions are needed). Make sure the token is available as the
40
- `GITHUB_AUTH` environment variable.
41
-
42
- For instance:
43
-
44
- ```bash
45
- export GITHUB_AUTH=abc123def456
46
- ```
47
-
48
- [generate-token]: https://github.com/settings/tokens/new?scopes=repo&description=GITHUB_AUTH+env+variable
49
-
50
- * And last (but not least 😁) do your release.
51
-
52
- ```sh
53
- npx release-it
54
- ```
55
-
56
- [release-it](https://github.com/release-it/release-it/) manages the actual
57
- release process. It will prompt you to to choose the version number after which
58
- you will have the chance to hand tweak the changelog to be used (for the
59
- `CHANGELOG.md` and GitHub release), then `release-it` continues on to tagging,
60
- pushing the tag and commits, etc.
61
-
62
- To start a prerelease branch for a new major use:
63
-
64
- ```sh
65
- npx release-it major --preRelease=beta
66
- ```
67
-
68
- On subsequent prerelease run:
69
-
70
- ```sh
71
- npx release-it --preRelease
72
- ```
73
-
74
- For more guidance see https://github.com/release-it/release-it/blob/master/docs/pre-releases.md
@@ -1,7 +0,0 @@
1
- import { assert } from '@ember/debug';
2
-
3
- export default function objectAt(arr, index) {
4
- assert('arr must be an instance of a Javascript Array or implement `objectAt`', Array.isArray(arr) || typeof arr.objectAt === 'function');
5
-
6
- return arr.objectAt ? arr.objectAt(index) : arr[index];
7
- }
@@ -1,13 +0,0 @@
1
- {{#each this.virtualComponents key="id" as |virtualComponent| ~}}
2
- {{~unbound virtualComponent.upperBound~}}
3
- {{~#if virtualComponent.isOccludedContent ~}}
4
- {{{unbound virtualComponent.element}}}
5
- {{~else~}}
6
- {{~yield virtualComponent.content virtualComponent.index ~}}
7
- {{~/if~}}
8
- {{~unbound virtualComponent.lowerBound~}}
9
- {{~/each}}
10
-
11
- {{#if this.shouldYieldToInverse}}
12
- {{yield to="inverse"}}
13
- {{/if}}
@@ -1 +0,0 @@
1
- export { default } from '@html-next/vertical-collection/components/vertical-collection/component';
@@ -1 +0,0 @@
1
- export EMBER_OPTIONAL_FEATURES=$(cat __env)
@@ -1,24 +0,0 @@
1
- #!/bin/bash
2
-
3
- function retry {
4
- command="$*"
5
- retval=1
6
- attempt=1
7
- until [[ $retval -eq 0 ]] || [[ $attempt -gt 4 ]]; do
8
- # Execute inside of a subshell in case parent
9
- # script is running with "set -e"
10
- (
11
- set +e
12
- $command
13
- )
14
- retval=$?
15
- attempt=$(( $attempt + 1 ))
16
- if [[ $retval -ne 0 ]]; then
17
- # If there was an error wait 10 seconds
18
- sleep 1
19
- fi
20
- done
21
- exit $retval
22
- }
23
-
24
- yarn run ember build && retry yarn run ember test --path=dist
package/bin/stash-env.sh DELETED
@@ -1 +0,0 @@
1
- printf '%s' "$EMBER_OPTIONAL_FEATURES" > __env
@@ -1 +0,0 @@
1
- {}
@@ -1,5 +0,0 @@
1
- 'use strict';
2
-
3
- module.exports = function(/* environment, appConfig */) {
4
- return { };
5
- };
package/index.js DELETED
@@ -1,157 +0,0 @@
1
- 'use strict';
2
-
3
- const StripClassCallCheckPlugin = require.resolve('babel6-plugin-strip-class-callcheck');
4
- const Funnel = require('broccoli-funnel');
5
- const Rollup = require('broccoli-rollup');
6
- const merge = require('broccoli-merge-trees');
7
- const VersionChecker = require('ember-cli-version-checker');
8
-
9
- module.exports = {
10
- name: require('./package').name,
11
-
12
- init() {
13
- this._super.init && this._super.init.apply(this, arguments);
14
-
15
- this.options = this.options || {};
16
- },
17
-
18
- getOutputDirForVersion() {
19
- return '';
20
- },
21
-
22
- // Borrowed from ember-cli-babel
23
- _emberVersionRequiresModulesAPIPolyfill() {
24
- let checker = this.checker.for('ember-source', 'npm');
25
-
26
- if (!checker.exists()) {
27
- return true;
28
- }
29
-
30
- return checker.lt('3.27.0-alpha.1');
31
- },
32
-
33
- treeForAddon(tree) {
34
- let babel = this.addons.find((addon) => addon.name === 'ember-cli-babel');
35
- let withPrivate = new Funnel(tree, { include: ['-private/**'] });
36
- let withoutPrivate = new Funnel(tree, {
37
- exclude: [
38
- '**/**.hbs',
39
- '-private'
40
- ],
41
- destDir: '@html-next/vertical-collection'
42
- });
43
-
44
- let privateTree = babel.transpileTree(withPrivate, {
45
- babel: this.options.babel,
46
- 'ember-cli-babel': {
47
- // we leave our output as valid ES
48
- // for the consuming app's config to transpile as desired
49
- // so we don't want to compileModules to amd here
50
- compileModules: false,
51
-
52
- disableEmberModulesAPIPolyfill: !this._emberVersionRequiresModulesAPIPolyfill(),
53
-
54
- // TODO for the embroider world we want to leave our -private module
55
- // as an es module and only transpile the few things we genuinely care about.
56
- // ideally this would occur as a pre-publish step so that consuming apps would
57
- // just see a `-private.js` file and not pay any additional costs.
58
- // CURRENTLY we transpile the -private module fully acccording to the
59
- // consuming app's config, so we must leave these enabled.
60
- disablePresetEnv: false,
61
- disableDebugTooling: false,
62
- disableDecoratorTransforms: false,
63
- enableTypeScriptTransform: true,
64
-
65
- throwUnlessParallelizable: true,
66
-
67
- // consuming app will take care of this if needed,
68
- // we don't need to also include
69
- includePolyfill: false,
70
-
71
- extensions: ['js', 'ts'],
72
- },
73
- });
74
-
75
- const templateTree = new Funnel(tree, {
76
- include: ['**/**.hbs']
77
- });
78
-
79
- // use the default options
80
- const addonTemplateTree = this._super(templateTree);
81
- let publicTree = babel.transpileTree(withoutPrivate);
82
-
83
- privateTree = new Rollup(privateTree, {
84
- rollup: {
85
- input: '-private/index.js',
86
- output: [
87
- {
88
- file: '@html-next/vertical-collection/-private.js',
89
- format: 'amd',
90
- amd: {
91
- id: '@html-next/vertical-collection/-private'
92
- }
93
- }
94
- ],
95
- external(id) {
96
- return (
97
- id.startsWith('@ember/') ||
98
- ['ember', 'ember-raf-scheduler'].includes(id)
99
- );
100
- },
101
- },
102
- });
103
-
104
- let destDir = this.getOutputDirForVersion();
105
- publicTree = new Funnel(publicTree, { destDir });
106
- privateTree = new Funnel(privateTree, { destDir });
107
-
108
- return merge([
109
- addonTemplateTree,
110
- publicTree,
111
- privateTree
112
- ]);
113
- },
114
-
115
- _hasSetupBabelOptions: false,
116
- buildBabelOptions(originalOptions) {
117
- const plugins = originalOptions.plugins || [];
118
-
119
- const opts = {
120
- loose: true,
121
- plugins,
122
- postTransformPlugins: [[StripClassCallCheckPlugin, {}]]
123
- };
124
-
125
- return opts;
126
- },
127
- _setupBabelOptions() {
128
- if (this._hasSetupBabelOptions) {
129
- return;
130
- }
131
-
132
- this.options.babel = this.buildBabelOptions(this.options.babel);
133
-
134
- this._hasSetupBabelOptions = true;
135
- },
136
-
137
- included(app) {
138
- this._super.included.apply(this, arguments);
139
- this.checker = new VersionChecker(app);
140
-
141
- while (typeof app.import !== 'function' && app.app) {
142
- app = app.app;
143
- }
144
-
145
- if (typeof app.import !== 'function') {
146
- throw new Error('vertical-collection is being used within another addon or engine '
147
- + 'and is having trouble registering itself to the parent application.');
148
- }
149
-
150
- this._env = app.env;
151
- this._setupBabelOptions(app.env);
152
-
153
- if (!/production/.test(app.env) && !/test/.test(app.env)) {
154
- this.import('vendor/debug.css');
155
- }
156
- }
157
- };
package/vendor/debug.css DELETED
@@ -1,62 +0,0 @@
1
- /**!
2
- Visualization Classes for debugging the vertical-collection
3
- */
4
- .vertical-collection-visual-debugger {
5
- height: 100%;
6
- position: fixed;
7
- z-index: 1000;
8
- top: 0;
9
- left: 0;
10
- display: flex;
11
- align-items: center;
12
- justify-content: left;
13
- background: rgba(50, 50, 50, 1);
14
- width: 125px;
15
- }
16
-
17
- .vertical-collection-visual-debugger .vc_visualization-container {
18
- transform: scale(0.25);
19
- left: 0;
20
- position: relative;
21
- }
22
-
23
-
24
- .vertical-collection-visual-debugger .vc_visualization-screen {
25
- position: absolute;
26
- background: transparent;
27
- box-sizing: content-box;
28
- border-top: 2px dashed yellow;
29
- border-bottom: 2px dashed yellow;
30
- width: 500px;
31
- }
32
-
33
- .vertical-collection-visual-debugger .vc_visualization-scroll-container {
34
- position: absolute;
35
- width: 500px;
36
- background: rgba(100, 230, 100, 0.65);
37
- }
38
-
39
- .vertical-collection-visual-debugger .vc_visualization-item-container {
40
- position: absolute;
41
- width: 500px;
42
- background: rgba(255, 255, 255, .15);
43
- }
44
-
45
- .vertical-collection-visual-debugger .vc_visualization-virtual-component {
46
- box-sizing: border-box;
47
- background: rgba(230, 100, 230, 0.6);
48
- border: 1px dotted #bbb;
49
- border-top: 0px;
50
- color: #fff;
51
- text-align: center;
52
- font-size: 2.5em;
53
- width: 250px;
54
- }
55
-
56
- .vertical-collection-visual-debugger .vc_visualization-virtual-component:first-of-type {
57
- border-top: 1px dotted #bbb;
58
- }
59
-
60
- .vertical-collection-visual-debugger .vc_visualization-virtual-component.culled {
61
- background: transparent;
62
- }
File without changes