@estokad/next 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/LICENSE CHANGED
@@ -1,17 +1,201 @@
1
- Copyright © 2026 Samarkand Industries OÜ. All rights reserved.
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
2
4
 
3
- Estokad is proprietary software. Source code in this repository is the
4
- confidential intellectual property of Samarkand Industries OÜ
5
- (registered Tallinn, Estonia).
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
6
 
7
- Permission to use, copy, modify, or distribute this software is granted
8
- only under a separate written agreement signed by Samarkand Industries
9
- OÜ. Without such agreement, no license is granted, expressed or implied.
7
+ 1. Definitions.
10
8
 
11
- Public-facing components the SDK packages published to npm under the
12
- `@estokad/*` scope, and the SDKs' published documentation are licensed
13
- separately. See the LICENSE file inside each `packages/*` directory or
14
- the package's npm registry page for the terms that apply to that
15
- specific package.
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
16
11
 
17
- Contact: legal@samarkandindustries.com
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 Samarkand Industries OÜ
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.md CHANGED
@@ -1,81 +1,140 @@
1
1
  # @estokad/next
2
2
 
3
- Next.js App Router adapter for Estokad. Type-safe content fetching, draft mode, and visual-edit overlay all wired through one provider.
3
+ Next.js App Router adapter for Estokad: typed content fetching (re-exports `@estokad/sdk`), draft-mode route handlers, the visual-edit overlay, and auto-tagging server components.
4
4
 
5
5
  ## Install
6
6
 
7
7
  ```bash
8
- pnpm add @estokad/next @estokad/sdk
8
+ pnpm add @estokad/next
9
9
  ```
10
10
 
11
- ## Set up the provider
11
+ `@estokad/sdk` is a dependency — you do not install it separately; `createClient` and the client types are re-exported.
12
12
 
13
- In your root layout:
13
+ ## Compatibility
14
14
 
15
- ```tsx
16
- // app/layout.tsx
17
- import { EstokadProvider, getEstokad } from '@estokad/next'
15
+ Peer range: **Next `^14.2 || ^15`**, **React `^18.2 || ^19`**.
18
16
 
19
- export default function RootLayout({ children }: { children: React.ReactNode }) {
20
- return (
21
- <html>
22
- <body>
23
- <EstokadProvider workspace="my-workspace" apiUrl="https://api.estokad.com">
24
- {children}
25
- </EstokadProvider>
26
- </body>
27
- </html>
28
- )
17
+ | Surface | Next 14.2 / React 18 | Next 15 / React 19 |
18
+ | --------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------ | ------------------ |
19
+ | `createClient` / `.gql`, `renderRichText`, `estokadDraftMode`, `estokadOverlayRoute`, `signDraftToken` / `verifyDraftToken` | runs + typechecks | runs + typechecks |
20
+ | async server components `EstokadProvider`, `<Estokad.*>` | **runs**, but does **not typecheck** under `@types/react@18` | runs + typechecks |
21
+
22
+ `draftMode()` / `cookies()` are async on Next 15 and sync on Next 14.2; the package awaits them, which is a no-op passthrough on 14 and required on 15 — so the runtime is correct on both.
23
+
24
+ The async-component caveat is the well-known `@types/react@18` limitation: an `async` function component types as `(props) => Promise<Element>`, which React 18's JSX types reject (`Promise<Element>` is not a valid `ReactNode`). React 19's types fixed this. On a React-18-pinned project you have three options, in order of preference:
25
+
26
+ 1. **Skip the React components.** Visual edit is delivered by the injected overlay script, not the components. Mount `estokadOverlayRoute` and inject `<script type="module" src="/api/estokad/overlay">` yourself in your layout when `(await draftMode()).isEnabled` — about six lines, fully typed on React 18. `EstokadProvider` is only a convenience wrapper around exactly that.
27
+ 2. Render `<Estokad.*>` and suppress the call-site type error (`// @ts-expect-error async server component — runs on Next 14, typed on React 19`). Runtime is correct.
28
+ 3. Move that project's `@types/react` to v19 (types only; React runtime can stay 18) if your toolchain allows it.
29
+
30
+ The data, draft-mode, overlay, rich-text, and token surfaces — the bulk of the adapter — are fully typed and run on Next 14.2 / React 18 with no workaround.
31
+
32
+ ## Type your content
33
+
34
+ The client is keyed by content type. Declare the types your workspace exposes by augmenting `ContentTypes` (the interface lives in `@estokad/sdk`; `estokad push` will generate this file for you once codegen is wired, until then declare it by hand):
35
+
36
+ ```ts
37
+ // estokad.d.ts
38
+ import type {} from '@estokad/next'
39
+
40
+ declare module '@estokad/sdk' {
41
+ interface ContentTypes {
42
+ article: {
43
+ title: string
44
+ slug: string
45
+ body: import('@estokad/next').TiptapDoc
46
+ hero: string | null
47
+ }
48
+ siteSettings: { siteName: string }
49
+ }
29
50
  }
30
51
  ```
