@uploadcare/blocks
Advanced tools
Comparing version 0.14.2 to 0.14.3
@@ -116,2 +116,5 @@ import { debounce } from '../blocks/utils/debounce.js'; | ||
this.$['*history'] = history; | ||
if (!prevActivity) { | ||
this.setForCtxTarget('lr-modal', '*modalActive', false); | ||
} | ||
} | ||
@@ -118,0 +121,0 @@ } |
@@ -118,4 +118,3 @@ import { ActivityBlock } from './ActivityBlock.js'; | ||
} else { | ||
/** @ts-ignore */ | ||
if (Object.values(Block.extSrcList).includes(srcKey)) { | ||
if (Object.values(UploaderBlock.extSrcList).includes(/** @type {any} */ (srcKey))) { | ||
this.set$({ | ||
@@ -260,3 +259,3 @@ '*currentActivityParams': { | ||
ctx: this.ctxName, | ||
data: uploadCollection.readProp(id, 'cdnUrlModifiers'), | ||
data: Data.getCtx(id).store, | ||
}), | ||
@@ -346,6 +345,6 @@ undefined, | ||
Object.keys(EVENT_TYPES).forEach((eType) => { | ||
Object.values(EVENT_TYPES).forEach((eType) => { | ||
let eName = EventManager.eName(eType); | ||
window.addEventListener(eName, (e) => { | ||
let outputTypes = [EVENT_TYPES.UPLOAD_FINISH, EVENT_TYPES.REMOVE]; | ||
let outputTypes = [EVENT_TYPES.UPLOAD_FINISH, EVENT_TYPES.REMOVE, EVENT_TYPES.CDN_MODIFICATION]; | ||
if (outputTypes.includes(e.detail.type)) { | ||
@@ -352,0 +351,0 @@ let dataCtx = Data.getCtx(e.detail.ctx); |
@@ -27,6 +27,5 @@ /** @typedef {import('@uploadcare/upload-client').UploadcareFile[]} FileList} */ | ||
GROUP_ATTR: string; | ||
FORM_VALUE_ATTR: string; | ||
FORM_INPUT_ATTR: string; | ||
INPUT_NAME_ATTR: string; | ||
}; | ||
/** @private */ | ||
private _input; | ||
} | ||
@@ -40,3 +39,4 @@ export namespace DataOutput { | ||
const GROUP_ATTR: string; | ||
const FORM_VALUE_ATTR: string; | ||
const FORM_INPUT_ATTR: string; | ||
const INPUT_NAME_ATTR: string; | ||
} | ||
@@ -43,0 +43,0 @@ type dict = any; |
@@ -46,11 +46,13 @@ import { UploaderBlock } from '../../abstract/UploaderBlock.js'; | ||
if (this.hasAttribute(this.dict.FORM_VALUE_ATTR)) { | ||
if (!this._input) { | ||
/** @private */ | ||
this._input = document.createElement('input'); | ||
this._input.type = 'text'; | ||
this._input.hidden = true; | ||
this.appendChild(this._input); | ||
if (this.hasAttribute(this.dict.FORM_INPUT_ATTR)) { | ||
this.innerHTML = ''; | ||
let values = data.groupData ? [data.groupData.cdnUrl] : data.map((file) => file.cdnUrl); | ||
for (let value of values) { | ||
let input = document.createElement('input'); | ||
input.type = 'text'; | ||
input.name = this.getAttribute(this.dict.INPUT_NAME_ATTR) || this.ctxName; | ||
input.hidden = true; | ||
input.value = value; | ||
this.appendChild(input); | ||
} | ||
this._input.value = JSON.stringify(data); | ||
} | ||
@@ -101,3 +103,4 @@ | ||
GROUP_ATTR: 'use-group', | ||
FORM_VALUE_ATTR: 'form-value', | ||
FORM_INPUT_ATTR: 'use-input', | ||
INPUT_NAME_ATTR: 'input-name', | ||
}; |
@@ -105,2 +105,8 @@ import { Block } from '../../abstract/Block.js'; | ||
const headerHtml = /* HTML */ ` | ||
<script> | ||
window.__IS_REF__ = true; | ||
</script> | ||
`; | ||
export class LiveHtml extends Block { | ||
@@ -131,3 +137,3 @@ async hl() { | ||
// @ts-ignore | ||
this.ref.vp.srcdoc = (this.importmapHtml || '') + this.ref.editor.textContent; | ||
this.ref.vp.srcdoc = headerHtml + (this.importmapHtml || '') + this.ref.editor.textContent; | ||
if (this.hasAttribute('console-output')) { | ||
@@ -134,0 +140,0 @@ /** @type {Window} */ |
@@ -18,4 +18,5 @@ import { ActivityBlock } from '../../abstract/ActivityBlock.js'; | ||
}, | ||
onClose: () => this.historyBack(), | ||
}); | ||
} | ||
} |
/** Do not edit this file manually. It's generated during build process. */ | ||
export const PACKAGE_NAME: "blocks"; | ||
export const PACKAGE_VERSION: "0.14.2"; | ||
export const PACKAGE_VERSION: "0.14.3"; | ||
//# 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.14.2'; | ||
export const PACKAGE_VERSION = '0.14.3'; |
{ | ||
"name": "@uploadcare/blocks", | ||
"version": "0.14.2", | ||
"version": "0.14.3", | ||
"description": "Building blocks for Uploadcare products integration", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -7,3 +7,4 @@ /** | ||
export function ifRef(cb) { | ||
!document.querySelector('meta') && !document.querySelector('title') && cb(); | ||
// @ts-ignore | ||
typeof window.__IS_REF__ === 'boolean' && !!window.__IS_REF__ && cb(); | ||
} |
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 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
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
1647987
16496
6