astro-tractstack 2.0.14 → 2.0.15
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/index.js +18 -0
- package/package.json +1 -1
- package/templates/src/components/compositor/Node.tsx +21 -8
- package/templates/src/components/edit/pane/AddPanePanel_new.tsx +459 -561
- package/templates/src/components/edit/pane/AiPaneGenerator.tsx +18 -81
- package/templates/src/components/edit/pane/steps/AiDesignStep.tsx +140 -0
- package/templates/src/components/edit/pane/steps/CopyInputStep.tsx +105 -0
- package/templates/src/components/edit/pane/steps/DesignLibraryStep.tsx +395 -0
- package/templates/src/constants/prompts.json +3 -1
- package/templates/src/utils/compositor/aiPaneParser.ts +32 -84
- package/templates/src/utils/compositor/designLibraryHelper.ts +87 -2
- package/utils/inject-files.ts +18 -0
- package/templates/src/components/edit/pane/PageGen.tsx +0 -485
- package/templates/src/components/edit/pane/PageGenSelector.tsx +0 -245
- package/templates/src/components/edit/pane/PageGenSpecial.tsx +0 -339
package/dist/index.js
CHANGED
|
@@ -448,6 +448,24 @@ async function w(t, e, c) {
|
|
|
448
448
|
src: t("../templates/src/components/edit/pane/AiPanePreview.tsx"),
|
|
449
449
|
dest: "src/components/edit/pane/AiPanePreview.tsx"
|
|
450
450
|
},
|
|
451
|
+
{
|
|
452
|
+
src: t(
|
|
453
|
+
"../templates/src/components/edit/pane/steps/CopyInputStep.tsx"
|
|
454
|
+
),
|
|
455
|
+
dest: "src/components/edit/pane/steps/CopyInputStep.tsx"
|
|
456
|
+
},
|
|
457
|
+
{
|
|
458
|
+
src: t(
|
|
459
|
+
"../templates/src/components/edit/pane/steps/DesignLibraryStep.tsx"
|
|
460
|
+
),
|
|
461
|
+
dest: "src/components/edit/pane/steps/DesignLibraryStep.tsx"
|
|
462
|
+
},
|
|
463
|
+
{
|
|
464
|
+
src: t(
|
|
465
|
+
"../templates/src/components/edit/pane/steps/AiDesignStep.tsx"
|
|
466
|
+
),
|
|
467
|
+
dest: "src/components/edit/pane/steps/AiDesignStep.tsx"
|
|
468
|
+
},
|
|
451
469
|
{
|
|
452
470
|
src: t(
|
|
453
471
|
"../templates/src/components/edit/pane/AddPanePanel_newCustomCopy.tsx"
|
package/package.json
CHANGED
|
@@ -32,7 +32,6 @@ import { NodeBasicTagEraser } from './nodes/tagElements/NodeBasicTag_eraser';
|
|
|
32
32
|
import { NodeBasicTagSettings } from './nodes/tagElements/NodeBasicTag_settings';
|
|
33
33
|
import { Pane_DesignLibrary } from './nodes/Pane_DesignLibrary';
|
|
34
34
|
import AddPanePanel from '@/components/edit/pane/AddPanePanel';
|
|
35
|
-
import PageCreationSelector from '@/components/edit/pane/PageGenSelector';
|
|
36
35
|
import ConfigPanePanel from '@/components/edit/pane/ConfigPanePanel';
|
|
37
36
|
import StoryFragmentConfigPanel from '@/components/edit/storyfragment/StoryFragmentConfigPanel';
|
|
38
37
|
import StoryFragmentTitlePanel from '@/components/edit/storyfragment/StoryFragmentPanel_title';
|
|
@@ -46,6 +45,7 @@ import type {
|
|
|
46
45
|
BaseNode,
|
|
47
46
|
FlatNode,
|
|
48
47
|
} from '@/types/compositorTypes';
|
|
48
|
+
import { PaneAddMode } from '@/types/compositorTypes';
|
|
49
49
|
import { handleClickEventDefault } from '@/utils/compositor/handleClickEvent';
|
|
50
50
|
import { selectionStore } from '@/stores/selection';
|
|
51
51
|
import type { NodeProps, SelectionOrigin } from '@/types/nodeProps';
|
|
@@ -89,6 +89,25 @@ function parseCodeHook(node: BaseNode | FlatNode) {
|
|
|
89
89
|
return null;
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
+
// Helper component to safely set the panel mode for an empty page
|
|
93
|
+
const EmptyPageHandler = (props: NodeProps) => {
|
|
94
|
+
const ctx = getCtx(props);
|
|
95
|
+
useEffect(() => {
|
|
96
|
+
ctx.setPaneAddMode(props.nodeId, PaneAddMode.NEW);
|
|
97
|
+
}, []);
|
|
98
|
+
|
|
99
|
+
// Now that the mode is set, render the panel which will read it.
|
|
100
|
+
return (
|
|
101
|
+
<AddPanePanel
|
|
102
|
+
nodeId={props.nodeId}
|
|
103
|
+
first={true}
|
|
104
|
+
ctx={ctx}
|
|
105
|
+
isStoryFragment={true}
|
|
106
|
+
config={props.config!}
|
|
107
|
+
/>
|
|
108
|
+
);
|
|
109
|
+
};
|
|
110
|
+
|
|
92
111
|
const getElement = (
|
|
93
112
|
node: BaseNode | FlatNode,
|
|
94
113
|
props: NodeProps
|
|
@@ -96,7 +115,6 @@ const getElement = (
|
|
|
96
115
|
if (node === undefined) return <></>;
|
|
97
116
|
const isPreview = getCtx(props).rootNodeId.get() === `tmp`;
|
|
98
117
|
const hasPanes = useStore(getCtx(props).hasPanes);
|
|
99
|
-
const isTemplate = useStore(getCtx(props).isTemplate);
|
|
100
118
|
const sharedProps = { ...props, nodeId: node.id };
|
|
101
119
|
const type = getType(node);
|
|
102
120
|
|
|
@@ -152,12 +170,7 @@ const getElement = (
|
|
|
152
170
|
</div>
|
|
153
171
|
</div>
|
|
154
172
|
) : !hasPanes && sf.slug && sf.title && !isPreview ? (
|
|
155
|
-
<
|
|
156
|
-
nodeId={props.nodeId}
|
|
157
|
-
ctx={getCtx(props)}
|
|
158
|
-
isTemplate={isTemplate}
|
|
159
|
-
config={props.config!}
|
|
160
|
-
/>
|
|
173
|
+
<EmptyPageHandler {...sharedProps} />
|
|
161
174
|
) : (
|
|
162
175
|
<>
|
|
163
176
|
<PanelVisibilityWrapper
|