react-attack 1.0.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/CODEOWNERS ADDED
@@ -0,0 +1 @@
1
+ * @passariello
package/COPYRIGHT.md ADDED
@@ -0,0 +1,9 @@
1
+ # Copyright
2
+
3
+ Copyright (c) 2025, Dario Passariello. All rights reserved.
4
+ Licensed under MIT License, see
5
+ <https://dario.passariello.ca>
6
+
7
+ This software is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the software.
8
+
9
+ This software is licensed under the MIT License.
package/LICENSE ADDED
@@ -0,0 +1,7 @@
1
+ # Copyright 2025 Dario Passariello
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
+
5
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
+
7
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,102 @@
1
+ # react-attack
2
+
3
+ If you love to use Jquery and react... this is for you!
4
+ You can pass a react component or html element and append it where you want... in react style
5
+
6
+ ## install
7
+
8
+ ```sh
9
+ npm i -D react-attack
10
+ ```
11
+
12
+ You use:
13
+ If your app is an SPA you need to import only one time at first script
14
+
15
+ ```javascript
16
+ import "react-attack"
17
+ ```
18
+
19
+ ## how works and use
20
+
21
+ ```js
22
+
23
+ useEffect(
24
+ () => {
25
+ ReactGlue(
26
+ "body", // <-- Append to body
27
+ "component", // <-- ID of container
28
+ <div>HTML</div> // <-- Example with HTML
29
+ )
30
+ }
31
+ )
32
+
33
+ or
34
+
35
+ // Create a component on-fly as Test + useState!
36
+ const TestComponent = () => {
37
+ const [test, setTest] = useState("Hello World")
38
+ return (
39
+ <div>
40
+ <h1>{test}</h1>
41
+ </div>
42
+ )
43
+ }
44
+
45
+ useEffect(
46
+ () => {
47
+ ReactGlue(
48
+ "body", // <-- Append to body
49
+ "component", // <-- ID of container
50
+ <TestComponent /> // <-- React Component
51
+ )
52
+ }
53
+ )
54
+
55
+ ```
56
+
57
+ ## React Example
58
+
59
+ ```js
60
+
61
+ // Example in React to create a popup into body
62
+
63
+ import React from "react"
64
+ import ReactGlue from "react-attack"
65
+
66
+ const MyFunction = () =>{
67
+
68
+ useEffect(
69
+ () => {
70
+
71
+ ReactGlue(
72
+ "body",
73
+ "component",
74
+ <div
75
+ className="modal"
76
+ style={
77
+ {
78
+ position:"absolute",
79
+ background:"white",
80
+ top:"20px",
81
+ left:"20px",
82
+ width:"300px",
83
+ height:"300px",
84
+ zIndex: 10,
85
+ }
86
+ }
87
+ >
88
+ Hello World
89
+ </div>
90
+ )
91
+
92
+ },[]
93
+ )
94
+
95
+ return null
96
+ }
97
+
98
+
99
+ ```
100
+
101
+ Copyright by Dario Passariello (c) 2025
102
+ all rights reserved - <dariopassariello@gmail.com>
package/SECURITY.md ADDED
@@ -0,0 +1,3 @@
1
+ # Security
2
+
3
+ Please email [@passariello](https://github.com/passariello) or see <https://dario.passariello.ca/contact/> if you have a potential security vulnerability to report.
package/index.d.ts ADDED
@@ -0,0 +1,13 @@
1
+ /*!
2
+ react-attack
3
+ Copyright (c) 2025 Dario Passariello <dariopassariello@gmail.com>
4
+ Licensed under MIT License, see
5
+ https://dario.passariello.ca
6
+ */
7
+
8
+ declare module 'ReactGlue'
9
+
10
+ declare var ReactGlue
11
+ type ReactGlue = {}
12
+
13
+ export default ReactGlue
package/index.tsx ADDED
@@ -0,0 +1 @@
1
+ import r,{isValidElement as i}from"react";import{createRoot as d}from"react-dom/client";const a=(o,c,e)=>{const t=document.createElement("div");t.id=c;const n=document.querySelector(o);if(!n)throw"React Glue need the parent object in the scene";const l=n.appendChild(t);d(t).render(i(e)?e:r.createElement(r.Fragment,null,e))};export default a;
package/package.json ADDED
@@ -0,0 +1,21 @@
1
+ {
2
+ "name": "react-attack",
3
+ "version": "1.0.0",
4
+ "description": "Render React where you want",
5
+ "keywords": [
6
+ "react-attack, react, render, component, glue, dario, passariello"
7
+ ],
8
+ "license": "MIT",
9
+ "author": "Dario Passariello",
10
+ "type": "commonjs",
11
+ "main": "./index.tsx",
12
+ "types": "./index.d.ts",
13
+ "dependencies": {
14
+ "react": "^19.1.1",
15
+ "react-dom": "^19.1.1"
16
+ },
17
+ "devDependencies": {
18
+ "esbuild": "0.25.9",
19
+ "esbuild-plugin-copy": "2.1.1"
20
+ }
21
+ }