astro-tractstack 2.0.13 → 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.
Files changed (28) hide show
  1. package/dist/index.js +40 -0
  2. package/package.json +1 -1
  3. package/templates/src/client/view.js +5 -0
  4. package/templates/src/components/compositor/Compositor.tsx +3 -2
  5. package/templates/src/components/compositor/Node.tsx +25 -8
  6. package/templates/src/components/compositor/nodes/Pane_DesignLibrary.tsx +105 -0
  7. package/templates/src/components/edit/ToolMode.tsx +7 -0
  8. package/templates/src/components/edit/pane/AddPanePanel_new.tsx +459 -561
  9. package/templates/src/components/edit/pane/AiPaneGenerator.tsx +19 -82
  10. package/templates/src/components/edit/pane/RestylePaneModal.tsx +573 -0
  11. package/templates/src/components/edit/pane/steps/AiDesignStep.tsx +140 -0
  12. package/templates/src/components/edit/pane/steps/CopyInputStep.tsx +105 -0
  13. package/templates/src/components/edit/pane/steps/DesignLibraryStep.tsx +395 -0
  14. package/templates/src/components/edit/state/SaveToLibraryModal.tsx +205 -0
  15. package/templates/src/constants/prompts.json +3 -1
  16. package/templates/src/stores/selection.ts +4 -0
  17. package/templates/src/types/compositorTypes.ts +51 -1
  18. package/templates/src/types/tractstack.ts +36 -31
  19. package/templates/src/utils/aai/getTitleSlug.ts +1 -1
  20. package/templates/src/utils/api/brandConfig.ts +8 -2
  21. package/templates/src/utils/api/brandHelpers.ts +4 -0
  22. package/templates/src/utils/compositor/aiPaneParser.ts +32 -84
  23. package/templates/src/utils/compositor/designLibraryHelper.ts +416 -0
  24. package/templates/src/utils/compositor/processMarkdown.ts +1 -1
  25. package/utils/inject-files.ts +40 -0
  26. package/templates/src/components/edit/pane/PageGen.tsx +0 -485
  27. package/templates/src/components/edit/pane/PageGenSelector.tsx +0 -245
  28. package/templates/src/components/edit/pane/PageGenSpecial.tsx +0 -339
@@ -1,10 +1,11 @@
1
1
  import { useState, useCallback } from 'react';
2
- import { AiPanePreview } from './AiPanePreview';
3
- import type { TemplatePane } from '@/types/compositorTypes';
4
2
  import prompts from '@/constants/prompts.json';
5
3
  import ColorPickerCombo from '@/components/fields/ColorPickerCombo';
4
+ import { AiPanePreview } from './AiPanePreview';
5
+ import { CopyInputStep } from './steps/CopyInputStep';
6
6
  import { parseAiPane } from '@/utils/compositor/aiPaneParser';
7
7
  import { classNames } from '@/utils/helpers';
8
+ import type { TemplatePane } from '@/types/compositorTypes';
8
9
  import type { BrandConfig } from '@/types/tractstack';
9
10
 
