auto-component 0.0.15 → 0.0.17

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/package.json CHANGED
@@ -1,17 +1,14 @@
1
1
  {
2
2
  "name": "auto-component",
3
- "version": "0.0.15",
3
+ "version": "0.0.17",
4
4
  "main": "src/auto-component.jsx",
5
+ "module": "src/auto-component.jsx",
5
6
  "peerDependencies": {
6
7
  "react": "*",
7
8
  "react-dom": "*"
8
9
  },
9
10
  "dependencies": {
10
- "js-beautify": "^1.14.10",
11
- "config-chain": "^1.1.13",
12
- "editorconfig": "^1.0.3",
13
- "glob": "^10.3.3",
14
- "nopt": "^7.2.0"
11
+ "js-beautify": "^1.14.10"
15
12
  },
16
13
  "files": [
17
14
  "src"
@@ -1,5 +1,5 @@
1
1
  import { useState, useEffect } from 'react'
2
- import beautify from 'js-beautify'
2
+ import { js_beautify, css_beautify, html_beautify } from 'js-beautify';
3
3
 
4
4
  import './auto-component.css'
5
5
 
@@ -25,6 +25,21 @@ const AutoComponent = () => {
25
25
  //**-------------------------**/
26
26
  // ** HTML/CSS Formatting ** //
27
27
  //**-----------------------**/
28
+
29
+ function get_beautify() {
30
+ // the default is js
31
+ var beautify = function(src, config) {
32
+ return js_beautify(src, config);
33
+ };
34
+
35
+ // short aliases
36
+ beautify.js = js_beautify;
37
+ beautify.css = css_beautify;
38
+ beautify.html = html_beautify;
39
+
40
+ return beautify;
41
+ }
42
+
28
43
  // get the html/style for the current page and set state
29
44
  const htmlContent = () => {
30
45
  const body = document.querySelector('body')