@flyo/nitro-next 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/dist/chunk-JMEC5XWK.js +84 -0
- package/dist/chunk-JMEC5XWK.js.map +1 -0
- package/dist/chunk-T46Q5G3T.mjs +84 -0
- package/dist/chunk-T46Q5G3T.mjs.map +1 -0
- package/dist/client.d.mts +2 -0
- package/dist/client.d.ts +2 -0
- package/dist/client.js +2 -0
- package/dist/client.js.map +1 -0
- package/dist/client.mjs +2 -0
- package/dist/client.mjs.map +1 -0
- package/dist/index.d.mts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +17 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +17 -0
- package/dist/index.mjs.map +1 -0
- package/dist/server.d.mts +22 -0
- package/dist/server.d.ts +22 -0
- package/dist/server.js +17 -0
- package/dist/server.js.map +1 -0
- package/dist/server.mjs +17 -0
- package/dist/server.mjs.map +1 -0
- package/package.json +82 -0
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }// src/server.tsx
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
var _nitrotypescript = require('@flyo/nitro-typescript');
|
|
8
|
+
var _jsxruntime = require('react/jsx-runtime');
|
|
9
|
+
var globalConfiguration = null;
|
|
10
|
+
var configResponse = null;
|
|
11
|
+
var configPromise = null;
|
|
12
|
+
var globalLang = null;
|
|
13
|
+
var globalComponents = {};
|
|
14
|
+
var initNitro = ({ accessToken, lang, components }) => {
|
|
15
|
+
if (!globalConfiguration) {
|
|
16
|
+
globalConfiguration = new (0, _nitrotypescript.Configuration)({
|
|
17
|
+
apiKey: accessToken
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
globalLang = _nullishCoalesce(lang, () => ( null));
|
|
21
|
+
globalComponents = _nullishCoalesce(components, () => ( {}));
|
|
22
|
+
return () => globalConfiguration;
|
|
23
|
+
};
|
|
24
|
+
async function getNitroConfig() {
|
|
25
|
+
console.log("\n[getNitroConfig] call");
|
|
26
|
+
if (configResponse) {
|
|
27
|
+
return configResponse;
|
|
28
|
+
}
|
|
29
|
+
if (configPromise) {
|
|
30
|
+
return configPromise;
|
|
31
|
+
}
|
|
32
|
+
const configApi = new (0, _nitrotypescript.ConfigApi)(globalConfiguration);
|
|
33
|
+
const useLang = _nullishCoalesce(globalLang, () => ( void 0));
|
|
34
|
+
configPromise = configApi.config({ lang: useLang }).then((config) => {
|
|
35
|
+
configResponse = config;
|
|
36
|
+
return config;
|
|
37
|
+
}).finally(() => {
|
|
38
|
+
configPromise = null;
|
|
39
|
+
console.log("\n[getNitroConfig] fetched config");
|
|
40
|
+
});
|
|
41
|
+
return configPromise;
|
|
42
|
+
}
|
|
43
|
+
function getNitroPages() {
|
|
44
|
+
return new (0, _nitrotypescript.PagesApi)(globalConfiguration);
|
|
45
|
+
}
|
|
46
|
+
function getNitroEntities() {
|
|
47
|
+
return new (0, _nitrotypescript.EntitiesApi)(globalConfiguration);
|
|
48
|
+
}
|
|
49
|
+
function NitroPage({
|
|
50
|
+
page
|
|
51
|
+
}) {
|
|
52
|
+
if (!_optionalChain([page, 'optionalAccess', _ => _.json]) || !Array.isArray(page.json)) {
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, { children: page.json.map((block, index) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
56
|
+
NitroBlock,
|
|
57
|
+
{
|
|
58
|
+
block
|
|
59
|
+
},
|
|
60
|
+
block.uid || index
|
|
61
|
+
)) });
|
|
62
|
+
}
|
|
63
|
+
function NitroBlock({
|
|
64
|
+
block
|
|
65
|
+
}) {
|
|
66
|
+
if (!block) {
|
|
67
|
+
return null;
|
|
68
|
+
}
|
|
69
|
+
const Component = block.component ? globalComponents[block.component] : void 0;
|
|
70
|
+
if (Component) {
|
|
71
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Component, { block });
|
|
72
|
+
}
|
|
73
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "pre", { children: JSON.stringify(block, null, 2) }) });
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
exports.initNitro = initNitro; exports.getNitroConfig = getNitroConfig; exports.getNitroPages = getNitroPages; exports.getNitroEntities = getNitroEntities; exports.NitroPage = NitroPage; exports.NitroBlock = NitroBlock;
|
|
84
|
+
//# sourceMappingURL=chunk-JMEC5XWK.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/nitro-next/nitro-next/lib/dist/chunk-JMEC5XWK.js","../src/server.tsx"],"names":[],"mappings":"AAAA;ACAA;AAGE;AAEA;AACA;AACA;AAAA,yDACK;AA0EH,+CAAA;AAxEJ,IAAI,oBAAA,EAA4C,IAAA;AAChD,IAAI,eAAA,EAAwC,IAAA;AAC5C,IAAI,cAAA,EAAgD,IAAA;AACpD,IAAI,WAAA,EAA4B,IAAA;AAEhC,IAAI,iBAAA,EAAwC,CAAC,CAAA;AAEtC,IAAM,UAAA,EAAY,CAAC,EAAC,WAAA,EAAa,I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mBAAoB,CAAA;AAC7C;AAMO,SAAS,SAAA,CAAU;AAAA,EACxB;AACF,CAAA,EAEG;AACD,EAAA,GAAA,CAAI,iBAAC,IAAA,2BAAM,OAAA,GAAQ,CAAC,KAAA,CAAM,OAAA,CAAQ,IAAA,CAAK,IAAI,CAAA,EAAG;AAC5C,IAAA,OAAO,IAAA;AAAA,EACT;AAEA,EAAA,uBACE,6BAAA,oBAAA,EAAA,EACG,QAAA,EAAA,IAAA,CAAK,IAAA,CAAK,GAAA,CAAI,CAAC,KAAA,EAAc,KAAA,EAAA,mBAC5B,6BAAA;AAAA,IAAC,UAAA;AAAA,IAAA;AAAA,MAEC;AAAA,IAAA,CAAA;AAAA,IADK,KAAA,CAAM,IAAA,GAAO;AAAA,EAEpB,CACD,EAAA,CACH,CAAA;AAEJ;AAEO,SAAS,UAAA,CAAW;AAAA,EACzB;AACF,CAAA,EAEG;AACD,EAAA,GAAA,CAAI,CAAC,KAAA,EAAO;AACV,IAAA,OAAO,IAAA;AAAA,EACT;AAEA,EAAA,MAAM,UAAA,EAAY,KAAA,CAAM,UAAA,EAAY,gBAAA,CAAiB,KAAA,CAAM,SAAS,EAAA,EAAI,KAAA,CAAA;AAExE,EAAA,GAAA,CAAI,SAAA,EAAW;AACb,IAAA,uBAAO,6BAAA,SAAC,EAAA,EAAU,MAAA,CAAc,CAAA;AAAA,EAClC;AAEA,EAAA,uBACE,6BAAA,KAAC,EAAA,EAEC,QAAA,kBAAA,6BAAA,KAAC,EAAA,EAAK,QAAA,EAAA,IAAA,CAAK,SAAA,CAAU,KAAA,EAAO,IAAA,EAAM,CAAC,EAAA,CAAE,EAAA,CACvC,CAAA;AAEJ;ADxCA;AACA;AACE;AACA;AACA;AACA;AACA;AACA;AACF,2NAAC","file":"/home/runner/work/nitro-next/nitro-next/lib/dist/chunk-JMEC5XWK.js","sourcesContent":[null,"import {\n Page,\n Block,\n ConfigApi,\n ConfigResponse,\n Configuration,\n PagesApi,\n EntitiesApi\n} from '@flyo/nitro-typescript';\n\nlet globalConfiguration: Configuration | null = null;\nlet configResponse: ConfigResponse | null = null;\nlet configPromise: Promise<ConfigResponse> | null = null;\nlet globalLang: string | null = null;\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nlet globalComponents: Record<string, any> = {};\n\nexport const initNitro = ({accessToken, lang, components}: {accessToken: string, lang?: string, components?: object}): ( () => Configuration ) => {\n\n if (!globalConfiguration) {\n globalConfiguration = new Configuration({\n apiKey: accessToken,\n });\n }\n\n globalLang = lang ?? null;\n globalComponents = components ?? {};\n\n return () => globalConfiguration!;\n}\n\nexport async function getNitroConfig(): Promise<ConfigResponse> {\n\n console.log('\\n[getNitroConfig] call');\n\n if (configResponse) {\n return configResponse;\n }\n\n if (configPromise) {\n return configPromise;\n }\n\n const configApi = new ConfigApi(globalConfiguration!);\n const useLang = globalLang ?? undefined;\n\n configPromise = configApi\n .config({ lang: useLang })\n .then((config) => {\n configResponse = config;\n return config;\n })\n .finally(() => {\n configPromise = null;\n console.log('\\n[getNitroConfig] fetched config');\n });\n\n return configPromise;\n}\n\nexport function getNitroPages(): PagesApi {\n return new PagesApi(globalConfiguration!);\n}\n\nexport function getNitroEntities(): EntitiesApi {\n return new EntitiesApi(globalConfiguration!);\n}\n\n\n/**\n * NitroPage component renders all blocks from a Flyo page\n */\nexport function NitroPage({\n page,\n}: {\n page: Page\n}) {\n if (!page?.json || !Array.isArray(page.json)) {\n return null;\n }\n\n return (\n <>\n {page.json.map((block: Block, index: number) => (\n <NitroBlock\n key={block.uid || index}\n block={block}\n />\n ))}\n </>\n );\n}\n\nexport function NitroBlock({\n block,\n}: {\n block: Block\n}) {\n if (!block) {\n return null;\n }\n\n const Component = block.component ? globalComponents[block.component] : undefined;\n\n if (Component) {\n return <Component block={block} />;\n }\n\n return (\n <div>\n {/* Render block content here */}\n <pre>{JSON.stringify(block, null, 2)}</pre>\n </div>\n );\n}"]}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
// src/server.tsx
|
|
2
|
+
import {
|
|
3
|
+
ConfigApi,
|
|
4
|
+
Configuration,
|
|
5
|
+
PagesApi,
|
|
6
|
+
EntitiesApi
|
|
7
|
+
} from "@flyo/nitro-typescript";
|
|
8
|
+
import { Fragment, jsx } from "react/jsx-runtime";
|
|
9
|
+
var globalConfiguration = null;
|
|
10
|
+
var configResponse = null;
|
|
11
|
+
var configPromise = null;
|
|
12
|
+
var globalLang = null;
|
|
13
|
+
var globalComponents = {};
|
|
14
|
+
var initNitro = ({ accessToken, lang, components }) => {
|
|
15
|
+
if (!globalConfiguration) {
|
|
16
|
+
globalConfiguration = new Configuration({
|
|
17
|
+
apiKey: accessToken
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
globalLang = lang ?? null;
|
|
21
|
+
globalComponents = components ?? {};
|
|
22
|
+
return () => globalConfiguration;
|
|
23
|
+
};
|
|
24
|
+
async function getNitroConfig() {
|
|
25
|
+
console.log("\n[getNitroConfig] call");
|
|
26
|
+
if (configResponse) {
|
|
27
|
+
return configResponse;
|
|
28
|
+
}
|
|
29
|
+
if (configPromise) {
|
|
30
|
+
return configPromise;
|
|
31
|
+
}
|
|
32
|
+
const configApi = new ConfigApi(globalConfiguration);
|
|
33
|
+
const useLang = globalLang ?? void 0;
|
|
34
|
+
configPromise = configApi.config({ lang: useLang }).then((config) => {
|
|
35
|
+
configResponse = config;
|
|
36
|
+
return config;
|
|
37
|
+
}).finally(() => {
|
|
38
|
+
configPromise = null;
|
|
39
|
+
console.log("\n[getNitroConfig] fetched config");
|
|
40
|
+
});
|
|
41
|
+
return configPromise;
|
|
42
|
+
}
|
|
43
|
+
function getNitroPages() {
|
|
44
|
+
return new PagesApi(globalConfiguration);
|
|
45
|
+
}
|
|
46
|
+
function getNitroEntities() {
|
|
47
|
+
return new EntitiesApi(globalConfiguration);
|
|
48
|
+
}
|
|
49
|
+
function NitroPage({
|
|
50
|
+
page
|
|
51
|
+
}) {
|
|
52
|
+
if (!page?.json || !Array.isArray(page.json)) {
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
return /* @__PURE__ */ jsx(Fragment, { children: page.json.map((block, index) => /* @__PURE__ */ jsx(
|
|
56
|
+
NitroBlock,
|
|
57
|
+
{
|
|
58
|
+
block
|
|
59
|
+
},
|
|
60
|
+
block.uid || index
|
|
61
|
+
)) });
|
|
62
|
+
}
|
|
63
|
+
function NitroBlock({
|
|
64
|
+
block
|
|
65
|
+
}) {
|
|
66
|
+
if (!block) {
|
|
67
|
+
return null;
|
|
68
|
+
}
|
|
69
|
+
const Component = block.component ? globalComponents[block.component] : void 0;
|
|
70
|
+
if (Component) {
|
|
71
|
+
return /* @__PURE__ */ jsx(Component, { block });
|
|
72
|
+
}
|
|
73
|
+
return /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx("pre", { children: JSON.stringify(block, null, 2) }) });
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export {
|
|
77
|
+
initNitro,
|
|
78
|
+
getNitroConfig,
|
|
79
|
+
getNitroPages,
|
|
80
|
+
getNitroEntities,
|
|
81
|
+
NitroPage,
|
|
82
|
+
NitroBlock
|
|
83
|
+
};
|
|
84
|
+
//# sourceMappingURL=chunk-T46Q5G3T.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/server.tsx"],"sourcesContent":["import {\n Page,\n Block,\n ConfigApi,\n ConfigResponse,\n Configuration,\n PagesApi,\n EntitiesApi\n} from '@flyo/nitro-typescript';\n\nlet globalConfiguration: Configuration | null = null;\nlet configResponse: ConfigResponse | null = null;\nlet configPromise: Promise<ConfigResponse> | null = null;\nlet globalLang: string | null = null;\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nlet globalComponents: Record<string, any> = {};\n\nexport const initNitro = ({accessToken, lang, components}: {accessToken: string, lang?: string, components?: object}): ( () => Configuration ) => {\n\n if (!globalConfiguration) {\n globalConfiguration = new Configuration({\n apiKey: accessToken,\n });\n }\n\n globalLang = lang ?? null;\n globalComponents = components ?? {};\n\n return () => globalConfiguration!;\n}\n\nexport async function getNitroConfig(): Promise<ConfigResponse> {\n\n console.log('\\n[getNitroConfig] call');\n\n if (configResponse) {\n return configResponse;\n }\n\n if (configPromise) {\n return configPromise;\n }\n\n const configApi = new ConfigApi(globalConfiguration!);\n const useLang = globalLang ?? undefined;\n\n configPromise = configApi\n .config({ lang: useLang })\n .then((config) => {\n configResponse = config;\n return config;\n })\n .finally(() => {\n configPromise = null;\n console.log('\\n[getNitroConfig] fetched config');\n });\n\n return configPromise;\n}\n\nexport function getNitroPages(): PagesApi {\n return new PagesApi(globalConfiguration!);\n}\n\nexport function getNitroEntities(): EntitiesApi {\n return new EntitiesApi(globalConfiguration!);\n}\n\n\n/**\n * NitroPage component renders all blocks from a Flyo page\n */\nexport function NitroPage({\n page,\n}: {\n page: Page\n}) {\n if (!page?.json || !Array.isArray(page.json)) {\n return null;\n }\n\n return (\n <>\n {page.json.map((block: Block, index: number) => (\n <NitroBlock\n key={block.uid || index}\n block={block}\n />\n ))}\n </>\n );\n}\n\nexport function NitroBlock({\n block,\n}: {\n block: Block\n}) {\n if (!block) {\n return null;\n }\n\n const Component = block.component ? globalComponents[block.component] : undefined;\n\n if (Component) {\n return <Component block={block} />;\n }\n\n return (\n <div>\n {/* Render block content here */}\n <pre>{JSON.stringify(block, null, 2)}</pre>\n </div>\n );\n}"],"mappings":";AAAA;AAAA,EAGE;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AA0EH,mBAEI,WAFJ;AAxEJ,IAAI,sBAA4C;AAChD,IAAI,iBAAwC;AAC5C,IAAI,gBAAgD;AACpD,IAAI,aAA4B;AAEhC,IAAI,mBAAwC,CAAC;AAEtC,IAAM,YAAY,CAAC,EAAC,aAAa,MAAM,WAAU,MAA4F;AAEhJ,MAAI,CAAC,qBAAqB;AACxB,0BAAsB,IAAI,cAAc;AAAA,MACtC,QAAQ;AAAA,IACV,CAAC;AAAA,EACH;AAEA,eAAa,QAAQ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version":3,"sources":["/home/runner/work/nitro-next/nitro-next/lib/dist/client.js"],"names":[],"mappings":"AAAA,yBAAY","file":"/home/runner/work/nitro-next/nitro-next/lib/dist/client.js"}
|
package/dist/client.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/index.d.mts
ADDED
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
var _chunkJMEC5XWKjs = require('./chunk-JMEC5XWK.js');
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
exports.NitroBlock = _chunkJMEC5XWKjs.NitroBlock; exports.NitroPage = _chunkJMEC5XWKjs.NitroPage; exports.getNitroConfig = _chunkJMEC5XWKjs.getNitroConfig; exports.getNitroEntities = _chunkJMEC5XWKjs.getNitroEntities; exports.getNitroPages = _chunkJMEC5XWKjs.getNitroPages; exports.initNitro = _chunkJMEC5XWKjs.initNitro;
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/nitro-next/nitro-next/lib/dist/index.js"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;AACA;AACF,sDAA4B;AAC5B;AACE;AACA;AACA;AACA;AACA;AACA;AACF,iUAAC","file":"/home/runner/work/nitro-next/nitro-next/lib/dist/index.js"}
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import {
|
|
2
|
+
NitroBlock,
|
|
3
|
+
NitroPage,
|
|
4
|
+
getNitroConfig,
|
|
5
|
+
getNitroEntities,
|
|
6
|
+
getNitroPages,
|
|
7
|
+
initNitro
|
|
8
|
+
} from "./chunk-T46Q5G3T.mjs";
|
|
9
|
+
export {
|
|
10
|
+
NitroBlock,
|
|
11
|
+
NitroPage,
|
|
12
|
+
getNitroConfig,
|
|
13
|
+
getNitroEntities,
|
|
14
|
+
getNitroPages,
|
|
15
|
+
initNitro
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { Block, Page, Configuration, ConfigResponse, PagesApi, EntitiesApi } from '@flyo/nitro-typescript';
|
|
3
|
+
|
|
4
|
+
declare const initNitro: ({ accessToken, lang, components }: {
|
|
5
|
+
accessToken: string;
|
|
6
|
+
lang?: string;
|
|
7
|
+
components?: object;
|
|
8
|
+
}) => (() => Configuration);
|
|
9
|
+
declare function getNitroConfig(): Promise<ConfigResponse>;
|
|
10
|
+
declare function getNitroPages(): PagesApi;
|
|
11
|
+
declare function getNitroEntities(): EntitiesApi;
|
|
12
|
+
/**
|
|
13
|
+
* NitroPage component renders all blocks from a Flyo page
|
|
14
|
+
*/
|
|
15
|
+
declare function NitroPage({ page, }: {
|
|
16
|
+
page: Page;
|
|
17
|
+
}): react_jsx_runtime.JSX.Element | null;
|
|
18
|
+
declare function NitroBlock({ block, }: {
|
|
19
|
+
block: Block;
|
|
20
|
+
}): react_jsx_runtime.JSX.Element | null;
|
|
21
|
+
|
|
22
|
+
export { NitroBlock, NitroPage, getNitroConfig, getNitroEntities, getNitroPages, initNitro };
|
package/dist/server.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { Block, Page, Configuration, ConfigResponse, PagesApi, EntitiesApi } from '@flyo/nitro-typescript';
|
|
3
|
+
|
|
4
|
+
declare const initNitro: ({ accessToken, lang, components }: {
|
|
5
|
+
accessToken: string;
|
|
6
|
+
lang?: string;
|
|
7
|
+
components?: object;
|
|
8
|
+
}) => (() => Configuration);
|
|
9
|
+
declare function getNitroConfig(): Promise<ConfigResponse>;
|
|
10
|
+
declare function getNitroPages(): PagesApi;
|
|
11
|
+
declare function getNitroEntities(): EntitiesApi;
|
|
12
|
+
/**
|
|
13
|
+
* NitroPage component renders all blocks from a Flyo page
|
|
14
|
+
*/
|
|
15
|
+
declare function NitroPage({ page, }: {
|
|
16
|
+
page: Page;
|
|
17
|
+
}): react_jsx_runtime.JSX.Element | null;
|
|
18
|
+
declare function NitroBlock({ block, }: {
|
|
19
|
+
block: Block;
|
|
20
|
+
}): react_jsx_runtime.JSX.Element | null;
|
|
21
|
+
|
|
22
|
+
export { NitroBlock, NitroPage, getNitroConfig, getNitroEntities, getNitroPages, initNitro };
|
package/dist/server.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
var _chunkJMEC5XWKjs = require('./chunk-JMEC5XWK.js');
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
exports.NitroBlock = _chunkJMEC5XWKjs.NitroBlock; exports.NitroPage = _chunkJMEC5XWKjs.NitroPage; exports.getNitroConfig = _chunkJMEC5XWKjs.getNitroConfig; exports.getNitroEntities = _chunkJMEC5XWKjs.getNitroEntities; exports.getNitroPages = _chunkJMEC5XWKjs.getNitroPages; exports.initNitro = _chunkJMEC5XWKjs.initNitro;
|
|
17
|
+
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/nitro-next/nitro-next/lib/dist/server.js"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;AACA;AACF,sDAA4B;AAC5B;AACE;AACA;AACA;AACA;AACA;AACA;AACF,iUAAC","file":"/home/runner/work/nitro-next/nitro-next/lib/dist/server.js"}
|
package/dist/server.mjs
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import {
|
|
2
|
+
NitroBlock,
|
|
3
|
+
NitroPage,
|
|
4
|
+
getNitroConfig,
|
|
5
|
+
getNitroEntities,
|
|
6
|
+
getNitroPages,
|
|
7
|
+
initNitro
|
|
8
|
+
} from "./chunk-T46Q5G3T.mjs";
|
|
9
|
+
export {
|
|
10
|
+
NitroBlock,
|
|
11
|
+
NitroPage,
|
|
12
|
+
getNitroConfig,
|
|
13
|
+
getNitroEntities,
|
|
14
|
+
getNitroPages,
|
|
15
|
+
initNitro
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=server.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/package.json
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@flyo/nitro-next",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Connecting Flyo Headless Content Hub into your Next.js project.",
|
|
5
|
+
"homepage": "https://dev.flyo.cloud/nitro",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"nextjs",
|
|
8
|
+
"flyo",
|
|
9
|
+
"cms",
|
|
10
|
+
"headless"
|
|
11
|
+
],
|
|
12
|
+
"main": "./dist/index.js",
|
|
13
|
+
"module": "./dist/index.mjs",
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"scripts": {
|
|
16
|
+
"dev": "tsup --watch",
|
|
17
|
+
"build": "tsup",
|
|
18
|
+
"test": "jest",
|
|
19
|
+
"test:watch": "jest --watch",
|
|
20
|
+
"test:coverage": "jest --coverage",
|
|
21
|
+
"lint": "eslint src"
|
|
22
|
+
},
|
|
23
|
+
"exports": {
|
|
24
|
+
".": {
|
|
25
|
+
"types": "./dist/index.d.ts",
|
|
26
|
+
"import": "./dist/index.mjs",
|
|
27
|
+
"require": "./dist/index.js"
|
|
28
|
+
},
|
|
29
|
+
"./client": {
|
|
30
|
+
"types": "./dist/client.d.ts",
|
|
31
|
+
"import": "./dist/client.mjs",
|
|
32
|
+
"require": "./dist/client.js"
|
|
33
|
+
},
|
|
34
|
+
"./server": {
|
|
35
|
+
"types": "./dist/server.d.ts",
|
|
36
|
+
"import": "./dist/server.mjs",
|
|
37
|
+
"require": "./dist/server.js"
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"files": [
|
|
41
|
+
"dist"
|
|
42
|
+
],
|
|
43
|
+
"dependencies": {
|
|
44
|
+
"@flyo/nitro-js-bridge": "^1.1.2",
|
|
45
|
+
"@flyo/nitro-typescript": "^1.1.0"
|
|
46
|
+
},
|
|
47
|
+
"peerDependencies": {
|
|
48
|
+
"next": ">=16.0.4",
|
|
49
|
+
"react": ">=18.0.0",
|
|
50
|
+
"react-dom": ">=18.0.0"
|
|
51
|
+
},
|
|
52
|
+
"devDependencies": {
|
|
53
|
+
"@testing-library/jest-dom": "^6.1.5",
|
|
54
|
+
"@testing-library/react": "^14.1.2",
|
|
55
|
+
"@types/jest": "^29.5.11",
|
|
56
|
+
"@types/node": "^20.10.0",
|
|
57
|
+
"@types/react": "^18.2.0",
|
|
58
|
+
"@types/react-dom": "^18.2.0",
|
|
59
|
+
"@typescript-eslint/eslint-plugin": "^7.18.0",
|
|
60
|
+
"@typescript-eslint/parser": "^7.18.0",
|
|
61
|
+
"eslint": "^8.57.1",
|
|
62
|
+
"eslint-plugin-react": "^7.37.5",
|
|
63
|
+
"eslint-plugin-react-hooks": "^7.0.1",
|
|
64
|
+
"jest": "^29.7.0",
|
|
65
|
+
"jest-environment-jsdom": "^29.7.0",
|
|
66
|
+
"next": "^14.2.25",
|
|
67
|
+
"react": "^18.2.0",
|
|
68
|
+
"react-dom": "^18.2.0",
|
|
69
|
+
"ts-jest": "^29.1.1",
|
|
70
|
+
"tsup": "^8.0.0",
|
|
71
|
+
"typescript": "^5.3.0"
|
|
72
|
+
},
|
|
73
|
+
"author": "Basil Suter <git@nadar.io>",
|
|
74
|
+
"license": "MIT",
|
|
75
|
+
"repository": {
|
|
76
|
+
"type": "git",
|
|
77
|
+
"url": "https://github.com/flyocloud/nitro-next"
|
|
78
|
+
},
|
|
79
|
+
"publishConfig": {
|
|
80
|
+
"access": "public"
|
|
81
|
+
}
|
|
82
|
+
}
|