slack-blocks-to-jsx 0.1.5 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +11 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +51 -356
- package/dist/index.mjs +51 -356
- package/dist/style.css +1 -1
- package/package.json +4 -2
package/dist/index.d.mts
CHANGED
|
@@ -991,6 +991,17 @@ type Props = {
|
|
|
991
991
|
time?: Date;
|
|
992
992
|
className?: string;
|
|
993
993
|
style?: React.CSSProperties;
|
|
994
|
+
unstyled?: boolean;
|
|
995
|
+
data?: {
|
|
996
|
+
users?: {
|
|
997
|
+
id: string;
|
|
998
|
+
name: string;
|
|
999
|
+
}[];
|
|
1000
|
+
channels?: {
|
|
1001
|
+
id: string;
|
|
1002
|
+
name: string;
|
|
1003
|
+
}[];
|
|
1004
|
+
};
|
|
994
1005
|
};
|
|
995
1006
|
declare const Message: (props: Props) => JSX.Element;
|
|
996
1007
|
|
package/dist/index.d.ts
CHANGED
|
@@ -991,6 +991,17 @@ type Props = {
|
|
|
991
991
|
time?: Date;
|
|
992
992
|
className?: string;
|
|
993
993
|
style?: React.CSSProperties;
|
|
994
|
+
unstyled?: boolean;
|
|
995
|
+
data?: {
|
|
996
|
+
users?: {
|
|
997
|
+
id: string;
|
|
998
|
+
name: string;
|
|
999
|
+
}[];
|
|
1000
|
+
channels?: {
|
|
1001
|
+
id: string;
|
|
1002
|
+
name: string;
|
|
1003
|
+
}[];
|
|
1004
|
+
};
|
|
994
1005
|
};
|
|
995
1006
|
declare const Message: (props: Props) => JSX.Element;
|
|
996
1007
|
|
package/dist/index.js
CHANGED
|
@@ -57,361 +57,26 @@ var parseEmojis = (text) => {
|
|
|
57
57
|
|
|
58
58
|
// src/utils/slack_text_to_jsx.ts
|
|
59
59
|
var import_html_react_parser = __toESM(require("html-react-parser"));
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
var
|
|
63
|
-
|
|
64
|
-
var escapeTags = (string) => ["<", string.substring(1, string.length - 1), ">"].join("");
|
|
65
|
-
var regex = {
|
|
66
|
-
new_line: import_xregexp.default.cache("\\n", "nsg"),
|
|
67
|
-
whitespace: import_xregexp.default.cache("\\s", "ns"),
|
|
68
|
-
characters: import_xregexp.default.cache("(?<mrkdwnCharacter>[\\*\\`\\~\\_]|>)", "ng"),
|
|
69
|
-
user_mention: import_xregexp.default.cache(
|
|
70
|
-
"<@(((?<userID>[U|W][^|>]+)(\\|(?<userName>[^>]+))?)|(?<userNameWithoutID>[^>]+))>",
|
|
71
|
-
"ng"
|
|
72
|
-
),
|
|
73
|
-
channel_mention: import_xregexp.default.cache(
|
|
74
|
-
"<#(((?<channelID>C[^|>]+)(\\|(?<channelName>[^>]+))?)|(?<channelNameWithoutID>[^>]+))>",
|
|
75
|
-
"ng"
|
|
76
|
-
),
|
|
77
|
-
link: import_xregexp.default.cache("<(?<linkUrl>https?:[^|>]+)(\\|(?<linkHtml>[^>]+))?>", "ng"),
|
|
78
|
-
mail_to: import_xregexp.default.cache("<mailto:(?<mailTo>[^|>]+)(\\|(?<mailToName>[^>]+))?>", "ng"),
|
|
79
|
-
tel: import_xregexp.default.cache("<tel:(?<tel>[^|>]+)(\\|(?<telName>[^>]+))?>", "ng"),
|
|
80
|
-
subteam_command: import_xregexp.default.cache(
|
|
81
|
-
"<!subteam\\^(?<subteamID>S[^|>]+)(\\|(?<subteamName>[^>]+))?>",
|
|
82
|
-
"ng"
|
|
83
|
-
),
|
|
84
|
-
command: import_xregexp.default.cache("<!(?<commandLiteral>[^|>]+)(\\|(?<commandName>[^>]+))?>", "ng")
|
|
85
|
-
};
|
|
86
|
-
var utility = {
|
|
87
|
-
replace_username: (match, users) => {
|
|
88
|
-
const userName = match.userName || match.userNameWithoutID || match.userID && users && users[match.userID];
|
|
89
|
-
if (userName) {
|
|
90
|
-
return `<span class="user-mention">@${userName}</span>`;
|
|
91
|
-
}
|
|
92
|
-
return escapeTags(match.toString());
|
|
93
|
-
},
|
|
94
|
-
replace_channel: (match, channels) => {
|
|
95
|
-
const channelName = match.channelName || match.channelNameWithoutID || match.channelID && channels && channels[match.channelID];
|
|
96
|
-
if (channelName) {
|
|
97
|
-
return `<span class="channel-mention">#${channelName}</span>`;
|
|
98
|
-
}
|
|
99
|
-
return escapeTags(match.toString());
|
|
100
|
-
},
|
|
101
|
-
replace_mailto: (match) => {
|
|
102
|
-
return `<a href="mailto:${match.mailTo}" target="_blank" rel="noopener noreferrer">${match.mailToName || match.mailTo}</a>`;
|
|
103
|
-
},
|
|
104
|
-
replace_tel: (match) => {
|
|
105
|
-
return `<a href="tel:${match.tel}" target="_blank" rel="noopener noreferrer">${match.telName || match.tel}</a>`;
|
|
106
|
-
},
|
|
107
|
-
replace_usergroup: (match, usergroups) => {
|
|
108
|
-
const userGroupName = match.subteamName || match.subteamID && usergroups && usergroups[match.subteamID];
|
|
109
|
-
if (userGroupName) {
|
|
110
|
-
return `${userGroupName}`;
|
|
111
|
-
}
|
|
112
|
-
return escapeTags(match.toString());
|
|
113
|
-
},
|
|
114
|
-
replace_command: (match) => {
|
|
115
|
-
if (match.commandLiteral && match.commandLiteral.startsWith("subteam")) {
|
|
116
|
-
return match.toString();
|
|
117
|
-
} else if (known_commands.includes(match.commandLiteral)) {
|
|
118
|
-
return `@${match.commandLiteral}`;
|
|
119
|
-
} else if (match.commandName) {
|
|
120
|
-
return `<${match.commandName}>`;
|
|
121
|
-
}
|
|
122
|
-
return `<${match.commandLiteral}>`;
|
|
123
|
-
},
|
|
124
|
-
build_opening_delimiter_regexp: (pattern, options) => {
|
|
125
|
-
const { prefixPattern = "", escapeDelimiter = true, spacePadded = false } = options;
|
|
126
|
-
const escapedDelimiter = escapeDelimiter ? import_xregexp.default.escape(pattern) : pattern;
|
|
127
|
-
return import_xregexp.default.cache(
|
|
128
|
-
`${spacePadded ? "(?<openingCapturedWhitespace>^|\\s)" : ""}${prefixPattern}${escapedDelimiter}`,
|
|
129
|
-
"ns"
|
|
130
|
-
);
|
|
131
|
-
},
|
|
132
|
-
build_closing_delimiter_regexp: (delimiter, options) => {
|
|
133
|
-
const { spacePadded = false, escapeDelimiter = true } = options;
|
|
134
|
-
const escapedDelimiter = escapeDelimiter ? import_xregexp.default.escape(delimiter) : delimiter;
|
|
135
|
-
return import_xregexp.default.cache(
|
|
136
|
-
`${escapedDelimiter}${spacePadded ? "(?<closingCapturedWhitespace>\\s|$)" : ""}`,
|
|
137
|
-
"ns"
|
|
138
|
-
);
|
|
139
|
-
},
|
|
140
|
-
increment_windows: (windows, offset) => {
|
|
141
|
-
windows.forEach((tagWindow) => {
|
|
142
|
-
tagWindow[0] += offset;
|
|
143
|
-
tagWindow[1] += offset;
|
|
144
|
-
});
|
|
145
|
-
return windows;
|
|
146
|
-
}
|
|
147
|
-
};
|
|
148
|
-
var patterns = {
|
|
149
|
-
inline_code_opening: '<code class="slack_inline_code">',
|
|
150
|
-
inline_code_closing: "</code>",
|
|
151
|
-
code_opening: '<pre class="slack_code">',
|
|
152
|
-
code_closing: "</pre>",
|
|
153
|
-
bold_opening: '<strong class="slack_bold">',
|
|
154
|
-
bold_closing: "</strong>",
|
|
155
|
-
strikethrough_opening: '<del class="slack_strikethrough">',
|
|
156
|
-
strikethrough_closing: "</del>",
|
|
157
|
-
italic_opening: '<i class="slack_italics">',
|
|
158
|
-
italic_closing: "</i>",
|
|
159
|
-
blockquote_opening: '<blockquote class="slack_blockquote">',
|
|
160
|
-
blockquote_closing: "</blockquote>",
|
|
161
|
-
inline_blockquote_opening: '<blockquote class="slack_inline_blockquote">',
|
|
162
|
-
inline_blockquote_closing: "</blockquote>",
|
|
163
|
-
line_break_tag_literal: "<br />"
|
|
164
|
-
};
|
|
165
|
-
var slack_text_parser = (text, options) => {
|
|
60
|
+
var import_slack_markdown = require("slack-markdown");
|
|
61
|
+
var slack_text_parser = import_slack_markdown.toHTML;
|
|
62
|
+
var slack_text_to_jsx = (text, parse_options) => {
|
|
63
|
+
const { markdown, users, channels } = parse_options;
|
|
166
64
|
if (!text)
|
|
167
|
-
return
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
_: "%5F"
|
|
180
|
-
};
|
|
181
|
-
const mrkdwnCharacter = match.mrkdwnCharacter;
|
|
182
|
-
const encodedLink = import_xregexp.default.replace(
|
|
183
|
-
match.linkUrl,
|
|
184
|
-
regex.characters,
|
|
185
|
-
(match2) => slackMrkdwnPercentageCharsMap[mrkdwnCharacter] || match2.mrkdwnCharacter
|
|
186
|
-
);
|
|
187
|
-
return `<a href="${encodedLink}" target="_blank" rel="noopener noreferrer">${match.linkHtml || encodedLink}</a>`;
|
|
188
|
-
});
|
|
189
|
-
if (markdown)
|
|
190
|
-
content = parse_markdown(content);
|
|
191
|
-
return import_xregexp.default.replaceEach(content, [
|
|
192
|
-
[regex.user_mention, (match) => utility.replace_username(match, users)],
|
|
193
|
-
[regex.channel_mention, (match) => utility.replace_channel(match, channels)],
|
|
194
|
-
[regex.mail_to, (match) => utility.replace_mailto(match)],
|
|
195
|
-
[regex.tel, (match) => utility.replace_tel(match)],
|
|
196
|
-
[regex.subteam_command, (match) => utility.replace_usergroup(match, usergroups)],
|
|
197
|
-
[regex.command, (match) => utility.replace_command(match)]
|
|
198
|
-
]);
|
|
199
|
-
};
|
|
200
|
-
var parse_markdown = (text) => {
|
|
201
|
-
let expandedTextAndWindows = { text, windows: [[0, text.length]] };
|
|
202
|
-
expandedTextAndWindows = replace_characters({
|
|
203
|
-
text: expandedTextAndWindows.text,
|
|
204
|
-
delimiter: "*",
|
|
205
|
-
replacementOpeningLiteral: patterns.bold_opening,
|
|
206
|
-
replacementClosingLiteral: patterns.bold_closing,
|
|
207
|
-
closedTagWindows: expandedTextAndWindows.windows,
|
|
208
|
-
options: {
|
|
209
|
-
maxReplacements: 100
|
|
210
|
-
}
|
|
211
|
-
});
|
|
212
|
-
expandedTextAndWindows = replace_characters({
|
|
213
|
-
text: expandedTextAndWindows.text,
|
|
214
|
-
delimiter: "~",
|
|
215
|
-
replacementOpeningLiteral: patterns.strikethrough_opening,
|
|
216
|
-
replacementClosingLiteral: patterns.strikethrough_closing,
|
|
217
|
-
closedTagWindows: expandedTextAndWindows.windows,
|
|
218
|
-
options: {
|
|
219
|
-
maxReplacements: 100
|
|
220
|
-
}
|
|
221
|
-
});
|
|
222
|
-
expandedTextAndWindows = replace_characters({
|
|
223
|
-
text: expandedTextAndWindows.text,
|
|
224
|
-
delimiter: "_",
|
|
225
|
-
replacementOpeningLiteral: patterns.italic_opening,
|
|
226
|
-
replacementClosingLiteral: patterns.italic_closing,
|
|
227
|
-
closedTagWindows: expandedTextAndWindows.windows,
|
|
228
|
-
options: {
|
|
229
|
-
spacePadded: true,
|
|
230
|
-
maxReplacements: 100
|
|
231
|
-
}
|
|
232
|
-
});
|
|
233
|
-
expandedTextAndWindows = replace_characters({
|
|
234
|
-
text: expandedTextAndWindows.text,
|
|
235
|
-
delimiter: "```",
|
|
236
|
-
replacementOpeningLiteral: patterns.code_opening,
|
|
237
|
-
replacementClosingLiteral: patterns.code_closing,
|
|
238
|
-
closedTagWindows: expandedTextAndWindows.windows,
|
|
239
|
-
options: {
|
|
240
|
-
partitionWindowOnMatch: true,
|
|
241
|
-
replaceNewlines: true
|
|
242
|
-
}
|
|
243
|
-
});
|
|
244
|
-
expandedTextAndWindows = replace_characters({
|
|
245
|
-
text: expandedTextAndWindows.text,
|
|
246
|
-
delimiter: "`",
|
|
247
|
-
replacementOpeningLiteral: patterns.inline_code_opening,
|
|
248
|
-
replacementClosingLiteral: patterns.inline_code_closing,
|
|
249
|
-
closedTagWindows: expandedTextAndWindows.windows,
|
|
250
|
-
options: {
|
|
251
|
-
partitionWindowOnMatch: true
|
|
252
|
-
}
|
|
253
|
-
});
|
|
254
|
-
expandedTextAndWindows = replace_characters({
|
|
255
|
-
text: expandedTextAndWindows.text,
|
|
256
|
-
delimiter: ">>>",
|
|
257
|
-
replacementOpeningLiteral: patterns.blockquote_opening,
|
|
258
|
-
replacementClosingLiteral: patterns.blockquote_closing,
|
|
259
|
-
closedTagWindows: expandedTextAndWindows.windows,
|
|
260
|
-
options: {
|
|
261
|
-
prefixPattern: "^\\s*",
|
|
262
|
-
endingPattern: "$",
|
|
263
|
-
replaceNewlines: true,
|
|
264
|
-
maxReplacements: 100
|
|
265
|
-
}
|
|
266
|
-
});
|
|
267
|
-
expandedTextAndWindows = replace_characters({
|
|
268
|
-
text: expandedTextAndWindows.text,
|
|
269
|
-
delimiter: ">",
|
|
270
|
-
replacementOpeningLiteral: patterns.inline_blockquote_opening,
|
|
271
|
-
replacementClosingLiteral: patterns.inline_blockquote_closing,
|
|
272
|
-
closedTagWindows: expandedTextAndWindows.windows,
|
|
273
|
-
options: {
|
|
274
|
-
prefixPattern: "^\\s*",
|
|
275
|
-
endingPattern: "\\n|$",
|
|
276
|
-
maxReplacements: 100
|
|
277
|
-
}
|
|
278
|
-
});
|
|
279
|
-
return expandedTextAndWindows.text;
|
|
280
|
-
};
|
|
281
|
-
var replace_characters = (input) => {
|
|
282
|
-
var _a;
|
|
283
|
-
const {
|
|
284
|
-
closedTagWindows,
|
|
285
|
-
delimiter,
|
|
286
|
-
options,
|
|
287
|
-
replacementClosingLiteral,
|
|
288
|
-
replacementOpeningLiteral,
|
|
289
|
-
text,
|
|
290
|
-
tagWindowIndex = 0,
|
|
291
|
-
tagWindowOffset = 0
|
|
292
|
-
} = input;
|
|
293
|
-
const partitionWindowOnMatch = options.partitionWindowOnMatch;
|
|
294
|
-
const spacePadded = options.spacePadded;
|
|
295
|
-
const asymmetric = options.endingPattern;
|
|
296
|
-
const replaceNewlines = options.replaceNewlines;
|
|
297
|
-
const prefixPattern = options.prefixPattern;
|
|
298
|
-
let maxReplacements = options.maxReplacements;
|
|
299
|
-
const openingDelimiterRegExp = utility.build_opening_delimiter_regexp(delimiter, {
|
|
300
|
-
spacePadded,
|
|
301
|
-
prefixPattern
|
|
302
|
-
});
|
|
303
|
-
const closingDelimiterRegExp = asymmetric ? utility.build_closing_delimiter_regexp((_a = options.endingPattern) != null ? _a : "", {
|
|
304
|
-
escapeDelimiter: false
|
|
305
|
-
}) : utility.build_closing_delimiter_regexp(delimiter, { spacePadded });
|
|
306
|
-
if (tagWindowIndex >= closedTagWindows.length || maxReplacements && maxReplacements <= 0) {
|
|
307
|
-
return {
|
|
308
|
-
text,
|
|
309
|
-
windows: closedTagWindows
|
|
310
|
-
};
|
|
311
|
-
}
|
|
312
|
-
const currentClosedTagWindow = closedTagWindows[tagWindowIndex];
|
|
313
|
-
const tagWindowStartIndex = currentClosedTagWindow == null ? void 0 : currentClosedTagWindow[0];
|
|
314
|
-
const tagWindowEndIndex = currentClosedTagWindow == null ? void 0 : currentClosedTagWindow[1];
|
|
315
|
-
if (tagWindowStartIndex >= tagWindowEndIndex || tagWindowStartIndex + tagWindowOffset > tagWindowEndIndex) {
|
|
316
|
-
return replace_characters({
|
|
317
|
-
text,
|
|
318
|
-
delimiter,
|
|
319
|
-
replacementClosingLiteral,
|
|
320
|
-
replacementOpeningLiteral,
|
|
321
|
-
closedTagWindows,
|
|
322
|
-
options,
|
|
323
|
-
tagWindowIndex: tagWindowIndex + 1
|
|
324
|
-
});
|
|
325
|
-
}
|
|
326
|
-
const openingMatch = import_xregexp.default.exec(
|
|
327
|
-
text,
|
|
328
|
-
openingDelimiterRegExp,
|
|
329
|
-
tagWindowStartIndex + tagWindowOffset
|
|
330
|
-
);
|
|
331
|
-
if (openingMatch && openingMatch.index < tagWindowEndIndex) {
|
|
332
|
-
const closingDelimiterLength = asymmetric ? 0 : delimiter.length;
|
|
333
|
-
const closingMatchMaxIndex = (tagWindowIndex === closedTagWindows.length - 1 && tagWindowEndIndex === text.length ? tagWindowEndIndex + 1 : tagWindowEndIndex) - closingDelimiterLength + 1;
|
|
334
|
-
let closingMatch = import_xregexp.default.exec(
|
|
335
|
-
text,
|
|
336
|
-
closingDelimiterRegExp,
|
|
337
|
-
openingMatch.index + delimiter.length
|
|
338
|
-
);
|
|
339
|
-
let nextClosingMatch = closingMatch && import_xregexp.default.exec(text, closingDelimiterRegExp, closingMatch.index + 1);
|
|
340
|
-
while (nextClosingMatch) {
|
|
341
|
-
const nextWhitespace = import_xregexp.default.exec(
|
|
342
|
-
text,
|
|
343
|
-
regex.whitespace,
|
|
344
|
-
closingMatch.index + delimiter.length
|
|
345
|
-
);
|
|
346
|
-
const crossedWhitespace = nextWhitespace && nextWhitespace.index < closingMatchMaxIndex;
|
|
347
|
-
if (nextClosingMatch.index >= closingMatchMaxIndex || crossedWhitespace) {
|
|
348
|
-
break;
|
|
349
|
-
}
|
|
350
|
-
closingMatch = nextClosingMatch;
|
|
351
|
-
nextClosingMatch = import_xregexp.default.exec(text, closingDelimiterRegExp, closingMatch.index + 1);
|
|
352
|
-
}
|
|
353
|
-
if (closingMatch && closingMatch.index < closingMatchMaxIndex) {
|
|
354
|
-
const afterDelimitersIndex = closingMatch.index + closingMatch[0].length;
|
|
355
|
-
const textBeforeDelimiter = text.slice(0, openingMatch.index);
|
|
356
|
-
const textAfterDelimiter = text.slice(afterDelimitersIndex);
|
|
357
|
-
const openingReplacementString = `${spacePadded ? openingMatch.openingCapturedWhitespace || " " : ""}${replacementOpeningLiteral}`;
|
|
358
|
-
const closingReplacementString = `${replacementClosingLiteral}${spacePadded ? closingMatch.closingCapturedWhitespace || " " : ""}${asymmetric ? closingMatch[0] : ""}`;
|
|
359
|
-
const textBetweenDelimiters = text.slice(
|
|
360
|
-
openingMatch.index + openingMatch[0].length,
|
|
361
|
-
closingMatch.index
|
|
362
|
-
);
|
|
363
|
-
const replacedTextBetweenDelimiters = replaceNewlines ? import_xregexp.default.replace(textBetweenDelimiters, regex.new_line, patterns.line_break_tag_literal) : textBetweenDelimiters;
|
|
364
|
-
const replacedDelimiterText = [
|
|
365
|
-
openingReplacementString,
|
|
366
|
-
replacedTextBetweenDelimiters,
|
|
367
|
-
closingReplacementString
|
|
368
|
-
].join("");
|
|
369
|
-
const delimiterReplacementLength = delimiter.length + closingDelimiterLength;
|
|
370
|
-
const windowOffset = replacementOpeningLiteral.length + replacementClosingLiteral.length - delimiterReplacementLength + replacedTextBetweenDelimiters.length - textBetweenDelimiters.length;
|
|
371
|
-
const newUpperWindowLimit = tagWindowEndIndex + windowOffset;
|
|
372
|
-
const nextWindowIndex = partitionWindowOnMatch ? tagWindowIndex + 1 : tagWindowIndex;
|
|
373
|
-
const nextTagWindowOffset = partitionWindowOnMatch ? 0 : afterDelimitersIndex + windowOffset - tagWindowStartIndex + 1;
|
|
374
|
-
if (partitionWindowOnMatch) {
|
|
375
|
-
currentClosedTagWindow[1] = openingMatch.index;
|
|
376
|
-
closedTagWindows.splice(nextWindowIndex, 0, [
|
|
377
|
-
closingMatch.index + closingDelimiterLength + windowOffset,
|
|
378
|
-
newUpperWindowLimit
|
|
379
|
-
]);
|
|
380
|
-
} else {
|
|
381
|
-
currentClosedTagWindow[1] = newUpperWindowLimit;
|
|
382
|
-
}
|
|
383
|
-
utility.increment_windows(closedTagWindows.slice(nextWindowIndex + 1), windowOffset);
|
|
384
|
-
if (maxReplacements) {
|
|
385
|
-
maxReplacements -= 1;
|
|
65
|
+
return null;
|
|
66
|
+
const html_string = slack_text_parser(text, {
|
|
67
|
+
slackCallbacks: {
|
|
68
|
+
user(data) {
|
|
69
|
+
const user = users.find((u) => u.id === data.id || u.name === data.name);
|
|
70
|
+
const label = (user == null ? void 0 : user.name) || data.id || data.name;
|
|
71
|
+
return `<span class="slack_user" data-user-id="${(user == null ? void 0 : user.id) || data.id}">@${label}</span>`;
|
|
72
|
+
},
|
|
73
|
+
channel(data) {
|
|
74
|
+
const channel = channels.find((c) => c.id === data.id || c.name === data.name);
|
|
75
|
+
const label = (channel == null ? void 0 : channel.name) || data.id || data.name;
|
|
76
|
+
return `<span class="slack_channel" data-channel-id="${(channel == null ? void 0 : channel.id) || data.id}">#${label}</span>`;
|
|
386
77
|
}
|
|
387
|
-
return replace_characters({
|
|
388
|
-
text: [textBeforeDelimiter, replacedDelimiterText, textAfterDelimiter].join(""),
|
|
389
|
-
delimiter,
|
|
390
|
-
replacementOpeningLiteral,
|
|
391
|
-
replacementClosingLiteral,
|
|
392
|
-
closedTagWindows,
|
|
393
|
-
options: Object.assign({}, options, { maxReplacements }),
|
|
394
|
-
tagWindowIndex: nextWindowIndex,
|
|
395
|
-
tagWindowOffset: nextTagWindowOffset
|
|
396
|
-
});
|
|
397
78
|
}
|
|
398
|
-
}
|
|
399
|
-
return replace_characters({
|
|
400
|
-
text,
|
|
401
|
-
delimiter,
|
|
402
|
-
replacementOpeningLiteral,
|
|
403
|
-
replacementClosingLiteral,
|
|
404
|
-
closedTagWindows,
|
|
405
|
-
options,
|
|
406
|
-
tagWindowIndex: tagWindowIndex + 1
|
|
407
79
|
});
|
|
408
|
-
};
|
|
409
|
-
|
|
410
|
-
// src/utils/slack_text_to_jsx.ts
|
|
411
|
-
var slack_text_to_jsx = (text, parse_options) => {
|
|
412
|
-
if (!text)
|
|
413
|
-
return null;
|
|
414
|
-
const html_string = slack_text_parser(text, { markdown: parse_options.markdown });
|
|
415
80
|
return (0, import_html_react_parser.default)(html_string, { trim: false });
|
|
416
81
|
};
|
|
417
82
|
|
|
@@ -489,15 +154,35 @@ var ImageElement = (props) => {
|
|
|
489
154
|
) });
|
|
490
155
|
};
|
|
491
156
|
|
|
157
|
+
// src/store/useGlobalData.ts
|
|
158
|
+
var import_zustand = require("zustand");
|
|
159
|
+
var useBearStore = (0, import_zustand.create)((set) => ({
|
|
160
|
+
users: [],
|
|
161
|
+
channels: [],
|
|
162
|
+
setUsers: (users) => set({ users }),
|
|
163
|
+
setChannels: (channels) => set({ channels })
|
|
164
|
+
}));
|
|
165
|
+
var useGlobalData = () => {
|
|
166
|
+
const { users, channels, setChannels, setUsers } = useBearStore();
|
|
167
|
+
return {
|
|
168
|
+
users,
|
|
169
|
+
channels,
|
|
170
|
+
setChannels,
|
|
171
|
+
setUsers
|
|
172
|
+
};
|
|
173
|
+
};
|
|
174
|
+
|
|
492
175
|
// src/components/composition_objects/text_object.tsx
|
|
493
176
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
494
177
|
var TextObject = (props) => {
|
|
495
178
|
const { type, text, emoji, verbatim = false } = props.data;
|
|
496
179
|
const { className = "" } = props;
|
|
497
|
-
const
|
|
180
|
+
const { channels, users } = useGlobalData();
|
|
181
|
+
let emoji_parsed = type == "mrkdwn" ? parseEmojis(text) : emoji === false ? text : parseEmojis(text);
|
|
182
|
+
emoji_parsed = emoji_parsed.replace(/>/g, "> ").replace(/</g, "<");
|
|
498
183
|
if (type === "plain_text")
|
|
499
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className, children: slack_text_to_jsx(emoji_parsed, { markdown: false }) });
|
|
500
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className, children: slack_text_to_jsx(emoji_parsed, { markdown: true }) });
|
|
184
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className, children: slack_text_to_jsx(emoji_parsed, { markdown: false, users, channels }) });
|
|
185
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className, children: slack_text_to_jsx(emoji_parsed, { markdown: true, users, channels }) });
|
|
501
186
|
};
|
|
502
187
|
|
|
503
188
|
// src/components/elements/button_element.tsx
|
|
@@ -1160,6 +845,7 @@ var BlockWrapper = (props) => {
|
|
|
1160
845
|
};
|
|
1161
846
|
|
|
1162
847
|
// src/message.tsx
|
|
848
|
+
var import_react6 = require("react");
|
|
1163
849
|
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1164
850
|
var Message = (props) => {
|
|
1165
851
|
const {
|
|
@@ -1169,12 +855,21 @@ var Message = (props) => {
|
|
|
1169
855
|
time = /* @__PURE__ */ new Date(),
|
|
1170
856
|
className = "",
|
|
1171
857
|
style,
|
|
1172
|
-
showBlockKitDebug = false
|
|
858
|
+
showBlockKitDebug = false,
|
|
859
|
+
unstyled = false,
|
|
860
|
+
data = {}
|
|
1173
861
|
} = props;
|
|
862
|
+
const { setChannels, setUsers } = useGlobalData();
|
|
863
|
+
(0, import_react6.useEffect)(() => {
|
|
864
|
+
if (data.users)
|
|
865
|
+
setUsers(data.users);
|
|
866
|
+
if (data.channels)
|
|
867
|
+
setChannels(data.channels);
|
|
868
|
+
}, [data]);
|
|
1174
869
|
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { id: "slack_blocks_to_jsx", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
1175
870
|
"section",
|
|
1176
871
|
{
|
|
1177
|
-
className: `flex gap-2 w-full max-w-[600px] slack_blocks_to_jsx relative ${className}`,
|
|
872
|
+
className: `flex gap-2 w-full max-w-[600px] slack_blocks_to_jsx relative ${unstyled ? "styles_disabled" : "styles_enabled"} ${className}`,
|
|
1178
873
|
style,
|
|
1179
874
|
children: [
|
|
1180
875
|
showBlockKitDebug && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
package/dist/index.mjs
CHANGED
|
@@ -21,361 +21,26 @@ var parseEmojis = (text) => {
|
|
|
21
21
|
|
|
22
22
|
// src/utils/slack_text_to_jsx.ts
|
|
23
23
|
import parse from "html-react-parser";
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
var escapeTags = (string) => ["<", string.substring(1, string.length - 1), ">"].join("");
|
|
29
|
-
var regex = {
|
|
30
|
-
new_line: XRegExp.cache("\\n", "nsg"),
|
|
31
|
-
whitespace: XRegExp.cache("\\s", "ns"),
|
|
32
|
-
characters: XRegExp.cache("(?<mrkdwnCharacter>[\\*\\`\\~\\_]|>)", "ng"),
|
|
33
|
-
user_mention: XRegExp.cache(
|
|
34
|
-
"<@(((?<userID>[U|W][^|>]+)(\\|(?<userName>[^>]+))?)|(?<userNameWithoutID>[^>]+))>",
|
|
35
|
-
"ng"
|
|
36
|
-
),
|
|
37
|
-
channel_mention: XRegExp.cache(
|
|
38
|
-
"<#(((?<channelID>C[^|>]+)(\\|(?<channelName>[^>]+))?)|(?<channelNameWithoutID>[^>]+))>",
|
|
39
|
-
"ng"
|
|
40
|
-
),
|
|
41
|
-
link: XRegExp.cache("<(?<linkUrl>https?:[^|>]+)(\\|(?<linkHtml>[^>]+))?>", "ng"),
|
|
42
|
-
mail_to: XRegExp.cache("<mailto:(?<mailTo>[^|>]+)(\\|(?<mailToName>[^>]+))?>", "ng"),
|
|
43
|
-
tel: XRegExp.cache("<tel:(?<tel>[^|>]+)(\\|(?<telName>[^>]+))?>", "ng"),
|
|
44
|
-
subteam_command: XRegExp.cache(
|
|
45
|
-
"<!subteam\\^(?<subteamID>S[^|>]+)(\\|(?<subteamName>[^>]+))?>",
|
|
46
|
-
"ng"
|
|
47
|
-
),
|
|
48
|
-
command: XRegExp.cache("<!(?<commandLiteral>[^|>]+)(\\|(?<commandName>[^>]+))?>", "ng")
|
|
49
|
-
};
|
|
50
|
-
var utility = {
|
|
51
|
-
replace_username: (match, users) => {
|
|
52
|
-
const userName = match.userName || match.userNameWithoutID || match.userID && users && users[match.userID];
|
|
53
|
-
if (userName) {
|
|
54
|
-
return `<span class="user-mention">@${userName}</span>`;
|
|
55
|
-
}
|
|
56
|
-
return escapeTags(match.toString());
|
|
57
|
-
},
|
|
58
|
-
replace_channel: (match, channels) => {
|
|
59
|
-
const channelName = match.channelName || match.channelNameWithoutID || match.channelID && channels && channels[match.channelID];
|
|
60
|
-
if (channelName) {
|
|
61
|
-
return `<span class="channel-mention">#${channelName}</span>`;
|
|
62
|
-
}
|
|
63
|
-
return escapeTags(match.toString());
|
|
64
|
-
},
|
|
65
|
-
replace_mailto: (match) => {
|
|
66
|
-
return `<a href="mailto:${match.mailTo}" target="_blank" rel="noopener noreferrer">${match.mailToName || match.mailTo}</a>`;
|
|
67
|
-
},
|
|
68
|
-
replace_tel: (match) => {
|
|
69
|
-
return `<a href="tel:${match.tel}" target="_blank" rel="noopener noreferrer">${match.telName || match.tel}</a>`;
|
|
70
|
-
},
|
|
71
|
-
replace_usergroup: (match, usergroups) => {
|
|
72
|
-
const userGroupName = match.subteamName || match.subteamID && usergroups && usergroups[match.subteamID];
|
|
73
|
-
if (userGroupName) {
|
|
74
|
-
return `${userGroupName}`;
|
|
75
|
-
}
|
|
76
|
-
return escapeTags(match.toString());
|
|
77
|
-
},
|
|
78
|
-
replace_command: (match) => {
|
|
79
|
-
if (match.commandLiteral && match.commandLiteral.startsWith("subteam")) {
|
|
80
|
-
return match.toString();
|
|
81
|
-
} else if (known_commands.includes(match.commandLiteral)) {
|
|
82
|
-
return `@${match.commandLiteral}`;
|
|
83
|
-
} else if (match.commandName) {
|
|
84
|
-
return `<${match.commandName}>`;
|
|
85
|
-
}
|
|
86
|
-
return `<${match.commandLiteral}>`;
|
|
87
|
-
},
|
|
88
|
-
build_opening_delimiter_regexp: (pattern, options) => {
|
|
89
|
-
const { prefixPattern = "", escapeDelimiter = true, spacePadded = false } = options;
|
|
90
|
-
const escapedDelimiter = escapeDelimiter ? XRegExp.escape(pattern) : pattern;
|
|
91
|
-
return XRegExp.cache(
|
|
92
|
-
`${spacePadded ? "(?<openingCapturedWhitespace>^|\\s)" : ""}${prefixPattern}${escapedDelimiter}`,
|
|
93
|
-
"ns"
|
|
94
|
-
);
|
|
95
|
-
},
|
|
96
|
-
build_closing_delimiter_regexp: (delimiter, options) => {
|
|
97
|
-
const { spacePadded = false, escapeDelimiter = true } = options;
|
|
98
|
-
const escapedDelimiter = escapeDelimiter ? XRegExp.escape(delimiter) : delimiter;
|
|
99
|
-
return XRegExp.cache(
|
|
100
|
-
`${escapedDelimiter}${spacePadded ? "(?<closingCapturedWhitespace>\\s|$)" : ""}`,
|
|
101
|
-
"ns"
|
|
102
|
-
);
|
|
103
|
-
},
|
|
104
|
-
increment_windows: (windows, offset) => {
|
|
105
|
-
windows.forEach((tagWindow) => {
|
|
106
|
-
tagWindow[0] += offset;
|
|
107
|
-
tagWindow[1] += offset;
|
|
108
|
-
});
|
|
109
|
-
return windows;
|
|
110
|
-
}
|
|
111
|
-
};
|
|
112
|
-
var patterns = {
|
|
113
|
-
inline_code_opening: '<code class="slack_inline_code">',
|
|
114
|
-
inline_code_closing: "</code>",
|
|
115
|
-
code_opening: '<pre class="slack_code">',
|
|
116
|
-
code_closing: "</pre>",
|
|
117
|
-
bold_opening: '<strong class="slack_bold">',
|
|
118
|
-
bold_closing: "</strong>",
|
|
119
|
-
strikethrough_opening: '<del class="slack_strikethrough">',
|
|
120
|
-
strikethrough_closing: "</del>",
|
|
121
|
-
italic_opening: '<i class="slack_italics">',
|
|
122
|
-
italic_closing: "</i>",
|
|
123
|
-
blockquote_opening: '<blockquote class="slack_blockquote">',
|
|
124
|
-
blockquote_closing: "</blockquote>",
|
|
125
|
-
inline_blockquote_opening: '<blockquote class="slack_inline_blockquote">',
|
|
126
|
-
inline_blockquote_closing: "</blockquote>",
|
|
127
|
-
line_break_tag_literal: "<br />"
|
|
128
|
-
};
|
|
129
|
-
var slack_text_parser = (text, options) => {
|
|
24
|
+
import { toHTML } from "slack-markdown";
|
|
25
|
+
var slack_text_parser = toHTML;
|
|
26
|
+
var slack_text_to_jsx = (text, parse_options) => {
|
|
27
|
+
const { markdown, users, channels } = parse_options;
|
|
130
28
|
if (!text)
|
|
131
|
-
return
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
_: "%5F"
|
|
144
|
-
};
|
|
145
|
-
const mrkdwnCharacter = match.mrkdwnCharacter;
|
|
146
|
-
const encodedLink = XRegExp.replace(
|
|
147
|
-
match.linkUrl,
|
|
148
|
-
regex.characters,
|
|
149
|
-
(match2) => slackMrkdwnPercentageCharsMap[mrkdwnCharacter] || match2.mrkdwnCharacter
|
|
150
|
-
);
|
|
151
|
-
return `<a href="${encodedLink}" target="_blank" rel="noopener noreferrer">${match.linkHtml || encodedLink}</a>`;
|
|
152
|
-
});
|
|
153
|
-
if (markdown)
|
|
154
|
-
content = parse_markdown(content);
|
|
155
|
-
return XRegExp.replaceEach(content, [
|
|
156
|
-
[regex.user_mention, (match) => utility.replace_username(match, users)],
|
|
157
|
-
[regex.channel_mention, (match) => utility.replace_channel(match, channels)],
|
|
158
|
-
[regex.mail_to, (match) => utility.replace_mailto(match)],
|
|
159
|
-
[regex.tel, (match) => utility.replace_tel(match)],
|
|
160
|
-
[regex.subteam_command, (match) => utility.replace_usergroup(match, usergroups)],
|
|
161
|
-
[regex.command, (match) => utility.replace_command(match)]
|
|
162
|
-
]);
|
|
163
|
-
};
|
|
164
|
-
var parse_markdown = (text) => {
|
|
165
|
-
let expandedTextAndWindows = { text, windows: [[0, text.length]] };
|
|
166
|
-
expandedTextAndWindows = replace_characters({
|
|
167
|
-
text: expandedTextAndWindows.text,
|
|
168
|
-
delimiter: "*",
|
|
169
|
-
replacementOpeningLiteral: patterns.bold_opening,
|
|
170
|
-
replacementClosingLiteral: patterns.bold_closing,
|
|
171
|
-
closedTagWindows: expandedTextAndWindows.windows,
|
|
172
|
-
options: {
|
|
173
|
-
maxReplacements: 100
|
|
174
|
-
}
|
|
175
|
-
});
|
|
176
|
-
expandedTextAndWindows = replace_characters({
|
|
177
|
-
text: expandedTextAndWindows.text,
|
|
178
|
-
delimiter: "~",
|
|
179
|
-
replacementOpeningLiteral: patterns.strikethrough_opening,
|
|
180
|
-
replacementClosingLiteral: patterns.strikethrough_closing,
|
|
181
|
-
closedTagWindows: expandedTextAndWindows.windows,
|
|
182
|
-
options: {
|
|
183
|
-
maxReplacements: 100
|
|
184
|
-
}
|
|
185
|
-
});
|
|
186
|
-
expandedTextAndWindows = replace_characters({
|
|
187
|
-
text: expandedTextAndWindows.text,
|
|
188
|
-
delimiter: "_",
|
|
189
|
-
replacementOpeningLiteral: patterns.italic_opening,
|
|
190
|
-
replacementClosingLiteral: patterns.italic_closing,
|
|
191
|
-
closedTagWindows: expandedTextAndWindows.windows,
|
|
192
|
-
options: {
|
|
193
|
-
spacePadded: true,
|
|
194
|
-
maxReplacements: 100
|
|
195
|
-
}
|
|
196
|
-
});
|
|
197
|
-
expandedTextAndWindows = replace_characters({
|
|
198
|
-
text: expandedTextAndWindows.text,
|
|
199
|
-
delimiter: "```",
|
|
200
|
-
replacementOpeningLiteral: patterns.code_opening,
|
|
201
|
-
replacementClosingLiteral: patterns.code_closing,
|
|
202
|
-
closedTagWindows: expandedTextAndWindows.windows,
|
|
203
|
-
options: {
|
|
204
|
-
partitionWindowOnMatch: true,
|
|
205
|
-
replaceNewlines: true
|
|
206
|
-
}
|
|
207
|
-
});
|
|
208
|
-
expandedTextAndWindows = replace_characters({
|
|
209
|
-
text: expandedTextAndWindows.text,
|
|
210
|
-
delimiter: "`",
|
|
211
|
-
replacementOpeningLiteral: patterns.inline_code_opening,
|
|
212
|
-
replacementClosingLiteral: patterns.inline_code_closing,
|
|
213
|
-
closedTagWindows: expandedTextAndWindows.windows,
|
|
214
|
-
options: {
|
|
215
|
-
partitionWindowOnMatch: true
|
|
216
|
-
}
|
|
217
|
-
});
|
|
218
|
-
expandedTextAndWindows = replace_characters({
|
|
219
|
-
text: expandedTextAndWindows.text,
|
|
220
|
-
delimiter: ">>>",
|
|
221
|
-
replacementOpeningLiteral: patterns.blockquote_opening,
|
|
222
|
-
replacementClosingLiteral: patterns.blockquote_closing,
|
|
223
|
-
closedTagWindows: expandedTextAndWindows.windows,
|
|
224
|
-
options: {
|
|
225
|
-
prefixPattern: "^\\s*",
|
|
226
|
-
endingPattern: "$",
|
|
227
|
-
replaceNewlines: true,
|
|
228
|
-
maxReplacements: 100
|
|
229
|
-
}
|
|
230
|
-
});
|
|
231
|
-
expandedTextAndWindows = replace_characters({
|
|
232
|
-
text: expandedTextAndWindows.text,
|
|
233
|
-
delimiter: ">",
|
|
234
|
-
replacementOpeningLiteral: patterns.inline_blockquote_opening,
|
|
235
|
-
replacementClosingLiteral: patterns.inline_blockquote_closing,
|
|
236
|
-
closedTagWindows: expandedTextAndWindows.windows,
|
|
237
|
-
options: {
|
|
238
|
-
prefixPattern: "^\\s*",
|
|
239
|
-
endingPattern: "\\n|$",
|
|
240
|
-
maxReplacements: 100
|
|
241
|
-
}
|
|
242
|
-
});
|
|
243
|
-
return expandedTextAndWindows.text;
|
|
244
|
-
};
|
|
245
|
-
var replace_characters = (input) => {
|
|
246
|
-
var _a;
|
|
247
|
-
const {
|
|
248
|
-
closedTagWindows,
|
|
249
|
-
delimiter,
|
|
250
|
-
options,
|
|
251
|
-
replacementClosingLiteral,
|
|
252
|
-
replacementOpeningLiteral,
|
|
253
|
-
text,
|
|
254
|
-
tagWindowIndex = 0,
|
|
255
|
-
tagWindowOffset = 0
|
|
256
|
-
} = input;
|
|
257
|
-
const partitionWindowOnMatch = options.partitionWindowOnMatch;
|
|
258
|
-
const spacePadded = options.spacePadded;
|
|
259
|
-
const asymmetric = options.endingPattern;
|
|
260
|
-
const replaceNewlines = options.replaceNewlines;
|
|
261
|
-
const prefixPattern = options.prefixPattern;
|
|
262
|
-
let maxReplacements = options.maxReplacements;
|
|
263
|
-
const openingDelimiterRegExp = utility.build_opening_delimiter_regexp(delimiter, {
|
|
264
|
-
spacePadded,
|
|
265
|
-
prefixPattern
|
|
266
|
-
});
|
|
267
|
-
const closingDelimiterRegExp = asymmetric ? utility.build_closing_delimiter_regexp((_a = options.endingPattern) != null ? _a : "", {
|
|
268
|
-
escapeDelimiter: false
|
|
269
|
-
}) : utility.build_closing_delimiter_regexp(delimiter, { spacePadded });
|
|
270
|
-
if (tagWindowIndex >= closedTagWindows.length || maxReplacements && maxReplacements <= 0) {
|
|
271
|
-
return {
|
|
272
|
-
text,
|
|
273
|
-
windows: closedTagWindows
|
|
274
|
-
};
|
|
275
|
-
}
|
|
276
|
-
const currentClosedTagWindow = closedTagWindows[tagWindowIndex];
|
|
277
|
-
const tagWindowStartIndex = currentClosedTagWindow == null ? void 0 : currentClosedTagWindow[0];
|
|
278
|
-
const tagWindowEndIndex = currentClosedTagWindow == null ? void 0 : currentClosedTagWindow[1];
|
|
279
|
-
if (tagWindowStartIndex >= tagWindowEndIndex || tagWindowStartIndex + tagWindowOffset > tagWindowEndIndex) {
|
|
280
|
-
return replace_characters({
|
|
281
|
-
text,
|
|
282
|
-
delimiter,
|
|
283
|
-
replacementClosingLiteral,
|
|
284
|
-
replacementOpeningLiteral,
|
|
285
|
-
closedTagWindows,
|
|
286
|
-
options,
|
|
287
|
-
tagWindowIndex: tagWindowIndex + 1
|
|
288
|
-
});
|
|
289
|
-
}
|
|
290
|
-
const openingMatch = XRegExp.exec(
|
|
291
|
-
text,
|
|
292
|
-
openingDelimiterRegExp,
|
|
293
|
-
tagWindowStartIndex + tagWindowOffset
|
|
294
|
-
);
|
|
295
|
-
if (openingMatch && openingMatch.index < tagWindowEndIndex) {
|
|
296
|
-
const closingDelimiterLength = asymmetric ? 0 : delimiter.length;
|
|
297
|
-
const closingMatchMaxIndex = (tagWindowIndex === closedTagWindows.length - 1 && tagWindowEndIndex === text.length ? tagWindowEndIndex + 1 : tagWindowEndIndex) - closingDelimiterLength + 1;
|
|
298
|
-
let closingMatch = XRegExp.exec(
|
|
299
|
-
text,
|
|
300
|
-
closingDelimiterRegExp,
|
|
301
|
-
openingMatch.index + delimiter.length
|
|
302
|
-
);
|
|
303
|
-
let nextClosingMatch = closingMatch && XRegExp.exec(text, closingDelimiterRegExp, closingMatch.index + 1);
|
|
304
|
-
while (nextClosingMatch) {
|
|
305
|
-
const nextWhitespace = XRegExp.exec(
|
|
306
|
-
text,
|
|
307
|
-
regex.whitespace,
|
|
308
|
-
closingMatch.index + delimiter.length
|
|
309
|
-
);
|
|
310
|
-
const crossedWhitespace = nextWhitespace && nextWhitespace.index < closingMatchMaxIndex;
|
|
311
|
-
if (nextClosingMatch.index >= closingMatchMaxIndex || crossedWhitespace) {
|
|
312
|
-
break;
|
|
313
|
-
}
|
|
314
|
-
closingMatch = nextClosingMatch;
|
|
315
|
-
nextClosingMatch = XRegExp.exec(text, closingDelimiterRegExp, closingMatch.index + 1);
|
|
316
|
-
}
|
|
317
|
-
if (closingMatch && closingMatch.index < closingMatchMaxIndex) {
|
|
318
|
-
const afterDelimitersIndex = closingMatch.index + closingMatch[0].length;
|
|
319
|
-
const textBeforeDelimiter = text.slice(0, openingMatch.index);
|
|
320
|
-
const textAfterDelimiter = text.slice(afterDelimitersIndex);
|
|
321
|
-
const openingReplacementString = `${spacePadded ? openingMatch.openingCapturedWhitespace || " " : ""}${replacementOpeningLiteral}`;
|
|
322
|
-
const closingReplacementString = `${replacementClosingLiteral}${spacePadded ? closingMatch.closingCapturedWhitespace || " " : ""}${asymmetric ? closingMatch[0] : ""}`;
|
|
323
|
-
const textBetweenDelimiters = text.slice(
|
|
324
|
-
openingMatch.index + openingMatch[0].length,
|
|
325
|
-
closingMatch.index
|
|
326
|
-
);
|
|
327
|
-
const replacedTextBetweenDelimiters = replaceNewlines ? XRegExp.replace(textBetweenDelimiters, regex.new_line, patterns.line_break_tag_literal) : textBetweenDelimiters;
|
|
328
|
-
const replacedDelimiterText = [
|
|
329
|
-
openingReplacementString,
|
|
330
|
-
replacedTextBetweenDelimiters,
|
|
331
|
-
closingReplacementString
|
|
332
|
-
].join("");
|
|
333
|
-
const delimiterReplacementLength = delimiter.length + closingDelimiterLength;
|
|
334
|
-
const windowOffset = replacementOpeningLiteral.length + replacementClosingLiteral.length - delimiterReplacementLength + replacedTextBetweenDelimiters.length - textBetweenDelimiters.length;
|
|
335
|
-
const newUpperWindowLimit = tagWindowEndIndex + windowOffset;
|
|
336
|
-
const nextWindowIndex = partitionWindowOnMatch ? tagWindowIndex + 1 : tagWindowIndex;
|
|
337
|
-
const nextTagWindowOffset = partitionWindowOnMatch ? 0 : afterDelimitersIndex + windowOffset - tagWindowStartIndex + 1;
|
|
338
|
-
if (partitionWindowOnMatch) {
|
|
339
|
-
currentClosedTagWindow[1] = openingMatch.index;
|
|
340
|
-
closedTagWindows.splice(nextWindowIndex, 0, [
|
|
341
|
-
closingMatch.index + closingDelimiterLength + windowOffset,
|
|
342
|
-
newUpperWindowLimit
|
|
343
|
-
]);
|
|
344
|
-
} else {
|
|
345
|
-
currentClosedTagWindow[1] = newUpperWindowLimit;
|
|
346
|
-
}
|
|
347
|
-
utility.increment_windows(closedTagWindows.slice(nextWindowIndex + 1), windowOffset);
|
|
348
|
-
if (maxReplacements) {
|
|
349
|
-
maxReplacements -= 1;
|
|
29
|
+
return null;
|
|
30
|
+
const html_string = slack_text_parser(text, {
|
|
31
|
+
slackCallbacks: {
|
|
32
|
+
user(data) {
|
|
33
|
+
const user = users.find((u) => u.id === data.id || u.name === data.name);
|
|
34
|
+
const label = (user == null ? void 0 : user.name) || data.id || data.name;
|
|
35
|
+
return `<span class="slack_user" data-user-id="${(user == null ? void 0 : user.id) || data.id}">@${label}</span>`;
|
|
36
|
+
},
|
|
37
|
+
channel(data) {
|
|
38
|
+
const channel = channels.find((c) => c.id === data.id || c.name === data.name);
|
|
39
|
+
const label = (channel == null ? void 0 : channel.name) || data.id || data.name;
|
|
40
|
+
return `<span class="slack_channel" data-channel-id="${(channel == null ? void 0 : channel.id) || data.id}">#${label}</span>`;
|
|
350
41
|
}
|
|
351
|
-
return replace_characters({
|
|
352
|
-
text: [textBeforeDelimiter, replacedDelimiterText, textAfterDelimiter].join(""),
|
|
353
|
-
delimiter,
|
|
354
|
-
replacementOpeningLiteral,
|
|
355
|
-
replacementClosingLiteral,
|
|
356
|
-
closedTagWindows,
|
|
357
|
-
options: Object.assign({}, options, { maxReplacements }),
|
|
358
|
-
tagWindowIndex: nextWindowIndex,
|
|
359
|
-
tagWindowOffset: nextTagWindowOffset
|
|
360
|
-
});
|
|
361
42
|
}
|
|
362
|
-
}
|
|
363
|
-
return replace_characters({
|
|
364
|
-
text,
|
|
365
|
-
delimiter,
|
|
366
|
-
replacementOpeningLiteral,
|
|
367
|
-
replacementClosingLiteral,
|
|
368
|
-
closedTagWindows,
|
|
369
|
-
options,
|
|
370
|
-
tagWindowIndex: tagWindowIndex + 1
|
|
371
43
|
});
|
|
372
|
-
};
|
|
373
|
-
|
|
374
|
-
// src/utils/slack_text_to_jsx.ts
|
|
375
|
-
var slack_text_to_jsx = (text, parse_options) => {
|
|
376
|
-
if (!text)
|
|
377
|
-
return null;
|
|
378
|
-
const html_string = slack_text_parser(text, { markdown: parse_options.markdown });
|
|
379
44
|
return parse(html_string, { trim: false });
|
|
380
45
|
};
|
|
381
46
|
|
|
@@ -453,15 +118,35 @@ var ImageElement = (props) => {
|
|
|
453
118
|
) });
|
|
454
119
|
};
|
|
455
120
|
|
|
121
|
+
// src/store/useGlobalData.ts
|
|
122
|
+
import { create } from "zustand";
|
|
123
|
+
var useBearStore = create((set) => ({
|
|
124
|
+
users: [],
|
|
125
|
+
channels: [],
|
|
126
|
+
setUsers: (users) => set({ users }),
|
|
127
|
+
setChannels: (channels) => set({ channels })
|
|
128
|
+
}));
|
|
129
|
+
var useGlobalData = () => {
|
|
130
|
+
const { users, channels, setChannels, setUsers } = useBearStore();
|
|
131
|
+
return {
|
|
132
|
+
users,
|
|
133
|
+
channels,
|
|
134
|
+
setChannels,
|
|
135
|
+
setUsers
|
|
136
|
+
};
|
|
137
|
+
};
|
|
138
|
+
|
|
456
139
|
// src/components/composition_objects/text_object.tsx
|
|
457
140
|
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
458
141
|
var TextObject = (props) => {
|
|
459
142
|
const { type, text, emoji, verbatim = false } = props.data;
|
|
460
143
|
const { className = "" } = props;
|
|
461
|
-
const
|
|
144
|
+
const { channels, users } = useGlobalData();
|
|
145
|
+
let emoji_parsed = type == "mrkdwn" ? parseEmojis(text) : emoji === false ? text : parseEmojis(text);
|
|
146
|
+
emoji_parsed = emoji_parsed.replace(/>/g, "> ").replace(/</g, "<");
|
|
462
147
|
if (type === "plain_text")
|
|
463
|
-
return /* @__PURE__ */ jsx3("div", { className, children: slack_text_to_jsx(emoji_parsed, { markdown: false }) });
|
|
464
|
-
return /* @__PURE__ */ jsx3("div", { className, children: slack_text_to_jsx(emoji_parsed, { markdown: true }) });
|
|
148
|
+
return /* @__PURE__ */ jsx3("div", { className, children: slack_text_to_jsx(emoji_parsed, { markdown: false, users, channels }) });
|
|
149
|
+
return /* @__PURE__ */ jsx3("div", { className, children: slack_text_to_jsx(emoji_parsed, { markdown: true, users, channels }) });
|
|
465
150
|
};
|
|
466
151
|
|
|
467
152
|
// src/components/elements/button_element.tsx
|
|
@@ -1124,6 +809,7 @@ var BlockWrapper = (props) => {
|
|
|
1124
809
|
};
|
|
1125
810
|
|
|
1126
811
|
// src/message.tsx
|
|
812
|
+
import { useEffect as useEffect5 } from "react";
|
|
1127
813
|
import { jsx as jsx17, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1128
814
|
var Message = (props) => {
|
|
1129
815
|
const {
|
|
@@ -1133,12 +819,21 @@ var Message = (props) => {
|
|
|
1133
819
|
time = /* @__PURE__ */ new Date(),
|
|
1134
820
|
className = "",
|
|
1135
821
|
style,
|
|
1136
|
-
showBlockKitDebug = false
|
|
822
|
+
showBlockKitDebug = false,
|
|
823
|
+
unstyled = false,
|
|
824
|
+
data = {}
|
|
1137
825
|
} = props;
|
|
826
|
+
const { setChannels, setUsers } = useGlobalData();
|
|
827
|
+
useEffect5(() => {
|
|
828
|
+
if (data.users)
|
|
829
|
+
setUsers(data.users);
|
|
830
|
+
if (data.channels)
|
|
831
|
+
setChannels(data.channels);
|
|
832
|
+
}, [data]);
|
|
1138
833
|
return /* @__PURE__ */ jsx17("div", { id: "slack_blocks_to_jsx", children: /* @__PURE__ */ jsxs9(
|
|
1139
834
|
"section",
|
|
1140
835
|
{
|
|
1141
|
-
className: `flex gap-2 w-full max-w-[600px] slack_blocks_to_jsx relative ${className}`,
|
|
836
|
+
className: `flex gap-2 w-full max-w-[600px] slack_blocks_to_jsx relative ${unstyled ? "styles_disabled" : "styles_enabled"} ${className}`,
|
|
1142
837
|
style,
|
|
1143
838
|
children: [
|
|
1144
839
|
showBlockKitDebug && /* @__PURE__ */ jsx17(
|
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@import url("https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;500;600;700&display=swap");#slack_blocks_to_jsx :is(.pointer-events-none){pointer-events:none}#slack_blocks_to_jsx :is(.visible){visibility:visible}#slack_blocks_to_jsx :is(.absolute){position:absolute}#slack_blocks_to_jsx :is(.relative){position:relative}#slack_blocks_to_jsx :is(.-left-3){left:-.75rem}#slack_blocks_to_jsx :is(.-right-\[5px\]){right:-5px}#slack_blocks_to_jsx :is(.-top-\[5px\]){top:-5px}#slack_blocks_to_jsx :is(.left-2){left:.5rem}#slack_blocks_to_jsx :is(.right-0){right:0}#slack_blocks_to_jsx :is(.right-1){right:.25rem}#slack_blocks_to_jsx :is(.top-0){top:0}#slack_blocks_to_jsx :is(.top-1\/2){top:50%}#slack_blocks_to_jsx :is(.top-2){top:.5rem}#slack_blocks_to_jsx :is(.top-\[24px\]){top:24px}#slack_blocks_to_jsx :is(.z-10){z-index:10}#slack_blocks_to_jsx :is(.z-20){z-index:20}#slack_blocks_to_jsx :is(.z-\[10\]){z-index:10}#slack_blocks_to_jsx :is(.my-1){margin-bottom:.25rem;margin-top:.25rem}#slack_blocks_to_jsx :is(.my-2){margin-bottom:.5rem;margin-top:.5rem}#slack_blocks_to_jsx :is(.mb-1){margin-bottom:.25rem}#slack_blocks_to_jsx :is(.mb-2){margin-bottom:.5rem}#slack_blocks_to_jsx :is(.ml-2){margin-left:.5rem}#slack_blocks_to_jsx :is(.mr-2){margin-right:.5rem}#slack_blocks_to_jsx :is(.mt-1){margin-top:.25rem}#slack_blocks_to_jsx :is(.mt-2){margin-top:.5rem}#slack_blocks_to_jsx :is(.block){display:block}#slack_blocks_to_jsx :is(.inline){display:inline}#slack_blocks_to_jsx :is(.flex){display:flex}#slack_blocks_to_jsx :is(.grid){display:grid}#slack_blocks_to_jsx :is(.h-3){height:.75rem}#slack_blocks_to_jsx :is(.h-5){height:1.25rem}#slack_blocks_to_jsx :is(.h-7){height:1.75rem}#slack_blocks_to_jsx :is(.h-9){height:2.25rem}#slack_blocks_to_jsx :is(.h-\[10px\]){height:10px}#slack_blocks_to_jsx :is(.h-\[14px\]){height:14px}#slack_blocks_to_jsx :is(.h-\[15px\]){height:15px}#slack_blocks_to_jsx :is(.h-\[28px\]){height:28px}#slack_blocks_to_jsx :is(.h-\[88px\]){height:88px}#slack_blocks_to_jsx :is(.h-\[9px\]){height:9px}#slack_blocks_to_jsx :is(.h-full){height:100%}#slack_blocks_to_jsx :is(.max-h-\[240px\]){max-height:240px}#slack_blocks_to_jsx :is(.min-h-\[28px\]){min-height:28px}#slack_blocks_to_jsx :is(.w-3){width:.75rem}#slack_blocks_to_jsx :is(.w-5){width:1.25rem}#slack_blocks_to_jsx :is(.w-9){width:2.25rem}#slack_blocks_to_jsx :is(.w-\[10px\]){width:10px}#slack_blocks_to_jsx :is(.w-\[15px\]){width:15px}#slack_blocks_to_jsx :is(.w-\[190px\]){width:190px}#slack_blocks_to_jsx :is(.w-\[27px\]){width:27px}#slack_blocks_to_jsx :is(.w-\[322px\]){width:322px}#slack_blocks_to_jsx :is(.w-\[88px\]){width:88px}#slack_blocks_to_jsx :is(.w-\[9px\]){width:9px}#slack_blocks_to_jsx :is(.w-full){width:100%}#slack_blocks_to_jsx :is(.min-w-\[56px\]){min-width:56px}#slack_blocks_to_jsx :is(.max-w-\[322px\]){max-width:322px}#slack_blocks_to_jsx :is(.max-w-\[600px\]){max-width:600px}#slack_blocks_to_jsx :is(.max-w-max){max-width:-moz-max-content;max-width:max-content}#slack_blocks_to_jsx :is(.shrink-0){flex-shrink:0}#slack_blocks_to_jsx :is(.grow){flex-grow:1}#slack_blocks_to_jsx :is(.-translate-y-1\/2){--tw-translate-y:-50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}#slack_blocks_to_jsx :is(.transform){transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}#slack_blocks_to_jsx :is(.cursor-pointer){cursor:pointer}#slack_blocks_to_jsx :is(.select-none){-webkit-user-select:none;-moz-user-select:none;user-select:none}#slack_blocks_to_jsx :is(.flex-col){flex-direction:column}#slack_blocks_to_jsx :is(.flex-wrap){flex-wrap:wrap}#slack_blocks_to_jsx :is(.items-center){align-items:center}#slack_blocks_to_jsx :is(.items-baseline){align-items:baseline}#slack_blocks_to_jsx :is(.justify-center){justify-content:center}#slack_blocks_to_jsx :is(.justify-between){justify-content:space-between}#slack_blocks_to_jsx :is(.gap-1){gap:.25rem}#slack_blocks_to_jsx :is(.gap-2){gap:.5rem}#slack_blocks_to_jsx :is(.gap-3){gap:.75rem}#slack_blocks_to_jsx :is(.gap-\[5px\]){gap:5px}#slack_blocks_to_jsx :is(.overflow-auto){overflow:auto}#slack_blocks_to_jsx :is(.overflow-hidden){overflow:hidden}#slack_blocks_to_jsx :is(.truncate){overflow:hidden;text-overflow:ellipsis;white-space:nowrap}#slack_blocks_to_jsx :is(.whitespace-nowrap){white-space:nowrap}#slack_blocks_to_jsx :is(.break-words){overflow-wrap:break-word}#slack_blocks_to_jsx :is(.rounded){border-radius:.25rem}#slack_blocks_to_jsx :is(.rounded-\[2px\]){border-radius:2px}#slack_blocks_to_jsx :is(.rounded-\[6px\]){border-radius:6px}#slack_blocks_to_jsx :is(.rounded-full){border-radius:9999px}#slack_blocks_to_jsx :is(.rounded-lg){border-radius:.5rem}#slack_blocks_to_jsx :is(.rounded-md){border-radius:.375rem}#slack_blocks_to_jsx :is(.border){border-width:1px}#slack_blocks_to_jsx :is(.border-\[1\.5px\]){border-width:1.5px}#slack_blocks_to_jsx :is(.border-b){border-bottom-width:1px}#slack_blocks_to_jsx :is(.border-solid){border-style:solid}#slack_blocks_to_jsx :is(.border-black-primary){--tw-border-opacity:1;border-color:rgb(29 28 29/var(--tw-border-opacity))}#slack_blocks_to_jsx :is(.border-black-primary\.3){border-color:rgba(29,28,29,.3)}#slack_blocks_to_jsx :is(.border-black-secondary){--tw-border-opacity:1;border-color:rgb(97 96 97/var(--tw-border-opacity))}#slack_blocks_to_jsx :is(.border-gray-primary){--tw-border-opacity:1;border-color:rgb(221 221 221/var(--tw-border-opacity))}#slack_blocks_to_jsx :is(.border-green-primary){--tw-border-opacity:1;border-color:rgb(0 122 90/var(--tw-border-opacity))}#slack_blocks_to_jsx :is(.border-green-primary\.3){border-color:rgba(0,122,90,.3)}#slack_blocks_to_jsx :is(.border-red-primary){--tw-border-opacity:1;border-color:rgb(224 30 90/var(--tw-border-opacity))}#slack_blocks_to_jsx :is(.border-red-primary\.3){border-color:rgba(224,30,90,.3)}#slack_blocks_to_jsx :is(.bg-black-primary\/\[0\.13\]){background-color:rgba(29,28,29,.13)}#slack_blocks_to_jsx :is(.bg-gray-300){--tw-bg-opacity:1;background-color:rgb(209 213 219/var(--tw-bg-opacity))}#slack_blocks_to_jsx :is(.bg-green-secondary){--tw-bg-opacity:1;background-color:rgb(32 162 113/var(--tw-bg-opacity))}#slack_blocks_to_jsx :is(.bg-white-secondary){--tw-bg-opacity:1;background-color:rgb(248 248 248/var(--tw-bg-opacity))}#slack_blocks_to_jsx :is(.object-cover){-o-object-fit:cover;object-fit:cover}#slack_blocks_to_jsx :is(.p-2){padding:.5rem}#slack_blocks_to_jsx :is(.px-2){padding-left:.5rem;padding-right:.5rem}#slack_blocks_to_jsx :is(.px-6){padding-left:1.5rem;padding-right:1.5rem}#slack_blocks_to_jsx :is(.px-\[3px\]){padding-left:3px;padding-right:3px}#slack_blocks_to_jsx :is(.py-1){padding-bottom:.25rem;padding-top:.25rem}#slack_blocks_to_jsx :is(.py-3){padding-bottom:.75rem;padding-top:.75rem}#slack_blocks_to_jsx :is(.py-\[1px\]){padding-bottom:1px;padding-top:1px}#slack_blocks_to_jsx :is(.pb-\[1px\]){padding-bottom:1px}#slack_blocks_to_jsx :is(.pr-3){padding-right:.75rem}#slack_blocks_to_jsx :is(.pr-7){padding-right:1.75rem}#slack_blocks_to_jsx :is(.pt-0){padding-top:0}#slack_blocks_to_jsx :is(.text-center){text-align:center}#slack_blocks_to_jsx :is(.text-\[10px\]){font-size:10px}#slack_blocks_to_jsx :is(.text-\[15px\]){font-size:15px}#slack_blocks_to_jsx :is(.text-\[8px\]){font-size:8px}#slack_blocks_to_jsx :is(.text-base){font-size:15px;line-height:1.46668}#slack_blocks_to_jsx :is(.text-small){font-size:13px;line-height:1.38461538}#slack_blocks_to_jsx :is(.text-xs){font-size:.75rem;line-height:1rem}#slack_blocks_to_jsx :is(.font-black){font-weight:900}#slack_blocks_to_jsx :is(.font-normal){font-weight:400}#slack_blocks_to_jsx :is(.font-semibold){font-weight:600}#slack_blocks_to_jsx :is(.uppercase){text-transform:uppercase}#slack_blocks_to_jsx :is(.leading-\[12\.5px\]){line-height:12.5px}#slack_blocks_to_jsx :is(.leading-\[17\.6px\]){line-height:17.6px}#slack_blocks_to_jsx :is(.leading-\[8px\]){line-height:8px}#slack_blocks_to_jsx :is(.text-black-primary){--tw-text-opacity:1;color:rgb(29 28 29/var(--tw-text-opacity))}#slack_blocks_to_jsx :is(.text-black-primary\.3){color:rgba(29,28,29,.3)}#slack_blocks_to_jsx :is(.text-black-primary\/\[0\.7\]){color:rgba(29,28,29,.7)}#slack_blocks_to_jsx :is(.text-black-secondary){--tw-text-opacity:1;color:rgb(97 96 97/var(--tw-text-opacity))}#slack_blocks_to_jsx :is(.text-blue-500){--tw-text-opacity:1;color:rgb(59 130 246/var(--tw-text-opacity))}#slack_blocks_to_jsx :is(.text-blue-primary){--tw-text-opacity:1;color:rgb(18 100 163/var(--tw-text-opacity))}#slack_blocks_to_jsx :is(.text-green-primary){--tw-text-opacity:1;color:rgb(0 122 90/var(--tw-text-opacity))}#slack_blocks_to_jsx :is(.text-red-primary){--tw-text-opacity:1;color:rgb(224 30 90/var(--tw-text-opacity))}#slack_blocks_to_jsx :is(.underline){text-decoration-line:underline}#slack_blocks_to_jsx :is(.shadow-custom_shadow-1){--tw-shadow-color:rgba(29,28,29,.13) 0px 0px 0px 1px,rgba(0,0,0,.12) 0px 5px 10px 0px;--tw-shadow:var(--tw-shadow-colored)}#slack_blocks_to_jsx :is(.outline){outline-style:solid}#slack_blocks_to_jsx :is(.filter){filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.slack_blocks_to_jsx{font-family:Open Sans,sans-serif!important;white-space:pre-wrap!important}.slack_blocks_to_jsx *,.slack_blocks_to_jsx :after,.slack_blocks_to_jsx :before{border:0 solid #e5e7eb;box-sizing:border-box}.slack_blocks_to_jsx :after,.slack_blocks_to_jsx :before{--tw-content:""}.slack_blocks_to_jsx :host,.slack_blocks_to_jsx html{line-height:1.5;-webkit-text-size-adjust:100%;font-feature-settings:normal;font-variation-settings:normal;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-tap-highlight-color:transparent}.slack_blocks_to_jsx body{line-height:inherit;margin:0}.slack_blocks_to_jsx hr{border-top-width:1px;color:inherit;height:0}.slack_blocks_to_jsx abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}.slack_blocks_to_jsx h1,.slack_blocks_to_jsx h2,.slack_blocks_to_jsx h3,.slack_blocks_to_jsx h4,.slack_blocks_to_jsx h5,.slack_blocks_to_jsx h6{font-size:inherit;font-weight:inherit}.slack_blocks_to_jsx a{color:inherit;text-decoration:inherit}.slack_blocks_to_jsx b,.slack_blocks_to_jsx strong{font-weight:bolder}.slack_blocks_to_jsx code,.slack_blocks_to_jsx kbd,.slack_blocks_to_jsx pre,.slack_blocks_to_jsx samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-size:1em;font-variation-settings:normal}.slack_blocks_to_jsx small{font-size:80%}.slack_blocks_to_jsx sub,.slack_blocks_to_jsx sup{font-size:75%;line-height:0;position:relative;vertical-align:initial}.slack_blocks_to_jsx sub{bottom:-.25em}.slack_blocks_to_jsx sup{top:-.5em}.slack_blocks_to_jsx table{border-collapse:collapse;border-color:inherit;text-indent:0}.slack_blocks_to_jsx button,.slack_blocks_to_jsx input,.slack_blocks_to_jsx optgroup,.slack_blocks_to_jsx select,.slack_blocks_to_jsx textarea{color:inherit;font-family:inherit;font-feature-settings:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;line-height:inherit;margin:0;padding:0}.slack_blocks_to_jsx button,.slack_blocks_to_jsx select{text-transform:none}.slack_blocks_to_jsx [type=button],.slack_blocks_to_jsx [type=reset],.slack_blocks_to_jsx [type=submit],.slack_blocks_to_jsx button{-webkit-appearance:button;background-color:initial;background-image:none}.slack_blocks_to_jsx :-moz-focusring{outline:auto}.slack_blocks_to_jsx :-moz-ui-invalid{box-shadow:none}.slack_blocks_to_jsx progress{vertical-align:initial}.slack_blocks_to_jsx ::-webkit-inner-spin-button,.slack_blocks_to_jsx ::-webkit-outer-spin-button{height:auto}.slack_blocks_to_jsx [type=search]{-webkit-appearance:textfield;outline-offset:-2px}.slack_blocks_to_jsx ::-webkit-search-decoration{-webkit-appearance:none}.slack_blocks_to_jsx ::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}.slack_blocks_to_jsx summary{display:list-item}.slack_blocks_to_jsx blockquote,.slack_blocks_to_jsx dd,.slack_blocks_to_jsx dl,.slack_blocks_to_jsx fieldset,.slack_blocks_to_jsx figure,.slack_blocks_to_jsx h1,.slack_blocks_to_jsx h2,.slack_blocks_to_jsx h3,.slack_blocks_to_jsx h4,.slack_blocks_to_jsx h5,.slack_blocks_to_jsx h6,.slack_blocks_to_jsx hr,.slack_blocks_to_jsx p,.slack_blocks_to_jsx pre{margin:0}.slack_blocks_to_jsx fieldset,.slack_blocks_to_jsx legend{padding:0}.slack_blocks_to_jsx menu,.slack_blocks_to_jsx ol,.slack_blocks_to_jsx ul{list-style:none;margin:0;padding:0}.slack_blocks_to_jsx dialog{padding:0}.slack_blocks_to_jsx textarea{resize:vertical}.slack_blocks_to_jsx input::-moz-placeholder,.slack_blocks_to_jsx textarea::-moz-placeholder{color:#9ca3af;opacity:1}.slack_blocks_to_jsx input::placeholder,.slack_blocks_to_jsx textarea::placeholder{color:#9ca3af;opacity:1}.slack_blocks_to_jsx [role=button],.slack_blocks_to_jsx button{cursor:pointer}.slack_blocks_to_jsx :disabled{cursor:default}.slack_blocks_to_jsx audio,.slack_blocks_to_jsx canvas,.slack_blocks_to_jsx embed,.slack_blocks_to_jsx iframe,.slack_blocks_to_jsx img,.slack_blocks_to_jsx object,.slack_blocks_to_jsx svg,.slack_blocks_to_jsx video{display:block;vertical-align:middle}.slack_blocks_to_jsx img,.slack_blocks_to_jsx video{height:auto;max-width:100%}.slack_blocks_to_jsx [hidden]{display:none}.slack_blocks_to_jsx *,.slack_blocks_to_jsx ::backdrop,.slack_blocks_to_jsx :after,.slack_blocks_to_jsx :before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:#3b82f680;--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.slack_blocks_to_jsx .slack_code{display:block;margin-bottom:.25rem;margin-top:.25rem;padding:.5rem;width:100%}.slack_blocks_to_jsx .slack_code,.slack_blocks_to_jsx .slack_inline_code{background-color:rgba(29,28,29,.04);border-color:rgba(29,28,29,.13);border-radius:3px;border-width:1px;font-size:.75rem;line-height:1rem;line-height:1.5;overflow-wrap:break-word;white-space:pre-wrap}.slack_blocks_to_jsx .slack_inline_code{display:inline-block;padding:.125rem 3px 1px;--tw-text-opacity:1;color:rgb(224 30 90/var(--tw-text-opacity))}.slack_blocks_to_jsx .slack_bold,.slack_blocks_to_jsx .slack_bold code{font-weight:600}.slack_blocks_to_jsx .slack_blockquote{display:block}.slack_blocks_to_jsx .slack_inline_blockquote{display:inline-block}#slack_blocks_to_jsx :is(.hover\:bg-blue-primary:hover){--tw-bg-opacity:1;background-color:rgb(18 100 163/var(--tw-bg-opacity))}#slack_blocks_to_jsx :is(.hover\:text-white-primary:hover){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}#slack_blocks_to_jsx :is(.focus\:outline-none:focus){outline:2px solid transparent;outline-offset:2px}#slack_blocks_to_jsx :is(.group:hover .group-hover\:border-white-primary){--tw-border-opacity:1;border-color:rgb(255 255 255/var(--tw-border-opacity))}#slack_blocks_to_jsx :is(.group:hover .group-hover\:bg-blue-primary){--tw-bg-opacity:1;background-color:rgb(18 100 163/var(--tw-bg-opacity))}#slack_blocks_to_jsx :is(.group:hover .group-hover\:text-white-primary){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}
|
|
1
|
+
@import url("https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;500;600;700&display=swap");#slack_blocks_to_jsx :is(.pointer-events-none){pointer-events:none}#slack_blocks_to_jsx :is(.visible){visibility:visible}#slack_blocks_to_jsx :is(.absolute){position:absolute}#slack_blocks_to_jsx :is(.relative){position:relative}#slack_blocks_to_jsx :is(.-left-3){left:-.75rem}#slack_blocks_to_jsx :is(.-right-\[5px\]){right:-5px}#slack_blocks_to_jsx :is(.-top-\[5px\]){top:-5px}#slack_blocks_to_jsx :is(.left-2){left:.5rem}#slack_blocks_to_jsx :is(.right-0){right:0}#slack_blocks_to_jsx :is(.right-1){right:.25rem}#slack_blocks_to_jsx :is(.top-0){top:0}#slack_blocks_to_jsx :is(.top-1\/2){top:50%}#slack_blocks_to_jsx :is(.top-2){top:.5rem}#slack_blocks_to_jsx :is(.top-\[24px\]){top:24px}#slack_blocks_to_jsx :is(.z-10){z-index:10}#slack_blocks_to_jsx :is(.z-20){z-index:20}#slack_blocks_to_jsx :is(.z-\[10\]){z-index:10}#slack_blocks_to_jsx :is(.my-1){margin-bottom:.25rem;margin-top:.25rem}#slack_blocks_to_jsx :is(.my-2){margin-bottom:.5rem;margin-top:.5rem}#slack_blocks_to_jsx :is(.mb-1){margin-bottom:.25rem}#slack_blocks_to_jsx :is(.mb-2){margin-bottom:.5rem}#slack_blocks_to_jsx :is(.ml-2){margin-left:.5rem}#slack_blocks_to_jsx :is(.mr-2){margin-right:.5rem}#slack_blocks_to_jsx :is(.mt-1){margin-top:.25rem}#slack_blocks_to_jsx :is(.mt-2){margin-top:.5rem}#slack_blocks_to_jsx :is(.block){display:block}#slack_blocks_to_jsx :is(.inline){display:inline}#slack_blocks_to_jsx :is(.flex){display:flex}#slack_blocks_to_jsx :is(.grid){display:grid}#slack_blocks_to_jsx :is(.h-3){height:.75rem}#slack_blocks_to_jsx :is(.h-5){height:1.25rem}#slack_blocks_to_jsx :is(.h-7){height:1.75rem}#slack_blocks_to_jsx :is(.h-9){height:2.25rem}#slack_blocks_to_jsx :is(.h-\[10px\]){height:10px}#slack_blocks_to_jsx :is(.h-\[14px\]){height:14px}#slack_blocks_to_jsx :is(.h-\[15px\]){height:15px}#slack_blocks_to_jsx :is(.h-\[28px\]){height:28px}#slack_blocks_to_jsx :is(.h-\[88px\]){height:88px}#slack_blocks_to_jsx :is(.h-\[9px\]){height:9px}#slack_blocks_to_jsx :is(.h-full){height:100%}#slack_blocks_to_jsx :is(.max-h-\[240px\]){max-height:240px}#slack_blocks_to_jsx :is(.min-h-\[28px\]){min-height:28px}#slack_blocks_to_jsx :is(.w-3){width:.75rem}#slack_blocks_to_jsx :is(.w-5){width:1.25rem}#slack_blocks_to_jsx :is(.w-9){width:2.25rem}#slack_blocks_to_jsx :is(.w-\[10px\]){width:10px}#slack_blocks_to_jsx :is(.w-\[15px\]){width:15px}#slack_blocks_to_jsx :is(.w-\[190px\]){width:190px}#slack_blocks_to_jsx :is(.w-\[27px\]){width:27px}#slack_blocks_to_jsx :is(.w-\[322px\]){width:322px}#slack_blocks_to_jsx :is(.w-\[88px\]){width:88px}#slack_blocks_to_jsx :is(.w-\[9px\]){width:9px}#slack_blocks_to_jsx :is(.w-full){width:100%}#slack_blocks_to_jsx :is(.min-w-\[56px\]){min-width:56px}#slack_blocks_to_jsx :is(.max-w-\[322px\]){max-width:322px}#slack_blocks_to_jsx :is(.max-w-\[600px\]){max-width:600px}#slack_blocks_to_jsx :is(.max-w-max){max-width:-moz-max-content;max-width:max-content}#slack_blocks_to_jsx :is(.shrink-0){flex-shrink:0}#slack_blocks_to_jsx :is(.grow){flex-grow:1}#slack_blocks_to_jsx :is(.-translate-y-1\/2){--tw-translate-y:-50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}#slack_blocks_to_jsx :is(.transform){transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}#slack_blocks_to_jsx :is(.cursor-pointer){cursor:pointer}#slack_blocks_to_jsx :is(.select-none){-webkit-user-select:none;-moz-user-select:none;user-select:none}#slack_blocks_to_jsx :is(.flex-col){flex-direction:column}#slack_blocks_to_jsx :is(.flex-wrap){flex-wrap:wrap}#slack_blocks_to_jsx :is(.items-center){align-items:center}#slack_blocks_to_jsx :is(.items-baseline){align-items:baseline}#slack_blocks_to_jsx :is(.justify-center){justify-content:center}#slack_blocks_to_jsx :is(.justify-between){justify-content:space-between}#slack_blocks_to_jsx :is(.gap-1){gap:.25rem}#slack_blocks_to_jsx :is(.gap-2){gap:.5rem}#slack_blocks_to_jsx :is(.gap-3){gap:.75rem}#slack_blocks_to_jsx :is(.gap-\[5px\]){gap:5px}#slack_blocks_to_jsx :is(.overflow-auto){overflow:auto}#slack_blocks_to_jsx :is(.overflow-hidden){overflow:hidden}#slack_blocks_to_jsx :is(.truncate){overflow:hidden;text-overflow:ellipsis;white-space:nowrap}#slack_blocks_to_jsx :is(.whitespace-nowrap){white-space:nowrap}#slack_blocks_to_jsx :is(.break-words){overflow-wrap:break-word}#slack_blocks_to_jsx :is(.rounded){border-radius:.25rem}#slack_blocks_to_jsx :is(.rounded-\[2px\]){border-radius:2px}#slack_blocks_to_jsx :is(.rounded-\[6px\]){border-radius:6px}#slack_blocks_to_jsx :is(.rounded-full){border-radius:9999px}#slack_blocks_to_jsx :is(.rounded-lg){border-radius:.5rem}#slack_blocks_to_jsx :is(.rounded-md){border-radius:.375rem}#slack_blocks_to_jsx :is(.border){border-width:1px}#slack_blocks_to_jsx :is(.border-\[1\.5px\]){border-width:1.5px}#slack_blocks_to_jsx :is(.border-b){border-bottom-width:1px}#slack_blocks_to_jsx :is(.border-solid){border-style:solid}#slack_blocks_to_jsx :is(.border-black-primary){--tw-border-opacity:1;border-color:rgb(29 28 29/var(--tw-border-opacity))}#slack_blocks_to_jsx :is(.border-black-primary\.3){border-color:rgba(29,28,29,.3)}#slack_blocks_to_jsx :is(.border-black-secondary){--tw-border-opacity:1;border-color:rgb(97 96 97/var(--tw-border-opacity))}#slack_blocks_to_jsx :is(.border-gray-primary){--tw-border-opacity:1;border-color:rgb(221 221 221/var(--tw-border-opacity))}#slack_blocks_to_jsx :is(.border-green-primary){--tw-border-opacity:1;border-color:rgb(0 122 90/var(--tw-border-opacity))}#slack_blocks_to_jsx :is(.border-green-primary\.3){border-color:rgba(0,122,90,.3)}#slack_blocks_to_jsx :is(.border-red-primary){--tw-border-opacity:1;border-color:rgb(224 30 90/var(--tw-border-opacity))}#slack_blocks_to_jsx :is(.border-red-primary\.3){border-color:rgba(224,30,90,.3)}#slack_blocks_to_jsx :is(.bg-black-primary\/\[0\.13\]){background-color:rgba(29,28,29,.13)}#slack_blocks_to_jsx :is(.bg-gray-300){--tw-bg-opacity:1;background-color:rgb(209 213 219/var(--tw-bg-opacity))}#slack_blocks_to_jsx :is(.bg-green-secondary){--tw-bg-opacity:1;background-color:rgb(32 162 113/var(--tw-bg-opacity))}#slack_blocks_to_jsx :is(.bg-white-secondary){--tw-bg-opacity:1;background-color:rgb(248 248 248/var(--tw-bg-opacity))}#slack_blocks_to_jsx :is(.object-cover){-o-object-fit:cover;object-fit:cover}#slack_blocks_to_jsx :is(.p-2){padding:.5rem}#slack_blocks_to_jsx :is(.px-2){padding-left:.5rem;padding-right:.5rem}#slack_blocks_to_jsx :is(.px-6){padding-left:1.5rem;padding-right:1.5rem}#slack_blocks_to_jsx :is(.px-\[3px\]){padding-left:3px;padding-right:3px}#slack_blocks_to_jsx :is(.py-1){padding-bottom:.25rem;padding-top:.25rem}#slack_blocks_to_jsx :is(.py-3){padding-bottom:.75rem;padding-top:.75rem}#slack_blocks_to_jsx :is(.py-\[1px\]){padding-bottom:1px;padding-top:1px}#slack_blocks_to_jsx :is(.pb-\[1px\]){padding-bottom:1px}#slack_blocks_to_jsx :is(.pr-3){padding-right:.75rem}#slack_blocks_to_jsx :is(.pr-7){padding-right:1.75rem}#slack_blocks_to_jsx :is(.pt-0){padding-top:0}#slack_blocks_to_jsx :is(.text-center){text-align:center}#slack_blocks_to_jsx :is(.text-\[10px\]){font-size:10px}#slack_blocks_to_jsx :is(.text-\[15px\]){font-size:15px}#slack_blocks_to_jsx :is(.text-\[8px\]){font-size:8px}#slack_blocks_to_jsx :is(.text-base){font-size:15px;line-height:1.46668}#slack_blocks_to_jsx :is(.text-small){font-size:13px;line-height:1.38461538}#slack_blocks_to_jsx :is(.text-xs){font-size:.75rem;line-height:1rem}#slack_blocks_to_jsx :is(.font-black){font-weight:900}#slack_blocks_to_jsx :is(.font-normal){font-weight:400}#slack_blocks_to_jsx :is(.font-semibold){font-weight:600}#slack_blocks_to_jsx :is(.uppercase){text-transform:uppercase}#slack_blocks_to_jsx :is(.leading-\[12\.5px\]){line-height:12.5px}#slack_blocks_to_jsx :is(.leading-\[17\.6px\]){line-height:17.6px}#slack_blocks_to_jsx :is(.leading-\[8px\]){line-height:8px}#slack_blocks_to_jsx :is(.text-black-primary){--tw-text-opacity:1;color:rgb(29 28 29/var(--tw-text-opacity))}#slack_blocks_to_jsx :is(.text-black-primary\.3){color:rgba(29,28,29,.3)}#slack_blocks_to_jsx :is(.text-black-primary\/\[0\.7\]){color:rgba(29,28,29,.7)}#slack_blocks_to_jsx :is(.text-black-secondary){--tw-text-opacity:1;color:rgb(97 96 97/var(--tw-text-opacity))}#slack_blocks_to_jsx :is(.text-blue-500){--tw-text-opacity:1;color:rgb(59 130 246/var(--tw-text-opacity))}#slack_blocks_to_jsx :is(.text-blue-primary){--tw-text-opacity:1;color:rgb(18 100 163/var(--tw-text-opacity))}#slack_blocks_to_jsx :is(.text-green-primary){--tw-text-opacity:1;color:rgb(0 122 90/var(--tw-text-opacity))}#slack_blocks_to_jsx :is(.text-red-primary){--tw-text-opacity:1;color:rgb(224 30 90/var(--tw-text-opacity))}#slack_blocks_to_jsx :is(.underline){text-decoration-line:underline}#slack_blocks_to_jsx :is(.shadow-custom_shadow-1){--tw-shadow-color:rgba(29,28,29,.13) 0px 0px 0px 1px,rgba(0,0,0,.12) 0px 5px 10px 0px;--tw-shadow:var(--tw-shadow-colored)}#slack_blocks_to_jsx :is(.outline){outline-style:solid}#slack_blocks_to_jsx :is(.filter){filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.slack_blocks_to_jsx.styles_enabled{font-family:Open Sans,sans-serif!important;white-space:pre-wrap!important}.slack_blocks_to_jsx.styles_enabled *,.slack_blocks_to_jsx.styles_enabled :after,.slack_blocks_to_jsx.styles_enabled :before{border:0 solid #e5e7eb;box-sizing:border-box}.slack_blocks_to_jsx.styles_enabled :after,.slack_blocks_to_jsx.styles_enabled :before{--tw-content:""}.slack_blocks_to_jsx.styles_enabled :host,.slack_blocks_to_jsx.styles_enabled html{line-height:1.5;-webkit-text-size-adjust:100%;font-feature-settings:normal;font-variation-settings:normal;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-tap-highlight-color:transparent}.slack_blocks_to_jsx.styles_enabled body{line-height:inherit;margin:0}.slack_blocks_to_jsx.styles_enabled hr{border-top-width:1px;color:inherit;height:0}.slack_blocks_to_jsx.styles_enabled abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}.slack_blocks_to_jsx.styles_enabled h1,.slack_blocks_to_jsx.styles_enabled h2,.slack_blocks_to_jsx.styles_enabled h3,.slack_blocks_to_jsx.styles_enabled h4,.slack_blocks_to_jsx.styles_enabled h5,.slack_blocks_to_jsx.styles_enabled h6{font-size:inherit;font-weight:inherit}.slack_blocks_to_jsx.styles_enabled a{color:inherit;text-decoration:inherit}.slack_blocks_to_jsx.styles_enabled b,.slack_blocks_to_jsx.styles_enabled strong{font-weight:bolder}.slack_blocks_to_jsx.styles_enabled code,.slack_blocks_to_jsx.styles_enabled kbd,.slack_blocks_to_jsx.styles_enabled pre,.slack_blocks_to_jsx.styles_enabled samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-size:1em;font-variation-settings:normal}.slack_blocks_to_jsx.styles_enabled small{font-size:80%}.slack_blocks_to_jsx.styles_enabled sub,.slack_blocks_to_jsx.styles_enabled sup{font-size:75%;line-height:0;position:relative;vertical-align:initial}.slack_blocks_to_jsx.styles_enabled sub{bottom:-.25em}.slack_blocks_to_jsx.styles_enabled sup{top:-.5em}.slack_blocks_to_jsx.styles_enabled table{border-collapse:collapse;border-color:inherit;text-indent:0}.slack_blocks_to_jsx.styles_enabled button,.slack_blocks_to_jsx.styles_enabled input,.slack_blocks_to_jsx.styles_enabled optgroup,.slack_blocks_to_jsx.styles_enabled select,.slack_blocks_to_jsx.styles_enabled textarea{color:inherit;font-family:inherit;font-feature-settings:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;line-height:inherit;margin:0;padding:0}.slack_blocks_to_jsx.styles_enabled button,.slack_blocks_to_jsx.styles_enabled select{text-transform:none}.slack_blocks_to_jsx.styles_enabled [type=button],.slack_blocks_to_jsx.styles_enabled [type=reset],.slack_blocks_to_jsx.styles_enabled [type=submit],.slack_blocks_to_jsx.styles_enabled button{-webkit-appearance:button;background-color:initial;background-image:none}.slack_blocks_to_jsx.styles_enabled :-moz-focusring{outline:auto}.slack_blocks_to_jsx.styles_enabled :-moz-ui-invalid{box-shadow:none}.slack_blocks_to_jsx.styles_enabled progress{vertical-align:initial}.slack_blocks_to_jsx.styles_enabled ::-webkit-inner-spin-button,.slack_blocks_to_jsx.styles_enabled ::-webkit-outer-spin-button{height:auto}.slack_blocks_to_jsx.styles_enabled [type=search]{-webkit-appearance:textfield;outline-offset:-2px}.slack_blocks_to_jsx.styles_enabled ::-webkit-search-decoration{-webkit-appearance:none}.slack_blocks_to_jsx.styles_enabled ::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}.slack_blocks_to_jsx.styles_enabled summary{display:list-item}.slack_blocks_to_jsx.styles_enabled blockquote,.slack_blocks_to_jsx.styles_enabled dd,.slack_blocks_to_jsx.styles_enabled dl,.slack_blocks_to_jsx.styles_enabled fieldset,.slack_blocks_to_jsx.styles_enabled figure,.slack_blocks_to_jsx.styles_enabled h1,.slack_blocks_to_jsx.styles_enabled h2,.slack_blocks_to_jsx.styles_enabled h3,.slack_blocks_to_jsx.styles_enabled h4,.slack_blocks_to_jsx.styles_enabled h5,.slack_blocks_to_jsx.styles_enabled h6,.slack_blocks_to_jsx.styles_enabled hr,.slack_blocks_to_jsx.styles_enabled p,.slack_blocks_to_jsx.styles_enabled pre{margin:0}.slack_blocks_to_jsx.styles_enabled fieldset,.slack_blocks_to_jsx.styles_enabled legend{padding:0}.slack_blocks_to_jsx.styles_enabled menu,.slack_blocks_to_jsx.styles_enabled ol,.slack_blocks_to_jsx.styles_enabled ul{list-style:none;margin:0;padding:0}.slack_blocks_to_jsx.styles_enabled dialog{padding:0}.slack_blocks_to_jsx.styles_enabled textarea{resize:vertical}.slack_blocks_to_jsx.styles_enabled input::-moz-placeholder,.slack_blocks_to_jsx.styles_enabled textarea::-moz-placeholder{color:#9ca3af;opacity:1}.slack_blocks_to_jsx.styles_enabled input::placeholder,.slack_blocks_to_jsx.styles_enabled textarea::placeholder{color:#9ca3af;opacity:1}.slack_blocks_to_jsx.styles_enabled [role=button],.slack_blocks_to_jsx.styles_enabled button{cursor:pointer}.slack_blocks_to_jsx.styles_enabled :disabled{cursor:default}.slack_blocks_to_jsx.styles_enabled audio,.slack_blocks_to_jsx.styles_enabled canvas,.slack_blocks_to_jsx.styles_enabled embed,.slack_blocks_to_jsx.styles_enabled iframe,.slack_blocks_to_jsx.styles_enabled img,.slack_blocks_to_jsx.styles_enabled object,.slack_blocks_to_jsx.styles_enabled svg,.slack_blocks_to_jsx.styles_enabled video{display:block;vertical-align:middle}.slack_blocks_to_jsx.styles_enabled img,.slack_blocks_to_jsx.styles_enabled video{height:auto;max-width:100%}.slack_blocks_to_jsx.styles_enabled [hidden]{display:none}.slack_blocks_to_jsx.styles_enabled *,.slack_blocks_to_jsx.styles_enabled ::backdrop,.slack_blocks_to_jsx.styles_enabled :after,.slack_blocks_to_jsx.styles_enabled :before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:#3b82f680;--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.slack_blocks_to_jsx.styles_enabled .slack_code{display:block;margin-bottom:.25rem;margin-top:.25rem;padding:.5rem;width:100%}.slack_blocks_to_jsx.styles_enabled .slack_code,.slack_blocks_to_jsx.styles_enabled .slack_inline_code{background-color:rgba(29,28,29,.04);border-color:rgba(29,28,29,.13);border-radius:3px;border-width:1px;font-size:.75rem;line-height:1rem;line-height:1.5;overflow-wrap:break-word;white-space:pre-wrap}.slack_blocks_to_jsx.styles_enabled .slack_inline_code{display:inline-block;padding:.125rem 3px 1px;--tw-text-opacity:1;color:rgb(224 30 90/var(--tw-text-opacity))}.slack_blocks_to_jsx.styles_enabled .slack_bold,.slack_blocks_to_jsx.styles_enabled .slack_bold code{font-weight:600}.slack_blocks_to_jsx.styles_enabled .slack_blockquote{display:block}.slack_blocks_to_jsx.styles_enabled .slack_inline_blockquote{display:inline-block}.slack_blocks_to_jsx.styles_enabled blockquote{padding-left:16px;position:relative}.slack_blocks_to_jsx.styles_enabled blockquote:before{background:#ddd;border-radius:8px;bottom:0;content:"";display:block;left:0;position:absolute;top:0;width:4px}.slack_blocks_to_jsx.styles_enabled .slack_channel,.slack_blocks_to_jsx.styles_enabled .slack_user{background:rgba(29,155,209,.1);color:#1264a3;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none}.slack_blocks_to_jsx.styles_disabled>*{all:unset!important}#slack_blocks_to_jsx :is(.hover\:bg-blue-primary:hover){--tw-bg-opacity:1;background-color:rgb(18 100 163/var(--tw-bg-opacity))}#slack_blocks_to_jsx :is(.hover\:text-white-primary:hover){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}#slack_blocks_to_jsx :is(.focus\:outline-none:focus){outline:2px solid transparent;outline-offset:2px}#slack_blocks_to_jsx :is(.group:hover .group-hover\:border-white-primary){--tw-border-opacity:1;border-color:rgb(255 255 255/var(--tw-border-opacity))}#slack_blocks_to_jsx :is(.group:hover .group-hover\:bg-blue-primary){--tw-bg-opacity:1;background-color:rgb(18 100 163/var(--tw-bg-opacity))}#slack_blocks_to_jsx :is(.group:hover .group-hover\:text-white-primary){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
],
|
|
12
12
|
"repository": "https://github.com/themashcodee/slack-blocks-to-jsx.git",
|
|
13
13
|
"license": "MIT",
|
|
14
|
-
"version": "0.1.
|
|
14
|
+
"version": "0.1.6",
|
|
15
15
|
"main": "dist/index.js",
|
|
16
16
|
"module": "dist/index.mjs",
|
|
17
17
|
"types": "dist/index.d.ts",
|
|
@@ -22,7 +22,9 @@
|
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"html-react-parser": "^4.2.2",
|
|
24
24
|
"node-emoji": "^2.1.0",
|
|
25
|
-
"
|
|
25
|
+
"slack-markdown": "^0.3.0",
|
|
26
|
+
"xregexp": "^5.1.1",
|
|
27
|
+
"zustand": "^4.5.2"
|
|
26
28
|
},
|
|
27
29
|
"peerDependencies": {
|
|
28
30
|
"react": "^17.0.0 || ^18.0.0",
|