@coherent.js/devtools 1.0.0-beta.2

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.
@@ -0,0 +1,397 @@
1
+ // src/inspector.js
2
+ var ComponentInspector = class {
3
+ constructor(options = {}) {
4
+ this.options = {
5
+ trackHistory: true,
6
+ maxHistory: 100,
7
+ verbose: false,
8
+ ...options
9
+ };
10
+ this.components = /* @__PURE__ */ new Map();
11
+ this.history = [];
12
+ this.inspectionCount = 0;
13
+ }
14
+ /**
15
+ * Inspect a component
16
+ *
17
+ * @param {Object} component - Component to inspect
18
+ * @param {Object} [metadata] - Additional metadata
19
+ * @returns {Object} Inspection result
20
+ */
21
+ inspect(component, metadata = {}) {
22
+ this.inspectionCount++;
23
+ const startTime = performance.now();
24
+ const analysis = this.analyzeComponent(component);
25
+ const tree = this.buildComponentTree(component);
26
+ const stats = this.calculateStats(component);
27
+ const endTime = performance.now();
28
+ const inspection = {
29
+ id: this.generateId(),
30
+ timestamp: Date.now(),
31
+ inspectionTime: endTime - startTime,
32
+ component,
33
+ metadata,
34
+ // Flatten analysis results to top level for easier access
35
+ type: analysis.type,
36
+ structure: component,
37
+ props: this.extractProps(component),
38
+ depth: stats.depth || 0,
39
+ // Use stats.depth, not tree.depth
40
+ childCount: stats.elementCount || 0,
41
+ complexity: stats.complexity || 0,
42
+ nodeCount: stats.nodeCount || 0,
43
+ // Keep nested data for detailed inspection
44
+ analysis,
45
+ tree,
46
+ stats,
47
+ valid: analysis.valid,
48
+ issues: analysis.issues || [],
49
+ errors: analysis.issues || [],
50
+ // Alias for compatibility
51
+ warnings: analysis.warnings || []
52
+ };
53
+ if (this.options.trackHistory) {
54
+ this.history.push(inspection);
55
+ if (this.history.length > this.options.maxHistory) {
56
+ this.history.shift();
57
+ }
58
+ }
59
+ this.components.set(inspection.id, inspection);
60
+ if (this.options.verbose) {
61
+ console.log("[Inspector] Component inspected:", inspection.id);
62
+ }
63
+ return inspection;
64
+ }
65
+ /**
66
+ * Extract props from component
67
+ */
68
+ extractProps(component) {
69
+ const props = [];
70
+ if (!component || typeof component !== "object") {
71
+ return props;
72
+ }
73
+ Object.keys(component).forEach((key) => {
74
+ const element = component[key];
75
+ if (element && typeof element === "object") {
76
+ Object.keys(element).forEach((prop) => {
77
+ if (!props.includes(prop) && prop !== "children" && prop !== "text") {
78
+ props.push(prop);
79
+ }
80
+ });
81
+ }
82
+ });
83
+ return props;
84
+ }
85
+ /**
86
+ * Analyze component structure
87
+ */
88
+ analyzeComponent(component) {
89
+ if (!component || typeof component !== "object") {
90
+ return {
91
+ type: typeof component,
92
+ valid: false,
93
+ issues: ["Component is not an object"]
94
+ };
95
+ }
96
+ const issues = [];
97
+ const warnings = [];
98
+ const info = [];
99
+ const seen = /* @__PURE__ */ new WeakSet();
100
+ const checkCircular = (obj, path = []) => {
101
+ if (obj === null || typeof obj !== "object") {
102
+ return;
103
+ }
104
+ if (seen.has(obj)) {
105
+ warnings.push(`circular reference detected at ${path.join(".")}`);
106
+ return;
107
+ }
108
+ seen.add(obj);
109
+ if (Array.isArray(obj)) {
110
+ obj.forEach((item, index) => checkCircular(item, [...path, `[${index}]`]));
111
+ } else {
112
+ Object.keys(obj).forEach((key) => {
113
+ checkCircular(obj[key], [...path, key]);
114
+ });
115
+ }
116
+ };
117
+ checkCircular(component, ["root"]);
118
+ const keys = Object.keys(component);
119
+ if (keys.length === 0) {
120
+ issues.push("Component is empty");
121
+ }
122
+ if (keys.length > 1) {
123
+ warnings.push("Component has multiple root elements");
124
+ }
125
+ keys.forEach((key) => {
126
+ const element = component[key];
127
+ if (typeof element === "object" && element !== null) {
128
+ if (element.children && !Array.isArray(element.children)) {
129
+ issues.push(`Children of ${key} should be an array`);
130
+ }
131
+ if (element.className && typeof element.className !== "string") {
132
+ warnings.push(`className of ${key} should be a string`);
133
+ }
134
+ if (element.style && typeof element.style !== "object") {
135
+ warnings.push(`style of ${key} should be an object`);
136
+ }
137
+ const eventHandlers = Object.keys(element).filter((k) => k.startsWith("on"));
138
+ if (eventHandlers.length > 0) {
139
+ info.push(`${key} has ${eventHandlers.length} event handler(s): ${eventHandlers.join(", ")}`);
140
+ }
141
+ }
142
+ });
143
+ return {
144
+ type: "component",
145
+ valid: issues.length === 0,
146
+ rootElements: keys,
147
+ issues,
148
+ warnings,
149
+ info
150
+ };
151
+ }
152
+ /**
153
+ * Build component tree structure
154
+ */
155
+ buildComponentTree(component, depth = 0, maxDepth = 10) {
156
+ if (depth > maxDepth) {
157
+ return { _truncated: true, reason: "Max depth reached" };
158
+ }
159
+ if (!component || typeof component !== "object") {
160
+ return { type: typeof component, value: component };
161
+ }
162
+ if (Array.isArray(component)) {
163
+ return component.map((child) => this.buildComponentTree(child, depth + 1, maxDepth));
164
+ }
165
+ const tree = {};
166
+ for (const [key, value] of Object.entries(component)) {
167
+ if (typeof value === "object" && value !== null) {
168
+ tree[key] = {
169
+ type: "element",
170
+ props: {},
171
+ children: []
172
+ };
173
+ for (const [prop, propValue] of Object.entries(value)) {
174
+ if (prop === "children") {
175
+ tree[key].children = this.buildComponentTree(propValue, depth + 1, maxDepth);
176
+ } else {
177
+ tree[key].props[prop] = propValue;
178
+ }
179
+ }
180
+ } else {
181
+ tree[key] = { type: typeof value, value };
182
+ }
183
+ }
184
+ return tree;
185
+ }
186
+ /**
187
+ * Calculate component statistics
188
+ */
189
+ calculateStats(component) {
190
+ const stats = {
191
+ elementCount: 0,
192
+ depth: 0,
193
+ textNodes: 0,
194
+ eventHandlers: 0,
195
+ hasStyles: false,
196
+ hasClasses: false,
197
+ complexity: 0
198
+ };
199
+ const traverse = (node, currentDepth = 1) => {
200
+ if (!node || typeof node !== "object") {
201
+ if (node !== null && node !== void 0) {
202
+ stats.textNodes++;
203
+ }
204
+ return;
205
+ }
206
+ if (Array.isArray(node)) {
207
+ node.forEach((child) => traverse(child, currentDepth));
208
+ return;
209
+ }
210
+ stats.elementCount++;
211
+ stats.depth = Math.max(stats.depth, currentDepth);
212
+ for (const [_key, value] of Object.entries(node)) {
213
+ if (typeof value === "object" && value !== null) {
214
+ if (value.style) stats.hasStyles = true;
215
+ if (value.className) stats.hasClasses = true;
216
+ const handlers = Object.keys(value).filter((k) => k.startsWith("on"));
217
+ stats.eventHandlers += handlers.length;
218
+ if (value.children) {
219
+ traverse(value.children, currentDepth + 1);
220
+ }
221
+ }
222
+ }
223
+ };
224
+ traverse(component);
225
+ stats.complexity = stats.elementCount * 10 + // Base complexity from element count
226
+ stats.depth * 5 + // Depth adds complexity
227
+ stats.eventHandlers * 3 + // Event handlers add complexity
228
+ stats.textNodes + // Text nodes add minimal complexity
229
+ (stats.hasStyles ? 5 : 0) + // Styles add complexity
230
+ (stats.hasClasses ? 3 : 0);
231
+ return stats;
232
+ }
233
+ /**
234
+ * Get component by ID
235
+ */
236
+ getComponent(id) {
237
+ return this.components.get(id);
238
+ }
239
+ /**
240
+ * Get inspection history
241
+ */
242
+ getHistory() {
243
+ return [...this.history];
244
+ }
245
+ /**
246
+ * Search components by criteria
247
+ */
248
+ search(criteria) {
249
+ const results = [];
250
+ for (const [id, inspection] of this.components.entries()) {
251
+ let matches = true;
252
+ if (criteria.hasIssues && inspection.analysis.issues.length === 0) {
253
+ matches = false;
254
+ }
255
+ if (criteria.hasWarnings && inspection.analysis.warnings.length === 0) {
256
+ matches = false;
257
+ }
258
+ if (criteria.minElements && inspection.stats.elementCount < criteria.minElements) {
259
+ matches = false;
260
+ }
261
+ if (criteria.maxElements && inspection.stats.elementCount > criteria.maxElements) {
262
+ matches = false;
263
+ }
264
+ if (matches) {
265
+ results.push({ id, inspection });
266
+ }
267
+ }
268
+ return results;
269
+ }
270
+ /**
271
+ * Compare two components
272
+ */
273
+ compare(componentA, componentB) {
274
+ const inspectionA = typeof componentA === "string" ? this.getComponent(componentA) : this.inspect(componentA);
275
+ const inspectionB = typeof componentB === "string" ? this.getComponent(componentB) : this.inspect(componentB);
276
+ return {
277
+ statsComparison: {
278
+ elementCount: {
279
+ a: inspectionA.stats.elementCount,
280
+ b: inspectionB.stats.elementCount,
281
+ diff: inspectionB.stats.elementCount - inspectionA.stats.elementCount
282
+ },
283
+ depth: {
284
+ a: inspectionA.stats.depth,
285
+ b: inspectionB.stats.depth,
286
+ diff: inspectionB.stats.depth - inspectionA.stats.depth
287
+ },
288
+ textNodes: {
289
+ a: inspectionA.stats.textNodes,
290
+ b: inspectionB.stats.textNodes,
291
+ diff: inspectionB.stats.textNodes - inspectionA.stats.textNodes
292
+ }
293
+ },
294
+ structureMatch: JSON.stringify(inspectionA.tree) === JSON.stringify(inspectionB.tree),
295
+ issuesComparison: {
296
+ a: inspectionA.analysis.issues.length,
297
+ b: inspectionB.analysis.issues.length
298
+ }
299
+ };
300
+ }
301
+ /**
302
+ * Generate report
303
+ */
304
+ generateReport() {
305
+ return {
306
+ totalInspections: this.inspectionCount,
307
+ componentsTracked: this.components.size,
308
+ historySize: this.history.length,
309
+ summary: {
310
+ totalElements: Array.from(this.components.values()).reduce((sum, c) => sum + c.stats.elementCount, 0),
311
+ averageDepth: Array.from(this.components.values()).reduce((sum, c) => sum + c.stats.depth, 0) / this.components.size || 0,
312
+ componentsWithIssues: Array.from(this.components.values()).filter((c) => c.analysis.issues.length > 0).length,
313
+ componentsWithWarnings: Array.from(this.components.values()).filter((c) => c.analysis.warnings.length > 0).length
314
+ }
315
+ };
316
+ }
317
+ /**
318
+ * Clear all data
319
+ */
320
+ clear() {
321
+ this.components.clear();
322
+ this.history = [];
323
+ this.inspectionCount = 0;
324
+ }
325
+ /**
326
+ * Clear history only
327
+ */
328
+ clearHistory() {
329
+ this.history = [];
330
+ }
331
+ /**
332
+ * Get inspection statistics
333
+ */
334
+ getStats() {
335
+ return {
336
+ totalInspections: this.inspectionCount,
337
+ componentsTracked: this.components.size,
338
+ historySize: this.history.length
339
+ };
340
+ }
341
+ /**
342
+ * Export inspection data
343
+ */
344
+ export() {
345
+ return {
346
+ inspections: this.history.map((h) => ({
347
+ id: h.id,
348
+ timestamp: h.timestamp,
349
+ type: h.type,
350
+ complexity: h.complexity,
351
+ depth: h.depth,
352
+ issues: h.issues,
353
+ warnings: h.warnings
354
+ })),
355
+ stats: this.getStats(),
356
+ exportedAt: Date.now()
357
+ };
358
+ }
359
+ /**
360
+ * Generate unique ID
361
+ */
362
+ generateId() {
363
+ return `inspect-${Date.now()}-${Math.random().toString(36).substring(7)}`;
364
+ }
365
+ };
366
+ function createInspector(options = {}) {
367
+ return new ComponentInspector(options);
368
+ }
369
+ function inspect(component, options = {}) {
370
+ const inspector = new ComponentInspector(options);
371
+ return inspector.inspect(component);
372
+ }
373
+ function validateComponent(component) {
374
+ const inspector = new ComponentInspector();
375
+ const inspection = inspector.inspect(component);
376
+ return {
377
+ valid: inspection.valid,
378
+ errors: inspection.issues || [],
379
+ issues: inspection.issues || [],
380
+ warnings: inspection.warnings || [],
381
+ stats: inspection.stats
382
+ };
383
+ }
384
+ var inspector_default = {
385
+ ComponentInspector,
386
+ createInspector,
387
+ inspect,
388
+ validateComponent
389
+ };
390
+ export {
391
+ ComponentInspector,
392
+ createInspector,
393
+ inspector_default as default,
394
+ inspect,
395
+ validateComponent
396
+ };
397
+ //# sourceMappingURL=inspector.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/inspector.js"],
4
+ "sourcesContent": ["/**\n * Coherent.js Component Inspector\n * \n * Provides tools for inspecting component structure, props, and state\n * \n * @module devtools/inspector\n */\n\n/**\n * Component Inspector\n * Analyzes and provides insights into component structure\n */\nexport class ComponentInspector {\n constructor(options = {}) {\n this.options = {\n trackHistory: true,\n maxHistory: 100,\n verbose: false,\n ...options\n };\n \n this.components = new Map();\n this.history = [];\n this.inspectionCount = 0;\n }\n\n /**\n * Inspect a component\n * \n * @param {Object} component - Component to inspect\n * @param {Object} [metadata] - Additional metadata\n * @returns {Object} Inspection result\n */\n inspect(component, metadata = {}) {\n this.inspectionCount++;\n \n const startTime = performance.now();\n const analysis = this.analyzeComponent(component);\n const tree = this.buildComponentTree(component);\n const stats = this.calculateStats(component);\n const endTime = performance.now();\n \n const inspection = {\n id: this.generateId(),\n timestamp: Date.now(),\n inspectionTime: endTime - startTime,\n component,\n metadata,\n // Flatten analysis results to top level for easier access\n type: analysis.type,\n structure: component,\n props: this.extractProps(component),\n depth: stats.depth || 0, // Use stats.depth, not tree.depth\n childCount: stats.elementCount || 0,\n complexity: stats.complexity || 0,\n nodeCount: stats.nodeCount || 0,\n // Keep nested data for detailed inspection\n analysis,\n tree,\n stats,\n valid: analysis.valid,\n issues: analysis.issues || [],\n errors: analysis.issues || [], // Alias for compatibility\n warnings: analysis.warnings || []\n };\n\n // Track in history\n if (this.options.trackHistory) {\n this.history.push(inspection);\n \n // Limit history size\n if (this.history.length > this.options.maxHistory) {\n this.history.shift();\n }\n }\n\n // Store component\n this.components.set(inspection.id, inspection);\n\n if (this.options.verbose) {\n console.log('[Inspector] Component inspected:', inspection.id);\n }\n\n return inspection;\n }\n\n /**\n * Extract props from component\n */\n extractProps(component) {\n const props = [];\n \n if (!component || typeof component !== 'object') {\n return props;\n }\n \n Object.keys(component).forEach(key => {\n const element = component[key];\n if (element && typeof element === 'object') {\n Object.keys(element).forEach(prop => {\n if (!props.includes(prop) && prop !== 'children' && prop !== 'text') {\n props.push(prop);\n }\n });\n }\n });\n \n return props;\n }\n\n /**\n * Analyze component structure\n */\n analyzeComponent(component) {\n if (!component || typeof component !== 'object') {\n return {\n type: typeof component,\n valid: false,\n issues: ['Component is not an object']\n };\n }\n\n const issues = [];\n const warnings = [];\n const info = [];\n const seen = new WeakSet();\n\n // Check for circular references\n const checkCircular = (obj, path = []) => {\n if (obj === null || typeof obj !== 'object') {\n return;\n }\n\n if (seen.has(obj)) {\n warnings.push(`circular reference detected at ${path.join('.')}`);\n return;\n }\n\n seen.add(obj);\n\n if (Array.isArray(obj)) {\n obj.forEach((item, index) => checkCircular(item, [...path, `[${index}]`]));\n } else {\n Object.keys(obj).forEach(key => {\n checkCircular(obj[key], [...path, key]);\n });\n }\n };\n\n checkCircular(component, ['root']);\n\n // Check component structure\n const keys = Object.keys(component);\n \n if (keys.length === 0) {\n issues.push('Component is empty');\n }\n\n if (keys.length > 1) {\n warnings.push('Component has multiple root elements');\n }\n\n // Analyze each element\n keys.forEach(key => {\n const element = component[key];\n \n if (typeof element === 'object' && element !== null) {\n // Check for common issues\n if (element.children && !Array.isArray(element.children)) {\n issues.push(`Children of ${key} should be an array`);\n }\n\n if (element.className && typeof element.className !== 'string') {\n warnings.push(`className of ${key} should be a string`);\n }\n\n if (element.style && typeof element.style !== 'object') {\n warnings.push(`style of ${key} should be an object`);\n }\n\n // Check for event handlers\n const eventHandlers = Object.keys(element).filter(k => k.startsWith('on'));\n if (eventHandlers.length > 0) {\n info.push(`${key} has ${eventHandlers.length} event handler(s): ${eventHandlers.join(', ')}`);\n }\n }\n });\n\n return {\n type: 'component',\n valid: issues.length === 0,\n rootElements: keys,\n issues,\n warnings,\n info\n };\n }\n\n /**\n * Build component tree structure\n */\n buildComponentTree(component, depth = 0, maxDepth = 10) {\n if (depth > maxDepth) {\n return { _truncated: true, reason: 'Max depth reached' };\n }\n\n if (!component || typeof component !== 'object') {\n return { type: typeof component, value: component };\n }\n\n if (Array.isArray(component)) {\n return component.map(child => this.buildComponentTree(child, depth + 1, maxDepth));\n }\n\n const tree = {};\n\n for (const [key, value] of Object.entries(component)) {\n if (typeof value === 'object' && value !== null) {\n tree[key] = {\n type: 'element',\n props: {},\n children: []\n };\n\n // Extract props and children\n for (const [prop, propValue] of Object.entries(value)) {\n if (prop === 'children') {\n tree[key].children = this.buildComponentTree(propValue, depth + 1, maxDepth);\n } else {\n tree[key].props[prop] = propValue;\n }\n }\n } else {\n tree[key] = { type: typeof value, value };\n }\n }\n\n return tree;\n }\n\n /**\n * Calculate component statistics\n */\n calculateStats(component) {\n const stats = {\n elementCount: 0,\n depth: 0,\n textNodes: 0,\n eventHandlers: 0,\n hasStyles: false,\n hasClasses: false,\n complexity: 0\n };\n\n const traverse = (node, currentDepth = 1) => {\n if (!node || typeof node !== 'object') {\n if (node !== null && node !== undefined) {\n stats.textNodes++;\n }\n return;\n }\n\n if (Array.isArray(node)) {\n node.forEach(child => traverse(child, currentDepth));\n return;\n }\n\n stats.elementCount++;\n stats.depth = Math.max(stats.depth, currentDepth);\n\n for (const [_key, value] of Object.entries(node)) {\n if (typeof value === 'object' && value !== null) {\n // Check for styles and classes\n if (value.style) stats.hasStyles = true;\n if (value.className) stats.hasClasses = true;\n\n // Count event handlers\n const handlers = Object.keys(value).filter(k => k.startsWith('on'));\n stats.eventHandlers += handlers.length;\n\n // Traverse children\n if (value.children) {\n traverse(value.children, currentDepth + 1);\n }\n }\n }\n };\n\n traverse(component);\n\n // Calculate complexity based on various factors\n stats.complexity = \n stats.elementCount * 10 + // Base complexity from element count\n stats.depth * 5 + // Depth adds complexity\n stats.eventHandlers * 3 + // Event handlers add complexity\n stats.textNodes + // Text nodes add minimal complexity\n (stats.hasStyles ? 5 : 0) + // Styles add complexity\n (stats.hasClasses ? 3 : 0); // Classes add complexity\n\n return stats;\n }\n\n /**\n * Get component by ID\n */\n getComponent(id) {\n return this.components.get(id);\n }\n\n /**\n * Get inspection history\n */\n getHistory() {\n return [...this.history];\n }\n\n /**\n * Search components by criteria\n */\n search(criteria) {\n const results = [];\n\n for (const [id, inspection] of this.components.entries()) {\n let matches = true;\n\n if (criteria.hasIssues && inspection.analysis.issues.length === 0) {\n matches = false;\n }\n\n if (criteria.hasWarnings && inspection.analysis.warnings.length === 0) {\n matches = false;\n }\n\n if (criteria.minElements && inspection.stats.elementCount < criteria.minElements) {\n matches = false;\n }\n\n if (criteria.maxElements && inspection.stats.elementCount > criteria.maxElements) {\n matches = false;\n }\n\n if (matches) {\n results.push({ id, inspection });\n }\n }\n\n return results;\n }\n\n /**\n * Compare two components\n */\n compare(componentA, componentB) {\n const inspectionA = typeof componentA === 'string' \n ? this.getComponent(componentA)\n : this.inspect(componentA);\n \n const inspectionB = typeof componentB === 'string'\n ? this.getComponent(componentB)\n : this.inspect(componentB);\n\n return {\n statsComparison: {\n elementCount: {\n a: inspectionA.stats.elementCount,\n b: inspectionB.stats.elementCount,\n diff: inspectionB.stats.elementCount - inspectionA.stats.elementCount\n },\n depth: {\n a: inspectionA.stats.depth,\n b: inspectionB.stats.depth,\n diff: inspectionB.stats.depth - inspectionA.stats.depth\n },\n textNodes: {\n a: inspectionA.stats.textNodes,\n b: inspectionB.stats.textNodes,\n diff: inspectionB.stats.textNodes - inspectionA.stats.textNodes\n }\n },\n structureMatch: JSON.stringify(inspectionA.tree) === JSON.stringify(inspectionB.tree),\n issuesComparison: {\n a: inspectionA.analysis.issues.length,\n b: inspectionB.analysis.issues.length\n }\n };\n }\n\n /**\n * Generate report\n */\n generateReport() {\n return {\n totalInspections: this.inspectionCount,\n componentsTracked: this.components.size,\n historySize: this.history.length,\n summary: {\n totalElements: Array.from(this.components.values())\n .reduce((sum, c) => sum + c.stats.elementCount, 0),\n averageDepth: Array.from(this.components.values())\n .reduce((sum, c) => sum + c.stats.depth, 0) / this.components.size || 0,\n componentsWithIssues: Array.from(this.components.values())\n .filter(c => c.analysis.issues.length > 0).length,\n componentsWithWarnings: Array.from(this.components.values())\n .filter(c => c.analysis.warnings.length > 0).length\n }\n };\n }\n\n /**\n * Clear all data\n */\n clear() {\n this.components.clear();\n this.history = [];\n this.inspectionCount = 0;\n }\n\n /**\n * Clear history only\n */\n clearHistory() {\n this.history = [];\n }\n\n /**\n * Get inspection statistics\n */\n getStats() {\n return {\n totalInspections: this.inspectionCount,\n componentsTracked: this.components.size,\n historySize: this.history.length\n };\n }\n\n /**\n * Export inspection data\n */\n export() {\n return {\n inspections: this.history.map(h => ({\n id: h.id,\n timestamp: h.timestamp,\n type: h.type,\n complexity: h.complexity,\n depth: h.depth,\n issues: h.issues,\n warnings: h.warnings\n })),\n stats: this.getStats(),\n exportedAt: Date.now()\n };\n }\n\n /**\n * Generate unique ID\n */\n generateId() {\n return `inspect-${Date.now()}-${Math.random().toString(36).substring(7)}`;\n }\n}\n\n/**\n * Create a component inspector\n */\nexport function createInspector(options = {}) {\n return new ComponentInspector(options);\n}\n\n/**\n * Quick inspect utility\n */\nexport function inspect(component, options = {}) {\n const inspector = new ComponentInspector(options);\n return inspector.inspect(component);\n}\n\n/**\n * Validate component structure\n */\nexport function validateComponent(component) {\n const inspector = new ComponentInspector();\n const inspection = inspector.inspect(component);\n \n return {\n valid: inspection.valid,\n errors: inspection.issues || [],\n issues: inspection.issues || [],\n warnings: inspection.warnings || [],\n stats: inspection.stats\n };\n}\n\nexport default {\n ComponentInspector,\n createInspector,\n inspect,\n validateComponent\n};\n"],
5
+ "mappings": ";AAYO,IAAM,qBAAN,MAAyB;AAAA,EAC9B,YAAY,UAAU,CAAC,GAAG;AACxB,SAAK,UAAU;AAAA,MACb,cAAc;AAAA,MACd,YAAY;AAAA,MACZ,SAAS;AAAA,MACT,GAAG;AAAA,IACL;AAEA,SAAK,aAAa,oBAAI,IAAI;AAC1B,SAAK,UAAU,CAAC;AAChB,SAAK,kBAAkB;AAAA,EACzB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,QAAQ,WAAW,WAAW,CAAC,GAAG;AAChC,SAAK;AAEL,UAAM,YAAY,YAAY,IAAI;AAClC,UAAM,WAAW,KAAK,iBAAiB,SAAS;AAChD,UAAM,OAAO,KAAK,mBAAmB,SAAS;AAC9C,UAAM,QAAQ,KAAK,eAAe,SAAS;AAC3C,UAAM,UAAU,YAAY,IAAI;AAEhC,UAAM,aAAa;AAAA,MACjB,IAAI,KAAK,WAAW;AAAA,MACpB,WAAW,KAAK,IAAI;AAAA,MACpB,gBAAgB,UAAU;AAAA,MAC1B;AAAA,MACA;AAAA;AAAA,MAEA,MAAM,SAAS;AAAA,MACf,WAAW;AAAA,MACX,OAAO,KAAK,aAAa,SAAS;AAAA,MAClC,OAAO,MAAM,SAAS;AAAA;AAAA,MACtB,YAAY,MAAM,gBAAgB;AAAA,MAClC,YAAY,M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