Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@uploadcare/blocks

Package Overview
Dependencies
Maintainers
3
Versions
338
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@uploadcare/blocks - npm Package Compare versions

Comparing version 0.12.4 to 0.13.0

blocks/DropArea/getDropItems.d.ts

4

blocks/ActivityCaption/ActivityCaption.js

@@ -5,4 +5,2 @@ import { ActivityBlock } from '../../abstract/ActivityBlock.js';

ActivityCaption.template = /* html */ `
<div class="caption">{{*activityCaption}}</div>
`;
ActivityCaption.template = /* HTML */ ` <div class="caption">{{*activityCaption}}</div> `;

@@ -5,4 +5,2 @@ import { ActivityBlock } from '../../abstract/ActivityBlock.js';

ActivityIcon.template = /* html */ `
<lr-icon set="@name: *activityIcon"></lr-icon>
`;
ActivityIcon.template = /* HTML */ ` <lr-icon set="@name: *activityIcon"></lr-icon> `;

@@ -225,33 +225,31 @@ import { UploaderBlock } from '../../abstract/UploaderBlock.js';

CameraSource.template = /*html*/ `
<div class="content">
<video
autoplay
playsinline
set="srcObject: video; style.transform: videoTransformCss; @hidden: videoHidden"
ref="video">
</video>
<div class="message-box" set="@hidden: messageHidden">
<span>{{l10nMessage}}</span>
<button type="button" set="onclick: onRequestPermissions; @hidden: requestBtnHidden" l10n="camera-permissions-request"></button>
CameraSource.template = /* HTML */ `
<div class="content">
<video
autoplay
playsinline
set="srcObject: video; style.transform: videoTransformCss; @hidden: videoHidden"
ref="video"
></video>
<div class="message-box" set="@hidden: messageHidden">
<span>{{l10nMessage}}</span>
<button
type="button"
set="onclick: onRequestPermissions; @hidden: requestBtnHidden"
l10n="camera-permissions-request"
></button>
</div>
</div>
</div>
<div class="toolbar">
<button
type="button"
class="cancel-btn secondary-btn"
set="onclick: onCancel"
l10n="cancel">
</button>
<lr-select
set="$.options: cameraSelectOptions; @hidden: cameraSelectHidden; onchange: onCameraSelectChange">
</lr-select>
<button
type="button"
class="shot-btn primary-btn"
set="onclick: onShot; @disabled: shotBtnDisabled"
l10n="camera-shot">
</button>
</div>
<div class="toolbar">
<button type="button" class="cancel-btn secondary-btn" set="onclick: onCancel" l10n="cancel"></button>
<lr-select set="$.options: cameraSelectOptions; @hidden: cameraSelectHidden; onchange: onCameraSelectChange">
</lr-select>
<button
type="button"
class="shot-btn primary-btn"
set="onclick: onShot; @disabled: shotBtnDisabled"
l10n="camera-shot"
></button>
</div>
`;

@@ -426,5 +426,2 @@ import { Block } from '../../../abstract/Block.js';

CropFrame.template = /*html*/ `
<svg class='svg' ref='svg-el' xmlns="http://www.w3.org/2000/svg">
</svg>
`;
CropFrame.template = /* HTML */ ` <svg class="svg" ref="svg-el" xmlns="http://www.w3.org/2000/svg"></svg> `;

@@ -44,3 +44,3 @@ import { Block } from '../../../abstract/Block.js';

EditorButtonControl.template = /*html*/ `
EditorButtonControl.template = /* HTML */ `
<div class="before"></div>

@@ -47,0 +47,0 @@ <lr-icon size="20" set="@name: icon;"></lr-icon>

@@ -152,3 +152,3 @@ import { createCdnUrl, createCdnUrlModifiers } from '../../../utils/cdn-utils.js';

EditorFilterControl.template = /*html*/ `
EditorFilterControl.template = /* HTML */ `
<div class="before"></div>

@@ -155,0 +155,0 @@ <div class="preview" ref="preview-el"></div>

@@ -529,5 +529,5 @@ import { Block } from '../../../abstract/Block.js';

EditorImageCropper.template = /*html*/ `
<canvas class='canvas' ref='canvas-el'></canvas>
<lr-crop-frame ref='frame-el'></lr-crop-frame>
EditorImageCropper.template = /* HTML */ `
<canvas class="canvas" ref="canvas-el"></canvas>
<lr-crop-frame ref="frame-el"></lr-crop-frame>
`;

@@ -21,4 +21,2 @@ import { Block } from '../../../abstract/Block.js';

EditorScroller.template = /*html*/ `
<slot></slot>
`;
EditorScroller.template = /* HTML */ ` <slot></slot> `;

@@ -113,4 +113,7 @@ import { Block } from '../../../abstract/Block.js';

EditorSlider.template = /*html*/ `
<lr-slider-ui ref="slider-el" set="disabled: disabled; min: min; max: max; defaultValue: defaultValue; zero: zero; onInput: on.input;"></lr-slider-ui>
EditorSlider.template = /* HTML */ `
<lr-slider-ui
ref="slider-el"
set="disabled: disabled; min: min; max: max; defaultValue: defaultValue; zero: zero; onInput: on.input;"
></lr-slider-ui>
`;

@@ -14,4 +14,11 @@ import { Block } from '../../../abstract/Block.js';

function renderTabToggle(id) {
return /*html*/ `
<lr-btn-ui theme="boring" ref="tab-toggle-${id}" data-id="${id}" icon="${id}" tabindex="0" set="onclick: on.clickTab;">
return /* HTML */ `
<lr-btn-ui
theme="boring"
ref="tab-toggle-${id}"
data-id="${id}"
icon="${id}"
tabindex="0"
set="onclick: on.clickTab;"
>
</lr-btn-ui>

@@ -23,10 +30,9 @@ `;

