@sampleapp.ai/sdk 1.0.28 → 1.0.30
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/chat-bar.js +1 -2
- package/dist/components/guardian/app-layout-no-sidebar.js +8 -0
- package/dist/components/guardian/ask-ai-view.js +249 -0
- package/dist/components/guardian/code-focus-section.d.ts +41 -0
- package/dist/components/guardian/code-focus-section.js +174 -0
- package/dist/components/guardian/context/guardian-context.js +94 -0
- package/dist/components/guardian/context/vm-context.js +28 -0
- package/dist/components/guardian/default-guide-view.js +34 -0
- package/dist/components/guardian/demo/guardian-demo.js +35 -0
- package/dist/components/guardian/demo/left-view/toggle.js +28 -0
- package/dist/components/guardian/demo/left-view.js +49 -0
- package/dist/components/guardian/guardian-component.js +79 -0
- package/dist/components/guardian/guardian-demo.js +35 -0
- package/dist/components/guardian/guardian-home.d.ts +4 -0
- package/dist/components/guardian/guardian-home.js +61 -0
- package/dist/components/guardian/guardian-playground.js +45 -0
- package/dist/components/guardian/guardian-style-wrapper.js +29 -0
- package/dist/components/guardian/guardian-upload-spec.d.ts +14 -0
- package/dist/components/guardian/guardian-upload-spec.js +160 -0
- package/dist/components/guardian/header/glassmorphic-combobox.d.ts +15 -0
- package/dist/components/guardian/header/glassmorphic-combobox.js +30 -0
- package/dist/components/guardian/header.js +61 -0
- package/dist/components/guardian/hooks/use-frame-messages.js +65 -0
- package/dist/components/guardian/hooks/use-frame-params.js +44 -0
- package/dist/components/guardian/hooks/use-sandbox-url-loader.js +101 -0
- package/dist/components/guardian/ide/browser.js +538 -0
- package/dist/components/guardian/index.js +8 -0
- package/dist/components/guardian/layout/app-layout-no-sidebar.js +8 -0
- package/dist/components/guardian/layout/header/glassmorphic-combobox.js +48 -0
- package/dist/components/guardian/layout/header.js +63 -0
- package/dist/components/guardian/right-view/code-view.js +56 -0
- package/dist/components/guardian/right-view/pill-file-selector.js +233 -0
- package/dist/components/guardian/right-view/preview-control-bar.js +25 -0
- package/dist/components/guardian/right-view/right-panel-view.js +38 -0
- package/dist/components/guardian/right-view/right-top-down-view.js +289 -0
- package/dist/components/guardian/right-view/right-view.js +28 -0
- package/dist/components/guardian/right-view/simplified-editor.js +234 -0
- package/dist/components/guardian/types/ide-types.js +162 -0
- package/dist/components/guardian/types.js +3 -0
- package/dist/components/guardian/ui/ai-loader.js +48 -0
- package/dist/components/guardian/ui/badge.js +24 -0
- package/dist/components/guardian/ui/button.js +45 -0
- package/dist/components/guardian/ui/command.js +63 -0
- package/dist/components/guardian/ui/console-with-app.js +17 -0
- package/dist/components/guardian/ui/dialog.js +57 -0
- package/dist/components/guardian/ui/dropdown-menu.js +82 -0
- package/dist/components/guardian/ui/markdown.js +57 -0
- package/dist/components/guardian/ui/popover.js +25 -0
- package/dist/components/guardian/ui/tooltip.js +25 -0
- package/dist/components/guardian/utils.js +88 -0
- package/dist/components/guardian/zip-to-codebase.js +246 -0
- package/dist/components/guardian/zip-to-filetree.js +284 -0
- package/dist/components/icons.js +22 -0
- package/dist/components/sandbox/Sandbox.js +87 -0
- package/dist/components/sandbox/SandboxHome.js +141 -0
- package/dist/components/sandbox/api.js +108 -0
- package/dist/components/sandbox/guardian/app-layout-no-sidebar.js +8 -0
- package/dist/components/sandbox/guardian/ask-ai-view.js +249 -0
- package/dist/components/sandbox/guardian/code-focus-section.js +174 -0
- package/dist/components/sandbox/guardian/context/guardian-context.js +94 -0
- package/dist/components/sandbox/guardian/context/vm-context.js +28 -0
- package/dist/components/sandbox/guardian/default-guide-view.js +34 -0
- package/dist/components/sandbox/guardian/demo/guardian-demo.js +35 -0
- package/dist/components/sandbox/guardian/demo/left-view/toggle.js +28 -0
- package/dist/components/sandbox/guardian/demo/left-view.js +58 -0
- package/dist/components/sandbox/guardian/guardian-component.js +97 -0
- package/dist/components/sandbox/guardian/guardian-demo.js +35 -0
- package/dist/components/sandbox/guardian/guardian-home.d.ts +4 -0
- package/dist/components/sandbox/guardian/guardian-home.js +61 -0
- package/dist/components/sandbox/guardian/guardian-playground.js +45 -0
- package/dist/components/sandbox/guardian/guardian-style-wrapper.js +33 -0
- package/dist/components/sandbox/guardian/guardian-upload-spec.d.ts +14 -0
- package/dist/components/sandbox/guardian/guardian-upload-spec.js +160 -0
- package/dist/components/sandbox/guardian/header/glassmorphic-combobox.js +30 -0
- package/dist/components/sandbox/guardian/header.js +61 -0
- package/dist/components/sandbox/guardian/hooks/use-frame-messages.js +65 -0
- package/dist/components/sandbox/guardian/hooks/use-frame-params.js +44 -0
- package/dist/components/sandbox/guardian/hooks/use-sandbox-url-loader.js +145 -0
- package/dist/components/sandbox/guardian/ide/browser.js +538 -0
- package/dist/components/sandbox/guardian/index.js +8 -0
- package/dist/components/sandbox/guardian/right-view/code-view.js +60 -0
- package/dist/components/sandbox/guardian/right-view/pill-file-selector.js +233 -0
- package/dist/components/sandbox/guardian/right-view/preview-control-bar.js +25 -0
- package/dist/components/sandbox/guardian/right-view/right-panel-view.js +38 -0
- package/dist/components/sandbox/guardian/right-view/right-top-down-view.js +289 -0
- package/dist/components/sandbox/guardian/right-view/right-view.js +28 -0
- package/dist/components/sandbox/guardian/right-view/simplified-editor.js +234 -0
- package/dist/components/sandbox/guardian/types/ide-types.js +162 -0
- package/dist/components/sandbox/guardian/types.js +3 -0
- package/dist/components/sandbox/guardian/ui/ai-loader.js +48 -0
- package/dist/components/sandbox/guardian/ui/badge.js +24 -0
- package/dist/components/sandbox/guardian/ui/button.js +45 -0
- package/dist/components/sandbox/guardian/ui/command.js +63 -0
- package/dist/components/sandbox/guardian/ui/console-with-app.js +17 -0
- package/dist/components/sandbox/guardian/ui/dialog.js +57 -0
- package/dist/components/sandbox/guardian/ui/dropdown-menu.js +82 -0
- package/dist/components/sandbox/guardian/ui/markdown/accordion-group/accordion.js +62 -0
- package/dist/components/sandbox/guardian/ui/markdown/accordion-group.js +23 -0
- package/dist/components/sandbox/guardian/ui/markdown/callout/callout-check.js +4 -0
- package/dist/components/sandbox/guardian/ui/markdown/callout/callout-error.js +4 -0
- package/dist/components/sandbox/guardian/ui/markdown/callout/callout-info.js +4 -0
- package/dist/components/sandbox/guardian/ui/markdown/callout/callout-note.js +4 -0
- package/dist/components/sandbox/guardian/ui/markdown/callout/callout-tip.js +4 -0
- package/dist/components/sandbox/guardian/ui/markdown/callout/callout-warning.js +4 -0
- package/dist/components/sandbox/guardian/ui/markdown/callout/shared/callout.js +9 -0
- package/dist/components/sandbox/guardian/ui/markdown/callout/shared/types.js +1 -0
- package/dist/components/sandbox/guardian/ui/markdown/card-group/card.js +18 -0
- package/dist/components/sandbox/guardian/ui/markdown/card-group.js +25 -0
- package/dist/components/sandbox/guardian/ui/markdown/code-group/code-block.js +87 -0
- package/dist/components/sandbox/guardian/ui/markdown/code-group.js +101 -0
- package/dist/components/sandbox/guardian/ui/markdown/icon.js +31 -0
- package/dist/components/sandbox/guardian/ui/markdown.js +786 -0
- package/dist/components/sandbox/guardian/ui/popover.js +25 -0
- package/dist/components/sandbox/guardian/ui/tooltip.js +25 -0
- package/dist/components/sandbox/guardian/utils.js +88 -0
- package/dist/components/sandbox/guardian/zip-to-codebase.js +259 -0
- package/dist/components/sandbox/guardian/zip-to-filetree.js +284 -0
- package/dist/components/sandbox/index.js +4 -0
- package/dist/components/sandbox/sandbox-control-bar.js +91 -0
- package/dist/components/sandbox/sandbox-header.js +52 -0
- package/dist/components/sandbox/sandbox-home/SandboxCard.js +59 -0
- package/dist/components/sandbox/sandbox-home/SandboxHome.js +174 -0
- package/dist/components/sandbox/sandbox-home/SearchBar.js +12 -0
- package/dist/components/sandbox/sandbox-home/index.js +3 -0
- package/dist/components/sandbox/sandbox-left-panel.js +248 -0
- package/dist/components/sandbox/sandbox-loading.js +48 -0
- package/dist/components/sandbox/sandbox-right-panel.js +247 -0
- package/dist/components/sandbox/types.js +1 -0
- package/dist/components/sandbox.js +32 -0
- package/dist/components/tailwind-example.js +46 -0
- package/dist/index.d.ts +336 -1
- package/dist/index.es.js +90151 -667
- package/dist/index.js +13 -2
- package/dist/index.standalone.js +61 -53
- package/dist/index.standalone.umd.js +17 -89
- package/dist/index.umd.js +86 -151
- package/dist/lib/api-client.example.js +60 -0
- package/dist/lib/api-client.js +98 -0
- package/dist/lib/generated-css.js +4 -0
- package/dist/lib/inject-styles.js +42 -0
- package/dist/lib/shadow-dom-wrapper.js +42 -0
- package/dist/lib/utils.js +5 -0
- package/dist/sdk.css +1 -1
- package/dist/tailwind.css +1 -0
- package/package.json +32 -5
package/dist/index.js
CHANGED
|
@@ -2,10 +2,21 @@ import * as React from "react"; // Change this line
|
|
|
2
2
|
import * as ReactDOM from "react-dom/client"; // Change this line
|
|
3
3
|
import { ChatButton } from "./components/ChatButton";
|
|
4
4
|
import { ModalSearchAndChat } from "./components/ModalSearchAndChat";
|
|
5
|
-
import { ChatBar } from "./components/chat-bar";
|
|
5
|
+
import { ChatBar as ChatBarRaw } from "./components/chat-bar";
|
|
6
|
+
import { ShadowDomWrapper } from "./lib/shadow-dom-wrapper";
|
|
7
|
+
import { TailwindExample as TailwindExampleRaw } from "./components/tailwind-example";
|
|
8
|
+
import { SandboxHome as SandboxHomeRaw } from "./components/sandbox/sandbox-home";
|
|
6
9
|
import "./styles.css";
|
|
10
|
+
import "./styles/tailwind.css";
|
|
11
|
+
const ChatBar = (props) => React.createElement(ShadowDomWrapper, null, React.createElement(ChatBarRaw, props));
|
|
12
|
+
const TailwindExample = (props) => React.createElement(ShadowDomWrapper, null, React.createElement(TailwindExampleRaw, props));
|
|
13
|
+
const SandboxHome = (props) => React.createElement(ShadowDomWrapper, null, React.createElement(SandboxHomeRaw, props));
|
|
7
14
|
// Export React components for direct JSX usage
|
|
8
|
-
export { ChatButton, ModalSearchAndChat, ChatBar };
|
|
15
|
+
export { ChatButton, ModalSearchAndChat, ChatBar, TailwindExample, SandboxHome };
|
|
16
|
+
// Export Sandbox component and types
|
|
17
|
+
export { Sandbox } from "./components/sandbox";
|
|
18
|
+
// Export Guardian components (now nested under sandbox)
|
|
19
|
+
export { GuardianPlayground, GuardianComponent, GuardianProvider, VmProvider, buildGuardianConfig, createSandboxUrlConfigs, } from "./components/sandbox/guardian";
|
|
9
20
|
// Export themes
|
|
10
21
|
export { themes, getTheme, DEFAULT_THEME } from "./themes";
|
|
11
22
|
// SDK class for loadScript programmatic usage
|
package/dist/index.standalone.js
CHANGED
|
@@ -1,65 +1,62 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import ReactDOM from "react-dom/client";
|
|
3
3
|
import { ChatBar as MinimalChatBar, } from "./components/chat-bar";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
else {
|
|
20
|
-
hostContainer = containerSelector;
|
|
4
|
+
import { TailwindExample as TailwindExampleComponent } from "./components/tailwind-example";
|
|
5
|
+
import { createShadowContainer, getShadowMountPoint, injectStylesIntoShadow, } from "./lib/inject-styles";
|
|
6
|
+
// Import CSS - will be processed by Vite/PostCSS
|
|
7
|
+
import "./styles/tailwind.css";
|
|
8
|
+
// Import processed Tailwind CSS as string for injection
|
|
9
|
+
import tailwindCssString from "virtual:tailwind-css";
|
|
10
|
+
// Helper to get container element
|
|
11
|
+
function getContainer(containerSelector) {
|
|
12
|
+
if (!containerSelector) {
|
|
13
|
+
return document.body;
|
|
14
|
+
}
|
|
15
|
+
else if (typeof containerSelector === "string") {
|
|
16
|
+
const found = document.querySelector(containerSelector);
|
|
17
|
+
if (!found) {
|
|
18
|
+
throw new Error(`Container not found: ${containerSelector}`);
|
|
21
19
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
20
|
+
return found;
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
return containerSelector;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
// Helper to create shadow DOM with CSS injection
|
|
27
|
+
function mountComponentInShadow(Component, props, container, cssContent) {
|
|
28
|
+
const shadow = createShadowContainer(container);
|
|
29
|
+
const mountPoint = getShadowMountPoint(shadow);
|
|
30
|
+
// Inject CSS if provided
|
|
31
|
+
if (cssContent) {
|
|
32
|
+
injectStylesIntoShadow(shadow, cssContent);
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
// Inject basic reset styles
|
|
36
|
+
injectStylesIntoShadow(shadow, `
|
|
35
37
|
* {
|
|
36
38
|
box-sizing: border-box;
|
|
37
39
|
}
|
|
38
|
-
|
|
39
|
-
/* Reset any inherited styles that might interfere */
|
|
40
40
|
div, span, p, button, input, textarea {
|
|
41
41
|
font-family: system-ui, -apple-system, sans-serif;
|
|
42
|
-
color: inherit;
|
|
43
|
-
background: transparent;
|
|
44
|
-
border: none;
|
|
45
|
-
margin: 0;
|
|
46
|
-
padding: 0;
|
|
47
42
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
43
|
+
`);
|
|
44
|
+
}
|
|
45
|
+
const root = ReactDOM.createRoot(mountPoint);
|
|
46
|
+
root.render(React.createElement(Component, props));
|
|
47
|
+
return {
|
|
48
|
+
unmount: () => {
|
|
49
|
+
root.unmount();
|
|
50
|
+
container.innerHTML = "";
|
|
51
|
+
},
|
|
52
|
+
container,
|
|
53
|
+
shadowRoot: shadow,
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
function initChatBarStandalone(props, containerSelector) {
|
|
57
|
+
try {
|
|
58
|
+
const hostContainer = getContainer(containerSelector);
|
|
59
|
+
return mountComponentInShadow(MinimalChatBar, props, hostContainer);
|
|
63
60
|
}
|
|
64
61
|
catch (error) {
|
|
65
62
|
console.error("SampleApp Standalone Error:", error);
|
|
@@ -70,12 +67,23 @@ function initChatBarStandalone(props, containerSelector) {
|
|
|
70
67
|
throw error;
|
|
71
68
|
}
|
|
72
69
|
}
|
|
70
|
+
function initTailwindExample(props, container) {
|
|
71
|
+
try {
|
|
72
|
+
// Inject processed Tailwind CSS into shadow DOM
|
|
73
|
+
return mountComponentInShadow(TailwindExampleComponent, props, container, tailwindCssString || "");
|
|
74
|
+
}
|
|
75
|
+
catch (error) {
|
|
76
|
+
console.error("TailwindExample Standalone Error:", error);
|
|
77
|
+
throw error;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
73
80
|
const SampleAppStandalone = {
|
|
74
81
|
ChatBar: initChatBarStandalone,
|
|
82
|
+
TailwindExample: initTailwindExample,
|
|
75
83
|
version: "1.0.25",
|
|
76
84
|
};
|
|
77
85
|
if (typeof window !== "undefined") {
|
|
78
86
|
window.SampleAppStandalone = SampleAppStandalone;
|
|
79
87
|
}
|
|
80
88
|
export default SampleAppStandalone;
|
|
81
|
-
export { initChatBarStandalone as ChatBar };
|
|
89
|
+
export { initChatBarStandalone as ChatBar, initTailwindExample as TailwindExample, };
|