m2m-components 5.0.5-alpha-b40d047.0 → 5.0.5-alpha-1718877026648-2c95198.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.
Files changed (92) hide show
  1. package/MenuBaseElement.mjs +2 -2
  2. package/{chunk-ZFAN72NV.mjs → chunk-5N273IY3.mjs} +3 -3
  3. package/{chunk-UXYQOQLC.mjs → chunk-ARKJVMNQ.mjs} +2 -2
  4. package/{chunk-AEK4UZ4X.mjs → chunk-B7ZCWRQS.mjs} +2 -2
  5. package/{chunk-2IIVHPAK.mjs → chunk-BZI57PP7.mjs} +2 -2
  6. package/{chunk-Q7CIWPU3.mjs → chunk-CC5RJYL7.mjs} +3 -3
  7. package/{chunk-FDRD4YS4.mjs → chunk-CTGSJWXT.mjs} +2 -2
  8. package/{chunk-ZJMVNDL3.mjs → chunk-DQ7HQOOU.mjs} +2 -2
  9. package/{chunk-AWTUIRQ2.mjs → chunk-JTZEHJPB.mjs} +2 -2
  10. package/{chunk-DK62FZ7A.mjs → chunk-LAH6LOT7.mjs} +2 -2
  11. package/{chunk-5AGE3LMI.mjs → chunk-M2D55I4L.mjs} +2 -2
  12. package/{chunk-DPBDUYMO.mjs → chunk-PQWXZDET.mjs} +2 -2
  13. package/chunk-QH5I6YL2.mjs +21 -0
  14. package/chunk-RDG67OF7.mjs +231 -0
  15. package/chunk-RDG67OF7.mjs.map +1 -0
  16. package/{chunk-27STFQPU.mjs → chunk-SS7VKGY7.mjs} +2 -2
  17. package/{chunk-IYTHV2XJ.mjs → chunk-SXIYWN76.mjs} +2 -2
  18. package/{chunk-RVG3UD3S.mjs → chunk-V65OEKRZ.mjs} +4 -4
  19. package/domains.mjs +1 -1
  20. package/endpoints/m2m-notifications.mjs +2 -2
  21. package/endpoints/m2m-notifications.v1.mjs +2 -2
  22. package/endpoints/m2m-users.mjs +2 -2
  23. package/endpoints/m2m-users.v1.mjs +2 -2
  24. package/endpoints/matsuri-forms.mjs +2 -2
  25. package/endpoints/matsuri-forms.v1.mjs +2 -2
  26. package/feedback/MultipleTextQuestion.d.mts +2 -2
  27. package/feedback/MultipleTextQuestion.d.ts +2 -2
  28. package/feedback/MultipleTextQuestion.js +1 -1
  29. package/feedback/MultipleTextQuestion.mjs +2 -2
  30. package/feedback/SelectQuestion.d.mts +2 -2
  31. package/feedback/SelectQuestion.d.ts +2 -2
  32. package/feedback/SelectQuestion.js +1 -1
  33. package/feedback/SelectQuestion.mjs +2 -2
  34. package/feedback/getRandomId.mjs +1 -1
  35. package/feedback/index.d.mts +2 -2
  36. package/feedback/index.d.ts +2 -2
  37. package/feedback/index.js +50 -8884
  38. package/feedback/index.js.map +1 -1
  39. package/feedback/index.mjs +4 -4
  40. package/index.js +11 -6
  41. package/index.js.map +1 -1
  42. package/index.mjs +11 -11
  43. package/initM2mComponents.mjs +1 -1
  44. package/m2m-apps-menu.mjs +3 -3
  45. package/m2m-releases-link.mjs +1 -1
  46. package/m2m-user-menu.mjs +3 -3
  47. package/notification/NotificationProvider.d.mts +2 -2
  48. package/notification/NotificationProvider.d.ts +2 -2
  49. package/notification/NotificationProvider.js +2 -2
  50. package/notification/NotificationProvider.mjs +4 -4
  51. package/notification/ServiceIdProvider.d.mts +2 -2
  52. package/notification/ServiceIdProvider.d.ts +2 -2
  53. package/notification/ServiceIdProvider.js +1 -1
  54. package/notification/ServiceIdProvider.mjs +2 -2
  55. package/notification/api.mjs +3 -3
  56. package/notification/index.d.mts +1 -1
  57. package/notification/index.d.ts +1 -1
  58. package/notification/index.js +2 -2
  59. package/notification/index.mjs +5 -5
  60. package/package.json +5 -1
  61. package/releases/t.mjs +1 -1
  62. package/storage/api/getToken.mjs +3 -3
  63. package/storage/api/login.mjs +3 -3
  64. package/storage/client.mjs +1 -1
  65. package/storage/hub.mjs +1 -1
  66. package/storage/jwt.mjs +1 -1
  67. package/storage/lib/client.mjs +1 -1
  68. package/storage/lib/hub.mjs +1 -1
  69. package/storage/persistenceDatabase.mjs +1 -1
  70. package/storage/refreshAuth.mjs +4 -4
  71. package/storage/useM2mAuth.d.mts +2 -2
  72. package/storage/useM2mAuth.d.ts +2 -2
  73. package/storage/useM2mAuth.js +1 -1
  74. package/storage/useM2mAuth.mjs +6 -6
  75. package/chunk-2LETE7K2.mjs +0 -9063
  76. package/chunk-2LETE7K2.mjs.map +0 -1
  77. package/chunk-IVVIQZ5Y.mjs +0 -59
  78. /package/{chunk-ZFAN72NV.mjs.map → chunk-5N273IY3.mjs.map} +0 -0
  79. /package/{chunk-UXYQOQLC.mjs.map → chunk-ARKJVMNQ.mjs.map} +0 -0
  80. /package/{chunk-AEK4UZ4X.mjs.map → chunk-B7ZCWRQS.mjs.map} +0 -0
  81. /package/{chunk-2IIVHPAK.mjs.map → chunk-BZI57PP7.mjs.map} +0 -0
  82. /package/{chunk-Q7CIWPU3.mjs.map → chunk-CC5RJYL7.mjs.map} +0 -0
  83. /package/{chunk-FDRD4YS4.mjs.map → chunk-CTGSJWXT.mjs.map} +0 -0
  84. /package/{chunk-ZJMVNDL3.mjs.map → chunk-DQ7HQOOU.mjs.map} +0 -0
  85. /package/{chunk-AWTUIRQ2.mjs.map → chunk-JTZEHJPB.mjs.map} +0 -0
  86. /package/{chunk-DK62FZ7A.mjs.map → chunk-LAH6LOT7.mjs.map} +0 -0
  87. /package/{chunk-5AGE3LMI.mjs.map → chunk-M2D55I4L.mjs.map} +0 -0
  88. /package/{chunk-DPBDUYMO.mjs.map → chunk-PQWXZDET.mjs.map} +0 -0
  89. /package/{chunk-IVVIQZ5Y.mjs.map → chunk-QH5I6YL2.mjs.map} +0 -0
  90. /package/{chunk-27STFQPU.mjs.map → chunk-SS7VKGY7.mjs.map} +0 -0
  91. /package/{chunk-IYTHV2XJ.mjs.map → chunk-SXIYWN76.mjs.map} +0 -0
  92. /package/{chunk-RVG3UD3S.mjs.map → chunk-V65OEKRZ.mjs.map} +0 -0
