+FileItem.template = html`
+
+
- {{itemName}}
- {{errorText}}
+ {{itemName}}
+ {{errorText}}
@@ -446,15 +447,15 @@ FileItem.template = /* HTML */ `
type="button"
l10n="@title:file-item-remove-button"
class="uc-remove-btn uc-mini-btn"
- set="onclick: onRemove;"
+ bind="onclick: onRemove;"
>
-
-
+
`;
FileItem.activeInstances = new Set();
diff --git a/blocks/Icon/Icon.js b/blocks/Icon/Icon.js
index 7ed291182..6e8442b9b 100644
--- a/blocks/Icon/Icon.js
+++ b/blocks/Icon/Icon.js
@@ -1,4 +1,5 @@
// @ts-check
+import { html } from '@symbiotejs/symbiote';
import { Block } from '../../abstract/Block.js';
export class Icon extends Block {
@@ -9,7 +10,6 @@ export class Icon extends Block {
...this.init$,
name: '',
href: '',
- title: '',
};
}
@@ -31,14 +31,12 @@ export class Icon extends Block {
}
}
-Icon.template = /* HTML */ `
+Icon.template = html`
`;
Icon.bindAttributes({
name: 'name',
- title: 'title',
});
diff --git a/blocks/Img/ImgBase.js b/blocks/Img/ImgBase.js
index a095e0662..e13b8165f 100644
--- a/blocks/Img/ImgBase.js
+++ b/blocks/Img/ImgBase.js
@@ -103,8 +103,8 @@ export class ImgBase extends ImgConfig {
createCdnUrl(
//
createOriginalUrl(this.$$('cdn-cname'), this.$$('uuid')),
- cdnModifiers
- )
+ cdnModifiers,
+ ),
);
}
@@ -114,8 +114,8 @@ export class ImgBase extends ImgConfig {
createCdnUrl(
//
createOriginalUrl(this.$$('cdn-cname'), this.$$('uuid')),
- cdnModifiers
- )
+ cdnModifiers,
+ ),
);
}
@@ -126,8 +126,8 @@ export class ImgBase extends ImgConfig {
//
this.$$('proxy-cname'),
cdnModifiers,
- this._fmtAbs(this.$$('src'))
- )
+ this._fmtAbs(this.$$('src')),
+ ),
);
}
@@ -138,8 +138,8 @@ export class ImgBase extends ImgConfig {
//
`https://${this.$$('pubkey')}.ucr.io/`,
cdnModifiers,
- this._fmtAbs(this.$$('src'))
- )
+ this._fmtAbs(this.$$('src')),
+ ),
);
}
}
@@ -157,7 +157,7 @@ export class ImgBase extends ImgConfig {
return applyTemplateData(
this.$$('secure-delivery-proxy'),
{ previewUrl: url },
- { transform: (value) => window.encodeURIComponent(value) }
+ { transform: (value) => window.encodeURIComponent(value) },
);
}
diff --git a/blocks/Img/ImgConfig.js b/blocks/Img/ImgConfig.js
index a80b6e71e..e7cf204be 100644
--- a/blocks/Img/ImgConfig.js
+++ b/blocks/Img/ImgConfig.js
@@ -1,4 +1,4 @@
-import { BaseComponent, Data } from '@symbiotejs/symbiote';
+import { Symbiote, PubSub } from '@symbiotejs/symbiote';
import { PROPS_MAP } from './props-map.js';
import { CSS_PREF } from './configurations.js';
import { PACKAGE_NAME, PACKAGE_VERSION } from '../../env.js';
@@ -8,7 +8,7 @@ for (let prop in PROPS_MAP) {
CSS_PROPS[CSS_PREF + prop] = PROPS_MAP[prop]?.default || '';
}
-export class ImgConfig extends BaseComponent {
+export class ImgConfig extends Symbiote {
cssInit$ = CSS_PROPS;
/**
@@ -87,7 +87,7 @@ export class ImgConfig extends BaseComponent {
});
this._isnObserver = null;
}
- Data.deleteCtx(this);
+ PubSub.deleteCtx(this);
}
static get observedAttributes() {
diff --git a/blocks/Img/utils/parseObjectToString.js b/blocks/Img/utils/parseObjectToString.js
index 5e0582e0b..a7b6c6ea3 100644
--- a/blocks/Img/utils/parseObjectToString.js
+++ b/blocks/Img/utils/parseObjectToString.js
@@ -1,6 +1,6 @@
export const parseObjectToString = (params) =>
Object.entries(params)
- .filter(([key, value]) => value !== undefined && value !== '')
+ .filter(([, value]) => value !== undefined && value !== '')
.map(([key, value]) => {
if (key === 'cdn-operations') {
return value;
diff --git a/blocks/Modal/Modal.js b/blocks/Modal/Modal.js
index 39540d4ba..072243770 100644
--- a/blocks/Modal/Modal.js
+++ b/blocks/Modal/Modal.js
@@ -1,4 +1,5 @@
// @ts-check
+import { html } from '@symbiotejs/symbiote';
import { Block } from '../../abstract/Block.js';
export class Modal extends Block {
@@ -109,7 +110,7 @@ export class Modal extends Block {
}
}
-Modal.template = /* HTML */ `
+Modal.template = html`
diff --git a/blocks/ProgressBar/ProgressBar.js b/blocks/ProgressBar/ProgressBar.js
index a8e0f8688..75db233ea 100644
--- a/blocks/ProgressBar/ProgressBar.js
+++ b/blocks/ProgressBar/ProgressBar.js
@@ -1,3 +1,4 @@
+import { html } from '@symbiotejs/symbiote';
import { Block } from '../../abstract/Block.js';
export class ProgressBar extends Block {
@@ -35,4 +36,4 @@ export class ProgressBar extends Block {
}
}
-ProgressBar.template = /* HTML */ `
`;
+ProgressBar.template = html`
`;
diff --git a/blocks/ProgressBarCommon/ProgressBarCommon.js b/blocks/ProgressBarCommon/ProgressBarCommon.js
index bf3f2d5fa..bcd489b33 100644
--- a/blocks/ProgressBarCommon/ProgressBarCommon.js
+++ b/blocks/ProgressBarCommon/ProgressBarCommon.js
@@ -1,3 +1,4 @@
+import { html } from '@symbiotejs/symbiote';
import { UploaderBlock } from '../../abstract/UploaderBlock.js';
export class ProgressBarCommon extends UploaderBlock {
@@ -41,4 +42,4 @@ export class ProgressBarCommon extends UploaderBlock {
}
}
-ProgressBarCommon.template = /* HTML */ `
`;
+ProgressBarCommon.template = html`
`;
diff --git a/blocks/Range/Range.js b/blocks/Range/Range.js
deleted file mode 100644
index 5b51b33a1..000000000
--- a/blocks/Range/Range.js
+++ /dev/null
@@ -1,44 +0,0 @@
-import { BaseComponent } from '@symbiotejs/symbiote';
-
-export class Range extends BaseComponent {
- init$ = {
- cssLeft: '50%',
- barActive: false,
- 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('value', (val) => {
- let pcnt = (val / 100) * 100;
- this.$.cssLeft = `${pcnt}%`;
- });
- this.defineAccessor('value', (val) => {
- this.$.value = val;
- });
- }
-}
-
-Range.template = /* HTML */ `
-
-
-
-`;
diff --git a/blocks/Range/range.css b/blocks/Range/range.css
deleted file mode 100644
index f095a6d2c..000000000
--- a/blocks/Range/range.css
+++ /dev/null
@@ -1,65 +0,0 @@
-uc-range {
- position: relative;
- display: inline-flex;
- align-items: center;
- justify-content: center;
- height: var(--uc-button-size);
-}
-
-uc-range datalist {
- display: none;
-}
-
-uc-range input {
- width: 100%;
- height: 100%;
- opacity: 0;
-}
-
-uc-range .uc-track-wrapper {
- position: absolute;
- right: 10px;
- left: 10px;
- display: flex;
- align-items: center;
- justify-content: center;
- height: 2px;
- user-select: none;
- pointer-events: none;
-}
-
-uc-range .uc-track {
- position: absolute;
- right: 0;
- left: 0;
- display: flex;
- align-items: center;
- justify-content: center;
- height: 2px;
- background-color: currentColor;
- border-radius: 2px;
- opacity: 0.5;
-}
-
-uc-range .uc-slider {
- position: absolute;
- width: 16px;
- height: 16px;
- background-color: currentColor;
- border-radius: 100%;
- transform: translateX(-50%);
-}
-
-uc-range .uc-bar {
- position: absolute;
- left: 0;
- height: 100%;
- background-color: currentColor;
- border-radius: 2px;
-}
-
-uc-range .uc-caption {
- position: absolute;
- display: inline-flex;
- justify-content: center;
-}
diff --git a/blocks/Select/Select.js b/blocks/Select/Select.js
index ad3c149a6..3b49240f5 100644
--- a/blocks/Select/Select.js
+++ b/blocks/Select/Select.js
@@ -1,3 +1,4 @@
+import { html } from '@symbiotejs/symbiote';
import { Block } from '../../abstract/Block.js';
export class Select extends Block {
@@ -21,15 +22,19 @@ export class Select extends Block {
initCallback() {
super.initCallback();
- this.sub('options', (/** @type {{ text: String; value: String }[]} */ options) => {
- this.$.currentText = options?.[0]?.text || '';
- let html = '';
- options?.forEach((opt) => {
- html += /* HTML */ `
`;
- });
- this.$.selectHtml = html;
- });
+ this.defineAccessor(
+ 'options',
+ /** @param {{ text: String; value: String }[]} options */
+ (options) => {
+ this.$.currentText = options?.[0]?.text || '';
+ let htmlCode = '';
+ options?.forEach((opt) => {
+ htmlCode += html`
`;
+ });
+ this.$.selectHtml = htmlCode;
+ },
+ );
}
}
-Select.template = /* HTML */ `
`;
+Select.template = html`
`;
diff --git a/blocks/SimpleBtn/SimpleBtn.js b/blocks/SimpleBtn/SimpleBtn.js
index 9381a38ee..21b8a1100 100644
--- a/blocks/SimpleBtn/SimpleBtn.js
+++ b/blocks/SimpleBtn/SimpleBtn.js
@@ -1,4 +1,5 @@
// @ts-check
+import { html } from '@symbiotejs/symbiote';
import { UploaderBlock } from '../../abstract/UploaderBlock.js';
import { asBoolean } from '../Config/normalizeConfigValue.js';
@@ -37,9 +38,9 @@ export class SimpleBtn extends UploaderBlock {
}
}
-SimpleBtn.template = /* HTML */ `
-
-
+SimpleBtn.template = html`
+
+
diff --git a/blocks/SourceBtn/SourceBtn.js b/blocks/SourceBtn/SourceBtn.js
index 45e50f34a..abbd68fc9 100644
--- a/blocks/SourceBtn/SourceBtn.js
+++ b/blocks/SourceBtn/SourceBtn.js
@@ -1,6 +1,7 @@
// @ts-check
-import { UploaderBlock } from '../../abstract/UploaderBlock.js';
+import { html } from '@symbiotejs/symbiote';
import { ActivityBlock } from '../../abstract/ActivityBlock.js';
+import { UploaderBlock } from '../../abstract/UploaderBlock.js';
const L10N_PREFIX = 'src-type-';
@@ -132,10 +133,9 @@ export class SourceBtn extends UploaderBlock {
};
}
}
-
-SourceBtn.template = /* HTML */ `
+SourceBtn.template = html`
-
+
`;
diff --git a/blocks/SourceList/SourceList.js b/blocks/SourceList/SourceList.js
index 7e9e45577..85c13f4bf 100644
--- a/blocks/SourceList/SourceList.js
+++ b/blocks/SourceList/SourceList.js
@@ -1,19 +1,20 @@
import { Block } from '../../abstract/Block.js';
import { stringToArray } from '../../utils/stringToArray.js';
+import { html } from '@symbiotejs/symbiote';
export class SourceList extends Block {
initCallback() {
super.initCallback();
this.subConfigValue('sourceList', (/** @type {String} */ val) => {
let list = stringToArray(val);
- let html = '';
+ let htmlContent = '';
list.forEach((srcName) => {
- html += /* HTML */ ``;
+ htmlContent += html``;
});
if (this.cfg.sourceListWrap) {
- this.innerHTML = html;
+ this.innerHTML = htmlContent;
} else {
- this.outerHTML = html;
+ this.outerHTML = htmlContent;
}
});
}
diff --git a/blocks/StartFrom/StartFrom.js b/blocks/StartFrom/StartFrom.js
index fa9900a77..72c2d13ef 100644
--- a/blocks/StartFrom/StartFrom.js
+++ b/blocks/StartFrom/StartFrom.js
@@ -1,3 +1,4 @@
+import { html } from '@symbiotejs/symbiote';
import { ActivityBlock } from '../../abstract/ActivityBlock.js';
export class StartFrom extends ActivityBlock {
@@ -11,4 +12,4 @@ export class StartFrom extends ActivityBlock {
}
}
-StartFrom.template = /* HTML */ `
`;
+StartFrom.template = html`
`;
diff --git a/blocks/UploadList/UploadList.js b/blocks/UploadList/UploadList.js
index 7d4e07039..611a016e8 100644
--- a/blocks/UploadList/UploadList.js
+++ b/blocks/UploadList/UploadList.js
@@ -1,4 +1,5 @@
// @ts-check
+import { html } from '@symbiotejs/symbiote';
import { ActivityBlock } from '../../abstract/ActivityBlock.js';
import { UploaderBlock } from '../../abstract/UploaderBlock.js';
import { EventType } from '../UploadCtxProvider/EventEmitter.js';
@@ -14,8 +15,6 @@ import { throttle } from '../utils/throttle.js';
*/
export class UploadList extends UploaderBlock {
- // Context owner should have access to CSS l10n
- // TODO: We need to move away l10n from CSS
couldBeCtxOwner = true;
historyTracked = true;
activityType = ActivityBlock.activities.UPLOAD_LIST;
@@ -199,42 +198,42 @@ export class UploadList extends UploaderBlock {
}
}
-UploadList.template = /* HTML */ `
+UploadList.template = html`
-
+
-
+
-
+
-
+
diff --git a/blocks/UrlSource/UrlSource.js b/blocks/UrlSource/UrlSource.js
index 80b7d6fa9..23a7c03ad 100644
--- a/blocks/UrlSource/UrlSource.js
+++ b/blocks/UrlSource/UrlSource.js
@@ -1,5 +1,6 @@
-import { UploaderBlock } from '../../abstract/UploaderBlock.js';
+import { html } from '@symbiotejs/symbiote';
import { ActivityBlock } from '../../abstract/ActivityBlock.js';
+import { UploaderBlock } from '../../abstract/UploaderBlock.js';
import { UploadSource } from '../utils/UploadSource.js';
export class UrlSource extends UploaderBlock {
@@ -36,25 +37,25 @@ export class UrlSource extends UploaderBlock {
}
}
-UrlSource.template = /* HTML */ `
+UrlSource.template = html`
-
+
-
+
diff --git a/blocks/themes/uc-basic/index.css b/blocks/themes/uc-basic/index.css
index a6c16b8ec..2bd27d9d8 100644
--- a/blocks/themes/uc-basic/index.css
+++ b/blocks/themes/uc-basic/index.css
@@ -9,7 +9,6 @@
/* UI COMPONENTS: */
@import url('../../Icon/icon.css');
-@import url('../../Range/range.css');
/* BLOCKS: */
@import url('../../Config/config.css');
diff --git a/blocks/themes/uc-basic/svg-sprite.js b/blocks/themes/uc-basic/svg-sprite.js
index f67fa0a4e..2bc3acc1a 100644
--- a/blocks/themes/uc-basic/svg-sprite.js
+++ b/blocks/themes/uc-basic/svg-sprite.js
@@ -1 +1 @@
-export default "
";
+export default "
";
diff --git a/demo/cloud-image-editor.html b/demo/cloud-image-editor.html
index ec7d13c16..7ad6ff8b3 100644
--- a/demo/cloud-image-editor.html
+++ b/demo/cloud-image-editor.html
@@ -11,7 +11,8 @@
-
-
+
+