@mekari/pixel3-airene-chat-bubble 0.1.0-dev.0
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/airene-chat-bubble.d.mts +72 -0
- package/dist/airene-chat-bubble.d.ts +72 -0
- package/dist/airene-chat-bubble.js +189 -0
- package/dist/airene-chat-bubble.mjs +9 -0
- package/dist/chunk-KHARJZFU.mjs +37 -0
- package/dist/chunk-M4TACMLD.mjs +71 -0
- package/dist/chunk-MLOC6O74.mjs +76 -0
- package/dist/chunk-QZ7VFGWC.mjs +6 -0
- package/dist/index.d.mts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +191 -0
- package/dist/index.mjs +9 -0
- package/dist/metafile-cjs.json +1 -0
- package/dist/metafile-esm.json +1 -0
- package/dist/modules/airene-chat-bubble.hooks.d.mts +14 -0
- package/dist/modules/airene-chat-bubble.hooks.d.ts +14 -0
- package/dist/modules/airene-chat-bubble.hooks.js +92 -0
- package/dist/modules/airene-chat-bubble.hooks.mjs +7 -0
- package/dist/modules/airene-chat-bubble.props.d.mts +37 -0
- package/dist/modules/airene-chat-bubble.props.d.ts +37 -0
- package/dist/modules/airene-chat-bubble.props.js +62 -0
- package/dist/modules/airene-chat-bubble.props.mjs +9 -0
- package/package.json +44 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import * as vue_jsx_runtime from 'vue/jsx-runtime';
|
|
2
|
+
import * as vue from 'vue';
|
|
3
|
+
|
|
4
|
+
declare const MpAireneChatBubble: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
5
|
+
id: {
|
|
6
|
+
type: vue.PropType<string>;
|
|
7
|
+
default: string;
|
|
8
|
+
};
|
|
9
|
+
title: {
|
|
10
|
+
type: vue.PropType<string>;
|
|
11
|
+
default: string;
|
|
12
|
+
};
|
|
13
|
+
variant: {
|
|
14
|
+
type: vue.PropType<"answer" | "question">;
|
|
15
|
+
default: string;
|
|
16
|
+
};
|
|
17
|
+
avatarSrc: {
|
|
18
|
+
type: vue.PropType<string>;
|
|
19
|
+
default: string;
|
|
20
|
+
};
|
|
21
|
+
fullScreenLabel: {
|
|
22
|
+
type: vue.PropType<string>;
|
|
23
|
+
default: string;
|
|
24
|
+
};
|
|
25
|
+
isLoading: {
|
|
26
|
+
type: BooleanConstructor;
|
|
27
|
+
default: boolean;
|
|
28
|
+
};
|
|
29
|
+
isShowFullScreen: {
|
|
30
|
+
type: BooleanConstructor;
|
|
31
|
+
default: boolean;
|
|
32
|
+
};
|
|
33
|
+
}>, () => vue_jsx_runtime.JSX.Element, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
34
|
+
id: {
|
|
35
|
+
type: vue.PropType<string>;
|
|
36
|
+
default: string;
|
|
37
|
+
};
|
|
38
|
+
title: {
|
|
39
|
+
type: vue.PropType<string>;
|
|
40
|
+
default: string;
|
|
41
|
+
};
|
|
42
|
+
variant: {
|
|
43
|
+
type: vue.PropType<"answer" | "question">;
|
|
44
|
+
default: string;
|
|
45
|
+
};
|
|
46
|
+
avatarSrc: {
|
|
47
|
+
type: vue.PropType<string>;
|
|
48
|
+
default: string;
|
|
49
|
+
};
|
|
50
|
+
fullScreenLabel: {
|
|
51
|
+
type: vue.PropType<string>;
|
|
52
|
+
default: string;
|
|
53
|
+
};
|
|
54
|
+
isLoading: {
|
|
55
|
+
type: BooleanConstructor;
|
|
56
|
+
default: boolean;
|
|
57
|
+
};
|
|
58
|
+
isShowFullScreen: {
|
|
59
|
+
type: BooleanConstructor;
|
|
60
|
+
default: boolean;
|
|
61
|
+
};
|
|
62
|
+
}>> & Readonly<{}>, {
|
|
63
|
+
id: string;
|
|
64
|
+
title: string;
|
|
65
|
+
variant: "answer" | "question";
|
|
66
|
+
avatarSrc: string;
|
|
67
|
+
fullScreenLabel: string;
|
|
68
|
+
isLoading: boolean;
|
|
69
|
+
isShowFullScreen: boolean;
|
|
70
|
+
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
71
|
+
|
|
72
|
+
export { MpAireneChatBubble };
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import * as vue_jsx_runtime from 'vue/jsx-runtime';
|
|
2
|
+
import * as vue from 'vue';
|
|
3
|
+
|
|
4
|
+
declare const MpAireneChatBubble: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
5
|
+
id: {
|
|
6
|
+
type: vue.PropType<string>;
|
|
7
|
+
default: string;
|
|
8
|
+
};
|
|
9
|
+
title: {
|
|
10
|
+
type: vue.PropType<string>;
|
|
11
|
+
default: string;
|
|
12
|
+
};
|
|
13
|
+
variant: {
|
|
14
|
+
type: vue.PropType<"answer" | "question">;
|
|
15
|
+
default: string;
|
|
16
|
+
};
|
|
17
|
+
avatarSrc: {
|
|
18
|
+
type: vue.PropType<string>;
|
|
19
|
+
default: string;
|
|
20
|
+
};
|
|
21
|
+
fullScreenLabel: {
|
|
22
|
+
type: vue.PropType<string>;
|
|
23
|
+
default: string;
|
|
24
|
+
};
|
|
25
|
+
isLoading: {
|
|
26
|
+
type: BooleanConstructor;
|
|
27
|
+
default: boolean;
|
|
28
|
+
};
|
|
29
|
+
isShowFullScreen: {
|
|
30
|
+
type: BooleanConstructor;
|
|
31
|
+
default: boolean;
|
|
32
|
+
};
|
|
33
|
+
}>, () => vue_jsx_runtime.JSX.Element, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
34
|
+
id: {
|
|
35
|
+
type: vue.PropType<string>;
|
|
36
|
+
default: string;
|
|
37
|
+
};
|
|
38
|
+
title: {
|
|
39
|
+
type: vue.PropType<string>;
|
|
40
|
+
default: string;
|
|
41
|
+
};
|
|
42
|
+
variant: {
|
|
43
|
+
type: vue.PropType<"answer" | "question">;
|
|
44
|
+
default: string;
|
|
45
|
+
};
|
|
46
|
+
avatarSrc: {
|
|
47
|
+
type: vue.PropType<string>;
|
|
48
|
+
default: string;
|
|
49
|
+
};
|
|
50
|
+
fullScreenLabel: {
|
|
51
|
+
type: vue.PropType<string>;
|
|
52
|
+
default: string;
|
|
53
|
+
};
|
|
54
|
+
isLoading: {
|
|
55
|
+
type: BooleanConstructor;
|
|
56
|
+
default: boolean;
|
|
57
|
+
};
|
|
58
|
+
isShowFullScreen: {
|
|
59
|
+
type: BooleanConstructor;
|
|
60
|
+
default: boolean;
|
|
61
|
+
};
|
|
62
|
+
}>> & Readonly<{}>, {
|
|
63
|
+
id: string;
|
|
64
|
+
title: string;
|
|
65
|
+
variant: "answer" | "question";
|
|
66
|
+
avatarSrc: string;
|
|
67
|
+
fullScreenLabel: string;
|
|
68
|
+
isLoading: boolean;
|
|
69
|
+
isShowFullScreen: boolean;
|
|
70
|
+
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
71
|
+
|
|
72
|
+
export { MpAireneChatBubble };
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
|
|
21
|
+
// src/airene-chat-bubble.tsx
|
|
22
|
+
var airene_chat_bubble_exports = {};
|
|
23
|
+
__export(airene_chat_bubble_exports, {
|
|
24
|
+
MpAireneChatBubble: () => MpAireneChatBubble
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(airene_chat_bubble_exports);
|
|
27
|
+
var import_vue2 = require("vue");
|
|
28
|
+
var import_vue3 = require("vue");
|
|
29
|
+
var import_pixel3_avatar = require("@mekari/pixel3-avatar");
|
|
30
|
+
var import_pixel3_icon = require("@mekari/pixel3-icon");
|
|
31
|
+
var import_pixel3_text = require("@mekari/pixel3-text");
|
|
32
|
+
|
|
33
|
+
// src/modules/airene-chat-bubble.hooks.ts
|
|
34
|
+
var import_vue = require("vue");
|
|
35
|
+
var import_pixel3_utils = require("@mekari/pixel3-utils");
|
|
36
|
+
var import_recipes = require("@mekari/pixel3-styled-system/recipes");
|
|
37
|
+
function useAireneChatBubble(props, emit) {
|
|
38
|
+
const {
|
|
39
|
+
id,
|
|
40
|
+
variant
|
|
41
|
+
} = (0, import_vue.toRefs)(props);
|
|
42
|
+
const getId = id.value || (0, import_pixel3_utils.getUniqueId)("", "airene-chat-bubble").value;
|
|
43
|
+
const rootAttrs = (0, import_vue.computed)(() => {
|
|
44
|
+
return {
|
|
45
|
+
"data-pixel-component": "MpAireneChatBubble",
|
|
46
|
+
id: getId,
|
|
47
|
+
class: (0, import_recipes.aireneBubbleSlotRecipe)().root
|
|
48
|
+
};
|
|
49
|
+
});
|
|
50
|
+
const headerAttrs = (0, import_vue.computed)(() => {
|
|
51
|
+
return {
|
|
52
|
+
id: `${getId}--header`,
|
|
53
|
+
class: (0, import_recipes.aireneBubbleSlotRecipe)().header
|
|
54
|
+
};
|
|
55
|
+
});
|
|
56
|
+
const loadingAttrs = (0, import_vue.computed)(() => {
|
|
57
|
+
return {
|
|
58
|
+
class: (0, import_recipes.aireneBubbleSlotRecipe)().loading
|
|
59
|
+
};
|
|
60
|
+
});
|
|
61
|
+
const bodyAttrs = (0, import_vue.computed)(() => {
|
|
62
|
+
return {
|
|
63
|
+
id: `${getId}--body`,
|
|
64
|
+
class: variant.value === "answer" ? (0, import_recipes.aireneBubbleSlotRecipe)().body : void 0
|
|
65
|
+
};
|
|
66
|
+
});
|
|
67
|
+
const textAttrs = (0, import_vue.computed)(() => {
|
|
68
|
+
return {
|
|
69
|
+
class: (0, import_recipes.aireneBubbleSlotRecipe)().text
|
|
70
|
+
};
|
|
71
|
+
});
|
|
72
|
+
const iconFullScreenAttrs = (0, import_vue.computed)(() => {
|
|
73
|
+
return {
|
|
74
|
+
name: "full-screen",
|
|
75
|
+
style: {
|
|
76
|
+
cursor: "pointer",
|
|
77
|
+
outline: "none"
|
|
78
|
+
},
|
|
79
|
+
onClick: handleClickFullScreen
|
|
80
|
+
};
|
|
81
|
+
});
|
|
82
|
+
function handleClickFullScreen() {
|
|
83
|
+
emit("click-full-screen", getId);
|
|
84
|
+
}
|
|
85
|
+
__name(handleClickFullScreen, "handleClickFullScreen");
|
|
86
|
+
return {
|
|
87
|
+
rootAttrs,
|
|
88
|
+
headerAttrs,
|
|
89
|
+
loadingAttrs,
|
|
90
|
+
bodyAttrs,
|
|
91
|
+
textAttrs,
|
|
92
|
+
iconFullScreenAttrs
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
__name(useAireneChatBubble, "useAireneChatBubble");
|
|
96
|
+
|
|
97
|
+
// src/modules/airene-chat-bubble.props.ts
|
|
98
|
+
var aireneChatBubbleProps = {
|
|
99
|
+
id: {
|
|
100
|
+
type: String,
|
|
101
|
+
default: ""
|
|
102
|
+
},
|
|
103
|
+
title: {
|
|
104
|
+
type: String,
|
|
105
|
+
default: "Airene"
|
|
106
|
+
},
|
|
107
|
+
variant: {
|
|
108
|
+
type: String,
|
|
109
|
+
default: "answer"
|
|
110
|
+
},
|
|
111
|
+
avatarSrc: {
|
|
112
|
+
type: String,
|
|
113
|
+
default: ""
|
|
114
|
+
},
|
|
115
|
+
fullScreenLabel: {
|
|
116
|
+
type: String,
|
|
117
|
+
default: "Full screen"
|
|
118
|
+
},
|
|
119
|
+
isLoading: {
|
|
120
|
+
type: Boolean,
|
|
121
|
+
default: false
|
|
122
|
+
},
|
|
123
|
+
isShowFullScreen: {
|
|
124
|
+
type: Boolean,
|
|
125
|
+
default: false
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
// src/airene-chat-bubble.tsx
|
|
130
|
+
function _isSlot(s) {
|
|
131
|
+
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !(0, import_vue2.isVNode)(s);
|
|
132
|
+
}
|
|
133
|
+
__name(_isSlot, "_isSlot");
|
|
134
|
+
var MpAireneChatBubble = (0, import_vue3.defineComponent)({
|
|
135
|
+
name: "MpAireneChatBubble",
|
|
136
|
+
props: aireneChatBubbleProps,
|
|
137
|
+
setup(props, {
|
|
138
|
+
slots,
|
|
139
|
+
emit
|
|
140
|
+
}) {
|
|
141
|
+
const {
|
|
142
|
+
rootAttrs,
|
|
143
|
+
headerAttrs,
|
|
144
|
+
loadingAttrs,
|
|
145
|
+
bodyAttrs,
|
|
146
|
+
textAttrs,
|
|
147
|
+
iconFullScreenAttrs
|
|
148
|
+
} = useAireneChatBubble(props, emit);
|
|
149
|
+
return () => {
|
|
150
|
+
const {
|
|
151
|
+
isLoading,
|
|
152
|
+
isShowFullScreen,
|
|
153
|
+
title,
|
|
154
|
+
variant,
|
|
155
|
+
avatarSrc,
|
|
156
|
+
fullScreenLabel
|
|
157
|
+
} = props;
|
|
158
|
+
const loading = slots.loading && slots.loading();
|
|
159
|
+
const text = slots.text && slots.text();
|
|
160
|
+
const data = slots.data && slots.data();
|
|
161
|
+
const footer = slots.footer && slots.footer();
|
|
162
|
+
const source = slots.source && slots.source();
|
|
163
|
+
return (0, import_vue2.createVNode)("div", rootAttrs.value, [(0, import_vue2.createVNode)("div", headerAttrs.value, [variant === "question" && (0, import_vue2.createVNode)(import_pixel3_avatar.MpAvatar, {
|
|
164
|
+
"id": "avatar-chat-bubble",
|
|
165
|
+
"src": avatarSrc,
|
|
166
|
+
"size": "sm",
|
|
167
|
+
"variant-color": "gray"
|
|
168
|
+
}, null), variant === "answer" && (0, import_vue2.createVNode)(import_pixel3_icon.MpIcon, {
|
|
169
|
+
"name": "airene-brand"
|
|
170
|
+
}, null), (0, import_vue2.createVNode)(import_pixel3_text.MpText, {
|
|
171
|
+
"size": "label-small",
|
|
172
|
+
"weight": "semiBold"
|
|
173
|
+
}, _isSlot(title) ? title : {
|
|
174
|
+
default: () => [title]
|
|
175
|
+
})]), isLoading && (0, import_vue2.createVNode)("div", loadingAttrs.value, [loading]), !isLoading && (0, import_vue2.createVNode)("div", bodyAttrs.value, [(0, import_vue2.createVNode)("div", textAttrs.value, [(0, import_vue2.createVNode)(import_pixel3_text.MpText, {
|
|
176
|
+
"size": "body",
|
|
177
|
+
"style": {
|
|
178
|
+
width: "100%"
|
|
179
|
+
}
|
|
180
|
+
}, _isSlot(text) ? text : {
|
|
181
|
+
default: () => [text]
|
|
182
|
+
}), isShowFullScreen && (0, import_vue2.withDirectives)((0, import_vue2.createVNode)(import_pixel3_icon.MpIcon, iconFullScreenAttrs.value, null), [[(0, import_vue2.resolveDirective)("tooltip"), fullScreenLabel]])]), data]), !isLoading && footer, !isLoading && source]);
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
});
|
|
186
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
187
|
+
0 && (module.exports = {
|
|
188
|
+
MpAireneChatBubble
|
|
189
|
+
});
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// src/modules/airene-chat-bubble.props.ts
|
|
2
|
+
var aireneChatBubbleProps = {
|
|
3
|
+
id: {
|
|
4
|
+
type: String,
|
|
5
|
+
default: ""
|
|
6
|
+
},
|
|
7
|
+
title: {
|
|
8
|
+
type: String,
|
|
9
|
+
default: "Airene"
|
|
10
|
+
},
|
|
11
|
+
variant: {
|
|
12
|
+
type: String,
|
|
13
|
+
default: "answer"
|
|
14
|
+
},
|
|
15
|
+
avatarSrc: {
|
|
16
|
+
type: String,
|
|
17
|
+
default: ""
|
|
18
|
+
},
|
|
19
|
+
fullScreenLabel: {
|
|
20
|
+
type: String,
|
|
21
|
+
default: "Full screen"
|
|
22
|
+
},
|
|
23
|
+
isLoading: {
|
|
24
|
+
type: Boolean,
|
|
25
|
+
default: false
|
|
26
|
+
},
|
|
27
|
+
isShowFullScreen: {
|
|
28
|
+
type: Boolean,
|
|
29
|
+
default: false
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
var aireneChatBubbleEmit = ["click-full-screen"];
|
|
33
|
+
|
|
34
|
+
export {
|
|
35
|
+
aireneChatBubbleProps,
|
|
36
|
+
aireneChatBubbleEmit
|
|
37
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__name
|
|
3
|
+
} from "./chunk-QZ7VFGWC.mjs";
|
|
4
|
+
|
|
5
|
+
// src/modules/airene-chat-bubble.hooks.ts
|
|
6
|
+
import { toRefs, computed } from "vue";
|
|
7
|
+
import { getUniqueId } from "@mekari/pixel3-utils";
|
|
8
|
+
import { aireneBubbleSlotRecipe } from "@mekari/pixel3-styled-system/recipes";
|
|
9
|
+
function useAireneChatBubble(props, emit) {
|
|
10
|
+
const {
|
|
11
|
+
id,
|
|
12
|
+
variant
|
|
13
|
+
} = toRefs(props);
|
|
14
|
+
const getId = id.value || getUniqueId("", "airene-chat-bubble").value;
|
|
15
|
+
const rootAttrs = computed(() => {
|
|
16
|
+
return {
|
|
17
|
+
"data-pixel-component": "MpAireneChatBubble",
|
|
18
|
+
id: getId,
|
|
19
|
+
class: aireneBubbleSlotRecipe().root
|
|
20
|
+
};
|
|
21
|
+
});
|
|
22
|
+
const headerAttrs = computed(() => {
|
|
23
|
+
return {
|
|
24
|
+
id: `${getId}--header`,
|
|
25
|
+
class: aireneBubbleSlotRecipe().header
|
|
26
|
+
};
|
|
27
|
+
});
|
|
28
|
+
const loadingAttrs = computed(() => {
|
|
29
|
+
return {
|
|
30
|
+
class: aireneBubbleSlotRecipe().loading
|
|
31
|
+
};
|
|
32
|
+
});
|
|
33
|
+
const bodyAttrs = computed(() => {
|
|
34
|
+
return {
|
|
35
|
+
id: `${getId}--body`,
|
|
36
|
+
class: variant.value === "answer" ? aireneBubbleSlotRecipe().body : void 0
|
|
37
|
+
};
|
|
38
|
+
});
|
|
39
|
+
const textAttrs = computed(() => {
|
|
40
|
+
return {
|
|
41
|
+
class: aireneBubbleSlotRecipe().text
|
|
42
|
+
};
|
|
43
|
+
});
|
|
44
|
+
const iconFullScreenAttrs = computed(() => {
|
|
45
|
+
return {
|
|
46
|
+
name: "full-screen",
|
|
47
|
+
style: {
|
|
48
|
+
cursor: "pointer",
|
|
49
|
+
outline: "none"
|
|
50
|
+
},
|
|
51
|
+
onClick: handleClickFullScreen
|
|
52
|
+
};
|
|
53
|
+
});
|
|
54
|
+
function handleClickFullScreen() {
|
|
55
|
+
emit("click-full-screen", getId);
|
|
56
|
+
}
|
|
57
|
+
__name(handleClickFullScreen, "handleClickFullScreen");
|
|
58
|
+
return {
|
|
59
|
+
rootAttrs,
|
|
60
|
+
headerAttrs,
|
|
61
|
+
loadingAttrs,
|
|
62
|
+
bodyAttrs,
|
|
63
|
+
textAttrs,
|
|
64
|
+
iconFullScreenAttrs
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
__name(useAireneChatBubble, "useAireneChatBubble");
|
|
68
|
+
|
|
69
|
+
export {
|
|
70
|
+
useAireneChatBubble
|
|
71
|
+
};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useAireneChatBubble
|
|
3
|
+
} from "./chunk-M4TACMLD.mjs";
|
|
4
|
+
import {
|
|
5
|
+
aireneChatBubbleProps
|
|
6
|
+
} from "./chunk-KHARJZFU.mjs";
|
|
7
|
+
import {
|
|
8
|
+
__name
|
|
9
|
+
} from "./chunk-QZ7VFGWC.mjs";
|
|
10
|
+
|
|
11
|
+
// src/airene-chat-bubble.tsx
|
|
12
|
+
import { withDirectives as _withDirectives, resolveDirective as _resolveDirective, isVNode as _isVNode, createVNode as _createVNode } from "vue";
|
|
13
|
+
import { defineComponent } from "vue";
|
|
14
|
+
import { MpAvatar } from "@mekari/pixel3-avatar";
|
|
15
|
+
import { MpIcon } from "@mekari/pixel3-icon";
|
|
16
|
+
import { MpText } from "@mekari/pixel3-text";
|
|
17
|
+
function _isSlot(s) {
|
|
18
|
+
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !_isVNode(s);
|
|
19
|
+
}
|
|
20
|
+
__name(_isSlot, "_isSlot");
|
|
21
|
+
var MpAireneChatBubble = defineComponent({
|
|
22
|
+
name: "MpAireneChatBubble",
|
|
23
|
+
props: aireneChatBubbleProps,
|
|
24
|
+
setup(props, {
|
|
25
|
+
slots,
|
|
26
|
+
emit
|
|
27
|
+
}) {
|
|
28
|
+
const {
|
|
29
|
+
rootAttrs,
|
|
30
|
+
headerAttrs,
|
|
31
|
+
loadingAttrs,
|
|
32
|
+
bodyAttrs,
|
|
33
|
+
textAttrs,
|
|
34
|
+
iconFullScreenAttrs
|
|
35
|
+
} = useAireneChatBubble(props, emit);
|
|
36
|
+
return () => {
|
|
37
|
+
const {
|
|
38
|
+
isLoading,
|
|
39
|
+
isShowFullScreen,
|
|
40
|
+
title,
|
|
41
|
+
variant,
|
|
42
|
+
avatarSrc,
|
|
43
|
+
fullScreenLabel
|
|
44
|
+
} = props;
|
|
45
|
+
const loading = slots.loading && slots.loading();
|
|
46
|
+
const text = slots.text && slots.text();
|
|
47
|
+
const data = slots.data && slots.data();
|
|
48
|
+
const footer = slots.footer && slots.footer();
|
|
49
|
+
const source = slots.source && slots.source();
|
|
50
|
+
return _createVNode("div", rootAttrs.value, [_createVNode("div", headerAttrs.value, [variant === "question" && _createVNode(MpAvatar, {
|
|
51
|
+
"id": "avatar-chat-bubble",
|
|
52
|
+
"src": avatarSrc,
|
|
53
|
+
"size": "sm",
|
|
54
|
+
"variant-color": "gray"
|
|
55
|
+
}, null), variant === "answer" && _createVNode(MpIcon, {
|
|
56
|
+
"name": "airene-brand"
|
|
57
|
+
}, null), _createVNode(MpText, {
|
|
58
|
+
"size": "label-small",
|
|
59
|
+
"weight": "semiBold"
|
|
60
|
+
}, _isSlot(title) ? title : {
|
|
61
|
+
default: () => [title]
|
|
62
|
+
})]), isLoading && _createVNode("div", loadingAttrs.value, [loading]), !isLoading && _createVNode("div", bodyAttrs.value, [_createVNode("div", textAttrs.value, [_createVNode(MpText, {
|
|
63
|
+
"size": "body",
|
|
64
|
+
"style": {
|
|
65
|
+
width: "100%"
|
|
66
|
+
}
|
|
67
|
+
}, _isSlot(text) ? text : {
|
|
68
|
+
default: () => [text]
|
|
69
|
+
}), isShowFullScreen && _withDirectives(_createVNode(MpIcon, iconFullScreenAttrs.value, null), [[_resolveDirective("tooltip"), fullScreenLabel]])]), data]), !isLoading && footer, !isLoading && source]);
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
export {
|
|
75
|
+
MpAireneChatBubble
|
|
76
|
+
};
|
package/dist/index.d.mts
ADDED
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
|
|
21
|
+
// src/index.ts
|
|
22
|
+
var src_exports = {};
|
|
23
|
+
__export(src_exports, {
|
|
24
|
+
MpAireneChatBubble: () => MpAireneChatBubble
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(src_exports);
|
|
27
|
+
|
|
28
|
+
// src/airene-chat-bubble.tsx
|
|
29
|
+
var import_vue2 = require("vue");
|
|
30
|
+
var import_vue3 = require("vue");
|
|
31
|
+
var import_pixel3_avatar = require("@mekari/pixel3-avatar");
|
|
32
|
+
var import_pixel3_icon = require("@mekari/pixel3-icon");
|
|
33
|
+
var import_pixel3_text = require("@mekari/pixel3-text");
|
|
34
|
+
|
|
35
|
+
// src/modules/airene-chat-bubble.hooks.ts
|
|
36
|
+
var import_vue = require("vue");
|
|
37
|
+
var import_pixel3_utils = require("@mekari/pixel3-utils");
|
|
38
|
+
var import_recipes = require("@mekari/pixel3-styled-system/recipes");
|
|
39
|
+
function useAireneChatBubble(props, emit) {
|
|
40
|
+
const {
|
|
41
|
+
id,
|
|
42
|
+
variant
|
|
43
|
+
} = (0, import_vue.toRefs)(props);
|
|
44
|
+
const getId = id.value || (0, import_pixel3_utils.getUniqueId)("", "airene-chat-bubble").value;
|
|
45
|
+
const rootAttrs = (0, import_vue.computed)(() => {
|
|
46
|
+
return {
|
|
47
|
+
"data-pixel-component": "MpAireneChatBubble",
|
|
48
|
+
id: getId,
|
|
49
|
+
class: (0, import_recipes.aireneBubbleSlotRecipe)().root
|
|
50
|
+
};
|
|
51
|
+
});
|
|
52
|
+
const headerAttrs = (0, import_vue.computed)(() => {
|
|
53
|
+
return {
|
|
54
|
+
id: `${getId}--header`,
|
|
55
|
+
class: (0, import_recipes.aireneBubbleSlotRecipe)().header
|
|
56
|
+
};
|
|
57
|
+
});
|
|
58
|
+
const loadingAttrs = (0, import_vue.computed)(() => {
|
|
59
|
+
return {
|
|
60
|
+
class: (0, import_recipes.aireneBubbleSlotRecipe)().loading
|
|
61
|
+
};
|
|
62
|
+
});
|
|
63
|
+
const bodyAttrs = (0, import_vue.computed)(() => {
|
|
64
|
+
return {
|
|
65
|
+
id: `${getId}--body`,
|
|
66
|
+
class: variant.value === "answer" ? (0, import_recipes.aireneBubbleSlotRecipe)().body : void 0
|
|
67
|
+
};
|
|
68
|
+
});
|
|
69
|
+
const textAttrs = (0, import_vue.computed)(() => {
|
|
70
|
+
return {
|
|
71
|
+
class: (0, import_recipes.aireneBubbleSlotRecipe)().text
|
|
72
|
+
};
|
|
73
|
+
});
|
|
74
|
+
const iconFullScreenAttrs = (0, import_vue.computed)(() => {
|
|
75
|
+
return {
|
|
76
|
+
name: "full-screen",
|
|
77
|
+
style: {
|
|
78
|
+
cursor: "pointer",
|
|
79
|
+
outline: "none"
|
|
80
|
+
},
|
|
81
|
+
onClick: handleClickFullScreen
|
|
82
|
+
};
|
|
83
|
+
});
|
|
84
|
+
function handleClickFullScreen() {
|
|
85
|
+
emit("click-full-screen", getId);
|
|
86
|
+
}
|
|
87
|
+
__name(handleClickFullScreen, "handleClickFullScreen");
|
|
88
|
+
return {
|
|
89
|
+
rootAttrs,
|
|
90
|
+
headerAttrs,
|
|
91
|
+
loadingAttrs,
|
|
92
|
+
bodyAttrs,
|
|
93
|
+
textAttrs,
|
|
94
|
+
iconFullScreenAttrs
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
__name(useAireneChatBubble, "useAireneChatBubble");
|
|
98
|
+
|
|
99
|
+
// src/modules/airene-chat-bubble.props.ts
|
|
100
|
+
var aireneChatBubbleProps = {
|
|
101
|
+
id: {
|
|
102
|
+
type: String,
|
|
103
|
+
default: ""
|
|
104
|
+
},
|
|
105
|
+
title: {
|
|
106
|
+
type: String,
|
|
107
|
+
default: "Airene"
|
|
108
|
+
},
|
|
109
|
+
variant: {
|
|
110
|
+
type: String,
|
|
111
|
+
default: "answer"
|
|
112
|
+
},
|
|
113
|
+
avatarSrc: {
|
|
114
|
+
type: String,
|
|
115
|
+
default: ""
|
|
116
|
+
},
|
|
117
|
+
fullScreenLabel: {
|
|
118
|
+
type: String,
|
|
119
|
+
default: "Full screen"
|
|
120
|
+
},
|
|
121
|
+
isLoading: {
|
|
122
|
+
type: Boolean,
|
|
123
|
+
default: false
|
|
124
|
+
},
|
|
125
|
+
isShowFullScreen: {
|
|
126
|
+
type: Boolean,
|
|
127
|
+
default: false
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
// src/airene-chat-bubble.tsx
|
|
132
|
+
function _isSlot(s) {
|
|
133
|
+
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !(0, import_vue2.isVNode)(s);
|
|
134
|
+
}
|
|
135
|
+
__name(_isSlot, "_isSlot");
|
|
136
|
+
var MpAireneChatBubble = (0, import_vue3.defineComponent)({
|
|
137
|
+
name: "MpAireneChatBubble",
|
|
138
|
+
props: aireneChatBubbleProps,
|
|
139
|
+
setup(props, {
|
|
140
|
+
slots,
|
|
141
|
+
emit
|
|
142
|
+
}) {
|
|
143
|
+
const {
|
|
144
|
+
rootAttrs,
|
|
145
|
+
headerAttrs,
|
|
146
|
+
loadingAttrs,
|
|
147
|
+
bodyAttrs,
|
|
148
|
+
textAttrs,
|
|
149
|
+
iconFullScreenAttrs
|
|
150
|
+
} = useAireneChatBubble(props, emit);
|
|
151
|
+
return () => {
|
|
152
|
+
const {
|
|
153
|
+
isLoading,
|
|
154
|
+
isShowFullScreen,
|
|
155
|
+
title,
|
|
156
|
+
variant,
|
|
157
|
+
avatarSrc,
|
|
158
|
+
fullScreenLabel
|
|
159
|
+
} = props;
|
|
160
|
+
const loading = slots.loading && slots.loading();
|
|
161
|
+
const text = slots.text && slots.text();
|
|
162
|
+
const data = slots.data && slots.data();
|
|
163
|
+
const footer = slots.footer && slots.footer();
|
|
164
|
+
const source = slots.source && slots.source();
|
|
165
|
+
return (0, import_vue2.createVNode)("div", rootAttrs.value, [(0, import_vue2.createVNode)("div", headerAttrs.value, [variant === "question" && (0, import_vue2.createVNode)(import_pixel3_avatar.MpAvatar, {
|
|
166
|
+
"id": "avatar-chat-bubble",
|
|
167
|
+
"src": avatarSrc,
|
|
168
|
+
"size": "sm",
|
|
169
|
+
"variant-color": "gray"
|
|
170
|
+
}, null), variant === "answer" && (0, import_vue2.createVNode)(import_pixel3_icon.MpIcon, {
|
|
171
|
+
"name": "airene-brand"
|
|
172
|
+
}, null), (0, import_vue2.createVNode)(import_pixel3_text.MpText, {
|
|
173
|
+
"size": "label-small",
|
|
174
|
+
"weight": "semiBold"
|
|
175
|
+
}, _isSlot(title) ? title : {
|
|
176
|
+
default: () => [title]
|
|
177
|
+
})]), isLoading && (0, import_vue2.createVNode)("div", loadingAttrs.value, [loading]), !isLoading && (0, import_vue2.createVNode)("div", bodyAttrs.value, [(0, import_vue2.createVNode)("div", textAttrs.value, [(0, import_vue2.createVNode)(import_pixel3_text.MpText, {
|
|
178
|
+
"size": "body",
|
|
179
|
+
"style": {
|
|
180
|
+
width: "100%"
|
|
181
|
+
}
|
|
182
|
+
}, _isSlot(text) ? text : {
|
|
183
|
+
default: () => [text]
|
|
184
|
+
}), isShowFullScreen && (0, import_vue2.withDirectives)((0, import_vue2.createVNode)(import_pixel3_icon.MpIcon, iconFullScreenAttrs.value, null), [[(0, import_vue2.resolveDirective)("tooltip"), fullScreenLabel]])]), data]), !isLoading && footer, !isLoading && source]);
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
});
|
|
188
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
189
|
+
0 && (module.exports = {
|
|
190
|
+
MpAireneChatBubble
|
|
191
|
+
});
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"inputs":{"src/modules/airene-chat-bubble.hooks.ts":{"bytes":1873,"imports":[{"path":"vue","kind":"import-statement","external":true},{"path":"@mekari/pixel3-utils","kind":"import-statement","external":true},{"path":"@mekari/pixel3-styled-system/recipes","kind":"import-statement","external":true},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/modules/airene-chat-bubble.props.ts":{"bytes":995,"imports":[],"format":"esm"},"src/airene-chat-bubble.tsx":{"bytes":2521,"imports":[{"path":"vue","kind":"import-statement","external":true},{"path":"vue","kind":"import-statement","external":true},{"path":"@mekari/pixel3-avatar","kind":"import-statement","external":true},{"path":"@mekari/pixel3-icon","kind":"import-statement","external":true},{"path":"@mekari/pixel3-text","kind":"import-statement","external":true},{"path":"src/modules/airene-chat-bubble.hooks.ts","kind":"import-statement","original":"./modules/airene-chat-bubble.hooks"},{"path":"src/modules/airene-chat-bubble.props.ts","kind":"import-statement","original":"./modules/airene-chat-bubble.props"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/index.ts":{"bytes":143,"imports":[{"path":"src/airene-chat-bubble.tsx","kind":"import-statement","original":"./airene-chat-bubble"}],"format":"esm"}},"outputs":{"dist/airene-chat-bubble.js":{"imports":[{"path":"vue","kind":"require-call","external":true},{"path":"vue","kind":"require-call","external":true},{"path":"@mekari/pixel3-avatar","kind":"require-call","external":true},{"path":"@mekari/pixel3-icon","kind":"require-call","external":true},{"path":"@mekari/pixel3-text","kind":"require-call","external":true},{"path":"vue","kind":"require-call","external":true},{"path":"@mekari/pixel3-utils","kind":"require-call","external":true},{"path":"@mekari/pixel3-styled-system/recipes","kind":"require-call","external":true}],"exports":[],"entryPoint":"src/airene-chat-bubble.tsx","inputs":{"src/airene-chat-bubble.tsx":{"bytesInOutput":2730},"src/modules/airene-chat-bubble.hooks.ts":{"bytesInOutput":1795},"src/modules/airene-chat-bubble.props.ts":{"bytesInOutput":441}},"bytes":6117},"dist/index.js":{"imports":[{"path":"vue","kind":"require-call","external":true},{"path":"vue","kind":"require-call","external":true},{"path":"@mekari/pixel3-avatar","kind":"require-call","external":true},{"path":"@mekari/pixel3-icon","kind":"require-call","external":true},{"path":"@mekari/pixel3-text","kind":"require-call","external":true},{"path":"vue","kind":"require-call","external":true},{"path":"@mekari/pixel3-utils","kind":"require-call","external":true},{"path":"@mekari/pixel3-styled-system/recipes","kind":"require-call","external":true}],"exports":[],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":141},"src/airene-chat-bubble.tsx":{"bytesInOutput":2544},"src/modules/airene-chat-bubble.hooks.ts":{"bytesInOutput":1795},"src/modules/airene-chat-bubble.props.ts":{"bytesInOutput":441}},"bytes":6089},"dist/modules/airene-chat-bubble.hooks.js":{"imports":[{"path":"vue","kind":"require-call","external":true},{"path":"@mekari/pixel3-utils","kind":"require-call","external":true},{"path":"@mekari/pixel3-styled-system/recipes","kind":"require-call","external":true}],"exports":[],"entryPoint":"src/modules/airene-chat-bubble.hooks.ts","inputs":{"src/modules/airene-chat-bubble.hooks.ts":{"bytesInOutput":2001}},"bytes":3047},"dist/modules/airene-chat-bubble.props.js":{"imports":[],"exports":[],"entryPoint":"src/modules/airene-chat-bubble.props.ts","inputs":{"src/modules/airene-chat-bubble.props.ts":{"bytesInOutput":753}},"bytes":1735}}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"inputs":{"src/modules/airene-chat-bubble.hooks.ts":{"bytes":1873,"imports":[{"path":"vue","kind":"import-statement","external":true},{"path":"@mekari/pixel3-utils","kind":"import-statement","external":true},{"path":"@mekari/pixel3-styled-system/recipes","kind":"import-statement","external":true},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/modules/airene-chat-bubble.props.ts":{"bytes":995,"imports":[],"format":"esm"},"src/airene-chat-bubble.tsx":{"bytes":2521,"imports":[{"path":"vue","kind":"import-statement","external":true},{"path":"vue","kind":"import-statement","external":true},{"path":"@mekari/pixel3-avatar","kind":"import-statement","external":true},{"path":"@mekari/pixel3-icon","kind":"import-statement","external":true},{"path":"@mekari/pixel3-text","kind":"import-statement","external":true},{"path":"src/modules/airene-chat-bubble.hooks.ts","kind":"import-statement","original":"./modules/airene-chat-bubble.hooks"},{"path":"src/modules/airene-chat-bubble.props.ts","kind":"import-statement","original":"./modules/airene-chat-bubble.props"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/index.ts":{"bytes":143,"imports":[{"path":"src/airene-chat-bubble.tsx","kind":"import-statement","original":"./airene-chat-bubble"}],"format":"esm"}},"outputs":{"dist/airene-chat-bubble.mjs":{"imports":[{"path":"dist/chunk-MLOC6O74.mjs","kind":"import-statement"},{"path":"dist/chunk-M4TACMLD.mjs","kind":"import-statement"},{"path":"dist/chunk-KHARJZFU.mjs","kind":"import-statement"},{"path":"dist/chunk-QZ7VFGWC.mjs","kind":"import-statement"}],"exports":["MpAireneChatBubble"],"entryPoint":"src/airene-chat-bubble.tsx","inputs":{},"bytes":187},"dist/index.mjs":{"imports":[{"path":"dist/chunk-MLOC6O74.mjs","kind":"import-statement"},{"path":"dist/chunk-M4TACMLD.mjs","kind":"import-statement"},{"path":"dist/chunk-KHARJZFU.mjs","kind":"import-statement"},{"path":"dist/chunk-QZ7VFGWC.mjs","kind":"import-statement"}],"exports":["MpAireneChatBubble"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":0}},"bytes":187},"dist/chunk-MLOC6O74.mjs":{"imports":[{"path":"dist/chunk-M4TACMLD.mjs","kind":"import-statement"},{"path":"dist/chunk-KHARJZFU.mjs","kind":"import-statement"},{"path":"dist/chunk-QZ7VFGWC.mjs","kind":"import-statement"},{"path":"vue","kind":"import-statement","external":true},{"path":"vue","kind":"import-statement","external":true},{"path":"@mekari/pixel3-avatar","kind":"import-statement","external":true},{"path":"@mekari/pixel3-icon","kind":"import-statement","external":true},{"path":"@mekari/pixel3-text","kind":"import-statement","external":true}],"exports":["MpAireneChatBubble"],"inputs":{"src/airene-chat-bubble.tsx":{"bytesInOutput":2306}},"bytes":2546},"dist/modules/airene-chat-bubble.hooks.mjs":{"imports":[{"path":"dist/chunk-M4TACMLD.mjs","kind":"import-statement"},{"path":"dist/chunk-QZ7VFGWC.mjs","kind":"import-statement"}],"exports":["useAireneChatBubble"],"entryPoint":"src/modules/airene-chat-bubble.hooks.ts","inputs":{},"bytes":129},"dist/chunk-M4TACMLD.mjs":{"imports":[{"path":"dist/chunk-QZ7VFGWC.mjs","kind":"import-statement"},{"path":"vue","kind":"import-statement","external":true},{"path":"@mekari/pixel3-utils","kind":"import-statement","external":true},{"path":"@mekari/pixel3-styled-system/recipes","kind":"import-statement","external":true}],"exports":["useAireneChatBubble"],"inputs":{"src/modules/airene-chat-bubble.hooks.ts":{"bytesInOutput":1567}},"bytes":1695},"dist/modules/airene-chat-bubble.props.mjs":{"imports":[{"path":"dist/chunk-KHARJZFU.mjs","kind":"import-statement"},{"path":"dist/chunk-QZ7VFGWC.mjs","kind":"import-statement"}],"exports":["aireneChatBubbleEmit","aireneChatBubbleProps"],"entryPoint":"src/modules/airene-chat-bubble.props.ts","inputs":{},"bytes":181},"dist/chunk-KHARJZFU.mjs":{"imports":[],"exports":["aireneChatBubbleEmit","aireneChatBubbleProps"],"inputs":{"src/modules/airene-chat-bubble.props.ts":{"bytesInOutput":491}},"bytes":595},"dist/chunk-QZ7VFGWC.mjs":{"imports":[],"exports":["__name"],"inputs":{},"bytes":151}}}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as vue from 'vue';
|
|
2
|
+
import { HTMLAttributes } from 'vue';
|
|
3
|
+
import { AireneChatBubbleProps, AireneChatBubbleEmits } from './airene-chat-bubble.props.mjs';
|
|
4
|
+
|
|
5
|
+
declare function useAireneChatBubble(props: AireneChatBubbleProps, emit: AireneChatBubbleEmits): {
|
|
6
|
+
rootAttrs: vue.ComputedRef<HTMLAttributes>;
|
|
7
|
+
headerAttrs: vue.ComputedRef<HTMLAttributes>;
|
|
8
|
+
loadingAttrs: vue.ComputedRef<HTMLAttributes>;
|
|
9
|
+
bodyAttrs: vue.ComputedRef<HTMLAttributes>;
|
|
10
|
+
textAttrs: vue.ComputedRef<HTMLAttributes>;
|
|
11
|
+
iconFullScreenAttrs: vue.ComputedRef<HTMLAttributes>;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export { useAireneChatBubble };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as vue from 'vue';
|
|
2
|
+
import { HTMLAttributes } from 'vue';
|
|
3
|
+
import { AireneChatBubbleProps, AireneChatBubbleEmits } from './airene-chat-bubble.props.js';
|
|
4
|
+
|
|
5
|
+
declare function useAireneChatBubble(props: AireneChatBubbleProps, emit: AireneChatBubbleEmits): {
|
|
6
|
+
rootAttrs: vue.ComputedRef<HTMLAttributes>;
|
|
7
|
+
headerAttrs: vue.ComputedRef<HTMLAttributes>;
|
|
8
|
+
loadingAttrs: vue.ComputedRef<HTMLAttributes>;
|
|
9
|
+
bodyAttrs: vue.ComputedRef<HTMLAttributes>;
|
|
10
|
+
textAttrs: vue.ComputedRef<HTMLAttributes>;
|
|
11
|
+
iconFullScreenAttrs: vue.ComputedRef<HTMLAttributes>;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export { useAireneChatBubble };
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
|
|
21
|
+
// src/modules/airene-chat-bubble.hooks.ts
|
|
22
|
+
var airene_chat_bubble_hooks_exports = {};
|
|
23
|
+
__export(airene_chat_bubble_hooks_exports, {
|
|
24
|
+
useAireneChatBubble: () => useAireneChatBubble
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(airene_chat_bubble_hooks_exports);
|
|
27
|
+
var import_vue = require("vue");
|
|
28
|
+
var import_pixel3_utils = require("@mekari/pixel3-utils");
|
|
29
|
+
var import_recipes = require("@mekari/pixel3-styled-system/recipes");
|
|
30
|
+
function useAireneChatBubble(props, emit) {
|
|
31
|
+
const {
|
|
32
|
+
id,
|
|
33
|
+
variant
|
|
34
|
+
} = (0, import_vue.toRefs)(props);
|
|
35
|
+
const getId = id.value || (0, import_pixel3_utils.getUniqueId)("", "airene-chat-bubble").value;
|
|
36
|
+
const rootAttrs = (0, import_vue.computed)(() => {
|
|
37
|
+
return {
|
|
38
|
+
"data-pixel-component": "MpAireneChatBubble",
|
|
39
|
+
id: getId,
|
|
40
|
+
class: (0, import_recipes.aireneBubbleSlotRecipe)().root
|
|
41
|
+
};
|
|
42
|
+
});
|
|
43
|
+
const headerAttrs = (0, import_vue.computed)(() => {
|
|
44
|
+
return {
|
|
45
|
+
id: `${getId}--header`,
|
|
46
|
+
class: (0, import_recipes.aireneBubbleSlotRecipe)().header
|
|
47
|
+
};
|
|
48
|
+
});
|
|
49
|
+
const loadingAttrs = (0, import_vue.computed)(() => {
|
|
50
|
+
return {
|
|
51
|
+
class: (0, import_recipes.aireneBubbleSlotRecipe)().loading
|
|
52
|
+
};
|
|
53
|
+
});
|
|
54
|
+
const bodyAttrs = (0, import_vue.computed)(() => {
|
|
55
|
+
return {
|
|
56
|
+
id: `${getId}--body`,
|
|
57
|
+
class: variant.value === "answer" ? (0, import_recipes.aireneBubbleSlotRecipe)().body : void 0
|
|
58
|
+
};
|
|
59
|
+
});
|
|
60
|
+
const textAttrs = (0, import_vue.computed)(() => {
|
|
61
|
+
return {
|
|
62
|
+
class: (0, import_recipes.aireneBubbleSlotRecipe)().text
|
|
63
|
+
};
|
|
64
|
+
});
|
|
65
|
+
const iconFullScreenAttrs = (0, import_vue.computed)(() => {
|
|
66
|
+
return {
|
|
67
|
+
name: "full-screen",
|
|
68
|
+
style: {
|
|
69
|
+
cursor: "pointer",
|
|
70
|
+
outline: "none"
|
|
71
|
+
},
|
|
72
|
+
onClick: handleClickFullScreen
|
|
73
|
+
};
|
|
74
|
+
});
|
|
75
|
+
function handleClickFullScreen() {
|
|
76
|
+
emit("click-full-screen", getId);
|
|
77
|
+
}
|
|
78
|
+
__name(handleClickFullScreen, "handleClickFullScreen");
|
|
79
|
+
return {
|
|
80
|
+
rootAttrs,
|
|
81
|
+
headerAttrs,
|
|
82
|
+
loadingAttrs,
|
|
83
|
+
bodyAttrs,
|
|
84
|
+
textAttrs,
|
|
85
|
+
iconFullScreenAttrs
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
__name(useAireneChatBubble, "useAireneChatBubble");
|
|
89
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
90
|
+
0 && (module.exports = {
|
|
91
|
+
useAireneChatBubble
|
|
92
|
+
});
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { PropType, ExtractPropTypes } from 'vue';
|
|
2
|
+
|
|
3
|
+
declare const aireneChatBubbleProps: {
|
|
4
|
+
id: {
|
|
5
|
+
type: PropType<string>;
|
|
6
|
+
default: string;
|
|
7
|
+
};
|
|
8
|
+
title: {
|
|
9
|
+
type: PropType<string>;
|
|
10
|
+
default: string;
|
|
11
|
+
};
|
|
12
|
+
variant: {
|
|
13
|
+
type: PropType<"answer" | "question">;
|
|
14
|
+
default: string;
|
|
15
|
+
};
|
|
16
|
+
avatarSrc: {
|
|
17
|
+
type: PropType<string>;
|
|
18
|
+
default: string;
|
|
19
|
+
};
|
|
20
|
+
fullScreenLabel: {
|
|
21
|
+
type: PropType<string>;
|
|
22
|
+
default: string;
|
|
23
|
+
};
|
|
24
|
+
isLoading: {
|
|
25
|
+
type: BooleanConstructor;
|
|
26
|
+
default: boolean;
|
|
27
|
+
};
|
|
28
|
+
isShowFullScreen: {
|
|
29
|
+
type: BooleanConstructor;
|
|
30
|
+
default: boolean;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
declare const aireneChatBubbleEmit: readonly ["click-full-screen"];
|
|
34
|
+
type AireneChatBubbleProps = ExtractPropTypes<typeof aireneChatBubbleProps>;
|
|
35
|
+
type AireneChatBubbleEmits = (event: (typeof aireneChatBubbleEmit)[number], value?: unknown, value2?: unknown) => void;
|
|
36
|
+
|
|
37
|
+
export { AireneChatBubbleEmits, AireneChatBubbleProps, aireneChatBubbleEmit, aireneChatBubbleProps };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { PropType, ExtractPropTypes } from 'vue';
|
|
2
|
+
|
|
3
|
+
declare const aireneChatBubbleProps: {
|
|
4
|
+
id: {
|
|
5
|
+
type: PropType<string>;
|
|
6
|
+
default: string;
|
|
7
|
+
};
|
|
8
|
+
title: {
|
|
9
|
+
type: PropType<string>;
|
|
10
|
+
default: string;
|
|
11
|
+
};
|
|
12
|
+
variant: {
|
|
13
|
+
type: PropType<"answer" | "question">;
|
|
14
|
+
default: string;
|
|
15
|
+
};
|
|
16
|
+
avatarSrc: {
|
|
17
|
+
type: PropType<string>;
|
|
18
|
+
default: string;
|
|
19
|
+
};
|
|
20
|
+
fullScreenLabel: {
|
|
21
|
+
type: PropType<string>;
|
|
22
|
+
default: string;
|
|
23
|
+
};
|
|
24
|
+
isLoading: {
|
|
25
|
+
type: BooleanConstructor;
|
|
26
|
+
default: boolean;
|
|
27
|
+
};
|
|
28
|
+
isShowFullScreen: {
|
|
29
|
+
type: BooleanConstructor;
|
|
30
|
+
default: boolean;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
declare const aireneChatBubbleEmit: readonly ["click-full-screen"];
|
|
34
|
+
type AireneChatBubbleProps = ExtractPropTypes<typeof aireneChatBubbleProps>;
|
|
35
|
+
type AireneChatBubbleEmits = (event: (typeof aireneChatBubbleEmit)[number], value?: unknown, value2?: unknown) => void;
|
|
36
|
+
|
|
37
|
+
export { AireneChatBubbleEmits, AireneChatBubbleProps, aireneChatBubbleEmit, aireneChatBubbleProps };
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/modules/airene-chat-bubble.props.ts
|
|
21
|
+
var airene_chat_bubble_props_exports = {};
|
|
22
|
+
__export(airene_chat_bubble_props_exports, {
|
|
23
|
+
aireneChatBubbleEmit: () => aireneChatBubbleEmit,
|
|
24
|
+
aireneChatBubbleProps: () => aireneChatBubbleProps
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(airene_chat_bubble_props_exports);
|
|
27
|
+
var aireneChatBubbleProps = {
|
|
28
|
+
id: {
|
|
29
|
+
type: String,
|
|
30
|
+
default: ""
|
|
31
|
+
},
|
|
32
|
+
title: {
|
|
33
|
+
type: String,
|
|
34
|
+
default: "Airene"
|
|
35
|
+
},
|
|
36
|
+
variant: {
|
|
37
|
+
type: String,
|
|
38
|
+
default: "answer"
|
|
39
|
+
},
|
|
40
|
+
avatarSrc: {
|
|
41
|
+
type: String,
|
|
42
|
+
default: ""
|
|
43
|
+
},
|
|
44
|
+
fullScreenLabel: {
|
|
45
|
+
type: String,
|
|
46
|
+
default: "Full screen"
|
|
47
|
+
},
|
|
48
|
+
isLoading: {
|
|
49
|
+
type: Boolean,
|
|
50
|
+
default: false
|
|
51
|
+
},
|
|
52
|
+
isShowFullScreen: {
|
|
53
|
+
type: Boolean,
|
|
54
|
+
default: false
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
var aireneChatBubbleEmit = ["click-full-screen"];
|
|
58
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
59
|
+
0 && (module.exports = {
|
|
60
|
+
aireneChatBubbleEmit,
|
|
61
|
+
aireneChatBubbleProps
|
|
62
|
+
});
|
package/package.json
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@mekari/pixel3-airene-chat-bubble",
|
|
3
|
+
"description": "Mekari Pixel 3 | Chat Bubble component for Airene.",
|
|
4
|
+
"version": "0.1.0-dev.0",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist"
|
|
9
|
+
],
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"@mekari/pixel3-avatar": "0.0.18-dev.4",
|
|
12
|
+
"@mekari/pixel3-text": "0.0.17-dev.4",
|
|
13
|
+
"@mekari/pixel3-icon": "0.0.18-dev.4",
|
|
14
|
+
"@mekari/pixel3-styled-system": "0.1.3-dev.4",
|
|
15
|
+
"@mekari/pixel3-utils": "0.0.7"
|
|
16
|
+
},
|
|
17
|
+
"peerDependencies": {
|
|
18
|
+
"vue": "^3.4.9"
|
|
19
|
+
},
|
|
20
|
+
"devDependencies": {
|
|
21
|
+
"vue": "^3.4.9"
|
|
22
|
+
},
|
|
23
|
+
"publishConfig": {
|
|
24
|
+
"access": "public"
|
|
25
|
+
},
|
|
26
|
+
"module": "dist/index.mjs",
|
|
27
|
+
"types": "dist/index.d.ts",
|
|
28
|
+
"exports": {
|
|
29
|
+
".": {
|
|
30
|
+
"types": "./dist/index.d.ts",
|
|
31
|
+
"require": "./dist/index.js",
|
|
32
|
+
"default": "./dist/index.mjs"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"scripts": {
|
|
36
|
+
"clean": "rimraf dist .turbo",
|
|
37
|
+
"build": "tsup && pnpm build:types",
|
|
38
|
+
"build:fast": "tsup",
|
|
39
|
+
"build:types": "tsup src --dts-only",
|
|
40
|
+
"types:check": "tsc --noEmit",
|
|
41
|
+
"replace-config": "clean-package",
|
|
42
|
+
"restore-config": "clean-package restore"
|
|
43
|
+
}
|
|
44
|
+
}
|