@plitzi/plitzi-sdk 0.35.5 → 0.35.7

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/CHANGELOG.md CHANGED
@@ -1,5 +1,61 @@
1
1
  # @plitzi/plitzi-sdk
2
2
 
3
+ ## 0.35.7
4
+
5
+ ### Patch Changes
6
+
7
+ - An SMTP failure says which credential it was, and a credential's values can be replaced from the builder.
8
+
9
+ - **`email.send` names the credential it could not send through:** `Could not send through the SMTP credential
10
+ "ceniza-smtp": its SMTP host is on a private network…`. The host used to be in the sentence, and a run's trace
11
+ redacts every value of a credential it resolved, so the message read `The SMTP host "«redacted»"…`.
12
+ - **Credentials can be edited in the builder.** A pencil on each row opens the form with the name and the provider
13
+ fixed and nothing it holds shown: every value is entered again, and saving replaces all of them. SMTP credentials
14
+ are also labelled in the list.
15
+
16
+ - Updated dependencies
17
+ - @plitzi/sdk-auth@0.35.7
18
+ - @plitzi/sdk-dev-tools@0.35.7
19
+ - @plitzi/sdk-elements@0.35.7
20
+ - @plitzi/sdk-event-bridge@0.35.7
21
+ - @plitzi/sdk-interactions@0.35.7
22
+ - @plitzi/sdk-navigation@0.35.7
23
+ - @plitzi/sdk-plugins@0.35.7
24
+ - @plitzi/sdk-schema@0.35.7
25
+ - @plitzi/sdk-shared@0.35.7
26
+ - @plitzi/sdk-style@0.35.7
27
+ - @plitzi/sdk-variables@0.35.7
28
+
29
+ ## 0.35.6
30
+
31
+ ### Patch Changes
32
+
33
+ - A failed server action can give back what it already did.
34
+
35
+ - **`flow.onFailure` ("On Failure") marks where the undo begins.** A run that reaches it has succeeded and ends there.
36
+ A run whose step failed jumps to it and runs the steps after it, in order, each still asking its own `when` — the
37
+ failure may have come before the thing to undo was ever done — with `{{ failure.step }}` and `{{ failure.message }}`
38
+ in scope. The run still ends failed, with the failure it had; an undo step that fails too is added to it.
39
+ - **The undo runs on its own clock and budget:** 5 seconds (or the run's own timeout if shorter) and its own outbound
40
+ request budget, because the run's may be exactly what ran out, and a caller closing the connection does not stop it.
41
+ A run that hit its deadline is undone too.
42
+ - **`defineAction` writes it from `onFailure: [...]`**, after the answer. `validateActionDocument` refuses an output
43
+ step or a second handler after one, warns about a handler with nothing to undo or nothing that undoes, and reserves
44
+ `failure` as a step id. `FAILURE_HANDLER_TASK` is exported from `@plitzi/sdk-shared/actions`.
45
+
46
+ - Updated dependencies
47
+ - @plitzi/sdk-auth@0.35.6
48
+ - @plitzi/sdk-dev-tools@0.35.6
49
+ - @plitzi/sdk-elements@0.35.6
50
+ - @plitzi/sdk-event-bridge@0.35.6
51
+ - @plitzi/sdk-interactions@0.35.6
52
+ - @plitzi/sdk-navigation@0.35.6
53
+ - @plitzi/sdk-plugins@0.35.6
54
+ - @plitzi/sdk-schema@0.35.6
55
+ - @plitzi/sdk-shared@0.35.6
56
+ - @plitzi/sdk-style@0.35.6
57
+ - @plitzi/sdk-variables@0.35.6
58
+
3
59
  ## 0.35.5
4
60
 
5
61
  ### Patch Changes
@@ -575,7 +575,7 @@ return Ee(_E,{value:a,children:e})},WP={runServerAction:{source:"actions",title:
575
575
  /* @__PURE__ */Ee("b",{children:n})," was refused"]}),{actionId:n,mode:i,runId:f.runId,reason:f.reason,error:f.error,status:String(p.status)}),{status:"failed",reason:f.reason??"failed",runId:f.runId??"",output:{}})},[r,o]),l=he(async e=>{if(!r||!e.runId)return{cancelled:!1};try{let t=204===(await fetch(`${r}/run/${e.runId}`,{method:"DELETE",credentials:"same-origin"})).status;return Gp.info("actions",/* @__PURE__ */Ie("span",{children:["Server action run ",
576
576
  /* @__PURE__ */Ee("b",{children:e.runId})," ",t?"cancelled":"was not cancelled"]}),{actionId:"",mode:"cancel",runId:e.runId,status:t?"aborted":"failed"}),{cancelled:t}}catch{return{cancelled:!1}}},[r]),u=ve(()=>(i??[]).map(e=>({label:`${e.name} (${e.identifier})`,value:e.identifier})),[i]);return t({id:"actions",callbacks:ve(()=>ef(WP,{cancelServerAction:l,runServerAction:s},{runServerAction:{params:e=>{let t=Xh(WP.runServerAction.params),n=(i??[]).find(t=>t.identifier===e.actionId),r=Object.entries(n?.input??{});return{...t,actionId:{...t.actionId,type:()=>u.length>0?"select":"text",canBind:!0,label:!1===a?"Action — this space has no server to run it":"Action",options:u},input:{...t.input,canBind:!0,label:r.length>0?`Input — ${r.map(([e,t])=>`${e}${t.required?"*":""}: ${t.type}`).join(", ")}`:"Input"}}}}}),[s,l,u,i,a])}),e},YP={login:{source:"auth",title:"Auth Login",strictParams:!0,params:{mode:{type:"select",description:"Credentials to sign in with: a username and password, or a token obtained elsewhere.",default:"normal",options:["normal","token"],optionLabels:{normal:"User and Password",token:"Token"},canBind:!1},username:{type:"text",description:"Username.",default:"",when:e=>"normal"===e.mode},password:{type:"text",description:"Password.",default:"",when:e=>"normal"===e.mode},token:{type:"text",description:"A token to exchange for a session.",default:"",when:e=>"token"===e.mode}},preview:{ok:"",reason:"",errors:{username:"",password:"",token:""},accessToken:"",expiresAt:"",refreshToken:""}},refreshDetails:{source:"auth",title:"Auth Refresh Details",strictParams:!0,params:{},preview:{errors:"",accessToken:"",expiresAt:"",refreshToken:""}},logout:{source:"auth",title:"Auth Logout",strictParams:!0,params:{}}},XP=({children:e,authProvider:t="basic"})=>{let{login:n,refresh:r,logout:i}=pe(xE),{useInteractions:a}=pe(_E),o=he(e=>n(e),[n]),s=he(e=>r(e),[r]),l=he(()=>i(),[i]);return a({id:"auth",callbacks:ve(()=>""===t?{}:ef(YP,{login:o,refreshDetails:s,logout:l}),[o,l,s,t])}),e},ZP={hostAction:{source:"host",title:"Host Action",strictParams:!0,params:{action:{type:"text",description:"The name the host registered the handler under — `openSpace`, `signOut`, whatever it offers.",default:""},value:{type:"scalar",description:"What the action is about: the space to open, the workspace to switch to. Optional.",default:""}}}},eM=({children:e,actions:t})=>{let{useInteractions:n}=pe(_E),r=he(e=>{let{action:n,value:r}=e,i=n?t?.[n]:void 0;i&&i({...e,value:r})},[t]);return n({id:"host",callbacks:ve(()=>ef(ZP,{hostAction:r}),[r])}),e},tM={navigate:{source:"navigation",title:"Navigate",strictParams:!0,params:{urlType:{type:"select",description:"Target kind: a space page, an internal space path, or an external URL.",options:["page","internal","external"],optionLabels:{page:"Space Page",internal:"Inside Space",external:"Outside Space"}},url:{type:"text",description:'Destination — a page id when urlType is "page", otherwise a URL/path.',when:e=>!!e.urlType,builderType:e=>"page"===e.urlType?"select":"text"}}}},nM=({children:e,previewMode:t=!1})=>{let{useInteractions:n}=pe(_E),[[r,i,a]]=F(["schema.pages","pageDefinitions","navigation.navigate"]),o=ve(()=>{let e=mt(i,r);return Object.keys(e).reduce((t,n)=>{let r=e[n];return[...t,{key:n,label:s(r,"attributes.name",n),defaultPage:s(r,"attributes.default",!1)}]},[])},[i,r]),l=he(e=>{if(!t)return;let{url:n,urlType:r}=e;"page"===r||"internal"===r?a(n):a(n,!0)},[a,t]);return n({id:"navigation",callbacks:ve(()=>{let{urlType:e,url:t}=Xh(tM.navigate.params);return ef(tM,{navigate:l},{navigate:{params:{urlType:e,url:{...t,defaultValue:o.find(e=>e.defaultPage)?.key??"",options:o.map(e=>({value:e.key,label:e.label}))}}}})},[l,o])}),e},rM={setState:{source:"state",title:"Set State",strictParams:!0,params:{key:{type:"text",description:"The state key/path to set. Stored under `runtime.state.<key>`.",default:""},type:{type:"select",description:'The value type. What is stored is coerced to it — a boolean is a real boolean, not "true".',options:["boolean","number","text"],optionLabels:{boolean:"True / False",number:"Numeric",text:"Text"}},value:{type:"scalar",description:"The value to store — its type follows the `type` param (a real boolean/number, or text).",when:e=>!!e.type,builderType:e=>"boolean"===e.type?"select":"text",options:["true","false"]}}},toggleState:{source:"state",title:"Toggle State",strictParams:!0,params:{key:{type:"text",description:"The state key/path to flip, under `runtime.state.<key>`. Anything not already true is treated as false, so a key that has never been set toggles to true.",default:""}}},appendState:{source:"state",title:"Append To State",strictParams:!0,params:{key:{type:"text",description:"The state key/path holding the list, under `runtime.state.<key>`. Created if it is not there.",default:""},value:{type:"scalar",description:"What to add to the end of the list.",default:""},unique:{type:"boolean",description:"Skip the append when the list already holds this value. For a list whose entries are their own identity — anything referring to one refers to it by value, so a second copy is indistinguishable.",default:!1},withId:{type:"boolean",description:"Store the entry as `{ id, value }` with an id of its own, so two entries that read the same are still two entries. Anything reading one back names `.value`; anything referring to one names `.id`.",default:!1}}},removeState:{source:"state",title:"Remove From State",strictParams:!0,params:{key:{type:"text",description:"The state key/path holding the list, under `runtime.state.<key>`.",default:""},value:{type:"scalar",description:"The entry to drop, by value — every copy of it. Prefer this wherever the list can change under the person: a position is only true until something before it moves.",default:""},by:{type:"text",description:"The FIELD carrying the identity, for a list of records rather than of scalars — `id` for entries appended with `withId`. Without it the whole entry is compared, which never matches a record.",default:""},index:{type:"text",description:"Which entry to drop, by position, when there is no value to go on. Inside a controlled list, `{{ <listSource>.index }}` is the row own position. An index that resolves to nothing removes nothing.",default:""}}},moveState:{source:"state",title:"Move Between Lists",strictParams:!0,params:{from:{type:"text",description:"The list to take it out of, under `runtime.state.<key>`.",default:""},to:{type:"text",description:"The list to put it into. It is not added twice.",default:""},value:{type:"scalar",description:"The entry to move. Absent from `from` means nothing happens.",default:""}}},toggleInState:{source:"state",title:"Toggle In List",strictParams:!0,params:{key:{type:"text",description:"The list to add to or drop from, under `runtime.state.<key>`.",default:""},value:{type:"scalar",description:"The entry the box stands for.",default:""}}},clearState:{source:"state",title:"Clear State",strictParams:!0,params:{key:{type:"text",description:"The list to empty, under `runtime.state.<key>`. Left blank it empties EVERYTHING the space is keeping — which on a page that holds notes beside a list means losing the notes to clear the list.",default:""}}}},iM=0,aM=({children:e})=>{let{useInteractions:t}=pe(_E),n=y(),r=he(e=>{let{key:t,type:r}=e,{value:i}=e;"boolean"===r?i=!0===i||"true"===i:"number"===r&&(i=parseInt(i,10)),n(`runtime.state.${t}`,i)},[n]),i=he(e=>{let{key:t}=e;t&&n(`runtime.state.${t}`,e=>!0!==e&&"true"!==e)},[n]),a=e=>!0===e||"true"===e,o=he(e=>{let{key:t,value:r,unique:i,withId:o}=e;t&&n(`runtime.state.${t}`,e=>{let t=Array.isArray(e)?e:[];return a(o)?[...t,{id:typeof crypto<"u"&&"function"==typeof crypto.randomUUID?crypto.randomUUID():`e${++iM}-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`,value:r}]:a(i)&&t.includes(r)?t:[...t,r]})},[n]),s=he(e=>{let{key:t,index:r,value:i,by:a}=e;if(!t)return;if(void 0!==i&&""!==i)return void n(`runtime.state.${t}`,e=>Array.isArray(e)?e.filter(e=>a?e?.[a]!==i:e!==i):[]);let o="number"==typeof r?r:parseInt(r??"",10);Number.isNaN(o)||n(`runtime.state.${t}`,e=>Array.isArray(e)?e.filter((e,t)=>t!==o):[])},[n]),l=he(e=>{let{from:t,to:r,value:i}=e;if(!t||!r||void 0===i||""===i)return;let a={moved:!1};n(`runtime.state.${t}`,e=>{let t=Array.isArray(e)?e:[];return a.moved=t.includes(i),a.moved?t.filter(e=>e!==i):t}),a.moved&&n(`runtime.state.${r}`,e=>{let t=Array.isArray(e)?e:[];return t.includes(i)?t:[...t,i]})},[n]),c=he(e=>{let{key:t,value:r}=e;t&&void 0!==r&&""!==r&&n(`runtime.state.${t}`,e=>{let t=Array.isArray(e)?e:[];return t.includes(r)?t.filter(e=>e!==r):[...t,r]})},[n]),u=he(e=>{let{key:t}=e;n(t?`runtime.state.${t}`:"runtime.state",t?[]:{})},[n]);return t({id:"state",callbacks:ve(()=>ef(rM,{setState:r,toggleState:i,appendState:o,removeState:s,moveState:l,toggleInState:c,clearState:u}),[r,i,o,s,l,c,u])}),e},oM=({children:e,hostActions:t})=>{let[[n="basic",r,i,a]]=F(["schema.settings.userProvider","navigation.routeParams","navigation.queryParams","navigation.currentPageId"]),{previewMode:o}=Pe();/* @__PURE__ */
577
577
  return Ee(HP,{currentPageId:a,routeParams:r,queryParams:i,children:/* @__PURE__ */Ee(XP,{authProvider:n,children:/* @__PURE__ */Ee(aM,{children:/* @__PURE__ */Ee(QP,{children:/* @__PURE__ */Ee(nM,{previewMode:o,children:/* @__PURE__ */Ee(eM,{actions:t,children:e})})})})})})},sM=se({});sM.displayName="StyleContext";var lM,cM,uM=({children:e,style:t})=>{let{style:n}=pe(ch),r=ve(()=>({}),[]);return i("style",t??(n||Qp)),/* @__PURE__ */Ee(sM,{value:r,children:e})},dM="/plitzi-sdk.css",pM=({revision:e,webKey:t="",webId:n,environment:r="main",currentPageId:i,server:a,isHydrating:o=!1,offlineMode:s=!1,offlineData:l,offlineDataType:c="json",instanceId:d,renderMode:h=De.renderMode,sdkStylePath:f="./plitzi-sdk.css",sdkDevToolsStylePath:m,previewMode:g=!0,debugMode:y=!1,overQuota:b=!1,analytics:v,onInitEventBridge:x,hostData:k,hostActions:w,onInitStateManager:S,...N})=>{const T=pe(u),[C,E]=we(!o);me(()=>E(!0),[]),p(["render.previewMode","render.debugMode","render.renderMode","render.environment","render.isHydrating","render.hydrated","render.overQuota"],[g,y,h,r,o,C,b]),p(["runtime.host"],[k]);const I=ve(()=>T?.withBase("runtime.state"),[T]),O=ve(()=>({get state(){return I?.getState()??{}},setState:e=>I?.setState(void 0,e),setStateByKey:(e,t)=>I?.setState(e,t),clearState:()=>I?.setState(void 0,{})}),[I]);return me(()=>{S?.(O)},[S,O]),/* @__PURE__ */Ee(CE,{webKey:t,webId:n,instanceId:d,server:a,offlineMode:s,offlineData:l,offlineDataType:c,revision:e,children:/* @__PURE__ */Ee(OE,{children:/* @__PURE__ */Ee(IE,{sdkStylePath:dM,children:/* @__PURE__ */Ee(uM,{children:/* @__PURE__ */Ee(DP,{onInit:x,debugMode:y,children:/* @__PURE__ */Ee(UI,{children:/* @__PURE__ */Ee(oO,{server:a,children:/* @__PURE__ */Ie(wE,{currentPageId:i,children:[/* @__PURE__ */Ee(vE,{analytics:v}),/* @__PURE__ */Ee(AP,{children:/* @__PURE__ */Ee(oM,{hostActions:w,children:/* @__PURE__ */Ee(zP,{enabled:y,instanceId:d,devToolsStyleLink:m||"/plitzi-sdk-devtools.css",renderMode:"shadow",innerClassName:vt({flex:"iframe"===h}),children:/* @__PURE__ */Ee(BI,{sdkStylePath:dM,server:a,...N})})})})]})})})})})})})})},hM=({className:e,scoped:t=!1,children:n})=>{const{theme:r}=Ch();/* @__PURE__ */
578
- return Ee(AE,{className:vt(e,t&&"system"!==r&&r),children:n})},fM=e=>({apiServer:"https://api.plitzi.com",ssrServer:"https://ssr.plitzi.com",serverUrl:"https://server.plitzi.com",websocketServer:"wss://server.plitzi.com",subscriptionServer:"wss://server.plitzi.com/subscriptions",...e}),mM={Button:Pp,ContentEditable:_f,Input:Vp,Heading:FN,ContainerResizable:ZN,ContainerCollapsable:YN,Text:uT,Markdown:Nw,ContainerTabs:oT},gM=({className:e="min-h-screen",children:t,webKey:n="",server:r,renderMode:i=De.renderMode,routing:a="browser",debugMode:o=!1,themeScope:l="document",theme:c,state:u,...d})=>{const p=ve(()=>R(n,!0),[n]),h=ke(u).current,f=ve(()=>({segments:{},runtime:{sources:{},state:h??{}},render:De}),[h]),m=ve(()=>(e=>{let t=e?.split(":")[1];return t?`plitzi_debug_${t}`:"plitzi_debug"})("undefined"==typeof window?void 0:window.location.host),[]),[g,y]=we(()=>(e=>{if("undefined"==typeof document)return!0;for(const t of document.cookie.split(";")){const n=t.indexOf("=");if(-1!==n&&t.slice(0,n).trim()===e)return"false"!==decodeURIComponent(t.slice(n+1).trim())}return!0})(m)),b=o&&g,v=ve(()=>fM(r),[r]),x=ve(()=>((e,t)=>{const n=new zu({uri:e.serverUrl}),r=new Fc,i=new hE(e=>({headers:{...e.headers,"sdk-version":"0.35.5",authorization:t?`Bearer ${t}`:""}}));return new bu({link:i.concat($u(e.serverUrl),new Nl((e,t)=>new ji(n=>{let r=t(e).subscribe({next:e=>{n.next(e.data?{...e,data:rd(e.data)}:e)},error:e=>n.error(e),complete:()=>n.complete()});return()=>{r.unsubscribe()}})),n),cache:r})})(v,n),[v,n]);me(()=>{},[]);const k=he(()=>{const e=!g;((e,t)=>{"undefined"!=typeof document&&(document.cookie=`${e}=${JSON.stringify(t)}; path=/; max-age=31536000; samesite=lax`)})(m,e),y(e)},[m,g]);(({authorized:e,onToggle:t})=>{const n=he(e=>{var n;e.shiftKey&&"F12"===e.key?t():!e.shiftKey||!e.altKey||"KeyD"!==e.code||(n=e.target)instanceof HTMLElement&&(n.isContentEditable||["INPUT","TEXTAREA","SELECT"].includes(n.tagName))||(e.preventDefault(),t())},[t]);me(()=>{if(e)return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[e,n])})({authorized:o,onToggle:k}),me(()=>{},[o,g,m]),me(()=>{d.isHydrating&&B.setHydrated()},[d.isHydrating]);const w=ve(()=>{const e={};return ie.forEach(t,t=>{if(!ue(t))return;if(t.type!==LI)return;const{renderType:n,component:r,assets:i=[],...a}=t.props;if(!n||!r)return;const o=r;o.type=n,o.assets=i,o.extraProps=a,e[n]=o}),e},[t]);"undefined"==typeof window&&v.requestUrl;const S="widget"===i?ae:"undefined"==typeof window?cE:"memory"===a?_C:nE,N="widget"===i?{}:{..."memory"===a&&"undefined"!=typeof window?{}:{basename:s(v,"basePath","/"),location:"undefined"==typeof window?v.requestUrl??"":void 0}};/* @__PURE__ */
578
+ return Ee(AE,{className:vt(e,t&&"system"!==r&&r),children:n})},fM=e=>({apiServer:"https://api.plitzi.com",ssrServer:"https://ssr.plitzi.com",serverUrl:"https://server.plitzi.com",websocketServer:"wss://server.plitzi.com",subscriptionServer:"wss://server.plitzi.com/subscriptions",...e}),mM={Button:Pp,ContentEditable:_f,Input:Vp,Heading:FN,ContainerResizable:ZN,ContainerCollapsable:YN,Text:uT,Markdown:Nw,ContainerTabs:oT},gM=({className:e="min-h-screen",children:t,webKey:n="",server:r,renderMode:i=De.renderMode,routing:a="browser",debugMode:o=!1,themeScope:l="document",theme:c,state:u,...d})=>{const p=ve(()=>R(n,!0),[n]),h=ke(u).current,f=ve(()=>({segments:{},runtime:{sources:{},state:h??{}},render:De}),[h]),m=ve(()=>(e=>{let t=e?.split(":")[1];return t?`plitzi_debug_${t}`:"plitzi_debug"})("undefined"==typeof window?void 0:window.location.host),[]),[g,y]=we(()=>(e=>{if("undefined"==typeof document)return!0;for(const t of document.cookie.split(";")){const n=t.indexOf("=");if(-1!==n&&t.slice(0,n).trim()===e)return"false"!==decodeURIComponent(t.slice(n+1).trim())}return!0})(m)),b=o&&g,v=ve(()=>fM(r),[r]),x=ve(()=>((e,t)=>{const n=new zu({uri:e.serverUrl}),r=new Fc,i=new hE(e=>({headers:{...e.headers,"sdk-version":"0.35.7",authorization:t?`Bearer ${t}`:""}}));return new bu({link:i.concat($u(e.serverUrl),new Nl((e,t)=>new ji(n=>{let r=t(e).subscribe({next:e=>{n.next(e.data?{...e,data:rd(e.data)}:e)},error:e=>n.error(e),complete:()=>n.complete()});return()=>{r.unsubscribe()}})),n),cache:r})})(v,n),[v,n]);me(()=>{},[]);const k=he(()=>{const e=!g;((e,t)=>{"undefined"!=typeof document&&(document.cookie=`${e}=${JSON.stringify(t)}; path=/; max-age=31536000; samesite=lax`)})(m,e),y(e)},[m,g]);(({authorized:e,onToggle:t})=>{const n=he(e=>{var n;e.shiftKey&&"F12"===e.key?t():!e.shiftKey||!e.altKey||"KeyD"!==e.code||(n=e.target)instanceof HTMLElement&&(n.isContentEditable||["INPUT","TEXTAREA","SELECT"].includes(n.tagName))||(e.preventDefault(),t())},[t]);me(()=>{if(e)return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[e,n])})({authorized:o,onToggle:k}),me(()=>{},[o,g,m]),me(()=>{d.isHydrating&&B.setHydrated()},[d.isHydrating]);const w=ve(()=>{const e={};return ie.forEach(t,t=>{if(!ue(t))return;if(t.type!==LI)return;const{renderType:n,component:r,assets:i=[],...a}=t.props;if(!n||!r)return;const o=r;o.type=n,o.assets=i,o.extraProps=a,e[n]=o}),e},[t]);"undefined"==typeof window&&v.requestUrl;const S="widget"===i?ae:"undefined"==typeof window?cE:"memory"===a?_C:nE,N="widget"===i?{}:{..."memory"===a&&"undefined"!=typeof window?{}:{basename:s(v,"basePath","/"),location:"undefined"==typeof window?v.requestUrl??"":void 0}};/* @__PURE__ */
579
579
  return Ee(ct,{value:f,middlewares:[Ve(Jp("sdk")),Fh(p),...b?[()=>({onChange:e=>B.recordStoreChange(e)}),je({shouldRecord:e=>!e?.startsWith("runtime.elements")&&!e?.startsWith("rsc")&&!e?.startsWith("theme")})]:[]],children:/* @__PURE__ */Ee(Th,{defaultTheme:"system",scope:l,theme:c,children:/* @__PURE__ */Ee(cT,{components:mM,children:/* @__PURE__ */Ee(hM,{scoped:"container"===l,className:vt("plitzi-sdk flex",e,{"sdk-debug-mode":b}),children:/* @__PURE__ */Ee(KS,{children:/* @__PURE__ */Ee(S,{...N,children:/* @__PURE__ */Ee(HN,{client:x,children:/* @__PURE__ */Ee(VN,{localCustomComponents:w,localComponents:bM,children:/* @__PURE__ */Ee(pM,{server:v,webKey:n,renderMode:i,debugMode:b,webId:p,...d})})})})})})})})})},yM=K(({ref:e,className:t,spaceKey:n,environment:r="main"})=>{const{settings:{previewMode:i},contexts:{NetworkContext:a}}=U(),{server:o}=pe(a);/* @__PURE__ */
580
580
  return Ee(cf,{ref:e,className:vt("plitzi-component__plitzi-sdk",t,{"with__plitzi-sdk":!i}),children:n&&/* @__PURE__ */Ee(gM,{webKey:n,environment:r,renderMode:"widget",server:o,className:"h-full w-full"})})}),bM={plitziSdk:Object.assign(yM,{type:"plitziSdk",content:{attributes:{spaceId:"",spaceKey:"",environment:"main"},definition:{label:"Plitzi Sdk",type:"plitziSdk",bindings:{},styleSelectors:{base:""},initialState:{visibility:!0}},builder:{canDelete:!0,canSelect:!0,canDragDrop:!0,canMove:!0,canTemplate:!0,itemsAllowed:[],itemsNotAllowed:[]},market:{category:"advanced",owner:"Plitzi",verified:!0,license:"MIT",website:"https://plitzi.com",backgroundColor:"#4422ee",icon:/* @__PURE__ */Ee(qN,{})},defaultStyle:{name:"Plitzi Sdk",displayMode:"desktop",style:{base:{default:{}}}},settings:{}}})};function vM(e,t={},n={},r=!1,i=!1){const a=(e=>{if(e.analytics||e.offlineMode||!e.webKey)return e;const{apiServer:t}=fM(e.server);return t?{...e,analytics:{endpoint:`${t.replace(/\/+$/,"")}/v1/collect`,key:e.webKey}}:e})(t),o=a.debugMode??r,s=({isHydrating:e=!1})=>{const[t,r]=we(!e);me(()=>r(!0),[]);const i=Object.keys(n).filter(e=>t||!n[e].clientOnly);o||(()=>{if(typeof window>"u")return;let e=()=>{},t=window.__REACT_DEVTOOLS_GLOBAL_HOOK__;"object"==typeof t&&Object.keys(t).forEach(n=>{let r=t[n];t[n]="function"==typeof r?e:null})})();const s=he(e=>{lM=e},[]),l=he(e=>{cM=e},[]);/* @__PURE__ */
581
- return Ee(gM,{...a,debugMode:o,isHydrating:e,onInitStateManager:s,onInitEventBridge:l,children:i.filter(e=>!!n[e].component).map(e=>/* @__PURE__ */Ee(BI.Plugin,{renderType:e,component:n[e].component,...n[e].props},e))})},l="undefined"!=typeof document?document.getElementById(e):void 0;if(!l)return;const c=i?Te(l,/* @__PURE__ */Ee(s,{isHydrating:!0})):Ne(l);return i||c.render(/* @__PURE__ */Ee(s,{})),{unmount:()=>c.unmount()}}Promise.resolve({ });var xM=({debugMode:e=!1,isHydrating:t=!1,children:n,webKey:r="",environment:i="main",renderMode:a=De.renderMode,...o})=>/* @__PURE__ */Ee(gM,{...o,isHydrating:t,renderMode:a,debugMode:e,webKey:r,environment:i,children:n});xM.Plugin=BI.Plugin;var kM=U,wM="0.35.5",SM=()=>lM,NM=()=>cM;export{w as ComponentContext,VN as ComponentProvider,hf as JsxManager,A as PlitziServiceProvider,wf as PluginManager,L as PluginRemote,bN as ReplicaProvider,cf as RootElement,xM as default,NM as getEventBridge,SM as getStateManager,$h as n,vM as render,bM as sdkComponents,uf as t,bE as track,Wh as useElement,kM as usePlitziServiceContext,Gh as useRscData,jh as useRscRefresh,F as useStore,wM as version,K as withElement};
581
+ return Ee(gM,{...a,debugMode:o,isHydrating:e,onInitStateManager:s,onInitEventBridge:l,children:i.filter(e=>!!n[e].component).map(e=>/* @__PURE__ */Ee(BI.Plugin,{renderType:e,component:n[e].component,...n[e].props},e))})},l="undefined"!=typeof document?document.getElementById(e):void 0;if(!l)return;const c=i?Te(l,/* @__PURE__ */Ee(s,{isHydrating:!0})):Ne(l);return i||c.render(/* @__PURE__ */Ee(s,{})),{unmount:()=>c.unmount()}}Promise.resolve({ });var xM=({debugMode:e=!1,isHydrating:t=!1,children:n,webKey:r="",environment:i="main",renderMode:a=De.renderMode,...o})=>/* @__PURE__ */Ee(gM,{...o,isHydrating:t,renderMode:a,debugMode:e,webKey:r,environment:i,children:n});xM.Plugin=BI.Plugin;var kM=U,wM="0.35.7",SM=()=>lM,NM=()=>cM;export{w as ComponentContext,VN as ComponentProvider,hf as JsxManager,A as PlitziServiceProvider,wf as PluginManager,L as PluginRemote,bN as ReplicaProvider,cf as RootElement,xM as default,NM as getEventBridge,SM as getStateManager,$h as n,vM as render,bM as sdkComponents,uf as t,bE as track,Wh as useElement,kM as usePlitziServiceContext,Gh as useRscData,jh as useRscRefresh,F as useStore,wM as version,K as withElement};
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plitzi/plitzi-sdk",
3
- "version": "0.35.5",
3
+ "version": "0.35.7",
4
4
  "homepage": "./",
