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,243 @@
|
|
|
1
|
+
import {
|
|
2
|
+
freshInstallStore,
|
|
3
|
+
FRESH_INSTALL_CACHE_DURATION,
|
|
4
|
+
} from '@/stores/backend';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Backend health check utilities for TractStack
|
|
8
|
+
* Handles proper failover logic between maintenance and 404 responses
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
export interface BackendHealthResponse {
|
|
12
|
+
isHealthy: boolean;
|
|
13
|
+
shouldRedirectToMaint: boolean;
|
|
14
|
+
shouldReturn404: boolean;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Check if backend is healthy and determine appropriate response action
|
|
19
|
+
* @param goBackend - Backend URL
|
|
20
|
+
* @param tenantId - Tenant ID for headers
|
|
21
|
+
* @param httpStatus - The original HTTP status from the failed request
|
|
22
|
+
* @returns Object indicating what action to take
|
|
23
|
+
*/
|
|
24
|
+
export async function checkBackendHealth(
|
|
25
|
+
goBackend: string,
|
|
26
|
+
tenantId: string,
|
|
27
|
+
httpStatus: number
|
|
28
|
+
): Promise<BackendHealthResponse> {
|
|
29
|
+
try {
|
|
30
|
+
// Quick health check with short timeout
|
|
31
|
+
const healthCheck = await fetch(`${goBackend}/api/v1/health`, {
|
|
32
|
+
headers: { 'X-Tenant-ID': tenantId },
|
|
33
|
+
signal: AbortSignal.timeout(3000), // 3 second timeout
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
const isHealthy = healthCheck.ok;
|
|
37
|
+
|
|
38
|
+
// If backend is healthy but we got 404/500, it's a legitimate content error
|
|
39
|
+
if (isHealthy && (httpStatus === 404 || httpStatus >= 500)) {
|
|
40
|
+
return {
|
|
41
|
+
isHealthy: true,
|
|
42
|
+
shouldRedirectToMaint: false,
|
|
43
|
+
shouldReturn404: true,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// If backend is unhealthy, go to maintenance
|
|
48
|
+
if (!isHealthy) {
|
|
49
|
+
return {
|
|
50
|
+
isHealthy: false,
|
|
51
|
+
shouldRedirectToMaint: true,
|
|
52
|
+
shouldReturn404: false,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// Backend is healthy and status is not 404/500 - shouldn't happen but handle gracefully
|
|
57
|
+
return {
|
|
58
|
+
isHealthy: true,
|
|
59
|
+
shouldRedirectToMaint: false,
|
|
60
|
+
shouldReturn404: true,
|
|
61
|
+
};
|
|
62
|
+
} catch (healthError) {
|
|
63
|
+
// Health check failed - backend is likely down
|
|
64
|
+
return {
|
|
65
|
+
isHealthy: false,
|
|
66
|
+
shouldRedirectToMaint: true,
|
|
67
|
+
shouldReturn404: false,
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Handle response based on backend health check
|
|
74
|
+
* @param healthResponse - Result from checkBackendHealth
|
|
75
|
+
* @param originalStatus - Original HTTP status code
|
|
76
|
+
* @param currentPath - Current URL path for redirect
|
|
77
|
+
* @returns Astro Response or redirect
|
|
78
|
+
*/
|
|
79
|
+
export function handleBackendResponse(
|
|
80
|
+
healthResponse: BackendHealthResponse,
|
|
81
|
+
originalStatus: number,
|
|
82
|
+
currentPath: string
|
|
83
|
+
) {
|
|
84
|
+
if (healthResponse.shouldRedirectToMaint) {
|
|
85
|
+
// Backend is down - redirect to maintenance page
|
|
86
|
+
return new Response(null, {
|
|
87
|
+
status: 302,
|
|
88
|
+
headers: {
|
|
89
|
+
Location: `/maint?from=${encodeURIComponent(currentPath)}`,
|
|
90
|
+
},
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
if (healthResponse.shouldReturn404) {
|
|
95
|
+
// Backend is up but content not found - return proper error
|
|
96
|
+
const statusText =
|
|
97
|
+
originalStatus === 404
|
|
98
|
+
? 'Story not found'
|
|
99
|
+
: originalStatus >= 500
|
|
100
|
+
? 'Server error'
|
|
101
|
+
: 'Request failed';
|
|
102
|
+
|
|
103
|
+
return new Response(null, {
|
|
104
|
+
status: originalStatus,
|
|
105
|
+
statusText,
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// Fallback - should not reach here
|
|
110
|
+
return new Response(null, {
|
|
111
|
+
status: 500,
|
|
112
|
+
statusText: 'Unexpected error',
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Handle failed backend response - determines if backend is down or content is missing
|
|
118
|
+
* This replaces the entire if (!response.ok) block in Astro pages
|
|
119
|
+
* @param response - The failed fetch response
|
|
120
|
+
* @param goBackend - Backend URL
|
|
121
|
+
* @param tenantId - Tenant ID
|
|
122
|
+
* @param currentPath - Current URL path
|
|
123
|
+
* @returns Astro Response or null (if response was actually ok)
|
|
124
|
+
*/
|
|
125
|
+
export async function handleFailedResponse(
|
|
126
|
+
response: Response,
|
|
127
|
+
goBackend: string,
|
|
128
|
+
tenantId: string,
|
|
129
|
+
currentPath: string
|
|
130
|
+
): Promise<Response | null> {
|
|
131
|
+
if (response.ok) {
|
|
132
|
+
return null; // Response was actually ok, let caller handle it normally
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
if (response.status >= 500 || response.status === 404) {
|
|
136
|
+
// Use the backend health helper to determine proper response
|
|
137
|
+
const healthResponse = await checkBackendHealth(
|
|
138
|
+
goBackend,
|
|
139
|
+
tenantId,
|
|
140
|
+
response.status
|
|
141
|
+
);
|
|
142
|
+
|
|
143
|
+
return handleBackendResponse(healthResponse, response.status, currentPath);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
// Other error status codes (401, 403, etc.) - return as-is
|
|
147
|
+
return new Response(null, {
|
|
148
|
+
status: response.status,
|
|
149
|
+
statusText: 'Story not found',
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Performs a pre-check to detect if the system requires initial setup.
|
|
155
|
+
* This function is designed to work idiomatically with Astro's control flow.
|
|
156
|
+
*
|
|
157
|
+
* - If setup is needed, it returns a Response object to trigger a redirect.
|
|
158
|
+
* - If the system is healthy, it completes silently by returning void.
|
|
159
|
+
* - If an unexpected error occurs (e.g., backend is unreachable), it logs
|
|
160
|
+
* the error and returns a Response object to redirect to a maintenance page.
|
|
161
|
+
*
|
|
162
|
+
* @param tenantId The tenant ID for which to perform the health check.
|
|
163
|
+
* @returns {Promise<Response | void>} A promise that resolves to a Response object
|
|
164
|
+
* if a redirect is needed, or void if the request can proceed.
|
|
165
|
+
*/
|
|
166
|
+
export async function preHealthCheck(
|
|
167
|
+
tenantId: string
|
|
168
|
+
): Promise<Response | void> {
|
|
169
|
+
const currentState = freshInstallStore.get();
|
|
170
|
+
const now = Date.now();
|
|
171
|
+
|
|
172
|
+
// Fast path: Use cache if the tenant is known to be active and the check is recent.
|
|
173
|
+
if (
|
|
174
|
+
currentState.activeTenants.includes(tenantId) &&
|
|
175
|
+
!currentState.needsSetup &&
|
|
176
|
+
now - currentState.lastChecked < FRESH_INSTALL_CACHE_DURATION
|
|
177
|
+
) {
|
|
178
|
+
return;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
const goBackend =
|
|
182
|
+
import.meta.env.PUBLIC_GO_BACKEND || 'http://localhost:8080';
|
|
183
|
+
const healthCheckUrl = `${goBackend}/api/v1/health`;
|
|
184
|
+
|
|
185
|
+
try {
|
|
186
|
+
const response = await fetch(healthCheckUrl, {
|
|
187
|
+
headers: { 'X-Tenant-ID': tenantId },
|
|
188
|
+
signal: AbortSignal.timeout(5000), // 5-second timeout
|
|
189
|
+
});
|
|
190
|
+
|
|
191
|
+
if (!response.ok) {
|
|
192
|
+
const responseBody = await response.text();
|
|
193
|
+
console.error(
|
|
194
|
+
`[preHealthCheck] Health check responded with a non-OK status: ${response.status}`,
|
|
195
|
+
{ tenantId, responseBody }
|
|
196
|
+
);
|
|
197
|
+
throw new Error(
|
|
198
|
+
`Health check failed with status code: ${response.status}`
|
|
199
|
+
);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
const result = await response.json();
|
|
203
|
+
|
|
204
|
+
if (result.needsSetup === true) {
|
|
205
|
+
// System requires initial setup. Update state and return a redirect Response.
|
|
206
|
+
freshInstallStore.set({
|
|
207
|
+
needsSetup: true,
|
|
208
|
+
activeTenants: currentState.activeTenants.filter(
|
|
209
|
+
(id) => id !== tenantId
|
|
210
|
+
),
|
|
211
|
+
lastChecked: now,
|
|
212
|
+
});
|
|
213
|
+
|
|
214
|
+
return new Response(null, {
|
|
215
|
+
status: 302,
|
|
216
|
+
headers: { Location: '/storykeep/init' },
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
// If we reach here, the system is considered initialized and healthy.
|
|
221
|
+
// Update the cache to reflect this state and continue.
|
|
222
|
+
freshInstallStore.set({
|
|
223
|
+
needsSetup: false,
|
|
224
|
+
activeTenants: [...new Set([...currentState.activeTenants, tenantId])],
|
|
225
|
+
lastChecked: now,
|
|
226
|
+
});
|
|
227
|
+
} catch (error) {
|
|
228
|
+
// For any error (network failure, JSON parsing error, etc.), log it
|
|
229
|
+
// and return a Response to redirect to the maintenance page.
|
|
230
|
+
console.error(
|
|
231
|
+
'[preHealthCheck] An unexpected error occurred during the health check process.',
|
|
232
|
+
{ tenantId, originalError: error }
|
|
233
|
+
);
|
|
234
|
+
|
|
235
|
+
const maintUrl = `/maint?from=${encodeURIComponent(
|
|
236
|
+
globalThis.location?.pathname || '/'
|
|
237
|
+
)}`;
|
|
238
|
+
return new Response(null, {
|
|
239
|
+
status: 302,
|
|
240
|
+
headers: { Location: maintUrl },
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { getColor } from './tailwindColors';
|
|
2
|
+
import type { TemplateMarkdown } from '@/types/compositorTypes';
|
|
3
|
+
import type { Theme } from '@/types/tractstack';
|
|
4
|
+
|
|
5
|
+
export const getTemplateSimpleMarkdown = (theme: Theme) => {
|
|
6
|
+
return {
|
|
7
|
+
nodeType: 'Markdown',
|
|
8
|
+
id: '',
|
|
9
|
+
parentId: '',
|
|
10
|
+
type: 'markdown',
|
|
11
|
+
markdownId: '01JD2RGG95PMZ7E6V5MBX9Q3FJ',
|
|
12
|
+
defaultClasses: {
|
|
13
|
+
h2: {
|
|
14
|
+
mobile: {
|
|
15
|
+
fontWEIGHT: 'bold',
|
|
16
|
+
textCOLOR: getColor(
|
|
17
|
+
{
|
|
18
|
+
light: 'brand-7',
|
|
19
|
+
'light-bw': 'brand-1',
|
|
20
|
+
'light-bold': 'brand-5',
|
|
21
|
+
dark: 'brand-4',
|
|
22
|
+
'dark-bw': 'brand-8',
|
|
23
|
+
'dark-bold': 'brand-3',
|
|
24
|
+
},
|
|
25
|
+
theme
|
|
26
|
+
),
|
|
27
|
+
textSIZE: '4xl',
|
|
28
|
+
fontFACE: 'action',
|
|
29
|
+
},
|
|
30
|
+
tablet: {
|
|
31
|
+
textSIZE: '5xl',
|
|
32
|
+
},
|
|
33
|
+
desktop: {
|
|
34
|
+
textSIZE: '6xl',
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
h3: {
|
|
38
|
+
mobile: {
|
|
39
|
+
fontWEIGHT: 'bold',
|
|
40
|
+
textCOLOR: 'brand-5',
|
|
41
|
+
textSIZE: 'xl',
|
|
42
|
+
fontFACE: 'action',
|
|
43
|
+
},
|
|
44
|
+
tablet: {
|
|
45
|
+
textSIZE: '3xl',
|
|
46
|
+
},
|
|
47
|
+
desktop: {},
|
|
48
|
+
},
|
|
49
|
+
h4: {
|
|
50
|
+
mobile: {
|
|
51
|
+
textCOLOR: 'brand-5',
|
|
52
|
+
textSIZE: 'xl',
|
|
53
|
+
fontFACE: 'action',
|
|
54
|
+
},
|
|
55
|
+
tablet: {
|
|
56
|
+
textSIZE: '2xl',
|
|
57
|
+
},
|
|
58
|
+
desktop: {},
|
|
59
|
+
},
|
|
60
|
+
p: {
|
|
61
|
+
mobile: {
|
|
62
|
+
textCOLOR: 'myoffwhite',
|
|
63
|
+
textSIZE: 'lg',
|
|
64
|
+
lineHEIGHT: 'snug',
|
|
65
|
+
mt: '2.5',
|
|
66
|
+
},
|
|
67
|
+
tablet: {
|
|
68
|
+
textSIZE: 'xl',
|
|
69
|
+
mt: '3.5',
|
|
70
|
+
},
|
|
71
|
+
desktop: {},
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
parentClasses: [
|
|
75
|
+
{
|
|
76
|
+
mobile: {
|
|
77
|
+
mt: '10',
|
|
78
|
+
mb: '5',
|
|
79
|
+
mx: '5',
|
|
80
|
+
},
|
|
81
|
+
tablet: {
|
|
82
|
+
mt: '20',
|
|
83
|
+
mb: '10',
|
|
84
|
+
mx: '10',
|
|
85
|
+
},
|
|
86
|
+
desktop: {},
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
mobile: {
|
|
90
|
+
maxW: 'none',
|
|
91
|
+
mx: 'auto',
|
|
92
|
+
},
|
|
93
|
+
tablet: {
|
|
94
|
+
maxW: 'screen-lg',
|
|
95
|
+
},
|
|
96
|
+
desktop: {
|
|
97
|
+
maxW: 'screen-xl',
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
mobile: {
|
|
102
|
+
px: '9',
|
|
103
|
+
pt: '12',
|
|
104
|
+
pb: '10',
|
|
105
|
+
textALIGN: 'left',
|
|
106
|
+
textWRAP: 'pretty',
|
|
107
|
+
maxW: 'none',
|
|
108
|
+
},
|
|
109
|
+
tablet: {
|
|
110
|
+
px: '14',
|
|
111
|
+
},
|
|
112
|
+
desktop: {
|
|
113
|
+
px: '32',
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
],
|
|
117
|
+
} as TemplateMarkdown;
|
|
118
|
+
};
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import type { TemplateNode } from '@/types/compositorTypes';
|
|
2
|
+
|
|
3
|
+
export const TemplateH2Node = {
|
|
4
|
+
nodeType: 'TagElement',
|
|
5
|
+
tagName: 'h2',
|
|
6
|
+
nodes: [
|
|
7
|
+
{
|
|
8
|
+
copy: 'Catchy title',
|
|
9
|
+
tagName: 'text',
|
|
10
|
+
},
|
|
11
|
+
],
|
|
12
|
+
} as TemplateNode;
|
|
13
|
+
|
|
14
|
+
export const TemplateH3Node = {
|
|
15
|
+
nodeType: 'TagElement',
|
|
16
|
+
tagName: 'h3',
|
|
17
|
+
nodes: [
|
|
18
|
+
{
|
|
19
|
+
copy: 'Catchy sub-title',
|
|
20
|
+
tagName: 'text',
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
} as TemplateNode;
|
|
24
|
+
|
|
25
|
+
export const TemplateH4Node = {
|
|
26
|
+
nodeType: 'TagElement',
|
|
27
|
+
tagName: 'h4',
|
|
28
|
+
nodes: [
|
|
29
|
+
{
|
|
30
|
+
copy: 'Catchy sub-title',
|
|
31
|
+
tagName: 'text',
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
} as TemplateNode;
|
|
35
|
+
|
|
36
|
+
export const TemplatePNode = {
|
|
37
|
+
nodeType: 'TagElement',
|
|
38
|
+
tagName: 'p',
|
|
39
|
+
nodes: [
|
|
40
|
+
{
|
|
41
|
+
copy: '...',
|
|
42
|
+
tagName: 'text',
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
} as TemplateNode;
|
|
46
|
+
|
|
47
|
+
export const TemplateOLNode = {
|
|
48
|
+
nodeType: 'TagElement',
|
|
49
|
+
tagName: 'ol',
|
|
50
|
+
nodes: [
|
|
51
|
+
{
|
|
52
|
+
copy: '...',
|
|
53
|
+
tagName: 'text',
|
|
54
|
+
},
|
|
55
|
+
],
|
|
56
|
+
} as TemplateNode;
|
|
57
|
+
|
|
58
|
+
export const TemplateULNode = {
|
|
59
|
+
nodeType: 'TagElement',
|
|
60
|
+
tagName: 'ul',
|
|
61
|
+
nodes: [
|
|
62
|
+
{
|
|
63
|
+
copy: '...',
|
|
64
|
+
tagName: 'text',
|
|
65
|
+
},
|
|
66
|
+
],
|
|
67
|
+
} as TemplateNode;
|
|
68
|
+
|
|
69
|
+
export const TemplateLINode = {
|
|
70
|
+
nodeType: 'TagElement',
|
|
71
|
+
tagName: 'li',
|
|
72
|
+
nodes: [
|
|
73
|
+
{
|
|
74
|
+
copy: '...',
|
|
75
|
+
tagName: 'text',
|
|
76
|
+
},
|
|
77
|
+
],
|
|
78
|
+
} as TemplateNode;
|
|
79
|
+
|
|
80
|
+
//export const TemplateAsideNode = {
|
|
81
|
+
// nodeType: "TagElement",
|
|
82
|
+
// tagName: "aside",
|
|
83
|
+
// nodes: [
|
|
84
|
+
// {
|
|
85
|
+
// copy: "aside node",
|
|
86
|
+
// tagName: "text",
|
|
87
|
+
// },
|
|
88
|
+
// ],
|
|
89
|
+
//} as TemplateNode;
|
|
90
|
+
|
|
91
|
+
export const TemplateImgNode = {
|
|
92
|
+
nodeType: 'TagElement',
|
|
93
|
+
tagName: 'img',
|
|
94
|
+
src: '/static.jpg',
|
|
95
|
+
alt: 'New image coming soon!',
|
|
96
|
+
} as TemplateNode;
|
|
97
|
+
|
|
98
|
+
export const TemplateYoutubeNode = {
|
|
99
|
+
nodeType: 'TagElement',
|
|
100
|
+
tagName: 'code',
|
|
101
|
+
copy: 'youtube(kJI4XdqiiAI|The Free Web Press)',
|
|
102
|
+
codeHookParams: ['kJI4XdqiiAI', 'The Free Web Press'],
|
|
103
|
+
} as TemplateNode;
|
|
104
|
+
|
|
105
|
+
export const TemplateToggleNode = {
|
|
106
|
+
nodeType: 'TagElement',
|
|
107
|
+
tagName: 'code',
|
|
108
|
+
copy: 'toggle(BeliefTag|This is so awesome, right?!)',
|
|
109
|
+
codeHookParams: ['BeliefTag', 'This is so awesome, right?!'],
|
|
110
|
+
} as TemplateNode;
|
|
111
|
+
|
|
112
|
+
export const TemplateBeliefNode = {
|
|
113
|
+
nodeType: 'TagElement',
|
|
114
|
+
tagName: 'code',
|
|
115
|
+
copy: 'belief(BeliefTag|likert|prompt)',
|
|
116
|
+
codeHookParams: ['BeliefTag', 'likert', 'prompt'],
|
|
117
|
+
} as TemplateNode;
|
|
118
|
+
|
|
119
|
+
export const TemplateBunnyNode = {
|
|
120
|
+
nodeType: 'TagElement',
|
|
121
|
+
tagName: 'code',
|
|
122
|
+
copy: 'bunny(id|title)',
|
|
123
|
+
codeHookParams: ['id', 'title'],
|
|
124
|
+
} as TemplateNode;
|
|
125
|
+
|
|
126
|
+
export const TemplateEmailSignUpNode = {
|
|
127
|
+
nodeType: 'TagElement',
|
|
128
|
+
tagName: 'code',
|
|
129
|
+
copy: 'signup(major|Keep in touch!|false)',
|
|
130
|
+
codeHookParams: ['major', 'Keep in touch!', 'false'],
|
|
131
|
+
} as TemplateNode;
|
|
132
|
+
|
|
133
|
+
export const TemplateIdentifyAsNode = {
|
|
134
|
+
nodeType: 'TagElement',
|
|
135
|
+
tagName: 'code',
|
|
136
|
+
copy: 'identifyAs(BeliefTag|TARGET_VALUE|prompt)',
|
|
137
|
+
codeHookParams: ['BeliefTag', 'TARGET_VALUE', 'prompt'],
|
|
138
|
+
} as TemplateNode;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import {
|
|
2
|
+
//TemplateAsideNode,
|
|
3
|
+
TemplateH2Node,
|
|
4
|
+
TemplateH3Node,
|
|
5
|
+
TemplatePNode,
|
|
6
|
+
} from './TemplateNodes';
|
|
7
|
+
import { getTemplateSimpleMarkdown } from './TemplateMarkdowns';
|
|
8
|
+
import { getColor, tailwindToHex } from './tailwindColors';
|
|
9
|
+
import type { TemplatePane } from '@/types/compositorTypes';
|
|
10
|
+
import type { Theme } from '@/types/tractstack';
|
|
11
|
+
|
|
12
|
+
export const getTemplateVisualBreakPane = (variant: string) => {
|
|
13
|
+
// colour will be set on insert based on adjacent nodes
|
|
14
|
+
const breakConfig = {
|
|
15
|
+
collection: 'kCz',
|
|
16
|
+
image: variant,
|
|
17
|
+
svgFill: 'black',
|
|
18
|
+
};
|
|
19
|
+
return {
|
|
20
|
+
nodeType: 'Pane',
|
|
21
|
+
title: '',
|
|
22
|
+
slug: '',
|
|
23
|
+
isDecorative: true,
|
|
24
|
+
bgColour: 'white',
|
|
25
|
+
bgPane: {
|
|
26
|
+
nodeType: 'BgPane',
|
|
27
|
+
type: 'visual-break',
|
|
28
|
+
breakDesktop: breakConfig,
|
|
29
|
+
breakTablet: breakConfig,
|
|
30
|
+
breakMobile: breakConfig,
|
|
31
|
+
},
|
|
32
|
+
} as TemplatePane;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export const getTemplateSimplePane = (
|
|
36
|
+
theme: Theme,
|
|
37
|
+
brand: string,
|
|
38
|
+
useOdd: boolean = false
|
|
39
|
+
) => {
|
|
40
|
+
return {
|
|
41
|
+
nodeType: 'Pane',
|
|
42
|
+
title: '',
|
|
43
|
+
slug: '',
|
|
44
|
+
bgColour: tailwindToHex(
|
|
45
|
+
getColor(
|
|
46
|
+
{
|
|
47
|
+
light: !useOdd ? 'brand-2' : 'white',
|
|
48
|
+
'light-bw': !useOdd ? 'white' : 'brand-2',
|
|
49
|
+
'light-bold': !useOdd ? 'brand-2' : 'white',
|
|
50
|
+
dark: !useOdd ? 'black' : 'brand-1',
|
|
51
|
+
'dark-bw': !useOdd ? 'black' : 'brand-1',
|
|
52
|
+
'dark-bold': !useOdd ? 'brand-1' : 'black',
|
|
53
|
+
},
|
|
54
|
+
theme
|
|
55
|
+
),
|
|
56
|
+
brand
|
|
57
|
+
),
|
|
58
|
+
markdown: {
|
|
59
|
+
...getTemplateSimpleMarkdown(theme),
|
|
60
|
+
nodes: [
|
|
61
|
+
{ ...TemplateH2Node, copy: 'H2 node in simple pane' },
|
|
62
|
+
{ ...TemplatePNode, copy: 'P node in simple pane' },
|
|
63
|
+
{ ...TemplateH3Node, copy: 'H3 node in simple pane' },
|
|
64
|
+
//{ ...TemplateAsideNode, copy: "Aside node in simple pane" },
|
|
65
|
+
],
|
|
66
|
+
},
|
|
67
|
+
} as TemplatePane;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
export const getTemplateMarkdownPane = (
|
|
71
|
+
theme: Theme,
|
|
72
|
+
variant: string,
|
|
73
|
+
brand: string,
|
|
74
|
+
useOdd: boolean = false
|
|
75
|
+
) => {
|
|
76
|
+
console.log(`variant: ${variant}`);
|
|
77
|
+
return {
|
|
78
|
+
nodeType: 'Pane',
|
|
79
|
+
title: '',
|
|
80
|
+
slug: '',
|
|
81
|
+
bgColour: tailwindToHex(
|
|
82
|
+
getColor(
|
|
83
|
+
{
|
|
84
|
+
light: !useOdd ? 'brand-2' : 'white',
|
|
85
|
+
'light-bw': !useOdd ? 'white' : 'brand-2',
|
|
86
|
+
'light-bold': !useOdd ? 'brand-2' : 'white',
|
|
87
|
+
dark: !useOdd ? 'black' : 'brand-1',
|
|
88
|
+
'dark-bw': !useOdd ? 'black' : 'brand-1',
|
|
89
|
+
'dark-bold': !useOdd ? 'brand-1' : 'black',
|
|
90
|
+
},
|
|
91
|
+
theme
|
|
92
|
+
),
|
|
93
|
+
brand
|
|
94
|
+
),
|
|
95
|
+
markdown: {
|
|
96
|
+
...getTemplateSimpleMarkdown(theme),
|
|
97
|
+
markdownBody: `## add a catchy title here\n\nyour story continues... and continues... and continues... and continues... and continues... and continues... with nice layout and typography.\n\n[Try it now!](try) [Learn more](learn)\n`,
|
|
98
|
+
},
|
|
99
|
+
} as TemplatePane;
|
|
100
|
+
};
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import type { Tag, FlatNode } from '@/types/compositorTypes';
|
|
2
|
+
|
|
3
|
+
const allowInsert = (
|
|
4
|
+
node: FlatNode,
|
|
5
|
+
tagName: Tag,
|
|
6
|
+
tagNameNew: Tag,
|
|
7
|
+
tagNameAdjacent?: Tag
|
|
8
|
+
): boolean => {
|
|
9
|
+
switch (tagName) {
|
|
10
|
+
case 'p':
|
|
11
|
+
case 'h2':
|
|
12
|
+
case 'h3':
|
|
13
|
+
case 'h4':
|
|
14
|
+
case 'h5':
|
|
15
|
+
case 'ul':
|
|
16
|
+
case 'ol':
|
|
17
|
+
{
|
|
18
|
+
switch (tagNameNew) {
|
|
19
|
+
case 'bunny':
|
|
20
|
+
case 'yt':
|
|
21
|
+
case 'belief':
|
|
22
|
+
case 'toggle':
|
|
23
|
+
case 'identify':
|
|
24
|
+
case 'signup':
|
|
25
|
+
case 'img':
|
|
26
|
+
//if (tagName === `ul` || tagNameAdjacent === `ul`) return false;
|
|
27
|
+
return true;
|
|
28
|
+
case 'p':
|
|
29
|
+
case 'h2':
|
|
30
|
+
case 'h3':
|
|
31
|
+
case 'h4':
|
|
32
|
+
case 'h5':
|
|
33
|
+
if (!tagNameAdjacent) return true;
|
|
34
|
+
switch (tagNameAdjacent) {
|
|
35
|
+
case 'p':
|
|
36
|
+
case 'h2':
|
|
37
|
+
case 'h3':
|
|
38
|
+
case 'h4':
|
|
39
|
+
case 'h5':
|
|
40
|
+
case 'ul':
|
|
41
|
+
case 'ol':
|
|
42
|
+
return true;
|
|
43
|
+
|
|
44
|
+
default:
|
|
45
|
+
console.log(
|
|
46
|
+
`1 miss on allowInsert: tagName:${tagName} tagNameNew:${tagNameNew} tagNameAdjacent:${tagNameAdjacent}`
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
break;
|
|
50
|
+
|
|
51
|
+
default:
|
|
52
|
+
console.log(
|
|
53
|
+
`2 miss on allowInsert: tagName:${tagName} tagNameNew:${tagNameNew} tagNameAdjacent:${tagNameAdjacent}`
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
break;
|
|
58
|
+
|
|
59
|
+
case 'li': {
|
|
60
|
+
switch (tagNameNew) {
|
|
61
|
+
case 'bunny':
|
|
62
|
+
case 'yt':
|
|
63
|
+
case 'belief':
|
|
64
|
+
case 'toggle':
|
|
65
|
+
case 'identify':
|
|
66
|
+
case 'signup':
|
|
67
|
+
return false;
|
|
68
|
+
case 'img':
|
|
69
|
+
if (node.tagNameCustom === `img` && tagNameAdjacent !== `ul`)
|
|
70
|
+
return true;
|
|
71
|
+
return false;
|
|
72
|
+
case 'p':
|
|
73
|
+
case 'h2':
|
|
74
|
+
case 'h3':
|
|
75
|
+
case 'h4':
|
|
76
|
+
case 'h5':
|
|
77
|
+
if (
|
|
78
|
+
node.tagNameCustom &&
|
|
79
|
+
[`p`, `h2`, `h3`, `h4`, `h5`].includes(node.tagNameCustom)
|
|
80
|
+
)
|
|
81
|
+
// treat these as li, unless this li is for image or widget
|
|
82
|
+
return true;
|
|
83
|
+
return false;
|
|
84
|
+
default:
|
|
85
|
+
console.log(
|
|
86
|
+
`3 miss on allowInsert: tagName:${tagName} tagNameNew:${tagNameNew} tagNameAdjacent:${tagNameAdjacent}`
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
break;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
default:
|
|
93
|
+
console.log(
|
|
94
|
+
`miss on allowInsert: tagName:${tagName} tagNameNew:${tagNameNew} tagNameAdjacent:${tagNameAdjacent}`
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
return false;
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
export default allowInsert;
|