@lexical/internal 0.45.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/LICENSE +21 -0
- package/README.md +14 -0
- package/dist/LexicalInternalDevInvariant.dev.js +38 -0
- package/dist/LexicalInternalDevInvariant.dev.mjs +36 -0
- package/dist/LexicalInternalDevInvariant.js +11 -0
- package/dist/LexicalInternalDevInvariant.js.flow +14 -0
- package/dist/LexicalInternalDevInvariant.mjs +12 -0
- package/dist/LexicalInternalDevInvariant.node.mjs +10 -0
- package/dist/LexicalInternalDevInvariant.prod.js +9 -0
- package/dist/LexicalInternalDevInvariant.prod.mjs +9 -0
- package/dist/LexicalInternalFormatDevErrorMessage.dev.js +25 -0
- package/dist/LexicalInternalFormatDevErrorMessage.dev.mjs +23 -0
- package/dist/LexicalInternalFormatDevErrorMessage.js +11 -0
- package/dist/LexicalInternalFormatDevErrorMessage.js.flow +10 -0
- package/dist/LexicalInternalFormatDevErrorMessage.mjs +12 -0
- package/dist/LexicalInternalFormatDevErrorMessage.node.mjs +10 -0
- package/dist/LexicalInternalFormatDevErrorMessage.prod.js +9 -0
- package/dist/LexicalInternalFormatDevErrorMessage.prod.mjs +9 -0
- package/dist/LexicalInternalFormatDevWarningMessage.dev.js +25 -0
- package/dist/LexicalInternalFormatDevWarningMessage.dev.mjs +23 -0
- package/dist/LexicalInternalFormatDevWarningMessage.js +11 -0
- package/dist/LexicalInternalFormatDevWarningMessage.js.flow +10 -0
- package/dist/LexicalInternalFormatDevWarningMessage.mjs +12 -0
- package/dist/LexicalInternalFormatDevWarningMessage.node.mjs +10 -0
- package/dist/LexicalInternalFormatDevWarningMessage.prod.js +9 -0
- package/dist/LexicalInternalFormatDevWarningMessage.prod.mjs +9 -0
- package/dist/LexicalInternalFormatProdErrorMessage.dev.js +34 -0
- package/dist/LexicalInternalFormatProdErrorMessage.dev.mjs +32 -0
- package/dist/LexicalInternalFormatProdErrorMessage.js +11 -0
- package/dist/LexicalInternalFormatProdErrorMessage.js.flow +13 -0
- package/dist/LexicalInternalFormatProdErrorMessage.mjs +12 -0
- package/dist/LexicalInternalFormatProdErrorMessage.node.mjs +10 -0
- package/dist/LexicalInternalFormatProdErrorMessage.prod.js +9 -0
- package/dist/LexicalInternalFormatProdErrorMessage.prod.mjs +9 -0
- package/dist/LexicalInternalFormatProdWarningMessage.dev.js +30 -0
- package/dist/LexicalInternalFormatProdWarningMessage.dev.mjs +28 -0
- package/dist/LexicalInternalFormatProdWarningMessage.js +11 -0
- package/dist/LexicalInternalFormatProdWarningMessage.js.flow +13 -0
- package/dist/LexicalInternalFormatProdWarningMessage.mjs +12 -0
- package/dist/LexicalInternalFormatProdWarningMessage.node.mjs +10 -0
- package/dist/LexicalInternalFormatProdWarningMessage.prod.js +9 -0
- package/dist/LexicalInternalFormatProdWarningMessage.prod.mjs +9 -0
- package/dist/LexicalInternalInvariant.dev.js +36 -0
- package/dist/LexicalInternalInvariant.dev.mjs +34 -0
- package/dist/LexicalInternalInvariant.js +11 -0
- package/dist/LexicalInternalInvariant.js.flow +14 -0
- package/dist/LexicalInternalInvariant.mjs +12 -0
- package/dist/LexicalInternalInvariant.node.mjs +10 -0
- package/dist/LexicalInternalInvariant.prod.js +9 -0
- package/dist/LexicalInternalInvariant.prod.mjs +9 -0
- package/dist/LexicalInternalVersion.dev.js +36 -0
- package/dist/LexicalInternalVersion.dev.mjs +34 -0
- package/dist/LexicalInternalVersion.js +11 -0
- package/dist/LexicalInternalVersion.js.flow +10 -0
- package/dist/LexicalInternalVersion.mjs +12 -0
- package/dist/LexicalInternalVersion.node.mjs +10 -0
- package/dist/LexicalInternalVersion.prod.js +9 -0
- package/dist/LexicalInternalVersion.prod.mjs +9 -0
- package/dist/LexicalInternalWarnOnlyOnce.dev.js +33 -0
- package/dist/LexicalInternalWarnOnlyOnce.dev.mjs +31 -0
- package/dist/LexicalInternalWarnOnlyOnce.js +11 -0
- package/dist/LexicalInternalWarnOnlyOnce.js.flow +10 -0
- package/dist/LexicalInternalWarnOnlyOnce.mjs +12 -0
- package/dist/LexicalInternalWarnOnlyOnce.node.mjs +10 -0
- package/dist/LexicalInternalWarnOnlyOnce.prod.js +9 -0
- package/dist/LexicalInternalWarnOnlyOnce.prod.mjs +9 -0
- package/dist/devInvariant.d.ts +16 -0
- package/dist/formatDevErrorMessage.d.ts +8 -0
- package/dist/formatDevWarningMessage.d.ts +8 -0
- package/dist/formatProdErrorMessage.d.ts +8 -0
- package/dist/formatProdWarningMessage.d.ts +8 -0
- package/dist/invariant.d.ts +8 -0
- package/dist/version.d.ts +8 -0
- package/dist/warnOnlyOnce.d.ts +8 -0
- package/package.json +289 -0
- package/src/devInvariant.ts +37 -0
- package/src/formatDevErrorMessage.ts +13 -0
- package/src/formatDevWarningMessage.ts +13 -0
- package/src/formatProdErrorMessage.ts +28 -0
- package/src/formatProdWarningMessage.ts +24 -0
- package/src/invariant.ts +31 -0
- package/src/version.ts +24 -0
- package/src/warnOnlyOnce.ts +24 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# `@lexical/internal`
|
|
2
|
+
|
|
3
|
+
> [!WARNING]
|
|
4
|
+
> This package contains **internal** utilities shared across the Lexical
|
|
5
|
+
> packages: `invariant`/`devInvariant`, dev/prod error- and warning-message
|
|
6
|
+
> formatting, `warnOnlyOnce`, and the `LEXICAL_VERSION` constant. These are
|
|
7
|
+
> bound to the build's transforms and are inlined into every other package
|
|
8
|
+
> rather than shipped as a runtime dependency, so it is published only so the
|
|
9
|
+
> modules resolve through normal package resolution — including the `source`
|
|
10
|
+
> export condition used when developing against a linked checkout.
|
|
11
|
+
>
|
|
12
|
+
> It is **not** a public API. Import from `lexical` and the `@lexical/*`
|
|
13
|
+
> feature packages instead. Nothing here follows semver and any export may
|
|
14
|
+
> change or disappear without notice.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
'use strict';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
13
|
+
*
|
|
14
|
+
* This source code is licensed under the MIT license found in the
|
|
15
|
+
* LICENSE file in the root directory of this source tree.
|
|
16
|
+
*
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* If `!cond`, throw in `__DEV__` like an invariant and warn in prod.
|
|
22
|
+
*
|
|
23
|
+
* A production build rewrites call sites via `transformErrorMessages`
|
|
24
|
+
* (throwing dev message in dev, `formatProdWarningMessage` in prod), so this
|
|
25
|
+
* body is only reached when consumed as untransformed source. It interpolates
|
|
26
|
+
* `%s` placeholders and throws outside production, otherwise warns.
|
|
27
|
+
*/
|
|
28
|
+
function devInvariant(cond, message = 'Internal Lexical error: devInvariant() called without a message', ...args) {
|
|
29
|
+
if (cond) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
const formatted = args.reduce((msg, arg) => msg.replace('%s', String(arg)), message);
|
|
33
|
+
{
|
|
34
|
+
throw new Error(formatted);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
exports.default = devInvariant;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
11
|
+
*
|
|
12
|
+
* This source code is licensed under the MIT license found in the
|
|
13
|
+
* LICENSE file in the root directory of this source tree.
|
|
14
|
+
*
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* If `!cond`, throw in `__DEV__` like an invariant and warn in prod.
|
|
20
|
+
*
|
|
21
|
+
* A production build rewrites call sites via `transformErrorMessages`
|
|
22
|
+
* (throwing dev message in dev, `formatProdWarningMessage` in prod), so this
|
|
23
|
+
* body is only reached when consumed as untransformed source. It interpolates
|
|
24
|
+
* `%s` placeholders and throws outside production, otherwise warns.
|
|
25
|
+
*/
|
|
26
|
+
function devInvariant(cond, message = 'Internal Lexical error: devInvariant() called without a message', ...args) {
|
|
27
|
+
if (cond) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
const formatted = args.reduce((msg, arg) => msg.replace('%s', String(arg)), message);
|
|
31
|
+
{
|
|
32
|
+
throw new Error(formatted);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export { devInvariant as default };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
'use strict'
|
|
10
|
+
const LexicalInternalDevInvariant = process.env.NODE_ENV !== 'production' ? require('./LexicalInternalDevInvariant.dev.js') : require('./LexicalInternalDevInvariant.prod.js');
|
|
11
|
+
module.exports = LexicalInternalDevInvariant;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
* @flow strict
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
declare export default function devInvariant(
|
|
11
|
+
cond?: boolean,
|
|
12
|
+
message?: string,
|
|
13
|
+
...args: Array<string>
|
|
14
|
+
): void;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import * as modDev from './LexicalInternalDevInvariant.dev.mjs';
|
|
10
|
+
import * as modProd from './LexicalInternalDevInvariant.prod.mjs';
|
|
11
|
+
const mod = process.env.NODE_ENV !== 'production' ? modDev : modProd;
|
|
12
|
+
export default mod.default;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
const mod = await (process.env.NODE_ENV !== 'production' ? import('./LexicalInternalDevInvariant.dev.mjs') : import('./LexicalInternalDevInvariant.prod.mjs'));
|
|
10
|
+
export default mod.default;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
"use strict";exports.default=function(e,r="Internal Lexical error: devInvariant() called without a message",...t){if(e)return;const n=t.reduce((e,r)=>e.replace("%s",String(r)),r);console.warn(n)};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
function e(e,r="Internal Lexical error: devInvariant() called without a message",...a){if(e)return;const n=a.reduce((e,r)=>e.replace("%s",String(r)),r);console.warn(n)}export{e as default};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
'use strict';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
13
|
+
*
|
|
14
|
+
* This source code is licensed under the MIT license found in the
|
|
15
|
+
* LICENSE file in the root directory of this source tree.
|
|
16
|
+
*
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
// Do not require this module directly! Use normal `invariant` calls.
|
|
20
|
+
|
|
21
|
+
function formatDevErrorMessage(message) {
|
|
22
|
+
throw new Error(message);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
exports.default = formatDevErrorMessage;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
11
|
+
*
|
|
12
|
+
* This source code is licensed under the MIT license found in the
|
|
13
|
+
* LICENSE file in the root directory of this source tree.
|
|
14
|
+
*
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
// Do not require this module directly! Use normal `invariant` calls.
|
|
18
|
+
|
|
19
|
+
function formatDevErrorMessage(message) {
|
|
20
|
+
throw new Error(message);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export { formatDevErrorMessage as default };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
'use strict'
|
|
10
|
+
const LexicalInternalFormatDevErrorMessage = process.env.NODE_ENV !== 'production' ? require('./LexicalInternalFormatDevErrorMessage.dev.js') : require('./LexicalInternalFormatDevErrorMessage.prod.js');
|
|
11
|
+
module.exports = LexicalInternalFormatDevErrorMessage;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
* @flow strict
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
declare export default function formatDevErrorMessage(message: string): empty;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import * as modDev from './LexicalInternalFormatDevErrorMessage.dev.mjs';
|
|
10
|
+
import * as modProd from './LexicalInternalFormatDevErrorMessage.prod.mjs';
|
|
11
|
+
const mod = process.env.NODE_ENV !== 'production' ? modDev : modProd;
|
|
12
|
+
export default mod.default;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
const mod = await (process.env.NODE_ENV !== 'production' ? import('./LexicalInternalFormatDevErrorMessage.dev.mjs') : import('./LexicalInternalFormatDevErrorMessage.prod.mjs'));
|
|
10
|
+
export default mod.default;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
"use strict";exports.default=function(r){throw new Error(r)};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
'use strict';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
13
|
+
*
|
|
14
|
+
* This source code is licensed under the MIT license found in the
|
|
15
|
+
* LICENSE file in the root directory of this source tree.
|
|
16
|
+
*
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
// Do not require this module directly! Use normal `invariant` calls.
|
|
20
|
+
|
|
21
|
+
function formatDevWarningMessage(message) {
|
|
22
|
+
console.warn(message);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
exports.default = formatDevWarningMessage;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
11
|
+
*
|
|
12
|
+
* This source code is licensed under the MIT license found in the
|
|
13
|
+
* LICENSE file in the root directory of this source tree.
|
|
14
|
+
*
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
// Do not require this module directly! Use normal `invariant` calls.
|
|
18
|
+
|
|
19
|
+
function formatDevWarningMessage(message) {
|
|
20
|
+
console.warn(message);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export { formatDevWarningMessage as default };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
'use strict'
|
|
10
|
+
const LexicalInternalFormatDevWarningMessage = process.env.NODE_ENV !== 'production' ? require('./LexicalInternalFormatDevWarningMessage.dev.js') : require('./LexicalInternalFormatDevWarningMessage.prod.js');
|
|
11
|
+
module.exports = LexicalInternalFormatDevWarningMessage;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
* @flow strict
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
declare export default function formatDevWarningMessage(message: string): void;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import * as modDev from './LexicalInternalFormatDevWarningMessage.dev.mjs';
|
|
10
|
+
import * as modProd from './LexicalInternalFormatDevWarningMessage.prod.mjs';
|
|
11
|
+
const mod = process.env.NODE_ENV !== 'production' ? modDev : modProd;
|
|
12
|
+
export default mod.default;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
const mod = await (process.env.NODE_ENV !== 'production' ? import('./LexicalInternalFormatDevWarningMessage.dev.mjs') : import('./LexicalInternalFormatDevWarningMessage.prod.mjs'));
|
|
10
|
+
export default mod.default;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
'use strict';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
13
|
+
*
|
|
14
|
+
* This source code is licensed under the MIT license found in the
|
|
15
|
+
* LICENSE file in the root directory of this source tree.
|
|
16
|
+
*
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
// Do not require this module directly! Use normal `invariant` calls with
|
|
20
|
+
// template literal strings. The messages will be replaced with error codes
|
|
21
|
+
// during build.
|
|
22
|
+
|
|
23
|
+
function formatProdErrorMessage(code, ...args) {
|
|
24
|
+
const url = new URL('https://lexical.dev/docs/error');
|
|
25
|
+
const params = new URLSearchParams();
|
|
26
|
+
params.append('code', code);
|
|
27
|
+
for (const arg of args) {
|
|
28
|
+
params.append('v', arg);
|
|
29
|
+
}
|
|
30
|
+
url.search = params.toString();
|
|
31
|
+
throw Error(`Minified Lexical error #${code}; visit ${url.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
exports.default = formatProdErrorMessage;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
11
|
+
*
|
|
12
|
+
* This source code is licensed under the MIT license found in the
|
|
13
|
+
* LICENSE file in the root directory of this source tree.
|
|
14
|
+
*
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
// Do not require this module directly! Use normal `invariant` calls with
|
|
18
|
+
// template literal strings. The messages will be replaced with error codes
|
|
19
|
+
// during build.
|
|
20
|
+
|
|
21
|
+
function formatProdErrorMessage(code, ...args) {
|
|
22
|
+
const url = new URL('https://lexical.dev/docs/error');
|
|
23
|
+
const params = new URLSearchParams();
|
|
24
|
+
params.append('code', code);
|
|
25
|
+
for (const arg of args) {
|
|
26
|
+
params.append('v', arg);
|
|
27
|
+
}
|
|
28
|
+
url.search = params.toString();
|
|
29
|
+
throw Error(`Minified Lexical error #${code}; visit ${url.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export { formatProdErrorMessage as default };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
'use strict'
|
|
10
|
+
const LexicalInternalFormatProdErrorMessage = process.env.NODE_ENV !== 'production' ? require('./LexicalInternalFormatProdErrorMessage.dev.js') : require('./LexicalInternalFormatProdErrorMessage.prod.js');
|
|
11
|
+
module.exports = LexicalInternalFormatProdErrorMessage;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
* @flow strict
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
declare export default function formatProdErrorMessage(
|
|
11
|
+
code: string,
|
|
12
|
+
...args: Array<string>
|
|
13
|
+
): empty;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import * as modDev from './LexicalInternalFormatProdErrorMessage.dev.mjs';
|
|
10
|
+
import * as modProd from './LexicalInternalFormatProdErrorMessage.prod.mjs';
|
|
11
|
+
const mod = process.env.NODE_ENV !== 'production' ? modDev : modProd;
|
|
12
|
+
export default mod.default;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
const mod = await (process.env.NODE_ENV !== 'production' ? import('./LexicalInternalFormatProdErrorMessage.dev.mjs') : import('./LexicalInternalFormatProdErrorMessage.prod.mjs'));
|
|
10
|
+
export default mod.default;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
"use strict";exports.default=function(e,...r){const n=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",e);for(const e of r)o.append("v",e);throw n.search=o.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
function e(e,...r){const n=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",e);for(const e of r)o.append("v",e);throw n.search=o.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}export{e as default};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
'use strict';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
13
|
+
*
|
|
14
|
+
* This source code is licensed under the MIT license found in the
|
|
15
|
+
* LICENSE file in the root directory of this source tree.
|
|
16
|
+
*
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
function formatProdWarningMessage(code, ...args) {
|
|
20
|
+
const url = new URL('https://lexical.dev/docs/error');
|
|
21
|
+
const params = new URLSearchParams();
|
|
22
|
+
params.append('code', code);
|
|
23
|
+
for (const arg of args) {
|
|
24
|
+
params.append('v', arg);
|
|
25
|
+
}
|
|
26
|
+
url.search = params.toString();
|
|
27
|
+
console.warn(`Minified Lexical warning #${code}; visit ${url.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
exports.default = formatProdWarningMessage;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
11
|
+
*
|
|
12
|
+
* This source code is licensed under the MIT license found in the
|
|
13
|
+
* LICENSE file in the root directory of this source tree.
|
|
14
|
+
*
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
function formatProdWarningMessage(code, ...args) {
|
|
18
|
+
const url = new URL('https://lexical.dev/docs/error');
|
|
19
|
+
const params = new URLSearchParams();
|
|
20
|
+
params.append('code', code);
|
|
21
|
+
for (const arg of args) {
|
|
22
|
+
params.append('v', arg);
|
|
23
|
+
}
|
|
24
|
+
url.search = params.toString();
|
|
25
|
+
console.warn(`Minified Lexical warning #${code}; visit ${url.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export { formatProdWarningMessage as default };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
'use strict'
|
|
10
|
+
const LexicalInternalFormatProdWarningMessage = process.env.NODE_ENV !== 'production' ? require('./LexicalInternalFormatProdWarningMessage.dev.js') : require('./LexicalInternalFormatProdWarningMessage.prod.js');
|
|
11
|
+
module.exports = LexicalInternalFormatProdWarningMessage;
|