5
5
  "license": "AGPL-3.0",
6
6
  "files": [
@@ -33,17 +33,17 @@
33
33
  "@fortawesome/fontawesome-free": "^7.3.1",
34
34
  "@plitzi/nexus": "^1.1.4",
35
35
  "@plitzi/plitzi-ui": "^1.6.21",
36
- "@plitzi/sdk-auth": "0.35.5",
37
- "@plitzi/sdk-dev-tools": "0.35.5",
38
- "@plitzi/sdk-elements": "0.35.5",
39
- "@plitzi/sdk-event-bridge": "0.35.5",
40
- "@plitzi/sdk-interactions": "0.35.5",
41
- "@plitzi/sdk-navigation": "0.35.5",
42
- "@plitzi/sdk-plugins": "0.35.5",
43
- "@plitzi/sdk-schema": "0.35.5",
44
- "@plitzi/sdk-shared": "0.35.5",
45
- "@plitzi/sdk-style": "0.35.5",
46
- "@plitzi/sdk-variables": "0.35.5",
36
+ "@plitzi/sdk-auth": "0.35.7",
37
+ "@plitzi/sdk-dev-tools": "0.35.7",
38
+ "@plitzi/sdk-elements": "0.35.7",
39
+ "@plitzi/sdk-event-bridge": "0.35.7",
40
+ "@plitzi/sdk-interactions": "0.35.7",
41
+ "@plitzi/sdk-navigation": "0.35.7",
42
+ "@plitzi/sdk-plugins": "0.35.7",
43
+ "@plitzi/sdk-schema": "0.35.7",
44
+ "@plitzi/sdk-shared": "0.35.7",
45
+ "@plitzi/sdk-style": "0.35.7",
46
+ "@plitzi/sdk-variables": "0.35.7",
47
47
  "clsx": "^2.1.1",
48
48
  "graphql": "^17.0.2",
49
49
  "immer": "^11.1.18",