@flamingo-stack/openframe-frontend-core 0.0.243 → 0.0.244
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/{chunk-MKVKVJQQ.js → chunk-APGMNHPY.js} +19 -32
- package/dist/chunk-APGMNHPY.js.map +1 -0
- package/dist/{chunk-3TDLFCCS.cjs → chunk-DV3YZWGN.cjs} +20 -33
- package/dist/chunk-DV3YZWGN.cjs.map +1 -0
- package/dist/{chunk-BKPS6M2F.cjs → chunk-EJ7J4QAD.cjs} +12 -12
- package/dist/{chunk-BKPS6M2F.cjs.map → chunk-EJ7J4QAD.cjs.map} +1 -1
- package/dist/{chunk-CZITXP77.cjs → chunk-EPXROXYC.cjs} +713 -645
- package/dist/chunk-EPXROXYC.cjs.map +1 -0
- package/dist/{chunk-SGJBUL2Y.cjs → chunk-FSS2MIEA.cjs} +3 -20
- package/dist/chunk-FSS2MIEA.cjs.map +1 -0
- package/dist/{chunk-VAUI3CND.js → chunk-LJGBFD52.js} +1 -18
- package/dist/chunk-LJGBFD52.js.map +1 -0
- package/dist/{chunk-FRRMXLU5.js → chunk-M7DPUWAL.js} +188 -120
- package/dist/chunk-M7DPUWAL.js.map +1 -0
- package/dist/{chunk-SEVJT2HP.js → chunk-NKGNRFSS.js} +8 -8
- package/dist/{chunk-VFKQMAUF.cjs → chunk-OB45JHDY.cjs} +3 -3
- package/dist/{chunk-VFKQMAUF.cjs.map → chunk-OB45JHDY.cjs.map} +1 -1
- package/dist/{chunk-4XLJWX2N.js → chunk-ORJREQ2W.js} +4 -4
- package/dist/{chunk-7ZHFCEJH.js → chunk-P5C732SC.js} +6 -6
- package/dist/{chunk-JJV3XGCY.js → chunk-PTSAF7T2.js} +2 -2
- package/dist/{chunk-VXP553WT.cjs → chunk-RJC3L5DT.cjs} +7 -7
- package/dist/{chunk-VXP553WT.cjs.map → chunk-RJC3L5DT.cjs.map} +1 -1
- package/dist/{chunk-MP5HOP7N.cjs → chunk-STKMIMLP.cjs} +12 -12
- package/dist/{chunk-MP5HOP7N.cjs.map → chunk-STKMIMLP.cjs.map} +1 -1
- package/dist/{chunk-V35PZSUA.js → chunk-WD2MZVJI.js} +5 -5
- package/dist/{chunk-DUZBTUXF.cjs → chunk-Z6GGYZDR.cjs} +27 -27
- package/dist/{chunk-DUZBTUXF.cjs.map → chunk-Z6GGYZDR.cjs.map} +1 -1
- package/dist/components/chat/chat-message-list.d.ts.map +1 -1
- package/dist/components/chat/hooks/use-chat-card-item.d.ts.map +1 -1
- package/dist/components/chat/index.cjs +16 -6
- package/dist/components/chat/index.cjs.map +1 -1
- package/dist/components/chat/index.js +15 -5
- package/dist/components/chat/types/entities/content-ref.d.ts +20 -5
- package/dist/components/chat/types/entities/content-ref.d.ts.map +1 -1
- package/dist/components/chat/utils/history-merge.d.ts +92 -0
- package/dist/components/chat/utils/history-merge.d.ts.map +1 -0
- package/dist/components/chat/utils/index.d.ts +1 -0
- package/dist/components/chat/utils/index.d.ts.map +1 -1
- package/dist/components/contact/index.cjs +7 -7
- package/dist/components/contact/index.js +6 -6
- package/dist/components/faq/faq-section.d.ts +1 -7
- package/dist/components/faq/faq-section.d.ts.map +1 -1
- package/dist/components/faq/index.cjs +3 -3
- package/dist/components/faq/index.js +2 -2
- package/dist/components/features/index.cjs +6 -6
- package/dist/components/features/index.js +5 -5
- package/dist/components/features/policy-configuration-panel.d.ts.map +1 -1
- package/dist/components/index.cjs +93 -87
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.d.ts +0 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +37 -31
- package/dist/components/index.js.map +1 -1
- package/dist/components/navigation/index.cjs +6 -6
- package/dist/components/navigation/index.js +5 -5
- package/dist/components/onboarding-guides/index.cjs +30 -30
- package/dist/components/onboarding-guides/index.cjs.map +1 -1
- package/dist/components/onboarding-guides/index.js +11 -11
- package/dist/components/tickets/index.cjs +73 -73
- package/dist/components/tickets/index.cjs.map +1 -1
- package/dist/components/tickets/index.js +15 -15
- package/dist/components/ui/index.cjs +19 -9
- package/dist/components/ui/index.cjs.map +1 -1
- package/dist/components/ui/index.js +23 -13
- package/dist/embed-shims/index.cjs +3 -3
- package/dist/embed-shims/index.cjs.map +1 -1
- package/dist/embed-shims/index.js +5 -5
- package/dist/index.cjs +11 -17
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +49 -55
- package/dist/types/index.d.ts +0 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/utils/index.cjs +0 -81
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.d.ts +1 -4
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -74
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/list-url.d.ts +0 -6
- package/dist/utils/list-url.d.ts.map +1 -1
- package/package.json +1 -7
- package/src/components/chat/__tests__/chat-message-list.test.tsx +92 -0
- package/src/components/chat/chat-message-list.tsx +74 -49
- package/src/components/chat/hooks/use-chat-card-item.ts +38 -3
- package/src/components/chat/types/entities/content-ref.ts +21 -5
- package/src/components/chat/utils/__tests__/history-merge.test.ts +339 -0
- package/src/components/chat/utils/history-merge.ts +255 -0
- package/src/components/chat/utils/index.ts +12 -0
- package/src/components/faq/faq-section.tsx +24 -69
- package/src/components/features/policy-configuration-panel.tsx +1 -0
- package/src/components/index.ts +0 -1
- package/src/types/index.ts +0 -1
- package/src/utils/index.ts +1 -16
- package/src/utils/list-url.ts +0 -9
- package/dist/chunk-3TDLFCCS.cjs.map +0 -1
- package/dist/chunk-CZITXP77.cjs.map +0 -1
- package/dist/chunk-F3GMWNAT.js +0 -285
- package/dist/chunk-F3GMWNAT.js.map +0 -1
- package/dist/chunk-FRRMXLU5.js.map +0 -1
- package/dist/chunk-HU252PYJ.cjs +0 -285
- package/dist/chunk-HU252PYJ.cjs.map +0 -1
- package/dist/chunk-MKVKVJQQ.js.map +0 -1
- package/dist/chunk-SGJBUL2Y.cjs.map +0 -1
- package/dist/chunk-VAUI3CND.js.map +0 -1
- package/dist/components/related-content/index.cjs +0 -26
- package/dist/components/related-content/index.cjs.map +0 -1
- package/dist/components/related-content/index.d.ts +0 -2
- package/dist/components/related-content/index.d.ts.map +0 -1
- package/dist/components/related-content/index.js +0 -26
- package/dist/components/related-content/index.js.map +0 -1
- package/dist/components/related-content/related-content-section.d.ts +0 -141
- package/dist/components/related-content/related-content-section.d.ts.map +0 -1
- package/dist/types/content-ref.d.ts +0 -35
- package/dist/types/content-ref.d.ts.map +0 -1
- package/dist/utils/content-ref-groups.d.ts +0 -58
- package/dist/utils/content-ref-groups.d.ts.map +0 -1
- package/dist/utils/extract-items.d.ts +0 -18
- package/dist/utils/extract-items.d.ts.map +0 -1
- package/dist/utils/suggestion-url.d.ts +0 -26
- package/dist/utils/suggestion-url.d.ts.map +0 -1
- package/src/components/related-content/index.ts +0 -9
- package/src/components/related-content/related-content-section.tsx +0 -612
- package/src/types/content-ref.ts +0 -34
- package/src/utils/content-ref-groups.ts +0 -89
- package/src/utils/extract-items.ts +0 -48
- package/src/utils/suggestion-url.ts +0 -39
- /package/dist/{chunk-SEVJT2HP.js.map → chunk-NKGNRFSS.js.map} +0 -0
- /package/dist/{chunk-4XLJWX2N.js.map → chunk-ORJREQ2W.js.map} +0 -0
- /package/dist/{chunk-7ZHFCEJH.js.map → chunk-P5C732SC.js.map} +0 -0
- /package/dist/{chunk-JJV3XGCY.js.map → chunk-PTSAF7T2.js.map} +0 -0
- /package/dist/{chunk-V35PZSUA.js.map → chunk-WD2MZVJI.js.map} +0 -0
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* RelatedContentSection
|
|
3
|
-
*
|
|
4
|
-
* Renders content references grouped by type using the canonical card
|
|
5
|
-
* components. MOVED from the hub (`components/shared/related-content-card.tsx`)
|
|
6
|
-
* so any consuming app can embed it; the hub keeps a thin wrapper that
|
|
7
|
-
* pre-binds its host-specific injections (nav hook, URL recomposition,
|
|
8
|
-
* program configs, admin campaign card).
|
|
9
|
-
*
|
|
10
|
-
* THREE data modes (precedence top-down):
|
|
11
|
-
* 1. CONTROLLED — `contentRefs` provided (even `[]`): render exactly those
|
|
12
|
-
* refs, no suggestion fetch (the original investor-update behavior).
|
|
13
|
-
* 2. SUGGESTION — `entityType` + `entityId` provided: self-fetch
|
|
14
|
-
* `GET {apiBaseUrl}/api/related-content?entityType&entityId[&count][&excludeTypes]`
|
|
15
|
-
* (the generic 5-tier engine's second web service). `minResults` maps to
|
|
16
|
-
* `count`; absent → param not sent (server default applies). Each ref
|
|
17
|
-
* carries a `reason` (data-only — never rendered, matching the
|
|
18
|
-
* FaqSection/FaqWithReason precedent).
|
|
19
|
-
* 3. SSR-HYDRATED suggestion — also pass `initialItems` (the server page
|
|
20
|
-
* called the engine directly); the first client fetch is skipped per the
|
|
21
|
-
* `useSelfFetch` initialData contract.
|
|
22
|
-
*
|
|
23
|
-
* Group layout (list vs grid) + card size (lg vs default) come from
|
|
24
|
-
* `CONTENT_REF_GROUPS` in `../../utils/content-ref-groups` — single source of
|
|
25
|
-
* truth, no per-type logic in this file. Skeletons come from
|
|
26
|
-
* `renderSkeletonForType` so the placeholder height matches the loaded card
|
|
27
|
-
* exactly (zero layout shift on resolve).
|
|
28
|
-
*
|
|
29
|
-
* One API call per content type via the shared list-URL builder
|
|
30
|
-
* (`buildListUrl` — injectable; defaults to the lib's byte-parity-tested
|
|
31
|
-
* builder prefixed with `apiBaseUrl`). Fetching uses `useSelfFetch` (plain
|
|
32
|
-
* fetch, NO react-query) so third-party embedders need no QueryClientProvider;
|
|
33
|
-
* cards are imported via DEEP module paths (not the chat barrel) so this
|
|
34
|
-
* chunk never reaches `@tanstack/react-query`.
|
|
35
|
-
*
|
|
36
|
-
* LOCKSTEP NOTE: this file's per-type card/skeleton dispatch is the SIZED
|
|
37
|
-
* sibling of the chat-side `CHAT_CARD_REGISTRY` (`../chat/entity-cards/
|
|
38
|
-
* dispatch.tsx`), which renders compact `size='sm'` cards wired to the chat
|
|
39
|
-
* runtime. Two dispatchers by design — when registering a new fetch-mode
|
|
40
|
-
* content type, add it BOTH there and here (cards + skeleton + list URL).
|
|
41
|
-
*/
|
|
42
|
-
import React from 'react';
|
|
43
|
-
import type { ContentRef, ContentRefWithReason } from '../../types/content-ref';
|
|
44
|
-
import type { ChatCardDispatchExtras } from '../chat/entity-cards/dispatch';
|
|
45
|
-
/** Anchor prop bundle the per-card link surface receives — same shape the
|
|
46
|
-
* hub's `useNavLink` returns and the chat dispatcher's anchor builders
|
|
47
|
-
* produce. `null` = non-anchor mode (no URL). */
|
|
48
|
-
export interface CardLinkAnchorProps {
|
|
49
|
-
href: string;
|
|
50
|
-
target?: '_blank';
|
|
51
|
-
rel?: 'noopener noreferrer';
|
|
52
|
-
onClick?: (e: React.MouseEvent<HTMLAnchorElement>) => void;
|
|
53
|
-
}
|
|
54
|
-
/** Render-prop component injection for the navigation decision — keeps hook
|
|
55
|
-
* calls legal (hooks live INSIDE the injected component; `CardForType`
|
|
56
|
-
* itself calls zero hooks). The hub injects a `useNavLink`-backed provider;
|
|
57
|
-
* the default is hook-free (pure `decideNewTab`). MUST be defined at module
|
|
58
|
-
* scope by hosts — an inline arrow would remount every card each render. */
|
|
59
|
-
export interface CardLinkProviderProps {
|
|
60
|
-
href: string | null;
|
|
61
|
-
targetPlatform: string | null;
|
|
62
|
-
children: (linkProps: CardLinkAnchorProps | null) => React.ReactElement | null;
|
|
63
|
-
}
|
|
64
|
-
export type CardLinkProvider = React.ComponentType<CardLinkProviderProps>;
|
|
65
|
-
/** Host-injected renderer pair for the admin-only `marketing_campaign` type.
|
|
66
|
-
* Absent (every non-hub embed) → the type renders nothing (its list URL
|
|
67
|
-
* hits `/api/admin`, unreachable outside the hub anyway). */
|
|
68
|
-
export interface AdminCampaignCardSlot {
|
|
69
|
-
Card: React.ComponentType<{
|
|
70
|
-
campaign: any;
|
|
71
|
-
}>;
|
|
72
|
-
Skeleton: React.ComponentType<{
|
|
73
|
-
size?: 'default' | 'sm';
|
|
74
|
-
}>;
|
|
75
|
-
}
|
|
76
|
-
export interface RelatedContentSectionProps {
|
|
77
|
-
/** CONTROLLED mode (the original behavior). When defined — even `[]` — no
|
|
78
|
-
* suggestion fetch runs and exactly these refs render. */
|
|
79
|
-
contentRefs?: ContentRef[];
|
|
80
|
-
/** SUGGESTION mode (with `entityId`): self-fetch suggestions for this host
|
|
81
|
-
* entity from `{apiBaseUrl}/api/related-content`. Ignored when
|
|
82
|
-
* `contentRefs` is provided. */
|
|
83
|
-
entityType?: string;
|
|
84
|
-
entityId?: number | string;
|
|
85
|
-
/** Maps to the suggestion API's `count` param — the PER-TYPE fill target
|
|
86
|
-
* for every candidate type EXCEPT the host's own. Absent → param not sent
|
|
87
|
-
* (server default applies). */
|
|
88
|
-
minResults?: number;
|
|
89
|
-
/** Maps to the suggestion API's `sameTypeCount` param — the budget for the
|
|
90
|
-
* candidate type MATCHING the host's own `entityType` (same-type boost:
|
|
91
|
-
* a blog post's rail leads with more blog posts). Absent → param not
|
|
92
|
-
* sent (host's type uses the server's `count`). */
|
|
93
|
-
sameTypeMinResults?: number;
|
|
94
|
-
/** SSR hydrate for suggestion mode — the server page ran the engine and
|
|
95
|
-
* drills the refs here; the first client fetch is skipped (useSelfFetch
|
|
96
|
-
* initialData contract). */
|
|
97
|
-
initialItems?: ContentRefWithReason[];
|
|
98
|
-
/** Section title (default: "Related Content") */
|
|
99
|
-
title?: string;
|
|
100
|
-
/**
|
|
101
|
-
* Grid columns at desktop. 2 = denser cards / wider summary (original
|
|
102
|
-
* investor-update layout); 3 = more cards per row for dashboards.
|
|
103
|
-
* Only consulted for grid-layout groups. Default: 2.
|
|
104
|
-
*/
|
|
105
|
-
columns?: 2 | 3;
|
|
106
|
-
/**
|
|
107
|
-
* ContentRef.type values to exclude. Honored in ALL modes — controlled
|
|
108
|
-
* mode post-filters (original behavior); suggestion mode ALSO forwards the
|
|
109
|
-
* list verbatim as the API's `excludeTypes=` param so excluded types never
|
|
110
|
-
* consume engine fill slots (`minResults` stays honored). The subtraction
|
|
111
|
-
* happens SERVER-side — this component never mirrors the hub's candidate
|
|
112
|
-
* list.
|
|
113
|
-
*/
|
|
114
|
-
excludeTypes?: string[];
|
|
115
|
-
/** Fetch-URL prefix for third-party embeds / reverse proxies
|
|
116
|
-
* ('' = same-origin). Applied to BOTH the suggestion fetch and the
|
|
117
|
-
* default per-group list fetches. */
|
|
118
|
-
apiBaseUrl?: string;
|
|
119
|
-
/** Host injection bundle — REUSES the chat dispatcher's
|
|
120
|
-
* `ChatCardDispatchExtras` (programConfigs, buildOgPlaceholderUrl,
|
|
121
|
-
* buildProductReleaseCardProps override). Program groups render nothing
|
|
122
|
-
* when their config is absent. */
|
|
123
|
-
extras?: ChatCardDispatchExtras;
|
|
124
|
-
/** Hub injects its `buildContentURL` recomposition; default uses the
|
|
125
|
-
* ref's stored `url`/`targetPlatform` as the API composed them. */
|
|
126
|
-
resolveHref?: (ref: ContentRef) => {
|
|
127
|
-
href: string | null;
|
|
128
|
-
targetPlatform: string | null;
|
|
129
|
-
};
|
|
130
|
-
/** Hub injects its registry-driven entity-list-api builder; default = the
|
|
131
|
-
* lib's `buildListUrl(type, ids, apiBaseUrl)`. */
|
|
132
|
-
buildListUrl?: (type: string, ids: string[]) => string | null;
|
|
133
|
-
/** Hub injects a `useNavLink`-backed render-prop provider; default = pure
|
|
134
|
-
* anchor via `decideNewTab`. MUST be a module-scope component. */
|
|
135
|
-
LinkProvider?: CardLinkProvider;
|
|
136
|
-
/** Renderer pair for the admin-only `marketing_campaign` type. Absent →
|
|
137
|
-
* the type renders nothing. */
|
|
138
|
-
adminCampaignCard?: AdminCampaignCardSlot;
|
|
139
|
-
}
|
|
140
|
-
export declare function RelatedContentSection({ contentRefs, entityType, entityId, minResults, sameTypeMinResults, initialItems, title, columns, excludeTypes, apiBaseUrl, extras, resolveHref, buildListUrl, LinkProvider, adminCampaignCard, }: RelatedContentSectionProps): React.JSX.Element | null;
|
|
141
|
-
//# sourceMappingURL=related-content-section.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"related-content-section.d.ts","sourceRoot":"","sources":["../../../src/components/related-content/related-content-section.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAEH,OAAO,KAAkB,MAAM,OAAO,CAAC;AAOvC,OAAO,KAAK,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAuBhF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAI5E;;kDAEkD;AAClD,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,QAAQ,CAAC;IAClB,GAAG,CAAC,EAAE,qBAAqB,CAAC;IAC5B,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;CAC5D;AAED;;;;6EAI6E;AAC7E,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,QAAQ,EAAE,CAAC,SAAS,EAAE,mBAAmB,GAAG,IAAI,KAAK,KAAK,CAAC,YAAY,GAAG,IAAI,CAAC;CAChF;AACD,MAAM,MAAM,gBAAgB,GAAG,KAAK,CAAC,aAAa,CAAC,qBAAqB,CAAC,CAAC;AAuB1E;;8DAE8D;AAC9D,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,KAAK,CAAC,aAAa,CAAC;QAAE,QAAQ,EAAE,GAAG,CAAA;KAAE,CAAC,CAAC;IAC7C,QAAQ,EAAE,KAAK,CAAC,aAAa,CAAC;QAAE,IAAI,CAAC,EAAE,SAAS,GAAG,IAAI,CAAA;KAAE,CAAC,CAAC;CAC5D;AA4TD,MAAM,WAAW,0BAA0B;IACzC;+DAC2D;IAC3D,WAAW,CAAC,EAAE,UAAU,EAAE,CAAC;IAC3B;;qCAEiC;IACjC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B;;oCAEgC;IAChC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;wDAGoD;IACpD,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;iCAE6B;IAC7B,YAAY,CAAC,EAAE,oBAAoB,EAAE,CAAC;IACtC,iDAAiD;IACjD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,OAAO,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;IAChB;;;;;;;OAOG;IACH,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB;;0CAEsC;IACtC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;uCAGmC;IACnC,MAAM,CAAC,EAAE,sBAAsB,CAAC;IAChC;wEACoE;IACpE,WAAW,CAAC,EAAE,CAAC,GAAG,EAAE,UAAU,KAAK;QAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,cAAc,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAC;IAC1F;uDACmD;IACnD,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,MAAM,GAAG,IAAI,CAAC;IAC9D;uEACmE;IACnE,YAAY,CAAC,EAAE,gBAAgB,CAAC;IAChC;oCACgC;IAChC,iBAAiB,CAAC,EAAE,qBAAqB,CAAC;CAC3C;AAED,wBAAgB,qBAAqB,CAAC,EACpC,WAAW,EACX,UAAU,EACV,QAAQ,EACR,UAAU,EACV,kBAAkB,EAClB,YAAY,EACZ,KAAyB,EACzB,OAAW,EACX,YAAY,EACZ,UAAe,EACf,MAAM,EACN,WAAgC,EAChC,YAAY,EACZ,YAAuC,EACvC,iBAAiB,GAClB,EAAE,0BAA0B,4BA0F5B"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ContentRef — the unified link/embed shape stored in JSONB columns
|
|
3
|
-
* across investor updates, performance baselines, and any other entity
|
|
4
|
-
* that surfaces "related content" rails.
|
|
5
|
-
*
|
|
6
|
-
* Lifted from `lib/data/investor-update-utils-shared.ts` in the hub
|
|
7
|
-
* (the server-side data utils in the same file stay hub-side; only the
|
|
8
|
-
* TYPE moves here). RELOCATED from `components/chat/types/entities/`
|
|
9
|
-
* to this server-safe home when `RelatedContentSection` moved into the
|
|
10
|
-
* lib — the chat path re-exports from here, so there is exactly ONE
|
|
11
|
-
* `ContentRef` definition package-wide.
|
|
12
|
-
*/
|
|
13
|
-
export interface ContentRef {
|
|
14
|
-
type: string;
|
|
15
|
-
id: string;
|
|
16
|
-
slug: string;
|
|
17
|
-
url: string;
|
|
18
|
-
targetPlatform?: string | null;
|
|
19
|
-
title: string;
|
|
20
|
-
summary?: string;
|
|
21
|
-
image_url?: string;
|
|
22
|
-
image_bg_color?: string;
|
|
23
|
-
visibility: 'public' | 'internal';
|
|
24
|
-
display_order: number;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* A ContentRef as returned by the suggestion service (`/api/related-content`)
|
|
28
|
-
* — carries the 5-tier engine's placement reason. Widened to `string` here
|
|
29
|
-
* (the narrow reason union is hub-server vocabulary); data-only, never
|
|
30
|
-
* rendered by the rail.
|
|
31
|
-
*/
|
|
32
|
-
export type ContentRefWithReason = ContentRef & {
|
|
33
|
-
reason: string;
|
|
34
|
-
};
|
|
35
|
-
//# sourceMappingURL=content-ref.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content-ref.d.ts","sourceRoot":"","sources":["../../src/types/content-ref.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,EAAE,QAAQ,GAAG,UAAU,CAAC;IAClC,aAAa,EAAE,MAAM,CAAC;CACvB;AAED;;;;;GAKG;AACH,MAAM,MAAM,oBAAoB,GAAG,UAAU,GAAG;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC"}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Content Ref Group Configuration
|
|
3
|
-
*
|
|
4
|
-
* Single source of truth for grouping content_refs by type. Used by both:
|
|
5
|
-
* - components/related-content (detail page rail — lives in this lib)
|
|
6
|
-
* - the hub's lib/utils/investor-email-utils.ts (email builder, via the
|
|
7
|
-
* hub's re-export shim at lib/config/content-ref-groups.ts)
|
|
8
|
-
*
|
|
9
|
-
* Lives in utils/ (server-safe tsup block) so hub server-side code can
|
|
10
|
-
* import it.
|
|
11
|
-
*
|
|
12
|
-
* Each entry carries the metadata RelatedContentSection needs to render the
|
|
13
|
-
* group WITHOUT re-implementing per-type logic locally:
|
|
14
|
-
* - `label`: section heading.
|
|
15
|
-
* - `order`: source-stable ordering (lowest first).
|
|
16
|
-
* - `layout`: 'list' (one-per-row, full-width cards) or 'grid' (responsive
|
|
17
|
-
* column grid).
|
|
18
|
-
* - `gridSize`: card-size variant passed to the per-type card dispatch.
|
|
19
|
-
* `'lg'` matches the canonical large-card variant openframe + flamingo
|
|
20
|
-
* apps already use; `'default'` is the legacy denser variant. New types
|
|
21
|
-
* should pick `'lg'` whenever the card has a large variant.
|
|
22
|
-
*
|
|
23
|
-
* Adding a new content type = one entry here. RelatedContentSection picks up
|
|
24
|
-
* the new group automatically (no hardcoded set to update). NOTE: the hub's
|
|
25
|
-
* related-content SUGGESTION candidate list is DERIVED from these keys (minus
|
|
26
|
-
* an explicit exclusion knob) — a new entry here becomes a suggestion
|
|
27
|
-
* candidate iff it also resolves through the hub's TYPE_TO_ENTITY → RAG
|
|
28
|
-
* config chain (unresolvable entries are dropped loudly at module load).
|
|
29
|
-
*/
|
|
30
|
-
export type ContentRefLayout = 'list' | 'grid';
|
|
31
|
-
/** Subset of `EntityCardSize` (entity-card dispatch) appropriate for
|
|
32
|
-
* grid/list rendering in RelatedContentSection. Duplicated as a literal
|
|
33
|
-
* union here to avoid a config→component import cycle. Kept in lockstep
|
|
34
|
-
* with `EntityCardSize`; widen here when a new size is added there. */
|
|
35
|
-
export type ContentRefGridSize = 'lg' | 'default' | 'sm';
|
|
36
|
-
export interface ContentRefGroupConfig {
|
|
37
|
-
label: string;
|
|
38
|
-
order: number;
|
|
39
|
-
layout: ContentRefLayout;
|
|
40
|
-
gridSize: ContentRefGridSize;
|
|
41
|
-
}
|
|
42
|
-
export declare const CONTENT_REF_GROUPS: Record<string, ContentRefGroupConfig>;
|
|
43
|
-
/** Human-readable label for a content_ref `type`. Returns null when the type
|
|
44
|
-
* isn't registered — caller decides the fallback. Use `getContentRefLabelOrTitleCase`
|
|
45
|
-
* to get a consistent title-cased fallback across all surfaces. */
|
|
46
|
-
export declare function getContentRefLabel(type: string): string | null;
|
|
47
|
-
/** Resolved label with a single shared fallback shape — title-cased version
|
|
48
|
-
* of the raw type string for any unregistered type. Both RelatedContentSection
|
|
49
|
-
* AND the investor-email builder consume this so cross-surface label rendering
|
|
50
|
-
* for unregistered types is identical (no drift between "podcast guest" and
|
|
51
|
-
* "Podcast Guest"). */
|
|
52
|
-
export declare function getContentRefLabelOrTitleCase(type: string): string;
|
|
53
|
-
/** Sort a set of present content_ref types into the canonical group order
|
|
54
|
-
* (registered types first in CONTENT_REF_GROUPS `order`, then unregistered
|
|
55
|
-
* types appended in insertion order). Used by RelatedContentSection AND the
|
|
56
|
-
* investor-email builder so cross-surface ordering stays identical. */
|
|
57
|
-
export declare function orderContentRefTypes(present: Iterable<string>): string[];
|
|
58
|
-
//# sourceMappingURL=content-ref-groups.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content-ref-groups.d.ts","sourceRoot":"","sources":["../../src/utils/content-ref-groups.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,MAAM,CAAA;AAE9C;;;wEAGwE;AACxE,MAAM,MAAM,kBAAkB,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI,CAAA;AAExD,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,gBAAgB,CAAA;IACxB,QAAQ,EAAE,kBAAkB,CAAA;CAC7B;AAED,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAUpE,CAAA;AAED;;oEAEoE;AACpE,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAE9D;AAED;;;;wBAIwB;AACxB,wBAAgB,6BAA6B,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAKlE;AAED;;;wEAGwE;AACxE,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,MAAM,EAAE,CAQxE"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* List-API response normalizers — HOISTED from
|
|
3
|
-
* `components/chat/hooks/use-chat-card-item.ts` (private copies) so the
|
|
4
|
-
* related-content rail can import them WITHOUT touching the chat hooks
|
|
5
|
-
* chunk (which reaches `@tanstack/react-query`). Pure + server-safe.
|
|
6
|
-
*
|
|
7
|
-
* The hub's `lib/utils/entity-list-api.ts` re-exports these — one
|
|
8
|
-
* implementation of response-shape normalization across both repos.
|
|
9
|
-
*/
|
|
10
|
-
/** Extract the items array from each endpoint's response shape (some
|
|
11
|
-
* return `{ items }`, others `{ posts }`, etc.). Single normalization
|
|
12
|
-
* point — callers always read `Item[]`. */
|
|
13
|
-
export declare function extractItems(data: unknown): unknown[];
|
|
14
|
-
/** Extract a stable id from a fetched item — different shapes use
|
|
15
|
-
* `id` vs `external_id`. Used by the chat loader to match the fetched
|
|
16
|
-
* array element back to the marker's id. */
|
|
17
|
-
export declare function extractItemId(type: string, item: unknown): string | null;
|
|
18
|
-
//# sourceMappingURL=extract-items.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"extract-items.d.ts","sourceRoot":"","sources":["../../src/utils/extract-items.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;4CAE4C;AAC5C,wBAAgB,YAAY,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,EAAE,CAerD;AAED;;6CAE6C;AAC7C,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAcxE"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared fetch-URL composer for the two suggestion sections (FaqSection +
|
|
3
|
-
* RelatedContentSection) — ONE owner of the entityType/entityId/count query
|
|
4
|
-
* shape so the sections can never drift. Pure + server-safe.
|
|
5
|
-
*
|
|
6
|
-
* Byte-parity contract with the original `buildFaqsUrl`: when only
|
|
7
|
-
* entityType/entityId are set, the param order is `entityType`, `entityId`;
|
|
8
|
-
* with nothing set, the bare `path` is returned (no `?`).
|
|
9
|
-
*/
|
|
10
|
-
export interface SuggestionUrlOptions {
|
|
11
|
-
/** Fetch-URL prefix for third-party embeds / reverse proxies
|
|
12
|
-
* ('' = same-origin relative). */
|
|
13
|
-
apiBaseUrl?: string;
|
|
14
|
-
/** Both required together for entity scope; partial → bare path. */
|
|
15
|
-
entityType?: string;
|
|
16
|
-
entityId?: number | string;
|
|
17
|
-
/** Maps to the server's `count` param. Undefined → param not sent
|
|
18
|
-
* (server default applies). */
|
|
19
|
-
count?: number;
|
|
20
|
-
/** Extra query params appended after the shared trio (e.g. the
|
|
21
|
-
* related-content `excludeTypes` deny-list). Empty/undefined values
|
|
22
|
-
* are skipped. */
|
|
23
|
-
extraParams?: Record<string, string | undefined>;
|
|
24
|
-
}
|
|
25
|
-
export declare function buildSuggestionUrl(path: string, opts?: SuggestionUrlOptions): string;
|
|
26
|
-
//# sourceMappingURL=suggestion-url.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"suggestion-url.d.ts","sourceRoot":"","sources":["../../src/utils/suggestion-url.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,WAAW,oBAAoB;IACnC;uCACmC;IACnC,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,oEAAoE;IACpE,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAC1B;oCACgC;IAChC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;uBAEmB;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAA;CACjD;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,oBAAyB,GAAG,MAAM,CAaxF"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
// CLIENT subpath barrel — `@flamingo-stack/openframe-frontend-core/components/related-content`
|
|
2
|
-
export {
|
|
3
|
-
RelatedContentSection,
|
|
4
|
-
type RelatedContentSectionProps,
|
|
5
|
-
type CardLinkProvider,
|
|
6
|
-
type CardLinkProviderProps,
|
|
7
|
-
type CardLinkAnchorProps,
|
|
8
|
-
type AdminCampaignCardSlot,
|
|
9
|
-
} from './related-content-section'
|