@feedmepos/mf-common 1.28.5 → 1.28.8
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/README.md +77 -0
- package/dist/{CustomAttributesForm-603b1077.js → CustomAttributesForm-a255e824.js} +1 -1
- package/dist/Entry.vue.d.ts.map +1 -1
- package/dist/{ItemSelector-e122e408.js → ItemSelector-e9325121.js} +9846 -9635
- package/dist/{RestaurantSelector-5d1f2002.js → RestaurantSelector-224c2427.js} +55 -55
- package/dist/{app-117cb626.js → app-7ca435b2.js} +9417 -9309
- package/dist/app.js +2 -2
- package/dist/components/Portal/PortalDesktop.vue.d.ts.map +1 -1
- package/dist/components/Portal/PortalMobile.vue.d.ts.map +1 -1
- package/dist/components/Portal/PortalTablet.vue.d.ts.map +1 -1
- package/dist/composables/useRemy.d.ts +4 -24
- package/dist/composables/useRemy.d.ts.map +1 -1
- package/dist/store.d.ts +23 -125
- package/dist/store.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/vite-preset.d.ts +88 -0
- package/dist/vite-preset.d.ts.map +1 -1
- package/dist/vite-preset.js +14 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -11,3 +11,80 @@ This package provide:
|
|
|
11
11
|
## Changelog
|
|
12
12
|
|
|
13
13
|
See [CHANGELOG.md](./CHANGELOG.md) for details about changes in each version.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
# Remy Integration Guide
|
|
18
|
+
|
|
19
|
+
## Overview
|
|
20
|
+
|
|
21
|
+
The common package provides a simplified interface for integrating Remy AI assistant into microfrontends. The responsibility of the common package is only to:
|
|
22
|
+
|
|
23
|
+
1. Register a callback when Remy icon is clicked
|
|
24
|
+
2. Show/hide the Remy icon based on callback registration
|
|
25
|
+
3. Trigger the callback when the icon is clicked
|
|
26
|
+
|
|
27
|
+
## Usage
|
|
28
|
+
|
|
29
|
+
### 1. Register Remy Callback
|
|
30
|
+
|
|
31
|
+
In your microfrontend (e.g., `mf-menu`), register a callback that will be triggered when the Remy icon is clicked:
|
|
32
|
+
|
|
33
|
+
```typescript
|
|
34
|
+
import { useCoreStore } from '@feedmepos/common'
|
|
35
|
+
|
|
36
|
+
const coreStore = useCoreStore()
|
|
37
|
+
|
|
38
|
+
// Register your callback
|
|
39
|
+
coreStore.registerOnRemyClicked(() => {
|
|
40
|
+
// Your Remy logic here
|
|
41
|
+
// For example: open Remy dialog, activate Remy session, etc.
|
|
42
|
+
console.log('Remy icon clicked!')
|
|
43
|
+
})
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### 2. Automatic Icon Display
|
|
47
|
+
|
|
48
|
+
When you register the callback:
|
|
49
|
+
- The `publicSetting.aiSettings.remy.enable` will be automatically set to `true`
|
|
50
|
+
- The Remy icon will appear on Desktop, Mobile, and Tablet views
|
|
51
|
+
- The icon is a video element showing the Remy animation
|
|
52
|
+
|
|
53
|
+
### 3. Icon Click Behavior
|
|
54
|
+
|
|
55
|
+
When a user clicks the Remy icon:
|
|
56
|
+
- The registered callback will be triggered
|
|
57
|
+
- You control what happens next (open dialog, start session, etc.)
|
|
58
|
+
|
|
59
|
+
## Implementation Details
|
|
60
|
+
|
|
61
|
+
### Desktop (PortalDesktop.vue)
|
|
62
|
+
- Icon appears in the header next to user info
|
|
63
|
+
- Positioned before debug and storefront buttons
|
|
64
|
+
|
|
65
|
+
### Mobile (PortalMobile.vue)
|
|
66
|
+
- Icon appears in the footer navigation
|
|
67
|
+
- Positioned next to the more menu button
|
|
68
|
+
|
|
69
|
+
### Tablet (PortalTablet.vue)
|
|
70
|
+
- Icon appears in the header
|
|
71
|
+
- Similar position to desktop view
|
|
72
|
+
|
|
73
|
+
## Example: Full Integration
|
|
74
|
+
|
|
75
|
+
```typescript
|
|
76
|
+
// In your microfrontend's main component or setup
|
|
77
|
+
import { onMounted } from 'vue'
|
|
78
|
+
import { useCoreStore } from '@feedmepos/common'
|
|
79
|
+
|
|
80
|
+
onMounted(async () => {
|
|
81
|
+
const coreStore = useCoreStore()
|
|
82
|
+
})
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Benefits
|
|
86
|
+
|
|
87
|
+
1. **Decoupled**: Common package doesn't need to know about Remy implementation details
|
|
88
|
+
2. **Flexible**: Each microfrontend can implement their own Remy behavior
|
|
89
|
+
3. **Simple API**: Only one method to register, icon visibility is automatic
|
|
90
|
+
4. **Consistent UX**: Icon appears in the same place across all views
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as A, computed as d, resolveComponent as N, openBlock as f, createElementBlock as b, createVNode as S, toDisplayString as C, unref as F, h } from "vue";
|
|
2
|
-
import { t as w, u as O } from "./app-
|
|
2
|
+
import { t as w, u as O } from "./app-7ca435b2.js";
|
|
3
3
|
import { components as y } from "@feedmepos/ui-library";
|
|
4
4
|
import { c as x } from "./object-27ce045b.js";
|
|
5
5
|
import "pinia";
|
package/dist/Entry.vue.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Entry.vue.d.ts","sourceRoot":"","sources":["../../src/Entry.vue.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"Entry.vue.d.ts","sourceRoot":"","sources":["../../src/Entry.vue.ts"],"names":[],"mappings":";AAyWA,wBAKG"}
|