@dyrected/next 2.5.17 → 2.5.18

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/admin.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import type { AdminUIProps } from "@dyrected/admin";
2
- export declare function DyrectedAdmin(props: AdminUIProps): import("react/jsx-runtime").JSX.Element;
1
+ import type { DyrectedAdminProps } from "@dyrected/react/admin";
2
+ export declare function DyrectedAdmin(props: DyrectedAdminProps): import("react/jsx-runtime").JSX.Element;
3
3
  //# sourceMappingURL=admin.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"admin.d.ts","sourceRoot":"","sources":["../src/admin.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAcpD,wBAAgB,aAAa,CAAC,KAAK,EAAE,YAAY,2CAKhD"}
1
+ {"version":3,"file":"admin.d.ts","sourceRoot":"","sources":["../src/admin.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAchE,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,2CAKtD"}
package/dist/admin.js CHANGED
@@ -1,13 +1,13 @@
1
1
  "use client";
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import dynamic from "next/dynamic";
4
- const LazyAdminUI = dynamic(() => import("@dyrected/admin").then((mod) => mod.AdminUI), {
4
+ const LazyDyrectedAdmin = dynamic(() => import("@dyrected/react/admin").then((mod) => mod.DyrectedAdmin), {
5
5
  ssr: false,
6
6
  loading: () => (_jsx("div", { className: "dy-p-8 dy-text-center dy-text-muted-foreground dy-text-xs dy-font-medium", children: "Loading admin panel..." })),
7
7
  });
8
8
  export function DyrectedAdmin(props) {
9
9
  const baseUrl = props.baseUrl || process.env.NEXT_PUBLIC_DYRECTED_URL || "/dyrected";
10
10
  const apiKey = props.apiKey || process.env.NEXT_PUBLIC_DYRECTED_API_KEY;
11
- return _jsx(LazyAdminUI, { ...props, baseUrl: baseUrl, apiKey: apiKey });
11
+ return _jsx(LazyDyrectedAdmin, { ...props, baseUrl: baseUrl, apiKey: apiKey });
12
12
  }
13
13
  //# sourceMappingURL=admin.js.map
package/dist/admin.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"admin.js","sourceRoot":"","sources":["../src/admin.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,OAAO,MAAM,cAAc,CAAC;AAGnC,MAAM,WAAW,GAAG,OAAO,CACzB,GAAG,EAAE,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,EAC1D;IACE,GAAG,EAAE,KAAK;IACV,OAAO,EAAE,GAAG,EAAE,CAAC,CACb,cAAK,SAAS,EAAC,0EAA0E,uCAEnF,CACP;CACF,CACF,CAAC;AAEF,MAAM,UAAU,aAAa,CAAC,KAAmB;IAC/C,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,IAAI,OAAO,CAAC,GAAG,CAAC,wBAAwB,IAAI,WAAW,CAAC;IACrF,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,IAAI,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC;IAExE,OAAO,KAAC,WAAW,OAAK,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAI,CAAC;AACtE,CAAC"}
1
+ {"version":3,"file":"admin.js","sourceRoot":"","sources":["../src/admin.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,OAAO,MAAM,cAAc,CAAC;AAGnC,MAAM,iBAAiB,GAAG,OAAO,CAC/B,GAAG,EAAE,CAAC,MAAM,CAAC,uBAAuB,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,aAAa,CAAC,EACtE;IACE,GAAG,EAAE,KAAK;IACV,OAAO,EAAE,GAAG,EAAE,CAAC,CACb,cAAK,SAAS,EAAC,0EAA0E,uCAEnF,CACP;CACF,CACF,CAAC;AAEF,MAAM,UAAU,aAAa,CAAC,KAAyB;IACrD,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,IAAI,OAAO,CAAC,GAAG,CAAC,wBAAwB,IAAI,WAAW,CAAC;IACrF,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,IAAI,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC;IAExE,OAAO,KAAC,iBAAiB,OAAK,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAI,CAAC;AAC5E,CAAC"}
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.withDyrected = withDyrected;
7
+ const path_1 = __importDefault(require("path"));
8
+ /**
9
+ * withDyrected — Wraps your Next.js config to ensure a single React instance
10
+ * is used across the app and @dyrected/admin's pre-built bundle.
11
+ *
12
+ * Usage in next.config.ts:
13
+ * import { withDyrected } from '@dyrected/next/config'
14
+ * export default withDyrected({ ... })
15
+ */
16
+ function withDyrected(nextConfig = {}) {
17
+ // Webpack uses absolute paths; Turbopack requires paths relative to the project root.
18
+ const appRoot = process.cwd();
19
+ const reactAbsolute = path_1.default.resolve(appRoot, 'node_modules/react');
20
+ const reactDomAbsolute = path_1.default.resolve(appRoot, 'node_modules/react-dom');
21
+ return {
22
+ ...nextConfig,
23
+ webpack(config, options) {
24
+ config.resolve.alias = {
25
+ ...config.resolve.alias,
26
+ react: reactAbsolute,
27
+ 'react-dom': reactDomAbsolute,
28
+ };
29
+ if (typeof nextConfig.webpack === 'function') {
30
+ return nextConfig.webpack(config, options);
31
+ }
32
+ return config;
33
+ },
34
+ turbopack: {
35
+ ...nextConfig.turbopack,
36
+ resolveAlias: {
37
+ ...nextConfig.turbopack?.resolveAlias,
38
+ react: './node_modules/react',
39
+ 'react-dom': './node_modules/react-dom',
40
+ },
41
+ },
42
+ };
43
+ }
44
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1,11 @@
1
+ import type { NextConfig } from 'next';
2
+ /**
3
+ * withDyrected — Wraps your Next.js config to ensure a single React instance
4
+ * is used across the app and @dyrected/admin's pre-built bundle.
5
+ *
6
+ * Usage in next.config.ts:
7
+ * import { withDyrected } from '@dyrected/next/config'
8
+ * export default withDyrected({ ... })
9
+ */
10
+ export declare function withDyrected(nextConfig?: NextConfig): NextConfig;
11
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAEvC;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,UAAU,GAAE,UAAe,GAAG,UAAU,CA4BpE"}
package/dist/config.js ADDED
@@ -0,0 +1,38 @@
1
+ import path from 'path';
2
+ /**
3
+ * withDyrected — Wraps your Next.js config to ensure a single React instance
4
+ * is used across the app and @dyrected/admin's pre-built bundle.
5
+ *
6
+ * Usage in next.config.ts:
7
+ * import { withDyrected } from '@dyrected/next/config'
8
+ * export default withDyrected({ ... })
9
+ */
10
+ export function withDyrected(nextConfig = {}) {
11
+ // Webpack uses absolute paths; Turbopack requires paths relative to the project root.
12
+ const appRoot = process.cwd();
13
+ const reactAbsolute = path.resolve(appRoot, 'node_modules/react');
14
+ const reactDomAbsolute = path.resolve(appRoot, 'node_modules/react-dom');
15
+ return {
16
+ ...nextConfig,
17
+ webpack(config, options) {
18
+ config.resolve.alias = {
19
+ ...config.resolve.alias,
20
+ react: reactAbsolute,
21
+ 'react-dom': reactDomAbsolute,
22
+ };
23
+ if (typeof nextConfig.webpack === 'function') {
24
+ return nextConfig.webpack(config, options);
25
+ }
26
+ return config;
27
+ },
28
+ turbopack: {
29
+ ...nextConfig.turbopack,
30
+ resolveAlias: {
31
+ ...nextConfig.turbopack?.resolveAlias,
32
+ react: './node_modules/react',
33
+ 'react-dom': './node_modules/react-dom',
34
+ },
35
+ },
36
+ };
37
+ }
38
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAGxB;;;;;;;GAOG;AACH,MAAM,UAAU,YAAY,CAAC,aAAyB,EAAE;IACtD,sFAAsF;IACtF,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IAC9B,MAAM,aAAa,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,oBAAoB,CAAC,CAAC;IAClE,MAAM,gBAAgB,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,wBAAwB,CAAC,CAAC;IAEzE,OAAO;QACL,GAAG,UAAU;QACb,OAAO,CAAC,MAAM,EAAE,OAAO;YACrB,MAAM,CAAC,OAAO,CAAC,KAAK,GAAG;gBACrB,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK;gBACvB,KAAK,EAAE,aAAa;gBACpB,WAAW,EAAE,gBAAgB;aAC9B,CAAC;YACF,IAAI,OAAO,UAAU,CAAC,OAAO,KAAK,UAAU,EAAE,CAAC;gBAC7C,OAAO,UAAU,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;YAC7C,CAAC;YACD,OAAO,MAAM,CAAC;QAChB,CAAC;QACD,SAAS,EAAE;YACT,GAAG,UAAU,CAAC,SAAS;YACvB,YAAY,EAAE;gBACZ,GAAG,UAAU,CAAC,SAAS,EAAE,YAAY;gBACrC,KAAK,EAAE,sBAAsB;gBAC7B,WAAW,EAAE,0BAA0B;aACxC;SACF;KACF,CAAC;AACJ,CAAC"}
package/dist/index.d.ts CHANGED
@@ -21,5 +21,8 @@ export declare function dyrectedNextHandler(config: DyrectedConfig): {
21
21
  export declare function getDyrectedClient(): DyrectedClient;
22
22
  export * from "./components/DyrectedMedia";
23
23
  export * from "./components/DyrectedImage";
24
+ export { DyrectedProvider, useDyrected, useLivePreview } from "@dyrected/react";
25
+ export type { DyrectedImageProps, DyrectedMediaProps } from "@dyrected/react";
26
+ export type { DyrectedAdminProps } from "@dyrected/react/admin";
24
27
  export * from "@dyrected/sdk";
25
28
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAErD,OAAO,EAAgB,cAAc,EAAE,MAAM,eAAe,CAAC;AAG7D;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,cAAc;;;;;;;EAWzD;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,IAAI,cAAc,CAQlD;AAED,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAErD,OAAO,EAAgB,cAAc,EAAE,MAAM,eAAe,CAAC;AAG7D;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,cAAc;;;;;;;EAWzD;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,IAAI,cAAc,CAQlD;AAED,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAG3C,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAChF,YAAY,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC9E,YAAY,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAEhE,cAAc,eAAe,CAAC"}
package/dist/index.js CHANGED
@@ -32,5 +32,7 @@ export function getDyrectedClient() {
32
32
  }
33
33
  export * from "./components/DyrectedMedia";
34
34
  export * from "./components/DyrectedImage";
35
+ // Re-export React integration layer so Next.js users have one package to import from
36
+ export { DyrectedProvider, useDyrected, useLivePreview } from "@dyrected/react";
35
37
  export * from "@dyrected/sdk";
36
38
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAkB,MAAM,eAAe,CAAC;AAC7D,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CAAC,MAAsB;IACxD,MAAM,OAAO,GAAG,MAAM,CAAC,iBAAiB,CAAC,MAAM,CAAQ,CAAC,CAAC;IAEzD,OAAO;QACL,GAAG,EAAE,OAAO;QACZ,IAAI,EAAE,OAAO;QACb,KAAK,EAAE,OAAO;QACd,MAAM,EAAE,OAAO;QACf,GAAG,EAAE,OAAO;QACZ,OAAO,EAAE,OAAO;KACjB,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,iBAAiB;IAC/B,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,wBAAwB,IAAI,OAAO,CAAC,GAAG,CAAC,YAAY,IAAI,uBAAuB,CAAC;IAC5G,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,4BAA4B,IAAI,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC;IAExF,OAAO,YAAY,CAAC;QAClB,OAAO;QACP,MAAM;KACP,CAAC,CAAC;AACL,CAAC;AAED,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,eAAe,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAkB,MAAM,eAAe,CAAC;AAC7D,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CAAC,MAAsB;IACxD,MAAM,OAAO,GAAG,MAAM,CAAC,iBAAiB,CAAC,MAAM,CAAQ,CAAC,CAAC;IAEzD,OAAO;QACL,GAAG,EAAE,OAAO;QACZ,IAAI,EAAE,OAAO;QACb,KAAK,EAAE,OAAO;QACd,MAAM,EAAE,OAAO;QACf,GAAG,EAAE,OAAO;QACZ,OAAO,EAAE,OAAO;KACjB,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,iBAAiB;IAC/B,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,wBAAwB,IAAI,OAAO,CAAC,GAAG,CAAC,YAAY,IAAI,uBAAuB,CAAC;IAC5G,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,4BAA4B,IAAI,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC;IAExF,OAAO,YAAY,CAAC;QAClB,OAAO;QACP,MAAM;KACP,CAAC,CAAC;AACL,CAAC;AAED,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAE3C,qFAAqF;AACrF,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAIhF,cAAc,eAAe,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dyrected/next",
3
- "version": "2.5.17",
3
+ "version": "2.5.18",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -20,13 +20,19 @@
20
20
  "./admin": {
21
21
  "types": "./dist/admin.d.ts",
22
22
  "import": "./dist/admin.js"
23
+ },
24
+ "./config": {
25
+ "types": "./dist/config.d.ts",
26
+ "import": "./dist/config.js",
27
+ "require": "./dist/config.cjs",
28
+ "default": "./dist/config.cjs"
23
29
  }
24
30
  },
25
31
  "dependencies": {
26
32
  "hono": "^4.0.0",
27
- "@dyrected/core": "2.5.17",
28
- "@dyrected/sdk": "2.5.17",
29
- "@dyrected/admin": "2.5.17"
33
+ "@dyrected/core": "2.5.18",
34
+ "@dyrected/sdk": "2.5.18",
35
+ "@dyrected/react": "2.5.18"
30
36
  },
31
37
  "devDependencies": {
32
38
  "@types/node": "^20.12.12",
@@ -47,7 +53,7 @@
47
53
  },
48
54
  "description": "Next.js integration for Dyrected CMS",
49
55
  "scripts": {
50
- "build": "tsc",
56
+ "build": "tsc && tsc -p tsconfig.cjs.json && cp dist-cjs/config.js dist/config.cjs && rm -rf dist-cjs",
51
57
  "dev": "tsc --watch"
52
58
  }
53
59
  }