@imagineio/configurator-sdk 0.1.3 → 0.1.5
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/README.md +134 -134
- package/dist/0a35b2c5f4.js +1 -1
- package/dist/2990ba64d6.js +1 -1
- package/dist/2c7c1bcef1.js +1 -1
- package/dist/30be653f00.css +106 -106
- package/dist/39a62ef7b8.js +1 -1
- package/dist/3c916f744f.js +1 -1
- package/dist/4e7d0a0d4a.js +1 -1
- package/dist/60d697292c.js +1 -1
- package/dist/6bff84d27e.js +1 -1
- package/dist/718ecf1729.js +1 -0
- package/dist/776277593f.js +1 -1
- package/dist/7d9ddaeb47.js +1 -1
- package/dist/811b403d43.js +1 -1
- package/dist/87bb469216.js +1 -1
- package/dist/9526094bb7.js +1 -1
- package/dist/98f3644031.js +1 -1
- package/dist/99577e3161.js +1 -0
- package/dist/9ce3c3df25.js +1 -0
- package/dist/a0f71d0bf5.js +1 -1
- package/dist/a493e9aa8f.js +1 -1
- package/dist/a77b15c0d6.js +1 -1
- package/dist/bcd44b4040.js +1 -1
- package/dist/bdec200d00.js +1 -1
- package/dist/be07a7f885.js +1 -0
- package/dist/c9a1656c62.js +1 -1
- package/dist/ce663020e4.js +2 -2
- package/dist/d4378d9afa.js +1 -1
- package/dist/dbd5ba1d07.js +1 -1
- package/dist/dc2a1a0e13.js +1 -1
- package/dist/fbd844f2d1.js +1 -1
- package/package.json +16 -14
package/dist/d4378d9afa.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Fragment as g,jsx as e,jsxs as f}from"react/jsx-runtime";import{memo as T,useEffect as _,useMemo as p,useRef as O,lazy as m,Suspense as w}from"react";import*as A from"three";import{Environment as I}from"@react-three/drei";import{useThree as N}from"@react-three/fiber";import{RectAreaLightUniformsLib as
|
|
1
|
+
import{Fragment as g,jsx as e,jsxs as f}from"react/jsx-runtime";import{memo as T,useEffect as _,useMemo as p,useRef as O,lazy as m,Suspense as w}from"react";import*as A from"three";import{Environment as I}from"@react-three/drei";import{useThree as N}from"@react-three/fiber";import{RectAreaLightUniformsLib as P}from"three/examples/jsm/lights/RectAreaLightUniformsLib.js";import k from"./983cbed22c.js";import{applyEnvironmentToRenderer as z}from"./4e7d0a0d4a.js";import{getApiBaseUrl as U}from"./8ade32d067.js";const F=(()=>{let t=null;const o=()=>t||(t=import("@react-three/postprocessing"));return{EffectComposer:m(()=>o().then(n=>({default:n.EffectComposer}))),Bloom:m(()=>o().then(n=>({default:n.Bloom}))),SSAO:m(()=>o().then(n=>({default:n.SSAO}))),FXAA:m(()=>o().then(n=>({default:n.FXAA}))),N8AO:m(()=>o().then(n=>({default:n.N8AO})))}})(),{EffectComposer:W,Bloom:D,SSAO:X,FXAA:G,N8AO:H}=F,$=m(()=>Promise.all([import("@react-three/postprocessing"),import("postprocessing")]).then(([t,o])=>{const n={ACESFilmic:o.ToneMappingMode.ACES_FILMIC,Reinhard:o.ToneMappingMode.REINHARD,Linear:o.ToneMappingMode.LINEAR,Cineon:o.ToneMappingMode.OPTIMIZED_CINEON,AgX:o.ToneMappingMode.AGX,Neutral:o.ToneMappingMode.NEUTRAL};return{default:({name:d})=>{const i=d?n[d]:void 0;return i===void 0?null:e(t.ToneMapping,{mode:i})}}}));let M=!1;function j(){if(!M){try{P.init()}catch{}M=!0}}function x(t){if(!t||/^([a-z]+:)?\/\//i.test(t)||t.startsWith("data:")||t.startsWith("blob:"))return t;const o=U()||"";return t.startsWith("/")?`${o}${t}`:`${o}/${t}`}function S(t,o){return o?512:typeof t.shadow_map_size=="number"?t.shadow_map_size:2048}function Y({env:t,isMobile:o,is3D:n,reducedQuality:l,captureMode:d}){const{gl:i,invalidate:s}=N();_(()=>{t&&Object.keys(t).length>0&&(z(t,i),s())},[t,i,s]);const c=p(()=>{if(!t)return[];if(Array.isArray(t.lights))return t.lights;const a=[];if(t.ambient_light&&a.push({type:"ambient",...t.ambient_light}),Array.isArray(t.directional_lights))for(const u of t.directional_lights)a.push({type:"directional",...u});return a},[t]);p(()=>c.some(a=>a?.type==="rect_area"),[c])&&j();const h=p(()=>{if(!t?.hdr)return null;const a=t.hdr,u=o?a.url_1k??a.url1k??a.url??null:a.url_2k??a.url2k??a.url??null;return u?{url:x(u),intensity:typeof a.intensity=="number"?a.intensity:1,rotation_deg:typeof a.rotation_deg=="number"?a.rotation_deg:0,as_background:!!a.as_background}:null},[t?.hdr,o]),b=p(()=>[0,A.MathUtils.degToRad(h?.rotation_deg??0),0],[h?.rotation_deg]);if(!t||Object.keys(t).length===0)return null;let y=null;h?.as_background||(y=t.background?.color??"#ffffff");const E=t.background?.color??"#ffffff",R=typeof t.shadows?.bias=="number"?t.shadows.bias:15e-5,B=typeof t.shadows?.radius=="number"?t.shadows.radius:typeof t.ground?.shadow_blur=="number"?t.ground.shadow_blur:null,C=typeof t.shadows?.normal_bias=="number"?t.shadows.normal_bias:null;return f(g,{children:[h&&e(k,{children:e(w,{fallback:h?.as_background?e("color",{attach:"background",args:[E]}):null,children:e(I,{files:h.url,background:h.as_background,environmentIntensity:h.intensity,environmentRotation:b,backgroundRotation:b})})}),y&&e("color",{attach:"background",args:[y]}),c.map((a,u)=>!a||a.enabled===!1?null:e(J,{light:a,is3D:n,reducedQuality:l,globalShadowBias:R,globalShadowRadius:B,globalShadowNormalBias:C},u)),e(q,{ground:t.ground,is3D:n,reducedQuality:l,captureMode:d}),e(Z,{postProcessing:t.post_processing,toneMapping:t.tone_mapping??t.toneMapping,is3D:n,reducedQuality:l,captureMode:d})]})}function q({ground:t,is3D:o,reducedQuality:n,captureMode:l}){if(l||!t||t.enabled!==!0)return null;const d=t.floor_color??t.color??"#ffffff",i=typeof t.size=="number"?t.size:21,s=n?-.05:o?-.005:-.02,c=typeof t.shadow_opacity=="number"?t.shadow_opacity:.5,r=t.shadow_color??"#000000";return f(g,{children:[f("mesh",{rotation:[-Math.PI/2,0,0],position:[0,s,0],renderOrder:n?-1:0,children:[e("circleGeometry",{args:[i,64]}),e("meshBasicMaterial",{color:d,toneMapped:!1,depthWrite:!n,polygonOffset:!0,polygonOffsetFactor:2,polygonOffsetUnits:2})]}),o&&c>0&&f("mesh",{rotation:[-Math.PI/2,0,0],position:[0,s+5e-4,0],receiveShadow:!0,children:[e("circleGeometry",{args:[i,64]}),e("shadowMaterial",{transparent:!0,opacity:c,color:r})]})]})}function Z({postProcessing:t,toneMapping:o,is3D:n,reducedQuality:l,captureMode:d}){if(d||!n||!t)return null;const i=t.bloom,s=t.ssao,c=t.fxaa,r=t.n8ao;return!i&&!s&&!c&&!r?null:e(k,{children:e(w,{fallback:null,children:f(W,{enableNormalPass:!!(s&&!r),children:[i&&e(D,{intensity:typeof i?.intensity=="number"?i.intensity:.5,luminanceThreshold:typeof i?.threshold=="number"?i.threshold:.9,luminanceSmoothing:typeof i?.smoothing=="number"?i.smoothing:.025,mipmapBlur:!0}),r&&e(H,{aoRadius:typeof r?.radius=="number"?r.radius:l?.3:.5,intensity:typeof r?.intensity=="number"?r.intensity:l?1:1.5,distanceFalloff:typeof r?.falloff=="number"?r.falloff:.5,quality:l?"low":"medium"}),s&&!r&&e(X,{intensity:typeof s?.intensity=="number"?s.intensity:1,radius:typeof s?.radius=="number"?s.radius:.1,samples:l?9:16}),c&&e(G,{}),e($,{name:o})]})})})}function J({light:t,is3D:o,reducedQuality:n,globalShadowBias:l,globalShadowRadius:d,globalShadowNormalBias:i}){const s=O();_(()=>{t.target&&s.current&&s.current.position.set(t.target[0],t.target[1],t.target[2])},[t.target]);const c=r=>r?{"shadow-bias":typeof t.bias=="number"?t.bias:l,"shadow-normalBias":typeof t.normal_bias=="number"?t.normal_bias:i??.1,"shadow-radius":typeof t.radius=="number"?t.radius:d??4,"shadow-mapSize-width":S(t,n),"shadow-mapSize-height":S(t,n),"shadow-camera-far":t.shadow_camera_far??500,"shadow-camera-near":t.shadow_camera_near??.5,"shadow-camera-left":t.shadow_camera_left??-5,"shadow-camera-right":t.shadow_camera_right??5,"shadow-camera-top":t.shadow_camera_top??5,"shadow-camera-bottom":t.shadow_camera_bottom??-5}:{};switch(t.type){case"ambient":return e("ambientLight",{color:t.color,intensity:t.intensity??1});case"directional":{const r=o&&!!t.cast_shadow,h=t.position??[0,5,5];return f(g,{children:[e("directionalLight",{color:t.color,intensity:t.intensity??1,position:h,castShadow:r,...c(r)}),t.target&&e("object3D",{ref:s})]})}case"point":{const r=o&&!!t.cast_shadow;return e("pointLight",{color:t.color,intensity:t.intensity??1,position:t.position??[0,5,0],distance:t.distance??0,decay:t.decay??2,castShadow:r,...c(r)})}case"spot":{const r=o&&!!t.cast_shadow;return f(g,{children:[e("spotLight",{color:t.color,intensity:t.intensity??1,position:t.position??[0,5,0],distance:t.distance??0,angle:A.MathUtils.degToRad(t.angle_deg??30),penumbra:t.penumbra??0,decay:t.decay??2,castShadow:r,...c(r)}),t.target&&e("object3D",{ref:s})]})}case"hemisphere":return e("hemisphereLight",{color:t.sky_color??t.color,groundColor:t.ground_color,intensity:t.intensity??1,position:t.position??[0,5,0]});case"rect_area":return e("rectAreaLight",{color:t.color,intensity:t.intensity??1,width:t.width??1,height:t.height??1,position:t.position??[0,5,0],rotation:t.rotation??[0,0,0]});default:return null}}var nt=T(Y);export{nt as default};
|
package/dist/dbd5ba1d07.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import m from"./872c4302e0.js";import v from"./9c6c598569.js";import x from"./d94df858ea.js";import q from"./8f60e5059a.js";import j from"./be337ddda5.js";import{applyFinishClick as X,normalizeMaterialTargets as z}from"./dc2a1a0e13.js";import{executeLayoutChange as Z}from"./9526094bb7.js";import{clearSceneLoadingAfterRender as ee}from"./2774152dd2.js";import"./9326c23506.js";import"./061b81ad81.js";import{isOptionAvailable as U,isOptionVisible as te}from"./817d930a49.js";import{runIntent as L,INTENTS as H}from"./6d238282c1.js";import{emitEvent as W,EVENTS as k}from"./2e366d7386.js";import{isAddFeature as ne}from"./8c27edda0f.js";import{getPlacementBinding as oe}from"./817d930a49.js";function D(e,t){if(e==null||t==null)return!1;try{return!!oe(e,t)}catch{return!1}}import{armHostedProduct as se}from"./ab6c80484f.js";function ce(e,t,s){const o=m.getState(),{options:p,features:i,materials:a}=o,c=v.getState(),u=(c.selectedInstanceId??null)!=null,g=q.getState(),{hostStyles:f,hostHandleTypes:_,freePieceTier:w,setFreePieceTier:N,setSceneLoading:O,showInfo:F,clearSelectedFeature:B,clearPendingHostedProduct:Y}=g,A=c.activeSceneConfigId,G=x.getState().setSceneSelection,C=j.getState(),h=A?C.getSceneFeatures?.(A)||[]:[],y={layoutFeature:h.find(l=>l.type==="layout_change"),finishFeatures:h.filter(l=>l.type==="finish_change"),productFeatures:h.filter(l=>l.type==="load_new_product"),appliancesFeature:h.find(l=>l.type==="appliance_selection")};if(!e||!t)return!1;const P=i||{},S=e.id??e.feature_id??Object.keys(P).find(l=>P[l]===e);return S==null?!1:(import("./a77b15c0d6.js").then(({selectOptionForScene:l})=>l({optionSetId:S,optionId:s})).catch(()=>{}),!0)}function M(e,t,s=null,o=null){const p=m.getState(),i=s??p.features?.[e]??p.features?.[String(e)]??null;let a=o??p.options?.[t]??p.options?.[String(t)]??null;return!a&&Array.isArray(i?.options)&&(a=i.options.find(c=>c&&typeof c=="object"&&String(c.id)===String(t))??null),{optionSetName:i?.name??null,optionName:a?.name??a?.label??null}}function Ee(e,t,s){return L({type:H.OPTION_SELECT,optionSetId:e,optionId:t,optionSetType:s?.type??null,featureId:e,featureType:s?.type??null},()=>{const o=ie(e,t,s);return W(k.OPTION_SELECTED,{optionSetId:e,optionId:t,featureType:s?.type??null,...M(e,t,s)}),o})}function ie(e,t,s){const o=s?.type;if(o==="appliance_selection"){const n=m.getState(),d=n.options||{},I=d[t]||d[String(t)]||null,T=I?.value??I?.valueText??t,Q=n.getProduct?.(T)||n.products?.[T]||{id:T};return se(Q)}if(o==="product_change"||o==="load_new_component"||o==="load_new_product"){const n=m.getState().options||{},d=n[t]||n[String(t)]||{id:t};return R(s,d)}const p=m.getState(),{options:i,features:a,materials:c}=p,r=v.getState(),u=r.selectedInstanceId??null,g=u!=null,f=q.getState(),{hostStyles:_,hostHandleTypes:w,freePieceTier:N,setFreePieceTier:O,setSceneLoading:F,showInfo:B,clearSelectedFeature:Y,clearPendingHostedProduct:A}=f,G=r.activeSceneConfigId,C=x.getState().setSceneSelection,h=j.getState(),y=G?h.getSceneFeatures?.(G)||[]:[],P={layoutFeature:y.find(n=>n.type==="layout_change"),finishFeatures:y.filter(n=>n.type==="finish_change"),productFeatures:y.filter(n=>n.type==="load_new_product"),appliancesFeature:y.find(n=>n.type==="appliance_selection")},S=i[t];if(S&&!te(e,t)||S&&!U(e,t))return;const l=a?.[e]||a?.[String(e)]||s||{},E={...s||{},...l},$=z(S?.materialSlots??S?.material_slots),J=z(E?.material_targets??E?.materialTargets??E?.materials);if($.length>0||J.length>0){const n=g&&D(u,e);return X({option:S,feature:E,scope:n?"single":"all",pieceIndex:n?u:null}),!0}let b="Updating...";const V=P.layoutFeature?.id===e,K=P.productFeatures?.some(n=>n.id===e);if(V)b="Changing layout...";else if(K){b=i[t]?.value===null?"Removing island...":"Adding island...";const d=i[t]?.tier??i[t]?.islandTier??null;(d==="single"||d==="double")&&O(d)}if(F(!0,b),V){const n=L({type:H.LAYOUT_CHANGE,optionSetId:e,optionId:t,featureId:e},()=>(requestAnimationFrame(()=>{Z(t,y),C(e,t),import("./a77b15c0d6.js").then(({applyLayoutPreset:d,refreshCanonicalState:I})=>setTimeout(()=>{const T=v.getState().activeSceneConfigId;T!=null?d(T):I()},400)).catch(()=>{})}),!0));return n!==!0&&F(!1),n===!0}return C(e,t),ee(),!0}function Ie(e,t){return L({type:H.OPTION_SELECT,optionSetId:e?.id??e?.feature_id??null,optionId:t?.id??null,optionSetType:e?.type??null,featureId:e?.id??e?.feature_id??null,featureType:e?.type??null},()=>{const s=R(e,t);return W(k.OPTION_SELECTED,{optionSetId:e?.id??e?.feature_id??null,optionId:t?.id??null,featureType:e?.type??null,...M(e?.id??e?.feature_id,t?.id,e,t)}),s})}function R(e,t){const o=v.getState().selectedInstanceId??null,p=t?.optionSetId??t?.option_set_id??e?.feature_id??e?.id,i=o!=null&&D(o,p),a=x.getState().setSceneSelection;if(i&&String(o).endsWith("__host")&&(e?.type==="load_new_product"||e?.type==="product_change")){const c=m.getState(),r=t?.value??t?.valueText??t?.value_text??t?.valueProductVariantId??t?.value_product_variant_id??null,g=(r!=null?c.getProduct?.(r)||c.products?.[r]||c.products?.[String(r)]:null)?.id??r;return g==null?!1:(import("./a77b15c0d6.js").then(({changeHostVariantForProduct:f})=>f({placementId:String(o).replace(/__host$/,""),variantId:g})).catch(()=>{}),!0)}if(U(e?.id,t?.id))if(ne(e,{productSelected:i}))a(e.id,t.id);else if(e.type==="load_new_product"&&i&&o!=null&&!String(o).endsWith("__host")){const c=m.getState(),r=t.value??t.valueText??t.value_text,u=r!=null?c.getProduct?.(r)||c.products?.[r]||c.products?.[String(r)]:null,g=u?.id??r,f=u?.productGraph??u?.product_graph??null,_=v.getState().productInstances?.[o]||null,w=_?.placementGroup??u?.placementGroup??u?.placement_group??null,N=_&&Number.isFinite(Number(_.sequence))?Number(_.sequence):void 0,O=Array.isArray(_?.position)?_.position:void 0;import("./a77b15c0d6.js").then(({addProduct:F})=>F({productGraphId:f,variantId:g,placementGroup:w,sequence:N,position:O,replace:!0,replacePlacementId:o})).catch(()=>{})}else i&&o!=null&&!String(o).endsWith("__host")?import("./a77b15c0d6.js").then(({selectOptionForProduct:c})=>c({placementId:o,optionSetId:t.optionSetId??t.option_set_id??e.feature_id??e.id,optionId:t.id})).catch(()=>{}):(ce(e,t,t.id),a(e.id,t.id))}export{ce as applyGlobalSwapViaGroup,Ee as selectOption,Ie as selectProductOption,D as selectionOwnsOptionSet};
|
package/dist/dc2a1a0e13.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import b from"./8f60e5059a.js";import
|
|
1
|
+
import b from"./8f60e5059a.js";import k from"./d94df858ea.js";import m from"./872c4302e0.js";import G,{deriveSceneFeatures as T}from"./be337ddda5.js";import _ from"./9c6c598569.js";import{resolveHostVariantId as B}from"./be07a7f885.js";function P(t){return Array.isArray(t)?t:typeof t=="string"&&t.trim()?[t]:t&&typeof t=="object"?Object.keys(t):[]}function j({placementId:t,optionSetId:o,optionId:s}){o==null||s==null||import("./a77b15c0d6.js").then(e=>{t!=null?e.selectOptionForProduct?.({placementId:t,optionSetId:o,optionId:s}):e.selectOptionForScene?.({optionSetId:o,optionId:s})}).catch(()=>{})}function H(){const t=k.getState().sceneSelections||{},o=m.getState().options||{},s=m.getState().products||{},e=G.getState().sceneConfigurations||{},a=_.getState().activeSceneConfigId,h=e[a];for(const v of T(h)){if(v?.type!=="load_new_product")continue;const g=t?.[v.id],f=g!=null?o?.[g]?.value:null;if(f==null)continue;const y=s[f]||s[String(f)];if(!y)continue;if(String(y.placement_group??y.placementGroup??"").includes("freestanding"))return f}return null}function W({option:t,feature:o,scope:s,pieceIndex:e}){if(!t)return{ok:!1,scope:null,wrote:0};if(t.value==null)return{ok:!1,scope:null,wrote:0};const a=o?.id??o?.feature_id;if(a==null)return{ok:!1,scope:null,wrote:0};const h=P(t?.materialSlots??t?.material_slots),v=P(o?.material_targets??o?.materialTargets??o?.materials),g=(h.length>0?h:v).map(n=>String(n).toLowerCase()).filter(Boolean);if(g.length===0)return{ok:!1,scope:null,wrote:0};const f=s==="single"||s==="all"?s:e?"single":"all";if(f==="single"&&!e)return{ok:!1,scope:null,wrote:0};if(f==="single"){const n=b.getState(),p=m.getState().products||{},l=m.getState().components||{},c=_.getState().productInstances?.[e];let i=n.hostProductOverrides?.[e]??n.basePiecePositions?.[e]?.productId??c?.variantId??c?.productId;if(i==null&&String(e).endsWith("__host")){const u=_.getState(),r=m.getState(),d=String(e).replace(/__host$/,""),O=u.productInstances?.[d],A=r.getProduct?.(O?.variantId??O?.productId);i=B(A,O)}i=i??H();const M=(i!=null?p[i]||p[String(i)]:null)?.components_configuration||{},w=new Set(g);let I=0;const F=Object.values(M).reduce((u,r)=>Array.isArray(r)?[...u,...r.map(d=>d?.componentId).filter(Boolean)]:(r&&typeof r=="object"&&r.componentId!=null&&u.push(r.componentId),u),[]);for(const u of F){const r=l[u]||l[String(u)],d=String(r?.materialSlot??r?.material_slot??"").toLowerCase();d&&w.has(d)&&(n.setHostMaterialOverride(e,d,t.value),I++)}return I>0&&j({placementId:e,optionSetId:Number(a),optionId:t.id}),{ok:I>0,scope:"single",wrote:I}}k.getState().setSceneSelection(a,t.id);const S={...b.getState().hostMaterialOverrides};let C=0;for(const n of Object.keys(S)){const p=S[n]||{};let l=null;for(const c of g)p[c]!=null&&(l||(l={...p}),delete l[c],C++);l&&(S[n]=l)}C>0&&b.setState({hostMaterialOverrides:S});try{const n=_.getState(),p=n.placementSelections||{};for(const[l,c]of Object.entries(p))if(c&&Object.prototype.hasOwnProperty.call(c,String(a))){const i={...c};delete i[String(a)],n.setPlacementSelections?.(l,i)}}catch{}return j({optionSetId:Number(a),optionId:t.id}),{ok:!0,scope:"all",wrote:0}}export{W as applyFinishClick,P as normalizeMaterialTargets};
|
package/dist/fbd844f2d1.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{shouldBlockRequest as y,requestBlockedError as
|
|
1
|
+
import{shouldBlockRequest as y,requestBlockedError as v}from"./631a9f7fac.js";import{authHeaders as S,isAuthFailure as w,reportAuthFailure as O,reportForbidden as b,getChannelId as p}from"./431a2d8618.js";import{ensureSessionToken as m,hasTokenProvider as k}from"./33fa2c8ca2.js";import{applyRequestInterceptors as E,applyResponseInterceptors as P,performRequest as T}from"./a3f18e76fe.js";import{getApiBaseUrl as C}from"./8ade32d067.js";import{assertLicensed as A}from"./fe235d7160.js";function g(e={}){const o=p();return o!=null?{...e,channelId:o}:e}async function d(e,o,{signal:i}={},s=!1){if(await A(e),y(e))throw v(e);await m();const r=E({path:e,url:`${C()}${e}`,method:"POST",headers:{"Content-Type":"application/json",...S(e)},body:o,init:void 0}),f=Date.now(),n=await T(r,c=>fetch(c.url,{method:"POST",headers:c.headers,body:JSON.stringify(c.body),signal:i}));if(w(n)){if(!s&&k())return await m({force:!0}),d(e,o,{signal:i},!0);await O(n,{url:e,method:"POST"})}n.status===403&&await b(n,{url:e,method:"POST"});let t=null;try{t=await n.json()}catch{t=null}const u=P({status:n.status,ok:n.ok,data:t||{},duration:Date.now()-f},r);return{status:u.status,ok:u.ok,data:u.data||{}}}async function j({systemId:e,presetId:o}={}){const{status:i,ok:s,data:r}=await d("/api/v1/configurations/initial/",g({systemId:e,...o!=null?{presetId:o}:{}}));if(!s)throw new Error(`initial configuration failed: ${i}`);return r}async function q({systemId:e,catalogVersion:o,state:i,mutation:s,idempotencyKey:r},{signal:f}={}){const{status:n,data:t}=await d("/api/v1/configurations/evaluate/",g({systemId:e,catalogVersion:o,state:i,mutation:s,...r?{idempotencyKey:r}:{}}),{signal:f}),u=new Set(["CONSTRAINT_NOT_IMPLEMENTED","STALE_SELECTION"]),c=a=>a&&typeof a=="object"?a.code??a.type:a,h=(t.warnings??[]).filter(a=>!u.has(String(c(a)??"").toUpperCase())),l=t.errorResponse&&typeof t.errorResponse=="object"?t.errorResponse:t;return{status:n,applied:n===200,rejected:n===422,staleCatalog:n===409||t.refetchCatalog===!0,blockingMutation:(l.blockingMutation??t.blockingMutation)===!0,code:l.code??t.code??null,system:t.system??null,pricing:t.pricing??null,resolvedState:t.resolvedState??null,optionVisibility:t.optionVisibility??null,optionSetVisibility:t.optionSetVisibility??null,optionAvailability:t.optionAvailability??null,defaultOptionOverrides:t.defaultOptionOverrides??null,fired:t.fired??[],selectionOverrides:t.selectionOverrides??[],removedPlacements:t.removedPlacements??null,addedPlacements:t.addedPlacements??null,messages:t.messages??l.messages??[],events:t.events??[],customEffects:t.customEffects??t.custom_effects??[],customDiagnostics:t.customDiagnostics??t.custom_diagnostics??l.customDiagnostics??[],errors:l.errors??t.errors??[],warnings:h,catalogVersion:t.catalogVersion??o??null,refetchCatalog:t.refetchCatalog===!0||n===409,previousState:l.previousState??t.previousState??null,schemaVersion:t.schemaVersion??null}}async function M(e){if(!Array.isArray(e)||e.length===0)return null;const o=p(),i={...o!=null?{channel:o}:{},items:e};try{const{ok:s,data:r}=await d("/api/v1/pricing/calculate/",i);return s?r:null}catch{return null}}export{M as calculatePricing,q as evaluateConfiguration,j as fetchInitialConfiguration};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@imagineio/configurator-sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"description": "Configurator SDK — backend Configuration Engine client, state stores, shared 3D scene primitives, and pluggable placement (strategy + type). Drives every configurator (kitchen, sectional, …) from one self-contained surface.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"type": "module",
|
|
@@ -36,26 +36,28 @@
|
|
|
36
36
|
"verify:publish": "node build/verify-publish.mjs"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@copilotkit/react-core": "
|
|
40
|
-
"@copilotkit/react-ui": "
|
|
41
|
-
"@gltf-transform/core": "4.
|
|
42
|
-
"@gltf-transform/extensions": "4.
|
|
43
|
-
"
|
|
39
|
+
"@copilotkit/react-core": "1.59.5",
|
|
40
|
+
"@copilotkit/react-ui": "1.59.5",
|
|
41
|
+
"@gltf-transform/core": "^4.5.1",
|
|
42
|
+
"@gltf-transform/extensions": "^4.5.1",
|
|
43
|
+
"lucide-react": "^0.525.0",
|
|
44
44
|
"html2canvas": "^1.4.1",
|
|
45
45
|
"jspdf": "^4.2.1",
|
|
46
|
-
"postprocessing": "6.36",
|
|
47
46
|
"qrcode": "^1.5.4",
|
|
48
47
|
"qrcode.react": "^4.2.0",
|
|
49
|
-
"uuid": "^
|
|
50
|
-
"zustand": "^
|
|
48
|
+
"uuid": "^14.0.3",
|
|
49
|
+
"zustand": "^5.0.16"
|
|
51
50
|
},
|
|
52
51
|
"peerDependencies": {
|
|
53
|
-
"@react-three/drei": "^9.88.0",
|
|
54
|
-
"@react-three/fiber": "^8.15.0",
|
|
55
|
-
"react": "^
|
|
56
|
-
"
|
|
57
|
-
"
|
|
52
|
+
"@react-three/drei": "^9.88.0 || ^10.7.0",
|
|
53
|
+
"@react-three/fiber": "^8.15.0 || ^9.6.0",
|
|
54
|
+
"@react-three/postprocessing": "^2.16.0 || ^3.2.0",
|
|
55
|
+
"postprocessing": "^6.36.0",
|
|
56
|
+
"react": "^18.2.0 || ^19.0.0",
|
|
57
|
+
"react-dom": "^18.2.0 || ^19.0.0",
|
|
58
|
+
"three": "^0.159.0 || ^0.185.0"
|
|
58
59
|
},
|
|
60
|
+
"peerDependenciesComment": "Two supported lines, picked by the consumer's React: React 19 -> fiber 9 / drei 10 / @react-three/postprocessing 3; React 18 -> fiber 8 / drei 9 / @react-three/postprocessing 2. Recommended three on BOTH lines is 0.186 (drei 9 / fiber 8 accept it; one three means one HDRI prefilter and one lighting result - 0.159 lights the same HDR visibly differently, its PMREM was rewritten in r16x). The original React 18 stack (three 0.159) stays installable by naming it, with postprocessing pinned ~6.36 because 6.39+ needs three >=0.168. The || operator only widens what is ACCEPTED: npm resolves each range to its highest match independently, so an empty project gets the React 19 line and a React 18 project must name its whole line in one install command (README). The two postprocessing packages are peers, not dependencies, because their major follows the React line; the dist bundles import both dynamically and leave them external.",
|
|
59
61
|
"devDependencies": {
|
|
60
62
|
"javascript-obfuscator": "^5.7.0",
|
|
61
63
|
"tsup": "^8.5.1",
|