@plitzi/plitzi-sdk 0.37.0 → 0.37.1
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 +18 -0
- package/dist/index.html +1 -1
- package/dist/plitzi-sdk.js +2 -2
- package/dist/plitzi-sdk.js.gz +0 -0
- package/package.json +12 -12
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @plitzi/plitzi-sdk
|
|
2
2
|
|
|
3
|
+
## 0.37.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- v0.37.1
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @plitzi/sdk-auth@0.37.1
|
|
10
|
+
- @plitzi/sdk-dev-tools@0.37.1
|
|
11
|
+
- @plitzi/sdk-elements@0.37.1
|
|
12
|
+
- @plitzi/sdk-event-bridge@0.37.1
|
|
13
|
+
- @plitzi/sdk-interactions@0.37.1
|
|
14
|
+
- @plitzi/sdk-navigation@0.37.1
|
|
15
|
+
- @plitzi/sdk-plugins@0.37.1
|
|
16
|
+
- @plitzi/sdk-schema@0.37.1
|
|
17
|
+
- @plitzi/sdk-shared@0.37.1
|
|
18
|
+
- @plitzi/sdk-style@0.37.1
|
|
19
|
+
- @plitzi/sdk-variables@0.37.1
|
|
20
|
+
|
|
3
21
|
## 0.37.0
|
|
4
22
|
|
|
5
23
|
### Minor Changes
|
package/dist/index.html
CHANGED
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
render(
|
|
58
58
|
'plitzi',
|
|
59
59
|
{
|
|
60
|
-
webKey: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.
|
|
60
|
+
webKey: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxIiwib3JpZ2lucyI6WyJodHRwczovL3dlYnNpdGUucGxpdHppLmFwcCIsImh0dHBzOi8vcGxpdHppLmxvY2FsIiwiaHR0cHM6Ly9hcHAucGxpdHppLmxvY2FsIiwiaHR0cHM6Ly9hcHAucGxpdHppLmxvY2FsOjMwMDAiLCJodHRwczovL2FwcC5wbGl0emkubG9jYWw6MzAwMSIsImh0dHBzOi8vc3NyLnBsaXR6aS5sb2NhbCIsImh0dHBzOi8vc2VydmVyLnBsaXR6aS5sb2NhbCIsImh0dHA6Ly9sb2NhbGhvc3Q6MzAwMCIsImh0dHA6Ly9sb2NhbGhvc3Q6ODA4MCIsImh0dHA6Ly8xMjcuMC4wLjE6ODA4MCJdLCJpc3MiOiJodHRwczovL3NlcnZlci5wbGl0emkubG9jYWwiLCJhdWQiOlsiaHR0cHM6Ly9wbGl0emkubG9jYWwiLCJodHRwczovL2FwcC5wbGl0emkubG9jYWwiLCJodHRwczovL2FwcC5wbGl0emkubG9jYWw6MzAwMCIsImh0dHBzOi8vYXBwLnBsaXR6aS5sb2NhbDozMDAxIiwiaHR0cHM6Ly9hcGkucGxpdHppLmxvY2FsIiwiaHR0cHM6Ly9zc3IucGxpdHppLmxvY2FsIiwiaHR0cHM6Ly9zZXJ2ZXIucGxpdHppLmxvY2FsIiwiaHR0cHM6Ly9tY3AucGxpdHppLmxvY2FsIiwiaHR0cHM6Ly9hdXRoLnBsaXR6aS5sb2NhbCIsImh0dHA6Ly8xMjcuMC4wLjE6NTMwMCIsImh0dHA6Ly9sb2NhbGhvc3Q6NTE4MCJdLCJzY29wZSI6InNwYWNlOnJlbmRlciIsImlhdCI6MTc4OTg0OTYyMywianRpIjoiMmM0ZTRkNDI1NzEzMTI4YyIsIm5iZiI6MTc4OTg0OTYyM30.VKxz7K9A8tvKnCwWLnB02NgAQY7Oftr6NzAXH8v4nsU',
|
|
61
61
|
environment: 'main',
|
|
62
62
|
revision: 0,
|
|
63
63
|
renderMode: 'raw',
|
package/dist/plitzi-sdk.js
CHANGED
|
@@ -614,7 +614,7 @@ return Ie(aI,{value:a,children:e})},yL={runServerAction:{source:"actions",title:
|
|
|
614
614
|
/* @__PURE__ */Ie("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=fe(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 Kp.info("actions",/* @__PURE__ */ze("span",{children:["Server action run ",
|
|
615
615
|
/* @__PURE__ */Ie("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=xe(()=>(i??[]).map(e=>({label:`${e.name} (${e.identifier})`,value:e.identifier})),[i]);return t({id:"actions",callbacks:xe(()=>lf(yL,{cancelServerAction:l,runServerAction:s},{runServerAction:{params:e=>{let t=of(yL.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},SL={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:{}}},NL=({children:e,authProvider:t="basic"})=>{let{login:n,refresh:r,logout:i}=he(GE),{useInteractions:a}=he(aI),o=fe(e=>n(e),[n]),s=fe(e=>r(e),[r]),l=fe(()=>i(),[i]);return a({id:"auth",callbacks:xe(()=>""===t?{}:lf(SL,{login:o,refreshDetails:s,logout:l}),[o,l,s,t])}),e},TL={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:""}}}},CL=({children:e,actions:t})=>{let{useInteractions:n}=he(aI),r=fe(e=>{let{action:n,value:r}=e,i=n?t?.[n]:void 0;i&&i({...e,value:r})},[t]);return n({id:"host",callbacks:xe(()=>lf(TL,{hostAction:r}),[r])}),e},EL={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"}}}},IL=({children:e,previewMode:t=!1})=>{let{useInteractions:n}=he(aI),[[r,i,a]]=p(["schema.pages","pageDefinitions","navigation.navigate"]),o=xe(()=>{let e=bt(i,r);return Object.keys(e).reduce((t,n)=>{let r=e[n];return[...t,{key:n,label:b(r,"attributes.name",n),defaultPage:b(r,"attributes.default",!1)}]},[])},[i,r]),s=fe(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:xe(()=>{let{urlType:e,url:t}=of(EL.navigate.params);return lf(EL,{navigate:s},{navigate:{params:{urlType:e,url:{...t,defaultValue:o.find(e=>e.defaultPage)?.key??"",options:o.map(e=>({value:e.key,label:e.label}))}}}})},[s,o])}),e},zL={invalidateQueries:{source:"queries",title:"Invalidate Queries",strictParams:!0,params:{elements:{type:"elementIds",elementType:"apiContainer",description:"The api containers to refresh, by element id — the way to name a request whose URL is a template. Leave both this and `url` empty to refresh every cached request on the page.",default:[],label:"Containers (ids)"},url:{type:"text",description:"Only the requests whose URL starts with this — `/api/orders` covers `/api/orders?page=2`. With `elements` too, a request must match both.",default:"",label:"URL prefix"}},preview:{}}},OL=({children:e})=>{let{useInteractions:t}=he(aI),n=fe(e=>ON({url:e.url??"",elements:IN(e.elements)}),[]);return t({id:"queries",callbacks:xe(()=>lf(zL,{invalidateQueries:n}),[n])}),e},AL={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:""}}}},_L=0,DL=({children:e})=>{let{useInteractions:t}=he(aI),n=g(),r=fe(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=fe(e=>{let{key:t}=e;t&&n(`runtime.state.${t}`,e=>!0!==e&&"true"!==e)},[n]),a=e=>!0===e||"true"===e,o=fe(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${++_L}-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`,value:r}]:a(i)&&t.includes(r)?t:[...t,r]})},[n]),s=fe(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=fe(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=fe(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=fe(e=>{let{key:t}=e;n(t?`runtime.state.${t}`:"runtime.state",t?[]:{})},[n]);return t({id:"state",callbacks:xe(()=>lf(AL,{setState:r,toggleState:i,appendState:o,removeState:s,moveState:l,toggleInState:c,clearState:u}),[r,i,o,s,l,c,u])}),e},PL=({children:e,hostActions:t})=>{let[[n="basic",r,i,a]]=p(["schema.settings.userProvider","navigation.routeParams","navigation.queryParams","navigation.currentPageId"]),{previewMode:o}=Me();/* @__PURE__ */
|
|
616
616
|
return Ie(gL,{currentPageId:a,routeParams:r,queryParams:i,children:/* @__PURE__ */Ie(NL,{authProvider:n,children:/* @__PURE__ */Ie(DL,{children:/* @__PURE__ */Ie(wL,{children:/* @__PURE__ */Ie(OL,{children:/* @__PURE__ */Ie(IL,{previewMode:o,children:/* @__PURE__ */Ie(CL,{actions:t,children:e})})})})})})})},ML=le({});ML.displayName="StyleContext";var LL,RL,jL=({children:e,style:t})=>{let{style:n}=he(fh),r=xe(()=>({}),[]);return $("style",t??(n||eh)),/* @__PURE__ */Ie(ML,{value:r,children:e})},FL="/plitzi-sdk.css",$L=({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:u,renderMode:d=Pe.renderMode,sdkStylePath:p="./plitzi-sdk.css",sdkDevToolsStylePath:h,previewMode:m=!0,debugMode:g=!1,overQuota:y=!1,analytics:b,onInitEventBridge:v,hostData:x,hostActions:w,onInitStateManager:S,...N})=>{const T=he(f),[C,E]=Se(!o);ge(()=>E(!0),[]),k(["render.previewMode","render.debugMode","render.renderMode","render.environment","render.isHydrating","render.hydrated","render.overQuota"],[m,g,d,r,o,C,y]),k(["runtime.host"],[x]);const I=xe(()=>T?.withBase("runtime.state"),[T]),z=xe(()=>({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 ge(()=>{S?.(z)},[S,z]),/* @__PURE__ */Ie(ZE,{webKey:t,webId:n,instanceId:u,server:a,offlineMode:s,offlineData:l,offlineDataType:c,revision:e,children:/* @__PURE__ */Ie(nI,{children:/* @__PURE__ */Ie(tI,{sdkStylePath:FL,children:/* @__PURE__ */Ie(jL,{children:/* @__PURE__ */Ie(JM,{onInit:v,debugMode:g,children:/* @__PURE__ */Ie(gz,{children:/* @__PURE__ */Ie(_z,{server:a,children:/* @__PURE__ */ze(JE,{currentPageId:i,children:[/* @__PURE__ */Ie(WE,{analytics:b}),/* @__PURE__ */Ie(GM,{children:/* @__PURE__ */Ie(PL,{hostActions:w,children:/* @__PURE__ */Ie(WM,{enabled:g,instanceId:u,devToolsStyleLink:h||"/plitzi-sdk-devtools.css",renderMode:"shadow",innerClassName:wt({flex:"iframe"===d}),children:/* @__PURE__ */Ie(mz,{sdkStylePath:FL,server:a,...N})})})})]})})})})})})})})},qL=({className:e,scoped:t=!1,children:n})=>{const{theme:r}=Ah();/* @__PURE__ */
|
|
617
|
-
return Ie(iI,{className:wt(e,t&&"system"!==r&&r),children:n})},VL=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}),BL={Button:Rp,ContentEditable:Ff,Input:Up,Heading:pT,ContainerResizable:CT,ContainerCollapsable:NT,Text:RT,Markdown:Dw,ContainerTabs:DT},UL=({className:e="min-h-screen",children:t,webKey:n="",server:r,renderMode:i=Pe.renderMode,routing:a="browser",debugMode:o=!1,themeScope:s="document",theme:l,state:c,...u})=>{const d=xe(()=>O(n,!0),[n]),p=we(c).current,h=xe(()=>({segments:{},runtime:{sources:{},state:p??{}},render:Pe}),[p]),f=xe(()=>(e=>{let t=e?.split(":")[1];return t?`plitzi_debug_${t}`:"plitzi_debug"})("undefined"==typeof window?void 0:window.location.host),[]),[m,g]=Se(()=>(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})(f)),y=o&&m,v=xe(()=>VL(r),[r]),x=xe(()=>((e,t)=>{const n=new Du({uri:e.serverUrl}),r=new Vc,i=new $E(e=>({headers:{...e.headers,"sdk-version":"0.37.
|
|
617
|
+
return Ie(iI,{className:wt(e,t&&"system"!==r&&r),children:n})},VL=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}),BL={Button:Rp,ContentEditable:Ff,Input:Up,Heading:pT,ContainerResizable:CT,ContainerCollapsable:NT,Text:RT,Markdown:Dw,ContainerTabs:DT},UL=({className:e="min-h-screen",children:t,webKey:n="",server:r,renderMode:i=Pe.renderMode,routing:a="browser",debugMode:o=!1,themeScope:s="document",theme:l,state:c,...u})=>{const d=xe(()=>O(n,!0),[n]),p=we(c).current,h=xe(()=>({segments:{},runtime:{sources:{},state:p??{}},render:Pe}),[p]),f=xe(()=>(e=>{let t=e?.split(":")[1];return t?`plitzi_debug_${t}`:"plitzi_debug"})("undefined"==typeof window?void 0:window.location.host),[]),[m,g]=Se(()=>(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})(f)),y=o&&m,v=xe(()=>VL(r),[r]),x=xe(()=>((e,t)=>{const n=new Du({uri:e.serverUrl}),r=new Vc,i=new $E(e=>({headers:{...e.headers,"sdk-version":"0.37.1",authorization:t?`Bearer ${t}`:""}}));return new ku({link:i.concat(Bu(e.serverUrl),new El((e,t)=>new qi(n=>{let r=t(e).subscribe({next:e=>{n.next(e.data?{...e,data:od(e.data)}:e)},error:e=>n.error(e),complete:()=>n.complete()});return()=>{r.unsubscribe()}})),n),cache:r})})(v,n),[v,n]);ge(()=>{},[]);const k=fe(()=>{const e=!m;((e,t)=>{"undefined"!=typeof document&&(document.cookie=`${e}=${JSON.stringify(t)}; path=/; max-age=31536000; samesite=lax`)})(f,e),g(e)},[f,m]);(({authorized:e,onToggle:t})=>{const n=fe(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]);ge(()=>{if(e)return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[e,n])})({authorized:o,onToggle:k}),ge(()=>{},[o,m,f]),ge(()=>{u.isHydrating&&U.setHydrated()},[u.isHydrating]);const w=xe(()=>{const e={};return ae.forEach(t,t=>{if(!de(t))return;if(t.type!==uz)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?oe:"undefined"==typeof window?LE:"memory"===a?aE:zE,N="widget"===i?{}:{..."memory"===a&&"undefined"!=typeof window?{}:{basename:b(v,"basePath","/"),location:"undefined"==typeof window?v.requestUrl??"":void 0}};/* @__PURE__ */
|
|
618
618
|
return Ie(pt,{value:h,middlewares:[Ve(Yp("sdk")),Uh(d),...y?[()=>({onChange:e=>U.recordStoreChange(e)}),Fe({shouldRecord:e=>!e?.startsWith("runtime.elements")&&!e?.startsWith("rsc")&&!e?.startsWith("theme")})]:[]],children:/* @__PURE__ */Ie(Oh,{defaultTheme:"system",scope:s,theme:l,children:/* @__PURE__ */Ie(LT,{components:BL,children:/* @__PURE__ */Ie(qL,{scoped:"container"===s,className:wt("plitzi-sdk flex",e,{"sdk-debug-mode":y}),children:/* @__PURE__ */Ie(sN,{children:/* @__PURE__ */Ie(S,{...N,children:/* @__PURE__ */Ie(bT,{client:x,children:/* @__PURE__ */Ie(fT,{localCustomComponents:w,localComponents:WL,children:/* @__PURE__ */Ie($L,{server:v,webKey:n,renderMode:i,debugMode:y,webId:d,...u})})})})})})})})})},HL=K(({ref:e,className:t,spaceKey:n,environment:r="main"})=>{const{settings:{previewMode:i},contexts:{NetworkContext:a}}=H(),{server:o}=he(a);/* @__PURE__ */
|
|
619
619
|
return Ie(gf,{ref:e,className:wt("plitzi-component__plitzi-sdk",t,{"with__plitzi-sdk":!i}),children:n&&/* @__PURE__ */Ie(UL,{webKey:n,environment:r,renderMode:"widget",server:o,className:"h-full w-full"})})}),WL={plitziSdk:Object.assign(HL,{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__ */Ie(mT,{})},defaultStyle:{name:"Plitzi Sdk",displayMode:"desktop",style:{base:{default:{}}}},settings:{}}})};function GL(e,t={},n={},r=!1,i=!1){const{actionRuns:a,...o}=(e=>{if(e.analytics||e.offlineMode||!e.webKey)return e;const{apiServer:t}=VL(e.server);return t?{...e,analytics:{endpoint:`${t.replace(/\/+$/,"")}/v1/collect`,key:e.webKey}}:e})(t),s=o.debugMode??r;s&&a?.length&&at(a);const l=({isHydrating:e=!1})=>{const[t,r]=Se(!e);ge(()=>r(!0),[]);const i=Object.keys(n).filter(e=>t||!n[e].clientOnly);s||(()=>{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 a=fe(e=>{LL=e},[]),l=fe(e=>{RL=e},[]);/* @__PURE__ */
|
|
620
|
-
return Ie(UL,{...o,debugMode:s,isHydrating:e,onInitStateManager:a,onInitEventBridge:l,children:i.filter(e=>!!n[e].component).map(e=>/* @__PURE__ */Ie(mz.Plugin,{renderType:e,component:n[e].component,...n[e].props},e))})},c="undefined"!=typeof document?document.getElementById(e):void 0;if(!c)return;const u=i?Ce(c,/* @__PURE__ */Ie(l,{isHydrating:!0})):Te(c);return i||u.render(/* @__PURE__ */Ie(l,{})),{unmount:()=>u.unmount()}}Promise.resolve({ });var QL=({debugMode:e=!1,isHydrating:t=!1,children:n,webKey:r="",environment:i="main",renderMode:a=Pe.renderMode,...o})=>/* @__PURE__ */Ie(UL,{...o,isHydrating:t,renderMode:a,debugMode:e,webKey:r,environment:i,children:n});QL.Plugin=mz.Plugin;var JL=H,KL="0.37.
|
|
620
|
+
return Ie(UL,{...o,debugMode:s,isHydrating:e,onInitStateManager:a,onInitEventBridge:l,children:i.filter(e=>!!n[e].component).map(e=>/* @__PURE__ */Ie(mz.Plugin,{renderType:e,component:n[e].component,...n[e].props},e))})},c="undefined"!=typeof document?document.getElementById(e):void 0;if(!c)return;const u=i?Ce(c,/* @__PURE__ */Ie(l,{isHydrating:!0})):Te(c);return i||u.render(/* @__PURE__ */Ie(l,{})),{unmount:()=>u.unmount()}}Promise.resolve({ });var QL=({debugMode:e=!1,isHydrating:t=!1,children:n,webKey:r="",environment:i="main",renderMode:a=Pe.renderMode,...o})=>/* @__PURE__ */Ie(UL,{...o,isHydrating:t,renderMode:a,debugMode:e,webKey:r,environment:i,children:n});QL.Plugin=mz.Plugin;var JL=H,KL="0.37.1",YL=()=>LL,XL=()=>RL;export{o as ComponentContext,fT as ComponentProvider,xf as JsxManager,A as PlitziServiceProvider,zf as PluginManager,R as PluginRemote,HN as ReplicaProvider,gf as RootElement,QL as default,XL as getEventBridge,YL as getStateManager,Wh as n,GL as render,WL as sdkComponents,yf as t,HE as track,Xh as useElement,JL as usePlitziServiceContext,Zh as useRscData,Bh as useRscRefresh,p as useStore,KL as version,K as withElement};
|
package/dist/plitzi-sdk.js.gz
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plitzi/plitzi-sdk",
|
|
3
|
-
"version": "0.37.
|
|
3
|
+
"version": "0.37.1",
|
|
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.2.2",
|
|
35
35
|
"@plitzi/plitzi-ui": "^1.6.21",
|
|
36
|
-
"@plitzi/sdk-auth": "0.37.
|
|
37
|
-
"@plitzi/sdk-dev-tools": "0.37.
|
|
38
|
-
"@plitzi/sdk-elements": "0.37.
|
|
39
|
-
"@plitzi/sdk-event-bridge": "0.37.
|
|
40
|
-
"@plitzi/sdk-interactions": "0.37.
|
|
41
|
-
"@plitzi/sdk-navigation": "0.37.
|
|
42
|
-
"@plitzi/sdk-plugins": "0.37.
|
|
43
|
-
"@plitzi/sdk-schema": "0.37.
|
|
44
|
-
"@plitzi/sdk-shared": "0.37.
|
|
45
|
-
"@plitzi/sdk-style": "0.37.
|
|
46
|
-
"@plitzi/sdk-variables": "0.37.
|
|
36
|
+
"@plitzi/sdk-auth": "0.37.1",
|
|
37
|
+
"@plitzi/sdk-dev-tools": "0.37.1",
|
|
38
|
+
"@plitzi/sdk-elements": "0.37.1",
|
|
39
|
+
"@plitzi/sdk-event-bridge": "0.37.1",
|
|
40
|
+
"@plitzi/sdk-interactions": "0.37.1",
|
|
41
|
+
"@plitzi/sdk-navigation": "0.37.1",
|
|
42
|
+
"@plitzi/sdk-plugins": "0.37.1",
|
|
43
|
+
"@plitzi/sdk-schema": "0.37.1",
|
|
44
|
+
"@plitzi/sdk-shared": "0.37.1",
|
|
45
|
+
"@plitzi/sdk-style": "0.37.1",
|
|
46
|
+
"@plitzi/sdk-variables": "0.37.1",
|
|
47
47
|
"clsx": "^2.1.1",
|
|
48
48
|
"graphql": "^17.0.2",
|
|
49
49
|
"immer": "^11.1.18",
|