@flamingo-stack/openframe-frontend-core 0.0.239 → 0.0.240
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-36G2QXYZ.cjs → chunk-3TDLFCCS.cjs} +37 -23
- package/dist/chunk-3TDLFCCS.cjs.map +1 -0
- package/dist/{chunk-ORJREQ2W.js → chunk-4XLJWX2N.js} +4 -4
- package/dist/{chunk-SZ3BBI6H.cjs → chunk-5JTDFOYB.cjs} +12 -12
- package/dist/{chunk-SZ3BBI6H.cjs.map → chunk-5JTDFOYB.cjs.map} +1 -1
- package/dist/{chunk-G6YZ7O27.js → chunk-7BWJF43J.js} +6 -6
- package/dist/{chunk-7LLS3TWN.js → chunk-B3NI3KT4.js} +5 -5
- package/dist/{chunk-MTROCWO4.cjs → chunk-CDLMGHSB.cjs} +7 -7
- package/dist/{chunk-MTROCWO4.cjs.map → chunk-CDLMGHSB.cjs.map} +1 -1
- package/dist/{chunk-JDQY7JCV.js → chunk-MKVKVJQQ.js} +36 -22
- package/dist/chunk-MKVKVJQQ.js.map +1 -0
- package/dist/{chunk-5VU66BD2.cjs → chunk-NE2DYD6K.cjs} +494 -461
- package/dist/chunk-NE2DYD6K.cjs.map +1 -0
- package/dist/chunk-POZHDJSK.js +276 -0
- package/dist/chunk-POZHDJSK.js.map +1 -0
- package/dist/{chunk-FSS2MIEA.cjs → chunk-SGJBUL2Y.cjs} +20 -3
- package/dist/chunk-SGJBUL2Y.cjs.map +1 -0
- package/dist/{chunk-IJOJWBME.cjs → chunk-SI4LEFLR.cjs} +27 -27
- package/dist/{chunk-IJOJWBME.cjs.map → chunk-SI4LEFLR.cjs.map} +1 -1
- package/dist/chunk-TE6LSK2X.cjs +276 -0
- package/dist/chunk-TE6LSK2X.cjs.map +1 -0
- package/dist/{chunk-LJGBFD52.js → chunk-VAUI3CND.js} +18 -1
- package/dist/chunk-VAUI3CND.js.map +1 -0
- package/dist/{chunk-OB45JHDY.cjs → chunk-VFKQMAUF.cjs} +3 -3
- package/dist/{chunk-OB45JHDY.cjs.map → chunk-VFKQMAUF.cjs.map} +1 -1
- package/dist/{chunk-Y6463TD6.js → chunk-XWUA273B.js} +2 -2
- package/dist/{chunk-Y7DCQUNL.js → chunk-YH6KPNIH.js} +87 -54
- package/dist/chunk-YH6KPNIH.js.map +1 -0
- package/dist/{chunk-ELMYRGWG.cjs → chunk-YY6S4T67.cjs} +12 -12
- package/dist/{chunk-ELMYRGWG.cjs.map → chunk-YY6S4T67.cjs.map} +1 -1
- package/dist/{chunk-PN64LWNT.js → chunk-ZYPOIFBS.js} +8 -8
- package/dist/components/chat/hooks/use-chat-card-item.d.ts.map +1 -1
- package/dist/components/chat/index.cjs +6 -6
- package/dist/components/chat/index.js +5 -5
- package/dist/components/chat/types/entities/content-ref.d.ts +5 -20
- package/dist/components/chat/types/entities/content-ref.d.ts.map +1 -1
- package/dist/components/chevron-button.d.ts +3 -1
- package/dist/components/chevron-button.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 +8 -2
- 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/faq/json-ld.cjs +1 -1
- package/dist/components/faq/json-ld.cjs.map +1 -1
- package/dist/components/faq/{faq-json-ld.d.ts → json-ld.d.ts} +1 -1
- package/dist/components/faq/json-ld.d.ts.map +1 -0
- package/dist/components/faq/json-ld.js +1 -1
- package/dist/components/faq/json-ld.js.map +1 -1
- package/dist/components/faq-accordion.d.ts.map +1 -1
- package/dist/components/features/index.cjs +6 -6
- package/dist/components/features/index.js +5 -5
- package/dist/components/index.cjs +89 -85
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +31 -27
- 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/related-content/index.cjs +26 -0
- package/dist/components/related-content/index.cjs.map +1 -0
- package/dist/components/related-content/index.d.ts +2 -0
- package/dist/components/related-content/index.d.ts.map +1 -0
- package/dist/components/related-content/index.js +26 -0
- package/dist/components/related-content/index.js.map +1 -0
- package/dist/components/related-content/related-content-section.d.ts +135 -0
- package/dist/components/related-content/related-content-section.d.ts.map +1 -0
- 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 +11 -11
- package/dist/components/ui/index.cjs.map +1 -1
- package/dist/components/ui/index.js +13 -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 +25 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +53 -39
- package/dist/types/content-ref.d.ts +35 -0
- package/dist/types/content-ref.d.ts.map +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/utils/content-ref-groups.d.ts +58 -0
- package/dist/utils/content-ref-groups.d.ts.map +1 -0
- package/dist/utils/extract-items.d.ts +18 -0
- package/dist/utils/extract-items.d.ts.map +1 -0
- package/dist/utils/index.cjs +77 -0
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +71 -1
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/suggestion-url.d.ts +26 -0
- package/dist/utils/suggestion-url.d.ts.map +1 -0
- package/package.json +7 -1
- package/src/components/chat/hooks/use-chat-card-item.ts +3 -38
- package/src/components/chat/types/entities/content-ref.ts +5 -21
- package/src/components/chevron-button.tsx +5 -1
- package/src/components/faq/faq-section.tsx +71 -26
- package/src/components/faq-accordion.tsx +2 -1
- package/src/components/index.ts +1 -0
- package/src/components/related-content/index.ts +9 -0
- package/src/components/related-content/related-content-section.tsx +585 -0
- package/src/types/content-ref.ts +34 -0
- package/src/types/index.ts +1 -0
- package/src/utils/content-ref-groups.ts +89 -0
- package/src/utils/extract-items.ts +48 -0
- package/src/utils/index.ts +15 -0
- package/src/utils/suggestion-url.ts +39 -0
- package/dist/chunk-36G2QXYZ.cjs.map +0 -1
- package/dist/chunk-5VU66BD2.cjs.map +0 -1
- package/dist/chunk-FSS2MIEA.cjs.map +0 -1
- package/dist/chunk-JDQY7JCV.js.map +0 -1
- package/dist/chunk-LJGBFD52.js.map +0 -1
- package/dist/chunk-Y7DCQUNL.js.map +0 -1
- package/dist/components/faq/faq-json-ld.d.ts.map +0 -1
- /package/dist/{chunk-ORJREQ2W.js.map → chunk-4XLJWX2N.js.map} +0 -0
- /package/dist/{chunk-G6YZ7O27.js.map → chunk-7BWJF43J.js.map} +0 -0
- /package/dist/{chunk-7LLS3TWN.js.map → chunk-B3NI3KT4.js.map} +0 -0
- /package/dist/{chunk-Y6463TD6.js.map → chunk-XWUA273B.js.map} +0 -0
- /package/dist/{chunk-PN64LWNT.js.map → chunk-ZYPOIFBS.js.map} +0 -0
- /package/src/components/faq/{faq-json-ld.ts → json-ld.ts} +0 -0
package/dist/types/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAIA,cAAc,gBAAgB,CAAA;AAC9B,YAAY,EAAE,QAAQ,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAA;AACtF,cAAc,YAAY,CAAA;AAC1B,cAAc,SAAS,CAAA;AACvB,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,IAAI,gBAAgB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAGjK,cAAc,YAAY,CAAA;AAG1B,cAAc,QAAQ,CAAA;AAGtB,cAAc,QAAQ,CAAA;AACtB,cAAc,cAAc,CAAA;AAC5B,cAAc,sBAAsB,CAAA;AACpC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,QAAQ,CAAA;AACtB,cAAc,mBAAmB,CAAA;AACjC,cAAc,YAAY,CAAA;AAC1B,cAAc,UAAU,CAAA;AACxB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,oBAAoB,CAAA;AAGlC,cAAc,YAAY,CAAA;AAC1B,cAAc,WAAW,CAAA;AACzB,cAAc,QAAQ,CAAA;AACtB,cAAc,QAAQ,CAAA;AAGtB,cAAc,SAAS,CAAA;AACvB,cAAc,YAAY,CAAA;AAG1B,cAAc,OAAO,CAAA;AACrB,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AAGvB,cAAc,cAAc,CAAA;AAG5B,cAAc,cAAc,CAAA;AAG5B,cAAc,eAAe,CAAA;AAG7B,cAAc,YAAY,CAAA;AAG1B,cAAc,aAAa,CAAA;AAE3B,cAAc,uBAAuB,CAAA;AACrC,cAAc,SAAS,CAAA;AACvB,cAAc,eAAe,CAAA;AAC7B,cAAc,QAAQ,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAIA,cAAc,gBAAgB,CAAA;AAC9B,YAAY,EAAE,QAAQ,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAA;AACtF,cAAc,YAAY,CAAA;AAC1B,cAAc,SAAS,CAAA;AACvB,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,IAAI,gBAAgB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAGjK,cAAc,YAAY,CAAA;AAG1B,cAAc,QAAQ,CAAA;AAGtB,cAAc,QAAQ,CAAA;AACtB,cAAc,cAAc,CAAA;AAC5B,cAAc,sBAAsB,CAAA;AACpC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,QAAQ,CAAA;AACtB,cAAc,mBAAmB,CAAA;AACjC,cAAc,YAAY,CAAA;AAC1B,cAAc,UAAU,CAAA;AACxB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,oBAAoB,CAAA;AAGlC,cAAc,YAAY,CAAA;AAC1B,cAAc,WAAW,CAAA;AACzB,cAAc,QAAQ,CAAA;AACtB,cAAc,QAAQ,CAAA;AAGtB,cAAc,SAAS,CAAA;AACvB,cAAc,YAAY,CAAA;AAG1B,cAAc,OAAO,CAAA;AACrB,cAAc,eAAe,CAAA;AAC7B,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AAGvB,cAAc,cAAc,CAAA;AAG5B,cAAc,cAAc,CAAA;AAG5B,cAAc,eAAe,CAAA;AAG7B,cAAc,YAAY,CAAA;AAG1B,cAAc,aAAa,CAAA;AAE3B,cAAc,uBAAuB,CAAA;AACrC,cAAc,SAAS,CAAA;AACvB,cAAc,eAAe,CAAA;AAC7B,cAAc,QAAQ,CAAA"}
|
|
@@ -0,0 +1,58 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,18 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
package/dist/utils/index.cjs
CHANGED
|
@@ -3314,6 +3314,76 @@ function buildListUrl(contentRefType, ids, base = "") {
|
|
|
3314
3314
|
return fn ? fn(ids, base) : null;
|
|
3315
3315
|
}
|
|
3316
3316
|
|
|
3317
|
+
// src/utils/content-ref-groups.ts
|
|
3318
|
+
var CONTENT_REF_GROUPS = {
|
|
3319
|
+
investor_update: { label: "Investor Updates", order: 1, layout: "grid", gridSize: "default" },
|
|
3320
|
+
product_release: { label: "Product Releases", order: 2, layout: "list", gridSize: "lg" },
|
|
3321
|
+
podcast: { label: "Podcasts", order: 3, layout: "list", gridSize: "default" },
|
|
3322
|
+
webinar: { label: "Webinars", order: 4, layout: "list", gridSize: "default" },
|
|
3323
|
+
case_study: { label: "Case Studies", order: 5, layout: "grid", gridSize: "default" },
|
|
3324
|
+
event: { label: "Events", order: 6, layout: "list", gridSize: "default" },
|
|
3325
|
+
blog_post_existing: { label: "Blog Posts", order: 7, layout: "grid", gridSize: "default" },
|
|
3326
|
+
customer_interview: { label: "Customer Interviews", order: 8, layout: "grid", gridSize: "default" },
|
|
3327
|
+
onboarding_guide: { label: "Onboarding Guides", order: 9, layout: "grid", gridSize: "default" }
|
|
3328
|
+
};
|
|
3329
|
+
function getContentRefLabel(type) {
|
|
3330
|
+
return CONTENT_REF_GROUPS[type]?.label ?? null;
|
|
3331
|
+
}
|
|
3332
|
+
function getContentRefLabelOrTitleCase(type) {
|
|
3333
|
+
return CONTENT_REF_GROUPS[type]?.label ?? type.replace(/_/g, " ").replace(/\b\w/g, (ch) => ch.toUpperCase());
|
|
3334
|
+
}
|
|
3335
|
+
function orderContentRefTypes(present) {
|
|
3336
|
+
const presentSet = new Set(present);
|
|
3337
|
+
const registeredInOrder = Object.entries(CONTENT_REF_GROUPS).sort(([, a], [, b]) => a.order - b.order).map(([type]) => type).filter((type) => presentSet.has(type));
|
|
3338
|
+
const unregistered = [...presentSet].filter((type) => !CONTENT_REF_GROUPS[type]);
|
|
3339
|
+
return [...registeredInOrder, ...unregistered];
|
|
3340
|
+
}
|
|
3341
|
+
|
|
3342
|
+
// src/utils/extract-items.ts
|
|
3343
|
+
function extractItems(data) {
|
|
3344
|
+
if (!data || typeof data !== "object") return [];
|
|
3345
|
+
const obj = data;
|
|
3346
|
+
if (Array.isArray(obj.items)) return obj.items;
|
|
3347
|
+
if (Array.isArray(obj.posts)) return obj.posts;
|
|
3348
|
+
if (Array.isArray(obj.campaigns)) return obj.campaigns;
|
|
3349
|
+
if (Array.isArray(obj.completed) || Array.isArray(obj.inProgress)) {
|
|
3350
|
+
const completed = Array.isArray(obj.completed) ? obj.completed : [];
|
|
3351
|
+
const inProgress = Array.isArray(obj.inProgress) ? obj.inProgress : [];
|
|
3352
|
+
return [...completed, ...inProgress];
|
|
3353
|
+
}
|
|
3354
|
+
if (Array.isArray(obj.data)) return obj.data;
|
|
3355
|
+
if (Array.isArray(data)) return data;
|
|
3356
|
+
return [];
|
|
3357
|
+
}
|
|
3358
|
+
function extractItemId(type, item) {
|
|
3359
|
+
if (!item || typeof item !== "object") return null;
|
|
3360
|
+
const obj = item;
|
|
3361
|
+
if (type === "roadmap_item" || type === "delivery_item" || type === "internal_task") {
|
|
3362
|
+
const ext = obj.external_id;
|
|
3363
|
+
if (typeof ext === "string") return ext;
|
|
3364
|
+
}
|
|
3365
|
+
const id = obj.id;
|
|
3366
|
+
if (typeof id === "string") return id;
|
|
3367
|
+
if (typeof id === "number") return String(id);
|
|
3368
|
+
return null;
|
|
3369
|
+
}
|
|
3370
|
+
|
|
3371
|
+
// src/utils/suggestion-url.ts
|
|
3372
|
+
function buildSuggestionUrl(path, opts = {}) {
|
|
3373
|
+
const qs = new URLSearchParams();
|
|
3374
|
+
const { entityType, entityId } = opts;
|
|
3375
|
+
if (entityType && entityId !== void 0 && entityId !== null && entityId !== "") {
|
|
3376
|
+
qs.set("entityType", entityType);
|
|
3377
|
+
qs.set("entityId", String(entityId));
|
|
3378
|
+
}
|
|
3379
|
+
if (opts.count !== void 0) qs.set("count", String(opts.count));
|
|
3380
|
+
for (const [key, value] of Object.entries(opts.extraParams ?? {})) {
|
|
3381
|
+
if (value !== void 0 && value !== "") qs.set(key, value);
|
|
3382
|
+
}
|
|
3383
|
+
const query = qs.toString();
|
|
3384
|
+
return `${opts.apiBaseUrl ?? ""}${path}${query ? `?${query}` : ""}`;
|
|
3385
|
+
}
|
|
3386
|
+
|
|
3317
3387
|
// src/utils/content-href.ts
|
|
3318
3388
|
var DEFAULT_CONTENT_SUFFIXES = {
|
|
3319
3389
|
onboarding_guide: "onboarding-guides",
|
|
@@ -3379,6 +3449,7 @@ exports.CHAT_ATTACHMENT_MARKDOWN_PATTERN = CHAT_ATTACHMENT_MARKDOWN_PATTERN;
|
|
|
3379
3449
|
exports.CHAT_ATTACHMENT_VIEW_TOKEN_QUERY_PARAM = CHAT_ATTACHMENT_VIEW_TOKEN_QUERY_PARAM;
|
|
3380
3450
|
exports.CHAT_ATTACHMENT_VIEW_URL_PREFIX = CHAT_ATTACHMENT_VIEW_URL_PREFIX;
|
|
3381
3451
|
exports.CHAT_ATTACHMENT_VIEW_URL_PREFIX_REGEX_ESCAPED = CHAT_ATTACHMENT_VIEW_URL_PREFIX_REGEX_ESCAPED;
|
|
3452
|
+
exports.CONTENT_REF_GROUPS = CONTENT_REF_GROUPS;
|
|
3382
3453
|
exports.CUSTOM_ITEM_ID = CUSTOM_ITEM_ID;
|
|
3383
3454
|
exports.DEFAULT_CONTENT_SUFFIXES = DEFAULT_CONTENT_SUFFIXES;
|
|
3384
3455
|
exports.DEFAULT_MIN_FILL_MS = DEFAULT_MIN_FILL_MS;
|
|
@@ -3407,6 +3478,7 @@ exports.buildChatAttachmentViewUrl = buildChatAttachmentViewUrl;
|
|
|
3407
3478
|
exports.buildDefaultHref = buildDefaultHref;
|
|
3408
3479
|
exports.buildDiscussAddendum = buildDiscussAddendum;
|
|
3409
3480
|
exports.buildListUrl = buildListUrl;
|
|
3481
|
+
exports.buildSuggestionUrl = buildSuggestionUrl;
|
|
3410
3482
|
exports.cleanEmailDomain = cleanEmailDomain;
|
|
3411
3483
|
exports.clearEmbedProxyAuth = clearEmbedProxyAuth;
|
|
3412
3484
|
exports.clickupTaskUrl = clickupTaskUrl;
|
|
@@ -3423,6 +3495,8 @@ exports.extractDominantColor = extractDominantColor;
|
|
|
3423
3495
|
exports.extractEntityIdFilter = extractEntityIdFilter;
|
|
3424
3496
|
exports.extractHumanitySignals = extractHumanitySignals;
|
|
3425
3497
|
exports.extractImageEdgeColorAsync = extractImageEdgeColorAsync;
|
|
3498
|
+
exports.extractItemId = extractItemId;
|
|
3499
|
+
exports.extractItems = extractItems;
|
|
3426
3500
|
exports.fetchPriorityProp = fetchPriorityProp;
|
|
3427
3501
|
exports.flattenAssistantContent = flattenAssistantContent;
|
|
3428
3502
|
exports.formatAbbreviatedNumber = formatAbbreviatedNumber;
|
|
@@ -3470,6 +3544,8 @@ exports.getConfidenceColorClass = getConfidenceColorClass;
|
|
|
3470
3544
|
exports.getConfidenceLabel = getConfidenceLabel;
|
|
3471
3545
|
exports.getConfidenceLevel = getConfidenceLevel;
|
|
3472
3546
|
exports.getConfidenceTextClass = getConfidenceTextClass;
|
|
3547
|
+
exports.getContentRefLabel = getContentRefLabel;
|
|
3548
|
+
exports.getContentRefLabelOrTitleCase = getContentRefLabelOrTitleCase;
|
|
3473
3549
|
exports.getContrastRatio = getContrastRatio;
|
|
3474
3550
|
exports.getCountryByCode = getCountryByCode;
|
|
3475
3551
|
exports.getCountryPhoneData = getCountryPhoneData;
|
|
@@ -3524,6 +3600,7 @@ exports.normalizeIconKey = normalizeIconKey;
|
|
|
3524
3600
|
exports.normalizeOSType = normalizeOSType;
|
|
3525
3601
|
exports.normalizeToolType = normalizeToolType;
|
|
3526
3602
|
exports.normalizeToolTypeWithFallback = normalizeToolTypeWithFallback;
|
|
3603
|
+
exports.orderContentRefTypes = orderContentRefTypes;
|
|
3527
3604
|
exports.parseScrollAnchor = parseScrollAnchor;
|
|
3528
3605
|
exports.parseWireCommandOverride = parseWireCommandOverride;
|
|
3529
3606
|
exports.platformColors = platformColors;
|