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.cjs
CHANGED
|
@@ -155,6 +155,7 @@ function freezeEntity(entity, flows) {
|
|
|
155
155
|
function createRegistry() {
|
|
156
156
|
const store = emptyStore();
|
|
157
157
|
let flowsCache = null;
|
|
158
|
+
const patternCache = /* @__PURE__ */ new Map();
|
|
158
159
|
const getFlows = () => {
|
|
159
160
|
if (flowsCache === null) flowsCache = Array.from(store.flow.values());
|
|
160
161
|
return flowsCache;
|
|
@@ -164,6 +165,7 @@ function createRegistry() {
|
|
|
164
165
|
const key = entityKey(entity);
|
|
165
166
|
store[entity.kind].set(key, entity);
|
|
166
167
|
flowsCache = null;
|
|
168
|
+
patternCache.delete(entity.kind);
|
|
167
169
|
};
|
|
168
170
|
const get = (kind, id) => {
|
|
169
171
|
assertEntityKind(kind);
|
|
@@ -171,6 +173,38 @@ function createRegistry() {
|
|
|
171
173
|
if (raw === void 0) return void 0;
|
|
172
174
|
return freezeEntity(raw, getFlows());
|
|
173
175
|
};
|
|
176
|
+
const getPatternsForKind = (kind) => {
|
|
177
|
+
const cached = patternCache.get(kind);
|
|
178
|
+
if (cached !== void 0)
|
|
179
|
+
return cached;
|
|
180
|
+
const patterns = [];
|
|
181
|
+
for (const [key, entity] of store[kind]) {
|
|
182
|
+
if (key.endsWith("*")) {
|
|
183
|
+
patterns.push({
|
|
184
|
+
prefix: key.slice(0, -1),
|
|
185
|
+
entity
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
patternCache.set(
|
|
190
|
+
kind,
|
|
191
|
+
patterns
|
|
192
|
+
);
|
|
193
|
+
return patterns;
|
|
194
|
+
};
|
|
195
|
+
const matchPattern = (kind, id) => {
|
|
196
|
+
assertEntityKind(kind);
|
|
197
|
+
const patterns = getPatternsForKind(kind);
|
|
198
|
+
if (patterns.length === 0) return void 0;
|
|
199
|
+
let best;
|
|
200
|
+
for (const entry of patterns) {
|
|
201
|
+
if (id.startsWith(entry.prefix) && (best === void 0 || entry.prefix.length > best.prefix.length)) {
|
|
202
|
+
best = entry;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
if (best === void 0) return void 0;
|
|
206
|
+
return freezeEntity(best.entity, getFlows());
|
|
207
|
+
};
|
|
174
208
|
const list = (kind) => {
|
|
175
209
|
assertEntityKind(kind);
|
|
176
210
|
const flows = getFlows();
|
|
@@ -221,6 +255,7 @@ function createRegistry() {
|
|
|
221
255
|
return {
|
|
222
256
|
add,
|
|
223
257
|
get,
|
|
258
|
+
matchPattern,
|
|
224
259
|
list,
|
|
225
260
|
query,
|
|
226
261
|
byScope,
|
|
@@ -1173,6 +1208,9 @@ var tailwind_built_default = `/*! tailwindcss v4.2.2 | MIT License | https://tai
|
|
|
1173
1208
|
.relative {
|
|
1174
1209
|
position: relative;
|
|
1175
1210
|
}
|
|
1211
|
+
.static {
|
|
1212
|
+
position: static;
|
|
1213
|
+
}
|
|
1176
1214
|
.inset-0 {
|
|
1177
1215
|
inset: calc(var(--spacing) * 0);
|
|
1178
1216
|
}
|
|
@@ -3625,7 +3663,7 @@ function createCursorTooltip(deps) {
|
|
|
3625
3663
|
// src/browser/surface/inspector.ts
|
|
3626
3664
|
function entityForRef(ref2, registry) {
|
|
3627
3665
|
if (registry) {
|
|
3628
|
-
const found = registry.get(ref2.kind, ref2.id);
|
|
3666
|
+
const found = registry.get(ref2.kind, ref2.id) ?? registry.matchPattern?.(ref2.kind, ref2.id);
|
|
3629
3667
|
if (found) return found;
|
|
3630
3668
|
}
|
|
3631
3669
|
if (ref2.kind === "route") return { kind: "route", path: ref2.id, page: ref2.id };
|
|
@@ -5619,6 +5657,14 @@ var badgeVariants = cva(badgeBase, {
|
|
|
5619
5657
|
}
|
|
5620
5658
|
}
|
|
5621
5659
|
});
|
|
5660
|
+
function badgeTpl(content, options = {}) {
|
|
5661
|
+
const { variant, size, class: extra } = options;
|
|
5662
|
+
return import_lit_html2.html`
|
|
5663
|
+
<span class=${cn(badgeVariants({ variant, size }), extra)} data-slot="badge"
|
|
5664
|
+
>${content}</span
|
|
5665
|
+
>
|
|
5666
|
+
`;
|
|
5667
|
+
}
|
|
5622
5668
|
|
|
5623
5669
|
// src/browser/views/primitives/chip.ts
|
|
5624
5670
|
var CHIP_CLASS = "inline-flex items-center gap-1.5 text-xs font-medium text-muted-foreground";
|
|
@@ -6947,7 +6993,10 @@ function renderDetailSurface(surface, ctx, root) {
|
|
|
6947
6993
|
>
|
|
6948
6994
|
${surface.title}
|
|
6949
6995
|
</h2>` : import_lit_html2.nothing}
|
|
6950
|
-
<span class="ml-auto"
|
|
6996
|
+
<span class="ml-auto flex items-center gap-1">
|
|
6997
|
+
${surface.unregistered ? badgeTpl("Unregistered", { variant: "warning", size: "sm" }) : import_lit_html2.nothing}
|
|
6998
|
+
${kindBadgeTpl(surface.entityKind)}
|
|
6999
|
+
</span>
|
|
6951
7000
|
</div>
|
|
6952
7001
|
${surface.subtitle ? subtitleTpl(surface.subtitle) : import_lit_html2.nothing}
|
|
6953
7002
|
<div
|
|
@@ -9817,12 +9866,11 @@ function createEntityDetailView(config) {
|
|
|
9817
9866
|
if (!ctx.ref || ctx.ref.kind !== kind) {
|
|
9818
9867
|
return { kind: "detail", entityKind: kind };
|
|
9819
9868
|
}
|
|
9820
|
-
const
|
|
9821
|
-
|
|
9822
|
-
|
|
9823
|
-
|
|
9824
|
-
const
|
|
9825
|
-
const meta = metaEntity.meta;
|
|
9869
|
+
const exactEntity = ctx.registry.get(kind, ctx.ref.id);
|
|
9870
|
+
const patternEntity = exactEntity ? void 0 : ctx.registry.matchPattern?.(kind, ctx.ref.id);
|
|
9871
|
+
const entity = exactEntity ?? patternEntity;
|
|
9872
|
+
const metaEntity = entity ? entity : null;
|
|
9873
|
+
const meta = metaEntity?.meta;
|
|
9826
9874
|
const actions = [];
|
|
9827
9875
|
const cloud = ctx.cloud;
|
|
9828
9876
|
actions.push({ ...reportAction(ctx.ref), group: "Report" });
|
|
@@ -9840,14 +9888,16 @@ function createEntityDetailView(config) {
|
|
|
9840
9888
|
actions.push({ ...highlightElementAction(ctx.ref), group: "Inspect" });
|
|
9841
9889
|
actions.push({ ...copyScreenshotAction(ctx.ref), group: "Inspect" });
|
|
9842
9890
|
}
|
|
9843
|
-
|
|
9844
|
-
|
|
9845
|
-
|
|
9846
|
-
|
|
9847
|
-
|
|
9848
|
-
|
|
9849
|
-
|
|
9850
|
-
|
|
9891
|
+
if (metaEntity?.loc) {
|
|
9892
|
+
actions.push({
|
|
9893
|
+
...copyPathAction(ctx.ref, metaEntity.loc),
|
|
9894
|
+
group: "Inspect"
|
|
9895
|
+
});
|
|
9896
|
+
actions.push({
|
|
9897
|
+
...copySnapshotAction(ctx.ref, metaEntity.loc),
|
|
9898
|
+
group: "Inspect"
|
|
9899
|
+
});
|
|
9900
|
+
}
|
|
9851
9901
|
const sections = [];
|
|
9852
9902
|
if (meta?.description) {
|
|
9853
9903
|
sections.push({ id: "description", text: meta.description });
|
|
@@ -9855,8 +9905,10 @@ function createEntityDetailView(config) {
|
|
|
9855
9905
|
if (offerAcceptance && meta?.acceptance?.length) {
|
|
9856
9906
|
sections.push({ id: "acceptance", items: meta.acceptance });
|
|
9857
9907
|
}
|
|
9858
|
-
|
|
9859
|
-
|
|
9908
|
+
if (entity) {
|
|
9909
|
+
for (const s of config.extraSections?.(ctx, entity) ?? []) {
|
|
9910
|
+
sections.push(s);
|
|
9911
|
+
}
|
|
9860
9912
|
}
|
|
9861
9913
|
if (!DOM_BACKED_KINDS2.has(kind)) {
|
|
9862
9914
|
sections.push({
|
|
@@ -9885,8 +9937,9 @@ function createEntityDetailView(config) {
|
|
|
9885
9937
|
return {
|
|
9886
9938
|
kind: "detail",
|
|
9887
9939
|
entityKind: kind,
|
|
9888
|
-
title: displayName(metaEntity),
|
|
9889
|
-
subtitle: config.subtitle?.(ctx,
|
|
9940
|
+
title: patternEntity ? ctx.ref.id : metaEntity ? displayName(metaEntity) : ctx.ref.id,
|
|
9941
|
+
subtitle: exactEntity ? config.subtitle?.(ctx, exactEntity) : void 0,
|
|
9942
|
+
unregistered: !entity,
|
|
9890
9943
|
actions,
|
|
9891
9944
|
sections
|
|
9892
9945
|
};
|