-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP : multi panels (for question comment purpose) #24
Conversation
components/MultiPanel/index.ts
Outdated
|
||
// Click event handler | ||
_onClick(event) { | ||
const heading : Element = event.target; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know what to do with types when we are doing simple event listeners...
When I do
_onClick(event : Event) {
const heading : Element = event.target
}
then type script yells Type 'EventTarget | null' is not assignable to type 'Element'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can go one of two ways with this. If you think event.target
can only ever be an Element
, you can do:
const heading = event.target as Element;
See https://www.typescriptlang.org/docs/handbook/basic-types.html#type-assertions.
However, if TypeScript is being helpful, you can make use of type guards.
if (!(event.target instanceof Element)) return;
const heading: Element = event.target;
The above works, because TypeScript infers that event.target
must be an Element
.
components/MultiPanel/index.ts
Outdated
currentHeading.setAttribute('tabindex', '-1'); | ||
if (newHeading) { | ||
newHeading.setAttribute('tabindex', '0'); | ||
newHeading.focus(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Type script is yelling Property 'focus' does not exist on type 'Element'
here... but I can't find the way to make return of _allHeadings
to HTMLElement
...
break; | ||
|
||
case 'Enter': | ||
case ' ': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we want to support IEs and FF before 37, then Spacebar
might be needed here.
https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need to support those browsers for this project, but in terms of using this component outside this project, I'll leave it up to you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
handled by adding case 'Spacebar':
return; | ||
} | ||
let newHeading; | ||
switch (event.key) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
switched to using event.key per @mathiasbynens's suggestion on previouse commit :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work — I love it! So readable 👍🏻
components/MultiPanel/index.ts
Outdated
this._childrenChange(); | ||
|
||
const children : Element[] = Array.from(this.children); | ||
for (let i : number = 0; i < children.length; i++){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: use forEach
instead of a hand-written loop. forEach
is highly optimized for proper arrays in V8, so it’s likely faster, and it still gives you access to the index
variable (unlike for
-of
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(https://v8project.blogspot.com/2017/09/elements-kinds-in-v8.html if you’re interested in the background)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hah, I recommended for-of below. Which is better? Fwiw I think we should be optimising for readability over what Chrome does fastest on a particular day.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fwiw I think we should be optimising for readability over what Chrome does fastest on a particular day.
To be clear, I fully agree with this, and this matches our general V8 messaging.
In this case, a handwritten for
loop expresses implementation, whereas for-of
+ entries
or forEach
would express intent. Expressing intent often leads to more readable code, IMHO.
forEach
likely being faster than for
in this case is an indirect result of that (and a nice little bonus). By expressing intent rather than implementation, you generally give the JS engine more information to work with, often leading to greater behind-the-scenes optimization potential.
components/MultiPanel/index.ts
Outdated
_prevHeading () { | ||
const headings : Element[] = this._allHeadings(); | ||
let newIdx : number = headings.findIndex(headings => headings === document.activeElement) - 1; | ||
return headings[(newIdx + headings.length) % headings.length]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe document the edge cases here? E.g. when headings contains a single element, this code just returns that.
components/MultiPanel/index.ts
Outdated
|
||
const children : Element[] = Array.from(this.children); | ||
for (let i : number = 0; i < children.length; i++){ | ||
const child : Element = children[i] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Our target browsers support:
for (const [i, child] of children.entries())
I'm undecided if this is better or not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Between that or forEach((child, index) => { … })
, I don’t really have a preference. I do think either of those are nicer than the hand-written for
loop though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No preference here either.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why use an Array at all?
let child = this.firstElementChild;
while (child) {
// stuff
child = child.nextElementSibling;
}
- nice balance of readability and performance
- avoids the array casting entirely
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Array operations are heavily optimized in V8 for actual arrays. The one-off cost of casting to an array is usually worth the later performance benefits when operating on the array (as opposed to an array-like object). (shameless https://www.youtube.com/watch?v=m9cTaYI95Zc plug in case anyone wants more info)
TL;DR Don’t think of the Array.from()
as overhead.
components/MultiPanel/index.ts
Outdated
_childrenChange () { | ||
if (this.children.length % 2 !== 0) { | ||
console.error('detected odd number of elements inside multi-panel, please make sure you have heading/content pair') | ||
this.appendChild(document.createElement('div')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm unsure about this as a fix. Imagine code like this:
multiPanel.append(parse(`<h1>Hello!</h1>`));
const data = await fetch(content).then(r => r.json());
multiPanel.append(parse(data.html));
In the above the developer is adding a heading, then going to the network to fetch the content. However, you're going to add an extra div after their heading, meaning their 'content' is going to be treated as a heading.
components/MultiPanel/index.ts
Outdated
|
||
// add EventListners | ||
this.addEventListener('click', this._onClick); | ||
this.addEventListener('keydown', this._onKeyDown); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can just add these in the constructor.
components/MultiPanel/index.ts
Outdated
// remove EventListeners | ||
disconnectedCallback() { | ||
this.removeEventListener('click', this._onClick); | ||
this.removeEventListener('keydown', this._onKeyDown); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you add the listeners in the constructor, you don't need to remove them here.
components/MultiPanel/index.ts
Outdated
} | ||
|
||
connectedCallback () { | ||
this._childrenChange(); | ||
|
||
const children : Element[] = Array.from(this.children); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The following code assumes the internals of the multi-panel are complete once the element is connected, and never change after that. Ideally that shouldn't be assumed. It'd be better to observe this stuff in _childrenChange
and react to elements coming and going.
components/MultiPanel/index.ts
Outdated
child.classList.add('panel-heading'); | ||
|
||
// for A11y | ||
child.id = `panel-heading-${i}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the child already has an ID we shouldn't overwrite it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ohh, and you're going to get duplication of IDs if you have two <multi-panel>
s. Maybe generate a random ID?
components/MultiPanel/index.ts
Outdated
} | ||
|
||
// make the first heading focusable. | ||
children[0].setAttribute('tabindex', '0'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details a better primitive here in terms of accessibility? @surma did you ever look into this?
It might be that <details>
buggers up too much when it comes to animation.
components/MultiPanel/index.ts
Outdated
const heading : Element = event.target; | ||
if (this._isHeading(heading)) { | ||
this._expand(heading); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This breaks if the user clicks an element inside the heading. As in:
<h1>Hello <em>world</em></h1>
Clicking world
won't work.
Instead of _isHeading
, maybe write something like _getClosestHeading
? el.closest('multi-panel > *')
will help here.
_getClosestHeading
should return undefined/null if the user didn't click within a heading.
components/MultiPanel/index.ts
Outdated
// if clicke event is not on heading element, ignore | ||
if (!this._isHeading(currentHeading)) { | ||
return; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be worth looking at user defined type guards here.
That way, you can tell TypeScript that, if _isHeading
returns true, the type of currentHeading
must be HTMLElement
or whatever.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: if you do the _closestHeading
thing I mentioned above, _isHeading
is still the best thing to use in this case.
// don’t handle modifier shortcuts used by assistive technology. | ||
if (event.altKey) { | ||
return; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch!
components/MultiPanel/index.ts
Outdated
|
||
// return list of panel heading elements | ||
_allHeadings () { | ||
return Array.from(this.querySelectorAll('.panel-heading')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will also pick up heading of multi-selects
inside this one. this.querySelectorAll(':scope > .panel-heading')
would prevent this.
components/MultiPanel/index.ts
Outdated
|
||
// returns headding that is before currently selected one. | ||
_prevHeading () { | ||
const headings : Element[] = this._allHeadings(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It'd be more efficient to use currentHeading.previousElementSibling
to find the previous heading, as you don't have to look up all headings.
components/MultiPanel/index.ts
Outdated
// returns first heading in multi-panel. | ||
_firstHeading () { | ||
const headings : Element[] = this._allHeadings(); | ||
return headings[0]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this would be faster:
return this.firstElementChild;
components/MultiPanel/index.ts
Outdated
// returns last heading in multi-panel. | ||
_lastHeading () { | ||
const headings : Element[] = this._allHeadings(); | ||
return headings[headings.length - 1]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this would be faster:
const children = this.children;
if (children.length % 1) {
// Odd number of children. Last one must be a heading.
return children[children.length - 1];
}
// Otherwise, the second-last child is the heading.
return children[children.length - 2];
Status : This component currently assumes there is always a set of If developer using this component does something like below (per @jakearchibald's review) and user click on heading before content is created, it should be fine (simply no
however, if developer inserts element in async way like above in the middle of multi panel children... it will mess up which panel to be 'expanded'. Not sure expecting dev user to "always append 2 elements together" is a reasonable expectation (code will be simpler !) or we should bullet proof this with unique ID approach and control element gets expanded based on ID. note: currently unique id is assigned just for A11y but not for control. |
let tabindexAlreadySet : boolean = false; | ||
let randomId : string; | ||
|
||
children.forEach((child, i) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this would be more readable as:
for (let i = 0; i < children.length; i += 2) {
const heading = children[i];
const content = children[i+1];
const randomId = Math.random().toString(36).substr(2, 9);
// …
}
As you don't need to do the odd/even check, and randomId
gets better scoping.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
handled this in suggested way.
if(i % 2 === 0){ | ||
// even index = heading element | ||
|
||
// if panel-heading class is already assigned to the element (= new child was added later), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Earlier?
|
||
// if panel-heading class is already assigned to the element (= new child was added later), | ||
// skip the ID/tabindex setting activities & just flag tabindexAlreadySet | ||
if (!child.classList.contains('panel-heading')){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there's an if statement with a short part & a long part, I think it's more readable to handle the short part first. In some cases it means you can avoid the else
. In this case:
if (child.classList.contains('panel-heading')) {
tabIndexAlreadySet = true;
return;
}
child.classList.add('panel-heading');
// …
The return
will need to be continue
if you change this to a for-loop.
// even index = heading element | ||
|
||
// if panel-heading class is already assigned to the element (= new child was added later), | ||
// skip the ID/tabindex setting activities & just flag tabindexAlreadySet |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this strategy has problems if you replace just a heading, or just the content. Or, if you swap some headings around but not the content.
closing this in lieu of #95 |
# This is the 1st commit message: Add position reset button and update zoom interaction. (GoogleChromeLabs#292) (GoogleChromeLabs#345) # The commit message GoogleChromeLabs#2 will be skipped: # 1.2.3 # The commit message GoogleChromeLabs#3 will be skipped: # Prevent both sides sharing a download URL. (GoogleChromeLabs#369) # # The commit message GoogleChromeLabs#4 will be skipped: # Add basic history handling (GoogleChromeLabs#288) (GoogleChromeLabs#309) # # * Add basic history handling (GoogleChromeLabs#288) # # * Move history management to Compress component # # * Remove unused pathname property from history # # * Rename history listener functions # # * Use history.back instead of history.replace # # * Support going forward in history. Persist last selected file in runtime # # * Add netlify redirects file # # * Use 301 status code for redirect # # * Cleanup _redirects file # # * Use 200 status code for redirects # # * Simplify onPopState function # # * Always redirect to 301 with url rewrite # # * Remove redundant history function # # * Remove file check on render. Call openEditor synchronously # # * Use pushState only if user is on the initial screen. Mount history listener in constructor # # * Simplify openEditor condition # # * Update early return condition # # * Rolling abstractions back into the main component # The commit message GoogleChromeLabs#5 will be skipped: # 1.3.0 # The commit message GoogleChromeLabs#6 will be skipped: # Add renovate.json # The commit message GoogleChromeLabs#7 will be skipped: # Merge pull request GoogleChromeLabs#373 from GoogleChromeLabs/renovate/configure # # Configure Renovate # The commit message GoogleChromeLabs#8 will be skipped: # Pin dependencies # The commit message GoogleChromeLabs#9 will be skipped: # Merge pull request GoogleChromeLabs#374 from GoogleChromeLabs/renovate/pin-dependencies # # Pin dependencies # The commit message GoogleChromeLabs#10 will be skipped: # Update dependency mini-css-extract-plugin to v0.5.0 # The commit message GoogleChromeLabs#11 will be skipped: # Merge pull request GoogleChromeLabs#380 from GoogleChromeLabs/renovate/mini-css-extract-plugin-0.x # # Update dependency mini-css-extract-plugin to v0.5.0 # The commit message GoogleChromeLabs#12 will be skipped: # Update dependency @types/node to v10.12.14 # The commit message GoogleChromeLabs#13 will be skipped: # Merge pull request GoogleChromeLabs#376 from GoogleChromeLabs/renovate/node-10.x # # Update dependency @types/node to v10.12.14 # The commit message GoogleChromeLabs#14 will be skipped: # Update dependency @types/node to v10.12.15 # The commit message GoogleChromeLabs#15 will be skipped: # Merge pull request GoogleChromeLabs#384 from GoogleChromeLabs/renovate/node-10.x # # Update dependency @types/node to v10.12.15 # The commit message GoogleChromeLabs#16 will be skipped: # Update dependency comlink to v3.1.1 # The commit message GoogleChromeLabs#17 will be skipped: # Merge pull request GoogleChromeLabs#377 from GoogleChromeLabs/renovate/comlink-3.x # # Update dependency comlink to v3.1.1 # The commit message GoogleChromeLabs#18 will be skipped: # Update dependency @types/webassembly-js-api to v0.0.2 # The commit message GoogleChromeLabs#19 will be skipped: # Merge pull request GoogleChromeLabs#375 from GoogleChromeLabs/renovate/webassembly-js-api-0.x # # Update dependency @types/webassembly-js-api to v0.0.2 # The commit message GoogleChromeLabs#20 will be skipped: # Update dependency critters-webpack-plugin to v2.1.1 # The commit message GoogleChromeLabs#21 will be skipped: # Merge pull request GoogleChromeLabs#378 from GoogleChromeLabs/renovate/critters-webpack-plugin-2.x # # Update dependency critters-webpack-plugin to v2.1.1 # The commit message GoogleChromeLabs#22 will be skipped: # Update dependency husky to v1.2.1 # The commit message GoogleChromeLabs#23 will be skipped: # Merge pull request GoogleChromeLabs#379 from GoogleChromeLabs/renovate/husky-1.x # # Update dependency husky to v1.2.1 # The commit message GoogleChromeLabs#24 will be skipped: # Update dependency preact to v8.4.2 # The commit message GoogleChromeLabs#25 will be skipped: # Merge pull request GoogleChromeLabs#381 from GoogleChromeLabs/renovate/preact-8.x # # Update dependency preact to v8.4.2 # The commit message GoogleChromeLabs#26 will be skipped: # Update dependency ts-loader to v5.3.1 # The commit message GoogleChromeLabs#27 will be skipped: # Merge pull request GoogleChromeLabs#382 from GoogleChromeLabs/renovate/ts-loader-5.x # # Update dependency ts-loader to v5.3.1 # The commit message GoogleChromeLabs#28 will be skipped: # Update dependency tslint-config-airbnb to v5.11.1 # The commit message GoogleChromeLabs#29 will be skipped: # Merge pull request GoogleChromeLabs#383 from GoogleChromeLabs/renovate/tslint-config-airbnb-5.x # # Update dependency tslint-config-airbnb to v5.11.1 # The commit message GoogleChromeLabs#30 will be skipped: # Update dependency webpack to v4.27.1 # The commit message GoogleChromeLabs#31 will be skipped: # Merge pull request GoogleChromeLabs#386 from GoogleChromeLabs/renovate/webpack-4.x # # Update dependency webpack to v4.27.1 # The commit message GoogleChromeLabs#32 will be skipped: # Update dependency raw-loader to v1 # The commit message GoogleChromeLabs#33 will be skipped: # Merge pull request GoogleChromeLabs#388 from GoogleChromeLabs/renovate/raw-loader-1.x # # Update dependency raw-loader to v1 # The commit message GoogleChromeLabs#34 will be skipped: # Update dependency worker-plugin to v3 # The commit message GoogleChromeLabs#35 will be skipped: # Merge pull request GoogleChromeLabs#390 from GoogleChromeLabs/renovate/worker-plugin-3.x # # Update dependency worker-plugin to v3 # The commit message GoogleChromeLabs#36 will be skipped: # Fixing sharp & preprocess settings # The commit message GoogleChromeLabs#37 will be skipped: # Using use_argb conditionally # The commit message GoogleChromeLabs#38 will be skipped: # Merge pull request GoogleChromeLabs#393 from GoogleChromeLabs/webp-sharp-fix # # Fixing sharp & preprocess settings. Fixes GoogleChromeLabs#392. # The commit message GoogleChromeLabs#39 will be skipped: # Debouncing input. Fixes GoogleChromeLabs#277 (GoogleChromeLabs#394) # # * Debouncing input # # * Clarifying comment # # * More comments and clarifications # The commit message GoogleChromeLabs#40 will be skipped: # Update dependency typescript to v3.2.2 # The commit message GoogleChromeLabs#41 will be skipped: # Fix typings for TypeScript v3.2 # The commit message GoogleChromeLabs#42 will be skipped: # Merge pull request GoogleChromeLabs#385 from GoogleChromeLabs/renovate/typescript-3.x # # Update dependency typescript to v3.2.2 # The commit message GoogleChromeLabs#43 will be skipped: # Preventing zoom in iOS Safari. (GoogleChromeLabs#395) # # The commit message GoogleChromeLabs#44 will be skipped: # Update README.md # # closes GoogleChromeLabs#367 # updating incorrect URL # The commit message GoogleChromeLabs#45 will be skipped: # Merge pull request GoogleChromeLabs#396 from GoogleChromeLabs/kosamari-patch-2 # # Update README.md for OptiPNG # The commit message GoogleChromeLabs#46 will be skipped: # 1.3.1 # The commit message GoogleChromeLabs#47 will be skipped: # Update dependency tslint to v5.12.0 # The commit message GoogleChromeLabs#48 will be skipped: # Merge pull request GoogleChromeLabs#398 from GoogleChromeLabs/renovate/tslint-5.x # # Update dependency tslint to v5.12.0 # The commit message GoogleChromeLabs#49 will be skipped: # Update dependency husky to v1.3.0 # The commit message GoogleChromeLabs#50 will be skipped: # Merge pull request GoogleChromeLabs#399 from GoogleChromeLabs/renovate/husky-1.x # # Update dependency husky to v1.3.0 # The commit message GoogleChromeLabs#51 will be skipped: # Update dependency @types/node to v10.12.17 # The commit message GoogleChromeLabs#52 will be skipped: # Merge pull request GoogleChromeLabs#400 from GoogleChromeLabs/renovate/node-10.x # # Update dependency @types/node to v10.12.17 # The commit message GoogleChromeLabs#53 will be skipped: # Update dependency webpack to v4.28.0 # The commit message GoogleChromeLabs#54 will be skipped: # Merge pull request GoogleChromeLabs#402 from GoogleChromeLabs/renovate/webpack-4.x # # Update dependency webpack to v4.28.0 # The commit message GoogleChromeLabs#55 will be skipped: # Update dependency @types/node to v10.12.18 # The commit message GoogleChromeLabs#56 will be skipped: # Merge pull request GoogleChromeLabs#403 from GoogleChromeLabs/renovate/node-10.x # # Update dependency @types/node to v10.12.18 # The commit message GoogleChromeLabs#57 will be skipped: # Update dependency file-loader to v3 # The commit message GoogleChromeLabs#58 will be skipped: # Merge pull request GoogleChromeLabs#404 from GoogleChromeLabs/renovate/file-loader-3.x # # Update dependency file-loader to v3 # The commit message GoogleChromeLabs#59 will be skipped: # Update dependency ts-loader to v5.3.2 # The commit message GoogleChromeLabs#60 will be skipped: # Merge pull request GoogleChromeLabs#406 from GoogleChromeLabs/renovate/ts-loader-5.x # # Update dependency ts-loader to v5.3.2 # The commit message GoogleChromeLabs#61 will be skipped: # Update dependency webpack-dev-server to v3.1.11 # The commit message GoogleChromeLabs#62 will be skipped: # Merge pull request GoogleChromeLabs#407 from GoogleChromeLabs/renovate/webpack-dev-server-3.x # # Update dependency webpack-dev-server to v3.1.11 # The commit message GoogleChromeLabs#63 will be skipped: # Update dependency webpack-dev-server to v3.1.12 # The commit message GoogleChromeLabs#64 will be skipped: # Merge pull request GoogleChromeLabs#408 from GoogleChromeLabs/renovate/webpack-dev-server-3.x # # Update dependency webpack-dev-server to v3.1.12 # The commit message GoogleChromeLabs#65 will be skipped: # Update dependency terser-webpack-plugin to v1.2.0 # The commit message GoogleChromeLabs#66 will be skipped: # Merge pull request GoogleChromeLabs#409 from GoogleChromeLabs/renovate/terser-webpack-plugin-1.x # # Update dependency terser-webpack-plugin to v1.2.0 # The commit message GoogleChromeLabs#67 will be skipped: # Update dependency webpack-dev-server to v3.1.13 # The commit message GoogleChromeLabs#68 will be skipped: # Merge pull request GoogleChromeLabs#410 from GoogleChromeLabs/renovate/webpack-dev-server-3.x # # Update dependency webpack-dev-server to v3.1.13 # The commit message GoogleChromeLabs#69 will be skipped: # Update dependency webpack-dev-server to v3.1.14 # The commit message GoogleChromeLabs#70 will be skipped: # Merge pull request GoogleChromeLabs#411 from GoogleChromeLabs/renovate/webpack-dev-server-3.x # # Update dependency webpack-dev-server to v3.1.14 # The commit message GoogleChromeLabs#71 will be skipped: # Update dependency loader-utils to v1.2.0 # The commit message GoogleChromeLabs#72 will be skipped: # Merge pull request GoogleChromeLabs#412 from GoogleChromeLabs/renovate/loader-utils-1.x # # Update dependency loader-utils to v1.2.0 # The commit message GoogleChromeLabs#73 will be skipped: # Update dependency terser-webpack-plugin to v1.2.1 # The commit message GoogleChromeLabs#74 will be skipped: # Merge pull request GoogleChromeLabs#414 from GoogleChromeLabs/renovate/terser-webpack-plugin-1.x # # Update dependency terser-webpack-plugin to v1.2.1 # The commit message GoogleChromeLabs#75 will be skipped: # Update dependency husky to v1.3.1 # The commit message GoogleChromeLabs#76 will be skipped: # Merge pull request GoogleChromeLabs#418 from GoogleChromeLabs/renovate/husky-1.x # # Update dependency husky to v1.3.1 # The commit message GoogleChromeLabs#77 will be skipped: # Update dependency webpack-cli to v3.2.0 # The commit message GoogleChromeLabs#78 will be skipped: # Merge pull request GoogleChromeLabs#421 from GoogleChromeLabs/renovate/webpack-cli-3.x # # Update dependency webpack-cli to v3.2.0 # The commit message GoogleChromeLabs#79 will be skipped: # Update dependency @webpack-cli/serve to v0.1.3 # The commit message GoogleChromeLabs#80 will be skipped: # Merge pull request GoogleChromeLabs#420 from GoogleChromeLabs/renovate/webpack-cli-serve-0.x # # Update dependency @webpack-cli/serve to v0.1.3 # The commit message GoogleChromeLabs#81 will be skipped: # Update dependency critters-webpack-plugin to v2.1.2 # The commit message GoogleChromeLabs#82 will be skipped: # Merge pull request GoogleChromeLabs#415 from GoogleChromeLabs/renovate/critters-webpack-plugin-2.x # # Update dependency critters-webpack-plugin to v2.1.2 # The commit message GoogleChromeLabs#83 will be skipped: # Update dependency ts-loader to v5.3.3 # The commit message GoogleChromeLabs#84 will be skipped: # Merge pull request GoogleChromeLabs#423 from GoogleChromeLabs/renovate/ts-loader-5.x # # Update dependency ts-loader to v5.3.3 # The commit message GoogleChromeLabs#85 will be skipped: # Update dependency critters-webpack-plugin to v2.1.3 # The commit message GoogleChromeLabs#86 will be skipped: # Merge pull request GoogleChromeLabs#422 from GoogleChromeLabs/renovate/critters-webpack-plugin-2.x # # Update dependency critters-webpack-plugin to v2.1.3 # The commit message GoogleChromeLabs#87 will be skipped: # Update dependency webpack-cli to v3.2.1 # The commit message GoogleChromeLabs#88 will be skipped: # Merge pull request GoogleChromeLabs#424 from GoogleChromeLabs/renovate/webpack-cli-3.x # # Update dependency webpack-cli to v3.2.1 # The commit message GoogleChromeLabs#89 will be skipped: # Update dependency tslint to v5.12.1 # The commit message GoogleChromeLabs#90 will be skipped: # Merge pull request GoogleChromeLabs#427 from GoogleChromeLabs/renovate/tslint-5.x # # Update dependency tslint to v5.12.1 # The commit message GoogleChromeLabs#91 will be skipped: # Update dependency typescript to v3.2.4 # The commit message GoogleChromeLabs#92 will be skipped: # Merge pull request GoogleChromeLabs#431 from GoogleChromeLabs/renovate/typescript-3.x # # Update dependency typescript to v3.2.4 # The commit message GoogleChromeLabs#93 will be skipped: # Update dependency critters-webpack-plugin to v2.2.0 # The commit message GoogleChromeLabs#94 will be skipped: # Merge pull request GoogleChromeLabs#432 from GoogleChromeLabs/renovate/critters-webpack-plugin-2.x # # Update dependency critters-webpack-plugin to v2.2.0 # The commit message GoogleChromeLabs#95 will be skipped: # Update dependency clean-webpack-plugin to v1.0.1 # The commit message GoogleChromeLabs#96 will be skipped: # Merge pull request GoogleChromeLabs#434 from GoogleChromeLabs/renovate/clean-webpack-plugin-1.x # # Update dependency clean-webpack-plugin to v1.0.1 # The commit message GoogleChromeLabs#97 will be skipped: # Update dependency progress-bar-webpack-plugin to v1.12.0 # The commit message GoogleChromeLabs#98 will be skipped: # Merge pull request GoogleChromeLabs#435 from GoogleChromeLabs/renovate/progress-bar-webpack-plugin-1.x # # Update dependency progress-bar-webpack-plugin to v1.12.0 # The commit message GoogleChromeLabs#99 will be skipped: # Add rotate user timing # The commit message GoogleChromeLabs#100 will be skipped: # Use Uint32Array to copy an entire pixel per op # The commit message GoogleChromeLabs#101 will be skipped: # Revert "Add rotate user timing" # # This reverts commit 887db67. # The commit message GoogleChromeLabs#102 will be skipped: # Remove unused bpp # The commit message GoogleChromeLabs#103 will be skipped: # Merge pull request GoogleChromeLabs#436 from GoogleChromeLabs/optimize-rotate # # Optimize rotate # The commit message GoogleChromeLabs#104 will be skipped: # Update dependency @types/node to v10.12.19 # The commit message GoogleChromeLabs#105 will be skipped: # Merge pull request GoogleChromeLabs#441 from GoogleChromeLabs/renovate/node-10.x # # Update dependency @types/node to v10.12.19 # The commit message GoogleChromeLabs#106 will be skipped: # Update dependency progress-bar-webpack-plugin to v1.12.1 # The commit message GoogleChromeLabs#107 will be skipped: # Merge pull request GoogleChromeLabs#442 from GoogleChromeLabs/renovate/progress-bar-webpack-plugin-1.x # # Update dependency progress-bar-webpack-plugin to v1.12.1 # The commit message GoogleChromeLabs#108 will be skipped: # Update dependency @types/node to v10.12.20 # The commit message GoogleChromeLabs#109 will be skipped: # Merge pull request GoogleChromeLabs#443 from GoogleChromeLabs/renovate/node-10.x # # Update dependency @types/node to v10.12.20 # The commit message GoogleChromeLabs#110 will be skipped: # Update dependency @types/node to v10.12.21 # The commit message GoogleChromeLabs#111 will be skipped: # Merge pull request GoogleChromeLabs#445 from GoogleChromeLabs/renovate/node-10.x # # Update dependency @types/node to v10.12.21 # The commit message GoogleChromeLabs#112 will be skipped: # This fixes GoogleChromeLabs#446 and sometimes it's best not to ask too many questions. (GoogleChromeLabs#447) # # The commit message GoogleChromeLabs#113 will be skipped: # Update dependency terser-webpack-plugin to v1.2.2 # The commit message GoogleChromeLabs#114 will be skipped: # Merge pull request GoogleChromeLabs#448 from GoogleChromeLabs/renovate/terser-webpack-plugin-1.x # # Update dependency terser-webpack-plugin to v1.2.2 # The commit message GoogleChromeLabs#115 will be skipped: # # This is a combination of 20 commits. # # This is the 1st commit message: # Merge from upstream/master branch # # # This is the commit message GoogleChromeLabs#2: # # Update zoom and positioning behaviours # # # This is the commit message GoogleChromeLabs#3: # # Merge branch 'master' into update-zoom-interaction # # # This is the commit message GoogleChromeLabs#4: # # Merge branch 'master' into update-zoom-interaction # # # This is the commit message GoogleChromeLabs#5: # # Merge branch 'master' into update-zoom-interaction # # # This is the commit message GoogleChromeLabs#6: # # Merge branch 'master' into update-zoom-interaction # # # This is the commit message GoogleChromeLabs#7: # # Merge branch 'master' into update-zoom-interaction # # # This is the commit message GoogleChromeLabs#8: # # Merge branch 'master' into update-zoom-interaction # # # This is the commit message GoogleChromeLabs#9: # # Merge branch 'master' into update-zoom-interaction # # # This is the commit message GoogleChromeLabs#10: # # Merge branch 'master' into update-zoom-interaction # # # This is the commit message GoogleChromeLabs#11: # # Merge from remote branch # # # This is the commit message GoogleChromeLabs#12: # # Merge from upstream/master # # # This is the commit message GoogleChromeLabs#13: # # Lazy-load the intersection-observer polyfill and optionally control wheel event # # # This is the commit message GoogleChromeLabs#14: # # Fix threshold handling issue # # # This is the commit message GoogleChromeLabs#15: # # merge remote-tracking branch 'upstream/master' into update-zoom-interaction # # # This is the commit message GoogleChromeLabs#16: # # merge remote-tracking branch 'upstream/master' into update-zoom-interaction # # # This is the commit message GoogleChromeLabs#17: # # Update double click listener and position reset behaviour # # # This is the commit message GoogleChromeLabs#18: # # Change back the indentations # # # This is the commit message GoogleChromeLabs#19: # # Update double click listener and position reset behaviour # # # This is the commit message GoogleChromeLabs#20: # # Change back the indentations # The commit message GoogleChromeLabs#116 will be skipped: # Merge from upstream/master branch # The commit message GoogleChromeLabs#117 will be skipped: # Update zoom and positioning behaviours # The commit message GoogleChromeLabs#118 will be skipped: # Merge branch 'master' into update-zoom-interaction # The commit message GoogleChromeLabs#119 will be skipped: # Merge branch 'master' into update-zoom-interaction # The commit message GoogleChromeLabs#120 will be skipped: # Merge branch 'master' into update-zoom-interaction # The commit message GoogleChromeLabs#121 will be skipped: # Merge branch 'master' into update-zoom-interaction # The commit message GoogleChromeLabs#122 will be skipped: # Merge branch 'master' into update-zoom-interaction # The commit message GoogleChromeLabs#123 will be skipped: # Merge branch 'master' into update-zoom-interaction # The commit message GoogleChromeLabs#124 will be skipped: # Merge branch 'master' into update-zoom-interaction # The commit message GoogleChromeLabs#125 will be skipped: # Merge branch 'master' into update-zoom-interaction # The commit message GoogleChromeLabs#126 will be skipped: # Merge from remote branch # The commit message GoogleChromeLabs#127 will be skipped: # Update dependency webpack-cli to v3.2.3 # The commit message GoogleChromeLabs#128 will be skipped: # Merge pull request GoogleChromeLabs#449 from GoogleChromeLabs/renovate/webpack-cli-3.x # # Update dependency webpack-cli to v3.2.3 # The commit message GoogleChromeLabs#129 will be skipped: # Update libwebp to 1.0.2 (GoogleChromeLabs#439) # # * Update package.json # # * Update package.json # # * Update README.md # # * Update README.md # # * Use cmake for libwebp # # * Minimize libwebp # The commit message GoogleChromeLabs#130 will be skipped: # Update dependency chokidar to v2.1.0 # The commit message GoogleChromeLabs#131 will be skipped: # Merge pull request GoogleChromeLabs#451 from GoogleChromeLabs/renovate/chokidar-2.x # # Update dependency chokidar to v2.1.0 # The commit message GoogleChromeLabs#132 will be skipped: # Update dependency loader-utils to v1.2.3 # The commit message GoogleChromeLabs#133 will be skipped: # Merge pull request GoogleChromeLabs#413 from GoogleChromeLabs/renovate/loader-utils-1.x # # Update dependency loader-utils to v1.2.3 # The commit message GoogleChromeLabs#134 will be skipped: # Update dependency @types/node to v10.12.23 # The commit message GoogleChromeLabs#135 will be skipped: # Merge pull request GoogleChromeLabs#453 from GoogleChromeLabs/renovate/node-10.x # # Update dependency @types/node to v10.12.23 # The commit message GoogleChromeLabs#136 will be skipped: # Merge from upstream/master # The commit message GoogleChromeLabs#137 will be skipped: # Lazy-load the intersection-observer polyfill and optionally control wheel event # The commit message GoogleChromeLabs#138 will be skipped: # Fix threshold handling issue # The commit message GoogleChromeLabs#139 will be skipped: # Adding CI step to compare build size to previous master build. (GoogleChromeLabs#450) # # The commit message GoogleChromeLabs#140 will be skipped: # no one must know I did this, or that it got through review. # The commit message GoogleChromeLabs#141 will be skipped: # Pin dependencies (GoogleChromeLabs#456) # # The commit message GoogleChromeLabs#142 will be skipped: # Switching to 1.4x rather than 140% # The commit message GoogleChromeLabs#143 will be skipped: # Rotate implementation in Rust # The commit message GoogleChromeLabs#144 will be skipped: # Reuse rotate instance and calculate pages correctly # The commit message GoogleChromeLabs#145 will be skipped: # Update wasm build # The commit message GoogleChromeLabs#146 will be skipped: # Merge pull request GoogleChromeLabs#438 from GoogleChromeLabs/rust-rotate # # Rotate implementation in Rust # The commit message GoogleChromeLabs#147 will be skipped: # Fix buffer size/offset calculations in rotate/processor.ts # The commit message GoogleChromeLabs#148 will be skipped: # Merge pull request GoogleChromeLabs#458 from jviide/rust-rotate # # Fix buffer offset/size calculations in rotate/processor.ts # The commit message GoogleChromeLabs#149 will be skipped: # 1.3.2 # The commit message GoogleChromeLabs#150 will be skipped: # Update dependency webpack-bundle-analyzer to v3.0.4 # The commit message GoogleChromeLabs#151 will be skipped: # Merge pull request GoogleChromeLabs#459 from GoogleChromeLabs/renovate/webpack-bundle-analyzer-3.x # # Update dependency webpack-bundle-analyzer to v3.0.4 # The commit message GoogleChromeLabs#152 will be skipped: # Update dependency @types/node to v10.12.25 # The commit message GoogleChromeLabs#153 will be skipped: # Merge pull request GoogleChromeLabs#455 from GoogleChromeLabs/renovate/node-10.x # # Update dependency @types/node to v10.12.25 # The commit message GoogleChromeLabs#154 will be skipped: # Update dependency chokidar to v2.1.1 # The commit message GoogleChromeLabs#155 will be skipped: # Merge pull request GoogleChromeLabs#457 from GoogleChromeLabs/renovate/chokidar-2.x # # Update dependency chokidar to v2.1.1 # The commit message GoogleChromeLabs#156 will be skipped: # Update dependency @types/node to v10.12.26 # The commit message GoogleChromeLabs#157 will be skipped: # Merge pull request GoogleChromeLabs#461 from GoogleChromeLabs/renovate/node-10.x # # Update dependency @types/node to v10.12.26 # The commit message GoogleChromeLabs#158 will be skipped: # Updating package lock to fix Netlify # The commit message GoogleChromeLabs#159 will be skipped: # Make Rust rotate code smaller (GoogleChromeLabs#462) # # * Make Rust rotate code smaller # # * Back on the rust happy path # The commit message GoogleChromeLabs#160 will be skipped: # 1.3.3 # The commit message GoogleChromeLabs#161 will be skipped: # Update dependency chokidar to v2.1.2 # The commit message GoogleChromeLabs#162 will be skipped: # Merge pull request GoogleChromeLabs#467 from GoogleChromeLabs/renovate/chokidar-2.x # # Update dependency chokidar to v2.1.2 # The commit message GoogleChromeLabs#163 will be skipped: # merge remote-tracking branch 'upstream/master' into update-zoom-interaction # The commit message GoogleChromeLabs#164 will be skipped: # Update double click listener and position reset behaviour # The commit message GoogleChromeLabs#165 will be skipped: # Change back the indentations # The commit message GoogleChromeLabs#166 will be skipped: # Update double click listener and position reset behaviour # The commit message GoogleChromeLabs#167 will be skipped: # Change back the indentations
Just making PR because commenting UI is better on PR.
Approach I took was to accept any HTML elements as children of
<multi-panels>
<multi-panels>
will simply take even indexed elements as heading, and element following(thus odd index) as content. Allowing user of this component more freedom in markup.note: I don't really understand TypeScript(yet) and this might very well be not great code(yet) !