@fangzhongya/utils 0.0.79 → 0.0.80

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 (43) hide show
  1. package/dist/basic/index.cjs +5 -5
  2. package/dist/basic/index.js +4 -4
  3. package/dist/basic/string/index.cjs +4 -4
  4. package/dist/basic/string/index.js +4 -4
  5. package/dist/chunk-4PHNHHMJ.cjs +147 -0
  6. package/dist/{chunk-SANLZVGX.js → chunk-AFYMIG44.js} +1 -1
  7. package/dist/{chunk-UWIEWCBK.cjs → chunk-DKSOW4ZW.cjs} +2 -2
  8. package/dist/{chunk-J2WRN55J.cjs → chunk-FL2HPQ66.cjs} +6 -6
  9. package/dist/chunk-H3AJ6I4R.js +147 -0
  10. package/dist/{chunk-MWIVL4NW.js → chunk-V3RZHI77.js} +17 -5
  11. package/dist/{chunk-7VGVDOZH.js → chunk-X44UO4CZ.js} +12 -12
  12. package/dist/{chunk-K425VRJJ.cjs → chunk-YII73IJ4.cjs} +15 -3
  13. package/dist/dom/index.cjs +3 -3
  14. package/dist/dom/index.js +4 -4
  15. package/dist/html/getVueText.cjs +14 -2
  16. package/dist/html/getVueText.d.cts +25 -10
  17. package/dist/html/getVueText.d.ts +25 -10
  18. package/dist/html/getVueText.js +15 -3
  19. package/dist/html/index.cjs +16 -4
  20. package/dist/html/index.d.cts +1 -1
  21. package/dist/html/index.d.ts +1 -1
  22. package/dist/html/index.js +18 -6
  23. package/dist/index-CYl0_lOi.d.cts +21 -0
  24. package/dist/index-CnZTBIkh.d.ts +21 -0
  25. package/dist/index.cjs +38 -38
  26. package/dist/index.d.cts +1 -1
  27. package/dist/index.d.ts +1 -1
  28. package/dist/index.js +41 -41
  29. package/dist/judge/index.cjs +7 -7
  30. package/dist/judge/index.js +13 -13
  31. package/dist/judge/matchs.cjs +3 -3
  32. package/dist/judge/matchs.js +2 -2
  33. package/package.json +1 -1
  34. package/dist/chunk-CDL6JMY2.js +0 -59
  35. package/dist/chunk-IWEOJ5C5.cjs +0 -59
  36. package/dist/index-BkWVGAdT.d.ts +0 -14
  37. package/dist/index-zghlonkx.d.cts +0 -14
  38. package/dist/{chunk-T2QKEABG.js → chunk-33X65PQS.js} +3 -3
  39. package/dist/{chunk-T22I7TJQ.cjs → chunk-3YUI42XN.cjs} +3 -3
  40. package/dist/{chunk-AS7KKPQT.js → chunk-CVOKF2FY.js} +3 -3
  41. package/dist/{chunk-SGWRUS75.cjs → chunk-HW7GNYRU.cjs} +3 -3
  42. package/dist/{chunk-GPFPHJRZ.js → chunk-Z3BZ5W5W.js} +3 -3
  43. package/dist/{chunk-PKFURLQT.cjs → chunk-ZUIHJQD6.cjs} +2 -2
@@ -1,7 +1,7 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-UWIEWCBK.cjs');
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-DKSOW4ZW.cjs');
2
2
 
3
3
 
4
- var _chunkSGWRUS75cjs = require('../chunk-SGWRUS75.cjs');
4
+ var _chunkHW7GNYRUcjs = require('../chunk-HW7GNYRU.cjs');
5
5
  require('../chunk-L7FSHU27.cjs');
6
6
  require('../chunk-BWXXXTFU.cjs');
7
7
  require('../chunk-K2XKKEE7.cjs');
@@ -37,14 +37,14 @@ require('../chunk-TCMJPIRM.cjs');
37
37
  require('../chunk-NDKOWDDX.cjs');
38
38
  require('../chunk-XSQOJWXL.cjs');
39
39
  require('../chunk-GD3OA7GU.cjs');
