astro-tractstack 2.0.16 → 2.0.18
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 +24 -0
- package/package.json +1 -1
- package/templates/custom/with-examples/SandboxLauncher.tsx +11 -9
- 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/nodes/Pane_DesignLibrary.tsx +1 -1
- 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 +184 -151
- 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/pane/steps/DirectInjectStep.tsx +96 -0
- 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 +8 -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 +1 -1
- package/templates/src/constants.ts +1 -0
- package/templates/src/stores/nodes.ts +110 -33
- package/templates/src/stores/storykeep.ts +3 -1
- package/templates/src/types/compositorTypes.ts +37 -2
- package/templates/src/utils/compositor/TemplateNodes.ts +8 -0
- package/templates/src/utils/compositor/aiPaneParser.ts +8 -2
- 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 +24 -0
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import { parseAiPane } from '@/utils/compositor/aiPaneParser';
|
|
3
|
+
import type { TemplatePane } from '@/types/compositorTypes';
|
|
4
|
+
|
|
5
|
+
interface DirectInjectStepProps {
|
|
6
|
+
onBack: () => void;
|
|
7
|
+
onCreatePane: (template: TemplatePane) => void;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const DirectInjectStep = ({
|
|
11
|
+
onBack,
|
|
12
|
+
onCreatePane,
|
|
13
|
+
}: DirectInjectStepProps) => {
|
|
14
|
+
const [shellJson, setShellJson] = useState('');
|
|
15
|
+
const [copyHtml, setCopyHtml] = useState('');
|
|
16
|
+
const [error, setError] = useState<string | null>(null);
|
|
17
|
+
|
|
18
|
+
const handleCreate = () => {
|
|
19
|
+
setError(null);
|
|
20
|
+
if (!shellJson.trim() || !copyHtml.trim()) {
|
|
21
|
+
setError('Both Shell JSON and Inner HTML must be provided.');
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
try {
|
|
26
|
+
const finalPane = parseAiPane(shellJson, copyHtml, 'DirectInject');
|
|
27
|
+
onCreatePane(finalPane);
|
|
28
|
+
} catch (err: any) {
|
|
29
|
+
console.error('Direct Inject Error:', err);
|
|
30
|
+
setError(
|
|
31
|
+
`Failed to parse inputs: ${err.message || 'Unknown error'}. Check console.`
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
return (
|
|
37
|
+
<div className="space-y-6 p-4">
|
|
38
|
+
<div className="space-y-4">
|
|
39
|
+
<div>
|
|
40
|
+
<label
|
|
41
|
+
htmlFor="shellJson"
|
|
42
|
+
className="block text-sm font-bold text-gray-700"
|
|
43
|
+
>
|
|
44
|
+
Shell JSON
|
|
45
|
+
</label>
|
|
46
|
+
<textarea
|
|
47
|
+
id="shellJson"
|
|
48
|
+
rows={10}
|
|
49
|
+
value={shellJson}
|
|
50
|
+
onChange={(e) => setShellJson(e.target.value)}
|
|
51
|
+
className="mt-1 block w-full rounded-md border-gray-300 p-2 font-mono text-sm shadow-sm focus:border-cyan-500 focus:ring-cyan-500"
|
|
52
|
+
placeholder={`{ "bgColour": "#ffffff", "parentClasses": [...], "defaultClasses": {...} }`}
|
|
53
|
+
/>
|
|
54
|
+
</div>
|
|
55
|
+
<div>
|
|
56
|
+
<label
|
|
57
|
+
htmlFor="copyHtml"
|
|
58
|
+
className="block text-sm font-bold text-gray-700"
|
|
59
|
+
>
|
|
60
|
+
Inner HTML
|
|
61
|
+
</label>
|
|
62
|
+
<textarea
|
|
63
|
+
id="copyHtml"
|
|
64
|
+
rows={10}
|
|
65
|
+
value={copyHtml}
|
|
66
|
+
onChange={(e) => setCopyHtml(e.target.value)}
|
|
67
|
+
className="mt-1 block w-full rounded-md border-gray-300 p-2 font-mono text-sm shadow-sm focus:border-cyan-500 focus:ring-cyan-500"
|
|
68
|
+
placeholder={`<h2 class="...">...</h2>\n<p class="...">...</p>`}
|
|
69
|
+
/>
|
|
70
|
+
</div>
|
|
71
|
+
</div>
|
|
72
|
+
|
|
73
|
+
{error && (
|
|
74
|
+
<div className="rounded-md bg-red-50 p-4">
|
|
75
|
+
<p className="text-sm font-bold text-red-800">{error}</p>
|
|
76
|
+
</div>
|
|
77
|
+
)}
|
|
78
|
+
|
|
79
|
+
<div className="flex justify-between">
|
|
80
|
+
<button
|
|
81
|
+
onClick={onBack}
|
|
82
|
+
className="rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-bold text-gray-700 shadow-sm hover:bg-gray-50"
|
|
83
|
+
>
|
|
84
|
+
← Back
|
|
85
|
+
</button>
|
|
86
|
+
<button
|
|
87
|
+
onClick={handleCreate}
|
|
88
|
+
disabled={!shellJson.trim() || !copyHtml.trim()}
|
|
89
|
+
className="rounded-md bg-cyan-600 px-4 py-2 text-sm font-bold text-white shadow-sm hover:bg-cyan-700 disabled:cursor-not-allowed disabled:bg-gray-400"
|
|
90
|
+
>
|
|
91
|
+
Create Pane
|
|
92
|
+
</button>
|
|
93
|
+
</div>
|
|
94
|
+
</div>
|
|
95
|
+
);
|
|
96
|
+
};
|
|
@@ -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 = ({
|
|
@@ -24,6 +28,7 @@ const StyleImagePanel = ({
|
|
|
24
28
|
outerContainerNode,
|
|
25
29
|
parentNode,
|
|
26
30
|
}: StyleImagePanelProps) => {
|
|
31
|
+
console.log(`StyleImagePanel`, parentNode, node);
|
|
27
32
|
const [altDescription, setAltDescription] = useState(node.alt || '');
|
|
28
33
|
|
|
29
34
|
const imgDefaultClasses = parentNode.defaultClasses?.[node.tagName];
|
|
@@ -300,7 +305,7 @@ const StyleImagePanel = ({
|
|
|
300
305
|
!node?.tagName ||
|
|
301
306
|
!containerNode?.tagName ||
|
|
302
307
|
!outerContainerNode?.tagName ||
|
|
303
|
-
!isMarkdownPaneFragmentNode(parentNode)
|
|
308
|
+
(!isMarkdownPaneFragmentNode(parentNode) && !isGridLayoutNode(parentNode))
|
|
304
309
|
) {
|
|
305
310
|
return null;
|
|
306
311
|
}
|
|
@@ -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
|
|