function renderTabContent(id) {
return /*html*/ `
return /* HTML */ `
<lr-presence-toggle class="tab-content" set="visible: presence.tabContent.${id}; styles: presence.tabContentStyles">
<lr-editor-scroller hidden-scrollbar>
<div class="controls-list_align">
<div class="controls-list_inner" ref="controls-list-${id}">
</div>
</div>
</lr-editor-scroller>
<lr-editor-scroller hidden-scrollbar>
<div class="controls-list_align">
<div class="controls-list_inner" ref="controls-list-${id}"></div>
</div>
</lr-editor-scroller>
</lr-presence-toggle>

@@ -331,19 +337,14 @@ `;

EditorToolbar.template = /*html*/ `
<lr-line-loader-ui set="active: showLoader"></lr-line-loader-ui>
<div class="filter-tooltip_container">
<div class="filter-tooltip_wrapper">
<div ref="tooltip-el" class="filter-tooltip filter-tooltip_visible">
{{*operationTooltip}}
EditorToolbar.template = /* HTML */ `
<lr-line-loader-ui set="active: showLoader"></lr-line-loader-ui>
<div class="filter-tooltip_container">
<div class="filter-tooltip_wrapper">
<div ref="tooltip-el" class="filter-tooltip filter-tooltip_visible">{{*operationTooltip}}</div>
</div>
</div>
</div>
<div class="toolbar-container">
<lr-presence-toggle class="sub-toolbar" set="visible: presence.mainToolbar; styles: presence.subTopToolbarStyles">
<div class="tab-content-row">
${TABS.map(renderTabContent).join('')}
</div>
<div class="toolbar-container">
<lr-presence-toggle class="sub-toolbar" set="visible: presence.mainToolbar; styles: presence.subTopToolbarStyles">
<div class="tab-content-row">${TABS.map(renderTabContent).join('')}</div>
<div class="controls-row">
<lr-btn-ui theme="boring" icon="closeMax" set="onclick: on.cancel">
</lr-btn-ui>
<lr-btn-ui theme="boring" icon="closeMax" set="onclick: on.cancel"> </lr-btn-ui>
<div class="tab-toggles">

@@ -353,7 +354,6 @@ <div ref="tabs-indicator" class="tab-toggles_indicator"></div>

</div>
<lr-btn-ui theme="primary" icon="done" set="onclick: on.apply">
</lr-btn-ui>
<lr-btn-ui theme="primary" icon="done" set="onclick: on.apply"> </lr-btn-ui>
</div>
</lr-presence-toggle>
<lr-presence-toggle class="sub-toolbar" set="visible: presence.subToolbar; styles: presence.subBottomToolbarStyles">
</lr-presence-toggle>
<lr-presence-toggle class="sub-toolbar" set="visible: presence.subToolbar; styles: presence.subBottomToolbarStyles">
<div class="slider">

@@ -363,9 +363,7 @@ <lr-editor-slider ref="slider-el"></lr-editor-slider>

<div class="controls-row">
<lr-btn-ui theme="boring" set="@text: l10n.cancel; onclick: on.cancelSlider;">
</lr-btn-ui>
<lr-btn-ui theme="primary" set="@text: l10n.apply; onclick: on.applySlider;">
</lr-btn-ui>
<lr-btn-ui theme="boring" set="@text: l10n.cancel; onclick: on.cancelSlider;"> </lr-btn-ui>
<lr-btn-ui theme="primary" set="@text: l10n.apply; onclick: on.applySlider;"> </lr-btn-ui>
</div>
</lr-presence-toggle>
</div>
</lr-presence-toggle>
</div>
`;

@@ -78,5 +78,5 @@ import { Block } from '../../../../../abstract/Block.js';

LrBtnUi.template = /*html*/ `
<lr-icon size="20" set="className: iconCss; @name: icon;"></lr-icon>
<div class="text">{{text}}</div>
LrBtnUi.template = /* HTML */ `
<lr-icon size="20" set="className: iconCss; @name: icon;"></lr-icon>
<div class="text">{{text}}</div>
`;

@@ -17,9 +17,9 @@ // @ts-nocheck

}
TestApp.template = /*html*/ `
<link rel="stylesheet" href="../../css/common.css">
<lr-btn-ui reverse set="#text: text; #icon: icon"></lr-btn-ui>
<div>&nbsp;</div>
<lr-btn-ui text="One more button..."></lr-btn-ui>
<div>&nbsp;</div>
TestApp.template = /* HTML */ `
<link rel="stylesheet" href="../../css/common.css" />
<lr-btn-ui reverse set="#text: text; #icon: icon"></lr-btn-ui>
<div>&nbsp;</div>
<lr-btn-ui text="One more button..."></lr-btn-ui>
<div>&nbsp;</div>
`;
TestApp.defineTag('test-app');

@@ -48,3 +48,3 @@ import { Block } from '../../../../../abstract/Block.js';

LineLoaderUi.template = /*html*/ `
LineLoaderUi.template = /* HTML */ `
<div class="inner">

@@ -51,0 +51,0 @@ <div class="line" ref="line-el"></div>

@@ -68,4 +68,2 @@ import { applyClassNames } from '../../lib/classNames.js';

}
PresenceToggle.template = /*html*/ `
<slot></slot>
`;
PresenceToggle.template = /* HTML */ ` <slot></slot> `;