40
- require('../chunk-XW3XIK3D.cjs');
41
40
  require('../chunk-2H3KVSFA.cjs');
42
41
  require('../chunk-ILJLXJ5O.cjs');
43
42
  require('../chunk-OJBZ7UUC.cjs');
44
43
  require('../chunk-JR6ZN6QD.cjs');
44
+ require('../chunk-XW3XIK3D.cjs');
45
+ require('../chunk-PW7RP73J.cjs');
45
46
  require('../chunk-UEVMS6QD.cjs');
46
47
  require('../chunk-OQL4GIEJ.cjs');
47
- require('../chunk-PW7RP73J.cjs');
48
48
  require('../chunk-WWAPPA4E.cjs');
49
49
  require('../chunk-A5LHXE5X.cjs');
50
50
  require('../chunk-MIC3W2VY.cjs');
@@ -54,4 +54,4 @@ require('../chunk-75ZPJI57.cjs');
54
54
 
55
55
 
56
56
 
57
- exports.array = _chunk65O7KWP4cjs.array_exports; exports.object = _chunkYUKBGZQ4cjs.object_exports; exports.string = _chunkSGWRUS75cjs.string_exports;
57
+ exports.array = _chunk65O7KWP4cjs.array_exports; exports.object = _chunkYUKBGZQ4cjs.object_exports; exports.string = _chunkHW7GNYRUcjs.string_exports;
@@ -1,7 +1,7 @@
1
- import "../chunk-SANLZVGX.js";
1
+ import "../chunk-AFYMIG44.js";
2
2
  import {
3
3
  string_exports
4
- } from "../chunk-AS7KKPQT.js";
4
+ } from "../chunk-CVOKF2FY.js";
5
5
  import "../chunk-VKE5JARB.js";
6
6
  import "../chunk-U6V3V5KH.js";
7
7
  import "../chunk-TIZFQBWC.js";
@@ -37,14 +37,14 @@ import "../chunk-Q6FMBSK4.js";
37
37
  import "../chunk-WQ2PUZ2S.js";
38
38
  import "../chunk-DBSRZCFK.js";
39
39
  import "../chunk-ZVBCHJA5.js";
40
- import "../chunk-O34QAOO7.js";
41
40
  import "../chunk-USIMBBLW.js";
42
41
  import "../chunk-P7AWHISY.js";
43
42
  import "../chunk-LPMR5W6M.js";
44
43
  import "../chunk-DMZP4RPN.js";
44
+ import "../chunk-O34QAOO7.js";
45
+ import "../chunk-A276ZDLP.js";
45
46
  import "../chunk-4OBNLDTJ.js";
46
47
  import "../chunk-EWJJKQIO.js";
47
- import "../chunk-A276ZDLP.js";
48
48
  import "../chunk-BEKTNBRJ.js";
49
49
  import "../chunk-GYE23WAN.js";
50
50
  import "../chunk-MXY4W3K5.js";
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../../chunk-SGWRUS75.cjs');
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../../chunk-HW7GNYRU.cjs');
2
2
 
3
3
 
4
4
  var _chunkL7FSHU27cjs = require('../../chunk-L7FSHU27.cjs');
@@ -61,13 +61,13 @@ var _chunkOJBZ7UUCcjs = require('../../chunk-OJBZ7UUC.cjs');
61
61
  var _chunkJR6ZN6QDcjs = require('../../chunk-JR6ZN6QD.cjs');
62
62
 
63
63
 
64
- var _chunkUEVMS6QDcjs = require('../../chunk-UEVMS6QD.cjs');
64
+ var _chunkPW7RP73Jcjs = require('../../chunk-PW7RP73J.cjs');
65
65
 
66
66
 
67
- var _chunkOQL4GIEJcjs = require('../../chunk-OQL4GIEJ.cjs');
67
+ var _chunkUEVMS6QDcjs = require('../../chunk-UEVMS6QD.cjs');
68
68
 
69
69
 
70
- var _chunkPW7RP73Jcjs = require('../../chunk-PW7RP73J.cjs');
70
+ var _chunkOQL4GIEJcjs = require('../../chunk-OQL4GIEJ.cjs');
71
71
  require('../../chunk-75ZPJI57.cjs');
72
72
 
