@grom.js/tgx 1.0.0 → 1.1.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/dist/Line.d.ts ADDED
@@ -0,0 +1,20 @@
1
+ import type { PropsWithChildren, TgxElement } from './types.ts';
2
+ /**
3
+ * Simple component that wraps its children in a fragment and adds a newline.
4
+ *
5
+ * Useful for creating multi-line messages.
6
+ *
7
+ * @example
8
+ * ```jsx
9
+ * import { Line } from '@grom.js/tgx'
10
+ *
11
+ * const Greeting = (props) => (
12
+ * <>
13
+ * <Line>Hello, <b>{props.name}</b>!</Line>
14
+ * <Line/>
15
+ * <Line><i>How are you doing?</i></Line>
16
+ * </>
17
+ * )
18
+ * ```
19
+ */
20
+ export declare function Line({ children }: PropsWithChildren): TgxElement;
package/dist/Line.js ADDED
@@ -0,0 +1,23 @@
1
+ import { Fragment } from "./jsx.js";
2
+ /**
3
+ * Simple component that wraps its children in a fragment and adds a newline.
4
+ *
5
+ * Useful for creating multi-line messages.
6
+ *
7
+ * @example
8
+ * ```jsx
9
+ * import { Line } from '@grom.js/tgx'
10
+ *
11
+ * const Greeting = (props) => (
12
+ * <>
13
+ * <Line>Hello, <b>{props.name}</b>!</Line>
14
+ * <Line/>
15
+ * <Line><i>How are you doing?</i></Line>
16
+ * </>
17
+ * )
18
+ * ```
19
+ */
20
+ export function Line({ children }) {
21
+ return Fragment({ children: [children, '\n'] });
22
+ }
23
+ //# sourceMappingURL=Line.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Line.js","sourceRoot":"","sources":["../src/Line.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAEnC;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,IAAI,CAAC,EAAE,QAAQ,EAAqB;IAClD,OAAO,QAAQ,CAAC,EAAE,QAAQ,EAAE,CAAC,QAAQ,EAAE,IAAI,CAAC,EAAE,CAAC,CAAA;AACjD,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  export * from './jsx.ts';
2
+ export { Line } from './Line.ts';
2
3
  export * from './render.ts';
3
4
  export * from './types.ts';
package/dist/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from "./jsx.js";
2
+ export { Line } from "./Line.js";
2
3
  export * from "./render.js";
3
4
  export * from "./types.js";
4
5
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,aAAa,CAAA;AAC3B,cAAc,YAAY,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,cAAc,aAAa,CAAA;AAC3B,cAAc,YAAY,CAAA"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@grom.js/tgx",
3
3
  "type": "module",
4
- "version": "1.0.0",
4
+ "version": "1.1.0",
5
5
  "description": "JSX runtime for composing Telegram messages",
6
6
  "author": {
7
7
  "name": "Vladislav Deryabkin",
@@ -38,14 +38,14 @@
38
38
  "node": "22.x"
39
39
  },
40
40
  "devDependencies": {
41
- "@antfu/eslint-config": "6.2.0",
42
- "@types/node": "22.19.1",
43
- "@vitest/coverage-v8": "4.0.10",
44
- "bumpp": "10.3.1",
45
- "eslint": "9.39.1",
46
- "eslint-plugin-format": "1.0.2",
47
- "taze": "19.9.0",
48
- "vitest": "4.0.10"
41
+ "@antfu/eslint-config": "7.4.3",
42
+ "@types/node": "22.19.11",
43
+ "@vitest/coverage-v8": "4.0.18",
44
+ "bumpp": "10.4.1",
45
+ "eslint": "9.39.2",
46
+ "eslint-plugin-format": "1.4.0",
47
+ "taze": "19.9.2",
48
+ "vitest": "4.0.18"
49
49
  },
50
50
  "scripts": {
51
51
  "build": "rm -rf ./dist/ && tsc --project ./tsconfig.lib.json",
package/src/Line.ts ADDED
@@ -0,0 +1,24 @@
1
+ import type { PropsWithChildren, TgxElement } from './types.ts'
2
+ import { Fragment } from './jsx.ts'
3
+
4
+ /**
5
+ * Simple component that wraps its children in a fragment and adds a newline.
6
+ *
7
+ * Useful for creating multi-line messages.
8
+ *
9
+ * @example
10
+ * ```jsx
11
+ * import { Line } from '@grom.js/tgx'
12
+ *
13
+ * const Greeting = (props) => (
14
+ * <>
15
+ * <Line>Hello, <b>{props.name}</b>!</Line>
16
+ * <Line/>
17
+ * <Line><i>How are you doing?</i></Line>
18
+ * </>
19
+ * )
20
+ * ```
21
+ */
22
+ export function Line({ children }: PropsWithChildren): TgxElement {
23
+ return Fragment({ children: [children, '\n'] })
24
+ }
package/src/index.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  export * from './jsx.ts'
2
+ export { Line } from './Line.ts'
2
3
  export * from './render.ts'
3
4
  export * from './types.ts'