@salla.sa/twilight-components 2.14.303 → 2.14.304
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{filepond-Bh6iKKhn.js → filepond-CSRZHHLr.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-poster-D8ICVN81.js → filepond-plugin-file-poster-HbvHQ4xC.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-size-DeA3uJPr.js → filepond-plugin-file-validate-size-MBHCj7aE.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-type-D_XDHgw0.js → filepond-plugin-file-validate-type-f9k8C7xL.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-edit-D1EHQVcm.js → filepond-plugin-image-edit-C27nfWyY.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-exif-orientation-DCb2xAO4.js → filepond-plugin-image-exif-orientation-BVIWVV_U.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-preview-D-dNkHgY.js → filepond-plugin-image-preview-DDZAVPrI.js} +1 -1
- package/dist/cjs/{index-Cc9yTgbA.js → index-CA0dkTAr.js} +1 -1
- package/dist/cjs/{index-Bs68-jFh.js → index-iL6M6R0b.js} +2 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/salla-accordion_62.cjs.entry.js +9 -9
- package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
- package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
- package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
- package/dist/cjs/salla-cart-item-offers.cjs.entry.js +1 -1
- package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
- package/dist/cjs/salla-custom-fields.cjs.entry.js +1 -1
- package/dist/cjs/salla-filters-widget.cjs.entry.js +1 -1
- package/dist/cjs/salla-filters.cjs.entry.js +1 -1
- package/dist/cjs/salla-installment.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-program.cjs.entry.js +1 -1
- package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
- package/dist/cjs/salla-notification-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-notifications.cjs.entry.js +1 -1
- package/dist/cjs/salla-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-details-options.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-details.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-totals-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-orders.cjs.entry.js +1 -1
- package/dist/cjs/salla-payments.cjs.entry.js +1 -1
- package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
- package/dist/cjs/salla-review-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-reviews-page.cjs.entry.js +1 -1
- package/dist/cjs/salla-reviews.cjs.entry.js +1 -1
- package/dist/cjs/salla-social.cjs.entry.js +1 -1
- package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-tooltip.cjs.entry.js +1 -1
- package/dist/cjs/salla-trust-badges.cjs.entry.js +1 -1
- package/dist/cjs/salla-verify.cjs.entry.js +1 -1
- package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
- package/dist/cjs/twilight.cjs.js +1 -1
- package/dist/components/index.js +2 -2
- package/dist/esm/{filepond-DeJbdkcJ.js → filepond-BK3ryZ4O.js} +1 -1
- package/dist/esm/{filepond-plugin-file-poster-U3_8oFZu.js → filepond-plugin-file-poster-CXrGQn3f.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-size-CEWMZWUc.js → filepond-plugin-file-validate-size-TbV5jS_i.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-type-VOCqp96B.js → filepond-plugin-file-validate-type-Ddr49QTv.js} +1 -1
- package/dist/esm/{filepond-plugin-image-edit-Bqn3Eiaw.js → filepond-plugin-image-edit-Cl1HLh6D.js} +1 -1
- package/dist/esm/{filepond-plugin-image-exif-orientation-BgABOhTs.js → filepond-plugin-image-exif-orientation-sh8N6lBS.js} +1 -1
- package/dist/esm/{filepond-plugin-image-preview-CeaGVuls.js → filepond-plugin-image-preview-CnbbixEI.js} +1 -1
- package/dist/esm/{index-DAeK8Uz8.js → index-7Vj3wCbC.js} +1 -1
- package/dist/esm/{index-DTWIEXBd.js → index-BK1JdIAs.js} +2 -2
- package/dist/esm/loader.js +2 -2
- package/dist/esm/salla-accordion_62.entry.js +9 -9
- package/dist/esm/salla-advertisement.entry.js +1 -1
- package/dist/esm/salla-app-install-alert.entry.js +1 -1
- package/dist/esm/salla-apps-icons.entry.js +1 -1
- package/dist/esm/salla-cart-item-offers.entry.js +1 -1
- package/dist/esm/salla-conditional-offer.entry.js +1 -1
- package/dist/esm/salla-contacts.entry.js +1 -1
- package/dist/esm/salla-custom-fields.entry.js +1 -1
- package/dist/esm/salla-filters-widget.entry.js +1 -1
- package/dist/esm/salla-filters.entry.js +1 -1
- package/dist/esm/salla-installment.entry.js +1 -1
- package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
- package/dist/esm/salla-loyalty-program.entry.js +1 -1
- package/dist/esm/salla-metadata.entry.js +1 -1
- package/dist/esm/salla-notification-item.entry.js +1 -1
- package/dist/esm/salla-notifications.entry.js +1 -1
- package/dist/esm/salla-offer.entry.js +1 -1
- package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
- package/dist/esm/salla-order-details-options.entry.js +1 -1
- package/dist/esm/salla-order-details.entry.js +1 -1
- package/dist/esm/salla-order-summary.entry.js +1 -1
- package/dist/esm/salla-order-totals-card.entry.js +1 -1
- package/dist/esm/salla-orders.entry.js +1 -1
- package/dist/esm/salla-payments.entry.js +1 -1
- package/dist/esm/salla-price-range.entry.js +1 -1
- package/dist/esm/salla-review-card.entry.js +1 -1
- package/dist/esm/salla-reviews-page.entry.js +1 -1
- package/dist/esm/salla-reviews.entry.js +1 -1
- package/dist/esm/salla-social.entry.js +1 -1
- package/dist/esm/salla-tiered-offer.entry.js +1 -1
- package/dist/esm/salla-tooltip.entry.js +1 -1
- package/dist/esm/salla-trust-badges.entry.js +1 -1
- package/dist/esm/salla-verify.entry.js +1 -1
- package/dist/esm/salla-wallet.entry.js +1 -1
- package/dist/esm/twilight.js +2 -2
- package/dist/twilight/{p-dd3eddc6.entry.js → p-013fce72.entry.js} +1 -1
- package/dist/twilight/{p-20393708.entry.js → p-019ac8fd.entry.js} +1 -1
- package/dist/twilight/{p-8165e585.entry.js → p-0cc20e03.entry.js} +1 -1
- package/dist/twilight/{p-51660db8.entry.js → p-16ea5bcd.entry.js} +1 -1
- package/dist/twilight/{p-c27ee294.entry.js → p-2d82b640.entry.js} +1 -1
- package/dist/twilight/{p-71d29fd5.entry.js → p-3d230249.entry.js} +1 -1
- package/dist/twilight/{p-7d472e04.entry.js → p-446d1563.entry.js} +1 -1
- package/dist/twilight/{p-50122fb0.entry.js → p-498a3cf6.entry.js} +1 -1
- package/dist/twilight/{p-8cdb0833.entry.js → p-4b8a857a.entry.js} +1 -1
- package/dist/twilight/{p-52daf9ff.entry.js → p-5523f5f7.entry.js} +1 -1
- package/dist/twilight/{p-5f9d6886.entry.js → p-5f9af57c.entry.js} +1 -1
- package/dist/twilight/{p-739661bc.entry.js → p-600b8139.entry.js} +1 -1
- package/dist/twilight/{p-bcdcb7d3.entry.js → p-619a5831.entry.js} +1 -1
- package/dist/twilight/{p-8aa2e6ef.entry.js → p-6b2af464.entry.js} +1 -1
- package/dist/twilight/{p-bd685d7a.entry.js → p-70f2ed1b.entry.js} +1 -1
- package/dist/twilight/{p-58f96180.entry.js → p-8736f3c4.entry.js} +1 -1
- package/dist/twilight/{p-cf748cc6.entry.js → p-91ff6fe9.entry.js} +1 -1
- package/dist/twilight/{p-28921059.entry.js → p-93a6f914.entry.js} +1 -1
- package/dist/twilight/{p-42fb48e0.entry.js → p-94ee77ce.entry.js} +1 -1
- package/dist/twilight/{p-CY6aEh1p.js → p-BIUEEJFB.js} +1 -1
- package/dist/twilight/{p-DTWIEXBd.js → p-BK1JdIAs.js} +1 -1
- package/dist/twilight/{p-CLXl5KQn.js → p-BLLbA40U.js} +1 -1
- package/dist/twilight/{p-BFIVW7Z_.js → p-CNb5qGJ_.js} +1 -1
- package/dist/twilight/{p-B_UFdi84.js → p-CV8Smdt8.js} +1 -1
- package/dist/twilight/{p-BmaTIGGk.js → p-DQlR80Sd.js} +1 -1
- package/dist/twilight/{p-CWYt6xLW.js → p-Dl88tie_.js} +1 -1
- package/dist/twilight/p-DoKdTjbN.js +9 -0
- package/dist/twilight/{p-B4mtkdfa.js → p-TcYs-K6G.js} +1 -1
- package/dist/twilight/{p-2d988821.entry.js → p-a279bd07.entry.js} +1 -1
- package/dist/twilight/{p-df9850fa.entry.js → p-a516b95f.entry.js} +1 -1
- package/dist/twilight/{p-64e6938c.entry.js → p-aeb1875a.entry.js} +1 -1
- package/dist/twilight/{p-1c2a52e8.entry.js → p-b0453703.entry.js} +1 -1
- package/dist/twilight/{p-cb90b64b.entry.js → p-b2f7cc05.entry.js} +1 -1
- package/dist/twilight/{p-6bb8845c.entry.js → p-b961be06.entry.js} +1 -1
- package/dist/twilight/{p-9df8e644.entry.js → p-b99d93ab.entry.js} +1 -1
- package/dist/twilight/{p-434d9b19.entry.js → p-c831c409.entry.js} +1 -1
- package/dist/twilight/{p-9bf3d18b.entry.js → p-d9f33b22.entry.js} +1 -1
- package/dist/twilight/{p-e945fc04.entry.js → p-df4a99db.entry.js} +1 -1
- package/dist/twilight/{p-553dd1f4.entry.js → p-dfd482e1.entry.js} +1 -1
- package/dist/twilight/{p-e81bfd34.entry.js → p-e1238ad0.entry.js} +1 -1
- package/dist/twilight/{p-7668437f.entry.js → p-ebadb30e.entry.js} +1 -1
- package/dist/twilight/{p-b188a81f.entry.js → p-f4dce389.entry.js} +2 -2
- package/dist/twilight/p-f93fea41.entry.js +4 -0
- package/dist/twilight/twilight.esm.js +1 -1
- package/package.json +5 -5
- package/dist/twilight/p-404adf2f.entry.js +0 -4
- package/dist/twilight/p-BGPMRVmO.js +0 -9
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{d as i}from"./p-
|
|
4
|
+
import{d as i}from"./p-BK1JdIAs.js";function n(i,n){return n.forEach((function(n){n&&"string"!=typeof n&&!Array.isArray(n)&&Object.keys(n).forEach((function(t){if("default"!==t&&!(t in i)){var e=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(i,t,e.get?e:{enumerable:!0,get:function(){return n[t]}})}}))})),Object.freeze(i)}var t,e,o,E={exports:{}},r=t?E.exports:(t=1,E.exports=(e=function(i){return/^image/.test(i.type)},o=function(i){var n=i.addFilter,t=i.utils,o=t.Type,E=t.createRoute,r=t.createItemAPI,l=void 0===r?function(i){return i}:r,_=i.views.fileActionButton;n("SHOULD_REMOVE_ON_REVERT",(function(i,n){var t=n.item,o=n.query;return new Promise((function(i){var n=t.file;i(!(o("GET_ALLOW_IMAGE_EDIT")&&o("GET_IMAGE_EDIT_ALLOW_EDIT")&&e(n)))}))})),n("DID_LOAD_ITEM",(function(i,n){var t=n.query,o=n.dispatch;return new Promise((function(n,E){if(i.origin>1)n(i);else{var r=i.file;if(t("GET_ALLOW_IMAGE_EDIT")&&t("GET_IMAGE_EDIT_INSTANT_EDIT"))if(e(r)){var l=function(i,n,t){return function(e){a.shift(),e?n(i):t(i),o("KICK"),_()}},_=function(){if(a.length){var i=a[0],n=i.item;o("EDIT_ITEM",{id:n.id,handleEditorResponse:l(n,i.resolve,i.reject)})}};u({item:i,resolve:n,reject:E}),1===a.length&&_()}else n(i);else n(i)}}))})),n("DID_CREATE_ITEM",(function(i,n){var t=n.dispatch;i.extend("edit",(function(){t("EDIT_ITEM",{id:i.id})}))}));var a=[],u=function(i){return a.push(i),i};return n("CREATE_VIEW",(function(i){var n=i.is,t=i.view,o=i.query;if(o("GET_ALLOW_IMAGE_EDIT")){var r=o("GET_ALLOW_IMAGE_PREVIEW");if(n("file-info")&&!r||n("file")&&r){var a=o("GET_IMAGE_EDIT_EDITOR");if(a){a.filepondCallbackBridge||(a.outputData=!0,a.outputFile=!1,a.filepondCallbackBridge={onconfirm:a.onconfirm||function(){},oncancel:a.oncancel||function(){}});t.registerDestroyer((function(i){var n=i.root;n.ref.buttonEditItem&&n.ref.buttonEditItem.off("click",n.ref.handleEdit),n.ref.editButton&&n.ref.editButton.removeEventListener("click",n.ref.handleEdit)}));var u={EDIT_ITEM:function(i){var n=i.root,t=i.props.id,e=i.action.handleEditorResponse;a.cropAspectRatio=n.query("GET_IMAGE_CROP_ASPECT_RATIO")||a.cropAspectRatio,a.outputCanvasBackgroundColor=n.query("GET_IMAGE_TRANSFORM_CANVAS_BACKGROUND_COLOR")||a.outputCanvasBackgroundColor;var o=n.query("GET_ITEM",t);if(o){var E=o.file,r=o.getMetadata("crop"),_=o.getMetadata("resize"),u=o.getMetadata("filter")||null,I=o.getMetadata("filters")||null,f=o.getMetadata("colors")||null,c=o.getMetadata("markup")||null,T={crop:r||{center:{x:.5,y:.5},flip:{horizontal:!1,vertical:!1},zoom:1,rotation:0,aspectRatio:null},size:_?{upscale:_.upscale,mode:_.mode,width:_.size.width,height:_.size.height}:null,filter:I?I.id||I.matrix:n.query("GET_ALLOW_IMAGE_FILTER")&&n.query("GET_IMAGE_FILTER_COLOR_MATRIX")&&!f?u:null,color:f,markup:c};a.onconfirm=function(i){var n=i.data,t=n.crop,E=n.size,r=n.filter,_=n.color,u=n.colorMatrix,I=n.markup,f={};if(t&&(f.crop=t),E){var c=(o.getMetadata("resize")||{}).size,T={width:E.width,height:E.height};T.width&&T.height||!c||(T.width=c.width,T.height=c.height),(T.width||T.height)&&(f.resize={upscale:E.upscale,mode:E.mode,size:T})}I&&(f.markup=I),f.colors=_,f.filters=r,f.filter=u,o.setMetadata(f),a.filepondCallbackBridge.onconfirm(n,l(o)),e&&(a.onclose=function(){e(!0),a.onclose=null})},a.oncancel=function(){a.filepondCallbackBridge.oncancel(l(o)),e&&(a.onclose=function(){e(!1),a.onclose=null})},a.open(E,T)}},DID_LOAD_ITEM:function(i){var n=i.root,E=i.props;if(o("GET_IMAGE_EDIT_ALLOW_EDIT")){var l=E.id,a=o("GET_ITEM",l);if(a&&e(a.file))if(n.ref.handleEdit=function(i){i.stopPropagation(),n.dispatch("EDIT_ITEM",{id:l})},r){var u=t.createChildView(_,{label:"edit",icon:o("GET_IMAGE_EDIT_ICON_EDIT"),opacity:0});u.element.classList.add("filepond--action-edit-item"),u.element.dataset.align=o("GET_STYLE_IMAGE_EDIT_BUTTON_EDIT_ITEM_POSITION"),u.on("click",n.ref.handleEdit),n.ref.buttonEditItem=t.appendChildView(u)}else{var I=t.element.querySelector(".filepond--file-info-main"),f=document.createElement("button");f.className="filepond--action-edit-item-alt",f.innerHTML=o("GET_IMAGE_EDIT_ICON_EDIT")+"<span>edit</span>",f.addEventListener("click",n.ref.handleEdit),I.appendChild(f),n.ref.editButton=f}}}};r&&(u.DID_IMAGE_PREVIEW_SHOW=function(i){var n=i.root;n.ref.buttonEditItem&&(n.ref.buttonEditItem.opacity=1)}),t.registerWriter(E(u))}}}})),{options:{allowImageEdit:[!0,o.BOOLEAN],styleImageEditButtonEditItemPosition:["bottom center",o.STRING],imageEditInstantEdit:[!1,o.BOOLEAN],imageEditAllowEdit:[!0,o.BOOLEAN],imageEditIconEdit:['<svg width="26" height="26" viewBox="0 0 26 26" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M8.5 17h1.586l7-7L15.5 8.414l-7 7V17zm-1.707-2.707l8-8a1 1 0 0 1 1.414 0l3 3a1 1 0 0 1 0 1.414l-8 8A1 1 0 0 1 10.5 19h-3a1 1 0 0 1-1-1v-3a1 1 0 0 1 .293-.707z" fill="currentColor" fill-rule="nonzero"/></svg>',o.STRING],imageEditEditor:[null,o.OBJECT]}}},"undefined"!=typeof window&&void 0!==window.document&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:o})),o)),l=n({__proto__:null,default:i(r)},[r]);
|
|
5
5
|
/*!
|
|
6
6
|
* FilePondPluginImageEdit 1.6.3
|
|
7
7
|
* Licensed under MIT, https://opensource.org/licenses/MIT/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{d as t}from"./p-
|
|
4
|
+
import{d as t}from"./p-BK1JdIAs.js";function n(t,n){return n.forEach((function(n){n&&"string"!=typeof n&&!Array.isArray(n)&&Object.keys(n).forEach((function(e){if("default"!==e&&!(e in t)){var r=Object.getOwnPropertyDescriptor(n,e);Object.defineProperty(t,e,r.get?r:{enumerable:!0,get:function(){return n[e]}})}}))})),Object.freeze(t)}var e,r={exports:{}},i=(e||(e=1,r.exports=function(){var t={type:"spring",stiffness:.5,damping:.45,mass:10},n=function(t){return-.5*(Math.cos(Math.PI*t)-1)},e=function(t){var n=Math.min(10/t.width,10/t.height),e=document.createElement("canvas"),i=e.getContext("2d"),o=e.width=Math.ceil(t.width*n),a=e.height=Math.ceil(t.height*n);i.drawImage(t,0,0,o,a);var _=null;try{_=i.getImageData(0,0,o,a).data}catch(t){return null}for(var E=_.length,I=0,u=0,c=0,T=0;T<E;T+=4)I+=_[T]*_[T],u+=_[T+1]*_[T+1],c+=_[T+2]*_[T+2];return{r:I=r(I,E),g:u=r(u,E),b:c=r(c,E)}},r=function(t,n){return Math.floor(Math.sqrt(t/(n/4)))},i=function(t,e,r,i,o){t.width=e,t.height=r;var a=t.getContext("2d"),_=.5*e,E=a.createRadialGradient(_,r+110,r-100,_,r+110,r+100);(function(t,e){for(var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:n,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:10,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,_=1-a,E=e.join(","),I=0;I<=o;I++){var u=I/o;t.addColorStop(a+_*u,"rgba(".concat(E,", ").concat(i(u)*r,")"))}})(E,i,o,void 0,8,.4),a.save(),a.translate(-250,0),a.scale(2,1),a.fillStyle=E,a.fillRect(0,0,e,r),a.restore()},o="undefined"!=typeof navigator,a=500,_=200,E=o&&document.createElement("canvas"),I=o&&document.createElement("canvas"),u=o&&document.createElement("canvas"),c=[40,40,40],T=[196,78,71],f=[54,151,99];o&&(i(E,a,_,c,.85),i(I,a,_,T,1),i(u,a,_,f,1));var l=function(n){var r=n.utils.createView({name:"file-poster-overlay",tag:"canvas",ignoreRect:!0,create:function(t){var n,e;(e=t.root.element).width=(n=t.props.template).width,e.height=n.height,e.getContext("2d").drawImage(n,0,0)},mixins:{styles:["opacity"],animations:{opacity:{type:"spring",mass:25}}}}),o=function(t){var n=t.root;n.ref.overlayShadow.opacity=1,n.ref.overlayError.opacity=0,n.ref.overlaySuccess.opacity=0},l=function(t){var n=t.root;n.ref.overlayShadow.opacity=.25,n.ref.overlayError.opacity=1};return n.utils.createView({name:"file-poster-wrapper",create:function(e){var o=e.root,l=e.props,s=o.query("GET_FILE_POSTER_ITEM_OVERLAY_SHADOW_COLOR"),O=o.query("GET_FILE_POSTER_ITEM_OVERLAY_ERROR_COLOR"),R=o.query("GET_FILE_POSTER_ITEM_OVERLAY_SUCCESS_COLOR");s&&s!==c&&i(E,a,_,c=s,.85),O&&O!==T&&i(I,a,_,T=O,1),R&&R!==f&&i(u,a,_,f=R,1);var v=function(n){return n.utils.createView({name:"file-poster",tag:"div",ignoreRect:!0,create:function(t){var n=t.root;n.ref.image=document.createElement("img"),n.element.appendChild(n.ref.image)},write:n.utils.createRoute({DID_FILE_POSTER_LOAD:function(t){var n=t.root,e=t.props,r=e.id,i=n.query("GET_ITEM",{id:e.id});if(i){var o=i.getMetadata("poster");n.ref.image.src=o,n.dispatch("DID_FILE_POSTER_DRAW",{id:r})}}}),mixins:{styles:["scaleX","scaleY","opacity"],animations:{scaleX:t,scaleY:t,opacity:{type:"tween",duration:750}}}})}(n);o.ref.image=o.appendChildView(o.createChildView(v,{id:l.id,scaleX:1.25,scaleY:1.25,opacity:0})),o.ref.overlayShadow=o.appendChildView(o.createChildView(r,{template:E,opacity:0})),o.ref.overlaySuccess=o.appendChildView(o.createChildView(r,{template:u,opacity:0})),o.ref.overlayError=o.appendChildView(o.createChildView(r,{template:I,opacity:0}))},write:n.utils.createRoute({DID_FILE_POSTER_LOAD:function(t){t.root.ref.overlayShadow.opacity=1},DID_FILE_POSTER_DRAW:function(t){var n=t.root.ref.image;n.scaleX=1,n.scaleY=1,n.opacity=1},DID_FILE_POSTER_CONTAINER_CREATE:function(t){var n,r,i,o=t.root,a=t.props.id,_=o.query("GET_ITEM",a);if(_){var E=_.getMetadata("poster"),I=function(t){var n=o.query("GET_FILE_POSTER_CALCULATE_AVERAGE_IMAGE_COLOR")?e(t):null;_.setMetadata("color",n,!0),o.dispatch("DID_FILE_POSTER_LOAD",{id:a,data:t})};n=E,r=function(t,n){var e,r;o.dispatch("DID_FILE_POSTER_CALCULATE_SIZE",{id:a,width:t,height:n}),(e=E,r=o.query("GET_FILE_POSTER_CROSS_ORIGIN_ATTRIBUTE_VALUE"),new Promise((function(t,n){var i=new Image;"string"==typeof crossOrigin&&(i.crossOrigin=r),i.onload=function(){t(i)},i.onerror=function(t){n(t)},i.src=e}))).then(I)},(i=new Image).onload=function(){var t=i.naturalWidth,n=i.naturalHeight;i=null,r(t,n)},i.src=n}},DID_THROW_ITEM_LOAD_ERROR:l,DID_THROW_ITEM_PROCESSING_ERROR:l,DID_THROW_ITEM_INVALID:l,DID_COMPLETE_ITEM_PROCESSING:function(t){var n=t.root;n.ref.overlayShadow.opacity=.25,n.ref.overlaySuccess.opacity=1},DID_START_ITEM_PROCESSING:o,DID_REVERT_ITEM_PROCESSING:o})})},s=function(t){var n=t.addFilter,e=t.utils,r=e.Type,i=e.createRoute,o=l(t);return n("CREATE_VIEW",(function(t){var n=t.view,e=t.query;if((0,t.is)("file")&&e("GET_ALLOW_FILE_POSTER")){var r=function(t,r){var i=r.id,a=e("GET_ITEM",i);a&&a.getMetadata("poster")&&!a.archived&&t.ref.previousPoster!==a.getMetadata("poster")&&(t.ref.previousPoster=a.getMetadata("poster"),e("GET_FILE_POSTER_FILTER_ITEM")(a)&&(t.ref.filePoster&&n.removeChildView(t.ref.filePoster),t.ref.filePoster=n.appendChildView(n.createChildView(o,{id:i})),t.dispatch("DID_FILE_POSTER_CONTAINER_CREATE",{id:i})))},a=function(t){var n=t.root,e=n.query("GET_FILE_POSTER_HEIGHT");if(e)return e;var r=n.query("GET_FILE_POSTER_MIN_HEIGHT"),i=n.query("GET_FILE_POSTER_MAX_HEIGHT");if(r&&n.ref.imageHeight<r)return r;var o=n.rect.element.width*(n.ref.imageHeight/n.ref.imageWidth);return r&&o<r?r:i&&o>i?i:o};n.registerWriter(i({DID_LOAD_ITEM:function(t){r(t.root,t.props)},DID_FILE_POSTER_CALCULATE_SIZE:function(t){var n=t.root,e=t.action;n.ref.filePoster&&(n.ref.imageWidth=e.width,n.ref.imageHeight=e.height,n.ref.shouldUpdatePanelHeight=!0,n.dispatch("KICK"))},DID_UPDATE_ITEM_METADATA:function(t){var n=t.root,e=t.props;/poster/.test(t.action.change.key)&&r(n,e)}},(function(t){var n=t.root;n.ref.filePoster&&(n.rect.element.hidden||n.ref.shouldUpdatePanelHeight&&(n.dispatch("DID_UPDATE_PANEL_HEIGHT",{id:t.props.id,height:a({root:n})}),n.ref.shouldUpdatePanelHeight=!1))})))}})),{options:{allowFilePoster:[!0,r.BOOLEAN],filePosterHeight:[null,r.INT],filePosterMinHeight:[null,r.INT],filePosterMaxHeight:[null,r.INT],filePosterFilterItem:[function(){return!0},r.FUNCTION],filePosterCalculateAverageImageColor:[!1,r.BOOLEAN],filePosterCrossOriginAttributeValue:["Anonymous",r.STRING],filePosterItemOverlayShadowColor:[null,r.ARRAY],filePosterItemOverlayErrorColor:[null,r.ARRAY],filePosterItemOverlaySuccessColor:[null,r.ARRAY]}}};return"undefined"!=typeof window&&void 0!==window.document&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:s})),s}()),r.exports),o=n({__proto__:null,default:t(i)},[i]);
|
|
5
5
|
/*!
|
|
6
6
|
* FilePondPluginFilePoster 2.5.1
|
|
7
7
|
* Licensed under MIT, https://opensource.org/licenses/MIT/
|