73
73
 
@@ -1,4 +1,4 @@
1
- import "../../chunk-AS7KKPQT.js";
1
+ import "../../chunk-CVOKF2FY.js";
2
2
  import {
3
3
  splitUpper
4
4
  } from "../../chunk-VKE5JARB.js";
@@ -59,15 +59,15 @@ import {
59
59
  import {
60
60
  appearNumSeat
61
61
  } from "../../chunk-DMZP4RPN.js";
62
+ import {
63
+ getStartSames
64
+ } from "../../chunk-A276ZDLP.js";
62
65
  import {
63
66
  firstLower
64
67
  } from "../../chunk-4OBNLDTJ.js";
65
68
  import {
66
69
  firstUpper
67
70
  } from "../../chunk-EWJJKQIO.js";
68
- import {
69
- getStartSames
70
- } from "../../chunk-A276ZDLP.js";
71
71
  import "../../chunk-MLKGABMK.js";
72
72
  export {
73
73
  appearNum,
@@ -0,0 +1,147 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});// packages/html/getVueText.ts
2
+ function getBlocks(content) {
3
+ const result = [];
4
+ function findMatchingEndTag(content2, startIndex, tagName) {
5
+ const endTag = `</${tagName}>`;
6
+ let i2 = startIndex;
7
+ let depth = 1;
8
+ while (i2 < content2.length) {
9
+ const nextOpen = content2.indexOf("<", i2);
10
+ if (nextOpen === -1) return -1;
11
+ if (content2[nextOpen + 1] === "/") {
12
+ if (content2.substring(nextOpen, nextOpen + endTag.length) === endTag) {
13
+ depth--;
14
+ if (depth === 0) {
15
+ return nextOpen;
16
+ }
17
+ i2 = nextOpen + endTag.length;
18
+ } else {
19
+ i2 = nextOpen + 1;
20
+ }
21
+ } else {
22
+ const nextTagMatch = content2.substring(nextOpen).match(/^<([a-zA-Z][a-zA-Z0-9\-]*)/);
23
+ if (nextTagMatch && nextTagMatch[1].toLowerCase() === tagName.toLowerCase()) {
24
+ depth++;
25
+ }
26
+ i2 = nextOpen + 1;
27
+ }
28
+ }
29
+ return -1;
30
+ }
31
+ let i = 0;
32
+ while (i < content.length) {
33
+ const openTagIndex = content.indexOf("<", i);
34
+ if (openTagIndex === -1) break;
35
+ if (content[openTagIndex + 1] === "/") {
36
+ i = openTagIndex + 1;
37
+ continue;
38
+ }
39
+ const tagMatch = content.substring(openTagIndex).match(/^<([a-zA-Z][a-zA-Z0-9\-]*)/);
40
+ if (!tagMatch) {
41
+ i = openTagIndex + 1;
42
+ continue;
43
+ }
44
+ const tagName = tagMatch[1].toLowerCase();
45
+ let startTagEnd = openTagIndex + tagMatch[0].length;
46
+ let inQuotes = false;
47
+ let quoteChar = "";
48
+ while (startTagEnd < content.length) {
49
+ const char = content[startTagEnd];
50
+ if (!inQuotes) {
51
+ if (char === ">") {
52
+ startTagEnd++;
53
+ break;
54
+ } else if (char === '"' || char === "'") {
55
+ inQuotes = true;
56
+ quoteChar = char;
57
+ }
58
+ } else {
59
+ if (char === quoteChar && content[startTagEnd - 1] !== "\\") {
60
+ inQuotes = false;
61
+ }
62
+ }
63
+ startTagEnd++;
64
+ }
65
+ if (startTagEnd >= content.length) {
66
+ i = openTagIndex + 1;
67
+ continue;
68
+ }
69
+ const endTagIndex = findMatchingEndTag(content, startTagEnd, tagName);
70
+ if (endTagIndex === -1) {
71
+ if (content.substring(startTagEnd - 2, startTagEnd) === "/>") {
72
+ const selfClosingBlock = content.substring(
73
+ openTagIndex,
74
+ startTagEnd
75
+ );
76
+ result.push({
77
+ type: tagName,
78
+ content: "",
79
+ block: selfClosingBlock
80
+ });
81
+ i = startTagEnd;
82
+ } else {
83
+ i = startTagEnd;
84
+ }
85
+ continue;
86
+ }
87
+ const endTagLength = `</${tagName}>`.length;
88
+ const tagContent = content.substring(startTagEnd, endTagIndex).trim();
89
+ const wholeBlock = content.substring(
90
+ openTagIndex,
91
+ endTagIndex + endTagLength
92
+ );
93
+ result.push({
94
+ type: tagName,
95
+ content: tagContent,
96
+ block: wholeBlock
97
+ });
98
+ i = endTagIndex + endTagLength;
99
+ }
100
+ return result;
101
+ }
102
+ function filterBlocksByType(blocks, type) {
103
+ return blocks.filter((block) => block.type === type);
104
+ }
105
+ function getBlocksContentByType(blocks, type) {
106
+ return blocks.filter((block) => block.type === type).map((block) => block.content);
107
+ }
108
+ function getFullBlocksByType(blocks, type) {
109
+ return blocks.filter((block) => block.type === type).map((block) => block.block);
110
+ }
111
+ function getVueComponents(content) {
112
+ const blocks = getBlocks(content);
113
+ return {
114
+ templates: filterBlocksByType(blocks, "template"),
115
+ scripts: filterBlocksByType(blocks, "script"),
116
+ styles: filterBlocksByType(blocks, "style"),
117
+ customBlocks: blocks.filter(
118
+ (block) => !["template", "script", "style"].includes(block.type)
119
+ )
120
+ };
121
+ }
122
+ function getVueTexts(content) {
123
+ const obj = getVueComponents(content);
124
+ return {
125
+ templates: obj.templates,
126
+ scripts: obj.scripts,
127
+ styles: obj.styles
128
+ };
129
+ }
130
+ function getVueText(content) {
131
+ const obj = getVueTexts(content);
132
+ return {
133
+ template: obj.templates.map((o) => o.content).join("\n"),
134
+ script: obj.scripts.map((o) => o.content).join("\n"),
135
+ style: obj.styles.map((o) => o.content).join("\n")
136
+ };
137
+ }
138
+
139
+
140
+
141
+
142
+
143
+
144
+
145
+
146
+
147
+ exports.getBlocks = getBlocks; exports.filterBlocksByType = filterBlocksByType; exports.getBlocksContentByType = getBlocksContentByType; exports.getFullBlocksByType = getFullBlocksByType; exports.getVueComponents = getVueComponents; exports.getVueTexts = getVueTexts; exports.getVueText = getVueText;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  string_exports
3
- } from "./chunk-AS7KKPQT.js";
3
+ } from "./chunk-CVOKF2FY.js";
4
4
  import {
5
5
  object_exports
6
6
  } from "./chunk-PRGC5MIZ.js";
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkSGWRUS75cjs = require('./chunk-SGWRUS75.cjs');
3
+ var _chunkHW7GNYRUcjs = require('./chunk-HW7GNYRU.cjs');
4
4
 
