@industry-theme/file-city-panel 0.3.10 → 0.3.11
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/components/TourPlayer.d.ts +6 -2
- package/dist/components/TourPlayer.d.ts.map +1 -1
- package/dist/components/TourPlayer.stories.d.ts.map +1 -1
- package/dist/panels.bundle.js +15 -1
- package/dist/panels.bundle.js.map +1 -1
- package/dist/types/index.d.ts +19 -1
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { IntroductionTour, IntroductionTourStep } from '@principal-ai/file-city-builder';
|
|
3
|
+
import type { TourAudioContext } from '../types/TextToSpeech';
|
|
4
|
+
import type { PanelActions } from '../types';
|
|
3
5
|
export interface TourPlayerProps {
|
|
4
6
|
/** The introduction tour to play */
|
|
5
7
|
tour: IntroductionTour;
|
|
@@ -20,8 +22,10 @@ export interface TourPlayerProps {
|
|
|
20
22
|
position?: 'top' | 'bottom' | 'overlay' | 'left' | 'right';
|
|
21
23
|
/** Skip welcome screen and start playing immediately */
|
|
22
24
|
skipWelcome?: boolean;
|
|
23
|
-
/**
|
|
24
|
-
|
|
25
|
+
/** Context for fetching tour audio (owner, repo, path, commitSha). Used with actions.fetchAudioUrls. */
|
|
26
|
+
tourAudioContext?: TourAudioContext;
|
|
27
|
+
/** Panel actions (provided by host). Used to fetch audio URLs via actions.fetchAudioUrls. */
|
|
28
|
+
actions?: PanelActions;
|
|
25
29
|
/** Auto-play audio when step changes (default: false) */
|
|
26
30
|
autoPlayAudio?: boolean;
|
|
27
31
|
/** Auto-advance to next step when audio ends (default: false) */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TourPlayer.d.ts","sourceRoot":"","sources":["../../src/components/TourPlayer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAgBxE,OAAO,KAAK,EAA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AC;IAEhC,yEAAyE;IACzE,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;;;;GAKG;AACH,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAijChD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TourPlayer.stories.d.ts","sourceRoot":"","sources":["../../src/components/TourPlayer.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"TourPlayer.stories.d.ts","sourceRoot":"","sources":["../../src/components/TourPlayer.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AA4J1C,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,UAAU,CAgBjC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,UAAU,CAAC,CAAC;AAEzC;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE,KAM3B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,SAAS,EAAE,KAsCvB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,UAAU,EAAE,KAqCxB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,QAAQ,EAAE,KAqCtB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,WAAW,EAAE,KAqCzB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,KAqC7B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,sBAAsB,EAAE,KAmFpC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,KA2E/B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,uBAAuB,EAAE,KAqFrC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE,KAiG3B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,KAiE9B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,KAwE/B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,YAAY,EAAE,KAqC1B,CAAC"}
|
package/dist/panels.bundle.js
CHANGED
|
@@ -51265,7 +51265,8 @@ const TourPlayer = ({
|
|
|
51265
51265
|
visible = true,
|
|
51266
51266
|
position,
|
|
51267
51267
|
skipWelcome = false,
|
|
51268
|
-
|
|
51268
|
+
tourAudioContext,
|
|
51269
|
+
actions,
|
|
51269
51270
|
autoPlayAudio = false,
|
|
51270
51271
|
autoAdvanceOnAudioEnd = false,
|
|
51271
51272
|
autoAdvanceDelay = 1e3
|
|
@@ -51275,6 +51276,7 @@ const TourPlayer = ({
|
|
|
51275
51276
|
const [completedSteps, setCompletedSteps] = useState(/* @__PURE__ */ new Set());
|
|
51276
51277
|
const [isPlaying, setIsPlaying] = useState(skipWelcome);
|
|
51277
51278
|
const [autoAdvanceTimeRemaining, setAutoAdvanceTimeRemaining] = useState(null);
|
|
51279
|
+
const [audioUrls, setAudioUrls] = useState();
|
|
51278
51280
|
const [isAudioPlaying, setIsAudioPlaying] = useState(false);
|
|
51279
51281
|
const [isAudioPaused, setIsAudioPaused] = useState(false);
|
|
51280
51282
|
const [audioDuration, setAudioDuration] = useState(0);
|
|
@@ -51346,6 +51348,18 @@ const TourPlayer = ({
|
|
|
51346
51348
|
},
|
|
51347
51349
|
[onInteractiveAction]
|
|
51348
51350
|
);
|
|
51351
|
+
useEffect(() => {
|
|
51352
|
+
if (!(actions == null ? void 0 : actions.fetchAudioUrls) || !tourAudioContext) return;
|
|
51353
|
+
async function loadAudio() {
|
|
51354
|
+
try {
|
|
51355
|
+
const urls = await actions.fetchAudioUrls(tourAudioContext);
|
|
51356
|
+
setAudioUrls(urls);
|
|
51357
|
+
} catch (error) {
|
|
51358
|
+
console.error("[TourPlayer] Failed to fetch audio URLs:", error);
|
|
51359
|
+
}
|
|
51360
|
+
}
|
|
51361
|
+
loadAudio();
|
|
51362
|
+
}, [actions, tourAudioContext]);
|
|
51349
51363
|
useEffect(() => {
|
|
51350
51364
|
return () => {
|
|
51351
51365
|
if (audioElementRef.current) {
|