auto-component 0.0.24 → 0.0.25

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.jsx +14 -15
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "auto-component",
3
- "version": "0.0.24",
3
+ "version": "0.0.25",
4
4
  "main": "src/index.jsx",
5
5
  "peerDependencies": {
6
6
  "react": "^18.2.0",
package/src/index.jsx CHANGED
@@ -1,6 +1,5 @@
1
1
  import { useState, useEffect } from 'react'
2
2
  // import beautify from 'js-beautify';
3
- import beautify from './node_modules/js-beautify/js/lib/beautify.js';
4
3
  import './auto-component.css'
5
4
 
6
5
  const AutoComponent = ({ exclusions }) => {
@@ -35,13 +34,13 @@ const AutoComponent = ({ exclusions }) => {
35
34
  }
36
35
 
37
36
  // format html for display (breaks/indentation)
38
- const formatHtml = (html) => {
39
- return beautify.html(html, {
40
- indent_size: 2,
41
- wrap_line_length: 80,
42
- max_preserve_newlines: 1,
43
- })
44
- }
37
+ // const formatHtml = (html) => {
38
+ // return beautify.html(html, {
39
+ // indent_size: 2,
40
+ // wrap_line_length: 80,
41
+ // max_preserve_newlines: 1,
42
+ // })
43
+ // }
45
44
 
46
45
  // clean html of exclusions:
47
46
  // if an element className includes 'exclude'
@@ -59,13 +58,13 @@ const AutoComponent = ({ exclusions }) => {
59
58
  };
60
59
 
61
60
  // full exclusion
62
- const cleanExclusionsFull = (html) => {
63
- const regexExcludeClass = /<[^>]*\sclass\s*=\s*['"]([^'"]*exclude[^'"]*)['"][^>]*>[\s\S]*?<\/[^>]*>/g
64
- const cleanedHtml = html.replace(regexExcludeClass, '')
65
- const scriptIndex = cleanedHtml.lastIndexOf('<script')
66
-
67
- return formatHtml(cleanedHtml.substring(0, scriptIndex))
68
- }
61
+ // const cleanExclusionsFull = (html) => {
62
+ // const regexExcludeClass = /<[^>]*\sclass\s*=\s*['"]([^'"]*exclude[^'"]*)['"][^>]*>[\s\S]*?<\/[^>]*>/g
63
+ // const cleanedHtml = html.replace(regexExcludeClass, '')
64
+ // const scriptIndex = cleanedHtml.lastIndexOf('<script')
65
+ //
66
+ // return formatHtml(cleanedHtml.substring(0, scriptIndex))
67
+ // }
69
68
 
70
69
  // exclude non <style> data and remove comments
71
70
  const cleanStyles = (css) => {