astro-tractstack 2.0.0-rc.68 → 2.0.0-rc.69

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "astro-tractstack",
3
- "version": "2.0.0-rc.68",
3
+ "version": "2.0.0-rc.69",
4
4
  "description": "Astro integration for TractStack - redeeming the web from boring experiences",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -40,7 +40,7 @@ const bgColor = parsedOptions.bgColor || '';
40
40
  class="mx-auto w-full max-w-7xl px-8 py-12"
41
41
  style={bgColor ? `background-color: ${bgColor}` : ''}
42
42
  >
43
- <div class="grid grid-cols-1 items-center gap-x-16 gap-y-12 md:grid-cols-2">
43
+ <div class="grid grid-cols-1 items-center md:grid-cols-2 md:gap-y-12">
44
44
  <div class="w-full">
45
45
  <a href={`/${featuredStory.slug}`} class="block">
46
46
  <div class="max-w-lg pr-12">
@@ -22,6 +22,8 @@ try {
22
22
  topics: '',
23
23
  excludedIds: '',
24
24
  pageSize: 10,
25
+ title: '',
26
+ bgColor: '',
25
27
  };
26
28
  }
27
29
 
@@ -30,6 +32,8 @@ const excludedIdsArray = parsedOptions.excludedIds
30
32
  : [];
31
33
  const topicsArray = parsedOptions.topics ? parsedOptions.topics.split(',') : [];
32
34
  const pageSize = parseInt(parsedOptions.pageSize || '10');
35
+ const title = parsedOptions.title;
36
+ const bgColor = parsedOptions.bgColor || '';
33
37
 
34
38
  // Filter for valid stories to display
