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,219 @@
|
|
|
1
|
+
import { useState, useEffect, type Dispatch, type SetStateAction } from 'react';
|
|
2
|
+
import ExclamationTriangleIcon from '@heroicons/react/24/outline/ExclamationTriangleIcon';
|
|
3
|
+
import CheckIcon from '@heroicons/react/24/outline/CheckIcon';
|
|
4
|
+
import { getCtx } from '@/stores/nodes';
|
|
5
|
+
import { cloneDeep } from '@/utils/helpers';
|
|
6
|
+
import { PaneConfigMode, type PaneNode } from '@/types/compositorTypes';
|
|
7
|
+
|
|
8
|
+
interface PaneSlugPanelProps {
|
|
9
|
+
nodeId: string;
|
|
10
|
+
setMode: Dispatch<SetStateAction<PaneConfigMode>>;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const PaneSlugPanel = ({ nodeId, setMode }: PaneSlugPanelProps) => {
|
|
14
|
+
const [slug, setSlug] = useState('');
|
|
15
|
+
const [isValid, setIsValid] = useState(false);
|
|
16
|
+
const [warning, setWarning] = useState(false);
|
|
17
|
+
const [charCount, setCharCount] = useState(0);
|
|
18
|
+
const [validationError, setValidationError] = useState<string | null>(null);
|
|
19
|
+
const [canSave, setCanSave] = useState(false);
|
|
20
|
+
|
|
21
|
+
const ctx = getCtx();
|
|
22
|
+
const allNodes = ctx.allNodes.get();
|
|
23
|
+
const paneNode = allNodes.get(nodeId) as PaneNode;
|
|
24
|
+
if (!paneNode) return null;
|
|
25
|
+
|
|
26
|
+
useEffect(() => {
|
|
27
|
+
setSlug(paneNode.slug);
|
|
28
|
+
setCharCount(paneNode.slug.length);
|
|
29
|
+
checkLiveValidity(paneNode.slug);
|
|
30
|
+
}, [paneNode.slug]);
|
|
31
|
+
|
|
32
|
+
// More permissive validation for typing
|
|
33
|
+
const checkLiveValidity = (value: string) => {
|
|
34
|
+
const length = value.length;
|
|
35
|
+
setCharCount(length);
|
|
36
|
+
|
|
37
|
+
// Basic format check for allowed characters
|
|
38
|
+
if (!/^[a-z0-9-]*$/.test(value)) {
|
|
39
|
+
setValidationError(
|
|
40
|
+
'Only lowercase letters, numbers, and hyphens allowed'
|
|
41
|
+
);
|
|
42
|
+
setIsValid(false);
|
|
43
|
+
setCanSave(false);
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// Length checks
|
|
48
|
+
setIsValid(length >= 3 && length <= 40);
|
|
49
|
+
setWarning(length > 40 && length <= 50);
|
|
50
|
+
setValidationError(null);
|
|
51
|
+
|
|
52
|
+
// Check if we can save
|
|
53
|
+
if (length >= 3) {
|
|
54
|
+
const saveValidation = checkSaveValidity(value);
|
|
55
|
+
setCanSave(saveValidation.isValid);
|
|
56
|
+
if (!saveValidation.isValid) {
|
|
57
|
+
setValidationError(saveValidation.error || null);
|
|
58
|
+
}
|
|
59
|
+
} else {
|
|
60
|
+
setCanSave(false);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return true;
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
// Strict validation for saving
|
|
67
|
+
const checkSaveValidity = (
|
|
68
|
+
value: string
|
|
69
|
+
): { isValid: boolean; error?: string } => {
|
|
70
|
+
// Strict pattern that prevents leading/trailing hyphens and multiple consecutive hyphens
|
|
71
|
+
if (!/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(value)) {
|
|
72
|
+
return {
|
|
73
|
+
isValid: false,
|
|
74
|
+
error:
|
|
75
|
+
'Slug must start and end with letters or numbers, and no consecutive hyphens',
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// Check duplicates and reserved slugs
|
|
80
|
+
return ctx.isSlugValid(value, nodeId);
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
const handleSlugChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
|
84
|
+
const newSlug = e.target.value.toLowerCase().replace(/[^a-z0-9-]/g, '');
|
|
85
|
+
|
|
86
|
+
if (newSlug.length <= 50) {
|
|
87
|
+
setSlug(newSlug);
|
|
88
|
+
checkLiveValidity(newSlug);
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
const handleSlugBlur = () => {
|
|
93
|
+
if (canSave) {
|
|
94
|
+
const ctx = getCtx();
|
|
95
|
+
const updatedNode = { ...cloneDeep(paneNode), slug, isChanged: true };
|
|
96
|
+
ctx.modifyNodes([updatedNode]);
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
return (
|
|
101
|
+
<div className="group mb-4 w-full rounded-b-md bg-white px-1.5 py-6 shadow-inner">
|
|
102
|
+
<div className="px-3.5">
|
|
103
|
+
<div className="mb-4 flex justify-between">
|
|
104
|
+
<h3 className="text-lg font-bold">Pane Slug</h3>
|
|
105
|
+
<button
|
|
106
|
+
onClick={() => setMode(PaneConfigMode.DEFAULT)}
|
|
107
|
+
className="text-myblue hover:text-black"
|
|
108
|
+
>
|
|
109
|
+
← Go Back
|
|
110
|
+
</button>
|
|
111
|
+
</div>
|
|
112
|
+
|
|
113
|
+
<div className="relative">
|
|
114
|
+
<input
|
|
115
|
+
type="text"
|
|
116
|
+
value={slug}
|
|
117
|
+
onChange={handleSlugChange}
|
|
118
|
+
onBlur={handleSlugBlur}
|
|
119
|
+
onKeyDown={(e) => {
|
|
120
|
+
if (e.key === 'Enter') {
|
|
121
|
+
e.currentTarget.blur();
|
|
122
|
+
}
|
|
123
|
+
}}
|
|
124
|
+
className={`w-full rounded-md border px-2 py-1 pr-16 ${
|
|
125
|
+
validationError || charCount < 3
|
|
126
|
+
? 'border-red-500 bg-red-50'
|
|
127
|
+
: isValid && canSave
|
|
128
|
+
? 'border-green-500 bg-green-50'
|
|
129
|
+
: warning
|
|
130
|
+
? 'border-yellow-500 bg-yellow-50'
|
|
131
|
+
: 'border-gray-300'
|
|
132
|
+
}`}
|
|
133
|
+
placeholder="Enter pane slug (3-40 characters recommended)"
|
|
134
|
+
/>
|
|
135
|
+
<div className="absolute right-2 top-1/2 flex -translate-y-1/2 items-center gap-2">
|
|
136
|
+
{validationError || charCount < 3 ? (
|
|
137
|
+
<ExclamationTriangleIcon className="h-5 w-5 text-red-500" />
|
|
138
|
+
) : isValid && canSave ? (
|
|
139
|
+
<CheckIcon className="h-5 w-5 text-green-500" />
|
|
140
|
+
) : warning ? (
|
|
141
|
+
<ExclamationTriangleIcon className="h-5 w-5 text-yellow-500" />
|
|
142
|
+
) : null}
|
|
143
|
+
<span
|
|
144
|
+
className={`text-sm ${
|
|
145
|
+
validationError || charCount < 3
|
|
146
|
+
? 'text-red-500'
|
|
147
|
+
: isValid && canSave
|
|
148
|
+
? 'text-green-500'
|
|
149
|
+
: warning
|
|
150
|
+
? 'text-yellow-500'
|
|
151
|
+
: 'text-gray-500'
|
|
152
|
+
}`}
|
|
153
|
+
>
|
|
154
|
+
{charCount}/50
|
|
155
|
+
</span>
|
|
156
|
+
</div>
|
|
157
|
+
</div>
|
|
158
|
+
{validationError && (
|
|
159
|
+
<div className="mt-2 text-sm text-red-600">
|
|
160
|
+
<ExclamationTriangleIcon className="mr-1 inline h-4 w-4" />
|
|
161
|
+
{validationError}
|
|
162
|
+
</div>
|
|
163
|
+
)}
|
|
164
|
+
<div className="mt-4 space-y-4 text-lg">
|
|
165
|
+
<div className="text-gray-600">
|
|
166
|
+
This is solely used for analytics!
|
|
167
|
+
<ul className="ml-4 mt-1">
|
|
168
|
+
<li>
|
|
169
|
+
<CheckIcon className="inline h-4 w-4" /> Keep it concise and
|
|
170
|
+
descriptive
|
|
171
|
+
</li>
|
|
172
|
+
<li>
|
|
173
|
+
<CheckIcon className="inline h-4 w-4" /> Use lowercase letters
|
|
174
|
+
and numbers
|
|
175
|
+
</li>
|
|
176
|
+
<li>
|
|
177
|
+
<CheckIcon className="inline h-4 w-4" /> Use hyphens between
|
|
178
|
+
words
|
|
179
|
+
</li>
|
|
180
|
+
<li>
|
|
181
|
+
<CheckIcon className="inline h-4 w-4" /> Must start and end with
|
|
182
|
+
a letter or number
|
|
183
|
+
</li>
|
|
184
|
+
</ul>
|
|
185
|
+
</div>
|
|
186
|
+
<div className="py-4">
|
|
187
|
+
{charCount < 3 && (
|
|
188
|
+
<span className="text-red-500">
|
|
189
|
+
Slug must be at least 3 characters
|
|
190
|
+
</span>
|
|
191
|
+
)}
|
|
192
|
+
{charCount >= 3 && charCount < 5 && !validationError && (
|
|
193
|
+
<span className="text-gray-500">
|
|
194
|
+
Consider adding more characters for better description
|
|
195
|
+
</span>
|
|
196
|
+
)}
|
|
197
|
+
{warning && !validationError && (
|
|
198
|
+
<span className="text-yellow-500">
|
|
199
|
+
Slug is getting long - consider shortening it
|
|
200
|
+
</span>
|
|
201
|
+
)}
|
|
202
|
+
{isValid && canSave && charCount >= 5 && !validationError && (
|
|
203
|
+
<span className="text-green-500">
|
|
204
|
+
Good slug length and format!
|
|
205
|
+
</span>
|
|
206
|
+
)}
|
|
207
|
+
{isValid && !canSave && !validationError && (
|
|
208
|
+
<span className="text-gray-500">
|
|
209
|
+
Valid characters but needs proper formatting to save
|
|
210
|
+
</span>
|
|
211
|
+
)}
|
|
212
|
+
</div>
|
|
213
|
+
</div>
|
|
214
|
+
</div>
|
|
215
|
+
</div>
|
|
216
|
+
);
|
|
217
|
+
};
|
|
218
|
+
|
|
219
|
+
export default PaneSlugPanel;
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useState,
|
|
3
|
+
useEffect,
|
|
4
|
+
type Dispatch,
|
|
5
|
+
type SetStateAction,
|
|
6
|
+
type ChangeEvent,
|
|
7
|
+
} from 'react';
|
|
8
|
+
import ExclamationTriangleIcon from '@heroicons/react/24/outline/ExclamationTriangleIcon';
|
|
9
|
+
import CheckIcon from '@heroicons/react/24/outline/CheckIcon';
|
|
10
|
+
import { getCtx } from '@/stores/nodes';
|
|
11
|
+
import { cloneDeep } from '@/utils/helpers';
|
|
12
|
+
import { PaneConfigMode, type PaneNode } from '@/types/compositorTypes';
|
|
13
|
+
|
|
14
|
+
interface PaneTitlePanelProps {
|
|
15
|
+
nodeId: string;
|
|
16
|
+
setMode: Dispatch<SetStateAction<PaneConfigMode>>;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const PaneTitlePanel = ({ nodeId, setMode }: PaneTitlePanelProps) => {
|
|
20
|
+
const [title, setTitle] = useState('');
|
|
21
|
+
const [isValid, setIsValid] = useState(false);
|
|
22
|
+
const [warning, setWarning] = useState(false);
|
|
23
|
+
const [charCount, setCharCount] = useState(0);
|
|
24
|
+
|
|
25
|
+
const ctx = getCtx();
|
|
26
|
+
const allNodes = ctx.allNodes.get();
|
|
27
|
+
const paneNode = allNodes.get(nodeId) as PaneNode;
|
|
28
|
+
if (!paneNode) return null;
|
|
29
|
+
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
setTitle(paneNode.title);
|
|
32
|
+
setCharCount(paneNode.title.length);
|
|
33
|
+
}, [paneNode.title]);
|
|
34
|
+
|
|
35
|
+
const handleTitleChange = (e: ChangeEvent<HTMLInputElement>) => {
|
|
36
|
+
const newTitle = e.target.value;
|
|
37
|
+
if (newTitle.length <= 50) {
|
|
38
|
+
// Prevent more than 70 chars
|
|
39
|
+
setTitle(newTitle);
|
|
40
|
+
setCharCount(newTitle.length);
|
|
41
|
+
setIsValid(newTitle.length >= 5 && newTitle.length <= 35);
|
|
42
|
+
setWarning(newTitle.length > 35 && newTitle.length <= 50);
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const handleTitleBlur = () => {
|
|
47
|
+
if (title.length >= 5) {
|
|
48
|
+
// Only update if meets minimum length
|
|
49
|
+
const ctx = getCtx();
|
|
50
|
+
const updatedNode = { ...cloneDeep(paneNode), title, isChanged: true };
|
|
51
|
+
ctx.modifyNodes([updatedNode]);
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
return (
|
|
56
|
+
<div className="group mb-4 w-full rounded-b-md bg-white px-1.5 py-6 shadow-inner">
|
|
57
|
+
<div className="px-3.5">
|
|
58
|
+
<div className="mb-4 flex justify-between">
|
|
59
|
+
<h3 className="text-lg font-bold">Pane Title</h3>
|
|
60
|
+
<button
|
|
61
|
+
onClick={() => setMode(PaneConfigMode.DEFAULT)}
|
|
62
|
+
className="text-myblue hover:text-black"
|
|
63
|
+
>
|
|
64
|
+
← Go Back
|
|
65
|
+
</button>
|
|
66
|
+
</div>
|
|
67
|
+
|
|
68
|
+
<div className="relative">
|
|
69
|
+
<input
|
|
70
|
+
type="text"
|
|
71
|
+
value={title}
|
|
72
|
+
onChange={handleTitleChange}
|
|
73
|
+
onBlur={handleTitleBlur}
|
|
74
|
+
onKeyDown={(e) => {
|
|
75
|
+
if (e.key === 'Enter') {
|
|
76
|
+
e.currentTarget.blur();
|
|
77
|
+
}
|
|
78
|
+
}}
|
|
79
|
+
className={`w-full rounded-md border px-2 py-1 pr-16 ${
|
|
80
|
+
charCount < 5
|
|
81
|
+
? 'border-red-500 bg-red-50'
|
|
82
|
+
: isValid
|
|
83
|
+
? 'border-green-500 bg-green-50'
|
|
84
|
+
: warning
|
|
85
|
+
? 'border-yellow-500 bg-yellow-50'
|
|
86
|
+
: 'border-gray-300'
|
|
87
|
+
}`}
|
|
88
|
+
placeholder="Enter story fragment title (50-60 characters recommended)"
|
|
89
|
+
/>
|
|
90
|
+
<div className="absolute right-2 top-1/2 flex -translate-y-1/2 items-center gap-2">
|
|
91
|
+
{charCount < 5 ? (
|
|
92
|
+
<ExclamationTriangleIcon className="h-5 w-5 text-red-500" />
|
|
93
|
+
) : isValid ? (
|
|
94
|
+
<CheckIcon className="h-5 w-5 text-green-500" />
|
|
95
|
+
) : warning ? (
|
|
96
|
+
<ExclamationTriangleIcon className="h-5 w-5 text-yellow-500" />
|
|
97
|
+
) : null}
|
|
98
|
+
<span
|
|
99
|
+
className={`text-sm ${
|
|
100
|
+
charCount < 5
|
|
101
|
+
? 'text-red-500'
|
|
102
|
+
: isValid
|
|
103
|
+
? 'text-green-500'
|
|
104
|
+
: warning
|
|
105
|
+
? 'text-yellow-500'
|
|
106
|
+
: 'text-gray-500'
|
|
107
|
+
}`}
|
|
108
|
+
>
|
|
109
|
+
{charCount}/50
|
|
110
|
+
</span>
|
|
111
|
+
</div>
|
|
112
|
+
</div>
|
|
113
|
+
<div className="mt-4 space-y-4 text-lg">
|
|
114
|
+
<div className="text-gray-600">
|
|
115
|
+
Write a clear, descriptive title for this piece of content. This is
|
|
116
|
+
used for your own internal analytics.
|
|
117
|
+
</div>
|
|
118
|
+
<div className="py-4">
|
|
119
|
+
{charCount < 5 && (
|
|
120
|
+
<span className="text-red-500">
|
|
121
|
+
Title must be at least 5 characters
|
|
122
|
+
</span>
|
|
123
|
+
)}
|
|
124
|
+
{charCount >= 5 && charCount < 10 && (
|
|
125
|
+
<span className="text-gray-500">
|
|
126
|
+
Add {10 - charCount} more characters for optimal length
|
|
127
|
+
</span>
|
|
128
|
+
)}
|
|
129
|
+
{warning && (
|
|
130
|
+
<span className="text-yellow-500">Title is getting long</span>
|
|
131
|
+
)}
|
|
132
|
+
{isValid && (
|
|
133
|
+
<span className="text-green-500">Perfect title length!</span>
|
|
134
|
+
)}
|
|
135
|
+
</div>
|
|
136
|
+
</div>
|
|
137
|
+
</div>
|
|
138
|
+
</div>
|
|
139
|
+
);
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
export default PaneTitlePanel;
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import { useState, useEffect } from 'react';
|
|
2
|
+
import PaneBreakCollectionSelector from '@/components/fields/PaneBreakCollectionSelector';
|
|
3
|
+
import PaneBreakShapeSelector from '@/components/fields/PaneBreakShapeSelector';
|
|
4
|
+
import ColorPickerCombo from '@/components/fields/ColorPickerCombo';
|
|
5
|
+
import { getCtx } from '@/stores/nodes';
|
|
6
|
+
import { collections } from '@/constants';
|
|
7
|
+
import { isBreakNode, isPaneNode } from '@/utils/compositor/typeGuards';
|
|
8
|
+
import { cloneDeep } from '@/utils/helpers';
|
|
9
|
+
import type {
|
|
10
|
+
FlatNode,
|
|
11
|
+
PaneNode,
|
|
12
|
+
BasePanelProps,
|
|
13
|
+
} from '@/types/compositorTypes';
|
|
14
|
+
|
|
15
|
+
interface BreakData {
|
|
16
|
+
collection: string;
|
|
17
|
+
image: string;
|
|
18
|
+
svgFill: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
interface BreakSettings {
|
|
22
|
+
collection: string;
|
|
23
|
+
desktopImage: string;
|
|
24
|
+
tabletImage: string;
|
|
25
|
+
mobileImage: string;
|
|
26
|
+
svgFill: string;
|
|
27
|
+
bgColor: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
interface BreakNode extends FlatNode {
|
|
31
|
+
breakDesktop: BreakData;
|
|
32
|
+
breakTablet: BreakData;
|
|
33
|
+
breakMobile: BreakData;
|
|
34
|
+
bgColor: string;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const StyleBreakPanel = ({ node, parentNode, config }: BasePanelProps) => {
|
|
38
|
+
if (!node || !isBreakNode(node) || !parentNode || !isPaneNode(parentNode)) {
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const ctx = getCtx();
|
|
43
|
+
const allNodes = ctx.allNodes.get();
|
|
44
|
+
|
|
45
|
+
const [settings, setSettings] = useState<BreakSettings>({
|
|
46
|
+
collection: node.breakDesktop?.collection ?? collections[0] ?? `kCz`,
|
|
47
|
+
desktopImage: node.breakDesktop?.image ?? 'none',
|
|
48
|
+
tabletImage: node.breakTablet?.image ?? 'none',
|
|
49
|
+
mobileImage: node.breakMobile?.image ?? 'none',
|
|
50
|
+
svgFill: node.breakDesktop?.svgFill ?? '#FFFFFF',
|
|
51
|
+
bgColor: parentNode.bgColour ?? '#000000',
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
// Monitor settings changes
|
|
55
|
+
useEffect(() => {
|
|
56
|
+
if (!node || !parentNode) return;
|
|
57
|
+
|
|
58
|
+
const prevSettings = {
|
|
59
|
+
collection: node.breakDesktop?.collection ?? collections[0] ?? `kCz`,
|
|
60
|
+
desktopImage: node.breakDesktop?.image ?? 'none',
|
|
61
|
+
tabletImage: node.breakTablet?.image ?? 'none',
|
|
62
|
+
mobileImage: node.breakMobile?.image ?? 'none',
|
|
63
|
+
svgFill: node.breakDesktop?.svgFill ?? '#FFFFFF',
|
|
64
|
+
bgColor: parentNode.bgColour ?? '#000000',
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
// Get mutable copies of the nodes
|
|
68
|
+
const breakNode = cloneDeep(allNodes.get(node.id)) as BreakNode;
|
|
69
|
+
const paneNode = cloneDeep(allNodes.get(parentNode.id)) as PaneNode;
|
|
70
|
+
|
|
71
|
+
if (!breakNode || !paneNode || !isPaneNode(paneNode)) return;
|
|
72
|
+
|
|
73
|
+
Object.entries(settings).forEach(([key, value]) => {
|
|
74
|
+
if (value !== prevSettings[key as keyof BreakSettings]) {
|
|
75
|
+
switch (key) {
|
|
76
|
+
case 'collection':
|
|
77
|
+
breakNode.breakDesktop.collection = value;
|
|
78
|
+
breakNode.breakTablet.collection = value;
|
|
79
|
+
breakNode.breakMobile.collection = value;
|
|
80
|
+
break;
|
|
81
|
+
|
|
82
|
+
case 'desktopImage':
|
|
83
|
+
breakNode.breakDesktop.image = value;
|
|
84
|
+
break;
|
|
85
|
+
|
|
86
|
+
case 'tabletImage':
|
|
87
|
+
breakNode.breakTablet.image = value;
|
|
88
|
+
break;
|
|
89
|
+
|
|
90
|
+
case 'mobileImage':
|
|
91
|
+
breakNode.breakMobile.image = value;
|
|
92
|
+
break;
|
|
93
|
+
|
|
94
|
+
case 'svgFill':
|
|
95
|
+
breakNode.breakDesktop.svgFill = value;
|
|
96
|
+
breakNode.breakTablet.svgFill = value;
|
|
97
|
+
breakNode.breakMobile.svgFill = value;
|
|
98
|
+
break;
|
|
99
|
+
|
|
100
|
+
case 'bgColor':
|
|
101
|
+
paneNode.bgColour = value;
|
|
102
|
+
break;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
const updatedNodes = [
|
|
108
|
+
{ ...breakNode, isChanged: true },
|
|
109
|
+
{ ...paneNode, isChanged: true },
|
|
110
|
+
];
|
|
111
|
+
ctx.modifyNodes(updatedNodes);
|
|
112
|
+
}, [settings, node, parentNode, ctx, allNodes]);
|
|
113
|
+
|
|
114
|
+
return (
|
|
115
|
+
<div className="space-y-4">
|
|
116
|
+
{collections.length > 1 && (
|
|
117
|
+
<div className="space-y-2">
|
|
118
|
+
<span className="text-mydarkgrey block text-sm">Collection</span>
|
|
119
|
+
<PaneBreakCollectionSelector
|
|
120
|
+
selectedCollection={settings.collection}
|
|
121
|
+
onChange={(collection) =>
|
|
122
|
+
setSettings((prev) => ({ ...prev, collection }))
|
|
123
|
+
}
|
|
124
|
+
/>
|
|
125
|
+
</div>
|
|
126
|
+
)}
|
|
127
|
+
|
|
128
|
+
<div className="space-y-2">
|
|
129
|
+
<span className="text-mydarkgrey block text-sm">
|
|
130
|
+
Shapes (for each screen size)
|
|
131
|
+
</span>
|
|
132
|
+
<div className="space-y-1">
|
|
133
|
+
<PaneBreakShapeSelector
|
|
134
|
+
viewport="mobile"
|
|
135
|
+
selectedImage={settings.mobileImage}
|
|
136
|
+
onChange={(image) =>
|
|
137
|
+
setSettings((prev) => ({ ...prev, mobileImage: image }))
|
|
138
|
+
}
|
|
139
|
+
/>
|
|
140
|
+
<PaneBreakShapeSelector
|
|
141
|
+
viewport="tablet"
|
|
142
|
+
selectedImage={settings.tabletImage}
|
|
143
|
+
onChange={(image) =>
|
|
144
|
+
setSettings((prev) => ({ ...prev, tabletImage: image }))
|
|
145
|
+
}
|
|
146
|
+
/>
|
|
147
|
+
<PaneBreakShapeSelector
|
|
148
|
+
viewport="desktop"
|
|
149
|
+
selectedImage={settings.desktopImage}
|
|
150
|
+
onChange={(image) =>
|
|
151
|
+
setSettings((prev) => ({ ...prev, desktopImage: image }))
|
|
152
|
+
}
|
|
153
|
+
/>
|
|
154
|
+
</div>
|
|
155
|
+
</div>
|
|
156
|
+
|
|
157
|
+
<div className="space-y-4">
|
|
158
|
+
<div className="grid grid-cols-2 gap-4">
|
|
159
|
+
<ColorPickerCombo
|
|
160
|
+
title="Shape Color"
|
|
161
|
+
defaultColor={settings.svgFill}
|
|
162
|
+
onColorChange={(color: string) =>
|
|
163
|
+
setSettings((prev) => ({ ...prev, svgFill: color }))
|
|
164
|
+
}
|
|
165
|
+
config={config!}
|
|
166
|
+
/>
|
|
167
|
+
<ColorPickerCombo
|
|
168
|
+
title="Background Color"
|
|
169
|
+
defaultColor={settings.bgColor}
|
|
170
|
+
onColorChange={(color: string) =>
|
|
171
|
+
setSettings((prev) => ({ ...prev, bgColor: color }))
|
|
172
|
+
}
|
|
173
|
+
config={config!}
|
|
174
|
+
allowNull={true}
|
|
175
|
+
/>
|
|
176
|
+
</div>
|
|
177
|
+
</div>
|
|
178
|
+
</div>
|
|
179
|
+
);
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
export default StyleBreakPanel;
|