@cmssy/next 9.10.0 → 10.1.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/README.md +9 -10
- package/dist/index.cjs +4 -8
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/middleware.cjs +10 -93
- package/dist/middleware.d.cts +2 -17
- package/dist/middleware.d.ts +2 -17
- package/dist/middleware.js +5 -73
- package/dist/server.cjs +23 -872
- package/dist/server.d.cts +5 -199
- package/dist/server.d.ts +5 -199
- package/dist/server.js +12 -847
- package/package.json +3 -8
- package/dist/client.cjs +0 -29
- package/dist/client.d.cts +0 -19
- package/dist/client.d.ts +0 -19
- package/dist/client.js +0 -16
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cmssy/next",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "10.1.0",
|
|
4
4
|
"description": "Next.js App Router bindings for cmssy headless sites (createCmssyPage + draft preview)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cmssy",
|
|
@@ -38,11 +38,6 @@
|
|
|
38
38
|
"import": "./dist/middleware.js",
|
|
39
39
|
"require": "./dist/middleware.cjs"
|
|
40
40
|
},
|
|
41
|
-
"./client": {
|
|
42
|
-
"types": "./dist/client.d.ts",
|
|
43
|
-
"import": "./dist/client.js",
|
|
44
|
-
"require": "./dist/client.cjs"
|
|
45
|
-
},
|
|
46
41
|
"./testing": {
|
|
47
42
|
"types": "./dist/testing.d.ts",
|
|
48
43
|
"import": "./dist/testing.js",
|
|
@@ -70,12 +65,12 @@
|
|
|
70
65
|
"tsup": "^8.3.0",
|
|
71
66
|
"typescript": "^5.6.0",
|
|
72
67
|
"vitest": "^2.1.0",
|
|
73
|
-
"@cmssy/react": "
|
|
68
|
+
"@cmssy/react": "10.1.0"
|
|
74
69
|
},
|
|
75
70
|
"dependencies": {
|
|
76
71
|
"@cmssy/types": "0.29.0",
|
|
77
72
|
"server-only": "^0.0.1",
|
|
78
|
-
"@cmssy/core": "
|
|
73
|
+
"@cmssy/core": "10.1.0"
|
|
79
74
|
},
|
|
80
75
|
"scripts": {
|
|
81
76
|
"build": "tsup",
|
package/dist/client.cjs
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
'use strict';
|
|
3
|
-
|
|
4
|
-
var Link = require('next/link');
|
|
5
|
-
var react = require('@cmssy/react');
|
|
6
|
-
var client = require('@cmssy/react/client');
|
|
7
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
8
|
-
|
|
9
|
-
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
-
|
|
11
|
-
var Link__default = /*#__PURE__*/_interopDefault(Link);
|
|
12
|
-
|
|
13
|
-
// src/cmssy-link.tsx
|
|
14
|
-
function CmssyLink({ href, locale, ...rest }) {
|
|
15
|
-
const fromContext = client.useCmssyLocale();
|
|
16
|
-
const active = locale ?? fromContext;
|
|
17
|
-
const resolved = active ? react.localizeHref(href, active) : href;
|
|
18
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Link__default.default, { href: resolved, ...rest });
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
Object.defineProperty(exports, "CmssyLocaleProvider", {
|
|
22
|
-
enumerable: true,
|
|
23
|
-
get: function () { return client.CmssyLocaleProvider; }
|
|
24
|
-
});
|
|
25
|
-
Object.defineProperty(exports, "useCmssyLocale", {
|
|
26
|
-
enumerable: true,
|
|
27
|
-
get: function () { return client.useCmssyLocale; }
|
|
28
|
-
});
|
|
29
|
-
exports.CmssyLink = CmssyLink;
|
package/dist/client.d.cts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import Link from 'next/link';
|
|
3
|
-
import { ComponentProps } from 'react';
|
|
4
|
-
import { CmssyLocaleContext } from '@cmssy/react';
|
|
5
|
-
export { CmssyLocaleProvider, CmssyLocaleProviderProps, useCmssyLocale } from '@cmssy/react/client';
|
|
6
|
-
|
|
7
|
-
interface CmssyLinkProps extends Omit<ComponentProps<typeof Link>, "href" | "locale"> {
|
|
8
|
-
href: string;
|
|
9
|
-
/** Override the active locale (defaults to the nearest CmssyLocaleProvider). */
|
|
10
|
-
locale?: CmssyLocaleContext;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* `next/link` that prefixes internal hrefs with the active locale, so navigation
|
|
14
|
-
* preserves the language. Reads the locale from the nearest
|
|
15
|
-
* `CmssyLocaleProvider`; falls back to the raw href when none is mounted.
|
|
16
|
-
*/
|
|
17
|
-
declare function CmssyLink({ href, locale, ...rest }: CmssyLinkProps): react_jsx_runtime.JSX.Element;
|
|
18
|
-
|
|
19
|
-
export { CmssyLink, type CmssyLinkProps };
|
package/dist/client.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import Link from 'next/link';
|
|
3
|
-
import { ComponentProps } from 'react';
|
|
4
|
-
import { CmssyLocaleContext } from '@cmssy/react';
|
|
5
|
-
export { CmssyLocaleProvider, CmssyLocaleProviderProps, useCmssyLocale } from '@cmssy/react/client';
|
|
6
|
-
|
|
7
|
-
interface CmssyLinkProps extends Omit<ComponentProps<typeof Link>, "href" | "locale"> {
|
|
8
|
-
href: string;
|
|
9
|
-
/** Override the active locale (defaults to the nearest CmssyLocaleProvider). */
|
|
10
|
-
locale?: CmssyLocaleContext;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* `next/link` that prefixes internal hrefs with the active locale, so navigation
|
|
14
|
-
* preserves the language. Reads the locale from the nearest
|
|
15
|
-
* `CmssyLocaleProvider`; falls back to the raw href when none is mounted.
|
|
16
|
-
*/
|
|
17
|
-
declare function CmssyLink({ href, locale, ...rest }: CmssyLinkProps): react_jsx_runtime.JSX.Element;
|
|
18
|
-
|
|
19
|
-
export { CmssyLink, type CmssyLinkProps };
|
package/dist/client.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import Link from 'next/link';
|
|
3
|
-
import { localizeHref } from '@cmssy/react';
|
|
4
|
-
import { useCmssyLocale } from '@cmssy/react/client';
|
|
5
|
-
export { CmssyLocaleProvider, useCmssyLocale } from '@cmssy/react/client';
|
|
6
|
-
import { jsx } from 'react/jsx-runtime';
|
|
7
|
-
|
|
8
|
-
// src/cmssy-link.tsx
|
|
9
|
-
function CmssyLink({ href, locale, ...rest }) {
|
|
10
|
-
const fromContext = useCmssyLocale();
|
|
11
|
-
const active = locale ?? fromContext;
|
|
12
|
-
const resolved = active ? localizeHref(href, active) : href;
|
|
13
|
-
return /* @__PURE__ */ jsx(Link, { href: resolved, ...rest });
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export { CmssyLink };
|