@plitzi/plitzi-sdk 0.34.0 → 0.34.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 +27 -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 +15 -16
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
# @plitzi/plitzi-sdk
|
|
2
2
|
|
|
3
|
+
## 0.34.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- cba7b8b: Build tools no longer install with the SDK.
|
|
8
|
+
|
|
9
|
+
`@plitzi/plitzi-sdk` listed `vite`, `vite-plugin-dts` and `vite-plugin-react` as runtime dependencies, and
|
|
10
|
+
`@plitzi/sdk-variables` listed `eslint` — so every project depending on the SDK installed a bundler, a type bundler,
|
|
11
|
+
a Babel 7 toolchain and a deprecated `eslint@9` it never runs. They are build-time only: `vite` and `vite-plugin-dts`
|
|
12
|
+
move to `devDependencies`, the unused `vite-plugin-react` is removed, `@vitejs/plugin-react` (which the build
|
|
13
|
+
config does import) is now declared, and `eslint` is dropped from `sdk-variables`' runtime list.
|
|
14
|
+
|
|
15
|
+
- v0.34.1
|
|
16
|
+
- Updated dependencies [cba7b8b]
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
- @plitzi/sdk-variables@0.34.1
|
|
19
|
+
- @plitzi/sdk-auth@0.34.1
|
|
20
|
+
- @plitzi/sdk-dev-tools@0.34.1
|
|
21
|
+
- @plitzi/sdk-elements@0.34.1
|
|
22
|
+
- @plitzi/sdk-event-bridge@0.34.1
|
|
23
|
+
- @plitzi/sdk-interactions@0.34.1
|
|
24
|
+
- @plitzi/sdk-navigation@0.34.1
|
|
25
|
+
- @plitzi/sdk-plugins@0.34.1
|
|
26
|
+
- @plitzi/sdk-schema@0.34.1
|
|
27
|
+
- @plitzi/sdk-shared@0.34.1
|
|
28
|
+
- @plitzi/sdk-style@0.34.1
|
|
29
|
+
|
|
3
30
|
## 0.34.0
|
|
4
31
|
|
|
5
32
|
### 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.eyJzdWIiOiIxIiwib3JpZ2lucyI6WyJodHRwczovL3dlYnNpdGUucGxpdHppLmFwcCIsImh0dHBzOi8vcGxpdHppLmxvY2FsIiwiaHR0cHM6Ly9hcHAucGxpdHppLmxvY2FsIiwiaHR0cHM6Ly9hcHAucGxpdHppLmxvY2FsOjMwMDAiLCJodHRwczovL2FwcC5wbGl0emkubG9jYWw6MzAwMSIsImh0dHBzOi8vc3NyLnBsaXR6aS5sb2NhbCIsImh0dHBzOi8vc2VydmVyLnBsaXR6aS5sb2NhbCIsImh0dHA6Ly9sb2NhbGhvc3Q6MzAwMCIsImh0dHA6Ly9sb2NhbGhvc3Q6ODA4MCIsImh0dHA6Ly8xMjcuMC4wLjE6ODA4MCJdLCJpc3MiOiJodHRwczovL3NlcnZlci5wbGl0emkubG9jYWwiLCJhdWQiOlsiaHR0cHM6Ly9wbGl0emkubG9jYWwiLCJodHRwczovL2FwcC5wbGl0emkubG9jYWwiLCJodHRwczovL2FwcC5wbGl0emkubG9jYWw6MzAwMCIsImh0dHBzOi8vYXBwLnBsaXR6aS5sb2NhbDozMDAxIiwiaHR0cHM6Ly9hcGkucGxpdHppLmxvY2FsIiwiaHR0cHM6Ly9zc3IucGxpdHppLmxvY2FsIiwiaHR0cHM6Ly9zZXJ2ZXIucGxpdHppLmxvY2FsIiwiaHR0cHM6Ly9tY3AucGxpdHppLmxvY2FsIiwiaHR0cHM6Ly9hdXRoLnBsaXR6aS5sb2NhbCIsImh0dHA6Ly8xMjcuMC4wLjE6NTMwMCIsImh0dHA6Ly9sb2NhbGhvc3Q6NTE4MCJdLCJzY29wZSI6InNwYWNlOnJlbmRlciIsImlhdCI6MTc4OTMzMDI5MiwianRpIjoiMTJiNzAzYjQ0N2E5NWUzZiIsIm5iZiI6MTc4OTMzMDI5Mn0.LpCEfGgbI2X9f1_WHu5OuiovDeCx73prviPRxt41Oms',
|
|
61
61
|
environment: 'main',
|
|
62
62
|
revision: 0,
|
|
63
63
|
renderMode: 'raw',
|
package/dist/plitzi-sdk.js
CHANGED
|
@@ -575,7 +575,7 @@ return Ee(zE,{value:a,children:e})},UP={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(UP,{cancelServerAction:l,runServerAction:s},{runServerAction:{params:e=>{let t=Xh(UP.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},KP={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:{}}},QP=({children:e,authProvider:t="basic"})=>{let{login:n,refresh:r,logout:i}=pe(bE),{useInteractions:a}=pe(zE),o=he(e=>n(e),[n]),s=he(e=>r(e),[r]),l=he(()=>i(),[i]);return a({id:"auth",callbacks:ve(()=>""===t?{}:ef(KP,{login:o,refreshDetails:s,logout:l}),[o,l,s,t])}),e},YP={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:""}}}},XP=({children:e,actions:t})=>{let{useInteractions:n}=pe(zE),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(YP,{hostAction:r}),[r])}),e},ZP={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"}}}},eR=({children:e,previewMode:t=!1})=>{let{useInteractions:n}=pe(zE),[[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:$(r,"attributes.name",n),defaultPage:$(r,"attributes.default",!1)}]},[])},[i,r]),s=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(ZP.navigate.params);return ef(ZP,{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},tR={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:""}}}},nR=0,rR=({children:e})=>{let{useInteractions:t}=pe(zE),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${++nR}-${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(tR,{setState:r,toggleState:i,appendState:o,removeState:s,moveState:l,toggleInState:c,clearState:u}),[r,i,o,s,l,c,u])}),e},iR=({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(BP,{currentPageId:a,routeParams:r,queryParams:i,children:/* @__PURE__ */Ee(QP,{authProvider:n,children:/* @__PURE__ */Ee(rR,{children:/* @__PURE__ */Ee(JP,{children:/* @__PURE__ */Ee(eR,{previewMode:o,children:/* @__PURE__ */Ee(XP,{actions:t,children:e})})})})})})},aR=se({});aR.displayName="StyleContext";var oR,sR,lR=({children:e,style:t})=>{let{style:n}=pe(ch),r=ve(()=>({}),[]);return i("style",t??(n||Qp)),/* @__PURE__ */Ee(aR,{value:r,children:e})},cR="/plitzi-sdk.css",uR=({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(NE,{webKey:t,webId:n,instanceId:d,server:a,offlineMode:s,offlineData:l,offlineDataType:c,revision:e,children:/* @__PURE__ */Ee(EE,{children:/* @__PURE__ */Ee(CE,{sdkStylePath:cR,children:/* @__PURE__ */Ee(lR,{children:/* @__PURE__ */Ee(AP,{onInit:x,debugMode:y,children:/* @__PURE__ */Ee(qI,{children:/* @__PURE__ */Ee(iO,{server:a,children:/* @__PURE__ */Ie(xE,{currentPageId:i,children:[/* @__PURE__ */Ee(yE,{analytics:v}),/* @__PURE__ */Ee(OP,{children:/* @__PURE__ */Ee(iR,{hostActions:w,children:/* @__PURE__ */Ee(IP,{enabled:y,instanceId:d,devToolsStyleLink:m||"/plitzi-sdk-devtools.css",renderMode:"shadow",innerClassName:vt({flex:"iframe"===h}),children:/* @__PURE__ */Ee(VI,{sdkStylePath:cR,server:a,...N})})})})]})})})})})})})})},dR=({className:e,scoped:t=!1,children:n})=>{const{theme:r}=Ch();/* @__PURE__ */
|
|
578
|
-
return Ee(OE,{className:vt(e,t&&"system"!==r&&r),children:n})},pR=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}),hR={Button:Pp,ContentEditable:_f,Input:Vp,Heading:LN,ContainerResizable:YN,ContainerCollapsable:KN,Text:lT,Markdown:Nw,ContainerTabs:iT},fR=({className:e="min-h-screen",children:t,webKey:n="",server:r,renderMode:i=De.renderMode,routing:a="browser",debugMode:o=!1,themeScope:s="document",theme:l,state:c,...u})=>{const d=ve(()=>Y(n,!0),[n]),p=ke(c).current,h=ve(()=>({segments:{},runtime:{sources:{},state:p??{}},render:De}),[p]),f=ve(()=>(e=>{let t=e?.split(":")[1];return t?`plitzi_debug_${t}`:"plitzi_debug"})("undefined"==typeof window?void 0:window.location.host),[]),[m,g]=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})(f)),y=o&&m,b=ve(()=>pR(r),[r]),v=ve(()=>((e,t)=>{const n=new zu({uri:e.serverUrl}),r=new Fc,i=new dE(e=>({headers:{...e.headers,"sdk-version":"0.34.
|
|
578
|
+
return Ee(OE,{className:vt(e,t&&"system"!==r&&r),children:n})},pR=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}),hR={Button:Pp,ContentEditable:_f,Input:Vp,Heading:LN,ContainerResizable:YN,ContainerCollapsable:KN,Text:lT,Markdown:Nw,ContainerTabs:iT},fR=({className:e="min-h-screen",children:t,webKey:n="",server:r,renderMode:i=De.renderMode,routing:a="browser",debugMode:o=!1,themeScope:s="document",theme:l,state:c,...u})=>{const d=ve(()=>Y(n,!0),[n]),p=ke(c).current,h=ve(()=>({segments:{},runtime:{sources:{},state:p??{}},render:De}),[p]),f=ve(()=>(e=>{let t=e?.split(":")[1];return t?`plitzi_debug_${t}`:"plitzi_debug"})("undefined"==typeof window?void 0:window.location.host),[]),[m,g]=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})(f)),y=o&&m,b=ve(()=>pR(r),[r]),v=ve(()=>((e,t)=>{const n=new zu({uri:e.serverUrl}),r=new Fc,i=new dE(e=>({headers:{...e.headers,"sdk-version":"0.34.1",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})})(b,n),[b,n]);me(()=>{},[]);const x=he(()=>{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=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:x}),me(()=>{},[o,m,f]),me(()=>{u.isHydrating&&B.setHydrated()},[u.isHydrating]);const k=ve(()=>{const e={};return ie.forEach(t,t=>{if(!ue(t))return;if(t.type!==RI)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&&b.requestUrl;const w="widget"===i?ae:"undefined"==typeof window?sE:"memory"===a?zC:eE,S="widget"===i?{}:{..."memory"===a&&"undefined"!=typeof window?{}:{basename:$(b,"basePath","/"),location:"undefined"==typeof window?b.requestUrl??"":void 0}};/* @__PURE__ */
|
|
579
579
|
return Ee(ct,{value:h,middlewares:[Ve(Jp("sdk")),Fh(d),...y?[()=>({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:s,theme:l,children:/* @__PURE__ */Ee(sT,{components:hR,children:/* @__PURE__ */Ee(dR,{scoped:"container"===s,className:vt("plitzi-sdk flex",e,{"sdk-debug-mode":y}),children:/* @__PURE__ */Ee(GS,{children:/* @__PURE__ */Ee(w,{...S,children:/* @__PURE__ */Ee(BN,{client:v,children:/* @__PURE__ */Ee(FN,{localCustomComponents:k,localComponents:gR,children:/* @__PURE__ */Ee(uR,{server:b,webKey:n,renderMode:i,debugMode:y,webId:d,...u})})})})})})})})})},mR=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(fR,{webKey:n,environment:r,renderMode:"widget",server:o,className:"h-full w-full"})})}),gR={plitziSdk:Object.assign(mR,{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($N,{})},defaultStyle:{name:"Plitzi Sdk",displayMode:"desktop",style:{base:{default:{}}}},settings:{}}})};function yR(e,t={},n={},r=!1,i=!1){const a=(e=>{if(e.analytics||e.offlineMode||!e.webKey)return e;const{apiServer:t}=pR(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=>{oR=e},[]),l=he(e=>{sR=e},[]);/* @__PURE__ */
|
|
581
|
-
return Ee(fR,{...a,debugMode:o,isHydrating:e,onInitStateManager:s,onInitEventBridge:l,children:i.filter(e=>!!n[e].component).map(e=>/* @__PURE__ */Ee(VI.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 bR=({debugMode:e=!1,isHydrating:t=!1,children:n,webKey:r="",environment:i="main",renderMode:a=De.renderMode,...o})=>/* @__PURE__ */Ee(fR,{...o,isHydrating:t,renderMode:a,debugMode:e,webKey:r,environment:i,children:n});bR.Plugin=VI.Plugin;var vR=U,xR="0.34.
|
|
581
|
+
return Ee(fR,{...a,debugMode:o,isHydrating:e,onInitStateManager:s,onInitEventBridge:l,children:i.filter(e=>!!n[e].component).map(e=>/* @__PURE__ */Ee(VI.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 bR=({debugMode:e=!1,isHydrating:t=!1,children:n,webKey:r="",environment:i="main",renderMode:a=De.renderMode,...o})=>/* @__PURE__ */Ee(fR,{...o,isHydrating:t,renderMode:a,debugMode:e,webKey:r,environment:i,children:n});bR.Plugin=VI.Plugin;var vR=U,xR="0.34.1",kR=()=>oR,wR=()=>sR;export{X as ComponentContext,FN as ComponentProvider,hf as JsxManager,A as PlitziServiceProvider,wf as PluginManager,z as PluginRemote,gN as ReplicaProvider,cf as RootElement,bR as default,wR as getEventBridge,kR as getStateManager,$h as n,yR as render,gR as sdkComponents,uf as t,gE as track,Wh as useElement,vR as usePlitziServiceContext,Gh as useRscData,jh as useRscRefresh,F as useStore,xR 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.34.
|
|
3
|
+
"version": "0.34.1",
|
|
4
4
|
"homepage": "./",
|
|
5
5
|
"license": "AGPL-3.0",
|
|
6
6
|
"files": [
|
|
@@ -33,24 +33,21 @@
|
|
|
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.34.
|
|
37
|
-
"@plitzi/sdk-dev-tools": "0.34.
|
|
38
|
-
"@plitzi/sdk-elements": "0.34.
|
|
39
|
-
"@plitzi/sdk-event-bridge": "0.34.
|
|
40
|
-
"@plitzi/sdk-interactions": "0.34.
|
|
41
|
-
"@plitzi/sdk-navigation": "0.34.
|
|
42
|
-
"@plitzi/sdk-plugins": "0.34.
|
|
43
|
-
"@plitzi/sdk-schema": "0.34.
|
|
44
|
-
"@plitzi/sdk-shared": "0.34.
|
|
45
|
-
"@plitzi/sdk-style": "0.34.
|
|
46
|
-
"@plitzi/sdk-variables": "0.34.
|
|
36
|
+
"@plitzi/sdk-auth": "0.34.1",
|
|
37
|
+
"@plitzi/sdk-dev-tools": "0.34.1",
|
|
38
|
+
"@plitzi/sdk-elements": "0.34.1",
|
|
39
|
+
"@plitzi/sdk-event-bridge": "0.34.1",
|
|
40
|
+
"@plitzi/sdk-interactions": "0.34.1",
|
|
41
|
+
"@plitzi/sdk-navigation": "0.34.1",
|
|
42
|
+
"@plitzi/sdk-plugins": "0.34.1",
|
|
43
|
+
"@plitzi/sdk-schema": "0.34.1",
|
|
44
|
+
"@plitzi/sdk-shared": "0.34.1",
|
|
45
|
+
"@plitzi/sdk-style": "0.34.1",
|
|
46
|
+
"@plitzi/sdk-variables": "0.34.1",
|
|
47
47
|
"clsx": "^2.1.1",
|
|
48
48
|
"graphql": "^17.0.2",
|
|
49
49
|
"immer": "^11.1.18",
|
|
50
|
-
"react-router-dom": "^7.18.3"
|
|
51
|
-
"vite": "^8.3.0",
|
|
52
|
-
"vite-plugin-dts": "^5.1.0",
|
|
53
|
-
"vite-plugin-react": "^4.0.1"
|
|
50
|
+
"react-router-dom": "^7.18.3"
|
|
54
51
|
},
|
|
55
52
|
"peerDependencies": {
|
|
56
53
|
"react": "^19",
|
|
@@ -77,6 +74,7 @@
|
|
|
77
74
|
"@storybook/testing-library": "^0.2.2",
|
|
78
75
|
"@tailwindcss/postcss": "^4.3.3",
|
|
79
76
|
"@types/ejs": "^3.1.5",
|
|
77
|
+
"@vitejs/plugin-react": "^6.1.1",
|
|
80
78
|
"css-loader": "^7.1.5",
|
|
81
79
|
"eslint": "^9.39.5",
|
|
82
80
|
"eslint-plugin-import": "^2.32.0",
|
|
@@ -101,6 +99,7 @@
|
|
|
101
99
|
"typescript": "^6.0.3",
|
|
102
100
|
"vite": "^8.3.0",
|
|
103
101
|
"vite-plugin-compression": "^0.5.1",
|
|
102
|
+
"vite-plugin-dts": "^5.1.0",
|
|
104
103
|
"vite-plugin-ejs": "^2.0.0",
|
|
105
104
|
"vite-plugin-mkcert": "^2.1.0",
|
|
106
105
|
"vitest": "^5.0.0"
|