jquery-react-render 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/.editorconfig +31 -0
- package/CODEOWNERS +1 -0
- package/COPYRIGHT.md +9 -0
- package/LICENSE +7 -0
- package/README.md +34 -0
- package/SECURITY.md +3 -0
- package/index.tsx +31 -0
- package/package.json +15 -0
package/.editorconfig
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
root = true
|
|
2
|
+
|
|
3
|
+
[*]
|
|
4
|
+
charset = utf-8
|
|
5
|
+
tab_width = 2
|
|
6
|
+
indent_size = 2
|
|
7
|
+
indent_style = space
|
|
8
|
+
end_of_line = CRLF
|
|
9
|
+
insert_final_newline = true
|
|
10
|
+
trim_trailing_whitespace = true
|
|
11
|
+
max_line_length = off
|
|
12
|
+
|
|
13
|
+
[*.md]
|
|
14
|
+
trim_trailing_whitespace = false
|
|
15
|
+
|
|
16
|
+
[*.js]
|
|
17
|
+
block_comment_start = /*
|
|
18
|
+
block_comment = *
|
|
19
|
+
block_comment_end = */
|
|
20
|
+
|
|
21
|
+
[*.yml]
|
|
22
|
+
indent_size = 1
|
|
23
|
+
|
|
24
|
+
[{*.json,Makefile}]
|
|
25
|
+
max_line_length = off
|
|
26
|
+
|
|
27
|
+
[test/{dotdot,resolver,module_dir,multirepo,node_path,pathfilter,precedence}/**/*]
|
|
28
|
+
indent_style = off
|
|
29
|
+
indent_size = off
|
|
30
|
+
max_line_length = off
|
|
31
|
+
insert_final_newline = off
|
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,34 @@
|
|
|
1
|
+
# jquery-react-render
|
|
2
|
+
|
|
3
|
+
If you love to use Jquery and react... this is for you!
|
|
4
|
+
You can pass and react component or html element and append where you want in react style
|
|
5
|
+
|
|
6
|
+
## install
|
|
7
|
+
|
|
8
|
+
```sh
|
|
9
|
+
npm i -D jquery-react-render
|
|
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 "jquery-react-render"
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## how works and use
|
|
20
|
+
|
|
21
|
+
```javascript
|
|
22
|
+
|
|
23
|
+
$("body") // The main element where you want you component
|
|
24
|
+
.react(
|
|
25
|
+
"#container", // example: the name of container
|
|
26
|
+
<div id="test">
|
|
27
|
+
This is just a test
|
|
28
|
+
</div>
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Copyright by Dario Passariello (c) 2025
|
|
34
|
+
all rights reserved - <dariopassariello@gmail.com>
|
package/SECURITY.md
ADDED
package/index.tsx
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import $ from "jquery"
|
|
2
|
+
import { createRoot } from 'react-dom/client'
|
|
3
|
+
|
|
4
|
+
export default (
|
|
5
|
+
()=>{
|
|
6
|
+
|
|
7
|
+
$.fn.react = function (element, component) {
|
|
8
|
+
|
|
9
|
+
function add(selector, elem) {
|
|
10
|
+
if (selector.startsWith('#')) {
|
|
11
|
+
$(elem).attr("id", selector.slice(1))
|
|
12
|
+
} else if (selector.startsWith('.')) {
|
|
13
|
+
$(elem).attr("class", selector.slice(1))
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
console.log(this[0])
|
|
18
|
+
|
|
19
|
+
const child = document.createElement('div')
|
|
20
|
+
add(element, child)
|
|
21
|
+
this.append(child)
|
|
22
|
+
|
|
23
|
+
createRoot(child).render(<>{component}</>)
|
|
24
|
+
return this
|
|
25
|
+
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return
|
|
29
|
+
|
|
30
|
+
}
|
|
31
|
+
)()
|
package/package.json
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "jquery-react-render",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Render React Element Using Jquery command",
|
|
5
|
+
"keywords":["jquery, react, render, component, dario, passariello"],
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"author": "Dario Passariello",
|
|
8
|
+
"type": "commonjs",
|
|
9
|
+
"main": "index.tsx",
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"jquery": "^3.7.1",
|
|
12
|
+
"react": "^19.1.1",
|
|
13
|
+
"react-dom": "^19.1.1"
|
|
14
|
+
}
|
|
15
|
+
}
|