@g9tm/lynxcontrols-richtext 0.0.0-stage → 2.5.9

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.
Files changed (49) hide show
  1. package/README.md +32 -2
  2. package/catalog/cards/G9RichLines.md +16 -0
  3. package/catalog/cards/G9RichText.md +17 -0
  4. package/catalog/cards/G9RichTextEditor.md +17 -0
  5. package/catalog/catalog.json +1667 -0
  6. package/catalog/index.md +7 -0
  7. package/dist/.tsbuildinfo +1 -0
  8. package/dist/bidi.d.ts +24 -0
  9. package/dist/bidi.d.ts.map +1 -0
  10. package/dist/bidi.jsx +102 -0
  11. package/dist/editor.d.ts +111 -0
  12. package/dist/editor.d.ts.map +1 -0
  13. package/dist/editor.jsx +556 -0
  14. package/dist/element-core.d.ts +60 -0
  15. package/dist/element-core.d.ts.map +1 -0
  16. package/dist/element-core.jsx +173 -0
  17. package/dist/element-types.d.ts +31 -0
  18. package/dist/element-types.d.ts.map +1 -0
  19. package/dist/element-types.jsx +1 -0
  20. package/dist/index.d.ts +10 -0
  21. package/dist/index.d.ts.map +1 -0
  22. package/dist/index.jsx +8 -0
  23. package/dist/lines-view.d.ts +27 -0
  24. package/dist/lines-view.d.ts.map +1 -0
  25. package/dist/lines-view.jsx +100 -0
  26. package/dist/mentions.d.ts +30 -0
  27. package/dist/mentions.d.ts.map +1 -0
  28. package/dist/mentions.jsx +40 -0
  29. package/dist/ot.d.ts +49 -0
  30. package/dist/ot.d.ts.map +1 -0
  31. package/dist/ot.jsx +306 -0
  32. package/dist/protocol.d.ts +199 -0
  33. package/dist/protocol.d.ts.map +1 -0
  34. package/dist/protocol.jsx +11 -0
  35. package/dist/rich-text.d.ts +48 -0
  36. package/dist/rich-text.d.ts.map +1 -0
  37. package/dist/rich-text.jsx +186 -0
  38. package/dist/richtext.css +411 -0
  39. package/dist/richtext.css.map +1 -0
  40. package/dist/session.d.ts +142 -0
  41. package/dist/session.d.ts.map +1 -0
  42. package/dist/session.jsx +665 -0
  43. package/dist/yjs.d.ts +3 -0
  44. package/dist/yjs.d.ts.map +1 -0
  45. package/dist/yjs.jsx +2 -0
  46. package/dist/ymodel.d.ts +178 -0
  47. package/dist/ymodel.d.ts.map +1 -0
  48. package/dist/ymodel.jsx +1379 -0
  49. package/package.json +68 -4
package/README.md CHANGED
@@ -1,3 +1,33 @@
1
- # Temporary Holding Version
1
+ # @g9tm/lynxcontrols-richtext
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Rich text for G9LynxControls (from G9Hub's documents): an editor over the host's `<g9-richtext>` element, which edits
4
+ the text natively (IME, selection, Persian and mixed directions) while the document model stays in the app. Opt-in:
5
+ none of it is in the cost of `@g9tm/lynxcontrols`.
6
+
7
+ ```tsx
8
+ import { G9RichTextEditor, useG9RichTextSession } from '@g9tm/lynxcontrols-richtext';
9
+ import { G9RichTextSession } from '@g9tm/lynxcontrols-richtext/yjs';
10
+
11
+ function Doc({ doc, awareness, me }) {
12
+ const { session, port, version } = useG9RichTextSession(
13
+ (port, onState) => new G9RichTextSession({ doc, awareness, user: me, port, onState }),
14
+ [doc],
15
+ );
16
+ return (
17
+ <G9RichTextEditor session={session} port={port} version={version} editable placeholder="Write…"
18
+ people={(q) => searchPeople(q)} links={(q) => searchLinks(q)} uploadImage={pickPicture}
19
+ promptLink={askForAddress} onOpenLink={open} />
20
+ );
21
+ }
22
+ ```
23
+
24
+ | Part | What it is |
25
+ | --- | --- |
26
+ | **`G9RichTextEditor`** | The toolbar (undo, redo, style, marks, link, lists with indent, quote, callout and tone, direction, insert), `/` blocks, `@` people and `[[` links while typing, collaborators' carets. The toolbar sits at a phone's bottom while the text has the focus. |
27
+ | **`G9RichText`** | The element bound to a session through a `G9RichTextPort`; `surface="drawn"` on a host without the element (the desktop): the lines drawn with views, the line being edited a text field. |
28
+ | **`G9RichLines`** | A document's lines drawn read-only (a version, a preview). |
29
+ | **`./yjs`** | `G9RichTextSession` and `G9RichDocModel`: a Yjs document (TipTap's schema) behind the element, with operational transforms, undo, markdown shortcuts and awareness carets. Needs `yjs` (and `y-protocols` for carets). |
30
+ | **`./protocol`** | The element's contract (`RtMessage`, `RtEdit`, `RtLine` …) for an app with its own model. |
31
+
32
+ The element: Android `G9RichTextBehaviors.create()` and iOS `G9LCRichTextUI` in `@g9tm/lynxcontrols-native`, web
33
+ `registerG9RichText()` in `@g9tm/lynxcontrols-web`.
@@ -0,0 +1,16 @@
1
+ # G9RichLines
2
+
3
+ `import { G9RichLines } from '@g9tm/lynxcontrols-richtext';`
4
+
5
+ The styled lines of a text (`text` split at `\n`, one `RtLine` each).
6
+
7
+ Props:
8
+ - `lines`: object[]
9
+ - `text`: string
10
+ - `direction?`: 'ltr' | 'rtl' = "ltr"
11
+ - `onTapLine?`: (index: number) => void
12
+ - `onToggleCheck?`: (index: number) => void
13
+ - `renderLine?`: (index, line, text) => ReactNode
14
+ - `editing?`: number
15
+
16
+ Example: `<G9RichLines lines={lines} text="Label" />`
@@ -0,0 +1,17 @@
1
+ # G9RichText
2
+
3
+ `import { G9RichText } from '@g9tm/lynxcontrols-richtext';`
4
+
5
+ An editable rich text on the host's element (or drawn, on the desktop).
6
+
7
+ Props:
8
+ - `editable`: boolean
9
+ - `placeholder`: string
10
+ - `port`: object
11
+ - `session`: object
12
+ - `onFocusChange?`: (focused: boolean) => void
13
+ - `onTapObject?`: (pos: number) => void
14
+ - `bottomInset?`: number
15
+ - `palette?`: object
16
+
17
+ Example: `<G9RichText editable placeholder="placeholder" port={port} session={session} />`
@@ -0,0 +1,17 @@
1
+ # G9RichTextEditor
2
+
3
+ `import { G9RichTextEditor } from '@g9tm/lynxcontrols-richtext';`
4
+
5
+ The live document's editor: the element, the toolbar and the suggestions.
6
+
7
+ Props:
8
+ - `editable`: boolean
9
+ - `placeholder`: string
10
+ - `port`: object
11
+ - `session`: object
12
+ - `version`: number
13
+ - `links?`: (query: string) => void
14
+ - `onOpenLink?`: (href: string) => void
15
+ - `people?`: (query: string) => void
16
+
17
+ Example: `<G9RichTextEditor editable placeholder="placeholder" port={port} session={session} version={1} />`