@@ -1,8 +1,8 @@
1
1
  'use client'
2
2
  import {
3
3
  MenuBaseElement
4
- } from "./chunk-2IIVHPAK.mjs";
5
- import "./chunk-IVVIQZ5Y.mjs";
4
+ } from "./chunk-BZI57PP7.mjs";
5
+ import "./chunk-QH5I6YL2.mjs";
6
6
  export {
7
7
  MenuBaseElement
8
8
  };
@@ -1,13 +1,13 @@
1
1
  'use client'
2
2
  import {
3
3
  MenuBaseElement
4
- } from "./chunk-2IIVHPAK.mjs";
4
+ } from "./chunk-BZI57PP7.mjs";
5
5
  import {
6
6
  getDomains
7
7
  } from "./chunk-B7STDXYN.mjs";
8
8
  import {
9
9
  __decorateClass
10
- } from "./chunk-IVVIQZ5Y.mjs";
10
+ } from "./chunk-QH5I6YL2.mjs";
11
11
 
12
12
  // src/m2m-apps-menu.ts
13
13
  import { customElement } from "lit/decorators.js";
@@ -75,4 +75,4 @@ M2MAppsMenu = __decorateClass([
75
75
  export {
76
76
  M2MAppsMenu
77
77
  };
78
- //# sourceMappingURL=chunk-ZFAN72NV.mjs.map
78
+ //# sourceMappingURL=chunk-5N273IY3.mjs.map
@@ -2,7 +2,7 @@
2
2
 
3
3
  // src/notification/ServiceIdProvider.tsx
4
4
  import React, { createContext, useMemo } from "react";
5
- import { jsx } from "react/jsx-runtime";
5
+ import { jsx } from "@emotion/react/jsx-runtime";
6
6
  var ServiceIdContext = createContext(
7
7
  void 0
8
8
  );
@@ -25,4 +25,4 @@ export {
25
25
  ServiceIdProvider,
26
26
  useServiceId
27
27
  };
28
- //# sourceMappingURL=chunk-UXYQOQLC.mjs.map
28
+ //# sourceMappingURL=chunk-ARKJVMNQ.mjs.map
@@ -1,7 +1,7 @@
1
1
  'use client'
2
2
  import {
3
3
  login
4
- } from "./chunk-27STFQPU.mjs";
4
+ } from "./chunk-SS7VKGY7.mjs";
5
5
 
6
6
  // src/storage/api/login.ts
7
7
  import { fetcher } from "matsuri-hooks";
@@ -15,4 +15,4 @@ var requestLogin = async (input) => {
15
15
  export {
16
16
  requestLogin
17
17
  };
18
- //# sourceMappingURL=chunk-AEK4UZ4X.mjs.map
18
+ //# sourceMappingURL=chunk-B7ZCWRQS.mjs.map
@@ -1,7 +1,7 @@
1
1
  'use client'
2
2
  import {
3
3
  __decorateClass
4
- } from "./chunk-IVVIQZ5Y.mjs";
4
+ } from "./chunk-QH5I6YL2.mjs";
5
5
 
6
6
  // src/MenuBaseElement.ts
7
7
  import { LitElement, css } from "lit";
@@ -151,4 +151,4 @@ __decorateClass([
151
151
  export {
152
152
  MenuBaseElement
153
153
  };
154
- //# sourceMappingURL=chunk-2IIVHPAK.mjs.map
154
+ //# sourceMappingURL=chunk-BZI57PP7.mjs.map
@@ -4,13 +4,13 @@ import {
4
4
  } from "./chunk-B6FEFIYC.mjs";
5
5
  import {
6
6
  MenuBaseElement
7
- } from "./chunk-2IIVHPAK.mjs";
7
+ } from "./chunk-BZI57PP7.mjs";
8
8
  import {
9
9
  getDomains
10
10
  } from "./chunk-B7STDXYN.mjs";
11
11
  import {
12
12
  __decorateClass
13
- } from "./chunk-IVVIQZ5Y.mjs";
13
+ } from "./chunk-QH5I6YL2.mjs";
14
14
 
15
15
  // src/m2m-user-menu.ts
16
16
  import { customElement } from "lit/decorators.js";
@@ -71,4 +71,4 @@ M2MUserMenu = __decorateClass([
71
71
  export {
72
72
  M2MUserMenu
73
73
  };
74
- //# sourceMappingURL=chunk-Q7CIWPU3.mjs.map
74
+ //# sourceMappingURL=chunk-CC5RJYL7.mjs.map
@@ -2,7 +2,7 @@
2
2
 
3
3
  // src/feedback/SelectQuestion.tsx
4
4
  import { Checkbox } from "matsuri-ui";
5
- import { jsx } from "react/jsx-runtime";
5
+ import { jsx } from "@emotion/react/jsx-runtime";
6
6
  var SelectQuestion = (props) => {
7
7
  return /* @__PURE__ */ jsx(
8
8
  "div",
@@ -31,4 +31,4 @@ var SelectQuestion = (props) => {
31
31
  export {
32
32
  SelectQuestion
33
33
  };
34
- //# sourceMappingURL=chunk-FDRD4YS4.mjs.map
34
+ //# sourceMappingURL=chunk-CTGSJWXT.mjs.map
@@ -1,7 +1,7 @@
1
1
  'use client'
2
2
  import {
3
3
  getToken
4
- } from "./chunk-27STFQPU.mjs";
4
+ } from "./chunk-SS7VKGY7.mjs";
5
5
 
6
6
  // src/storage/api/getToken.ts
7
7
  import { fetcher } from "matsuri-hooks";
@@ -15,4 +15,4 @@ var requestGetToken = async (input) => {
15
15
  export {
16
16
  requestGetToken
17
17
  };
18
- //# sourceMappingURL=chunk-ZJMVNDL3.mjs.map
18
+ //# sourceMappingURL=chunk-DQ7HQOOU.mjs.map
@@ -1,7 +1,7 @@
1
1
  'use client'
2
2
  import {
3
3
  m2mNotifications_v1
4
- } from "./chunk-5AGE3LMI.mjs";
4
+ } from "./chunk-M2D55I4L.mjs";
5
5
 
6
6
  // src/notification/api.ts
7
7
  import { fetcher } from "matsuri-hooks";
@@ -51,4 +51,4 @@ export {
51
51
  requestSubscribe,
52
52
  requestUnSubscribe
53
53
  };
54
- //# sourceMappingURL=chunk-AWTUIRQ2.mjs.map
54
+ //# sourceMappingURL=chunk-JTZEHJPB.mjs.map
@@ -7,7 +7,7 @@ import {
7
7
  } from "./chunk-JTG3PYLM.mjs";
8
8
  import {
9
9
  requestGetToken
10
- } from "./chunk-ZJMVNDL3.mjs";
10
+ } from "./chunk-DQ7HQOOU.mjs";
11
11
  import {
12
12
  m2mAuthTokenApi
13
13
  } from "./chunk-B6FEFIYC.mjs";
@@ -36,4 +36,4 @@ var refreshAuth = async () => {
36
36
  export {
37
37
  refreshAuth
38
38
  };
39
- //# sourceMappingURL=chunk-DK62FZ7A.mjs.map
39
+ //# sourceMappingURL=chunk-LAH6LOT7.mjs.map
@@ -1,7 +1,7 @@
1
1
  'use client'
2
2
  import {
3
3
  __export
4
- } from "./chunk-IVVIQZ5Y.mjs";
4
+ } from "./chunk-QH5I6YL2.mjs";
5
5
 
6
6
  // src/endpoints/m2m-notifications.v1.ts
7
7
  var m2m_notifications_v1_exports = {};
@@ -111,4 +111,4 @@ export {
111
111
  m2mNotifications_v1,
112
112
  m2m_notifications_v1_exports
113
113
  };
114
- //# sourceMappingURL=chunk-5AGE3LMI.mjs.map
114
+ //# sourceMappingURL=chunk-M2D55I4L.mjs.map
@@ -1,7 +1,7 @@
1
1
  'use client'
2
2
  import {
3
3
  __export
4
- } from "./chunk-IVVIQZ5Y.mjs";
4
+ } from "./chunk-QH5I6YL2.mjs";
5
5
 
6
6
  // src/endpoints/matsuri-forms.v1.ts
7
7
  var matsuri_forms_v1_exports = {};
@@ -286,4 +286,4 @@ export {
286
286
  matsuriForms_v1,
287
287
  matsuri_forms_v1_exports
288
288
  };
289
- //# sourceMappingURL=chunk-DPBDUYMO.mjs.map
289
+ //# sourceMappingURL=chunk-PQWXZDET.mjs.map
@@ -0,0 +1,21 @@
1
+ 'use client'
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __export = (target, all) => {
5
+ for (var name in all)
6
+ __defProp(target, name, { get: all[name], enumerable: true });
7
+ };
8
+ var __decorateClass = (decorators, target, key, kind) => {
9
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
10
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
11
+ if (decorator = decorators[i])
12
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
13
+ if (kind && result) __defProp(target, key, result);
14
+ return result;
15
+ };
16
+
17
+ export {
18
+ __export,
19
+ __decorateClass
20
+ };
21
+ //# sourceMappingURL=chunk-QH5I6YL2.mjs.map
@@ -0,0 +1,231 @@
1
+ 'use client'
2
+ import {
3
+ getRandomId
4
+ } from "./chunk-IH72EYIB.mjs";
5
+ import {
6
+ MultipleTextQuestion
7
+ } from "./chunk-SXIYWN76.mjs";
8
+ import {
9
+ SelectQuestion
10
+ } from "./chunk-CTGSJWXT.mjs";
11
+
12
+ // src/feedback/index.tsx
13
+ import {
14
+ Button,
15
+ Modal,
16
+ Portal,
17
+ Typography,
18
+ useAlert,
19
+ useModal
20
+ } from "matsuri-ui";
21
+ import {
22
+ MatsuriFormsQuestion,
23
+ MatsuriFormsQuestionProvider,
24
+ useMatsuriForms
25
+ } from "matsuri-forms-sdk";
26
+ import { createContext, useContext, useState } from "react";
27
+ import FeedbackIconBase from "@mui/icons-material/Feedback";
28
+ import { jsx, jsxs } from "@emotion/react/jsx-runtime";
29
+ import { createElement } from "@emotion/react";
30
+ var normalizeIcon = (Icon) => {
31
+ return Icon.default ? Icon.default : Icon;
32
+ };
33
+ var FeedbackIcon = normalizeIcon(FeedbackIconBase);
34
+ var getFormId = () => {
35
+ return globalThis.M2M_COMPONENTS_ENV === "production" ? "01GWRQ1MRS7PE29XGRETFZ6D7Y" : "01GTBSYMGPMX91E96P007SXEMH";
36
+ };
37
+ var TextQuestionContext = createContext({});
38
+ var TextQuestion = (props) => {
39
+ const context = useContext(TextQuestionContext);
40
+ return /* @__PURE__ */ jsx(
41
+ "input",
42
+ {
43
+ value: context[props.title],
44
+ type: "hidden",
45
+ name: props.name
46
+ }
47
+ );
48
+ };
49
+ var FeedbackProviderModal = (props) => {
50
+ const { questions, submit } = useMatsuriForms(getFormId(), {
51
+ dev: globalThis.M2M_COMPONENTS_ENV !== "production"
52
+ });
53
+ const { throwAlert } = useAlert();
54
+ const [status, setStatus] = useState(
55
+ "started"
56
+ );
57
+ const id = getRandomId();
58
+ return /* @__PURE__ */ jsx(
59
+ Modal,
60
+ {
61
+ backdrop: true,
62
+ width: 600,
63
+ maxWidth: 600,
64
+ header: /* @__PURE__ */ jsx(Typography, { variant: "h3", children: "\u30D5\u30A3\u30FC\u30C9\u30D0\u30C3\u30AF\u3092\u9001\u4FE1" }),
65
+ body: status === "completed" ? /* @__PURE__ */ jsxs(
66
+ "div",
67
+ {
68
+ style: {
69
+ display: "grid",
70
+ gap: 32
71
+ },
72
+ children: [
73
+ /* @__PURE__ */ jsx(Typography, { children: "\u30EC\u30DD\u30FC\u30C8\u3092\u9001\u4FE1\u3057\u307E\u3057\u305F\u3002\u3042\u308A\u304C\u3068\u3046\u3054\u3056\u3044\u307E\u3059\u3002" }),
74
+ /* @__PURE__ */ jsx(Typography, { color: "textSecondary", variant: "caption", as: "p", children: "\u304A\u9001\u308A\u3044\u305F\u3060\u3044\u305F\u30D5\u30A3\u30FC\u30C9\u30D0\u30C3\u30AF\u306F\u3001\u554F\u984C\u306E\u89E3\u6C7A\u3068\u30B5\u30FC\u30D3\u30B9\u306E\u6539\u5584\u306B\u5F79\u7ACB\u3066\u3055\u305B\u3066\u3044\u305F\u3060\u304D\u307E\u3059\u3002" }),
75
+ /* @__PURE__ */ jsx(
76
+ Button,
77
+ {
78
+ color: "primary",
79
+ variant: "filled",
80
+ onClick: () => {
81
+ var _a;
82
+ (_a = props.onClose) == null ? void 0 : _a.call(props);
83
+ },
84
+ children: "\u9589\u3058\u308B"
85
+ }
86
+ )
87
+ ]
88
+ }
89
+ ) : /* @__PURE__ */ jsxs(
90
+ "form",
91
+ {
92
+ style: {
93
+ display: "grid",
94
+ gap: 24
95
+ },
96
+ onSubmit: async (event) => {
97
+ event.preventDefault();
98
+ setStatus("sending");
99
+ const { error } = await submit(event.currentTarget);
100
+ const input = {
101
+ id,
102
+ userId: props.userId,
103
+ userName: props.userName,
104
+ serviceName: props.serviceName,
105
+ url: window.location.href
106
+ };
107
+ throwAlert(error, {
108
+ ignoreSuccess: true,
109
+ errorMessage: {
110
+ reason: "\u30B5\u30FC\u30D0\u30FC\u5074\u306E\u30A8\u30E9\u30FC\u306E\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059\u3002",
111
+ action: "\u3057\u3070\u3089\u304F\u6642\u9593\u3092\u7A7A\u3051\u3066\u8A66\u3059\u304B\u3001\u958B\u767A\u30C1\u30FC\u30E0\u3078\u304A\u554F\u3044\u5408\u308F\u305B\u304F\u3060\u3055\u3044\u3002",
112
+ happend: "\u30D5\u30A3\u30FC\u30C9\u30D0\u30C3\u30AF\u306E\u9001\u4FE1\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002"
113
+ },
114
+ onSuccess: () => {
115
+ var _a, _b, _c;
116
+ (_c = (_b = (_a = props.datadogLogs) == null ? void 0 : _a.logger) == null ? void 0 : _b.info) == null ? void 0 : _c.call(
117
+ _b,
118
+ `Feedback: ${id} by ${props.userId}`,
119
+ {
120
+ input
121
+ }
122
+ );
123
+ window.setTimeout(() => {
124
+ setStatus("completed");
125
+ }, 2e3);
126
+ },
127
+ onError: () => {
128
+ var _a, _b, _c;
129
+ (_c = (_b = (_a = props.datadogLogs) == null ? void 0 : _a.logger) == null ? void 0 : _b.error) == null ? void 0 : _c.call(
130
+ _b,
131
+ `Failed Feedback: ${input.id} by ${input.userId}`,
132
+ { input, error }
133
+ );
134
+ window.setTimeout(() => {
135
+ setStatus("started");
136
+ }, 2e3);
137
+ }
138
+ });
139
+ },
140
+ children: [
141
+ /* @__PURE__ */ jsx(
142
+ TextQuestionContext.Provider,
143
+ {
144
+ value: {
145
+ userId: props.userId,
146
+ userName: props.userName,
147
+ serviceName: props.serviceName,
148
+ url: window.location.href,
149
+ id
150
+ },
151
+ children: /* @__PURE__ */ jsx(
152
+ MatsuriFormsQuestionProvider,
153
+ {
154
+ renderSelect: SelectQuestion,
155
+ renderMultilineText: MultipleTextQuestion,
156
+ renderText: TextQuestion,
157
+ children: questions.map((question) => {
158
+ return /* @__PURE__ */ createElement(MatsuriFormsQuestion, { ...question, key: question.id });
159
+ })
160
+ }
161
+ )
162
+ }
163
+ ),
164
+ /* @__PURE__ */ jsxs("div", { children: [
165
+ /* @__PURE__ */ jsx(
166
+ Button,
167
+ {
168
+ type: "submit",
169
+ color: "primary",
170
+ variant: "filled",
171
+ disabled: status === "sending",
172
+ fullWidth: true,
173
+ children: "\u9001\u4FE1"
174
+ }
175
+ ),
176
+ /* @__PURE__ */ jsxs(
177
+ Typography,
178
+ {
179
+ variant: "caption",
180
+ style: {
181
+ float: "right"
182
+ },
183
+ children: [
184
+ status === "sending" ? "\u9001\u4FE1\u4E2D..." : void 0,
185
+ "\xA0"
186
+ ]
187
+ }
188
+ )
189
+ ] })
190
+ ]
191
+ }
192
+ ),
193
+ ...props
194
+ }
195
+ );
196
+ };
197
+ var FeedbackProvider = ({
198
+ children,
199
+ ...modalProps
200
+ }) => {
201
+ const [open] = useModal(FeedbackProviderModal, {
202
+ enableClickOutside: true,
203
+ disableClose: false
204
+ });
205
+ return /* @__PURE__ */ jsxs("div", { children: [
206
+ children,
207
+ /* @__PURE__ */ jsx(Portal, { children: /* @__PURE__ */ jsx(
208
+ Button,
209
+ {
210
+ style: {
211
+ position: "fixed",
212
+ bottom: 16,
213
+ right: 16
214
+ },
215
+ onClick: () => {
216
+ open(modalProps);
217
+ },
218
+ type: "button",
219
+ icon: /* @__PURE__ */ jsx(FeedbackIcon, {}),
220
+ color: "secondary",
221
+ variant: "filled",
222
+ rounded: true
223
+ }
224
+ ) })
225
+ ] });
226
+ };
227
+
228
+ export {
229
+ FeedbackProvider
230
+ };
231
+ //# sourceMappingURL=chunk-RDG67OF7.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/feedback/index.tsx"],"sourcesContent":["import {\n Button,\n Modal,\n ModalProps,\n Portal,\n Typography,\n useAlert,\n useModal,\n} from \"matsuri-ui\";\nimport { type Logger } from \"@datadog/browser-logs\";\nimport {\n MatsuriFormsQuestion,\n MatsuriFormsQuestionProvider,\n MatsuriFormsTextQuestionProps,\n useMatsuriForms,\n} from \"matsuri-forms-sdk\";\nimport { MultipleTextQuestion } from \"./MultipleTextQuestion\";\nimport { PropsWithChildren, createContext, useContext, useState } from \"react\";\nimport { SelectQuestion } from \"./SelectQuestion\";\nimport { getRandomId } from \"./getRandomId\";\nimport FeedbackIconBase from \"@mui/icons-material/Feedback\";\n\n/**\n * これはワークアラウンドです。\n * これを行わずに、MuiIconをそのまま使うと、トランスパイル後のコードで次のようなエラーが発生し、コンポーネントを描画できなくなります。\n * `Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object.`\n * 関連リンク:\n * https://stackoverflow.com/questions/72008357/mui-icons-used-in-shared-react-component-library-wont-render-error-element-ty\n * https://github.com/mui/material-ui/issues/35535\n */\nconst normalizeIcon = <T,>(Icon: T): T => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access\n return ((Icon as any).default ? (Icon as any).default : Icon) as T;\n};\nconst FeedbackIcon = normalizeIcon(FeedbackIconBase);\n\nconst getFormId = () => {\n return globalThis.M2M_COMPONENTS_ENV === \"production\"\n ? \"01GWRQ1MRS7PE29XGRETFZ6D7Y\"\n : \"01GTBSYMGPMX91E96P007SXEMH\";\n};\n\ninterface TextQuestionContextValue {\n userId?: string;\n userName?: string;\n serviceName?: string;\n url?: string;\n id?: string;\n}\n\nconst TextQuestionContext = createContext<TextQuestionContextValue>({});\n\nconst TextQuestion = (props: MatsuriFormsTextQuestionProps) => {\n const context = useContext(TextQuestionContext);\n return (\n <input\n value={context[props.title as keyof TextQuestionContextValue]}\n type=\"hidden\"\n name={props.name}\n />\n );\n};\n\ninterface FeedbackProviderModalProps\n extends Partial<ModalProps>,\n FeedbackProviderProps {}\n\nconst FeedbackProviderModal = (props: FeedbackProviderModalProps) => {\n const { questions, submit } = useMatsuriForms(getFormId(), {\n dev: globalThis.M2M_COMPONENTS_ENV !== \"production\",\n });\n\n const { throwAlert } = useAlert();\n\n const [status, setStatus] = useState<\"started\" | \"sending\" | \"completed\">(\n \"started\",\n );\n\n const id = getRandomId();\n\n return (\n <Modal\n backdrop\n width={600}\n maxWidth={600}\n header={<Typography variant=\"h3\">フィードバックを送信</Typography>}\n body={\n status === \"completed\" ? (\n <div\n style={{\n display: \"grid\",\n gap: 32,\n }}\n >\n <Typography>\n レポートを送信しました。ありがとうございます。\n </Typography>\n <Typography color=\"textSecondary\" variant=\"caption\" as=\"p\">\n お送りいただいたフィードバックは、問題の解決とサービスの改善に役立てさせていただきます。\n </Typography>\n <Button\n color=\"primary\"\n variant=\"filled\"\n onClick={() => {\n props.onClose?.();\n }}\n >\n 閉じる\n </Button>\n </div>\n ) : (\n <form\n style={{\n display: \"grid\",\n gap: 24,\n }}\n onSubmit={async (event) => {\n event.preventDefault();\n setStatus(\"sending\");\n const { error } = await submit(event.currentTarget);\n\n /**\n * 以下、対応が行われるまでは取れる値だけ送る\n * https://github.com/matsuri-tech/matsuri-forms-manager-front/issues/265\n */\n const input = {\n id,\n userId: props.userId,\n userName: props.userName,\n serviceName: props.serviceName,\n url: window.location.href,\n };\n throwAlert(error, {\n ignoreSuccess: true,\n errorMessage: {\n reason: \"サーバー側のエラーの可能性があります。\",\n action:\n \"しばらく時間を空けて試すか、開発チームへお問い合わせください。\",\n happend: \"フィードバックの送信に失敗しました。\",\n },\n onSuccess: () => {\n props.datadogLogs?.logger?.info?.(\n `Feedback: ${id} by ${props.userId}`,\n {\n input,\n },\n );\n\n window.setTimeout(() => {\n setStatus(\"completed\");\n }, 2000);\n },\n onError: () => {\n props.datadogLogs?.logger?.error?.(\n `Failed Feedback: ${input.id} by ${input.userId}`,\n { input, error },\n );\n\n window.setTimeout(() => {\n setStatus(\"started\");\n }, 2000);\n },\n });\n }}\n >\n <TextQuestionContext.Provider\n value={{\n userId: props.userId,\n userName: props.userName,\n serviceName: props.serviceName,\n url: window.location.href,\n id,\n }}\n >\n <MatsuriFormsQuestionProvider\n renderSelect={SelectQuestion}\n renderMultilineText={MultipleTextQuestion}\n renderText={TextQuestion}\n >\n {questions.map((question) => {\n return (\n <MatsuriFormsQuestion {...question} key={question.id} />\n );\n })}\n </MatsuriFormsQuestionProvider>\n </TextQuestionContext.Provider>\n <div>\n <Button\n type=\"submit\"\n color=\"primary\"\n variant=\"filled\"\n disabled={status === \"sending\"}\n fullWidth\n >\n 送信\n </Button>\n <Typography\n variant=\"caption\"\n style={{\n float: \"right\",\n }}\n >\n {status === \"sending\" ? \"送信中...\" : undefined}\n &nbsp;\n </Typography>\n </div>\n </form>\n )\n }\n {...props}\n />\n );\n};\n\ninterface FeedbackProviderProps {\n userId?: string;\n userName?: string;\n serviceName: string;\n datadogLogs?: {\n logger: Logger;\n };\n}\n\nexport const FeedbackProvider = ({\n children,\n ...modalProps\n}: PropsWithChildren<FeedbackProviderProps>) => {\n const [open] = useModal(FeedbackProviderModal, {\n enableClickOutside: true,\n disableClose: false,\n });\n return (\n <div>\n {children}\n <Portal>\n <Button\n style={{\n position: \"fixed\",\n bottom: 16,\n right: 16,\n }}\n onClick={() => {\n open(modalProps);\n }}\n type=\"button\"\n icon={<FeedbackIcon />}\n color=\"secondary\"\n variant=\"filled\"\n rounded\n />\n </Portal>\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;AAAA;AAAA,EACE;AAAA,EACA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP;AAAA,EACE;AAAA,EACA;AAAA,EAEA;AAAA,OACK;AAEP,SAA4B,eAAe,YAAY,gBAAgB;AAGvE,OAAO,sBAAsB;AAmCzB,cAiCM,YAjCN;AA8HgB;AAvJpB,IAAM,gBAAgB,CAAK,SAAe;AAExC,SAAS,KAAa,UAAW,KAAa,UAAU;AAC1D;AACA,IAAM,eAAe,cAAc,gBAAgB;AAEnD,IAAM,YAAY,MAAM;AACtB,SAAO,WAAW,uBAAuB,eACrC,+BACA;AACN;AAUA,IAAM,sBAAsB,cAAwC,CAAC,CAAC;AAEtE,IAAM,eAAe,CAAC,UAAyC;AAC7D,QAAM,UAAU,WAAW,mBAAmB;AAC9C,SACE;AAAA,IAAC;AAAA;AAAA,MACC,OAAO,QAAQ,MAAM,KAAuC;AAAA,MAC5D,MAAK;AAAA,MACL,MAAM,MAAM;AAAA;AAAA,EACd;AAEJ;AAMA,IAAM,wBAAwB,CAAC,UAAsC;AACnE,QAAM,EAAE,WAAW,OAAO,IAAI,gBAAgB,UAAU,GAAG;AAAA,IACzD,KAAK,WAAW,uBAAuB;AAAA,EACzC,CAAC;AAED,QAAM,EAAE,WAAW,IAAI,SAAS;AAEhC,QAAM,CAAC,QAAQ,SAAS,IAAI;AAAA,I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AAEJ;AAWO,IAAM,mBAAmB,CAAC;AAAA,EAC/B;AAAA,EACA,GAAG;AACL,MAAgD;AAC9C,QAAM,CAAC,IAAI,IAAI,SAAS,uBAAuB;AAAA,IAC7C,oBAAoB;AAAA,IACpB,cAAc;AAAA,EAChB,CAAC;AACD,SACE,qBAAC,SACE;AAAA;AAAA,IACD,oBAAC,UACC;AAAA,MAAC;AAAA;AAAA,QACC,OAAO;AAAA,UACL,UAAU;AAAA,UACV,QAAQ;AAAA,UACR,OAAO;AAAA,QACT;AAAA,QACA,SAAS,MAAM;AACb,eAAK,UAAU;AAAA,QACjB;AAAA,QACA,MAAK;AAAA,QACL,MAAM,oBAAC,gBAAa;AAAA,QACpB,OAAM;AAAA,QACN,SAAQ;AAAA,QACR,SAAO;AAAA;AAAA,IACT,GACF;AAAA,KACF;AAEJ;","names":[]}
@@ -1,7 +1,7 @@
1
1
  'use client'
2
2
  import {
3
3
  __export
4
- } from "./chunk-IVVIQZ5Y.mjs";
4
+ } from "./chunk-QH5I6YL2.mjs";
5
5
 
6
6
  // src/endpoints/m2m-users.v1.ts
7
7
  var m2m_users_v1_exports = {};
@@ -438,4 +438,4 @@ export {
438
438
  m2mUsers_v1,
439
439
  m2m_users_v1_exports
440
440
  };
441
- //# sourceMappingURL=chunk-27STFQPU.mjs.map
441
+ //# sourceMappingURL=chunk-SS7VKGY7.mjs.map
@@ -2,7 +2,7 @@
2
2
 
3
3
  // src/feedback/MultipleTextQuestion.tsx
4
4
  import { MultipleTextField } from "matsuri-ui";
5
- import { jsx } from "react/jsx-runtime";
5
+ import { jsx } from "@emotion/react/jsx-runtime";
6
6
  var MultipleTextQuestion = (props) => {
7
7
  return /* @__PURE__ */ jsx(
8
8
  MultipleTextField,
@@ -19,4 +19,4 @@ var MultipleTextQuestion = (props) => {
19
19
  export {
20
20
  MultipleTextQuestion
21
21
  };
22
- //# sourceMappingURL=chunk-IYTHV2XJ.mjs.map
22
+ //# sourceMappingURL=chunk-SXIYWN76.mjs.map
@@ -1,10 +1,10 @@
1
1
  'use client'
2
2
  import {
3
3
  useServiceId
4
- } from "./chunk-UXYQOQLC.mjs";
4
+ } from "./chunk-ARKJVMNQ.mjs";
5
5
  import {
6
6
  m2mNotifications_v1
7
- } from "./chunk-5AGE3LMI.mjs";
7
+ } from "./chunk-M2D55I4L.mjs";
8
8
 
9
9
  // src/notification/NotificationProvider.tsx
10
10
  import {
@@ -14,7 +14,7 @@ import {
14
14
  } from "react";
15
15
  import { useAuthFetch } from "matsuri-hooks";
16
16
  import { useMemo } from "react";
17
- import { jsx } from "react/jsx-runtime";
17
+ import { jsx } from "@emotion/react/jsx-runtime";
18
18
  var NotificationPermissionContext = createContext(void 0);
19
19
  var NotificationsContext = createContext(void 0);
20
20
  var NotificationsProvider = ({
@@ -80,4 +80,4 @@ export {
80
80
  useNotifications,
81
81
  useNotificationPermission
82
82
  };
83
- //# sourceMappingURL=chunk-RVG3UD3S.mjs.map
83
+ //# sourceMappingURL=chunk-V65OEKRZ.mjs.map
package/domains.mjs CHANGED
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  getDomains
4
4
  } from "./chunk-B7STDXYN.mjs";
5
- import "./chunk-IVVIQZ5Y.mjs";
5
+ import "./chunk-QH5I6YL2.mjs";
6
6
  export {
7
7
  getDomains
8
8
  };
@@ -1,8 +1,8 @@
1
1
  'use client'
2
2
  import {
3
3
  m2m_notifications_v1_exports
4
- } from "../chunk-5AGE3LMI.mjs";
5
- import "../chunk-IVVIQZ5Y.mjs";
4
+ } from "../chunk-M2D55I4L.mjs";
5
+ import "../chunk-QH5I6YL2.mjs";
6
6
 
7
7
  // src/endpoints/m2m-notifications.ts
8
8
  var m2mNotifications = { v1: m2m_notifications_v1_exports };
@@ -8,8 +8,8 @@ import {
8
8
  root,
9
9
  saveSubscription,
10
10
  updateNotificationStatus
11
- } from "../chunk-5AGE3LMI.mjs";
12
- import "../chunk-IVVIQZ5Y.mjs";
11
+ } from "../chunk-M2D55I4L.mjs";
12
+ import "../chunk-QH5I6YL2.mjs";
13
13
  export {
14
14
  findMySubscriptions,
15
15
  findNotificationsByServiceId,
@@ -1,8 +1,8 @@
1
1
  'use client'
2
2
  import {
3
3
  m2m_users_v1_exports
4
- } from "../chunk-27STFQPU.mjs";
5
- import "../chunk-IVVIQZ5Y.mjs";
4
+ } from "../chunk-SS7VKGY7.mjs";
5
+ import "../chunk-QH5I6YL2.mjs";
6
6
 
7
7
  // src/endpoints/m2m-users.ts
8
8
  var m2mUsers = { v1: m2m_users_v1_exports };
@@ -33,8 +33,8 @@ import {
33
33
  updateUser,
34
34
  updateUserByAdmin,
35
35
  updateUserPatch
36
- } from "../chunk-27STFQPU.mjs";
37
- import "../chunk-IVVIQZ5Y.mjs";
36
+ } from "../chunk-SS7VKGY7.mjs";
37
+ import "../chunk-QH5I6YL2.mjs";
38
38
  export {
39
39
  activateUser,
40
40
  activateUserByAdmin,
@@ -1,8 +1,8 @@
1
1
  'use client'
2
2
  import {
3
3
  matsuri_forms_v1_exports
4
- } from "../chunk-DPBDUYMO.mjs";
5
- import "../chunk-IVVIQZ5Y.mjs";
4
+ } from "../chunk-PQWXZDET.mjs";
5
+ import "../chunk-QH5I6YL2.mjs";
6
6
 
7
7
  // src/endpoints/matsuri-forms.ts
8
8
  var matsuriForms = { v1: matsuri_forms_v1_exports };
@@ -21,8 +21,8 @@ import {
21
21
  signUpWithGoogle,
22
22
  submissionCreate,
23
23
  submissionGet
24
- } from "../chunk-DPBDUYMO.mjs";
25
- import "../chunk-IVVIQZ5Y.mjs";
24
+ } from "../chunk-PQWXZDET.mjs";
25
+ import "../chunk-QH5I6YL2.mjs";
26
26
  export {
27
27
  formActivateSheetFeature,
28
28
  formCreate,
@@ -1,6 +1,6 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
1
+ import * as _emotion_react_jsx_runtime from '@emotion/react/jsx-runtime';
2
2
  import { MatsuriFormsMultilineTextQuestionProps } from 'matsuri-forms-sdk';
3
3
 
4
- declare const MultipleTextQuestion: (props: MatsuriFormsMultilineTextQuestionProps) => react_jsx_runtime.JSX.Element;
4
+ declare const MultipleTextQuestion: (props: MatsuriFormsMultilineTextQuestionProps) => _emotion_react_jsx_runtime.JSX.Element;
5
5
 
6
6
  export { MultipleTextQuestion };
@@ -1,6 +1,6 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
1
+ import * as _emotion_react_jsx_runtime from '@emotion/react/jsx-runtime';
2
2
  import { MatsuriFormsMultilineTextQuestionProps } from 'matsuri-forms-sdk';
3
3
 
4
- declare const MultipleTextQuestion: (props: MatsuriFormsMultilineTextQuestionProps) => react_jsx_runtime.JSX.Element;
4
+ declare const MultipleTextQuestion: (props: MatsuriFormsMultilineTextQuestionProps) => _emotion_react_jsx_runtime.JSX.Element;
5
5
 
6
6
  export { MultipleTextQuestion };
@@ -25,7 +25,7 @@ __export(MultipleTextQuestion_exports, {
25
25
  });
26
26
  module.exports = __toCommonJS(MultipleTextQuestion_exports);
27
27
  var import_matsuri_ui = require("matsuri-ui");
28
- var import_jsx_runtime = require("react/jsx-runtime");
28
+ var import_jsx_runtime = require("@emotion/react/jsx-runtime");
29
29
  var MultipleTextQuestion = (props) => {
30
30
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
31
31
  import_matsuri_ui.MultipleTextField,
@@ -1,8 +1,8 @@
1
1
  'use client'
2
2
  import {
3
3
  MultipleTextQuestion
4
- } from "../chunk-IYTHV2XJ.mjs";
5
- import "../chunk-IVVIQZ5Y.mjs";
4
+ } from "../chunk-SXIYWN76.mjs";
5
+ import "../chunk-QH5I6YL2.mjs";
6
6
  export {
7
7
  MultipleTextQuestion
8
8
  };