@flamingo-stack/openframe-frontend-core 0.0.829 → 0.0.831
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/build/export-map.json +1 -1
- package/dist/{case-study-card-QMFGPABF.cjs → case-study-card-TK7ZCNLM.cjs} +5 -5
- package/dist/{chunk-LKP5R3EQ.cjs → chunk-46LATWQR.cjs} +2 -2
- package/dist/{chunk-IBD2FPSX.cjs → chunk-4JHO2NVI.cjs} +2 -2
- package/dist/{chunk-3B6ZE4EZ.cjs → chunk-5L3UKDC6.cjs} +16 -16
- package/dist/{chunk-THPAGFT6.cjs → chunk-7COZUANC.cjs} +60 -69
- package/dist/{chunk-DWSU35QQ.cjs → chunk-7WQD3R5J.cjs} +84 -84
- package/dist/{chunk-DAKGX2WF.cjs → chunk-APNONOHY.cjs} +2 -2
- package/dist/{chunk-KPGKTEEB.cjs → chunk-BUEEQD3G.cjs} +2 -2
- package/dist/{chunk-YMLRDVPO.cjs → chunk-C4OQIYGW.cjs} +11 -11
- package/dist/{chunk-IFLGIBFZ.cjs → chunk-CP46CVUC.cjs} +91 -91
- package/dist/{chunk-UO6F6LLI.cjs → chunk-D6ZSRGH2.cjs} +699 -642
- package/dist/{chunk-UE5ZBCJ4.cjs → chunk-DAQMCWCK.cjs} +3 -3
- package/dist/{chunk-MFYSV7DE.cjs → chunk-EYSIQORA.cjs} +94 -94
- package/dist/{chunk-DU6AF77X.cjs → chunk-FNNDGOR3.cjs} +33 -33
- package/dist/{chunk-OKTNRGM5.cjs → chunk-GPXKG34G.cjs} +54 -54
- package/dist/{chunk-FMSAN6SR.cjs → chunk-H3WTYAVR.cjs} +129 -129
- package/dist/{chunk-HMC2IWV4.cjs → chunk-HDLY6OMQ.cjs} +6 -6
- package/dist/{chunk-2VLPXUQK.cjs → chunk-HLJXCOMA.cjs} +4 -4
- package/dist/{chunk-PBHP3FHO.cjs → chunk-JBTH3O2C.cjs} +4 -4
- package/dist/{chunk-2HQNXX2K.cjs → chunk-JQCQCE6U.cjs} +2 -2
- package/dist/{chunk-AY6XJOIN.cjs → chunk-LWMWY3JO.cjs} +45 -45
- package/dist/{chunk-R3PKAIX3.cjs → chunk-OGPAVRNF.cjs} +17 -17
- package/dist/{chunk-4DUVTJ6A.cjs → chunk-P5DWAVWK.cjs} +28 -28
- package/dist/{chunk-4ZIKDOPY.cjs → chunk-QHBKZJ6A.cjs} +4 -4
- package/dist/{chunk-PRZAEPGG.cjs → chunk-R6QZHOJB.cjs} +46 -46
- package/dist/{chunk-F2J5WN6U.cjs → chunk-SOCCHWDK.cjs} +2 -2
- package/dist/{chunk-IMDYB77M.cjs → chunk-SRHHLDBP.cjs} +36 -36
- package/dist/{chunk-7PZQ7SHB.cjs → chunk-SWMUW3RR.cjs} +18 -18
- package/dist/{chunk-6GPMVHJN.cjs → chunk-TD4CC4KV.cjs} +20 -20
- package/dist/{chunk-6WNSZ5XP.cjs → chunk-UGM3YDCK.cjs} +25 -25
- package/dist/{chunk-AH4YWTWZ.cjs → chunk-UQS2RI5Y.cjs} +12 -12
- package/dist/{chunk-IHRMX3X6.cjs → chunk-VBGBKRDO.cjs} +684 -661
- package/dist/{chunk-YHQDB5QJ.cjs → chunk-VQG2A7GA.cjs} +2 -2
- package/dist/{chunk-S6UJEW4G.cjs → chunk-WCOSGDGA.cjs} +2 -2
- package/dist/{chunk-ENMPSEEQ.cjs → chunk-WVNUCKB7.cjs} +4 -4
- package/dist/{chunk-LNXRTVOY.cjs → chunk-X76TZ5YR.cjs} +21 -21
- package/dist/{chunk-IBQ3CSKL.cjs → chunk-X7VQM5TU.cjs} +6 -6
- package/dist/{chunk-BIG3O33P.cjs → chunk-YJZ7R3W5.cjs} +28 -2
- package/dist/{chunk-W4VEDSAX.cjs → chunk-ZABZIM2Y.cjs} +6 -6
- package/dist/{chunk-ZJXLNIWC.cjs → chunk-ZJ5K6XHW.cjs} +21 -21
- package/dist/{cloud-tenants-YVCSVVIS.cjs → cloud-tenants-E2AC4WEJ.cjs} +20 -20
- package/dist/components/case-studies/index.cjs +36 -36
- package/dist/components/chat/embeddable-chat.d.ts +3 -3
- package/dist/components/chat/embeddable-chat.d.ts.map +1 -1
- package/dist/components/chat/embeddable-chat.js +21 -14
- package/dist/components/chat/guide-welcome.d.ts +5 -16
- package/dist/components/chat/guide-welcome.d.ts.map +1 -1
- package/dist/components/chat/guide-welcome.js +4 -29
- package/dist/components/chat/index.cjs +19 -15
- package/dist/components/chat/mingo-quick-action-wall.d.ts +42 -16
- package/dist/components/chat/mingo-quick-action-wall.d.ts.map +1 -1
- package/dist/components/chat/mingo-quick-action-wall.js +105 -19
- package/dist/components/chat/mingo-welcome.d.ts +6 -13
- package/dist/components/chat/mingo-welcome.d.ts.map +1 -1
- package/dist/components/chat/mingo-welcome.js +5 -9
- package/dist/components/chat/quick-action-chip.d.ts +8 -2
- package/dist/components/chat/quick-action-chip.d.ts.map +1 -1
- package/dist/components/chat/quick-action-chip.js +18 -8
- package/dist/components/chat/utils/icon-registry.d.ts +2 -2
- package/dist/components/chat/utils/icon-registry.js +2 -2
- package/dist/components/contact/index.cjs +21 -21
- package/dist/components/docs/index.cjs +24 -24
- package/dist/components/embeds/index.cjs +21 -21
- package/dist/components/faq/index.cjs +22 -22
- package/dist/components/features/index.cjs +22 -20
- package/dist/components/features/notifications/index.d.ts +3 -1
- package/dist/components/features/notifications/index.d.ts.map +1 -1
- package/dist/components/features/notifications/index.js +2 -0
- package/dist/components/features/notifications/notification-category-icon.d.ts +7 -0
- package/dist/components/features/notifications/notification-category-icon.d.ts.map +1 -0
- package/dist/components/features/notifications/notification-category-icon.js +26 -0
- package/dist/components/features/notifications/notification-tile.d.ts.map +1 -1
- package/dist/components/features/notifications/types.d.ts +1 -1
- package/dist/components/features/notifications/types.d.ts.map +1 -1
- package/dist/components/help-center-pages/index.cjs +125 -125
- package/dist/components/index.cjs +90 -82
- package/dist/components/meeting-scheduler/index.cjs +69 -69
- package/dist/components/navigation/index.cjs +23 -23
- package/dist/components/navigation/site-footer.d.ts.map +1 -1
- package/dist/components/navigation/site-footer.js +2 -12
- package/dist/components/onboarding-guides/index.cjs +23 -23
- package/dist/components/product-demo/index.cjs +31 -31
- package/dist/components/related-content/index.cjs +9 -9
- package/dist/components/social-icon-row.d.ts +6 -2
- package/dist/components/social-icon-row.d.ts.map +1 -1
- package/dist/components/social-icon-row.js +5 -6
- package/dist/components/tickets/index.cjs +27 -27
- package/dist/components/ui/actions-menu.d.ts.map +1 -1
- package/dist/components/ui/actions-menu.js +27 -1
- package/dist/components/ui/index.cjs +24 -20
- package/dist/{devices-AW6BERJF.cjs → devices-CAYUGD2N.cjs} +21 -21
- package/dist/{embeddable-chat-ZJIOMMSA.cjs → embeddable-chat-FYHMR66R.cjs} +121 -114
- package/dist/hooks/index.cjs +7 -7
- package/dist/index.cjs +31 -25
- package/dist/{knowledge-PEOXTIVS.cjs → knowledge-OI4OPEVL.cjs} +21 -21
- package/dist/{logs-CYA7H4KM.cjs → logs-B3XV2NHV.cjs} +27 -27
- package/dist/platform-domains.cjs +4 -0
- package/dist/platform-domains.d.ts +2 -0
- package/dist/platform-domains.d.ts.map +1 -1
- package/dist/platform-domains.js +4 -0
- package/dist/{policies-M6QSFL5G.cjs → policies-ZB4Z42DV.cjs} +24 -24
- package/dist/{remote-session-QGFG5WAL.cjs → remote-session-CN3G7JNR.cjs} +7 -7
- package/dist/{scripts-Y46ECDDP.cjs → scripts-I4DNUOQC.cjs} +27 -27
- package/dist/{software-update-OTC2DGQZ.cjs → software-update-AWH4WXOH.cjs} +24 -24
- package/dist/{tickets-board-KCH6ITUV.cjs → tickets-board-PLYD2NSY.cjs} +11 -11
- package/dist/types/marketing.d.ts +61 -216
- package/dist/types/marketing.d.ts.map +1 -1
- package/dist/utils/index.cjs +2 -2
- package/dist/utils/notifications.cjs +55 -0
- package/dist/utils/notifications.d.ts +29 -0
- package/dist/utils/notifications.d.ts.map +1 -0
- package/dist/utils/notifications.js +53 -0
- package/dist/utils/social-platforms.d.ts +9 -9
- package/dist/utils/social-platforms.d.ts.map +1 -1
- package/package.json +7 -1
- package/src/components/chat/embeddable-chat.tsx +29 -45
- package/src/components/chat/guide-welcome.tsx +12 -57
- package/src/components/chat/mingo-quick-action-wall.tsx +166 -31
- package/src/components/chat/mingo-welcome.tsx +16 -35
- package/src/components/chat/quick-action-chip.tsx +32 -8
- package/src/components/chat/utils/icon-registry.ts +5 -5
- package/src/components/chat/utils/index.ts +1 -1
- package/src/components/features/notifications/index.ts +2 -1
- package/src/components/features/notifications/notification-category-icon.tsx +38 -0
- package/src/components/features/notifications/notification-tile.tsx +2 -1
- package/src/components/features/notifications/types.ts +1 -2
- package/src/components/navigation/site-footer.tsx +2 -11
- package/src/components/social-icon-row.tsx +11 -10
- package/src/components/ui/actions-menu.tsx +35 -1
- package/src/platform-domains.ts +5 -0
- package/src/types/marketing.ts +90 -268
- package/src/utils/index.ts +1 -1
- package/src/utils/notifications.ts +71 -0
- package/src/utils/social-platforms.ts +9 -9
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What an OpenFrame notification can say about itself: its severity and the
|
|
3
|
+
* dashboard section (category) it belongs to, as the backend's enums name them.
|
|
4
|
+
* Stated once for every host that writes or draws one: the OpenFrame app's
|
|
5
|
+
* notification tiles, the Backoffice API's announcement request and the hub's
|
|
6
|
+
* preview of an announcement before it is sent.
|
|
7
|
+
*
|
|
8
|
+
* Pure and server-safe; also published as the granular subpath
|
|
9
|
+
* `./utils/notifications`, so server code reads the vocabulary without React.
|
|
10
|
+
*/
|
|
11
|
+
/** The backend's notification severities, drawn as the tile's colour. */
|
|
12
|
+
export declare const NOTIFICATION_SEVERITIES: readonly ["INFO", "SUCCESS", "WARNING", "DANGER"];
|
|
13
|
+
export type NotificationSeverity = (typeof NOTIFICATION_SEVERITIES)[number];
|
|
14
|
+
export declare const NOTIFICATION_SEVERITY_LABELS: Readonly<Record<NotificationSeverity, string>>;
|
|
15
|
+
/** The severity a notification has when it states none. */
|
|
16
|
+
export declare const DEFAULT_NOTIFICATION_SEVERITY: NotificationSeverity;
|
|
17
|
+
/**
|
|
18
|
+
* The backend's `NotificationCategory`: the dashboard section a notification
|
|
19
|
+
* belongs to. Any section but GENERIC shows an unread counter on its menu item.
|
|
20
|
+
*/
|
|
21
|
+
export declare const NOTIFICATION_CATEGORIES: readonly ["DASHBOARD", "CUSTOMERS", "DEVICES", "SCRIPTS", "MONITORING", "SOFTWARE", "LOGS", "TICKETS", "INSIGHTS", "MINGO", "INTEGRATIONS", "GENERIC"];
|
|
22
|
+
export type NotificationCategory = (typeof NOTIFICATION_CATEGORIES)[number];
|
|
23
|
+
/** Each category as the app's navigation names its section. */
|
|
24
|
+
export declare const NOTIFICATION_CATEGORY_LABELS: Readonly<Record<NotificationCategory, string>>;
|
|
25
|
+
/** The category a notification has when it states none. */
|
|
26
|
+
export declare const DEFAULT_NOTIFICATION_CATEGORY: NotificationCategory;
|
|
27
|
+
export declare function isNotificationSeverity(value: unknown): value is NotificationSeverity;
|
|
28
|
+
export declare function isNotificationCategory(value: unknown): value is NotificationCategory;
|
|
29
|
+
//# sourceMappingURL=notifications.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notifications.d.ts","sourceRoot":"","sources":["../../src/utils/notifications.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,yEAAyE;AACzE,eAAO,MAAM,uBAAuB,mDAAoD,CAAC;AACzF,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,uBAAuB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE5E,eAAO,MAAM,4BAA4B,EAAE,QAAQ,CAAC,MAAM,CAAC,oBAAoB,EAAE,MAAM,CAAC,CAKvF,CAAC;AAEF,2DAA2D;AAC3D,eAAO,MAAM,6BAA6B,EAAE,oBAA6B,CAAC;AAE1E;;;GAGG;AACH,eAAO,MAAM,uBAAuB,wJAa1B,CAAC;AACX,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,uBAAuB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE5E,+DAA+D;AAC/D,eAAO,MAAM,4BAA4B,EAAE,QAAQ,CAAC,MAAM,CAAC,oBAAoB,EAAE,MAAM,CAAC,CAavF,CAAC;AAEF,2DAA2D;AAC3D,eAAO,MAAM,6BAA6B,EAAE,oBAAgC,CAAC;AAE7E,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,oBAAoB,CAEpF;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,oBAAoB,CAEpF"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
const NOTIFICATION_SEVERITIES = ["INFO", "SUCCESS", "WARNING", "DANGER"];
|
|
2
|
+
const NOTIFICATION_SEVERITY_LABELS = {
|
|
3
|
+
INFO: "Info",
|
|
4
|
+
SUCCESS: "Success",
|
|
5
|
+
WARNING: "Warning",
|
|
6
|
+
DANGER: "Danger"
|
|
7
|
+
};
|
|
8
|
+
const DEFAULT_NOTIFICATION_SEVERITY = "INFO";
|
|
9
|
+
const NOTIFICATION_CATEGORIES = [
|
|
10
|
+
"DASHBOARD",
|
|
11
|
+
"CUSTOMERS",
|
|
12
|
+
"DEVICES",
|
|
13
|
+
"SCRIPTS",
|
|
14
|
+
"MONITORING",
|
|
15
|
+
"SOFTWARE",
|
|
16
|
+
"LOGS",
|
|
17
|
+
"TICKETS",
|
|
18
|
+
"INSIGHTS",
|
|
19
|
+
"MINGO",
|
|
20
|
+
"INTEGRATIONS",
|
|
21
|
+
"GENERIC"
|
|
22
|
+
];
|
|
23
|
+
const NOTIFICATION_CATEGORY_LABELS = {
|
|
24
|
+
DASHBOARD: "Dashboard",
|
|
25
|
+
CUSTOMERS: "Customers",
|
|
26
|
+
DEVICES: "Devices",
|
|
27
|
+
SCRIPTS: "Scripts",
|
|
28
|
+
MONITORING: "Monitoring",
|
|
29
|
+
SOFTWARE: "Software",
|
|
30
|
+
LOGS: "Logs",
|
|
31
|
+
TICKETS: "Tickets",
|
|
32
|
+
INSIGHTS: "Insights",
|
|
33
|
+
MINGO: "Mingo",
|
|
34
|
+
INTEGRATIONS: "Integrations",
|
|
35
|
+
GENERIC: "General"
|
|
36
|
+
};
|
|
37
|
+
const DEFAULT_NOTIFICATION_CATEGORY = "GENERIC";
|
|
38
|
+
function isNotificationSeverity(value) {
|
|
39
|
+
return typeof value === "string" && NOTIFICATION_SEVERITIES.includes(value);
|
|
40
|
+
}
|
|
41
|
+
function isNotificationCategory(value) {
|
|
42
|
+
return typeof value === "string" && NOTIFICATION_CATEGORIES.includes(value);
|
|
43
|
+
}
|
|
44
|
+
export {
|
|
45
|
+
DEFAULT_NOTIFICATION_CATEGORY,
|
|
46
|
+
DEFAULT_NOTIFICATION_SEVERITY,
|
|
47
|
+
NOTIFICATION_CATEGORIES,
|
|
48
|
+
NOTIFICATION_CATEGORY_LABELS,
|
|
49
|
+
NOTIFICATION_SEVERITIES,
|
|
50
|
+
NOTIFICATION_SEVERITY_LABELS,
|
|
51
|
+
isNotificationCategory,
|
|
52
|
+
isNotificationSeverity
|
|
53
|
+
};
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
* type, and the "find the link for a platform" picker.
|
|
4
4
|
*
|
|
5
5
|
* **This module does NOT own the list of platforms.** That list lives in the
|
|
6
|
-
* `
|
|
6
|
+
* `channel_platforms` table and only there: it is admin-editable, it carries
|
|
7
7
|
* `display_name`, `icon_name`, `base_url`, `url_pattern`, `category` and
|
|
8
8
|
* `sort_order`, and the hub already reads it everywhere
|
|
9
|
-
* (`lib/data/
|
|
9
|
+
* (`lib/data/channel-platforms-utils.ts`, `useChannelPlatforms`). A hardcoded
|
|
10
10
|
* tuple here would be a second vocabulary that drifts the first time somebody
|
|
11
11
|
* adds a row — and, being a compile-time union, would reject that row outright.
|
|
12
12
|
*
|
|
@@ -22,24 +22,24 @@
|
|
|
22
22
|
* scripts can import the type and the classifier without pulling in React.
|
|
23
23
|
*/
|
|
24
24
|
/**
|
|
25
|
-
* One row of `
|
|
25
|
+
* One row of `channel_platforms`, in the shape callers pass around.
|
|
26
26
|
*
|
|
27
27
|
* Deliberately a narrow READ view: the columns that decide presentation and
|
|
28
28
|
* URL-building, not the OAuth or media-config columns, which have their own
|
|
29
29
|
* consumers and no business here.
|
|
30
30
|
*/
|
|
31
31
|
export interface SocialPlatformDefinition {
|
|
32
|
-
/** `
|
|
32
|
+
/** `channel_platforms.name` — the canonical key, lowercase. */
|
|
33
33
|
name: string;
|
|
34
|
-
/** `
|
|
34
|
+
/** `channel_platforms.base_url`, e.g. `https://twitter.com/`. */
|
|
35
35
|
baseUrl?: string | null;
|
|
36
|
-
/** `
|
|
36
|
+
/** `channel_platforms.url_pattern`, e.g. `https://twitter.com/{username}`. */
|
|
37
37
|
urlPattern?: string | null;
|
|
38
38
|
}
|
|
39
39
|
/**
|
|
40
40
|
* Accepted SPELLINGS that resolve onto a platform name.
|
|
41
41
|
*
|
|
42
|
-
* Not a vocabulary — every value here must be a `
|
|
42
|
+
* Not a vocabulary — every value here must be a `channel_platforms.name`. These
|
|
43
43
|
* exist because external data says `x`, `fb` or `generic` where the table says
|
|
44
44
|
* `twitter`, `facebook` and `website`.
|
|
45
45
|
*/
|
|
@@ -60,7 +60,7 @@ export declare function hostMatches(hostname: string | null | undefined, domain:
|
|
|
60
60
|
* (`x.com`), a share domain (`youtu.be`), an invite domain (`discord.gg`).
|
|
61
61
|
*
|
|
62
62
|
* The ONLY hardcoded host knowledge left, and it is additive: every primary
|
|
63
|
-
* host is derived from the row. Keyed by `
|
|
63
|
+
* host is derived from the row. Keyed by `channel_platforms.name`, so a row that
|
|
64
64
|
* does not exist contributes nothing. If this grows, the answer is an
|
|
65
65
|
* `alt_hosts` column on the table, not a longer map here.
|
|
66
66
|
*/
|
|
@@ -70,7 +70,7 @@ export declare function socialPlatformHosts(platform: SocialPlatformDefinition):
|
|
|
70
70
|
/**
|
|
71
71
|
* Classify a URL by its host against the platforms the DATABASE defines.
|
|
72
72
|
*
|
|
73
|
-
* `platforms` is the caller's loaded `
|
|
73
|
+
* `platforms` is the caller's loaded `channel_platforms` rows — passing them in
|
|
74
74
|
* is what keeps this function pure and this module free of a platform list.
|
|
75
75
|
* Returns `'website'` for a URL that parses but matches no row (the table's own
|
|
76
76
|
* catch-all row), and `null` for something that is not a URL at all.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"social-platforms.d.ts","sourceRoot":"","sources":["../../src/utils/social-platforms.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH;;;;;;GAMG;AACH,MAAM,WAAW,wBAAwB;IACvC
|
|
1
|
+
{"version":3,"file":"social-platforms.d.ts","sourceRoot":"","sources":["../../src/utils/social-platforms.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH;;;;;;GAMG;AACH,MAAM,WAAW,wBAAwB;IACvC,+DAA+D;IAC/D,IAAI,EAAE,MAAM,CAAC;IACb,iEAAiE;IACjE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,8EAA8E;IAC9E,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED;;;;;;GAMG;AACH,eAAO,MAAM,uBAAuB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAS1D,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAK1F;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAKxF;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,yBAAyB,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAMvE,CAAC;AAYF,mFAAmF;AACnF,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,wBAAwB,GAAG,MAAM,EAAE,CAGhF;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAC9B,SAAS,EAAE,SAAS,wBAAwB,EAAE,GAC7C,MAAM,GAAG,IAAI,CASf;AAED;;;;;GAKG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4FAA4F;IAC5F,UAAU,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC;CACtC,GAAG,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,KAAK,CAAA;CAAE,GAAG;IAAE,OAAO,EAAE,MAAM,IAAI,CAAC;IAAC,IAAI,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC,CAAC;AAEhF;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,CAAC,SAAS;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,EAC3D,KAAK,EAAE,SAAS,CAAC,EAAE,GAAG,IAAI,GAAG,SAAS,EACtC,QAAQ,EAAE,MAAM,GACf,CAAC,GAAG,SAAS,CAIf"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flamingo-stack/openframe-frontend-core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.831",
|
|
4
4
|
"description": "Shared design system and components for all Flamingo platforms",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": [
|
|
@@ -293,6 +293,12 @@
|
|
|
293
293
|
"require": "./dist/utils/mobile-app.cjs",
|
|
294
294
|
"default": "./dist/utils/mobile-app.js"
|
|
295
295
|
},
|
|
296
|
+
"./utils/notifications": {
|
|
297
|
+
"types": "./dist/utils/notifications.d.ts",
|
|
298
|
+
"import": "./dist/utils/notifications.js",
|
|
299
|
+
"require": "./dist/utils/notifications.cjs",
|
|
300
|
+
"default": "./dist/utils/notifications.js"
|
|
301
|
+
},
|
|
296
302
|
"./utils/platform-identity": {
|
|
297
303
|
"types": "./dist/utils/platform-identity.d.ts",
|
|
298
304
|
"import": "./dist/utils/platform-identity.js",
|
|
@@ -399,13 +399,10 @@ export interface EmbeddableChatProps {
|
|
|
399
399
|
* extra `quickActions` chips.
|
|
400
400
|
* Each field falls back to the built-in OpenFrame defaults, so the kit
|
|
401
401
|
* stays platform-agnostic. `onStartGuideChat` and `hasExistingChats` are
|
|
402
|
-
* wired internally and are NOT overridable here.
|
|
403
|
-
*
|
|
402
|
+
* wired internally and are NOT overridable here. A quick action's click is wired internally too: it puts the
|
|
403
|
+
* action's prompt into the composer to edit and send, then calls the action's own `onClick` (e.g. analytics).
|
|
404
404
|
*/
|
|
405
|
-
mingoWelcome?: Omit<
|
|
406
|
-
MingoWelcomeProps,
|
|
407
|
-
'onStartGuideChat' | 'hasExistingChats' | 'onQuickActionHover' | 'onQuickActionHoverEnd'
|
|
408
|
-
>;
|
|
405
|
+
mingoWelcome?: Omit<MingoWelcomeProps, 'onStartGuideChat' | 'hasExistingChats'>;
|
|
409
406
|
|
|
410
407
|
/**
|
|
411
408
|
* The host's conversation page size: how many dialogs one page of the list
|
|
@@ -1271,11 +1268,20 @@ function EmbeddableChatInner({
|
|
|
1271
1268
|
|
|
1272
1269
|
// Imperative handle to the chat input.
|
|
1273
1270
|
const chatInputRef = useRef<ChatInputRef | null>(null);
|
|
1274
|
-
//
|
|
1275
|
-
//
|
|
1276
|
-
//
|
|
1277
|
-
// draft
|
|
1278
|
-
const
|
|
1271
|
+
// A quick action (a starter) puts its prompt into the composer to edit and send, the way support prompts that
|
|
1272
|
+
// start a conversation work (AWS Cloudscape, "support prompts"): nothing is sent on the click. It never loses what
|
|
1273
|
+
// the user typed: an empty composer, or one holding only the prompt a quick action put there, takes the new prompt;
|
|
1274
|
+
// a draft of the user's own keeps its text and gets the prompt after it.
|
|
1275
|
+
const insertedPromptRef = useRef<string | null>(null);
|
|
1276
|
+
const insertQuickAction = useCallback((prompt: string) => {
|
|
1277
|
+
const input = chatInputRef.current;
|
|
1278
|
+
if (!input) return;
|
|
1279
|
+
const draft = input.getValue().trim();
|
|
1280
|
+
const next = draft === '' || draft === insertedPromptRef.current ? prompt : `${draft}\n\n${prompt}`;
|
|
1281
|
+
insertedPromptRef.current = next;
|
|
1282
|
+
input.setValue(next);
|
|
1283
|
+
input.focus();
|
|
1284
|
+
}, []);
|
|
1279
1285
|
|
|
1280
1286
|
// The slash-command registry (Guide onboarding cards) is loaded via
|
|
1281
1287
|
// react-query below, after `activeMode` is resolved — gated on Guide mode and
|
|
@@ -2117,16 +2123,6 @@ function EmbeddableChatInner({
|
|
|
2117
2123
|
// Guide-mode empty state (no open conversation) — drives the "Mingo Guide"
|
|
2118
2124
|
// header, the guide banner, and the GuideWelcome content branch.
|
|
2119
2125
|
const isGuideEmpty = !hasConversation && activeMode === 'guide';
|
|
2120
|
-
// Quick-action chips exist in BOTH empty states (Guide onboarding + Mingo
|
|
2121
|
-
// welcome). If the chip row goes away (a message is sent, or the mode
|
|
2122
|
-
// switches) while a chip is still hovered, drop the in-flight preview so it
|
|
2123
|
-
// can't leak into the next composer state.
|
|
2124
|
-
const isQuickActionEmpty = !hasConversation && (activeMode === 'guide' || activeMode === 'mingo');
|
|
2125
|
-
// Dropped while rendering, not from an effect: the composer reads
|
|
2126
|
-
// `quickActionPreview` in THIS render, so an effect committed one frame with
|
|
2127
|
-
// the hovered chip's prompt still ghosted into a composer whose chip row had
|
|
2128
|
-
// already gone. Guarded, so the extra render pass takes the early exit.
|
|
2129
|
-
if (!isQuickActionEmpty && quickActionPreview !== null) setQuickActionPreview(null);
|
|
2130
2126
|
// The guide-empty back-chevron returns to Mingo — only offer it when Mingo
|
|
2131
2127
|
// mode actually exists to return to (guide is normally entered from Mingo).
|
|
2132
2128
|
const guideCanReturnToMingo = isGuideEmpty && hasMingoMode;
|
|
@@ -2876,15 +2872,15 @@ function EmbeddableChatInner({
|
|
|
2876
2872
|
// the new-user compose surface: greeting + grid + promo +
|
|
2877
2873
|
// primary Guide chip.
|
|
2878
2874
|
hasExistingChats={false}
|
|
2879
|
-
//
|
|
2880
|
-
//
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2875
|
+
// A quick action puts its prompt into the composer to edit and send (`insertQuickAction`), then runs
|
|
2876
|
+
// the host's own click. Wired after the `{...mingoWelcome}` spread so nothing is sent from here.
|
|
2877
|
+
quickActions={mingoWelcome?.quickActions?.map(action => ({
|
|
2878
|
+
...action,
|
|
2879
|
+
onClick: () => {
|
|
2880
|
+
insertQuickAction(action.prompt ?? action.label);
|
|
2881
|
+
action.onClick?.();
|
|
2882
|
+
},
|
|
2883
|
+
}))}
|
|
2888
2884
|
/>
|
|
2889
2885
|
) : (
|
|
2890
2886
|
/* Figma node 7532:328214 — Guide-mode empty state: greeting
|
|
@@ -2922,20 +2918,8 @@ function EmbeddableChatInner({
|
|
|
2922
2918
|
? guideSuggestedActions
|
|
2923
2919
|
: (guideWelcome?.quickActions ?? guideSuggestedActions)
|
|
2924
2920
|
}
|
|
2925
|
-
//
|
|
2926
|
-
onQuickAction={action =>
|
|
2927
|
-
setQuickActionPreview(null);
|
|
2928
|
-
handleSend(action.prompt ?? action.label);
|
|
2929
|
-
}}
|
|
2930
|
-
// Hover/focus PREVIEWS the action's full prompt as ghost text
|
|
2931
|
-
// in the empty composer (the chip label is short; this reveals
|
|
2932
|
-
// what will be sent). Declarative + non-destructive — see
|
|
2933
|
-
// `quickActionPreview` / `ChatInput.previewText`.
|
|
2934
|
-
onQuickActionHover={action => setQuickActionPreview(action.prompt ?? action.label)}
|
|
2935
|
-
onQuickActionHoverEnd={() => setQuickActionPreview(null)}
|
|
2936
|
-
// In agent mode a built-in agent (fae/mingo) caps the wall at
|
|
2937
|
-
// 2 rows; host/guide mode (no active agent) keeps the default.
|
|
2938
|
-
agentSlug={activeAgentSlug}
|
|
2921
|
+
// A quick action puts its prompt into the composer to edit and send.
|
|
2922
|
+
onQuickAction={action => insertQuickAction(action.prompt ?? action.label)}
|
|
2939
2923
|
>
|
|
2940
2924
|
{/* Figma node 7363:205938 — single-column slash-command
|
|
2941
2925
|
list. No own scroll (GuideWelcome's region scrolls); the
|
|
@@ -3009,7 +2993,7 @@ function EmbeddableChatInner({
|
|
|
3009
2993
|
}
|
|
3010
2994
|
autoFocus={previewMode ? false : autoFocusInput}
|
|
3011
2995
|
slashCommands={slashCommandsProp}
|
|
3012
|
-
previewText={
|
|
2996
|
+
previewText={composerPreviewText ?? undefined}
|
|
3013
2997
|
safeAreaBottom={safeAreaBottom}
|
|
3014
2998
|
edgeLight={composerEdgeLight}
|
|
3015
2999
|
showAttachmentButton={attachmentsEnabled && activeMode === 'guide'}
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import { type ReactNode, useMemo } from 'react';
|
|
4
|
-
import { usePageTopicStamp } from '../../contexts/page-topics-context';
|
|
5
4
|
import { cn } from '../../utils/cn';
|
|
6
5
|
import { AgentMark } from '../agent-mark';
|
|
7
6
|
import { EntityIcon } from '../icon-display';
|
|
8
7
|
import { TextLineSkeleton } from '../loading/unified-skeleton';
|
|
9
|
-
import { PageTopicLabel } from '../page-topic-label';
|
|
10
8
|
import { useLoadingScope } from '../ui/loading-scope';
|
|
11
9
|
import { ScrollFadeOverlay, useScrollFade } from '../ui/scroll-fade';
|
|
10
|
+
import { QuickActionSet } from './mingo-quick-action-wall';
|
|
12
11
|
import { accentFromIdentityIcon, type QuickActionAccent } from './quick-action-chip';
|
|
13
|
-
import { QuickActionWall } from './quick-action-wall';
|
|
14
12
|
|
|
15
13
|
// =============================================================================
|
|
16
14
|
// Types
|
|
@@ -50,10 +48,9 @@ export interface GuideWelcomeProps {
|
|
|
50
48
|
* `subtitle` is present. A loading scope draws the skeleton too. */
|
|
51
49
|
subtitleLoading?: boolean;
|
|
52
50
|
/** Quick-action chips — caller-provided; there are no built-in defaults, so
|
|
53
|
-
* the
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
* the composer; click sends it. */
|
|
51
|
+
* the set is omitted entirely unless the host supplies actions. The first
|
|
52
|
+
* ones fill the set's slots and the rest open from its "More" slot; a click
|
|
53
|
+
* hands the action to `onQuickAction` (the chat puts its `prompt` into the composer). */
|
|
57
54
|
quickActions?: ReadonlyArray<GuideQuickAction>;
|
|
58
55
|
/** The host is still reading the chips (e.g. the quick actions of the page's
|
|
59
56
|
* topic): with none to show yet the wall draws its own loading form. A
|
|
@@ -66,15 +63,6 @@ export interface GuideWelcomeProps {
|
|
|
66
63
|
showTopic?: boolean;
|
|
67
64
|
/** Fired when a quick-action chip is activated (click). */
|
|
68
65
|
onQuickAction?: (action: GuideQuickAction) => void;
|
|
69
|
-
/** Pointer/keyboard focus enters a quick-action chip — e.g. preview the
|
|
70
|
-
* action's full `prompt` in the composer input. */
|
|
71
|
-
onQuickActionHover?: (action: GuideQuickAction) => void;
|
|
72
|
-
/** Pointer/keyboard focus leaves the chip — e.g. restore the composer. */
|
|
73
|
-
onQuickActionHoverEnd?: () => void;
|
|
74
|
-
/** Agent this empty state belongs to — forwarded to the quick-action
|
|
75
|
-
* {@link QuickActionWall} so a built-in agent (`'fae'`/`'mingo'`) caps the
|
|
76
|
-
* brick stack at 2 rows. Unset (host/guide mode) keeps the full `rows` cap. */
|
|
77
|
-
agentSlug?: string;
|
|
78
66
|
/** Slash-command onboarding list — rendered inside the shared scroll region
|
|
79
67
|
* below the greeting (so greeting + list scroll together, with edge fades). */
|
|
80
68
|
children?: ReactNode;
|
|
@@ -96,8 +84,7 @@ const DEFAULT_TITLE = 'Guide Mode Chat';
|
|
|
96
84
|
*
|
|
97
85
|
* Guide-mode chat empty state: a centred greeting and the slash-command
|
|
98
86
|
* onboarding list share one scroll region (with top/bottom fade affordances),
|
|
99
|
-
* and
|
|
100
|
-
* quick actions render as chips; the remainder collapse under a "⋯" menu.
|
|
87
|
+
* and the pinned quick-action set sits above the composer.
|
|
101
88
|
*
|
|
102
89
|
* Mirrors `MingoWelcome` (the default-mode empty state) — content is
|
|
103
90
|
* configurable with OpenFrame defaults.
|
|
@@ -111,15 +98,9 @@ export function GuideWelcome({
|
|
|
111
98
|
quickActionsLoading = false,
|
|
112
99
|
showTopic: showTopicProp,
|
|
113
100
|
onQuickAction,
|
|
114
|
-
onQuickActionHover,
|
|
115
|
-
onQuickActionHoverEnd,
|
|
116
|
-
agentSlug,
|
|
117
101
|
children,
|
|
118
102
|
className,
|
|
119
103
|
}: GuideWelcomeProps) {
|
|
120
|
-
// The host's choice (`PageTopicsProvider showTopic`) unless this surface states its own.
|
|
121
|
-
const topicStamp = usePageTopicStamp();
|
|
122
|
-
const showTopic = showTopicProp ?? topicStamp;
|
|
123
104
|
// Scroll-fade affordances: a 48px gradient at the top/bottom edge of the
|
|
124
105
|
// scroll region, shown only while content is actually hidden in that
|
|
125
106
|
// direction. (Same behaviour as MingoWelcome.)
|
|
@@ -130,11 +111,8 @@ export function GuideWelcome({
|
|
|
130
111
|
// The same switch for the chips (read data): the wall draws its loading form while there are none to show yet.
|
|
131
112
|
const chipsAreLoading = inLoadingScope || (quickActionsLoading && quickActions.length === 0);
|
|
132
113
|
|
|
133
|
-
// Map to the shared {@link QuickActionChip} shape
|
|
134
|
-
//
|
|
135
|
-
// the chat's quick actions read as "the work the agent does". Every chip
|
|
136
|
-
// stays interactive (clone copies included); `onHoverStart`/`onHoverEnd` drive
|
|
137
|
-
// the composer prompt preview and `onSelect` sends.
|
|
114
|
+
// Map to the shared {@link QuickActionChip} shape the chat's {@link QuickActionSet} draws (the set Mingo's empty
|
|
115
|
+
// state and the OpenFrame dock draw too). `onSelect` hands the action to the host.
|
|
138
116
|
const chipItems = useMemo(
|
|
139
117
|
() =>
|
|
140
118
|
quickActions.map(action => ({
|
|
@@ -152,10 +130,8 @@ export function GuideWelcome({
|
|
|
152
130
|
accent: action.accent ?? accentFromIdentityIcon(icon) ?? 'cyan',
|
|
153
131
|
},
|
|
154
132
|
onSelect: () => onQuickAction?.(action),
|
|
155
|
-
onHoverStart: () => onQuickActionHover?.(action),
|
|
156
|
-
onHoverEnd: () => onQuickActionHoverEnd?.(),
|
|
157
133
|
})),
|
|
158
|
-
[quickActions, icon, onQuickAction
|
|
134
|
+
[quickActions, icon, onQuickAction],
|
|
159
135
|
);
|
|
160
136
|
|
|
161
137
|
return (
|
|
@@ -211,32 +187,11 @@ export function GuideWelcome({
|
|
|
211
187
|
<ScrollFadeOverlay edge="bottom" visible={fadeBottom} className="h-12" />
|
|
212
188
|
</div>
|
|
213
189
|
|
|
214
|
-
{/*
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
chips packed edge-to-edge, drifting under left/right edge fades so a
|
|
218
|
-
long agent action set gets "reach" without squeezing the composer.
|
|
219
|
-
Chips stay directly hoverable — hover/focus previews the action's full
|
|
220
|
-
prompt in the composer, click sends it — and `pauseOnHover` freezes
|
|
221
|
-
the hovered row so a moving chip never dodges a click. */}
|
|
222
|
-
{/* Right-aligned and pulled against the chips, so it reads as a stamp on the wall, not a row of its own. */}
|
|
223
|
-
{showTopic && (
|
|
224
|
-
<PageTopicLabel className="-mb-[var(--spacing-system-xs)] shrink-0 px-[var(--spacing-system-l)] text-right" />
|
|
225
|
-
)}
|
|
190
|
+
{/* The quick actions, pinned above the composer: the static {@link QuickActionSet} (fixed slots, its height
|
|
191
|
+
set by the width alone, "More" for the rest). A click hands the action to `onQuickAction`. The set prints
|
|
192
|
+
the page's topic over itself. */}
|
|
226
193
|
{(quickActions.length > 0 || chipsAreLoading) && (
|
|
227
|
-
<
|
|
228
|
-
chips={chipItems}
|
|
229
|
-
loading={chipsAreLoading}
|
|
230
|
-
agentSlug={agentSlug}
|
|
231
|
-
rows={4}
|
|
232
|
-
pauseOnHover
|
|
233
|
-
dragScroll
|
|
234
|
-
fade={['left', 'right']}
|
|
235
|
-
fadeSize={{ left: 32 }}
|
|
236
|
-
fadeColor="var(--color-bg)"
|
|
237
|
-
copyGap="var(--spacing-system-xxs)"
|
|
238
|
-
className="max-h-44 shrink-0"
|
|
239
|
-
/>
|
|
194
|
+
<QuickActionSet chips={chipItems} loading={chipsAreLoading} showTopic={showTopicProp} />
|
|
240
195
|
)}
|
|
241
196
|
</div>
|
|
242
197
|
);
|