@@ -170,7 +170,12 @@ import { Block } from '../../../../../abstract/Block.js';

}
SliderUi.template = /*html*/ `
<div class="steps" ref="steps-el">
</div>
SliderUi.template = /* HTML */ `
<div class="steps" ref="steps-el"></div>
<div ref="thumb-el" class="thumb"></div>
<input class="input" type='range' ref='input-el' tabindex="0" set="oninput: on.sliderInput; onchange: on.sliderChange; @min: min; @max: max; @value: defaultValue;">
<input
class="input"
type="range"
ref="input-el"
tabindex="0"
set="oninput: on.sliderInput; onchange: on.sliderChange; @min: min; @max: max; @value: defaultValue;"
/>
`;

@@ -18,3 +18,3 @@ import { Block } from '../../../../../abstract/Block.js';

CtxProvider.template = /*html*/ `
CtxProvider.template = /* HTML */ `
<lr-slider-ui set="min: min; max: max: defaultValue: defaultValue; onInput: on.input"></lr-slider-ui>

@@ -21,0 +21,0 @@ <div>{{value}}</div>

/**
* Helper function for legacy browsers and iframes which sometimes focus on elements like document, body, and non-interactive SVG.
* Helper function for legacy browsers and iframes which sometimes focus on elements like document, body, and
* non-interactive SVG.
*

@@ -114,3 +115,4 @@ * @param {EventTarget} el

* On `focus`, add the `focus-visible` class to the target if: - the target received focus as a result of keyboard
* navigation or - the event target is an element that will likely require interaction via the keyboard (e.g., a text box).
* navigation or - the event target is an element that will likely require interaction via the keyboard (e.g., a text
* box).
*

@@ -117,0 +119,0 @@ * @param {Event} e

import { TRANSPARENT_PIXEL_SRC } from '../../../utils/transparentPixelSrc.js';
export const TEMPLATE = /*html*/ `
<div class="wrapper wrapper_desktop">
<lr-presence-toggle class="network_problems_splash" set="visible: presence.networkProblems;">
<div class="network_problems_content">
<div class="network_problems_icon">
<lr-icon size="20" name="sad"></lr-icon>
export const TEMPLATE = /* HTML */ `
<div class="wrapper wrapper_desktop">
<lr-presence-toggle class="network_problems_splash" set="visible: presence.networkProblems;">
<div class="network_problems_content">
<div class="network_problems_icon">
<lr-icon size="20" name="sad"></lr-icon>
</div>
<div class="network_problems_text">Network error</div>
</div>
<div class="network_problems_text">
Network error
<div class="network_problems_footer">
<lr-btn-ui theme="primary" text="Retry" set="onclick: *on.retryNetwork"></lr-btn-ui>
</div>
</lr-presence-toggle>
<div class="viewport">
<div class="file_type_outer">
<div class="file_type">{{fileType}}</div>
</div>
<div class="image_container" ref="img-container-el">
<img src="${TRANSPARENT_PIXEL_SRC}" class="image image_visible_from_editor" ref="img-el" />
<lr-editor-image-cropper ref="cropper-el"></lr-editor-image-cropper>
<lr-editor-image-fader ref="fader-el"></lr-editor-image-fader>
</div>
<div class="info_pan">{{msg}}</div>
</div>
<div class="network_problems_footer">
<lr-btn-ui theme="primary" text="Retry" set="onclick: *on.retryNetwork"></lr-btn-ui>
<div class="toolbar">
<lr-line-loader-ui set="active: showLoader"></lr-line-loader-ui>
<div class="toolbar_content toolbar_content__editor">
<lr-editor-toolbar></lr-editor-toolbar>
</div>
</div>
</lr-presence-toggle>
<div class="viewport">
<div class="file_type_outer">
<div class="file_type">{{fileType}}</div>
</div>
<div class="image_container" ref="img-container-el">
<img src="${TRANSPARENT_PIXEL_SRC}" class="image image_visible_from_editor" ref="img-el">
<lr-editor-image-cropper ref="cropper-el"></lr-editor-image-cropper>
<lr-editor-image-fader ref="fader-el"></lr-editor-image-fader>
</div>
<div class="info_pan">{{msg}}</div>
</div>
<div class="toolbar">
<lr-line-loader-ui set="active: showLoader"></lr-line-loader-ui>
<div class="toolbar_content toolbar_content__editor">
<lr-editor-toolbar></lr-editor-toolbar>
</div>
</div>
</div>
`;

@@ -14,11 +14,5 @@ import { Block } from '../../abstract/Block.js';

Color.template = /*html*/ `
<input
ref="input"
type="color"
set="oninput: onChange; style.opacity: inputOpacity">
<div
class="current-color"
set="style.backgroundColor: *selectedColor">
</div>
Color.template = /* HTML */ `
<input ref="input" type="color" set="oninput: onChange; style.opacity: inputOpacity" />
<div class="current-color" set="style.backgroundColor: *selectedColor"></div>
`;

@@ -63,14 +63,8 @@ import { ActivityBlock } from '../../abstract/ActivityBlock.js';

ConfirmationDialog.template = /*html*/ `
<div class="message">{{messageTxt}}</div>
<div class="toolbar">
<button
type="button"
class="deny-btn secondary-btn"
set="onclick: onDeny">{{denyBtnTxt}}</button>
<button
type="button"
class="confirm-btn primary-btn"
set="onclick: onConfirm">{{confirmBtnTxt}}</button>
</div>
ConfirmationDialog.template = /* HTML */ `
<div class="message">{{messageTxt}}</div>
<div class="toolbar">
<button type="button" class="deny-btn secondary-btn" set="onclick: onDeny">{{denyBtnTxt}}</button>
<button type="button" class="confirm-btn primary-btn" set="onclick: onConfirm">{{confirmBtnTxt}}</button>
</div>
`;

@@ -5,4 +5,3 @@ /**

* @param {Function} desc.onChange
* @param {Function} desc.onFiles
* @param {(src: String) => void} desc.onImgElement
* @param {Function} desc.onItems
*/

@@ -12,4 +11,3 @@ export function addDropzone(desc: {

onChange: Function;
onFiles: Function;
onImgElement: (src: string) => void;
onItems: Function;
}): () => void;

@@ -16,0 +14,0 @@ export type DropzoneState = number;

@@ -1,6 +0,3 @@

import { getDropFiles } from './getDropFiles.js';
import { getDropItems } from './getDropItems.js';
/** @type {String} */
let dragImageSrc = null;
/** @enum {Number} */

