@flyo/nitro-astro 1.0.0
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/cdn.ts +48 -0
- package/components/BlockSlot.astro +13 -0
- package/components/BlockSlot.ts +2 -0
- package/components/FallbackComponent.astro +21 -0
- package/components/FallbackComponent.ts +2 -0
- package/components/FlyoNitroBlock.astro +27 -0
- package/components/FlyoNitroBlock.ts +2 -0
- package/components/FlyoNitroPage.astro +12 -0
- package/components/FlyoNitroPage.ts +2 -0
- package/components/MetaInfo.astro +35 -0
- package/components/MetaInfo.ts +2 -0
- package/components/MetaInfoEntity.astro +17 -0
- package/components/MetaInfoEntity.ts +2 -0
- package/components/MetaInfoPage.astro +16 -0
- package/components/MetaInfoPage.ts +2 -0
- package/dist/nitro-astro.js +79 -0
- package/dist/nitro-astro.mjs +844 -0
- package/middleware.ts +45 -0
- package/module.d.ts +6 -0
- package/package.json +99 -0
- package/sitemap.ts +34 -0
package/cdn.ts
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Create an astro ExternalImageService for flyo where the base url with transormations looks like https://storage.flyo.cloud/image_7a158241.jpg/thumb/250x250?format=webp
|
|
3
|
+
*/
|
|
4
|
+
import type { ExternalImageService, ImageTransform } from "astro";
|
|
5
|
+
|
|
6
|
+
const service: ExternalImageService = {
|
|
7
|
+
getURL(options: ImageTransform) {
|
|
8
|
+
// check if the options.src contains already https://storage.flyo.cloud
|
|
9
|
+
// if not we add it to the url
|
|
10
|
+
|
|
11
|
+
let url =
|
|
12
|
+
typeof options.src === "string" &&
|
|
13
|
+
options.src.includes("https://storage.flyo.cloud")
|
|
14
|
+
? options.src
|
|
15
|
+
: `https://storage.flyo.cloud/${options.src}`;
|
|
16
|
+
|
|
17
|
+
// if either width or height are defined we add the /thumb/$widthx$height path to it.
|
|
18
|
+
let width: string | number | null = options.width ? options.width : null;
|
|
19
|
+
let height: string | number | null = options.height ? options.height : null;
|
|
20
|
+
|
|
21
|
+
if (width || height) {
|
|
22
|
+
if (width === null) {
|
|
23
|
+
width = "null";
|
|
24
|
+
}
|
|
25
|
+
if (height === null) {
|
|
26
|
+
height = "null";
|
|
27
|
+
}
|
|
28
|
+
url += `/thumb/${width}x${height}`;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const format = options.format ? options.format : "webp";
|
|
32
|
+
|
|
33
|
+
return `${url}?format=${format}`;
|
|
34
|
+
},
|
|
35
|
+
|
|
36
|
+
getHTMLAttributes(options) {
|
|
37
|
+
const { ...attributes } = options;
|
|
38
|
+
return {
|
|
39
|
+
...attributes,
|
|
40
|
+
width: options.width ?? null, // width and height are required to prevent CLS and enable lazy loading for chrome.
|
|
41
|
+
height: options.height ?? null, // width and height are required to prevent CLS and enable lazy loading for chrome.
|
|
42
|
+
loading: options.loading ?? "lazy",
|
|
43
|
+
decoding: options.decoding ?? "async",
|
|
44
|
+
};
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export default service;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
import FlyoNitroBlock from "./FlyoNitroBlock.astro";
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
slot: {
|
|
6
|
+
content?: object[]; // Add the content property with type object[]
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const { slot } = Astro.props;
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
{slot?.content?.map((block: object) => <FlyoNitroBlock block={block} />)}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
import { Block } from "@flyo/nitro-typescript";
|
|
3
|
+
import { useFlyoIntegration } from "./../index.ts";
|
|
4
|
+
interface Props {
|
|
5
|
+
block: Block;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
const { block } = Astro.props;
|
|
9
|
+
|
|
10
|
+
const isLiveEdit = useFlyoIntegration().options.liveEdit || false;
|
|
11
|
+
const folder = useFlyoIntegration().options.componentsDir;
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
{
|
|
15
|
+
isLiveEdit && (
|
|
16
|
+
<div style="margin: 20px 0; padding: 10px; border-radius: 5px; background-color: #DC143C; color: white;">
|
|
17
|
+
Can't find <strong>{block.component}.astro</strong> file in the folder{" "}
|
|
18
|
+
<strong>{folder}</strong>, please make sure the component exists.
|
|
19
|
+
</div>
|
|
20
|
+
)
|
|
21
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
import * as components from "virtual:flyo-components";
|
|
3
|
+
import type { AstroComponentFactory } from "astro/dist/runtime/server";
|
|
4
|
+
import camelcase from "camelcase";
|
|
5
|
+
import { Block } from "@flyo/nitro-typescript";
|
|
6
|
+
|
|
7
|
+
interface Props {
|
|
8
|
+
block: Block;
|
|
9
|
+
[prop: string]: unknown;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const { block, ...props } = Astro.props;
|
|
13
|
+
|
|
14
|
+
/* @vite-ignore */
|
|
15
|
+
let Component: AstroComponentFactory | null = null;
|
|
16
|
+
|
|
17
|
+
const key: string = camelcase(block.component as string);
|
|
18
|
+
const componentFound: boolean = key in components;
|
|
19
|
+
|
|
20
|
+
if (componentFound) {
|
|
21
|
+
Component = components[key];
|
|
22
|
+
} else {
|
|
23
|
+
Component = components.fallback;
|
|
24
|
+
}
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
{Component && <Component block={block} {...props} />}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
import { Page } from "@flyo/nitro-typescript";
|
|
3
|
+
import FlyoNitroBlock from "./FlyoNitroBlock.astro";
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
page: Page;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const { page } = Astro.props;
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
{page?.json?.map((block: object) => <FlyoNitroBlock block={block} />)}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
const { title, image, description, jsonld } = Astro.props;
|
|
3
|
+
const jsonLdString = jsonld ? JSON.stringify(jsonld) : null;
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
{
|
|
7
|
+
title && (
|
|
8
|
+
<>
|
|
9
|
+
<meta name="title" content={title} />
|
|
10
|
+
<meta property="og:title" content={title} />
|
|
11
|
+
<meta name="twitter:title" content={title} />
|
|
12
|
+
</>
|
|
13
|
+
)
|
|
14
|
+
}
|
|
15
|
+
{
|
|
16
|
+
description && (
|
|
17
|
+
<>
|
|
18
|
+
<meta name="description" content={description} />
|
|
19
|
+
<meta property="og:description" content={description} />
|
|
20
|
+
<meta name="twitter:description" content={description} />
|
|
21
|
+
</>
|
|
22
|
+
)
|
|
23
|
+
}
|
|
24
|
+
{
|
|
25
|
+
image && (
|
|
26
|
+
<>
|
|
27
|
+
<meta name="image" content={image} />
|
|
28
|
+
<meta property="og:image" content={image} />
|
|
29
|
+
<meta name="twitter:image" content={image} />
|
|
30
|
+
</>
|
|
31
|
+
)
|
|
32
|
+
}
|
|
33
|
+
{jsonLdString && <script type="application/ld+json" set:html={jsonLdString} />}
|
|
34
|
+
<meta property="og:type" content="website" />
|
|
35
|
+
<meta name="twitter:card" content="summary_large_image" />
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
import { Entity } from "@flyo/nitro-typescript";
|
|
3
|
+
import MetaInfo from "./MetaInfo.astro";
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
response: Entity;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const { response } = Astro.props;
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
<MetaInfo
|
|
13
|
+
title={response.entity?.entity_title}
|
|
14
|
+
description={response.entity?.entity_teaser}
|
|
15
|
+
image={response.entity?.entity_image}
|
|
16
|
+
jsonld={response.jsonld}
|
|
17
|
+
/>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
import { Page } from "@flyo/nitro-typescript";
|
|
3
|
+
import MetaInfo from "./MetaInfo.astro";
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
page: Page;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const { page } = Astro.props;
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
<MetaInfo
|
|
13
|
+
title={page.meta_json?.title}
|
|
14
|
+
description={page.meta_json?.description}
|
|
15
|
+
image={page.meta_json?.image}
|
|
16
|
+
/>
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
(function(u,g){typeof exports=="object"&&typeof module<"u"?g(exports):typeof define=="function"&&define.amd?define(["exports"],g):(u=typeof globalThis<"u"?globalThis:u||self,g(u.flyoNitroIntegration={}))})(this,function(u){"use strict";const g="https://api.flyo.cloud/nitro/v1".replace(/\/+$/,"");class F{constructor(n={}){this.configuration=n}set config(n){this.configuration=n}get basePath(){return this.configuration.basePath!=null?this.configuration.basePath:g}get fetchApi(){return this.configuration.fetchApi}get middleware(){return this.configuration.middleware||[]}get queryParamsStringify(){return this.configuration.queryParamsStringify||_}get username(){return this.configuration.username}get password(){return this.configuration.password}get apiKey(){const n=this.configuration.apiKey;if(n)return typeof n=="function"?n:()=>n}get accessToken(){const n=this.configuration.accessToken;if(n)return typeof n=="function"?n:async()=>n}get headers(){return this.configuration.headers}get credentials(){return this.configuration.credentials}}const L=new F,w=class j{constructor(n=L){this.configuration=n,this.fetchApi=async(t,i)=>{let r={url:t,init:i};for(const a of this.middleware)a.pre&&(r=await a.pre({fetch:this.fetchApi,...r})||r);let o;try{o=await(this.configuration.fetchApi||fetch)(r.url,r.init)}catch(a){for(const l of this.middleware)l.onError&&(o=await l.onError({fetch:this.fetchApi,url:r.url,init:r.init,error:a,response:o?o.clone():void 0})||o);if(o===void 0)throw a instanceof Error?new N(a,"The request failed and the interceptors did not return an alternative response"):a}for(const a of this.middleware)a.post&&(o=await a.post({fetch:this.fetchApi,url:r.url,init:r.init,response:o.clone()})||o);return o},this.middleware=n.middleware}withMiddleware(...n){const t=this.clone();return t.middleware=t.middleware.concat(...n),t}withPreMiddleware(...n){const t=n.map(i=>({pre:i}));return this.withMiddleware(...t)}withPostMiddleware(...n){const t=n.map(i=>({post:i}));return this.withMiddleware(...t)}isJsonMime(n){return n?j.jsonRegex.test(n):!1}async request(n,t){const{url:i,init:r}=await this.createFetchParams(n,t),o=await this.fetchApi(i,r);if(o&&o.status>=200&&o.status<300)return o;throw new K(o,"Response returned an error code")}async createFetchParams(n,t){let i=this.configuration.basePath+n.path;n.query!==void 0&&Object.keys(n.query).length!==0&&(i+="?"+this.configuration.queryParamsStringify(n.query));const r=Object.assign({},this.configuration.headers,n.headers);Object.keys(r).forEach(y=>r[y]===void 0?delete r[y]:{});const o=typeof t=="function"?t:async()=>t,a={method:n.method,headers:r,body:n.body,credentials:this.configuration.credentials},l={...a,...await o({init:a,context:n})};let s;x(l.body)||l.body instanceof URLSearchParams||P(l.body)?s=l.body:this.isJsonMime(r["Content-Type"])?s=JSON.stringify(l.body):s=l.body;const c={...l,body:s};return{url:i,init:c}}clone(){const n=this.constructor,t=new n(this.configuration);return t.middleware=this.middleware.slice(),t}};w.jsonRegex=new RegExp("^(:?application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(:?;.*)?$","i");let p=w;function P(e){return typeof Blob<"u"&&e instanceof Blob}function x(e){return typeof FormData<"u"&&e instanceof FormData}class K extends Error{constructor(n,t){super(t),this.response=n,this.name="ResponseError"}}class N extends Error{constructor(n,t){super(t),this.cause=n,this.name="FetchError"}}class h extends Error{constructor(n,t){super(t),this.field=n,this.name="RequiredError"}}function _(e,n=""){return Object.keys(e).map(t=>b(t,e[t],n)).filter(t=>t.length>0).join("&")}function b(e,n,t=""){const i=t+(t.length?`[${e}]`:e);if(n instanceof Array){const r=n.map(o=>encodeURIComponent(String(o))).join(`&${encodeURIComponent(i)}=`);return`${encodeURIComponent(i)}=${r}`}if(n instanceof Set){const r=Array.from(n);return b(e,r,t)}return n instanceof Date?`${encodeURIComponent(i)}=${encodeURIComponent(n.toISOString())}`:n instanceof Object?_(n,i):`${encodeURIComponent(i)}=${encodeURIComponent(String(n))}`}function v(e,n){return Object.keys(e).reduce((t,i)=>({...t,[i]:n(e[i])}),{})}class d{constructor(n,t=i=>i){this.raw=n,this.transformer=t}async value(){return this.transformer(await this.raw.json())}}function M(e){return $(e)}function $(e,n){return e==null?e:{identifier:e.identifier==null?void 0:e.identifier,content:e.content==null?void 0:e.content.map(C)}}function C(e){return B(e)}function B(e,n){return e==null?e:{items:e.items==null?void 0:e.items,content:e.content==null?void 0:e.content,config:e.config==null?void 0:e.config,identifier:e.identifier==null?void 0:e.identifier,uid:e.uid==null?void 0:e.uid,component:e.component==null?void 0:e.component,slots:e.slots==null?void 0:v(e.slots,M)}}function E(e){return O(e)}function O(e,n){return e==null?e:{type:e.type==null?void 0:e.type,target:e.target==null?void 0:e.target,label:e.label==null?void 0:e.label,href:e.href==null?void 0:e.href,slug:e.slug==null?void 0:e.slug,properties:e.properties==null?void 0:e.properties,children:e.children==null?void 0:e.children.map(E)}}function D(e){return G(e)}function G(e,n){return e==null?e:{items:e.items==null?void 0:e.items.map(E),uid:e.uid==null?void 0:e.uid,identifier:e.identifier==null?void 0:e.identifier,label:e.label==null?void 0:e.label}}function H(e){return V(e)}function V(e,n){return e==null?e:{domain:e.domain==null?void 0:e.domain,slug:e.slug==null?void 0:e.slug,version:e.version==null?void 0:e.version,updated_at:e.updated_at==null?void 0:e.updated_at,language:e.language==null?void 0:e.language,primary_language:e.primary_language==null?void 0:e.primary_language}}function z(e){return J(e)}function J(e,n){return e==null?e:{nitro:e.nitro==null?void 0:H(e.nitro),pages:e.pages==null?void 0:e.pages,containers:e.containers==null?void 0:v(e.containers,D),globals:e.globals==null?void 0:e.globals}}function W(e){return Q(e)}function Q(e,n){return e==null?e:{api:e.api==null?void 0:e.api,image:e.image==null?void 0:e.image}}function Y(e){return Z(e)}function Z(e,n){return e==null?e:{_version:e._version==null?void 0:e._version,entity_metric:e.entity_metric==null?void 0:W(e.entity_metric),entity_unique_id:e.entity_unique_id==null?void 0:e.entity_unique_id,entity_id:e.entity_id==null?void 0:e.entity_id,entity_image:e.entity_image==null?void 0:e.entity_image,entity_slug:e.entity_slug==null?void 0:e.entity_slug,entity_teaser:e.entity_teaser==null?void 0:e.entity_teaser,entity_time_end:e.entity_time_end==null?void 0:e.entity_time_end,entity_time_start:e.entity_time_start==null?void 0:e.entity_time_start,entity_title:e.entity_title==null?void 0:e.entity_title,entity_type:e.entity_type==null?void 0:e.entity_type,entity_type_id:e.entity_type_id==null?void 0:e.entity_type_id,updated_at:e.updated_at==null?void 0:e.updated_at,routes:e.routes==null?void 0:e.routes}}function q(e){return X(e)}function X(e,n){return e==null?e:{entity:e.entity==null?void 0:Y(e.entity),model:e.model==null?void 0:e.model,language:e.language==null?void 0:e.language,jsonld:e.jsonld==null?void 0:e.jsonld}}function R(e){return ee(e)}function ee(e,n){return e==null?e:{entity_unique_id:e.entity_unique_id==null?void 0:e.entity_unique_id,entity_title:e.entity_title==null?void 0:e.entity_title,entity_teaser:e.entity_teaser==null?void 0:e.entity_teaser,entity_slug:e.entity_slug==null?void 0:e.entity_slug,entity_time_start:e.entity_time_start==null?void 0:e.entity_time_start,entity_type:e.entity_type==null?void 0:e.entity_type,entity_type_id:e.entity_type_id==null?void 0:e.entity_type_id,entity_image:e.entity_image==null?void 0:e.entity_image,routes:e.routes==null?void 0:e.routes}}function ne(e){return te(e)}function te(e,n){return e==null?e:{description:e.description==null?void 0:e.description,image:e.image==null?void 0:e.image,title:e.title==null?void 0:e.title}}function ie(e){return oe(e)}function oe(e,n){return e==null?e:{slug:e.slug==null?void 0:e.slug,title:e.title==null?void 0:e.title}}function re(e){return ae(e)}function ae(e,n){return e==null?e:{value:e.value==null?void 0:e.value,navigation:e.navigation==null?void 0:e.navigation,propagate:e.propagate==null?void 0:e.propagate}}function A(e){return le(e)}function le(e,n){return e==null?e:{id:e.id==null?void 0:e.id,title:e.title==null?void 0:e.title,href:e.href==null?void 0:e.href,slug:e.slug==null?void 0:e.slug,json:e.json==null?void 0:e.json.map(C),depth:e.depth==null?void 0:e.depth,is_home:e.is_home==null?void 0:e.is_home,created_at:e.created_at==null?void 0:e.created_at,updated_at:e.updated_at==null?void 0:e.updated_at,is_visible:e.is_visible==null?void 0:e.is_visible,meta_json:e.meta_json==null?void 0:ne(e.meta_json),properties:e.properties==null?void 0:v(e.properties,re),uid:e.uid==null?void 0:e.uid,type:e.type==null?void 0:e.type,target:e.target==null?void 0:e.target,container:e.container==null?void 0:e.container,breadcrumb:e.breadcrumb==null?void 0:e.breadcrumb.map(ie)}}function se(e){return ue(e)}function ue(e,n){return e==null?e:{version:e.version==null?void 0:e.version,updated_at:e.updated_at==null?void 0:e.updated_at}}class ce extends p{async configRaw(n,t){const i={};n.lang!=null&&(i.lang=n.lang);const r={};this.configuration&&this.configuration.apiKey&&(i.token=await this.configuration.apiKey("token"));const o=await this.request({path:"/config",method:"GET",headers:r,query:i},t);return new d(o,a=>z(a))}async config(n={},t){return await(await this.configRaw(n,t)).value()}}class de extends p{async entityBySlugRaw(n,t){if(n.slug==null)throw new h("slug",'Required parameter "slug" was null or undefined when calling entityBySlug().');const i={};n.lang!=null&&(i.lang=n.lang),n.typeId!=null&&(i.typeId=n.typeId);const r={};this.configuration&&this.configuration.apiKey&&(i.token=await this.configuration.apiKey("token"));const o=await this.request({path:"/entities/slug/{slug}".replace("{slug}",encodeURIComponent(String(n.slug))),method:"GET",headers:r,query:i},t);return new d(o,a=>q(a))}async entityBySlug(n,t){return await(await this.entityBySlugRaw(n,t)).value()}async entityByUniqueidRaw(n,t){if(n.uniqueid==null)throw new h("uniqueid",'Required parameter "uniqueid" was null or undefined when calling entityByUniqueid().');const i={};n.lang!=null&&(i.lang=n.lang);const r={};this.configuration&&this.configuration.apiKey&&(i.token=await this.configuration.apiKey("token"));const o=await this.request({path:"/entities/uniqueid/{uniqueid}".replace("{uniqueid}",encodeURIComponent(String(n.uniqueid))),method:"GET",headers:r,query:i},t);return new d(o,a=>q(a))}async entityByUniqueid(n,t){return await(await this.entityByUniqueidRaw(n,t)).value()}}class fe extends p{async homeRaw(n,t){const i={};n.lang!=null&&(i.lang=n.lang);const r={};this.configuration&&this.configuration.apiKey&&(i.token=await this.configuration.apiKey("token"));const o=await this.request({path:"/pages/home",method:"GET",headers:r,query:i},t);return new d(o,a=>A(a))}async home(n={},t){return await(await this.homeRaw(n,t)).value()}async pageRaw(n,t){const i={};n.lang!=null&&(i.lang=n.lang),n.slug!=null&&(i.slug=n.slug);const r={};this.configuration&&this.configuration.apiKey&&(i.token=await this.configuration.apiKey("token"));const o=await this.request({path:"/pages",method:"GET",headers:r,query:i},t);return new d(o,a=>A(a))}async page(n={},t){return await(await this.pageRaw(n,t)).value()}}class pe extends p{async searchRaw(n,t){if(n.query==null)throw new h("query",'Required parameter "query" was null or undefined when calling search().');const i={};n.lang!=null&&(i.lang=n.lang),n.query!=null&&(i.query=n.query);const r={};this.configuration&&this.configuration.apiKey&&(i.token=await this.configuration.apiKey("token"));const o=await this.request({path:"/search",method:"GET",headers:r,query:i},t);return new d(o,a=>a.map(R))}async search(n,t){return await(await this.searchRaw(n,t)).value()}}class ge extends p{async sitemapRaw(n,t){const i={};n.lang!=null&&(i.lang=n.lang);const r={};this.configuration&&this.configuration.apiKey&&(i.token=await this.configuration.apiKey("token"));const o=await this.request({path:"/sitemap",method:"GET",headers:r,query:i},t);return new d(o,a=>a.map(R))}async sitemap(n={},t){return await(await this.sitemapRaw(n,t)).value()}}class ye extends p{async versionRaw(n,t){const i={};n.lang!=null&&(i.lang=n.lang);const r={};this.configuration&&this.configuration.apiKey&&(i.token=await this.configuration.apiKey("token"));const o=await this.request({path:"/version",method:"GET",headers:r,query:i},t);return new d(o,a=>se(a))}async version(n={},t){return await(await this.versionRaw(n,t)).value()}}const he=/[\p{Lu}]/u,ve=/[\p{Ll}]/u,I=/^[\p{Lu}](?![\p{Lu}])/gu,k=/([\p{Alpha}\p{N}_]|$)/u,m=/[_.\- ]+/,me=new RegExp("^"+m.source),T=new RegExp(m.source+k.source,"gu"),S=new RegExp("\\d+"+k.source,"gu"),we=(e,n,t,i)=>{let r=!1,o=!1,a=!1,l=!1;for(let s=0;s<e.length;s++){const c=e[s];l=s>2?e[s-3]==="-":!0,r&&he.test(c)?(e=e.slice(0,s)+"-"+e.slice(s),r=!1,a=o,o=!0,s++):o&&a&&ve.test(c)&&(!l||i)?(e=e.slice(0,s-1)+"-"+e.slice(s-1),a=o,o=!1,r=!0):(r=n(c)===c&&t(c)!==c,a=o,o=t(c)===c&&n(c)!==c)}return e},_e=(e,n)=>(I.lastIndex=0,e.replace(I,t=>n(t))),be=(e,n)=>(T.lastIndex=0,S.lastIndex=0,e.replace(T,(t,i)=>n(i)).replace(S,t=>n(t)));function Ce(e,n){if(!(typeof e=="string"||Array.isArray(e)))throw new TypeError("Expected the input to be `string | string[]`");if(n={pascalCase:!1,preserveConsecutiveUppercase:!1,...n},Array.isArray(e)?e=e.map(o=>o.trim()).filter(o=>o.length).join("-"):e=e.trim(),e.length===0)return"";const t=n.locale===!1?o=>o.toLowerCase():o=>o.toLocaleLowerCase(n.locale),i=n.locale===!1?o=>o.toUpperCase():o=>o.toLocaleUpperCase(n.locale);return e.length===1?m.test(e)?"":n.pascalCase?i(e):t(e):(e!==t(e)&&(e=we(e,t,i,n.preserveConsecutiveUppercase)),e=e.replace(me,""),e=n.preserveConsecutiveUppercase?_e(e,t):t(e),n.pascalCase&&(e=i(e.charAt(0))+e.slice(1)),be(e,i))}function Ee(e,n,t){const i="virtual:flyo-components",r="\0"+i;return{name:"vite-plugin-flyo-components",async resolveId(o){if(o===i)return r},async load(o){if(o===r){const a=[];for(const[s,c]of Object.entries(n)){const y=await this.resolve("/"+e+"/"+c+".astro");y&&a.push(`export { default as ${Ce(s)} } from "${y.id}"`)}let l=null;return t&&(l=await this.resolve("/"+e+"/"+t+".astro")),l?a.push(`export { default as fallback } from "${l.id}"`):a.push('export { default as fallback } from "@flyo/nitro-astro/FallbackComponent.astro"'),a.join(";")}}}}function U(){return globalThis.flyoNitroInstance||console.error("The Flyo Typescript Configuration has not been initialized correctly"),globalThis.flyoNitroInstance}function f(){return U().config}async function qe(e){return await e.locals.config}function Re(){return new ce(f())}function Ae(){return new de(f())}function Ie(){return new fe(f())}function ke(){return new pe(f())}function Te(){return new ge(f())}function Se(){return new ye(f())}function Ue(e){return{"data-flyo-block-uid":e.uid}}const je=`
|
|
2
|
+
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 163.4 88.5">
|
|
3
|
+
<style type="text/css">
|
|
4
|
+
.st8{fill:#FFFFFF;}
|
|
5
|
+
</style>
|
|
6
|
+
<g id="Ebene_1">
|
|
7
|
+
<g>
|
|
8
|
+
<path class="st8" d="M49,56.7c-0.5-0.3-0.8-0.7-1.2-1.2c-0.4-0.5-0.6-1.2-0.7-1.8c-0.1-0.6-0.2-1.2-0.2-1.8V18.7
|
|
9
|
+
c0-5.2-1.6-9.4-4.8-12.6c-3.2-3.2-8.2-4.8-15-4.8c-6.1,0-10.9,1.5-14.3,4.6C9.4,8.9,7.7,13.3,7.7,19v6.4H1.5V35h6.1v32.1h11.9V35
|
|
10
|
+
h7.7v-9.6h-7.7c0-8.3,0.6-9.4,1.8-11.3c1.2-1.8,3.2-2.8,6.1-2.8c1.5,0,2.7,0.3,3.7,0.8c1,0.5,1.7,1.2,2.3,2.1
|
|
11
|
+
c0.6,0.9,0.9,1.9,1.2,3.1c0.2,1.2,0.3,2.4,0.3,3.7v36.8c0,1.4,0.3,2.6,0.8,3.8c0.5,1.2,1.3,2.2,2.3,3.2c1,0.9,2.1,1.6,3.5,2.1
|
|
12
|
+
c10.1,3,18.5-1.1,18.5-1.1l-4-10.1C52,58.4,49.6,57,49,56.7z"/>
|
|
13
|
+
<path class="st8" d="M146.3,34.6c-1.1-2.9-2.7-5.5-4.9-7.7c-2.1-2.2-4.7-4-7.7-5.3c-3-1.3-6.4-2-10.2-2c-3.8,0-7.2,0.7-10.2,2
|
|
14
|
+
c-3,1.3-5.6,3.1-7.7,5.3c-2.1,2.2-3.7,4.8-4.9,7.7c-1.1,2.9-1.7,6-1.7,9.3c0,3.2,0.6,6.3,1.7,9.2c1.1,2.9,2.7,5.5,4.9,7.7
|
|
15
|
+
c2.1,2.2,4.7,4,7.7,5.3c3,1.3,6.4,2,10.2,2c3.8,0,7.2-0.7,10.2-2c3-1.3,5.6-3.1,7.7-5.3c2.1-2.2,3.7-4.8,4.8-7.7
|
|
16
|
+
c1.1-2.9,1.7-6,1.7-9.2C148,40.6,147.4,37.5,146.3,34.6z M134.8,49.5c-0.6,1.7-1.5,3.2-2.6,4.5c-1.1,1.2-2.4,2.2-3.9,2.9
|
|
17
|
+
c-1.5,0.7-3.1,1-4.8,1c-1.7,0-3.3-0.3-4.8-1c-1.5-0.7-2.8-1.6-3.9-2.9c-1.1-1.2-2-2.7-2.6-4.4s-0.9-3.6-0.9-5.7
|
|
18
|
+
c0-2,0.3-3.9,0.9-5.6c0.6-1.7,1.5-3.2,2.6-4.5c1.1-1.2,2.4-2.2,3.9-2.9c1.5-0.7,3.1-1.1,4.8-1.1c1.7,0,3.3,0.3,4.8,1
|
|
19
|
+
c1.5,0.7,2.8,1.6,3.9,2.9c1.1,1.2,2,2.7,2.6,4.5c0.6,1.7,0.9,3.6,0.9,5.6C135.8,45.8,135.4,47.7,134.8,49.5z"/>
|
|
20
|
+
<path class="st8" d="M88.2,20.4L77,56.8L64.4,20.4H52.1l18.4,46.6c-0.1,0.9-0.2,1.7-0.4,2.6c-0.1,0.4-0.2,0.7-0.3,1.1c0,0,0,0,0,0
|
|
21
|
+
c-0.5,1.2-1,2.4-1.7,3.3c-0.1,0.1-0.1,0.2-0.2,0.3c0,0.1-0.1,0.1-0.2,0.2c-0.8,1-1.8,1.9-3,2.7c0.7,1.7,1.4,3.3,2.2,5.4l1.8,4.7
|
|
22
|
+
c0.3-0.1,0.6-0.3,0.9-0.4c0.3-0.2,0.6-0.3,0.9-0.4c0.2-0.1,0.4-0.2,0.5-0.3c1.3-0.7,2.3-1.4,3.4-2.3c0,0,0.1-0.1,0.1-0.1
|
|
23
|
+
c0.1-0.1,0.3-0.2,0.4-0.4c1.2-1.1,2.2-2.1,3-3.2c1.4-1.8,2.5-3.7,3.3-5.9c0.7-1.8,1.2-3.7,1.4-5.6c0-0.3,0.1-0.6,0.2-1l16.6-47.3
|
|
24
|
+
H88.2z"/>
|
|
25
|
+
<path class="st8" d="M161.3,62.6c-0.3-0.8-0.8-1.6-1.4-2.2c-0.6-0.6-1.3-1.1-2.2-1.5c-0.9-0.4-1.8-0.6-2.9-0.6
|
|
26
|
+
c-1.1,0-2.1,0.2-2.9,0.6c-0.9,0.4-1.6,0.9-2.2,1.5c-0.6,0.6-1.1,1.4-1.4,2.2c-0.3,0.8-0.5,1.7-0.5,2.6c0,0.9,0.2,1.8,0.5,2.6
|
|
27
|
+
c0.3,0.8,0.8,1.6,1.4,2.2c0.6,0.6,1.3,1.1,2.2,1.5c0.9,0.4,1.8,0.6,2.9,0.6c1.1,0,2.1-0.2,2.9-0.6c0.9-0.4,1.6-0.9,2.2-1.5
|
|
28
|
+
c0.6-0.6,1.1-1.4,1.4-2.2c0.3-0.8,0.5-1.7,0.5-2.6C161.7,64.3,161.6,63.4,161.3,62.6z"/>
|
|
29
|
+
</g>
|
|
30
|
+
</g>
|
|
31
|
+
</svg>
|
|
32
|
+
`;function Fe(e){const n={accessToken:!1,liveEdit:!1,fallbackComponent:null,componentsDir:"src/components/flyo",serverCacheHeaderTtl:1200,clientCacheHeaderTtl:900,...e};return n.liveEdit==="true"?n.liveEdit=!0:n.liveEdit==="false"&&(n.liveEdit=!1),{name:"@flyo/nitro-astro",hooks:{"astro:config:setup":({injectScript:t,updateConfig:i,injectRoute:r,addMiddleware:o,addDevToolbarApp:a})=>{a({id:"flyo-nitro",name:"Flyo Nitro",icon:je,entrypoint:"@flyo/nitro-astro/toolbar.ts"}),r({pattern:"sitemap.xml",entrypoint:"@flyo/nitro-astro/sitemap.ts"}),o({entrypoint:"@flyo/nitro-astro/middleware.ts",order:"post"}),i({image:{service:{entrypoint:"@flyo/nitro-astro/cdn.ts"}},vite:{plugins:[Ee(e.componentsDir,e.components||{},e.fallbackComponent)]}}),t("page-ssr",`
|
|
33
|
+
import { Configuration } from '@flyo/nitro-typescript'
|
|
34
|
+
|
|
35
|
+
var defaultConfig = new Configuration({
|
|
36
|
+
apiKey: '${n.accessToken}'
|
|
37
|
+
})
|
|
38
|
+
|
|
39
|
+
globalThis.flyoNitroInstance = {
|
|
40
|
+
config: defaultConfig,
|
|
41
|
+
options: {
|
|
42
|
+
liveEdit: ${n.liveEdit},
|
|
43
|
+
componentsDir: '${n.componentsDir}',
|
|
44
|
+
clientCacheHeaderTtl: ${n.clientCacheHeaderTtl},
|
|
45
|
+
serverCacheHeaderTtl: ${n.serverCacheHeaderTtl}
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
`),n.liveEdit&&t("page",`
|
|
49
|
+
window.addEventListener("message", (event) => {
|
|
50
|
+
if (event.data?.action === 'pageRefresh') {
|
|
51
|
+
window.location.reload(true);
|
|
52
|
+
}
|
|
53
|
+
})
|
|
54
|
+
|
|
55
|
+
function getActualWindow() {
|
|
56
|
+
if (window === window.top) {
|
|
57
|
+
return window;
|
|
58
|
+
} else if (window.parent) {
|
|
59
|
+
return window.parent;
|
|
60
|
+
}
|
|
61
|
+
return window;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
window.openBlockInFlyo = function(blockUid) {
|
|
65
|
+
getActualWindow().postMessage({
|
|
66
|
+
action: 'openEdit',
|
|
67
|
+
data: JSON.parse(JSON.stringify({item:{uid: blockUid}}))
|
|
68
|
+
}, 'https://flyo.cloud')
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// Find all elements with the 'data-flyo-block-uid' attribute
|
|
72
|
+
const elements = document.querySelectorAll('[data-flyo-block-uid]');
|
|
73
|
+
|
|
74
|
+
elements.forEach(element => {
|
|
75
|
+
element.addEventListener('click', function() {
|
|
76
|
+
openBlockInFlyo(this.getAttribute('data-flyo-block-uid'))
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
`)}}}}u.default=Fe,u.editableBlock=Ue,u.useConfig=qe,u.useConfigApi=Re,u.useConfiguration=f,u.useEntitiesApi=Ae,u.useFlyoIntegration=U,u.usePagesApi=Ie,u.useSearchApi=ke,u.useSitemapApi=Te,u.useVersionApi=Se,Object.defineProperties(u,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|