31
52
 
32
- `EstokadProvider` reads draft state from cookies, injects the visual-edit overlay script when draft mode is on, and provides the typed client to server + client components downstream.
53
+ Each accessor `cms.<type>` is then typed against the matching interface.
54
+
55
+ ## Create the client
56
+
57
+ ```ts
58
+ import { createClient } from '@estokad/next'
59
+
60
+ const cms = createClient({
61
+ workspace: 'your-workspace-slug',
62
+ apiUrl: 'https://api.estokad.com',
63
+ apiKey: process.env.ESTOKAD_PUBLIC_KEY!, // a delivery/read key
64
+ })
65
+ ```
66
+
67
+ Pass `draft: true` (with a draft-scoped key) to read unpublished content — typically only inside the draft-mode branch.
33
68
 
34
69
  ## Fetch + render
35
70
 
36
71
  ```tsx
37
72
  // app/articles/[slug]/page.tsx
38
- import { getEstokad, Estokad } from '@estokad/next'
73
+ import { createClient, Estokad } from '@estokad/next'
74
+
75
+ const cms = createClient({
76
+ workspace: 'your-workspace-slug',
77
+ apiUrl: 'https://api.estokad.com',
78
+ apiKey: process.env.ESTOKAD_PUBLIC_KEY!,
79
+ })
39
80
 
40
81
  export default async function ArticlePage({ params }: { params: { slug: string } }) {
41
- const cms = getEstokad()
42
- const article = await cms.fetch('article', params.slug)
82
+ const article = await cms.article.get({ slug: params.slug })
83
+ if (!article) return null
43
84
 
85
+ // EntryEnvelope<T> flattens the content fields onto the object, plus
86
+ // `id` and an optional `_meta` ({ status, publishedAt, updatedAt, createdAt }).
44
87
  return (
45
88
  <article>
46
- <Estokad.Text entry={article} field="title" as="h1" />
47
- <Estokad.RichText entry={article} field="body" />
48
- <Estokad.Image entry={article} field="hero" alt={article.title} />
89
+ <Estokad.Text
90
+ value={article.title}
91
+ entryId={article.id}
92
+ contentType="article"
93
+ fieldName="title"
94
+ as="h1"
95
+ />
96
+ <Estokad.RichText
97
+ value={article.body}
98
+ entryId={article.id}
99
+ contentType="article"
100
+ fieldName="body"
101
+ />
102
+ <Estokad.Image
103
+ src={article.hero}
104
+ alt={article.title}
105
+ entryId={article.id}
106
+ contentType="article"
107
+ fieldName="hero"
108
+ />
49
109
  </article>
50
110
  )
51
111
  }
52
112
  ```
53
113
 
54
- The `<Estokad.*>` components emit plain HTML in production. In draft mode they add `data-estokad-field` attributes that the visual-edit overlay reads to support click-to-edit.
114
+ `cms.<type>` exposes `get({ id } | { slug })`, `list({ first?, offset? })`, `create(data)`, `update(id, data)`, `publish(id)`, `unpublish(id)`, `delete(id)`. Raw GraphQL is `cms.gql<T>(query, variables?)`.
115
+
116
+ The `<Estokad.*>` components (`Text`, `RichText`, `Number`, `Date`, `Image`, `Field`) emit plain HTML in production. In draft mode they add `data-estokad-*` attributes the overlay reads for click-to-edit. Every one takes `entryId`, `contentType`, `fieldName` plus its `value`/`src`. They're async Server Components — see Compatibility on React 18.
55
117
 
56
118
  ## Draft mode
57
119
 
