@openclaw/line 2026.7.2-beta.4 → 2026.7.2-beta.7

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 (149) hide show
  1. package/README.md +1 -1
  2. package/dist/accounts-BqEVsDoB.js +103 -0
  3. package/dist/api.js +2 -2
  4. package/dist/{card-command-Ch0TwcDW.js → card-command-ty11OJNt.js} +1 -2
  5. package/dist/{channel-CNcv74n2.js → channel-D4i_K4fQ.js} +9 -9
  6. package/dist/channel-plugin-api.js +1 -1
  7. package/dist/channel.runtime-BdhK8Xw7.js +4 -0
  8. package/dist/contract-api.js +1 -1
  9. package/dist/flex-templates-iKJsyCq-.js +1339 -0
  10. package/dist/index.js +1 -1
  11. package/dist/{markdown-to-line-DWIdzBfy.js → markdown-to-line-DMDQTMhx.js} +27 -12
  12. package/dist/{monitor-BinAXvIY.js → monitor-DXEodYFJ.js} +63 -106
  13. package/dist/monitor.runtime-CZquR7jI.js +2 -0
  14. package/dist/{outbound.runtime-DRyoVa81.js → outbound.runtime-BS0IhU_M.js} +1 -1
  15. package/dist/{probe-BslD77tJ.js → probe-CM03wo6r.js} +7 -9
  16. package/dist/probe.runtime-D13ZtXsd.js +2 -0
  17. package/dist/{reply-payload-transform-d57WYHFm.js → reply-payload-transform-D5-dHB8b.js} +1 -1
  18. package/dist/runtime-api.js +9 -9
  19. package/dist/setup-api.js +1 -1
  20. package/dist/{setup-surface-Bili5gWy.js → setup-surface-DRQ7n0En.js} +93 -129
  21. package/package.json +4 -5
  22. package/dist/accounts-BUBOoW5Q.js +0 -169
  23. package/dist/basic-cards-Rb-Ow7LN.js +0 -307
  24. package/dist/channel.runtime-BBCZvRa_.js +0 -4
  25. package/dist/flex-templates-KiKaVYgi.js +0 -813
  26. package/dist/monitor.runtime-DKj4FHkA.js +0 -2
  27. package/dist/probe.runtime-CRhVGqwl.js +0 -2
  28. package/npm-shrinkwrap.json +0 -60
  29. /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/LICENSE +0 -0
  30. /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/README.md +0 -0
  31. /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/assert/strict.d.ts +0 -0
  32. /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/assert.d.ts +0 -0
  33. /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/async_hooks.d.ts +0 -0
  34. /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/buffer.buffer.d.ts +0 -0
  35. /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/buffer.d.ts +0 -0
  36. /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/child_process.d.ts +0 -0
  37. /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/cluster.d.ts +0 -0
  38. /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/compatibility/iterators.d.ts +0 -0
  39. /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/console.d.ts +0 -0
  40. /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/constants.d.ts +0 -0
  41. /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/crypto.d.ts +0 -0
  42. /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/dgram.d.ts +0 -0
  43. /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/diagnostics_channel.d.ts +0 -0
  44. /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/dns/promises.d.ts +0 -0
  45. /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/dns.d.ts +0 -0
  46. /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/domain.d.ts +0 -0
  47. /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/events.d.ts +0 -0
  48. /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/fs/promises.d.ts +0 -0
  49. /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/fs.d.ts +0 -0
  50. /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/globals.d.ts +0 -0
  51. /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/globals.typedarray.d.ts +0 -0
  52. /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/http.d.ts +0 -0
  53. /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/http2.d.ts +0 -0
  54. /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/https.d.ts +0 -0
  55. /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/index.d.ts +0 -0
  56. /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/inspector.d.ts +0 -0
  57. /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/inspector.generated.d.ts +0 -0
  58. /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/module.d.ts +0 -0
  59. /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/net.d.ts +0 -0
  60. /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/os.d.ts +0 -0
  61. /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/package.json +0 -0
  62. /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/path.d.ts +0 -0
  63. /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/perf_hooks.d.ts +0 -0
  64. /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/process.d.ts +0 -0
  65. /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/punycode.d.ts +0 -0
  66. /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/querystring.d.ts +0 -0
  67. /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/readline/promises.d.ts +0 -0
  68. /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/readline.d.ts +0 -0
  69. /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/repl.d.ts +0 -0
  70. /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/sea.d.ts +0 -0
  71. /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/sqlite.d.ts +0 -0
  72. /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/stream/consumers.d.ts +0 -0
  73. /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/stream/promises.d.ts +0 -0
  74. /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/stream/web.d.ts +0 -0
  75. /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/stream.d.ts +0 -0
  76. /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/string_decoder.d.ts +0 -0
  77. /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/test.d.ts +0 -0
  78. /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/timers/promises.d.ts +0 -0
  79. /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/timers.d.ts +0 -0
  80. /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/tls.d.ts +0 -0
  81. /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/trace_events.d.ts +0 -0
  82. /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/ts5.6/buffer.buffer.d.ts +0 -0
  83. /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/ts5.6/compatibility/float16array.d.ts +0 -0
  84. /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/ts5.6/globals.typedarray.d.ts +0 -0
  85. /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/ts5.6/index.d.ts +0 -0
  86. /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/ts5.7/compatibility/float16array.d.ts +0 -0
  87. /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/ts5.7/index.d.ts +0 -0
  88. /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/tty.d.ts +0 -0
  89. /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/url.d.ts +0 -0
  90. /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/util.d.ts +0 -0
  91. /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/v8.d.ts +0 -0
  92. /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/vm.d.ts +0 -0
  93. /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/wasi.d.ts +0 -0
  94. /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/web-globals/abortcontroller.d.ts +0 -0
  95. /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/web-globals/crypto.d.ts +0 -0
  96. /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/web-globals/domexception.d.ts +0 -0
  97. /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/web-globals/events.d.ts +0 -0
  98. /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/web-globals/fetch.d.ts +0 -0
  99. /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/web-globals/navigator.d.ts +0 -0
  100. /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/web-globals/storage.d.ts +0 -0
  101. /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/web-globals/streams.d.ts +0 -0
  102. /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/worker_threads.d.ts +0 -0
  103. /package/node_modules/{@types → @line/bot-sdk/node_modules/@types}/node/zlib.d.ts +0 -0
  104. /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/LICENSE +0 -0
  105. /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/README.md +0 -0
  106. /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/agent.d.ts +0 -0
  107. /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/api.d.ts +0 -0
  108. /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/balanced-pool.d.ts +0 -0
  109. /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/cache-interceptor.d.ts +0 -0
  110. /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/cache.d.ts +0 -0
  111. /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/client-stats.d.ts +0 -0
  112. /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/client.d.ts +0 -0
  113. /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/connector.d.ts +0 -0
  114. /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/content-type.d.ts +0 -0
  115. /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/cookies.d.ts +0 -0
  116. /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/diagnostics-channel.d.ts +0 -0
  117. /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/dispatcher.d.ts +0 -0
  118. /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/env-http-proxy-agent.d.ts +0 -0
  119. /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/errors.d.ts +0 -0
  120. /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/eventsource.d.ts +0 -0
  121. /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/fetch.d.ts +0 -0
  122. /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/formdata.d.ts +0 -0
  123. /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/global-dispatcher.d.ts +0 -0
  124. /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/global-origin.d.ts +0 -0
  125. /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/h2c-client.d.ts +0 -0
  126. /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/handlers.d.ts +0 -0
  127. /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/header.d.ts +0 -0
  128. /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/index.d.ts +0 -0
  129. /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/interceptors.d.ts +0 -0
  130. /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/mock-agent.d.ts +0 -0
  131. /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/mock-call-history.d.ts +0 -0
  132. /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/mock-client.d.ts +0 -0
  133. /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/mock-errors.d.ts +0 -0
  134. /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/mock-interceptor.d.ts +0 -0
  135. /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/mock-pool.d.ts +0 -0
  136. /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/package.json +0 -0
  137. /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/patch.d.ts +0 -0
  138. /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/pool-stats.d.ts +0 -0
  139. /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/pool.d.ts +0 -0
  140. /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/proxy-agent.d.ts +0 -0
  141. /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/readable.d.ts +0 -0
  142. /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/retry-agent.d.ts +0 -0
  143. /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/retry-handler.d.ts +0 -0
  144. /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/round-robin-pool.d.ts +0 -0
  145. /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/snapshot-agent.d.ts +0 -0
  146. /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/util.d.ts +0 -0
  147. /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/utility.d.ts +0 -0
  148. /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/webidl.d.ts +0 -0
  149. /package/node_modules/{undici-types → @line/bot-sdk/node_modules/undici-types}/websocket.d.ts +0 -0
