@accelflow/space-content 0.1.0-beta.3 → 0.1.0-beta.4
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 +18 -11
- package/package.json +6 -2
package/README.md
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
|
-
# Space
|
|
1
|
+
# Accelflow Space Headless CMS SDK
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The official Headless CMS SDK for [Accelflow Space](https://space.accelflow.jp/en/), developed and maintained by [Accelflow Inc.](https://accelflow.jp/).
|
|
4
|
+
|
|
5
|
+
Create, review, and publish content with your team in Space, then bring it into your own website with Vite, Next.js, or another build system. The SDK synchronizes published content at build time and provides optional rendering, table-of-contents, and author-profile utilities. Requires Node.js 24 or later. Licensed under MIT.
|
|
6
|
+
|
|
7
|
+
- [Service website](https://space.accelflow.jp/en/)
|
|
8
|
+
- [Headless CMS use case](https://space.accelflow.jp/en/use-cases/headless-cms/)
|
|
9
|
+
- [Company website — Accelflow Inc.](https://accelflow.jp/)
|
|
10
|
+
- [Source code](https://github.com/Accelflow/space-content-sdk) · [Report an issue](https://github.com/Accelflow/space-content-sdk/issues)
|
|
4
11
|
|
|
5
12
|
The beta package is available on npm.
|
|
6
13
|
|
|
@@ -64,7 +71,7 @@ repository; the tests here exercise the client with synthetic protocol fixtures.
|
|
|
64
71
|
|
|
65
72
|
## Full framework examples
|
|
66
73
|
|
|
67
|
-
See [Vite and Next.js examples](examples
|
|
74
|
+
See [Vite and Next.js examples](https://github.com/Accelflow/space-content-sdk/tree/main/examples#readme) for complete static builds,
|
|
68
75
|
CI cache handling, HTML rendering, asset headers and deployment boundaries.
|
|
69
76
|
|
|
70
77
|
## Table of contents
|
|
@@ -75,7 +82,7 @@ The browser-safe entry is separate from the authenticated Node client:
|
|
|
75
82
|
import { mountTableOfContents } from '@accelflow/space-content/toc';
|
|
76
83
|
import '@accelflow/space-content/toc.css';
|
|
77
84
|
|
|
78
|
-
const cleanup = mountTableOfContents(articleElement, { locale: '
|
|
85
|
+
const cleanup = mountTableOfContents(articleElement, { locale: 'en' });
|
|
79
86
|
// Call cleanup when replacing the article or unmounting the component.
|
|
80
87
|
```
|
|
81
88
|
|
|
@@ -85,14 +92,14 @@ In Next.js, use this browser entry in a client component effect and return the c
|
|
|
85
92
|
|
|
86
93
|
## Release preparation
|
|
87
94
|
|
|
88
|
-
See [RELEASING.md](RELEASING.md) for packaging checks, initial publication and OIDC setup.
|
|
95
|
+
See [RELEASING.md](https://github.com/Accelflow/space-content-sdk/blob/main/RELEASING.md) for packaging checks, initial publication and OIDC setup.
|
|
89
96
|
|
|
90
97
|
## JSON and HTML rendering
|
|
91
98
|
|
|
92
99
|
```js
|
|
93
100
|
import {renderArticleBody} from '@accelflow/space-content/render';
|
|
94
101
|
const html = renderArticleBody(article.body, {
|
|
95
|
-
assets: content.assets, locale: '
|
|
102
|
+
assets: content.assets, locale: 'en', pdfMode: 'link',
|
|
96
103
|
renderers: {paragraph: ({children}) => `<p>${children}</p>`},
|
|
97
104
|
});
|
|
98
105
|
```
|
|
@@ -132,12 +139,12 @@ import '@accelflow/space-content/profile.css';
|
|
|
132
139
|
|
|
133
140
|
const profile = createAuthorProfile(content.articles, {
|
|
134
141
|
origin: 'https://your-site.example',
|
|
135
|
-
locale: '
|
|
136
|
-
url: '/
|
|
137
|
-
articleHref: article => `/
|
|
142
|
+
locale: 'en',
|
|
143
|
+
url: '/en/blog/authors/editorial-team/',
|
|
144
|
+
articleHref: article => `/en/blog/${article.slug}/`,
|
|
138
145
|
});
|
|
139
146
|
const html = renderAuthorProfile(profile, {
|
|
140
|
-
labels: {about: '
|
|
147
|
+
labels: {about: 'About the editorial team', articles: 'Articles by the editorial team'},
|
|
141
148
|
});
|
|
142
149
|
```
|
|
143
150
|
|
|
@@ -161,7 +168,7 @@ Draft articles, other locales and articles with a different author are excluded.
|
|
|
161
168
|
|
|
162
169
|
When a Space workspace has a CMS URL, the delivery API rewrites article links
|
|
163
170
|
before returning HTML or JSON. Use the article base URL (for example,
|
|
164
|
-
`https://example.com/
|
|
171
|
+
`https://example.com/en/blog/`). Workspace references use that base plus the
|
|
165
172
|
published page-tree path. Links with the same hostname become root-relative;
|
|
166
173
|
other HTTP(S) links retain an absolute URL and carry `target="_blank"` with
|
|
167
174
|
`rel="noopener noreferrer"`. The renderer preserves these safe external targets.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@accelflow/space-content",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=24"
|
|
@@ -55,12 +55,16 @@
|
|
|
55
55
|
"bugs": {
|
|
56
56
|
"url": "https://github.com/Accelflow/space-content-sdk/issues"
|
|
57
57
|
},
|
|
58
|
-
"homepage": "https://
|
|
58
|
+
"homepage": "https://space.accelflow.jp/en/",
|
|
59
59
|
"publishConfig": {
|
|
60
60
|
"access": "public",
|
|
61
61
|
"tag": "beta"
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
64
|
"sanitize-html": "^2.18.0"
|
|
65
|
+
},
|
|
66
|
+
"author": {
|
|
67
|
+
"name": "Accelflow Inc.",
|
|
68
|
+
"url": "https://accelflow.jp/"
|
|
65
69
|
}
|
|
66
70
|
}
|