dumi 2.4.43 → 2.4.44
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.
|
@@ -167,19 +167,22 @@ export function useDemo(
|
|
|
167
167
|
version?: string,
|
|
168
168
|
routeId?: string,
|
|
169
169
|
): IDemoData | undefined {
|
|
170
|
+
const mappedDemoId = loader
|
|
171
|
+
? undefined
|
|
172
|
+
: getDemoIdCandidates(id).find((candidate) => demoIdMap[candidate]);
|
|
170
173
|
const cacheKey = version
|
|
171
174
|
? `${id}:${version}`
|
|
172
175
|
: routeId
|
|
173
176
|
? `${id}:route=${routeId}`
|
|
174
177
|
: id;
|
|
175
|
-
const getter = loader ?? demoIdMap[
|
|
178
|
+
const getter = loader ?? (mappedDemoId ? demoIdMap[mappedDemoId] : undefined);
|
|
176
179
|
|
|
177
180
|
if (!demosCache.get(cacheKey)) {
|
|
178
181
|
demosCache.set(
|
|
179
182
|
cacheKey,
|
|
180
183
|
getter
|
|
181
184
|
? getter().then(({ demos }) => {
|
|
182
|
-
const demo = demos[id];
|
|
185
|
+
const demo = demos[id] ?? (mappedDemoId && demos[mappedDemoId]);
|
|
183
186
|
if (!demo) return undefined;
|
|
184
187
|
|
|
185
188
|
// expand context for omit ext
|