@fangzhongya/vue-components 0.1.9 → 0.1.12

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/dist/archive.cjs CHANGED
@@ -1,17 +1,261 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
2
2
 
3
- var _chunk7I5BHK3Rcjs = require('./chunk-7I5BHK3R.cjs');
3
+ var _chunk54PWFLZLcjs = require('./chunk-54PWFLZL.cjs');
4
4
 
5
5
 
6
- var _chunkVF7SYL7Qcjs = require('./chunk-VF7SYL7Q.cjs');
6
+ var _chunkUNBQUEQ4cjs = require('./chunk-UNBQUEQ4.cjs');
7
7
 
8
8
 
9
- var _chunkMRYLBEJRcjs = require('./chunk-MRYLBEJR.cjs');
10
- require('./chunk-ULH7QSGL.cjs');
9
+ var _chunkM6Y4OKJRcjs = require('./chunk-M6Y4OKJR.cjs');
10
+ require('./chunk-XMZBDIKY.cjs');
11
11
 
12
12
  // packages/archive.ts
13
13
  var _fs = require('fs');
14
14
  var _path = require('path');
15
+
16
+ // node_modules/.pnpm/@fangzhongya+utils@0.0.28/node_modules/@fangzhongya/utils/dist/chunk-5HC662VK.js
17
+ var TYPE_MARKERS = {
18
+ FUNCTION_REF: "_FR_",
19
+ CODE_BLOCK: "_CB_",
20
+ /**内置对象*/
21
+ SYMBOL: "_Sy_",
22
+ FUNCTION: "_F_",
23
+ UNDEFINED: "_UN_",
24
+ DATE: "_D_",
25
+ REGEXP: "_R_",
26
+ NAN: "_N_",
27
+ BIGINT: "_BI_",
28
+ MAP: "_M_",
29
+ SET: "_S_",
30
+ ARRAY_BUFFER: "_AB_",
31
+ TYPED_ARRAY: "_TA_",
32
+ DATA_VIEW: "_DV_",
33
+ ERROR: "_E_",
34
+ URL: "_U_",
35
+ INFINITY: "_I_",
36
+ NEGATIVE_INFINITY: "_NI_",
37
+ INT8_ARRAY: "_I8_",
38
+ UINT8_ARRAY: "_U8_",
39
+ UINT8_CLAMPED_ARRAY: "_U8C_",
40
+ INT16_ARRAY: "_I1_",
41
+ UINT16_ARRAY: "_U1_",
42
+ INT32_ARRAY: "_I3_",
43
+ UINT32_ARRAY: "_U3_",
44
+ FLOAT32_ARRAY: "_F3_",
45
+ FLOAT64_ARRAY: "_F6_",
46
+ BIGINT64_ARRAY: "_BI6_",
47
+ BIGUINT64_ARRAY: "_BU6_"
48
+ };
49
+ var arrayBufferUtils = {
50
+ // 将ArrayBuffer编码为Base64字符串
51
+ encode: (buffer) => {
52
+ if (typeof Buffer !== "undefined") {
53
+ const bytes = new Uint8Array(buffer);
54
+ let binary = "";
55
+ bytes.forEach((byte) => binary += String.fromCharCode(byte));
56
+ return btoa(binary);
57
+ }
58
+ if (typeof btoa === "function") {
59
+ const bytes = new Uint8Array(buffer);
60
+ let binary = "";
61
+ for (let i = 0; i < bytes.byteLength; i++) {
62
+ binary += String.fromCharCode(bytes[i]);
63
+ }
64
+ return btoa(binary);
65
+ }
66
+ throw new Error(
67
+ "ArrayBuffer encoding not supported in this environment"
68
+ );
69
+ },
70
+ // 将Base64字符串解码为ArrayBuffer
71
+ decode: (base64Str) => {
72
+ if (typeof Buffer !== "undefined") {
73
+ const binaryString = atob(base64Str);
74
+ const bytes = new Uint8Array(binaryString.length);
75
+ for (let i = 0; i < binaryString.length; i++) {
76
+ bytes[i] = binaryString.charCodeAt(i);
77
+ }
78
+ return bytes.buffer;
79
+ }
80
+ if (typeof atob === "function") {
81
+ const binaryString = atob(base64Str);
82
+ const bytes = new Uint8Array(binaryString.length);
83
+ for (let i = 0; i < binaryString.length; i++) {
84
+ bytes[i] = binaryString.charCodeAt(i);
85
+ }
86
+ return bytes.buffer;
87
+ }
88
+ throw new Error(
89
+ "ArrayBuffer decoding not supported in this environment"
90
+ );
91
+ },
92
+ // 获取ArrayBuffer的字节数组表示
93
+ toByteArray: (buffer) => {
94
+ return Array.from(new Uint8Array(buffer));
95
+ },
96
+ // 从字节数组创建ArrayBuffer
97
+ fromByteArray: (array) => {
98
+ const buffer = new ArrayBuffer(array.length);
99
+ const view = new Uint8Array(buffer);
100
+ array.forEach((value, index) => view[index] = value);
101
+ return buffer;
102
+ }
103
+ };
104
+ function toJSONSStringify(obj, space) {
105
+ const seen = /* @__PURE__ */ new WeakSet();
106
+ return JSON.stringify(
107
+ obj,
108
+ function(key, value) {
109
+ if (value === null) {
110
+ return null;
111
+ }
112
+ if (typeof value === "object") {
113
+ if (seen.has(value)) return "[Circular]";
114
+ seen.add(value);
115
+ }
116
+ if (this[key] instanceof Date) {
117
+ return {
118
+ [TYPE_MARKERS.DATE]: this[key].getTime()
119
+ };
120
+ }
121
+ if (this[key] instanceof URL) {
122
+ return {
123
+ [TYPE_MARKERS.URL]: this[key].href
124
+ };
125
+ }
126
+ if (value === Infinity) {
127
+ return { [TYPE_MARKERS.INFINITY]: 1 };
128
+ }
129
+ if (value === -Infinity) {
130
+ return { [TYPE_MARKERS.NEGATIVE_INFINITY]: 1 };
131
+ }
132
+ if (value === void 0) {
133
+ return { [TYPE_MARKERS.UNDEFINED]: 1 };
134
+ }
135
+ if (Object.is(value, NaN)) {
136
+ return { [TYPE_MARKERS.NAN]: 1 };
137
+ }
138
+ switch (typeof value) {
139
+ case "bigint":
140
+ return { [TYPE_MARKERS.BIGINT]: value.toString() };
141
+ case "symbol":
142
+ return {
143
+ [TYPE_MARKERS.SYMBOL]: {
144
+ k: _nullishCoalesce(Symbol.keyFor(value), () => ( 0)),
145
+ d: value.description || ""
146
+ }
147
+ };
148
+ case "function":
149
+ return {
150
+ [TYPE_MARKERS.FUNCTION]: value.toString()
151
+ };
152
+ case "object":
153
+ if (value instanceof RegExp) {
154
+ return {
155
+ [TYPE_MARKERS.REGEXP]: {
156
+ s: value.source,
157
+ f: value.flags
158
+ }
159
+ };
160
+ }
161
+ if (value instanceof Map) {
162
+ return {
163
+ [TYPE_MARKERS.MAP]: Array.from(value.entries())
164
+ };
165
+ }
166
+ if (value instanceof Set) {
167
+ return {
168
+ [TYPE_MARKERS.SET]: Array.from(value.values())
169
+ };
170
+ }
171
+ if (value instanceof ArrayBuffer) {
172
+ return {
173
+ [TYPE_MARKERS.ARRAY_BUFFER]: arrayBufferUtils.encode(value)
174
+ };
175
+ }
176
+ if (value instanceof Int8Array) {
177
+ return {
178
+ [TYPE_MARKERS.INT8_ARRAY]: arrayBufferUtils.toByteArray(value.buffer)
179
+ };
180
+ }
181
+ if (value instanceof Uint8Array) {
182
+ return {
183
+ [TYPE_MARKERS.UINT8_ARRAY]: arrayBufferUtils.toByteArray(value.buffer)
184
+ };
185
+ }
186
+ if (value instanceof Uint8ClampedArray) {
187
+ return {
188
+ [TYPE_MARKERS.UINT8_CLAMPED_ARRAY]: arrayBufferUtils.toByteArray(value.buffer)
189
+ };
190
+ }
191
+ if (value instanceof Int16Array) {
192
+ return {
193
+ [TYPE_MARKERS.INT16_ARRAY]: arrayBufferUtils.toByteArray(value.buffer)
194
+ };
195
+ }
196
+ if (value instanceof Uint16Array) {
197
+ return {
198
+ [TYPE_MARKERS.UINT16_ARRAY]: arrayBufferUtils.toByteArray(value.buffer)
199
+ };
200
+ }
201
+ if (value instanceof Int32Array) {
202
+ return {
203
+ [TYPE_MARKERS.INT32_ARRAY]: arrayBufferUtils.toByteArray(value.buffer)
204
+ };
205
+ }
206
+ if (value instanceof Uint32Array) {
207
+ return {
208
+ [TYPE_MARKERS.UINT32_ARRAY]: arrayBufferUtils.toByteArray(value.buffer)
209
+ };
210
+ }
211
+ if (value instanceof Float32Array) {
212
+ return {
213
+ [TYPE_MARKERS.FLOAT32_ARRAY]: arrayBufferUtils.toByteArray(value.buffer)
214
+ };
215
+ }
216
+ if (value instanceof Float64Array) {
217
+ return {
218
+ [TYPE_MARKERS.FLOAT64_ARRAY]: arrayBufferUtils.toByteArray(value.buffer)
219
+ };
220
+ }
221
+ if (value instanceof BigInt64Array) {
222
+ return {
223
+ [TYPE_MARKERS.BIGINT64_ARRAY]: arrayBufferUtils.toByteArray(value.buffer)
224
+ };
225
+ }
226
+ if (value instanceof BigUint64Array) {
227
+ return {
228
+ [TYPE_MARKERS.BIGUINT64_ARRAY]: arrayBufferUtils.toByteArray(value.buffer)
229
+ };
230
+ }
231
+ if (value instanceof DataView) {
232
+ return {
233
+ [TYPE_MARKERS.DATA_VIEW]: {
234
+ b: arrayBufferUtils.encode(
235
+ value.buffer
236
+ ),
237
+ o: value.byteOffset,
238
+ l: value.byteLength
239
+ }
240
+ };
241
+ }
242
+ if (value instanceof Error) {
243
+ return {
244
+ [TYPE_MARKERS.ERROR]: {
245
+ n: value.name,
246
+ m: value.message,
247
+ s: value.stack
248
+ }
249
+ };
250
+ }
251
+ }
252
+ return value;
253
+ },
254
+ space
255
+ );
256
+ }
257
+
258
+ // packages/archive.ts
15
259
  var archiveConfig = {
16
260
  /**
17
261
  * 自动导入的文件目录
@@ -46,7 +290,7 @@ function setJson(obj) {
46
290
  let url = _path.resolve.call(void 0, process.cwd(), obj.jsonName);
47
291
  _fs.writeFile.call(void 0,
48
292
  url,
49
- JSON.stringify(global._ComponentsResolverArchive_, null, 4),
293
+ toJSONSStringify(global._ComponentsResolverArchive_, 4),
50
294
  "utf-8",
51
295
  () => {
52
296
  }
@@ -55,8 +299,8 @@ function setJson(obj) {
55
299
  }
56
300
  }
57
301
  function ComponentsResolverArchive(config2 = {}) {
58
- const configs = _chunkMRYLBEJRcjs.unmergeObject.call(void 0, _chunkVF7SYL7Qcjs.config, archiveConfig, 2, true);
59
- const fangComp = new (0, _chunk7I5BHK3Rcjs.component_default)(_chunkMRYLBEJRcjs.unmergeObject.call(void 0, configs, config2, 1));
302
+ const configs = _chunkM6Y4OKJRcjs.unmergeObject.call(void 0, _chunkUNBQUEQ4cjs.config, archiveConfig, 2, true);
303
+ const fangComp = new (0, _chunk54PWFLZLcjs.component_default)(_chunkM6Y4OKJRcjs.unmergeObject.call(void 0, configs, config2, 1));
60
304
  setJson(fangComp.config);
61
305
  return [
62
306
  {
package/dist/archive.js CHANGED
@@ -1,17 +1,261 @@
1
1
  import {
2
2
  component_default
3
- } from "./chunk-MADSSI5H.js";
3
+ } from "./chunk-B2WZS7UJ.js";
4
4
  import {
5
5
  config
6
- } from "./chunk-ZQPRQ7JM.js";
6
+ } from "./chunk-DURXCSNX.js";
7
7
  import {
8
8
  unmergeObject
9
- } from "./chunk-ZTRD2TOY.js";
10
- import "./chunk-2KIAPSQV.js";
9
+ } from "./chunk-ZRYXYGML.js";
10
+ import "./chunk-BDZPEKUD.js";
11
11
 
12
12
  // packages/archive.ts
13
13
  import { writeFile } from "fs";
14
14
  import { resolve } from "path";
15
+
16
+ // node_modules/.pnpm/@fangzhongya+utils@0.0.28/node_modules/@fangzhongya/utils/dist/chunk-5HC662VK.js
17
+ var TYPE_MARKERS = {
18
+ FUNCTION_REF: "_FR_",
19
+ CODE_BLOCK: "_CB_",
20
+ /**内置对象*/
21
+ SYMBOL: "_Sy_",
22
+ FUNCTION: "_F_",
23
+ UNDEFINED: "_UN_",
24
+ DATE: "_D_",
25
+ REGEXP: "_R_",
26
+ NAN: "_N_",
27
+ BIGINT: "_BI_",
28
+ MAP: "_M_",
29
+ SET: "_S_",
30
+ ARRAY_BUFFER: "_AB_",
31
+ TYPED_ARRAY: "_TA_",
32
+ DATA_VIEW: "_DV_",
33
+ ERROR: "_E_",
34
+ URL: "_U_",
35
+ INFINITY: "_I_",
36
+ NEGATIVE_INFINITY: "_NI_",
37
+ INT8_ARRAY: "_I8_",
38
+ UINT8_ARRAY: "_U8_",
39
+ UINT8_CLAMPED_ARRAY: "_U8C_",
40
+ INT16_ARRAY: "_I1_",
41
+ UINT16_ARRAY: "_U1_",
42
+ INT32_ARRAY: "_I3_",
43
+ UINT32_ARRAY: "_U3_",
44
+ FLOAT32_ARRAY: "_F3_",
45
+ FLOAT64_ARRAY: "_F6_",
46
+ BIGINT64_ARRAY: "_BI6_",
47
+ BIGUINT64_ARRAY: "_BU6_"
48
+ };
49
+ var arrayBufferUtils = {
50
+ // 将ArrayBuffer编码为Base64字符串
51
+ encode: (buffer) => {
52
+ if (typeof Buffer !== "undefined") {
53
+ const bytes = new Uint8Array(buffer);
54
+ let binary = "";
55
+ bytes.forEach((byte) => binary += String.fromCharCode(byte));
56
+ return btoa(binary);
57
+ }
58
+ if (typeof btoa === "function") {
59
+ const bytes = new Uint8Array(buffer);
60
+ let binary = "";
61
+ for (let i = 0; i < bytes.byteLength; i++) {
62
+ binary += String.fromCharCode(bytes[i]);
63
+ }
64
+ return btoa(binary);
65
+ }
66
+ throw new Error(
67
+ "ArrayBuffer encoding not supported in this environment"
68
+ );
69
+ },
70
+ // 将Base64字符串解码为ArrayBuffer
71
+ decode: (base64Str) => {
72
+ if (typeof Buffer !== "undefined") {
73
+ const binaryString = atob(base64Str);
74
+ const bytes = new Uint8Array(binaryString.length);
75
+ for (let i = 0; i < binaryString.length; i++) {
76
+ bytes[i] = binaryString.charCodeAt(i);
77
+ }
78
+ return bytes.buffer;
79
+ }
80
+ if (typeof atob === "function") {
81
+ const binaryString = atob(base64Str);
82
+ const bytes = new Uint8Array(binaryString.length);
83
+ for (let i = 0; i < binaryString.length; i++) {
84
+ bytes[i] = binaryString.charCodeAt(i);
85
+ }
86
+ return bytes.buffer;
87
+ }
88
+ throw new Error(
89
+ "ArrayBuffer decoding not supported in this environment"
90
+ );
91
+ },
92
+ // 获取ArrayBuffer的字节数组表示
93
+ toByteArray: (buffer) => {
94
+ return Array.from(new Uint8Array(buffer));
95
+ },
96
+ // 从字节数组创建ArrayBuffer
97
+ fromByteArray: (array) => {
98
+ const buffer = new ArrayBuffer(array.length);
99
+ const view = new Uint8Array(buffer);
100
+ array.forEach((value, index) => view[index] = value);
101
+ return buffer;
102
+ }
103
+ };
104
+ function toJSONSStringify(obj, space) {
105
+ const seen = /* @__PURE__ */ new WeakSet();
106
+ return JSON.stringify(
107
+ obj,
108
+ function(key, value) {
109
+ if (value === null) {
110
+ return null;
111
+ }
112
+ if (typeof value === "object") {
113
+ if (seen.has(value)) return "[Circular]";
114
+ seen.add(value);
115
+ }
116
+ if (this[key] instanceof Date) {
117
+ return {
118
+ [TYPE_MARKERS.DATE]: this[key].getTime()
119
+ };
120
+ }
121
+ if (this[key] instanceof URL) {
122
+ return {
123
+ [TYPE_MARKERS.URL]: this[key].href
124
+ };
125
+ }
126
+ if (value === Infinity) {
127
+ return { [TYPE_MARKERS.INFINITY]: 1 };
128
+ }
129
+ if (value === -Infinity) {
130
+ return { [TYPE_MARKERS.NEGATIVE_INFINITY]: 1 };
131
+ }
132
+ if (value === void 0) {
133
+ return { [TYPE_MARKERS.UNDEFINED]: 1 };
134
+ }
135
+ if (Object.is(value, NaN)) {
136
+ return { [TYPE_MARKERS.NAN]: 1 };
137
+ }
138
+ switch (typeof value) {
139
+ case "bigint":
140
+ return { [TYPE_MARKERS.BIGINT]: value.toString() };
141
+ case "symbol":
142
+ return {
143
+ [TYPE_MARKERS.SYMBOL]: {
144
+ k: Symbol.keyFor(value) ?? 0,
145
+ d: value.description || ""
146
+ }
147
+ };
148
+ case "function":
149
+ return {
150
+ [TYPE_MARKERS.FUNCTION]: value.toString()
151
+ };
152
+ case "object":
153
+ if (value instanceof RegExp) {
154
+ return {
155
+ [TYPE_MARKERS.REGEXP]: {
156
+ s: value.source,
157
+ f: value.flags
158
+ }
159
+ };
160
+ }
161
+ if (value instanceof Map) {
162
+ return {
163
+ [TYPE_MARKERS.MAP]: Array.from(value.entries())
164
+ };
165
+ }
166
+ if (value instanceof Set) {
167
+ return {
168
+ [TYPE_MARKERS.SET]: Array.from(value.values())
169
+ };
170
+ }
171
+ if (value instanceof ArrayBuffer) {
172
+ return {
173
+ [TYPE_MARKERS.ARRAY_BUFFER]: arrayBufferUtils.encode(value)
174
+ };
175
+ }
176
+ if (value instanceof Int8Array) {
177
+ return {
178
+ [TYPE_MARKERS.INT8_ARRAY]: arrayBufferUtils.toByteArray(value.buffer)
179
+ };
180
+ }
181
+ if (value instanceof Uint8Array) {
182
+ return {
183
+ [TYPE_MARKERS.UINT8_ARRAY]: arrayBufferUtils.toByteArray(value.buffer)
184
+ };
185
+ }
186
+ if (value instanceof Uint8ClampedArray) {
187
+ return {
188
+ [TYPE_MARKERS.UINT8_CLAMPED_ARRAY]: arrayBufferUtils.toByteArray(value.buffer)
189
+ };
190
+ }
191
+ if (value instanceof Int16Array) {
192
+ return {
193
+ [TYPE_MARKERS.INT16_ARRAY]: arrayBufferUtils.toByteArray(value.buffer)
194
+ };
195
+ }
196
+ if (value instanceof Uint16Array) {
197
+ return {
198
+ [TYPE_MARKERS.UINT16_ARRAY]: arrayBufferUtils.toByteArray(value.buffer)
199
+ };
200
+ }
201
+ if (value instanceof Int32Array) {
202
+ return {
203
+ [TYPE_MARKERS.INT32_ARRAY]: arrayBufferUtils.toByteArray(value.buffer)
204
+ };
205
+ }
206
+ if (value instanceof Uint32Array) {
207
+ return {
208
+ [TYPE_MARKERS.UINT32_ARRAY]: arrayBufferUtils.toByteArray(value.buffer)
209
+ };
210
+ }
211
+ if (value instanceof Float32Array) {
212
+ return {
213
+ [TYPE_MARKERS.FLOAT32_ARRAY]: arrayBufferUtils.toByteArray(value.buffer)
214
+ };
215
+ }
216
+ if (value instanceof Float64Array) {
217
+ return {
218
+ [TYPE_MARKERS.FLOAT64_ARRAY]: arrayBufferUtils.toByteArray(value.buffer)
219
+ };
220
+ }
221
+ if (value instanceof BigInt64Array) {
222
+ return {
223
+ [TYPE_MARKERS.BIGINT64_ARRAY]: arrayBufferUtils.toByteArray(value.buffer)
224
+ };
225
+ }
226
+ if (value instanceof BigUint64Array) {
227
+ return {
228
+ [TYPE_MARKERS.BIGUINT64_ARRAY]: arrayBufferUtils.toByteArray(value.buffer)
229
+ };
230
+ }
231
+ if (value instanceof DataView) {
232
+ return {
233
+ [TYPE_MARKERS.DATA_VIEW]: {
234
+ b: arrayBufferUtils.encode(
235
+ value.buffer
236
+ ),
237
+ o: value.byteOffset,
238
+ l: value.byteLength
239
+ }
240
+ };
241
+ }
242
+ if (value instanceof Error) {
243
+ return {
244
+ [TYPE_MARKERS.ERROR]: {
245
+ n: value.name,
246
+ m: value.message,
247
+ s: value.stack
248
+ }
249
+ };
250
+ }
251
+ }
252
+ return value;
253
+ },
254
+ space
255
+ );
256
+ }
257
+
258
+ // packages/archive.ts
15
259
  var archiveConfig = {
16
260
  /**
17
261
  * 自动导入的文件目录
@@ -46,7 +290,7 @@ function setJson(obj) {
46
290
  let url = resolve(process.cwd(), obj.jsonName);
47
291
  writeFile(
48
292
  url,
49
- JSON.stringify(global._ComponentsResolverArchive_, null, 4),
293
+ toJSONSStringify(global._ComponentsResolverArchive_, 4),
50
294
  "utf-8",
51
295
  () => {
52
296
  }