@sampleapp.ai/sdk 1.0.37 → 1.0.38
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/sandbox/api.js +2 -3
- package/dist/components/sandbox/guardian/guardian-playground.js +2 -2
- package/dist/components/sandbox/guardian/right-view/right-top-down-view.js +1 -0
- package/dist/components/sandbox/guardian/utils.js +4 -4
- package/dist/index.es.js +6 -5
- package/package.json +1 -1
|
@@ -21,7 +21,6 @@ function createDownloadLink(downloadEndpoint) {
|
|
|
21
21
|
* @returns Sandbox configuration
|
|
22
22
|
*/
|
|
23
23
|
export async function fetchSandboxConfig(apiKey, sandboxId) {
|
|
24
|
-
var _a, _b;
|
|
25
24
|
const client = createApiClient({
|
|
26
25
|
apiKey,
|
|
27
26
|
});
|
|
@@ -55,7 +54,7 @@ export async function fetchSandboxConfig(apiKey, sandboxId) {
|
|
|
55
54
|
name: sandboxContent.uid, // Use UID as name if no name field exists
|
|
56
55
|
description: sandboxContent.markdown || "", // Use markdown as description
|
|
57
56
|
themeColor: "#3b82f6", // Default theme color
|
|
58
|
-
hasPreview:
|
|
57
|
+
hasPreview: sandboxContent.has_preview,
|
|
59
58
|
chatUid: sandboxContent.chat_uid || "", // Fallback: only used if published_url is not available
|
|
60
59
|
useCases: [
|
|
61
60
|
{
|
|
@@ -63,7 +62,7 @@ export async function fetchSandboxConfig(apiKey, sandboxId) {
|
|
|
63
62
|
name: sandboxContent.uid,
|
|
64
63
|
description: sandboxContent.markdown || "",
|
|
65
64
|
themeColor: "#3b82f6",
|
|
66
|
-
hasPreview:
|
|
65
|
+
hasPreview: sandboxContent.has_preview,
|
|
67
66
|
frameworks: [
|
|
68
67
|
{
|
|
69
68
|
key: frameworkKey,
|
|
@@ -10,7 +10,7 @@ import { GuardianStyleWrapper } from "./guardian-style-wrapper";
|
|
|
10
10
|
* When isFrame=true, reads framework from URL params client-side.
|
|
11
11
|
*/
|
|
12
12
|
export default function GuardianPlayground({ nestedConfig, useCase, framework: serverFramework, isFrame = false, apiKey, env, chatUid, theme = "dark", }) {
|
|
13
|
-
var _a
|
|
13
|
+
var _a;
|
|
14
14
|
// When in frame mode, allow URL params to override framework
|
|
15
15
|
const frameParams = useFrameParams();
|
|
16
16
|
const framework = isFrame && frameParams.framework ? frameParams.framework : serverFramework;
|
|
@@ -41,5 +41,5 @@ export default function GuardianPlayground({ nestedConfig, useCase, framework: s
|
|
|
41
41
|
}
|
|
42
42
|
});
|
|
43
43
|
return (React.createElement(GuardianStyleWrapper, { themeColor: frameworkConfig.themeColor, theme: theme },
|
|
44
|
-
React.createElement(GuardianComponent, { demoOptions: frameworkConfig.demoOptions, frameworkOptions: frameworkConfig.frameworkOptions, firstFrameworkByUseCase: firstFrameworkByUseCase, currentFramework: frameworkConfig.currentFramework, CustomConsole: frameworkConfig.CustomConsole, GuideView: frameworkConfig.GuideView, playgroundUid: frameworkConfig.playgroundUid, browserUrl: (_a = frameParams.iframeUrl) !== null && _a !== void 0 ? _a : frameworkConfig.browserUrl, useVm: frameworkConfig.useVm, playgroundLogo: frameworkConfig.playgroundLogo, sandboxUid: frameworkConfig.sandboxUid, name: frameworkConfig.name, description: frameworkConfig.description, codeZipFile: frameworkConfig.codeZipFile, completeCodeZipFile: frameworkConfig.completeCodeZipFile, variant: frameworkConfig.variant, themeColor: frameworkConfig.themeColor, hasPreview:
|
|
44
|
+
React.createElement(GuardianComponent, { demoOptions: frameworkConfig.demoOptions, frameworkOptions: frameworkConfig.frameworkOptions, firstFrameworkByUseCase: firstFrameworkByUseCase, currentFramework: frameworkConfig.currentFramework, CustomConsole: frameworkConfig.CustomConsole, GuideView: frameworkConfig.GuideView, playgroundUid: frameworkConfig.playgroundUid, browserUrl: (_a = frameParams.iframeUrl) !== null && _a !== void 0 ? _a : frameworkConfig.browserUrl, useVm: frameworkConfig.useVm, playgroundLogo: frameworkConfig.playgroundLogo, sandboxUid: frameworkConfig.sandboxUid, name: frameworkConfig.name, description: frameworkConfig.description, codeZipFile: frameworkConfig.codeZipFile, completeCodeZipFile: frameworkConfig.completeCodeZipFile, variant: frameworkConfig.variant, themeColor: frameworkConfig.themeColor, hasPreview: frameworkConfig.hasPreview, currentUseCase: useCase, isFrame: isFrame, apiKey: apiKey, env: env, chatUid: chatUid, gitUrl: frameworkConfig.gitUrl })));
|
|
45
45
|
}
|
|
@@ -15,6 +15,7 @@ import { useFrameParams } from "../hooks/use-frame-params";
|
|
|
15
15
|
import { cn } from "../../../../lib/utils";
|
|
16
16
|
import { handleSandboxDownload } from "../utils";
|
|
17
17
|
export default function RightView({ reloadCounter, overlayStage, browserUrl, useVm, codeZipFile, themeColor, completeCodeZipFile, hasPreview, isPreviewMinimized = false, isGuardian = false, isBrowserMaximized = false, isBrowserUrlReady = false, sandboxId, apiKey, sandboxError, }) {
|
|
18
|
+
console.log('hasPreview', hasPreview);
|
|
18
19
|
const { setFileTree, setGeneratedCode } = useGuardianContext();
|
|
19
20
|
const { setVmResolution } = useVmContext();
|
|
20
21
|
const frameParams = useFrameParams();
|
|
@@ -9,7 +9,7 @@ import { createApiClient } from "../../../lib/api-client";
|
|
|
9
9
|
* // Access via: config["full-stack-auth"].frameworks["nextjs"]
|
|
10
10
|
*/
|
|
11
11
|
export function buildGuardianConfig(useCases, options) {
|
|
12
|
-
var _a;
|
|
12
|
+
var _a, _b, _c;
|
|
13
13
|
const { playgroundUid, playgroundLogo, frameworkLabels, variant } = options;
|
|
14
14
|
const result = {};
|
|
15
15
|
for (const uc of useCases) {
|
|
@@ -19,7 +19,7 @@ export function buildGuardianConfig(useCases, options) {
|
|
|
19
19
|
name: uc.name,
|
|
20
20
|
description: uc.description,
|
|
21
21
|
themeColor: uc.themeColor,
|
|
22
|
-
hasPreview: uc.hasPreview,
|
|
22
|
+
hasPreview: (_a = uc.hasPreview) !== null && _a !== void 0 ? _a : true,
|
|
23
23
|
frameworks: {},
|
|
24
24
|
};
|
|
25
25
|
// Compute frameworkOptions from ALL frameworks in this use case
|
|
@@ -49,9 +49,9 @@ export function buildGuardianConfig(useCases, options) {
|
|
|
49
49
|
sandboxUid: fw.sandboxUid,
|
|
50
50
|
codeZipFile: fw.codeZipFile,
|
|
51
51
|
completeCodeZipFile: fw.completeCodeZipFile,
|
|
52
|
-
themeColor: (
|
|
52
|
+
themeColor: (_b = fw.themeColor) !== null && _b !== void 0 ? _b : uc.themeColor,
|
|
53
53
|
variant,
|
|
54
|
-
hasPreview: uc.hasPreview,
|
|
54
|
+
hasPreview: (_c = uc.hasPreview) !== null && _c !== void 0 ? _c : true,
|
|
55
55
|
gitUrl: fw.gitUrl,
|
|
56
56
|
};
|
|
57
57
|
}
|
package/dist/index.es.js
CHANGED
|
@@ -4308,7 +4308,7 @@ async function zre(e, t) {
|
|
|
4308
4308
|
// Use markdown as description
|
|
4309
4309
|
themeColor: "#3b82f6",
|
|
4310
4310
|
// Default theme color
|
|
4311
|
-
hasPreview: o.has_preview
|
|
4311
|
+
hasPreview: o.has_preview,
|
|
4312
4312
|
chatUid: o.chat_uid || "",
|
|
4313
4313
|
// Fallback: only used if published_url is not available
|
|
4314
4314
|
useCases: [
|
|
@@ -4317,7 +4317,7 @@ async function zre(e, t) {
|
|
|
4317
4317
|
name: o.uid,
|
|
4318
4318
|
description: o.markdown || "",
|
|
4319
4319
|
themeColor: "#3b82f6",
|
|
4320
|
-
hasPreview: o.has_preview
|
|
4320
|
+
hasPreview: o.has_preview,
|
|
4321
4321
|
frameworks: [
|
|
4322
4322
|
{
|
|
4323
4323
|
key: a,
|
|
@@ -75703,7 +75703,7 @@ function PXe(e, t) {
|
|
|
75703
75703
|
name: c.name,
|
|
75704
75704
|
description: c.description,
|
|
75705
75705
|
themeColor: c.themeColor,
|
|
75706
|
-
hasPreview: c.hasPreview,
|
|
75706
|
+
hasPreview: c.hasPreview ?? !0,
|
|
75707
75707
|
frameworks: {}
|
|
75708
75708
|
}, u = c.frameworks.map((p) => ({
|
|
75709
75709
|
label: (a && a[p.key]) ?? Pre[p.key] ?? p.key,
|
|
@@ -75731,7 +75731,7 @@ function PXe(e, t) {
|
|
|
75731
75731
|
completeCodeZipFile: p.completeCodeZipFile,
|
|
75732
75732
|
themeColor: p.themeColor ?? c.themeColor,
|
|
75733
75733
|
variant: n,
|
|
75734
|
-
hasPreview: c.hasPreview,
|
|
75734
|
+
hasPreview: c.hasPreview ?? !0,
|
|
75735
75735
|
gitUrl: p.gitUrl
|
|
75736
75736
|
};
|
|
75737
75737
|
i[c.id] = d;
|
|
@@ -81856,6 +81856,7 @@ function yet({
|
|
|
81856
81856
|
apiKey: h,
|
|
81857
81857
|
sandboxError: f
|
|
81858
81858
|
}) {
|
|
81859
|
+
console.log("hasPreview", s);
|
|
81859
81860
|
const { setFileTree: b, setGeneratedCode: m } = nr(), { setVmResolution: y } = dz(), w = Al(), [A, C] = Ae("code"), [x, k] = Ae([]), [S, _] = Ae(!r), T = xe(null);
|
|
81860
81861
|
Ce(() => {
|
|
81861
81862
|
if (f)
|
|
@@ -82639,7 +82640,7 @@ function xet({
|
|
|
82639
82640
|
completeCodeZipFile: p.completeCodeZipFile,
|
|
82640
82641
|
variant: p.variant,
|
|
82641
82642
|
themeColor: p.themeColor,
|
|
82642
|
-
hasPreview: p.hasPreview
|
|
82643
|
+
hasPreview: p.hasPreview,
|
|
82643
82644
|
currentUseCase: t,
|
|
82644
82645
|
isFrame: o,
|
|
82645
82646
|
apiKey: a,
|