@viamedici-spc/configurator-framer 2.2.0-alpha0004 → 2.2.0-alpha0005
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -235,7 +235,7 @@ ${c}`);case h.ConfiguratorErrorType.SessionParametersInvalid:return o(`Configura
|
|
|
235
235
|
`;function Ms(e){return f.jsx(ks,{...e,initial:{backgroundColor:"rgba(0,0,0,0)"},animate:{backgroundColor:"rgba(0,0,0,0.1)"},exit:{backgroundColor:"rgba(0,0,0,0)"}})}function Fs(e){const[t,n]=T.useState(null),{explain:o,applySolution:i}=U.useExplain(),r=T.useRef(null),l=T.useCallback(async(u,b,w,y)=>{const m=Ji.guid();r.current=m,n(null);try{const v=await u(),P=v,S=v,I=(P==null?void 0:P.decisionExplanations)??[],R=(S==null?void 0:S.constraintExplanations)??[];m==r.current&&n({controlId:y,displayMode:I.length===0&&R.length>0?"dialog":w,explainQuestion:b,hasError:!1,decisionExplanations:Ls(I),constraintExplanations:R})}catch{m==r.current&&n({controlId:y,displayMode:w,explainQuestion:b,hasError:!0,decisionExplanations:null,constraintExplanations:null})}},[]),s=T.useCallback((u,b,w)=>{const y=typeof u=="function"?u(h.explainQuestionBuilder):u;return l(()=>e.explainConstraints?o(y,"full"):o(y,"decisions"),y,b,w)},[e.explainConstraints,o,l]),a=T.useCallback((u,b,w)=>l(()=>Promise.resolve(u),null,b,w),[l]),c=T.useCallback(()=>{n(null)},[]),x=T.useCallback(u=>(c(),i(u)),[i,c]),g=T.useCallback(u=>{n(b=>b!=null?{...b,displayMode:u}:b)},[]),C=T.useMemo(()=>({process:t,applySolution:x,explain:s,handleExplainAnswer:a,dismiss:c,switchMode:g}),[t,x,s,a,c,g]);return f.jsx(He.Provider,{value:C,children:e.children})}function Ls(e){const t=p.pipe(p.Bool.Ord,p.Ord.contramap(o=>o.solution==null)),n=p.pipe(p.Num.Ord,p.Ord.contramap(o=>o.causedByDecisions.length));return p.pipe(e,p.RA.sortBy([t,n]))}const Le=new Map;function bt(e){const{singletonId:t,children:n}=e,[o,i]=T.useState(!1),r=T.useRef({chose:()=>i(!0)});return T.useEffect(()=>(Ns(t,r.current),()=>Bs(t,r.current)),[]),o?f.jsx(f.Fragment,{children:n}):null}function Ns(e,t){zs(e).candidates.add(t),fi(e)}function Bs(e,t){let n=Le.get(e);n!=null&&(n.candidates.delete(t),n.chosen===t&&(n.chosen=null),$s(e),fi(e))}function fi(e){let t=Le.get(e);if(t==null||t.chosen!=null)return;const n=t.candidates.values().next().value;n!=null&&(t.chosen=n,n.chose())}function $s(e){let t=Le.get(e);t==null||t.candidates.size>0||Le.delete(e)}function zs(e){let t=Le.get(e);return t==null&&(t={chosen:null,candidates:new Set},Le.set(e,t)),t}const oe={attributeId:{title:"Attribute Id",type:d.ControlType.String},componentPath:{title:"Component Path",type:d.ControlType.String},sharedConfigurationModel:{title:"Shared Configuration Model",type:d.ControlType.String}},_n={description:{title:"Description",type:d.ControlType.String},regex:{title:"Regex",type:d.ControlType.String},direction:{title:"Direction",type:d.ControlType.Enum,defaultValue:"asc",options:["asc","desc"],displaySegmentedControl:!0},mode:{title:"Mode",type:d.ControlType.Enum,defaultValue:"isMatch",options:["isMatch","string","numeric"]}},Ws={choiceValueSorting:{title:"Choice Value Sorting",type:d.ControlType.Object,defaultValue:null,buttonTitle:"Definition…",controls:{defaultRules:{title:"Default Rules",type:d.ControlType.Array,control:{type:d.ControlType.Object,controls:_n}},attributes:{title:"Attribute",type:d.ControlType.Array,control:{type:d.ControlType.Object,controls:{...oe,choiceValues:{title:"Choice Values",type:d.ControlType.Array,control:{type:d.ControlType.String}},rules:{title:"Rules",type:d.ControlType.Array,control:{type:d.ControlType.Object,controls:_n}}}}},jsonDefinition:{title:"Definition – JSON",type:d.ControlType.String,displayTextArea:!0}}}};function Ks(e,t){const n=[],o=(r,l)=>{const s=n.find(c=>e.equals(c.first,r)&&e.equals(c.second,l));if(s)return s.ordering;const a=t.compare(r,l);return n.push({first:r,second:l,ordering:a}),a},i=p.Ord.fromCompare(o);return{cachedOrderings:n,...i}}function qs(){const e=[];return{getCache:(t,n)=>{const o=e.find(r=>r.eq===t&&r.ord===n);if(o)return o.ordCache;const i=Ks(t,n);return e.push({eq:t,ord:n,ordCache:i}),i}}}const pi=p.Ord.getMonoid(),Hs=new Intl.Collator("en",{sensitivity:"base"}),_s=new Intl.Collator("en",{sensitivity:"variant"}),Us={regex:".*",direction:"asc",mode:"string"},Qs=p.pipe([Hs,_s],p.RA.map(na),p.MO.concatAll(p.Ord.getMonoid())),Ys=p.pipe(p.Bool.Ord,p.Ord.contramap(e=>p.O.isSome(e))),Gs=p.Num.Ord;function Xs(e,t){return p.pipe((t==null?void 0:t.attributes)??[],p.RA.findFirst(n=>h.globalAttributeIdEq.equals(Z(n),e)),p.O.map(n=>[Js(n.choiceValues??[]),Un(n.rules??[])]),p.O.getOrElse(()=>[Un((t==null?void 0:t.defaultRules)??[])]),p.RA.append(hi(Us)),p.MO.concatAll(pi))}function Js(e){return p.pipe(p.Num.Ord,p.Ord.reverse,p.O.getOrd,p.Ord.reverse,p.Ord.contramap(t=>p.pipe(e,p.RA.findIndex(n=>p.Str.Eq.equals(t,n)))))}function Un(e){return p.pipe(e,p.RA.map(hi),p.MO.concatAll(pi))}function hi(e){const t=p.O.tryCatch(()=>new RegExp(e.regex)),n=N.match(e.mode).returnType().with("string",()=>Zs(e.direction)).with("numeric",()=>ea(e.direction)).with("isMatch",()=>ta(e.direction)).exhaustive();return p.pipe(n,p.Ord.contramap(o=>p.pipe(t,p.O.chainNullableK(i=>(i.lastIndex=0,i[Symbol.match](o))),p.O.chain(i=>p.pipe(i,p.RA.lookup(1),p.O.alt(()=>p.pipe(i,p.RA.lookup(0))))))))}function Zs(e){return p.pipe(Qs,hn(e),gi)}function ea(e){return p.pipe(Gs,hn(e),gi,p.Ord.contramap(p.O.chain(p.Num.parseFloatO)))}function ta(e){return p.pipe(Ys,hn(e))}function gi(e){return p.pipe(e,p.Ord.reverse,p.O.getOrd,p.Ord.reverse)}function hn(e){return t=>N.match(e).returnType().with("asc",()=>t).with("desc",()=>p.Ord.reverse(t)).exhaustive()}function na(e){return p.Ord.fromCompare((t,n)=>N.match(e.compare(t,n)).returnType().with(N.P.number.gt(0),()=>1).with(N.P.number.lt(0),()=>-1).otherwise(()=>0))}const oa=qs(),mi=T.createContext(null);function xt(e,t){const n=T.useContext(mi),o=T.useMemo(()=>p.pipe(Xs(e,n),r=>oa.getCache(p.Str.Eq,r),p.Ord.contramap(r=>r.id)),[]),{attribute:i}=U.useChoiceAttribute(e);return p.pipe(t??(i==null?void 0:i.values)??[],p.RA.sort(o))}const ia={localization:{title:"Localization",type:d.ControlType.Object,defaultValue:null,buttonTitle:"Definition…",controls:{jsonDefinition:{title:"Definition – JSON",type:d.ControlType.String,displayTextArea:!0}}}};globalThis&&globalThis.__spreadArray;function ra(e){return e}globalThis&&globalThis.__spreadArray;var la=function(e){return{_tag:"Left",left:e}},sa=function(e){return{_tag:"Right",right:e}},aa=la,ca=sa,ua=function(e,t){try{return ca(e())}catch(n){return aa(t(n))}},da=function(e){return ua(function(){return JSON.parse(e)},ra)};const Ct=J.z.object({localId:J.z.string(),componentPath:J.z.string().array().optional().nullish(),sharedConfigurationModelId:J.z.string().optional().nullish()});function yi(e){var t;return{sharedConfigurationModel:e.sharedConfigurationModelId??"",componentPath:((t=e.componentPath)==null?void 0:t.join(" -> "))??"",attributeId:e.localId}}function gn(e,t,n){return o=>T.useMemo(()=>p.pipe(o,p.O.fromNullable,p.O.filter(p.P.not(p.Str.isEmpty)),p.E.fromOption(()=>null),p.E.chain(p.flow(da,p.E.mapLeft(i=>`The JSON content could not be parsed. Please check for syntax errors.
|
|
236
236
|
`+i.toString()),p.E.chain(i=>p.pipe(t.safeParse(i),r=>r.success?p.E.right(r.data):p.E.left(r.error),p.E.mapLeft(r=>Zi.fromError(r,{maxIssuesInMessage:5,issueSeparator:`
|
|
237
237
|
- `})),p.E.mapLeft(r=>`The JSON schema is invalid. Ensure all required fields and types are correctly defined.
|
|
238
|
-
`+r.toString()))),p.E.map(n),p.E.mapLeft(i=>f.jsx(yo,{type:"warning",title:e+" definition is invalid and was ignored",message:i}))))),[o])}const bi=J.z.object({attributeId:Ct,name:J.z.array(J.z.object({localeCode:J.z.string(),translation:J.z.string()}))}),fa=bi.extend({choiceValueId:J.z.string()}),pa=J.z.object({attributes:bi.array().optional().nullish(),choiceValues:fa.array().optional().nullish()});function Qn(e){return{...yi(e.attributeId),name:p.pipe(e.name,p.RA.map(t=>t),p.RA.toArray)}}function ha(e){const t=p.pipe(e.attributes??[],p.RA.map(Qn),p.RA.toArray),n=p.pipe(e.choiceValues??[],p.RA.map(o=>({...Qn(o),choiceValueId:o.choiceValueId})),p.RA.toArray);return{attributes:t,choiceValues:n}}const ga=gn("Localization",pa,ha),ma=ga,Yn=J.z.object({regex:J.z.string(),direction:J.z.enum(["asc","desc"]),mode:J.z.enum(["isMatch","string","numeric"]),description:J.z.string().optional()}),ya=J.z.object({defaultRules:Yn.array().optional().nullish(),attributes:J.z.object({attributeId:Ct,choiceValues:J.z.string().array(),rules:Yn.array()}).array().optional().nullish()});function ba(e){const t=p.pipe(e.defaultRules??[],p.RA.map(o=>o),p.RA.toArray);return{attributes:p.pipe(e.attributes??[],p.RA.map(o=>({...yi(o.attributeId),choiceValues:p.RA.toArray(o.choiceValues),rules:p.pipe(o.rules,p.RA.map(i=>i),p.RA.toArray)})),p.RA.toArray),defaultRules:t}}const xa=gn("ChoiceValueSorting",ya,ba),Ca=xa,va=J.z.object({attributeId:Ct,decisions:Ct.array()}),wa=va.array(),Sa=gn("AttributeRelations",wa,e=>e),Ta=Sa,Ea={wizardAttributeRelations:{title:"Wizard Attribute Relations",type:d.ControlType.Object,defaultValue:null,buttonTitle:"Definition…",controls:{wizardSteps:{title:"Wizard Steps",type:d.ControlType.Array,control:{type:d.ControlType.Object,controls:{name:{title:"Name",type:d.ControlType.String},attributes:{title:"Attributes",type:d.ControlType.Array,control:{type:d.ControlType.Object,controls:oe}}}}}}}},xi=ae(e=>{var D,O,j,A;const{hcaBaseUrl:t,sessionCreation:n,accessToken:o,sessionCreateUrl:i,sessionDeleteUrl:r,deploymentName:l,channel:s,children:a,explainDialogProps:c,explainPopoverProps:x,explainConstraints:g}=e,{activeLocale:C}=d.useLocaleInfo(),u=C.code;if(T.useEffect(()=>{console.info("Current locale code:",u)},[u]),G())return f.jsxs(f.Fragment,{children:[a,f.jsx(bt,{singletonId:"Configuration",children:f.jsx(Cn,{})})]});const w=Ta((D=e.attributeRelations)==null?void 0:D.jsonDefinition),y=T.useMemo(()=>p.pipe(w,p.O.fromEither,p.O.toNullable),[w]),m=Ca((O=e.choiceValueSorting)==null?void 0:O.jsonDefinition),v=T.useMemo(()=>p.pipe(m,p.E.orElse(()=>p.pipe(e.choiceValueSorting,p.E.fromNullable(null))),p.E.getOrElse(()=>({attributes:[],defaultRules:[]}))),[m,e.choiceValueSorting]),P=ma((j=e.localization)==null?void 0:j.jsonDefinition),S=T.useMemo(()=>p.pipe(P,p.E.getOrElse(()=>({attributes:[],choiceValues:[]}))),[P]),I=p.pipe((A=e.wizardAttributeRelations)==null?void 0:A.wizardSteps,p.O.fromNullable,p.O.filter(p.RA.isNonEmpty),p.O.map(p.RA.map(F=>({attributes:p.pipe(F.attributes,p.RA.map(Z))}))),p.O.toNullable),R=T.useMemo(()=>({apiBaseUrl:Yi(t,"api","engine"),sessionInitialisationOptions:N.match(n).with("client-side",()=>({accessToken:o})).with("server-side",()=>({sessionCreateUrl:i})).exhaustive(),configurationModelSource:{type:h.ConfigurationModelSourceType.Channel,channel:s,deploymentName:l},attributeRelations:y,wizardAttributeRelations:I,allowedInExplain:{rules:{type:h.AllowedRulesInExplainType.all}}}),[t,n,o,i,r,s,l,y]);return f.jsxs(f.Fragment,{children:[f.jsxs(U.Configuration,{sessionContext:R,children:[p.pipe(P,p.E.swap,p.O.fromEither,p.O.toNullable),p.pipe(m,p.E.swap,p.O.fromEither,p.O.toNullable),p.pipe(w,p.E.swap,p.O.fromEither,p.O.toNullable),f.jsx(dr,{...e}),f.jsx(T.Suspense,{children:f.jsx(Et.Provider,{value:S,children:f.jsxs(Fs,{explainConstraints:g,children:[f.jsx(en.Provider,{value:x,children:f.jsx(mi.Provider,{value:v,children:a})}),f.jsx(Vs,{...c})]})})})]}),f.jsx(bt,{singletonId:"Configuration",children:f.jsx(Cn,{})})]})}),Aa=xi;d.addPropertyControls(xi,{children:{title:"Content",type:d.ControlType.ComponentInstance},channel:{type:d.ControlType.String,title:"Channel",defaultValue:"release"},deploymentName:{type:d.ControlType.String,title:"Deployment Name"},hcaBaseUrl:{title:"HCA Base URL",type:d.ControlType.String,defaultValue:"https://spc.
|
|
238
|
+
`+r.toString()))),p.E.map(n),p.E.mapLeft(i=>f.jsx(yo,{type:"warning",title:e+" definition is invalid and was ignored",message:i}))))),[o])}const bi=J.z.object({attributeId:Ct,name:J.z.array(J.z.object({localeCode:J.z.string(),translation:J.z.string()}))}),fa=bi.extend({choiceValueId:J.z.string()}),pa=J.z.object({attributes:bi.array().optional().nullish(),choiceValues:fa.array().optional().nullish()});function Qn(e){return{...yi(e.attributeId),name:p.pipe(e.name,p.RA.map(t=>t),p.RA.toArray)}}function ha(e){const t=p.pipe(e.attributes??[],p.RA.map(Qn),p.RA.toArray),n=p.pipe(e.choiceValues??[],p.RA.map(o=>({...Qn(o),choiceValueId:o.choiceValueId})),p.RA.toArray);return{attributes:t,choiceValues:n}}const ga=gn("Localization",pa,ha),ma=ga,Yn=J.z.object({regex:J.z.string(),direction:J.z.enum(["asc","desc"]),mode:J.z.enum(["isMatch","string","numeric"]),description:J.z.string().optional()}),ya=J.z.object({defaultRules:Yn.array().optional().nullish(),attributes:J.z.object({attributeId:Ct,choiceValues:J.z.string().array(),rules:Yn.array()}).array().optional().nullish()});function ba(e){const t=p.pipe(e.defaultRules??[],p.RA.map(o=>o),p.RA.toArray);return{attributes:p.pipe(e.attributes??[],p.RA.map(o=>({...yi(o.attributeId),choiceValues:p.RA.toArray(o.choiceValues),rules:p.pipe(o.rules,p.RA.map(i=>i),p.RA.toArray)})),p.RA.toArray),defaultRules:t}}const xa=gn("ChoiceValueSorting",ya,ba),Ca=xa,va=J.z.object({attributeId:Ct,decisions:Ct.array()}),wa=va.array(),Sa=gn("AttributeRelations",wa,e=>e),Ta=Sa,Ea={wizardAttributeRelations:{title:"Wizard Attribute Relations",type:d.ControlType.Object,defaultValue:null,buttonTitle:"Definition…",controls:{wizardSteps:{title:"Wizard Steps",type:d.ControlType.Array,control:{type:d.ControlType.Object,controls:{name:{title:"Name",type:d.ControlType.String},attributes:{title:"Attributes",type:d.ControlType.Array,control:{type:d.ControlType.Object,controls:oe}}}}}}}},xi=ae(e=>{var D,O,j,A;const{hcaBaseUrl:t,sessionCreation:n,accessToken:o,sessionCreateUrl:i,sessionDeleteUrl:r,deploymentName:l,channel:s,children:a,explainDialogProps:c,explainPopoverProps:x,explainConstraints:g}=e,{activeLocale:C}=d.useLocaleInfo(),u=C.code;if(T.useEffect(()=>{console.info("Current locale code:",u)},[u]),G())return f.jsxs(f.Fragment,{children:[a,f.jsx(bt,{singletonId:"Configuration",children:f.jsx(Cn,{})})]});const w=Ta((D=e.attributeRelations)==null?void 0:D.jsonDefinition),y=T.useMemo(()=>p.pipe(w,p.O.fromEither,p.O.toNullable),[w]),m=Ca((O=e.choiceValueSorting)==null?void 0:O.jsonDefinition),v=T.useMemo(()=>p.pipe(m,p.E.orElse(()=>p.pipe(e.choiceValueSorting,p.E.fromNullable(null))),p.E.getOrElse(()=>({attributes:[],defaultRules:[]}))),[m,e.choiceValueSorting]),P=ma((j=e.localization)==null?void 0:j.jsonDefinition),S=T.useMemo(()=>p.pipe(P,p.E.getOrElse(()=>({attributes:[],choiceValues:[]}))),[P]),I=p.pipe((A=e.wizardAttributeRelations)==null?void 0:A.wizardSteps,p.O.fromNullable,p.O.filter(p.RA.isNonEmpty),p.O.map(p.RA.map(F=>({attributes:p.pipe(F.attributes,p.RA.map(Z))}))),p.O.toNullable),R=T.useMemo(()=>({apiBaseUrl:Yi(t,"api","engine"),sessionInitialisationOptions:N.match(n).with("client-side",()=>({accessToken:o})).with("server-side",()=>({sessionCreateUrl:i})).exhaustive(),configurationModelSource:{type:h.ConfigurationModelSourceType.Channel,channel:s,deploymentName:l},attributeRelations:y,wizardAttributeRelations:I,allowedInExplain:{rules:{type:h.AllowedRulesInExplainType.all}}}),[t,n,o,i,r,s,l,y]);return f.jsxs(f.Fragment,{children:[f.jsxs(U.Configuration,{sessionContext:R,children:[p.pipe(P,p.E.swap,p.O.fromEither,p.O.toNullable),p.pipe(m,p.E.swap,p.O.fromEither,p.O.toNullable),p.pipe(w,p.E.swap,p.O.fromEither,p.O.toNullable),f.jsx(dr,{...e}),f.jsx(T.Suspense,{children:f.jsx(Et.Provider,{value:S,children:f.jsxs(Fs,{explainConstraints:g,children:[f.jsx(en.Provider,{value:x,children:f.jsx(mi.Provider,{value:v,children:a})}),f.jsx(Vs,{...c})]})})})]}),f.jsx(bt,{singletonId:"Configuration",children:f.jsx(Cn,{})})]})}),Aa=xi;d.addPropertyControls(xi,{children:{title:"Content",type:d.ControlType.ComponentInstance},channel:{type:d.ControlType.String,title:"Channel",defaultValue:"release"},deploymentName:{type:d.ControlType.String,title:"Deployment Name"},hcaBaseUrl:{title:"HCA Base URL",type:d.ControlType.String,defaultValue:"https://spc.viamedici.io/hca"},sessionCreation:{title:"Session Creation",type:d.ControlType.Enum,displaySegmentedControl:!0,segmentedControlDirection:"horizontal",defaultValue:"client-side",options:["client-side","server-side"]},accessToken:{title:"HCA Access Token",type:d.ControlType.String,obscured:!0,hidden:e=>e.sessionCreation!=="client-side"},sessionCreateUrl:{title:"Create Session URl",type:d.ControlType.String,hidden:e=>e.sessionCreation!=="server-side"},sessionDeleteUrl:{title:"Close Session URl",type:d.ControlType.String,hidden:e=>e.sessionCreation!=="server-side"},configurationModelNotFoundContent:{title:"Content – Configuration Model not found",type:d.ControlType.ComponentInstance},errorContent:{title:"Content – Error",type:d.ControlType.ComponentInstance},accessTokenInvalidContent:{title:"Content – HCA Access Token invalid",type:d.ControlType.ComponentInstance},accessTokenRestrictionContent:{title:"Content – HCA Access Token restriction",type:d.ControlType.ComponentInstance},explainDialogProps:{title:"Explain Dialog",type:d.ControlType.Object,optional:!1,controls:Cr,buttonTitle:"Props…"},explainPopoverProps:{title:"Explain Popover",type:d.ControlType.Object,optional:!1,controls:xr,buttonTitle:"Props…"},explainConstraints:{title:"Explain Constraints",type:d.ControlType.Boolean,defaultValue:!1},attributeRelations:{title:"Attribute Relations",type:d.ControlType.Object,defaultValue:null,buttonTitle:"Definition…",controls:{jsonDefinition:{title:"Definition – JSON",type:d.ControlType.String,displayTextArea:!0}}},...Ea,...Ws,...ia});const $e={explain:{title:"Explain",type:d.ControlType.Enum,defaultValue:"popover",options:["popover","dialog","disabled"]}},Jt={type:d.ControlType.Object,optional:!0,controls:{fill:{title:"Fill",type:d.ControlType.Color,optional:!0},color:{title:"Color",type:d.ControlType.Color,optional:!0},borderColor:{title:"Border Color",type:d.ControlType.Color,optional:!0}}},Ci={...oe,...de({color:"black",text:{fontSize:16,textAlign:"left"}}),..._e({fill:"#EBEBEB",radius:6}),implicitLabelPrefix:{title:"Implicit Label Prefix",type:d.ControlType.String,defaultValue:"Implicit: "},unsatisfiedColors:{...Jt,title:"Unsatisfied Colors"},implicitSelectedColors:{...Jt,title:"Implicit Selected Colors"},...$e},Zt=(e,t,n)=>{var r,l,s,a,c,x;const o=Be(e),i=fe(e);return{...o,...i,backgroundColor:N.match({isSatisfied:t,isImplicitSelected:n,unsatisfiedFill:(r=e.unsatisfiedColors)==null?void 0:r.fill,implicitSelectedFill:(l=e.implicitSelectedColors)==null?void 0:l.fill}).with({isSatisfied:!1,unsatisfiedFill:N.P.string.minLength(1)},g=>g.unsatisfiedFill).with({isImplicitSelected:!0,implicitSelectedFill:N.P.string.minLength(1)},g=>g.implicitSelectedFill).otherwise(()=>o.backgroundColor),borderColor:N.match({isSatisfied:t,isImplicitSelected:n,unsatisfiedBorderColor:(s=e.unsatisfiedColors)==null?void 0:s.borderColor,implicitSelectedBorderColor:(a=e.implicitSelectedColors)==null?void 0:a.borderColor}).with({isSatisfied:!1,unsatisfiedBorderColor:N.P.string.minLength(1)},g=>g.unsatisfiedBorderColor).with({isImplicitSelected:!0,implicitSelectedBorderColor:N.P.string.minLength(1)},g=>g.implicitSelectedBorderColor).otherwise(()=>o.borderColor),color:N.match({isSatisfied:t,isImplicitSelected:n,unsatisfiedColor:(c=e.unsatisfiedColors)==null?void 0:c.color,implicitSelectedColor:(x=e.implicitSelectedColors)==null?void 0:x.color}).with({isSatisfied:!1,unsatisfiedColor:N.P.string.minLength(1)},g=>g.unsatisfiedColor).with({isImplicitSelected:!0,implicitSelectedColor:N.P.string.minLength(1)},g=>g.implicitSelectedColor).otherwise(()=>i.color),...e.style}},mn={...Ci,resetLabel:{title:"Reset Label",type:d.ControlType.String,defaultValue:"Reset"},blockedLabel:{title:"Blocked Label",type:d.ControlType.String,defaultValue:"Blocked"},appearance:{title:"Appearance",type:d.ControlType.Enum,defaultValue:"auto",displaySegmentedControl:!0,segmentedControlDirection:"horizontal",options:["auto","none"]}},Ne=(e,t,n)=>({...Zt(e,t,n),appearance:e.appearance});function he(){const{explain:e,handleExplainAnswer:t}=T.useContext(He);return{explain:e,handleExplainAnswer:t}}function Ia(e={}){const{initialOpen:t=!1,placement:n="top",modal:o=!1,open:i,onOpenChange:r,arrow:l}=e,[s,a]=T.useState(t),c=i??s,x=r??a,g=ri({placement:n,open:c,onOpenChange:x,whileElementsMounted:Sl,middleware:[ll(((l==null?void 0:l.height)??0)+5),El({crossAxis:n.includes("-"),fallbackAxisSideDirection:"end",padding:5}),Tl({padding:5}),...l?[Il(l)]:[]]}),C=g.context,u=oi(C,{enabled:i==null}),b=ii(C),w=li([u,b]);return T.useMemo(()=>({open:c,setOpen:x,...w,...g,modal:o,arrow:l}),[c,x,w,g,o,l])}const vi=T.createContext(null),et=()=>{const e=T.useContext(vi);if(e==null)throw new Error("Popover components must be wrapped in <Popover />");return e};function Ra({children:e,...t}){const n=Ia(t);return f.jsx(vi.Provider,{value:n,children:e})}const Pa=T.forwardRef(function(t,n){const o=T.Children.toArray(t.children)[0],i=et(),r=t.children.ref,l=un([i.refs.setReference,n,r]);return T.isValidElement(o)?T.cloneElement(o,i.getReferenceProps({ref:l,...t,...o.props,"data-state":i.open?"open":"closed"})):f.jsx("span",{children:"Not valid children for PopoverTrigger"})}),Oa=Pa,Da=k.button`
|
|
239
239
|
appearance: none;
|
|
240
240
|
border: none;
|
|
241
241
|
text-decoration: underline;
|
package/dist/index.js
CHANGED
|
@@ -4305,7 +4305,7 @@ ee(sr, {
|
|
|
4305
4305
|
hcaBaseUrl: {
|
|
4306
4306
|
title: "HCA Base URL",
|
|
4307
4307
|
type: f.String,
|
|
4308
|
-
defaultValue: "https://spc.
|
|
4308
|
+
defaultValue: "https://spc.viamedici.io/hca"
|
|
4309
4309
|
},
|
|
4310
4310
|
sessionCreation: {
|
|
4311
4311
|
title: "Session Creation",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@viamedici-spc/configurator-framer",
|
|
3
|
-
"version": "2.2.0-
|
|
3
|
+
"version": "2.2.0-alpha0005",
|
|
4
4
|
"description": "Component library to build configurator apps with Framer based on Viamedici SPC.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"@fortawesome/free-regular-svg-icons": "^6.5.1",
|
|
69
69
|
"@fortawesome/free-solid-svg-icons": "^6.5.1",
|
|
70
70
|
"@fortawesome/react-fontawesome": "^0.2.0",
|
|
71
|
-
"@viamedici-spc/configurator-react": "3.0.
|
|
71
|
+
"@viamedici-spc/configurator-react": "3.0.1",
|
|
72
72
|
"@viamedici-spc/fp-ts-extensions": "^1.2.0",
|
|
73
73
|
"camelcase": "^8.0.0",
|
|
74
74
|
"clsx": "^2.1.0",
|