@@ -34,4 +31,3 @@ export const DropzoneState = {

* @param {Function} desc.onChange
* @param {Function} desc.onFiles
* @param {(src: String) => void} desc.onImgElement
* @param {Function} desc.onItems
*/

@@ -110,10 +106,4 @@ export function addDropzone(desc) {

e.preventDefault();
if (dragImageSrc) {
desc.onImgElement.bind(desc.element)(dragImageSrc);
dragImageSrc = null;
setState(DropzoneState.INACTIVE);
return;
}
let files = await getDropFiles(e.dataTransfer);
desc.onFiles(files);
let items = await getDropItems(e.dataTransfer);
desc.onItems(items);
setState(DropzoneState.INACTIVE);

@@ -123,7 +113,2 @@ };

window.addEventListener('dragstart', (e) => {
// @ts-ignore
dragImageSrc = e.target.constructor === HTMLImageElement ? e.target.src : null;
});
return () => {

@@ -135,5 +120,4 @@ nearnessRegistry.delete(desc.element);

window.removeEventListener(eventName, onFinalEvent, false);
dragImageSrc = null;
});
};
}

@@ -19,17 +19,23 @@ import { UploaderBlock } from '../../abstract/UploaderBlock.js';

},
onFiles: (files) => {
if (!files.length) {
onItems: (items) => {
if (!items.length) {
return;
}
if (!this.getCssData('--cfg-multiple')) {
files = [files[0]];
items = [items[0]];
}
files.forEach((/** @type {File} */ file) => {
let isImage = fileIsImage(file);
items.forEach((/** @type {File | String} */ item) => {
if (typeof item === 'string') {
this.uploadCollection.add({
externalUrl: item,
});
return;
}
let isImage = fileIsImage(item);
this.uploadCollection.add({
file,
file: item,
isImage: isImage,
mimeType: file.type,
fileName: file.name,
fileSize: file.size,
mimeType: item.type,
fileName: item.name,
fileSize: item.size,
});

@@ -41,14 +47,6 @@ });

});
// @ts-ignore
this.setForCtxTarget('lr-modal', '*modalActive', true);
}
},
onImgElement(src) {
// @ts-ignore
this.uploadCollection.add({
externalUrl: src,
});
// @ts-ignore
this.set$({
'*currentActivity': ActivityBlock.activities.UPLOAD_LIST,
});
},
});

@@ -55,0 +53,0 @@

