@nextbridgehq/payload-block-builder 0.1.1 → 0.1.3
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/README.md +2 -0
- package/dist/client.cjs +31 -0
- package/dist/client.d.cts +3 -1
- package/dist/client.d.ts +3 -1
- package/dist/client.js +31 -0
- package/dist/index.cjs +10 -0
- package/dist/index.js +10 -0
- package/package.json +1 -1
package/README.md
CHANGED
package/dist/client.cjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
'use client'
|
|
1
2
|
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -29,6 +30,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
29
30
|
// src/client.ts
|
|
30
31
|
var client_exports = {};
|
|
31
32
|
__export(client_exports, {
|
|
33
|
+
BlockBuilderNavLink: () => BlockBuilderNavLink,
|
|
32
34
|
BlockDataField: () => BlockDataField,
|
|
33
35
|
BuilderShell: () => BuilderShell,
|
|
34
36
|
EditInBuilderButton: () => EditInBuilderButton,
|
|
@@ -2445,8 +2447,37 @@ function BuilderShell({ loadSlug }) {
|
|
|
2445
2447
|
label
|
|
2446
2448
|
))));
|
|
2447
2449
|
}
|
|
2450
|
+
|
|
2451
|
+
// src/components/BlockBuilderNavLink/index.tsx
|
|
2452
|
+
var import_react17 = __toESM(require("react"), 1);
|
|
2453
|
+
var import_link = __toESM(require("next/link"), 1);
|
|
2454
|
+
function BlockBuilderNavLink() {
|
|
2455
|
+
return /* @__PURE__ */ import_react17.default.createElement("div", { style: { padding: "0 16px", marginTop: "8px" } }, /* @__PURE__ */ import_react17.default.createElement(
|
|
2456
|
+
import_link.default,
|
|
2457
|
+
{
|
|
2458
|
+
href: "/block-builder",
|
|
2459
|
+
target: "_blank",
|
|
2460
|
+
rel: "noopener noreferrer",
|
|
2461
|
+
style: {
|
|
2462
|
+
display: "flex",
|
|
2463
|
+
alignItems: "center",
|
|
2464
|
+
gap: "8px",
|
|
2465
|
+
padding: "8px 12px",
|
|
2466
|
+
borderRadius: "6px",
|
|
2467
|
+
border: "1px solid #16a34a",
|
|
2468
|
+
color: "#16a34a",
|
|
2469
|
+
textDecoration: "none",
|
|
2470
|
+
fontSize: "13px",
|
|
2471
|
+
fontWeight: 500,
|
|
2472
|
+
transition: "background 0.15s"
|
|
2473
|
+
}
|
|
2474
|
+
},
|
|
2475
|
+
"Block Builder"
|
|
2476
|
+
));
|
|
2477
|
+
}
|
|
2448
2478
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2449
2479
|
0 && (module.exports = {
|
|
2480
|
+
BlockBuilderNavLink,
|
|
2450
2481
|
BlockDataField,
|
|
2451
2482
|
BuilderShell,
|
|
2452
2483
|
EditInBuilderButton,
|
package/dist/client.d.cts
CHANGED
|
@@ -17,4 +17,6 @@ type Props = {
|
|
|
17
17
|
};
|
|
18
18
|
declare function BuilderShell({ loadSlug }: Props): React.JSX.Element;
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
declare function BlockBuilderNavLink(): React.JSX.Element;
|
|
21
|
+
|
|
22
|
+
export { BlockBuilderNavLink, BlockDataField, BuilderShell, EditInBuilderButton, SchemaBuilderField };
|
package/dist/client.d.ts
CHANGED
|
@@ -17,4 +17,6 @@ type Props = {
|
|
|
17
17
|
};
|
|
18
18
|
declare function BuilderShell({ loadSlug }: Props): React.JSX.Element;
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
declare function BlockBuilderNavLink(): React.JSX.Element;
|
|
21
|
+
|
|
22
|
+
export { BlockBuilderNavLink, BlockDataField, BuilderShell, EditInBuilderButton, SchemaBuilderField };
|
package/dist/client.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
1
3
|
// src/components/BlockDataField/index.tsx
|
|
2
4
|
import React, { useCallback, useEffect, useRef, useState } from "react";
|
|
3
5
|
import { useField, useFormFields, useListDrawer } from "@payloadcms/ui";
|
|
@@ -2432,7 +2434,36 @@ function BuilderShell({ loadSlug }) {
|
|
|
2432
2434
|
label
|
|
2433
2435
|
))));
|
|
2434
2436
|
}
|
|
2437
|
+
|
|
2438
|
+
// src/components/BlockBuilderNavLink/index.tsx
|
|
2439
|
+
import React17 from "react";
|
|
2440
|
+
import Link2 from "next/link";
|
|
2441
|
+
function BlockBuilderNavLink() {
|
|
2442
|
+
return /* @__PURE__ */ React17.createElement("div", { style: { padding: "0 16px", marginTop: "8px" } }, /* @__PURE__ */ React17.createElement(
|
|
2443
|
+
Link2,
|
|
2444
|
+
{
|
|
2445
|
+
href: "/block-builder",
|
|
2446
|
+
target: "_blank",
|
|
2447
|
+
rel: "noopener noreferrer",
|
|
2448
|
+
style: {
|
|
2449
|
+
display: "flex",
|
|
2450
|
+
alignItems: "center",
|
|
2451
|
+
gap: "8px",
|
|
2452
|
+
padding: "8px 12px",
|
|
2453
|
+
borderRadius: "6px",
|
|
2454
|
+
border: "1px solid #16a34a",
|
|
2455
|
+
color: "#16a34a",
|
|
2456
|
+
textDecoration: "none",
|
|
2457
|
+
fontSize: "13px",
|
|
2458
|
+
fontWeight: 500,
|
|
2459
|
+
transition: "background 0.15s"
|
|
2460
|
+
}
|
|
2461
|
+
},
|
|
2462
|
+
"Block Builder"
|
|
2463
|
+
));
|
|
2464
|
+
}
|
|
2435
2465
|
export {
|
|
2466
|
+
BlockBuilderNavLink,
|
|
2436
2467
|
BlockDataField,
|
|
2437
2468
|
BuilderShell,
|
|
2438
2469
|
EditInBuilderButton,
|
package/dist/index.cjs
CHANGED
|
@@ -1138,6 +1138,16 @@ var dynamicBlocksPlugin = (options = {}) => {
|
|
|
1138
1138
|
} = options;
|
|
1139
1139
|
if (!enabled) return incomingConfig;
|
|
1140
1140
|
const config = { ...incomingConfig };
|
|
1141
|
+
config.admin = {
|
|
1142
|
+
...config.admin,
|
|
1143
|
+
components: {
|
|
1144
|
+
...config.admin?.components,
|
|
1145
|
+
afterNavLinks: [
|
|
1146
|
+
...config.admin?.components?.afterNavLinks ?? [],
|
|
1147
|
+
"@nextbridgehq/payload-block-builder/client#BlockBuilderNavLink"
|
|
1148
|
+
]
|
|
1149
|
+
}
|
|
1150
|
+
};
|
|
1141
1151
|
config.collections = [
|
|
1142
1152
|
...config.collections ?? [],
|
|
1143
1153
|
BlockDefinitions,
|
package/dist/index.js
CHANGED
|
@@ -1110,6 +1110,16 @@ var dynamicBlocksPlugin = (options = {}) => {
|
|
|
1110
1110
|
} = options;
|
|
1111
1111
|
if (!enabled) return incomingConfig;
|
|
1112
1112
|
const config = { ...incomingConfig };
|
|
1113
|
+
config.admin = {
|
|
1114
|
+
...config.admin,
|
|
1115
|
+
components: {
|
|
1116
|
+
...config.admin?.components,
|
|
1117
|
+
afterNavLinks: [
|
|
1118
|
+
...config.admin?.components?.afterNavLinks ?? [],
|
|
1119
|
+
"@nextbridgehq/payload-block-builder/client#BlockBuilderNavLink"
|
|
1120
|
+
]
|
|
1121
|
+
}
|
|
1122
|
+
};
|
|
1113
1123
|
config.collections = [
|
|
1114
1124
|
...config.collections ?? [],
|
|
1115
1125
|
BlockDefinitions,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nextbridgehq/payload-block-builder",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Block Builder for Payload CMS",
|
|
5
5
|
"keywords": ["payload", "payload-plugin", "cms", "block-builder", "dynamic-blocks"],
|
|
6
6
|
"homepage": "https://github.com/nextbridgehq/block-builder",
|