uidex 0.5.2 → 0.6.0
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/cli/cli.cjs +50 -1
- package/dist/cli/cli.cjs.map +1 -1
- package/dist/headless/index.cjs +39 -1
- package/dist/headless/index.cjs.map +1 -1
- package/dist/headless/index.d.cts +1 -0
- package/dist/headless/index.d.ts +1 -0
- package/dist/headless/index.js +39 -1
- package/dist/headless/index.js.map +1 -1
- package/dist/index.cjs +73 -20
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +73 -20
- package/dist/index.js.map +1 -1
- package/dist/react/index.cjs +73 -20
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +3 -0
- package/dist/react/index.d.ts +3 -0
- package/dist/react/index.js +73 -20
- package/dist/react/index.js.map +1 -1
- package/dist/scan/index.cjs +50 -1
- package/dist/scan/index.cjs.map +1 -1
- package/dist/scan/index.d.cts +1 -0
- package/dist/scan/index.d.ts +1 -0
- package/dist/scan/index.js +50 -1
- package/dist/scan/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -102,6 +102,7 @@ interface ReportRecord {
|
|
|
102
102
|
interface Registry {
|
|
103
103
|
add(entity: Entity): void;
|
|
104
104
|
get<K extends EntityKind>(kind: K, id: string): EntityByKind<K> | undefined;
|
|
105
|
+
matchPattern<K extends EntityKind>(kind: K, id: string): EntityByKind<K> | undefined;
|
|
105
106
|
list<K extends EntityKind>(kind: K): ReadonlyArray<EntityByKind<K>>;
|
|
106
107
|
query(predicate: (entity: Entity) => boolean): Entity[];
|
|
107
108
|
byScope(scope: Scope): Entity[];
|
|
@@ -640,6 +641,8 @@ interface DetailSurface {
|
|
|
640
641
|
entityKind: EntityKind;
|
|
641
642
|
/** Registry lookup failed — renders the "not found" placeholder. */
|
|
642
643
|
notFound?: EntityRef;
|
|
644
|
+
/** Entity exists in the DOM but not in the registry (gen file). */
|
|
645
|
+
unregistered?: boolean;
|
|
643
646
|
/** Entity display name, rendered as the heading. */
|
|
644
647
|
title?: string;
|
|
645
648
|
subtitle?: DetailSubtitle;
|
package/dist/index.d.ts
CHANGED
|
@@ -102,6 +102,7 @@ interface ReportRecord {
|
|
|
102
102
|
interface Registry {
|
|
103
103
|
add(entity: Entity): void;
|
|
104
104
|
get<K extends EntityKind>(kind: K, id: string): EntityByKind<K> | undefined;
|
|
105
|
+
matchPattern<K extends EntityKind>(kind: K, id: string): EntityByKind<K> | undefined;
|
|
105
106
|
list<K extends EntityKind>(kind: K): ReadonlyArray<EntityByKind<K>>;
|
|
106
107
|
query(predicate: (entity: Entity) => boolean): Entity[];
|
|
107
108
|
byScope(scope: Scope): Entity[];
|
|
@@ -640,6 +641,8 @@ interface DetailSurface {
|
|
|
640
641
|
entityKind: EntityKind;
|
|
641
642
|
/** Registry lookup failed — renders the "not found" placeholder. */
|
|
642
643
|
notFound?: EntityRef;
|
|
644
|
+
/** Entity exists in the DOM but not in the registry (gen file). */
|
|
645
|
+
unregistered?: boolean;
|
|
643
646
|
/** Entity display name, rendered as the heading. */
|
|
644
647
|
title?: string;
|
|
645
648
|
subtitle?: DetailSubtitle;
|
package/dist/index.js
CHANGED
|
@@ -67,6 +67,7 @@ function freezeEntity(entity, flows) {
|
|
|
67
67
|
function createRegistry() {
|
|
68
68
|
const store = emptyStore();
|
|
69
69
|
let flowsCache = null;
|
|
70
|
+
const patternCache = /* @__PURE__ */ new Map();
|
|
70
71
|
const getFlows = () => {
|
|
71
72
|
if (flowsCache === null) flowsCache = Array.from(store.flow.values());
|
|
72
73
|
return flowsCache;
|
|
@@ -76,6 +77,7 @@ function createRegistry() {
|
|
|
76
77
|
const key = entityKey(entity);
|
|
77
78
|
store[entity.kind].set(key, entity);
|
|
78
79
|
flowsCache = null;
|
|
80
|
+
patternCache.delete(entity.kind);
|
|
79
81
|
};
|
|
80
82
|
const get = (kind, id) => {
|
|
81
83
|
assertEntityKind(kind);
|
|
@@ -83,6 +85,38 @@ function createRegistry() {
|
|
|
83
85
|
if (raw === void 0) return void 0;
|
|
84
86
|
return freezeEntity(raw, getFlows());
|
|
85
87
|
};
|
|
88
|
+
const getPatternsForKind = (kind) => {
|
|
89
|
+
const cached = patternCache.get(kind);
|
|
90
|
+
if (cached !== void 0)
|
|
91
|
+
return cached;
|
|
92
|
+
const patterns = [];
|
|
93
|
+
for (const [key, entity] of store[kind]) {
|
|
94
|
+
if (key.endsWith("*")) {
|
|
95
|
+
patterns.push({
|
|
96
|
+
prefix: key.slice(0, -1),
|
|
97
|
+
entity
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
patternCache.set(
|
|
102
|
+
kind,
|
|
103
|
+
patterns
|
|
104
|
+
);
|
|
105
|
+
return patterns;
|
|
106
|
+
};
|
|
107
|
+
const matchPattern = (kind, id) => {
|
|
108
|
+
assertEntityKind(kind);
|
|
109
|
+
const patterns = getPatternsForKind(kind);
|
|
110
|
+
if (patterns.length === 0) return void 0;
|
|
111
|
+
let best;
|
|
112
|
+
for (const entry of patterns) {
|
|
113
|
+
if (id.startsWith(entry.prefix) && (best === void 0 || entry.prefix.length > best.prefix.length)) {
|
|
114
|
+
best = entry;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
if (best === void 0) return void 0;
|
|
118
|
+
return freezeEntity(best.entity, getFlows());
|
|
119
|
+
};
|
|
86
120
|
const list = (kind) => {
|
|
87
121
|
assertEntityKind(kind);
|
|
88
122
|
const flows = getFlows();
|
|
@@ -133,6 +167,7 @@ function createRegistry() {
|
|
|
133
167
|
return {
|
|
134
168
|
add,
|
|
135
169
|
get,
|
|
170
|
+
matchPattern,
|
|
136
171
|
list,
|
|
137
172
|
query,
|
|
138
173
|
byScope,
|
|
@@ -1094,6 +1129,9 @@ var tailwind_built_default = `/*! tailwindcss v4.2.2 | MIT License | https://tai
|
|
|
1094
1129
|
.relative {
|
|
1095
1130
|
position: relative;
|
|
1096
1131
|
}
|
|
1132
|
+
.static {
|
|
1133
|
+
position: static;
|
|
1134
|
+
}
|
|
1097
1135
|
.inset-0 {
|
|
1098
1136
|
inset: calc(var(--spacing) * 0);
|
|
1099
1137
|
}
|
|
@@ -3546,7 +3584,7 @@ function createCursorTooltip(deps) {
|
|
|
3546
3584
|
// src/browser/surface/inspector.ts
|
|
3547
3585
|
function entityForRef(ref2, registry) {
|
|
3548
3586
|
if (registry) {
|
|
3549
|
-
const found = registry.get(ref2.kind, ref2.id);
|
|
3587
|
+
const found = registry.get(ref2.kind, ref2.id) ?? registry.matchPattern?.(ref2.kind, ref2.id);
|
|
3550
3588
|
if (found) return found;
|
|
3551
3589
|
}
|
|
3552
3590
|
if (ref2.kind === "route") return { kind: "route", path: ref2.id, page: ref2.id };
|
|
@@ -5561,6 +5599,14 @@ var badgeVariants = cva(badgeBase, {
|
|
|
5561
5599
|
}
|
|
5562
5600
|
}
|
|
5563
5601
|
});
|
|
5602
|
+
function badgeTpl(content, options = {}) {
|
|
5603
|
+
const { variant, size, class: extra } = options;
|
|
5604
|
+
return html`
|
|
5605
|
+
<span class=${cn(badgeVariants({ variant, size }), extra)} data-slot="badge"
|
|
5606
|
+
>${content}</span
|
|
5607
|
+
>
|
|
5608
|
+
`;
|
|
5609
|
+
}
|
|
5564
5610
|
|
|
5565
5611
|
// src/browser/views/primitives/chip.ts
|
|
5566
5612
|
var CHIP_CLASS = "inline-flex items-center gap-1.5 text-xs font-medium text-muted-foreground";
|
|
@@ -6917,7 +6963,10 @@ function renderDetailSurface(surface, ctx, root) {
|
|
|
6917
6963
|
>
|
|
6918
6964
|
${surface.title}
|
|
6919
6965
|
</h2>` : nothing}
|
|
6920
|
-
<span class="ml-auto"
|
|
6966
|
+
<span class="ml-auto flex items-center gap-1">
|
|
6967
|
+
${surface.unregistered ? badgeTpl("Unregistered", { variant: "warning", size: "sm" }) : nothing}
|
|
6968
|
+
${kindBadgeTpl(surface.entityKind)}
|
|
6969
|
+
</span>
|
|
6921
6970
|
</div>
|
|
6922
6971
|
${surface.subtitle ? subtitleTpl(surface.subtitle) : nothing}
|
|
6923
6972
|
<div
|
|
@@ -9803,12 +9852,11 @@ function createEntityDetailView(config) {
|
|
|
9803
9852
|
if (!ctx.ref || ctx.ref.kind !== kind) {
|
|
9804
9853
|
return { kind: "detail", entityKind: kind };
|
|
9805
9854
|
}
|
|
9806
|
-
const
|
|
9807
|
-
|
|
9808
|
-
|
|
9809
|
-
|
|
9810
|
-
const
|
|
9811
|
-
const meta = metaEntity.meta;
|
|
9855
|
+
const exactEntity = ctx.registry.get(kind, ctx.ref.id);
|
|
9856
|
+
const patternEntity = exactEntity ? void 0 : ctx.registry.matchPattern?.(kind, ctx.ref.id);
|
|
9857
|
+
const entity = exactEntity ?? patternEntity;
|
|
9858
|
+
const metaEntity = entity ? entity : null;
|
|
9859
|
+
const meta = metaEntity?.meta;
|
|
9812
9860
|
const actions = [];
|
|
9813
9861
|
const cloud = ctx.cloud;
|
|
9814
9862
|
actions.push({ ...reportAction(ctx.ref), group: "Report" });
|
|
@@ -9826,14 +9874,16 @@ function createEntityDetailView(config) {
|
|
|
9826
9874
|
actions.push({ ...highlightElementAction(ctx.ref), group: "Inspect" });
|
|
9827
9875
|
actions.push({ ...copyScreenshotAction(ctx.ref), group: "Inspect" });
|
|
9828
9876
|
}
|
|
9829
|
-
|
|
9830
|
-
|
|
9831
|
-
|
|
9832
|
-
|
|
9833
|
-
|
|
9834
|
-
|
|
9835
|
-
|
|
9836
|
-
|
|
9877
|
+
if (metaEntity?.loc) {
|
|
9878
|
+
actions.push({
|
|
9879
|
+
...copyPathAction(ctx.ref, metaEntity.loc),
|
|
9880
|
+
group: "Inspect"
|
|
9881
|
+
});
|
|
9882
|
+
actions.push({
|
|
9883
|
+
...copySnapshotAction(ctx.ref, metaEntity.loc),
|
|
9884
|
+
group: "Inspect"
|
|
9885
|
+
});
|
|
9886
|
+
}
|
|
9837
9887
|
const sections = [];
|
|
9838
9888
|
if (meta?.description) {
|
|
9839
9889
|
sections.push({ id: "description", text: meta.description });
|
|
@@ -9841,8 +9891,10 @@ function createEntityDetailView(config) {
|
|
|
9841
9891
|
if (offerAcceptance && meta?.acceptance?.length) {
|
|
9842
9892
|
sections.push({ id: "acceptance", items: meta.acceptance });
|
|
9843
9893
|
}
|
|
9844
|
-
|
|
9845
|
-
|
|
9894
|
+
if (entity) {
|
|
9895
|
+
for (const s of config.extraSections?.(ctx, entity) ?? []) {
|
|
9896
|
+
sections.push(s);
|
|
9897
|
+
}
|
|
9846
9898
|
}
|
|
9847
9899
|
if (!DOM_BACKED_KINDS2.has(kind)) {
|
|
9848
9900
|
sections.push({
|
|
@@ -9871,8 +9923,9 @@ function createEntityDetailView(config) {
|
|
|
9871
9923
|
return {
|
|
9872
9924
|
kind: "detail",
|
|
9873
9925
|
entityKind: kind,
|
|
9874
|
-
title: displayName(metaEntity),
|
|
9875
|
-
subtitle: config.subtitle?.(ctx,
|
|
9926
|
+
title: patternEntity ? ctx.ref.id : metaEntity ? displayName(metaEntity) : ctx.ref.id,
|
|
9927
|
+
subtitle: exactEntity ? config.subtitle?.(ctx, exactEntity) : void 0,
|
|
9928
|
+
unregistered: !entity,
|
|
9876
9929
|
actions,
|
|
9877
9930
|
sections
|
|
9878
9931
|
};
|