@flamingo-stack/openframe-frontend-core 0.0.692 → 0.0.693-snapshot.20261002120603
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/chat-protocol/events.d.ts +3 -0
- package/dist/chat-protocol/events.d.ts.map +1 -1
- package/dist/chat-protocol/frames.d.ts +6 -0
- package/dist/chat-protocol/frames.d.ts.map +1 -1
- package/dist/chat-protocol/index.cjs +26 -1
- package/dist/chat-protocol/index.cjs.map +1 -1
- package/dist/chat-protocol/index.d.ts +1 -0
- package/dist/chat-protocol/index.d.ts.map +1 -1
- package/dist/chat-protocol/index.js +23 -2
- package/dist/chat-protocol/index.js.map +1 -1
- package/dist/chat-protocol/leading-frames.d.ts.map +1 -1
- package/dist/chat-protocol/progress.d.ts +35 -0
- package/dist/chat-protocol/progress.d.ts.map +1 -0
- package/dist/{chunk-GDZ7IC5B.js → chunk-234IIQIS.js} +2 -2
- package/dist/{chunk-KDCIYRZV.cjs → chunk-2EQED5SZ.cjs} +34 -34
- package/dist/{chunk-KDCIYRZV.cjs.map → chunk-2EQED5SZ.cjs.map} +1 -1
- package/dist/{chunk-JUNOY5HK.js → chunk-2HX6AADM.js} +15 -17
- package/dist/chunk-2HX6AADM.js.map +1 -0
- package/dist/{chunk-X5XFKI6N.js → chunk-33L2IR62.js} +3 -3
- package/dist/{chunk-A5NHAHV6.js → chunk-42LIHMRA.js} +4 -4
- package/dist/{chunk-MIZU2OTO.cjs → chunk-63BLVGXZ.cjs} +4 -4
- package/dist/{chunk-MIZU2OTO.cjs.map → chunk-63BLVGXZ.cjs.map} +1 -1
- package/dist/{chunk-TEIHEFXP.js → chunk-6ZSDKDOV.js} +8 -8
- package/dist/{chunk-UVUNBXS6.js → chunk-7IINE3MK.js} +48 -5
- package/dist/chunk-7IINE3MK.js.map +1 -0
- package/dist/{chunk-N3526CTH.cjs → chunk-7TO3CWPM.cjs} +3 -3
- package/dist/{chunk-N3526CTH.cjs.map → chunk-7TO3CWPM.cjs.map} +1 -1
- package/dist/{chunk-TXFGG47A.js → chunk-7VO6NC67.js} +4 -4
- package/dist/{chunk-SC44YJCF.js → chunk-A7RKT5SO.js} +2 -2
- package/dist/{chunk-Y7ZEVTLC.js → chunk-BW6YBATM.js} +141 -71
- package/dist/chunk-BW6YBATM.js.map +1 -0
- package/dist/{chunk-GZRU2A4L.cjs → chunk-C27F6GBZ.cjs} +790 -720
- package/dist/chunk-C27F6GBZ.cjs.map +1 -0
- package/dist/{chunk-DVSPRY2V.cjs → chunk-ESMDIJIN.cjs} +3 -3
- package/dist/{chunk-DVSPRY2V.cjs.map → chunk-ESMDIJIN.cjs.map} +1 -1
- package/dist/{chunk-EXWS2QSD.cjs → chunk-FNGX5WZM.cjs} +497 -474
- package/dist/chunk-FNGX5WZM.cjs.map +1 -0
- package/dist/{chunk-RK47E3PP.js → chunk-GWQCUC53.js} +4 -4
- package/dist/{chunk-AVAZ6BD6.js → chunk-HBMGSGZY.js} +6 -6
- package/dist/{chunk-HM7ZGABI.js → chunk-HEBLLLLD.js} +2 -2
- package/dist/{chunk-7BNWMOPM.cjs → chunk-HJZ3UTUE.cjs} +83 -83
- package/dist/{chunk-7BNWMOPM.cjs.map → chunk-HJZ3UTUE.cjs.map} +1 -1
- package/dist/{chunk-ATREVNIN.cjs → chunk-JB25CCOB.cjs} +47 -47
- package/dist/{chunk-ATREVNIN.cjs.map → chunk-JB25CCOB.cjs.map} +1 -1
- package/dist/{chunk-Q25VYAEL.cjs → chunk-JISKS7RJ.cjs} +26 -26
- package/dist/{chunk-Q25VYAEL.cjs.map → chunk-JISKS7RJ.cjs.map} +1 -1
- package/dist/{chunk-WTYQCT4A.cjs → chunk-K5GSLGV2.cjs} +18 -18
- package/dist/{chunk-WTYQCT4A.cjs.map → chunk-K5GSLGV2.cjs.map} +1 -1
- package/dist/{chunk-CG7OWW7X.cjs → chunk-K5K2FRQK.cjs} +19 -19
- package/dist/{chunk-CG7OWW7X.cjs.map → chunk-K5K2FRQK.cjs.map} +1 -1
- package/dist/{chunk-CKUPANVU.cjs → chunk-KBSL4FCL.cjs} +9 -9
- package/dist/{chunk-CKUPANVU.cjs.map → chunk-KBSL4FCL.cjs.map} +1 -1
- package/dist/{chunk-SDORFSFK.cjs → chunk-KDUDL4PB.cjs} +37 -37
- package/dist/{chunk-SDORFSFK.cjs.map → chunk-KDUDL4PB.cjs.map} +1 -1
- package/dist/{chunk-5XPK2QGU.cjs → chunk-KJHIFF6H.cjs} +16 -16
- package/dist/{chunk-5XPK2QGU.cjs.map → chunk-KJHIFF6H.cjs.map} +1 -1
- package/dist/{chunk-MCNQKS6I.js → chunk-LHYOESIQ.js} +4 -4
- package/dist/{chunk-DUURFYGS.cjs → chunk-LPFU6U7O.cjs} +5 -5
- package/dist/{chunk-DUURFYGS.cjs.map → chunk-LPFU6U7O.cjs.map} +1 -1
- package/dist/{chunk-ZAV2F4VX.js → chunk-N7HFUBOV.js} +3 -3
- package/dist/{chunk-53O6PQ3F.cjs → chunk-NDLFK57D.cjs} +7 -7
- package/dist/{chunk-53O6PQ3F.cjs.map → chunk-NDLFK57D.cjs.map} +1 -1
- package/dist/{chunk-Z7QCNCBN.js → chunk-O4RDXDVS.js} +12 -12
- package/dist/{chunk-F6LXGP6S.cjs → chunk-Q2B2MGFU.cjs} +7 -7
- package/dist/{chunk-F6LXGP6S.cjs.map → chunk-Q2B2MGFU.cjs.map} +1 -1
- package/dist/{chunk-CKO6NKNE.js → chunk-QP54LMXJ.js} +38 -15
- package/dist/{chunk-CKO6NKNE.js.map → chunk-QP54LMXJ.js.map} +1 -1
- package/dist/{chunk-QRA2JXE4.cjs → chunk-RE6PGOSS.cjs} +6 -8
- package/dist/chunk-RE6PGOSS.cjs.map +1 -0
- package/dist/{chunk-C2SVJVEB.js → chunk-SH5GPYSV.js} +2 -2
- package/dist/{chunk-KQZMM3QJ.cjs → chunk-SJFB4Z4L.cjs} +105 -105
- package/dist/{chunk-KQZMM3QJ.cjs.map → chunk-SJFB4Z4L.cjs.map} +1 -1
- package/dist/{chunk-7EPGJOKN.js → chunk-TA3JJFEO.js} +4 -4
- package/dist/{chunk-LYJJH4D6.js → chunk-TBR3UTFY.js} +6 -6
- package/dist/{chunk-USKQURNF.cjs → chunk-TG3VBMDG.cjs} +3 -3
- package/dist/{chunk-USKQURNF.cjs.map → chunk-TG3VBMDG.cjs.map} +1 -1
- package/dist/{chunk-IQTQIBZ3.js → chunk-TV5SZJ3N.js} +12 -12
- package/dist/{chunk-RLNNV46K.js → chunk-TXSQLORA.js} +6 -6
- package/dist/{chunk-LYQULSK4.js → chunk-UCXZRJIE.js} +7 -7
- package/dist/{chunk-I27PWVWE.cjs → chunk-WT4HURQN.cjs} +46 -3
- package/dist/chunk-WT4HURQN.cjs.map +1 -0
- package/dist/{chunk-XAOAYDGR.js → chunk-WZJWIZVH.js} +4 -4
- package/dist/{chunk-PKZGXRU2.js → chunk-XKNKGBUX.js} +10 -8
- package/dist/{chunk-PKZGXRU2.js.map → chunk-XKNKGBUX.js.map} +1 -1
- package/dist/{chunk-LNKLB7GM.cjs → chunk-XNTQHC26.cjs} +28 -28
- package/dist/{chunk-LNKLB7GM.cjs.map → chunk-XNTQHC26.cjs.map} +1 -1
- package/dist/{chunk-2YVTGPM7.js → chunk-XZILGCXJ.js} +2 -2
- package/dist/{chunk-DKJDO7YM.cjs → chunk-Y5AFMYYN.cjs} +46 -44
- package/dist/chunk-Y5AFMYYN.cjs.map +1 -0
- package/dist/{chunk-FTK3S57R.cjs → chunk-ZCPMWXIB.cjs} +25 -25
- package/dist/{chunk-FTK3S57R.cjs.map → chunk-ZCPMWXIB.cjs.map} +1 -1
- package/dist/{chunk-RTKF5AYA.cjs → chunk-ZUGAHQDB.cjs} +7 -7
- package/dist/{chunk-RTKF5AYA.cjs.map → chunk-ZUGAHQDB.cjs.map} +1 -1
- package/dist/components/case-studies/index.cjs +21 -21
- package/dist/components/case-studies/index.js +8 -8
- package/dist/components/chat/chat-message-list.d.ts.map +1 -1
- package/dist/components/chat/chat-typing-indicator.d.ts.map +1 -1
- package/dist/components/chat/cycling-phrase.d.ts.map +1 -1
- package/dist/components/chat/embeddable-chat.d.ts.map +1 -1
- package/dist/components/chat/hooks/use-sse-chat-adapter.d.ts.map +1 -1
- package/dist/components/chat/hooks/use-unified-chat.d.ts.map +1 -1
- package/dist/components/chat/index.cjs +5 -5
- package/dist/components/chat/index.js +4 -4
- package/dist/components/chat/stream/chat-dialog-store.d.ts.map +1 -1
- package/dist/components/chat/stream/chat-stream-reducer.d.ts +4 -0
- package/dist/components/chat/stream/chat-stream-reducer.d.ts.map +1 -1
- package/dist/components/chat/types/component.types.d.ts +2 -0
- package/dist/components/chat/types/component.types.d.ts.map +1 -1
- package/dist/components/chat/types/unified-chat-state.types.d.ts +5 -0
- package/dist/components/chat/types/unified-chat-state.types.d.ts.map +1 -1
- package/dist/components/contact/index.cjs +9 -9
- package/dist/components/contact/index.js +8 -8
- package/dist/components/docs/index.cjs +12 -12
- package/dist/components/docs/index.js +11 -11
- package/dist/components/embeds/index.cjs +9 -9
- package/dist/components/embeds/index.js +8 -8
- package/dist/components/faq/index.cjs +10 -10
- package/dist/components/faq/index.js +9 -9
- package/dist/components/features/index.cjs +8 -8
- package/dist/components/features/index.js +7 -7
- package/dist/components/help-center-pages/index.cjs +107 -107
- package/dist/components/help-center-pages/index.js +22 -22
- package/dist/components/index.cjs +69 -69
- package/dist/components/index.js +22 -22
- package/dist/components/meeting-scheduler/index.cjs +59 -59
- package/dist/components/meeting-scheduler/index.js +9 -9
- package/dist/components/navigation/app-layout-drawer.d.ts.map +1 -1
- package/dist/components/navigation/index.cjs +11 -11
- package/dist/components/navigation/index.js +10 -10
- package/dist/components/onboarding-guides/index.cjs +12 -12
- package/dist/components/onboarding-guides/index.js +11 -11
- package/dist/components/related-content/index.cjs +6 -6
- package/dist/components/related-content/index.js +5 -5
- package/dist/components/tickets/index.cjs +13 -13
- package/dist/components/tickets/index.js +12 -12
- package/dist/components/ui/index.cjs +8 -8
- package/dist/components/ui/index.js +7 -7
- package/dist/components/ui/markdown/engine.d.ts +0 -21
- package/dist/components/ui/markdown/engine.d.ts.map +1 -1
- package/dist/hooks/index.cjs +6 -6
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.js +5 -5
- package/dist/hooks/use-authed-asset-src.d.ts.map +1 -1
- package/dist/index.cjs +15 -15
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +12 -12
- package/dist/tailwind.config.cjs +14 -1
- package/dist/tailwind.config.cjs.map +1 -1
- package/dist/tailwind.config.js +14 -1
- package/dist/tailwind.config.js.map +1 -1
- package/eslint-config/README.md +13 -0
- package/eslint-config/base.js +15 -0
- package/eslint-config/webview-performance.js +75 -0
- package/package.json +1 -1
- package/src/chat-protocol/__tests__/progress.test.ts +39 -0
- package/src/chat-protocol/events.ts +3 -0
- package/src/chat-protocol/frames.ts +7 -0
- package/src/chat-protocol/index.ts +2 -0
- package/src/chat-protocol/leading-frames.ts +4 -1
- package/src/chat-protocol/progress.ts +55 -0
- package/src/components/chat/chat-message-enhanced.tsx +1 -1
- package/src/components/chat/chat-message-list.tsx +65 -15
- package/src/components/chat/chat-typing-indicator.tsx +18 -29
- package/src/components/chat/cycling-phrase.tsx +1 -11
- package/src/components/chat/embeddable-chat.tsx +14 -6
- package/src/components/chat/hooks/use-sse-chat-adapter.ts +2 -0
- package/src/components/chat/hooks/use-unified-chat.ts +1 -0
- package/src/components/chat/stream/__tests__/chat-stream-reducer-progress.test.ts +40 -0
- package/src/components/chat/stream/chat-dialog-store.ts +1 -0
- package/src/components/chat/stream/chat-stream-reducer.ts +13 -0
- package/src/components/chat/types/component.types.ts +2 -0
- package/src/components/chat/types/unified-chat-state.types.ts +6 -0
- package/src/components/navigation/app-layout-drawer.tsx +53 -7
- package/src/components/ui/__tests__/__snapshots__/markdown-parity.test.tsx.snap +29 -29
- package/src/components/ui/markdown/engine.tsx +56 -12
- package/src/hooks/use-authed-asset-src.ts +58 -6
- package/tailwind.config.ts +13 -0
- package/dist/chunk-DKJDO7YM.cjs.map +0 -1
- package/dist/chunk-EXWS2QSD.cjs.map +0 -1
- package/dist/chunk-GZRU2A4L.cjs.map +0 -1
- package/dist/chunk-I27PWVWE.cjs.map +0 -1
- package/dist/chunk-JUNOY5HK.js.map +0 -1
- package/dist/chunk-QRA2JXE4.cjs.map +0 -1
- package/dist/chunk-UVUNBXS6.js.map +0 -1
- package/dist/chunk-Y7ZEVTLC.js.map +0 -1
- /package/dist/{chunk-GDZ7IC5B.js.map → chunk-234IIQIS.js.map} +0 -0
- /package/dist/{chunk-X5XFKI6N.js.map → chunk-33L2IR62.js.map} +0 -0
- /package/dist/{chunk-A5NHAHV6.js.map → chunk-42LIHMRA.js.map} +0 -0
- /package/dist/{chunk-TEIHEFXP.js.map → chunk-6ZSDKDOV.js.map} +0 -0
- /package/dist/{chunk-TXFGG47A.js.map → chunk-7VO6NC67.js.map} +0 -0
- /package/dist/{chunk-SC44YJCF.js.map → chunk-A7RKT5SO.js.map} +0 -0
- /package/dist/{chunk-RK47E3PP.js.map → chunk-GWQCUC53.js.map} +0 -0
- /package/dist/{chunk-AVAZ6BD6.js.map → chunk-HBMGSGZY.js.map} +0 -0
- /package/dist/{chunk-HM7ZGABI.js.map → chunk-HEBLLLLD.js.map} +0 -0
- /package/dist/{chunk-MCNQKS6I.js.map → chunk-LHYOESIQ.js.map} +0 -0
- /package/dist/{chunk-ZAV2F4VX.js.map → chunk-N7HFUBOV.js.map} +0 -0
- /package/dist/{chunk-Z7QCNCBN.js.map → chunk-O4RDXDVS.js.map} +0 -0
- /package/dist/{chunk-C2SVJVEB.js.map → chunk-SH5GPYSV.js.map} +0 -0
- /package/dist/{chunk-7EPGJOKN.js.map → chunk-TA3JJFEO.js.map} +0 -0
- /package/dist/{chunk-LYJJH4D6.js.map → chunk-TBR3UTFY.js.map} +0 -0
- /package/dist/{chunk-IQTQIBZ3.js.map → chunk-TV5SZJ3N.js.map} +0 -0
- /package/dist/{chunk-RLNNV46K.js.map → chunk-TXSQLORA.js.map} +0 -0
- /package/dist/{chunk-LYQULSK4.js.map → chunk-UCXZRJIE.js.map} +0 -0
- /package/dist/{chunk-XAOAYDGR.js.map → chunk-WZJWIZVH.js.map} +0 -0
- /package/dist/{chunk-2YVTGPM7.js.map → chunk-XZILGCXJ.js.map} +0 -0
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
var _chunkJU6SBF3Ccjs = require('./chunk-JU6SBF3C.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunk63BLVGXZcjs = require('./chunk-63BLVGXZ.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
@@ -164,7 +164,7 @@ function UnifiedPagination({
|
|
|
164
164
|
if (syncUrl) {
|
|
165
165
|
const params = new URLSearchParams(searchParams.toString());
|
|
166
166
|
params.set("page", page.toString());
|
|
167
|
-
window.history.replaceState(null, "",
|
|
167
|
+
window.history.replaceState(null, "", _chunk63BLVGXZcjs.withQuery.call(void 0, pathname, params.toString()));
|
|
168
168
|
}
|
|
169
169
|
setTimeout(() => {
|
|
170
170
|
window.scrollTo({
|
|
@@ -185,4 +185,4 @@ function UnifiedPagination({
|
|
|
185
185
|
|
|
186
186
|
|
|
187
187
|
exports.EmptyState = EmptyState; exports.UnifiedPagination = UnifiedPagination;
|
|
188
|
-
//# sourceMappingURL=chunk-
|
|
188
|
+
//# sourceMappingURL=chunk-ESMDIJIN.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/openframe-oss-lib/openframe-oss-lib/openframe-frontend-core/dist/chunk-DVSPRY2V.cjs","../src/components/empty-state.tsx","../src/components/unified-pagination.tsx"],"names":["jsx"],"mappings":"AAAA,qFAAY;AACZ;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACA;AC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S,QAAA;AACC,UAAA;AACE,UAAA;AACV,QAAA;AACJ,IAAA;AACF,EAAA;AAEM,EAAA;AACA,EAAA;AACA,EAAA;AAKW,EAAA;AAGX,EAAA;AAGJ,EAAA;AAEE,oBAAA;AASA,oBAAA;AAGA,oBAAA;AAGY,IAAA;AASC,IAAA;AASM,IAAA;AAEd,MAAA;AAAA,MAAA;AACU,QAAA;AACD,QAAA;AACE,QAAA;AAET,QAAA;AAAA,MAAA;AAEL,IAAA;AAEJ,EAAA;AAEJ;ADrEsB;AACA;AEzEZA;AAjDM;AACd,EAAA;AACA,EAAA;AACA,EAAA;AACY,EAAA;AACF,EAAA;AACK,EAAA;AACU;AACnB,EAAA;AACW,EAAA;AAEX,EAAA;AAEE,IAAA;AAGY,IAAA;AACH,MAAA;AACf,IAAA;AAKa,IAAA;AACI,MAAA;AACJ,MAAA;AACI,MAAA;AACjB,IAAA;AAGiB,IAAA;AACC,MAAA;AACT,QAAA;AACK,QAAA;AAAA;AACX,MAAA;AACC,IAAA;AACN,EAAA;AASkB,EAAA;AACT,IAAA;AAMH,IAAA;AACN,EAAA;AAGE,EAAA;AAIJ;AFkGsB;AACA;AACA;AACA;AACA","file":"/home/runner/work/openframe-oss-lib/openframe-oss-lib/openframe-frontend-core/dist/chunk-DVSPRY2V.cjs","sourcesContent":[null,"'use client';\n\nimport { Search, FileText, Package } from 'lucide-react';\nimport { useRouter } from '../embed-shims/next-navigation';\nimport { Button } from './ui/button';\n\nexport interface EmptyStateProps {\n type: 'vendors' | 'posts' | 'search' | 'generic';\n title?: string;\n description?: string;\n showBackButton?: boolean;\n onGoBack?: () => void;\n backButtonText?: string;\n // New CTA properties\n showCTA?: boolean;\n ctaText?: string;\n onCtaClick?: () => void;\n /**\n * Link-CTA mode: render the CTA as a navigation link (`href` — plain or\n * `mailto:`). Wins over `onCtaClick`, and SHORT-CIRCUITS the smart-CTA\n * path-sniffing below (which reads `window.location.pathname` — an\n * SSR/client divergence server-rendered pages must never enter).\n */\n ctaHref?: string;\n ctaVariant?: 'primary' | 'secondary';\n}\n\nexport function EmptyState({\n type,\n title,\n description,\n showBackButton = false,\n onGoBack,\n backButtonText = 'Go Back',\n showCTA = true,\n ctaText,\n onCtaClick,\n ctaHref,\n ctaVariant = 'primary',\n}: EmptyStateProps) {\n const router = useRouter();\n\n // Default content based on type\n const getDefaultContent = () => {\n switch (type) {\n case 'vendors':\n return {\n icon: <Package className=\"h-full w-full\" />,\n title: 'No vendors found',\n description:\n \"We couldn't find any vendors matching your criteria. Try adjusting your filters or search terms.\",\n };\n case 'posts':\n return {\n icon: <FileText className=\"h-full w-full\" />,\n title: 'No articles found',\n description:\n \"We couldn't find any articles matching your criteria. Try different categories, tags, or search terms.\",\n };\n case 'search':\n return {\n icon: <Search className=\"h-full w-full\" />,\n title: 'No results found',\n description: \"Your search didn't return any results. Try different keywords or browse our categories.\",\n };\n default:\n return {\n icon: <Search className=\"h-full w-full\" />,\n title: 'Nothing found',\n description: \"We couldn't find what you're looking for. Try adjusting your search or filters.\",\n };\n }\n };\n\n // Smart CTA logic based on context\n const getSmartCTA = () => {\n // If custom CTA is provided, use it\n if (ctaText && onCtaClick) {\n return {\n text: ctaText,\n action: onCtaClick,\n };\n }\n\n // Check if we're on the client side\n const isClient = typeof window !== 'undefined';\n const currentPath = isClient ? window.location.pathname : '';\n\n // Surgical filter reset (promoted from the hub's diverged clone during\n // the EmptyState convergence): delete ONLY the filter params the surface\n // owns — nuking the whole query string threw away unrelated state — and\n // use `replace` with `scroll: false` so resetting filters neither adds a\n // history entry nor jumps the page.\n const resetParams = (paramsToDelete: string[]) => {\n if (!isClient) return;\n const params = new URLSearchParams(window.location.search);\n for (const p of paramsToDelete) params.delete(p);\n const queryString = params.toString();\n // Keep the hash — a filter reset must not clear an unrelated\n // deep-link anchor (e.g. #delivery-123).\n const hash = window.location.hash;\n router.replace(`${window.location.pathname}${queryString ? `?${queryString}` : ''}${hash}`, { scroll: false });\n };\n\n // Smart defaults based on type and context\n switch (type) {\n case 'search':\n return {\n text: 'Reset Filters',\n action: () => resetParams(['search', 'page']),\n };\n case 'posts':\n // Blog-style listing pages (blog, case studies) reset their filters\n if (currentPath.includes('/blog') || currentPath.includes('/case-studies')) {\n return {\n text: 'Reset Filters',\n action: () => resetParams(['search', 'page', 'category', 'tags']),\n };\n } else if (currentPath.includes('/profile')) {\n return {\n text: 'Browse Vendors',\n action: () => router.push('/vendors'),\n };\n }\n return {\n text: 'View All Posts',\n action: () => router.push('/blog'),\n };\n case 'vendors':\n // If we're in profile or other pages, direct to main content\n if (currentPath.includes('/profile')) {\n return {\n text: 'Browse Vendors',\n action: () => router.push('/vendors'),\n };\n } else if (currentPath.includes('/vendors') || currentPath.includes('/margin-increase/compare')) {\n return {\n text: 'Reset Filters',\n action: () => resetParams(['search', 'page', 'category', 'subcategory']),\n };\n }\n return {\n text: 'Browse Vendors',\n action: () => router.push('/vendors'),\n };\n default:\n return {\n text: 'Browse Vendors',\n action: () => router.push('/vendors'),\n };\n }\n };\n\n const defaultContent = getDefaultContent();\n const displayTitle = title || defaultContent.title;\n const displayDescription = description || defaultContent.description;\n // ctaHref short-circuits BEFORE getSmartCTA(): the smart defaults read\n // window.location.pathname (SSR-empty, client-real), so a server-rendered\n // page with a link CTA must never enter that branch. Existing callers\n // without ctaHref keep today's smart-default behavior unchanged.\n const smartCTA = ctaHref ? null : getSmartCTA();\n // The CTA is the house Button in its own variant: painting colours over the\n // default accent Button with classes lost to its hover (green text on green).\n const ctaButtonVariant = ctaVariant === 'primary' ? 'accent' : 'outline';\n\n return (\n <div className=\"flex flex-col items-center justify-center px-6 py-6 text-center md:py-16\">\n {/* Icon */}\n <div className=\"mb-3 flex items-center justify-center md:mb-6\">\n <div className=\"rounded-full border border-ods-border bg-ods-card p-3 md:p-6\">\n <div className=\"flex h-8 w-8 items-center justify-center text-ods-text-secondary md:h-16 md:w-16\">\n {defaultContent.icon}\n </div>\n </div>\n </div>\n\n {/* Title */}\n <h2 className=\"mb-2 text-ods-text-primary text-h3 md:mb-3\">{displayTitle}</h2>\n\n {/* Description */}\n <p className=\"mb-4 max-w-md text-ods-text-secondary text-h6 md:mb-8\">{displayDescription}</p>\n\n {/* Link CTA (ctaHref) — SSR-safe, no path sniffing */}\n {showCTA && ctaHref && (\n <div className=\"mb-3 w-full max-w-xs\">\n <Button href={ctaHref} variant={ctaButtonVariant} className=\"w-full\">\n {ctaText || 'Contact us'}\n </Button>\n </div>\n )}\n\n {/* Smart CTA Button */}\n {showCTA && !ctaHref && smartCTA && (\n <div className=\"mb-3 w-full max-w-xs\">\n <Button onClick={smartCTA.action} variant={ctaButtonVariant} className=\"w-full\">\n {smartCTA.text}\n </Button>\n </div>\n )}\n\n {/* Optional Back Button */}\n {showBackButton && onGoBack && (\n <div className=\"w-full max-w-xs\">\n <Button\n onClick={onGoBack}\n variant=\"outline\"\n className=\"w-full font-body font-medium transition-all duration-150\"\n >\n {backButtonText}\n </Button>\n </div>\n )}\n </div>\n );\n}\n","'use client';\n\nimport { useSearchParams, usePathname } from '../embed-shims/next-navigation';\nimport { withQuery } from '../utils/search-params';\nimport { Pagination } from './pagination';\n\ninterface UnifiedPaginationProps {\n currentPage: number;\n totalPages: number;\n onPageChange?: (page: number) => void;\n className?: string;\n /**\n * Write `?page=` into the URL on every change (default true, the historical\n * behaviour). Set false when the CALLER owns the URL — a surface whose whole\n * filter state is one schema would otherwise get two writers racing on it.\n */\n syncUrl?: boolean;\n /**\n * Keep the row's height when there is only one page, instead of rendering\n * nothing. Stops a one-page result from shifting the content above it.\n */\n reserveSpace?: boolean;\n}\n\nexport function UnifiedPagination({\n currentPage,\n totalPages,\n onPageChange,\n className = 'mt-8 flex justify-center w-full',\n syncUrl = true,\n reserveSpace = false,\n}: UnifiedPaginationProps) {\n const searchParams = useSearchParams();\n const pathname = usePathname();\n\n const handlePageChange = (page: number) => {\n // Preserve current scroll position\n const currentScrollY = window.scrollY;\n\n // Call the callback to update local state (prevents reload)\n if (onPageChange) {\n onPageChange(page);\n }\n\n // Update URL for bookmarking without navigation — unless the caller owns\n // the URL (`syncUrl={false}`), in which case a second writer here would\n // race the caller's own param write.\n if (syncUrl) {\n const params = new URLSearchParams(searchParams.toString());\n params.set('page', page.toString());\n window.history.replaceState(null, '', withQuery(pathname, params.toString()));\n }\n\n // Restore scroll position after a brief delay to allow content to render\n setTimeout(() => {\n window.scrollTo({\n top: currentScrollY,\n behavior: 'instant', // Instant to prevent any scroll animation\n });\n }, 0);\n };\n\n // Don't render pagination if there's only one page (optionally holding the\n // row's height so the content above it does not shift).\n //\n // The reserved row renders the REAL control, hidden — an empty div reserves\n // nothing, and a hardcoded spacer height silently drifts the day the control\n // changes. `invisible` keeps the box, `aria-hidden` + `pointer-events-none`\n // keep it out of the accessibility tree and out of the way.\n if (totalPages <= 1) {\n return reserveSpace ? (\n <div className={className} aria-hidden=\"true\">\n <div className=\"pointer-events-none invisible\">\n <Pagination currentPage={1} totalPages={1} onPageChange={() => {}} />\n </div>\n </div>\n ) : null;\n }\n\n return (\n <div className={className}>\n <Pagination currentPage={currentPage} totalPages={totalPages} onPageChange={handlePageChange} />\n </div>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/openframe-oss-lib/openframe-oss-lib/openframe-frontend-core/dist/chunk-ESMDIJIN.cjs","../src/components/empty-state.tsx","../src/components/unified-pagination.tsx"],"names":["jsx"],"mappings":"AAAA,qFAAY;AACZ;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACA;ACdA,2CAA0C;AA6C1B,+CAAA;AApBT,SAAS,UAAA,CAAW;AAAA,EACzB,IAAA;AAAA,EACA,KAAA;AAAA,EACA,WAAA;AAAA,EACA,eAAA,EAAiB,KAAA;AAAA,EACjB,QAAA;AAAA,EACA,eAAA,EAAiB,SAAA;AAAA,EACjB,QAAA,EAAU,IAAA;AAAA,EACV,OAAA;AAAA,EACA,UA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AACD,QAAA;AACE,QAAA;AAET,QAAA;AAAA,MAAA;AAEL,IAAA;AAEJ,EAAA;AAEJ;ADrEsB;AACA;AEzEZA;AAjDM;AACd,EAAA;AACA,EAAA;AACA,EAAA;AACY,EAAA;AACF,EAAA;AACK,EAAA;AACU;AACnB,EAAA;AACW,EAAA;AAEX,EAAA;AAEE,IAAA;AAGY,IAAA;AACH,MAAA;AACf,IAAA;AAKa,IAAA;AACI,MAAA;AACJ,MAAA;AACI,MAAA;AACjB,IAAA;AAGiB,IAAA;AACC,MAAA;AACT,QAAA;AACK,QAAA;AAAA;AACX,MAAA;AACC,IAAA;AACN,EAAA;AASkB,EAAA;AACT,IAAA;AAMH,IAAA;AACN,EAAA;AAGE,EAAA;AAIJ;AFkGsB;AACA;AACA;AACA;AACA","file":"/home/runner/work/openframe-oss-lib/openframe-oss-lib/openframe-frontend-core/dist/chunk-ESMDIJIN.cjs","sourcesContent":[null,"'use client';\n\nimport { Search, FileText, Package } from 'lucide-react';\nimport { useRouter } from '../embed-shims/next-navigation';\nimport { Button } from './ui/button';\n\nexport interface EmptyStateProps {\n type: 'vendors' | 'posts' | 'search' | 'generic';\n title?: string;\n description?: string;\n showBackButton?: boolean;\n onGoBack?: () => void;\n backButtonText?: string;\n // New CTA properties\n showCTA?: boolean;\n ctaText?: string;\n onCtaClick?: () => void;\n /**\n * Link-CTA mode: render the CTA as a navigation link (`href` — plain or\n * `mailto:`). Wins over `onCtaClick`, and SHORT-CIRCUITS the smart-CTA\n * path-sniffing below (which reads `window.location.pathname` — an\n * SSR/client divergence server-rendered pages must never enter).\n */\n ctaHref?: string;\n ctaVariant?: 'primary' | 'secondary';\n}\n\nexport function EmptyState({\n type,\n title,\n description,\n showBackButton = false,\n onGoBack,\n backButtonText = 'Go Back',\n showCTA = true,\n ctaText,\n onCtaClick,\n ctaHref,\n ctaVariant = 'primary',\n}: EmptyStateProps) {\n const router = useRouter();\n\n // Default content based on type\n const getDefaultContent = () => {\n switch (type) {\n case 'vendors':\n return {\n icon: <Package className=\"h-full w-full\" />,\n title: 'No vendors found',\n description:\n \"We couldn't find any vendors matching your criteria. Try adjusting your filters or search terms.\",\n };\n case 'posts':\n return {\n icon: <FileText className=\"h-full w-full\" />,\n title: 'No articles found',\n description:\n \"We couldn't find any articles matching your criteria. Try different categories, tags, or search terms.\",\n };\n case 'search':\n return {\n icon: <Search className=\"h-full w-full\" />,\n title: 'No results found',\n description: \"Your search didn't return any results. Try different keywords or browse our categories.\",\n };\n default:\n return {\n icon: <Search className=\"h-full w-full\" />,\n title: 'Nothing found',\n description: \"We couldn't find what you're looking for. Try adjusting your search or filters.\",\n };\n }\n };\n\n // Smart CTA logic based on context\n const getSmartCTA = () => {\n // If custom CTA is provided, use it\n if (ctaText && onCtaClick) {\n return {\n text: ctaText,\n action: onCtaClick,\n };\n }\n\n // Check if we're on the client side\n const isClient = typeof window !== 'undefined';\n const currentPath = isClient ? window.location.pathname : '';\n\n // Surgical filter reset (promoted from the hub's diverged clone during\n // the EmptyState convergence): delete ONLY the filter params the surface\n // owns — nuking the whole query string threw away unrelated state — and\n // use `replace` with `scroll: false` so resetting filters neither adds a\n // history entry nor jumps the page.\n const resetParams = (paramsToDelete: string[]) => {\n if (!isClient) return;\n const params = new URLSearchParams(window.location.search);\n for (const p of paramsToDelete) params.delete(p);\n const queryString = params.toString();\n // Keep the hash — a filter reset must not clear an unrelated\n // deep-link anchor (e.g. #delivery-123).\n const hash = window.location.hash;\n router.replace(`${window.location.pathname}${queryString ? `?${queryString}` : ''}${hash}`, { scroll: false });\n };\n\n // Smart defaults based on type and context\n switch (type) {\n case 'search':\n return {\n text: 'Reset Filters',\n action: () => resetParams(['search', 'page']),\n };\n case 'posts':\n // Blog-style listing pages (blog, case studies) reset their filters\n if (currentPath.includes('/blog') || currentPath.includes('/case-studies')) {\n return {\n text: 'Reset Filters',\n action: () => resetParams(['search', 'page', 'category', 'tags']),\n };\n } else if (currentPath.includes('/profile')) {\n return {\n text: 'Browse Vendors',\n action: () => router.push('/vendors'),\n };\n }\n return {\n text: 'View All Posts',\n action: () => router.push('/blog'),\n };\n case 'vendors':\n // If we're in profile or other pages, direct to main content\n if (currentPath.includes('/profile')) {\n return {\n text: 'Browse Vendors',\n action: () => router.push('/vendors'),\n };\n } else if (currentPath.includes('/vendors') || currentPath.includes('/margin-increase/compare')) {\n return {\n text: 'Reset Filters',\n action: () => resetParams(['search', 'page', 'category', 'subcategory']),\n };\n }\n return {\n text: 'Browse Vendors',\n action: () => router.push('/vendors'),\n };\n default:\n return {\n text: 'Browse Vendors',\n action: () => router.push('/vendors'),\n };\n }\n };\n\n const defaultContent = getDefaultContent();\n const displayTitle = title || defaultContent.title;\n const displayDescription = description || defaultContent.description;\n // ctaHref short-circuits BEFORE getSmartCTA(): the smart defaults read\n // window.location.pathname (SSR-empty, client-real), so a server-rendered\n // page with a link CTA must never enter that branch. Existing callers\n // without ctaHref keep today's smart-default behavior unchanged.\n const smartCTA = ctaHref ? null : getSmartCTA();\n // The CTA is the house Button in its own variant: painting colours over the\n // default accent Button with classes lost to its hover (green text on green).\n const ctaButtonVariant = ctaVariant === 'primary' ? 'accent' : 'outline';\n\n return (\n <div className=\"flex flex-col items-center justify-center px-6 py-6 text-center md:py-16\">\n {/* Icon */}\n <div className=\"mb-3 flex items-center justify-center md:mb-6\">\n <div className=\"rounded-full border border-ods-border bg-ods-card p-3 md:p-6\">\n <div className=\"flex h-8 w-8 items-center justify-center text-ods-text-secondary md:h-16 md:w-16\">\n {defaultContent.icon}\n </div>\n </div>\n </div>\n\n {/* Title */}\n <h2 className=\"mb-2 text-ods-text-primary text-h3 md:mb-3\">{displayTitle}</h2>\n\n {/* Description */}\n <p className=\"mb-4 max-w-md text-ods-text-secondary text-h6 md:mb-8\">{displayDescription}</p>\n\n {/* Link CTA (ctaHref) — SSR-safe, no path sniffing */}\n {showCTA && ctaHref && (\n <div className=\"mb-3 w-full max-w-xs\">\n <Button href={ctaHref} variant={ctaButtonVariant} className=\"w-full\">\n {ctaText || 'Contact us'}\n </Button>\n </div>\n )}\n\n {/* Smart CTA Button */}\n {showCTA && !ctaHref && smartCTA && (\n <div className=\"mb-3 w-full max-w-xs\">\n <Button onClick={smartCTA.action} variant={ctaButtonVariant} className=\"w-full\">\n {smartCTA.text}\n </Button>\n </div>\n )}\n\n {/* Optional Back Button */}\n {showBackButton && onGoBack && (\n <div className=\"w-full max-w-xs\">\n <Button\n onClick={onGoBack}\n variant=\"outline\"\n className=\"w-full font-body font-medium transition-all duration-150\"\n >\n {backButtonText}\n </Button>\n </div>\n )}\n </div>\n );\n}\n","'use client';\n\nimport { useSearchParams, usePathname } from '../embed-shims/next-navigation';\nimport { withQuery } from '../utils/search-params';\nimport { Pagination } from './pagination';\n\ninterface UnifiedPaginationProps {\n currentPage: number;\n totalPages: number;\n onPageChange?: (page: number) => void;\n className?: string;\n /**\n * Write `?page=` into the URL on every change (default true, the historical\n * behaviour). Set false when the CALLER owns the URL — a surface whose whole\n * filter state is one schema would otherwise get two writers racing on it.\n */\n syncUrl?: boolean;\n /**\n * Keep the row's height when there is only one page, instead of rendering\n * nothing. Stops a one-page result from shifting the content above it.\n */\n reserveSpace?: boolean;\n}\n\nexport function UnifiedPagination({\n currentPage,\n totalPages,\n onPageChange,\n className = 'mt-8 flex justify-center w-full',\n syncUrl = true,\n reserveSpace = false,\n}: UnifiedPaginationProps) {\n const searchParams = useSearchParams();\n const pathname = usePathname();\n\n const handlePageChange = (page: number) => {\n // Preserve current scroll position\n const currentScrollY = window.scrollY;\n\n // Call the callback to update local state (prevents reload)\n if (onPageChange) {\n onPageChange(page);\n }\n\n // Update URL for bookmarking without navigation — unless the caller owns\n // the URL (`syncUrl={false}`), in which case a second writer here would\n // race the caller's own param write.\n if (syncUrl) {\n const params = new URLSearchParams(searchParams.toString());\n params.set('page', page.toString());\n window.history.replaceState(null, '', withQuery(pathname, params.toString()));\n }\n\n // Restore scroll position after a brief delay to allow content to render\n setTimeout(() => {\n window.scrollTo({\n top: currentScrollY,\n behavior: 'instant', // Instant to prevent any scroll animation\n });\n }, 0);\n };\n\n // Don't render pagination if there's only one page (optionally holding the\n // row's height so the content above it does not shift).\n //\n // The reserved row renders the REAL control, hidden — an empty div reserves\n // nothing, and a hardcoded spacer height silently drifts the day the control\n // changes. `invisible` keeps the box, `aria-hidden` + `pointer-events-none`\n // keep it out of the accessibility tree and out of the way.\n if (totalPages <= 1) {\n return reserveSpace ? (\n <div className={className} aria-hidden=\"true\">\n <div className=\"pointer-events-none invisible\">\n <Pagination currentPage={1} totalPages={1} onPageChange={() => {}} />\n </div>\n </div>\n ) : null;\n }\n\n return (\n <div className={className}>\n <Pagination currentPage={currentPage} totalPages={totalPages} onPageChange={handlePageChange} />\n </div>\n );\n}\n"]}
|