astro-tractstack 2.0.17 → 2.0.19
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/codehooks/FeaturedArticleSetup.tsx +1 -1
- package/templates/src/components/codehooks/ListContentSetup.tsx +1 -1
- package/templates/src/components/compositor/Compositor.tsx +1 -0
- package/templates/src/components/compositor/Node.tsx +41 -17
- package/templates/src/components/compositor/nodes/GhostInsertBlock.tsx +9 -6
- package/templates/src/components/compositor/nodes/GridLayout.tsx +124 -0
- package/templates/src/components/compositor/nodes/GridLayout_eraser.tsx +33 -0
- package/templates/src/components/compositor/nodes/Markdown.tsx +67 -37
- package/templates/src/components/compositor/nodes/Markdown_eraser.tsx +56 -0
- package/templates/src/components/compositor/preview/FeaturedArticlePreview.tsx +8 -2
- package/templates/src/components/edit/PanelSwitch.tsx +232 -75
- package/templates/src/components/edit/SettingsPanel.tsx +0 -1
- package/templates/src/components/edit/pane/AddPanePanel_codehook.tsx +3 -3
- package/templates/src/components/edit/pane/AddPanePanel_new.tsx +402 -167
- package/templates/src/components/edit/pane/AddPanePanel_reuse.tsx +2 -2
- package/templates/src/components/edit/pane/ConfigPanePanel.tsx +1 -7
- package/templates/src/components/edit/pane/PanePanel_impression.tsx +1 -1
- package/templates/src/components/edit/pane/RestylePaneModal.tsx +8 -5
- package/templates/src/components/edit/pane/steps/AiDesignStep.tsx +6 -6
- package/templates/src/components/edit/pane/steps/CopyInputStep.tsx +3 -3
- package/templates/src/components/edit/pane/steps/DesignLibraryStep.tsx +4 -4
- package/templates/src/components/edit/panels/StyleElementPanel.tsx +11 -4
- package/templates/src/components/edit/panels/StyleElementPanel_add.tsx +8 -8
- package/templates/src/components/edit/panels/StyleElementPanel_remove.tsx +14 -4
- package/templates/src/components/edit/panels/StyleElementPanel_update.tsx +16 -4
- package/templates/src/components/edit/panels/StyleImagePanel.tsx +7 -3
- package/templates/src/components/edit/panels/StyleImagePanel_add.tsx +9 -2
- package/templates/src/components/edit/panels/StyleImagePanel_remove.tsx +5 -2
- package/templates/src/components/edit/panels/StyleImagePanel_update.tsx +5 -2
- package/templates/src/components/edit/panels/StyleLiElementPanel.tsx +7 -3
- package/templates/src/components/edit/panels/StyleLiElementPanel_add.tsx +9 -2
- package/templates/src/components/edit/panels/StyleLiElementPanel_remove.tsx +5 -2
- package/templates/src/components/edit/panels/StyleLiElementPanel_update.tsx +5 -2
- package/templates/src/components/edit/panels/StyleParentPanel.tsx +530 -171
- package/templates/src/components/edit/panels/StyleParentPanel_add.tsx +77 -42
- package/templates/src/components/edit/panels/StyleParentPanel_deleteLayer.tsx +38 -22
- package/templates/src/components/edit/panels/StyleParentPanel_remove.tsx +171 -66
- package/templates/src/components/edit/panels/StyleParentPanel_update.tsx +166 -98
- package/templates/src/components/edit/panels/StyleWidgetPanel.tsx +7 -3
- package/templates/src/components/edit/panels/StyleWidgetPanel_add.tsx +9 -2
- package/templates/src/components/edit/panels/StyleWidgetPanel_remove.tsx +5 -2
- package/templates/src/components/edit/panels/StyleWidgetPanel_update.tsx +6 -2
- package/templates/src/components/edit/state/SaveModal.tsx +10 -2
- package/templates/src/components/edit/state/SaveToLibraryModal.tsx +6 -6
- package/templates/src/components/fields/PaneBreakShapeSelector.tsx +1 -1
- package/templates/src/components/widgets/ImpressionWrapper.tsx +4 -1
- package/templates/src/constants/prompts.json +23 -2
- package/templates/src/stores/nodes.ts +356 -212
- package/templates/src/stores/storykeep.ts +3 -1
- package/templates/src/types/compositorTypes.ts +56 -3
- package/templates/src/types/tractstack.ts +1 -0
- package/templates/src/utils/compositor/TemplateNodes.ts +8 -0
- package/templates/src/utils/compositor/aiPaneParser.ts +263 -83
- package/templates/src/utils/compositor/designLibraryHelper.ts +12 -9
- package/templates/src/utils/compositor/nodesHelper.ts +229 -0
- package/templates/src/utils/compositor/reduceNodesClassNames.ts +40 -1
- package/templates/src/utils/compositor/typeGuards.ts +7 -0
- package/templates/src/utils/etl/extractor.ts +1 -5
- package/templates/src/utils/etl/index.ts +1 -0
- package/templates/src/utils/etl/transformer.ts +70 -25
- package/utils/inject-files.ts +18 -0
|
@@ -310,7 +310,7 @@ const AddPaneReUsePanel = ({
|
|
|
310
310
|
<style>{comboboxItemStyles}</style>
|
|
311
311
|
<div className="w-full rounded-md bg-white p-1.5">
|
|
312
312
|
<div className="flex flex-wrap items-center gap-2">
|
|
313
|
-
<div className="flex min-w-
|
|
313
|
+
<div className="flex min-w-48 flex-wrap items-center gap-2">
|
|
314
314
|
<button
|
|
315
315
|
onClick={() => setMode(PaneAddMode.DEFAULT)}
|
|
316
316
|
className="w-fit flex-none rounded bg-gray-100 px-3 py-1 text-sm text-gray-700 transition-colors hover:bg-gray-200 focus:bg-gray-200"
|
|
@@ -323,7 +323,7 @@ const AddPaneReUsePanel = ({
|
|
|
323
323
|
</div>
|
|
324
324
|
</div>
|
|
325
325
|
|
|
326
|
-
<div className="min-w-
|
|
326
|
+
<div className="min-w-72 flex-1">
|
|
327
327
|
<Combobox.Root
|
|
328
328
|
collection={collection}
|
|
329
329
|
value={[]}
|
|
@@ -9,11 +9,7 @@ import {
|
|
|
9
9
|
isContextPaneNode,
|
|
10
10
|
hasBeliefPayload,
|
|
11
11
|
} from '@/utils/compositor/typeGuards';
|
|
12
|
-
import {
|
|
13
|
-
settingsPanelStore,
|
|
14
|
-
viewportKeyStore,
|
|
15
|
-
fullContentMapStore,
|
|
16
|
-
} from '@/stores/storykeep';
|
|
12
|
+
import { settingsPanelStore, fullContentMapStore } from '@/stores/storykeep';
|
|
17
13
|
import { getCtx } from '@/stores/nodes';
|
|
18
14
|
import PaneTitlePanel from './PanePanel_title';
|
|
19
15
|
import PaneMagicPathPanel from './PanePanel_path';
|
|
@@ -34,8 +30,6 @@ const ConfigPanePanel = ({ nodeId }: ConfigPanePanelProps) => {
|
|
|
34
30
|
const isActiveMode =
|
|
35
31
|
activePaneMode.panel === 'settings' && activePaneMode.paneId === nodeId;
|
|
36
32
|
const $contentMap = useStore(fullContentMapStore);
|
|
37
|
-
const $viewportKey = useStore(viewportKeyStore);
|
|
38
|
-
const isMobile = $viewportKey.value === `mobile`;
|
|
39
33
|
|
|
40
34
|
const allNodes = ctx.allNodes.get();
|
|
41
35
|
const paneNode = allNodes.get(nodeId) as PaneNode;
|
|
@@ -200,7 +200,7 @@ const PaneImpressionPanel = ({ nodeId, setMode }: PaneImpressionPanelProps) => {
|
|
|
200
200
|
onChange={(e) => handleInputChange('body', e.target.value)}
|
|
201
201
|
onBlur={handleBlur}
|
|
202
202
|
placeholder="Enter impression body text"
|
|
203
|
-
className={`${commonInputClass} min-h-
|
|
203
|
+
className={`${commonInputClass} min-h-24`}
|
|
204
204
|
/>
|
|
205
205
|
</div>
|
|
206
206
|
|
|
@@ -130,7 +130,7 @@ const TemplatePreviewItem = ({
|
|
|
130
130
|
)}
|
|
131
131
|
</div>
|
|
132
132
|
<div className="p-3">
|
|
133
|
-
<h3 className="truncate font-
|
|
133
|
+
<h3 className="truncate font-bold" title={template.title}>
|
|
134
134
|
{template.title}
|
|
135
135
|
</h3>
|
|
136
136
|
<p className="text-sm text-gray-600">
|
|
@@ -404,9 +404,12 @@ export const RestylePaneModal = ({ config }: RestylePaneModalProps) => {
|
|
|
404
404
|
<Portal>
|
|
405
405
|
<Dialog.Backdrop className="z-103 fixed inset-0 bg-black/70" />
|
|
406
406
|
<Dialog.Positioner className="z-104 fixed inset-0 flex items-center justify-center">
|
|
407
|
-
<Dialog.Content
|
|
407
|
+
<Dialog.Content
|
|
408
|
+
className="flex flex-col rounded-lg bg-white shadow-2xl"
|
|
409
|
+
style={{ maxHeight: '90vw', width: '90vw' }}
|
|
410
|
+
>
|
|
408
411
|
<header className="flex items-center justify-between border-b p-4">
|
|
409
|
-
<Dialog.Title className="text-xl font-
|
|
412
|
+
<Dialog.Title className="text-xl font-bold">
|
|
410
413
|
Restyle Pane from Design Library
|
|
411
414
|
</Dialog.Title>
|
|
412
415
|
<Dialog.CloseTrigger
|
|
@@ -427,7 +430,7 @@ export const RestylePaneModal = ({ config }: RestylePaneModalProps) => {
|
|
|
427
430
|
className="w-48"
|
|
428
431
|
positioning={{ gutter: 4 }}
|
|
429
432
|
>
|
|
430
|
-
<Select.Label className="mb-1 text-sm font-
|
|
433
|
+
<Select.Label className="mb-1 text-sm font-bold">
|
|
431
434
|
Category
|
|
432
435
|
</Select.Label>
|
|
433
436
|
<Select.Control>
|
|
@@ -461,7 +464,7 @@ export const RestylePaneModal = ({ config }: RestylePaneModalProps) => {
|
|
|
461
464
|
className="flex-1"
|
|
462
465
|
positioning={{ gutter: 4 }}
|
|
463
466
|
>
|
|
464
|
-
<Combobox.Label className="mb-1 text-sm font-
|
|
467
|
+
<Combobox.Label className="mb-1 text-sm font-bold">
|
|
465
468
|
Filter by Title
|
|
466
469
|
</Combobox.Label>
|
|
467
470
|
<Combobox.Control>
|
|
@@ -37,11 +37,11 @@ export const AiDesignStep = ({
|
|
|
37
37
|
|
|
38
38
|
return (
|
|
39
39
|
<div className="space-y-6 rounded-lg bg-gray-50 p-4 shadow-inner">
|
|
40
|
-
<label className="block text-lg font-
|
|
40
|
+
<label className="block text-lg font-bold text-gray-800">
|
|
41
41
|
2. Configure AI Design
|
|
42
42
|
</label>
|
|
43
43
|
<div>
|
|
44
|
-
<label className="block text-base font-
|
|
44
|
+
<label className="block text-base font-bold text-gray-800">
|
|
45
45
|
Color Harmony
|
|
46
46
|
</label>
|
|
47
47
|
<div className="mt-2 flex flex-wrap gap-x-4 gap-y-2">
|
|
@@ -58,7 +58,7 @@ export const AiDesignStep = ({
|
|
|
58
58
|
/>
|
|
59
59
|
<label
|
|
60
60
|
htmlFor={`harmony-${option}`}
|
|
61
|
-
className="text-sm font-
|
|
61
|
+
className="text-sm font-bold text-gray-700"
|
|
62
62
|
>
|
|
63
63
|
{option}
|
|
64
64
|
</label>
|
|
@@ -89,7 +89,7 @@ export const AiDesignStep = ({
|
|
|
89
89
|
</div>
|
|
90
90
|
|
|
91
91
|
<div>
|
|
92
|
-
<label className="block text-base font-
|
|
92
|
+
<label className="block text-base font-bold text-gray-800">
|
|
93
93
|
Theme / Mood
|
|
94
94
|
</label>
|
|
95
95
|
<div className="mt-2 flex flex-wrap gap-x-4 gap-y-2">
|
|
@@ -106,7 +106,7 @@ export const AiDesignStep = ({
|
|
|
106
106
|
/>
|
|
107
107
|
<label
|
|
108
108
|
htmlFor={`theme-${option}`}
|
|
109
|
-
className="text-sm font-
|
|
109
|
+
className="text-sm font-bold text-gray-700"
|
|
110
110
|
>
|
|
111
111
|
{option}
|
|
112
112
|
</label>
|
|
@@ -118,7 +118,7 @@ export const AiDesignStep = ({
|
|
|
118
118
|
<div>
|
|
119
119
|
<label
|
|
120
120
|
htmlFor="additional-notes"
|
|
121
|
-
className="block text-base font-
|
|
121
|
+
className="block text-base font-bold text-gray-800"
|
|
122
122
|
>
|
|
123
123
|
Additional Design Notes (Optional)
|
|
124
124
|
</label>
|
|
@@ -30,7 +30,7 @@ export const CopyInputStep = ({
|
|
|
30
30
|
|
|
31
31
|
return (
|
|
32
32
|
<div className="space-y-4 rounded-lg bg-gray-50 p-4 shadow-inner">
|
|
33
|
-
<label className="block text-lg font-
|
|
33
|
+
<label className="block text-lg font-bold text-gray-800">
|
|
34
34
|
1. Provide Content
|
|
35
35
|
</label>
|
|
36
36
|
<div className="my-2 flex space-x-4">
|
|
@@ -46,7 +46,7 @@ export const CopyInputStep = ({
|
|
|
46
46
|
/>
|
|
47
47
|
<label
|
|
48
48
|
htmlFor="copy-prompt-mode"
|
|
49
|
-
className="text-sm font-
|
|
49
|
+
className="text-sm font-bold text-gray-700"
|
|
50
50
|
>
|
|
51
51
|
Write a prompt
|
|
52
52
|
</label>
|
|
@@ -63,7 +63,7 @@ export const CopyInputStep = ({
|
|
|
63
63
|
/>
|
|
64
64
|
<label
|
|
65
65
|
htmlFor="copy-raw-mode"
|
|
66
|
-
className="text-sm font-
|
|
66
|
+
className="text-sm font-bold text-gray-700"
|
|
67
67
|
>
|
|
68
68
|
Provide Copy (Markdown)
|
|
69
69
|
</label>
|
|
@@ -139,7 +139,7 @@ const TemplatePreviewItem = ({
|
|
|
139
139
|
</div>
|
|
140
140
|
</div>
|
|
141
141
|
<div className="flex-grow p-3">
|
|
142
|
-
<h3 className="truncate font-
|
|
142
|
+
<h3 className="truncate font-bold" title={title}>
|
|
143
143
|
{title}
|
|
144
144
|
</h3>
|
|
145
145
|
<p className="text-sm capitalize text-gray-600">{category}</p>
|
|
@@ -226,7 +226,7 @@ export const DesignLibraryStep = ({
|
|
|
226
226
|
|
|
227
227
|
return (
|
|
228
228
|
<div className="flex h-full flex-col space-y-4 rounded-lg bg-gray-50 p-4 shadow-inner">
|
|
229
|
-
<label className="block text-lg font-
|
|
229
|
+
<label className="block text-lg font-bold text-gray-800">
|
|
230
230
|
2. Choose a Design
|
|
231
231
|
</label>
|
|
232
232
|
|
|
@@ -241,7 +241,7 @@ export const DesignLibraryStep = ({
|
|
|
241
241
|
className="w-48"
|
|
242
242
|
positioning={{ gutter: 4 }}
|
|
243
243
|
>
|
|
244
|
-
<Select.Label className="mb-1 text-sm font-
|
|
244
|
+
<Select.Label className="mb-1 text-sm font-bold text-gray-700">
|
|
245
245
|
Category
|
|
246
246
|
</Select.Label>
|
|
247
247
|
<Select.Control>
|
|
@@ -280,7 +280,7 @@ export const DesignLibraryStep = ({
|
|
|
280
280
|
className="flex-1"
|
|
281
281
|
positioning={{ gutter: 4 }}
|
|
282
282
|
>
|
|
283
|
-
<Combobox.Label className="mb-1 text-sm font-
|
|
283
|
+
<Combobox.Label className="mb-1 text-sm font-bold text-gray-700">
|
|
284
284
|
Filter by Title
|
|
285
285
|
</Combobox.Label>
|
|
286
286
|
<Combobox.Control>
|
|
@@ -5,18 +5,22 @@ import {
|
|
|
5
5
|
settingsPanelStore,
|
|
6
6
|
} from '@/stores/storykeep';
|
|
7
7
|
import { StylesMemory } from '@/components/edit/state/StylesMemory';
|
|
8
|
-
import {
|
|
8
|
+
import {
|
|
9
|
+
isMarkdownPaneFragmentNode,
|
|
10
|
+
isGridLayoutNode,
|
|
11
|
+
} from '@/utils/compositor/typeGuards';
|
|
9
12
|
import SelectedTailwindClass from '@/components/fields/SelectedTailwindClass';
|
|
10
13
|
import { tagTitles } from '@/types/compositorTypes';
|
|
11
14
|
import type {
|
|
12
15
|
Tag,
|
|
13
16
|
FlatNode,
|
|
14
17
|
MarkdownPaneFragmentNode,
|
|
18
|
+
GridLayoutNode,
|
|
15
19
|
} from '@/types/compositorTypes';
|
|
16
20
|
|
|
17
|
-
interface StyleElementPanelProps {
|
|
21
|
+
export interface StyleElementPanelProps {
|
|
18
22
|
node: FlatNode;
|
|
19
|
-
parentNode: MarkdownPaneFragmentNode;
|
|
23
|
+
parentNode: MarkdownPaneFragmentNode | GridLayoutNode;
|
|
20
24
|
onTitleChange?: (title: string) => void;
|
|
21
25
|
}
|
|
22
26
|
|
|
@@ -25,7 +29,10 @@ const StyleElementPanel = ({
|
|
|
25
29
|
parentNode,
|
|
26
30
|
onTitleChange,
|
|
27
31
|
}: StyleElementPanelProps) => {
|
|
28
|
-
if (
|
|
32
|
+
if (
|
|
33
|
+
!node?.tagName ||
|
|
34
|
+
(!isMarkdownPaneFragmentNode(parentNode) && !isGridLayoutNode(parentNode))
|
|
35
|
+
) {
|
|
29
36
|
return null;
|
|
30
37
|
}
|
|
31
38
|
|
|
@@ -9,13 +9,13 @@ import {
|
|
|
9
9
|
settingsPanelStore,
|
|
10
10
|
} from '@/stores/storykeep';
|
|
11
11
|
import { tailwindClasses } from '@/utils/compositor/tailwindClasses';
|
|
12
|
-
import { isMarkdownPaneFragmentNode } from '@/utils/compositor/typeGuards';
|
|
13
|
-
import { useDropdownDirection } from '@/utils/helpers';
|
|
14
12
|
import {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
} from '@/
|
|
13
|
+
isMarkdownPaneFragmentNode,
|
|
14
|
+
isGridLayoutNode,
|
|
15
|
+
} from '@/utils/compositor/typeGuards';
|
|
16
|
+
import { useDropdownDirection } from '@/utils/helpers';
|
|
17
|
+
import type { StyleElementPanelProps } from './StyleElementPanel';
|
|
18
|
+
import { tagTitles, type Tag } from '@/types/compositorTypes';
|
|
19
19
|
|
|
20
20
|
const RECOMMENDED_STYLES: {
|
|
21
21
|
[key: string]: Array<{ key: string; title: string }>;
|
|
@@ -123,7 +123,7 @@ const StyleElementPanelAdd = ({
|
|
|
123
123
|
node,
|
|
124
124
|
parentNode,
|
|
125
125
|
onTitleChange,
|
|
126
|
-
}:
|
|
126
|
+
}: StyleElementPanelProps) => {
|
|
127
127
|
const [query, setQuery] = useState('');
|
|
128
128
|
const [showAdvanced, setShowAdvanced] = useState(false);
|
|
129
129
|
const [selectedStyle, setSelectedStyle] = useState<string | null>(null);
|
|
@@ -134,7 +134,7 @@ const StyleElementPanelAdd = ({
|
|
|
134
134
|
!node ||
|
|
135
135
|
!node.tagName ||
|
|
136
136
|
!parentNode ||
|
|
137
|
-
!isMarkdownPaneFragmentNode(parentNode)
|
|
137
|
+
(!isMarkdownPaneFragmentNode(parentNode) && !isGridLayoutNode(parentNode))
|
|
138
138
|
) {
|
|
139
139
|
return null;
|
|
140
140
|
}
|
|
@@ -6,22 +6,32 @@ import {
|
|
|
6
6
|
} from '@/stores/storykeep';
|
|
7
7
|
import { getCtx } from '@/stores/nodes';
|
|
8
8
|
import { tailwindClasses } from '@/utils/compositor/tailwindClasses';
|
|
9
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
isMarkdownPaneFragmentNode,
|
|
11
|
+
isGridLayoutNode,
|
|
12
|
+
} from '@/utils/compositor/typeGuards';
|
|
10
13
|
import { cloneDeep } from '@/utils/helpers';
|
|
11
14
|
import { tagTitles } from '@/types/compositorTypes';
|
|
12
15
|
import type {
|
|
13
16
|
Tag,
|
|
14
|
-
BasePanelProps,
|
|
15
17
|
FlatNode,
|
|
16
18
|
MarkdownPaneFragmentNode,
|
|
19
|
+
GridLayoutNode,
|
|
17
20
|
} from '@/types/compositorTypes';
|
|
18
21
|
|
|
22
|
+
export interface StyleElementRemovePanelProps {
|
|
23
|
+
node: FlatNode;
|
|
24
|
+
parentNode: MarkdownPaneFragmentNode | GridLayoutNode;
|
|
25
|
+
className: string;
|
|
26
|
+
onTitleChange?: (title: string) => void;
|
|
27
|
+
}
|
|
28
|
+
|
|
19
29
|
const StyleElementRemovePanel = ({
|
|
20
30
|
node,
|
|
21
31
|
parentNode,
|
|
22
32
|
className,
|
|
23
33
|
onTitleChange,
|
|
24
|
-
}:
|
|
34
|
+
}: StyleElementRemovePanelProps) => {
|
|
25
35
|
if (!className || !node?.tagName) return null;
|
|
26
36
|
|
|
27
37
|
const friendlyName = tailwindClasses[className]?.title || className;
|
|
@@ -40,7 +50,7 @@ const StyleElementRemovePanel = ({
|
|
|
40
50
|
!node ||
|
|
41
51
|
!className ||
|
|
42
52
|
!parentNode ||
|
|
43
|
-
!isMarkdownPaneFragmentNode(parentNode)
|
|
53
|
+
(!isMarkdownPaneFragmentNode(parentNode) && !isGridLayoutNode(parentNode))
|
|
44
54
|
) {
|
|
45
55
|
console.error('Missing required properties for class removal');
|
|
46
56
|
return;
|
|
@@ -7,15 +7,27 @@ import {
|
|
|
7
7
|
import ViewportComboBox from '@/components/fields/ViewportComboBox';
|
|
8
8
|
import { tailwindClasses } from '@/utils/compositor/tailwindClasses';
|
|
9
9
|
import { getCtx } from '@/stores/nodes';
|
|
10
|
-
import {
|
|
10
|
+
import {
|
|
11
|
+
isMarkdownPaneFragmentNode,
|
|
12
|
+
isGridLayoutNode,
|
|
13
|
+
} from '@/utils/compositor/typeGuards';
|
|
11
14
|
import { cloneDeep } from '@/utils/helpers';
|
|
12
15
|
import { tagTitles } from '@/types/compositorTypes';
|
|
13
16
|
import type {
|
|
14
17
|
Tag,
|
|
15
|
-
BasePanelProps,
|
|
16
18
|
FlatNode,
|
|
17
19
|
MarkdownPaneFragmentNode,
|
|
20
|
+
GridLayoutNode,
|
|
18
21
|
} from '@/types/compositorTypes';
|
|
22
|
+
import type { BrandConfig } from '@/types/tractstack';
|
|
23
|
+
|
|
24
|
+
export interface StyleElementUpdatePanelProps {
|
|
25
|
+
node: FlatNode;
|
|
26
|
+
parentNode: MarkdownPaneFragmentNode | GridLayoutNode;
|
|
27
|
+
className: string;
|
|
28
|
+
onTitleChange?: (title: string) => void;
|
|
29
|
+
config?: BrandConfig | null;
|
|
30
|
+
}
|
|
19
31
|
|
|
20
32
|
const StyleElementUpdatePanel = ({
|
|
21
33
|
node,
|
|
@@ -23,12 +35,12 @@ const StyleElementUpdatePanel = ({
|
|
|
23
35
|
className,
|
|
24
36
|
onTitleChange,
|
|
25
37
|
config,
|
|
26
|
-
}:
|
|
38
|
+
}: StyleElementUpdatePanelProps) => {
|
|
27
39
|
if (
|
|
28
40
|
!node ||
|
|
29
41
|
!className ||
|
|
30
42
|
!parentNode ||
|
|
31
|
-
!isMarkdownPaneFragmentNode(parentNode)
|
|
43
|
+
(!isMarkdownPaneFragmentNode(parentNode) && !isGridLayoutNode(parentNode))
|
|
32
44
|
)
|
|
33
45
|
return null;
|
|
34
46
|
|
|
@@ -2,20 +2,24 @@ import { useMemo, useState } from 'react';
|
|
|
2
2
|
import { getCtx } from '@/stores/nodes';
|
|
3
3
|
import { settingsPanelStore } from '@/stores/storykeep';
|
|
4
4
|
import { cloneDeep } from '@/utils/helpers';
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
isMarkdownPaneFragmentNode,
|
|
7
|
+
isGridLayoutNode,
|
|
8
|
+
} from '@/utils/compositor/typeGuards';
|
|
6
9
|
import { StylesMemory } from '@/components/edit/state/StylesMemory';
|
|
7
10
|
import SelectedTailwindClass from '@/components/fields/SelectedTailwindClass';
|
|
8
11
|
import ImageUpload, { type ImageParams } from '@/components/fields/ImageUpload';
|
|
9
12
|
import type {
|
|
10
13
|
FlatNode,
|
|
11
14
|
MarkdownPaneFragmentNode,
|
|
15
|
+
GridLayoutNode,
|
|
12
16
|
} from '@/types/compositorTypes';
|
|
13
17
|
|
|
14
18
|
interface StyleImagePanelProps {
|
|
15
19
|
node: FlatNode;
|
|
16
20
|
containerNode: FlatNode;
|
|
17
21
|
outerContainerNode: FlatNode;
|
|
18
|
-
parentNode: MarkdownPaneFragmentNode;
|
|
22
|
+
parentNode: MarkdownPaneFragmentNode | GridLayoutNode;
|
|
19
23
|
}
|
|
20
24
|
|
|
21
25
|
const StyleImagePanel = ({
|
|
@@ -300,7 +304,7 @@ const StyleImagePanel = ({
|
|
|
300
304
|
!node?.tagName ||
|
|
301
305
|
!containerNode?.tagName ||
|
|
302
306
|
!outerContainerNode?.tagName ||
|
|
303
|
-
!isMarkdownPaneFragmentNode(parentNode)
|
|
307
|
+
(!isMarkdownPaneFragmentNode(parentNode) && !isGridLayoutNode(parentNode))
|
|
304
308
|
) {
|
|
305
309
|
return null;
|
|
306
310
|
}
|
|
@@ -6,7 +6,10 @@ import CheckIcon from '@heroicons/react/24/outline/CheckIcon';
|
|
|
6
6
|
import { settingsPanelStore } from '@/stores/storykeep';
|
|
7
7
|
import { getCtx } from '@/stores/nodes';
|
|
8
8
|
import { tailwindClasses } from '@/utils/compositor/tailwindClasses';
|
|
9
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
isMarkdownPaneFragmentNode,
|
|
11
|
+
isGridLayoutNode,
|
|
12
|
+
} from '@/utils/compositor/typeGuards';
|
|
10
13
|
import { useDropdownDirection } from '@/utils/helpers';
|
|
11
14
|
import type { BasePanelProps } from '@/types/compositorTypes';
|
|
12
15
|
|
|
@@ -77,7 +80,11 @@ const StyleImagePanelAdd = ({ node, parentNode, childId }: BasePanelProps) => {
|
|
|
77
80
|
const comboboxRef = useRef<HTMLDivElement>(null);
|
|
78
81
|
const { openAbove } = useDropdownDirection(comboboxRef);
|
|
79
82
|
|
|
80
|
-
if (
|
|
83
|
+
if (
|
|
84
|
+
!node?.tagName ||
|
|
85
|
+
!parentNode ||
|
|
86
|
+
(!isMarkdownPaneFragmentNode(parentNode) && !isGridLayoutNode(parentNode))
|
|
87
|
+
)
|
|
81
88
|
return null;
|
|
82
89
|
|
|
83
90
|
const isOuterContainer = node.tagName === 'ul' || node.tagName === 'ol';
|
|
@@ -2,7 +2,10 @@ import { settingsPanelStore } from '@/stores/storykeep';
|
|
|
2
2
|
import { getCtx } from '@/stores/nodes';
|
|
3
3
|
import { tailwindClasses } from '@/utils/compositor/tailwindClasses';
|
|
4
4
|
import type { FlatNode, BasePanelProps } from '@/types/compositorTypes';
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
isMarkdownPaneFragmentNode,
|
|
7
|
+
isGridLayoutNode,
|
|
8
|
+
} from '@/utils/compositor/typeGuards';
|
|
6
9
|
import { cloneDeep } from '@/utils/helpers';
|
|
7
10
|
|
|
8
11
|
const StyleImageRemovePanel = ({
|
|
@@ -15,7 +18,7 @@ const StyleImageRemovePanel = ({
|
|
|
15
18
|
!className ||
|
|
16
19
|
!node?.tagName ||
|
|
17
20
|
!parentNode ||
|
|
18
|
-
!isMarkdownPaneFragmentNode(parentNode)
|
|
21
|
+
(!isMarkdownPaneFragmentNode(parentNode) && !isGridLayoutNode(parentNode))
|
|
19
22
|
) {
|
|
20
23
|
return null;
|
|
21
24
|
}
|
|
@@ -3,7 +3,10 @@ import { settingsPanelStore } from '@/stores/storykeep';
|
|
|
3
3
|
import { getCtx } from '@/stores/nodes';
|
|
4
4
|
import ViewportComboBox from '@/components/fields/ViewportComboBox';
|
|
5
5
|
import { tailwindClasses } from '@/utils/compositor/tailwindClasses';
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
isMarkdownPaneFragmentNode,
|
|
8
|
+
isGridLayoutNode,
|
|
9
|
+
} from '@/utils/compositor/typeGuards';
|
|
7
10
|
import { cloneDeep } from '@/utils/helpers';
|
|
8
11
|
import type {
|
|
9
12
|
BasePanelProps,
|
|
@@ -22,7 +25,7 @@ const StyleImageUpdatePanel = ({
|
|
|
22
25
|
!node ||
|
|
23
26
|
!className ||
|
|
24
27
|
!parentNode ||
|
|
25
|
-
!isMarkdownPaneFragmentNode(parentNode)
|
|
28
|
+
(!isMarkdownPaneFragmentNode(parentNode) && !isGridLayoutNode(parentNode))
|
|
26
29
|
)
|
|
27
30
|
return null;
|
|
28
31
|
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { useMemo } from 'react';
|
|
2
2
|
import { settingsPanelStore } from '@/stores/storykeep';
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
isMarkdownPaneFragmentNode,
|
|
5
|
+
isGridLayoutNode,
|
|
6
|
+
} from '@/utils/compositor/typeGuards';
|
|
4
7
|
import SelectedTailwindClass from '@/components/fields/SelectedTailwindClass';
|
|
5
8
|
import { StylesMemory } from '@/components/edit/state/StylesMemory';
|
|
6
9
|
import { tagTitles } from '@/types/compositorTypes';
|
|
@@ -8,12 +11,13 @@ import type {
|
|
|
8
11
|
Tag,
|
|
9
12
|
FlatNode,
|
|
10
13
|
MarkdownPaneFragmentNode,
|
|
14
|
+
GridLayoutNode,
|
|
11
15
|
} from '@/types/compositorTypes';
|
|
12
16
|
|
|
13
17
|
interface StyleLiElementPanelProps {
|
|
14
18
|
node: FlatNode;
|
|
15
19
|
outerContainerNode: FlatNode;
|
|
16
|
-
parentNode: MarkdownPaneFragmentNode;
|
|
20
|
+
parentNode: MarkdownPaneFragmentNode | GridLayoutNode;
|
|
17
21
|
}
|
|
18
22
|
|
|
19
23
|
const StyleLiElementPanel = ({
|
|
@@ -24,7 +28,7 @@ const StyleLiElementPanel = ({
|
|
|
24
28
|
if (
|
|
25
29
|
!node?.tagName ||
|
|
26
30
|
!outerContainerNode?.tagName ||
|
|
27
|
-
!isMarkdownPaneFragmentNode(parentNode)
|
|
31
|
+
(!isMarkdownPaneFragmentNode(parentNode) && !isGridLayoutNode(parentNode))
|
|
28
32
|
) {
|
|
29
33
|
return null;
|
|
30
34
|
}
|
|
@@ -6,7 +6,10 @@ import CheckIcon from '@heroicons/react/24/outline/CheckIcon';
|
|
|
6
6
|
import { settingsPanelStore } from '@/stores/storykeep';
|
|
7
7
|
import { getCtx } from '@/stores/nodes';
|
|
8
8
|
import { tailwindClasses } from '@/utils/compositor/tailwindClasses';
|
|
9
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
isMarkdownPaneFragmentNode,
|
|
11
|
+
isGridLayoutNode,
|
|
12
|
+
} from '@/utils/compositor/typeGuards';
|
|
10
13
|
import { useDropdownDirection } from '@/utils/helpers';
|
|
11
14
|
import type { BasePanelProps, FlatNode } from '@/types/compositorTypes';
|
|
12
15
|
|
|
@@ -70,7 +73,11 @@ const StyleLiElementAddPanel = ({
|
|
|
70
73
|
const comboboxRef = useRef<HTMLDivElement>(null);
|
|
71
74
|
const { openAbove } = useDropdownDirection(comboboxRef);
|
|
72
75
|
|
|
73
|
-
if (
|
|
76
|
+
if (
|
|
77
|
+
!node?.tagName ||
|
|
78
|
+
!parentNode ||
|
|
79
|
+
(!isMarkdownPaneFragmentNode(parentNode) && !isGridLayoutNode(parentNode))
|
|
80
|
+
)
|
|
74
81
|
return null;
|
|
75
82
|
|
|
76
83
|
const isContainer = node.tagName === 'ul' || node.tagName === 'ol';
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { settingsPanelStore } from '@/stores/storykeep';
|
|
2
2
|
import { getCtx } from '@/stores/nodes';
|
|
3
3
|
import { tailwindClasses } from '@/utils/compositor/tailwindClasses';
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
isMarkdownPaneFragmentNode,
|
|
6
|
+
isGridLayoutNode,
|
|
7
|
+
} from '@/utils/compositor/typeGuards';
|
|
5
8
|
import { cloneDeep } from '@/utils/helpers';
|
|
6
9
|
import type {
|
|
7
10
|
BasePanelProps,
|
|
@@ -19,7 +22,7 @@ const StyleLiElementRemovePanel = ({
|
|
|
19
22
|
!className ||
|
|
20
23
|
!node?.tagName ||
|
|
21
24
|
!parentNode ||
|
|
22
|
-
!isMarkdownPaneFragmentNode(parentNode)
|
|
25
|
+
(!isMarkdownPaneFragmentNode(parentNode) && !isGridLayoutNode(parentNode))
|
|
23
26
|
)
|
|
24
27
|
return null;
|
|
25
28
|
|
|
@@ -3,7 +3,10 @@ import { settingsPanelStore } from '@/stores/storykeep';
|
|
|
3
3
|
import { getCtx } from '@/stores/nodes';
|
|
4
4
|
import ViewportComboBox from '@/components/fields/ViewportComboBox';
|
|
5
5
|
import { tailwindClasses } from '@/utils/compositor/tailwindClasses';
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
isMarkdownPaneFragmentNode,
|
|
8
|
+
isGridLayoutNode,
|
|
9
|
+
} from '@/utils/compositor/typeGuards';
|
|
7
10
|
import { cloneDeep } from '@/utils/helpers';
|
|
8
11
|
import type {
|
|
9
12
|
BasePanelProps,
|
|
@@ -22,7 +25,7 @@ const StyleLiElementUpdatePanel = ({
|
|
|
22
25
|
!node ||
|
|
23
26
|
!className ||
|
|
24
27
|
!parentNode ||
|
|
25
|
-
!isMarkdownPaneFragmentNode(parentNode)
|
|
28
|
+
(!isMarkdownPaneFragmentNode(parentNode) && !isGridLayoutNode(parentNode))
|
|
26
29
|
)
|
|
27
30
|
return null;
|
|
28
31
|
|