5
5
 
6
6
  var _chunkYUKBGZQ4cjs = require('./chunk-YUKBGZQ4.cjs');
@@ -16,7 +16,7 @@ var basic_exports = {};
16
16
  _chunk75ZPJI57cjs.__export.call(void 0, basic_exports, {
17
17
  array: () => _chunk65O7KWP4cjs.array_exports,
18
18
  object: () => _chunkYUKBGZQ4cjs.object_exports,
19
- string: () => _chunkSGWRUS75cjs.string_exports
19
+ string: () => _chunkHW7GNYRUcjs.string_exports
20
20
  });
21
21
 
22
22
 
@@ -1,15 +1,11 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkT22I7TJQcjs = require('./chunk-T22I7TJQ.cjs');
4
3
 
5
4
 
6
- var _chunkYGJOBIEOcjs = require('./chunk-YGJOBIEO.cjs');
7
5
 
8
6
 
9
- var _chunkZZEFL2TEcjs = require('./chunk-ZZEFL2TE.cjs');
10
7
 
11
8
 
12
- var _chunk2BY5RQHUcjs = require('./chunk-2BY5RQHU.cjs');
13
9
 
14
10
 
15
11
 
@@ -28,15 +24,19 @@ var _chunk2BY5RQHUcjs = require('./chunk-2BY5RQHU.cjs');
28
24
 
