hanbiro-react16-sdk 1.0.22 → 1.0.23

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.
Files changed (38) hide show
  1. package/dist/components/ChatAIDraft/EmptyState.d.ts +6 -0
  2. package/dist/components/ChatAIDraft/EmptyState.js +220 -0
  3. package/dist/components/ChatAIDraft/List.js +55 -18
  4. package/dist/components/ChatAIDraft/SettingPopper.d.ts +5 -4
  5. package/dist/components/ChatAIDraft/SettingPopper.js +235 -79
  6. package/dist/components/ChatAIDraft/constants.d.ts +4 -0
  7. package/dist/components/ChatAIDraft/constants.js +18 -0
  8. package/dist/components/ChatAIDraft/index.d.ts +5 -8
  9. package/dist/components/ChatAIDraft/index.js +80 -48
  10. package/dist/components/index.d.ts +1 -1
  11. package/dist/hanbiro-react16-sdk.style.css +39 -2
  12. package/dist/hanbiro-react16-sdk.umd.js +2258 -1698
  13. package/dist/index.js +2 -2
  14. package/dist/node_modules/prop-types/index.js +1 -2
  15. package/dist/node_modules/react-feather/dist/icons/align-justify.js +86 -0
  16. package/dist/node_modules/react-feather/dist/icons/{send.js → arrow-up.js} +10 -10
  17. package/dist/node_modules/react-feather/dist/icons/award.js +72 -0
  18. package/dist/node_modules/react-feather/dist/icons/check.js +68 -0
  19. package/dist/node_modules/react-feather/dist/icons/chevron-down.js +68 -0
  20. package/dist/node_modules/react-feather/dist/icons/compass.js +72 -0
  21. package/dist/node_modules/react-feather/dist/icons/file-text.js +82 -0
  22. package/dist/node_modules/react-feather/dist/icons/frown.js +82 -0
  23. package/dist/node_modules/react-feather/dist/icons/heart.js +68 -0
  24. package/dist/node_modules/react-feather/dist/icons/message-circle.js +68 -0
  25. package/dist/node_modules/react-feather/dist/icons/message-square.js +68 -0
  26. package/dist/node_modules/react-feather/dist/icons/scissors.js +89 -0
  27. package/dist/node_modules/react-feather/dist/icons/smile.js +82 -0
  28. package/dist/node_modules/react-feather/dist/icons/thumbs-up.js +68 -0
  29. package/dist/node_modules/react-feather/dist/icons/zap.js +68 -0
  30. package/package.json +1 -1
  31. package/dist/components/TinyMceEditor/index.js +0 -181
  32. package/dist/components/TinyMceEditor/scrollStyle.js +0 -40
  33. package/dist/components/TinyMceEditor/useEditor.js +0 -120
  34. package/dist/node_modules/@tinymce/tinymce-react/lib/es2015/main/ts/ScriptLoader2.js +0 -148
  35. package/dist/node_modules/@tinymce/tinymce-react/lib/es2015/main/ts/TinyMCE.js +0 -7
  36. package/dist/node_modules/@tinymce/tinymce-react/lib/es2015/main/ts/Utils.js +0 -103
  37. package/dist/node_modules/@tinymce/tinymce-react/lib/es2015/main/ts/components/Editor.js +0 -353
  38. package/dist/node_modules/@tinymce/tinymce-react/lib/es2015/main/ts/components/EditorPropTypes.js +0 -102