10
11
  interface AiPaneGeneratorProps {
@@ -73,7 +74,7 @@ export function AiPaneGenerator({
73
74
  const requestBody = {
74
75
  prompt: prompt,
75
76
  input_text: context,
76
- final_model: 'anthropic/claude-3-5-sonnet',
77
+ final_model: '',
77
78
  temperature: 0.5,
78
79
  max_tokens: 2000,
79
80
  };
@@ -300,7 +301,7 @@ export function AiPaneGenerator({
300
301
  <div>
301
302
  <label
302
303
  htmlFor="shell-json"
303
- className="block text-lg font-semibold text-gray-800"
304
+ className="block text-lg font-bold text-gray-800"
304
305
  >
305
306
  Shell JSON Payload
306
307
  </label>
@@ -317,7 +318,7 @@ export function AiPaneGenerator({
317
318
  <div>
318
319
  <label
319
320
  htmlFor="copy-html"
320
- className="block text-lg font-semibold text-gray-800"
321
+ className="block text-lg font-bold text-gray-800"
321
322
  >
322
323
  Copy HTML Payload
323
324
  </label>
@@ -361,7 +362,7 @@ export function AiPaneGenerator({
361
362
  return (
362
363
  <div className="space-y-6 p-4">
363
364
  <div>
364
- <label className="block text-lg font-semibold text-gray-800">
365
+ <label className="block text-lg font-bold text-gray-800">
365
366
  Color Harmony
366
367
  </label>
367
368
  <div className="mt-2 flex flex-wrap gap-x-4 gap-y-2">
@@ -378,7 +379,7 @@ export function AiPaneGenerator({
378
379
  />
379
380
  <label
380
381
  htmlFor={`harmony-${option}`}
381
- className="text-sm font-medium text-gray-700"
382
+ className="text-sm font-bold text-gray-700"
382
383
  >
383
384
  {option}
384
385
  </label>
@@ -409,7 +410,7 @@ export function AiPaneGenerator({
409
410
  </div>
410
411
 
411
412
  <div>
412
- <label className="block text-lg font-semibold text-gray-800">
413
+ <label className="block text-lg font-bold text-gray-800">
413
414
  Theme / Mood
414
415
  </label>
415
416
  <div className="mt-2 flex flex-wrap gap-x-4 gap-y-2">
@@ -426,7 +427,7 @@ export function AiPaneGenerator({
426
427
  />
427
428
  <label
428
429
  htmlFor={`theme-${option}`}
429
- className="text-sm font-medium text-gray-700"
430
+ className="text-sm font-bold text-gray-700"
430
431
  >
431
432
  {option}
432
433
  </label>
@@ -438,7 +439,7 @@ export function AiPaneGenerator({
438
439
  <div>
439
440
  <label
440
441
  htmlFor="additional-notes"
441
- className="block text-lg font-semibold text-gray-800"
442
+ className="block text-lg font-bold text-gray-800"
442
443
  >
443
444
  Additional Design Notes (Optional)
444
445
  </label>
@@ -456,78 +457,14 @@ export function AiPaneGenerator({
456
457
  />
457
458
  </div>
458
459
 
459
- <div>
460
- <label className="block text-lg font-semibold text-gray-800">
461
- Provide Content
462
- </label>
463
- <div className="my-2 flex space-x-4">
464
- <div className="flex items-center space-x-2">
465
- <input
466
- type="radio"
467
- id="copy-prompt-mode"
468
- name="copyModeOptions"
469
- value="prompt"
470
- checked={copyMode === 'prompt'}
471
- onChange={(e) => setCopyMode(e.target.value as CopyMode)}
472
- className="h-4 w-4 border-gray-300 text-cyan-600 focus:ring-cyan-500"
473
- />
474
- <label
475
- htmlFor="copy-prompt-mode"
476
- className="text-sm font-medium text-gray-700"
477
- >
478
- Write a prompt
479
- </label>
480
- </div>
481
- <div className="flex items-center space-x-2">
482
- <input
483
- type="radio"
484
- id="copy-raw-mode"
485
- name="copyModeOptions"
486
- value="raw"
487
- checked={copyMode === 'raw'}
488
- onChange={(e) => setCopyMode(e.target.value as CopyMode)}
489
- className="h-4 w-4 border-gray-300 text-cyan-600 focus:ring-cyan-500"
490
- />
491
- <label
492
- htmlFor="copy-raw-mode"
493
- className="text-sm font-medium text-gray-700"
494
- >
495
- Provide Copy
496
- </label>
497
- </div>
498
- </div>
499
-
500
- {copyMode === 'prompt' ? (
501
- <>
502
- <p className="mb-2 text-sm text-gray-500">
503
- Let the AI write the copy based on your prompt.
504
- </p>
505
- <textarea
506
- id="copy-prompt"
507
- value={copyPrompt}
508
- onChange={(e) => setCopyPrompt(e.target.value)}
509
- placeholder="Enter copy prompt..."
510
- rows={4}
511
- className="block w-full rounded-md border-gray-300 p-2 shadow-sm focus:border-cyan-500 focus:ring-cyan-500 sm:text-sm"
512
- />
513
- </>
514
- ) : (
515
- <>
516
- <p className="mb-2 text-sm text-gray-500">
517
- Provide your raw copy text here. The AI will structure and style
518
- it.
519
- </p>
520
- <textarea
521
- id="raw-copy"
522
- value={rawCopy}
523
- onChange={(e) => setRawCopy(e.target.value)}
524
- placeholder="Paste or type your copy text..."
525
- rows={6}
526
- className="block w-full rounded-md border-gray-300 p-2 shadow-sm focus:border-cyan-500 focus:ring-cyan-500 sm:text-sm"
527
- />
528
- </>
529
- )}
530
- </div>
460
+ <CopyInputStep
461
+ copyMode={copyMode}
462
+ onCopyModeChange={setCopyMode}
463
+ promptValue={copyPrompt}
464
+ onPromptValueChange={setCopyPrompt}
465
+ copyValue={rawCopy}
466
+ onCopyValueChange={setRawCopy}
467
+ />
531
468
 
532
469
  {error && <p className="text-sm text-red-600">{error}</p>}
533
470