@octane-xplat/richtext 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.
@@ -0,0 +1,5 @@
1
+ import type { UniversalComponent } from 'octane/universal'
2
+ import type { RichTextEditorProps } from '../src/types'
3
+ export declare const RichTextEditor: UniversalComponent<RichTextEditorProps>
4
+ export declare const supported: boolean
5
+ export type * from '../src/types'
@@ -0,0 +1,11 @@
1
+ import type { UniversalComponent } from 'octane/universal'
2
+ import type { RichTextEditorProps } from '../src/types'
3
+ /** Internal shared editor host. */
4
+ export declare const NativeEditor: UniversalComponent<
5
+ RichTextEditorProps & {
6
+ browser: string
7
+ json?: any
8
+ onJSONReady?: (ok: boolean) => void
9
+ onJSONChange?: (doc: any) => void
10
+ }
11
+ >
@@ -0,0 +1,70 @@
1
+ import type { Octane } from 'octane/jsx-runtime';
2
+ /** Android uses WordPress Aztec; AppKit uses StarterKit in WKWebView.
3
+ * iOS is stubbed. Web/Windows use the tiptap facade instead of this leaf. */
4
+ export type RichTextFormat = 'bold' | 'italic' | 'underline' | 'strikethrough' | 'code' | 'blockquote' | 'bulletList' | 'orderedList' | 'taskList' | 'codeBlock' | 'horizontalRule' | 'highlight' | 'subscript' | 'superscript' | 'paragraph' | 'heading1' | 'heading2' | 'heading3' | 'heading4' | 'heading5' | 'heading6' | 'alignLeft' | 'alignCenter' | 'alignRight' | 'link';
5
+ export interface RichTextEditorHandle {
6
+ /** Serialized document HTML (Aztec's "plain" HTML — no contenteditable
7
+ * markup). */
8
+ /** AppKit: returns the latest WebKit snapshot; commands are asynchronous. */
9
+ getHTML(): string;
10
+ /** Replace the document. Android resets Aztec history; AppKit uses engine history. */
11
+ setHTML(html: string): void;
12
+ /** Toggle a format at the current selection. `link` needs
13
+ * `linkTo(url, anchor)` instead. */
14
+ apply(format: RichTextFormat): void;
15
+ /** Insert or re-target a link over the current selection. */
16
+ linkTo(url: string, anchor?: string): void;
17
+ removeLink(): void;
18
+ /** Formats active at the selection — powers toolbar highlight state. */
19
+ isActive(format: RichTextFormat): boolean;
20
+ /** Android: Aztec's history batches keyboard input only — format
21
+ * toggles and programmatic edits do not register. */
22
+ undo(): void;
23
+ redo(): void;
24
+ focus(): void;
25
+ blur(): void;
26
+ isFocused(): boolean;
27
+ /** The platform surface — `AztecText` on Android. */
28
+ /** AppKit: the XplatEditorHost transport, not the browser engine instance. */
29
+ native: any;
30
+ }
31
+ export interface RichTextSelectionChange {
32
+ start: number;
33
+ end: number;
34
+ /** Formats active at the caret/range, in facade spellings. */
35
+ active: RichTextFormat[];
36
+ }
37
+ export interface RichTextEditorProps {
38
+ id?: string;
39
+ className?: string;
40
+ style?: any;
41
+ /** Initial document HTML. Re-applied only when the string changes
42
+ * externally — text the editor emitted back through `onChange` is never
43
+ * re-pushed, so typing doesn't reparse the document. */
44
+ value?: string;
45
+ placeholder?: string;
46
+ editable?: boolean;
47
+ autofocus?: boolean;
48
+ onReady?: () => void;
49
+ onChange?: (html: string) => void;
50
+ onSelectionChange?: (event: RichTextSelectionChange) => void;
51
+ onFocus?: () => void;
52
+ onBlur?: () => void;
53
+ /** Imperative handle — fires once when the native editor exists. */
54
+ ref?: Octane.Ref<RichTextEditorHandle>;
55
+ /** Per-platform escape bag — properties are assigned onto the native
56
+ * `AztecText` after the leaf's own props. */
57
+ android?: Record<string, any>;
58
+ ios?: Record<string, any>;
59
+ row?: number | string;
60
+ col?: number | string;
61
+ rowSpan?: number;
62
+ colSpan?: number;
63
+ dock?: 'left' | 'top' | 'right' | 'bottom';
64
+ left?: number;
65
+ top?: number;
66
+ flexGrow?: number;
67
+ flexShrink?: number;
68
+ alignSelf?: 'auto' | 'flex-start' | 'flex-end' | 'center' | 'stretch' | 'baseline';
69
+ order?: number;
70
+ }
package/index.d.ts DELETED
@@ -1 +0,0 @@
1
- export {}
package/index.js DELETED
@@ -1,2 +0,0 @@
1
- // Reservation stub; implementation will arrive in a later release.
2
- module.exports = {}