astro-tractstack 2.0.14 → 2.0.16

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.
Files changed (34) hide show
  1. package/dist/index.js +41 -9
  2. package/package.json +1 -1
  3. package/templates/custom/with-examples/CodeHook.astro +4 -0
  4. package/templates/custom/with-examples/SandboxLauncher.tsx +65 -0
  5. package/templates/env.example +3 -0
  6. package/templates/src/components/codehooks/SandboxAuthWrapper.tsx +75 -0
  7. package/templates/src/components/codehooks/SandboxRegisterForm.tsx +202 -0
  8. package/templates/src/components/compositor/Compositor.tsx +2 -0
  9. package/templates/src/components/compositor/Node.tsx +27 -9
  10. package/templates/src/components/compositor/nodes/Pane_DesignLibrary.tsx +13 -11
  11. package/templates/src/components/compositor/nodes/Pane_layout.tsx +16 -14
  12. package/templates/src/components/edit/Header.tsx +8 -2
  13. package/templates/src/components/edit/PanelSwitch.tsx +4 -4
  14. package/templates/src/components/edit/pane/AddPanePanel.tsx +3 -0
  15. package/templates/src/components/edit/pane/AddPanePanel_new.tsx +463 -561
  16. package/templates/src/components/edit/pane/steps/AiDesignStep.tsx +140 -0
  17. package/templates/src/components/edit/pane/steps/CopyInputStep.tsx +105 -0
  18. package/templates/src/components/edit/pane/steps/DesignLibraryStep.tsx +395 -0
  19. package/templates/src/components/edit/panels/StyleImagePanel.tsx +10 -8
  20. package/templates/src/components/edit/state/SaveModal.tsx +41 -0
  21. package/templates/src/constants/prompts.json +3 -1
  22. package/templates/src/pages/api/sandbox.ts +86 -0
  23. package/templates/src/pages/sandbox.astro +137 -0
  24. package/templates/src/types/nodeProps.ts +1 -0
  25. package/templates/src/utils/compositor/aiPaneParser.ts +32 -84
  26. package/templates/src/utils/compositor/designLibraryHelper.ts +87 -2
  27. package/templates/src/utils/profileStorage.ts +13 -0
  28. package/utils/inject-files.ts +41 -10
  29. package/templates/src/components/edit/pane/AiPaneGenerator.tsx +0 -575
  30. package/templates/src/components/edit/pane/AiPanePreview.tsx +0 -107
  31. package/templates/src/components/edit/pane/PageGen.tsx +0 -485
  32. package/templates/src/components/edit/pane/PageGenSelector.tsx +0 -245
  33. package/templates/src/components/edit/pane/PageGenSpecial.tsx +0 -339
  34. package/templates/src/utils/aai/getTitleSlug.ts +0 -72
@@ -52,10 +52,6 @@ const PanelSwitch = ({
52
52
  }: SettingsPanelProps) => {
53
53
  const signal = useStore(settingsPanelStore);
54
54
 
55
- if (!signal) {
56
- return null;
57
- }
58
-
59
55
  useEffect(() => {
60
56
  if (signal?.action && onTitleChange) {
61
57
  const title = getSettingsPanelTitle(signal.action);
@@ -63,6 +59,10 @@ const PanelSwitch = ({
63
59
  }
64
60
  }, [signal?.action, onTitleChange]);
65
61
 
62
+ if (!signal) {
63
+ return null;
64
+ }
65
+
66
66
  const ctx = getCtx();
67
67
  const allNodes = ctx.allNodes.get();
68
68
  const clickedNode = allNodes.get(signal.nodeId) as FlatNode | undefined;
@@ -16,6 +16,7 @@ interface AddPanePanelProps {
16
16
  isStoryFragment?: boolean;
17
17
  isContextPane?: boolean;
18
18
  config?: BrandConfig;
19
+ isSandboxMode?: boolean;
19
20
  }
20
21
 
21
22
  const AddPanePanel = ({
@@ -25,6 +26,7 @@ const AddPanePanel = ({
25
26
  isStoryFragment = false,
26
27
  isContextPane = false,
27
28
  config,
29
+ isSandboxMode = false,
28
30
  }: AddPanePanelProps) => {
29
31
  const [reset, setReset] = useState(false);
30
32
  const lookup = first ? `${nodeId}-0` : nodeId;
@@ -66,6 +68,7 @@ const AddPanePanel = ({
66
68
  isStoryFragment={isStoryFragment}
67
69
  isContextPane={isContextPane}
68
70
  config={config!}
71
+ isSandboxMode={isSandboxMode}
69
72
  />
70
73
  ) : mode === PaneAddMode.BREAK && !isContextPane ? (
71
74
  <AddPaneBreakPanel