@sigx/lynx-markdown 0.4.1 → 0.4.2

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 (3) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +71 -71
  3. package/package.json +53 -53
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025-2026 Andreas Ekdahl
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 all
13
+ 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 THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,71 +1,71 @@
1
- # @sigx/lynx-markdown
2
-
3
- Typed SignalX wrapper around Lynx's `<x-markdown>` XElement.
4
-
5
- ## Status
6
-
7
- **Pre-release** — the wrapper compiles and types cleanly today, but the
8
- underlying native element ships per-platform on different schedules:
9
-
10
- | Platform | First version | Notes |
11
- | -------- | -------------- | ---------------------------------------------- |
12
- | Harmony | Lynx 3.7.0 | Stable. |
13
- | Android | Lynx 3.8.0-rc.0 | Ships as `org.lynxsdk.lynx:lynx_xelement_markdown`. |
14
- | iOS | (post-3.8.0) | Currently only on the upstream `main` branch. |
15
-
16
- On platforms where `<x-markdown>` is not yet registered, the component
17
- renders nothing at runtime. This package exists so that app code can
18
- already adopt the typed API surface — once you bump SignalX's Lynx pins
19
- to a release that includes the native element on your target platforms,
20
- it starts rendering without code changes.
21
-
22
- When the iOS/Android pods land in stable, this README will be updated
23
- with the matching native dependency wiring (Podfile + gradle).
24
-
25
- ## Install
26
-
27
- ```
28
- pnpm add @sigx/lynx-markdown
29
- ```
30
-
31
- ## Use
32
-
33
- ```tsx
34
- import { Markdown } from '@sigx/lynx-markdown';
35
-
36
- export default function ArticleScreen() {
37
- return (
38
- <Markdown
39
- value={"# Hello\n\nThis is **markdown**."}
40
- effect="typewriter"
41
- onLink={(e) => console.log('tapped', e.detail.url)}
42
- onParseEnd={() => console.log('parsed')}
43
- />
44
- );
45
- }
46
- ```
47
-
48
- ## Props
49
-
50
- | Prop | Type | Notes |
51
- | ------------- | --------------------------------------- | --------------------------------------------------- |
52
- | `value` | `string` | Markdown source passed as a raw-text child. |
53
- | `effect` | `'typewriter' \| 'none' \| string` | Maps to the `markdown-effect` attribute. |
54
- | `attachments` | `ReadonlyArray<unknown>` | Maps to `text-mark-attachments`. Engine-defined. |
55
- | `class` | `string` | |
56
- | `style` | `string \| Record<string, ...>` | |
57
- | `onLink` | `(e: MarkdownLinkEvent) => void` | Underlying `bindlink`. |
58
- | `onImageTap` | `(e: MarkdownImageTapEvent) => void` | Underlying `bindimageTap`. |
59
- | `onParseEnd` | `(e: MarkdownParseEndEvent) => void` | Underlying `bindparseEnd`. |
60
-
61
- ## Native element methods
62
-
63
- The underlying `<x-markdown>` exposes UI methods you can invoke via a
64
- `main-thread:ref`:
65
-
66
- - `getContent`, `getParseResult`, `getImages`
67
- - `pauseAnimation`, `resumeAnimation`, `clearStatus`
68
- - `getTextBoundingRect`, `setTextSelection`, `getSelectedText`
69
-
70
- These are not yet wrapped by the component; drop down to the intrinsic
71
- `<x-markdown>` element with a ref to call them directly.
1
+ # @sigx/lynx-markdown
2
+
3
+ Typed SignalX wrapper around Lynx's `<x-markdown>` XElement.
4
+
5
+ ## Status
6
+
7
+ **Pre-release** — the wrapper compiles and types cleanly today, but the
8
+ underlying native element ships per-platform on different schedules:
9
+
10
+ | Platform | First version | Notes |
11
+ | -------- | -------------- | ---------------------------------------------- |
12
+ | Harmony | Lynx 3.7.0 | Stable. |
13
+ | Android | Lynx 3.8.0-rc.0 | Ships as `org.lynxsdk.lynx:lynx_xelement_markdown`. |
14
+ | iOS | (post-3.8.0) | Currently only on the upstream `main` branch. |
15
+
16
+ On platforms where `<x-markdown>` is not yet registered, the component
17
+ renders nothing at runtime. This package exists so that app code can
18
+ already adopt the typed API surface — once you bump SignalX's Lynx pins
19
+ to a release that includes the native element on your target platforms,
20
+ it starts rendering without code changes.
21
+
22
+ When the iOS/Android pods land in stable, this README will be updated
23
+ with the matching native dependency wiring (Podfile + gradle).
24
+
25
+ ## Install
26
+
27
+ ```
28
+ pnpm add @sigx/lynx-markdown
29
+ ```
30
+
31
+ ## Use
32
+
33
+ ```tsx
34
+ import { Markdown } from '@sigx/lynx-markdown';
35
+
36
+ export default function ArticleScreen() {
37
+ return (
38
+ <Markdown
39
+ value={"# Hello\n\nThis is **markdown**."}
40
+ effect="typewriter"
41
+ onLink={(e) => console.log('tapped', e.detail.url)}
42
+ onParseEnd={() => console.log('parsed')}
43
+ />
44
+ );
45
+ }
46
+ ```
47
+
48
+ ## Props
49
+
50
+ | Prop | Type | Notes |
51
+ | ------------- | --------------------------------------- | --------------------------------------------------- |
52
+ | `value` | `string` | Markdown source passed as a raw-text child. |
53
+ | `effect` | `'typewriter' \| 'none' \| string` | Maps to the `markdown-effect` attribute. |
54
+ | `attachments` | `ReadonlyArray<unknown>` | Maps to `text-mark-attachments`. Engine-defined. |
55
+ | `class` | `string` | |
56
+ | `style` | `string \| Record<string, ...>` | |
57
+ | `onLink` | `(e: MarkdownLinkEvent) => void` | Underlying `bindlink`. |
58
+ | `onImageTap` | `(e: MarkdownImageTapEvent) => void` | Underlying `bindimageTap`. |
59
+ | `onParseEnd` | `(e: MarkdownParseEndEvent) => void` | Underlying `bindparseEnd`. |
60
+
61
+ ## Native element methods
62
+
63
+ The underlying `<x-markdown>` exposes UI methods you can invoke via a
64
+ `main-thread:ref`:
65
+
66
+ - `getContent`, `getParseResult`, `getImages`
67
+ - `pauseAnimation`, `resumeAnimation`, `clearStatus`
68
+ - `getTextBoundingRect`, `setTextSelection`, `getSelectedText`
69
+
70
+ These are not yet wrapped by the component; drop down to the intrinsic
71
+ `<x-markdown>` element with a ref to call them directly.
package/package.json CHANGED
@@ -1,55 +1,55 @@
1
1
  {
2
- "name": "@sigx/lynx-markdown",
3
- "version": "0.4.1",
4
- "description": "Typed signalx wrapper around Lynx's <x-markdown> element. Renders markdown source via XElement/Markdown.",
5
- "type": "module",
6
- "main": "./dist/index.js",
7
- "types": "./dist/index.d.ts",
8
- "exports": {
9
- ".": {
10
- "types": "./dist/index.d.ts",
11
- "import": "./dist/index.js",
12
- "default": "./dist/index.js"
13
- },
14
- "./package.json": "./package.json"
2
+ "name": "@sigx/lynx-markdown",
3
+ "version": "0.4.2",
4
+ "description": "Typed signalx wrapper around Lynx's <x-markdown> element. Renders markdown source via XElement/Markdown.",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.js",
12
+ "default": "./dist/index.js"
15
13
  },
16
- "files": [
17
- "dist",
18
- "README.md",
19
- "LICENSE"
20
- ],
21
- "scripts": {
22
- "build": "node ../../scripts/clean.mjs dist && tsgo",
23
- "dev": "tsgo --watch",
24
- "clean": "node ../../scripts/clean.mjs dist .turbo"
25
- },
26
- "peerDependencies": {
27
- "@sigx/lynx": "workspace:^"
28
- },
29
- "devDependencies": {
30
- "@sigx/lynx": "workspace:^",
31
- "@typescript/native-preview": "7.0.0-dev.20260511.1",
32
- "typescript": "^6.0.3"
33
- },
34
- "author": "Andreas Ekdahl",
35
- "license": "MIT",
36
- "repository": {
37
- "type": "git",
38
- "url": "git+https://github.com/signalxjs/lynx.git",
39
- "directory": "packages/lynx-markdown"
40
- },
41
- "homepage": "https://github.com/signalxjs/lynx/tree/main/packages/lynx-markdown",
42
- "bugs": {
43
- "url": "https://github.com/signalxjs/lynx/issues"
44
- },
45
- "publishConfig": {
46
- "access": "public"
47
- },
48
- "keywords": [
49
- "signalx",
50
- "sigx",
51
- "lynx",
52
- "markdown",
53
- "x-markdown"
54
- ]
55
- }
14
+ "./package.json": "./package.json"
15
+ },
16
+ "files": [
17
+ "dist",
18
+ "README.md",
19
+ "LICENSE"
20
+ ],
21
+ "peerDependencies": {
22
+ "@sigx/lynx": "^0.4.2"
23
+ },
24
+ "devDependencies": {
25
+ "@typescript/native-preview": "7.0.0-dev.20260521.1",
26
+ "typescript": "^6.0.3",
27
+ "@sigx/lynx": "^0.4.2"
28
+ },
29
+ "author": "Andreas Ekdahl",
30
+ "license": "MIT",
31
+ "repository": {
32
+ "type": "git",
33
+ "url": "git+https://github.com/signalxjs/lynx.git",
34
+ "directory": "packages/lynx-markdown"
35
+ },
36
+ "homepage": "https://github.com/signalxjs/lynx/tree/main/packages/lynx-markdown",
37
+ "bugs": {
38
+ "url": "https://github.com/signalxjs/lynx/issues"
39
+ },
40
+ "publishConfig": {
41
+ "access": "public"
42
+ },
43
+ "keywords": [
44
+ "signalx",
45
+ "sigx",
46
+ "lynx",
47
+ "markdown",
48
+ "x-markdown"
49
+ ],
50
+ "scripts": {
51
+ "build": "node ../../scripts/clean.mjs dist && tsgo",
52
+ "dev": "tsgo --watch",
53
+ "clean": "node ../../scripts/clean.mjs dist .turbo"
54
+ }
55
+ }