@doist/react-interpolate 1.1.1 → 2.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.
@@ -0,0 +1,18 @@
1
+ export const TOKEN_PLACEHOLDER: 'TOKEN_PLACEHOLDER'
2
+
3
+ type Syntax = {
4
+ type: typeof TOKEN_PLACEHOLDER
5
+ regex: RegExp
6
+ }
7
+
8
+ type InterpolateProps = {
9
+ string: string
10
+ mapping: {
11
+ [key: string]: ((children: React.ReactNode) => React.ReactNode) | React.ReactNode
12
+ }
13
+ syntax?: Syntax[]
14
+ }
15
+
16
+ declare function Interpolate(props: InterpolateProps): JSX.Element
17
+
18
+ export = Interpolate
package/package.json CHANGED
@@ -1,13 +1,14 @@
1
1
  {
2
2
  "name": "@doist/react-interpolate",
3
- "version": "1.1.1",
3
+ "version": "2.1.0",
4
4
  "license": "MIT",
5
5
  "description": "A string interpolation component that formats and interpolates a template string in a safe way",
6
6
  "main": "dist/react-interpolate.cjs",
7
7
  "module": "dist/react-interpolate.mjs",
8
+ "types": "dist/react-interpolate.d.ts",
8
9
  "engines": {
9
- "node": "^18.0.0 || ^20.0.0 || ^21.0.0",
10
- "npm": "^9.0.0 || ^10.0.0"
10
+ "node": "^20.0.0 || ^21.0.0",
11
+ "npm": "^10.0.0"
11
12
  },
12
13
  "files": [
13
14
  "dist",
@@ -68,6 +69,7 @@
68
69
  "react-dom": "18.2.0",
69
70
  "rollup": "2.75.7",
70
71
  "rollup-plugin-babel": "4.4.0",
72
+ "rollup-plugin-copy": "3.5.0",
71
73
  "uglify-es": "3.3.9"
72
74
  }
73
75
  }
@@ -0,0 +1,18 @@
1
+ export const TOKEN_PLACEHOLDER: 'TOKEN_PLACEHOLDER'
2
+
3
+ type Syntax = {
4
+ type: typeof TOKEN_PLACEHOLDER
5
+ regex: RegExp
6
+ }
7
+
8
+ type InterpolateProps = {
9
+ string: string
10
+ mapping: {
11
+ [key: string]: ((children: React.ReactNode) => React.ReactNode) | React.ReactNode
12
+ }
13
+ syntax?: Syntax[]
14
+ }
15
+
16
+ declare function Interpolate(props: InterpolateProps): JSX.Element
17
+
18
+ export = Interpolate