58
- Wire the route handler that toggles draft mode (called by the Studio's preview link):
120
+ The Studio preview link calls a route on your site that toggles Next.js draft mode:
59
121
 
60
122
  ```ts
61
123
  // app/api/draft/route.ts
62
124
  import { estokadDraftMode } from '@estokad/next/draft'
63
125
 
64
- export const { GET } = estokadDraftMode.enable({
65
- workspace: 'my-workspace',
126
+ export const GET = estokadDraftMode.enable({
127
+ workspace: 'your-workspace-slug',
66
128
  previewSecret: process.env.ESTOKAD_PREVIEW_SECRET!,
129
+ // or, recommended in production: jwksUrl: 'https://api.estokad.com/v1/<ws>/.well-known/jwks.json'
67
130
  })
68
- ```
69
-
70
- Disable:
71
-
72
- ```ts
73
- // app/api/draft/disable/route.ts
74
- import { estokadDraftMode } from '@estokad/next/draft'
75
131
 
76
- export const { GET } = estokadDraftMode.disable()
132
+ // disable is itself the handler — do not call it
133
+ export const POST = estokadDraftMode.disable
77
134
  ```
78
135
 
136
+ `estokadDraftMode.enable(config)` returns the route handler; `estokadDraftMode.disable` _is_ the handler. Token verification is HMAC (`previewSecret`) or RS256/JWKS (`jwksUrl`, takes precedence). Low-level codecs `signDraftToken` / `verifyDraftToken` / `verifyDraftTokenJwks` are exported from the package root.
137
+
79
138
  ## Visual edit overlay
80
139
 
81
140
  Mount the overlay route once:
@@ -85,12 +144,48 @@ Mount the overlay route once:
85
144
  export { estokadOverlayRoute as GET } from '@estokad/next/overlay-route'
86
145
  ```
87
146
 
88
- `EstokadProvider` injects the overlay automatically when draft mode is on.
147
+ Then either wrap your layout with `EstokadProvider` (it injects `<script type="module" src="/api/estokad/overlay">` when draft mode is on, and is a zero-overhead pass-through otherwise):
148
+
149
+ ```tsx
150
+ // app/layout.tsx
151
+ import { EstokadProvider } from '@estokad/next'
152
+
153
+ export default function RootLayout({ children }: { children: React.ReactNode }) {
154
+ return (
155
+ <html>
156
+ <body>
157
+ <EstokadProvider>{children}</EstokadProvider>
158
+ </body>
159
+ </html>
160
+ )
161
+ }
162
+ ```
163
+
164
+ …or, on React 18 (to avoid the async-component type caveat), inline the same six lines yourself:
165
+
166
+ ```tsx
167
+ // app/layout.tsx
168
+ import { draftMode } from 'next/headers'
169
+
170
+ export default async function RootLayout({ children }: { children: React.ReactNode }) {
171
+ const { isEnabled } = await draftMode()
172
+ return (
173
+ <html>
174
+ <body>
175
+ {children}
176
+ {isEnabled ? <script type="module" src="/api/estokad/overlay" async /> : null}
177
+ </body>
178
+ </html>
179
+ )
180
+ }
181
+ ```
182
+
183
+ `EstokadProvider` accepts an optional `overlaySrc` to override the default `/api/estokad/overlay` path.
89
184
 
90
185
  ## Documentation
91
186
 
92
- Full reference at [`docs.estokad.com/visual-edit`](https://docs.estokad.com/docs/visual-edit) and [`docs.estokad.com/getting-started`](https://docs.estokad.com/docs/getting-started).
187
+ Full reference at [`docs.estokad.com/docs/visual-edit`](https://docs.estokad.com/docs/visual-edit) and [`docs.estokad.com/docs/getting-started`](https://docs.estokad.com/docs/getting-started).
93
188
 
94
189
  ## License
95
190
 
96
- Apache-2.0. Estokad is a Samarkand Industries product.
191
+ Apache-2.0. Estokad is a trademark of Samarkand Industries OÜ; this license grants no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D,eAAO,MAAM,OAAO;;;;;;;CAOV,CAAA"}
@@ -14,6 +14,9 @@ import { jsx as _jsx } from "react/jsx-runtime";
14
14
  import { draftMode } from 'next/headers';
15
15
  import { renderRichText } from './rich-text.js';
16
16
  async function getDraftAttrs(meta, fieldType) {
17
+ // Awaited deliberately: async on Next 15, sync on Next 14.2; the
18
+ // await is a no-op passthrough on 14 and required on 15. Keeps the
19
+ // peer range ^14.2 || ^15. See provider.tsx for the full note.
17
20
  const { isEnabled } = await draftMode();
18
21
  if (!isEnabled)
19
22
  return {};
@@ -1 +1 @@
1
- {"version":3,"file":"components.js","sourceRoot":"","sources":["../src/components.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,EAAE;AACF,0EAA0E;AAC1E,4DAA4D;AAC5D,wEAAwE;AACxE,oEAAoE;AACpE,oBAAoB;AACpB,EAAE;AACF,sEAAsE;AACtE,uEAAuE;AACvE,mEAAmE;AACnE,mCAAmC;AAEnC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAGxC,OAAO,EAAE,cAAc,EAAkB,MAAM,gBAAgB,CAAA;AAa/D,KAAK,UAAU,aAAa,CAC1B,IAAmB,EACnB,SAAoB;IAEpB,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,SAAS,EAAE,CAAA;IACvC,IAAI,CAAC,SAAS;QAAE,OAAO,EAAE,CAAA;IACzB,OAAO;QACL,oBAAoB,EAAE,IAAI,CAAC,OAAO;QAClC,mBAAmB,EAAE,IAAI,CAAC,WAAW;QACrC,oBAAoB,EAAE,IAAI,CAAC,SAAS;QACpC,wBAAwB,EAAE,SAAS;KACpC,CAAA;AACH,CAAC;AAUD,MAAM,CAAC,KAAK,UAAU,IAAI,CACxB,KAAoE;IAEpE,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAA;IAChF,MAAM,GAAG,GAAG,CA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CAAC,EAAE,MAAM,CAAA;IACzB;+DAC2D;IAC3D,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAA;CAChC;AAED,eAAO,MAAM,gBAAgB;IAC3B;6DACyD;mBAC1C,YAAY,IACK,SAAS,WAAW,KAAG,OAAO,CAAC,YAAY,CAAC;IAsD5E,8CAA8C;eAC7B,OAAO,CAAC,YAAY,CAAC;CAOvC,CAAA"}
1
+ {"version":3,"file":"draft.d.ts","sourceRoot":"","sources":["../src/draft.ts"],"names":[],"mappings":"AA4BA,OAAO,EAAE,YAAY,EAAE,KAAK,WAAW,EAAE,MAAM,aAAa,CAAA;AAI5D,UAAU,YAAY;IACpB,gEAAgE;IAChE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B;;sEAEkE;IAClE,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;IACzB;+DAC2D;IAC3D,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAA;CAChC;AAED,eAAO,MAAM,gBAAgB;IAC3B;6DACyD;mBAC1C,YAAY,IACK,SAAS,WAAW,KAAG,OAAO,CAAC,YAAY,CAAC;IAsD5E,8CAA8C;eAC7B,OAAO,CAAC,YAAY,CAAC;CAUvC,CAAA"}
package/dist/draft.js CHANGED
@@ -76,6 +76,9 @@ export const estokadDraftMode = {
76
76
  },
77
77
  /** POST handler that turns draft mode off. */
78
78
  async disable() {
79
+ // draftMode()/cookies() are async on Next 15, sync on Next 14.2.
80
+ // Awaiting is correct on both (no-op passthrough on 14), which is
81
+ // what makes the peer range ^14.2 || ^15 safe. Don't de-await.
79
82
  const draft = await draftMode();
80
83
  draft.disable();
81
84
  const cookieStore = await cookies();
package/dist/draft.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"draft.js","sourceRoot":"","sources":["../src/draft.ts"],"names":[],"mappings":"AAAA,oDAAoD;AACpD,EAAE;AACF,wEAAwE;AACxE,sEAAsE;AACtE,sEAAsE;AACtE,mEAAmE;AACn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AAY,EACZ,YAA2B;IAE3B,MAAM,KAAK,GAAG,MAAM,SAAS,EAAE,CAAA;IAC/B,KAAK,CAAC,MAAM,EAAE,CAAA;IACd,IAAI,YAAY,EAAE,CAAC;QACjB,MAAM,WAAW,GAAG,MAAM,OAAO,EAAE,CAAA;QACnC,WAAW,CAAC,GAAG,CAAC,yBAAyB,EAAE,YAAY,EAAE;YACvD,QAAQ,EAAE,KAAK,EAAE,oCAAoC;YACrD,QAAQ,EAAE,KAAK;YACf,MAAM,EAAE,GAAG,CAAC,QAAQ,KAAK,QAAQ;YACjC,IAAI,EAAE,GAAG;YACT,MAAM,EAAE,EAAE,GAAG,EAAE;SAChB,CAAC,CAAA;IACJ,CAAC;IACD,OAAO,YAAY,CAAC,QAAQ,CAAC,IAAI,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAA;AAClD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../src/provider.tsx"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC,UAAU,KAAK;IACb,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAA;IAC5B;;iEAE6D;IAC7D,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAC7B;AAED,wBAAsB,eAAe,CAAC,EAAE,QAAQ,EAAE,UAAmC,EAAE,EAAE,KAAK,oDAS7F"}
1
+ {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../src/provider.tsx"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC,UAAU,KAAK;IACb,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAA;IAC5B;;iEAE6D;IAC7D,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAC7B;AAED,wBAAsB,eAAe,CAAC,EAAE,QAAQ,EAAE,UAAmC,EAAE,EAAE,KAAK,oDAY7F"}
package/dist/provider.js CHANGED
@@ -20,6 +20,9 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
20
20
  // route handler (which is mounted with `estokadOverlayRoute`).
21
21
  import { draftMode } from 'next/headers';
22
22
  export async function EstokadProvider({ children, overlaySrc = '/api/estokad/overlay' }) {
23
+ // draftMode() is async on Next 15, sync on Next 14.2. Awaiting works
24
+ // on both (await of a non-thenable is a passthrough) — this is what
25
+ // lets the package's peer range span ^14.2 || ^15. Don't unwrap it.
23
26
  const { isEnabled } = await draftMode();
24
27
  return (_jsxs(_Fragment, { children: [children, isEnabled ? _jsx("script", { type: "module", src: overlaySrc, async: true }) : null] }));
25
28
  }
@@ -1 +1 @@
1
- {"version":3,"file":"provider.js","sourceRoot":"","sources":["../src/provider.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,wEAAwE;AACxE,EAAE;AACF,oDAAoD;AACpD,EAAE;AACF,uDAAuD;AACvD,eAAe;AACf,eAAe;AACf,iBAAiB;AACjB,0DAA0D;AAC1D,kBAAkB;AAClB,gBAAgB;AAChB,QAAQ;AACR,MAAM;AACN,EAAE;AACF,0EAA0E;AAC1E,qEAAqE;AACrE,uEAAuE;AACvE,+DAA+D;AAE/D,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAWxC,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,EAAE,QAAQ,EAAE,UAAU,GAAG,sBAAsB,EAAS;IAC5F,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,SAAS,EAAE,CAAA;IAEvC,OAAO,CACL,8BACG,QAAQ,EACR,SAAS,CAAC,CAAC,CAAC,iBAAQ,IAAI,EAAC,QAAQ,EAAC,GAAG,EAAE,UAAU,EAAE,KAAK,SAAG,CAAC,CAAC,CAAC,IAAI,IAClE,CACJ,CAAA;AACH,CAAC"}
1
+ {"version":3,"file":"provider.js","sourceRoot":"","sources":["../src/provider.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,wEAAwE;AACxE,EAAE;AACF,oDAAoD;AACpD,EAAE;AACF,uDAAuD;AACvD,eAAe;AACf,eAAe;AACf,iBAAiB;AACjB,0DAA0D;AAC1D,kBAAkB;AAClB,gBAAgB;AAChB,QAAQ;AACR,MAAM;AACN,EAAE;AACF,0EAA0E;AAC1E,qEAAqE;AACrE,uEAAuE;AACvE,+DAA+D;AAE/D,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAWxC,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,EAAE,QAAQ,EAAE,UAAU,GAAG,sBAAsB,EAAS;IAC5F,qEAAqE;IACrE,oEAAoE;IACpE,oEAAoE;IACpE,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,SAAS,EAAE,CAAA;IAEvC,OAAO,CACL,8BACG,QAAQ,EACR,SAAS,CAAC,CAAC,CAAC,iBAAQ,IAAI,EAAC,QAAQ,EAAC,GAAG,EAAE,UAAU,EAAE,KAAK,SAAG,CAAC,CAAC,CAAC,IAAI,IAClE,CACJ,CAAA;AACH,CAAC"}
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@estokad/next",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "type": "module",
5
5
  "description": "Next.js adapter: draft mode helpers, EstokadProvider, auto-tagging Estokad.* components.",
6
- "license": "MIT",
6
+ "license": "Apache-2.0",
7
7
  "repository": {
8
8
  "type": "git",
9
9
  "url": "https://github.com/ELIASspaceMercer/estokad.git",
@@ -33,11 +33,11 @@
33
33
  "dist"
34
34
  ],
35
35
  "dependencies": {
36
- "@estokad/sdk": "0.1.1"
36
+ "@estokad/sdk": "0.1.3"
37
37
  },
38
38
  "peerDependencies": {
39
- "next": "^15.0.0",
40
- "react": "^19.0.0"
39
+ "next": "^14.2.0 || ^15.0.0",
40
+ "react": "^18.2.0 || ^19.0.0"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@types/node": "^22.10.0",