{"_id":"@danrubinmoto/crm-federated-engine","name":"@danrubinmoto/crm-federated-engine","dist-tags":{"latest":"0.2.0"},"versions":{"0.2.0":{"name":"@danrubinmoto/crm-federated-engine","version":"0.2.0","description":"Klientský balíček pro satelitní domény Dan Rubin Moto — SWR federace obsahu z CRM, Carbon Performance patička, JSON-LD, anti-duplication guard.","homepage":"https://app.danrubinmoto.com","keywords":["crm","federation","seo","geo","footer","satellite","dan-rubin"],"type":"module","main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./style.css":"./dist/style.css"},"sideEffects":["**/*.css"],"scripts":{"clean":"rm -rf dist","build:js":"tsup","build:css":"tailwindcss -i ./src/styles.css -o ./dist/style.css --minify","build":"bun run clean && bun run build:js && bun run build:css"},"engines":{"node":">=18"},"peerDependencies":{"react":"^18.3.0 || ^19.0.0","react-dom":"^18.3.0 || ^19.0.0"},"dependencies":{"zod":"^4.4.3"},"devDependencies":{"@tailwindcss/cli":"^4.3.1","@types/node":"^26.1.1","@types/react":"^19.2.17","@types/react-dom":"^19.2.0","tailwindcss":"^4.3.1","tsup":"^8.5.1","typescript":"^6.0.3"},"publishConfig":{"access":"public"},"license":"UNLICENSED","gitHead":"616f891e2757de3c7f8f3ac6f387f563c8323a7b","_id":"@danrubinmoto/crm-federated-engine@0.2.0","_nodeVersion":"24.18.0","_npmVersion":"11.16.0","dist":{"integrity":"sha512-8tvfl5hVcjr66Pu0XpjiqnPqZsN0FOw1d/3HAOyUstZ+xjFaP5myw18c5hBj73vTh4bdqU1sxC5S1NZKOHWNMw==","shasum":"fc59f1663b5765a2a715505b607bfdfe238d547f","tarball":"https://registry.npmjs.org/@danrubinmoto/crm-federated-engine/-/crm-federated-engine-0.2.0.tgz","fileCount":9,"unpackedSize":131123,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDeBdSqhZ94UWt3IwRxfmHrgrXQZR0ld6nygLKn0rfskQIhAMGgoKiAV3rqqcnZJ/sWgtdM3F+UGRRYD7Y0oArUCAWz"}]},"_npmUser":{"name":"danrubinmoto","email":"dan@danrubinmoto.com"},"directories":{},"maintainers":[{"name":"danrubinmoto","email":"dan@danrubinmoto.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/crm-federated-engine_0.2.0_1783857347715_0.9348478458899001"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-12T11:55:47.474Z","0.2.0":"2026-07-12T11:55:47.854Z","modified":"2026-07-12T11:55:48.154Z"},"maintainers":[{"name":"danrubinmoto","email":"dan@danrubinmoto.com"}],"description":"Klientský balíček pro satelitní domény Dan Rubin Moto — SWR federace obsahu z CRM, Carbon Performance patička, JSON-LD, anti-duplication guard.","homepage":"https://app.danrubinmoto.com","keywords":["crm","federation","seo","geo","footer","satellite","dan-rubin"],"license":"UNLICENSED","readme":"# @danrubinmoto/crm-federated-engine\r\n\r\nKlientský balíček pro **satelitní domény** ekosystému Dan Rubín. Načte\r\nkonfiguraci a ceníky z centrálního CRM endpointu\r\n`GET https://crm-danrubinmoto.lovable.app/api/public/services?site={domain}`,\r\ndrží 24h SWR cache v `localStorage`, injektuje JSON-LD (`Organization` +\r\n`Person` + `Course[]`) a vykreslí patičku v tématu **Carbon Performance**\r\npodle `footer_variant`:\r\n\r\n- `PREMIUM_CORE` — minimalistický podpis, luxusní typografie\r\n- `COMPETITIVE_ATTACK` — bento tabulka „skupinová motoškola vs 1 : 1 koučink\"\r\n- `DESTINATION_ESCAPE` — zážitkový blok Málaga / Andalusie\r\n\r\n## Instalace\r\n\r\n```bash\r\nbun add @danrubinmoto/crm-federated-engine\r\n```\r\n\r\nPřipoj CSS jednou v rootu satelitu (obsahuje Carbon tokeny a Tailwind\r\nutility používané komponentou):\r\n\r\n```ts\r\nimport \"@danrubinmoto/crm-federated-engine/style.css\";\r\n```\r\n\r\n## Použití\r\n\r\n```tsx\r\nimport {\r\n  CrmFederatedEngine,\r\n  type FederatedPayload,\r\n} from \"@danrubinmoto/crm-federated-engine\";\r\nimport { toast } from \"sonner\";\r\n\r\nconst STATIC_FALLBACK: FederatedPayload = {\r\n  site: {\r\n    id: \"static\",\r\n    name: \"individualnimotoskola.cz\",\r\n    url: \"individualnimotoskola.cz\",\r\n    default_locale: \"cs\",\r\n    currency: \"CZK\",\r\n    footer_variant: \"PREMIUM_CORE\",\r\n    interlink_targets: [\r\n      {\r\n        target_domain: \"danrubin.cz\",\r\n        anchor_text: \"osobní trénink motocyklů od Dana Rubína\",\r\n      },\r\n    ],\r\n    protected_content_hashes: [],\r\n  },\r\n  locale: \"cs\",\r\n  count: 0,\r\n  services: [],\r\n  seo_schema: null,\r\n};\r\n\r\nexport function SiteFooter() {\r\n  return (\r\n    <CrmFederatedEngine\r\n      site=\"individualnimotoskola.cz\"\r\n      staticFallback={STATIC_FALLBACK}\r\n      onNetworkFallback={(reason) =>\r\n        toast.warning(\r\n          reason === \"timeout\"\r\n            ? \"CRM neodpovídá do 4,5 s — používám lokální data.\"\r\n            : reason === \"network\"\r\n              ? \"Výpadek sítě — používám lokální data.\"\r\n              : \"Neplatná odpověď CRM — používám lokální data.\",\r\n        )\r\n      }\r\n    />\r\n  );\r\n}\r\n```\r\n\r\n## Chování\r\n\r\n| Stav | `source` | Poznámka |\r\n| --- | --- | --- |\r\n| Úspěšný fetch | `network` | Payload validován Zod schématem. |\r\n| Fetch selhal / timeout, cache existuje | `cache` | Prezentuje se poslední známý payload (i po TTL). |\r\n| Fetch selhal, cache neexistuje | `fallback` | Neměnný `staticFallback` z props. |\r\n\r\n- **Timeout**: `AbortController` 4500 ms (přepis `timeoutMs`).\r\n- **Cache**: `localStorage[\"crm_federation_cache\"]`, TTL 24 h (přepis `ttlMs` / `cacheKey`).\r\n- **Dev guard**: v `NODE_ENV=development` hashuje textový obsah `main` a při\r\n  shodě s `protected_content_hashes` z payloadu injektuje\r\n  `<link rel=\"canonical\" href=\"https://danrubin.cz\">`.\r\n- **Brand voice lint**: v dev módu loguje výskyt korporátního plurálu\r\n  („nabízíme\", „poskytujeme\", „od nás\", „naše motoškola\", „jsme\r\n  profesionál\").\r\n- **Tap-targety**: všechny odkazy patičky mají `min-h-11 min-w-11` pro\r\n  ovládání bříškem prstu v motorkářské rukavici (Z Fold 7 vnější displej).\r\n\r\n## Odkazy\r\n\r\n- Spec: [`docs/specs/archive/009-crm-federated-cross-domain-engine.md`](https://github.com/danrubinmoto/crm/blob/main/docs/specs/archive/009-crm-federated-cross-domain-engine.md)\r\n- Admin konfigurace: `https://app.danrubinmoto.com/settings/sites`","readmeFilename":"README.md","_rev":"1-757e753408b5105f02b67d94cbad6f87"}