astro-tractstack 2.0.43 → 2.0.45
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 +6 -0
- package/package.json +1 -1
- package/templates/src/components/compositor/nodes/Pane_DesignLibrary.tsx +24 -3
- package/templates/src/components/edit/pane/AddPanePanel_new.tsx +156 -343
- package/templates/src/components/edit/pane/AiRestylePaneModal.tsx +230 -0
- package/templates/src/components/edit/pane/RestylePaneModal.tsx +7 -5
- package/templates/src/components/edit/pane/steps/AiDesignStep.tsx +28 -14
- package/templates/src/components/edit/pane/steps/CopyInputStep.tsx +238 -96
- package/templates/src/components/edit/panels/StyleParentPanel.tsx +29 -1
- package/templates/src/stores/nodes.ts +65 -0
- package/templates/src/stores/selection.ts +2 -0
- package/utils/inject-files.ts +6 -0
package/dist/index.js
CHANGED
|
@@ -476,6 +476,12 @@ async function w(t, e, c) {
|
|
|
476
476
|
),
|
|
477
477
|
dest: "src/components/edit/pane/RestylePaneModal.tsx"
|
|
478
478
|
},
|
|
479
|
+
{
|
|
480
|
+
src: t(
|
|
481
|
+
"../templates/src/components/edit/pane/AiRestylePaneModal.tsx"
|
|
482
|
+
),
|
|
483
|
+
dest: "src/components/edit/pane/AiRestylePaneModal.tsx"
|
|
484
|
+
},
|
|
479
485
|
{
|
|
480
486
|
src: t(
|
|
481
487
|
"../templates/src/components/edit/pane/steps/CopyInputStep.tsx"
|
package/package.json
CHANGED
|
@@ -4,6 +4,7 @@ import ArchiveBoxArrowDownIcon from '@heroicons/react/24/outline/ArchiveBoxArrow
|
|
|
4
4
|
import ArrowPathRoundedSquareIcon from '@heroicons/react/24/outline/ArrowPathRoundedSquareIcon';
|
|
5
5
|
import ArrowDownTrayIcon from '@heroicons/react/24/outline/ArrowDownTrayIcon';
|
|
6
6
|
import CheckIcon from '@heroicons/react/24/outline/CheckIcon';
|
|
7
|
+
import SparklesIcon from '@heroicons/react/24/solid/SparklesIcon';
|
|
7
8
|
import { viewportKeyStore } from '@/stores/storykeep';
|
|
8
9
|
import { getCtx } from '@/stores/nodes';
|
|
9
10
|
import { RenderChildren } from './RenderChildren';
|
|
@@ -12,6 +13,7 @@ import type { NodeProps } from '@/types/nodeProps';
|
|
|
12
13
|
import type { BgImageNode, ArtpackImageNode } from '@/types/compositorTypes';
|
|
13
14
|
import { SaveToLibraryModal } from '@/components/edit/state/SaveToLibraryModal';
|
|
14
15
|
import { RestylePaneModal } from '@/components/edit/pane/RestylePaneModal';
|
|
16
|
+
import { AiRestylePaneModal } from '@/components/edit/pane/AiRestylePaneModal';
|
|
15
17
|
import { selectionStore } from '@/stores/selection';
|
|
16
18
|
import { copyPaneToClipboard } from '@/utils/compositor/designLibraryHelper';
|
|
17
19
|
|
|
@@ -35,9 +37,12 @@ function getSizeClasses(
|
|
|
35
37
|
|
|
36
38
|
export const Pane_DesignLibrary = (props: NodeProps) => {
|
|
37
39
|
const ctx = getCtx(props);
|
|
38
|
-
const { isRestyleModalOpen } = useStore(
|
|
39
|
-
|
|
40
|
-
|
|
40
|
+
const { isRestyleModalOpen, isAiRestyleModalOpen } = useStore(
|
|
41
|
+
selectionStore,
|
|
42
|
+
{
|
|
43
|
+
keys: ['isRestyleModalOpen', 'isAiRestyleModalOpen'],
|
|
44
|
+
}
|
|
45
|
+
);
|
|
41
46
|
const [currentViewport, setCurrentViewport] = useState(
|
|
42
47
|
viewportKeyStore.get().value
|
|
43
48
|
);
|
|
@@ -81,6 +86,12 @@ export const Pane_DesignLibrary = (props: NodeProps) => {
|
|
|
81
86
|
selectionStore.setKey('isRestyleModalOpen', true);
|
|
82
87
|
};
|
|
83
88
|
|
|
89
|
+
const handleAiRestyleClick = (e: React.MouseEvent) => {
|
|
90
|
+
e.stopPropagation();
|
|
91
|
+
selectionStore.setKey('paneToRestyleId', props.nodeId);
|
|
92
|
+
selectionStore.setKey('isAiRestyleModalOpen', true);
|
|
93
|
+
};
|
|
94
|
+
|
|
84
95
|
const handleSaveClick = (e: React.MouseEvent) => {
|
|
85
96
|
e.stopPropagation();
|
|
86
97
|
setIsSaveModalOpen(true);
|
|
@@ -106,6 +117,13 @@ export const Pane_DesignLibrary = (props: NodeProps) => {
|
|
|
106
117
|
<ArchiveBoxArrowDownIcon className="h-7 w-7 text-white" />
|
|
107
118
|
</button>
|
|
108
119
|
)}
|
|
120
|
+
<button
|
|
121
|
+
title="Re-Color"
|
|
122
|
+
onClick={handleAiRestyleClick}
|
|
123
|
+
className="flex h-10 w-10 items-center justify-center rounded-full bg-purple-600 p-1.5 shadow-lg hover:bg-purple-700"
|
|
124
|
+
>
|
|
125
|
+
<SparklesIcon className="h-5 w-5 text-white" />
|
|
126
|
+
</button>
|
|
109
127
|
<button
|
|
110
128
|
title="Restyle Pane from Design Library"
|
|
111
129
|
onClick={handleRestyleClick}
|
|
@@ -243,6 +261,9 @@ export const Pane_DesignLibrary = (props: NodeProps) => {
|
|
|
243
261
|
)}
|
|
244
262
|
|
|
245
263
|
{isRestyleModalOpen && <RestylePaneModal />}
|
|
264
|
+
{isAiRestyleModalOpen && (
|
|
265
|
+
<AiRestylePaneModal isSandboxMode={props.isSandboxMode} />
|
|
266
|
+
)}
|
|
246
267
|
</div>
|
|
247
268
|
);
|
|
248
269
|
};
|