29
25
 
30
26
 
27
+ var _chunkV2DXOH6Bcjs = require('./chunk-V2DXOH6B.cjs');
31
28
 
32
29
 
30
+ var _chunk3YUI42XNcjs = require('./chunk-3YUI42XN.cjs');
33
31
 
34
32
 
33
+ var _chunk2BY5RQHUcjs = require('./chunk-2BY5RQHU.cjs');
35
34
 
36
35
 
36
+ var _chunkYGJOBIEOcjs = require('./chunk-YGJOBIEO.cjs');
37
37
 
38
38
 
39
- var _chunkV2DXOH6Bcjs = require('./chunk-V2DXOH6B.cjs');
39
+ var _chunkZZEFL2TEcjs = require('./chunk-ZZEFL2TE.cjs');
40
40
 
41
41
 
42
42
  var _chunk75ZPJI57cjs = require('./chunk-75ZPJI57.cjs');
@@ -69,7 +69,7 @@ _chunk75ZPJI57cjs.__export.call(void 0, judge_exports, {
69
69
  isTel: () => _chunkV2DXOH6Bcjs.isTel,
70
70
  isURL: () => _chunkV2DXOH6Bcjs.isURL,
71
71
  isWeChat: () => _chunkV2DXOH6Bcjs.isWeChat,
72
- matchs: () => _chunkT22I7TJQcjs.matchs,
72
+ matchs: () => _chunk3YUI42XNcjs.matchs,
73
73
  matchsEnd: () => _chunkYGJOBIEOcjs.matchsEnd,
74
74
  matchsStart: () => _chunkZZEFL2TEcjs.matchsStart,
75
75
  matchsWhole: () => _chunk2BY5RQHUcjs.matchsWhole
@@ -0,0 +1,147 @@
1
+ // packages/html/getVueText.ts
2
+ function getBlocks(content) {
3
+ const result = [];
4
+ function findMatchingEndTag(content2, startIndex, tagName) {
5
+ const endTag = `</${tagName}>`;
6
+ let i2 = startIndex;
7
+ let depth = 1;
8
+ while (i2 < content2.length) {
9
+ const nextOpen = content2.indexOf("<", i2);
10
+ if (nextOpen === -1) return -1;
11
+ if (content2[nextOpen + 1] === "/") {
12
+ if (content2.substring(nextOpen, nextOpen + endTag.length) === endTag) {
13
+ depth--;
14
+ if (depth === 0) {
15
+ return nextOpen;
16
+ }
17
+ i2 = nextOpen + endTag.length;
18
+ } else {
19
+ i2 = nextOpen + 1;
20
+ }
21
+ } else {
22
+ const nextTagMatch = content2.substring(nextOpen).match(/^<([a-zA-Z][a-zA-Z0-9\-]*)/);
23
+ if (nextTagMatch && nextTagMatch[1].toLowerCase() === tagName.toLowerCase()) {
24
+ depth++;
25
+ }
26
+ i2 = nextOpen + 1;
27
+ }
28
+ }
29
+ return -1;
30
+ }
31
+ let i = 0;
32
+ while (i < content.length) {
33
+ const openTagIndex = content.indexOf("<", i);
34
+ if (openTagIndex === -1) break;
35
+ if (content[openTagIndex + 1] === "/") {
36
+ i = openTagIndex + 1;
37
+ continue;
38
+ }
39
+ const tagMatch = content.substring(openTagIndex).match(/^<([a-zA-Z][a-zA-Z0-9\-]*)/);
40
+ if (!tagMatch) {
41
+ i = openTagIndex + 1;
42
+ continue;
43
+ }
44
+ const tagName = tagMatch[1].toLowerCase();
45
+ let startTagEnd = openTagIndex + tagMatch[0].length;
46
+ let inQuotes = false;
47
+ let quoteChar = "";
48
+ while (startTagEnd < content.length) {
49
+ const char = content[startTagEnd];
50
+ if (!inQuotes) {
51
+ if (char === ">") {
52
+ startTagEnd++;
53
+ break;
54
+ } else if (char === '"' || char === "'") {
55
+ inQuotes = true;
56
+ quoteChar = char;
57
+ }
58
+ } else {
59
+ if (char === quoteChar && content[startTagEnd - 1] !== "\\") {
60
+ inQuotes = false;
61
+ }
62
+ }
63
+ startTagEnd++;
64
+ }
65
+ if (startTagEnd >= content.length) {
66
+ i = openTagIndex + 1;
67
+ continue;
68
+ }
69
+ const endTagIndex = findMatchingEndTag(content, startTagEnd, tagName);
70
+ if (endTagIndex === -1) {
71
+ if (content.substring(startTagEnd - 2, startTagEnd) === "/>") {
72
+ const selfClosingBlock = content.substring(
73
+ openTagIndex,
74
+ startTagEnd
75
+ );
76
+ result.push({
77
+ type: tagName,
78
+ content: "",
79
+ block: selfClosingBlock
80
+ });
81
+ i = startTagEnd;
82
+ } else {
83
+ i = startTagEnd;
84
+ }
85
+ continue;
86
+ }
87
+ const endTagLength = `</${tagName}>`.length;
88
+ const tagContent = content.substring(startTagEnd, endTagIndex).trim();
89
+ const wholeBlock = content.substring(
90
+ openTagIndex,
91
+ endTagIndex + endTagLength
92
+ );
93
+ result.push({
94
+ type: tagName,
95
+ content: tagContent,
96
+ block: wholeBlock
97
+ });
98
+ i = endTagIndex + endTagLength;
99
+ }
100
+ return result;
101
+ }
102
+ function filterBlocksByType(blocks, type) {
103
+ return blocks.filter((block) => block.type === type);
104
+ }
105
+ function getBlocksContentByType(blocks, type) {
106
+ return blocks.filter((block) => block.type === type).map((block) => block.content);
107
+ }
108
+ function getFullBlocksByType(blocks, type) {
109
+ return blocks.filter((block) => block.type === type).map((block) => block.block);
110
+ }
111
+ function getVueComponents(content) {
112
+ const blocks = getBlocks(content);
113
+ return {
114
+ templates: filterBlocksByType(blocks, "template"),
115
+ scripts: filterBlocksByType(blocks, "script"),
116
+ styles: filterBlocksByType(blocks, "style"),
117
+ customBlocks: blocks.filter(
118
+ (block) => !["template", "script", "style"].includes(block.type)
119
+ )
120
+ };
121
+ }
122
+ function getVueTexts(content) {
123
+ const obj = getVueComponents(content);
124
+ return {
125
+ templates: obj.templates,
126
+ scripts: obj.scripts,
127
+ styles: obj.styles
128
+ };
129
+ }
130
+ function getVueText(content) {
131
+ const obj = getVueTexts(content);
132
+ return {
133
+ template: obj.templates.map((o) => o.content).join("\n"),
134
+ script: obj.scripts.map((o) => o.content).join("\n"),
135
+ style: obj.styles.map((o) => o.content).join("\n")
136
+ };
137
+ }
138
+
139
+ export {
140
+ getBlocks,
141
+ filterBlocksByType,
142
+ getBlocksContentByType,
143
+ getFullBlocksByType,
144
+ getVueComponents,
145
+ getVueTexts,
146
+ getVueText
147
+ };
@@ -1,3 +1,6 @@
1
+ import {
2
+ htmlEscape
3
+ } from "./chunk-NCSN3MC5.js";
1
4
  import {
2
5
  analysisHtml
3
6
  } from "./chunk-GIAO77MY.js";
@@ -5,11 +8,14 @@ import {
5
8
  generateHtmlh
6
9
  } from "./chunk-IV7XHH6K.js";
7
10
  import {
8
- getVueText
9
- } from "./chunk-CDL6JMY2.js";
10
- import {
11
- htmlEscape
12
- } from "./chunk-NCSN3MC5.js";
11
+ filterBlocksByType,
12
+ getBlocks,
13
+ getBlocksContentByType,
14
+ getFullBlocksByType,
15
+ getVueComponents,
16
+ getVueText,
17
+ getVueTexts
18
+ } from "./chunk-H3AJ6I4R.js";
13
19
  import {
14
20
  __export
15
21
  } from "./chunk-MLKGABMK.js";
@@ -18,8 +24,14 @@ import {
18
24
  var html_exports = {};
19
25
  __export(html_exports, {
20
26
  analysisHtml: () => analysisHtml,
27
+ filterBlocksByType: () => filterBlocksByType,
21
28
  generateHtmlh: () => generateHtmlh,
29
+ getBlocks: () => getBlocks,
30
+ getBlocksContentByType: () => getBlocksContentByType,
31
+ getFullBlocksByType: () => getFullBlocksByType,
32
+ getVueComponents: () => getVueComponents,
22
33
  getVueText: () => getVueText,
34
+ getVueTexts: () => getVueTexts,
23
35
  htmlEscape: () => htmlEscape
24
36
  });
25
37
 
@@ -1,15 +1,3 @@
1
- import {
2
- matchs
3
- } from "./chunk-T2QKEABG.js";
4
- import {
5
- matchsEnd
6
- } from "./chunk-YNOFNHEK.js";
7
- import {
8
- matchsStart
9
- } from "./chunk-S6JRKYPY.js";
10
- import {
11
- matchsWhole
12
- } from "./chunk-IRGCP7KH.js";
13
1
  import {
14
2
  isAlphaNumeric,
15
3
  isBankCode,
@@ -37,6 +25,18 @@ import {
37
25
  isURL,
38
26
  isWeChat
39
27
  } from "./chunk-PLNZCEDI.js";
28
+ import {
29
+ matchs
30
+ } from "./chunk-33X65PQS.js";
31
+ import {
32
+ matchsWhole
33
+ } from "./chunk-IRGCP7KH.js";
34
+ import {
35
+ matchsEnd
36
+ } from "./chunk-YNOFNHEK.js";
37
+ import {
38
+ matchsStart
39
+ } from "./chunk-S6JRKYPY.js";
40
40
  import {
41
41
  __export
42
42
  } from "./chunk-MLKGABMK.js";
@@ -1,15 +1,21 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
+ var _chunkEWXBN4VGcjs = require('./chunk-EWXBN4VG.cjs');
4
+
5
+
3
6
  var _chunkLEPZYF2Ncjs = require('./chunk-LEPZYF2N.cjs');
4
7
 
5
8
 
6
9
  var _chunkE2MM4MECcjs = require('./chunk-E2MM4MEC.cjs');
7
10
 
8
11
 
9
- var _chunkIWEOJ5C5cjs = require('./chunk-IWEOJ5C5.cjs');
10
12
 
11
13
 
12
- var _chunkEWXBN4VGcjs = require('./chunk-EWXBN4VG.cjs');
14
+
15
+
16
+
17
+
18
+ var _chunk4PHNHHMJcjs = require('./chunk-4PHNHHMJ.cjs');
13
19
 
14
20
 
15
21
  var _chunk75ZPJI57cjs = require('./chunk-75ZPJI57.cjs');
@@ -18,8 +24,14 @@ var _chunk75ZPJI57cjs = require('./chunk-75ZPJI57.cjs');
18
24
  var html_exports = {};
19
25
  _chunk75ZPJI57cjs.__export.call(void 0, html_exports, {
20
26
  analysisHtml: () => _chunkLEPZYF2Ncjs.analysisHtml,
27
+ filterBlocksByType: () => _chunk4PHNHHMJcjs.filterBlocksByType,
21
28
  generateHtmlh: () => _chunkE2MM4MECcjs.generateHtmlh,
22
- getVueText: () => _chunkIWEOJ5C5cjs.getVueText,
29
+ getBlocks: () => _chunk4PHNHHMJcjs.getBlocks,
30
+ getBlocksContentByType: () => _chunk4PHNHHMJcjs.getBlocksContentByType,
31
+ getFullBlocksByType: () => _chunk4PHNHHMJcjs.getFullBlocksByType,
32
+ getVueComponents: () => _chunk4PHNHHMJcjs.getVueComponents,
33
+ getVueText: () => _chunk4PHNHHMJcjs.getVueText,
34
+ getVueTexts: () => _chunk4PHNHHMJcjs.getVueTexts,
23
35
  htmlEscape: () => _chunkEWXBN4VGcjs.htmlEscape
24
36
  });
25
37
 
@@ -1,13 +1,13 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-PKFURLQT.cjs');
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-ZUIHJQD6.cjs');
2
2
 
3
3
 
4
+ var _chunk2OR4FUOAcjs = require('../chunk-2OR4FUOA.cjs');
4
5
 
5
6
 
6
7
 
7
- var _chunkEOJVE3HLcjs = require('../chunk-EOJVE3HL.cjs');
8
8
 
9
9
 
10
- var _chunk2OR4FUOAcjs = require('../chunk-2OR4FUOA.cjs');
10
+ var _chunkEOJVE3HLcjs = require('../chunk-EOJVE3HL.cjs');
11
11
  require('../chunk-75ZPJI57.cjs');
12
12
 
13
13
 
package/dist/dom/index.js CHANGED
@@ -1,13 +1,13 @@
1
- import "../chunk-GPFPHJRZ.js";
1
+ import "../chunk-Z3BZ5W5W.js";
2
+ import {
3
+ getLocus
4
+ } from "../chunk-Q63V2U5G.js";
2
5
  import {
3
6
  foundEvent,
4
7
  foundEventCallback,
5
8
  pressEvent,
6
9
  shiftEvent
7
10
  } from "../chunk-AFFLQCJL.js";
8
- import {
9
- getLocus
10
- } from "../chunk-Q63V2U5G.js";
11
11
  import "../chunk-MLKGABMK.js";
12
12
  export {
13
13
  foundEvent,
@@ -1,7 +1,19 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkIWEOJ5C5cjs = require('../chunk-IWEOJ5C5.cjs');
3
+
4
+
5
+
6
+
7
+
8
+
9
+ var _chunk4PHNHHMJcjs = require('../chunk-4PHNHHMJ.cjs');
4
10
  require('../chunk-75ZPJI57.cjs');
5
11
 
6
12
 
7
- exports.getVueText = _chunkIWEOJ5C5cjs.getVueText;
13
+
14
+
15
+
16
+
17
+
18
+
19
+ exports.filterBlocksByType = _chunk4PHNHHMJcjs.filterBlocksByType; exports.getBlocks = _chunk4PHNHHMJcjs.getBlocks; exports.getBlocksContentByType = _chunk4PHNHHMJcjs.getBlocksContentByType; exports.getFullBlocksByType = _chunk4PHNHHMJcjs.getFullBlocksByType; exports.getVueComponents = _chunk4PHNHHMJcjs.getVueComponents; exports.getVueText = _chunk4PHNHHMJcjs.getVueText; exports.getVueTexts = _chunk4PHNHHMJcjs.getVueTexts;
@@ -1,12 +1,27 @@
1
- interface VueFileParts {
2
- template: string;
3
- scripts: string[];
4
- styles: string[];
5
- customBlocks: {
6
- type: string;
7
- content: string;
8
- }[];
1
+ interface Block {
2
+ type: string;
3
+ content: string;
4
+ block: string;
9
5
  }
10
- declare function getVueText(content: string): VueFileParts;
6
+ declare function getBlocks(content: string): Block[];
7
+ declare function filterBlocksByType(blocks: Block[], type: string): Block[];
8
+ declare function getBlocksContentByType(blocks: Block[], type: string): string[];
9
+ declare function getFullBlocksByType(blocks: Block[], type: string): string[];
10
+ declare function getVueComponents(content: string): {
11
+ templates: Block[];
12
+ scripts: Block[];
13
+ styles: Block[];
14
+ customBlocks: Block[];
15
+ };
16
+ declare function getVueTexts(content: string): {
17
+ templates: Block[];
18
+ scripts: Block[];
19
+ styles: Block[];
20
+ };
21
+ declare function getVueText(content: string): {
22
+ template: string;
23
+ script: string;
24
+ style: string;
25
+ };
11
26
 
12
- export { getVueText };
27
+ export { type Block, filterBlocksByType, getBlocks, getBlocksContentByType, getFullBlocksByType, getVueComponents, getVueText, getVueTexts };