@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,89 +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
|
-
|
|
31
|
-
export type ContentRefLayout = 'list' | 'grid'
|
|
32
|
-
|
|
33
|
-
/** Subset of `EntityCardSize` (entity-card dispatch) appropriate for
|
|
34
|
-
* grid/list rendering in RelatedContentSection. Duplicated as a literal
|
|
35
|
-
* union here to avoid a config→component import cycle. Kept in lockstep
|
|
36
|
-
* with `EntityCardSize`; widen here when a new size is added there. */
|
|
37
|
-
export type ContentRefGridSize = 'lg' | 'default' | 'sm'
|
|
38
|
-
|
|
39
|
-
export interface ContentRefGroupConfig {
|
|
40
|
-
label: string
|
|
41
|
-
order: number
|
|
42
|
-
layout: ContentRefLayout
|
|
43
|
-
gridSize: ContentRefGridSize
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export const CONTENT_REF_GROUPS: Record<string, ContentRefGroupConfig> = {
|
|
47
|
-
investor_update: { label: 'Investor Updates', order: 1, layout: 'grid', gridSize: 'default' },
|
|
48
|
-
product_release: { label: 'Product Releases', order: 2, layout: 'list', gridSize: 'lg' },
|
|
49
|
-
podcast: { label: 'Podcasts', order: 3, layout: 'list', gridSize: 'default' },
|
|
50
|
-
webinar: { label: 'Webinars', order: 4, layout: 'list', gridSize: 'default' },
|
|
51
|
-
case_study: { label: 'Case Studies', order: 5, layout: 'grid', gridSize: 'default' },
|
|
52
|
-
event: { label: 'Events', order: 6, layout: 'list', gridSize: 'default' },
|
|
53
|
-
blog_post_existing: { label: 'Blog Posts', order: 7, layout: 'grid', gridSize: 'default' },
|
|
54
|
-
customer_interview: { label: 'Customer Interviews', order: 8, layout: 'grid', gridSize: 'default' },
|
|
55
|
-
onboarding_guide: { label: 'Onboarding Guides', order: 9, layout: 'list', gridSize: 'default' },
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
/** Human-readable label for a content_ref `type`. Returns null when the type
|
|
59
|
-
* isn't registered — caller decides the fallback. Use `getContentRefLabelOrTitleCase`
|
|
60
|
-
* to get a consistent title-cased fallback across all surfaces. */
|
|
61
|
-
export function getContentRefLabel(type: string): string | null {
|
|
62
|
-
return CONTENT_REF_GROUPS[type]?.label ?? null
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
/** Resolved label with a single shared fallback shape — title-cased version
|
|
66
|
-
* of the raw type string for any unregistered type. Both RelatedContentSection
|
|
67
|
-
* AND the investor-email builder consume this so cross-surface label rendering
|
|
68
|
-
* for unregistered types is identical (no drift between "podcast guest" and
|
|
69
|
-
* "Podcast Guest"). */
|
|
70
|
-
export function getContentRefLabelOrTitleCase(type: string): string {
|
|
71
|
-
return (
|
|
72
|
-
CONTENT_REF_GROUPS[type]?.label ??
|
|
73
|
-
type.replace(/_/g, ' ').replace(/\b\w/g, (ch) => ch.toUpperCase())
|
|
74
|
-
)
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
/** Sort a set of present content_ref types into the canonical group order
|
|
78
|
-
* (registered types first in CONTENT_REF_GROUPS `order`, then unregistered
|
|
79
|
-
* types appended in insertion order). Used by RelatedContentSection AND the
|
|
80
|
-
* investor-email builder so cross-surface ordering stays identical. */
|
|
81
|
-
export function orderContentRefTypes(present: Iterable<string>): string[] {
|
|
82
|
-
const presentSet = new Set(present)
|
|
83
|
-
const registeredInOrder = Object.entries(CONTENT_REF_GROUPS)
|
|
84
|
-
.sort(([, a], [, b]) => a.order - b.order)
|
|
85
|
-
.map(([type]) => type)
|
|
86
|
-
.filter((type) => presentSet.has(type))
|
|
87
|
-
const unregistered = [...presentSet].filter((type) => !CONTENT_REF_GROUPS[type])
|
|
88
|
-
return [...registeredInOrder, ...unregistered]
|
|
89
|
-
}
|
|
@@ -1,48 +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
|
-
|
|
11
|
-
/** Extract the items array from each endpoint's response shape (some
|
|
12
|
-
* return `{ items }`, others `{ posts }`, etc.). Single normalization
|
|
13
|
-
* point — callers always read `Item[]`. */
|
|
14
|
-
export function extractItems(data: unknown): unknown[] {
|
|
15
|
-
if (!data || typeof data !== 'object') return []
|
|
16
|
-
const obj = data as Record<string, unknown>
|
|
17
|
-
if (Array.isArray(obj.items)) return obj.items
|
|
18
|
-
if (Array.isArray(obj.posts)) return obj.posts
|
|
19
|
-
if (Array.isArray(obj.campaigns)) return obj.campaigns
|
|
20
|
-
if (Array.isArray(obj.completed) || Array.isArray(obj.inProgress)) {
|
|
21
|
-
// Delivery endpoint splits into completed/inProgress arrays — flatten.
|
|
22
|
-
const completed = Array.isArray(obj.completed) ? obj.completed : []
|
|
23
|
-
const inProgress = Array.isArray(obj.inProgress) ? obj.inProgress : []
|
|
24
|
-
return [...completed, ...inProgress]
|
|
25
|
-
}
|
|
26
|
-
if (Array.isArray(obj.data)) return obj.data
|
|
27
|
-
if (Array.isArray(data)) return data
|
|
28
|
-
return []
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/** Extract a stable id from a fetched item — different shapes use
|
|
32
|
-
* `id` vs `external_id`. Used by the chat loader to match the fetched
|
|
33
|
-
* array element back to the marker's id. */
|
|
34
|
-
export function extractItemId(type: string, item: unknown): string | null {
|
|
35
|
-
if (!item || typeof item !== 'object') return null
|
|
36
|
-
const obj = item as Record<string, unknown>
|
|
37
|
-
if (type === 'roadmap_item' || type === 'delivery_item' || type === 'internal_task') {
|
|
38
|
-
const ext = obj.external_id
|
|
39
|
-
if (typeof ext === 'string') return ext
|
|
40
|
-
}
|
|
41
|
-
// RoadmapItem-shaped responses use `id` to carry the external_id; the
|
|
42
|
-
// mapper renames external_id→id at the API boundary. Treat both id and
|
|
43
|
-
// external_id as primary-key candidates for these clickup-backed types.
|
|
44
|
-
const id = obj.id
|
|
45
|
-
if (typeof id === 'string') return id
|
|
46
|
-
if (typeof id === 'number') return String(id)
|
|
47
|
-
return null
|
|
48
|
-
}
|
|
@@ -1,39 +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
|
-
|
|
26
|
-
export function buildSuggestionUrl(path: string, opts: SuggestionUrlOptions = {}): string {
|
|
27
|
-
const qs = new URLSearchParams()
|
|
28
|
-
const { entityType, entityId } = opts
|
|
29
|
-
if (entityType && entityId !== undefined && entityId !== null && entityId !== '') {
|
|
30
|
-
qs.set('entityType', entityType)
|
|
31
|
-
qs.set('entityId', String(entityId))
|
|
32
|
-
}
|
|
33
|
-
if (opts.count !== undefined) qs.set('count', String(opts.count))
|
|
34
|
-
for (const [key, value] of Object.entries(opts.extraParams ?? {})) {
|
|
35
|
-
if (value !== undefined && value !== '') qs.set(key, value)
|
|
36
|
-
}
|
|
37
|
-
const query = qs.toString()
|
|
38
|
-
return `${opts.apiBaseUrl ?? ''}${path}${query ? `?${query}` : ''}`
|
|
39
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|