@@ -0,0 +1,6 @@
1
+ import * as React from "react";
2
+ interface EmptyStateProps {
3
+ onSelectPrompt: (text: string) => void;
4
+ }
5
+ declare const EmptyState: React.FunctionComponent<EmptyStateProps>;
6
+ export default EmptyState;
@@ -0,0 +1,220 @@
1
+ import * as React from "react";
2
+ import CustomAiIcon from "./CustomAIIcon.js";
3
+ import MessageSquare from "../../node_modules/react-feather/dist/icons/message-square.js";
4
+ import MessageCircle from "../../node_modules/react-feather/dist/icons/message-circle.js";
5
+ import Check from "../../node_modules/react-feather/dist/icons/check.js";
6
+ const FEATURES = [
7
+ {
8
+ icon: /* @__PURE__ */ React.createElement(MessageCircle, { size: 16 }),
9
+ title: "Request via message",
10
+ desc: 'e.g., "Draft an email to Director Hong proposing a Q3 collaboration meeting (May 20, 3 PM)"'
11
+ },
12
+ {
13
+ icon: /* @__PURE__ */ React.createElement(CustomAiIcon, { size: 16, stroke: 2 }),
14
+ title: "AI generates a draft",
15
+ desc: "Refine the draft freely with follow-ups like 'more polite' or 'add a deadline'."
16
+ },
17
+ {
18
+ icon: /* @__PURE__ */ React.createElement(Check, { size: 16 }),
19
+ title: "Apply to body",
20
+ desc: "Insert the response you like into the email body and send."
21
+ }
22
+ ];
23
+ const SUGGESTIONS = [
24
+ "Propose a Q3 meeting to Director Hong (May 20, 3 PM)",
25
+ "Notify client of payment schedule (Due May 30)",
26
+ "Welcome message to new employee (Joining May 22)"
27
+ ];
28
+ const EmptyState = ({
29
+ onSelectPrompt
30
+ }) => {
31
+ return /* @__PURE__ */ React.createElement(
32
+ "div",
33
+ {
34
+ style: {
35
+ flex: 1,
36
+ minHeight: 0,
37
+ overflowY: "auto",
38
+ display: "flex",
39
+ flexDirection: "column",
40
+ paddingRight: 8,
41
+ marginRight: -8
42
+ }
43
+ },
44
+ /* @__PURE__ */ React.createElement("div", { style: { textAlign: "center", marginTop: 8 } }, /* @__PURE__ */ React.createElement(
45
+ "div",
46
+ {
47
+ style: {
48
+ fontSize: 14,
49
+ fontWeight: 600,
50
+ color: "var(--text-primary)",
51
+ lineHeight: 1.5
52
+ }
53
+ },
54
+ "Let's draft a new email together from scratch."
55
+ ), /* @__PURE__ */ React.createElement(
56
+ "div",
57
+ {
58
+ style: {
59
+ fontSize: 13,
60
+ color: "var(--text-secondary)",
61
+ marginTop: 4
62
+ }
63
+ },
64
+ "Tell me what kind of email you'd like to write."
65
+ )),
66
+ /* @__PURE__ */ React.createElement(
67
+ "div",
68
+ {
69
+ style: {
70
+ alignSelf: "center",
71
+ width: 120,
72
+ height: 120,
73
+ borderRadius: "50%",
74
+ background: "var(--primary-lighter)",
75
+ display: "flex",
76
+ alignItems: "center",
77
+ justifyContent: "center",
78
+ margin: "20px 0",
79
+ color: "var(--primary-main)"
80
+ }
81
+ },
82
+ /* @__PURE__ */ React.createElement(CustomAiIcon, { size: 56, stroke: 1.5 })
83
+ ),
84
+ /* @__PURE__ */ React.createElement("div", { style: { textAlign: "center" } }, /* @__PURE__ */ React.createElement(
85
+ "div",
86
+ {
87
+ style: {
88
+ fontSize: 13,
89
+ color: "var(--text-secondary)",
90
+ lineHeight: 1.6
91
+ }
92
+ },
93
+ "Give me the recipient, purpose, and key points",
94
+ /* @__PURE__ */ React.createElement("br", null),
95
+ "and AI will generate a polished draft."
96
+ )),
97
+ /* @__PURE__ */ React.createElement(
98
+ "div",
99
+ {
100
+ style: {
101
+ borderTop: "1px solid var(--border-light)",
102
+ marginTop: 20,
103
+ paddingTop: 16,
104
+ display: "flex",
105
+ flexDirection: "column",
106
+ gap: 14
107
+ }
108
+ },
109
+ FEATURES.map((f, i) => /* @__PURE__ */ React.createElement(
110
+ "div",
111
+ {
112
+ key: i,
113
+ style: {
114
+ display: "flex",
115
+ flexDirection: "row",
116
+ alignItems: "flex-start",
117
+ gap: 10
118
+ }
119
+ },
120
+ /* @__PURE__ */ React.createElement(
121
+ "div",
122
+ {
123
+ style: {
124
+ width: 28,
125
+ height: 28,
126
+ borderRadius: "50%",
127
+ background: "var(--background-softGrey)",
128
+ color: "var(--primary-main)",
129
+ display: "flex",
130
+ alignItems: "center",
131
+ justifyContent: "center",
132
+ flexShrink: 0
133
+ }
134
+ },
135
+ f.icon
136
+ ),
137
+ /* @__PURE__ */ React.createElement("div", { style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ React.createElement(
138
+ "div",
139
+ {
140
+ style: {
141
+ fontSize: 13,
142
+ fontWeight: 600,
143
+ color: "var(--text-primary)"
144
+ }
145
+ },
146
+ f.title
147
+ ), /* @__PURE__ */ React.createElement(
148
+ "div",
149
+ {
150
+ style: {
151
+ fontSize: 12,
152
+ color: "var(--text-secondary)",
153
+ marginTop: 2,
154
+ lineHeight: 1.5
155
+ }
156
+ },
157
+ f.desc
158
+ ))
159
+ ))
160
+ ),
161
+ /* @__PURE__ */ React.createElement(
162
+ "div",
163
+ {
164
+ style: {
165
+ borderTop: "1px solid var(--border-light)",
166
+ marginTop: 20,
167
+ paddingTop: 16
168
+ }
169
+ },
170
+ /* @__PURE__ */ React.createElement(
171
+ "div",
172
+ {
173
+ style: {
174
+ fontSize: 12,
175
+ color: "var(--text-secondary)",
176
+ marginBottom: 8
177
+ }
178
+ },
179
+ "💡 Try these prompts to get a draft right away"
180
+ ),
181
+ /* @__PURE__ */ React.createElement("div", { style: { display: "flex", flexDirection: "column", gap: 8 } }, SUGGESTIONS.map((s, i) => /* @__PURE__ */ React.createElement(
182
+ "button",
183
+ {
184
+ key: i,
185
+ type: "button",
186
+ onClick: () => onSelectPrompt(s),
187
+ style: {
188
+ display: "flex",
189
+ alignItems: "center",
190
+ gap: 8,
191
+ width: "100%",
192
+ padding: "10px 12px",
193
+ borderRadius: 8,
194
+ border: "none",
195
+ background: "var(--primary-lighter)",
196
+ color: "var(--text-primary)",
197
+ fontSize: 13,
198
+ textAlign: "left",
199
+ cursor: "pointer",
200
+ fontFamily: "inherit"
201
+ }
202
+ },
203
+ /* @__PURE__ */ React.createElement(
204
+ MessageSquare,
205
+ {
206
+ size: 14,
207
+ style: {
208
+ color: "var(--primary-main)",
209
+ flexShrink: 0
210
+ }
211
+ }
212
+ ),
213
+ /* @__PURE__ */ React.createElement("span", null, s)
214
+ )))
215
+ )
216
+ );
217
+ };
218
+ export {
219
+ EmptyState as default
220
+ };
@@ -21,9 +21,48 @@ var __async = (__this, __arguments, generator) => {
21
21
  import * as React from "react";
22
22
  import { marked } from "../../node_modules/marked/lib/marked.esm.js";
23
23
  import TypingText from "./TypingText.js";
24
- import LoadingCircular from "../LoadingCircular/index.js";
25
24
  import Tooltip from "../Tooltip/index.js";
26
25
  import Copy from "../../node_modules/react-feather/dist/icons/copy.js";
26
+ const AIAvatar = () => /* @__PURE__ */ React.createElement(
27
+ "div",
28
+ {
29
+ style: {
30
+ width: 28,
31
+ height: 28,
32
+ borderRadius: "50%",
33
+ background: "var(--primary-main)",
34
+ color: "var(--primary-contrasttext)",
35
+ display: "flex",
36
+ alignItems: "center",
37
+ justifyContent: "center",
38
+ fontSize: 11,
39
+ fontWeight: 700,
40
+ letterSpacing: 0.5,
41
+ flexShrink: 0
42
+ }
43
+ },
44
+ "AI"
45
+ );
46
+ const LoadingDots = ({
47
+ label = "Thinking"
48
+ }) => /* @__PURE__ */ React.createElement(
49
+ "div",
50
+ {
51
+ style: {
52
+ display: "inline-flex",
53
+ alignItems: "center",
54
+ gap: 6,
55
+ background: "var(--background-softGrey)",
56
+ borderRadius: 8,
57
+ borderTopLeftRadius: 0,
58
+ padding: "8px 12px",
59
+ fontSize: 13,
60
+ color: "var(--text-secondary)"
61
+ }
62
+ },
63
+ /* @__PURE__ */ React.createElement("span", null, label),
64
+ /* @__PURE__ */ React.createElement("span", { className: "chat-ai-dots", "aria-hidden": "true" }, /* @__PURE__ */ React.createElement("span", null), /* @__PURE__ */ React.createElement("span", null), /* @__PURE__ */ React.createElement("span", null))
65
+ );
27
66
  const List = ({
28
67
  items,
29
68
  onApply,
@@ -88,7 +127,8 @@ const List = ({
88
127
  borderRadius: 8,
89
128
  borderTopRightRadius: 0,
90
129
  padding: "8px 12px",
91
- background: "var(--background-softGrey)"
130
+ background: "var(--primary-main)",
131
+ color: "var(--primary-contrasttext)"
92
132
  }
93
133
  }
94
134
  )
@@ -100,22 +140,24 @@ const List = ({
100
140
  width: "100%",
101
141
  display: "flex",
102
142
  alignItems: "flex-start",
103
- flexDirection: "column",
143
+ flexDirection: "row",
104
144
  position: "relative",
105
- marginTop: 8
145
+ marginTop: 8,
146
+ gap: 8
106
147
  }
107
148
  },
108
- (_item == null ? void 0 : _item.isLoading) ? /* @__PURE__ */ React.createElement(LoadingCircular, { size: 32 }) : /* @__PURE__ */ React.createElement(
149
+ /* @__PURE__ */ React.createElement(AIAvatar, null),
150
+ /* @__PURE__ */ React.createElement(
109
151
  "div",
110
152
  {
111
153
  style: {
154
+ flex: 1,
155
+ minWidth: 0,
112
156
  display: "flex",
113
- flexDirection: "row",
114
- alignItems: "flex-end",
115
- width: "100%"
157
+ flexDirection: "column"
116
158
  }
117
159
  },
118
- /* @__PURE__ */ React.createElement(
160
+ (_item == null ? void 0 : _item.isLoading) ? /* @__PURE__ */ React.createElement(LoadingDots, null) : /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
119
161
  TypingText,
120
162
  {
121
163
  data: { subject: _item.subject, body: _item.body },
@@ -123,24 +165,19 @@ const List = ({
123
165
  background: "var(--background-softGrey)",
124
166
  borderRadius: 8,
125
167
  borderTopLeftRadius: 0,
126
- padding: "8px 12px",
127
- flexShrink: 0
168
+ padding: "8px 12px"
128
169
  }
129
170
  }
130
- ),
131
- /* @__PURE__ */ React.createElement(Tooltip, { title: "Apply content" }, /* @__PURE__ */ React.createElement(
171
+ ), /* @__PURE__ */ React.createElement("div", { style: { marginTop: 4 } }, /* @__PURE__ */ React.createElement(Tooltip, { title: "Apply content" }, /* @__PURE__ */ React.createElement(
132
172
  "button",
133
173
  {
134
174
  type: "button",
135
175
  onClick: () => handleApply(_item.body),
136
176
  color: "primary",
137
- className: "icon-button small",
138
- style: {
139
- marginLeft: 4
140
- }
177
+ className: "icon-button small"
141
178
  },
142
179
  /* @__PURE__ */ React.createElement(Copy, { size: 16 })
143
- ))
180
+ ))))
144
181
  )
145
182
  )
146
183
  ))
