-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #207 from uploadcare/lr-video
Lr video
- Loading branch information
Showing
30 changed files
with
601 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,60 @@ | ||
import { Block } from '../../abstract/Block.js'; | ||
import { BaseComponent } from '@symbiotejs/symbiote'; | ||
|
||
export class Range extends Block { | ||
export class Range extends BaseComponent { | ||
init$ = { | ||
...this.init$, | ||
cssLeft: '50%', | ||
caption: 'CAPTION', | ||
barActive: false, | ||
'*rangeValue': 100, | ||
onChange: () => { | ||
this.$['*rangeValue'] = this.ref.range['value']; | ||
value: 50, | ||
onChange: (e) => { | ||
e.preventDefault(); | ||
e.stopPropagation(); | ||
this.$.value = parseFloat(this._range.value); | ||
this.dispatchEvent(new Event('change')); | ||
}, | ||
}; | ||
|
||
initCallback() { | ||
super.initCallback(); | ||
/** @type {HTMLInputElement} */ | ||
this._range = this.ref.range; | ||
[...this.attributes].forEach((attr) => { | ||
let exclude = ['style', 'ref']; | ||
if (!exclude.includes(attr.name)) { | ||
this.ref.range.setAttribute(attr.name, attr.value); | ||
} | ||
}); | ||
this.sub('*rangeValue', (val) => { | ||
let pcnt = (val / this.ref.range['max']) * 100; | ||
this.sub('value', (val) => { | ||
let pcnt = (val / 100) * 100; | ||
this.$.cssLeft = `${pcnt}%`; | ||
}); | ||
this.defineAccessor('value', (val) => { | ||
this.$.value = val; | ||
}); | ||
} | ||
} | ||
|
||
Range.template = /*html*/ ` | ||
<datalist id="range-values"> | ||
<option value="0" label="min"></option> | ||
<option value="100" label="0"></option> | ||
<option value="200" label="max"></option> | ||
</datalist> | ||
<div class="track"> | ||
<div class="bar" set="style.width: cssLeft; @active: barActive"></div> | ||
<div class="slider" set="style.left: cssLeft"></div> | ||
<div class="center"></div> | ||
<div class="caption" set="@text: caption">{{caption}}</div> | ||
<div class="track-wrapper"> | ||
<div | ||
class="track"> | ||
</div> | ||
<div | ||
class="bar" | ||
set | ||
-style.width="cssLeft" | ||
-@active="barActive"> | ||
</div> | ||
<div | ||
class="slider" | ||
set | ||
-style.left="cssLeft"> | ||
</div> | ||
</div> | ||
<input | ||
type="range" | ||
ref="range" | ||
list="range-values" | ||
set="@value: *rangeValue; oninput: onChange"> | ||
set | ||
-@value="value" | ||
-oninput="onChange" /> | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { UploaderBlock } from '../../abstract/UploaderBlock.js'; | ||
|
||
export class UploadCtxProvider extends UploaderBlock {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,13 @@ | ||
import { ifRef } from '../../utils/ifRef.js'; | ||
import { UploadDetails } from './UploadDetails.js'; | ||
import { Icon } from '../Icon/Icon.js'; | ||
import { Tabs } from '../Tabs/Tabs.js'; | ||
import { EditableCanvas } from '../EditableCanvas/EditableCanvas.js'; | ||
import { registerBlocks } from '../../abstract/registerBlocks.js'; | ||
|
||
registerBlocks({ UploadDetails, Icon, Tabs, EditableCanvas }); | ||
|
||
const uploadDetails = new UploadDetails(); | ||
uploadDetails.classList.add('lr-wgt-common'); | ||
|
||
window.onload = () => { | ||
document.querySelector('#viewport')?.appendChild(uploadDetails); | ||
ifRef(() => { | ||
registerBlocks({ UploadDetails, Icon, Tabs, EditableCanvas }); | ||
/** @type {UploadDetails} */ | ||
let uploadDetails = document.querySelector(UploadDetails.is); | ||
uploadDetails.$['*currentActivity'] = 'details'; | ||
}; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,10 @@ | ||
import { ifRef } from '../../utils/ifRef.js'; | ||
import { UploadList } from './UploadList.js'; | ||
import { registerBlocks } from '../../abstract/registerBlocks.js'; | ||
|
||
registerBlocks({ UploadList }); | ||
|
||
const uploadList = new UploadList(); | ||
uploadList.classList.add('lr-wgt-common'); | ||
|
||
window.onload = () => { | ||
document.querySelector('#viewport')?.appendChild(uploadList); | ||
ifRef(() => { | ||
registerBlocks({ UploadList }); | ||
/** @type {UploadList} */ | ||
let uploadList = document.querySelector(UploadList.is); | ||
uploadList.$['*currentActivity'] = 'upload-list'; | ||
}; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.