astro-tractstack 2.1.3 → 2.2.1
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/README.md +54 -266
- package/bin/create-tractstack.js +9 -6
- package/dist/index.js +109 -71
- package/package.json +4 -2
- package/templates/css/custom.css +5 -0
- package/templates/icons/code.svg +18 -0
- package/templates/icons/li.svg +4 -0
- package/templates/icons/link.svg +22 -0
- package/templates/icons/p.svg +3 -0
- package/templates/src/client/app.js +80 -1
- package/templates/src/components/Footer.astro +1 -1
- package/templates/src/components/codehooks/BunnyVideoSetup.tsx +6 -6
- package/templates/src/components/codehooks/EpinetDurationSelector.tsx +3 -3
- package/templates/src/components/codehooks/FeaturedArticleSetup.tsx +1 -1
- package/templates/src/components/codehooks/ListContentSetup.tsx +2 -2
- package/templates/src/components/codehooks/ProductCardSetup.tsx +1 -1
- package/templates/src/components/codehooks/ProductGridSetup.tsx +2 -2
- package/templates/src/components/codehooks/SandboxRegisterForm.tsx +3 -3
- package/templates/src/components/compositor/Compositor.tsx +25 -9
- package/templates/src/components/compositor/Node.tsx +168 -496
- package/templates/src/components/compositor/PanelVisibilityWrapper.tsx +1 -0
- package/templates/src/components/compositor/elements/SignUp.tsx +1 -1
- package/templates/src/components/compositor/elements/YouTubeWrapper.tsx +2 -0
- package/templates/src/components/compositor/nodes/CreativePane.tsx +262 -0
- package/templates/src/components/compositor/nodes/GhostInsertBlock.tsx +4 -6
- package/templates/src/components/compositor/nodes/GridLayout.tsx +4 -2
- package/templates/src/components/compositor/nodes/Markdown.tsx +18 -3
- package/templates/src/components/compositor/nodes/Pane.tsx +11 -5
- package/templates/src/components/compositor/nodes/RenderChildren.tsx +1 -1
- package/templates/src/components/compositor/nodes/tagElements/NodeAnchorComponent.tsx +5 -5
- package/templates/src/components/compositor/nodes/tagElements/NodeBasicTag.tsx +90 -42
- package/templates/src/components/compositor/nodes/tagElements/NodeImg.tsx +2 -0
- package/templates/src/components/compositor/nodes/tagElements/NodeText.tsx +27 -1
- package/templates/src/components/compositor/preview/PaneSnapshotGenerator.tsx +10 -8
- package/templates/src/components/compositor/tools/NodeOverlay.tsx +224 -0
- package/templates/src/components/compositor/tools/PaneOverlay.tsx +122 -0
- package/templates/src/components/edit/Header.tsx +68 -9
- package/templates/src/components/edit/PanelSwitch.tsx +42 -4
- package/templates/src/components/edit/SettingsPanel.tsx +2 -3
- package/templates/src/components/edit/ToolMode.tsx +1 -31
- package/templates/src/components/edit/pane/AddPanePanel_break.tsx +2 -2
- package/templates/src/components/edit/pane/AddPanePanel_codehook.tsx +1 -1
- package/templates/src/components/edit/pane/AddPanePanel_new.tsx +193 -659
- package/templates/src/components/edit/pane/AddPanePanel_reuse.tsx +15 -82
- package/templates/src/components/edit/pane/AiRestylePaneModal.tsx +95 -45
- package/templates/src/components/edit/pane/ConfigPanePanel.tsx +137 -49
- package/templates/src/components/edit/pane/RestylePaneModal.tsx +1 -1
- package/templates/src/components/edit/pane/steps/AiCreativeDesignStep.tsx +375 -0
- package/templates/src/components/edit/pane/steps/AiDesignStep.tsx +1 -23
- package/templates/src/components/edit/pane/steps/AiLibraryCopyStep.tsx +327 -0
- package/templates/src/components/edit/pane/steps/AiRefineDesignStep.tsx +267 -0
- package/templates/src/components/edit/pane/steps/AiStandardDesignStep.tsx +371 -0
- package/templates/src/components/edit/pane/steps/CopyInputStep.tsx +201 -76
- package/templates/src/components/edit/pane/steps/CreativeInjectStep.tsx +141 -0
- package/templates/src/components/edit/panels/CreativeImagePanel.tsx +435 -0
- package/templates/src/components/edit/panels/CreativeLinkPanel.tsx +110 -0
- package/templates/src/components/edit/panels/StyleCodeHookPanel.tsx +1 -1
- package/templates/src/components/edit/panels/StyleParentPanel.tsx +118 -126
- package/templates/src/components/edit/panels/StyleParentPanel_add.tsx +3 -2
- package/templates/src/components/edit/panels/StyleParentPanel_deleteLayer.tsx +1 -0
- package/templates/src/components/edit/panels/StyleParentPanel_remove.tsx +3 -1
- package/templates/src/components/edit/panels/StyleParentPanel_update.tsx +3 -1
- package/templates/src/components/edit/panels/StyleWidgetPanel.tsx +1 -1
- package/templates/src/components/edit/state/SaveModal.tsx +19 -787
- package/templates/src/components/edit/state/SaveToLibraryModal.tsx +2 -2
- package/templates/src/components/edit/storyfragment/StoryFragmentPanel_menu.tsx +1 -1
- package/templates/src/components/edit/widgets/BunnyWidget.tsx +5 -5
- package/templates/src/components/edit/widgets/InteractiveDisclosureWidget.tsx +1 -1
- package/templates/src/components/edit/widgets/SignupWidget.tsx +1 -1
- package/templates/src/components/fields/ActionBuilderTimeSelector.tsx +1 -1
- package/templates/src/components/fields/ArtpackImage.tsx +11 -3
- package/templates/src/components/fields/BackgroundImage.tsx +8 -0
- package/templates/src/components/fields/BackgroundImageWrapper.tsx +15 -9
- package/templates/src/components/fields/ImageUpload.tsx +6 -0
- package/templates/src/components/form/ActionBuilderField.tsx +15 -5
- package/templates/src/components/form/ActionBuilderSlugSelector.tsx +1 -1
- package/templates/src/components/form/ColorPicker.tsx +1 -1
- package/templates/src/components/form/EnumSelect.tsx +1 -1
- package/templates/src/components/form/NumberInput.tsx +1 -1
- package/templates/src/components/form/StringArrayInput.tsx +1 -1
- package/templates/src/components/form/StringInput.tsx +1 -1
- package/templates/src/components/form/UnsavedChangesBar.tsx +1 -1
- package/templates/src/components/form/advanced/APIConfigSection.tsx +2 -2
- package/templates/src/components/form/advanced/AuthConfigSection.tsx +2 -2
- package/templates/src/components/profile/ProfileCreate.tsx +1 -1
- package/templates/src/components/profile/ProfileEdit.tsx +1 -1
- package/templates/src/components/storykeep/Dashboard_Advanced.tsx +2 -2
- package/templates/src/components/storykeep/controls/content/BeliefForm.tsx +1 -1
- package/templates/src/components/storykeep/controls/content/ContentSummary.tsx +2 -2
- package/templates/src/components/storykeep/controls/content/KnownResourceTable.tsx +1 -1
- package/templates/src/components/storykeep/controls/content/ManageContent.tsx +6 -6
- package/templates/src/components/storykeep/controls/content/MenuForm.tsx +1 -1
- package/templates/src/components/storykeep/controls/content/PaneTable.tsx +358 -0
- package/templates/src/components/storykeep/controls/content/ResourceTable.tsx +1 -1
- package/templates/src/constants/prompts.json +18 -10
- package/templates/src/constants.ts +3 -0
- package/templates/src/hooks/usePaneFragments.ts +60 -0
- package/templates/src/lib/session.ts +71 -16
- package/templates/src/pages/[...slug].astro +4 -46
- package/templates/src/pages/api/css.ts +149 -0
- package/templates/src/pages/maint.astro +1 -1
- package/templates/src/pages/storykeep/login.astro +2 -2
- package/templates/src/stores/nodes.ts +162 -49
- package/templates/src/stores/orphanAnalysis.ts +6 -30
- package/templates/src/stores/previews.ts +7 -0
- package/templates/src/stores/storykeep.ts +0 -8
- package/templates/src/types/compositorTypes.ts +53 -10
- package/templates/src/utils/compositor/aiGeneration.ts +93 -0
- package/templates/src/utils/compositor/allowInsert.ts +2 -0
- package/templates/src/utils/compositor/htmlAst.ts +704 -0
- package/templates/src/utils/compositor/nodesHelper.ts +281 -102
- package/templates/src/utils/compositor/savePipeline.ts +893 -0
- package/templates/src/utils/etl/index.ts +3 -0
- package/templates/src/utils/etl/transformer.ts +10 -0
- package/templates/src/utils/helpers.ts +101 -0
- package/utils/inject-files.ts +100 -62
- package/templates/icons/text.svg +0 -6
- package/templates/src/components/compositor/NodeWithGuid.tsx +0 -69
- package/templates/src/components/compositor/nodes/GridLayout_eraser.tsx +0 -33
- package/templates/src/components/compositor/nodes/Markdown_eraser.tsx +0 -56
- package/templates/src/components/compositor/nodes/Pane_DesignLibrary.tsx +0 -269
- package/templates/src/components/compositor/nodes/Pane_eraser.tsx +0 -186
- package/templates/src/components/compositor/nodes/Pane_layout.tsx +0 -79
- package/templates/src/components/compositor/nodes/tagElements/NodeA_eraser.tsx +0 -26
- package/templates/src/components/compositor/nodes/tagElements/NodeBasicTag_eraser.tsx +0 -61
- package/templates/src/components/compositor/nodes/tagElements/NodeBasicTag_insert.tsx +0 -120
- package/templates/src/components/compositor/nodes/tagElements/NodeBasicTag_settings.tsx +0 -62
- package/templates/src/components/compositor/nodes/tagElements/NodeButton_eraser.tsx +0 -26
|
@@ -123,7 +123,7 @@ export default function SandboxRegisterForm({
|
|
|
123
123
|
value={firstname}
|
|
124
124
|
onChange={(e) => setFirstname(e.target.value)}
|
|
125
125
|
disabled={isLoading}
|
|
126
|
-
className="
|
|
126
|
+
className="mt-1 block w-full rounded-md border-gray-300 px-3 py-2 shadow-sm focus:border-cyan-500 focus:ring-cyan-500 md:text-sm"
|
|
127
127
|
required
|
|
128
128
|
/>
|
|
129
129
|
</div>
|
|
@@ -140,7 +140,7 @@ export default function SandboxRegisterForm({
|
|
|
140
140
|
value={email}
|
|
141
141
|
onChange={(e) => setEmail(e.target.value)}
|
|
142
142
|
disabled={isLoading}
|
|
143
|
-
className="
|
|
143
|
+
className="mt-1 block w-full rounded-md border-gray-300 px-3 py-2 shadow-sm focus:border-cyan-500 focus:ring-cyan-500 md:text-sm"
|
|
144
144
|
required
|
|
145
145
|
/>
|
|
146
146
|
</div>
|
|
@@ -157,7 +157,7 @@ export default function SandboxRegisterForm({
|
|
|
157
157
|
value={codeword}
|
|
158
158
|
onChange={(e) => setCodeword(e.target.value)}
|
|
159
159
|
disabled={isLoading}
|
|
160
|
-
className="
|
|
160
|
+
className="mt-1 block w-full rounded-md border-gray-300 px-3 py-2 shadow-sm focus:border-cyan-500 focus:ring-cyan-500 md:text-sm"
|
|
161
161
|
required
|
|
162
162
|
/>
|
|
163
163
|
</div>
|
|
@@ -21,8 +21,8 @@ import {
|
|
|
21
21
|
sandboxTokenStore,
|
|
22
22
|
} from '@/stores/storykeep';
|
|
23
23
|
import { getCtx, ROOT_NODE_NAME, type NodesContext } from '@/stores/nodes';
|
|
24
|
-
import { stopLoadingAnimation } from '@/utils/helpers';
|
|
25
|
-
import Node from './Node';
|
|
24
|
+
import { resolveCollisions, stopLoadingAnimation } from '@/utils/helpers';
|
|
25
|
+
import { Node } from './Node';
|
|
26
26
|
import { ARTPACKS } from '@/constants/brandThemes';
|
|
27
27
|
import {
|
|
28
28
|
selectionStore,
|
|
@@ -288,6 +288,15 @@ export const Compositor = (props: CompositorProps) => {
|
|
|
288
288
|
selectionOrigin.current = null;
|
|
289
289
|
};
|
|
290
290
|
|
|
291
|
+
useEffect(() => {
|
|
292
|
+
window.addEventListener('resize', resolveCollisions);
|
|
293
|
+
return () => window.removeEventListener('resize', resolveCollisions);
|
|
294
|
+
}, []);
|
|
295
|
+
|
|
296
|
+
useEffect(() => {
|
|
297
|
+
resolveCollisions();
|
|
298
|
+
});
|
|
299
|
+
|
|
291
300
|
useEffect(() => {
|
|
292
301
|
if (viewportModeStore.get() === 'auto') {
|
|
293
302
|
setViewportMode('auto');
|
|
@@ -352,10 +361,16 @@ export const Compositor = (props: CompositorProps) => {
|
|
|
352
361
|
}
|
|
353
362
|
);
|
|
354
363
|
|
|
364
|
+
const unsubscribeToolAddMode = getCtx(props).toolAddModeStore.subscribe(
|
|
365
|
+
(mode) => {
|
|
366
|
+
if (mode.value !== 'span') resetSelectionStore();
|
|
367
|
+
}
|
|
368
|
+
);
|
|
369
|
+
|
|
355
370
|
const unsubscribeToolMode = getCtx(props).toolModeValStore.subscribe(
|
|
356
371
|
(mode) => {
|
|
357
372
|
if (VERBOSE) console.log(LOG_PREFIX + 'Tool mode changed:', mode.value);
|
|
358
|
-
if (mode.value !== '
|
|
373
|
+
if (mode.value !== 'insert') {
|
|
359
374
|
if (VERBOSE)
|
|
360
375
|
console.log(
|
|
361
376
|
LOG_PREFIX + 'Exited styles mode, resetting selection store.'
|
|
@@ -384,6 +399,7 @@ export const Compositor = (props: CompositorProps) => {
|
|
|
384
399
|
console.log(LOG_PREFIX + 'Compositor unmounting, cleaning up...');
|
|
385
400
|
unsubscribe();
|
|
386
401
|
unsubscribeToolMode();
|
|
402
|
+
unsubscribeToolAddMode();
|
|
387
403
|
stopLoadingAnimation();
|
|
388
404
|
// Ensure listeners are removed on unmount
|
|
389
405
|
window.removeEventListener('mousemove', handleDragMove);
|
|
@@ -417,6 +433,8 @@ export const Compositor = (props: CompositorProps) => {
|
|
|
417
433
|
'span'
|
|
418
434
|
);
|
|
419
435
|
if (newSpanNodeId) {
|
|
436
|
+
ctx.toolModeValStore.set({ value: 'text' });
|
|
437
|
+
ctx.toolAddModeStore.set({ value: 'p' });
|
|
420
438
|
settingsPanelStore.set({
|
|
421
439
|
action: 'style-element',
|
|
422
440
|
nodeId: newSpanNodeId,
|
|
@@ -480,12 +498,10 @@ export const Compositor = (props: CompositorProps) => {
|
|
|
480
498
|
>
|
|
481
499
|
{/* Loading indicator */}
|
|
482
500
|
{isLoading && (
|
|
483
|
-
<div
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
</div>
|
|
488
|
-
</div>
|
|
501
|
+
<div
|
|
502
|
+
className="absolute inset-0 flex items-center justify-center"
|
|
503
|
+
style={{ zIndex: '1007' }}
|
|
504
|
+
></div>
|
|
489
505
|
)}
|
|
490
506
|
|
|
491
507
|
{/* Selection drag box */}
|