@@ -86,9 +86,9 @@ export const buttonsModel = [

function getBthHtml(btn) {
return /*html*/ `<button
return /* HTML */ `<button
type="button"
action="${btn.action}"
action="${btn.action}"
ref="${btn.ref}"
l10n="title:${btn.l10n_name}">
<lr-icon
set="${btn.set}"
set="${btn.set}"
name="${btn.icon}">

@@ -99,7 +99,8 @@ </lr-icon>

const clrHtml = /*html*/ `<lr-color
ref="color"
const clrHtml = /* HTML */ `<lr-color
ref="color"
action="color"
set="onchange: onColor"
l10n="title:select-color"></lr-color>`;
set="onchange: onColor"
l10n="title:select-color"
></lr-color>`;

@@ -106,0 +107,0 @@ export function getButtons() {

@@ -91,12 +91,10 @@ import { Block } from '../../abstract/Block.js';

EditableCanvas.template = /*html*/ `
<canvas class="img-view" ref="cvs"></canvas>
<svg class="img-view" xmlns="http://www.w3.org/2000/svg" ref="svg">
<g ref="svg_g">
<image ref="svg_img" x="0" y="0"></image>
</g>
</svg>
<editable-canvas-toolbar
set="refMap: refMap; @hidden: toolbarHidden">
</editable-canvas-toolbar>
EditableCanvas.template = /* HTML */ `
<canvas class="img-view" ref="cvs"></canvas>
<svg class="img-view" xmlns="http://www.w3.org/2000/svg" ref="svg">
<g ref="svg_g">
<image ref="svg_img" x="0" y="0"></image>
</g>
</svg>
<editable-canvas-toolbar set="refMap: refMap; @hidden: toolbarHidden"> </editable-canvas-toolbar>
`;

@@ -103,0 +101,0 @@

@@ -140,13 +140,5 @@ import { Block } from '../../abstract/Block.js';

}
EditorToolbar.template = /*html*/ `
<div
class="btns"
ref="btns"
set="onclick: onBtnClick">${getButtons()}</div>
<lr-range
min="0"
max="200"
ref="range"
set="@visible: rangeActive; $.caption: rangeCaption">
</lr-range>
EditorToolbar.template = /* HTML */ `
<div class="btns" ref="btns" set="onclick: onBtnClick">${getButtons()}</div>
<lr-range min="0" max="200" ref="range" set="@visible: rangeActive; $.caption: rangeCaption"> </lr-range>
`;

@@ -139,20 +139,12 @@ import { create } from '@symbiotejs/symbiote';

ExternalSource.template = /*html*/ `
<div
ref="iframeWrapper"
class="iframe-wrapper">
</div>
<div class="toolbar">
<button type="button"
class="cancel-btn secondary-btn"
set="onclick: onCancel"
l10n="cancel">
</button>
<div></div>
<div class="selected-counter">
<span l10n="selected-count"></span>{{counter}}</div>
<button type="button" class="done-btn primary-btn" set="onclick: onDone; @disabled: !counter">
<lr-icon name="check"></lr-icon>
</button>
</div>
ExternalSource.template = /* HTML */ `
<div ref="iframeWrapper" class="iframe-wrapper"></div>
<div class="toolbar">
<button type="button" class="cancel-btn secondary-btn" set="onclick: onCancel" l10n="cancel"></button>
<div></div>
<div class="selected-counter"><span l10n="selected-count"></span>{{counter}}</div>
<button type="button" class="done-btn primary-btn" set="onclick: onDone; @disabled: !counter">
<lr-icon name="check"></lr-icon>
</button>
</div>
`;

@@ -428,31 +428,28 @@ import { UploaderBlock } from '../../abstract/UploaderBlock.js';

FileItem.template = /*html*/ `
<div
class="inner"
set="@finished: isFinished; @uploading: isUploading; @failed: isFailed; @focused: isFocused">
<div
class="thumb"
set="style.backgroundImage: thumbUrl">
<div class="badge">
<lr-icon set="@name: badgeIcon"></lr-icon>
FileItem.template = /* HTML */ `
<div class="inner" set="@finished: isFinished; @uploading: isUploading; @failed: isFailed; @focused: isFocused">
<div class="thumb" set="style.backgroundImage: thumbUrl">
<div class="badge">
<lr-icon set="@name: badgeIcon"></lr-icon>
</div>
</div>
<div class="file-name-wrapper">
<span class="file-name" set="@title: itemName">{{itemName}}</span>
</div>
<button type="button" class="edit-btn" set="onclick: onEdit;">
<lr-icon name="edit-file"></lr-icon>
</button>
<button type="button" class="remove-btn" set="onclick: onRemove;">
<lr-icon name="remove-file"></lr-icon>
</button>
<button type="button" class="upload-btn" set="onclick: onUpload;">
<lr-icon name="upload"></lr-icon>
</button>
<lr-progress-bar
class="progress-bar"
set="value: progressValue; visible: progressVisible; unknown: progressUnknown"
>
</lr-progress-bar>
</div>
<div class="file-name-wrapper">
<span class="file-name" set="@title: itemName">{{itemName}}</span>
</div>
<button type="button" class="edit-btn" set="onclick: onEdit;">
<lr-icon name="edit-file"></lr-icon>
</button>
<button type="button" class="remove-btn" set="onclick: onRemove;">
<lr-icon name="remove-file"></lr-icon>
</button>
<button type="button" class="upload-btn" set="onclick: onUpload;">
<lr-icon name="upload"></lr-icon>
</button>
<lr-progress-bar
class="progress-bar"
set="value: progressValue; visible: progressVisible; unknown: progressUnknown">
</lr-progress-bar>
</div>
`;
FileItem.activeInstances = new Set();

@@ -51,5 +51,3 @@ import { Block } from '../../abstract/Block.js';

FilePreview.template = /*html*/ `
<lr-img class="img-view" ref="img" set="@src: src; style.aa: src;"/>
`;
FilePreview.template = /* HTML */ ` <lr-img class="img-view" ref="img" set="@src: src; style.aa: src;" /> `;

@@ -56,0 +54,0 @@ FilePreview.bindAttributes({

@@ -44,8 +44,4 @@ import { Block } from '../../abstract/Block.js';

Icon.template = /*html*/ `
<svg
ref="svg"
xmlns="http://www.w3.org/2000/svg"
set="@viewBox: viewBox; @height: size; @width: size">
</svg>
Icon.template = /* HTML */ `
<svg ref="svg" xmlns="http://www.w3.org/2000/svg" set="@viewBox: viewBox; @height: size; @width: size"></svg>
`;

@@ -52,0 +48,0 @@

@@ -11,2 +11,3 @@ export class LiveHtml extends Block {

onKeydown: (e: any) => void;
onNewTabClick: () => void;
'*ctxTargetsRegistry': Map<any, any>;

@@ -13,0 +14,0 @@ };

import { Block } from '../../abstract/Block.js';
const INIT_HTML = /*html*/ `
const INIT_HTML = /* HTML */ `
<!DOCTYPE html>

@@ -159,2 +159,18 @@ <html lang="en">

},
onNewTabClick: () => {
const url = new URL(document.location.toString());
url.hash = '';
const baseUrl = url.toString();
const code = `
<!DOCTYPE html>
<html lang="en">
<base href="${baseUrl}" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
${this.ref.vp.srcdoc}
</html>
`;
const winUrl = URL.createObjectURL(new Blob([code], { type: 'text/html' }));
window.open(winUrl);
},
// onPaste: (e) => {

@@ -235,9 +251,10 @@ // e.preventDefault();

LiveHtml.template = /*html*/ `
<div
ref="editor"
contenteditable="true"
set="textContent:code; oninput:onInput; onkeydown:onKeydown; spellcheck:spellcheck">
</div>
<iframe ref="vp"></iframe>
LiveHtml.template = /* HTML */ `
<div
ref="editor"
contenteditable="true"
set="textContent:code; oninput:onInput; onkeydown:onKeydown; spellcheck:spellcheck"
></div>
<iframe ref="vp"></iframe>
<button class="open-new-tab-btn" set="onclick: onNewTabClick">Open in the new tab</button>
`;

@@ -44,11 +44,11 @@ import { Block } from '../../abstract/Block.js';

MessageBox.template = /*html*/ `
<div class="heading">
<lr-icon set="@name: iconName"></lr-icon>
<div class="caption">{{captionTxt}}</div>
<button type="button" set="onclick: onClose">
<lr-icon name="close"></lr-icon>
</button>
</div>
<div class="msg">{{msgTxt}}</div>
MessageBox.template = /* HTML */ `
<div class="heading">
<lr-icon set="@name: iconName"></lr-icon>
<div class="caption">{{captionTxt}}</div>
<button type="button" set="onclick: onClose">
<lr-icon name="close"></lr-icon>
</button>
</div>
<div class="msg">{{msgTxt}}</div>
`;

@@ -38,17 +38,14 @@ import { Block } from '../../abstract/Block.js';

Modal.template = /*html*/ `
<div class="dialog">
<div class="heading" set="@hidden: *modalHeaderHidden">
<slot name="heading"></slot>
<button
type="button"
class="close-btn"
set="onclick: closeClicked">
<lr-icon name="close"></lr-icon>
</button>
Modal.template = /* HTML */ `
<div class="dialog">
<div class="heading" set="@hidden: *modalHeaderHidden">
<slot name="heading"></slot>
<button type="button" class="close-btn" set="onclick: closeClicked">
<lr-icon name="close"></lr-icon>
</button>
</div>
<div class="content">
<slot></slot>
</div>
</div>
<div class="content">
<slot></slot>
</div>
</div>
`;

@@ -37,7 +37,2 @@ import { Block } from '../../abstract/Block.js';

ProgressBar.template = /*html*/ `
<div
ref="line"
class="progress">
</div>
`;
ProgressBar.template = /* HTML */ ` <div ref="line" class="progress"></div> `;

@@ -38,4 +38,4 @@ import { UploaderBlock } from '../../abstract/UploaderBlock.js';

ProgressBarCommon.template = /*html*/ `
<lr-progress-bar set="visible: visible; unknown: unknown; value: value"></lr-progress-bar>
ProgressBarCommon.template = /* HTML */ `
<lr-progress-bar set="visible: visible; unknown: unknown; value: value"></lr-progress-bar>
`;

@@ -36,26 +36,10 @@ import { BaseComponent } from '@symbiotejs/symbiote';

Range.template = /*html*/ `
<div class="track-wrapper">
<div
class="track">
Range.template = /* HTML */ `
<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>
<div
class="bar"
set
-style.width="cssLeft"
-@active="barActive">
</div>
<div
class="slider"
set
-style.left="cssLeft">
</div>
</div>
<input
type="range"
ref="range"
set
-@value="value"
-oninput="onChange" />
<input type="range" ref="range" set -@value="value" -oninput="onChange" />
`;

@@ -28,3 +28,3 @@ import { Block } from '../../abstract/Block.js';

options?.forEach((opt) => {
html += /*html*/ `<option value="${opt.value}">${opt.text}</option>`;
html += /* HTML */ `<option value="${opt.value}">${opt.text}</option>`;
});

@@ -36,8 +36,8 @@ this.$.selectHtml = html;

Select.template = /*html*/ `
<button>
{{currentText}}
<lr-icon name="select"></lr-icon>
<select ref="select" set="innerHTML: selectHtml; onchange: onSelect"></select>
</button>
Select.template = /* HTML */ `
<button>
{{currentText}}
<lr-icon name="select"></lr-icon>
<select ref="select" set="innerHTML: selectHtml; onchange: onSelect"></select>
</button>
`;

@@ -21,10 +21,11 @@ import { UploaderBlock } from '../../abstract/UploaderBlock.js';

SimpleBtn.template = /*html*/ `
<lr-drop-area>
<button type="button" set="onclick: onClick">
<lr-icon name="upload"></lr-icon>
<span>{{*simpleButtonText}}</span>
<slot></slot>
</button>
</lr-drop-area>
SimpleBtn.template = /* HTML */ `
<lr-drop-area>
<button type="button" set="onclick: onClick">
<lr-icon name="upload"></lr-icon>
<span>{{*simpleButtonText}}</span>
<slot></slot>
<div class="visual-drop-area"></div>
</button>
</lr-drop-area>
`;

@@ -90,5 +90,5 @@ import { UploaderBlock } from '../../abstract/UploaderBlock.js';

}
SourceBtn.template = /*html*/ `
<lr-icon set="@name: iconName"></lr-icon>
<div class="txt" l10n="src-type"></div>
SourceBtn.template = /* HTML */ `
<lr-icon set="@name: iconName"></lr-icon>
<div class="txt" l10n="src-type"></div>
`;

@@ -95,0 +95,0 @@ SourceBtn.bindAttributes({

@@ -19,3 +19,3 @@ import { Block } from '../../abstract/Block.js';

list.forEach((srcName) => {
html += /*html*/ `<lr-source-btn type="${srcName}"></lr-source-btn>`;
html += /* HTML */ `<lr-source-btn type="${srcName}"></lr-source-btn>`;
});

@@ -22,0 +22,0 @@ if (this.getCssData('--cfg-source-list-wrap')) {

@@ -74,7 +74,7 @@ import { Block } from '../../abstract/Block.js';

Tabs.template = /*html*/ `
<div ref="row" class="tabs-row"></div>
<div ref="context" class="tabs-context">
<slot></slot>
</div>
Tabs.template = /* HTML */ `
<div ref="row" class="tabs-row"></div>
<div ref="context" class="tabs-context">
<slot></slot>
</div>
`;

@@ -146,66 +146,45 @@ import { UploaderBlock } from '../../abstract/UploaderBlock.js';

UploadDetails.template = /*html*/ `
<lr-tabs
tab-list="tab-view, tab-details">
UploadDetails.template = /* HTML */ `
<lr-tabs tab-list="tab-view, tab-details">
<div tab-ctx="tab-details" class="details">
<div class="info-block">
<div class="info-block_name" l10n="file-name"></div>
<input
name="name-input"
ref="file_name_input"
set="value: fileName; oninput: onNameInput; @disabled: !!cdnUrl"
type="text"
/>
</div>
<div
tab-ctx="tab-details"
class="details">
<div class="info-block">
<div class="info-block_name" l10n="file-size"></div>
<div>{{fileSize}}</div>
</div>
<div class="info-block">
<div class="info-block_name" l10n="file-name"></div>
<input
name="name-input"
ref="file_name_input"
set="value: fileName; oninput: onNameInput; @disabled: !!cdnUrl"
type="text" />
</div>
<div class="info-block">
<div class="info-block_name" l10n="cdn-url"></div>
<a class="cdn-link" target="_blank" set="@href: cdnUrl; @disabled: !cdnUrl">{{cdnUrl}}</a>
</div>
<div class="info-block">
<div class="info-block_name" l10n="file-size"></div>
<div>{{fileSize}}</div>
<div>{{errorTxt}}</div>
</div>
<div class="info-block">
<div class="info-block_name" l10n="cdn-url"></div>
<a
class="cdn-link"
target="_blank"
set="@href: cdnUrl; @disabled: !cdnUrl">{{cdnUrl}}</a>
</div>
<lr-file-preview tab-ctx="tab-view" set="@checkerboard: checkerboard;" ref="filePreview"> </lr-file-preview>
</lr-tabs>
<div>{{errorTxt}}</div>
<div class="toolbar" set="@edit-disabled: cloudEditBtnHidden">
<button type="button" class="edit-btn secondary-btn" set="onclick: onCloudEdit; @hidden: cloudEditBtnHidden;">
<lr-icon name="edit"></lr-icon>
<span l10n="edit-image"></span>
</button>
<button type="button" class="remove-btn secondary-btn" set="onclick: onRemove">
<lr-icon name="remove"></lr-icon>
<span l10n="remove-from-list"></span>
</button>
<div></div>
<button type="button" class="back-btn primary-btn" set="onclick: onBack">
<span l10n="ok"></span>
</button>
</div>
<lr-file-preview
tab-ctx="tab-view"
set="@checkerboard: checkerboard;"
ref="filePreview">
</lr-file-preview>
</lr-tabs>
<div class="toolbar" set="@edit-disabled: cloudEditBtnHidden">
<button
type="button"
class="edit-btn secondary-btn"
set="onclick: onCloudEdit; @hidden: cloudEditBtnHidden;">
<lr-icon name="edit"></lr-icon>
<span l10n="edit-image"></span>
</button>
<button
type="button"
class="remove-btn secondary-btn"
set="onclick: onRemove">
<lr-icon name="remove"></lr-icon>
<span l10n="remove-from-list"></span>
</button>
<div></div>
<button
type="button"
class="back-btn primary-btn"
set="onclick: onBack">
<span l10n="ok"></span>
</button>
</div>
`;

@@ -206,35 +206,31 @@ import { UploaderBlock } from '../../abstract/UploaderBlock.js';

UploadList.template = /*html*/ `
<div class="no-files" set="@hidden: hasFiles">
<slot name="empty"><span l10n="no-files"></span></slot>
</div>
UploadList.template = /* HTML */ `
<div class="no-files" set="@hidden: hasFiles">
<slot name="empty"><span l10n="no-files"></span></slot>
</div>
<div
class="files"
repeat="*uploadList"
repeat-item-tag="lr-file-item"></div>
<div class="files" repeat="*uploadList" repeat-item-tag="lr-file-item"></div>
<div class="toolbar">
<button
type="button"
class="cancel-btn secondary-btn"
set="onclick: onCancel;"
l10n="clear"></button>
<div class="toolbar-spacer"></div>
<button
type="button"
class="add-more-btn secondary-btn"
set="onclick: onAdd; @disabled: !addMoreBtnEnabled; @hidden: !addMoreBtnVisible"
l10n="add-more"></button>
<button
type="button"
class="upload-btn primary-btn"
set="@hidden: !uploadBtnVisible; onclick: onUpload; @disabled: !uploadBtnEnabled"
l10n="upload"></button>
<button
type="button"
class="done-btn primary-btn"
set="@hidden: !doneBtnVisible; onclick: onDone; @disabled: !doneBtnEnabled"
l10n="done"></button>
</div>
<div class="toolbar">
<button type="button" class="cancel-btn secondary-btn" set="onclick: onCancel;" l10n="clear"></button>
<div class="toolbar-spacer"></div>
<button
type="button"
class="add-more-btn secondary-btn"
set="onclick: onAdd; @disabled: !addMoreBtnEnabled; @hidden: !addMoreBtnVisible"
l10n="add-more"
></button>
<button
type="button"
class="upload-btn primary-btn"
set="@hidden: !uploadBtnVisible; onclick: onUpload; @disabled: !uploadBtnEnabled"
l10n="upload"
></button>
<button
type="button"
class="done-btn primary-btn"
set="@hidden: !doneBtnVisible; onclick: onDone; @disabled: !doneBtnEnabled"
l10n="done"
></button>
</div>
`;

@@ -40,15 +40,6 @@ import { UploaderBlock } from '../../abstract/UploaderBlock.js';

UrlSource.template = /*html*/ `
<input placeholder="https://..." .url-input type="text" ref="input" set="oninput: onInput"/>
<button
type="button"
class="url-upload-btn primary-btn"
set="onclick: onUpload; @disabled: importDisabled">
</button>
<button
type="button"
class="cancel-btn secondary-btn"
set="onclick: onCancel"
l10n="cancel">
</button>
UrlSource.template = /* HTML */ `
<input placeholder="https://..." .url-input type="text" ref="input" set="oninput: onInput" />
<button type="button" class="url-upload-btn primary-btn" set="onclick: onUpload; @disabled: importDisabled"></button>
<button type="button" class="cancel-btn secondary-btn" set="onclick: onCancel" l10n="cancel"></button>
`;

@@ -225,3 +225,3 @@ import { Block } from '../../abstract/Block.js';

desc?.sources.forEach((srcDesc) => {
html += /*html*/ `<source ${this._desc2attrs(srcDesc)}>`;
html += /* HTML */ `<source ${this._desc2attrs(srcDesc)} />`;
});

@@ -231,3 +231,3 @@

desc.tracks.forEach((trackDesc) => {
html += /*html*/ `<track ${this._desc2attrs(trackDesc)}>`;
html += /* HTML */ `<track ${this._desc2attrs(trackDesc)} />`;
});

@@ -263,62 +263,35 @@ this.$.hasSubtitles = true;

Video.template = /*html*/ `
<div class="video-wrapper">
<video
ref="video"
preload="metadata"
crossorigin="anonymous">
</video>
</div>
Video.template = /* HTML */ `
<div class="video-wrapper">
<video ref="video" preload="metadata" crossorigin="anonymous"></video>
</div>
<div class="toolbar">
<div class="toolbar">
<div class="progress" ref="progress" set -onclick="progressClicked">
<div class="bar" set -style.width="progressCssWidth"></div>
</div>
<div
class="progress"
ref="progress"
set
-onclick="progressClicked">
<div
class="bar"
set
-style.width="progressCssWidth"></div>
</div>
<div class="tb-block">
<button set -onclick="onPP">
<lr-icon set -@name="ppIcon"></lr-icon>
</button>
<div class="timer">{{currentTime}} / {{totalTime}}</div>
</div>
<div class="tb-block">
<button
set
-onclick="onPP">
<lr-icon set -@name="ppIcon"></lr-icon>
</button>
<div class="timer">{{currentTime}} / {{totalTime}}</div>
</div>
<div class="tb-block">
<button set -onclick="onCap" -@hidden="!hasSubtitles">
<lr-icon set -@name="capIcon"></lr-icon>
</button>
<div class="tb-block">
<button
set
-onclick="onCap"
-@hidden="!hasSubtitles">
<lr-icon set -@name="capIcon"></lr-icon>
</button>
<button set -onclick="onMute">
<lr-icon set -@name="volIcon"></lr-icon>
</button>
<button
set
-onclick="onMute">
<lr-icon set -@name="volIcon"></lr-icon>
</button>
<lr-range type="range" set -onchange="onVolChange" -@disabled="volumeDisabled" -value="volumeValue"> </lr-range>
<lr-range
type="range"
set
-onchange="onVolChange"
-@disabled="volumeDisabled"
-value="volumeValue">
</lr-range>
<button
set
-onclick="onFs">
<lr-icon set -@name="fsIcon"></lr-icon>
</button>
<button set -onclick="onFs">
<lr-icon set -@name="fsIcon"></lr-icon>
</button>
</div>
</div>
</div>
`;

@@ -325,0 +298,0 @@

/** Do not edit this file manually. It's generated during build process. */
export const PACKAGE_NAME: "blocks";
export const PACKAGE_VERSION: "0.12.4";
export const PACKAGE_VERSION: "0.13.0";
//# sourceMappingURL=env.d.ts.map
/** Do not edit this file manually. It's generated during build process. */
export const PACKAGE_NAME = 'blocks';
export const PACKAGE_VERSION = '0.12.4';
export const PACKAGE_VERSION = '0.13.0';
{
"name": "@uploadcare/blocks",
"version": "0.12.4",
"version": "0.13.0",
"description": "Building blocks for Uploadcare products integration",

@@ -102,4 +102,4 @@ "keywords": [

"postcss": "^8.4.13",
"prettier": "^2.6.2",
"prettier-plugin-jsdoc": "0.3.38",
"prettier": "^2.7.1",
"prettier-plugin-jsdoc": "0.4.2",
"puppeteer": "^14.4.1",

@@ -106,0 +106,0 @@ "rimraf": "^3.0.2",

@@ -26,15 +26,14 @@ import { SolutionBlock } from '../../../abstract/SolutionBlock.js';

FileUploaderInline.template = /*html*/ `
<lr-start-from>
<lr-source-list wrap></lr-source-list>
<lr-drop-area set="@hidden: dropAreaHidden" clickable></lr-drop-area>
</lr-start-from>
<lr-upload-list ref="uBlock"></lr-upload-list>
<lr-camera-source></lr-camera-source>
<lr-url-source></lr-url-source>
<lr-external-source></lr-external-source>
<lr-upload-details></lr-upload-details>
<lr-confirmation-dialog></lr-confirmation-dialog>
<lr-message-box></lr-message-box>
<lr-progress-bar></lr-progress-bar>
<lr-cloud-image-editor></lr-cloud-image-editor>`;
FileUploaderInline.template = /* HTML */ ` <lr-start-from>
<lr-source-list wrap></lr-source-list>
<lr-drop-area set="@hidden: dropAreaHidden" clickable></lr-drop-area>
</lr-start-from>
<lr-upload-list ref="uBlock"></lr-upload-list>
<lr-camera-source></lr-camera-source>
<lr-url-source></lr-url-source>
<lr-external-source></lr-external-source>
<lr-upload-details></lr-upload-details>
<lr-confirmation-dialog></lr-confirmation-dialog>
<lr-message-box></lr-message-box>
<lr-progress-bar></lr-progress-bar>
<lr-cloud-image-editor></lr-cloud-image-editor>`;

@@ -31,3 +31,3 @@ import { SolutionBlock } from '../../../abstract/SolutionBlock.js';

FileUploaderMinimal.template = /*html*/ `
FileUploaderMinimal.template = /* HTML */ `
<lr-start-from>

@@ -34,0 +34,0 @@ <lr-drop-area clickable l10n="drop-files-here"></lr-drop-area>

@@ -5,23 +5,23 @@ import { SolutionBlock } from '../../../abstract/SolutionBlock.js';

FileUploaderRegular.template = /*html*/ `
<lr-simple-btn></lr-simple-btn>
FileUploaderRegular.template = /* HTML */ `
<lr-simple-btn></lr-simple-btn>
<lr-modal strokes block-body-scrolling>
<lr-activity-icon slot="heading"></lr-activity-icon>
<lr-activity-caption slot="heading"></lr-activity-caption>
<lr-start-from>
<lr-source-list wrap></lr-source-list>
<lr-drop-area clickable></lr-drop-area>
</lr-start-from>
<lr-upload-list></lr-upload-list>
<lr-camera-source></lr-camera-source>
<lr-url-source></lr-url-source>
<lr-external-source></lr-external-source>
<lr-upload-details></lr-upload-details>
<lr-confirmation-dialog></lr-confirmation-dialog>
<lr-cloud-image-editor></lr-cloud-image-editor>
</lr-modal>
<lr-modal strokes block-body-scrolling>
<lr-activity-icon slot="heading"></lr-activity-icon>
<lr-activity-caption slot="heading"></lr-activity-caption>
<lr-start-from>
<lr-source-list wrap></lr-source-list>
<lr-drop-area clickable></lr-drop-area>
</lr-start-from>
<lr-upload-list></lr-upload-list>
<lr-camera-source></lr-camera-source>
<lr-url-source></lr-url-source>
<lr-external-source></lr-external-source>
<lr-upload-details></lr-upload-details>
<lr-confirmation-dialog></lr-confirmation-dialog>
<lr-cloud-image-editor></lr-cloud-image-editor>
</lr-modal>
<lr-message-box></lr-message-box>
<lr-progress-bar-common></lr-progress-bar-common>
<lr-message-box></lr-message-box>
<lr-progress-bar-common></lr-progress-bar-common>
`;

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc