astro-tractstack 2.0.0-rc.0
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/LICENSE +110 -0
- package/README.md +56 -0
- package/astro.d.ts +64 -0
- package/bin/create-tractstack.js +483 -0
- package/dist/config.js +80 -0
- package/dist/index.js +2129 -0
- package/package.json +89 -0
- package/templates/artpacks/kCz/captainBreakfast_1080px.webp +0 -0
- package/templates/artpacks/kCz/captainBreakfast_1920px.webp +0 -0
- package/templates/artpacks/kCz/captainBreakfast_600px.webp +0 -0
- package/templates/artpacks/kCz/cleanDrips_1080px.webp +0 -0
- package/templates/artpacks/kCz/cleanDrips_1920px.webp +0 -0
- package/templates/artpacks/kCz/cleanDrips_600px.webp +0 -0
- package/templates/artpacks/kCz/crispwaves_1080px.webp +0 -0
- package/templates/artpacks/kCz/crispwaves_1920px.webp +0 -0
- package/templates/artpacks/kCz/crispwaves_600px.webp +0 -0
- package/templates/artpacks/kCz/dragonSkin_1080px.webp +0 -0
- package/templates/artpacks/kCz/dragonSkin_1920px.webp +0 -0
- package/templates/artpacks/kCz/dragonSkin_600px.webp +0 -0
- package/templates/artpacks/kCz/dragon_1080px.webp +0 -0
- package/templates/artpacks/kCz/dragon_1920px.webp +0 -0
- package/templates/artpacks/kCz/dragon_600px.webp +0 -0
- package/templates/artpacks/kCz/nightcity_1080px.webp +0 -0
- package/templates/artpacks/kCz/nightcity_1920px.webp +0 -0
- package/templates/artpacks/kCz/nightcity_600px.webp +0 -0
- package/templates/artpacks/kCz/pattern1_1080px.webp +0 -0
- package/templates/artpacks/kCz/pattern1_1920px.webp +0 -0
- package/templates/artpacks/kCz/pattern1_600px.webp +0 -0
- package/templates/artpacks/kCz/pattern2_1080px.webp +0 -0
- package/templates/artpacks/kCz/pattern2_1920px.webp +0 -0
- package/templates/artpacks/kCz/pattern2_600px.webp +0 -0
- package/templates/artpacks/kCz/skindrips_1080px.webp +0 -0
- package/templates/artpacks/kCz/skindrips_1920px.webp +0 -0
- package/templates/artpacks/kCz/skindrips_600px.webp +0 -0
- package/templates/artpacks/kCz/slimetime_1080px.webp +0 -0
- package/templates/artpacks/kCz/slimetime_1920px.webp +0 -0
- package/templates/artpacks/kCz/slimetime_600px.webp +0 -0
- package/templates/artpacks/kCz/snake_1080px.webp +0 -0
- package/templates/artpacks/kCz/snake_1920px.webp +0 -0
- package/templates/artpacks/kCz/snake_600px.webp +0 -0
- package/templates/artpacks/kCz/toxicshock_1080px.webp +0 -0
- package/templates/artpacks/kCz/toxicshock_1920px.webp +0 -0
- package/templates/artpacks/kCz/toxicshock_600px.webp +0 -0
- package/templates/artpacks/kCz/tractstack_1080px.webp +0 -0
- package/templates/artpacks/kCz/tractstack_1920px.webp +0 -0
- package/templates/artpacks/kCz/tractstack_600px.webp +0 -0
- package/templates/artpacks/kCz/tripdrips_1080px.webp +0 -0
- package/templates/artpacks/kCz/tripdrips_1920px.webp +0 -0
- package/templates/artpacks/kCz/tripdrips_600px.webp +0 -0
- package/templates/artpacks/kCz/wavedrips_1080px.webp +0 -0
- package/templates/artpacks/kCz/wavedrips_1920px.webp +0 -0
- package/templates/artpacks/kCz/wavedrips_600px.webp +0 -0
- package/templates/artpacks/t8k/beach_1080px.webp +0 -0
- package/templates/artpacks/t8k/beach_1920px.webp +0 -0
- package/templates/artpacks/t8k/beach_600px.webp +0 -0
- package/templates/artpacks/t8k/blast_1080px.webp +0 -0
- package/templates/artpacks/t8k/blast_1920px.webp +0 -0
- package/templates/artpacks/t8k/blast_600px.webp +0 -0
- package/templates/artpacks/t8k/bokeh_1080px.webp +0 -0
- package/templates/artpacks/t8k/bokeh_1920px.webp +0 -0
- package/templates/artpacks/t8k/bokeh_600px.webp +0 -0
- package/templates/artpacks/t8k/cartoon_1080px.webp +0 -0
- package/templates/artpacks/t8k/cartoon_1920px.webp +0 -0
- package/templates/artpacks/t8k/cartoon_600px.webp +0 -0
- package/templates/artpacks/t8k/darkeggshell_1080px.webp +0 -0
- package/templates/artpacks/t8k/darkeggshell_1920px.webp +0 -0
- package/templates/artpacks/t8k/darkeggshell_600px.webp +0 -0
- package/templates/artpacks/t8k/explosion_1080px.webp +0 -0
- package/templates/artpacks/t8k/explosion_1920px.webp +0 -0
- package/templates/artpacks/t8k/explosion_600px.webp +0 -0
- package/templates/artpacks/t8k/floral_1080px.webp +0 -0
- package/templates/artpacks/t8k/floral_1920px.webp +0 -0
- package/templates/artpacks/t8k/floral_600px.webp +0 -0
- package/templates/artpacks/t8k/flower_1080px.webp +0 -0
- package/templates/artpacks/t8k/flower_1920px.webp +0 -0
- package/templates/artpacks/t8k/flower_600px.webp +0 -0
- package/templates/artpacks/t8k/foliage_1080px.webp +0 -0
- package/templates/artpacks/t8k/foliage_1920px.webp +0 -0
- package/templates/artpacks/t8k/foliage_600px.webp +0 -0
- package/templates/artpacks/t8k/mist_1080px.webp +0 -0
- package/templates/artpacks/t8k/mist_1920px.webp +0 -0
- package/templates/artpacks/t8k/mist_600px.webp +0 -0
- package/templates/artpacks/t8k/portal_1080px.webp +0 -0
- package/templates/artpacks/t8k/portal_1920px.webp +0 -0
- package/templates/artpacks/t8k/portal_600px.webp +0 -0
- package/templates/artpacks/t8k/storytime_1080px.webp +0 -0
- package/templates/artpacks/t8k/storytime_1920px.webp +0 -0
- package/templates/artpacks/t8k/storytime_600px.webp +0 -0
- package/templates/artpacks/t8k/tacky_1080px.webp +0 -0
- package/templates/artpacks/t8k/tacky_1920px.webp +0 -0
- package/templates/artpacks/t8k/tacky_600px.webp +0 -0
- package/templates/artpacks/t8k/wallpaper_1080px.webp +0 -0
- package/templates/artpacks/t8k/wallpaper_1920px.webp +0 -0
- package/templates/artpacks/t8k/wallpaper_600px.webp +0 -0
- package/templates/brand/favicon.ico +0 -0
- package/templates/brand/logo.svg +19 -0
- package/templates/brand/static.jpg +0 -0
- package/templates/brand/wordmark.svg +4 -0
- package/templates/css/custom.css +51 -0
- package/templates/css/frontend.css +3519 -0
- package/templates/css/storykeep.css +92872 -0
- package/templates/custom/minimal/CodeHook.astro +53 -0
- package/templates/custom/minimal/CustomRoutes.astro +46 -0
- package/templates/custom/with-examples/CodeHook.astro +49 -0
- package/templates/custom/with-examples/CustomHero.astro +13 -0
- package/templates/custom/with-examples/CustomRoutes.astro +39 -0
- package/templates/custom/with-examples/pages/Collections.astro +110 -0
- package/templates/env.example +8 -0
- package/templates/fonts/Inter-Black.woff2 +0 -0
- package/templates/fonts/Inter-Bold.woff2 +0 -0
- package/templates/fonts/Inter-Regular.woff2 +0 -0
- package/templates/icons/h2.svg +1 -0
- package/templates/icons/h3.svg +1 -0
- package/templates/icons/h4.svg +1 -0
- package/templates/icons/h5.svg +1 -0
- package/templates/icons/image.svg +7 -0
- package/templates/icons/text.svg +6 -0
- package/templates/socials/codepen.svg +1 -0
- package/templates/socials/discord.svg +1 -0
- package/templates/socials/facebook.svg +1 -0
- package/templates/socials/github.svg +1 -0
- package/templates/socials/instagram.svg +1 -0
- package/templates/socials/linkedin.svg +1 -0
- package/templates/socials/mail.svg +1 -0
- package/templates/socials/rumble.svg +1 -0
- package/templates/socials/tiktok.svg +1 -0
- package/templates/socials/twitch.svg +1 -0
- package/templates/socials/twitter.svg +1 -0
- package/templates/socials/x.svg +1 -0
- package/templates/socials/youtube.svg +1 -0
- package/templates/src/client/analytics-events.ts +213 -0
- package/templates/src/client/belief-events.ts +205 -0
- package/templates/src/client/sse.ts +667 -0
- package/templates/src/components/Footer.astro +246 -0
- package/templates/src/components/Fragment.astro +70 -0
- package/templates/src/components/Header.astro +458 -0
- package/templates/src/components/Menu.tsx +196 -0
- package/templates/src/components/codehooks/BunnyVideoSetup.tsx +692 -0
- package/templates/src/components/codehooks/BunnyVideoWrapper.astro +78 -0
- package/templates/src/components/codehooks/EpinetDurationSelector.tsx +1020 -0
- package/templates/src/components/codehooks/EpinetTableView.tsx +594 -0
- package/templates/src/components/codehooks/EpinetWrapper.tsx +424 -0
- package/templates/src/components/codehooks/FeaturedContent.astro +273 -0
- package/templates/src/components/codehooks/FeaturedContentSetup.tsx +738 -0
- package/templates/src/components/codehooks/ListContent.astro +460 -0
- package/templates/src/components/codehooks/ListContentSetup.tsx +649 -0
- package/templates/src/components/codehooks/SankeyDiagram.tsx +359 -0
- package/templates/src/components/compositor/Compositor.tsx +144 -0
- package/templates/src/components/compositor/Node.tsx +415 -0
- package/templates/src/components/compositor/NodeWithGuid.tsx +25 -0
- package/templates/src/components/compositor/PanelVisibilityWrapper.tsx +87 -0
- package/templates/src/components/compositor/elements/Belief.tsx +148 -0
- package/templates/src/components/compositor/elements/BgImage.tsx +118 -0
- package/templates/src/components/compositor/elements/BgVisualBreak.tsx +102 -0
- package/templates/src/components/compositor/elements/BunnyVideo.tsx +63 -0
- package/templates/src/components/compositor/elements/IdentifyAs.tsx +66 -0
- package/templates/src/components/compositor/elements/PlayButton.tsx +19 -0
- package/templates/src/components/compositor/elements/SignUp.tsx +179 -0
- package/templates/src/components/compositor/elements/Svg.tsx +33 -0
- package/templates/src/components/compositor/elements/ToggleBelief.tsx +36 -0
- package/templates/src/components/compositor/elements/YouTubeWrapper.tsx +33 -0
- package/templates/src/components/compositor/nodes/BgPaneWrapper.tsx +35 -0
- package/templates/src/components/compositor/nodes/GhostInsertBlock.tsx +189 -0
- package/templates/src/components/compositor/nodes/Markdown.tsx +179 -0
- package/templates/src/components/compositor/nodes/Pane.tsx +277 -0
- package/templates/src/components/compositor/nodes/Pane_eraser.tsx +69 -0
- package/templates/src/components/compositor/nodes/Pane_layout.tsx +77 -0
- package/templates/src/components/compositor/nodes/RenderChildren.tsx +19 -0
- package/templates/src/components/compositor/nodes/StoryFragment.tsx +35 -0
- package/templates/src/components/compositor/nodes/TagElement.tsx +14 -0
- package/templates/src/components/compositor/nodes/Widget.tsx +115 -0
- package/templates/src/components/compositor/nodes/tagElements/NodeA.tsx +4 -0
- package/templates/src/components/compositor/nodes/tagElements/NodeA_eraser.tsx +26 -0
- package/templates/src/components/compositor/nodes/tagElements/NodeAnchorComponent.tsx +248 -0
- package/templates/src/components/compositor/nodes/tagElements/NodeBasicTag.tsx +684 -0
- package/templates/src/components/compositor/nodes/tagElements/NodeBasicTag_eraser.tsx +62 -0
- package/templates/src/components/compositor/nodes/tagElements/NodeBasicTag_insert.tsx +120 -0
- package/templates/src/components/compositor/nodes/tagElements/NodeBasicTag_settings.tsx +62 -0
- package/templates/src/components/compositor/nodes/tagElements/NodeButton.tsx +5 -0
- package/templates/src/components/compositor/nodes/tagElements/NodeButton_eraser.tsx +26 -0
- package/templates/src/components/compositor/nodes/tagElements/NodeImg.tsx +28 -0
- package/templates/src/components/compositor/nodes/tagElements/NodeText.tsx +18 -0
- package/templates/src/components/compositor/nodes/tagElements/TabIndicator.tsx +51 -0
- package/templates/src/components/compositor/preview/FeaturedContentPreview.tsx +128 -0
- package/templates/src/components/compositor/preview/ListContentPreview.tsx +213 -0
- package/templates/src/components/compositor/preview/OgImagePreview.tsx +223 -0
- package/templates/src/components/compositor/preview/PaneSnapshotGenerator.tsx +199 -0
- package/templates/src/components/compositor/preview/PanesPreviewGenerator.tsx +123 -0
- package/templates/src/components/compositor/preview/VisualBreakPreview.tsx +154 -0
- package/templates/src/components/edit/Header.tsx +181 -0
- package/templates/src/components/edit/PanelSwitch.tsx +446 -0
- package/templates/src/components/edit/SettingsPanel.tsx +70 -0
- package/templates/src/components/edit/ToolBar.tsx +101 -0
- package/templates/src/components/edit/ToolMode.tsx +121 -0
- package/templates/src/components/edit/context/ContextPaneConfig.tsx +91 -0
- package/templates/src/components/edit/context/ContextPaneConfig_slug.tsx +174 -0
- package/templates/src/components/edit/context/ContextPaneConfig_title.tsx +186 -0
- package/templates/src/components/edit/pane/AddPanePanel.tsx +136 -0
- package/templates/src/components/edit/pane/AddPanePanel_break.tsx +470 -0
- package/templates/src/components/edit/pane/AddPanePanel_codehook.tsx +264 -0
- package/templates/src/components/edit/pane/AddPanePanel_new.tsx +623 -0
- package/templates/src/components/edit/pane/AddPanePanel_newAICopy.tsx +107 -0
- package/templates/src/components/edit/pane/AddPanePanel_newAICopy_modal.tsx +217 -0
- package/templates/src/components/edit/pane/AddPanePanel_newCopyMode.tsx +109 -0
- package/templates/src/components/edit/pane/AddPanePanel_newCustomCopy.tsx +39 -0
- package/templates/src/components/edit/pane/AddPanePanel_reuse.tsx +445 -0
- package/templates/src/components/edit/pane/ConfigPanePanel.tsx +245 -0
- package/templates/src/components/edit/pane/PageGen.tsx +485 -0
- package/templates/src/components/edit/pane/PageGenSelector.tsx +238 -0
- package/templates/src/components/edit/pane/PageGenSpecial.tsx +362 -0
- package/templates/src/components/edit/pane/PageGen_preview.tsx +495 -0
- package/templates/src/components/edit/pane/PanePanel_impression.tsx +258 -0
- package/templates/src/components/edit/pane/PanePanel_path.tsx +268 -0
- package/templates/src/components/edit/pane/PanePanel_slug.tsx +219 -0
- package/templates/src/components/edit/pane/PanePanel_title.tsx +142 -0
- package/templates/src/components/edit/panels/StyleBreakPanel.tsx +182 -0
- package/templates/src/components/edit/panels/StyleCodeHookPanel.tsx +439 -0
- package/templates/src/components/edit/panels/StyleElementPanel.tsx +177 -0
- package/templates/src/components/edit/panels/StyleElementPanel_add.tsx +349 -0
- package/templates/src/components/edit/panels/StyleElementPanel_remove.tsx +159 -0
- package/templates/src/components/edit/panels/StyleElementPanel_update.tsx +320 -0
- package/templates/src/components/edit/panels/StyleImagePanel.tsx +460 -0
- package/templates/src/components/edit/panels/StyleImagePanel_add.tsx +296 -0
- package/templates/src/components/edit/panels/StyleImagePanel_remove.tsx +153 -0
- package/templates/src/components/edit/panels/StyleImagePanel_update.tsx +312 -0
- package/templates/src/components/edit/panels/StyleLiElementPanel.tsx +273 -0
- package/templates/src/components/edit/panels/StyleLiElementPanel_add.tsx +301 -0
- package/templates/src/components/edit/panels/StyleLiElementPanel_remove.tsx +132 -0
- package/templates/src/components/edit/panels/StyleLiElementPanel_update.tsx +313 -0
- package/templates/src/components/edit/panels/StyleLinkPanel.tsx +346 -0
- package/templates/src/components/edit/panels/StyleLinkPanel_add.tsx +265 -0
- package/templates/src/components/edit/panels/StyleLinkPanel_config.tsx +240 -0
- package/templates/src/components/edit/panels/StyleLinkPanel_remove.tsx +94 -0
- package/templates/src/components/edit/panels/StyleLinkPanel_update.tsx +110 -0
- package/templates/src/components/edit/panels/StyleParentPanel.tsx +263 -0
- package/templates/src/components/edit/panels/StyleParentPanel_add.tsx +275 -0
- package/templates/src/components/edit/panels/StyleParentPanel_deleteLayer.tsx +112 -0
- package/templates/src/components/edit/panels/StyleParentPanel_remove.tsx +87 -0
- package/templates/src/components/edit/panels/StyleParentPanel_update.tsx +141 -0
- package/templates/src/components/edit/panels/StyleWidgetPanel.tsx +428 -0
- package/templates/src/components/edit/panels/StyleWidgetPanel_add.tsx +292 -0
- package/templates/src/components/edit/panels/StyleWidgetPanel_config.tsx +190 -0
- package/templates/src/components/edit/panels/StyleWidgetPanel_remove.tsx +152 -0
- package/templates/src/components/edit/panels/StyleWidgetPanel_update.tsx +308 -0
- package/templates/src/components/edit/state/SaveModal.tsx +811 -0
- package/templates/src/components/edit/state/StylesMemory.tsx +310 -0
- package/templates/src/components/edit/storyfragment/StoryFragmentConfigPanel.tsx +289 -0
- package/templates/src/components/edit/storyfragment/StoryFragmentPanel_menu.tsx +320 -0
- package/templates/src/components/edit/storyfragment/StoryFragmentPanel_og.tsx +888 -0
- package/templates/src/components/edit/storyfragment/StoryFragmentPanel_slug.tsx +269 -0
- package/templates/src/components/edit/storyfragment/StoryFragmentPanel_title.tsx +190 -0
- package/templates/src/components/edit/widgets/BeliefWidget.tsx +183 -0
- package/templates/src/components/edit/widgets/BunnyWidget.tsx +134 -0
- package/templates/src/components/edit/widgets/IdentifyAsWidget.tsx +193 -0
- package/templates/src/components/edit/widgets/SignupWidget.tsx +177 -0
- package/templates/src/components/edit/widgets/ToggleWidget.tsx +152 -0
- package/templates/src/components/edit/widgets/YouTubeWidget.tsx +65 -0
- package/templates/src/components/fields/ActionBuilderTimeSelector.tsx +353 -0
- package/templates/src/components/fields/ArtpackImage.tsx +480 -0
- package/templates/src/components/fields/BackgroundImage.tsx +530 -0
- package/templates/src/components/fields/BackgroundImageWrapper.tsx +192 -0
- package/templates/src/components/fields/BooleanParam.tsx +67 -0
- package/templates/src/components/fields/BunnyMomentSelector.tsx +56 -0
- package/templates/src/components/fields/ColorPickerCombo.tsx +284 -0
- package/templates/src/components/fields/ImageUpload.tsx +405 -0
- package/templates/src/components/fields/MultiParam.tsx +75 -0
- package/templates/src/components/fields/PaneBreakCollectionSelector.tsx +97 -0
- package/templates/src/components/fields/PaneBreakShapeSelector.tsx +134 -0
- package/templates/src/components/fields/SelectedTailwindClass.tsx +44 -0
- package/templates/src/components/fields/SingleParam.tsx +73 -0
- package/templates/src/components/fields/ViewportComboBox.tsx +252 -0
- package/templates/src/components/form/ActionBuilderField.tsx +282 -0
- package/templates/src/components/form/ActionBuilderSlugSelector.tsx +182 -0
- package/templates/src/components/form/BooleanToggle.tsx +94 -0
- package/templates/src/components/form/ColorPicker.tsx +153 -0
- package/templates/src/components/form/DateTimeInput.tsx +638 -0
- package/templates/src/components/form/EnumSelect.tsx +88 -0
- package/templates/src/components/form/FileUpload.tsx +465 -0
- package/templates/src/components/form/MagicPathBuilder.tsx +546 -0
- package/templates/src/components/form/NumberInput.tsx +101 -0
- package/templates/src/components/form/ParagraphArrayInput.tsx +207 -0
- package/templates/src/components/form/StringArrayInput.tsx +163 -0
- package/templates/src/components/form/StringInput.tsx +88 -0
- package/templates/src/components/form/UnsavedChangesBar.tsx +295 -0
- package/templates/src/components/form/advanced/APIConfigSection.tsx +69 -0
- package/templates/src/components/form/advanced/AuthConfigSection.tsx +97 -0
- package/templates/src/components/form/brand/BrandAssetsSection.tsx +93 -0
- package/templates/src/components/form/brand/BrandColorsSection.tsx +201 -0
- package/templates/src/components/form/brand/SEOSection.tsx +101 -0
- package/templates/src/components/form/brand/SiteConfigSection.tsx +61 -0
- package/templates/src/components/form/brand/SocialLinksSection.tsx +393 -0
- package/templates/src/components/profile/ProfileConsent.tsx +65 -0
- package/templates/src/components/profile/ProfileCreate.tsx +462 -0
- package/templates/src/components/profile/ProfileEdit.tsx +409 -0
- package/templates/src/components/profile/ProfileSwitch.tsx +255 -0
- package/templates/src/components/profile/ProfileUnlock.tsx +221 -0
- package/templates/src/components/storykeep/Dashboard.tsx +160 -0
- package/templates/src/components/storykeep/Dashboard_Activity.tsx +56 -0
- package/templates/src/components/storykeep/Dashboard_Advanced.tsx +165 -0
- package/templates/src/components/storykeep/Dashboard_Analytics.tsx +451 -0
- package/templates/src/components/storykeep/Dashboard_Branding.tsx +95 -0
- package/templates/src/components/storykeep/Dashboard_Content.tsx +191 -0
- package/templates/src/components/storykeep/controls/UsageCell.tsx +71 -0
- package/templates/src/components/storykeep/controls/content/BeliefForm.tsx +378 -0
- package/templates/src/components/storykeep/controls/content/BeliefTable.tsx +329 -0
- package/templates/src/components/storykeep/controls/content/ContentBrowser.tsx +385 -0
- package/templates/src/components/storykeep/controls/content/ContentSummary.tsx +149 -0
- package/templates/src/components/storykeep/controls/content/KnownResourceForm.tsx +397 -0
- package/templates/src/components/storykeep/controls/content/KnownResourceTable.tsx +260 -0
- package/templates/src/components/storykeep/controls/content/ManageContent.tsx +439 -0
- package/templates/src/components/storykeep/controls/content/MenuForm.tsx +239 -0
- package/templates/src/components/storykeep/controls/content/MenuTable.tsx +332 -0
- package/templates/src/components/storykeep/controls/content/ResourceBulkIngest.tsx +724 -0
- package/templates/src/components/storykeep/controls/content/ResourceForm.tsx +355 -0
- package/templates/src/components/storykeep/controls/content/ResourceTable.tsx +222 -0
- package/templates/src/components/storykeep/controls/content/StoryFragmentTable.tsx +482 -0
- package/templates/src/components/storykeep/state/BrandingWrapper.tsx +42 -0
- package/templates/src/components/storykeep/state/FetchAnalytics.tsx +350 -0
- package/templates/src/components/storykeep/widgets/ResponsiveLine.tsx +319 -0
- package/templates/src/components/storykeep/widgets/Wizard.tsx +278 -0
- package/templates/src/components/tenant/RegistrationForm.tsx +447 -0
- package/templates/src/components/widgets/BunnyVideoHero.astro +775 -0
- package/templates/src/components/widgets/Impression.tsx +102 -0
- package/templates/src/components/widgets/ImpressionWrapper.tsx +214 -0
- package/templates/src/constants/beliefs.ts +61 -0
- package/templates/src/constants/brandThemes.ts +133 -0
- package/templates/src/constants/prompts.json +55 -0
- package/templates/src/constants/shapes.ts +556 -0
- package/templates/src/constants/stopWords.ts +116 -0
- package/templates/src/constants/tailwindColors.json +344 -0
- package/templates/src/constants.ts +274 -0
- package/templates/src/hooks/useFormState.ts +203 -0
- package/templates/src/layouts/Layout.astro +290 -0
- package/templates/src/lib/session.ts +126 -0
- package/templates/src/lib/storyData.ts +56 -0
- package/templates/src/middleware.ts +52 -0
- package/templates/src/pages/404.astro +54 -0
- package/templates/src/pages/[...slug]/edit.astro +216 -0
- package/templates/src/pages/[...slug].astro +148 -0
- package/templates/src/pages/api/auth/decode.ts +101 -0
- package/templates/src/pages/api/auth/login.ts +122 -0
- package/templates/src/pages/api/auth/logout.ts +37 -0
- package/templates/src/pages/api/auth/profile.ts +76 -0
- package/templates/src/pages/api/orphan-analysis.ts +106 -0
- package/templates/src/pages/api/tailwind.ts +116 -0
- package/templates/src/pages/collections/[param1].astro +65 -0
- package/templates/src/pages/context/[...contextSlug]/edit.astro +207 -0
- package/templates/src/pages/context/[...contextSlug].astro +161 -0
- package/templates/src/pages/llms.txt.ts +122 -0
- package/templates/src/pages/maint.astro +183 -0
- package/templates/src/pages/media/[...slug].astro +67 -0
- package/templates/src/pages/robots.txt.ts +36 -0
- package/templates/src/pages/sandbox/activate.astro +258 -0
- package/templates/src/pages/sandbox/register.astro +44 -0
- package/templates/src/pages/sandbox/success.astro +179 -0
- package/templates/src/pages/sitemap.xml.ts +119 -0
- package/templates/src/pages/storykeep/advanced.astro +69 -0
- package/templates/src/pages/storykeep/branding.astro +57 -0
- package/templates/src/pages/storykeep/content.astro +71 -0
- package/templates/src/pages/storykeep/init.astro +36 -0
- package/templates/src/pages/storykeep/login.astro +266 -0
- package/templates/src/pages/storykeep/logout.astro +84 -0
- package/templates/src/pages/storykeep/profile.astro +98 -0
- package/templates/src/pages/storykeep.astro +81 -0
- package/templates/src/stores/analytics.ts +171 -0
- package/templates/src/stores/backend.ts +16 -0
- package/templates/src/stores/navigation.ts +149 -0
- package/templates/src/stores/nodes.ts +2390 -0
- package/templates/src/stores/nodesHistory.ts +85 -0
- package/templates/src/stores/notificationSystem.ts +41 -0
- package/templates/src/stores/orphanAnalysis.ts +409 -0
- package/templates/src/stores/storykeep.ts +247 -0
- package/templates/src/types/astro.ts +86 -0
- package/templates/src/types/compositorTypes.ts +456 -0
- package/templates/src/types/formTypes.ts +281 -0
- package/templates/src/types/multiTenant.ts +77 -0
- package/templates/src/types/nodeProps.ts +66 -0
- package/templates/src/types/tractstack.ts +445 -0
- package/templates/src/utils/aai/getTitleSlug.ts +72 -0
- package/templates/src/utils/actions/actionButton.ts +101 -0
- package/templates/src/utils/actions/lispLexer.ts +57 -0
- package/templates/src/utils/actions/preParse_Action.ts +85 -0
- package/templates/src/utils/actions/preParse_Bunny.ts +50 -0
- package/templates/src/utils/actions/preParse_Clicked.ts +87 -0
- package/templates/src/utils/actions/preParse_Impression.ts +71 -0
- package/templates/src/utils/api/advancedConfig.ts +66 -0
- package/templates/src/utils/api/advancedHelpers.ts +134 -0
- package/templates/src/utils/api/beliefConfig.ts +87 -0
- package/templates/src/utils/api/beliefHelpers.ts +196 -0
- package/templates/src/utils/api/brandConfig.ts +126 -0
- package/templates/src/utils/api/brandHelpers.ts +155 -0
- package/templates/src/utils/api/fileHelpers.ts +306 -0
- package/templates/src/utils/api/menuConfig.ts +57 -0
- package/templates/src/utils/api/menuHelpers.ts +156 -0
- package/templates/src/utils/api/resourceConfig.ts +158 -0
- package/templates/src/utils/api/resourceHelpers.ts +72 -0
- package/templates/src/utils/api/tenantConfig.ts +97 -0
- package/templates/src/utils/api/tenantHelpers.ts +172 -0
- package/templates/src/utils/api.ts +183 -0
- package/templates/src/utils/auth.ts +150 -0
- package/templates/src/utils/backend.ts +243 -0
- package/templates/src/utils/compositor/TemplateMarkdowns.ts +118 -0
- package/templates/src/utils/compositor/TemplateNodes.ts +138 -0
- package/templates/src/utils/compositor/TemplatePanes.ts +100 -0
- package/templates/src/utils/compositor/allowInsert.ts +100 -0
- package/templates/src/utils/compositor/domHelpers.ts +37 -0
- package/templates/src/utils/compositor/handleClickEvent.ts +131 -0
- package/templates/src/utils/compositor/nodesHelper.ts +491 -0
- package/templates/src/utils/compositor/nodesMarkdownGenerator.ts +292 -0
- package/templates/src/utils/compositor/processMarkdown.ts +431 -0
- package/templates/src/utils/compositor/reduceNodesClassNames.ts +192 -0
- package/templates/src/utils/compositor/tailwindClasses.ts +1795 -0
- package/templates/src/utils/compositor/tailwindColors.ts +227 -0
- package/templates/src/utils/compositor/templateMarkdownStyles.ts +1265 -0
- package/templates/src/utils/compositor/typeGuards.ts +193 -0
- package/templates/src/utils/etl/extractor.ts +119 -0
- package/templates/src/utils/etl/index.ts +88 -0
- package/templates/src/utils/etl/loader.ts +36 -0
- package/templates/src/utils/etl/transformer.ts +286 -0
- package/templates/src/utils/helpers.ts +435 -0
- package/templates/src/utils/layout.ts +209 -0
- package/templates/src/utils/profileStorage.ts +306 -0
- package/templates/src/utils/useInterval.ts +27 -0
- package/templates/tailwind.config.cjs +169 -0
- package/utils/create-resolver.ts +10 -0
- package/utils/inject-files.ts +2140 -0
- package/utils/validate-config.ts +43 -0
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
import { useState, useMemo } from 'react';
|
|
2
|
+
import { useStore } from '@nanostores/react';
|
|
3
|
+
import { RadioGroup } from '@ark-ui/react/radio-group';
|
|
4
|
+
import CheckCircleIcon from '@heroicons/react/20/solid/CheckCircleIcon';
|
|
5
|
+
import CubeTransparentIcon from '@heroicons/react/24/outline/CubeTransparentIcon';
|
|
6
|
+
import DocumentIcon from '@heroicons/react/24/outline/DocumentIcon';
|
|
7
|
+
import NewspaperIcon from '@heroicons/react/24/outline/NewspaperIcon';
|
|
8
|
+
import ExclamationTriangleIcon from '@heroicons/react/24/outline/ExclamationTriangleIcon';
|
|
9
|
+
import AddPanePanel from './AddPanePanel';
|
|
10
|
+
import PageCreationGen from './PageGen';
|
|
11
|
+
import PageCreationSpecial from './PageGenSpecial';
|
|
12
|
+
import { hasAssemblyAIStore, fullContentMapStore } from '@/stores/storykeep';
|
|
13
|
+
import type { NodesContext } from '@/stores/nodes';
|
|
14
|
+
|
|
15
|
+
interface PageCreationSelectorProps {
|
|
16
|
+
nodeId: string;
|
|
17
|
+
ctx: NodesContext;
|
|
18
|
+
isTemplate?: boolean;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
type CreationMode = {
|
|
22
|
+
id: 'design' | 'generate' | 'featured';
|
|
23
|
+
name: string;
|
|
24
|
+
description: string;
|
|
25
|
+
icon: typeof DocumentIcon;
|
|
26
|
+
active: boolean;
|
|
27
|
+
disabled?: boolean;
|
|
28
|
+
disabledReason?: string;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export const PageCreationSelector = ({
|
|
32
|
+
nodeId,
|
|
33
|
+
ctx,
|
|
34
|
+
isTemplate = false,
|
|
35
|
+
}: PageCreationSelectorProps) => {
|
|
36
|
+
const [selectedMode, setSelectedMode] =
|
|
37
|
+
useState<CreationMode['id']>('design');
|
|
38
|
+
const [showTemplates, setShowTemplates] = useState(false);
|
|
39
|
+
const [showGen, setShowGen] = useState(false);
|
|
40
|
+
const [showFeatured, setShowFeatured] = useState(false);
|
|
41
|
+
const $contentMap = useStore(fullContentMapStore);
|
|
42
|
+
|
|
43
|
+
const validPagesCount = useMemo(() => {
|
|
44
|
+
return $contentMap.filter(
|
|
45
|
+
(item) =>
|
|
46
|
+
item.type === 'StoryFragment' &&
|
|
47
|
+
typeof item.description === 'string' &&
|
|
48
|
+
typeof item.thumbSrc === 'string' &&
|
|
49
|
+
typeof item.thumbSrcSet === 'string' &&
|
|
50
|
+
typeof item.changed === 'string'
|
|
51
|
+
).length;
|
|
52
|
+
}, [$contentMap]);
|
|
53
|
+
|
|
54
|
+
const modes = useMemo(() => {
|
|
55
|
+
const baseModesWithoutFeature = [
|
|
56
|
+
{
|
|
57
|
+
id: 'design',
|
|
58
|
+
name: 'Design from scratch',
|
|
59
|
+
description:
|
|
60
|
+
'Build your page section by section using our design system',
|
|
61
|
+
icon: DocumentIcon,
|
|
62
|
+
active: true,
|
|
63
|
+
},
|
|
64
|
+
...(hasAssemblyAIStore.get()
|
|
65
|
+
? [
|
|
66
|
+
{
|
|
67
|
+
id: 'generate',
|
|
68
|
+
name: 'Generate with AI',
|
|
69
|
+
description:
|
|
70
|
+
'Tell us what kind of page you want and AI will generate a first draft',
|
|
71
|
+
icon: CubeTransparentIcon,
|
|
72
|
+
active: hasAssemblyAIStore.get(),
|
|
73
|
+
},
|
|
74
|
+
]
|
|
75
|
+
: []),
|
|
76
|
+
];
|
|
77
|
+
|
|
78
|
+
const featuredMode = {
|
|
79
|
+
id: 'featured',
|
|
80
|
+
name: 'Featured Content home page',
|
|
81
|
+
description:
|
|
82
|
+
'A layout with a prominent hero section showcasing a featured article and grid of additional top articles',
|
|
83
|
+
icon: NewspaperIcon,
|
|
84
|
+
active: true,
|
|
85
|
+
disabled: validPagesCount < 3,
|
|
86
|
+
disabledReason:
|
|
87
|
+
validPagesCount === 0
|
|
88
|
+
? 'Not yet available; no pages with SEO metadata found.'
|
|
89
|
+
: `Not yet available; requires at least 3 pages with SEO metadata (currently ${validPagesCount}).`,
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
return [...baseModesWithoutFeature, featuredMode] as CreationMode[];
|
|
93
|
+
}, [validPagesCount]);
|
|
94
|
+
|
|
95
|
+
const handleContinue = () => {
|
|
96
|
+
if (!selectedMode) return;
|
|
97
|
+
|
|
98
|
+
const selectedModeObj = modes.find((m) => m.id === selectedMode);
|
|
99
|
+
if (selectedModeObj?.disabled) return;
|
|
100
|
+
|
|
101
|
+
if (selectedMode === 'design') {
|
|
102
|
+
setShowTemplates(true);
|
|
103
|
+
} else if (selectedMode === 'generate') {
|
|
104
|
+
setShowGen(true);
|
|
105
|
+
} else if (selectedMode === 'featured') {
|
|
106
|
+
setShowFeatured(true);
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
const radioGroupStyles = `
|
|
111
|
+
.radio-control[data-state="unchecked"] .radio-dot {
|
|
112
|
+
background-color: #d1d5db; /* gray-300 */
|
|
113
|
+
}
|
|
114
|
+
.radio-control[data-state="checked"] .radio-dot {
|
|
115
|
+
background-color: #0891b2; /* cyan-600 */
|
|
116
|
+
}
|
|
117
|
+
.radio-control[data-state="checked"] {
|
|
118
|
+
border-color: #0891b2; /* cyan-600 */
|
|
119
|
+
}
|
|
120
|
+
.radio-item[data-state="checked"] {
|
|
121
|
+
background-color: #f9f9f9;
|
|
122
|
+
color: white;
|
|
123
|
+
}
|
|
124
|
+
.radio-item[data-disabled="true"] {
|
|
125
|
+
background-color: #f9fafb;
|
|
126
|
+
cursor: not-allowed;
|
|
127
|
+
}
|
|
128
|
+
`;
|
|
129
|
+
|
|
130
|
+
if (showTemplates || isTemplate)
|
|
131
|
+
return (
|
|
132
|
+
<AddPanePanel
|
|
133
|
+
nodeId={nodeId}
|
|
134
|
+
first={true}
|
|
135
|
+
ctx={ctx}
|
|
136
|
+
isStoryFragment={true}
|
|
137
|
+
/>
|
|
138
|
+
);
|
|
139
|
+
else if (showGen) return <PageCreationGen nodeId={nodeId} ctx={ctx} />;
|
|
140
|
+
else if (showFeatured)
|
|
141
|
+
return <PageCreationSpecial nodeId={nodeId} ctx={ctx} />;
|
|
142
|
+
|
|
143
|
+
return (
|
|
144
|
+
<div className="p-0.5 shadow-inner">
|
|
145
|
+
<style>{radioGroupStyles}</style>
|
|
146
|
+
<div className="w-full rounded-md bg-white p-6">
|
|
147
|
+
<h2 className="font-action mb-6 text-2xl font-bold text-gray-900">
|
|
148
|
+
How would you like to create your page?
|
|
149
|
+
</h2>
|
|
150
|
+
|
|
151
|
+
<div className="w-full max-w-3xl">
|
|
152
|
+
<RadioGroup.Root
|
|
153
|
+
defaultValue="design"
|
|
154
|
+
onValueChange={(details) => {
|
|
155
|
+
if (details.value) {
|
|
156
|
+
setSelectedMode(details.value as CreationMode['id']);
|
|
157
|
+
}
|
|
158
|
+
}}
|
|
159
|
+
>
|
|
160
|
+
<RadioGroup.Label className="sr-only">
|
|
161
|
+
Page Creation Mode
|
|
162
|
+
</RadioGroup.Label>
|
|
163
|
+
<div className="space-y-4">
|
|
164
|
+
{modes.map((mode) => (
|
|
165
|
+
<RadioGroup.Item
|
|
166
|
+
key={mode.id}
|
|
167
|
+
value={mode.id}
|
|
168
|
+
disabled={mode.disabled}
|
|
169
|
+
className={`radio-item relative flex cursor-pointer rounded-lg px-5 py-6 shadow-md focus:outline-none ${
|
|
170
|
+
mode.disabled
|
|
171
|
+
? 'bg-gray-50'
|
|
172
|
+
: 'bg-white hover:ring-2 hover:ring-cyan-600 hover:ring-offset-2'
|
|
173
|
+
}`}
|
|
174
|
+
>
|
|
175
|
+
<div className="flex w-full items-center justify-between">
|
|
176
|
+
<div className="flex items-center">
|
|
177
|
+
<div className="flex-shrink-0">
|
|
178
|
+
{mode.disabled ? (
|
|
179
|
+
<ExclamationTriangleIcon
|
|
180
|
+
className="h-8 w-8 text-amber-500"
|
|
181
|
+
aria-hidden="true"
|
|
182
|
+
/>
|
|
183
|
+
) : (
|
|
184
|
+
<mode.icon
|
|
185
|
+
className="h-8 w-8 text-cyan-700 data-[state=checked]:text-white"
|
|
186
|
+
aria-hidden="true"
|
|
187
|
+
/>
|
|
188
|
+
)}
|
|
189
|
+
</div>
|
|
190
|
+
<div className="ml-4">
|
|
191
|
+
<RadioGroup.ItemText>
|
|
192
|
+
<p
|
|
193
|
+
className={`font-bold ${mode.disabled ? 'text-gray-400' : 'text-gray-900 data-[state=checked]:text-white'}`}
|
|
194
|
+
>
|
|
195
|
+
{mode.name}
|
|
196
|
+
</p>
|
|
197
|
+
<span
|
|
198
|
+
className={`inline ${mode.disabled ? 'text-gray-400' : 'text-gray-500 data-[state=checked]:text-cyan-100'}`}
|
|
199
|
+
>
|
|
200
|
+
{mode.description}
|
|
201
|
+
{mode.disabled && mode.disabledReason && (
|
|
202
|
+
<span className="mt-1 block font-bold text-amber-500">
|
|
203
|
+
{mode.disabledReason}
|
|
204
|
+
</span>
|
|
205
|
+
)}
|
|
206
|
+
</span>
|
|
207
|
+
</RadioGroup.ItemText>
|
|
208
|
+
</div>
|
|
209
|
+
</div>
|
|
210
|
+
<div className="hidden shrink-0 text-white data-[state=checked]:block">
|
|
211
|
+
<CheckCircleIcon className="h-6 w-6" />
|
|
212
|
+
</div>
|
|
213
|
+
</div>
|
|
214
|
+
<RadioGroup.ItemControl className="radio-control mr-2 flex h-4 w-4 items-center justify-center rounded-full border border-gray-300">
|
|
215
|
+
<div className="radio-dot h-2 w-2 rounded-full" />
|
|
216
|
+
</RadioGroup.ItemControl>
|
|
217
|
+
<RadioGroup.ItemHiddenInput />
|
|
218
|
+
</RadioGroup.Item>
|
|
219
|
+
))}
|
|
220
|
+
</div>
|
|
221
|
+
</RadioGroup.Root>
|
|
222
|
+
</div>
|
|
223
|
+
|
|
224
|
+
<div className="mt-8 flex justify-end">
|
|
225
|
+
<button
|
|
226
|
+
type="button"
|
|
227
|
+
onClick={handleContinue}
|
|
228
|
+
className="inline-flex justify-center rounded-md bg-cyan-700 px-6 py-2 text-sm font-bold text-white shadow-sm hover:bg-cyan-600 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-cyan-600"
|
|
229
|
+
>
|
|
230
|
+
Continue
|
|
231
|
+
</button>
|
|
232
|
+
</div>
|
|
233
|
+
</div>
|
|
234
|
+
</div>
|
|
235
|
+
);
|
|
236
|
+
};
|
|
237
|
+
|
|
238
|
+
export default PageCreationSelector;
|
|
@@ -0,0 +1,362 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
import { RadioGroup } from '@ark-ui/react/radio-group';
|
|
4
|
+
import { ulid } from 'ulid';
|
|
5
|
+
import FeaturedContentPreview from '@/components/compositor/preview/FeaturedContentPreview';
|
|
6
|
+
import ListContentPreview from '@/components/compositor/preview/ListContentPreview';
|
|
7
|
+
import VisualBreakPreview from '@/components/compositor/preview/VisualBreakPreview';
|
|
8
|
+
import { getTemplateVisualBreakPane } from '@/utils/compositor/TemplatePanes';
|
|
9
|
+
import { fullContentMapStore } from '@/stores/storykeep';
|
|
10
|
+
import type { NodesContext } from '@/stores/nodes';
|
|
11
|
+
import { findUniqueSlug } from '@/utils/helpers';
|
|
12
|
+
import type { StoryFragmentNode, TemplatePane } from '@/types/compositorTypes';
|
|
13
|
+
|
|
14
|
+
// Layout options with IDs, labels, and descriptions
|
|
15
|
+
const layoutOptions = [
|
|
16
|
+
{
|
|
17
|
+
id: 'featured-only',
|
|
18
|
+
label: 'Featured Content Only',
|
|
19
|
+
description: 'A hero section highlighting your most important content',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
id: 'featured-list',
|
|
23
|
+
label: 'Featured with List',
|
|
24
|
+
description: 'Hero section with a supporting content grid below',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
id: 'complete-home',
|
|
28
|
+
label: 'Complete Home Layout',
|
|
29
|
+
description: 'Hero section, visual break, and supporting content grid',
|
|
30
|
+
},
|
|
31
|
+
];
|
|
32
|
+
|
|
33
|
+
// Visual break variants for selection
|
|
34
|
+
const breakVariants = [
|
|
35
|
+
{ id: 'cutwide2', label: 'Wave Cut', odd: true },
|
|
36
|
+
{ id: 'cutwide1', label: 'Diagonal Cut', odd: true },
|
|
37
|
+
{ id: 'burstwide2', label: 'Burst', odd: false },
|
|
38
|
+
{ id: 'crookedwide', label: 'Crooked', odd: false },
|
|
39
|
+
];
|
|
40
|
+
|
|
41
|
+
interface PageCreationSpecialProps {
|
|
42
|
+
nodeId: string;
|
|
43
|
+
ctx: NodesContext;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const PageCreationSpecial = ({
|
|
47
|
+
nodeId,
|
|
48
|
+
ctx,
|
|
49
|
+
}: PageCreationSpecialProps): ReactNode => {
|
|
50
|
+
// State for layout and visual break selection
|
|
51
|
+
const [selectedLayout, setSelectedLayout] = useState(layoutOptions[0].id);
|
|
52
|
+
const [selectedBreak, setSelectedBreak] = useState(breakVariants[0].id);
|
|
53
|
+
const [isCreating, setIsCreating] = useState(false);
|
|
54
|
+
|
|
55
|
+
const existingSlugs = fullContentMapStore
|
|
56
|
+
.get()
|
|
57
|
+
.filter((item) => ['Pane', 'StoryFragment'].includes(item.type))
|
|
58
|
+
.map((item) => item.slug);
|
|
59
|
+
|
|
60
|
+
// CSS for RadioGroup styling
|
|
61
|
+
const radioGroupStyles = `
|
|
62
|
+
.radio-control[data-state="unchecked"] .radio-dot {
|
|
63
|
+
background-color: #d1d5db; /* gray-300 */
|
|
64
|
+
}
|
|
65
|
+
.radio-control[data-state="checked"] .radio-dot {
|
|
66
|
+
background-color: #0891b2; /* cyan-600 */
|
|
67
|
+
}
|
|
68
|
+
.radio-control[data-state="checked"] {
|
|
69
|
+
border-color: #0891b2;
|
|
70
|
+
}
|
|
71
|
+
.radio-item[data-state="checked"] {
|
|
72
|
+
border-color: #0891b2;
|
|
73
|
+
background-color: #ecfeff; /* cyan-50 */
|
|
74
|
+
}
|
|
75
|
+
`;
|
|
76
|
+
|
|
77
|
+
// Function to handle continue/apply button
|
|
78
|
+
const handleApply = async () => {
|
|
79
|
+
if (!selectedLayout) return; // Null check
|
|
80
|
+
|
|
81
|
+
try {
|
|
82
|
+
setIsCreating(true);
|
|
83
|
+
|
|
84
|
+
// Get the storyfragment node
|
|
85
|
+
const storyfragment = ctx.allNodes.get().get(nodeId) as StoryFragmentNode;
|
|
86
|
+
if (!storyfragment) {
|
|
87
|
+
console.error('Story fragment not found');
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// Create panes array to hold the IDs of all panes we'll create
|
|
92
|
+
const paneIds: string[] = [];
|
|
93
|
+
|
|
94
|
+
// 1. Create Featured Content pane
|
|
95
|
+
const featuredContentPane: TemplatePane = {
|
|
96
|
+
id: ulid(),
|
|
97
|
+
nodeType: 'Pane',
|
|
98
|
+
title: 'Featured Content',
|
|
99
|
+
slug: findUniqueSlug(`featured-content`, existingSlugs),
|
|
100
|
+
isDecorative: false,
|
|
101
|
+
parentId: nodeId,
|
|
102
|
+
codeHookTarget: 'featured-content',
|
|
103
|
+
codeHookPayload: {
|
|
104
|
+
options: JSON.stringify({
|
|
105
|
+
title: 'Featured Content',
|
|
106
|
+
featured: true,
|
|
107
|
+
slugs: '',
|
|
108
|
+
category: '',
|
|
109
|
+
limit: '6',
|
|
110
|
+
showDate: 'true',
|
|
111
|
+
}),
|
|
112
|
+
},
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
// Add the featured content pane
|
|
116
|
+
const featuredContentId = ctx.addTemplatePane(
|
|
117
|
+
nodeId,
|
|
118
|
+
featuredContentPane
|
|
119
|
+
);
|
|
120
|
+
if (featuredContentId) {
|
|
121
|
+
paneIds.push(featuredContentId);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// If layout includes visual break + list content
|
|
125
|
+
if (selectedLayout === 'complete-home') {
|
|
126
|
+
// Get the selected break variant
|
|
127
|
+
const breakVariant = breakVariants.find((b) => b.id === selectedBreak);
|
|
128
|
+
const bgColor = breakVariant?.odd ? 'white' : 'gray-50';
|
|
129
|
+
const fillColor = breakVariant?.odd ? 'gray-50' : 'white';
|
|
130
|
+
|
|
131
|
+
// 2. Create Visual Break pane
|
|
132
|
+
const visualBreakTemplate = getTemplateVisualBreakPane(selectedBreak);
|
|
133
|
+
visualBreakTemplate.id = ulid();
|
|
134
|
+
visualBreakTemplate.title = 'Visual Break';
|
|
135
|
+
visualBreakTemplate.slug = `${storyfragment.slug}-visual-break`;
|
|
136
|
+
visualBreakTemplate.bgColour = bgColor;
|
|
137
|
+
|
|
138
|
+
// Configure the SVG fill color
|
|
139
|
+
if (visualBreakTemplate.bgPane) {
|
|
140
|
+
if (visualBreakTemplate.bgPane.type === 'visual-break') {
|
|
141
|
+
if (visualBreakTemplate.bgPane.breakDesktop) {
|
|
142
|
+
visualBreakTemplate.bgPane.breakDesktop.svgFill = fillColor;
|
|
143
|
+
}
|
|
144
|
+
if (visualBreakTemplate.bgPane.breakTablet) {
|
|
145
|
+
visualBreakTemplate.bgPane.breakTablet.svgFill = fillColor;
|
|
146
|
+
}
|
|
147
|
+
if (visualBreakTemplate.bgPane.breakMobile) {
|
|
148
|
+
visualBreakTemplate.bgPane.breakMobile.svgFill = fillColor;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
// Add the visual break pane
|
|
154
|
+
const visualBreakId = ctx.addTemplatePane(nodeId, visualBreakTemplate);
|
|
155
|
+
if (visualBreakId) {
|
|
156
|
+
paneIds.push(visualBreakId);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
// If layout includes list content
|
|
161
|
+
if (
|
|
162
|
+
selectedLayout === 'featured-list' ||
|
|
163
|
+
selectedLayout === 'complete-home'
|
|
164
|
+
) {
|
|
165
|
+
// 3. Create List Content pane
|
|
166
|
+
const listContentPane: TemplatePane = {
|
|
167
|
+
id: ulid(),
|
|
168
|
+
nodeType: 'Pane',
|
|
169
|
+
title: 'Content List',
|
|
170
|
+
slug: `${storyfragment.slug}-content-list`,
|
|
171
|
+
isDecorative: false,
|
|
172
|
+
parentId: nodeId,
|
|
173
|
+
// For complete-home layout, match the background color with the visual break
|
|
174
|
+
bgColour: selectedLayout === 'complete-home' ? 'gray-50' : 'white',
|
|
175
|
+
codeHookTarget: 'list-content',
|
|
176
|
+
codeHookPayload: {
|
|
177
|
+
options: JSON.stringify({
|
|
178
|
+
title: 'More Articles',
|
|
179
|
+
sortByPopular: 'true',
|
|
180
|
+
showTopics: 'true',
|
|
181
|
+
showDate: 'true',
|
|
182
|
+
limit: '10',
|
|
183
|
+
category: '',
|
|
184
|
+
}),
|
|
185
|
+
},
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
// Add the list content pane
|
|
189
|
+
const listContentId = ctx.addTemplatePane(nodeId, listContentPane);
|
|
190
|
+
if (listContentId) {
|
|
191
|
+
paneIds.push(listContentId);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
// Update the storyfragment with the new panes
|
|
196
|
+
if (paneIds.length > 0) {
|
|
197
|
+
storyfragment.paneIds = paneIds;
|
|
198
|
+
storyfragment.isChanged = true;
|
|
199
|
+
ctx.modifyNodes([storyfragment]);
|
|
200
|
+
ctx.notifyNode('root');
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
// Set title and slug if they're not set
|
|
204
|
+
if (!storyfragment.title || !storyfragment.slug) {
|
|
205
|
+
const updatedFragment = {
|
|
206
|
+
...storyfragment,
|
|
207
|
+
title: storyfragment.title || 'Home Page',
|
|
208
|
+
slug: storyfragment.slug || 'home',
|
|
209
|
+
isChanged: true,
|
|
210
|
+
};
|
|
211
|
+
ctx.modifyNodes([updatedFragment]);
|
|
212
|
+
}
|
|
213
|
+
} catch (error) {
|
|
214
|
+
console.error('Error creating special layout:', error);
|
|
215
|
+
} finally {
|
|
216
|
+
setIsCreating(false);
|
|
217
|
+
}
|
|
218
|
+
};
|
|
219
|
+
|
|
220
|
+
return (
|
|
221
|
+
<div className="rounded-md bg-white p-6">
|
|
222
|
+
<style>{radioGroupStyles}</style>
|
|
223
|
+
<div className="text-mydarkgrey mb-6 space-y-6 italic">
|
|
224
|
+
<strong>Note:</strong> when editing web pages (story fragments) be sure
|
|
225
|
+
to click on Topics & Details for each page; (if you see no articles,
|
|
226
|
+
that's why!)
|
|
227
|
+
</div>
|
|
228
|
+
<div className="mb-6 space-y-6">
|
|
229
|
+
<div>
|
|
230
|
+
<RadioGroup.Root
|
|
231
|
+
defaultValue={selectedLayout}
|
|
232
|
+
onValueChange={(details) => {
|
|
233
|
+
if (details.value) {
|
|
234
|
+
setSelectedLayout(details.value);
|
|
235
|
+
}
|
|
236
|
+
}}
|
|
237
|
+
>
|
|
238
|
+
<RadioGroup.Label className="text-lg font-bold">
|
|
239
|
+
Select Layout
|
|
240
|
+
</RadioGroup.Label>
|
|
241
|
+
<div className="mt-2 space-y-4">
|
|
242
|
+
{layoutOptions.map((option) => (
|
|
243
|
+
<RadioGroup.Item
|
|
244
|
+
key={option.id}
|
|
245
|
+
value={option.id}
|
|
246
|
+
className="radio-item flex items-center space-x-3 rounded-lg border p-4"
|
|
247
|
+
>
|
|
248
|
+
<div className="flex items-center">
|
|
249
|
+
<RadioGroup.ItemControl className="radio-control mr-2 flex h-4 w-4 items-center justify-center rounded-full border border-gray-300">
|
|
250
|
+
<div className="radio-dot h-2 w-2 rounded-full" />
|
|
251
|
+
</RadioGroup.ItemControl>
|
|
252
|
+
<RadioGroup.ItemText>
|
|
253
|
+
<div>
|
|
254
|
+
<div className="font-bold">{option.label}</div>
|
|
255
|
+
<div className="text-sm text-gray-500">
|
|
256
|
+
{option.description}
|
|
257
|
+
</div>
|
|
258
|
+
</div>
|
|
259
|
+
</RadioGroup.ItemText>
|
|
260
|
+
</div>
|
|
261
|
+
<RadioGroup.ItemHiddenInput />
|
|
262
|
+
</RadioGroup.Item>
|
|
263
|
+
))}
|
|
264
|
+
</div>
|
|
265
|
+
</RadioGroup.Root>
|
|
266
|
+
</div>
|
|
267
|
+
|
|
268
|
+
{selectedLayout === 'complete-home' && (
|
|
269
|
+
<div>
|
|
270
|
+
<div className="mb-2 text-lg font-bold">
|
|
271
|
+
Select Visual Break Style
|
|
272
|
+
</div>
|
|
273
|
+
<div className="grid grid-cols-2 gap-4 md:grid-cols-3 lg:grid-cols-5">
|
|
274
|
+
{breakVariants.map((breakVar) => (
|
|
275
|
+
<div
|
|
276
|
+
key={breakVar.id}
|
|
277
|
+
className={`cursor-pointer rounded-lg border p-2 ${
|
|
278
|
+
selectedBreak === breakVar.id
|
|
279
|
+
? 'border-cyan-600 ring-2 ring-cyan-600 ring-opacity-50'
|
|
280
|
+
: 'border-gray-300'
|
|
281
|
+
}`}
|
|
282
|
+
onClick={() => setSelectedBreak(breakVar.id)}
|
|
283
|
+
>
|
|
284
|
+
<div className="h-16 overflow-hidden rounded">
|
|
285
|
+
<VisualBreakPreview
|
|
286
|
+
bgColour="#ffffff"
|
|
287
|
+
fillColour="#000000"
|
|
288
|
+
variant={breakVar.id}
|
|
289
|
+
height={60}
|
|
290
|
+
/>
|
|
291
|
+
</div>
|
|
292
|
+
<div className="mt-1 text-center text-sm font-bold">
|
|
293
|
+
{breakVar.label}
|
|
294
|
+
</div>
|
|
295
|
+
</div>
|
|
296
|
+
))}
|
|
297
|
+
</div>
|
|
298
|
+
</div>
|
|
299
|
+
)}
|
|
300
|
+
</div>
|
|
301
|
+
|
|
302
|
+
<div className="mt-8 rounded-lg border bg-white p-4 shadow-md">
|
|
303
|
+
<h3 className="mb-4 text-lg font-bold">Preview</h3>
|
|
304
|
+
|
|
305
|
+
{selectedLayout === 'featured-only' && <FeaturedContentPreview />}
|
|
306
|
+
|
|
307
|
+
{selectedLayout === 'featured-list' && (
|
|
308
|
+
<div>
|
|
309
|
+
<FeaturedContentPreview />
|
|
310
|
+
<ListContentPreview bgColour="#ffffff" />
|
|
311
|
+
</div>
|
|
312
|
+
)}
|
|
313
|
+
|
|
314
|
+
{selectedLayout === 'complete-home' && (
|
|
315
|
+
<div>
|
|
316
|
+
<FeaturedContentPreview />
|
|
317
|
+
<VisualBreakPreview
|
|
318
|
+
bgColour={
|
|
319
|
+
breakVariants.find((b) => b.id === selectedBreak)?.odd
|
|
320
|
+
? '#ffffff'
|
|
321
|
+
: '#f1f5f9'
|
|
322
|
+
}
|
|
323
|
+
fillColour={
|
|
324
|
+
breakVariants.find((b) => b.id === selectedBreak)?.odd
|
|
325
|
+
? '#f1f5f9'
|
|
326
|
+
: '#ffffff'
|
|
327
|
+
}
|
|
328
|
+
variant={selectedBreak}
|
|
329
|
+
/>
|
|
330
|
+
<ListContentPreview bgColour="#f1f5f9" />
|
|
331
|
+
</div>
|
|
332
|
+
)}
|
|
333
|
+
</div>
|
|
334
|
+
|
|
335
|
+
<div className="mt-6 flex justify-end gap-3">
|
|
336
|
+
<button
|
|
337
|
+
onClick={() => {
|
|
338
|
+
ctx.setPanelMode(nodeId, 'add', 'DEFAULT');
|
|
339
|
+
ctx.notifyNode('root');
|
|
340
|
+
}}
|
|
341
|
+
className="rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-bold text-gray-700 hover:bg-gray-50"
|
|
342
|
+
disabled={isCreating}
|
|
343
|
+
>
|
|
344
|
+
Back
|
|
345
|
+
</button>
|
|
346
|
+
<button
|
|
347
|
+
onClick={handleApply}
|
|
348
|
+
disabled={isCreating || !selectedLayout}
|
|
349
|
+
className={`rounded-md px-6 py-2 text-sm font-bold text-white transition-colors ${
|
|
350
|
+
isCreating || !selectedLayout
|
|
351
|
+
? 'bg-gray-400'
|
|
352
|
+
: 'bg-cyan-600 hover:bg-cyan-700'
|
|
353
|
+
}`}
|
|
354
|
+
>
|
|
355
|
+
{isCreating ? 'Creating...' : 'Create Layout'}
|
|
356
|
+
</button>
|
|
357
|
+
</div>
|
|
358
|
+
</div>
|
|
359
|
+
);
|
|
360
|
+
};
|
|
361
|
+
|
|
362
|
+
export default PageCreationSpecial;
|