@@ -1,813 +0,0 @@
1
- import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
2
- //#region extensions/line/src/flex-templates/common.ts
3
- function attachFooterText(bubble, footer) {
4
- bubble.footer = {
5
- type: "box",
6
- layout: "vertical",
7
- contents: [{
8
- type: "text",
9
- text: footer,
10
- size: "xs",
11
- color: "#AAAAAA",
12
- wrap: true,
13
- align: "center"
14
- }],
15
- paddingAll: "lg",
16
- backgroundColor: "#FAFAFA"
17
- };
18
- }
19
- //#endregion
20
- //#region extensions/line/src/flex-templates/schedule-cards.ts
21
- function buildTitleSubtitleHeader(params) {
22
- const { title, subtitle } = params;
23
- const headerContents = [{
24
- type: "text",
25
- text: title,
26
- weight: "bold",
27
- size: "xl",
28
- color: "#111111",
29
- wrap: true
30
- }];
31
- if (subtitle) headerContents.push({
32
- type: "text",
33
- text: subtitle,
34
- size: "sm",
35
- color: "#888888",
36
- margin: "sm",
37
- wrap: true
38
- });
39
- return headerContents;
40
- }
41
- function buildCardHeaderSections(headerContents) {
42
- return [{
43
- type: "box",
44
- layout: "vertical",
45
- contents: headerContents,
46
- paddingBottom: "lg"
47
- }, {
48
- type: "separator",
49
- color: "#EEEEEE"
50
- }];
51
- }
52
- function createMegaBubbleWithFooter(params) {
53
- const bubble = {
54
- type: "bubble",
55
- size: "mega",
56
- body: {
57
- type: "box",
58
- layout: "vertical",
59
- contents: params.bodyContents,
60
- paddingAll: "xl",
61
- backgroundColor: "#FFFFFF"
62
- }
63
- };
64
- if (params.footer) attachFooterText(bubble, params.footer);
65
- return bubble;
66
- }
67
- /**
68
- * Create a receipt/summary card (for orders, transactions, data tables)
69
- *
70
- * Editorial design: Clean table layout with alternating row backgrounds,
71
- * prominent total section, and clear visual hierarchy.
72
- */
73
- function createReceiptCard(params) {
74
- const { title, subtitle, items, total, footer } = params;
75
- const itemRows = items.slice(0, 12).map((item, index) => ({
76
- type: "box",
77
- layout: "horizontal",
78
- contents: [{
79
- type: "text",
80
- text: item.name,
81
- size: "sm",
82
- color: item.highlight ? "#111111" : "#666666",
83
- weight: item.highlight ? "bold" : "regular",
84
- flex: 3,
85
- wrap: true
86
- }, {
87
- type: "text",
88
- text: item.value,
89
- size: "sm",
90
- color: item.highlight ? "#06C755" : "#333333",
91
- weight: item.highlight ? "bold" : "regular",
92
- flex: 2,
93
- align: "end",
94
- wrap: true
95
- }],
96
- paddingAll: "md",
97
- backgroundColor: index % 2 === 0 ? "#FFFFFF" : "#FAFAFA"
98
- }));
99
- const bodyContents = [...buildCardHeaderSections(buildTitleSubtitleHeader({
100
- title,
101
- subtitle
102
- })), {
103
- type: "box",
104
- layout: "vertical",
105
- contents: itemRows,
106
- margin: "md",
107
- cornerRadius: "md",
108
- borderWidth: "light",
109
- borderColor: "#EEEEEE"
110
- }];
111
- if (total) bodyContents.push({
112
- type: "box",
113
- layout: "horizontal",
114
- contents: [{
115
- type: "text",
116
- text: total.label,
117
- size: "lg",
118
- weight: "bold",
119
- color: "#111111",
120
- flex: 2
121
- }, {
122
- type: "text",
123
- text: total.value,
124
- size: "xl",
125
- weight: "bold",
126
- color: "#06C755",
127
- flex: 2,
128
- align: "end"
129
- }],
130
- margin: "xl",
131
- paddingAll: "lg",
132
- backgroundColor: "#F0FDF4",
133
- cornerRadius: "lg"
134
- });
135
- return createMegaBubbleWithFooter({
136
- bodyContents,
137
- footer
138
- });
139
- }
140
- /**
141
- * Create a calendar event card (for meetings, appointments, reminders)
142
- *
143
- * Editorial design: Date as hero, strong typographic hierarchy,
144
- * color-blocked zones, full text wrapping for readability.
145
- */
146
- function createEventCard(params) {
147
- const { title, date, time, location, description, calendar, isAllDay, action } = params;
148
- const dateBlock = {
149
- type: "box",
150
- layout: "vertical",
151
- contents: [{
152
- type: "text",
153
- text: date.toUpperCase(),
154
- size: "sm",
155
- weight: "bold",
156
- color: "#06C755",
157
- wrap: true
158
- }, {
159
- type: "text",
160
- text: isAllDay ? "ALL DAY" : time ?? "",
161
- size: "xxl",
162
- weight: "bold",
163
- color: "#111111",
164
- wrap: true,
165
- margin: "xs"
166
- }],
167
- paddingBottom: "lg",
168
- borderWidth: "none"
169
- };
170
- if (!time && !isAllDay) dateBlock.contents = [{
171
- type: "text",
172
- text: date,
173
- size: "xl",
174
- weight: "bold",
175
- color: "#111111",
176
- wrap: true
177
- }];
178
- const bodyContents = [dateBlock, {
179
- type: "box",
180
- layout: "horizontal",
181
- contents: [{
182
- type: "box",
183
- layout: "vertical",
184
- contents: [],
185
- width: "4px",
186
- backgroundColor: "#06C755",
187
- cornerRadius: "2px"
188
- }, {
189
- type: "box",
190
- layout: "vertical",
191
- contents: [{
192
- type: "text",
193
- text: title,
194
- size: "lg",
195
- weight: "bold",
196
- color: "#1a1a1a",
197
- wrap: true
198
- }, ...calendar ? [{
199
- type: "text",
200
- text: calendar,
201
- size: "xs",
202
- color: "#888888",
203
- margin: "sm",
204
- wrap: true
205
- }] : []],
206
- flex: 1,
207
- paddingStart: "lg"
208
- }],
209
- paddingTop: "lg",
210
- paddingBottom: "lg",
211
- borderWidth: "light",
212
- borderColor: "#EEEEEE"
213
- }];
214
- if (location || description) {
215
- const detailItems = [];
216
- if (location) detailItems.push({
217
- type: "box",
218
- layout: "horizontal",
219
- contents: [{
220
- type: "text",
221
- text: "📍",
222
- size: "sm",
223
- flex: 0
224
- }, {
225
- type: "text",
226
- text: location,
227
- size: "sm",
228
- color: "#444444",
229
- margin: "md",
230
- flex: 1,
231
- wrap: true
232
- }],
233
- alignItems: "flex-start"
234
- });
235
- if (description) detailItems.push({
236
- type: "text",
237
- text: description,
238
- size: "sm",
239
- color: "#666666",
240
- wrap: true,
241
- margin: location ? "lg" : "none"
242
- });
243
- bodyContents.push({
244
- type: "box",
245
- layout: "vertical",
246
- contents: detailItems,
247
- margin: "lg",
248
- paddingAll: "lg",
249
- backgroundColor: "#F8F9FA",
250
- cornerRadius: "lg"
251
- });
252
- }
253
- return {
254
- type: "bubble",
255
- size: "mega",
256
- body: {
257
- type: "box",
258
- layout: "vertical",
259
- contents: bodyContents,
260
- paddingAll: "xl",
261
- backgroundColor: "#FFFFFF",
262
- action
263
- }
264
- };
265
- }
266
- /**
267
- * Create a calendar agenda card showing multiple events
268
- *
269
- * Editorial timeline design: Time-focused left column with event details
270
- * on the right. Visual accent bars indicate event priority/recency.
271
- */
272
- function createAgendaCard(params) {
273
- const { title, subtitle, events, footer } = params;
274
- const headerContents = buildTitleSubtitleHeader({
275
- title,
276
- subtitle
277
- });
278
- const eventItems = events.slice(0, 6).map((event, index) => {
279
- const isActive = event.isNow || index === 0;
280
- const accentColor = isActive ? "#06C755" : "#E5E5E5";
281
- const timeColumn = {
282
- type: "box",
283
- layout: "vertical",
284
- contents: [{
285
- type: "text",
286
- text: event.time ?? "—",
287
- size: "sm",
288
- weight: isActive ? "bold" : "regular",
289
- color: isActive ? "#06C755" : "#666666",
290
- align: "end",
291
- wrap: true
292
- }],
293
- width: "65px",
294
- justifyContent: "flex-start"
295
- };
296
- const dotColumn = {
297
- type: "box",
298
- layout: "vertical",
299
- contents: [{
300
- type: "box",
301
- layout: "vertical",
302
- contents: [],
303
- width: "10px",
304
- height: "10px",
305
- backgroundColor: accentColor,
306
- cornerRadius: "5px"
307
- }],
308
- width: "24px",
309
- alignItems: "center",
310
- justifyContent: "flex-start",
311
- paddingTop: "xs"
312
- };
313
- const detailContents = [{
314
- type: "text",
315
- text: event.title,
316
- size: "md",
317
- weight: "bold",
318
- color: "#1a1a1a",
319
- wrap: true
320
- }];
321
- const secondaryParts = [];
322
- if (event.location) secondaryParts.push(event.location);
323
- if (event.calendar) secondaryParts.push(event.calendar);
324
- if (secondaryParts.length > 0) detailContents.push({
325
- type: "text",
326
- text: secondaryParts.join(" · "),
327
- size: "xs",
328
- color: "#888888",
329
- wrap: true,
330
- margin: "xs"
331
- });
332
- return {
333
- type: "box",
334
- layout: "horizontal",
335
- contents: [
336
- timeColumn,
337
- dotColumn,
338
- {
339
- type: "box",
340
- layout: "vertical",
341
- contents: detailContents,
342
- flex: 1
343
- }
344
- ],
345
- margin: index > 0 ? "xl" : void 0,
346
- alignItems: "flex-start"
347
- };
348
- });
349
- return createMegaBubbleWithFooter({
350
- bodyContents: [...buildCardHeaderSections(headerContents), {
351
- type: "box",
352
- layout: "vertical",
353
- contents: eventItems,
354
- paddingTop: "xl"
355
- }],
356
- footer
357
- });
358
- }
359
- //#endregion
360
- //#region extensions/line/src/actions.ts
361
- const LINE_ACTION_LABEL_LIMIT = 20;
362
- const LINE_ACTION_DATA_LIMIT = 300;
363
- function truncateLineActionLabel(label, limit = LINE_ACTION_LABEL_LIMIT) {
364
- return truncateUtf16Safe(label, limit);
365
- }
366
- function truncateLineActionData(data) {
367
- return truncateUtf16Safe(data, LINE_ACTION_DATA_LIMIT);
368
- }
369
- /**
370
- * Create a message action (sends text when tapped)
371
- */
372
- function messageAction(label, text) {
373
- return {
374
- type: "message",
375
- label: truncateLineActionLabel(label),
376
- text: text ?? label
377
- };
378
- }
379
- /**
380
- * Create a URI action (opens a URL when tapped)
381
- */
382
- function uriAction(label, uri) {
383
- return {
384
- type: "uri",
385
- label: truncateLineActionLabel(label),
386
- uri
387
- };
388
- }
389
- /**
390
- * Create a postback action (sends data to webhook when tapped)
391
- */
392
- function postbackAction(label, data, displayText) {
393
- return {
394
- type: "postback",
395
- label: truncateLineActionLabel(label),
396
- data: truncateLineActionData(data),
397
- displayText: displayText === void 0 ? void 0 : truncateLineActionData(displayText)
398
- };
399
- }
400
- /**
401
- * Create a datetime picker action
402
- */
403
- function datetimePickerAction(label, data, mode, options) {
404
- return {
405
- type: "datetimepicker",
406
- label: truncateLineActionLabel(label),
407
- data: truncateLineActionData(data),
408
- mode,
409
- initial: options?.initial,
410
- max: options?.max,
411
- min: options?.min
412
- };
413
- }
414
- //#endregion
415
- //#region extensions/line/src/flex-templates/media-control-cards.ts
416
- /**
417
- * Create a media player card for Sonos, Spotify, Apple Music, etc.
418
- *
419
- * Editorial design: Album art hero with gradient overlay for text,
420
- * prominent now-playing indicator, refined playback controls.
421
- */
422
- function createMediaPlayerCard(params) {
423
- const { title, subtitle, source, imageUrl, isPlaying, progress, controls, extraActions } = params;
424
- const trackInfo = [{
425
- type: "text",
426
- text: title,
427
- weight: "bold",
428
- size: "xl",
429
- color: "#111111",
430
- wrap: true
431
- }];
432
- if (subtitle) trackInfo.push({
433
- type: "text",
434
- text: subtitle,
435
- size: "md",
436
- color: "#666666",
437
- wrap: true,
438
- margin: "sm"
439
- });
440
- const statusItems = [];
441
- if (isPlaying !== void 0) statusItems.push({
442
- type: "box",
443
- layout: "horizontal",
444
- contents: [{
445
- type: "box",
446
- layout: "vertical",
447
- contents: [],
448
- width: "8px",
449
- height: "8px",
450
- backgroundColor: isPlaying ? "#06C755" : "#CCCCCC",
451
- cornerRadius: "4px"
452
- }, {
453
- type: "text",
454
- text: isPlaying ? "Now Playing" : "Paused",
455
- size: "xs",
456
- color: isPlaying ? "#06C755" : "#888888",
457
- weight: "bold",
458
- margin: "sm"
459
- }],
460
- alignItems: "center"
461
- });
462
- if (source) statusItems.push({
463
- type: "text",
464
- text: source,
465
- size: "xs",
466
- color: "#AAAAAA",
467
- margin: statusItems.length > 0 ? "lg" : void 0
468
- });
469
- if (progress) statusItems.push({
470
- type: "text",
471
- text: progress,
472
- size: "xs",
473
- color: "#888888",
474
- align: "end",
475
- flex: 1
476
- });
477
- const bodyContents = [{
478
- type: "box",
479
- layout: "vertical",
480
- contents: trackInfo
481
- }];
482
- if (statusItems.length > 0) bodyContents.push({
483
- type: "box",
484
- layout: "horizontal",
485
- contents: statusItems,
486
- margin: "lg",
487
- alignItems: "center"
488
- });
489
- const bubble = {
490
- type: "bubble",
491
- size: "mega",
492
- body: {
493
- type: "box",
494
- layout: "vertical",
495
- contents: bodyContents,
496
- paddingAll: "xl",
497
- backgroundColor: "#FFFFFF"
498
- }
499
- };
500
- if (imageUrl) bubble.hero = {
501
- type: "image",
502
- url: imageUrl,
503
- size: "full",
504
- aspectRatio: "1:1",
505
- aspectMode: "cover"
506
- };
507
- if (controls || extraActions?.length) {
508
- const footerContents = [];
509
- if (controls) {
510
- const controlButtons = [];
511
- if (controls.previous) controlButtons.push({
512
- type: "button",
513
- action: {
514
- type: "postback",
515
- label: "⏮",
516
- data: controls.previous.data
517
- },
518
- style: "secondary",
519
- flex: 1,
520
- height: "sm"
521
- });
522
- if (controls.play) controlButtons.push({
523
- type: "button",
524
- action: {
525
- type: "postback",
526
- label: "▶",
527
- data: controls.play.data
528
- },
529
- style: isPlaying ? "secondary" : "primary",
530
- flex: 1,
531
- height: "sm",
532
- margin: controls.previous ? "md" : void 0
533
- });
534
- if (controls.pause) controlButtons.push({
535
- type: "button",
536
- action: {
537
- type: "postback",
538
- label: "⏸",
539
- data: controls.pause.data
540
- },
541
- style: isPlaying ? "primary" : "secondary",
542
- flex: 1,
543
- height: "sm",
544
- margin: controlButtons.length > 0 ? "md" : void 0
545
- });
546
- if (controls.next) controlButtons.push({
547
- type: "button",
548
- action: {
549
- type: "postback",
550
- label: "⏭",
551
- data: controls.next.data
552
- },
553
- style: "secondary",
554
- flex: 1,
555
- height: "sm",
556
- margin: controlButtons.length > 0 ? "md" : void 0
557
- });
558
- if (controlButtons.length > 0) footerContents.push({
559
- type: "box",
560
- layout: "horizontal",
561
- contents: controlButtons
562
- });
563
- }
564
- if (extraActions?.length) footerContents.push({
565
- type: "box",
566
- layout: "horizontal",
567
- contents: extraActions.slice(0, 2).map((action, index) => ({
568
- type: "button",
569
- action: {
570
- type: "postback",
571
- label: truncateLineActionLabel(action.label, 15),
572
- data: action.data
573
- },
574
- style: "secondary",
575
- flex: 1,
576
- height: "sm",
577
- margin: index > 0 ? "md" : void 0
578
- })),
579
- margin: "md"
580
- });
581
- if (footerContents.length > 0) bubble.footer = {
582
- type: "box",
583
- layout: "vertical",
584
- contents: footerContents,
585
- paddingAll: "lg",
586
- backgroundColor: "#FAFAFA"
587
- };
588
- }
589
- return bubble;
590
- }
591
- /**
592
- * Create an Apple TV remote card with a D-pad and control rows.
593
- */
594
- function createAppleTvRemoteCard(params) {
595
- const { deviceName, status, actionData } = params;
596
- const headerContents = [{
597
- type: "text",
598
- text: deviceName,
599
- weight: "bold",
600
- size: "xl",
601
- color: "#111111",
602
- wrap: true
603
- }];
604
- if (status) headerContents.push({
605
- type: "text",
606
- text: status,
607
- size: "sm",
608
- color: "#666666",
609
- wrap: true,
610
- margin: "sm"
611
- });
612
- const makeButton = (label, data, style = "secondary") => ({
613
- type: "button",
614
- action: {
615
- type: "postback",
616
- label,
617
- data
618
- },
619
- style,
620
- height: "sm",
621
- flex: 1
622
- });
623
- const dpadRows = [
624
- {
625
- type: "box",
626
- layout: "horizontal",
627
- contents: [
628
- { type: "filler" },
629
- makeButton("↑", actionData.up),
630
- { type: "filler" }
631
- ]
632
- },
633
- {
634
- type: "box",
635
- layout: "horizontal",
636
- contents: [
637
- makeButton("←", actionData.left),
638
- makeButton("OK", actionData.select, "primary"),
639
- makeButton("→", actionData.right)
640
- ],
641
- margin: "md"
642
- },
643
- {
644
- type: "box",
645
- layout: "horizontal",
646
- contents: [
647
- { type: "filler" },
648
- makeButton("↓", actionData.down),
649
- { type: "filler" }
650
- ],
651
- margin: "md"
652
- }
653
- ];
654
- const menuRow = {
655
- type: "box",
656
- layout: "horizontal",
657
- contents: [makeButton("Menu", actionData.menu), makeButton("Home", actionData.home)],
658
- margin: "lg"
659
- };
660
- const playbackRow = {
661
- type: "box",
662
- layout: "horizontal",
663
- contents: [makeButton("Play", actionData.play), makeButton("Pause", actionData.pause)],
664
- margin: "md"
665
- };
666
- const volumeRow = {
667
- type: "box",
668
- layout: "horizontal",
669
- contents: [
670
- makeButton("Vol +", actionData.volumeUp),
671
- makeButton("Mute", actionData.mute),
672
- makeButton("Vol -", actionData.volumeDown)
673
- ],
674
- margin: "md"
675
- };
676
- return {
677
- type: "bubble",
678
- size: "mega",
679
- body: {
680
- type: "box",
681
- layout: "vertical",
682
- contents: [
683
- {
684
- type: "box",
685
- layout: "vertical",
686
- contents: headerContents
687
- },
688
- {
689
- type: "separator",
690
- margin: "lg",
691
- color: "#EEEEEE"
692
- },
693
- ...dpadRows,
694
- menuRow,
695
- playbackRow,
696
- volumeRow
697
- ],
698
- paddingAll: "xl",
699
- backgroundColor: "#FFFFFF"
700
- }
701
- };
702
- }
703
- /**
704
- * Create a device control card for Apple TV, smart home devices, etc.
705
- *
706
- * Editorial design: Device-focused header with status indicator,
707
- * clean control grid with clear visual hierarchy.
708
- */
709
- function createDeviceControlCard(params) {
710
- const { deviceName, deviceType, status, isOnline, imageUrl, controls } = params;
711
- const headerContents = [{
712
- type: "box",
713
- layout: "horizontal",
714
- contents: [{
715
- type: "box",
716
- layout: "vertical",
717
- contents: [],
718
- width: "10px",
719
- height: "10px",
720
- backgroundColor: isOnline !== false ? "#06C755" : "#FF5555",
721
- cornerRadius: "5px"
722
- }, {
723
- type: "text",
724
- text: deviceName,
725
- weight: "bold",
726
- size: "xl",
727
- color: "#111111",
728
- wrap: true,
729
- flex: 1,
730
- margin: "md"
731
- }],
732
- alignItems: "center"
733
- }];
734
- if (deviceType) headerContents.push({
735
- type: "text",
736
- text: deviceType,
737
- size: "sm",
738
- color: "#888888",
739
- margin: "sm"
740
- });
741
- if (status) headerContents.push({
742
- type: "box",
743
- layout: "vertical",
744
- contents: [{
745
- type: "text",
746
- text: status,
747
- size: "sm",
748
- color: "#444444",
749
- wrap: true
750
- }],
751
- margin: "lg",
752
- paddingAll: "md",
753
- backgroundColor: "#F8F9FA",
754
- cornerRadius: "md"
755
- });
756
- const bubble = {
757
- type: "bubble",
758
- size: "mega",
759
- body: {
760
- type: "box",
761
- layout: "vertical",
762
- contents: headerContents,
763
- paddingAll: "xl",
764
- backgroundColor: "#FFFFFF"
765
- }
766
- };
767
- if (imageUrl) bubble.hero = {
768
- type: "image",
769
- url: imageUrl,
770
- size: "full",
771
- aspectRatio: "16:9",
772
- aspectMode: "cover"
773
- };
774
- if (controls.length > 0) {
775
- const rows = [];
776
- const limitedControls = controls.slice(0, 6);
777
- for (let i = 0; i < limitedControls.length; i += 2) {
778
- const rowButtons = [];
779
- for (const [offset, ctrl] of limitedControls.slice(i, i + 2).entries()) {
780
- const buttonLabel = ctrl.icon ? `${ctrl.icon} ${ctrl.label}` : ctrl.label;
781
- rowButtons.push({
782
- type: "button",
783
- action: {
784
- type: "postback",
785
- label: truncateLineActionLabel(buttonLabel, 18),
786
- data: ctrl.data
787
- },
788
- style: ctrl.style ?? "secondary",
789
- flex: 1,
790
- height: "sm",
791
- margin: offset > 0 ? "md" : void 0
792
- });
793
- }
794
- if (rowButtons.length === 1) rowButtons.push({ type: "filler" });
795
- rows.push({
796
- type: "box",
797
- layout: "horizontal",
798
- contents: rowButtons,
799
- margin: i > 0 ? "md" : void 0
800
- });
801
- }
802
- bubble.footer = {
803
- type: "box",
804
- layout: "vertical",
805
- contents: rows,
806
- paddingAll: "lg",
807
- backgroundColor: "#FAFAFA"
808
- };
809
- }
810
- return bubble;
811
- }
812
- //#endregion
813
- export { messageAction as a, createAgendaCard as c, attachFooterText as d, datetimePickerAction as i, createEventCard as l, createDeviceControlCard as n, postbackAction as o, createMediaPlayerCard as r, uriAction as s, createAppleTvRemoteCard as t, createReceiptCard as u };