@plitzi/plitzi-builder 0.35.6 → 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 +27 -0
- package/dist/modules/Space/Models/SpaceCredentialForm.d.ts +6 -1
- package/dist/modules/Space/components/SpaceCredentials/SpaceCredential.d.ts +2 -1
- package/dist/modules/Space/components/SpaceCredentials/SpaceCredentials.d.ts +3 -1
- package/dist/package.json.d.ts +1 -1
- package/dist/plitzi-builder.js +14 -15
- package/dist/plitzi-builder.js.gz +0 -0
- package/package.json +13 -13
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
# @plitzi/plitzi-builder
|
|
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/plitzi-sdk@0.35.7
|
|
18
|
+
- @plitzi/sdk-auth@0.35.7
|
|
19
|
+
- @plitzi/sdk-dev-tools@0.35.7
|
|
20
|
+
- @plitzi/sdk-elements@0.35.7
|
|
21
|
+
- @plitzi/sdk-event-bridge@0.35.7
|
|
22
|
+
- @plitzi/sdk-interactions@0.35.7
|
|
23
|
+
- @plitzi/sdk-navigation@0.35.7
|
|
24
|
+
- @plitzi/sdk-plugins@0.35.7
|
|
25
|
+
- @plitzi/sdk-schema@0.35.7
|
|
26
|
+
- @plitzi/sdk-shared@0.35.7
|
|
27
|
+
- @plitzi/sdk-style@0.35.7
|
|
28
|
+
- @plitzi/sdk-variables@0.35.7
|
|
29
|
+
|
|
3
30
|
## 0.35.6
|
|
4
31
|
|
|
5
32
|
### Patch Changes
|
|
@@ -51,8 +51,13 @@ export type SpaceCredentialFormProps = {
|
|
|
51
51
|
user?: string;
|
|
52
52
|
pass?: string;
|
|
53
53
|
token?: string;
|
|
54
|
+
/**
|
|
55
|
+
* Replaces the values of a credential that already exists. Its provider is fixed — a CDN, a deployment or a flow
|
|
56
|
+
* reads its keys as that provider's — and nothing it holds is shown: every value is typed again and all are replaced.
|
|
57
|
+
*/
|
|
58
|
+
editing?: boolean;
|
|
54
59
|
onClose?: (e?: MouseEvent) => void;
|
|
55
60
|
onSubmit?: (e: MouseEvent | undefined, values: z.infer<typeof spaceCredentialFormSchema>) => void;
|
|
56
61
|
};
|
|
57
|
-
declare const SpaceCredentialForm: ({ name, provider, accessKeyId, secretAccessKey, type, user, pass, token, onSubmit, onClose }: SpaceCredentialFormProps) => import("react").JSX.Element;
|
|
62
|
+
declare const SpaceCredentialForm: ({ name, provider, accessKeyId, secretAccessKey, type, user, pass, token, editing, onSubmit, onClose }: SpaceCredentialFormProps) => import("react").JSX.Element;
|
|
58
63
|
export default SpaceCredentialForm;
|
|
@@ -13,7 +13,8 @@ export type SpaceCredentialProps = {
|
|
|
13
13
|
createdAt: number;
|
|
14
14
|
updatedAt: number;
|
|
15
15
|
onSelect?: (identifier: string) => void;
|
|
16
|
+
onEdit?: (identifier: string) => void;
|
|
16
17
|
onRemove?: (identifier: string) => void;
|
|
17
18
|
};
|
|
18
|
-
declare const SpaceCredential: ({ providersSupported, identifier, name, provider, selected, inUse, usedIn, createdAt, onSelect, onRemove }: SpaceCredentialProps) => import("react").JSX.Element;
|
|
19
|
+
declare const SpaceCredential: ({ providersSupported, identifier, name, provider, selected, inUse, usedIn, createdAt, onSelect, onEdit, onRemove }: SpaceCredentialProps) => import("react").JSX.Element;
|
|
19
20
|
export default SpaceCredential;
|
|
@@ -4,7 +4,9 @@ export type SpaceCredentialsProps = {
|
|
|
4
4
|
credentials?: TSpaceCredential[];
|
|
5
5
|
selected?: string;
|
|
6
6
|
onSelect?: (identifier: string) => void;
|
|
7
|
+
/** Offers replacing a credential's values. Left out, a row offers nothing but selecting and removing it. */
|
|
8
|
+
onEdit?: (identifier: string) => void;
|
|
7
9
|
onRemove?: (identifier: string) => void;
|
|
8
10
|
};
|
|
9
|
-
declare const SpaceCredentials: ({ providersSupported, credentials, selected, onSelect, onRemove }: SpaceCredentialsProps) => import("react").JSX.Element;
|
|
11
|
+
declare const SpaceCredentials: ({ providersSupported, credentials, selected, onSelect, onEdit, onRemove }: SpaceCredentialsProps) => import("react").JSX.Element;
|
|
10
12
|
export default SpaceCredentials;
|
package/dist/package.json.d.ts
CHANGED
package/dist/plitzi-builder.js
CHANGED
|
@@ -3639,10 +3639,9 @@ return T(uPe,{className:"relative flex grow basis-0",rounded:"none",children:/*
|
|
|
3639
3639
|
return P("div",{className:"flex min-h-80 grow flex-col gap-2",children:[
|
|
3640
3640
|
/* @__PURE__ */T(aTe,{value:e,theme:r,mode:"json",lineWrapping:!0,autoComplete:i,onChange:n}),t&&/* @__PURE__ */T("span",{className:"text-xs text-red-600",children:t}),
|
|
3641
3641
|
/* @__PURE__ */P("span",{className:"text-xs text-gray-500 dark:text-zinc-400",children:["Reference a credential by key — ",
|
|
3642
|
-
/* @__PURE__ */T("code",{children:"{{credential.token}}"})," resolves on the server. The secret itself never leaves it, and neither does this manifest."]})]})},v3e=e=>{if("r2"===e.provider||"s3"===e.provider)return{accessKeyId:e.accessKeyId,secretAccessKey:e.secretAccessKey};if("custom"===e.provider)return JSON.parse(e.data);if("smtp"===e.provider){const{host:t,port:n,security:r,username:i,password:a,fromEmail:o,fromName:s}=e;return{host:t,port:n,security:r,username:i,password:a,fromEmail:o,fromName:s}}return e.fields};eQ(),r$();var b3e={host:"",port:"587",security:"starttls",username:"",password:"",fromEmail:"",fromName:""},y3e=["host","port","security","username","password","fromEmail","fromName"],x3e=qY("provider",[FY({provider:HY("s3"),name:IY().min(2),accessKeyId:IY().min(1),secretAccessKey:IY().min(1)}),FY({provider:HY("r2"),name:IY().min(2),accessKeyId:IY().min(1),secretAccessKey:IY().min(1)}),FY({provider:HY("custom"),name:IY().min(2),data:IY().min(2).refine(e=>{try{const t=JSON.parse(e);return null!==t&&"object"==typeof t&&!Array.isArray(t)}catch{return!1}},'Expected a JSON object, for example { "token": "…" }')}),FY({provider:HY("smtp"),name:IY().min(2),host:IY(),port:IY(),security:UY(["starttls","tls","none"]),username:IY(),password:IY(),fromEmail:IY(),fromName:IY()}).superRefine((e,t)=>{(e=>{let t=G5e(e,"host"),n=Number(G5e(e,"port")),r=G5e(e,"security"),i=G5e(e,"username"),a="string"==typeof e.password?e.password:"",o=G5e(e,"fromEmail"),s=G5e(e,"fromName"),l=[];return Z5e.test(t)||l.push({key:"host",message:"A host name like smtp.example.com, with no scheme and no port"}),(!Number.isInteger(n)||n<1||n>65535)&&l.push({key:"port",message:"A port number, usually 587 or 465"}),X5e(r)||l.push({key:"security",message:"One of tls, starttls or none"}),""!==a&&""===i&&l.push({key:"username",message:"A password needs the user it belongs to"}),(e=>Y5e.test(e))(o)||l.push({key:"fromEmail",message:"The one address this server sends as"}),(/[\r\n]/.test(s)||s.length>100)&&l.push({key:"fromName",message:"One line of at most 100 characters"}),l.length>0||!X5e(r)?{problems:l}:{settings:{host:t,port:n,security:r,username:i,password:a,fromEmail:o,fromName:s},problems:[]}})(e).problems.forEach(e=>t.addIssue({code:"custom",path:[e.key],message:e.message}))}),FY({provider:HY("ssr"),name:IY().min(2),fields:qY("type",[FY({type:HY("basic"),user:IY().min(2).max(20),pass:IY().min(2).max(50)}),FY({type:HY("token"),token:IY().min(10).max(100)})])})]),w3e=({name:e,provider:t,accessKeyId:n,secretAccessKey:r,type:i,user:a,pass:o,token:s})=>"ssr"===t?{name:e,provider:t,fields:{type:i,..."basic"===i?{user:a,pass:o}:{token:s}}}:"custom"===t?{name:e,provider:t,data:'{\n "token": ""\n}'}:"smtp"===t?{name:e,provider:t,...b3e}:{name:e,provider:t,accessKeyId:n,secretAccessKey:r},O3e=({name:e="New Credential",provider:t="s3",accessKeyId:n="",secretAccessKey:r="",type:i="basic",user:a="",pass:o="",token:s="",
|
|
3643
|
-
return P(GDe,{form:
|
|
3644
|
-
/* @__PURE__ */T(GDe.Input,{name:"name",label:"Name",size:"xs"}),
|
|
3645
|
-
/* @__PURE__ */P(GDe.Select,{name:"provider",label:"Provider",size:"xs",onChange:h,children:[
|
|
3642
|
+
/* @__PURE__ */T("code",{children:"{{credential.token}}"})," resolves on the server. The secret itself never leaves it, and neither does this manifest."]})]})},v3e=e=>{if("r2"===e.provider||"s3"===e.provider)return{accessKeyId:e.accessKeyId,secretAccessKey:e.secretAccessKey};if("custom"===e.provider)return JSON.parse(e.data);if("smtp"===e.provider){const{host:t,port:n,security:r,username:i,password:a,fromEmail:o,fromName:s}=e;return{host:t,port:n,security:r,username:i,password:a,fromEmail:o,fromName:s}}return e.fields};eQ(),r$();var b3e={host:"",port:"587",security:"starttls",username:"",password:"",fromEmail:"",fromName:""},y3e=["host","port","security","username","password","fromEmail","fromName"],x3e=qY("provider",[FY({provider:HY("s3"),name:IY().min(2),accessKeyId:IY().min(1),secretAccessKey:IY().min(1)}),FY({provider:HY("r2"),name:IY().min(2),accessKeyId:IY().min(1),secretAccessKey:IY().min(1)}),FY({provider:HY("custom"),name:IY().min(2),data:IY().min(2).refine(e=>{try{const t=JSON.parse(e);return null!==t&&"object"==typeof t&&!Array.isArray(t)}catch{return!1}},'Expected a JSON object, for example { "token": "…" }')}),FY({provider:HY("smtp"),name:IY().min(2),host:IY(),port:IY(),security:UY(["starttls","tls","none"]),username:IY(),password:IY(),fromEmail:IY(),fromName:IY()}).superRefine((e,t)=>{(e=>{let t=G5e(e,"host"),n=Number(G5e(e,"port")),r=G5e(e,"security"),i=G5e(e,"username"),a="string"==typeof e.password?e.password:"",o=G5e(e,"fromEmail"),s=G5e(e,"fromName"),l=[];return Z5e.test(t)||l.push({key:"host",message:"A host name like smtp.example.com, with no scheme and no port"}),(!Number.isInteger(n)||n<1||n>65535)&&l.push({key:"port",message:"A port number, usually 587 or 465"}),X5e(r)||l.push({key:"security",message:"One of tls, starttls or none"}),""!==a&&""===i&&l.push({key:"username",message:"A password needs the user it belongs to"}),(e=>Y5e.test(e))(o)||l.push({key:"fromEmail",message:"The one address this server sends as"}),(/[\r\n]/.test(s)||s.length>100)&&l.push({key:"fromName",message:"One line of at most 100 characters"}),l.length>0||!X5e(r)?{problems:l}:{settings:{host:t,port:n,security:r,username:i,password:a,fromEmail:o,fromName:s},problems:[]}})(e).problems.forEach(e=>t.addIssue({code:"custom",path:[e.key],message:e.message}))}),FY({provider:HY("ssr"),name:IY().min(2),fields:qY("type",[FY({type:HY("basic"),user:IY().min(2).max(20),pass:IY().min(2).max(50)}),FY({type:HY("token"),token:IY().min(10).max(100)})])})]),w3e=({name:e,provider:t,accessKeyId:n,secretAccessKey:r,type:i,user:a,pass:o,token:s})=>"ssr"===t?{name:e,provider:t,fields:{type:i,..."basic"===i?{user:a,pass:o}:{token:s}}}:"custom"===t?{name:e,provider:t,data:'{\n "token": ""\n}'}:"smtp"===t?{name:e,provider:t,...b3e}:{name:e,provider:t,accessKeyId:n,secretAccessKey:r},O3e=({name:e="New Credential",provider:t="s3",accessKeyId:n="",secretAccessKey:r="",type:i="basic",user:a="",pass:o="",token:s="",editing:l=!1,onSubmit:c,onClose:d})=>{const u=qDe({defaultValues:w3e({name:e,provider:t,accessKeyId:n,secretAccessKey:r,type:i,user:a,pass:o,token:s}),config:{schema:x3e}}),h=g(e=>c?.(void 0,e),[c]),f=g(e=>{u.formMethods.resetField("fields"),u.formMethods.resetField("accessKeyId"),u.formMethods.resetField("secretAccessKey"),u.formMethods.resetField("data"),"custom"===e&&u.formMethods.setValue("data",'{\n "token": ""\n}'),"smtp"===e&&y3e.forEach(e=>u.formMethods.setValue(e,b3e[e])),"ssr"===e&&u.formMethods.setValue("fields",{type:"basic",user:"",pass:""})},[u.formMethods]);/* @__PURE__ */
|
|
3643
|
+
return P(GDe,{form:u,onSubmit:h,className:"gap-4",children:[/* @__PURE__ */P(GDe.Body,{children:[
|
|
3644
|
+
/* @__PURE__ */T(GDe.Input,{name:"name",label:"Name",size:"xs"}),l&&/* @__PURE__ */T("span",{className:"text-xs text-gray-500 dark:text-zinc-400",children:"The values this credential holds are never shown. Enter them all again: saving replaces every one."}),!l&&/* @__PURE__ */P(GDe.Select,{name:"provider",label:"Provider",size:"xs",onChange:f,children:[
|
|
3646
3645
|
/* @__PURE__ */T("option",{value:"s3",children:"AWS S3"}),
|
|
3647
3646
|
/* @__PURE__ */T("option",{value:"r2",children:"Cloudflare R2"}),
|
|
3648
3647
|
/* @__PURE__ */T("option",{value:"ssr",children:"Plitzi SSR"}),
|
|
@@ -3664,15 +3663,15 @@ return P(GDe,{form:d,onSubmit:u,className:"gap-4",children:[/* @__PURE__ */P(GDe
|
|
|
3664
3663
|
/* @__PURE__ */P(GDe.Conditional,{when:"provider",is:"ssr",children:[
|
|
3665
3664
|
/* @__PURE__ */P(GDe.Select,{name:"fields.type",label:"Auth Type",size:"xs",children:[/* @__PURE__ */T("option",{value:"basic",children:"Basic"}),/* @__PURE__ */T("option",{value:"token",children:"Token"})]}),
|
|
3666
3665
|
/* @__PURE__ */P(GDe.Conditional,{when:"fields.type",is:"basic",children:[/* @__PURE__ */T(GDe.Input,{name:"fields.user",label:"User",size:"xs"}),/* @__PURE__ */T(GDe.Input,{name:"fields.pass",label:"Password",size:"xs",type:"password"})]}),
|
|
3667
|
-
/* @__PURE__ */T(GDe.Conditional,{when:"fields.type",is:"token",children:/* @__PURE__ */T(GDe.Input,{name:"fields.token",label:"Token",size:"xs"})})]})]}),/* @__PURE__ */P(GDe.Footer,{justify:"end",children:[/* @__PURE__ */T(Yj,{onClick:
|
|
3666
|
+
/* @__PURE__ */T(GDe.Conditional,{when:"fields.type",is:"token",children:/* @__PURE__ */T(GDe.Input,{name:"fields.token",label:"Token",size:"xs"})})]})]}),/* @__PURE__ */P(GDe.Footer,{justify:"end",children:[/* @__PURE__ */T(Yj,{onClick:d,size:"sm",children:"Cancel"}),/* @__PURE__ */T(Yj,{type:"submit",size:"sm",children:l?"Save":"Submit"})]})]})};KV();var k3e=({children:e})=>/* @__PURE__ */P("div",{className:"flex flex-col items-center justify-center gap-6 rounded border border-dashed border-gray-300 p-10 dark:border-zinc-600",children:[/* @__PURE__ */P("div",{className:"flex flex-col items-center justify-center gap-2",children:[
|
|
3668
3667
|
/* @__PURE__ */T(Uj,{icon:"fa-solid fa-key",size:"custom",className:"fa-2x rounded-full bg-gray-400 p-4"}),
|
|
3669
3668
|
/* @__PURE__ */T(FGe,{children:"No credentials yet"}),
|
|
3670
|
-
/* @__PURE__ */T(FGe,{className:"text-gray-400 dark:text-zinc-500",children:"Add your first credential to start managing your credentials"})]}),e]});KV(),ka(),h1();var S3e=({providersSupported:e,identifier:t,name:n,provider:r,selected:i=!1,inUse:a=!1,usedIn:o=[],createdAt:s,onSelect:l,onRemove:
|
|
3671
|
-
return P("div",{className:ca("group relative flex flex-col gap-2 rounded border p-2",{"hover:bg-primary-100/30 border-gray-300 dark:border-zinc-700":!i&&
|
|
3669
|
+
/* @__PURE__ */T(FGe,{className:"text-gray-400 dark:text-zinc-500",children:"Add your first credential to start managing your credentials"})]}),e]});KV(),ka(),h1();var S3e=({providersSupported:e,identifier:t,name:n,provider:r,selected:i=!1,inUse:a=!1,usedIn:o=[],createdAt:s,onSelect:l,onEdit:c,onRemove:d})=>{const u=k(()=>!e||!e.length||e.includes(r),[r,e]),h=k(()=>ky(s,"MMMM dd, yyyy"),[s]),f=k(()=>o.map(e=>`${e.usedFrom}:${e.name}`).join(", "),[o]),p=g(e=>{e.stopPropagation(),u&&l?.(t)},[t,u,l]),m=g(e=>{e.stopPropagation(),c?.(t)},[t,c]),v=g(e=>{e.stopPropagation(),d?.(t)},[t,d]);/* @__PURE__ */
|
|
3670
|
+
return P("div",{className:ca("group relative flex flex-col gap-2 rounded border p-2",{"hover:bg-primary-100/30 border-gray-300 dark:border-zinc-700":!i&&u,"border-primary-400 bg-primary-100/50 dark:bg-primary-500/20":i&&u,"cursor-pointer":u,"cursor-not-allowed border-gray-300 bg-gray-100 opacity-70 dark:border-zinc-700 dark:bg-zinc-800":!u}),onClick:p,children:[
|
|
3672
3671
|
/* @__PURE__ */P("div",{className:"flex items-center justify-between",children:[/* @__PURE__ */T(dTe,{as:"h6",children:n}),i&&/* @__PURE__ */T("div",{className:"flex",children:/* @__PURE__ */T(Uj,{size:"2xl",intent:"primaryActive",icon:"fa-solid fa-circle-check",className:"cursor-default"})})]}),
|
|
3673
|
-
/* @__PURE__ */P("div",{className:"flex items-center gap-2",children:["r2"===r&&/* @__PURE__ */P(A,{children:[/* @__PURE__ */T(Uj,{icon:"fa-brands fa-cloudflare"}),"Cloudflare R2"]}),"s3"===r&&/* @__PURE__ */P(A,{children:[/* @__PURE__ */T(Uj,{icon:"fa-brands fa-aws"}),"Amazon S3"]}),"ssr"===r&&/* @__PURE__ */P(A,{children:[/* @__PURE__ */T(Uj,{icon:"fa-solid fa-server"}),"Plitzi SSR"]}),"custom"===r&&/* @__PURE__ */P(A,{children:[/* @__PURE__ */T(Uj,{icon:"fa-solid fa-plug"}),"API / CMS"]}),a&&/* @__PURE__ */T("span",{title:
|
|
3674
|
-
/* @__PURE__ */P("div",{className:"text-xs text-gray-500 dark:text-zinc-400",children:["Created ",
|
|
3675
|
-
/* @__PURE__ */P("div",{className:"absolute right-2 bottom-2",children:[
|
|
3672
|
+
/* @__PURE__ */P("div",{className:"flex items-center gap-2",children:["r2"===r&&/* @__PURE__ */P(A,{children:[/* @__PURE__ */T(Uj,{icon:"fa-brands fa-cloudflare"}),"Cloudflare R2"]}),"s3"===r&&/* @__PURE__ */P(A,{children:[/* @__PURE__ */T(Uj,{icon:"fa-brands fa-aws"}),"Amazon S3"]}),"ssr"===r&&/* @__PURE__ */P(A,{children:[/* @__PURE__ */T(Uj,{icon:"fa-solid fa-server"}),"Plitzi SSR"]}),"custom"===r&&/* @__PURE__ */P(A,{children:[/* @__PURE__ */T(Uj,{icon:"fa-solid fa-plug"}),"API / CMS"]}),"smtp"===r&&/* @__PURE__ */P(A,{children:[/* @__PURE__ */T(Uj,{icon:"fa-solid fa-envelope"}),"SMTP (email)"]}),a&&/* @__PURE__ */T("span",{title:f,children:/* @__PURE__ */T(zGe,{intent:"info",solid:!1,size:"xs",icon:"fa-solid fa-link",children:"In Use"})}),!u&&/* @__PURE__ */T("span",{title:"This credential belongs to a provider that cannot be used here.",children:/* @__PURE__ */T(zGe,{intent:"warning",solid:!1,size:"xs",children:"Not Supported"})})]}),
|
|
3673
|
+
/* @__PURE__ */P("div",{className:"text-xs text-gray-500 dark:text-zinc-400",children:["Created ",h]}),
|
|
3674
|
+
/* @__PURE__ */P("div",{className:"absolute right-2 bottom-2 flex",children:[c&&/* @__PURE__ */T(Uj,{icon:"fas fa-pen",title:"Replace its values",size:"lg",className:"hidden cursor-pointer rounded p-4 group-hover:flex hover:bg-gray-200 dark:hover:bg-zinc-700",onClick:m}),!a&&/* @__PURE__ */T(Uj,{intent:"danger",icon:"fas fa-trash-alt",title:"Remove",size:"lg",className:"hidden cursor-pointer rounded p-4 group-hover:flex hover:bg-red-200 dark:hover:bg-red-900/40",onClick:v}),a&&/* @__PURE__ */T(Uj,{intent:"tertiary",icon:"fa-solid fa-circle-exclamation",size:"lg",title:"This credential is currently in use and cannot be removed.",className:"cursor-default p-4 hover:bg-transparent"})]})]})},C3e=({providersSupported:e,credentials:t,selected:n="",onSelect:r,onEdit:i,onRemove:a})=>/* @__PURE__ */T("div",{className:"flex max-h-75 flex-col gap-2 overflow-y-auto",children:t?.map(({name:t,identifier:o,provider:s,inUse:l,usedIn:c,createdAt:d,updatedAt:u})=>/* @__PURE__ */T(S3e,{providersSupported:e,identifier:o,name:t,selected:o===n,provider:s,inUse:l,usedIn:c,createdAt:d,updatedAt:u,onSelect:r,onEdit:i,onRemove:a},o),[])});eQ();var E3e=({providersSupported:e,credentials:t,credentialSelected:n,onClickAddCredential:r,onSelectCredential:i,onRemoveCredential:a})=>/* @__PURE__ */P(A,{children:[
|
|
3676
3675
|
/* @__PURE__ */P("div",{className:"flex flex-col",children:[/* @__PURE__ */T(dTe,{as:"h4",children:"My Credentials"}),/* @__PURE__ */T(FGe,{size:"sm",className:"text-gray-500 dark:text-zinc-400",children:"Manage your authentication credentials and API keys"})]}),t&&t.length>0&&/* @__PURE__ */P("div",{className:"flex items-center justify-between",children:[/* @__PURE__ */T("span",{children:1===t.length?`${t.length} credential configured`:`${t.length} credentials configured`}),/* @__PURE__ */T(Yj,{size:"xs",onClick:r,children:"Add Credential"})]}),t&&t.length>0&&/* @__PURE__ */T(C3e,{providersSupported:e,credentials:t,selected:n,onSelect:i,onRemove:a}),(!t||0===t.length)&&/* @__PURE__ */T(k3e,{children:/* @__PURE__ */T(Yj,{size:"xs",onClick:r,children:"Add Credential"})})]});eQ(),vQ(),DF();var N3e=({providersSupported:e,children:t,className:n,selected:r,onSelect:i})=>{const{mutate:a}=m(eF),[o,s]=E(r),[l,c]=E(void 0),d=g(e=>{e.stopPropagation()},[]),u=g(()=>{c({name:"",provider:e?.[0]??"r2",inUse:!1,usedIn:[]})},[e]),h=g(()=>c(void 0),[]),[f,p,v,b]=zje(),{data:y=[],mutate:x}=YLe(p?"SpaceCredentials":null,e=>e?.SpaceCredentials.edges,{});uV(()=>{p&&s(r)},[r,p]);const w=g(async(e,t)=>{(await a("SpaceAddCredential",{name:t.name,provider:t.provider,data:v3e(t)})).success&&(x(),c(void 0))},[x,a]),O=g(e=>{i?.(o),b(e)},[b,i,o]),k=g(e=>s(e),[]),S=g(async e=>{(await a("SpaceRemoveCredential",{identifier:e})).success&&(x(),c(void 0))},[x,a]);/* @__PURE__ */
|
|
3677
3676
|
return P(A,{children:[/* @__PURE__ */T("div",{className:n,onClick:v,children:t}),/* @__PURE__ */P(_Pe,{onClick:d,onClose:b,id:f,open:p,size:"sm",className:{card:"w-125"},children:[
|
|
3678
3677
|
/* @__PURE__ */P(_Pe.Header,{children:[/* @__PURE__ */T(_Pe.HeaderIcon,{icon:"fa-solid fa-key"}),"Space Credentials"]}),
|
|
@@ -3727,11 +3726,11 @@ return P("div",{className:"mx-auto flex w-full max-w-4xl grow basis-0 flex-col p
|
|
|
3727
3726
|
return T(uPe,{className:"relative flex grow basis-0",rounded:"none",children:/* @__PURE__ */P(uPe.Body,{grow:!0,children:[t&&/* @__PURE__ */T("div",{className:"p-4 text-sm text-gray-500",children:"Loading connectors…"}),!t&&n&&/* @__PURE__ */T("div",{className:"p-4 text-sm text-red-600",children:n}),!t&&!n&&!r&&/* @__PURE__ */T("div",{className:"mx-auto w-full max-w-4xl p-4 pb-0",children:/* @__PURE__ */T(lTe,{intent:"warning",size:"sm",solid:!1,children:/* @__PURE__ */P("div",{className:"flex flex-col gap-1 text-xs",children:[
|
|
3728
3727
|
/* @__PURE__ */T("span",{className:"font-medium",children:"This space has no server-rendered deployment."}),
|
|
3729
3728
|
/* @__PURE__ */T("span",{children:"Connectors resolve on the server before the page reaches the browser. A space published without server rendering has no server to resolve them."}),
|
|
3730
|
-
/* @__PURE__ */T("span",{children:"Connectors still work in the builder preview. To reach visitors, deploy the space with a Plitzi SSR credential."})]})})}),!t&&!n&&!p&&/* @__PURE__ */T(c4e,{connectors:h,onSelect:c,onRemove:x,onCreate:v}),!t&&!n&&p&&/* @__PURE__ */T(l4e,{connector:f,onSubmit:y,onCancel:b},f?.identifier??"new")]})})},h4e=()=>/* @__PURE__ */T(u4e,{});eQ(),DF();var f4e=()=>{const{mutate:e}=m(eF),{data:t=[],isLoading:n,mutate:r}=YLe("SpaceCredentials",e=>e?.SpaceCredentials.edges),{showDialog:i}=FPe(),[a,o]=E(void 0),s=g(()=>o("custom"),[]),l=g(()=>o(void 0),[]),
|
|
3731
|
-
return T(uPe,{className:"relative flex grow basis-0",rounded:"none",children:/* @__PURE__ */P(uPe.Body,{grow:!0,children:[n&&/* @__PURE__ */T("div",{className:"p-4 text-sm text-gray-500",children:"Loading credentials…"}),!n&&a&&/* @__PURE__ */T("div",{className:"mx-auto w-full max-w-3xl p-4",children:/* @__PURE__ */T(O3e,{provider:a,onSubmit:
|
|
3732
|
-
/* @__PURE__ */P("div",{className:"flex w-full items-center justify-between",children:[/* @__PURE__ */T(dTe,{as:"h5",children:"Credentials"}),/* @__PURE__ */T(Yj,{size:"sm",onClick:
|
|
3729
|
+
/* @__PURE__ */T("span",{children:"Connectors still work in the builder preview. To reach visitors, deploy the space with a Plitzi SSR credential."})]})})}),!t&&!n&&!p&&/* @__PURE__ */T(c4e,{connectors:h,onSelect:c,onRemove:x,onCreate:v}),!t&&!n&&p&&/* @__PURE__ */T(l4e,{connector:f,onSubmit:y,onCancel:b},f?.identifier??"new")]})})},h4e=()=>/* @__PURE__ */T(u4e,{});eQ(),DF();var f4e=()=>{const{mutate:e}=m(eF),{data:t=[],isLoading:n,mutate:r}=YLe("SpaceCredentials",e=>e?.SpaceCredentials.edges),{showDialog:i}=FPe(),[a,o]=E(void 0),[s,l]=E(void 0),c=g(()=>o("custom"),[]),d=g(e=>l(t.find(t=>t.identifier===e)),[t]),u=g(()=>{o(void 0),l(void 0)},[]),h=g(async(t,n)=>{(await e("SpaceAddCredential",{name:n.name,provider:n.provider,data:v3e(n)})).success&&(await r(),o(void 0))},[r,e]),f=g(async(t,n)=>{s&&(await e("SpaceUpdateCredential",{identifier:s.identifier,name:n.name,provider:n.provider,data:v3e(n)})).success&&(await r(),l(void 0))},[s,r,e]),p=g(async t=>{await i(/* @__PURE__ */T(_Pe.Header,{children:/* @__PURE__ */T("h4",{children:"Remove Credential"})}),/* @__PURE__ */T(_Pe.Body,{children:/* @__PURE__ */T("div",{className:"px-3 py-2",children:/* @__PURE__ */T("h4",{children:"Anything authenticating with this credential will stop working. Remove it?"})})}))&&(await e("SpaceRemoveCredential",{identifier:t})).success&&await r()},[r,e,i]);/* @__PURE__ */
|
|
3730
|
+
return T(uPe,{className:"relative flex grow basis-0",rounded:"none",children:/* @__PURE__ */P(uPe.Body,{grow:!0,children:[n&&/* @__PURE__ */T("div",{className:"p-4 text-sm text-gray-500",children:"Loading credentials…"}),!n&&a&&/* @__PURE__ */T("div",{className:"mx-auto w-full max-w-3xl p-4",children:/* @__PURE__ */T(O3e,{provider:a,onSubmit:h,onClose:u})}),!n&&s&&/* @__PURE__ */T("div",{className:"mx-auto w-full max-w-3xl p-4",children:/* @__PURE__ */T(O3e,{editing:!0,name:s.name,provider:s.provider,onSubmit:f,onClose:u},s.identifier)}),!n&&!a&&!s&&/* @__PURE__ */P("div",{className:"mx-auto flex w-full max-w-4xl grow basis-0 flex-col gap-4 p-4",children:[
|
|
3731
|
+
/* @__PURE__ */P("div",{className:"flex w-full items-center justify-between",children:[/* @__PURE__ */T(dTe,{as:"h5",children:"Credentials"}),/* @__PURE__ */T(Yj,{size:"sm",onClick:c,children:"New Credential"})]}),
|
|
3733
3732
|
/* @__PURE__ */T("span",{className:"text-xs text-gray-500 dark:text-zinc-400",children:"Secrets are encrypted at rest and only ever resolved on the server. A connector names the credential it needs; the value itself never reaches the browser or the published page."}),0===t.length&&/* @__PURE__ */T("div",{className:"rounded-sm border-2 border-dashed border-gray-300 p-4 text-center text-sm text-zinc-600 dark:border-zinc-600 dark:text-zinc-400",children:"No credentials yet. Add the CMS token your connector authenticates with."}),
|
|
3734
|
-
/* @__PURE__ */T(C3e,{credentials:t,onRemove:
|
|
3733
|
+
/* @__PURE__ */T(C3e,{credentials:t,onEdit:d,onRemove:p})]})]})})},p4e=()=>/* @__PURE__ */T(f4e,{});mi();var m4e=({previewMode:e=!1,externalStyle:t=""})=>{const[[n,r,i]]=Yn(["schema.settings","schema.pages","segments"]),a=k(()=>{let e=n.customCss;return"string"!=typeof e&&(e=""),[e,...Object.values(i).map(e=>e.style.cache)].join("\n")},[n.customCss,i]);/* @__PURE__ */
|
|
3735
3734
|
return P("div",{className:"flex w-full grow",children:[/* @__PURE__ */T(xGe,{externalStyle:t,customCss:a,pages:r}),!e&&/* @__PURE__ */T(iPe,{className:"max-h-[calc(100vh-48px)] overflow-y-auto",size:"md",placementTabs:"right",placement:"right",minWidth:335,maxWidth:800,canHide:!0})]})},g4e=()=>/* @__PURE__ */T(uPe,{children:/* @__PURE__ */T(uPe.Body,{children:"Test"})}),v4e=()=>/* @__PURE__ */T("div",{className:"flex grow basis-0 flex-col",children:"Coming Soon..."}),b4e=()=>/* @__PURE__ */T("div",{className:"flex grow basis-0 flex-col",children:"WWW"});eQ(),uQ(),h1();var y4e=({name:e="Plugin",description:t="Plugin Description",createdAt:n=0,icon:r="",revisions:i,owner:a="Plitzi",website:o="https://plitzi.com",color:s="",version:l,latestVersion:c,onAdd:d,onUpdate:u,onRemove:h})=>{const f=k(()=>ky(n,"MMMM dd, yyyy"),[n]),[p,m]=E(()=>{let e=l;return l||(e=c),e}),v=g(e=>m(e),[m]),b=g(()=>{l?h?.():d?.(p)},[d,h,l,p]),y=g(async()=>{await(u?.(c))&&m(c)},[c,u]);/* @__PURE__ */
|
|
3736
3735
|
return P("div",{className:"flex w-75 flex-col",children:[
|
|
3737
3736
|
/* @__PURE__ */P("div",{className:"flex flex-col rounded-sm border border-gray-300 p-4 dark:border-zinc-700",children:[
|
|
@@ -4112,5 +4111,5 @@ return T(XB,{value:q,children:e})};Gp(),y1(),IR(),DF(),LF(),JJ(),mi();var flt=({
|
|
|
4112
4111
|
return T(mK,{value:U,children:e})},plt=l({});plt.displayName="StyleContext",y1(),DF(),mi(),zF();var mlt=({children:e,style:t,includeSubscriptions:n=!0,middlewares:r=[]})=>{let{subscriptionManager:i}=m(eF),[a,o]=$it(slt,t??lB,r);Fn("style",a);let s=g((e,t=!1)=>o({type:olt.STYLE_UPDATE,style:e,fromSubscriptions:t}),[o]),l=g((e,t,n,r,i,a,s=!1)=>{t||=Lje(n),o({type:olt.STYLE_ADD_SELECTOR,displayMode:e,selector:t,selectorType:n,path:r,value:i,params:a,fromSubscriptions:s})},[o]),c=g((e,t,n,r,i,a=!1)=>o({type:olt.STYLE_UPDATE_SELECTOR,displayMode:e,selector:t,path:n,value:r,params:i,fromSubscriptions:a}),[o]),d=g((e,t,n=!1)=>o({type:olt.STYLE_REMOVE_SELECTOR,displayMode:e,selector:t,fromSubscriptions:n}),[o]),u=g((e,t,n=!1)=>o({type:olt.STYLE_REMOVE_SELECTORS,displayMode:e,selectors:t,fromSubscriptions:n}),[o]),h=g((e,t,n,r,i,a=!1)=>{o({type:olt.STYLE_ADD_SELECTOR_VARIABLE,displayMode:e,selector:t,category:n,name:r,value:i,fromSubscriptions:a})},[o]),f=g((e,t,n,r,i,a=!1)=>{o({type:olt.STYLE_UPDATE_SELECTOR_VARIABLE,displayMode:e,selector:t,category:n,name:r,value:i,fromSubscriptions:a})},[o]),p=g((e,t,n,r,i=!1)=>{o({type:olt.STYLE_REMOVE_SELECTOR_VARIABLE,displayMode:e,selector:t,category:n,name:r,fromSubscriptions:i})},[o]),v=g((e,t,n,r=!1)=>o({type:olt.STYLE_ADD_VARIABLE,category:e,name:t,value:n,fromSubscriptions:r}),[o]),b=g((e,t,n,r=!1)=>o({type:olt.STYLE_UPDATE_VARIABLE,category:e,name:t,value:n,fromSubscriptions:r}),[o]),x=g((e,t,n=!1)=>o({type:olt.STYLE_REMOVE_VARIABLE,category:e,name:t,fromSubscriptions:n}),[o]),w=g((e,t=!1)=>o({type:olt.STYLE_ADD_FONT,font:e,fromSubscriptions:t}),[o]),O=g((e,t,n=!1)=>o({type:olt.STYLE_UPDATE_FONT,family:e,font:t,fromSubscriptions:n}),[o]),S=g((e,t=!1)=>o({type:olt.STYLE_REMOVE_FONT,family:e,fromSubscriptions:t}),[o]),C=g((e,t=!1)=>o({type:olt.STYLE_ADD_TEMPLATE,platform:e,fromSubscriptions:t}),[o]),E=g((e,t,n=!1)=>{o({type:olt.STYLE_UPDATE_SETTINGS,path:e,value:t,fromSubscriptions:n})},[o]);y(()=>{if(n)return i.subscribe("STYLE_UPDATED",e=>s(e,!0)),i.subscribe("STYLE_ADD_SELECTOR",({displayMode:e,selector:t,type:n,path:r,style:i,params:a})=>l(e,t,n,r,i,a,!0)),i.subscribe("STYLE_UPDATE_SELECTOR",({displayMode:e,selector:t,path:n,style:r,params:i})=>c(e,t,n,r,i,!0)),i.subscribe("STYLE_REMOVE_SELECTOR",({displayMode:e,selector:t})=>d(e,t,!0)),i.subscribe("STYLE_REMOVE_SELECTORS",({displayMode:e,selectors:t})=>u(e,t,!0)),i.subscribe("STYLE_ADD_SELECTOR_VARIABLE",({displayMode:e,selector:t,category:n,name:r,value:i})=>h(e,t,n,r,i,!0)),i.subscribe("STYLE_UPDATE_SELECTOR_VARIABLE",({displayMode:e,selector:t,category:n,name:r,value:i})=>f(e,t,n,r,i,!0)),i.subscribe("STYLE_REMOVE_SELECTOR_VARIABLE",({displayMode:e,selector:t,category:n,name:r})=>p(e,t,n,r,!0)),i.subscribe("STYLE_ADD_VARIABLE",({category:e,name:t,value:n})=>v(e,t,n,!0)),i.subscribe("STYLE_UPDATE_VARIABLE",({category:e,name:t,value:n})=>b(e,t,n,!0)),i.subscribe("STYLE_REMOVE_VARIABLE",({category:e,name:t})=>x(e,t,!0)),i.subscribe("STYLE_ADD_FONT",({font:e})=>w(e,!0)),i.subscribe("STYLE_UPDATE_FONT",({family:e,font:t})=>O(e,t,!0)),i.subscribe("STYLE_REMOVE_FONT",({family:e})=>S(e,!0)),i.subscribe("STYLE_UPDATE_SETTINGS",({path:e,value:t})=>E(e,t,!0)),()=>i.unsubscribe(["STYLE_UPDATED","STYLE_ADD_SELECTOR","STYLE_UPDATE_SELECTOR","STYLE_REMOVE_SELECTOR","STYLE_REMOVE_SELECTORS","STYLE_ADD_SELECTOR_VARIABLE","STYLE_UPDATE_SELECTOR_VARIABLE","STYLE_REMOVE_SELECTOR_VARIABLE","STYLE_ADD_VARIABLE","STYLE_UPDATE_VARIABLE","STYLE_REMOVE_VARIABLE","STYLE_ADD_FONT","STYLE_UPDATE_FONT","STYLE_REMOVE_FONT","STYLE_UPDATE_SETTINGS"],!0)},[i,n,s,l,c,d,u,h,f,p,v,b,x,w,O,S,E]);let N=k(()=>({styleUpdate:s,styleAddSelector:l,styleUpdateSelector:c,styleRemoveSelector:d,styleRemoveSelectors:u,styleAddSelectorVariable:h,styleUpdateSelectorVariable:f,styleRemoveSelectorVariable:p,styleAddVariable:v,styleUpdateVariable:b,styleRemoveVariable:x,styleAddFont:w,styleUpdateFont:O,styleRemoveFont:S,styleAddTemplate:C,styleUpdateSettings:E}),[s,l,c,d,u,h,f,p,v,b,x,w,O,S,C,E]);return N0("main",N),/* @__PURE__ */T(plt,{value:N,children:e})};IR(),LF();var glt=({children:e,includeSubscriptions:t=!0})=>{const{style:n}=m(tF),{enqueueMiddleware:r}=m(dlt),{undoableMiddleware:i}=m(cGe),a=k(()=>[{middleware:i},{middleware:r,filterCallback:cR}],[r,i]);/* @__PURE__ */
|
|
4113
4112
|
return T(mlt,{style:n,middlewares:a,includeSubscriptions:t,children:e})};Gp();var vlt={past:[],future:[],canUndo:!1,canRedo:!1},blt=(e=vlt,t)=>{switch(t.type){case"undoableAddUndo":{const n=Xi(t,["type"]),r=[...e.past,n];return{past:r,future:[],canUndo:r.length>0,canRedo:!1}}case"undoableUndo":case"undoableRedo":return{past:t.past,future:t.future,canUndo:t.past.length>0,canRedo:t.future.length>0};case"undoableClearHistory":return 0===e.past.length&&0===e.future.length?e:vlt;default:return e}};IR();var ylt=({children:e})=>{const[t,n]=S(blt,vlt),r=C(t);r.current=t;const i=g((e,t=!0)=>{switch(e.action.type){case Zst[e.action.type]:{const n=e;return void n.dispatch({type:Zst.SCHEMA_UPDATE,schema:t?n.prevState:n.nextState})}case olt[e.action.type]:{const n=e;return void n.dispatch({type:olt.STYLE_UPDATE,style:t?n.prevState:n.nextState})}case llt[e.action.type]:{const n=e,r=n.prevState.segmentId;return void n.dispatch({type:llt.SEGMENTS_UPDATE,segment:t?n.prevState[r]:n.nextState[r],segmentId:r})}default:return}},[]),a=g((e,t,r,i)=>{n({type:"undoableAddUndo",prevState:e,action:t,nextState:r,dispatch:i})},[n]),o=g(()=>{const{canUndo:e,past:t,future:a}=r.current;if(e){const e=t.pop();if(!e)return;const r=[...a,e];i(e),n({type:"undoableUndo",past:t,future:r})}},[n,i]),s=g(()=>{const{canRedo:e,past:t,future:a}=r.current;if(e){const e=a.pop();if(!e)return;const r=[...t,e];i(e,!1),n({type:"undoableRedo",past:r,future:a})}},[n,i]),l=g(()=>{n({type:"undoableClearHistory"})},[n]),c=g((e,t,n,r)=>{cR(r)?a(e,r,t,n):r.fromSubscriptions&&l()},[a,l]),{canUndo:d,canRedo:u}=t,h=k(()=>({canUndo:d,canRedo:u,dispatchUndoable:n,undoableAddUndo:a,undoableUndo:o,undoableRedo:s,undoableClearHistory:l,undoableMiddleware:c}),[d,u,n,a,o,s,l,c]);/* @__PURE__ */
|
|
4114
4113
|
return T(cGe,{value:h,children:e})},xlt=({children:e,instanceId:t,webKey:n="",webId:r,environment:i="main",userKey:a="",server:o,includeSubscriptions:s=!0,includeRealTime:l=!0,debugMode:c=!1})=>/* @__PURE__ */T(Fst,{instanceId:t,webKey:n,webId:r,environment:i,userKey:a,server:o,children:/* @__PURE__ */T(qst,{includeSubscriptions:s,includeRealTime:l,children:/* @__PURE__ */T(ult,{includeSubscriptions:s,children:/* @__PURE__ */T(ylt,{children:/* @__PURE__ */T(gXe,{debugMode:c,children:/* @__PURE__ */T(flt,{children:/* @__PURE__ */T(Dst,{children:/* @__PURE__ */T(Ist,{children:/* @__PURE__ */T(Ust,{children:/* @__PURE__ */T(BPe,{children:/* @__PURE__ */T(hlt,{includeSubscriptions:s,children:/* @__PURE__ */T(glt,{includeSubscriptions:s,children:/* @__PURE__ */T(qXe,{server:o,children:/* @__PURE__ */T(Lst,{children:e})})})})})})})})})})})})})});mi();var wlt=({webKey:e="",webId:t,userKey:n="",instanceId:r="",server:i,environment:a="main",includeSubscriptions:o=!0,includeRealTime:s=!0,externalStyle:l="",debugMode:c=!1})=>{const[d,u]=E(!1),[h,f]=nje("builder-state.app.displayBorderComponents","black"),[p,m]=E(1),[g,v]=E("desktop"),[b,y]=E(!1);Xn("displayMode",g),Xn(["render.previewMode","render.debugMode","render.environment"],[d,c,a]);const x=k(()=>({previewMode:d,debugMode:c,setPreviewMode:u,displayBorderComponents:h,setDisplayBorderComponents:f,zoom:p,setZoom:m,displayMode:g,setDisplayMode:v,mobilePreview:b,setMobilePreview:y}),[d,c,u,h,f,p,m,g,v,b,y]),w=k(()=>/* @__PURE__ */T(xlt,{instanceId:r,webKey:e,webId:t,environment:a,userKey:n,server:i,includeSubscriptions:o,includeRealTime:s,debugMode:c,children:/* @__PURE__ */T(dXe,{children:/* @__PURE__ */T($Xe,{children:/* @__PURE__ */T(kPe,{renderLeftPopup:!1,renderRightPopup:!1,renderFloatingPopup:!d,children:/* @__PURE__ */T(M2e,{innerClassName:"flex",enabled:c,instanceId:r,children:/* @__PURE__ */T(Ast,{externalStyle:l})})})})})}),[r,e,t,a,n,i,o,s,d,c,l]);/* @__PURE__ */
|
|
4115
|
-
return T(SPe,{value:x,children:w})},Olt=e=>{const t=new Headers;return e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach(e=>{const n=e.split(":"),r=n.shift()?.trim();if(r){const e=n.join(":").trim();t.append(r,e)}}),t},klt=(e,t)=>t?.customFetch?((e,t)=>new Promise((n,r)=>{const i=new XMLHttpRequest;i.onload=()=>{const e={url:"",status:i.status,statusText:i.statusText,headers:Olt(i.getAllResponseHeaders()||"")};e.url="responseURL"in i?i.responseURL:e.headers.get("X-Request-URL")??"";const t=i.response??i.responseText;n(new Response(t,e))},i.onerror=e=>{r(/* @__PURE__ */new TypeError("Network request failed")),t?.onError&&t.onError(e)},i.ontimeout=()=>{r(/* @__PURE__ */new TypeError("Network request failed"))},i.open(t?.method??"GET",e,!0),t?.headers&&Object.keys(t.headers).forEach(e=>{const n=t.headers;n[e]&&i.setRequestHeader(e,n[e])}),t?.onProgress&&(i.upload.onprogress=t.onProgress),t?.onAbortPossible&&t.onAbortPossible(()=>{i.abort()}),t?.body&&i.send(t.body)}))(e,t):fetch(e,t),Slt={name:"@plitzi/plitzi-builder",version:"0.35.6",homepage:"./",license:"AGPL-3.0",files:["dist"],repository:{type:"https",url:"https://github.com/plitzi/plitzi-workspace.git"},type:"module",main:"dist/plitzi-builder.js",module:"dist/plitzi-builder.js",types:"dist/index.d.ts",exports:{".":{types:"./dist/index.d.ts",import:"./dist/plitzi-builder.js",default:"./dist/plitzi-builder.js"},"./plitzi-builder.css":"./dist/plitzi-builder.css","./plitzi-builder-vendor.js":"./dist/plitzi-builder-vendor.js","./plitzi-builder-dev-vendor.js":"./dist/plitzi-builder-dev-vendor.js","./plitzi-builder-dev-vendor.js.map":"./dist/plitzi-builder-dev-vendor.js.map"},dependencies:{"@apollo/client":"^4.3.0","@fortawesome/fontawesome-free":"^7.3.1","@plitzi/nexus":"^1.1.4","@plitzi/plitzi-sdk":"workspace:*","@plitzi/plitzi-ui":"^1.6.21","@plitzi/sdk-auth":"workspace:*","@plitzi/sdk-dev-tools":"workspace:*","@plitzi/sdk-elements":"workspace:*","@plitzi/sdk-event-bridge":"workspace:*","@plitzi/sdk-interactions":"workspace:*","@plitzi/sdk-navigation":"workspace:*","@plitzi/sdk-plugins":"workspace:*","@plitzi/sdk-schema":"workspace:*","@plitzi/sdk-shared":"workspace:*","@plitzi/sdk-style":"workspace:*","@plitzi/sdk-variables":"workspace:*","@tanstack/react-virtual":"^3.14.12","@xyflow/react":"^12.11.6","apollo-upload-client":"^20.0.0",clsx:"^2.1.1",graphql:"^17.0.2","graphql-ws":"^6.2.1",immer:"^11.1.18",jszip:"^3.10.2","react-hook-form":"^7.88.0","react-router-dom":"^7.18.3",swr:"^2.5.1",uuid:"^14.0.2",zod:"^4.6.4"},peerDependencies:{react:"^19","react-dom":"^19"},devDependencies:{"@babel/compat-data":"^8.0.5","@babel/core":"^8.0.5","@babel/helper-builder-react-jsx-experimental":"^7.12.11","@babel/helper-validator-identifier":"^8.0.4","@babel/plugin-proposal-class-properties":"^7.18.6","@babel/plugin-transform-private-methods":"^8.0.1","@babel/plugin-transform-runtime":"^8.0.1","@babel/polyfill":"^7.12.1","@babel/preset-env":"^8.0.5","@babel/preset-react":"^8.0.1","@tailwindcss/postcss":"^4.3.3","css-loader":"^7.1.5",eslint:"^9.39.5","eslint-plugin-import":"^2.32.0","flow-bin":"^0.331.0",postcss:"^8.5.28","postcss-loader":"^8.2.1","postcss-scss":"^4.0.9",prettier:"^3.9.6","prop-types":"^15.8.1",react:"^19.3.0","react-dom":"^19.3.0","react-refresh":"^0.19.0","react-test-renderer":"^19.3.0",sass:"^1.104.1","sass-embedded":"^1.104.1","sass-loader":"^17.0.1",stylelint:"^17.15.0","stylelint-order":"^8.1.1","stylelint-scss":"^7.2.0",terser:"^5.51.2",typescript:"^6.0.3",vite:"^8.3.0","vite-plugin-dts":"^5.1.0","vite-plugin-ejs":"^2.0.0","vite-plugin-mkcert":"^2.1.0","vite-plugin-react":"^4.0.1",vitest:"^5.0.0"},scripts:{start:"vite dev --mode development",test:"vitest run","test:coverage":"",lint:"TIMING=1 eslint ./src","lint-style":'stylelint "**/*.scss" --custom-syntax postcss-scss',"lint-style:fix":'stylelint "**/*.scss" --custom-syntax postcss-scss --fix',typecheck:"tsc -p tsconfig.app.json --noEmit","build:dev":"tsc -p tsconfig.app.json --noEmit && vite build --mode development","build:dev-watch":"tsc -p tsconfig.app.json --noEmit && vite build --mode development --watch","build:dev-gzip":"tsc -p tsconfig.app.json --noEmit && ONLY_GZIP=1 vite build --mode development","build:dev-analyze":"tsc -p tsconfig.app.json --noEmit && ONLY_ANALYZE=1 vite build --mode development","build:prod":"tsc -p tsconfig.app.json --noEmit && vite build","build:prod-watch":"tsc -p tsconfig.app.json --noEmit && vite build --watch","build:prod-gzip":"tsc -p tsconfig.app.json --noEmit && ONLY_GZIP=1 vite build","build:prod-analyze":"tsc -p tsconfig.app.json --noEmit && ONLY_ANALYZE=1 vite build","build-vendor:dev":"vite build --config vite.vendor.config.ts --mode development","build-vendor:prod":"vite build --config vite.vendor.config.ts"},eslintConfig:{extends:"react-app"},browserslist:{production:[">0.2%","not dead","not op_mini all"],development:["last 1 chrome version","last 1 firefox version","last 1 safari version"]}};cM(),kR(),RT(),JV(),QQ(),SQ(),nQ(),HV(),GV(),AQ(),aQ(),vF(),DQ(),dQ(),fQ(),Cj(),ka(),ek(),pF(),an(),pi(),h1(),CR(),vj(),Yg(),u1(),mi(),C1();var Clt={Button:Zj,FileUpload:kDe,ContentEditable:G1,Card:dPe,Form:XDe,Input:SV,Switch:sV,Checkbox:DV,Select:iV,Select2:PV,Heading:cTe,Flex:Bj,ContainerResizable:WTe,ContainerCollapsable:rQe,Icon:Wj,IconGroup:Uje,Popup:wPe,Sidebar:JTe,Tree:_Ge,Accordion:FTe,QueryBuilder:XQ,Alert:sTe,Modal:VPe,Text:BGe,Label:Jj,TextArea:hTe,ContainerFrame:EPe,KVInput:xTe,Markdown:_ee,MenuList:tVe,ContainerDraggable:vPe,Breadcrumb:AGe,CodeMirror:iTe,ErrorMessage:Gj,ColorPicker:oDe,MetricInput:lVe,ContainerTabs:LGe,ContainerFloating:bV,Badge:NGe},Elt=e=>{const{children:t,server:r,webKey:i="",includeSubscriptions:a=!0,userKey:o="",className:s="min-h-screen",debugMode:l=!1}=e,c=k(()=>function(e){if(!e)return 0;let t={};try{let n=e.split(".")[1],r=typeof window<"u"?window.atob(n):Buffer.from(n,"base64").toString();t=JSON.parse(r)}catch{return 0}return ji(t,"data.spaceId",0)}(i),[i]),[d,u]=nje(`web_${c}_state.instanceId`,"","sessionStorage"),[f,p]=nje("builder-state.debugMode",!1,"localStorage",l),m=k(()=>(e=>{const t={apiServer:"https://api.plitzi.com",ssrServer:"https://ssr.plitzi.com",basePath:"",host:"https://plitzi.com",serverUrl:"https://server.plitzi.com",fontsBaseUrl:"",websocketServer:"wss://server.plitzi.com",subscriptionServer:"wss://server.plitzi.com/subscriptions",location:void 0,...e};return"/"===t.basePath?t.basePath="":t.basePath&&(t.basePath=t.basePath.replaceAll("//","/")),t})(r),[r]),v=g(e=>{e.shiftKey&&"F12"===e.key&&p(e=>!e)},[p]);y(()=>{l&&window.addEventListener("keydown",v)},[v,l]),y(()=>{},[]);let b=!1;try{gYe(),b=!0}catch{b=!1}y(()=>{const e=HQ();u(e)},[c,u]);const x=g((e,t,n,r)=>{if(!e)return;const i=new oM,a=new eKe({uri:e.serverUrl,fetch:klt}),s=new wGe(e=>{const n={...e.headers??{},"plitzi-instance-id":r,"plitzi-access-token":o,"sdk-version":Slt.version,"Apollo-Require-Preflight":"true"};return t&&(n.authorization=`Bearer ${t}`),{headers:n}}),l=OT.from([EI(e.serverUrl),vD(),s,a]);if(!n||!e.subscriptionServer)return new tI({link:l,cache:i});const c=function(e){const{url:t,connectionParams:n,lazy:r=!0,onNonLazyError:i=console.error,lazyCloseTimeout:a=0,keepAlive:o=0,disablePong:s,connectionAckWaitTimeout:l=0,retryAttempts:c=5,retryWait:d=async function(e){const t=Math.pow(2,e);await new Promise(e=>setTimeout(e,1e3*t+Math.floor(2700*Math.random()+300)))},shouldRetry:u=cKe,on:h,webSocketImpl:f,generateID:p=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)})},jsonMessageReplacer:m,jsonMessageReviver:g}=e;let v;if(f){if(!("function"==typeof(b=f)&&"constructor"in b&&"CLOSED"in b&&"CLOSING"in b&&"CONNECTING"in b&&"OPEN"in b))throw new Error("Invalid WebSocket implementation provided");v=f}else"undefined"!=typeof WebSocket?v=WebSocket:"undefined"!=typeof global?v=global.WebSocket||global.MozWebSocket:"undefined"!=typeof window&&(v=window.WebSocket||window.MozWebSocket);var b;if(!v)throw new Error("WebSocket implementation missing; on Node you can `import WebSocket from 'ws';` and pass `webSocketImpl: WebSocket` to `createClient`");const y=v,x=(()=>{const e=/* @__PURE__ */(()=>{const e={};return{on:(t,n)=>(e[t]=n,()=>{delete e[t]}),emit(t){"id"in t&&e[t.id]?.(t)}}})(),t={connecting:h?.connecting?[h.connecting]:[],opened:h?.opened?[h.opened]:[],connected:h?.connected?[h.connected]:[],ping:h?.ping?[h.ping]:[],pong:h?.pong?[h.pong]:[],message:h?.message?[e.emit,h.message]:[e.emit],closed:h?.closed?[h.closed]:[],error:h?.error?[h.error]:[]};return{onMessage:e.on,on(e,n){const r=t[e];return r.push(n),()=>{const e=r.indexOf(n);e>-1&&r.splice(e,1)}},emit(e,...n){for(const r of[...t[e]])r(...n)}}})();function w(e){const t=[x.on("error",n=>{t.forEach(e=>e()),e(n)}),x.on("closed",n=>{t.forEach(e=>e()),e(n)})]}let O,k,S=0,C=!1,E=0,N=!1;async function z(){clearTimeout(k);const[e,r]=await(O??(O=new Promise((e,r)=>(async()=>{if(C){if(await d(E),!S)return O=void 0,r({code:1e3,reason:"All Subscriptions Gone"});E++}x.emit("connecting",C);const i=new y("function"==typeof t?await t():t,"graphql-transport-ws");let a,c;function u(){isFinite(o)&&o>0&&(clearTimeout(c),c=setTimeout(()=>{i.readyState===y.OPEN&&(i.send(sKe({type:aKe.Ping})),x.emit("ping",!1,void 0))},o))}w(e=>{O=void 0,clearTimeout(a),clearTimeout(c),r(e),e instanceof lKe&&(i.close(4499,"Terminated"),i.onerror=null,i.onclose=null)}),i.onerror=e=>x.emit("error",e),i.onclose=e=>x.emit("closed",e),i.onopen=async()=>{try{x.emit("opened",i);const e="function"==typeof n?await n():n;if(i.readyState!==y.OPEN)return;i.send(sKe(e?{type:aKe.ConnectionInit,payload:e}:{type:aKe.ConnectionInit},m)),isFinite(l)&&l>0&&(a=setTimeout(()=>{i.close(iKe.ConnectionAcknowledgementTimeout,"Connection acknowledgement timeout")},l)),u()}catch(e){x.emit("error",e),i.close(iKe.InternalClientError,rKe(e instanceof Error?e.message:String(e),"Internal client error"))}};let h=!1;i.onmessage=({data:t})=>{try{const n=function(e,t){return oKe("string"==typeof e?JSON.parse(e,t):e)}(t,g);if(x.emit("message",n),"ping"===n.type||"pong"===n.type)return x.emit(n.type,!0,n.payload),void("pong"===n.type?u():s||(i.send(sKe(n.payload?{type:aKe.Pong,payload:n.payload}:{type:aKe.Pong})),x.emit("pong",!1,n.payload)));if(h)return;if(n.type!==aKe.ConnectionAck)throw new Error(`First message cannot be of type ${n.type}`);clearTimeout(a),h=!0,x.emit("connected",i,n.payload,C),C=!1,E=0,e([i,new Promise((e,t)=>w(t))])}catch(n){i.onmessage=null,x.emit("error",n),i.close(iKe.BadResponse,rKe(n instanceof Error?n.message:String(n),"Bad response"))}}})())));e.readyState===y.CLOSING&&await r;let i=()=>{};const c=new Promise(e=>i=e);return[e,i,Promise.race([c.then(()=>{if(!S){const t=()=>e.close(1e3,"Normal Closure");isFinite(a)&&a>0?k=setTimeout(()=>{e.readyState===y.OPEN&&t()},a):t()}}),r])]}function A(e){if(cKe(e)&&(t=e.code,![1e3,1001,1006,1005,1012,1013,1014].includes(t)&&t>=1e3&&t<=1999||[iKe.InternalServerError,iKe.InternalClientError,iKe.BadRequest,iKe.BadResponse,iKe.Unauthorized,iKe.SubprotocolNotAcceptable,iKe.SubscriberAlreadyExists,iKe.TooManyInitialisationRequests].includes(e.code)))throw e;var t;if(N)return!1;if(cKe(e)&&1e3===e.code)return S>0;if(!c||E>=c)throw e;if(!u(e))throw e;return C=!0}function T(e,t){const n=p(e);let r=!1,i=!1,a=()=>{S--,r=!0};return(async()=>{for(S++;;)try{const[o,s,l]=await z();if(r)return s();const c=x.onMessage(n,e=>{switch(e.type){case aKe.Next:return void t.next(e.payload);case aKe.Error:return i=!0,r=!0,t.error(e.payload),void a();case aKe.Complete:return r=!0,void a()}});return o.send(sKe({id:n,type:aKe.Subscribe,payload:e},m)),a=()=>{r||o.readyState!==y.OPEN||o.send(sKe({id:n,type:aKe.Complete},m)),S--,r=!0,s()},void(await l.finally(c))}catch(o){if(!A(o))return}})().then(()=>{i||t.complete()}).catch(e=>{t.error(e)}),()=>{r||a()}}return r||(async()=>{for(S++;;)try{const[,,e]=await z();await e}catch(e){try{if(!A(e))return}catch(t){return i?.(t)}}})(),{on:x.on,subscribe:T,iterate(e){const t=[],n={done:!1,error:null,resolve:()=>{}},r=T(e,{next(e){t.push(e),n.resolve()},error(e){n.done=!0,n.error=e,n.resolve()},complete(){n.done=!0,n.resolve()}}),i=async function*(){for(;;){for(t.length||await new Promise(e=>n.resolve=e);t.length;)yield t.shift();if(n.error)throw n.error;if(n.done)return}}();return i.throw=async e=>(n.done||(n.done=!0,n.error=e,n.resolve()),{done:!0,value:void 0}),i.return=async()=>(r(),{done:!0,value:void 0}),i},async dispose(){if(N=!0,O){const[e]=await O;e.close(1e3,"Normal Closure")}},terminate(){O&&x.emit("closed",new lKe)}}}({url:e.subscriptionServer,shouldRetry:()=>!0,retryAttempts:1/0,connectionParams:{authToken:t,instanceId:r,userToken:o},onNonLazyError:e=>{if(e instanceof Error){const{message:t}=e;"Space Not Allowed"!==t&&"Invalid Token"!==t&&"Missing auth token"!==t&&"Missing instanceId"!==t&&"Access Not Authorized"!==t&&"Token Invalid"!==t||c.dispose()}}}),d=new OGe(c),u=OT.split(({query:e})=>{const t=pN(e);return"OperationDefinition"===t.kind&&t.operation===Lx.SUBSCRIPTION},OT.from([vD(),d]),l),h=new tI({link:u,cache:i});return h.subscriptionClient=c,h},[o]),w=k(()=>x(m,i,a,d),[x,m,i,a,d]),O=k(()=>{const e={};return t?(n.forEach(t,t=>{if(!h(t))return;const{renderType:n,component:r,settings:i,definition:a,...o}=t.props;if(!n||!r)return;const s=r;s.type=n,s.pluginSettings=i,s.extraProps=o,a&&(s.content=a),e[n]=s}),e):e},[t]);y(()=>{if(w)return()=>{const e=w.subscriptionClient;e&&e.dispose()}},[w]);const S=k(()=>w&&/* @__PURE__ */T(CGe,{client:w,children:/* @__PURE__ */T(CTe,{localCustomComponents:O,localComponents:L,children:/* @__PURE__ */T(cUe,{children:/* @__PURE__ */T(wlt,{...Xi(e,["children","server"]),debugMode:f,server:m,instanceId:d,webId:c})})})}),[w,f,d,O,e,m,c]),C=k(()=>({styleSelector:"base",collaboration:{collaborators:[]},render:{..._,previewMode:!1}}),[]);/* @__PURE__ */
|
|
4114
|
+
return T(SPe,{value:x,children:w})},Olt=e=>{const t=new Headers;return e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach(e=>{const n=e.split(":"),r=n.shift()?.trim();if(r){const e=n.join(":").trim();t.append(r,e)}}),t},klt=(e,t)=>t?.customFetch?((e,t)=>new Promise((n,r)=>{const i=new XMLHttpRequest;i.onload=()=>{const e={url:"",status:i.status,statusText:i.statusText,headers:Olt(i.getAllResponseHeaders()||"")};e.url="responseURL"in i?i.responseURL:e.headers.get("X-Request-URL")??"";const t=i.response??i.responseText;n(new Response(t,e))},i.onerror=e=>{r(/* @__PURE__ */new TypeError("Network request failed")),t?.onError&&t.onError(e)},i.ontimeout=()=>{r(/* @__PURE__ */new TypeError("Network request failed"))},i.open(t?.method??"GET",e,!0),t?.headers&&Object.keys(t.headers).forEach(e=>{const n=t.headers;n[e]&&i.setRequestHeader(e,n[e])}),t?.onProgress&&(i.upload.onprogress=t.onProgress),t?.onAbortPossible&&t.onAbortPossible(()=>{i.abort()}),t?.body&&i.send(t.body)}))(e,t):fetch(e,t),Slt={name:"@plitzi/plitzi-builder",version:"0.35.7",homepage:"./",license:"AGPL-3.0",files:["dist"],repository:{type:"https",url:"https://github.com/plitzi/plitzi-workspace.git"},type:"module",main:"dist/plitzi-builder.js",module:"dist/plitzi-builder.js",types:"dist/index.d.ts",exports:{".":{types:"./dist/index.d.ts",import:"./dist/plitzi-builder.js",default:"./dist/plitzi-builder.js"},"./plitzi-builder.css":"./dist/plitzi-builder.css","./plitzi-builder-vendor.js":"./dist/plitzi-builder-vendor.js","./plitzi-builder-dev-vendor.js":"./dist/plitzi-builder-dev-vendor.js","./plitzi-builder-dev-vendor.js.map":"./dist/plitzi-builder-dev-vendor.js.map"},dependencies:{"@apollo/client":"^4.3.0","@fortawesome/fontawesome-free":"^7.3.1","@plitzi/nexus":"^1.1.4","@plitzi/plitzi-sdk":"workspace:*","@plitzi/plitzi-ui":"^1.6.21","@plitzi/sdk-auth":"workspace:*","@plitzi/sdk-dev-tools":"workspace:*","@plitzi/sdk-elements":"workspace:*","@plitzi/sdk-event-bridge":"workspace:*","@plitzi/sdk-interactions":"workspace:*","@plitzi/sdk-navigation":"workspace:*","@plitzi/sdk-plugins":"workspace:*","@plitzi/sdk-schema":"workspace:*","@plitzi/sdk-shared":"workspace:*","@plitzi/sdk-style":"workspace:*","@plitzi/sdk-variables":"workspace:*","@tanstack/react-virtual":"^3.14.12","@xyflow/react":"^12.11.6","apollo-upload-client":"^20.0.0",clsx:"^2.1.1",graphql:"^17.0.2","graphql-ws":"^6.2.1",immer:"^11.1.18",jszip:"^3.10.2","react-hook-form":"^7.88.0","react-router-dom":"^7.18.3",swr:"^2.5.1",uuid:"^14.0.2",zod:"^4.6.4"},peerDependencies:{react:"^19","react-dom":"^19"},devDependencies:{"@babel/compat-data":"^8.0.5","@babel/core":"^8.0.5","@babel/helper-builder-react-jsx-experimental":"^7.12.11","@babel/helper-validator-identifier":"^8.0.4","@babel/plugin-proposal-class-properties":"^7.18.6","@babel/plugin-transform-private-methods":"^8.0.1","@babel/plugin-transform-runtime":"^8.0.1","@babel/polyfill":"^7.12.1","@babel/preset-env":"^8.0.5","@babel/preset-react":"^8.0.1","@tailwindcss/postcss":"^4.3.3","css-loader":"^7.1.5",eslint:"^9.39.5","eslint-plugin-import":"^2.32.0","flow-bin":"^0.331.0",postcss:"^8.5.28","postcss-loader":"^8.2.1","postcss-scss":"^4.0.9",prettier:"^3.9.6","prop-types":"^15.8.1",react:"^19.3.0","react-dom":"^19.3.0","react-refresh":"^0.19.0","react-test-renderer":"^19.3.0",sass:"^1.104.1","sass-embedded":"^1.104.1","sass-loader":"^17.0.1",stylelint:"^17.15.0","stylelint-order":"^8.1.1","stylelint-scss":"^7.2.0",terser:"^5.51.2",typescript:"^6.0.3",vite:"^8.3.0","vite-plugin-dts":"^5.1.0","vite-plugin-ejs":"^2.0.0","vite-plugin-mkcert":"^2.1.0","vite-plugin-react":"^4.0.1",vitest:"^5.0.0"},scripts:{start:"vite dev --mode development",test:"vitest run","test:coverage":"",lint:"TIMING=1 eslint ./src","lint-style":'stylelint "**/*.scss" --custom-syntax postcss-scss',"lint-style:fix":'stylelint "**/*.scss" --custom-syntax postcss-scss --fix',typecheck:"tsc -p tsconfig.app.json --noEmit","build:dev":"tsc -p tsconfig.app.json --noEmit && vite build --mode development","build:dev-watch":"tsc -p tsconfig.app.json --noEmit && vite build --mode development --watch","build:dev-gzip":"tsc -p tsconfig.app.json --noEmit && ONLY_GZIP=1 vite build --mode development","build:dev-analyze":"tsc -p tsconfig.app.json --noEmit && ONLY_ANALYZE=1 vite build --mode development","build:prod":"tsc -p tsconfig.app.json --noEmit && vite build","build:prod-watch":"tsc -p tsconfig.app.json --noEmit && vite build --watch","build:prod-gzip":"tsc -p tsconfig.app.json --noEmit && ONLY_GZIP=1 vite build","build:prod-analyze":"tsc -p tsconfig.app.json --noEmit && ONLY_ANALYZE=1 vite build","build-vendor:dev":"vite build --config vite.vendor.config.ts --mode development","build-vendor:prod":"vite build --config vite.vendor.config.ts"},eslintConfig:{extends:"react-app"},browserslist:{production:[">0.2%","not dead","not op_mini all"],development:["last 1 chrome version","last 1 firefox version","last 1 safari version"]}};cM(),kR(),RT(),JV(),QQ(),SQ(),nQ(),HV(),GV(),AQ(),aQ(),vF(),DQ(),dQ(),fQ(),Cj(),ka(),ek(),pF(),an(),pi(),h1(),CR(),vj(),Yg(),u1(),mi(),C1();var Clt={Button:Zj,FileUpload:kDe,ContentEditable:G1,Card:dPe,Form:XDe,Input:SV,Switch:sV,Checkbox:DV,Select:iV,Select2:PV,Heading:cTe,Flex:Bj,ContainerResizable:WTe,ContainerCollapsable:rQe,Icon:Wj,IconGroup:Uje,Popup:wPe,Sidebar:JTe,Tree:_Ge,Accordion:FTe,QueryBuilder:XQ,Alert:sTe,Modal:VPe,Text:BGe,Label:Jj,TextArea:hTe,ContainerFrame:EPe,KVInput:xTe,Markdown:_ee,MenuList:tVe,ContainerDraggable:vPe,Breadcrumb:AGe,CodeMirror:iTe,ErrorMessage:Gj,ColorPicker:oDe,MetricInput:lVe,ContainerTabs:LGe,ContainerFloating:bV,Badge:NGe},Elt=e=>{const{children:t,server:r,webKey:i="",includeSubscriptions:a=!0,userKey:o="",className:s="min-h-screen",debugMode:l=!1}=e,c=k(()=>function(e){if(!e)return 0;let t={};try{let n=e.split(".")[1],r=typeof window<"u"?window.atob(n):Buffer.from(n,"base64").toString();t=JSON.parse(r)}catch{return 0}return ji(t,"data.spaceId",0)}(i),[i]),[d,u]=nje(`web_${c}_state.instanceId`,"","sessionStorage"),[f,p]=nje("builder-state.debugMode",!1,"localStorage",l),m=k(()=>(e=>{const t={apiServer:"https://api.plitzi.com",ssrServer:"https://ssr.plitzi.com",basePath:"",host:"https://plitzi.com",serverUrl:"https://server.plitzi.com",fontsBaseUrl:"",websocketServer:"wss://server.plitzi.com",subscriptionServer:"wss://server.plitzi.com/subscriptions",location:void 0,...e};return"/"===t.basePath?t.basePath="":t.basePath&&(t.basePath=t.basePath.replaceAll("//","/")),t})(r),[r]),v=g(e=>{e.shiftKey&&"F12"===e.key&&p(e=>!e)},[p]);y(()=>{l&&window.addEventListener("keydown",v)},[v,l]),y(()=>{},[]);let b=!1;try{gYe(),b=!0}catch{b=!1}y(()=>{const e=HQ();u(e)},[c,u]);const x=g((e,t,n,r)=>{if(!e)return;const i=new oM,a=new eKe({uri:e.serverUrl,fetch:klt}),s=new wGe(e=>{const n={...e.headers??{},"plitzi-instance-id":r,"plitzi-access-token":o,"sdk-version":Slt.version,"Apollo-Require-Preflight":"true"};return t&&(n.authorization=`Bearer ${t}`),{headers:n}}),l=OT.from([EI(e.serverUrl),vD(),s,a]);if(!n||!e.subscriptionServer)return new tI({link:l,cache:i});const c=function(e){const{url:t,connectionParams:n,lazy:r=!0,onNonLazyError:i=console.error,lazyCloseTimeout:a=0,keepAlive:o=0,disablePong:s,connectionAckWaitTimeout:l=0,retryAttempts:c=5,retryWait:d=async function(e){const t=Math.pow(2,e);await new Promise(e=>setTimeout(e,1e3*t+Math.floor(2700*Math.random()+300)))},shouldRetry:u=cKe,on:h,webSocketImpl:f,generateID:p=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)})},jsonMessageReplacer:m,jsonMessageReviver:g}=e;let v;if(f){if(!("function"==typeof(b=f)&&"constructor"in b&&"CLOSED"in b&&"CLOSING"in b&&"CONNECTING"in b&&"OPEN"in b))throw new Error("Invalid WebSocket implementation provided");v=f}else"undefined"!=typeof WebSocket?v=WebSocket:"undefined"!=typeof global?v=global.WebSocket||global.MozWebSocket:"undefined"!=typeof window&&(v=window.WebSocket||window.MozWebSocket);var b;if(!v)throw new Error("WebSocket implementation missing; on Node you can `import WebSocket from 'ws';` and pass `webSocketImpl: WebSocket` to `createClient`");const y=v,x=(()=>{const e=/* @__PURE__ */(()=>{const e={};return{on:(t,n)=>(e[t]=n,()=>{delete e[t]}),emit(t){"id"in t&&e[t.id]?.(t)}}})(),t={connecting:h?.connecting?[h.connecting]:[],opened:h?.opened?[h.opened]:[],connected:h?.connected?[h.connected]:[],ping:h?.ping?[h.ping]:[],pong:h?.pong?[h.pong]:[],message:h?.message?[e.emit,h.message]:[e.emit],closed:h?.closed?[h.closed]:[],error:h?.error?[h.error]:[]};return{onMessage:e.on,on(e,n){const r=t[e];return r.push(n),()=>{const e=r.indexOf(n);e>-1&&r.splice(e,1)}},emit(e,...n){for(const r of[...t[e]])r(...n)}}})();function w(e){const t=[x.on("error",n=>{t.forEach(e=>e()),e(n)}),x.on("closed",n=>{t.forEach(e=>e()),e(n)})]}let O,k,S=0,C=!1,E=0,N=!1;async function z(){clearTimeout(k);const[e,r]=await(O??(O=new Promise((e,r)=>(async()=>{if(C){if(await d(E),!S)return O=void 0,r({code:1e3,reason:"All Subscriptions Gone"});E++}x.emit("connecting",C);const i=new y("function"==typeof t?await t():t,"graphql-transport-ws");let a,c;function u(){isFinite(o)&&o>0&&(clearTimeout(c),c=setTimeout(()=>{i.readyState===y.OPEN&&(i.send(sKe({type:aKe.Ping})),x.emit("ping",!1,void 0))},o))}w(e=>{O=void 0,clearTimeout(a),clearTimeout(c),r(e),e instanceof lKe&&(i.close(4499,"Terminated"),i.onerror=null,i.onclose=null)}),i.onerror=e=>x.emit("error",e),i.onclose=e=>x.emit("closed",e),i.onopen=async()=>{try{x.emit("opened",i);const e="function"==typeof n?await n():n;if(i.readyState!==y.OPEN)return;i.send(sKe(e?{type:aKe.ConnectionInit,payload:e}:{type:aKe.ConnectionInit},m)),isFinite(l)&&l>0&&(a=setTimeout(()=>{i.close(iKe.ConnectionAcknowledgementTimeout,"Connection acknowledgement timeout")},l)),u()}catch(e){x.emit("error",e),i.close(iKe.InternalClientError,rKe(e instanceof Error?e.message:String(e),"Internal client error"))}};let h=!1;i.onmessage=({data:t})=>{try{const n=function(e,t){return oKe("string"==typeof e?JSON.parse(e,t):e)}(t,g);if(x.emit("message",n),"ping"===n.type||"pong"===n.type)return x.emit(n.type,!0,n.payload),void("pong"===n.type?u():s||(i.send(sKe(n.payload?{type:aKe.Pong,payload:n.payload}:{type:aKe.Pong})),x.emit("pong",!1,n.payload)));if(h)return;if(n.type!==aKe.ConnectionAck)throw new Error(`First message cannot be of type ${n.type}`);clearTimeout(a),h=!0,x.emit("connected",i,n.payload,C),C=!1,E=0,e([i,new Promise((e,t)=>w(t))])}catch(n){i.onmessage=null,x.emit("error",n),i.close(iKe.BadResponse,rKe(n instanceof Error?n.message:String(n),"Bad response"))}}})())));e.readyState===y.CLOSING&&await r;let i=()=>{};const c=new Promise(e=>i=e);return[e,i,Promise.race([c.then(()=>{if(!S){const t=()=>e.close(1e3,"Normal Closure");isFinite(a)&&a>0?k=setTimeout(()=>{e.readyState===y.OPEN&&t()},a):t()}}),r])]}function A(e){if(cKe(e)&&(t=e.code,![1e3,1001,1006,1005,1012,1013,1014].includes(t)&&t>=1e3&&t<=1999||[iKe.InternalServerError,iKe.InternalClientError,iKe.BadRequest,iKe.BadResponse,iKe.Unauthorized,iKe.SubprotocolNotAcceptable,iKe.SubscriberAlreadyExists,iKe.TooManyInitialisationRequests].includes(e.code)))throw e;var t;if(N)return!1;if(cKe(e)&&1e3===e.code)return S>0;if(!c||E>=c)throw e;if(!u(e))throw e;return C=!0}function T(e,t){const n=p(e);let r=!1,i=!1,a=()=>{S--,r=!0};return(async()=>{for(S++;;)try{const[o,s,l]=await z();if(r)return s();const c=x.onMessage(n,e=>{switch(e.type){case aKe.Next:return void t.next(e.payload);case aKe.Error:return i=!0,r=!0,t.error(e.payload),void a();case aKe.Complete:return r=!0,void a()}});return o.send(sKe({id:n,type:aKe.Subscribe,payload:e},m)),a=()=>{r||o.readyState!==y.OPEN||o.send(sKe({id:n,type:aKe.Complete},m)),S--,r=!0,s()},void(await l.finally(c))}catch(o){if(!A(o))return}})().then(()=>{i||t.complete()}).catch(e=>{t.error(e)}),()=>{r||a()}}return r||(async()=>{for(S++;;)try{const[,,e]=await z();await e}catch(e){try{if(!A(e))return}catch(t){return i?.(t)}}})(),{on:x.on,subscribe:T,iterate(e){const t=[],n={done:!1,error:null,resolve:()=>{}},r=T(e,{next(e){t.push(e),n.resolve()},error(e){n.done=!0,n.error=e,n.resolve()},complete(){n.done=!0,n.resolve()}}),i=async function*(){for(;;){for(t.length||await new Promise(e=>n.resolve=e);t.length;)yield t.shift();if(n.error)throw n.error;if(n.done)return}}();return i.throw=async e=>(n.done||(n.done=!0,n.error=e,n.resolve()),{done:!0,value:void 0}),i.return=async()=>(r(),{done:!0,value:void 0}),i},async dispose(){if(N=!0,O){const[e]=await O;e.close(1e3,"Normal Closure")}},terminate(){O&&x.emit("closed",new lKe)}}}({url:e.subscriptionServer,shouldRetry:()=>!0,retryAttempts:1/0,connectionParams:{authToken:t,instanceId:r,userToken:o},onNonLazyError:e=>{if(e instanceof Error){const{message:t}=e;"Space Not Allowed"!==t&&"Invalid Token"!==t&&"Missing auth token"!==t&&"Missing instanceId"!==t&&"Access Not Authorized"!==t&&"Token Invalid"!==t||c.dispose()}}}),d=new OGe(c),u=OT.split(({query:e})=>{const t=pN(e);return"OperationDefinition"===t.kind&&t.operation===Lx.SUBSCRIPTION},OT.from([vD(),d]),l),h=new tI({link:u,cache:i});return h.subscriptionClient=c,h},[o]),w=k(()=>x(m,i,a,d),[x,m,i,a,d]),O=k(()=>{const e={};return t?(n.forEach(t,t=>{if(!h(t))return;const{renderType:n,component:r,settings:i,definition:a,...o}=t.props;if(!n||!r)return;const s=r;s.type=n,s.pluginSettings=i,s.extraProps=o,a&&(s.content=a),e[n]=s}),e):e},[t]);y(()=>{if(w)return()=>{const e=w.subscriptionClient;e&&e.dispose()}},[w]);const S=k(()=>w&&/* @__PURE__ */T(CGe,{client:w,children:/* @__PURE__ */T(CTe,{localCustomComponents:O,localComponents:L,children:/* @__PURE__ */T(cUe,{children:/* @__PURE__ */T(wlt,{...Xi(e,["children","server"]),debugMode:f,server:m,instanceId:d,webId:c})})})}),[w,f,d,O,e,m,c]),C=k(()=>({styleSelector:"base",collaboration:{collaborators:[]},render:{..._,previewMode:!1}}),[]);/* @__PURE__ */
|
|
4116
4115
|
return T(On,{value:C,middlewares:[ze(Ty("builder")),f0(c),...f?[t1(),Ce({shouldRecord:e=>!e?.startsWith("runtime.elements")&&!e?.startsWith("collaboration")&&!e?.startsWith("theme")})]:[]],children:/* @__PURE__ */T(BK,{defaultTheme:"dark",cookieName:"builder-theme",children:/* @__PURE__ */T(QGe,{components:Clt,children:/* @__PURE__ */P(zPe,{className:ca("plitzi-builder flex items-stretch",s),children:[!b&&/* @__PURE__ */T(eXe,{basename:m.basePath??"",children:S}),b&&S]})})})})};function Nlt(e,t={},n={},r=!1){const i=()=>(r||gD(),/* @__PURE__ */T(Elt,{...t,debugMode:r,children:Object.keys(n).map(e=>/* @__PURE__ */T(xGe.Plugin,{renderType:e,settings:n[e].pluginSettings,definition:n[e].content,component:n[e]},e))}));"undefined"!=typeof document&&z.createRoot(document.getElementById(e)).render(/* @__PURE__ */T(i,{}))}N1(),Jp(),dx(),ax(),cx(),xD(),ix(),mi();var zlt=e=>{const{debugMode:t=!1,children:n}=e;return y(()=>{t||gD()},[t]),/* @__PURE__ */T(Elt,{...e,children:n})};zlt.Plugin=xGe.Plugin;var{version:Alt}=Slt;export{By as ComponentContext,CTe as ComponentProvider,P1 as JsxManager,Ry as PlitziServiceProvider,B1 as PluginManager,Fy as PluginRemote,jne as ReplicaProvider,Dy as RootElement,zlt as default,Nlt as render,Yn as useBuilderStore,Jh as useElement,Iy as usePlitziServiceContext,T1 as useRscData,Alt as version,n1 as withElement};
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plitzi/plitzi-builder",
|
|
3
|
-
"version": "0.35.
|
|
3
|
+
"version": "0.35.7",
|
|
4
4
|
"homepage": "./",
|
|
5
5
|
"license": "AGPL-3.0",
|
|
6
6
|
"files": [
|
|
@@ -29,19 +29,19 @@
|
|
|
29
29
|
"@apollo/client": "^4.3.0",
|
|
30
30
|
"@fortawesome/fontawesome-free": "^7.3.1",
|
|
31
31
|
"@plitzi/nexus": "^1.1.4",
|
|
32
|
-
"@plitzi/plitzi-sdk": "0.35.
|
|
32
|
+
"@plitzi/plitzi-sdk": "0.35.7",
|
|
33
33
|
"@plitzi/plitzi-ui": "^1.6.21",
|
|
34
|
-
"@plitzi/sdk-auth": "0.35.
|
|
35
|
-
"@plitzi/sdk-dev-tools": "0.35.
|
|
36
|
-
"@plitzi/sdk-elements": "0.35.
|
|
37
|
-
"@plitzi/sdk-event-bridge": "0.35.
|
|
38
|
-
"@plitzi/sdk-interactions": "0.35.
|
|
39
|
-
"@plitzi/sdk-navigation": "0.35.
|
|
40
|
-
"@plitzi/sdk-plugins": "0.35.
|
|
41
|
-
"@plitzi/sdk-schema": "0.35.
|
|
42
|
-
"@plitzi/sdk-shared": "0.35.
|
|
43
|
-
"@plitzi/sdk-style": "0.35.
|
|
44
|
-
"@plitzi/sdk-variables": "0.35.
|
|
34
|
+
"@plitzi/sdk-auth": "0.35.7",
|
|
35
|
+
"@plitzi/sdk-dev-tools": "0.35.7",
|
|
36
|
+
"@plitzi/sdk-elements": "0.35.7",
|
|
37
|
+
"@plitzi/sdk-event-bridge": "0.35.7",
|
|
38
|
+
"@plitzi/sdk-interactions": "0.35.7",
|
|
39
|
+
"@plitzi/sdk-navigation": "0.35.7",
|
|
40
|
+
"@plitzi/sdk-plugins": "0.35.7",
|
|
41
|
+
"@plitzi/sdk-schema": "0.35.7",
|
|
42
|
+
"@plitzi/sdk-shared": "0.35.7",
|
|
43
|
+
"@plitzi/sdk-style": "0.35.7",
|
|
44
|
+
"@plitzi/sdk-variables": "0.35.7",
|
|
45
45
|
"@tanstack/react-virtual": "^3.14.12",
|
|
46
46
|
"@xyflow/react": "^12.11.6",
|
|
47
47
|
"apollo-upload-client": "^20.0.0",
|