@octane-xplat/tiptap 0.0.1 → 0.10.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2026 Alec Larson
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,79 @@
1
- # @octane-xplat/tiptap
1
+ # `@octane-xplat/tiptap`
2
2
 
3
- Version 0.0.1 is a reservation stub so the automated release can publish this package name. It has no supported API. Use a later release for the implementation.
3
+ The unified rich-text facade: one `TiptapEditor` component across web and
4
+ native. Web renders a real tiptap `Editor` through `@octanejs/tiptap`'s
5
+ `EditorContent`; Android renders the `@octane-xplat/richtext` leaf (WordPress
6
+ Aztec on Android, iOS stub) and layers tiptap document JSON on top through
7
+ the DOM-free ProseMirror slices (`@tiptap/pm`, `@tiptap/static-renderer`)
8
+ with a `zeed-dom` parse shim. No DOM-bound tiptap code (`EditorView`) ever
9
+ enters a native bundle — divergence lives at the file-suffix boundary.
10
+
11
+ ```tsx
12
+ import { useState } from 'octane'
13
+ import { TiptapEditor, supported } from '@octane-xplat/tiptap'
14
+ import { Text } from '@octane-xplat/ui'
15
+
16
+ export function Notes() {
17
+ const [html, setHtml] = useState('<p>Trip notes</p>')
18
+ return supported ? (
19
+ <TiptapEditor value={html} onChange={setHtml} />
20
+ ) : (
21
+ <Text>Editing is unavailable on this target</Text>
22
+ )
23
+ }
24
+ ```
25
+
26
+ `value`/`onChange` exchange document HTML. `getJSON`/`setJSON` exchange
27
+ tiptap document JSON: synchronous on web, bridged on native after
28
+ `onJSONReady(true)` — the lazy bridge reports `false` (and `getJSON()`
29
+ returns `null`) on runtimes that cannot host the schema modules. On native,
30
+ HTML is the canonical interchange format; JSON output is a best-effort
31
+ mapping of Aztec's flat span list onto ProseMirror's tree.
32
+
33
+ ```tsx
34
+ import { useRef, useState } from 'octane'
35
+ import { TiptapEditor, type TiptapEditorHandle } from '@octane-xplat/tiptap'
36
+ import { Button } from '@octane-xplat/ui'
37
+
38
+ export function DocumentCopy() {
39
+ const editor = useRef<TiptapEditorHandle | null>(null)
40
+ const [html, setHtml] = useState('<p>Trip notes</p>')
41
+ const [jsonReady, setJsonReady] = useState(false)
42
+ return (
43
+ <>
44
+ <TiptapEditor
45
+ value={html}
46
+ onChange={setHtml}
47
+ ref={(handle) => {
48
+ editor.current = handle
49
+ }}
50
+ onReady={() => setJsonReady(editor.current?.getJSON() != null)}
51
+ onJSONReady={setJsonReady}
52
+ />
53
+ <Button
54
+ isDisabled={!jsonReady}
55
+ onPress={() => {
56
+ const document = editor.current?.getJSON()
57
+ if (document) editor.current?.setJSON(document)
58
+ }}
59
+ >
60
+ Round-trip document
61
+ </Button>
62
+ </>
63
+ )
64
+ }
65
+ ```
66
+
67
+ The tiptap family pins to `3.28.0` to match `@octanejs/tiptap@0.0.51` —
68
+ extension `^` ranges float ahead of core and break (`getPreviousBlockSibling`),
69
+ so consumers should keep the workspace override. See
70
+ [`docs/app/rich-text.md`](../../docs/app/rich-text.md) for the shared contract,
71
+ format vocabulary, and known limits.
72
+
73
+ ## macOS AppKit
74
+
75
+ The macOS export mounts a bundled local editor document in WKWebView.
76
+ RichText uses StarterKit; Tiptap and Lexical use their existing web facades.
77
+ Wait for `onReady`; synchronous getters return the latest received snapshot
78
+ and commands cross WebKit asynchronously. The `native` handle is the Swift
79
+ host transport. See [AppKit setup and engine limits](../../docs/rich-text.md#macos-appkit-editing).
@@ -0,0 +1 @@
1
+ declare const html: string; export default html