35
39
  const validPages = contentMap.filter(
@@ -62,14 +66,16 @@ const sortedStories = [...filteredStories].sort((a, b) => {
62
66
  // The initial display
63
67
  const initialStories = sortedStories.slice(0, pageSize);
64
68
  const totalPages = Math.ceil(sortedStories.length / pageSize);
65
-
66
- const bgColor = parsedOptions.bgColor || '';
67
69
  ---
68
70
 
69
71
  <div
70
- class="mx-auto max-w-7xl p-4 py-12"
72
+ class="mx-auto max-w-7xl p-4 py-24"
71
73
  style={bgColor ? `background-color: ${bgColor}` : ''}
72
74
  >
75
+ <h2 class="mb-8 text-center text-3xl font-bold text-gray-900">
76
+ {title || `Recent Articles`}
77
+ </h2>
78
+
73
79
  {
74
80
  initialStories.length === 0 && (
75
81
  <div class="rounded-lg bg-gray-50 px-4 py-12 text-center">
@@ -22,7 +22,6 @@ const ListContentSetup = ({
22
22
  }: ListContentSetupProps) => {
23
23
  const $contentMap = useStore(fullContentMapStore);
24
24
  const [isPanelOpen, setIsPanelOpen] = useState(false);
25
-
26
25
  const [excludedIds, setExcludedIds] = useState<string[]>(
27
26
  params?.excludedIds ? params.excludedIds.split(',') : []
28
27
  );
@@ -34,6 +33,7 @@ const ListContentSetup = ({
34
33
  );
35
34
  const [currentPage, setCurrentPage] = useState(1);
36
35
  const [bgColor, setBgColor] = useState(params?.bgColor || '');
36
+ const [title, setTitle] = useState(params?.title || '');
37
37
 
38
38
  const isInitialMount = useRef(true);
39
39
 
@@ -43,15 +43,15 @@ const ListContentSetup = ({
43
43
  selectedTopics.length > 0 ||
44
44
  excludedIds.length > 0 ||
45
45
  pageSize !== 10 ||
46
- bgColor !== '';
46
+ bgColor !== '' ||
47
+ title !== '';
47
48
 
48
49
  const validPages = $contentMap.filter(
49
50
  (item) =>
50
51
  item.type === 'StoryFragment' &&
51
52
  typeof item.description === 'string' &&
52
53
  typeof item.thumbSrc === 'string' &&
53
- typeof item.thumbSrcSet === 'string' &&
54
- typeof item.changed === 'string'
54
+ typeof item.thumbSrcSet === 'string'
55
55
  );
56
56
 
57
57
  // Build topic map for filtering
@@ -111,6 +111,7 @@ const ListContentSetup = ({
111
111
  topics: selectedTopics.join(','),
112
112
  pageSize: pageSize,
113
113
  bgColor: bgColor,
114
+ title: title,
114
115
  }),
115
116
  },
116
117
  bgColour: bgColor || undefined,
@@ -138,7 +139,7 @@ const ListContentSetup = ({
138
139
  }, 500);
139
140
 
140
141
  return () => clearTimeout(timeoutId);
141
- }, [excludedIds, selectedTopics, pageSize, bgColor]);
142
+ }, [excludedIds, selectedTopics, pageSize, bgColor, title]);
142
143
 
143
144
  // Toggle a page's exclusion status
144
145
  const toggleExclude = (id: string) => {
@@ -283,6 +284,23 @@ const ListContentSetup = ({
283
284
  <h3 className="text-lg font-bold text-gray-900">Content Settings</h3>
284
285
  </div>
285
286
  <div className="space-y-4 pt-4">
287
+ <div>
288
+ <label
289
+ htmlFor="list-title"
290
+ className="block text-sm font-bold text-gray-700"
291
+ >
292
+ Optional Title
293
+ </label>
294
+ <input
295
+ type="text"
296
+ id="list-title"
297
+ className="mt-1 block w-full rounded-md border-gray-300 px-3 py-2 shadow-sm focus:border-cyan-600 focus:ring-cyan-600 sm:text-sm"
298
+ value={title}
299
+ onChange={(e) => setTitle(e.target.value)}
300
+ placeholder="e.g., Recent Articles"
301
+ />
302
+ </div>
303
+
286
304
  <div>
287
305
  <label
288
306
  htmlFor="page-size"
@@ -449,23 +467,9 @@ const ListContentSetup = ({
449
467
  />
450
468
  </div>
451
469
  <div className="ml-4 min-w-0 flex-1">
452
- <div className="flex items-center justify-between">
453
- <p className="truncate text-sm font-bold text-gray-900">
454
- {page.title}
455
- </p>
456
- <div className="flex items-center space-x-4">
457
- <button
458
- onClick={() => toggleExclude(page.id)}
459
- className={`rounded px-2 py-1 text-xs font-bold ${
460
- isExcluded
461
- ? 'bg-gray-100 text-gray-700 hover:bg-gray-200'
462
- : 'bg-red-100 text-red-600 hover:bg-red-200'
463
- }`}
464
- >
465
- {isExcluded ? 'Restore' : 'Exclude'}
466
- </button>
467
- </div>
468
- </div>
470
+ <p className="text-sm font-bold text-gray-900">
471
+ {page.title}
472
+ </p>
469
473
  <div className="mt-1">
470
474
  <p className="line-clamp-1 text-sm text-gray-500">
471
475
  {page.description}
@@ -486,6 +490,16 @@ const ListContentSetup = ({
486
490
  {topic}
487
491
  </span>
488
492
  ))}
493
+ <button
494
+ onClick={() => toggleExclude(page.id)}
495
+ className={`rounded px-2 py-1 text-xs font-bold ${
496
+ isExcluded
497
+ ? 'bg-gray-100 text-gray-700 hover:bg-gray-200'
498
+ : 'bg-red-100 text-red-600 hover:bg-red-200'
499
+ }`}
500
+ >
501
+ {isExcluded ? 'Restore' : 'Exclude'}
502
+ </button>
489
503
  </div>
490
504
  )}
491
505
  <div className="mt-1 flex items-center text-xs text-gray-500">
@@ -67,10 +67,6 @@ const PanelVisibilityWrapper = ({
67
67
  currentActiveMode.panel === panelType &&
68
68
  currentActiveMode.paneId === nodeId;
69
69
  if (!entries[0].isIntersecting && stillActive) {
70
- console.log('❌ CLOSING PANEL DUE TO INTERSECTION OBSERVER!', {
71
- panelType,
72
- nodeId,
73
- });
74
70
  nodesCtx.closeAllPanels();
75
71
  }
76
72
  }, 100); // Small delay to allow panel to render
@@ -102,7 +102,7 @@ const StoryKeepHeader = ({ slug, isContext = false }: StoryKeepHeaderProps) => {
102
102
  <div className="flex flex-wrap items-center justify-center gap-x-4 gap-y-2 p-2">
103
103
  {/* Viewport Section with stacked label */}
104
104
  <div className="flex flex-col items-center">
105
- <span className="text-xs font-medium text-gray-600">Viewport:</span>
105
+ <span className="text-xs font-bold text-gray-600">Viewport:</span>
106
106
  <span className="text-xs text-gray-700">{viewport}</span>
107
107
  </div>
108
108
 
@@ -285,14 +285,14 @@ const PaneTitlePanel = ({ nodeId, setMode }: PaneTitlePanelProps) => {
285
285
  {/* Help Text */}
286
286
  <div className="space-y-4 text-sm text-gray-600">
287
287
  <div>
288
- <h4 className="font-semibold">Title Guidelines:</h4>
288
+ <h4 className="font-bold">Title Guidelines:</h4>
289
289
  <ul className="ml-4 mt-1 list-disc">
290
290
  <li>5-35 characters recommended for optimal display</li>
291
291
  <li>Clear, descriptive title for the pane content</li>
292
292
  </ul>
293
293
  </div>
294
294
  <div>
295
- <h4 className="font-semibold">Slug Guidelines:</h4>
295
+ <h4 className="font-bold">Slug Guidelines:</h4>
296
296
  <ul className="ml-4 mt-1 list-disc">
297
297
  <li>Used for analytics tracking</li>
298
298
  <li>Only lowercase letters, numbers, and hyphens</li>
@@ -905,7 +905,7 @@ export default function SaveModal({
905
905
 
906
906
  {stage === 'ERROR' && (
907
907
  <div className="mb-4 rounded bg-red-50 p-3 text-red-800">
908
- <div className="font-medium">Save failed</div>
908
+ <div className="font-bold">Save failed</div>
909
909
  <div className="mt-1 text-sm">{error}</div>
910
910
  </div>
911
911
  )}
@@ -217,7 +217,7 @@ const StoryFragmentSlugPanel = ({
217
217
 
218
218
  {isHomeSlug && (
219
219
  <div className="mt-4">
220
- <div className="inline-flex items-center rounded-full bg-blue-100 px-3 py-1.5 text-sm font-medium text-blue-800">
220
+ <div className="inline-flex items-center rounded-full bg-blue-100 px-3 py-1.5 text-sm font-bold text-blue-800">
221
221
  <LockClosedIcon className="mr-1.5 h-4 w-4" />
222
222
  Home Page
223
223
  </div>
@@ -504,7 +504,7 @@ const BackgroundImage = ({ paneId, onUpdate }: BackgroundImageProps) => {
504
504
  />
505
505
  </div>
506
506
  <div className="flex-1">
507
- <div className="font-medium">
507
+ <div className="font-bold">
508
508
  {file.altDescription || file.filename}
509
509
  </div>
510
510
  {file.altDescription && (
@@ -323,7 +323,7 @@ export const ImageUpload = ({
323
323
  {isSelectingFile && (
324
324
  <div className="fixed inset-0 z-50 flex items-center justify-center bg-black bg-opacity-50">
325
325
  <div className="w-full max-w-md rounded-lg bg-white p-6 shadow-lg">
326
- <h3 className="text-mydarkgrey mb-4 text-lg font-medium">
326
+ <h3 className="text-mydarkgrey mb-4 text-lg font-bold">
327
327
  Select an Image
328
328
  </h3>
329
329
 
@@ -270,7 +270,7 @@ export default function SearchResults({
270
270
  <div className="mt-3 min-w-0 flex-1 md:mt-0">
271
271
  <div className="flex items-start justify-between gap-4">
272
272
  <div className="flex-1">
273
- <h3 className="text-mydarkgrey group-hover:text-myblue mb-2 text-lg font-semibold transition-colors">
273
+ <h3 className="text-mydarkgrey group-hover:text-myblue mb-2 text-lg font-bold transition-colors">
274
274
  {item.title}
275
275
  </h3>
276
276
  {item.description && (
@@ -320,7 +320,7 @@ export default function SearchResults({
320
320
  page={currentPage}
321
321
  onPageChange={(details) => handlePageChange(details.page)}
322
322
  >
323
- <Pagination.PrevTrigger className="text-mydarkgrey hover:text-myblue mr-2 flex items-center gap-1 rounded px-3 py-2 text-sm font-medium transition-colors disabled:opacity-50">
323
+ <Pagination.PrevTrigger className="text-mydarkgrey hover:text-myblue mr-2 flex items-center gap-1 rounded px-3 py-2 text-sm font-bold transition-colors disabled:opacity-50">
324
324
  <ChevronLeftIcon className="h-4 w-4" />
325
325
  Previous
326
326
  </Pagination.PrevTrigger>
@@ -334,7 +334,7 @@ export default function SearchResults({
334
334
  key={index}
335
335
  type="page"
336
336
  value={page.value}
337
- className={`rounded px-3 py-2 text-sm font-medium transition-colors ${
337
+ className={`rounded px-3 py-2 text-sm font-bold transition-colors ${
338
338
  page.value === currentPage
339
339
  ? 'bg-myblue text-white'
340
340
  : 'text-mydarkgrey hover:text-myblue'
@@ -355,7 +355,7 @@ export default function SearchResults({
355
355
  </Pagination.Context>
356
356
  </div>
357
357
 
358
- <Pagination.NextTrigger className="text-mydarkgrey hover:text-myblue ml-2 flex items-center gap-1 rounded px-3 py-2 text-sm font-medium transition-colors disabled:opacity-50">
358
+ <Pagination.NextTrigger className="text-mydarkgrey hover:text-myblue ml-2 flex items-center gap-1 rounded px-3 py-2 text-sm font-bold transition-colors disabled:opacity-50">
359
359
  Next
360
360
  <ChevronRightIcon className="h-4 w-4" />
361
361
  </Pagination.NextTrigger>
@@ -252,12 +252,26 @@ export default function ResourceForm({
252
252
  />
253
253
  );
254
254
 
255
- case 'image':
255
+ case 'image': {
256
+ let fileUploadValue = ''; // Default to an empty string.
257
+
258
+ if (typeof fieldValue === 'string') {
259
+ // Case 1: The value is a string (Base64 URI).
260
+ fileUploadValue = fieldValue;
261
+ } else if (
262
+ fieldValue &&
263
+ typeof fieldValue === 'object' &&
264
+ fieldValue.src
265
+ ) {
266
+ // already saved, url
267
+ fileUploadValue = fieldValue.src;
268
+ }
269
+
256
270
  return (
257
271
  <FileUpload
258
272
  key={fieldName}
259
273
  label={fieldName.charAt(0).toUpperCase() + fieldName.slice(1)}
260
- value={fieldValue || ''}
274
+ value={fileUploadValue}
261
275
  onChange={(value) => updateOptionsField(fieldName, value)}
262
276
  accept="image/*"
263
277
  showPreview={true}
@@ -265,6 +279,7 @@ export default function ResourceForm({
265
279
  required={!fieldDef.optional}
266
280
  />
267
281
  );
282
+ }
268
283
 
269
284
  default:
270
285
  return (
@@ -259,7 +259,7 @@ export default function Wizard({
259
259
  <div className="mt-3">
260
260
  <a
261
261
  href={currentStep.href}
262
- className="inline-flex items-center rounded-md bg-cyan-600 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-cyan-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-cyan-600"
262
+ className="inline-flex items-center rounded-md bg-cyan-600 px-3 py-2 text-sm font-bold text-white shadow-sm hover:bg-cyan-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-cyan-600"
263
263
  >
264
264
  {currentStep.buttonText}
265
265
  <svg