@shipengine/elements 2.15.0 → 2.17.0
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/actions-menu.js +5 -5
- package/carrier.js +1 -1
- package/components.js +1 -1
- package/elements.js +1 -1
- package/hooks.js +1 -1
- package/index.js +1 -1
- package/package.json +5 -5
- package/src/components/add-funds-form/add-funds-form.d.ts +2 -2
- package/src/components/carrier-balance/carrier-balance.d.ts +4 -7
- package/src/components/fund-and-purchase/fund-and-purchase.d.ts +1 -2
- package/src/components/modal/modal.styles.d.ts +6 -0
- package/src/components/templates/products-display/products-display.styles.d.ts +2 -1
- package/src/components/templates/shipment-form/shipment-form.d.ts +3 -2
- package/src/elements/purchase-label/hooks/use-presets.d.ts +2 -1
- package/src/elements/purchase-label/hooks/use-rates-form.d.ts +3 -1
- package/src/elements/purchase-label/hooks/use-rates-with-cache.d.ts +3 -1
- package/src/elements/purchase-label/hooks/use-request-rates.d.ts +3 -1
- package/src/elements/purchase-label/hooks/use-shipment-form.d.ts +3 -3
- package/src/features/manage-carriers/manage-carriers.d.ts +2 -2
- package/src/features/manage-funding/manage-funding.d.ts +2 -2
- package/src/hooks/options/format-carrier-label.d.ts +2 -0
- package/src/hooks/options/use-rate-options.d.ts +1 -1
- package/src/hooks/options/use-service-code-options.d.ts +2 -1
- package/src/utilities/feature-flags/index.d.ts +1 -0
- package/src/utilities/feature-flags/types.d.ts +5 -4
- package/src/utilities/feature-flags/utils.d.ts +2 -0
- package/src/utilities/form-logger.d.ts +1 -1
- package/src/utilities/validation.d.ts +1 -1
- package/src/workflows/carrier-services/carrier-services.d.ts +25 -25
- package/src/workflows/onboarding/components/onboarding-wizard/onboarding-wizard.d.ts +2 -1
- package/src/workflows/onboarding/onboarding.d.ts +77 -5
- package/use-configure-shipment.js +1 -1
- package/use-toggle.js +1 -1
- package/use-unit-settings.js +1 -1
- package/utilities.js +1 -1
- package/validation.js +1 -1
- package/vat.js +1 -1
- package/wallet-form.js +1 -1
- package/warehouses.js +1 -1
- package/workflows.js +1 -1
package/carrier.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{format as e}from"date-fns/format";import{ca as r,de as a,enAU as t,enGB as s,enUS as n,es as i,fr as l,it as o,pt as c}from"date-fns/locale";import{parse as d}from"date-fns/parse";import u from"lodash/get";import m from"humps";import{SE as p}from"@shipengine/react-api";import g from"lodash/isEqual";import h from"lodash/isNil";import v from"lodash/omit";import f from"lodash/omitBy";import{c as y,u as w,f as b}from"./address.js";function D(e,r){var a={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&r.indexOf(t)<0&&(a[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(t=Object.getOwnPropertySymbols(e);s<t.length;s++)r.indexOf(t[s])<0&&Object.prototype.propertyIsEnumerable.call(e,t[s])&&(a[t[s]]=e[t[s]])}return a}function C(e,r,a,t){return new(a||(a=Promise))((function(s,n){function i(e){try{o(t.next(e))}catch(e){n(e)}}function l(e){try{o(t.throw(e))}catch(e){n(e)}}function o(e){var r;e.done?s(e.value):(r=e.value,r instanceof a?r:new a((function(e){e(r)}))).then(i,l)}o((t=t.apply(e,r||[])).next())}))}const L=(e,r="en-US")=>new Date(e).toLocaleDateString(r,{day:"numeric",month:"long",year:"numeric"}),S=(e="en-US")=>{const d=e.replaceAll("-",""),u=e.split("-")[0],m={ca:r,de:a,enAU:t,enGB:s,enUS:n,es:i,fr:l,it:o,pt:c};return m[d in m?d:u]},A=(r,a="en-US",t)=>{const s=S(a),n=F(a);return e(r,null!=t?t:n,{locale:s})},M=(e,r="en-US",a="P")=>{const t=S(r);return d(e,a,new Date,{locale:t})},U=(e,r="en-US")=>new Date(e).toLocaleDateString(r,{day:"2-digit",month:"2-digit",year:"2-digit"}),O=(e,r="en-US")=>new Date(e).toLocaleDateString(r,{day:"2-digit",month:"2-digit",year:"numeric"}),F=(e="en-US")=>{var r;return null===(r=(S(e)||S("en-US")).formatLong)||void 0===r?void 0:r.date({width:"short"})},j=(e,r=new Date)=>((r=new Date(r)).setDate(r.getDate()+e),r),z=(e,r=new Date)=>r.getHours()>=e?j(1,new Date(r)):new Date(r),I=(...e)=>new Date(Math.max(...e.map(Number))),P=e=>{const r=e?new Date(e):new Date;return new Date(r.getUTCFullYear(),r.getUTCMonth(),r.getUTCDate())},_=e=>{const r=(new Date).getFullYear(),a=[];for(let t=0;t<e;t++)a.push(`${r+t}`);return a},x=(e,r,a="desc")=>{const[t,s]="asc"===a?[e,r]:[r,e];return new Date(t.createdAt).getTime()-new Date(s.createdAt).getTime()},E=e=>!!e&&("string"==typeof e?new Date(e):e)>=new Date,k=e=>{const r=null!=e?e:new Date;return{firstDayOfMonth:new Date(r.getFullYear(),r.getMonth(),1),lastDayOfTheMonth:new Date(r.getFullYear(),r.getMonth()+1,0),origin:r,previousMonthFirstDay:new Date(r.getFullYear(),r.getMonth()-1,1),previousMonthLastDay:new Date(r.getFullYear(),r.getMonth()-1+1,0),thirtyDaysAgo:new Date((new Date).setDate(r.getDate()-30))}},B={accountSettingsFeatures:{showCarrierServices:!0,showExternalCarriers:!1,showLabelLayout:!0,showManageWarehouses:!0,showUnitSettings:!0,showVatSettings:!0},globalFeatures:{enableParcelGuard:!0,isSandbox:!1,poweredByShipEngine:!0,showVatSettings:!1},labelsGridFeatures:{columns:[{allowFilter:!0,name:"labelId"},{name:"recipient"},{name:"shippingService"},{name:"createdDate"},{name:"trackingStatus"}],showActions:!0},purchaseLabelFeatures:{betaEnableWindsorFramework:!1,compatibleCountryCodes:["AU","CA","FR","DE","GB","IL","IT","NO","ES","SE","US"],enableErrorWhenShipmentCancelled:!1,partnerMessages:{incompleteLabelPurchaseRequirements:void 0},rateForm:{enableFunding:!0,enableGlobalPostFiltering:!1,enablePudoUI:!1,labelLayout:!1,nicknameRate:!0,requireDhlTermsAcknowledgement:!1,saveRate:!0},shipmentForm:{addOns:!0,browseRates:!0,includeCarrierInsurance:!1,includeShipsuranceInsurance:!0,includeThirdPartyInsurance:!1,selectService:!0,shippingPresets:!1,useWarehouses:!0}},shipmentSummaryFeatures:{schedulePickup:!0}},T=e=>{var r;return null!==(r={PurchaseLabel:"ConfigureSalesOrderShipment"}[e])&&void 0!==r?r:""},V=e=>e.map((e=>u(B,e))).reduce(((e,r)=>Object.assign(e,r))),R=e=>null!==e&&"object"==typeof e&&!Array.isArray(e);function $(e,r){const a=Object.assign({},e);return R(e)&&R(r)&&Object.keys(r).forEach((e=>{R(r[e])?(a[e]||Object.assign(a,{[e]:{}}),a[e]=$(a[e],r[e])):Object.assign(a,{[e]:r[e]})})),a}const Z=e=>e.slice(0,1).toUpperCase()+e.slice(1),G=e=>e.split(" ").map((e=>Z(e.toLowerCase()))).join(" "),q=e=>m.pascalize(e),N=e=>null==e?void 0:e.replace(/\s+/g,"-").toLowerCase(),Y=e=>e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/(?<=[a-zA-Z])(\d)/g," $1").trim(),H={aud:"$",cad:"$",eur:"€",gbp:"£",nzd:"$",usd:"$"},W=(e,r="en-US")=>Intl.NumberFormat(r,{currency:e.currency,style:"currency"}).format(e.amount),J=(...e)=>e.reduce(((e,r)=>{var a;return r?e+(null!==(a=r.amount)&&void 0!==a?a:0):e}),0),K=e=>[e.substring(0,4),e.substring(4,8),e.substring(8,12),e.substring(12)].join(" ").trim(),Q=e=>{const r=e.replace(/\//g,"");return r.length>2?[r.substring(0,2),r.substring(2,6)].join("/").trim():r},X=e=>{switch(null==e?void 0:e.toLowerCase()){case"usd":default:return p.Currency.USD;case"cad":return p.Currency.CAD;case"aud":return p.Currency.AUD;case"gbp":return p.Currency.GBP;case"eur":return p.Currency.EUR;case"nzd":return p.Currency.NZD}},ee=e=>{let r;switch(e){case p.Currency.USD:case p.Currency.CAD:case p.Currency.AUD:case p.Currency.NZD:r="$";break;case p.Currency.GBP:r="£";break;case p.Currency.EUR:r="€"}return r},re=(e,r,a)=>{switch(e){case"usps_media_mail":return!0;case"usps_first_class_mail":return"large_envelope_or_flat"===r;case"dhl_express_worldwide":return a;default:return!1}},ae=(e={})=>J(...Object.values(e)),te=(e,r)=>r[e]||e,se=e=>{var r;return"US"===e.countryCode||(null===(r=y.find((r=>r.code===e.countryCode)))||void 0===r?void 0:r.isUnitedStatesTerritory)},ne=e=>{var r,a;return!(!(null===(r=w.find((r=>r.code===e.stateProvince)))||void 0===r?void 0:r.isMilitary)&&!(null===(a=b.find((r=>r.code===e.cityLocality)))||void 0===a?void 0:a.isMilitary))},ie=e=>{var r,a;return!(!(null===(r=y.find((r=>r.code===e.countryCode)))||void 0===r?void 0:r.isUnitedStatesTerritory)&&!(null===(a=w.find((r=>r.code===e.stateProvince)))||void 0===a?void 0:a.isUnitedStatesTerritory))},le=e=>{var r;return!!(null===(r=y.find((r=>r.code===e.countryCode)))||void 0===r?void 0:r.isUnsupportedByUps)},oe=/^(((p[\s\.\'\,]?[o\s][\.\'\,]?)\s?)|(post\s?office\s?))((box|bin|bo|b\.?)?\s?(num|number|#)?\s?\d+)/i,ce=e=>oe.test(e),de=e=>!!(ce(e.addressLine1)||e.addressLine2&&ce(e.addressLine2)),ue=e=>!e||Object.entries(e).every((([e,r])=>"countryCode"===e||[null,"","unknown"].includes(r))),me=(e,r)=>Object.assign(Object.assign(Object.assign({},e),e.matchedAddress&&{matchedAddress:Object.assign(Object.assign({},e.matchedAddress),{email:r})}),{originalAddress:Object.assign(Object.assign({},e.originalAddress),{email:r})}),pe=e=>{var r;if(e)return null!==(r=e.find((e=>e.isDefault)))&&void 0!==r?r:e[0]},ge=(e,r)=>{if(!e&&!r)return;const a={originAddress:f(v(null==e?void 0:e.shipFrom,["addressResidentialIndicator"]),h),returnAddress:f(v(null==e?void 0:e.returnTo,["addressResidentialIndicator"]),h)},t=null==r?void 0:r.find((e=>g(a,v(Object.assign(Object.assign({},e),void 0===e.returnAddress&&{returnAddress:e.originAddress}),["addressId","name","isDefault"]))));return(null==t?void 0:t.addressId)||"custom-shipment-address"},he=(e,r)=>{if(!e||!r)return;const a={originAddress:f(v(null==e?void 0:e.shipFrom,["addressResidentialIndicator"]),h),returnAddress:f(v(null==e?void 0:e.returnTo,["addressResidentialIndicator"]),h)};return null==r?void 0:r.some((e=>g(a,v(Object.assign(Object.assign({},e),void 0===e.returnAddress&&{returnAddress:e.originAddress}),["addressId","name","isDefault"]))))};const ve=["usps","stamps_com"],fe=e=>ve.includes(e),ye=e=>"ups"===e,we=e=>e.includes("yodel"),be=e=>"hermes"===e,De=(e=[],r)=>{const a=e.find((e=>e.carrierCode===r));return null==a?void 0:a.carrierId},Ce=(e,r)=>{var a;if("parcelguard"===e)return"logo"===r?"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='55' height='55' fill='none'%3e%3cmask id='a' width='55' height='55' x='0' y='0' maskUnits='userSpaceOnUse' style='mask-type:alpha'%3e%3cpath fill='%23FFFFFE' fill-rule='evenodd' d='M55 0H0v55h55zM32.238 10.76H24.39V7.997h7.847zM2.39 40.477l48.324-6.693V12.967L2.39 19.618z' clip-rule='evenodd'/%3e%3c/mask%3e%3cg fill-rule='evenodd' clip-rule='evenodd' mask='url(%23a)'%3e%3cpath fill='%23BBAE92' d='M10.136 9.38v31.096l17.726 10.908 18.03-10.908V9.456z'/%3e%3cpath fill='%23343534' d='M8.087 6.742c.49-.271 1.111-.413 1.751-.413H46.19c.64 0 1.26.142 1.75.413.462.255.99.742.99 1.477v32.75c0 .602-.342 1.13-.691 1.496-.354.37-.823.693-1.342.902L30.024 53.77a1 1 0 0 1-.144.07c-.556.21-1.232.3-1.867.3-.634 0-1.31-.09-1.867-.3a1 1 0 0 1-.143-.07L9.13 43.367a3.9 3.9 0 0 1-1.34-.902c-.35-.366-.692-.894-.692-1.496V8.219c0-.735.528-1.222.99-1.477m.663 1.577.006-.009zm.023-.026a.7.7 0 0 1 .125-.085c.198-.11.529-.204.94-.204H46.19c.41 0 .742.094.94.204a.7.7 0 0 1 .125.085v32.676q0-.006-.002.002c-.008.025-.046.148-.227.338a2.2 2.2 0 0 1-.8.522 1 1 0 0 0-.144.07L29.22 52.298c-.308.103-.74.167-1.206.167s-.897-.064-1.205-.167L9.945 41.902a1 1 0 0 0-.143-.07 2.2 2.2 0 0 1-.8-.523c-.182-.19-.22-.313-.227-.337q-.003-.009-.002-.003zm38.505.026-.006-.009q.007.01.006.01'/%3e%3cpath fill='%23343534' d='M32.81 1.106a.84.84 0 0 1 1.1-.44l13.887 5.946a.838.838 0 1 1-.66 1.54L33.252 2.206a.84.84 0 0 1-.44-1.1M26.343 3.567a.84.84 0 0 1-.643.994L9.327 8.075a.838.838 0 0 1-.351-1.638l16.373-3.514a.84.84 0 0 1 .994.644M22.73 7.25c0-.463.375-.838.838-.838h9.51c.462 0 .837.375.837.838v4.26a.84.84 0 0 1-.837.838h-9.51a.84.84 0 0 1-.838-.838zm1.675.838v2.584h7.835V8.088z'/%3e%3c/g%3e%3cpath fill='%23343534' fill-rule='evenodd' d='M9.36 22.741c-.144-.233-.375-.323-.777-.268l-1.944.267.02 1.841 1.915-.263c.461-.064.69-.247.808-.486.068-.15.087-.306.084-.538-.003-.253-.035-.451-.107-.553m2.001 2.187c-.455.6-1.214.957-2.196 1.113-.3.05-2.455.326-2.455.326l.028 2.5-2.456.337-.089-7.992 4.901-.673c.962-.133 1.646-.014 2.092.38.466.342.724.996.735 1.987.01.89-.174 1.543-.56 2.022M15.859 22.324l-.168-.645-.153.71-.68 1.977 1.673-.23zm-2.186 5.59-2.526.346 3.018-8.418 3.117-.428 2.995 7.592-2.566.352-.6-1.62-2.836.39zM25.765 20.467c-.123-.237-.364-.284-.715-.236l-2.055.282.018 1.629 2.105-.29c.3-.041.56-.147.648-.352.059-.15.087-.367.085-.528-.002-.182-.024-.392-.086-.506m2.135 1.53c-.246.46-.604.761-.974.893l1.9 2.941-2.736.376-1.433-2.508-1.644.226.03 2.7-2.405.331-.09-7.991 5.042-.693c1.062-.146 1.757.062 2.164.543.315.362.471.878.48 1.627.007.647-.128 1.171-.334 1.555M36.824 23.03c-.538 1.26-1.643 2.04-3.778 2.333-1.473.202-2.55.026-3.248-.567-.67-.577-1.001-1.554-1.017-2.971-.014-1.274.275-2.297.87-3.057.692-.866 1.78-1.41 3.354-1.627 2.425-.333 3.497.432 3.86 1.506.156.445.213.995.216 1.308l-2.475.34a1.6 1.6 0 0 0-.22-.8c-.235-.373-.608-.525-1.39-.417-.662.09-1.08.33-1.346.752-.247.379-.331.948-.323 1.676.01.84.135 1.339.4 1.637.305.353.787.418 1.339.342.72-.098 1.11-.375 1.317-.697.187-.28.244-.56.26-.897l2.476-.34c-.016.326-.05.959-.295 1.479M37.965 24.575l-.089-7.991 6.765-.93.021 1.882-4.37.6.014 1.163 4.209-.578.02 1.901-4.208.579.013 1.183 4.42-.607.02 1.862zM45.913 23.483l-.09-7.991 2.476-.34.067 6.018 3.818-.525.023 1.973zM12.535 37.45l-.108-.654c-.505.597-1.264.964-2.356 1.114-1.443.199-2.542-.167-3.154-1.025-.377-.506-.628-1.444-.64-2.557-.012-1.001.149-1.935.612-2.708.561-.948 1.636-1.765 3.5-2.02 2.055-.283 3.175.272 3.648 1.261.164.332.26.846.264 1.19l-2.365.325c-.002-.203-.116-.45-.288-.62-.233-.23-.636-.338-1.147-.267-.621.085-1.051.276-1.328.668-.267.361-.4.937-.39 1.888.01.88.166 1.365.36 1.652.244.311.688.524 1.5.412.822-.113 1.438-.613 1.512-1.2l-.005-.426-1.984.273-.019-1.719 4.22-.58s.022 2.094.028 2.54c.01.98.033 2.142.034 2.193zM19.07 36.664c-2.185.3-3.858-.301-3.881-2.385l-.058-5.19 2.456-.337.057 5.088c.007.698.543 1.04 1.455.915.862-.119 1.418-.64 1.41-1.299 0-.151-.056-5.098-.056-5.098l2.445-.336.06 5.351c.02 1.862-1.613 2.978-3.888 3.29M27.9 30.05l-.169-.645-.152.71-.681 1.978 1.674-.23zm-2.187 5.59-2.526.346 3.018-8.418 3.117-.428 2.996 7.592-2.566.352-.6-1.62-2.836.39zM38.006 28.165c-.123-.236-.365-.284-.716-.236l-2.054.282.018 1.63 2.105-.29c.3-.041.56-.148.648-.353.059-.15.087-.366.085-.528-.002-.182-.025-.392-.086-.505m2.135 1.53c-.246.46-.604.762-.974.894l1.9 2.94-2.736.377-1.433-2.509-1.644.226.03 2.701-2.405.33-.09-7.99 5.042-.694c1.062-.145 1.757.063 2.164.544.315.362.471.877.48 1.626.007.648-.128 1.172-.334 1.555M47.074 28.55c-.007-.576-.075-1.306-.279-1.501-.314-.302-.605-.353-1.207-.27l-1.533.21.047 4.239 1.534-.21c.621-.086.95-.263 1.217-.624.208-.282.228-1.196.22-1.844m-.886 4.276-4.49.617-.09-7.992 4.37-.6c1.444-.198 2.34.033 2.838.653.499.61.596 1.266.613 2.722.018 1.7-.084 2.342-.518 3.07-.473.805-1.29 1.333-2.723 1.53' clip-rule='evenodd'/%3e%3cpath fill='%231A1919' fill-rule='evenodd' d='m50.974 40.244.198.625.195-.625h.45v1.086h-.288v-.786l-.236.786h-.245l-.236-.784v.784h-.288v-1.086zm-1.506.261v-.26h.959v.26h-.323v.825h-.317v-.825z' clip-rule='evenodd'/%3e%3c/svg%3e":"data:image/svg+xml,%3csvg width='21' height='20' viewBox='0 0 21 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath fill-rule='evenodd' clip-rule='evenodd' d='M2.16675 3.33342V15.6721L9.969 19.7591C10.2574 19.9102 10.6014 19.9114 10.8909 19.7623L18.8334 15.6721V3.33343L2.16675 3.33342Z' fill='%23343534'/%3e%3cpath fill-rule='evenodd' clip-rule='evenodd' d='M8.58857 0.731017C8.7832 1.14808 8.60288 1.64395 8.18582 1.83857L2.93582 4.92191L2.16675 3.33342L7.48101 0.328269C7.89807 0.133641 8.39394 0.313958 8.58857 0.731017Z' fill='%23343534'/%3e%3cpath fill-rule='evenodd' clip-rule='evenodd' d='M11.4734 0.371172C11.7287 -0.0117689 12.2461 -0.115247 12.629 0.140047L18.8334 3.33343L17.9545 4.86013L11.7045 1.5268C11.3216 1.2715 11.2181 0.754112 11.4734 0.371172Z' fill='%23343534'/%3e%3cpath fill-rule='evenodd' clip-rule='evenodd' d='M3.83325 5V14.8709L10.4431 18.3333L17.1666 14.8709V5.02448L3.83325 5Z' fill='%23F9FAFB'/%3e%3cpath fill-rule='evenodd' clip-rule='evenodd' d='M3.8335 4.8335V14.8277L10.4432 18.3334L17.1665 14.8277V4.85828L3.8335 4.8335Z' fill='%23BBAE92'/%3e%3c/svg%3e";return`https://logos.shipstation.com/ipaas/carriers/${null!==(a={stamps_com:"stamps_com_wl",usps:"stamps_com_wl"}[e])&&void 0!==a?a:e}/${r}.svg`},Le=e=>!!e&&["GB","CA"].includes(e),Se=e=>"AU"===e,Ae=(e,r)=>null==e?void 0:e.filter((e=>"globalpost"===e.carrierCode?Le(r):"sendle_walleted"!==e.carrierCode||Se(r)));export{Se as $,J as A,K as B,Q as C,X as D,ee as E,re as F,ae as G,te as H,se as I,ne as J,ie as K,le as L,ce as M,de as N,ue as O,me as P,pe as Q,ge as R,he as S,fe as T,ye as U,we as V,be as W,De as X,Ce as Y,Le as Z,C as _,S as a,Ae as a0,D as a1,A as b,U as c,$ as d,O as e,L as f,V as g,F as h,j as i,_ as j,E as k,k as l,I as m,z as n,P as o,M as p,T as q,R as r,x as s,Z as t,G as u,q as v,N as w,Y as x,H as y,W as z};
|
|
1
|
+
import{format as e}from"date-fns/format";import{ca as r,de as a,enAU as s,enGB as t,enUS as n,es as i,fr as l,it as o,pt as c}from"date-fns/locale";import{parse as d}from"date-fns/parse";import u from"lodash/get.js";import m from"humps";import{SE as p}from"@shipengine/react-api";import g from"lodash/isEqual.js";import h from"lodash/isNil.js";import v from"lodash/omit.js";import f from"lodash/omitBy.js";import{c as y,u as w,f as b}from"./address.js";function D(e,r){var a={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&r.indexOf(s)<0&&(a[s]=e[s]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var t=0;for(s=Object.getOwnPropertySymbols(e);t<s.length;t++)r.indexOf(s[t])<0&&Object.prototype.propertyIsEnumerable.call(e,s[t])&&(a[s[t]]=e[s[t]])}return a}function C(e,r,a,s){return new(a||(a=Promise))((function(t,n){function i(e){try{o(s.next(e))}catch(e){n(e)}}function l(e){try{o(s.throw(e))}catch(e){n(e)}}function o(e){var r;e.done?t(e.value):(r=e.value,r instanceof a?r:new a((function(e){e(r)}))).then(i,l)}o((s=s.apply(e,r||[])).next())}))}const L=(e,r="en-US")=>new Date(e).toLocaleDateString(r,{day:"numeric",month:"long",year:"numeric"}),S=(e="en-US")=>{const d=e.replaceAll("-",""),u=e.split("-")[0],m={ca:r,de:a,enAU:s,enGB:t,enUS:n,es:i,fr:l,it:o,pt:c};return m[d in m?d:u]},A=(r,a="en-US",s)=>{const t=S(a),n=j(a);return e(r,null!=s?s:n,{locale:t})},M=(e,r="en-US",a="P")=>{const s=S(r);return d(e,a,new Date,{locale:s})},U=(e,r="en-US")=>new Date(e).toLocaleDateString(r,{day:"2-digit",month:"2-digit",year:"2-digit"}),O=(e,r="en-US")=>new Date(e).toLocaleDateString(r,{day:"2-digit",month:"2-digit",year:"numeric"}),j=(e="en-US")=>{var r;return null===(r=(S(e)||S("en-US")).formatLong)||void 0===r?void 0:r.date({width:"short"})},F=(e,r=new Date)=>((r=new Date(r)).setDate(r.getDate()+e),r),z=(e,r=new Date)=>r.getHours()>=e?F(1,new Date(r)):new Date(r),I=(...e)=>new Date(Math.max(...e.map(Number))),_=e=>{const r=e?new Date(e):new Date;return new Date(r.getUTCFullYear(),r.getUTCMonth(),r.getUTCDate())},x=e=>{const r=(new Date).getFullYear(),a=[];for(let s=0;s<e;s++)a.push(`${r+s}`);return a},P=(e,r,a="desc")=>{const[s,t]="asc"===a?[e,r]:[r,e];return new Date(s.createdAt).getTime()-new Date(t.createdAt).getTime()},E=e=>!!e&&("string"==typeof e?new Date(e):e)>=new Date,k=e=>{const r=null!=e?e:new Date;return{firstDayOfMonth:new Date(r.getFullYear(),r.getMonth(),1),lastDayOfTheMonth:new Date(r.getFullYear(),r.getMonth()+1,0),origin:r,previousMonthFirstDay:new Date(r.getFullYear(),r.getMonth()-1,1),previousMonthLastDay:new Date(r.getFullYear(),r.getMonth()-1+1,0),thirtyDaysAgo:new Date((new Date).setDate(r.getDate()-30))}},B={accountSettingsFeatures:{showCarrierServices:!0,showExternalCarriers:!1,showLabelLayout:!0,showManageWarehouses:!0,showUnitSettings:!0,showVatSettings:!0},globalFeatures:{enableParcelGuard:!0,isSandbox:!1,poweredByShipEngine:!0,showVatSettings:!1},labelsGridFeatures:{columns:[{allowFilter:!0,name:"labelId"},{name:"recipient"},{name:"shippingService"},{name:"createdDate"},{name:"trackingStatus"}],showActions:!0},purchaseLabelFeatures:{betaEnableWindsorFramework:!1,compatibleCountryCodes:["AU","CA","FR","DE","GB","IL","IT","NO","ES","SE","US"],enableErrorWhenShipmentCancelled:!1,partnerMessages:{incompleteLabelPurchaseRequirements:void 0},rateForm:{enableFunding:!0,enablePudoUI:!1,labelLayout:!1,nicknameRate:!0,requireDhlTermsAcknowledgement:!1,saveRate:!0},shipmentForm:{addOns:!0,browseRates:!0,includeCarrierInsurance:!1,includeShipsuranceInsurance:!0,includeThirdPartyInsurance:!1,selectService:!0,shippingPresets:!1,useWarehouses:!0}},shipmentSummaryFeatures:{schedulePickup:!0}},T=e=>{var r;return null!==(r={PurchaseLabel:"ConfigureSalesOrderShipment"}[e])&&void 0!==r?r:""},V=e=>e.map((e=>u(B,e))).reduce(((e,r)=>Object.assign(e,r))),R=e=>null!==e&&"object"==typeof e&&!Array.isArray(e);function $(e,r){const a=Object.assign({},e);return R(e)&&R(r)&&Object.keys(r).forEach((e=>{R(r[e])?(a[e]||Object.assign(a,{[e]:{}}),a[e]=$(a[e],r[e])):Object.assign(a,{[e]:r[e]})})),a}const Z=e=>e.slice(0,1).toUpperCase()+e.slice(1),G=e=>e.split(" ").map((e=>Z(e.toLowerCase()))).join(" "),q=e=>m.pascalize(e),N=e=>null==e?void 0:e.replace(/\s+/g,"-").toLowerCase(),Y=e=>e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/(?<=[a-zA-Z])(\d)/g," $1").trim(),H={aud:"$",cad:"$",eur:"€",gbp:"£",nzd:"$",usd:"$"},W=(e,r="en-US")=>Intl.NumberFormat(r,{currency:e.currency,style:"currency"}).format(e.amount),J=(...e)=>e.reduce(((e,r)=>{var a;return r?e+(null!==(a=r.amount)&&void 0!==a?a:0):e}),0),K=e=>[e.substring(0,4),e.substring(4,8),e.substring(8,12),e.substring(12)].join(" ").trim(),Q=e=>{const r=e.replace(/\//g,"");return r.length>2?[r.substring(0,2),r.substring(2,6)].join("/").trim():r},X=e=>{switch(null==e?void 0:e.toLowerCase()){case"usd":default:return p.Currency.USD;case"cad":return p.Currency.CAD;case"aud":return p.Currency.AUD;case"gbp":return p.Currency.GBP;case"eur":return p.Currency.EUR;case"nzd":return p.Currency.NZD}},ee=e=>{let r;switch(e){case p.Currency.USD:case p.Currency.CAD:case p.Currency.AUD:case p.Currency.NZD:r="$";break;case p.Currency.GBP:r="£";break;case p.Currency.EUR:r="€"}return r},re=(e,r,a)=>{switch(e){case"usps_media_mail":return!0;case"usps_first_class_mail":return"large_envelope_or_flat"===r;case"dhl_express_worldwide":return a;default:return!1}},ae=(e={})=>J(...Object.values(e)),se=(e,r)=>r[e]||e,te=e=>{var r;return"US"===e.countryCode||(null===(r=y.find((r=>r.code===e.countryCode)))||void 0===r?void 0:r.isUnitedStatesTerritory)},ne=e=>{var r,a;return!(!(null===(r=w.find((r=>r.code===e.stateProvince)))||void 0===r?void 0:r.isMilitary)&&!(null===(a=b.find((r=>r.code===e.cityLocality)))||void 0===a?void 0:a.isMilitary))},ie=e=>{var r,a;return!(!(null===(r=y.find((r=>r.code===e.countryCode)))||void 0===r?void 0:r.isUnitedStatesTerritory)&&!(null===(a=w.find((r=>r.code===e.stateProvince)))||void 0===a?void 0:a.isUnitedStatesTerritory))},le=e=>{var r;return!!(null===(r=y.find((r=>r.code===e.countryCode)))||void 0===r?void 0:r.isUnsupportedByUps)},oe=/^(((p[\s\.\'\,]?[o\s][\.\'\,]?)\s?)|(post\s?office\s?))((box|bin|bo|b\.?)?\s?(num|number|#)?\s?\d+)/i,ce=e=>oe.test(e),de=e=>!!(ce(e.addressLine1)||e.addressLine2&&ce(e.addressLine2)),ue=e=>!e||Object.entries(e).every((([e,r])=>"countryCode"===e||[null,"","unknown"].includes(r))),me=(e,r)=>Object.assign(Object.assign(Object.assign({},e),e.matchedAddress&&{matchedAddress:Object.assign(Object.assign({},e.matchedAddress),{email:r})}),{originalAddress:Object.assign(Object.assign({},e.originalAddress),{email:r})}),pe=e=>{var r;if(e)return null!==(r=e.find((e=>e.isDefault)))&&void 0!==r?r:e[0]},ge=(e,r)=>{if(!e&&!r)return;const a={originAddress:f(v(null==e?void 0:e.shipFrom,["addressResidentialIndicator"]),h),returnAddress:f(v(null==e?void 0:e.returnTo,["addressResidentialIndicator"]),h)},s=null==r?void 0:r.find((e=>g(a,v(Object.assign(Object.assign({},e),void 0===e.returnAddress&&{returnAddress:e.originAddress}),["addressId","name","isDefault"]))));return(null==s?void 0:s.addressId)||"custom-shipment-address"},he=(e,r)=>{if(!e||!r)return;const a={originAddress:f(v(null==e?void 0:e.shipFrom,["addressResidentialIndicator"]),h),returnAddress:f(v(null==e?void 0:e.returnTo,["addressResidentialIndicator"]),h)};return null==r?void 0:r.some((e=>g(a,v(Object.assign(Object.assign({},e),void 0===e.returnAddress&&{returnAddress:e.originAddress}),["addressId","name","isDefault"]))))};const ve=["usps","stamps_com"],fe=e=>ve.includes(e),ye=e=>"ups"===e,we=e=>e.includes("yodel"),be=e=>"hermes"===e,De=(e=[],r)=>{const a=e.find((e=>e.carrierCode===r));return null==a?void 0:a.carrierId},Ce=(e,r)=>{var a;if("parcelguard"===e)return"logo"===r?"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='55' height='55' fill='none'%3e%3cmask id='a' width='55' height='55' x='0' y='0' maskUnits='userSpaceOnUse' style='mask-type:alpha'%3e%3cpath fill='%23FFFFFE' fill-rule='evenodd' d='M55 0H0v55h55zM32.238 10.76H24.39V7.997h7.847zM2.39 40.477l48.324-6.693V12.967L2.39 19.618z' clip-rule='evenodd'/%3e%3c/mask%3e%3cg fill-rule='evenodd' clip-rule='evenodd' mask='url(%23a)'%3e%3cpath fill='%23BBAE92' d='M10.136 9.38v31.096l17.726 10.908 18.03-10.908V9.456z'/%3e%3cpath fill='%23343534' d='M8.087 6.742c.49-.271 1.111-.413 1.751-.413H46.19c.64 0 1.26.142 1.75.413.462.255.99.742.99 1.477v32.75c0 .602-.342 1.13-.691 1.496-.354.37-.823.693-1.342.902L30.024 53.77a1 1 0 0 1-.144.07c-.556.21-1.232.3-1.867.3-.634 0-1.31-.09-1.867-.3a1 1 0 0 1-.143-.07L9.13 43.367a3.9 3.9 0 0 1-1.34-.902c-.35-.366-.692-.894-.692-1.496V8.219c0-.735.528-1.222.99-1.477m.663 1.577.006-.009zm.023-.026a.7.7 0 0 1 .125-.085c.198-.11.529-.204.94-.204H46.19c.41 0 .742.094.94.204a.7.7 0 0 1 .125.085v32.676q0-.006-.002.002c-.008.025-.046.148-.227.338a2.2 2.2 0 0 1-.8.522 1 1 0 0 0-.144.07L29.22 52.298c-.308.103-.74.167-1.206.167s-.897-.064-1.205-.167L9.945 41.902a1 1 0 0 0-.143-.07 2.2 2.2 0 0 1-.8-.523c-.182-.19-.22-.313-.227-.337q-.003-.009-.002-.003zm38.505.026-.006-.009q.007.01.006.01'/%3e%3cpath fill='%23343534' d='M32.81 1.106a.84.84 0 0 1 1.1-.44l13.887 5.946a.838.838 0 1 1-.66 1.54L33.252 2.206a.84.84 0 0 1-.44-1.1M26.343 3.567a.84.84 0 0 1-.643.994L9.327 8.075a.838.838 0 0 1-.351-1.638l16.373-3.514a.84.84 0 0 1 .994.644M22.73 7.25c0-.463.375-.838.838-.838h9.51c.462 0 .837.375.837.838v4.26a.84.84 0 0 1-.837.838h-9.51a.84.84 0 0 1-.838-.838zm1.675.838v2.584h7.835V8.088z'/%3e%3c/g%3e%3cpath fill='%23343534' fill-rule='evenodd' d='M9.36 22.741c-.144-.233-.375-.323-.777-.268l-1.944.267.02 1.841 1.915-.263c.461-.064.69-.247.808-.486.068-.15.087-.306.084-.538-.003-.253-.035-.451-.107-.553m2.001 2.187c-.455.6-1.214.957-2.196 1.113-.3.05-2.455.326-2.455.326l.028 2.5-2.456.337-.089-7.992 4.901-.673c.962-.133 1.646-.014 2.092.38.466.342.724.996.735 1.987.01.89-.174 1.543-.56 2.022M15.859 22.324l-.168-.645-.153.71-.68 1.977 1.673-.23zm-2.186 5.59-2.526.346 3.018-8.418 3.117-.428 2.995 7.592-2.566.352-.6-1.62-2.836.39zM25.765 20.467c-.123-.237-.364-.284-.715-.236l-2.055.282.018 1.629 2.105-.29c.3-.041.56-.147.648-.352.059-.15.087-.367.085-.528-.002-.182-.024-.392-.086-.506m2.135 1.53c-.246.46-.604.761-.974.893l1.9 2.941-2.736.376-1.433-2.508-1.644.226.03 2.7-2.405.331-.09-7.991 5.042-.693c1.062-.146 1.757.062 2.164.543.315.362.471.878.48 1.627.007.647-.128 1.171-.334 1.555M36.824 23.03c-.538 1.26-1.643 2.04-3.778 2.333-1.473.202-2.55.026-3.248-.567-.67-.577-1.001-1.554-1.017-2.971-.014-1.274.275-2.297.87-3.057.692-.866 1.78-1.41 3.354-1.627 2.425-.333 3.497.432 3.86 1.506.156.445.213.995.216 1.308l-2.475.34a1.6 1.6 0 0 0-.22-.8c-.235-.373-.608-.525-1.39-.417-.662.09-1.08.33-1.346.752-.247.379-.331.948-.323 1.676.01.84.135 1.339.4 1.637.305.353.787.418 1.339.342.72-.098 1.11-.375 1.317-.697.187-.28.244-.56.26-.897l2.476-.34c-.016.326-.05.959-.295 1.479M37.965 24.575l-.089-7.991 6.765-.93.021 1.882-4.37.6.014 1.163 4.209-.578.02 1.901-4.208.579.013 1.183 4.42-.607.02 1.862zM45.913 23.483l-.09-7.991 2.476-.34.067 6.018 3.818-.525.023 1.973zM12.535 37.45l-.108-.654c-.505.597-1.264.964-2.356 1.114-1.443.199-2.542-.167-3.154-1.025-.377-.506-.628-1.444-.64-2.557-.012-1.001.149-1.935.612-2.708.561-.948 1.636-1.765 3.5-2.02 2.055-.283 3.175.272 3.648 1.261.164.332.26.846.264 1.19l-2.365.325c-.002-.203-.116-.45-.288-.62-.233-.23-.636-.338-1.147-.267-.621.085-1.051.276-1.328.668-.267.361-.4.937-.39 1.888.01.88.166 1.365.36 1.652.244.311.688.524 1.5.412.822-.113 1.438-.613 1.512-1.2l-.005-.426-1.984.273-.019-1.719 4.22-.58s.022 2.094.028 2.54c.01.98.033 2.142.034 2.193zM19.07 36.664c-2.185.3-3.858-.301-3.881-2.385l-.058-5.19 2.456-.337.057 5.088c.007.698.543 1.04 1.455.915.862-.119 1.418-.64 1.41-1.299 0-.151-.056-5.098-.056-5.098l2.445-.336.06 5.351c.02 1.862-1.613 2.978-3.888 3.29M27.9 30.05l-.169-.645-.152.71-.681 1.978 1.674-.23zm-2.187 5.59-2.526.346 3.018-8.418 3.117-.428 2.996 7.592-2.566.352-.6-1.62-2.836.39zM38.006 28.165c-.123-.236-.365-.284-.716-.236l-2.054.282.018 1.63 2.105-.29c.3-.041.56-.148.648-.353.059-.15.087-.366.085-.528-.002-.182-.025-.392-.086-.505m2.135 1.53c-.246.46-.604.762-.974.894l1.9 2.94-2.736.377-1.433-2.509-1.644.226.03 2.701-2.405.33-.09-7.99 5.042-.694c1.062-.145 1.757.063 2.164.544.315.362.471.877.48 1.626.007.648-.128 1.172-.334 1.555M47.074 28.55c-.007-.576-.075-1.306-.279-1.501-.314-.302-.605-.353-1.207-.27l-1.533.21.047 4.239 1.534-.21c.621-.086.95-.263 1.217-.624.208-.282.228-1.196.22-1.844m-.886 4.276-4.49.617-.09-7.992 4.37-.6c1.444-.198 2.34.033 2.838.653.499.61.596 1.266.613 2.722.018 1.7-.084 2.342-.518 3.07-.473.805-1.29 1.333-2.723 1.53' clip-rule='evenodd'/%3e%3cpath fill='%231A1919' fill-rule='evenodd' d='m50.974 40.244.198.625.195-.625h.45v1.086h-.288v-.786l-.236.786h-.245l-.236-.784v.784h-.288v-1.086zm-1.506.261v-.26h.959v.26h-.323v.825h-.317v-.825z' clip-rule='evenodd'/%3e%3c/svg%3e":"data:image/svg+xml,%3csvg width='21' height='20' viewBox='0 0 21 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath fill-rule='evenodd' clip-rule='evenodd' d='M2.16675 3.33342V15.6721L9.969 19.7591C10.2574 19.9102 10.6014 19.9114 10.8909 19.7623L18.8334 15.6721V3.33343L2.16675 3.33342Z' fill='%23343534'/%3e%3cpath fill-rule='evenodd' clip-rule='evenodd' d='M8.58857 0.731017C8.7832 1.14808 8.60288 1.64395 8.18582 1.83857L2.93582 4.92191L2.16675 3.33342L7.48101 0.328269C7.89807 0.133641 8.39394 0.313958 8.58857 0.731017Z' fill='%23343534'/%3e%3cpath fill-rule='evenodd' clip-rule='evenodd' d='M11.4734 0.371172C11.7287 -0.0117689 12.2461 -0.115247 12.629 0.140047L18.8334 3.33343L17.9545 4.86013L11.7045 1.5268C11.3216 1.2715 11.2181 0.754112 11.4734 0.371172Z' fill='%23343534'/%3e%3cpath fill-rule='evenodd' clip-rule='evenodd' d='M3.83325 5V14.8709L10.4431 18.3333L17.1666 14.8709V5.02448L3.83325 5Z' fill='%23F9FAFB'/%3e%3cpath fill-rule='evenodd' clip-rule='evenodd' d='M3.8335 4.8335V14.8277L10.4432 18.3334L17.1665 14.8277V4.85828L3.8335 4.8335Z' fill='%23BBAE92'/%3e%3c/svg%3e";return`https://logos.shipstation.com/ipaas/carriers/${null!==(a={stamps_com:"stamps_com_wl",usps:"stamps_com_wl"}[e])&&void 0!==a?a:e}/${r}.svg`},Le=e=>!!e&&["GB","CA","US"].includes(e),Se=e=>"AU"===e,Ae=(e,r)=>null==e?void 0:e.filter((e=>"globalpost"===e.carrierCode?Le(r):"sendle_walleted"!==e.carrierCode||Se(r)));export{Se as $,J as A,K as B,Q as C,X as D,ee as E,re as F,ae as G,se as H,te as I,ne as J,ie as K,le as L,ce as M,de as N,ue as O,me as P,pe as Q,ge as R,he as S,fe as T,ye as U,we as V,be as W,De as X,Ce as Y,Le as Z,C as _,S as a,Ae as a0,D as a1,A as b,U as c,$ as d,O as e,L as f,V as g,j as h,F as i,x as j,E as k,k as l,I as m,z as n,_ as o,M as p,T as q,R as r,P as s,Z as t,G as u,q as v,N as w,Y as x,H as y,W as z};
|
package/components.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{y as Actions,x as ActionsMenu,A as AddFundsForm,a as AutoFundingForm,B as ButtonGroup,C as CarrierBalance,c as CarrierConnectionCard,d as CarrierIcon,e as CarrierLogo,f as CollapsiblePanel,h as CopyButton,i as Cube,D as DateRangeCombo,j as DateRangeSelect,k as DisplayTerm,E as EditBillingForm,l as ErrorFallback,F as FieldLabel,m as FormPortal,n as FundAndPurchase,H as HistoryCard,o as HistoryCardExtension,I as InlineLabel,p as ItemsBreakdown,L as LinkAction,q as Loader,P as PoweredByShipEngine,R as RateDetails,S as Section,r as SettingsCard,z as ShipFromAddressForm,t as SkeletonCarrierRow,u as Spacer,v as Spread,T as Tabs,V as VatForm,W as WalletCard,w as WarehouseForm,b as autoFundingSchema,g as getAddFundsSchema,s as styles}from"./actions-menu.js";export{C as CellFormattedDate,D as Drawer,E as ErrorState,G as GridController,b as GridFilters,a as GridFooter,u as usePager}from"./usePager.js";export{f as Field,P as Pager,S as StoryNotes,a as SuspendText}from"./suspend-text.js";export{P as Portal}from"./use-toggle.js";import"./carrier.js";import"date-fns/format";import"date-fns/locale";import"date-fns/parse";import"lodash/get";import"humps";import"@shipengine/react-api";import"lodash/isEqual";import"lodash/isNil";import"lodash/omit";import"lodash/omitBy";import"./address.js";import"@emotion/react/jsx-runtime";import"date-fns/isToday";import"@shipengine/giger";import"@emotion/react";import"react";import"./validation.js";import"@hookform/resolvers/zod";import"zod";import"react-i18next";import"@shipengine/giger-theme";import"react-hook-form";import"./money.js";import"copy-to-clipboard";import"js-base64";import"libphonenumber-js/min";import"card-validator";import"./zod.js";import"react-use";import"date-fns/subDays";import"react-dom";
|
|
1
|
+
export{y as Actions,x as ActionsMenu,A as AddFundsForm,a as AutoFundingForm,B as ButtonGroup,C as CarrierBalance,c as CarrierConnectionCard,d as CarrierIcon,e as CarrierLogo,f as CollapsiblePanel,h as CopyButton,i as Cube,D as DateRangeCombo,j as DateRangeSelect,k as DisplayTerm,E as EditBillingForm,l as ErrorFallback,F as FieldLabel,m as FormPortal,n as FundAndPurchase,H as HistoryCard,o as HistoryCardExtension,I as InlineLabel,p as ItemsBreakdown,L as LinkAction,q as Loader,P as PoweredByShipEngine,R as RateDetails,S as Section,r as SettingsCard,z as ShipFromAddressForm,t as SkeletonCarrierRow,u as Spacer,v as Spread,T as Tabs,V as VatForm,W as WalletCard,w as WarehouseForm,b as autoFundingSchema,g as getAddFundsSchema,s as styles}from"./actions-menu.js";export{C as CellFormattedDate,D as Drawer,E as ErrorState,G as GridController,b as GridFilters,a as GridFooter,u as usePager}from"./usePager.js";export{f as Field,P as Pager,S as StoryNotes,a as SuspendText}from"./suspend-text.js";export{P as Portal}from"./use-toggle.js";import"./carrier.js";import"date-fns/format";import"date-fns/locale";import"date-fns/parse";import"lodash/get.js";import"humps";import"@shipengine/react-api";import"lodash/isEqual.js";import"lodash/isNil.js";import"lodash/omit.js";import"lodash/omitBy.js";import"./address.js";import"@emotion/react/jsx-runtime";import"date-fns/isToday";import"@shipengine/giger";import"@emotion/react";import"react";import"./validation.js";import"@hookform/resolvers/zod";import"zod";import"react-i18next";import"@shipengine/giger-theme";import"react-hook-form";import"./money.js";import"copy-to-clipboard";import"js-base64";import"libphonenumber-js/min";import"card-validator";import"./zod.js";import"react-use";import"date-fns/subDays";import"react-dom";
|
package/elements.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{l as LabelsGrid,m as ManageCarriers,b as ManageExternalCarriers,f as ManageFunding,a as ManageWarehouses,h as PaymentMethodSettings,p as PurchaseLabel,g as SelectLabelLayout,d as ShipmentSummary,s as ShipmentsGrid,c as ThemeCreator,T as ThemeCreatorProvider,i as TransactionHistory,e as UnitSettings,u as useThemeCreator}from"./transaction-history-element.js";export{a as CarrierServices,v as VoidLabel}from"./use-unit-settings.js";import"@emotion/react/jsx-runtime";import"./actions-menu.js";import"./carrier.js";import"date-fns/format";import"date-fns/locale";import"date-fns/parse";import"lodash/get";import"humps";import"@shipengine/react-api";import"lodash/isEqual";import"lodash/isNil";import"lodash/omit";import"lodash/omitBy";import"./address.js";import"date-fns/isToday";import"@shipengine/giger";import"./use-toggle.js";import"react";import"react-dom";import"@emotion/react";import"./validation.js";import"@hookform/resolvers/zod";import"zod";import"react-i18next";import"@shipengine/giger-theme";import"react-hook-form";import"./money.js";import"copy-to-clipboard";import"js-base64";import"libphonenumber-js/min";import"card-validator";import"./zod.js";import"./use-configure-shipment.js";import"./warehouses.js";import"./canada-ddp.js";import"lodash/orderBy";import"@tanstack/react-query";import"./use-get-service-name.js";import"./usePager.js";import"react-use";import"date-fns/subDays";import"date-fns/formatISO";import"date-fns/isSameDay";import"date-fns/isWithinInterval";import"date-fns/setHours";import"date-fns/setMinutes";import"./vat.js";import"axios";import"lodash/merge";import"lodash/mergeWith";import"@shipengine/js-api";import"@rjsf/core";import"@rjsf/validator-ajv8";import"lodash/camelCase";import"use-debounce";import"classnames";import"i18next";import"i18next-browser-languagedetector";import"@emotion/cache";import"stylis";
|
|
1
|
+
export{l as LabelsGrid,m as ManageCarriers,b as ManageExternalCarriers,f as ManageFunding,a as ManageWarehouses,h as PaymentMethodSettings,p as PurchaseLabel,g as SelectLabelLayout,d as ShipmentSummary,s as ShipmentsGrid,c as ThemeCreator,T as ThemeCreatorProvider,i as TransactionHistory,e as UnitSettings,u as useThemeCreator}from"./transaction-history-element.js";export{a as CarrierServices,v as VoidLabel}from"./use-unit-settings.js";import"@emotion/react/jsx-runtime";import"./actions-menu.js";import"./carrier.js";import"date-fns/format";import"date-fns/locale";import"date-fns/parse";import"lodash/get.js";import"humps";import"@shipengine/react-api";import"lodash/isEqual.js";import"lodash/isNil.js";import"lodash/omit.js";import"lodash/omitBy.js";import"./address.js";import"date-fns/isToday";import"@shipengine/giger";import"./use-toggle.js";import"react";import"react-dom";import"@emotion/react";import"./validation.js";import"@hookform/resolvers/zod";import"zod";import"react-i18next";import"@shipengine/giger-theme";import"react-hook-form";import"./money.js";import"copy-to-clipboard";import"js-base64";import"libphonenumber-js/min";import"card-validator";import"./zod.js";import"./use-configure-shipment.js";import"./warehouses.js";import"./canada-ddp.js";import"lodash/orderBy.js";import"@tanstack/react-query";import"./use-get-service-name.js";import"./usePager.js";import"react-use";import"date-fns/subDays";import"date-fns/formatISO";import"date-fns/isSameDay";import"date-fns/isWithinInterval";import"date-fns/setHours";import"date-fns/setMinutes";import"./vat.js";import"axios";import"lodash/merge.js";import"lodash/mergeWith.js";import"@shipengine/js-api";import"@rjsf/core";import"@rjsf/validator-ajv8";import"lodash/camelCase.js";import"use-debounce";import"classnames";import"i18next";import"i18next-browser-languagedetector";import"@emotion/cache";import"stylis";
|
package/hooks.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{R as RootPortalProvider,c as useAddressValidation,u as useCountryCodeOptions,d as useNestedForm,e as useRootPortal,b as useStateCodeOptions,f as useToggle}from"./use-toggle.js";export{P as PudoType,p as useBlackboxDetection,r as useConfigureShipment,u as useConfirmationOptions,a as useCustomsContentsOptions,b as useCustomsNonDeliveryOptions,c as useDateRangeOptions,n as useGetFundingSourceInsuranceProvider,s as useImportSalesOrder,d as useInsuranceProviderOptions,o as useManageFundingSourceInsurance,e as useMovementIndicatorOptions,f as usePackageOptions,g as useRateOptions,q as useScrubErrors,h as useServiceCodeOptions,l as useServicePoints,k as useShipFromAddressOptions,i as useShipmentMetadata,j as useShippingPresetsOptions,m as useWindsorFramework}from"./use-configure-shipment.js";export{u as useGetServiceName}from"./use-get-service-name.js";export{P as PageLayoutProvider,u as useExpirationMonthOptions,a as useHelpers,b as usePageLayout}from"./use-page-layout.js";export{u as useRunOnceOnTrue}from"./use-run-once-on-true.js";import"@emotion/react/jsx-runtime";import"react";import"./carrier.js";import"date-fns/format";import"date-fns/locale";import"date-fns/parse";import"lodash/get";import"humps";import"@shipengine/react-api";import"lodash/isEqual";import"lodash/isNil";import"lodash/omit";import"lodash/omitBy";import"./address.js";import"react-dom";import"react-i18next";import"./warehouses.js";import"./canada-ddp.js";import"lodash/orderBy";import"@shipengine/giger";import"@emotion/react";import"js-base64";import"@tanstack/react-query";import"./checks.js";import"jwt-decode";
|
|
1
|
+
export{R as RootPortalProvider,c as useAddressValidation,u as useCountryCodeOptions,d as useNestedForm,e as useRootPortal,b as useStateCodeOptions,f as useToggle}from"./use-toggle.js";export{P as PudoType,p as useBlackboxDetection,r as useConfigureShipment,u as useConfirmationOptions,a as useCustomsContentsOptions,b as useCustomsNonDeliveryOptions,c as useDateRangeOptions,n as useGetFundingSourceInsuranceProvider,s as useImportSalesOrder,d as useInsuranceProviderOptions,o as useManageFundingSourceInsurance,e as useMovementIndicatorOptions,f as usePackageOptions,g as useRateOptions,q as useScrubErrors,h as useServiceCodeOptions,l as useServicePoints,k as useShipFromAddressOptions,i as useShipmentMetadata,j as useShippingPresetsOptions,m as useWindsorFramework}from"./use-configure-shipment.js";export{u as useGetServiceName}from"./use-get-service-name.js";export{P as PageLayoutProvider,u as useExpirationMonthOptions,a as useHelpers,b as usePageLayout}from"./use-page-layout.js";export{u as useRunOnceOnTrue}from"./use-run-once-on-true.js";import"@emotion/react/jsx-runtime";import"react";import"./carrier.js";import"date-fns/format";import"date-fns/locale";import"date-fns/parse";import"lodash/get.js";import"humps";import"@shipengine/react-api";import"lodash/isEqual.js";import"lodash/isNil.js";import"lodash/omit.js";import"lodash/omitBy.js";import"./address.js";import"react-dom";import"react-i18next";import"./warehouses.js";import"./canada-ddp.js";import"lodash/orderBy.js";import"@shipengine/giger";import"@emotion/react";import"js-base64";import"@tanstack/react-query";import"./checks.js";import"jwt-decode";
|
package/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ShipEngine as _}from"@shipengine/react-api";export*from"@shipengine/react-api";export{y as Actions,x as ActionsMenu,A as AddFundsForm,a as AutoFundingForm,B as ButtonGroup,C as CarrierBalance,c as CarrierConnectionCard,d as CarrierIcon,e as CarrierLogo,f as CollapsiblePanel,h as CopyButton,i as Cube,D as DateRangeCombo,j as DateRangeSelect,k as DisplayTerm,E as EditBillingForm,l as ErrorFallback,F as FieldLabel,m as FormPortal,n as FundAndPurchase,H as HistoryCard,o as HistoryCardExtension,I as InlineLabel,p as ItemsBreakdown,L as LinkAction,q as Loader,P as PoweredByShipEngine,R as RateDetails,S as Section,r as SettingsCard,z as ShipFromAddressForm,t as SkeletonCarrierRow,u as Spacer,v as Spread,T as Tabs,V as VatForm,W as WalletCard,w as WarehouseForm,b as autoFundingSchema,g as getAddFundsSchema,s as styles}from"./actions-menu.js";export{C as CellFormattedDate,D as Drawer,E as ErrorState,G as GridController,b as GridFilters,a as GridFooter,u as usePager}from"./usePager.js";export{f as Field,P as Pager,S as StoryNotes,a as SuspendText}from"./suspend-text.js";import{E as ee,R as
|
|
1
|
+
import{ShipEngine as _}from"@shipengine/react-api";export*from"@shipengine/react-api";export{y as Actions,x as ActionsMenu,A as AddFundsForm,a as AutoFundingForm,B as ButtonGroup,C as CarrierBalance,c as CarrierConnectionCard,d as CarrierIcon,e as CarrierLogo,f as CollapsiblePanel,h as CopyButton,i as Cube,D as DateRangeCombo,j as DateRangeSelect,k as DisplayTerm,E as EditBillingForm,l as ErrorFallback,F as FieldLabel,m as FormPortal,n as FundAndPurchase,H as HistoryCard,o as HistoryCardExtension,I as InlineLabel,p as ItemsBreakdown,L as LinkAction,q as Loader,P as PoweredByShipEngine,R as RateDetails,S as Section,r as SettingsCard,z as ShipFromAddressForm,t as SkeletonCarrierRow,u as Spacer,v as Spread,T as Tabs,V as VatForm,W as WalletCard,w as WarehouseForm,b as autoFundingSchema,g as getAddFundsSchema,s as styles}from"./actions-menu.js";export{C as CellFormattedDate,D as Drawer,E as ErrorState,G as GridController,b as GridFilters,a as GridFooter,u as usePager}from"./usePager.js";export{f as Field,P as Pager,S as StoryNotes,a as SuspendText}from"./suspend-text.js";import{E as ee,R as se,a as ae}from"./use-toggle.js";export{a as ElementsContext,E as ElementsContextProvider,P as Portal,R as RootPortalProvider,c as useAddressValidation,u as useCountryCodeOptions,g as useElements,d as useNestedForm,e as useRootPortal,b as useStateCodeOptions,f as useToggle}from"./use-toggle.js";export{C as Country,U as UsState,d as UsaCity,c as countries,a as countryCodes,e as euCountryCodes,p as postalCodeRegex,f as usCities,b as usStateCodes,u as usStates}from"./address.js";export{a as CarrierServices,b as ConnectExternalCarrier,v as VoidLabel,c as createElement}from"./use-unit-settings.js";import{t as re}from"./transaction-history-element.js";export{l as LabelsGrid,m as ManageCarriers,b as ManageExternalCarriers,f as ManageFunding,a as ManageWarehouses,h as PaymentMethodSettings,p as PurchaseLabel,g as SelectLabelLayout,d as ShipmentSummary,s as ShipmentsGrid,c as ThemeCreator,T as ThemeCreatorProvider,i as TransactionHistory,e as UnitSettings,u as useThemeCreator}from"./transaction-history-element.js";export{e as extendZod}from"./zod.js";export{P as PudoType,p as useBlackboxDetection,r as useConfigureShipment,u as useConfirmationOptions,a as useCustomsContentsOptions,b as useCustomsNonDeliveryOptions,c as useDateRangeOptions,n as useGetFundingSourceInsuranceProvider,s as useImportSalesOrder,d as useInsuranceProviderOptions,o as useManageFundingSourceInsurance,e as useMovementIndicatorOptions,f as usePackageOptions,g as useRateOptions,q as useScrubErrors,h as useServiceCodeOptions,l as useServicePoints,k as useShipFromAddressOptions,i as useShipmentMetadata,j as useShippingPresetsOptions,m as useWindsorFramework}from"./use-configure-shipment.js";export{P as PageLayoutProvider,u as useExpirationMonthOptions,a as useHelpers,b as usePageLayout}from"./use-page-layout.js";export{u as useGetServiceName}from"./use-get-service-name.js";export{u as useRunOnceOnTrue}from"./use-run-once-on-true.js";export{m as moneySchema}from"./money.js";export{p as phoneSchema,a as phoneSchemaUnvalidated}from"./phone.js";export{C as CanadaDeliveredDutyOptions}from"./canada-ddp.js";export{a as assert,r as raise}from"./assertions.js";export{g as getSellerIdFromToken,i as isOnboarded}from"./checks.js";export{d as convertDimensions,c as createDictionary,f as formatDimensions,n as getCancelledShipment,g as getCustomsFromSalesOrder,q as getDefaultWarehouse,e as getIsCustomsRequiredForSalesOrder,l as getIsCustomsRequiredForShipment,k as getIsInternationalShipment,m as getPendingShipment,h as getRequestedServices,j as getSalesOrderItemsFromSalesOrderOrShipment,o as getShipmentByStatus,r as getWarehouseById,b as isCollectionService,a as isPudoEligibleRate,i as isShippingServiceServiceDisabled,p as moveCustomsItemsToProducts}from"./warehouses.js";import{_ as te,g as oe,d as ie}from"./carrier.js";export{P as addEmailToValidation,x as addSpaceBetweenWords,A as calculateTotal,t as capitalizeFirstLetter,u as capitalizeFirstLetterOfEachWord,y as currencySymbol,i as daysAfter,d as deepMergeFeatures,q as featureFlagComponentNameLookup,a0 as filterFundingSourceCarriers,a as findDateLocale,b as formatByDateAndLocale,B as formatCreditCardNumber,f as formatDate,c as formatDateDDMMYY,e as formatDateDDMMYYYY,C as formatExpiration,z as formatMoney,X as getCarrierIdByCarrierCode,D as getCurrencyFromString,E as getCurrencySymbolFromString,g as getDefaultFeatures,Q as getDefaultShipFromAddress,j as getExpirationYears,S as getIsShipmentUsingSavedShipFromAddress,Y as getLogoOrIconByCarrierCode,F as getRateRequiresAcknowledgement,l as getRelativeDates,R as getSavedShipFromAddressId,G as getTotalRateAmount,h as getlocaleDateStringFormat,I as isDomesticAddress,O as isEmptyAddress,W as isEvriCarrier,Z as isGlobalPostEligible,J as isMilitaryAddress,k as isNowOrInTheFuture,r as isObject,M as isPoBox,N as isPoBoxAddress,$ as isSendleEligible,K as isUnitedStatesTerritory,L as isUnsupportedByUps,U as isUpsCarrier,T as isUspsCarrier,V as isYodelCarrier,m as mostRecent,n as nextDayCutoff,o as omitTime,H as overrideCarrierCodes,p as parseLocaleDate,v as pascalize,w as replaceSpacesWithDashes,s as sortByCreationDate}from"./carrier.js";export{N as NO_VAT_COUNTRIES,f as convertDecimalWeightToFractionalWeight,e as convertFractionalWeightToDecimalWeight,d as convertPoundsAndOuncesToOunces,g as convertWeight,c as createCodedErrors,h as formatFractionalWeight,n as formatTrackingNumber,k as getInsuranceProviderWithFriendlyName,l as getIsInsuraceProviderAccepted,o as getIsVatRequired,b as isDecimalWeight,j as isFlatRatePackageCode,i as isMetricWeightUnit,a as throwAny,t as throwJoinedMessages,m as trackingStatusFormatter}from"./vat.js";export{a as aggregateRateDetailItems,c as calculateRateDetailBreakdown,b as createStyles,e as errorMap,f as formLogger,i as isString,s as scopeTheme,v as validationResolver}from"./validation.js";export{a as AccountSettings,l as LabelWorkflow,o as Onboarding}from"./wallet-form.js";import{jsx as ne}from"@emotion/react/jsx-runtime";import{useCallback as me,useMemo as de}from"react";import{THEME_ID as le,GigerProvider as ce,GigerTestProvider as pe}from"@shipengine/giger";import{Theme as ue}from"@shipengine/giger-theme";import ge from"axios";import"date-fns/isToday";import"@emotion/react";import"react-i18next";import"lodash/isEqual.js";import"react-hook-form";import"zod";import"copy-to-clipboard";import"js-base64";import"libphonenumber-js/min";import"lodash/omit.js";import"card-validator";import"react-use";import"date-fns/subDays";import"react-dom";import"humps";import"lodash/merge.js";import"@tanstack/react-query";import"lodash/mergeWith.js";import"@shipengine/js-api";import"@rjsf/core";import"@rjsf/validator-ajv8";import"lodash/camelCase.js";import"use-debounce";import"classnames";import"i18next";import"i18next-browser-languagedetector";import"@emotion/cache";import"stylis";import"date-fns/formatISO";import"date-fns/isSameDay";import"date-fns/isWithinInterval";import"date-fns/setHours";import"date-fns/setMinutes";import"lodash/orderBy.js";import"jwt-decode";import"date-fns/format";import"date-fns/locale";import"date-fns/parse";import"lodash/get.js";import"lodash/isNil.js";import"lodash/omitBy.js";import"@hookform/resolvers/zod";const he=({baseURL:e="https://elements.shipengine.com",cdnURL:s="https://cdn.packlink.com",children:a,container:r,features:t,getToken:o,headers:i,locale:n,onApiError:m,onError:d=(()=>{}),scope:l="lmnt",themeConfig:c,defaultQueryClientOptions:p,emotionCacheShadowRootContainer:u})=>{const g=(({cdnURL:e})=>me((s=>te(void 0,void 0,void 0,(function*(){return(yield ge.get(`/brand/fallback/icons/${s.toLowerCase()}.svg`,{baseURL:e,responseType:"text"})).data}))),[e]))({cdnURL:s}),h=de((()=>{var e;const s=new ue(null!==(e=c&&le in c?c[le]:c)&&void 0!==e?e:re.fallback);return c&&le in c?{[le]:s}:s}),[c]),f={baseURL:e,cdnURL:s,container:r,emotionCacheShadowRootContainer:u,features:t,getToken:o,locale:n,onError:d,scope:l,theme:h};return ne(ee,Object.assign({},f,{children:ne(ce,Object.assign({cdnUrl:s,emotionCacheShadowRootContainer:u,reference:u||l||void 0,resolveIcon:g,theme:h},{children:ne(_,Object.assign({baseURL:e,defaultQueryClientOptions:p,getToken:o,headers:i,onApiError:m},{children:ne(se,Object.assign({emotionCacheShadowRootContainer:u},{children:a}))}))}))}))},fe=({baseURL:e,children:s,features:a})=>{const r=de((()=>new ue),[]),t=oe(["globalFeatures"]),o=me((()=>"none"),[]),i={baseURL:e,cdnURL:"mockCdnUrl",getFeatures:e=>{var s;return ie(null!==(s=oe([e]))&&void 0!==s?s:{},null==a?void 0:a[e])},getToken:o,globalFeatures:Object.assign(Object.assign({enabledExternalCarriers:["apc","asendia","better_trucks","canpar","chronopost","couriers_please","courierpost","dpd","hermes_germany","intelliquick_delivery","lso","ontrac","seko","ups","yodel"]},t),a.globalFeatures),onError:()=>{},scope:"lmnt",theme:r};return ne(ae.Provider,Object.assign({value:i},{children:ne(pe,Object.assign({theme:r},{children:ne(_,Object.assign({baseURL:e,getToken:o},{children:s}))}))}))};export{he as ElementsProvider,fe as ElementsTestProvider};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shipengine/elements",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.17.0",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@emotion/react": "11.x",
|
|
6
6
|
"react-i18next": "11.x",
|
|
@@ -38,10 +38,10 @@
|
|
|
38
38
|
"@rjsf/core": "5.16.1",
|
|
39
39
|
"@rjsf/utils": "5.16.1",
|
|
40
40
|
"@rjsf/validator-ajv8": "5.16.1",
|
|
41
|
-
"@shipengine/giger": "1.20.
|
|
42
|
-
"@shipengine/giger-theme": "1.7.
|
|
43
|
-
"@shipengine/js-api": "3.
|
|
44
|
-
"@shipengine/react-api": "3.8.
|
|
41
|
+
"@shipengine/giger": "1.20.8",
|
|
42
|
+
"@shipengine/giger-theme": "1.7.1",
|
|
43
|
+
"@shipengine/js-api": "3.2.0",
|
|
44
|
+
"@shipengine/react-api": "3.8.3",
|
|
45
45
|
"@storybook/addons": "6.5.16",
|
|
46
46
|
"@storybook/api": "6.5.16",
|
|
47
47
|
"@storybook/components": "7.0.0-rc.1",
|
|
@@ -22,7 +22,6 @@ export type AddFundsFormProvider = {
|
|
|
22
22
|
* @see {@link AddFundsForm | The `<AddFundsForm />` component using these props}
|
|
23
23
|
*/
|
|
24
24
|
export type AddFundsFormProps = {
|
|
25
|
-
addedFundsError?: SE.CodedError[] | null;
|
|
26
25
|
addFunds?: (payload: {
|
|
27
26
|
carrierId: string;
|
|
28
27
|
funds: {
|
|
@@ -30,6 +29,7 @@ export type AddFundsFormProps = {
|
|
|
30
29
|
currency: SE.Currency;
|
|
31
30
|
};
|
|
32
31
|
}) => Promise<void>;
|
|
32
|
+
addFundsError?: SE.CodedError[] | null;
|
|
33
33
|
carrierId: string;
|
|
34
34
|
children?: (addFundsForm: AddFundsFormProvider) => React.ReactElement;
|
|
35
35
|
currency?: SE.Currency;
|
|
@@ -49,4 +49,4 @@ export type AddFundsFormProps = {
|
|
|
49
49
|
*
|
|
50
50
|
* @see {@link AddFundsFormProps | The props that are passed into the `<AddFundsForm />` component}
|
|
51
51
|
*/
|
|
52
|
-
export declare const AddFundsForm: ({ carrierId, children, currency, onCancel, onSuccess, minimumAmount, onFail, addFunds,
|
|
52
|
+
export declare const AddFundsForm: ({ carrierId, children, currency, onCancel, onSuccess, minimumAmount, onFail, addFunds, addFundsError, }: AddFundsFormProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Currency } from "@shipengine/react-api";
|
|
2
2
|
/**
|
|
3
3
|
* @internal
|
|
4
4
|
*
|
|
@@ -11,11 +11,8 @@ export type CarrierBalanceProps = {
|
|
|
11
11
|
* `balance` is the current balance for the carrier if there is one.
|
|
12
12
|
*/
|
|
13
13
|
balance?: number;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
*/
|
|
17
|
-
carrierId?: string;
|
|
18
|
-
currency: SE.Currency;
|
|
14
|
+
currency: Currency;
|
|
15
|
+
isLoading?: boolean;
|
|
19
16
|
};
|
|
20
17
|
/**
|
|
21
18
|
* @internal
|
|
@@ -27,4 +24,4 @@ export type CarrierBalanceProps = {
|
|
|
27
24
|
*
|
|
28
25
|
* @see {@link CarrierBalanceProps | The props for the `<CarrierBalance />` component}
|
|
29
26
|
*/
|
|
30
|
-
export declare const CarrierBalance: ({ balance,
|
|
27
|
+
export declare const CarrierBalance: ({ balance, isLoading, currency }: CarrierBalanceProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -8,7 +8,6 @@ import { SE } from "@shipengine/react-api";
|
|
|
8
8
|
* @see {@link FundAndPurchase | The `<FundAndPurchase />` component using these props}
|
|
9
9
|
*/
|
|
10
10
|
export type FundAndPurchaseProps = {
|
|
11
|
-
balance?: number;
|
|
12
11
|
carrierId?: string;
|
|
13
12
|
className?: string;
|
|
14
13
|
control: Control<any, any>;
|
|
@@ -37,4 +36,4 @@ export type FundAndPurchaseProps = {
|
|
|
37
36
|
*
|
|
38
37
|
* @see {@link FundAndPurchaseProps | The props that are passed into the `<FundAndPurchase />` component}
|
|
39
38
|
*/
|
|
40
|
-
export declare const FundAndPurchase: ({
|
|
39
|
+
export declare const FundAndPurchase: ({ carrierId, control, currency, disabled, isFundingEnabled, isFundingRequired, isPreferredRate, nickname, purchaseAmount, showVatSettings, rateDetails, onSave, onPurchase, onVatRegistrationComplete, isInvalidatedByError, }: FundAndPurchaseProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
export declare const styles: {
|
|
2
|
-
actions: () => {
|
|
2
|
+
actions: (theme: import("@shipengine/giger-theme/dist/lib/Theme").Theme) => {
|
|
3
3
|
background: string;
|
|
4
4
|
display: "flex";
|
|
5
5
|
flexDirection: "column";
|
|
6
|
+
width: number;
|
|
6
7
|
};
|
|
7
8
|
actionsButton: () => {
|
|
8
9
|
padding: string;
|
|
@@ -13,12 +13,12 @@ export type ShipmentFormModeChangeSource = "form" | "user";
|
|
|
13
13
|
export type ShipmentFormProps = {
|
|
14
14
|
accountSettings?: SE.ShipEngineAccountSettings;
|
|
15
15
|
addressLoading: boolean;
|
|
16
|
-
addressPreference?: AddressPreference;
|
|
17
16
|
carriers?: SE.Carrier[];
|
|
18
17
|
charsetWarning?: CharsetWarning;
|
|
19
18
|
currency: SE.Currency;
|
|
20
19
|
customPackageTypes?: SE.CustomPackage[];
|
|
21
20
|
defaultFeatures?: PurchaseLabelFeatures;
|
|
21
|
+
disabledShippingServices?: PurchaseLabelFeatures["disabledShippingServices"];
|
|
22
22
|
errors?: SE.CodedError[];
|
|
23
23
|
features?: ShipmentFormFeatures;
|
|
24
24
|
harmonizedTariffCodes?: HarmonizedTariffCode[];
|
|
@@ -48,6 +48,7 @@ export type ShipmentFormProps = {
|
|
|
48
48
|
})[];
|
|
49
49
|
shipment?: SE.SalesOrderShipment;
|
|
50
50
|
shippingPresets?: UseShippingPresetsOptionsProps;
|
|
51
|
+
shipToAddressPreference?: AddressPreference;
|
|
51
52
|
warehouseId?: string;
|
|
52
53
|
warehouses?: SE.Warehouse[];
|
|
53
54
|
};
|
|
@@ -56,4 +57,4 @@ export type CharsetWarning = {
|
|
|
56
57
|
message: string;
|
|
57
58
|
title?: string;
|
|
58
59
|
};
|
|
59
|
-
export declare const ShipmentForm: ({ accountSettings, addressLoading,
|
|
60
|
+
export declare const ShipmentForm: ({ accountSettings, addressLoading, shipToAddressPreference, charsetWarning, carriers, customPackageTypes, currency, defaultFeatures, disabledShippingServices, features, harmonizedTariffCodes, hydrateRef, insuranceAccount, isLoading, onApplyPreset, onChangeAddress, onChangeMode, onChangeShipFromAddress, onDirty, onSubmit, onSubmitParseAddress, onToggleAddressPreferenceDisclosure, onUpdateCustoms, onUpdateTaxableIds, parseAddressErrors, resetParseAddress, salesOrder, shipment, shipFromAddresses, shippingPresets, warehouseId, warehouses, }: ShipmentFormProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -2,9 +2,10 @@ import { SE } from "@shipengine/react-api";
|
|
|
2
2
|
import { ShippingPreset } from "../../../types";
|
|
3
3
|
export type UsePresetsProps = {
|
|
4
4
|
onApply?: (preset: ShippingPreset, shipment: SE.SalesOrderShipment) => Promise<void> | void;
|
|
5
|
+
onShipmentUpdated?: (shipment: SE.SalesOrderShipment) => Promise<void> | void;
|
|
5
6
|
shipment?: SE.SalesOrderShipment;
|
|
6
7
|
};
|
|
7
|
-
export declare const usePresets: ({ onApply, shipment }: UsePresetsProps) => {
|
|
8
|
+
export declare const usePresets: ({ onApply, onShipmentUpdated, shipment }: UsePresetsProps) => {
|
|
8
9
|
handleApplyPreset: (preset: ShippingPreset) => Promise<void>;
|
|
9
10
|
presetErrors: SE.CodedError[] | null;
|
|
10
11
|
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { SE } from "@shipengine/react-api";
|
|
2
|
+
import { PurchaseLabelFeatures } from "../../../utilities";
|
|
2
3
|
import { UseRatesWithCacheProps } from "./use-rates-with-cache";
|
|
3
4
|
export type UseRatesFormProps = {
|
|
5
|
+
disabledShippingServices?: PurchaseLabelFeatures["disabledShippingServices"];
|
|
4
6
|
getPreferredRates?: UseRatesWithCacheProps["getPreferredRates"];
|
|
5
7
|
onBeforeLabelCreate?: (rate: SE.Rate, shipment: SE.SalesOrderShipment) => Promise<void> | Promise<{
|
|
6
8
|
error?: SE.CodedError;
|
|
@@ -21,7 +23,7 @@ export type UseRatesFormProps = {
|
|
|
21
23
|
printLabelLayout?: SE.LabelLayout;
|
|
22
24
|
shipment?: SE.SalesOrderShipment;
|
|
23
25
|
};
|
|
24
|
-
export declare const useRatesForm: ({ getPreferredRates, onBeforeRateSaved, onBeforeLabelCreate, onLabelCreateFailure, onLabelCreateSuccess, onRateSaved, onRatesCalculated, onShipmentUpdated, printLabelLayout, shipment, }: UseRatesFormProps) => {
|
|
26
|
+
export declare const useRatesForm: ({ getPreferredRates, disabledShippingServices, onBeforeRateSaved, onBeforeLabelCreate, onLabelCreateFailure, onLabelCreateSuccess, onRateSaved, onRatesCalculated, onShipmentUpdated, printLabelLayout, shipment, }: UseRatesFormProps) => {
|
|
25
27
|
carriers: SE.Carrier[] | undefined;
|
|
26
28
|
displayableRateErrors: string[] | undefined;
|
|
27
29
|
errors: SE.CodedError[] | undefined;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { SE } from "@shipengine/react-api";
|
|
2
|
+
import { PurchaseLabelFeatures } from "../../../utilities";
|
|
2
3
|
import { UseRequestRatesProps } from "./use-request-rates";
|
|
3
4
|
export type UseRatesWithCacheProps = {
|
|
5
|
+
disabledShippingServices?: PurchaseLabelFeatures["disabledShippingServices"];
|
|
4
6
|
getPreferredRates?: UseRequestRatesProps["getPreferredRates"];
|
|
5
7
|
onRatesCalculated: UseRequestRatesProps["onRatesCalculated"];
|
|
6
8
|
shipment?: SE.SalesOrderShipment;
|
|
@@ -14,7 +16,7 @@ export type UseRatesWithCacheProps = {
|
|
|
14
16
|
* It also intercepts the resetRates function from useRequestRates to set a flag to ignore this caching.
|
|
15
17
|
* (this transparently returns the behaviors to the default useRequestRates behavior)
|
|
16
18
|
*/
|
|
17
|
-
export declare const useRatesWithCache: ({
|
|
19
|
+
export declare const useRatesWithCache: ({ disabledShippingServices, onRatesCalculated, getPreferredRates, shipment, }: UseRatesWithCacheProps) => {
|
|
18
20
|
preferredRatesResponse: import("../../..").PreferredRatesResponse | undefined;
|
|
19
21
|
ratesCalculating: boolean;
|
|
20
22
|
ratesErrors: SE.CodedError[] | null;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { SE } from "@shipengine/react-api";
|
|
2
2
|
import { PreferredRatesResponse } from "../../../types";
|
|
3
|
+
import { PurchaseLabelFeatures } from "../../../utilities";
|
|
3
4
|
import { ConfigureShipmentProps } from "../configure-shipment";
|
|
4
5
|
export type UseRequestRatesProps = {
|
|
6
|
+
disabledShippingServices?: PurchaseLabelFeatures["disabledShippingServices"];
|
|
5
7
|
getPreferredRates?: ConfigureShipmentProps["getPreferredRates"];
|
|
6
8
|
onRatesCalculated?: (rates: SE.Rate[], shipment: SE.SalesOrderShipment) => Promise<void> | void;
|
|
7
9
|
};
|
|
8
|
-
export declare const useRequestRates: ({ onRatesCalculated, getPreferredRates }: UseRequestRatesProps) => {
|
|
10
|
+
export declare const useRequestRates: ({ disabledShippingServices, onRatesCalculated, getPreferredRates, }: UseRequestRatesProps) => {
|
|
9
11
|
isCalculating: boolean;
|
|
10
12
|
preferredRatesResponse: PreferredRatesResponse | undefined;
|
|
11
13
|
ratesErrors: SE.CodedError[] | null;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SE } from "@shipengine/react-api";
|
|
2
|
-
import { HarmonizedTariffCode, ShipFromAddress
|
|
2
|
+
import { HarmonizedTariffCode, ShipFromAddress } from "../../../types";
|
|
3
3
|
import { UseAddressProps } from "./use-address";
|
|
4
4
|
import { UsePresetsProps } from "./use-presets";
|
|
5
5
|
export type UseShipmentFormProps = {
|
|
@@ -18,13 +18,12 @@ export type UseShipmentFormProps = {
|
|
|
18
18
|
export declare const useShipmentForm: ({ compatibleCountryCodes, onAddressValidation, onApplyPreset, onChangeAddress, onShipmentUpdated, onSubmit, salesOrder, shipment, shipFromAddresses: shipFromAddressesProp, useWarehouses, }: UseShipmentFormProps) => {
|
|
19
19
|
accountSettings: SE.ShipEngineAccountSettings | undefined;
|
|
20
20
|
addressLoading: boolean;
|
|
21
|
-
addressPreference: import("../../../components/templates").AddressPreference | undefined;
|
|
22
21
|
carriers: SE.Carrier[] | undefined;
|
|
23
22
|
charsetWarning: import("../../../components/templates").CharsetWarning | undefined;
|
|
24
23
|
customPackageTypes: SE.CustomPackage[] | undefined;
|
|
25
24
|
displayableErrors: string[] | undefined;
|
|
26
25
|
errors: SE.CodedError[] | undefined;
|
|
27
|
-
onApplyPreset: (preset: ShippingPreset) => Promise<void>;
|
|
26
|
+
onApplyPreset: (preset: import("../../../types").ShippingPreset) => Promise<void>;
|
|
28
27
|
onChangeAddress: (shipTo: SE.Address, { shouldValidate }: import("../../../components/templates").OnChangeAddressOptions) => Promise<SE.SalesOrderShipment>;
|
|
29
28
|
onChangeShipFromAddress: (id?: string, shipFromAddress?: ShipFromAddress) => Promise<void>;
|
|
30
29
|
onSubmit: (values: Partial<SE.SalesOrderShipment>) => Promise<SE.SalesOrderShipment>;
|
|
@@ -45,5 +44,6 @@ export declare const useShipmentForm: ({ compatibleCountryCodes, onAddressValida
|
|
|
45
44
|
name?: string | undefined;
|
|
46
45
|
}[] | undefined;
|
|
47
46
|
shipment: SE.SalesOrderShipment | undefined;
|
|
47
|
+
shipToAddressPreference: import("../../../components/templates").AddressPreference | undefined;
|
|
48
48
|
warehouses: SE.Warehouse[] | undefined;
|
|
49
49
|
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { CodedError, Currency } from "@shipengine/react-api";
|
|
2
2
|
export type ShipEngineCarriersProps = {
|
|
3
|
-
addedFundsError?: CodedError[] | null;
|
|
4
3
|
addFunds?: (payload: {
|
|
5
4
|
carrierId: string;
|
|
6
5
|
funds: {
|
|
@@ -8,9 +7,10 @@ export type ShipEngineCarriersProps = {
|
|
|
8
7
|
currency: Currency;
|
|
9
8
|
};
|
|
10
9
|
}) => Promise<void>;
|
|
10
|
+
addFundsError?: CodedError[] | null;
|
|
11
11
|
isUpdateFundsError?: boolean;
|
|
12
12
|
isUpdatingFunds?: boolean;
|
|
13
13
|
onRedirectToOnboarding?: () => void;
|
|
14
14
|
showFunds?: boolean;
|
|
15
15
|
};
|
|
16
|
-
export declare const ShipEngineCarriers: ({ showFunds, onRedirectToOnboarding, addFunds,
|
|
16
|
+
export declare const ShipEngineCarriers: ({ showFunds, onRedirectToOnboarding, addFunds, addFundsError, }: ShipEngineCarriersProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -15,7 +15,6 @@ import { CodedError, Currency } from "@shipengine/react-api";
|
|
|
15
15
|
* @see {@link ManageFundingProps | The props that are passed into the `<ManageFunding />` component}
|
|
16
16
|
*/
|
|
17
17
|
export type ManageFundingProps = {
|
|
18
|
-
addedFundsError?: CodedError[] | null;
|
|
19
18
|
addFunds?: (payload: {
|
|
20
19
|
carrierId: string;
|
|
21
20
|
funds: {
|
|
@@ -23,6 +22,7 @@ export type ManageFundingProps = {
|
|
|
23
22
|
currency: Currency;
|
|
24
23
|
};
|
|
25
24
|
}) => Promise<void>;
|
|
25
|
+
addFundsError?: CodedError[] | null;
|
|
26
26
|
onRedirectToOnboarding?: () => void;
|
|
27
27
|
};
|
|
28
|
-
export declare const ManageFunding: ({ onRedirectToOnboarding, addFunds,
|
|
28
|
+
export declare const ManageFunding: ({ onRedirectToOnboarding, addFunds, addFundsError, }: ManageFundingProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -32,4 +32,4 @@ export type RateOption = Omit<SE.Rate, "warningMessages"> & {
|
|
|
32
32
|
*
|
|
33
33
|
* # Rate Options Hook
|
|
34
34
|
*/
|
|
35
|
-
export declare const useRateOptions: (rates?: SE.Rate[], preferredRates?: PreferredRatesResponse, carriers?: SE.Carrier[], shipment?: SE.SalesOrderShipment, servicePoints?: SE.ServicePoint[],
|
|
35
|
+
export declare const useRateOptions: (rates?: SE.Rate[], preferredRates?: PreferredRatesResponse, carriers?: SE.Carrier[], shipment?: SE.SalesOrderShipment, servicePoints?: SE.ServicePoint[], requireDhlTermsAcknowledgement?: boolean, windsorFrameworkEnabled?: boolean) => RateOption[];
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { SE } from "@shipengine/react-api";
|
|
2
2
|
import { SelectCategory } from "../../components/field/select";
|
|
3
|
+
import { PurchaseLabelFeatures } from "../../utilities";
|
|
3
4
|
/**
|
|
4
5
|
* @internal
|
|
5
6
|
*
|
|
@@ -7,4 +8,4 @@ import { SelectCategory } from "../../components/field/select";
|
|
|
7
8
|
*
|
|
8
9
|
* @category Hooks
|
|
9
10
|
*/
|
|
10
|
-
export declare const useServiceCodeOptions: (carriers?: SE.Carrier[], shipment?: SE.SalesOrderShipment) => SelectCategory[];
|
|
11
|
+
export declare const useServiceCodeOptions: (carriers?: SE.Carrier[], shipment?: SE.SalesOrderShipment, disabledShippingServices?: PurchaseLabelFeatures["disabledShippingServices"]) => SelectCategory[];
|
|
@@ -6,10 +6,6 @@ export type RateFormFeatures = {
|
|
|
6
6
|
* Enables the `funding` section of the rate form.
|
|
7
7
|
*/
|
|
8
8
|
enableFunding?: boolean;
|
|
9
|
-
/**
|
|
10
|
-
* Enables the `global post filtering` on all rates fetched in the rates form.
|
|
11
|
-
*/
|
|
12
|
-
enableGlobalPostFiltering?: boolean;
|
|
13
9
|
/**
|
|
14
10
|
* Enables the Pick Up/Drop Off tabs UI in the Rate Form to separate rates with PUDO capability by type.
|
|
15
11
|
*/
|
|
@@ -80,6 +76,11 @@ export type PurchaseLabelFeatures = {
|
|
|
80
76
|
* List of all supported `countries` available in ShipEngine Elements.
|
|
81
77
|
*/
|
|
82
78
|
compatibleCountryCodes?: CountryCode[];
|
|
79
|
+
/**
|
|
80
|
+
* Rates for any service codes included here will not be available for purchase.
|
|
81
|
+
* The property should be of the form { "carrier_code": ["service_code1", "service_code2"] }
|
|
82
|
+
*/
|
|
83
|
+
disabledShippingServices?: Record<string, string[]>;
|
|
83
84
|
/**
|
|
84
85
|
* When enabled will modify the default behavior of creating a new shipment for a salesorder to throwing an error
|
|
85
86
|
*/
|
|
@@ -16,5 +16,5 @@ import { FieldValues, ResolverResult, UseFormHandleSubmit } from "react-hook-for
|
|
|
16
16
|
export declare const formLogger: {
|
|
17
17
|
capture(handleSubmit: ReturnType<UseFormHandleSubmit<any>>): (e?: React.BaseSyntheticEvent) => void;
|
|
18
18
|
isSubmitting: boolean;
|
|
19
|
-
log: <
|
|
19
|
+
log: <U extends FieldValues>(getValidationResult: () => Promise<ResolverResult<U>>, sensitiveValues?: string[]) => Promise<ResolverResult<U>>;
|
|
20
20
|
};
|
|
@@ -15,4 +15,4 @@ export declare const errorMap: z.ZodErrorMap;
|
|
|
15
15
|
*
|
|
16
16
|
* @category Utilities
|
|
17
17
|
*/
|
|
18
|
-
export declare const validationResolver: <T extends z.ZodType<any, any, any>>(schema: T) => ReturnType<Resolver>;
|
|
18
|
+
export declare const validationResolver: <T extends z.ZodType<any, any, any>>(schema: T, sensitiveValues?: string[]) => ReturnType<Resolver>;
|
|
@@ -24,11 +24,11 @@ import { CodedError } from "@shipengine/react-api";
|
|
|
24
24
|
* @see {@link AccountSettings.Element | The `<AccountSettings />` component renders the `<CarrierServices />` component}
|
|
25
25
|
*/
|
|
26
26
|
export type CarrierServicesProps = {
|
|
27
|
-
addedFundsError?: CodedError[] | null;
|
|
28
27
|
addFunds?: () => Promise<any>;
|
|
28
|
+
addFundsError?: CodedError[] | null;
|
|
29
29
|
onRedirectToOnboarding?: () => void;
|
|
30
30
|
};
|
|
31
|
-
export declare const Component: ({ onRedirectToOnboarding, addFunds,
|
|
31
|
+
export declare const Component: ({ onRedirectToOnboarding, addFunds, addFundsError, }: CarrierServicesProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
32
32
|
export declare const Element: ({ resources, ...props }: CarrierServicesProps & {
|
|
33
33
|
resources?: {
|
|
34
34
|
en: {
|
|
@@ -602,29 +602,6 @@ export declare const Element: ({ resources, ...props }: CarrierServicesProps & {
|
|
|
602
602
|
pdf: string;
|
|
603
603
|
};
|
|
604
604
|
};
|
|
605
|
-
/**
|
|
606
|
-
* # Carrier-Services Component
|
|
607
|
-
*
|
|
608
|
-
* @param ComponentProps The base props that will be passed into the `<CarrierServices />` component.
|
|
609
|
-
*
|
|
610
|
-
* @returns Element A React element that renders the `<CarrierServices />` component allowing users
|
|
611
|
-
* to view a list of carriers that are connected to their ShipEngine account, add funds to their wallet, view transaction history, and manage their payment method. This component is
|
|
612
|
-
* composed in the `<AccountSettings />` Element.
|
|
613
|
-
*
|
|
614
|
-
* @example
|
|
615
|
-
* ```tsx
|
|
616
|
-
* (() => {
|
|
617
|
-
* const features = useFeatures("Global");
|
|
618
|
-
*
|
|
619
|
-
* return <CarrierServices.Element features={features} />;
|
|
620
|
-
* })();
|
|
621
|
-
* ```
|
|
622
|
-
*
|
|
623
|
-
* <br />
|
|
624
|
-
*
|
|
625
|
-
* @see {@link CarrierServices.ComponentProps | The props that are passed into the `<CarrierServices />` component}
|
|
626
|
-
* @see {@link AccountSettings.Element | The `<AccountSettings />` component renders the `<CarrierServices />` component}
|
|
627
|
-
*/
|
|
628
605
|
emptyState: {
|
|
629
606
|
title: string;
|
|
630
607
|
subtitle: string;
|
|
@@ -1097,6 +1074,29 @@ export declare const Element: ({ resources, ...props }: CarrierServicesProps & {
|
|
|
1097
1074
|
accountBalance: string;
|
|
1098
1075
|
paymentMethod: string;
|
|
1099
1076
|
transactionHistory: string;
|
|
1077
|
+
/**
|
|
1078
|
+
* # Carrier-Services Component
|
|
1079
|
+
*
|
|
1080
|
+
* @param ComponentProps The base props that will be passed into the `<CarrierServices />` component.
|
|
1081
|
+
*
|
|
1082
|
+
* @returns Element A React element that renders the `<CarrierServices />` component allowing users
|
|
1083
|
+
* to view a list of carriers that are connected to their ShipEngine account, add funds to their wallet, view transaction history, and manage their payment method. This component is
|
|
1084
|
+
* composed in the `<AccountSettings />` Element.
|
|
1085
|
+
*
|
|
1086
|
+
* @example
|
|
1087
|
+
* ```tsx
|
|
1088
|
+
* (() => {
|
|
1089
|
+
* const features = useFeatures("Global");
|
|
1090
|
+
*
|
|
1091
|
+
* return <CarrierServices.Element features={features} />;
|
|
1092
|
+
* })();
|
|
1093
|
+
* ```
|
|
1094
|
+
*
|
|
1095
|
+
* <br />
|
|
1096
|
+
*
|
|
1097
|
+
* @see {@link CarrierServices.ComponentProps | The props that are passed into the `<CarrierServices />` component}
|
|
1098
|
+
* @see {@link AccountSettings.Element | The `<AccountSettings />` component renders the `<CarrierServices />` component}
|
|
1099
|
+
*/
|
|
1100
1100
|
adjustmentHistory: string;
|
|
1101
1101
|
warehouses: string;
|
|
1102
1102
|
carriers: {
|
|
@@ -15,5 +15,6 @@ export type ValidateAddress = ValidateWarehouse | ValidateBilling;
|
|
|
15
15
|
export type OnboardingWizardProps = {
|
|
16
16
|
defaultShipFromAddress?: ShipFromAddressStepProps["defaultShipFromAddress"];
|
|
17
17
|
onComplete: () => void;
|
|
18
|
+
onSellerOnboarded?: () => void;
|
|
18
19
|
};
|
|
19
|
-
export declare const OnboardingWizard: ({ defaultShipFromAddress, onComplete: onWizardComplete, }: OnboardingWizardProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
20
|
+
export declare const OnboardingWizard: ({ defaultShipFromAddress, onComplete: onWizardComplete, onSellerOnboarded, }: OnboardingWizardProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|