@nitrogenbuilder/connector-payload 0.1.40 → 0.1.41
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/components/LockedJsonField.js +1 -1
- package/dist/components/NitrogenComponentInventoryClient.d.ts +1 -1
- package/dist/components/NitrogenComponentInventoryField.js +5 -5
- package/dist/components/NitrogenComponentInventoryView.js +5 -5
- package/dist/components/NitrogenDataViewer.js +1 -1
- package/dist/components/NitrogenEditButton.js +2 -2
- package/dist/components/NitrogenEditButtonRuntime.js +21 -5
- package/dist/components/NitrogenViewButton.js +2 -2
- package/dist/components/NitrogenViewButtonRuntime.js +7 -3
- package/dist/editor/NitrogenEditorPage.js +12 -29
- package/dist/editor/index.d.ts +3 -3
- package/dist/editor/index.js +3 -3
- package/dist/endpoints/all.js +2 -2
- package/dist/endpoints/batch.js +2 -2
- package/dist/endpoints/collection-endpoints.js +1 -1
- package/dist/endpoints/component-inventory.d.ts +1 -1
- package/dist/endpoints/component-inventory.js +2 -2
- package/dist/endpoints/helpers.d.ts +5 -5
- package/dist/endpoints/helpers.js +1 -1
- package/dist/endpoints/media.js +1 -1
- package/dist/endpoints/nitrogen-settings.js +1 -1
- package/dist/endpoints/templates.js +2 -2
- package/dist/frontend/NitrogenWrapper.js +2 -2
- package/dist/frontend/index.d.ts +5 -5
- package/dist/frontend/index.js +3 -3
- package/dist/globals/NitrogenSettings.js +46 -11
- package/dist/index.d.ts +7 -7
- package/dist/index.js +22 -22
- package/dist/inventory/indexing.d.ts +2 -2
- package/dist/inventory/indexing.js +1 -1
- package/dist/types.d.ts +6 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { LockedJsonFieldRuntime } from './LockedJsonFieldRuntime';
|
|
2
|
+
import { LockedJsonFieldRuntime } from './LockedJsonFieldRuntime.js';
|
|
3
3
|
export const LockedJsonField = ({ field, value }) => {
|
|
4
4
|
const label = typeof field.label === 'string' ? field.label : field.name;
|
|
5
5
|
const description = typeof field.admin?.description === 'string' ? field.admin.description : undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ComponentManifestEntry } from '@nitrogenbuilder/types';
|
|
2
|
-
import type { NitrogenComponentUsageDoc } from '../types';
|
|
2
|
+
import type { NitrogenComponentUsageDoc } from '../types.js';
|
|
3
3
|
type InventoryClientProps = {
|
|
4
4
|
adminRoute: string;
|
|
5
5
|
components: Array<{
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { findAllDocs, NITROGEN_COMPONENT_CATALOG_COLLECTION, NITROGEN_COMPONENT_USAGE_COLLECTION, } from '../inventory/indexing';
|
|
3
|
-
import { getNitrogenSettings } from '../endpoints/helpers';
|
|
4
|
-
import NitrogenComponentInventoryClient from './NitrogenComponentInventoryClient';
|
|
5
|
-
import NitrogenComponentInventoryReindexButton from './NitrogenComponentInventoryReindexButton';
|
|
2
|
+
import { findAllDocs, NITROGEN_COMPONENT_CATALOG_COLLECTION, NITROGEN_COMPONENT_USAGE_COLLECTION, } from '../inventory/indexing.js';
|
|
3
|
+
import { getNitrogenSettings } from '../endpoints/helpers.js';
|
|
4
|
+
import NitrogenComponentInventoryClient from './NitrogenComponentInventoryClient.js';
|
|
5
|
+
import NitrogenComponentInventoryReindexButton from './NitrogenComponentInventoryReindexButton.js';
|
|
6
6
|
function buildComponentPreviewUrl(settings) {
|
|
7
|
-
const frontendBaseUrl = String(settings.developmentUrl || settings.frontendUrl || '').replace(/\/$/, '');
|
|
7
|
+
const frontendBaseUrl = String(settings.frontendDevUrl || settings.developmentUrl || settings.frontendUrl || '').replace(/\/$/, '');
|
|
8
8
|
if (!frontendBaseUrl) {
|
|
9
9
|
return '';
|
|
10
10
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
// @ts-expect-error The consuming Payload app provides @payloadcms/next at runtime.
|
|
3
3
|
import { DefaultTemplate } from '@payloadcms/next/templates';
|
|
4
|
-
import { findAllDocs, NITROGEN_COMPONENT_CATALOG_COLLECTION, NITROGEN_COMPONENT_USAGE_COLLECTION, } from '../inventory/indexing';
|
|
5
|
-
import { getNitrogenSettings } from '../endpoints/helpers';
|
|
6
|
-
import NitrogenComponentInventoryClient from './NitrogenComponentInventoryClient';
|
|
7
|
-
import NitrogenComponentInventoryReindexButton from './NitrogenComponentInventoryReindexButton';
|
|
4
|
+
import { findAllDocs, NITROGEN_COMPONENT_CATALOG_COLLECTION, NITROGEN_COMPONENT_USAGE_COLLECTION, } from '../inventory/indexing.js';
|
|
5
|
+
import { getNitrogenSettings } from '../endpoints/helpers.js';
|
|
6
|
+
import NitrogenComponentInventoryClient from './NitrogenComponentInventoryClient.js';
|
|
7
|
+
import NitrogenComponentInventoryReindexButton from './NitrogenComponentInventoryReindexButton.js';
|
|
8
8
|
function buildComponentPreviewUrl(settings) {
|
|
9
|
-
const frontendBaseUrl = String(settings.developmentUrl || settings.frontendUrl || '').replace(/\/$/, '');
|
|
9
|
+
const frontendBaseUrl = String(settings.frontendDevUrl || settings.developmentUrl || settings.frontendUrl || '').replace(/\/$/, '');
|
|
10
10
|
if (!frontendBaseUrl) {
|
|
11
11
|
return '';
|
|
12
12
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import NitrogenDataViewerRuntime from './NitrogenDataViewerRuntime';
|
|
2
|
+
import NitrogenDataViewerRuntime from './NitrogenDataViewerRuntime.js';
|
|
3
3
|
const NitrogenDataViewer = ({ field, path, value }) => {
|
|
4
4
|
const label = typeof field.label === 'string' ? field.label : field.name;
|
|
5
5
|
const description = typeof field.admin?.description === 'string' ? field.admin.description : undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import dynamic from 'next/dynamic';
|
|
3
|
-
export const NitrogenEditButton = dynamic(() => import('./NitrogenEditButtonRuntime').then((module) => module.NitrogenEditButtonRuntime), {
|
|
2
|
+
import dynamic from 'next/dynamic.js';
|
|
3
|
+
export const NitrogenEditButton = dynamic(() => import('./NitrogenEditButtonRuntime.js').then((module) => module.NitrogenEditButtonRuntime), {
|
|
4
4
|
loading: () => null,
|
|
5
5
|
ssr: false,
|
|
6
6
|
});
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useState, useEffect } from 'react';
|
|
4
4
|
import { Button } from '@payloadcms/ui';
|
|
5
|
-
import { nitrogenButtonGroupStyle, nitrogenEditDevButtonVars, nitrogenEditLiveButtonVars, nitrogenViewButtonVars, } from './nitrogenAdminButtonStyles';
|
|
5
|
+
import { nitrogenButtonGroupStyle, nitrogenEditDevButtonVars, nitrogenEditLiveButtonVars, nitrogenViewButtonVars, } from './nitrogenAdminButtonStyles.js';
|
|
6
6
|
function isLocalAdminHost() {
|
|
7
7
|
const hostname = window.location.hostname;
|
|
8
8
|
return (hostname === 'localhost' ||
|
|
@@ -11,8 +11,23 @@ function isLocalAdminHost() {
|
|
|
11
11
|
}
|
|
12
12
|
function getPreferredSiteUrl(data) {
|
|
13
13
|
const isLocalAdmin = isLocalAdminHost();
|
|
14
|
-
const preferredUrl = isLocalAdmin
|
|
15
|
-
|
|
14
|
+
const preferredUrl = isLocalAdmin
|
|
15
|
+
? data.frontendDevUrl || data.developmentUrl
|
|
16
|
+
: data.frontendUrl;
|
|
17
|
+
const fallbackUrl = isLocalAdmin
|
|
18
|
+
? data.frontendUrl
|
|
19
|
+
: data.frontendDevUrl || data.developmentUrl;
|
|
20
|
+
return preferredUrl || fallbackUrl || '';
|
|
21
|
+
}
|
|
22
|
+
function getPreferredEditorUrl(data) {
|
|
23
|
+
const isLocalAdmin = isLocalAdminHost();
|
|
24
|
+
const legacyEditorDevUrl = data.instanceUrl;
|
|
25
|
+
const preferredUrl = isLocalAdmin
|
|
26
|
+
? data.nitrogenEditorDevUrl || legacyEditorDevUrl
|
|
27
|
+
: data.nitrogenEditorUrl;
|
|
28
|
+
const fallbackUrl = isLocalAdmin
|
|
29
|
+
? data.nitrogenEditorUrl
|
|
30
|
+
: data.nitrogenEditorDevUrl || legacyEditorDevUrl;
|
|
16
31
|
return preferredUrl || fallbackUrl || '';
|
|
17
32
|
}
|
|
18
33
|
function normalizeRoutePattern(routePattern) {
|
|
@@ -105,8 +120,9 @@ export const NitrogenEditButtonRuntime = ({ collection, routePattern }) => {
|
|
|
105
120
|
if (data.connectorToken) {
|
|
106
121
|
setToken(data.connectorToken);
|
|
107
122
|
}
|
|
108
|
-
|
|
109
|
-
|
|
123
|
+
const editorUrl = getPreferredEditorUrl(data);
|
|
124
|
+
if (editorUrl) {
|
|
125
|
+
setInstanceUrl(editorUrl.replace(/\/$/, ''));
|
|
110
126
|
}
|
|
111
127
|
const url = getPreferredSiteUrl(data);
|
|
112
128
|
if (url) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import dynamic from 'next/dynamic';
|
|
3
|
-
export const NitrogenViewButton = dynamic(() => import('./NitrogenViewButtonRuntime').then((module) => module.NitrogenViewButtonRuntime), {
|
|
2
|
+
import dynamic from 'next/dynamic.js';
|
|
3
|
+
export const NitrogenViewButton = dynamic(() => import('./NitrogenViewButtonRuntime.js').then((module) => module.NitrogenViewButtonRuntime), {
|
|
4
4
|
loading: () => null,
|
|
5
5
|
ssr: false,
|
|
6
6
|
});
|
|
@@ -2,14 +2,18 @@
|
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { useState, useEffect } from 'react';
|
|
4
4
|
import { Button } from '@payloadcms/ui';
|
|
5
|
-
import { nitrogenViewButtonVars } from './nitrogenAdminButtonStyles';
|
|
5
|
+
import { nitrogenViewButtonVars } from './nitrogenAdminButtonStyles.js';
|
|
6
6
|
function getPreferredSiteUrl(data) {
|
|
7
7
|
const hostname = window.location.hostname;
|
|
8
8
|
const isLocalAdmin = hostname === 'localhost' ||
|
|
9
9
|
hostname === '127.0.0.1' ||
|
|
10
10
|
hostname === '[::1]';
|
|
11
|
-
const preferredUrl = isLocalAdmin
|
|
12
|
-
|
|
11
|
+
const preferredUrl = isLocalAdmin
|
|
12
|
+
? data.frontendDevUrl || data.developmentUrl
|
|
13
|
+
: data.frontendUrl;
|
|
14
|
+
const fallbackUrl = isLocalAdmin
|
|
15
|
+
? data.frontendUrl
|
|
16
|
+
: data.frontendDevUrl || data.developmentUrl;
|
|
13
17
|
return preferredUrl || fallbackUrl || '';
|
|
14
18
|
}
|
|
15
19
|
function normalizeRoutePattern(routePattern) {
|
|
@@ -21,33 +21,16 @@ function getNitrogenApiUrl(isDevelopment) {
|
|
|
21
21
|
}
|
|
22
22
|
function getSiteUrl(settings, isDevelopment) {
|
|
23
23
|
const preferredUrl = isDevelopment
|
|
24
|
-
? settings.developmentUrl
|
|
24
|
+
? settings.frontendDevUrl || settings.developmentUrl
|
|
25
25
|
: settings.frontendUrl;
|
|
26
26
|
const fallbackUrl = isDevelopment
|
|
27
27
|
? settings.frontendUrl
|
|
28
|
-
: settings.developmentUrl;
|
|
29
|
-
const normalizeOrigin = (value) => {
|
|
30
|
-
if (!value)
|
|
31
|
-
return "";
|
|
32
|
-
try {
|
|
33
|
-
return new URL(value).origin;
|
|
34
|
-
}
|
|
35
|
-
catch {
|
|
36
|
-
return "";
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
const preferredOrigin = normalizeOrigin(preferredUrl);
|
|
40
|
-
const fallbackOrigin = normalizeOrigin(fallbackUrl);
|
|
41
|
-
const instanceOrigin = normalizeOrigin(settings.instanceUrl);
|
|
42
|
-
if (preferredUrl &&
|
|
43
|
-
instanceOrigin &&
|
|
44
|
-
preferredOrigin === instanceOrigin &&
|
|
45
|
-
fallbackUrl &&
|
|
46
|
-
fallbackOrigin !== instanceOrigin) {
|
|
47
|
-
return fallbackUrl;
|
|
48
|
-
}
|
|
28
|
+
: settings.frontendDevUrl || settings.developmentUrl;
|
|
49
29
|
return preferredUrl || fallbackUrl || "";
|
|
50
30
|
}
|
|
31
|
+
function getNitrogenEditorDevUrl(settings) {
|
|
32
|
+
return settings.nitrogenEditorDevUrl || settings.instanceUrl || "";
|
|
33
|
+
}
|
|
51
34
|
/**
|
|
52
35
|
* Creates a standalone editor page that loads the Nitrogen builder.
|
|
53
36
|
*
|
|
@@ -73,7 +56,7 @@ export function createNitrogenEditorPage(config) {
|
|
|
73
56
|
const settings = (await payload.findGlobal({
|
|
74
57
|
slug: "nitrogen-settings",
|
|
75
58
|
}));
|
|
76
|
-
// `development=true` selects the preview target (`
|
|
59
|
+
// `development=true` selects the preview target (`frontendDevUrl`) without
|
|
77
60
|
// requiring the editor shell itself to come from a local Vite server.
|
|
78
61
|
const isPreviewDevelopment = params.development === "true";
|
|
79
62
|
const siteUrl = getSiteUrl(settings, isPreviewDevelopment);
|
|
@@ -104,19 +87,19 @@ export function createNitrogenEditorPage(config) {
|
|
|
104
87
|
requestHostname === "127.0.0.1" ||
|
|
105
88
|
requestHostname === "[::1]";
|
|
106
89
|
const isEditorDevelopment = params.editorDevelopment === "true";
|
|
107
|
-
const
|
|
90
|
+
const editorDevOrigin = getNitrogenEditorDevUrl(settings).replace(/\/$/, "");
|
|
91
|
+
const isEditorDev = !!editorDevOrigin &&
|
|
108
92
|
(isEditorDevelopment ||
|
|
109
93
|
(isPreviewDevelopment && isLocalRequestHost));
|
|
110
|
-
const editorOrigin = settings.instanceUrl?.replace(/\/$/, "") || "";
|
|
111
94
|
const editorAssetsBase = isEditorDev
|
|
112
|
-
?
|
|
95
|
+
? editorDevOrigin
|
|
113
96
|
: "/nitrogen-editor/assets";
|
|
114
97
|
const editorCdnVersion = typeof settings.editorCdnVersion === "string" &&
|
|
115
98
|
settings.editorCdnVersion.trim()
|
|
116
99
|
? settings.editorCdnVersion.trim()
|
|
117
100
|
: DEFAULT_EDITOR_CDN_VERSION;
|
|
118
101
|
const cdnBase = `https://cdn.jsdelivr.net/npm/@nitrogenbuilder/editor@${editorCdnVersion}`;
|
|
119
|
-
return (_jsxs(_Fragment, { children: [!isEditorDev && (_jsxs(_Fragment, { children: [_jsx("link", { rel: "preconnect", href: "https://cdn.jsdelivr.net" }), _jsx("link", { rel: "preconnect", href: "https://fonts.gstatic.com", crossOrigin: "" })] })), isEditorDev ? (_jsxs(_Fragment, { children: [_jsx("link", { rel: "stylesheet", crossOrigin: "", href: `${editorAssetsBase}/fa620pro/css/all.css` }), _jsx("link", { rel: "stylesheet", crossOrigin: "", href: `${editorAssetsBase}/fa620pro/css/sharp-solid.css` }), _jsx("link", { rel: "stylesheet", crossOrigin: "", href: `${
|
|
102
|
+
return (_jsxs(_Fragment, { children: [!isEditorDev && (_jsxs(_Fragment, { children: [_jsx("link", { rel: "preconnect", href: "https://cdn.jsdelivr.net" }), _jsx("link", { rel: "preconnect", href: "https://fonts.gstatic.com", crossOrigin: "" })] })), isEditorDev ? (_jsxs(_Fragment, { children: [_jsx("link", { rel: "stylesheet", crossOrigin: "", href: `${editorAssetsBase}/fa620pro/css/all.css` }), _jsx("link", { rel: "stylesheet", crossOrigin: "", href: `${editorAssetsBase}/fa620pro/css/sharp-solid.css` }), _jsx("link", { rel: "stylesheet", crossOrigin: "", href: `${editorDevOrigin}/src/index.scss` })] })) : (_jsxs(_Fragment, { children: [_jsx("link", { rel: "stylesheet", crossOrigin: "", href: `${editorAssetsBase}/fa620pro/css/all.css` }), _jsx("link", { rel: "stylesheet", crossOrigin: "", href: `${editorAssetsBase}/fa620pro/css/sharp-solid.css` }), _jsx("link", { rel: "stylesheet", crossOrigin: "", href: `${cdnBase}/index.css` })] })), _jsx("script", { dangerouslySetInnerHTML: {
|
|
120
103
|
__html: [
|
|
121
104
|
`window.nitrogenConfig = ${JSON.stringify(builderConfig)};`,
|
|
122
105
|
`window.nitrogenEditId = "${editId}";`,
|
|
@@ -142,7 +125,7 @@ export function createNitrogenEditorPage(config) {
|
|
|
142
125
|
} })) }), _jsx("style", { dangerouslySetInnerHTML: {
|
|
143
126
|
__html: `@keyframes nitrogen-loader-pulse{0%{transform:scale(1);opacity:0}50%{opacity:1}100%{transform:scale(1.05);opacity:0}}`,
|
|
144
127
|
} })] }), isEditorDev ? (_jsxs(_Fragment, { children: [_jsx("script", { type: "module", dangerouslySetInnerHTML: {
|
|
145
|
-
__html: `import RefreshRuntime from "${
|
|
146
|
-
} }), _jsx("script", { type: "module", src: `${
|
|
128
|
+
__html: `import RefreshRuntime from "${editorDevOrigin}/@react-refresh";RefreshRuntime.injectIntoGlobalHook(window);window.$RefreshReg$ = () => {};window.$RefreshSig$ = () => (type) => type;window.__vite_plugin_react_preamble_installed__ = true;`,
|
|
129
|
+
} }), _jsx("script", { type: "module", src: `${editorDevOrigin}/@vite/client` }), _jsx("script", { type: "module", crossOrigin: "", src: `${editorDevOrigin}/src/main.tsx` })] })) : (_jsx("script", { type: "module", crossOrigin: "", src: `${cdnBase}/index.js` }))] }));
|
|
147
130
|
};
|
|
148
131
|
}
|
package/dist/editor/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { createNitrogenEditorPage } from './NitrogenEditorPage';
|
|
2
|
-
export { default as NitrogenEditorLayout } from './NitrogenEditorLayout';
|
|
3
|
-
export { GET as nitrogenEditorAssetsRoute } from './NitrogenEditorAssetsRoute';
|
|
1
|
+
export { createNitrogenEditorPage } from './NitrogenEditorPage.js';
|
|
2
|
+
export { default as NitrogenEditorLayout } from './NitrogenEditorLayout.js';
|
|
3
|
+
export { GET as nitrogenEditorAssetsRoute } from './NitrogenEditorAssetsRoute.js';
|
package/dist/editor/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { createNitrogenEditorPage } from './NitrogenEditorPage';
|
|
2
|
-
export { default as NitrogenEditorLayout } from './NitrogenEditorLayout';
|
|
3
|
-
export { GET as nitrogenEditorAssetsRoute } from './NitrogenEditorAssetsRoute';
|
|
1
|
+
export { createNitrogenEditorPage } from './NitrogenEditorPage.js';
|
|
2
|
+
export { default as NitrogenEditorLayout } from './NitrogenEditorLayout.js';
|
|
3
|
+
export { GET as nitrogenEditorAssetsRoute } from './NitrogenEditorAssetsRoute.js';
|
package/dist/endpoints/all.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { getNitrogenSettings } from './helpers';
|
|
2
|
-
import { buildPermalink, buildRelativePermalink, resolveCollection, } from '../collection-registry';
|
|
1
|
+
import { getNitrogenSettings } from './helpers.js';
|
|
2
|
+
import { buildPermalink, buildRelativePermalink, resolveCollection, } from '../collection-registry.js';
|
|
3
3
|
export const allEndpoints = [
|
|
4
4
|
// GET /api/nitrogen/v1/all — List all items with filtering
|
|
5
5
|
{
|
package/dist/endpoints/batch.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { buildPermalink, buildRelativePermalink, resolveCollection, } from "../collection-registry";
|
|
2
|
-
import { getNitrogenSettings, buildDynamicData, buildPageResponse, } from "./helpers";
|
|
1
|
+
import { buildPermalink, buildRelativePermalink, resolveCollection, } from "../collection-registry.js";
|
|
2
|
+
import { getNitrogenSettings, buildDynamicData, buildPageResponse, } from "./helpers.js";
|
|
3
3
|
function toArray(value) {
|
|
4
4
|
if (Array.isArray(value)) {
|
|
5
5
|
return value.map((item) => String(item).trim()).filter(Boolean);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getNitrogenSettings, buildDynamicData, buildPageResponse, buildListItemResponse, getTemplateForType, requireAuth, } from './helpers';
|
|
1
|
+
import { getNitrogenSettings, buildDynamicData, buildPageResponse, buildListItemResponse, getTemplateForType, requireAuth, } from './helpers.js';
|
|
2
2
|
/**
|
|
3
3
|
* Creates a complete set of CRUD endpoints for a given Payload collection.
|
|
4
4
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Endpoint } from 'payload';
|
|
2
|
-
import type { NitrogenComponentManifestInput } from '../inventory/manifest';
|
|
2
|
+
import type { NitrogenComponentManifestInput } from '../inventory/manifest.js';
|
|
3
3
|
export declare function createComponentInventoryEndpoints(args: {
|
|
4
4
|
collections: string[];
|
|
5
5
|
componentManifest?: NitrogenComponentManifestInput;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { requireAuth } from './helpers';
|
|
2
|
-
import { findAllDocs, NITROGEN_COMPONENT_CATALOG_COLLECTION, NITROGEN_COMPONENT_USAGE_COLLECTION, reindexAllComponentInventory, } from '../inventory/indexing';
|
|
1
|
+
import { requireAuth } from './helpers.js';
|
|
2
|
+
import { findAllDocs, NITROGEN_COMPONENT_CATALOG_COLLECTION, NITROGEN_COMPONENT_USAGE_COLLECTION, reindexAllComponentInventory, } from '../inventory/indexing.js';
|
|
3
3
|
function moduleNameFromNode(node) {
|
|
4
4
|
const value = node.module;
|
|
5
5
|
if (typeof value === 'string')
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Payload, PayloadRequest } from 'payload';
|
|
2
|
-
import type { JsonObject, NitrogenPageDoc, NitrogenTemplateDoc, NitrogenSettingsGlobal, MediaDoc } from '../types';
|
|
2
|
+
import type { JsonObject, NitrogenPageDoc, NitrogenTemplateDoc, NitrogenSettingsGlobal, MediaDoc } from '../types.js';
|
|
3
3
|
export interface TemplateRef {
|
|
4
4
|
ID: string | number;
|
|
5
5
|
content: string;
|
|
@@ -60,10 +60,10 @@ export declare function buildMediaItemResponse(doc: MediaDoc): {
|
|
|
60
60
|
height: number;
|
|
61
61
|
createdAt: string;
|
|
62
62
|
sizes: {
|
|
63
|
-
[key: string]: import("../types").MediaSize | undefined;
|
|
64
|
-
thumbnail?: import("../types").MediaSize;
|
|
65
|
-
medium?: import("../types").MediaSize;
|
|
66
|
-
large?: import("../types").MediaSize;
|
|
63
|
+
[key: string]: import("../types.js").MediaSize | undefined;
|
|
64
|
+
thumbnail?: import("../types.js").MediaSize;
|
|
65
|
+
medium?: import("../types.js").MediaSize;
|
|
66
|
+
large?: import("../types.js").MediaSize;
|
|
67
67
|
};
|
|
68
68
|
thumbnailURL: string;
|
|
69
69
|
name: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { buildPermalink, buildRelativePermalink } from '../collection-registry';
|
|
1
|
+
import { buildPermalink, buildRelativePermalink } from '../collection-registry.js';
|
|
2
2
|
export function formatDate(date) {
|
|
3
3
|
const d = new Date(date);
|
|
4
4
|
const pad = (n) => String(n).padStart(2, '0');
|
package/dist/endpoints/media.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { getNitrogenSettings, buildDynamicData, buildPageResponse, buildListItemResponse, getTemplateForType, requireAuth, } from './helpers';
|
|
2
|
-
import { buildPermalink, buildRelativePermalink } from '../collection-registry';
|
|
1
|
+
import { getNitrogenSettings, buildDynamicData, buildPageResponse, buildListItemResponse, getTemplateForType, requireAuth, } from './helpers.js';
|
|
2
|
+
import { buildPermalink, buildRelativePermalink } from '../collection-registry.js';
|
|
3
3
|
function isContentTemplateCollection(collection) {
|
|
4
4
|
return !!collection && collection !== 'header' && collection !== 'footer';
|
|
5
5
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { getPayload } from 'payload';
|
|
3
|
-
import { NitrogenPageClient } from './NitrogenPageClient';
|
|
4
|
-
import { buildDynamicData, getNitrogenSettings } from '../endpoints/helpers';
|
|
3
|
+
import { NitrogenPageClient } from './NitrogenPageClient.js';
|
|
4
|
+
import { buildDynamicData, getNitrogenSettings } from '../endpoints/helpers.js';
|
|
5
5
|
/**
|
|
6
6
|
* Server component that wraps your page content and automatically handles
|
|
7
7
|
* Nitrogen builder mode and Nitrogen-rendered pages.
|
package/dist/frontend/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { NitrogenWrapper } from "./NitrogenWrapper";
|
|
2
|
-
export type { NitrogenWrapperProps } from "./NitrogenWrapper";
|
|
3
|
-
export { NitrogenPageClient } from "./NitrogenPageClient";
|
|
4
|
-
export type { NitrogenPageClientProps } from "./NitrogenPageClient";
|
|
5
|
-
export { buildDynamicData, getNitrogenSettings } from "../endpoints/helpers";
|
|
1
|
+
export { NitrogenWrapper } from "./NitrogenWrapper.js";
|
|
2
|
+
export type { NitrogenWrapperProps } from "./NitrogenWrapper.js";
|
|
3
|
+
export { NitrogenPageClient } from "./NitrogenPageClient.js";
|
|
4
|
+
export type { NitrogenPageClientProps } from "./NitrogenPageClient.js";
|
|
5
|
+
export { buildDynamicData, getNitrogenSettings } from "../endpoints/helpers.js";
|
|
6
6
|
export { nitrogen } from "@nitrogenbuilder/client-core";
|
|
7
7
|
export type { ComponentSettings, ComponentSettingsToProps, } from "@nitrogenbuilder/types";
|
package/dist/frontend/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// Main export - use NitrogenWrapper for simplest integration
|
|
2
|
-
export { NitrogenWrapper } from "./NitrogenWrapper";
|
|
2
|
+
export { NitrogenWrapper } from "./NitrogenWrapper.js";
|
|
3
3
|
// Lower-level exports for custom implementations
|
|
4
|
-
export { NitrogenPageClient } from "./NitrogenPageClient";
|
|
4
|
+
export { NitrogenPageClient } from "./NitrogenPageClient.js";
|
|
5
5
|
// Helper exports for data fetching (server-safe)
|
|
6
|
-
export { buildDynamicData, getNitrogenSettings } from "../endpoints/helpers";
|
|
6
|
+
export { buildDynamicData, getNitrogenSettings } from "../endpoints/helpers.js";
|
|
7
7
|
// Re-export nitrogen singleton for registering custom components
|
|
8
8
|
export { nitrogen } from "@nitrogenbuilder/client-core";
|
|
@@ -28,19 +28,54 @@ export const NitrogenSettings = {
|
|
|
28
28
|
admin: { description: 'Connector token for server communication' },
|
|
29
29
|
},
|
|
30
30
|
{
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
31
|
+
type: 'row',
|
|
32
|
+
fields: [
|
|
33
|
+
{
|
|
34
|
+
name: 'nitrogenEditorUrl',
|
|
35
|
+
label: 'Nitrogen Editor Url',
|
|
36
|
+
type: 'text',
|
|
37
|
+
defaultValue: 'https://stbackend.siteservice.net',
|
|
38
|
+
admin: {
|
|
39
|
+
description: 'Production Nitrogen editor URL',
|
|
40
|
+
width: '50%',
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
name: 'nitrogenEditorDevUrl',
|
|
45
|
+
label: 'Nitrogen Editor Dev Url',
|
|
46
|
+
type: 'text',
|
|
47
|
+
defaultValue: 'http://localhost:5173',
|
|
48
|
+
admin: {
|
|
49
|
+
description: 'Local Nitrogen editor development URL',
|
|
50
|
+
width: '50%',
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
],
|
|
39
54
|
},
|
|
40
55
|
{
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
56
|
+
type: 'row',
|
|
57
|
+
fields: [
|
|
58
|
+
{
|
|
59
|
+
name: 'frontendUrl',
|
|
60
|
+
label: 'Frontend Url',
|
|
61
|
+
type: 'text',
|
|
62
|
+
defaultValue: 'https://stfrontend.siteservice.net',
|
|
63
|
+
admin: {
|
|
64
|
+
description: 'Production frontend URL',
|
|
65
|
+
width: '50%',
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
name: 'frontendDevUrl',
|
|
70
|
+
label: 'Frontend Dev Url',
|
|
71
|
+
type: 'text',
|
|
72
|
+
defaultValue: 'http://localhost:4321',
|
|
73
|
+
admin: {
|
|
74
|
+
description: 'Local frontend development URL',
|
|
75
|
+
width: '50%',
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
],
|
|
44
79
|
},
|
|
45
80
|
{
|
|
46
81
|
name: 'nitrogenConfig',
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { NitrogenComponentManifestInput } from './inventory/manifest';
|
|
1
|
+
import type { NitrogenComponentManifestInput } from './inventory/manifest.js';
|
|
2
2
|
export interface NitrogenConnectorPluginOptions {
|
|
3
3
|
/** Disable the plugin without removing it from config */
|
|
4
4
|
disabled?: boolean;
|
|
@@ -30,11 +30,11 @@ export interface NitrogenConnectorPluginOptions {
|
|
|
30
30
|
indexCollections?: string[];
|
|
31
31
|
}
|
|
32
32
|
export declare const nitrogenConnectorPlugin: (options?: NitrogenConnectorPluginOptions) => any;
|
|
33
|
-
export { NitrogenTemplates } from "./collections/NitrogenTemplates";
|
|
34
|
-
export { NitrogenSettings } from "./globals/NitrogenSettings";
|
|
35
|
-
export { NitrogenEditButton } from "./components/NitrogenEditButton";
|
|
36
|
-
export { NitrogenViewButton } from "./components/NitrogenViewButton";
|
|
37
|
-
export { buildDynamicData, getNitrogenSettings } from "./endpoints/helpers";
|
|
38
|
-
export { createCollectionEndpoints } from "./endpoints/collection-endpoints";
|
|
33
|
+
export { NitrogenTemplates } from "./collections/NitrogenTemplates.js";
|
|
34
|
+
export { NitrogenSettings } from "./globals/NitrogenSettings.js";
|
|
35
|
+
export { NitrogenEditButton } from "./components/NitrogenEditButton.js";
|
|
36
|
+
export { NitrogenViewButton } from "./components/NitrogenViewButton.js";
|
|
37
|
+
export { buildDynamicData, getNitrogenSettings } from "./endpoints/helpers.js";
|
|
38
|
+
export { createCollectionEndpoints } from "./endpoints/collection-endpoints.js";
|
|
39
39
|
export { nitrogen } from "@nitrogenbuilder/client-core";
|
|
40
40
|
export type { ComponentSettings, ComponentSettingsToProps, } from "@nitrogenbuilder/types";
|
package/dist/index.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { NitrogenTemplates } from "./collections/NitrogenTemplates";
|
|
2
|
-
import { NitrogenComponentCatalog } from './collections/NitrogenComponentCatalog';
|
|
3
|
-
import { NitrogenComponentUsage } from './collections/NitrogenComponentUsage';
|
|
4
|
-
import { NitrogenSettings } from "./globals/NitrogenSettings";
|
|
5
|
-
import { NitrogenComponents } from './globals/NitrogenComponents';
|
|
6
|
-
import { templatesEndpoints } from "./endpoints/templates";
|
|
7
|
-
import { mediaEndpoints } from "./endpoints/media";
|
|
8
|
-
import { nitrogenSettingsEndpoints } from "./endpoints/nitrogen-settings";
|
|
9
|
-
import { allEndpoints } from "./endpoints/all";
|
|
10
|
-
import { collectionsEndpoints } from "./endpoints/collections";
|
|
11
|
-
import { menuEndpoints } from "./endpoints/menu";
|
|
12
|
-
import { createCollectionEndpoints } from "./endpoints/collection-endpoints";
|
|
13
|
-
import { createComponentInventoryEndpoints } from './endpoints/component-inventory';
|
|
14
|
-
import { batchEndpoints } from "./endpoints/batch";
|
|
15
|
-
import { registerCollection } from "./collection-registry";
|
|
16
|
-
import { deleteDocumentUsage, reindexDocumentUsage, syncComponentCatalog, } from './inventory/indexing';
|
|
1
|
+
import { NitrogenTemplates } from "./collections/NitrogenTemplates.js";
|
|
2
|
+
import { NitrogenComponentCatalog } from './collections/NitrogenComponentCatalog.js';
|
|
3
|
+
import { NitrogenComponentUsage } from './collections/NitrogenComponentUsage.js';
|
|
4
|
+
import { NitrogenSettings } from "./globals/NitrogenSettings.js";
|
|
5
|
+
import { NitrogenComponents } from './globals/NitrogenComponents.js';
|
|
6
|
+
import { templatesEndpoints } from "./endpoints/templates.js";
|
|
7
|
+
import { mediaEndpoints } from "./endpoints/media.js";
|
|
8
|
+
import { nitrogenSettingsEndpoints } from "./endpoints/nitrogen-settings.js";
|
|
9
|
+
import { allEndpoints } from "./endpoints/all.js";
|
|
10
|
+
import { collectionsEndpoints } from "./endpoints/collections.js";
|
|
11
|
+
import { menuEndpoints } from "./endpoints/menu.js";
|
|
12
|
+
import { createCollectionEndpoints } from "./endpoints/collection-endpoints.js";
|
|
13
|
+
import { createComponentInventoryEndpoints } from './endpoints/component-inventory.js';
|
|
14
|
+
import { batchEndpoints } from "./endpoints/batch.js";
|
|
15
|
+
import { registerCollection } from "./collection-registry.js";
|
|
16
|
+
import { deleteDocumentUsage, reindexDocumentUsage, syncComponentCatalog, } from './inventory/indexing.js';
|
|
17
17
|
/** Fields required by Nitrogen that will be injected into collections if missing */
|
|
18
18
|
const nitrogenRequiredFields = [
|
|
19
19
|
{
|
|
@@ -227,14 +227,14 @@ export const nitrogenConnectorPlugin = (options = {}) => (incomingConfig) => {
|
|
|
227
227
|
return config;
|
|
228
228
|
};
|
|
229
229
|
// Re-export for consumers who need direct access
|
|
230
|
-
export { NitrogenTemplates } from "./collections/NitrogenTemplates";
|
|
231
|
-
export { NitrogenSettings } from "./globals/NitrogenSettings";
|
|
230
|
+
export { NitrogenTemplates } from "./collections/NitrogenTemplates.js";
|
|
231
|
+
export { NitrogenSettings } from "./globals/NitrogenSettings.js";
|
|
232
232
|
// Editor exports
|
|
233
|
-
export { NitrogenEditButton } from "./components/NitrogenEditButton";
|
|
234
|
-
export { NitrogenViewButton } from "./components/NitrogenViewButton";
|
|
233
|
+
export { NitrogenEditButton } from "./components/NitrogenEditButton.js";
|
|
234
|
+
export { NitrogenViewButton } from "./components/NitrogenViewButton.js";
|
|
235
235
|
// Helper exports for consumers building custom frontend routes
|
|
236
|
-
export { buildDynamicData, getNitrogenSettings } from "./endpoints/helpers";
|
|
236
|
+
export { buildDynamicData, getNitrogenSettings } from "./endpoints/helpers.js";
|
|
237
237
|
// Collection endpoint factory for consumers who need custom endpoint generation
|
|
238
|
-
export { createCollectionEndpoints } from "./endpoints/collection-endpoints";
|
|
238
|
+
export { createCollectionEndpoints } from "./endpoints/collection-endpoints.js";
|
|
239
239
|
// Re-export @nitrogenbuilder packages for convenience
|
|
240
240
|
export { nitrogen } from "@nitrogenbuilder/client-core";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ComponentManifestEntry } from '@nitrogenbuilder/types';
|
|
2
2
|
import type { Payload, Where } from 'payload';
|
|
3
|
-
import type { NitrogenInventorySourceDoc } from '../types';
|
|
4
|
-
import { type NitrogenComponentManifestInput } from './manifest';
|
|
3
|
+
import type { NitrogenInventorySourceDoc } from '../types.js';
|
|
4
|
+
import { type NitrogenComponentManifestInput } from './manifest.js';
|
|
5
5
|
export declare const NITROGEN_COMPONENT_CATALOG_COLLECTION = "nitrogen-component-catalog";
|
|
6
6
|
export declare const NITROGEN_COMPONENT_USAGE_COLLECTION = "nitrogen-component-usage";
|
|
7
7
|
type ComponentUsageRecord = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { resolveComponentManifest, } from './manifest';
|
|
1
|
+
import { resolveComponentManifest, } from './manifest.js';
|
|
2
2
|
export const NITROGEN_COMPONENT_CATALOG_COLLECTION = 'nitrogen-component-catalog';
|
|
3
3
|
export const NITROGEN_COMPONENT_USAGE_COLLECTION = 'nitrogen-component-usage';
|
|
4
4
|
function moduleNameFromNode(node) {
|
package/dist/types.d.ts
CHANGED
|
@@ -33,8 +33,13 @@ export interface NitrogenTemplateDoc extends NitrogenDocBase {
|
|
|
33
33
|
export interface NitrogenSettingsGlobal {
|
|
34
34
|
licenseKey?: string;
|
|
35
35
|
connectorToken?: string;
|
|
36
|
-
|
|
36
|
+
nitrogenEditorUrl?: string;
|
|
37
|
+
nitrogenEditorDevUrl?: string;
|
|
37
38
|
frontendUrl?: string;
|
|
39
|
+
frontendDevUrl?: string;
|
|
40
|
+
/** @deprecated Use nitrogenEditorDevUrl. */
|
|
41
|
+
instanceUrl?: string;
|
|
42
|
+
/** @deprecated Use frontendDevUrl. */
|
|
38
43
|
developmentUrl?: string;
|
|
39
44
|
editorCdnVersion?: string;
|
|
40
45
|
nitrogenConfig?: NitrogenConfig;
|
package/package.json
CHANGED