@@ -3,9 +3,10 @@ import * as React from "react";
3
3
  interface SettingPopperProps {
4
4
  lang: LabelValue | null;
5
5
  setLang: (lang: LabelValue | null) => void;
6
- originalEmail: string;
7
- setOriginalEmail: (email: string) => void;
8
- getEditorContent?: () => string;
6
+ tone: LabelValue | null;
7
+ setTone: (tone: LabelValue | null) => void;
8
+ length: LabelValue | null;
9
+ setLength: (length: LabelValue | null) => void;
9
10
  parentRef?: React.RefObject<HTMLDivElement>;
10
11
  }
11
12
  interface SettingPopperState {
@@ -21,7 +22,7 @@ declare class SettingPopper extends React.Component<SettingPopperProps, SettingP
21
22
  getLanguageOptions: () => Promise<void>;
22
23
  handleClickOutside: (event: MouseEvent) => void;
23
24
  togglePopper: () => void;
24
- handleLangChange: (e: React.ChangeEvent<HTMLSelectElement>) => void;
25
+ renderChipGroup: (options: LabelValue[], selected: LabelValue | null, onSelect: (opt: LabelValue) => void, iconMap: Record<string, React.ReactNode>, columns?: number) => React.JSX.Element;
25
26
  render(): React.JSX.Element;
26
27
  }
27
28
  export default SettingPopper;