stream-chat-react 11.2.0 → 11.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser.full-bundle.js +404 -447
- package/dist/browser.full-bundle.js.map +1 -1
- package/dist/browser.full-bundle.min.js +4 -4
- package/dist/browser.full-bundle.min.js.map +1 -1
- package/dist/components/Channel/Channel.d.ts +2 -0
- package/dist/components/Channel/Channel.d.ts.map +1 -1
- package/dist/components/Channel/Channel.js +1 -0
- package/dist/components/MessageActions/CustomMessageActionsList.d.ts +13 -0
- package/dist/components/MessageActions/CustomMessageActionsList.d.ts.map +1 -0
- package/dist/components/MessageActions/CustomMessageActionsList.js +11 -0
- package/dist/components/MessageActions/MessageActionsBox.d.ts +1 -6
- package/dist/components/MessageActions/MessageActionsBox.d.ts.map +1 -1
- package/dist/components/MessageActions/MessageActionsBox.js +6 -14
- package/dist/components/MessageActions/index.d.ts +1 -0
- package/dist/components/MessageActions/index.d.ts.map +1 -1
- package/dist/components/MessageActions/index.js +1 -0
- package/dist/context/ComponentContext.d.ts +2 -1
- package/dist/context/ComponentContext.d.ts.map +1 -1
- package/dist/index.cjs.js +368 -412
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -2
package/dist/index.cjs.js
CHANGED
|
@@ -4651,7 +4651,7 @@ function mark(values, key, value) {
|
|
|
4651
4651
|
* @property {Array<string>} [mustUseProperty]
|
|
4652
4652
|
*/
|
|
4653
4653
|
|
|
4654
|
-
const own$
|
|
4654
|
+
const own$5 = {}.hasOwnProperty;
|
|
4655
4655
|
|
|
4656
4656
|
/**
|
|
4657
4657
|
* @param {Definition} definition
|
|
@@ -4666,7 +4666,7 @@ function create(definition) {
|
|
|
4666
4666
|
let prop;
|
|
4667
4667
|
|
|
4668
4668
|
for (prop in definition.properties) {
|
|
4669
|
-
if (own$
|
|
4669
|
+
if (own$5.call(definition.properties, prop)) {
|
|
4670
4670
|
const value = definition.properties[prop];
|
|
4671
4671
|
const info = new DefinedInfo(
|
|
4672
4672
|
prop,
|
|
@@ -6585,7 +6585,7 @@ VFileMessage.prototype.source = undefined;
|
|
|
6585
6585
|
* @typedef {import('./components.js').Components} Components
|
|
6586
6586
|
*/
|
|
6587
6587
|
|
|
6588
|
-
const own$
|
|
6588
|
+
const own$4 = {}.hasOwnProperty;
|
|
6589
6589
|
|
|
6590
6590
|
/** @type {Map<string, number>} */
|
|
6591
6591
|
const emptyMap = new Map();
|
|
@@ -6722,7 +6722,7 @@ function one$1(state, node, key) {
|
|
|
6722
6722
|
});
|
|
6723
6723
|
}
|
|
6724
6724
|
|
|
6725
|
-
if (own$
|
|
6725
|
+
if (own$4.call(state.components, node.tagName)) {
|
|
6726
6726
|
const key = /** @type {keyof JSX.IntrinsicElements} */ (node.tagName);
|
|
6727
6727
|
type = state.components[key];
|
|
6728
6728
|
|
|
@@ -6868,7 +6868,7 @@ function createProperties(state, ancestors) {
|
|
|
6868
6868
|
let alignValue;
|
|
6869
6869
|
|
|
6870
6870
|
for (prop in node.properties) {
|
|
6871
|
-
if (prop !== 'children' && own$
|
|
6871
|
+
if (prop !== 'children' && own$4.call(node.properties, prop)) {
|
|
6872
6872
|
const result = createProperty(
|
|
6873
6873
|
state,
|
|
6874
6874
|
ancestors,
|
|
@@ -7034,7 +7034,7 @@ function transformStylesToCssCasing(domCasing) {
|
|
|
7034
7034
|
let from;
|
|
7035
7035
|
|
|
7036
7036
|
for (from in domCasing) {
|
|
7037
|
-
if (own$
|
|
7037
|
+
if (own$4.call(domCasing, from)) {
|
|
7038
7038
|
cssCasing[transformStyleToCssCasing(from)] = domCasing[from];
|
|
7039
7039
|
}
|
|
7040
7040
|
}
|
|
@@ -7113,395 +7113,6 @@ const urlAttributes = {
|
|
|
7113
7113
|
]
|
|
7114
7114
|
};
|
|
7115
7115
|
|
|
7116
|
-
/**
|
|
7117
|
-
* @typedef {import('micromark-util-types').Code} Code
|
|
7118
|
-
*/
|
|
7119
|
-
|
|
7120
|
-
const unicodePunctuationInternal = regexCheck(/\p{P}/u);
|
|
7121
|
-
|
|
7122
|
-
/**
|
|
7123
|
-
* Check whether the character code represents an ASCII alpha (`a` through `z`,
|
|
7124
|
-
* case insensitive).
|
|
7125
|
-
*
|
|
7126
|
-
* An **ASCII alpha** is an ASCII upper alpha or ASCII lower alpha.
|
|
7127
|
-
*
|
|
7128
|
-
* An **ASCII upper alpha** is a character in the inclusive range U+0041 (`A`)
|
|
7129
|
-
* to U+005A (`Z`).
|
|
7130
|
-
*
|
|
7131
|
-
* An **ASCII lower alpha** is a character in the inclusive range U+0061 (`a`)
|
|
7132
|
-
* to U+007A (`z`).
|
|
7133
|
-
*
|
|
7134
|
-
* @param code
|
|
7135
|
-
* Code.
|
|
7136
|
-
* @returns {boolean}
|
|
7137
|
-
* Whether it matches.
|
|
7138
|
-
*/
|
|
7139
|
-
const asciiAlpha = regexCheck(/[A-Za-z]/);
|
|
7140
|
-
|
|
7141
|
-
/**
|
|
7142
|
-
* Check whether the character code represents an ASCII alphanumeric (`a`
|
|
7143
|
-
* through `z`, case insensitive, or `0` through `9`).
|
|
7144
|
-
*
|
|
7145
|
-
* An **ASCII alphanumeric** is an ASCII digit (see `asciiDigit`) or ASCII alpha
|
|
7146
|
-
* (see `asciiAlpha`).
|
|
7147
|
-
*
|
|
7148
|
-
* @param code
|
|
7149
|
-
* Code.
|
|
7150
|
-
* @returns {boolean}
|
|
7151
|
-
* Whether it matches.
|
|
7152
|
-
*/
|
|
7153
|
-
const asciiAlphanumeric = regexCheck(/[\dA-Za-z]/);
|
|
7154
|
-
|
|
7155
|
-
/**
|
|
7156
|
-
* Check whether the character code represents an ASCII atext.
|
|
7157
|
-
*
|
|
7158
|
-
* atext is an ASCII alphanumeric (see `asciiAlphanumeric`), or a character in
|
|
7159
|
-
* the inclusive ranges U+0023 NUMBER SIGN (`#`) to U+0027 APOSTROPHE (`'`),
|
|
7160
|
-
* U+002A ASTERISK (`*`), U+002B PLUS SIGN (`+`), U+002D DASH (`-`), U+002F
|
|
7161
|
-
* SLASH (`/`), U+003D EQUALS TO (`=`), U+003F QUESTION MARK (`?`), U+005E
|
|
7162
|
-
* CARET (`^`) to U+0060 GRAVE ACCENT (`` ` ``), or U+007B LEFT CURLY BRACE
|
|
7163
|
-
* (`{`) to U+007E TILDE (`~`).
|
|
7164
|
-
*
|
|
7165
|
-
* See:
|
|
7166
|
-
* **\[RFC5322]**:
|
|
7167
|
-
* [Internet Message Format](https://tools.ietf.org/html/rfc5322).
|
|
7168
|
-
* P. Resnick.
|
|
7169
|
-
* IETF.
|
|
7170
|
-
*
|
|
7171
|
-
* @param code
|
|
7172
|
-
* Code.
|
|
7173
|
-
* @returns {boolean}
|
|
7174
|
-
* Whether it matches.
|
|
7175
|
-
*/
|
|
7176
|
-
const asciiAtext = regexCheck(/[#-'*+\--9=?A-Z^-~]/);
|
|
7177
|
-
|
|
7178
|
-
/**
|
|
7179
|
-
* Check whether a character code is an ASCII control character.
|
|
7180
|
-
*
|
|
7181
|
-
* An **ASCII control** is a character in the inclusive range U+0000 NULL (NUL)
|
|
7182
|
-
* to U+001F (US), or U+007F (DEL).
|
|
7183
|
-
*
|
|
7184
|
-
* @param {Code} code
|
|
7185
|
-
* Code.
|
|
7186
|
-
* @returns {boolean}
|
|
7187
|
-
* Whether it matches.
|
|
7188
|
-
*/
|
|
7189
|
-
function asciiControl(code) {
|
|
7190
|
-
return (
|
|
7191
|
-
// Special whitespace codes (which have negative values), C0 and Control
|
|
7192
|
-
// character DEL
|
|
7193
|
-
code !== null && (code < 32 || code === 127)
|
|
7194
|
-
)
|
|
7195
|
-
}
|
|
7196
|
-
|
|
7197
|
-
/**
|
|
7198
|
-
* Check whether the character code represents an ASCII digit (`0` through `9`).
|
|
7199
|
-
*
|
|
7200
|
-
* An **ASCII digit** is a character in the inclusive range U+0030 (`0`) to
|
|
7201
|
-
* U+0039 (`9`).
|
|
7202
|
-
*
|
|
7203
|
-
* @param code
|
|
7204
|
-
* Code.
|
|
7205
|
-
* @returns {boolean}
|
|
7206
|
-
* Whether it matches.
|
|
7207
|
-
*/
|
|
7208
|
-
const asciiDigit = regexCheck(/\d/);
|
|
7209
|
-
|
|
7210
|
-
/**
|
|
7211
|
-
* Check whether the character code represents an ASCII hex digit (`a` through
|
|
7212
|
-
* `f`, case insensitive, or `0` through `9`).
|
|
7213
|
-
*
|
|
7214
|
-
* An **ASCII hex digit** is an ASCII digit (see `asciiDigit`), ASCII upper hex
|
|
7215
|
-
* digit, or an ASCII lower hex digit.
|
|
7216
|
-
*
|
|
7217
|
-
* An **ASCII upper hex digit** is a character in the inclusive range U+0041
|
|
7218
|
-
* (`A`) to U+0046 (`F`).
|
|
7219
|
-
*
|
|
7220
|
-
* An **ASCII lower hex digit** is a character in the inclusive range U+0061
|
|
7221
|
-
* (`a`) to U+0066 (`f`).
|
|
7222
|
-
*
|
|
7223
|
-
* @param code
|
|
7224
|
-
* Code.
|
|
7225
|
-
* @returns {boolean}
|
|
7226
|
-
* Whether it matches.
|
|
7227
|
-
*/
|
|
7228
|
-
const asciiHexDigit = regexCheck(/[\dA-Fa-f]/);
|
|
7229
|
-
|
|
7230
|
-
/**
|
|
7231
|
-
* Check whether the character code represents ASCII punctuation.
|
|
7232
|
-
*
|
|
7233
|
-
* An **ASCII punctuation** is a character in the inclusive ranges U+0021
|
|
7234
|
-
* EXCLAMATION MARK (`!`) to U+002F SLASH (`/`), U+003A COLON (`:`) to U+0040 AT
|
|
7235
|
-
* SIGN (`@`), U+005B LEFT SQUARE BRACKET (`[`) to U+0060 GRAVE ACCENT
|
|
7236
|
-
* (`` ` ``), or U+007B LEFT CURLY BRACE (`{`) to U+007E TILDE (`~`).
|
|
7237
|
-
*
|
|
7238
|
-
* @param code
|
|
7239
|
-
* Code.
|
|
7240
|
-
* @returns {boolean}
|
|
7241
|
-
* Whether it matches.
|
|
7242
|
-
*/
|
|
7243
|
-
const asciiPunctuation = regexCheck(/[!-/:-@[-`{-~]/);
|
|
7244
|
-
|
|
7245
|
-
/**
|
|
7246
|
-
* Check whether a character code is a markdown line ending.
|
|
7247
|
-
*
|
|
7248
|
-
* A **markdown line ending** is the virtual characters M-0003 CARRIAGE RETURN
|
|
7249
|
-
* LINE FEED (CRLF), M-0004 LINE FEED (LF) and M-0005 CARRIAGE RETURN (CR).
|
|
7250
|
-
*
|
|
7251
|
-
* In micromark, the actual character U+000A LINE FEED (LF) and U+000D CARRIAGE
|
|
7252
|
-
* RETURN (CR) are replaced by these virtual characters depending on whether
|
|
7253
|
-
* they occurred together.
|
|
7254
|
-
*
|
|
7255
|
-
* @param {Code} code
|
|
7256
|
-
* Code.
|
|
7257
|
-
* @returns {boolean}
|
|
7258
|
-
* Whether it matches.
|
|
7259
|
-
*/
|
|
7260
|
-
function markdownLineEnding(code) {
|
|
7261
|
-
return code !== null && code < -2
|
|
7262
|
-
}
|
|
7263
|
-
|
|
7264
|
-
/**
|
|
7265
|
-
* Check whether a character code is a markdown line ending (see
|
|
7266
|
-
* `markdownLineEnding`) or markdown space (see `markdownSpace`).
|
|
7267
|
-
*
|
|
7268
|
-
* @param {Code} code
|
|
7269
|
-
* Code.
|
|
7270
|
-
* @returns {boolean}
|
|
7271
|
-
* Whether it matches.
|
|
7272
|
-
*/
|
|
7273
|
-
function markdownLineEndingOrSpace(code) {
|
|
7274
|
-
return code !== null && (code < 0 || code === 32)
|
|
7275
|
-
}
|
|
7276
|
-
|
|
7277
|
-
/**
|
|
7278
|
-
* Check whether a character code is a markdown space.
|
|
7279
|
-
*
|
|
7280
|
-
* A **markdown space** is the concrete character U+0020 SPACE (SP) and the
|
|
7281
|
-
* virtual characters M-0001 VIRTUAL SPACE (VS) and M-0002 HORIZONTAL TAB (HT).
|
|
7282
|
-
*
|
|
7283
|
-
* In micromark, the actual character U+0009 CHARACTER TABULATION (HT) is
|
|
7284
|
-
* replaced by one M-0002 HORIZONTAL TAB (HT) and between 0 and 3 M-0001 VIRTUAL
|
|
7285
|
-
* SPACE (VS) characters, depending on the column at which the tab occurred.
|
|
7286
|
-
*
|
|
7287
|
-
* @param {Code} code
|
|
7288
|
-
* Code.
|
|
7289
|
-
* @returns {boolean}
|
|
7290
|
-
* Whether it matches.
|
|
7291
|
-
*/
|
|
7292
|
-
function markdownSpace(code) {
|
|
7293
|
-
return code === -2 || code === -1 || code === 32
|
|
7294
|
-
}
|
|
7295
|
-
|
|
7296
|
-
// Size note: removing ASCII from the regex and using `asciiPunctuation` here
|
|
7297
|
-
// In fact adds to the bundle size.
|
|
7298
|
-
/**
|
|
7299
|
-
* Check whether the character code represents Unicode punctuation.
|
|
7300
|
-
*
|
|
7301
|
-
* A **Unicode punctuation** is a character in the Unicode `Pc` (Punctuation,
|
|
7302
|
-
* Connector), `Pd` (Punctuation, Dash), `Pe` (Punctuation, Close), `Pf`
|
|
7303
|
-
* (Punctuation, Final quote), `Pi` (Punctuation, Initial quote), `Po`
|
|
7304
|
-
* (Punctuation, Other), or `Ps` (Punctuation, Open) categories, or an ASCII
|
|
7305
|
-
* punctuation (see `asciiPunctuation`).
|
|
7306
|
-
*
|
|
7307
|
-
* See:
|
|
7308
|
-
* **\[UNICODE]**:
|
|
7309
|
-
* [The Unicode Standard](https://www.unicode.org/versions/).
|
|
7310
|
-
* Unicode Consortium.
|
|
7311
|
-
*
|
|
7312
|
-
* @param {Code} code
|
|
7313
|
-
* Code.
|
|
7314
|
-
* @returns {boolean}
|
|
7315
|
-
* Whether it matches.
|
|
7316
|
-
*/
|
|
7317
|
-
function unicodePunctuation(code) {
|
|
7318
|
-
return asciiPunctuation(code) || unicodePunctuationInternal(code)
|
|
7319
|
-
}
|
|
7320
|
-
|
|
7321
|
-
/**
|
|
7322
|
-
* Check whether the character code represents Unicode whitespace.
|
|
7323
|
-
*
|
|
7324
|
-
* Note that this does handle micromark specific markdown whitespace characters.
|
|
7325
|
-
* See `markdownLineEndingOrSpace` to check that.
|
|
7326
|
-
*
|
|
7327
|
-
* A **Unicode whitespace** is a character in the Unicode `Zs` (Separator,
|
|
7328
|
-
* Space) category, or U+0009 CHARACTER TABULATION (HT), U+000A LINE FEED (LF),
|
|
7329
|
-
* U+000C (FF), or U+000D CARRIAGE RETURN (CR) (**\[UNICODE]**).
|
|
7330
|
-
*
|
|
7331
|
-
* See:
|
|
7332
|
-
* **\[UNICODE]**:
|
|
7333
|
-
* [The Unicode Standard](https://www.unicode.org/versions/).
|
|
7334
|
-
* Unicode Consortium.
|
|
7335
|
-
*
|
|
7336
|
-
* @param code
|
|
7337
|
-
* Code.
|
|
7338
|
-
* @returns {boolean}
|
|
7339
|
-
* Whether it matches.
|
|
7340
|
-
*/
|
|
7341
|
-
const unicodeWhitespace = regexCheck(/\s/);
|
|
7342
|
-
|
|
7343
|
-
/**
|
|
7344
|
-
* Create a code check from a regex.
|
|
7345
|
-
*
|
|
7346
|
-
* @param {RegExp} regex
|
|
7347
|
-
* @returns {(code: Code) => boolean}
|
|
7348
|
-
*/
|
|
7349
|
-
function regexCheck(regex) {
|
|
7350
|
-
return check
|
|
7351
|
-
|
|
7352
|
-
/**
|
|
7353
|
-
* Check whether a code matches the bound regex.
|
|
7354
|
-
*
|
|
7355
|
-
* @param {Code} code
|
|
7356
|
-
* Character code.
|
|
7357
|
-
* @returns {boolean}
|
|
7358
|
-
* Whether the character code matches the bound regex.
|
|
7359
|
-
*/
|
|
7360
|
-
function check(code) {
|
|
7361
|
-
return code !== null && code > -1 && regex.test(String.fromCharCode(code))
|
|
7362
|
-
}
|
|
7363
|
-
}
|
|
7364
|
-
|
|
7365
|
-
const characterReferences = {'"': 'quot', '&': 'amp', '<': 'lt', '>': 'gt'};
|
|
7366
|
-
|
|
7367
|
-
/**
|
|
7368
|
-
* Encode only the dangerous HTML characters.
|
|
7369
|
-
*
|
|
7370
|
-
* This ensures that certain characters which have special meaning in HTML are
|
|
7371
|
-
* dealt with.
|
|
7372
|
-
* Technically, we can skip `>` and `"` in many cases, but CM includes them.
|
|
7373
|
-
*
|
|
7374
|
-
* @param {string} value
|
|
7375
|
-
* Value to encode.
|
|
7376
|
-
* @returns {string}
|
|
7377
|
-
* Encoded value.
|
|
7378
|
-
*/
|
|
7379
|
-
function encode(value) {
|
|
7380
|
-
return value.replace(/["&<>]/g, replace)
|
|
7381
|
-
|
|
7382
|
-
/**
|
|
7383
|
-
* @param {string} value
|
|
7384
|
-
* @returns {string}
|
|
7385
|
-
*/
|
|
7386
|
-
function replace(value) {
|
|
7387
|
-
// @ts-expect-error Hush, it’s fine.
|
|
7388
|
-
return '&' + characterReferences[value] + ';'
|
|
7389
|
-
}
|
|
7390
|
-
}
|
|
7391
|
-
|
|
7392
|
-
/**
|
|
7393
|
-
* Make a value safe for injection as a URL.
|
|
7394
|
-
*
|
|
7395
|
-
* This encodes unsafe characters with percent-encoding and skips already
|
|
7396
|
-
* encoded sequences (see `normalizeUri`).
|
|
7397
|
-
* Further unsafe characters are encoded as character references (see
|
|
7398
|
-
* `micromark-util-encode`).
|
|
7399
|
-
*
|
|
7400
|
-
* A regex of allowed protocols can be given, in which case the URL is
|
|
7401
|
-
* sanitized.
|
|
7402
|
-
* For example, `/^(https?|ircs?|mailto|xmpp)$/i` can be used for `a[href]`, or
|
|
7403
|
-
* `/^https?$/i` for `img[src]` (this is what `github.com` allows).
|
|
7404
|
-
* If the URL includes an unknown protocol (one not matched by `protocol`, such
|
|
7405
|
-
* as a dangerous example, `javascript:`), the value is ignored.
|
|
7406
|
-
*
|
|
7407
|
-
* @param {string | null | undefined} url
|
|
7408
|
-
* URI to sanitize.
|
|
7409
|
-
* @param {RegExp | null | undefined} [protocol]
|
|
7410
|
-
* Allowed protocols.
|
|
7411
|
-
* @returns {string}
|
|
7412
|
-
* Sanitized URI.
|
|
7413
|
-
*/
|
|
7414
|
-
function sanitizeUri(url, protocol) {
|
|
7415
|
-
const value = encode(normalizeUri(url || ''));
|
|
7416
|
-
if (!protocol) {
|
|
7417
|
-
return value
|
|
7418
|
-
}
|
|
7419
|
-
const colon = value.indexOf(':');
|
|
7420
|
-
const questionMark = value.indexOf('?');
|
|
7421
|
-
const numberSign = value.indexOf('#');
|
|
7422
|
-
const slash = value.indexOf('/');
|
|
7423
|
-
if (
|
|
7424
|
-
// If there is no protocol, it’s relative.
|
|
7425
|
-
colon < 0 ||
|
|
7426
|
-
// If the first colon is after a `?`, `#`, or `/`, it’s not a protocol.
|
|
7427
|
-
(slash > -1 && colon > slash) ||
|
|
7428
|
-
(questionMark > -1 && colon > questionMark) ||
|
|
7429
|
-
(numberSign > -1 && colon > numberSign) ||
|
|
7430
|
-
// It is a protocol, it should be allowed.
|
|
7431
|
-
protocol.test(value.slice(0, colon))
|
|
7432
|
-
) {
|
|
7433
|
-
return value
|
|
7434
|
-
}
|
|
7435
|
-
return ''
|
|
7436
|
-
}
|
|
7437
|
-
|
|
7438
|
-
/**
|
|
7439
|
-
* Normalize a URL.
|
|
7440
|
-
*
|
|
7441
|
-
* Encode unsafe characters with percent-encoding, skipping already encoded
|
|
7442
|
-
* sequences.
|
|
7443
|
-
*
|
|
7444
|
-
* @param {string} value
|
|
7445
|
-
* URI to normalize.
|
|
7446
|
-
* @returns {string}
|
|
7447
|
-
* Normalized URI.
|
|
7448
|
-
*/
|
|
7449
|
-
function normalizeUri(value) {
|
|
7450
|
-
/** @type {Array<string>} */
|
|
7451
|
-
const result = [];
|
|
7452
|
-
let index = -1;
|
|
7453
|
-
let start = 0;
|
|
7454
|
-
let skip = 0;
|
|
7455
|
-
while (++index < value.length) {
|
|
7456
|
-
const code = value.charCodeAt(index);
|
|
7457
|
-
/** @type {string} */
|
|
7458
|
-
let replace = '';
|
|
7459
|
-
|
|
7460
|
-
// A correct percent encoded value.
|
|
7461
|
-
if (
|
|
7462
|
-
code === 37 &&
|
|
7463
|
-
asciiAlphanumeric(value.charCodeAt(index + 1)) &&
|
|
7464
|
-
asciiAlphanumeric(value.charCodeAt(index + 2))
|
|
7465
|
-
) {
|
|
7466
|
-
skip = 2;
|
|
7467
|
-
}
|
|
7468
|
-
// ASCII.
|
|
7469
|
-
else if (code < 128) {
|
|
7470
|
-
if (!/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(code))) {
|
|
7471
|
-
replace = String.fromCharCode(code);
|
|
7472
|
-
}
|
|
7473
|
-
}
|
|
7474
|
-
// Astral.
|
|
7475
|
-
else if (code > 55_295 && code < 57_344) {
|
|
7476
|
-
const next = value.charCodeAt(index + 1);
|
|
7477
|
-
|
|
7478
|
-
// A correct surrogate pair.
|
|
7479
|
-
if (code < 56_320 && next > 56_319 && next < 57_344) {
|
|
7480
|
-
replace = String.fromCharCode(code, next);
|
|
7481
|
-
skip = 1;
|
|
7482
|
-
}
|
|
7483
|
-
// Lone surrogate.
|
|
7484
|
-
else {
|
|
7485
|
-
replace = '\uFFFD';
|
|
7486
|
-
}
|
|
7487
|
-
}
|
|
7488
|
-
// Unicode.
|
|
7489
|
-
else {
|
|
7490
|
-
replace = String.fromCharCode(code);
|
|
7491
|
-
}
|
|
7492
|
-
if (replace) {
|
|
7493
|
-
result.push(value.slice(start, index), encodeURIComponent(replace));
|
|
7494
|
-
start = index + skip + 1;
|
|
7495
|
-
replace = '';
|
|
7496
|
-
}
|
|
7497
|
-
if (skip) {
|
|
7498
|
-
index += skip;
|
|
7499
|
-
skip = 0;
|
|
7500
|
-
}
|
|
7501
|
-
}
|
|
7502
|
-
return result.join('') + value.slice(start)
|
|
7503
|
-
}
|
|
7504
|
-
|
|
7505
7116
|
/**
|
|
7506
7117
|
* @typedef {import('mdast').Nodes} Nodes
|
|
7507
7118
|
*
|
|
@@ -9744,7 +9355,7 @@ const characterEntities = {
|
|
|
9744
9355
|
zwnj: ''
|
|
9745
9356
|
};
|
|
9746
9357
|
|
|
9747
|
-
const own$
|
|
9358
|
+
const own$3 = {}.hasOwnProperty;
|
|
9748
9359
|
|
|
9749
9360
|
/**
|
|
9750
9361
|
* Decode a single character reference (without the `&` or `;`).
|
|
@@ -9758,7 +9369,7 @@ const own$4 = {}.hasOwnProperty;
|
|
|
9758
9369
|
* Decoded reference.
|
|
9759
9370
|
*/
|
|
9760
9371
|
function decodeNamedCharacterReference(value) {
|
|
9761
|
-
return own$
|
|
9372
|
+
return own$3.call(characterEntities, value) ? characterEntities[value] : false
|
|
9762
9373
|
}
|
|
9763
9374
|
|
|
9764
9375
|
/**
|
|
@@ -9998,6 +9609,322 @@ function normalizeIdentifier(value) {
|
|
|
9998
9609
|
)
|
|
9999
9610
|
}
|
|
10000
9611
|
|
|
9612
|
+
/**
|
|
9613
|
+
* @typedef {import('micromark-util-types').Code} Code
|
|
9614
|
+
*/
|
|
9615
|
+
|
|
9616
|
+
const unicodePunctuationInternal = regexCheck(/\p{P}/u);
|
|
9617
|
+
|
|
9618
|
+
/**
|
|
9619
|
+
* Check whether the character code represents an ASCII alpha (`a` through `z`,
|
|
9620
|
+
* case insensitive).
|
|
9621
|
+
*
|
|
9622
|
+
* An **ASCII alpha** is an ASCII upper alpha or ASCII lower alpha.
|
|
9623
|
+
*
|
|
9624
|
+
* An **ASCII upper alpha** is a character in the inclusive range U+0041 (`A`)
|
|
9625
|
+
* to U+005A (`Z`).
|
|
9626
|
+
*
|
|
9627
|
+
* An **ASCII lower alpha** is a character in the inclusive range U+0061 (`a`)
|
|
9628
|
+
* to U+007A (`z`).
|
|
9629
|
+
*
|
|
9630
|
+
* @param code
|
|
9631
|
+
* Code.
|
|
9632
|
+
* @returns {boolean}
|
|
9633
|
+
* Whether it matches.
|
|
9634
|
+
*/
|
|
9635
|
+
const asciiAlpha = regexCheck(/[A-Za-z]/);
|
|
9636
|
+
|
|
9637
|
+
/**
|
|
9638
|
+
* Check whether the character code represents an ASCII alphanumeric (`a`
|
|
9639
|
+
* through `z`, case insensitive, or `0` through `9`).
|
|
9640
|
+
*
|
|
9641
|
+
* An **ASCII alphanumeric** is an ASCII digit (see `asciiDigit`) or ASCII alpha
|
|
9642
|
+
* (see `asciiAlpha`).
|
|
9643
|
+
*
|
|
9644
|
+
* @param code
|
|
9645
|
+
* Code.
|
|
9646
|
+
* @returns {boolean}
|
|
9647
|
+
* Whether it matches.
|
|
9648
|
+
*/
|
|
9649
|
+
const asciiAlphanumeric = regexCheck(/[\dA-Za-z]/);
|
|
9650
|
+
|
|
9651
|
+
/**
|
|
9652
|
+
* Check whether the character code represents an ASCII atext.
|
|
9653
|
+
*
|
|
9654
|
+
* atext is an ASCII alphanumeric (see `asciiAlphanumeric`), or a character in
|
|
9655
|
+
* the inclusive ranges U+0023 NUMBER SIGN (`#`) to U+0027 APOSTROPHE (`'`),
|
|
9656
|
+
* U+002A ASTERISK (`*`), U+002B PLUS SIGN (`+`), U+002D DASH (`-`), U+002F
|
|
9657
|
+
* SLASH (`/`), U+003D EQUALS TO (`=`), U+003F QUESTION MARK (`?`), U+005E
|
|
9658
|
+
* CARET (`^`) to U+0060 GRAVE ACCENT (`` ` ``), or U+007B LEFT CURLY BRACE
|
|
9659
|
+
* (`{`) to U+007E TILDE (`~`).
|
|
9660
|
+
*
|
|
9661
|
+
* See:
|
|
9662
|
+
* **\[RFC5322]**:
|
|
9663
|
+
* [Internet Message Format](https://tools.ietf.org/html/rfc5322).
|
|
9664
|
+
* P. Resnick.
|
|
9665
|
+
* IETF.
|
|
9666
|
+
*
|
|
9667
|
+
* @param code
|
|
9668
|
+
* Code.
|
|
9669
|
+
* @returns {boolean}
|
|
9670
|
+
* Whether it matches.
|
|
9671
|
+
*/
|
|
9672
|
+
const asciiAtext = regexCheck(/[#-'*+\--9=?A-Z^-~]/);
|
|
9673
|
+
|
|
9674
|
+
/**
|
|
9675
|
+
* Check whether a character code is an ASCII control character.
|
|
9676
|
+
*
|
|
9677
|
+
* An **ASCII control** is a character in the inclusive range U+0000 NULL (NUL)
|
|
9678
|
+
* to U+001F (US), or U+007F (DEL).
|
|
9679
|
+
*
|
|
9680
|
+
* @param {Code} code
|
|
9681
|
+
* Code.
|
|
9682
|
+
* @returns {boolean}
|
|
9683
|
+
* Whether it matches.
|
|
9684
|
+
*/
|
|
9685
|
+
function asciiControl(code) {
|
|
9686
|
+
return (
|
|
9687
|
+
// Special whitespace codes (which have negative values), C0 and Control
|
|
9688
|
+
// character DEL
|
|
9689
|
+
code !== null && (code < 32 || code === 127)
|
|
9690
|
+
)
|
|
9691
|
+
}
|
|
9692
|
+
|
|
9693
|
+
/**
|
|
9694
|
+
* Check whether the character code represents an ASCII digit (`0` through `9`).
|
|
9695
|
+
*
|
|
9696
|
+
* An **ASCII digit** is a character in the inclusive range U+0030 (`0`) to
|
|
9697
|
+
* U+0039 (`9`).
|
|
9698
|
+
*
|
|
9699
|
+
* @param code
|
|
9700
|
+
* Code.
|
|
9701
|
+
* @returns {boolean}
|
|
9702
|
+
* Whether it matches.
|
|
9703
|
+
*/
|
|
9704
|
+
const asciiDigit = regexCheck(/\d/);
|
|
9705
|
+
|
|
9706
|
+
/**
|
|
9707
|
+
* Check whether the character code represents an ASCII hex digit (`a` through
|
|
9708
|
+
* `f`, case insensitive, or `0` through `9`).
|
|
9709
|
+
*
|
|
9710
|
+
* An **ASCII hex digit** is an ASCII digit (see `asciiDigit`), ASCII upper hex
|
|
9711
|
+
* digit, or an ASCII lower hex digit.
|
|
9712
|
+
*
|
|
9713
|
+
* An **ASCII upper hex digit** is a character in the inclusive range U+0041
|
|
9714
|
+
* (`A`) to U+0046 (`F`).
|
|
9715
|
+
*
|
|
9716
|
+
* An **ASCII lower hex digit** is a character in the inclusive range U+0061
|
|
9717
|
+
* (`a`) to U+0066 (`f`).
|
|
9718
|
+
*
|
|
9719
|
+
* @param code
|
|
9720
|
+
* Code.
|
|
9721
|
+
* @returns {boolean}
|
|
9722
|
+
* Whether it matches.
|
|
9723
|
+
*/
|
|
9724
|
+
const asciiHexDigit = regexCheck(/[\dA-Fa-f]/);
|
|
9725
|
+
|
|
9726
|
+
/**
|
|
9727
|
+
* Check whether the character code represents ASCII punctuation.
|
|
9728
|
+
*
|
|
9729
|
+
* An **ASCII punctuation** is a character in the inclusive ranges U+0021
|
|
9730
|
+
* EXCLAMATION MARK (`!`) to U+002F SLASH (`/`), U+003A COLON (`:`) to U+0040 AT
|
|
9731
|
+
* SIGN (`@`), U+005B LEFT SQUARE BRACKET (`[`) to U+0060 GRAVE ACCENT
|
|
9732
|
+
* (`` ` ``), or U+007B LEFT CURLY BRACE (`{`) to U+007E TILDE (`~`).
|
|
9733
|
+
*
|
|
9734
|
+
* @param code
|
|
9735
|
+
* Code.
|
|
9736
|
+
* @returns {boolean}
|
|
9737
|
+
* Whether it matches.
|
|
9738
|
+
*/
|
|
9739
|
+
const asciiPunctuation = regexCheck(/[!-/:-@[-`{-~]/);
|
|
9740
|
+
|
|
9741
|
+
/**
|
|
9742
|
+
* Check whether a character code is a markdown line ending.
|
|
9743
|
+
*
|
|
9744
|
+
* A **markdown line ending** is the virtual characters M-0003 CARRIAGE RETURN
|
|
9745
|
+
* LINE FEED (CRLF), M-0004 LINE FEED (LF) and M-0005 CARRIAGE RETURN (CR).
|
|
9746
|
+
*
|
|
9747
|
+
* In micromark, the actual character U+000A LINE FEED (LF) and U+000D CARRIAGE
|
|
9748
|
+
* RETURN (CR) are replaced by these virtual characters depending on whether
|
|
9749
|
+
* they occurred together.
|
|
9750
|
+
*
|
|
9751
|
+
* @param {Code} code
|
|
9752
|
+
* Code.
|
|
9753
|
+
* @returns {boolean}
|
|
9754
|
+
* Whether it matches.
|
|
9755
|
+
*/
|
|
9756
|
+
function markdownLineEnding(code) {
|
|
9757
|
+
return code !== null && code < -2
|
|
9758
|
+
}
|
|
9759
|
+
|
|
9760
|
+
/**
|
|
9761
|
+
* Check whether a character code is a markdown line ending (see
|
|
9762
|
+
* `markdownLineEnding`) or markdown space (see `markdownSpace`).
|
|
9763
|
+
*
|
|
9764
|
+
* @param {Code} code
|
|
9765
|
+
* Code.
|
|
9766
|
+
* @returns {boolean}
|
|
9767
|
+
* Whether it matches.
|
|
9768
|
+
*/
|
|
9769
|
+
function markdownLineEndingOrSpace(code) {
|
|
9770
|
+
return code !== null && (code < 0 || code === 32)
|
|
9771
|
+
}
|
|
9772
|
+
|
|
9773
|
+
/**
|
|
9774
|
+
* Check whether a character code is a markdown space.
|
|
9775
|
+
*
|
|
9776
|
+
* A **markdown space** is the concrete character U+0020 SPACE (SP) and the
|
|
9777
|
+
* virtual characters M-0001 VIRTUAL SPACE (VS) and M-0002 HORIZONTAL TAB (HT).
|
|
9778
|
+
*
|
|
9779
|
+
* In micromark, the actual character U+0009 CHARACTER TABULATION (HT) is
|
|
9780
|
+
* replaced by one M-0002 HORIZONTAL TAB (HT) and between 0 and 3 M-0001 VIRTUAL
|
|
9781
|
+
* SPACE (VS) characters, depending on the column at which the tab occurred.
|
|
9782
|
+
*
|
|
9783
|
+
* @param {Code} code
|
|
9784
|
+
* Code.
|
|
9785
|
+
* @returns {boolean}
|
|
9786
|
+
* Whether it matches.
|
|
9787
|
+
*/
|
|
9788
|
+
function markdownSpace(code) {
|
|
9789
|
+
return code === -2 || code === -1 || code === 32
|
|
9790
|
+
}
|
|
9791
|
+
|
|
9792
|
+
// Size note: removing ASCII from the regex and using `asciiPunctuation` here
|
|
9793
|
+
// In fact adds to the bundle size.
|
|
9794
|
+
/**
|
|
9795
|
+
* Check whether the character code represents Unicode punctuation.
|
|
9796
|
+
*
|
|
9797
|
+
* A **Unicode punctuation** is a character in the Unicode `Pc` (Punctuation,
|
|
9798
|
+
* Connector), `Pd` (Punctuation, Dash), `Pe` (Punctuation, Close), `Pf`
|
|
9799
|
+
* (Punctuation, Final quote), `Pi` (Punctuation, Initial quote), `Po`
|
|
9800
|
+
* (Punctuation, Other), or `Ps` (Punctuation, Open) categories, or an ASCII
|
|
9801
|
+
* punctuation (see `asciiPunctuation`).
|
|
9802
|
+
*
|
|
9803
|
+
* See:
|
|
9804
|
+
* **\[UNICODE]**:
|
|
9805
|
+
* [The Unicode Standard](https://www.unicode.org/versions/).
|
|
9806
|
+
* Unicode Consortium.
|
|
9807
|
+
*
|
|
9808
|
+
* @param {Code} code
|
|
9809
|
+
* Code.
|
|
9810
|
+
* @returns {boolean}
|
|
9811
|
+
* Whether it matches.
|
|
9812
|
+
*/
|
|
9813
|
+
function unicodePunctuation(code) {
|
|
9814
|
+
return asciiPunctuation(code) || unicodePunctuationInternal(code)
|
|
9815
|
+
}
|
|
9816
|
+
|
|
9817
|
+
/**
|
|
9818
|
+
* Check whether the character code represents Unicode whitespace.
|
|
9819
|
+
*
|
|
9820
|
+
* Note that this does handle micromark specific markdown whitespace characters.
|
|
9821
|
+
* See `markdownLineEndingOrSpace` to check that.
|
|
9822
|
+
*
|
|
9823
|
+
* A **Unicode whitespace** is a character in the Unicode `Zs` (Separator,
|
|
9824
|
+
* Space) category, or U+0009 CHARACTER TABULATION (HT), U+000A LINE FEED (LF),
|
|
9825
|
+
* U+000C (FF), or U+000D CARRIAGE RETURN (CR) (**\[UNICODE]**).
|
|
9826
|
+
*
|
|
9827
|
+
* See:
|
|
9828
|
+
* **\[UNICODE]**:
|
|
9829
|
+
* [The Unicode Standard](https://www.unicode.org/versions/).
|
|
9830
|
+
* Unicode Consortium.
|
|
9831
|
+
*
|
|
9832
|
+
* @param code
|
|
9833
|
+
* Code.
|
|
9834
|
+
* @returns {boolean}
|
|
9835
|
+
* Whether it matches.
|
|
9836
|
+
*/
|
|
9837
|
+
const unicodeWhitespace = regexCheck(/\s/);
|
|
9838
|
+
|
|
9839
|
+
/**
|
|
9840
|
+
* Create a code check from a regex.
|
|
9841
|
+
*
|
|
9842
|
+
* @param {RegExp} regex
|
|
9843
|
+
* @returns {(code: Code) => boolean}
|
|
9844
|
+
*/
|
|
9845
|
+
function regexCheck(regex) {
|
|
9846
|
+
return check
|
|
9847
|
+
|
|
9848
|
+
/**
|
|
9849
|
+
* Check whether a code matches the bound regex.
|
|
9850
|
+
*
|
|
9851
|
+
* @param {Code} code
|
|
9852
|
+
* Character code.
|
|
9853
|
+
* @returns {boolean}
|
|
9854
|
+
* Whether the character code matches the bound regex.
|
|
9855
|
+
*/
|
|
9856
|
+
function check(code) {
|
|
9857
|
+
return code !== null && code > -1 && regex.test(String.fromCharCode(code))
|
|
9858
|
+
}
|
|
9859
|
+
}
|
|
9860
|
+
|
|
9861
|
+
/**
|
|
9862
|
+
* Normalize a URL.
|
|
9863
|
+
*
|
|
9864
|
+
* Encode unsafe characters with percent-encoding, skipping already encoded
|
|
9865
|
+
* sequences.
|
|
9866
|
+
*
|
|
9867
|
+
* @param {string} value
|
|
9868
|
+
* URI to normalize.
|
|
9869
|
+
* @returns {string}
|
|
9870
|
+
* Normalized URI.
|
|
9871
|
+
*/
|
|
9872
|
+
function normalizeUri(value) {
|
|
9873
|
+
/** @type {Array<string>} */
|
|
9874
|
+
const result = [];
|
|
9875
|
+
let index = -1;
|
|
9876
|
+
let start = 0;
|
|
9877
|
+
let skip = 0;
|
|
9878
|
+
while (++index < value.length) {
|
|
9879
|
+
const code = value.charCodeAt(index);
|
|
9880
|
+
/** @type {string} */
|
|
9881
|
+
let replace = '';
|
|
9882
|
+
|
|
9883
|
+
// A correct percent encoded value.
|
|
9884
|
+
if (
|
|
9885
|
+
code === 37 &&
|
|
9886
|
+
asciiAlphanumeric(value.charCodeAt(index + 1)) &&
|
|
9887
|
+
asciiAlphanumeric(value.charCodeAt(index + 2))
|
|
9888
|
+
) {
|
|
9889
|
+
skip = 2;
|
|
9890
|
+
}
|
|
9891
|
+
// ASCII.
|
|
9892
|
+
else if (code < 128) {
|
|
9893
|
+
if (!/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(code))) {
|
|
9894
|
+
replace = String.fromCharCode(code);
|
|
9895
|
+
}
|
|
9896
|
+
}
|
|
9897
|
+
// Astral.
|
|
9898
|
+
else if (code > 55_295 && code < 57_344) {
|
|
9899
|
+
const next = value.charCodeAt(index + 1);
|
|
9900
|
+
|
|
9901
|
+
// A correct surrogate pair.
|
|
9902
|
+
if (code < 56_320 && next > 56_319 && next < 57_344) {
|
|
9903
|
+
replace = String.fromCharCode(code, next);
|
|
9904
|
+
skip = 1;
|
|
9905
|
+
}
|
|
9906
|
+
// Lone surrogate.
|
|
9907
|
+
else {
|
|
9908
|
+
replace = '\uFFFD';
|
|
9909
|
+
}
|
|
9910
|
+
}
|
|
9911
|
+
// Unicode.
|
|
9912
|
+
else {
|
|
9913
|
+
replace = String.fromCharCode(code);
|
|
9914
|
+
}
|
|
9915
|
+
if (replace) {
|
|
9916
|
+
result.push(value.slice(start, index), encodeURIComponent(replace));
|
|
9917
|
+
start = index + skip + 1;
|
|
9918
|
+
replace = '';
|
|
9919
|
+
}
|
|
9920
|
+
if (skip) {
|
|
9921
|
+
index += skip;
|
|
9922
|
+
skip = 0;
|
|
9923
|
+
}
|
|
9924
|
+
}
|
|
9925
|
+
return result.join('') + value.slice(start)
|
|
9926
|
+
}
|
|
9927
|
+
|
|
10001
9928
|
/**
|
|
10002
9929
|
* @typedef {import('micromark-util-types').Effects} Effects
|
|
10003
9930
|
* @typedef {import('micromark-util-types').State} State
|
|
@@ -18161,7 +18088,7 @@ function index(value) {
|
|
|
18161
18088
|
*
|
|
18162
18089
|
* @typedef {import('../index.js').CompileData} CompileData
|
|
18163
18090
|
*/
|
|
18164
|
-
const own$
|
|
18091
|
+
const own$2 = {}.hasOwnProperty;
|
|
18165
18092
|
|
|
18166
18093
|
/**
|
|
18167
18094
|
* Turn markdown into a syntax tree.
|
|
@@ -18354,7 +18281,7 @@ function compiler(options) {
|
|
|
18354
18281
|
index = -1;
|
|
18355
18282
|
while (++index < events.length) {
|
|
18356
18283
|
const handler = config[events[index][0]];
|
|
18357
|
-
if (own$
|
|
18284
|
+
if (own$2.call(handler, events[index][1].type)) {
|
|
18358
18285
|
handler[events[index][1].type].call(
|
|
18359
18286
|
Object.assign(
|
|
18360
18287
|
{
|
|
@@ -19306,7 +19233,7 @@ function extension(combined, extension) {
|
|
|
19306
19233
|
/** @type {keyof Extension} */
|
|
19307
19234
|
let key;
|
|
19308
19235
|
for (key in extension) {
|
|
19309
|
-
if (own$
|
|
19236
|
+
if (own$2.call(extension, key)) {
|
|
19310
19237
|
switch (key) {
|
|
19311
19238
|
case 'canContainEols': {
|
|
19312
19239
|
const right = extension[key];
|
|
@@ -21011,7 +20938,7 @@ function footer(state) {
|
|
|
21011
20938
|
* @typedef {import('./footer.js').FootnoteBackLabelTemplate} FootnoteBackLabelTemplate
|
|
21012
20939
|
*/
|
|
21013
20940
|
|
|
21014
|
-
const own$
|
|
20941
|
+
const own$1 = {}.hasOwnProperty;
|
|
21015
20942
|
|
|
21016
20943
|
/** @type {Options} */
|
|
21017
20944
|
const emptyOptions$1 = {};
|
|
@@ -21084,7 +21011,7 @@ function createState(tree, options) {
|
|
|
21084
21011
|
const type = node.type;
|
|
21085
21012
|
const handle = state.handlers[type];
|
|
21086
21013
|
|
|
21087
|
-
if (own$
|
|
21014
|
+
if (own$1.call(state.handlers, type) && handle) {
|
|
21088
21015
|
return handle(state, node, parent)
|
|
21089
21016
|
}
|
|
21090
21017
|
|
|
@@ -21240,7 +21167,7 @@ function defaultUnknownHandler(state, node) {
|
|
|
21240
21167
|
/** @type {HastElement | HastText} */
|
|
21241
21168
|
const result =
|
|
21242
21169
|
'value' in node &&
|
|
21243
|
-
!(own$
|
|
21170
|
+
!(own$1.call(data, 'hProperties') || own$1.call(data, 'hChildren'))
|
|
21244
21171
|
? {type: 'text', value: node.value}
|
|
21245
21172
|
: {
|
|
21246
21173
|
type: 'element',
|
|
@@ -23046,7 +22973,7 @@ const CallableInstance =
|
|
|
23046
22973
|
// `parse` is called.
|
|
23047
22974
|
// Currently, we allow directly setting `processor.parser`, which is untyped.
|
|
23048
22975
|
|
|
23049
|
-
const own
|
|
22976
|
+
const own = {}.hasOwnProperty;
|
|
23050
22977
|
|
|
23051
22978
|
/**
|
|
23052
22979
|
* @template {Node | undefined} [ParseTree=undefined]
|
|
@@ -23267,7 +23194,7 @@ class Processor extends CallableInstance {
|
|
|
23267
23194
|
}
|
|
23268
23195
|
|
|
23269
23196
|
// Get `key`.
|
|
23270
|
-
return (own
|
|
23197
|
+
return (own.call(this.namespace, key) && this.namespace[key]) || undefined
|
|
23271
23198
|
}
|
|
23272
23199
|
|
|
23273
23200
|
// Set space.
|
|
@@ -23998,7 +23925,6 @@ function isUint8Array(value) {
|
|
|
23998
23925
|
|
|
23999
23926
|
// Register `Raw` in tree:
|
|
24000
23927
|
|
|
24001
|
-
const own = {}.hasOwnProperty;
|
|
24002
23928
|
const changelog =
|
|
24003
23929
|
'https://github.com/remarkjs/react-markdown/blob/main/changelog.md';
|
|
24004
23930
|
|
|
@@ -24144,7 +24070,10 @@ function Markdown(options) {
|
|
|
24144
24070
|
let key;
|
|
24145
24071
|
|
|
24146
24072
|
for (key in urlAttributes) {
|
|
24147
|
-
if (
|
|
24073
|
+
if (
|
|
24074
|
+
Object.hasOwn(urlAttributes, key) &&
|
|
24075
|
+
Object.hasOwn(node.properties, key)
|
|
24076
|
+
) {
|
|
24148
24077
|
const value = node.properties[key];
|
|
24149
24078
|
const test = urlAttributes[key];
|
|
24150
24079
|
if (test === null || test.includes(node.tagName)) {
|
|
@@ -24188,7 +24117,28 @@ function Markdown(options) {
|
|
|
24188
24117
|
* Safe URL.
|
|
24189
24118
|
*/
|
|
24190
24119
|
function defaultUrlTransform(value) {
|
|
24191
|
-
|
|
24120
|
+
// Same as:
|
|
24121
|
+
// <https://github.com/micromark/micromark/blob/929275e/packages/micromark-util-sanitize-uri/dev/index.js#L34>
|
|
24122
|
+
// But without the `encode` part.
|
|
24123
|
+
const colon = value.indexOf(':');
|
|
24124
|
+
const questionMark = value.indexOf('?');
|
|
24125
|
+
const numberSign = value.indexOf('#');
|
|
24126
|
+
const slash = value.indexOf('/');
|
|
24127
|
+
|
|
24128
|
+
if (
|
|
24129
|
+
// If there is no protocol, it’s relative.
|
|
24130
|
+
colon < 0 ||
|
|
24131
|
+
// If the first colon is after a `?`, `#`, or `/`, it’s not a protocol.
|
|
24132
|
+
(slash > -1 && colon > slash) ||
|
|
24133
|
+
(questionMark > -1 && colon > questionMark) ||
|
|
24134
|
+
(numberSign > -1 && colon > numberSign) ||
|
|
24135
|
+
// It is a protocol, it should be allowed.
|
|
24136
|
+
safeProtocol.test(value.slice(0, colon))
|
|
24137
|
+
) {
|
|
24138
|
+
return value
|
|
24139
|
+
}
|
|
24140
|
+
|
|
24141
|
+
return ''
|
|
24192
24142
|
}
|
|
24193
24143
|
|
|
24194
24144
|
/**
|
|
@@ -32216,18 +32166,22 @@ var isOnlyEmojis = function (text) {
|
|
|
32216
32166
|
|
|
32217
32167
|
var CustomMessageActionsList = function (props) {
|
|
32218
32168
|
var customMessageActions = props.customMessageActions, message = props.message;
|
|
32169
|
+
if (!customMessageActions)
|
|
32170
|
+
return null;
|
|
32219
32171
|
var customActionsArray = Object.keys(customMessageActions);
|
|
32220
32172
|
return (React__default["default"].createElement(React__default["default"].Fragment, null, customActionsArray.map(function (customAction) {
|
|
32221
32173
|
var customHandler = customMessageActions[customAction];
|
|
32222
32174
|
return (React__default["default"].createElement("button", { "aria-selected": 'false', className: 'str-chat__message-actions-list-item str-chat__message-actions-list-item-button', key: customAction, onClick: function (event) { return customHandler(message, event); }, role: 'option' }, customAction));
|
|
32223
32175
|
})));
|
|
32224
32176
|
};
|
|
32177
|
+
|
|
32225
32178
|
var UnMemoizedMessageActionsBox = function (props) {
|
|
32226
32179
|
var getMessageActions = props.getMessageActions, handleDelete = props.handleDelete, handleEdit = props.handleEdit, handleFlag = props.handleFlag, handleMute = props.handleMute, handlePin = props.handlePin, isUserMuted = props.isUserMuted, mine = props.mine, _a = props.open, open = _a === void 0 ? false : _a;
|
|
32180
|
+
var _b = icons.useComponentContext('MessageActionsBox').CustomMessageActionsList, CustomMessageActionsList$1 = _b === void 0 ? CustomMessageActionsList : _b;
|
|
32227
32181
|
var setQuotedMessage = icons.useChannelActionContext('MessageActionsBox').setQuotedMessage;
|
|
32228
|
-
var
|
|
32182
|
+
var _c = icons.useMessageContext('MessageActionsBox'), customMessageActions = _c.customMessageActions, message = _c.message, messageListRect = _c.messageListRect;
|
|
32229
32183
|
var t = icons.useTranslationContext('MessageActionsBox').t;
|
|
32230
|
-
var
|
|
32184
|
+
var _d = React.useState(false), reverse = _d[0], setReverse = _d[1];
|
|
32231
32185
|
var messageActions = getMessageActions();
|
|
32232
32186
|
var checkIfReverse = React.useCallback(function (containerElement) {
|
|
32233
32187
|
if (!containerElement) {
|
|
@@ -32262,7 +32216,7 @@ var UnMemoizedMessageActionsBox = function (props) {
|
|
|
32262
32216
|
var buttonClassName = 'str-chat__message-actions-list-item str-chat__message-actions-list-item-button';
|
|
32263
32217
|
return (React__default["default"].createElement("div", { className: rootClassName, "data-testid": 'message-actions-box', ref: checkIfReverse },
|
|
32264
32218
|
React__default["default"].createElement("div", { "aria-label": 'Message Options', className: 'str-chat__message-actions-list', role: 'listbox' },
|
|
32265
|
-
|
|
32219
|
+
React__default["default"].createElement(CustomMessageActionsList$1, { customMessageActions: customMessageActions, message: message }),
|
|
32266
32220
|
messageActions.indexOf(MESSAGE_ACTIONS.quote) > -1 && (React__default["default"].createElement("button", { "aria-selected": 'false', className: buttonClassName, onClick: handleQuote, role: 'option' }, t('Reply'))),
|
|
32267
32221
|
messageActions.indexOf(MESSAGE_ACTIONS.pin) > -1 && !message.parent_id && (React__default["default"].createElement("button", { "aria-selected": 'false', className: buttonClassName, onClick: handlePin, role: 'option' }, !message.pinned ? t('Pin') : t('Unpin'))),
|
|
32268
32222
|
messageActions.indexOf(MESSAGE_ACTIONS.flag) > -1 && (React__default["default"].createElement("button", { "aria-selected": 'false', className: buttonClassName, onClick: handleFlag, role: 'option' }, t('Flag'))),
|
|
@@ -35864,6 +35818,7 @@ var ChannelInner = function (props) {
|
|
|
35864
35818
|
Avatar: props.Avatar,
|
|
35865
35819
|
BaseImage: props.BaseImage,
|
|
35866
35820
|
CooldownTimer: props.CooldownTimer,
|
|
35821
|
+
CustomMessageActionsList: props.CustomMessageActionsList,
|
|
35867
35822
|
DateSeparator: props.DateSeparator,
|
|
35868
35823
|
EditMessageInput: props.EditMessageInput,
|
|
35869
35824
|
EmojiPicker: props.EmojiPicker,
|
|
@@ -37229,7 +37184,7 @@ var UnMemoizedChannelList = function (props) {
|
|
|
37229
37184
|
*/
|
|
37230
37185
|
var ChannelList = React__default["default"].memo(UnMemoizedChannelList);
|
|
37231
37186
|
|
|
37232
|
-
var version = '11.
|
|
37187
|
+
var version = '11.3.0';
|
|
37233
37188
|
|
|
37234
37189
|
var useChat = function (_a) {
|
|
37235
37190
|
var _b, _c;
|
|
@@ -39410,6 +39365,7 @@ exports.ChatDown = ChatDown;
|
|
|
39410
39365
|
exports.CommandItem = CommandItem;
|
|
39411
39366
|
exports.ConnectionStatus = ConnectionStatus;
|
|
39412
39367
|
exports.CooldownTimer = CooldownTimer;
|
|
39368
|
+
exports.CustomMessageActionsList = CustomMessageActionsList;
|
|
39413
39369
|
exports.DateSeparator = DateSeparator;
|
|
39414
39370
|
exports.DefaultSuggestionList = List;
|
|
39415
39371
|
exports.DefaultSuggestionListHeader = DefaultSuggestionListHeader;
|