@feedmepos/mf-common 1.28.2 → 1.28.6

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 CHANGED
@@ -11,3 +11,89 @@ 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
+ import { Remy } from './helper/remy' // Your Remy client
80
+
81
+ onMounted(async () => {
82
+ const coreStore = useCoreStore()
83
+
84
+ // Initialize your Remy client
85
+ await Remy.init()
86
+
87
+ // Register callback to handle Remy icon clicks
88
+ coreStore.registerOnRemyClicked(() => {
89
+ Remy.toggleDialog(true)
90
+ })
91
+ })
92
+ ```
93
+
94
+ ## Benefits
95
+
96
+ 1. **Decoupled**: Common package doesn't need to know about Remy implementation details
97
+ 2. **Flexible**: Each microfrontend can implement their own Remy behavior
98
+ 3. **Simple API**: Only one method to register, icon visibility is automatic
99
+ 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-dc181a5c.js";
2
+ import { t as w, u as O } from "./app-9b38f0c2.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";
@@ -1 +1 @@
1
- {"version":3,"file":"Entry.vue.d.ts","sourceRoot":"","sources":["../../src/Entry.vue.ts"],"names":[],"mappings":";AA0VA,wBAKG"}
1
+ {"version":3,"file":"Entry.vue.d.ts","sourceRoot":"","sources":["../../src/Entry.vue.ts"],"names":[],"mappings":";AAyWA,wBAKG"}
@@ -1,5 +1,5 @@
1
1
  import { ref as fr, computed as Ut, defineComponent as ec, onMounted as tc, watch as bs, resolveComponent as ea, openBlock as jt, createElementBlock as an, createElementVNode as At, toDisplayString as ys, unref as Ct, createVNode as Kt, isRef as nc, createCommentVNode as Ur, Fragment as nu, renderList as ru, createBlock as ta, withCtx as iu, normalizeClass as Pu, Transition as vs } from "vue";
2
- import { c as $r, l as U, d as Te, e as We, f as rc, u as Du, g as ic, a as ac, O as ws, t as oc, b as uc } from "./app-dc181a5c.js";
2
+ import { c as $r, l as U, d as Te, e as We, f as rc, u as Du, g as ic, a as ac, O as ws, t as oc, b as uc } from "./app-9b38f0c2.js";
3
3
  import { FmButtonVariant as Gr } from "@feedmepos/ui-library";
4
4
  import { defineStore as sc } from "pinia";
5
5
  import { c as Lr } from "./object-27ce045b.js";
@@ -1,5 +1,5 @@
1
1
  import { ref as S, computed as o, defineComponent as ae, mergeModels as ne, useModel as ue, watch as j, resolveComponent as k, openBlock as i, createElementBlock as b, createElementVNode as C, createVNode as y, withCtx as L, normalizeClass as re, toDisplayString as oe, createCommentVNode as N, createBlock as O, withModifiers as K, unref as g, isRef as se, Fragment as Q, renderList as T, renderSlot as ie, nextTick as ce } from "vue";
2
- import { t as ve, u as de, a as fe, O as E, b as me } from "./app-dc181a5c.js";
2
+ import { t as ve, u as de, a as fe, O as E, b as me } from "./app-9b38f0c2.js";
3
3
  import "@feedmepos/ui-library";
4
4
  import "pinia";
5
5
  import "vue-router";