@promakeai/cli 0.3.0 → 0.3.2
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/dist/index.js +209 -415
- package/dist/registry/about-page.json +3 -3
- package/dist/registry/about-section.json +4 -4
- package/dist/registry/animations.json +2 -2
- package/dist/registry/announcement-bar.json +4 -4
- package/dist/registry/api.json +1 -1
- package/dist/registry/auth-core.json +3 -3
- package/dist/registry/bento-grid-section.json +4 -4
- package/dist/registry/blog-core.json +5 -5
- package/dist/registry/blog-list-page.json +3 -3
- package/dist/registry/blog-section.json +4 -4
- package/dist/registry/cards-carousel-section.json +4 -4
- package/dist/registry/cart-drawer.json +3 -3
- package/dist/registry/cart-page.json +3 -3
- package/dist/registry/case-study-page.json +3 -3
- package/dist/registry/category-section.json +3 -3
- package/dist/registry/checkout-page.json +3 -3
- package/dist/registry/coming-soon-page-minimal.json +4 -4
- package/dist/registry/coming-soon-page.json +4 -4
- package/dist/registry/contact-info-grid.json +4 -4
- package/dist/registry/contact-page-centered.json +4 -4
- package/dist/registry/contact-page-split.json +4 -4
- package/dist/registry/contact-page.json +3 -3
- package/dist/registry/content-section.json +4 -4
- package/dist/registry/cookie-consent.json +4 -4
- package/dist/registry/cookies-page.json +3 -3
- package/dist/registry/cta-section.json +3 -3
- package/dist/registry/ecommerce-core.json +10 -10
- package/dist/registry/empty-page.json +3 -3
- package/dist/registry/faq-categorized.json +4 -4
- package/dist/registry/faq-simple.json +4 -4
- package/dist/registry/favorites-blog-block.json +1 -1
- package/dist/registry/favorites-blog-page.json +4 -4
- package/dist/registry/favorites-ecommerce-block.json +1 -1
- package/dist/registry/favorites-ecommerce-page.json +4 -4
- package/dist/registry/feature-section.json +3 -3
- package/dist/registry/featured-products.json +3 -3
- package/dist/registry/footer-detailed.json +4 -4
- package/dist/registry/footer-minimal.json +3 -3
- package/dist/registry/footer.json +3 -3
- package/dist/registry/forgot-password-page-split.json +4 -4
- package/dist/registry/forgot-password-page.json +4 -4
- package/dist/registry/google-adsense.json +4 -4
- package/dist/registry/google-map.json +2 -2
- package/dist/registry/header-centered-pill.json +4 -4
- package/dist/registry/header-ecommerce.json +3 -3
- package/dist/registry/header-mega.json +4 -4
- package/dist/registry/header-minimal.json +4 -4
- package/dist/registry/header-simple.json +3 -3
- package/dist/registry/hero-carousel.json +3 -3
- package/dist/registry/hero-cta.json +4 -4
- package/dist/registry/hero-gradient.json +4 -4
- package/dist/registry/hero-grid.json +4 -4
- package/dist/registry/hero-profile.json +3 -3
- package/dist/registry/hero.json +3 -3
- package/dist/registry/landing-page-app.json +3 -3
- package/dist/registry/landing-page-saas.json +3 -3
- package/dist/registry/login-page-split.json +4 -4
- package/dist/registry/login-page.json +4 -4
- package/dist/registry/logo-cloud.json +4 -4
- package/dist/registry/masonry-grid.json +3 -3
- package/dist/registry/my-orders-page.json +4 -4
- package/dist/registry/newsletter-section.json +4 -4
- package/dist/registry/order-card-compact.json +1 -1
- package/dist/registry/order-confirmation-page.json +4 -4
- package/dist/registry/order-detail-block.json +1 -1
- package/dist/registry/orders-list-block.json +1 -1
- package/dist/registry/payment-success-block.json +1 -1
- package/dist/registry/portfolio-page.json +4 -4
- package/dist/registry/post-card.json +3 -3
- package/dist/registry/post-detail-block.json +1 -1
- package/dist/registry/post-detail-page.json +4 -4
- package/dist/registry/pricing-card.json +3 -3
- package/dist/registry/pricing-page.json +4 -4
- package/dist/registry/pricing-section.json +4 -4
- package/dist/registry/privacy-page.json +3 -3
- package/dist/registry/product-card-detailed.json +4 -4
- package/dist/registry/product-card-hover.json +4 -4
- package/dist/registry/product-card.json +3 -3
- package/dist/registry/product-detail-block.json +1 -1
- package/dist/registry/product-detail-page.json +4 -4
- package/dist/registry/product-detail-section.json +4 -4
- package/dist/registry/product-quick-view.json +4 -4
- package/dist/registry/products-page.json +3 -3
- package/dist/registry/reading-progress.json +4 -4
- package/dist/registry/register-page-split.json +4 -4
- package/dist/registry/register-page.json +4 -4
- package/dist/registry/related-posts-block.json +1 -1
- package/dist/registry/related-products-block.json +1 -1
- package/dist/registry/reset-password-page-split.json +4 -4
- package/dist/registry/service-card.json +1 -1
- package/dist/registry/share-buttons.json +4 -4
- package/dist/registry/skill-card.json +1 -1
- package/dist/registry/team-page.json +4 -4
- package/dist/registry/terms-page.json +3 -3
- package/dist/registry/testimonials-carousel.json +4 -4
- package/dist/registry/testimonials-grid.json +4 -4
- package/dist/registry/timeline-section.json +4 -4
- package/dist/registry/video-hero.json +4 -4
- package/dist/registry/youtube-embed.json +4 -4
- package/package.json +2 -2
- package/template/.env +6 -6
- package/template/public/_redirects +1 -1
- package/template/public/robots.txt +14 -14
- package/template/src/components/GoogleAnalytics.tsx +34 -34
- package/template/src/components/LanguageSwitcher.tsx +53 -53
- package/template/src/components/ScriptInjector.tsx +62 -62
- package/template/src/lib/env.ts +19 -19
- package/template/src/router.tsx +14 -14
- package/template/src/vite-env.d.ts +1 -1
- package/dist/registry/auth.json +0 -70
- package/dist/registry/docs/reset-password-page.md +0 -36
- package/dist/registry/reset-password-page.json +0 -39
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"path": "about-page/index.ts",
|
|
17
17
|
"type": "registry:index",
|
|
18
18
|
"target": "$modules$/about-page/index.ts",
|
|
19
|
-
"content": "export * from './about-page';\
|
|
19
|
+
"content": "export * from './about-page';\nexport { AboutPage as default } from './about-page';\n"
|
|
20
20
|
},
|
|
21
21
|
{
|
|
22
22
|
"path": "about-page/about-page.tsx",
|
|
@@ -28,13 +28,13 @@
|
|
|
28
28
|
"path": "about-page/lang/en.json",
|
|
29
29
|
"type": "registry:lang",
|
|
30
30
|
"target": "$modules$/about-page/lang/en.json",
|
|
31
|
-
"content": "{\
|
|
31
|
+
"content": "{\n \"title\": \"About Us\",\n \"subtitle\": \"Tell your brand's story, vision, and value in a few sentences.\",\n \"storyTitle\": \"Our Story\",\n \"storyP1\": \"Tell your brand's origins, motivation, and current position. Include key turning points.\",\n \"storyP2\": \"Continue your story. Deepen the journey mentioned in the first paragraph.\",\n \"missionTitle\": \"Our Mission\",\n \"missionDesc\": \"Describe your brand's core purpose and user value.\",\n \"valuesTitle\": \"Our Values\",\n \"valuesDesc\": \"Share the core values that define your brand.\",\n \"teamTitle\": \"Our Team\",\n \"teamDesc\": \"Describe your team structure, culture, and collaboration.\",\n \"qualityTitle\": \"Quality First\",\n \"qualityDesc\": \"Emphasize quality standards and user experience focus.\",\n \"customersValue\": \"500+\",\n \"customersLabel\": \"Happy Customers\",\n \"projectsValue\": \"1000+\",\n \"projectsLabel\": \"Projects Completed\",\n \"experienceValue\": \"10+\",\n \"experienceLabel\": \"Years Experience\",\n \"satisfactionValue\": \"99%\",\n \"satisfactionLabel\": \"Client Satisfaction\",\n \"ctaTitle\": \"Ready to Work Together?\",\n \"ctaDesc\": \"Update this CTA based on your goals.\"\n}"
|
|
32
32
|
},
|
|
33
33
|
{
|
|
34
34
|
"path": "about-page/lang/tr.json",
|
|
35
35
|
"type": "registry:lang",
|
|
36
36
|
"target": "$modules$/about-page/lang/tr.json",
|
|
37
|
-
"content": "{\
|
|
37
|
+
"content": "{\n \"title\": \"Hakkımızda\",\n \"subtitle\": \"Markanızın hikayesini, vizyonunu ve değerini birkaç cümleyle anlatın.\",\n \"storyTitle\": \"Hikayemiz\",\n \"storyP1\": \"Markanızın doğuşunu, motivasyonunu ve bugünkü konumunu anlatın. Dönüm noktalarını ekleyin.\",\n \"storyP2\": \"Hikayenizin devamı. İlk paragraftaki yolculuğu derinleştirin.\",\n \"missionTitle\": \"Misyonumuz\",\n \"missionDesc\": \"Markanızın temel amacını ve kullanıcı değerini anlatın.\",\n \"valuesTitle\": \"Değerlerimiz\",\n \"valuesDesc\": \"Markanızı tanımlayan temel değerleri paylaşın.\",\n \"teamTitle\": \"Ekibimiz\",\n \"teamDesc\": \"Ekip yapınızı, kültürünüzü ve işbirliğinizi anlatın.\",\n \"qualityTitle\": \"Önce Kalite\",\n \"qualityDesc\": \"Kalite standartlarınızı ve kullanıcı deneyimi odağınızı vurgulayın.\",\n \"customersValue\": \"500+\",\n \"customersLabel\": \"Mutlu Müşteri\",\n \"projectsValue\": \"1000+\",\n \"projectsLabel\": \"Tamamlanan Proje\",\n \"experienceValue\": \"10+\",\n \"experienceLabel\": \"Yıllık Deneyim\",\n \"satisfactionValue\": \"%99\",\n \"satisfactionLabel\": \"Müşteri Memnuniyeti\",\n \"ctaTitle\": \"Birlikte Çalışmaya Hazır mısınız?\",\n \"ctaDesc\": \"Bu CTA'yı hedeflerinize göre güncelleyin.\"\n}"
|
|
38
38
|
}
|
|
39
39
|
],
|
|
40
40
|
"exports": {
|
|
@@ -10,25 +10,25 @@
|
|
|
10
10
|
"path": "about-section/index.ts",
|
|
11
11
|
"type": "registry:index",
|
|
12
12
|
"target": "$modules$/about-section/index.ts",
|
|
13
|
-
"content": "export * from './about-section';\
|
|
13
|
+
"content": "export * from './about-section';\n"
|
|
14
14
|
},
|
|
15
15
|
{
|
|
16
16
|
"path": "about-section/about-section.tsx",
|
|
17
17
|
"type": "registry:component",
|
|
18
18
|
"target": "$modules$/about-section/about-section.tsx",
|
|
19
|
-
"content": "import { Link } from \"react-router\";\
|
|
19
|
+
"content": "import { Link } from \"react-router\";\nimport { useTranslation } from \"react-i18next\";\nimport { cn } from \"@/lib/utils\";\nimport { Button } from \"@/components/ui/button\";\n\ninterface AboutSectionProps {\n className?: string;\n}\n\nexport function AboutSection({ className }: AboutSectionProps) {\n const { t } = useTranslation(\"about-section\");\n\n const stats = [\n { value: t(\"stat1Value\", \"500+\"), label: t(\"stat1Label\", \"Happy Clients\") },\n { value: t(\"stat2Value\", \"1000+\"), label: t(\"stat2Label\", \"Projects Completed\") },\n { value: t(\"stat3Value\", \"99%\"), label: t(\"stat3Label\", \"Satisfaction Rate\") },\n { value: t(\"stat4Value\", \"15+\"), label: t(\"stat4Label\", \"Years Experience\") },\n ];\n\n const companies = [\"Google\", \"Microsoft\", \"Amazon\", \"Apple\", \"Meta\"];\n\n return (\n <section className={cn(\"py-16 md:py-24\", className)}>\n <div className=\"w-full max-w-[var(--container-max-width)] mx-auto px-4\">\n {/* Header */}\n <div className=\"grid md:grid-cols-2 gap-8 mb-12\">\n <h2 className=\"text-3xl md:text-4xl lg:text-5xl font-bold\">\n {t(\"title\", \"About Our Company\")}\n </h2>\n <p className=\"text-muted-foreground text-lg\">\n {t(\"description\", \"We are a passionate team dedicated to creating innovative solutions that empower businesses to thrive in the digital age. Our mission is to deliver excellence in everything we do.\")}\n </p>\n </div>\n\n {/* Images Grid */}\n <div className=\"grid lg:grid-cols-3 gap-6 mb-16\">\n {/* Main Image */}\n <div className=\"lg:col-span-2\">\n <div className=\"aspect-[16/10] lg:aspect-auto lg:h-full rounded-2xl bg-muted overflow-hidden\">\n <img\n src=\"/images/placeholder.png\"\n alt={t(\"mainImageAlt\", \"Our team\")}\n className=\"w-full h-full object-cover\"\n onError={(e) => {\n e.currentTarget.style.display = \"none\";\n }}\n />\n </div>\n </div>\n\n {/* Side Column */}\n <div className=\"flex flex-col gap-6\">\n {/* Info Card */}\n <div className=\"bg-muted rounded-2xl p-6 flex flex-col justify-between flex-1\">\n <div>\n <h3 className=\"text-lg font-semibold mb-2\">\n {t(\"cardTitle\", \"Our Mission\")}\n </h3>\n <p className=\"text-muted-foreground text-sm mb-4\">\n {t(\"cardDescription\", \"Providing businesses with effective tools to improve workflows, boost efficiency, and encourage sustainable growth.\")}\n </p>\n </div>\n <Button variant=\"outline\" asChild className=\"w-fit\">\n <Link to=\"/about\">{t(\"cardButton\", \"Learn More\")}</Link>\n </Button>\n </div>\n\n {/* Secondary Image */}\n <div className=\"aspect-square rounded-2xl bg-muted overflow-hidden flex-1\">\n <img\n src=\"/images/placeholder.png\"\n alt={t(\"secondaryImageAlt\", \"Our office\")}\n className=\"w-full h-full object-cover\"\n onError={(e) => {\n e.currentTarget.style.display = \"none\";\n }}\n />\n </div>\n </div>\n </div>\n\n {/* Companies */}\n <div className=\"text-center mb-16\">\n <p className=\"text-muted-foreground mb-6\">\n {t(\"companiesTitle\", \"Trusted by leading companies worldwide\")}\n </p>\n <div className=\"flex flex-wrap justify-center items-center gap-8 md:gap-12\">\n {companies.map((company) => (\n <span\n key={company}\n className=\"text-xl md:text-2xl font-semibold text-muted-foreground/50\"\n >\n {company}\n </span>\n ))}\n </div>\n </div>\n\n {/* Stats */}\n <div className=\"bg-muted rounded-2xl p-8 md:p-12\">\n <div className=\"text-center md:text-left mb-8\">\n <h3 className=\"text-2xl md:text-3xl font-bold mb-2\">\n {t(\"statsTitle\", \"Our Achievements\")}\n </h3>\n <p className=\"text-muted-foreground max-w-xl\">\n {t(\"statsDescription\", \"Numbers that reflect our commitment to excellence and client satisfaction.\")}\n </p>\n </div>\n <div className=\"grid grid-cols-2 lg:grid-cols-4 gap-8\">\n {stats.map((stat, index) => (\n <div key={index} className=\"text-center\">\n <div className=\"text-3xl md:text-4xl lg:text-5xl font-bold text-primary mb-2\">\n {stat.value}\n </div>\n <p className=\"text-sm md:text-base text-muted-foreground\">\n {stat.label}\n </p>\n </div>\n ))}\n </div>\n </div>\n </div>\n </section>\n );\n}\n"
|
|
20
20
|
},
|
|
21
21
|
{
|
|
22
22
|
"path": "about-section/lang/en.json",
|
|
23
23
|
"type": "registry:lang",
|
|
24
24
|
"target": "$modules$/about-section/lang/en.json",
|
|
25
|
-
"content": "{\
|
|
25
|
+
"content": "{\n \"title\": \"About Us\",\n \"description\": \"We're a team of passionate professionals dedicated to delivering exceptional results for our clients.\",\n \"mainImageAlt\": \"Our team\",\n \"secondaryImageAlt\": \"Our office\",\n \"cardTitle\": \"Our Mission\",\n \"cardDescription\": \"To empower businesses with innovative solutions that drive growth and success.\",\n \"cardButton\": \"Learn More\",\n \"companiesTitle\": \"Trusted by Leading Brands\",\n \"statsTitle\": \"Our Achievements\",\n \"statsDescription\": \"Numbers that showcase our commitment to excellence.\",\n \"stat1Value\": \"500+\",\n \"stat1Label\": \"Happy Clients\",\n \"stat2Value\": \"1000+\",\n \"stat2Label\": \"Projects Completed\",\n \"stat3Value\": \"99%\",\n \"stat3Label\": \"Satisfaction Rate\",\n \"stat4Value\": \"15+\",\n \"stat4Label\": \"Years Experience\"\n}"
|
|
26
26
|
},
|
|
27
27
|
{
|
|
28
28
|
"path": "about-section/lang/tr.json",
|
|
29
29
|
"type": "registry:lang",
|
|
30
30
|
"target": "$modules$/about-section/lang/tr.json",
|
|
31
|
-
"content": "{\
|
|
31
|
+
"content": "{\n \"title\": \"Hakkımızda\",\n \"description\": \"Müşterilerimize olağanüstü sonuçlar sunmaya kendini adamış, tutkulu profesyonellerden oluşan bir ekibiz.\",\n \"mainImageAlt\": \"Ekibimiz\",\n \"secondaryImageAlt\": \"Ofisimiz\",\n \"cardTitle\": \"Misyonumuz\",\n \"cardDescription\": \"İşletmeleri büyüme ve başarı sağlayan yenilikçi çözümlerle güçlendirmek.\",\n \"cardButton\": \"Daha Fazla\",\n \"companiesTitle\": \"Önde Gelen Markalar Tarafından Güvenilir\",\n \"statsTitle\": \"Başarılarımız\",\n \"statsDescription\": \"Mükemmeliyete olan bağlılığımızı gösteren rakamlar.\",\n \"stat1Value\": \"500+\",\n \"stat1Label\": \"Mutlu Müşteri\",\n \"stat2Value\": \"1000+\",\n \"stat2Label\": \"Tamamlanan Proje\",\n \"stat3Value\": \"%99\",\n \"stat3Label\": \"Memnuniyet Oranı\",\n \"stat4Value\": \"15+\",\n \"stat4Label\": \"Yıllık Deneyim\"\n}"
|
|
32
32
|
}
|
|
33
33
|
],
|
|
34
34
|
"exports": {
|
|
@@ -13,13 +13,13 @@
|
|
|
13
13
|
"path": "animations/index.ts",
|
|
14
14
|
"type": "registry:index",
|
|
15
15
|
"target": "$modules$/animations/index.ts",
|
|
16
|
-
"content": "export * from \"./animations\";\
|
|
16
|
+
"content": "export * from \"./animations\";\nexport * from \"./components\";\n"
|
|
17
17
|
},
|
|
18
18
|
{
|
|
19
19
|
"path": "animations/animations.ts",
|
|
20
20
|
"type": "registry:lib",
|
|
21
21
|
"target": "$modules$/animations/animations.ts",
|
|
22
|
-
"content": "import type { Variants, Transition } from \"motion/react\";\
|
|
22
|
+
"content": "import type { Variants, Transition } from \"motion/react\";\n\n/**\n * Fade in from bottom animation\n * Use for: Hero sections, cards on scroll, page content\n */\nexport const fadeInUp: Variants = {\n initial: { opacity: 0, y: 20 },\n animate: { opacity: 1, y: 0 },\n exit: { opacity: 0, y: -10 },\n};\n\n/**\n * Fade in from top animation\n * Use for: Dropdowns, modals, notifications\n */\nexport const fadeInDown: Variants = {\n initial: { opacity: 0, y: -20 },\n animate: { opacity: 1, y: 0 },\n exit: { opacity: 0, y: -10 },\n};\n\n/**\n * Slide in from left animation\n * Use for: Sidebars, navigation, list items\n */\nexport const slideInLeft: Variants = {\n initial: { opacity: 0, x: -20 },\n animate: { opacity: 1, x: 0 },\n exit: { opacity: 0, x: -20 },\n};\n\n/**\n * Slide in from right animation\n * Use for: Panels, drawers, cart sidebars\n */\nexport const slideInRight: Variants = {\n initial: { opacity: 0, x: 20 },\n animate: { opacity: 1, x: 0 },\n exit: { opacity: 0, x: 20 },\n};\n\n/**\n * Scale up animation\n * Use for: Modals, popups, dialogs\n */\nexport const scaleUp: Variants = {\n initial: { opacity: 0, scale: 0.95 },\n animate: { opacity: 1, scale: 1 },\n exit: { opacity: 0, scale: 0.95 },\n};\n\n/**\n * Simple fade animation\n * Use for: Overlays, backgrounds, subtle transitions\n */\nexport const fade: Variants = {\n initial: { opacity: 0 },\n animate: { opacity: 1 },\n exit: { opacity: 0 },\n};\n\n/**\n * Stagger container for child animations\n * Use with children that have their own variants\n *\n * @example\n * <motion.div variants={staggerContainer} initial=\"initial\" animate=\"animate\">\n * {items.map(item => (\n * <motion.div key={item.id} variants={fadeInUp}>\n * {item.content}\n * </motion.div>\n * ))}\n * </motion.div>\n */\nexport const staggerContainer: Variants = {\n initial: {},\n animate: {\n transition: {\n staggerChildren: 0.1,\n delayChildren: 0.1,\n },\n },\n};\n\n/**\n * Fast stagger for many items\n */\nexport const staggerContainerFast: Variants = {\n initial: {},\n animate: {\n transition: {\n staggerChildren: 0.05,\n delayChildren: 0.05,\n },\n },\n};\n\n/**\n * Slow stagger for fewer, larger items\n */\nexport const staggerContainerSlow: Variants = {\n initial: {},\n animate: {\n transition: {\n staggerChildren: 0.15,\n delayChildren: 0.2,\n },\n },\n};\n\n/**\n * Default spring transition\n * Use for: Most animations\n */\nexport const springTransition: Transition = {\n type: \"spring\",\n stiffness: 300,\n damping: 30,\n};\n\n/**\n * Smooth ease transition\n * Use for: Subtle, elegant animations\n */\nexport const easeTransition: Transition = {\n type: \"tween\",\n ease: \"easeOut\",\n duration: 0.3,\n};\n\n/**\n * Quick transition\n * Use for: Hover effects, quick feedback\n */\nexport const quickTransition: Transition = {\n type: \"tween\",\n ease: \"easeOut\",\n duration: 0.15,\n};\n\n/**\n * Hover scale effect props\n * Use with motion components for card hover effects\n *\n * @example\n * <motion.div {...hoverScale}>\n * <Card>...</Card>\n * </motion.div>\n */\nexport const hoverScale = {\n whileHover: { scale: 1.02 },\n whileTap: { scale: 0.98 },\n transition: springTransition,\n};\n\n/**\n * Subtle hover scale for smaller elements\n */\nexport const hoverScaleSubtle = {\n whileHover: { scale: 1.01 },\n whileTap: { scale: 0.99 },\n transition: quickTransition,\n};\n\n/**\n * Hover lift effect (scale + shadow simulation via y)\n */\nexport const hoverLift = {\n whileHover: { scale: 1.02, y: -4 },\n whileTap: { scale: 0.98, y: 0 },\n transition: springTransition,\n};\n\n/**\n * Button press effect\n */\nexport const buttonPress = {\n whileHover: { scale: 1.02 },\n whileTap: { scale: 0.95 },\n transition: quickTransition,\n};\n\n/**\n * Icon hover rotation\n */\nexport const iconHoverRotate = {\n whileHover: { rotate: 15 },\n transition: springTransition,\n};\n\n/**\n * Accordion/collapse animation variants\n * Use with AnimatePresence for expand/collapse\n *\n * @example\n * <AnimatePresence>\n * {isOpen && (\n * <motion.div\n * variants={collapseVariants}\n * initial=\"collapsed\"\n * animate=\"expanded\"\n * exit=\"collapsed\"\n * >\n * Content\n * </motion.div>\n * )}\n * </AnimatePresence>\n */\nexport const collapseVariants: Variants = {\n collapsed: {\n height: 0,\n opacity: 0,\n overflow: \"hidden\",\n },\n expanded: {\n height: \"auto\",\n opacity: 1,\n overflow: \"visible\",\n transition: {\n height: { duration: 0.3, ease: \"easeOut\" },\n opacity: { duration: 0.2, delay: 0.1 },\n },\n },\n};\n\n/**\n * Page transition variants\n * Use for route transitions with AnimatePresence\n */\nexport const pageTransition: Variants = {\n initial: { opacity: 0, y: 10 },\n animate: {\n opacity: 1,\n y: 0,\n transition: {\n duration: 0.3,\n ease: \"easeOut\",\n },\n },\n exit: {\n opacity: 0,\n y: -10,\n transition: {\n duration: 0.2,\n ease: \"easeIn\",\n },\n },\n};\n\n/**\n * Carousel slide variants\n * Direction should be passed as custom prop\n *\n * @example\n * <motion.div\n * custom={direction}\n * variants={carouselSlide}\n * initial=\"enter\"\n * animate=\"center\"\n * exit=\"exit\"\n * >\n */\nexport const carouselSlide: Variants = {\n enter: (direction: number) => ({\n x: direction > 0 ? 300 : -300,\n opacity: 0,\n }),\n center: {\n x: 0,\n opacity: 1,\n transition: {\n x: { type: \"spring\", stiffness: 300, damping: 30 },\n opacity: { duration: 0.2 },\n },\n },\n exit: (direction: number) => ({\n x: direction < 0 ? 300 : -300,\n opacity: 0,\n transition: {\n x: { type: \"spring\", stiffness: 300, damping: 30 },\n opacity: { duration: 0.2 },\n },\n }),\n};\n\n/**\n * Notification/toast animation\n */\nexport const notificationVariants: Variants = {\n initial: { opacity: 0, y: -20, scale: 0.95 },\n animate: {\n opacity: 1,\n y: 0,\n scale: 1,\n transition: springTransition,\n },\n exit: {\n opacity: 0,\n y: -20,\n scale: 0.95,\n transition: quickTransition,\n },\n};\n\n/**\n * List item animation for staggered lists\n */\nexport const listItem: Variants = {\n initial: { opacity: 0, x: -10 },\n animate: { opacity: 1, x: 0 },\n exit: { opacity: 0, x: 10 },\n};\n\n/**\n * Grid item animation for staggered grids\n */\nexport const gridItem: Variants = {\n initial: { opacity: 0, scale: 0.9 },\n animate: { opacity: 1, scale: 1 },\n exit: { opacity: 0, scale: 0.9 },\n};\n"
|
|
23
23
|
},
|
|
24
24
|
{
|
|
25
25
|
"path": "animations/components.tsx",
|
|
@@ -13,25 +13,25 @@
|
|
|
13
13
|
"path": "announcement-bar/index.ts",
|
|
14
14
|
"type": "registry:index",
|
|
15
15
|
"target": "$modules$/announcement-bar/index.ts",
|
|
16
|
-
"content": "export { AnnouncementBar } from \"./announcement-bar\";\
|
|
16
|
+
"content": "export { AnnouncementBar } from \"./announcement-bar\";\n"
|
|
17
17
|
},
|
|
18
18
|
{
|
|
19
19
|
"path": "announcement-bar/announcement-bar.tsx",
|
|
20
20
|
"type": "registry:component",
|
|
21
21
|
"target": "$modules$/announcement-bar/announcement-bar.tsx",
|
|
22
|
-
"content": "import { useState } from \"react\";\
|
|
22
|
+
"content": "import { useState } from \"react\";\nimport { Link } from \"react-router\";\nimport { useTranslation } from \"react-i18next\";\nimport { X, ArrowRight, Sparkles, Megaphone, Gift, Zap } from \"lucide-react\";\nimport { cn } from \"@/lib/utils\";\nimport { motion, AnimatePresence } from \"motion/react\";\n\ntype BarVariant = \"default\" | \"primary\" | \"warning\" | \"success\" | \"gradient\";\n\ninterface AnnouncementBarProps {\n message?: string;\n linkText?: string;\n linkUrl?: string;\n variant?: BarVariant;\n icon?: \"sparkles\" | \"megaphone\" | \"gift\" | \"zap\" | \"none\";\n dismissible?: boolean;\n storageKey?: string;\n className?: string;\n}\n\nconst icons = {\n sparkles: Sparkles,\n megaphone: Megaphone,\n gift: Gift,\n zap: Zap,\n none: null,\n};\n\nconst variantStyles: Record<BarVariant, string> = {\n default: \"bg-muted text-muted-foreground\",\n primary: \"bg-primary text-primary-foreground\",\n warning: \"bg-yellow-500 text-yellow-950\",\n success: \"bg-green-500 text-white\",\n gradient: \"bg-gradient-to-r from-primary via-purple-500 to-pink-500 text-white\",\n};\n\nexport function AnnouncementBar({\n message,\n linkText,\n linkUrl = \"#\",\n variant = \"primary\",\n icon = \"sparkles\",\n dismissible = true,\n storageKey = \"announcement-bar-dismissed\",\n className,\n}: AnnouncementBarProps) {\n const { t } = useTranslation(\"announcement-bar\");\n const [isVisible, setIsVisible] = useState(() => {\n if (typeof window === \"undefined\") return false;\n if (dismissible) {\n return !localStorage.getItem(storageKey);\n }\n return true;\n });\n\n const displayMessage = message || t(\"message\", \"Exciting news! Check out our latest features.\");\n const displayLinkText = linkText || t(\"linkText\", \"Learn more\");\n\n const handleDismiss = () => {\n if (dismissible) {\n localStorage.setItem(storageKey, \"true\");\n }\n setIsVisible(false);\n };\n\n const IconComponent = icons[icon];\n\n return (\n <AnimatePresence>\n {isVisible && (\n <motion.div\n initial={{ height: 0, opacity: 0 }}\n animate={{ height: \"auto\", opacity: 1 }}\n exit={{ height: 0, opacity: 0 }}\n transition={{ duration: 0.3 }}\n className={cn(\n \"relative overflow-hidden\",\n variantStyles[variant],\n className\n )}\n >\n <div className=\"w-full max-w-[var(--container-max-width)] mx-auto px-4\">\n <div className=\"flex items-center justify-center gap-2 py-2.5 text-sm font-medium\">\n {IconComponent && (\n <IconComponent className=\"h-4 w-4 flex-shrink-0\" />\n )}\n <span className=\"text-center\">{displayMessage}</span>\n {linkUrl && (\n <Link\n to={linkUrl}\n className=\"inline-flex items-center gap-1 font-semibold hover:underline underline-offset-2\"\n >\n {displayLinkText}\n <ArrowRight className=\"h-3 w-3\" />\n </Link>\n )}\n {dismissible && (\n <button\n onClick={handleDismiss}\n className=\"absolute right-4 p-1 rounded hover:bg-black/10 transition-colors\"\n aria-label={t(\"dismiss\", \"Dismiss\")}\n >\n <X className=\"h-4 w-4\" />\n </button>\n )}\n </div>\n </div>\n </motion.div>\n )}\n </AnimatePresence>\n );\n}\n"
|
|
23
23
|
},
|
|
24
24
|
{
|
|
25
25
|
"path": "announcement-bar/lang/en.json",
|
|
26
26
|
"type": "registry:lang",
|
|
27
27
|
"target": "$modules$/announcement-bar/lang/en.json",
|
|
28
|
-
"content": "{\
|
|
28
|
+
"content": "{\n \"message\": \"Important announcement: Limited time offer - Learn more →\",\n \"linkText\": \"Learn more\",\n \"dismiss\": \"Dismiss\"\n}"
|
|
29
29
|
},
|
|
30
30
|
{
|
|
31
31
|
"path": "announcement-bar/lang/tr.json",
|
|
32
32
|
"type": "registry:lang",
|
|
33
33
|
"target": "$modules$/announcement-bar/lang/tr.json",
|
|
34
|
-
"content": "{\
|
|
34
|
+
"content": "{\n \"message\": \"Önemli duyuru: Sınırlı süreli kampanya - Detaylar →\",\n \"linkText\": \"Daha fazla\",\n \"dismiss\": \"Kapat\"\n}"
|
|
35
35
|
}
|
|
36
36
|
],
|
|
37
37
|
"exports": {
|
package/dist/registry/api.json
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"path": "api/index.ts",
|
|
14
14
|
"type": "registry:index",
|
|
15
15
|
"target": "$modules$/api/index.ts",
|
|
16
|
-
"content": "export { customerClient } from \"./customer-client\";\
|
|
16
|
+
"content": "export { customerClient } from \"./customer-client\";\nexport type { ApiClient } from \"./customer-client\";\nexport { getErrorMessage } from \"./get-error-message\";\n"
|
|
17
17
|
},
|
|
18
18
|
{
|
|
19
19
|
"path": "api/customer-client.ts",
|
|
@@ -15,19 +15,19 @@
|
|
|
15
15
|
"path": "auth-core/index.ts",
|
|
16
16
|
"type": "registry:index",
|
|
17
17
|
"target": "$modules$/auth-core/index.ts",
|
|
18
|
-
"content": "// Store\
|
|
18
|
+
"content": "// Store\nexport { useAuthStore } from \"./auth-store\";\nexport type { User, AuthTokens } from \"./auth-store\";\n\n// Hook\nexport { useAuth } from \"./use-auth\";\n"
|
|
19
19
|
},
|
|
20
20
|
{
|
|
21
21
|
"path": "auth-core/auth-store.ts",
|
|
22
22
|
"type": "registry:store",
|
|
23
23
|
"target": "$modules$/auth-core/auth-store.ts",
|
|
24
|
-
"content": "import { create } from \"zustand\";\
|
|
24
|
+
"content": "import { create } from \"zustand\";\nimport { persist } from \"zustand/middleware\";\n\nexport interface User {\n username: string;\n email?: string;\n}\n\nexport interface AuthTokens {\n accessToken: string;\n refreshToken?: string;\n idToken?: string;\n encryptionKey?: string;\n expiresAt?: number; // Unix timestamp in milliseconds\n}\n\ninterface AuthState {\n user: User | null;\n tokens: AuthTokens | null;\n isAuthenticated: boolean;\n setAuth: (user: User, tokens: AuthTokens) => void;\n updateTokens: (tokens: AuthTokens) => void;\n clearAuth: () => void;\n isTokenExpired: () => boolean;\n getTimeUntilExpiry: () => number | null;\n}\n\nexport const useAuthStore = create<AuthState>()(\n persist(\n (set, get) => ({\n user: null,\n tokens: null,\n isAuthenticated: false,\n\n setAuth: (user, tokens) => set({ user, tokens, isAuthenticated: true }),\n\n updateTokens: (tokens) => set({ tokens }),\n\n clearAuth: () =>\n set({ user: null, tokens: null, isAuthenticated: false }),\n\n isTokenExpired: () => {\n const { tokens } = get();\n if (!tokens?.expiresAt) return false;\n // Consider token expired 30 seconds before actual expiry for safety margin\n return Date.now() >= tokens.expiresAt - 30000;\n },\n\n getTimeUntilExpiry: () => {\n const { tokens } = get();\n if (!tokens?.expiresAt) return null;\n return tokens.expiresAt - Date.now();\n },\n }),\n { name: \"auth-storage\" },\n ),\n);\n"
|
|
25
25
|
},
|
|
26
26
|
{
|
|
27
27
|
"path": "auth-core/use-auth.ts",
|
|
28
28
|
"type": "registry:hook",
|
|
29
29
|
"target": "$modules$/auth-core/use-auth.ts",
|
|
30
|
-
"content": "import { useCallback, useEffect, useRef } from \"react\";\
|
|
30
|
+
"content": "import { useCallback, useEffect, useRef } from \"react\";\nimport {\n useAuthStore,\n type User,\n type AuthTokens,\n} from \"./auth-store\";\nimport { customerClient } from \"@/modules/api\";\n\n// Refresh token 1 minute before expiry\nconst REFRESH_BUFFER_MS = 60 * 1000;\n\nexport function useAuth() {\n const {\n user,\n tokens,\n isAuthenticated,\n setAuth,\n updateTokens,\n clearAuth,\n isTokenExpired,\n getTimeUntilExpiry,\n } = useAuthStore();\n\n const refreshTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const isRefreshingRef = useRef(false);\n\n // Refresh token using the refresh token\n const refreshAccessToken = useCallback(async (): Promise<boolean> => {\n const currentTokens = useAuthStore.getState().tokens;\n\n // Don't refresh if no refresh token exists\n if (!currentTokens?.refreshToken || isRefreshingRef.current) {\n console.log(\"⚠️ No refresh token available, skipping refresh\");\n return false;\n }\n\n isRefreshingRef.current = true;\n\n try {\n // Make a refresh request using the axios instance directly\n const response = await customerClient.axios.post<{\n accessToken: string;\n refreshToken?: string;\n expiresIn?: number;\n }>(\"/auth/refresh\", {\n refreshToken: currentTokens.refreshToken,\n });\n\n const { accessToken, refreshToken, expiresIn } = response.data;\n\n // Validate response has required data\n if (!accessToken) {\n console.error(\"❌ Refresh response missing accessToken\");\n return false;\n }\n\n const newTokens: AuthTokens = {\n accessToken,\n refreshToken: refreshToken || currentTokens.refreshToken,\n idToken: currentTokens.idToken, // Preserve existing idToken\n encryptionKey: currentTokens.encryptionKey, // Preserve existing encryptionKey\n expiresAt: expiresIn ? Date.now() + expiresIn * 1000 : undefined,\n };\n\n customerClient.setToken(accessToken);\n updateTokens(newTokens);\n\n console.log(\"✅ Token refreshed successfully\");\n return true;\n } catch (error) {\n console.error(\"❌ Token refresh failed:\", error);\n // DON'T clear auth on refresh failure - just return false\n // User can still use their existing token until it expires\n return false;\n } finally {\n isRefreshingRef.current = false;\n }\n }, [updateTokens]);\n\n // Schedule automatic token refresh\n const scheduleTokenRefresh = useCallback(() => {\n // Clear any existing timeout\n if (refreshTimeoutRef.current) {\n clearTimeout(refreshTimeoutRef.current);\n refreshTimeoutRef.current = null;\n }\n\n const timeUntilExpiry = getTimeUntilExpiry();\n\n // Only schedule if we have an expiry time and a refresh token\n if (timeUntilExpiry === null || !tokens?.refreshToken) {\n return;\n }\n\n // Calculate when to refresh (REFRESH_BUFFER_MS before expiry)\n const refreshIn = Math.max(timeUntilExpiry - REFRESH_BUFFER_MS, 0);\n\n // Don't schedule if expiry is too far in the future (> 24 hours)\n if (refreshIn > 24 * 60 * 60 * 1000) {\n return;\n }\n\n refreshTimeoutRef.current = setTimeout(async () => {\n const success = await refreshAccessToken();\n if (success) {\n // Reschedule for the new token\n scheduleTokenRefresh();\n }\n }, refreshIn);\n }, [getTimeUntilExpiry, tokens?.refreshToken, refreshAccessToken]);\n\n // Sync token with API client and set up refresh on mount and token changes\n useEffect(() => {\n if (tokens?.accessToken) {\n console.log(\"🔑 Setting token in API client\");\n customerClient.setToken(tokens.accessToken);\n\n // Only try to refresh if we have a refresh token AND token is expired\n if (isTokenExpired() && tokens.refreshToken) {\n console.log(\"⏰ Token expired, attempting refresh...\");\n refreshAccessToken().then((success) => {\n if (success) {\n scheduleTokenRefresh();\n } else {\n console.log(\"⚠️ Refresh failed, but keeping existing token\");\n }\n });\n } else if (tokens.refreshToken) {\n // Only schedule refresh if we have a refresh token\n scheduleTokenRefresh();\n }\n } else if (tokens && Object.keys(tokens).length === 0) {\n // tokens is empty object {} - this shouldn't happen, log it\n console.warn(\"⚠️ Tokens object is empty, this may indicate a bug\");\n } else {\n customerClient.setToken(null);\n }\n\n // Cleanup timeout on unmount\n return () => {\n if (refreshTimeoutRef.current) {\n clearTimeout(refreshTimeoutRef.current);\n }\n };\n }, [\n tokens?.accessToken,\n tokens?.refreshToken,\n isTokenExpired,\n refreshAccessToken,\n scheduleTokenRefresh,\n ]);\n\n // Set up axios interceptor for 401 responses (token expired during request)\n useEffect(() => {\n const interceptorId = customerClient.axios.interceptors.response.use(\n (response) => response,\n async (error) => {\n const originalRequest = error.config;\n\n // Skip refresh for auth endpoints to prevent infinite loops\n const isAuthEndpoint = originalRequest?.url?.includes(\"/auth/\");\n\n // If we get a 401 and haven't retried yet, try to refresh\n if (\n error.response?.status === 401 &&\n !originalRequest._retry &&\n tokens?.refreshToken &&\n !isAuthEndpoint\n ) {\n originalRequest._retry = true;\n\n const success = await refreshAccessToken();\n if (success) {\n // Retry the original request with new token\n const newTokens = useAuthStore.getState().tokens;\n if (newTokens?.accessToken) {\n originalRequest.headers.Authorization = `Bearer ${newTokens.accessToken}`;\n return customerClient.axios(originalRequest);\n }\n }\n }\n\n return Promise.reject(error);\n },\n );\n\n return () => {\n customerClient.axios.interceptors.response.eject(interceptorId);\n };\n }, [tokens?.refreshToken, refreshAccessToken]);\n\n const login = useCallback(async (username: string, password: string) => {\n const response = await customerClient.auth.login({ username, password });\n\n console.log(\"🔐 Login response:\", response);\n console.log(\"🔐 accessToken:\", response.accessToken);\n console.log(\"🔐 refreshToken:\", response.refreshToken);\n console.log(\"🔐 encryptionKey:\", response.encryptionKey);\n\n const newTokens: AuthTokens = {\n accessToken: response.accessToken,\n refreshToken: response.refreshToken,\n idToken: response.idToken,\n encryptionKey: response.encryptionKey,\n expiresAt: response.expiresIn\n ? Date.now() + response.expiresIn * 1000\n : undefined,\n };\n\n console.log(\"🔐 newTokens object:\", newTokens);\n\n const newUser: User = {\n username,\n email: (response as any).email || (response as any).user?.email,\n };\n\n customerClient.setToken(newTokens.accessToken);\n setAuth(newUser, newTokens);\n\n console.log(\n \"🔐 Auth set complete, checking store:\",\n useAuthStore.getState().tokens,\n );\n }, []);\n\n const register = useCallback(\n async (username: string, email: string, password: string) => {\n await customerClient.auth.register({ username, email, password });\n },\n [],\n );\n\n const confirmEmail = useCallback(async (username: string, code: string) => {\n await customerClient.auth.confirm({ username, code });\n }, []);\n\n const forgotPassword = useCallback(async (username: string) => {\n await customerClient.auth.forgotPassword({ username });\n }, []);\n\n const resetPassword = useCallback(\n async (username: string, code: string, newPassword: string) => {\n await customerClient.auth.resetPassword({ username, code, newPassword });\n },\n [],\n );\n\n const logout = useCallback(() => {\n // Clear any scheduled refresh\n if (refreshTimeoutRef.current) {\n clearTimeout(refreshTimeoutRef.current);\n refreshTimeoutRef.current = null;\n }\n\n customerClient.setToken(null);\n clearAuth();\n }, [clearAuth]);\n\n return {\n user,\n token: tokens?.accessToken ?? null,\n tokens,\n isAuthenticated,\n api: customerClient,\n login,\n register,\n confirmEmail,\n forgotPassword,\n resetPassword,\n logout,\n refreshAccessToken,\n };\n}\n"
|
|
31
31
|
}
|
|
32
32
|
],
|
|
33
33
|
"exports": {
|
|
@@ -10,25 +10,25 @@
|
|
|
10
10
|
"path": "bento-grid-section/index.ts",
|
|
11
11
|
"type": "registry:index",
|
|
12
12
|
"target": "$modules$/bento-grid-section/index.ts",
|
|
13
|
-
"content": "export * from './bento-grid-section';\
|
|
13
|
+
"content": "export * from './bento-grid-section';\n"
|
|
14
14
|
},
|
|
15
15
|
{
|
|
16
16
|
"path": "bento-grid-section/bento-grid-section.tsx",
|
|
17
17
|
"type": "registry:component",
|
|
18
18
|
"target": "$modules$/bento-grid-section/bento-grid-section.tsx",
|
|
19
|
-
"content": "import type { ReactNode } from \"react\";\
|
|
19
|
+
"content": "import type { ReactNode } from \"react\";\nimport { cn } from \"@/lib/utils\";\n\n// Bento Grid Components\nexport function BentoGrid({\n className,\n children,\n}: {\n className?: string;\n children?: ReactNode;\n}) {\n return (\n <div\n className={cn(\n \"grid md:auto-rows-[18rem] grid-cols-1 md:grid-cols-3 gap-4 max-w-7xl mx-auto\",\n className\n )}\n >\n {children}\n </div>\n );\n}\n\nexport function BentoGridItem({\n className,\n title,\n description,\n header,\n icon,\n}: {\n className?: string;\n title?: string | ReactNode;\n description?: string | ReactNode;\n header?: ReactNode;\n icon?: ReactNode;\n}) {\n return (\n <div\n className={cn(\n \"row-span-1 rounded-xl group/bento hover:shadow-xl transition duration-200 shadow-input dark:shadow-none p-4 dark:bg-black dark:border-white/[0.2] bg-white border border-transparent justify-between flex flex-col space-y-4\",\n className\n )}\n >\n {header}\n <div className=\"group-hover/bento:translate-x-2 transition duration-200\">\n {icon}\n <div className=\"font-sans font-bold text-neutral-600 dark:text-neutral-200 mb-2 mt-2\">\n {title}\n </div>\n <div className=\"font-sans font-normal text-neutral-600 text-xs dark:text-neutral-300\">\n {description}\n </div>\n </div>\n </div>\n );\n}\n\n// Section Component\ninterface BentoGridSectionProps {\n title?: string;\n items: Array<{\n title: string;\n description: string;\n header?: ReactNode;\n icon?: ReactNode;\n className?: string;\n }>;\n className?: string;\n}\n\nexport function BentoGridSection({\n title,\n items,\n className,\n}: BentoGridSectionProps) {\n return (\n <section className={cn(\"py-16 md:py-24\", className)}>\n <div className=\"w-full max-w-[var(--container-max-width)] mx-auto px-4\">\n {title && (\n <h2 className=\"text-3xl md:text-4xl font-bold text-center mb-12\">\n {title}\n </h2>\n )}\n <BentoGrid>\n {items.map((item, i) => (\n <BentoGridItem\n key={i}\n title={item.title}\n description={item.description}\n header={item.header}\n icon={item.icon}\n className={item.className}\n />\n ))}\n </BentoGrid>\n </div>\n </section>\n );\n}\n"
|
|
20
20
|
},
|
|
21
21
|
{
|
|
22
22
|
"path": "bento-grid-section/lang/en.json",
|
|
23
23
|
"type": "registry:lang",
|
|
24
24
|
"target": "$modules$/bento-grid-section/lang/en.json",
|
|
25
|
-
"content": "{\
|
|
25
|
+
"content": "{\n \"title\": \"Features\"\n}\n"
|
|
26
26
|
},
|
|
27
27
|
{
|
|
28
28
|
"path": "bento-grid-section/lang/tr.json",
|
|
29
29
|
"type": "registry:lang",
|
|
30
30
|
"target": "$modules$/bento-grid-section/lang/tr.json",
|
|
31
|
-
"content": "{\
|
|
31
|
+
"content": "{\n \"title\": \"Özellikler\"\n}\n"
|
|
32
32
|
}
|
|
33
33
|
],
|
|
34
34
|
"exports": {
|
|
@@ -13,19 +13,19 @@
|
|
|
13
13
|
"path": "blog-core/index.ts",
|
|
14
14
|
"type": "registry:index",
|
|
15
15
|
"target": "$modules$/blog-core/index.ts",
|
|
16
|
-
"content": "// Types\
|
|
16
|
+
"content": "// Types\nexport * from './types';\n\n// Store (Zustand)\nexport { useBlogStore, useBlog } from './stores/blog-store';\n\n// Hooks\nexport {\n usePosts,\n usePostBySlug,\n useFeaturedPosts,\n useRecentPosts,\n usePopularPosts,\n usePostsByCategory,\n usePostsByTag,\n usePostSearch,\n useBlogCategories,\n usePostStats\n} from './usePosts';\n"
|
|
17
17
|
},
|
|
18
18
|
{
|
|
19
19
|
"path": "blog-core/types.ts",
|
|
20
20
|
"type": "registry:type",
|
|
21
21
|
"target": "$modules$/blog-core/types.ts",
|
|
22
|
-
"content": "export interface PostCategory {\
|
|
22
|
+
"content": "export interface PostCategory {\n id: number;\n name: string;\n slug: string;\n is_primary: boolean;\n}\n\nexport interface Post {\n id: number;\n title: string;\n slug: string;\n content: string;\n excerpt: string;\n featured_image: string;\n images: string[];\n category: string; // Primary category slug (backward compatibility)\n category_name?: string; // Primary category name (backward compatibility)\n categories: PostCategory[]; // Multi-category support\n author: string;\n author_avatar: string;\n published_at: string;\n updated_at: string;\n tags: string[];\n read_time: number;\n view_count: number;\n featured: boolean;\n published: boolean;\n meta_description: string;\n meta_keywords: string;\n}\n\nexport interface Author {\n id: number;\n name: string;\n slug: string;\n bio?: string;\n avatar?: string;\n social?: {\n twitter?: string;\n linkedin?: string;\n github?: string;\n website?: string;\n };\n}\n\nexport interface Comment {\n id: number;\n post_id: number;\n author_name: string;\n author_email: string;\n content: string;\n created_at: string;\n approved: boolean;\n}\n\nexport interface BlogCategory {\n id: number;\n name: string;\n slug: string;\n description?: string;\n image?: string;\n}\n\nexport interface BlogContextType {\n favorites: Post[];\n addToFavorites: (post: Post) => void;\n removeFromFavorites: (postId: string) => void;\n isFavorite: (postId: string) => boolean;\n clearFavorites: () => void;\n}\n\nexport interface BlogSettings {\n site: {\n name: string;\n description: string;\n url: string;\n logo?: string;\n };\n author: {\n name: string;\n bio?: string;\n avatar?: string;\n };\n social: {\n twitter?: string;\n linkedin?: string;\n github?: string;\n facebook?: string;\n };\n comments: {\n enabled: boolean;\n moderation: boolean;\n };\n newsletter: {\n enabled: boolean;\n provider?: string;\n };\n}\n"
|
|
23
23
|
},
|
|
24
24
|
{
|
|
25
25
|
"path": "blog-core/stores/blog-store.ts",
|
|
26
26
|
"type": "registry:store",
|
|
27
27
|
"target": "$modules$/blog-core/stores/blog-store.ts",
|
|
28
|
-
"content": "import { create } from \"zustand\";\
|
|
28
|
+
"content": "import { create } from \"zustand\";\nimport { persist } from \"zustand/middleware\";\nimport type { Post, BlogContextType } from \"../types\";\n\ninterface BlogStore {\n favorites: Post[];\n addToFavorites: (post: Post) => void;\n removeFromFavorites: (postId: string) => void;\n isFavorite: (postId: string) => boolean;\n clearFavorites: () => void;\n}\n\nexport const useBlogStore = create<BlogStore>()(\n persist(\n (set, get) => ({\n favorites: [],\n\n addToFavorites: (post) =>\n set((state) => {\n if (state.favorites.some((p) => p.id === post.id)) {\n return state;\n }\n return { favorites: [...state.favorites, post] };\n }),\n\n removeFromFavorites: (postId) =>\n set((state) => ({\n favorites: state.favorites.filter((p) => String(p.id) !== postId),\n })),\n\n isFavorite: (postId) => {\n return get().favorites.some((p) => String(p.id) === postId);\n },\n\n clearFavorites: () => set({ favorites: [] }),\n }),\n { name: \"blog_favorites\" }\n )\n);\n\n// Backward compatible hook - matches BlogContextType\nexport const useBlog = (): BlogContextType => {\n const store = useBlogStore();\n return {\n favorites: store.favorites,\n addToFavorites: store.addToFavorites,\n removeFromFavorites: store.removeFromFavorites,\n isFavorite: store.isFavorite,\n clearFavorites: store.clearFavorites,\n };\n};\n"
|
|
29
29
|
},
|
|
30
30
|
{
|
|
31
31
|
"path": "blog-core/usePosts.ts",
|
|
@@ -37,13 +37,13 @@
|
|
|
37
37
|
"path": "blog-core/lang/en.json",
|
|
38
38
|
"type": "registry:lang",
|
|
39
39
|
"target": "$modules$/blog-core/lang/en.json",
|
|
40
|
-
"content": "{\
|
|
40
|
+
"content": "{\n \"favorites\": \"Favorites\",\n \"addedToFavorites\": \"Added to favorites\",\n \"removedFromFavorites\": \"Removed from favorites\",\n \"noFavorites\": \"No favorites yet\",\n \"clearFavorites\": \"Clear all favorites\",\n \"posts\": \"Posts\",\n \"categories\": \"Categories\",\n \"tags\": \"Tags\",\n \"readMore\": \"Read more\",\n \"minRead\": \"min read\",\n \"views\": \"views\",\n \"loadingPosts\": \"Loading posts...\",\n \"noPosts\": \"No posts found\",\n \"errorLoadingPosts\": \"Error loading posts\"\n}\n"
|
|
41
41
|
},
|
|
42
42
|
{
|
|
43
43
|
"path": "blog-core/lang/tr.json",
|
|
44
44
|
"type": "registry:lang",
|
|
45
45
|
"target": "$modules$/blog-core/lang/tr.json",
|
|
46
|
-
"content": "{\
|
|
46
|
+
"content": "{\n \"favorites\": \"Favoriler\",\n \"addedToFavorites\": \"Favorilere eklendi\",\n \"removedFromFavorites\": \"Favorilerden kaldırıldı\",\n \"noFavorites\": \"Henüz favori yok\",\n \"clearFavorites\": \"Tüm favorileri temizle\",\n \"posts\": \"Yazılar\",\n \"categories\": \"Kategoriler\",\n \"tags\": \"Etiketler\",\n \"readMore\": \"Devamını oku\",\n \"minRead\": \"dk okuma\",\n \"views\": \"görüntüleme\",\n \"loadingPosts\": \"Yazılar yükleniyor...\",\n \"noPosts\": \"Yazı bulunamadı\",\n \"errorLoadingPosts\": \"Yazılar yüklenirken hata oluştu\"\n}\n"
|
|
47
47
|
}
|
|
48
48
|
],
|
|
49
49
|
"exports": {
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"path": "blog-list-page/index.ts",
|
|
19
19
|
"type": "registry:index",
|
|
20
20
|
"target": "$modules$/blog-list-page/index.ts",
|
|
21
|
-
"content": "export * from './blog-list-page';\
|
|
21
|
+
"content": "export * from './blog-list-page';\nexport { BlogListPage as default } from './blog-list-page';\n"
|
|
22
22
|
},
|
|
23
23
|
{
|
|
24
24
|
"path": "blog-list-page/blog-list-page.tsx",
|
|
@@ -30,13 +30,13 @@
|
|
|
30
30
|
"path": "blog-list-page/lang/en.json",
|
|
31
31
|
"type": "registry:lang",
|
|
32
32
|
"target": "$modules$/blog-list-page/lang/en.json",
|
|
33
|
-
"content": "{\
|
|
33
|
+
"content": "{\n \"title\": \"Blog\",\n \"subtitle\": \"Discover our latest articles and insights\",\n \"allPosts\": \"All Posts\",\n \"featuredPosts\": \"Featured Posts\",\n \"recentPosts\": \"Recent Posts\",\n \"popularPosts\": \"Popular Posts\",\n \"categories\": \"Categories\",\n \"tags\": \"Tags\",\n \"filters\": \"Filters\",\n \"search\": \"Search\",\n \"searchPlaceholder\": \"Search posts...\",\n \"sortBy\": \"Sort By\",\n \"sortNewest\": \"Newest First\",\n \"sortOldest\": \"Oldest First\",\n \"sortPopular\": \"Most Popular\",\n \"sortReadingTime\": \"Reading Time\",\n \"showing\": \"Showing\",\n \"of\": \"of\",\n \"posts\": \"posts\",\n \"for\": \"for\",\n \"noPostsFound\": \"No posts found matching your criteria.\",\n \"clearFilters\": \"Clear Filters\",\n \"filterDescription\": \"Filter posts by category, tags, and more\",\n \"readMore\": \"Read More\",\n \"minRead\": \"min\",\n \"views\": \"views\",\n \"error\": \"Failed to load posts\"\n}\n"
|
|
34
34
|
},
|
|
35
35
|
{
|
|
36
36
|
"path": "blog-list-page/lang/tr.json",
|
|
37
37
|
"type": "registry:lang",
|
|
38
38
|
"target": "$modules$/blog-list-page/lang/tr.json",
|
|
39
|
-
"content": "{\
|
|
39
|
+
"content": "{\n \"title\": \"Blog\",\n \"subtitle\": \"En son makalelerimizi ve görüşlerimizi keşfedin\",\n \"allPosts\": \"Tüm Yazılar\",\n \"featuredPosts\": \"Öne Çıkan Yazılar\",\n \"recentPosts\": \"Son Yazılar\",\n \"popularPosts\": \"Popüler Yazılar\",\n \"categories\": \"Kategoriler\",\n \"tags\": \"Etiketler\",\n \"filters\": \"Filtreler\",\n \"search\": \"Arama\",\n \"searchPlaceholder\": \"Yazı ara...\",\n \"sortBy\": \"Sırala\",\n \"sortNewest\": \"En Yeni\",\n \"sortOldest\": \"En Eski\",\n \"sortPopular\": \"En Popüler\",\n \"sortReadingTime\": \"Okuma Süresi\",\n \"showing\": \"Gösterilen\",\n \"of\": \"/\",\n \"posts\": \"yazı\",\n \"for\": \"için\",\n \"noPostsFound\": \"Kriterlere uygun yazı bulunamadı.\",\n \"clearFilters\": \"Filtreleri Temizle\",\n \"filterDescription\": \"Yazıları kategori, etiket ve daha fazlasına göre filtreleyin\",\n \"readMore\": \"Devamını Oku\",\n \"minRead\": \"dk\",\n \"views\": \"görüntülenme\",\n \"error\": \"Yazılar yüklenemedi\"\n}\n"
|
|
40
40
|
}
|
|
41
41
|
],
|
|
42
42
|
"exports": {
|
|
@@ -15,25 +15,25 @@
|
|
|
15
15
|
"path": "blog-section/index.ts",
|
|
16
16
|
"type": "registry:index",
|
|
17
17
|
"target": "$modules$/blog-section/index.ts",
|
|
18
|
-
"content": "export * from './blog-section';\
|
|
18
|
+
"content": "export * from './blog-section';\n"
|
|
19
19
|
},
|
|
20
20
|
{
|
|
21
21
|
"path": "blog-section/blog-section.tsx",
|
|
22
22
|
"type": "registry:component",
|
|
23
23
|
"target": "$modules$/blog-section/blog-section.tsx",
|
|
24
|
-
"content": "import { Link } from \"react-router\";\
|
|
24
|
+
"content": "import { Link } from \"react-router\";\nimport { ArrowRight } from \"lucide-react\";\nimport { useTranslation } from \"react-i18next\";\nimport { cn } from \"@/lib/utils\";\nimport { Badge } from \"@/components/ui/badge\";\nimport { Button } from \"@/components/ui/button\";\nimport {\n Card,\n CardContent,\n CardFooter,\n CardHeader,\n} from \"@/components/ui/card\";\nimport { useRecentPosts } from \"@/modules/blog-core\";\nimport type { Post } from \"@/modules/blog-core/types\";\n\ninterface BlogSectionProps {\n posts?: Post[];\n loading?: boolean;\n className?: string;\n}\n\nexport function BlogSection({\n posts: propPosts,\n loading: propLoading,\n className,\n}: BlogSectionProps) {\n const { t } = useTranslation(\"blog-section\");\n const { posts: hookPosts, loading: hookLoading } = useRecentPosts(3);\n\n const posts = propPosts ?? hookPosts;\n const loading = propLoading ?? hookLoading;\n\n return (\n <section className={cn(\"py-16 md:py-24\", className)}>\n <div className=\"w-full max-w-[var(--container-max-width)] mx-auto px-4\">\n {/* Header */}\n <div className=\"text-center mb-12\">\n <Badge variant=\"secondary\" className=\"mb-4\">\n {t(\"tagline\", \"Latest Updates\")}\n </Badge>\n <h2 className=\"text-3xl font-bold md:text-4xl lg:text-5xl mb-4\">\n {t(\"title\", \"From Our Blog\")}\n </h2>\n <p className=\"text-muted-foreground max-w-2xl mx-auto mb-6\">\n {t(\n \"subtitle\",\n \"Discover the latest trends, tips, and insights from our team of experts.\"\n )}\n </p>\n <Button variant=\"link\" asChild>\n <Link to=\"/blog\">\n {t(\"viewAll\", \"View all articles\")}\n <ArrowRight className=\"ml-2 h-4 w-4\" />\n </Link>\n </Button>\n </div>\n\n {/* Posts Grid */}\n <div className=\"grid md:grid-cols-2 lg:grid-cols-3 gap-6 max-w-6xl mx-auto\">\n {loading ? (\n [...Array(3)].map((_, i) => (\n <Card key={i} className=\"overflow-hidden p-0 animate-pulse\">\n <div className=\"aspect-video bg-muted\"></div>\n <CardHeader className=\"pt-6 pb-2\">\n <div className=\"flex items-center gap-2 mb-2\">\n <div className=\"h-5 w-16 bg-muted rounded\"></div>\n <div className=\"h-4 w-20 bg-muted rounded\"></div>\n </div>\n <div className=\"h-6 w-3/4 bg-muted rounded\"></div>\n </CardHeader>\n <CardContent className=\"py-0\">\n <div className=\"h-4 w-full bg-muted rounded mb-2\"></div>\n <div className=\"h-4 w-2/3 bg-muted rounded\"></div>\n </CardContent>\n <CardFooter className=\"pb-2\">\n <div className=\"h-4 w-24 bg-muted rounded\"></div>\n </CardFooter>\n </Card>\n ))\n ) : (\n posts.map((post) => (\n <Card key={post.id} className=\"overflow-hidden group p-0\">\n <div className=\"aspect-video overflow-hidden\">\n <Link to={`/blog/${post.slug}`}>\n <img\n src={post.featured_image || \"/images/placeholder.png\"}\n alt={post.title}\n className=\"w-full h-full object-cover transition-transform duration-300 group-hover:scale-105\"\n onError={(e) => {\n e.currentTarget.style.display = \"none\";\n }}\n />\n </Link>\n </div>\n <CardHeader className=\"pt-6 pb-2\">\n <div className=\"flex items-center gap-2 mb-2\">\n <Badge variant=\"outline\" className=\"text-xs\">\n {post.category_name || post.category}\n </Badge>\n <span className=\"text-xs text-muted-foreground\">\n {new Date(post.published_at).toLocaleDateString()}\n </span>\n </div>\n <Link to={`/blog/${post.slug}`}>\n <h3 className=\"text-lg font-semibold hover:text-primary transition-colors line-clamp-2\">\n {post.title}\n </h3>\n </Link>\n </CardHeader>\n <CardContent className=\"py-0\">\n <p className=\"text-sm text-muted-foreground line-clamp-2\">\n {post.excerpt}\n </p>\n </CardContent>\n <CardFooter className=\"pb-2\">\n <Link\n to={`/blog/${post.slug}`}\n className=\"text-sm font-medium text-primary hover:underline inline-flex items-center whitespace-nowrap\"\n >\n {t(\"readMore\", \"Read more\")}\n <ArrowRight className=\"ml-1 h-3 w-3 shrink-0\" />\n </Link>\n </CardFooter>\n </Card>\n ))\n )}\n </div>\n </div>\n </section>\n );\n}\n"
|
|
25
25
|
},
|
|
26
26
|
{
|
|
27
27
|
"path": "blog-section/lang/en.json",
|
|
28
28
|
"type": "registry:lang",
|
|
29
29
|
"target": "$modules$/blog-section/lang/en.json",
|
|
30
|
-
"content": "{\
|
|
30
|
+
"content": "{\n \"tagline\": \"Latest Updates\",\n \"title\": \"From Our Blog\",\n \"subtitle\": \"Insights, tutorials, and stories to help you succeed.\",\n \"viewAll\": \"View all articles\",\n \"readMore\": \"Read more\",\n \"post1Title\": \"Getting Started: A Complete Guide\",\n \"post1Summary\": \"Learn the essential steps to launch your project successfully and avoid common pitfalls.\",\n \"post1Category\": \"Tutorial\",\n \"post1Author\": \"Sarah Chen\",\n \"post1Date\": \"Jan 15, 2024\",\n \"post2Title\": \"10 Best Practices You Need to Know\",\n \"post2Summary\": \"Discover proven strategies that will help you work smarter and achieve better results.\",\n \"post2Category\": \"Best Practices\",\n \"post2Author\": \"Michael Park\",\n \"post2Date\": \"Jan 10, 2024\",\n \"post3Title\": \"Design Trends That Matter in 2024\",\n \"post3Summary\": \"Stay ahead of the curve with these emerging design trends shaping the industry.\",\n \"post3Category\": \"Design\",\n \"post3Author\": \"Emily Davis\",\n \"post3Date\": \"Jan 5, 2024\"\n}"
|
|
31
31
|
},
|
|
32
32
|
{
|
|
33
33
|
"path": "blog-section/lang/tr.json",
|
|
34
34
|
"type": "registry:lang",
|
|
35
35
|
"target": "$modules$/blog-section/lang/tr.json",
|
|
36
|
-
"content": "{\
|
|
36
|
+
"content": "{\n \"tagline\": \"Son Güncellemeler\",\n \"title\": \"Blogumuzdan\",\n \"subtitle\": \"Ekibimizden içgörüler, ipuçları ve hikayeleri keşfedin.\",\n \"viewAll\": \"Tüm makaleleri görüntüle\",\n \"readMore\": \"Devamını oku\",\n \"post1Title\": \"Başlangıç Rehberi\",\n \"post1Summary\": \"Kapsamlı rehberimizle hızlı bir şekilde başlamak için temel adımları öğrenin.\",\n \"post1Category\": \"Eğitim\",\n \"post1Author\": \"Sarah Chen\",\n \"post1Date\": \"15 Ocak 2024\",\n \"post2Title\": \"Başarı İçin En İyi Uygulamalar\",\n \"post2Summary\": \"Daha iyi sonuçlar elde etmenize yardımcı olan kanıtlanmış stratejileri keşfedin.\",\n \"post2Category\": \"En İyi Uygulamalar\",\n \"post2Author\": \"Michael Park\",\n \"post2Date\": \"10 Ocak 2024\",\n \"post3Title\": \"2024 Tasarım Trendleri\",\n \"post3Summary\": \"En son tasarım trendlerini ve projelerinizde nasıl uygulayacağınızı keşfedin.\",\n \"post3Category\": \"Tasarım\",\n \"post3Author\": \"Emily Davis\",\n \"post3Date\": \"5 Ocak 2024\"\n}"
|
|
37
37
|
}
|
|
38
38
|
],
|
|
39
39
|
"exports": {
|