mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
* chore(NA): splits types from code on @kbn/i18n (#119256) * chore(NA): auto creation of the package.json for the new types pkg rule * chore(NA): first alpha api extractor working version * chore(NA): support kbn-analytics * chore(NA): correctly read tsconfig files and deps from ts_config rule * chore(NA): layed out pkg_npm_types tree artifact custom rule * chore(NA): missing todos * chore(NA): node modules link mapping * chore(NA): fully working pkg_npm_types rule * chore(NA): fix changes on new packages using elastic datemath pkgs * docs(NA): remove todo * docs(NA): last todo text correction * chore(NA): removed commented lines * fix(NA): include missing package version * chore(NA): include license keys * chore(NA): change mock types package into private * chore(NA): disable validator on ts_project rule * chore(NA): use the wrapper for ts_project * commit using @elastic.co * chore(NA): commit using @elastic.co * chore(NA): split types from code on @kbn/i18n * chore(NA): update yarn.lock file * chore(NA): split @kbn/i18n and @kbn/i18n-react * chore(NA): missing import fix * chore(NA): fix jest project configs * chore(NA): change imports on kbn i18n * chore(NA): change imports on kbn i18n * chore(NA): correct loader imports * chore(NA): missnig i18nLoader export key * chore(NA): fix type exports * chore(NA): export type only * chore(NA): export type only * fix(NA): type exports * chore(NA): missing @Kbn/i18n/react imports * chore(NA): missing skip path for kbn-i18n-react Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> # Conflicts: # package.json # packages/BUILD.bazel # packages/kbn-monaco/BUILD.bazel # src/core/public/core_app/status/components/server_status.tsx # src/core/public/core_app/status/components/status_table.tsx # src/core/public/core_app/status/components/version_header.tsx # src/core/public/core_app/status/status_app.tsx # src/plugins/console/public/application/components/storage_quota_error.tsx # src/plugins/dashboard/public/application/listing/dashboard_listing.tsx # src/plugins/data_view_field_editor/public/components/field_editor/form_fields/script_field.tsx # src/plugins/dev_tools/public/application.tsx # src/plugins/discover/public/application/apps/context/context_app_route.tsx # src/plugins/discover/public/application/apps/doc/single_doc_route.tsx # src/plugins/discover/public/application/apps/main/components/doc_table/components/table_row_details.tsx # src/plugins/discover/public/application/apps/main/components/layout/discover_documents.tsx # src/plugins/discover/public/application/components/table/table_columns.tsx # src/plugins/discover/public/application/components/table/table_row_btn_filter_remove.tsx # src/plugins/discover/public/application/components/table/table_row_btn_toggle_column.tsx # src/plugins/index_pattern_editor/public/open_editor.tsx # src/plugins/interactive_setup/public/plugin.tsx # src/plugins/kibana_overview/public/application.tsx # src/plugins/kibana_react/public/util/to_mount_point.tsx # src/plugins/presentation_util/public/components/field_picker/field_search.tsx # src/plugins/vis_types/timeseries/public/timeseries_vis_renderer.tsx # src/plugins/vis_types/xy/public/vis_renderer.tsx # src/plugins/visualizations/public/wizard/show_new_vis.tsx # x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_create_from_csv/error_display.tsx # x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_create_from_csv/instructions.tsx # x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_create_from_csv/main.tsx # x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_create_from_csv/pipelines_csv_uploader.tsx # x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_create_from_csv/pipelines_preview.tsx # x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_list/empty_list.tsx # x-pack/plugins/lens/public/editor_frame_service/editor_frame/suggestion_panel.tsx # x-pack/plugins/lens/public/indexpattern_datasource/utils.tsx # x-pack/plugins/lens/public/metric_visualization/visualization.tsx # x-pack/plugins/lens/public/pie_visualization/render_function.tsx # x-pack/plugins/maps/public/classes/sources/ems_tms_source/update_source_editor.js # x-pack/plugins/maps/public/classes/sources/es_search_source/util/scaling_documenation_popover.tsx # x-pack/plugins/security/public/authentication/access_agreement/access_agreement_page.tsx # x-pack/plugins/security/public/authentication/logged_out/logged_out_page.tsx # x-pack/plugins/security/public/authentication/login/login_page.tsx # x-pack/plugins/security/public/authentication/overwritten_session/overwritten_session_page.tsx # x-pack/plugins/security/public/management/users/users_management_app.tsx # x-pack/plugins/security_solution/public/management/pages/event_filters/view/components/form/index.tsx # x-pack/plugins/spaces/public/space_selector/space_selector.tsx # yarn.lock * chore(NA): missing @kbn/i18n/react imports
This commit is contained in:
parent
d862acfdaa
commit
beb041b24f
2054 changed files with 2330 additions and 2082 deletions
|
@ -120,7 +120,7 @@ To localize strings in React, use either `FormattedMessage` or `i18n.translate`.
|
|||
["source","js"]
|
||||
-----------
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
import { FormattedMessage } from '@kbn/i18n-react';
|
||||
|
||||
export const Component = () => {
|
||||
return (
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
import React, { Component } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
import { FormattedMessage } from '@kbn/i18n-react';
|
||||
import { EuiEmptyPrompt } from '@elastic/eui';
|
||||
import { InspectorViewProps, Adapters } from '../../../../src/plugins/inspector/public';
|
||||
import { AstDebugView } from './ast_debug_view';
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
import React, { useEffect } from 'react';
|
||||
import { BrowserRouter as Router } from 'react-router-dom';
|
||||
import { FormattedMessage, I18nProvider } from '@kbn/i18n/react';
|
||||
import { FormattedMessage, I18nProvider } from '@kbn/i18n-react';
|
||||
|
||||
import {
|
||||
EuiPage,
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import { Router, Route, Redirect } from 'react-router-dom';
|
||||
import { I18nProvider } from '@kbn/i18n/react';
|
||||
import { I18nProvider } from '@kbn/i18n-react';
|
||||
import { AppMountParameters, CoreStart } from '../../../src/core/public';
|
||||
import { AppPluginStartDependencies } from './types';
|
||||
import { SearchExamplePage, ExampleLink } from './common/example_page';
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
import { FormattedMessage } from '@kbn/i18n-react';
|
||||
|
||||
import {
|
||||
EuiButtonEmpty,
|
||||
|
|
|
@ -132,6 +132,7 @@
|
|||
"@kbn/es-query": "link:bazel-bin/packages/kbn-es-query",
|
||||
"@kbn/field-types": "link:bazel-bin/packages/kbn-field-types",
|
||||
"@kbn/i18n": "link:bazel-bin/packages/kbn-i18n",
|
||||
"@kbn/i18n-react": "link:bazel-bin/packages/kbn-i18n-react",
|
||||
"@kbn/interpreter": "link:bazel-bin/packages/kbn-interpreter",
|
||||
"@kbn/io-ts-utils": "link:bazel-bin/packages/kbn-io-ts-utils",
|
||||
"@kbn/logging": "link:bazel-bin/packages/kbn-logging",
|
||||
|
@ -550,6 +551,8 @@
|
|||
"@types/json-stable-stringify": "^1.0.32",
|
||||
"@types/json5": "^0.0.30",
|
||||
"@types/kbn__ace": "link:bazel-bin/packages/kbn-ace/npm_module_types",
|
||||
"@types/kbn__i18n": "link:bazel-bin/packages/kbn-i18n/npm_module_types",
|
||||
"@types/kbn__i18n-react": "link:bazel-bin/packages/kbn-i18n-react/npm_module_types",
|
||||
"@types/license-checker": "15.0.0",
|
||||
"@types/listr": "^0.14.0",
|
||||
"@types/loader-utils": "^1.1.3",
|
||||
|
|
|
@ -27,6 +27,7 @@ filegroup(
|
|||
"//packages/kbn-expect:build",
|
||||
"//packages/kbn-field-types:build",
|
||||
"//packages/kbn-i18n:build",
|
||||
"//packages/kbn-i18n-react:build",
|
||||
"//packages/kbn-interpreter:build",
|
||||
"//packages/kbn-io-ts-utils:build",
|
||||
"//packages/kbn-logging:build",
|
||||
|
@ -76,6 +77,8 @@ filegroup(
|
|||
"//packages/elastic-apm-synthtrace:build_types",
|
||||
"//packages/elastic-datemath:build_types",
|
||||
"//packages/kbn-ace:build_types",
|
||||
"//packages/kbn-i18n:build_types",
|
||||
"//packages/kbn-i18n-react:build_types",
|
||||
],
|
||||
)
|
||||
|
||||
|
|
|
@ -79,8 +79,8 @@ module.exports = {
|
|||
},
|
||||
{
|
||||
from: 'react-intl',
|
||||
to: '@kbn/i18n/react',
|
||||
disallowedMessage: `import from @kbn/i18n/react instead`
|
||||
to: '@kbn/i18n-react',
|
||||
disallowedMessage: `import from @kbn/i18n-react instead`
|
||||
},
|
||||
{
|
||||
from: 'styled-components',
|
||||
|
|
|
@ -38,9 +38,10 @@ RUNTIME_DEPS = [
|
|||
]
|
||||
|
||||
TYPES_DEPS = [
|
||||
"//packages/kbn-i18n",
|
||||
"//packages/kbn-i18n:npm_module_types",
|
||||
"@npm//@elastic/eui",
|
||||
"@npm//resize-observer-polyfill",
|
||||
"@npm//tslib",
|
||||
"@npm//@types/enzyme",
|
||||
"@npm//@types/jest",
|
||||
"@npm//@types/node",
|
||||
|
|
|
@ -49,7 +49,7 @@ TYPES_DEPS = [
|
|||
"//packages/kbn-logging",
|
||||
"//packages/kbn-std",
|
||||
"//packages/kbn-utility-types",
|
||||
"//packages/kbn-i18n",
|
||||
"//packages/kbn-i18n:npm_module_types",
|
||||
"@npm//load-json-file",
|
||||
"@npm//rxjs",
|
||||
"@npm//@types/jest",
|
||||
|
|
|
@ -38,13 +38,13 @@ RUNTIME_DEPS = [
|
|||
"@npm//load-json-file",
|
||||
"@npm//lodash",
|
||||
"@npm//moment-timezone",
|
||||
"@npm//tslib",
|
||||
]
|
||||
|
||||
TYPES_DEPS = [
|
||||
"//packages/kbn-utility-types",
|
||||
"//packages/kbn-i18n",
|
||||
"//packages/kbn-i18n:npm_module_types",
|
||||
"@npm//@elastic/elasticsearch",
|
||||
"@npm//tslib",
|
||||
"@npm//@types/jest",
|
||||
"@npm//@types/lodash",
|
||||
"@npm//@types/moment-timezone",
|
||||
|
|
123
packages/kbn-i18n-react/BUILD.bazel
Normal file
123
packages/kbn-i18n-react/BUILD.bazel
Normal file
|
@ -0,0 +1,123 @@
|
|||
load("@npm//@bazel/typescript:index.bzl", "ts_config")
|
||||
load("@build_bazel_rules_nodejs//:index.bzl", "js_library")
|
||||
load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project")
|
||||
|
||||
PKG_BASE_NAME = "kbn-i18n-react"
|
||||
PKG_REQUIRE_NAME = "@kbn/i18n-react"
|
||||
TYPES_PKG_REQUIRE_NAME = "@types/kbn__i18n-react"
|
||||
|
||||
SOURCE_FILES = glob(
|
||||
[
|
||||
"src/**/*.ts",
|
||||
"src/**/*.tsx",
|
||||
],
|
||||
exclude = [
|
||||
"**/*.test.*",
|
||||
"**/__snapshots__/**",
|
||||
],
|
||||
)
|
||||
|
||||
SRCS = SOURCE_FILES
|
||||
|
||||
filegroup(
|
||||
name = "srcs",
|
||||
srcs = SRCS,
|
||||
)
|
||||
|
||||
NPM_MODULE_EXTRA_FILES = [
|
||||
"package.json",
|
||||
"README.md"
|
||||
]
|
||||
|
||||
RUNTIME_DEPS = [
|
||||
"//packages/kbn-i18n",
|
||||
"@npm//prop-types",
|
||||
"@npm//react",
|
||||
"@npm//react-intl"
|
||||
]
|
||||
|
||||
TYPES_DEPS = [
|
||||
"//packages/kbn-i18n:npm_module_types",
|
||||
"@npm//tslib",
|
||||
"@npm//@types/jest",
|
||||
"@npm//@types/node",
|
||||
"@npm//@types/prop-types",
|
||||
"@npm//@types/react",
|
||||
"@npm//@types/react-intl",
|
||||
]
|
||||
|
||||
jsts_transpiler(
|
||||
name = "target_node",
|
||||
srcs = SRCS,
|
||||
build_pkg_name = package_name(),
|
||||
)
|
||||
|
||||
jsts_transpiler(
|
||||
name = "target_web",
|
||||
srcs = SRCS,
|
||||
build_pkg_name = package_name(),
|
||||
web = True,
|
||||
)
|
||||
|
||||
ts_config(
|
||||
name = "tsconfig",
|
||||
src = "tsconfig.json",
|
||||
deps = [
|
||||
"//:tsconfig.base.json",
|
||||
"//:tsconfig.bazel.json",
|
||||
],
|
||||
)
|
||||
|
||||
ts_project(
|
||||
name = "tsc_types",
|
||||
args = ['--pretty'],
|
||||
srcs = SRCS,
|
||||
deps = TYPES_DEPS,
|
||||
declaration = True,
|
||||
declaration_map = True,
|
||||
emit_declaration_only = True,
|
||||
out_dir = "target_types",
|
||||
source_map = True,
|
||||
root_dir = "src",
|
||||
tsconfig = ":tsconfig",
|
||||
)
|
||||
|
||||
js_library(
|
||||
name = PKG_BASE_NAME,
|
||||
srcs = NPM_MODULE_EXTRA_FILES,
|
||||
deps = RUNTIME_DEPS + [":target_node", ":target_web"],
|
||||
package_name = PKG_REQUIRE_NAME,
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
pkg_npm(
|
||||
name = "npm_module",
|
||||
deps = [
|
||||
":%s" % PKG_BASE_NAME,
|
||||
]
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "build",
|
||||
srcs = [
|
||||
":npm_module",
|
||||
],
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
pkg_npm_types(
|
||||
name = "npm_module_types",
|
||||
srcs = SRCS,
|
||||
deps = [":tsc_types"],
|
||||
package_name = TYPES_PKG_REQUIRE_NAME,
|
||||
tsconfig = ":tsconfig",
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "build_types",
|
||||
srcs = [
|
||||
":npm_module_types",
|
||||
],
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
3
packages/kbn-i18n-react/README.md
Normal file
3
packages/kbn-i18n-react/README.md
Normal file
|
@ -0,0 +1,3 @@
|
|||
# I18n-React
|
||||
|
||||
Please check the [@kbn/I18n README](../kbn-i18n/README.md) for all the information
|
14
packages/kbn-i18n-react/jest.config.js
Normal file
14
packages/kbn-i18n-react/jest.config.js
Normal file
|
@ -0,0 +1,14 @@
|
|||
/*
|
||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||
* or more contributor license agreements. Licensed under the Elastic License
|
||||
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
||||
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
||||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
module.exports = {
|
||||
preset: '@kbn/test',
|
||||
rootDir: '../..',
|
||||
roots: ['<rootDir>/packages/kbn-i18n-react'],
|
||||
testRunner: 'jasmine2',
|
||||
};
|
8
packages/kbn-i18n-react/package.json
Normal file
8
packages/kbn-i18n-react/package.json
Normal file
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"name": "@kbn/i18n-react",
|
||||
"browser": "./target_web/browser.js",
|
||||
"main": "./target_node/index.js",
|
||||
"version": "1.0.0",
|
||||
"license": "SSPL-1.0 OR Elastic License 2.0",
|
||||
"private": true
|
||||
}
|
|
@ -12,7 +12,7 @@ import * as React from 'react';
|
|||
// eslint-disable-next-line @kbn/eslint/module_migration
|
||||
import { IntlProvider } from 'react-intl';
|
||||
|
||||
import * as i18n from '../core';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { PseudoLocaleWrapper } from './pseudo_locale_wrapper';
|
||||
|
||||
/**
|
|
@ -8,8 +8,7 @@
|
|||
|
||||
import * as PropTypes from 'prop-types';
|
||||
import * as React from 'react';
|
||||
import * as i18n from '../core';
|
||||
import { isPseudoLocale, translateUsingPseudoLocale } from '../core/pseudo_locale';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
|
||||
/**
|
||||
* To translate label that includes nested `FormattedMessage` instances React Intl
|
||||
|
@ -26,11 +25,11 @@ function translateFormattedMessageUsingPseudoLocale(message: string) {
|
|||
if (formattedMessageDelimiter !== null) {
|
||||
return message
|
||||
.split(formattedMessageDelimiter[0])
|
||||
.map((part) => (part.startsWith('ELEMENT-') ? part : translateUsingPseudoLocale(part)))
|
||||
.map((part) => (part.startsWith('ELEMENT-') ? part : i18n.translateUsingPseudoLocale(part)))
|
||||
.join(formattedMessageDelimiter[0]);
|
||||
}
|
||||
|
||||
return translateUsingPseudoLocale(message);
|
||||
return i18n.translateUsingPseudoLocale(message);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -51,7 +50,7 @@ export class PseudoLocaleWrapper extends React.PureComponent {
|
|||
constructor(props: { children: React.ReactNode }, context: any) {
|
||||
super(props, context);
|
||||
|
||||
if (isPseudoLocale(i18n.getLocale())) {
|
||||
if (i18n.isPseudoLocale(i18n.getLocale())) {
|
||||
const formatMessage = context.intl.formatMessage;
|
||||
context.intl.formatMessage = (...args: any[]) =>
|
||||
translateFormattedMessageUsingPseudoLocale(formatMessage(...args));
|
19
packages/kbn-i18n-react/tsconfig.json
Normal file
19
packages/kbn-i18n-react/tsconfig.json
Normal file
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
"extends": "../../tsconfig.bazel.json",
|
||||
"compilerOptions": {
|
||||
"declaration": true,
|
||||
"declarationMap": true,
|
||||
"emitDeclarationOnly": true,
|
||||
"outDir": "./target_types",
|
||||
"sourceMap": true,
|
||||
"sourceRoot": "../../../../../packages/kbn-i18n-react/src",
|
||||
"types": [
|
||||
"jest",
|
||||
"node"
|
||||
]
|
||||
},
|
||||
"include": [
|
||||
"src/**/*.ts",
|
||||
"src/**/*.tsx",
|
||||
],
|
||||
}
|
|
@ -1,9 +1,10 @@
|
|||
load("@npm//@bazel/typescript:index.bzl", "ts_config", "ts_project")
|
||||
load("@build_bazel_rules_nodejs//:index.bzl", "js_library", "pkg_npm")
|
||||
load("//src/dev/bazel:index.bzl", "jsts_transpiler")
|
||||
load("@npm//@bazel/typescript:index.bzl", "ts_config")
|
||||
load("@build_bazel_rules_nodejs//:index.bzl", "js_library")
|
||||
load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project")
|
||||
|
||||
PKG_BASE_NAME = "kbn-i18n"
|
||||
PKG_REQUIRE_NAME = "@kbn/i18n"
|
||||
TYPES_PKG_REQUIRE_NAME = "@types/kbn__i18n"
|
||||
|
||||
SOURCE_FILES = glob(
|
||||
[
|
||||
|
@ -27,7 +28,6 @@ filegroup(
|
|||
)
|
||||
|
||||
NPM_MODULE_EXTRA_FILES = [
|
||||
"react/package.json",
|
||||
"package.json",
|
||||
"GUIDELINE.md",
|
||||
"README.md"
|
||||
|
@ -37,21 +37,14 @@ RUNTIME_DEPS = [
|
|||
"@npm//intl-format-cache",
|
||||
"@npm//intl-messageformat",
|
||||
"@npm//intl-relativeformat",
|
||||
"@npm//prop-types",
|
||||
"@npm//react",
|
||||
"@npm//react-intl"
|
||||
]
|
||||
|
||||
TYPES_DEPS = [
|
||||
"//packages/kbn-babel-preset",
|
||||
"@npm//intl-messageformat",
|
||||
"@npm//tslib",
|
||||
"@npm//@types/intl-relativeformat",
|
||||
"@npm//@types/jest",
|
||||
"@npm//@types/node",
|
||||
"@npm//@types/prop-types",
|
||||
"@npm//@types/react",
|
||||
"@npm//@types/react-intl",
|
||||
]
|
||||
|
||||
jsts_transpiler(
|
||||
|
@ -93,7 +86,7 @@ ts_project(
|
|||
js_library(
|
||||
name = PKG_BASE_NAME,
|
||||
srcs = NPM_MODULE_EXTRA_FILES,
|
||||
deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"],
|
||||
deps = RUNTIME_DEPS + [":target_node", ":target_web"],
|
||||
package_name = PKG_REQUIRE_NAME,
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
@ -112,3 +105,20 @@ filegroup(
|
|||
],
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
pkg_npm_types(
|
||||
name = "npm_module_types",
|
||||
srcs = SRCS,
|
||||
deps = [":tsc_types"],
|
||||
package_name = TYPES_PKG_REQUIRE_NAME,
|
||||
tsconfig = ":tsconfig",
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "build_types",
|
||||
srcs = [
|
||||
":npm_module_types",
|
||||
],
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
|
|
@ -201,7 +201,7 @@ uses I18n engine under the hood:
|
|||
```js
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import { I18nProvider } from '@kbn/i18n/react';
|
||||
import { I18nProvider } from '@kbn/i18n-react';
|
||||
|
||||
ReactDOM.render(
|
||||
<I18nProvider>
|
||||
|
@ -216,7 +216,7 @@ ReactDOM.render(
|
|||
After that we can use `FormattedMessage` components inside `RootComponent`:
|
||||
```jsx
|
||||
import React, { Component } from 'react';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
import { FormattedMessage } from '@kbn/i18n-react';
|
||||
|
||||
class RootComponent extends Component {
|
||||
constructor(props) {
|
||||
|
@ -292,7 +292,7 @@ React component as a pure function:
|
|||
|
||||
```js
|
||||
import React from 'react';
|
||||
import { injectI18n, intlShape } from '@kbn/i18n/react';
|
||||
import { injectI18n, intlShape } from '@kbn/i18n-react';
|
||||
|
||||
export const MyComponent = injectI18n({ intl }) => (
|
||||
<input
|
||||
|
@ -318,7 +318,7 @@ React component as a class:
|
|||
|
||||
```js
|
||||
import React from 'react';
|
||||
import { injectI18n, intlShape } from '@kbn/i18n/react';
|
||||
import { injectI18n, intlShape } from '@kbn/i18n-react';
|
||||
|
||||
export const MyComponent = injectI18n(
|
||||
class MyComponent extends React.Component {
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
"name": "@kbn/i18n",
|
||||
"browser": "./target_web/browser.js",
|
||||
"main": "./target_node/index.js",
|
||||
"types": "./target_types/index.d.ts",
|
||||
"version": "1.0.0",
|
||||
"license": "SSPL-1.0 OR Elastic License 2.0",
|
||||
"private": true
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
{
|
||||
"browser": "../target_web/react",
|
||||
"main": "../target_node/react",
|
||||
"types": "../target_types/react/index.d.ts"
|
||||
}
|
|
@ -152,7 +152,7 @@ export function getRegisteredLocales() {
|
|||
return Object.keys(translationsForLocale);
|
||||
}
|
||||
|
||||
interface TranslateArguments {
|
||||
export interface TranslateArguments {
|
||||
values?: Record<string, string | number | boolean | Date | null | undefined>;
|
||||
defaultMessage: string;
|
||||
description?: string;
|
||||
|
|
|
@ -6,5 +6,7 @@
|
|||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
export type { Formats } from './formats';
|
||||
export { formats } from './formats';
|
||||
export * from './i18n';
|
||||
export * from './pseudo_locale';
|
||||
|
|
|
@ -6,8 +6,60 @@
|
|||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
import * as i18nCore from './core';
|
||||
import * as loader from './loader';
|
||||
import {
|
||||
formats,
|
||||
addTranslation,
|
||||
getTranslation,
|
||||
setLocale,
|
||||
getLocale,
|
||||
setDefaultLocale,
|
||||
getDefaultLocale,
|
||||
setFormats,
|
||||
getFormats,
|
||||
getRegisteredLocales,
|
||||
translate,
|
||||
init,
|
||||
load,
|
||||
isPseudoLocale,
|
||||
translateUsingPseudoLocale,
|
||||
} from './core';
|
||||
|
||||
export const i18n = i18nCore;
|
||||
export const i18nLoader = loader;
|
||||
import {
|
||||
registerTranslationFile,
|
||||
registerTranslationFiles,
|
||||
getTranslationsByLocale,
|
||||
getAllTranslations,
|
||||
getAllTranslationsFromPaths,
|
||||
getRegisteredLocales as getRegisteredLocalesForLoader,
|
||||
} from './loader';
|
||||
|
||||
const i18n = {
|
||||
formats,
|
||||
addTranslation,
|
||||
getTranslation,
|
||||
setLocale,
|
||||
getLocale,
|
||||
setDefaultLocale,
|
||||
getDefaultLocale,
|
||||
setFormats,
|
||||
getFormats,
|
||||
getRegisteredLocales,
|
||||
translate,
|
||||
init,
|
||||
load,
|
||||
isPseudoLocale,
|
||||
translateUsingPseudoLocale,
|
||||
};
|
||||
|
||||
const i18nLoader = {
|
||||
registerTranslationFile,
|
||||
registerTranslationFiles,
|
||||
getTranslationsByLocale,
|
||||
getAllTranslations,
|
||||
getAllTranslationsFromPaths,
|
||||
getRegisteredLocales: getRegisteredLocalesForLoader,
|
||||
};
|
||||
|
||||
export type { Translation } from './translation';
|
||||
export type { Formats, TranslateArguments } from './core';
|
||||
export { i18n, i18nLoader };
|
||||
|
|
|
@ -39,9 +39,11 @@ RUNTIME_DEPS = [
|
|||
]
|
||||
|
||||
TYPES_DEPS = [
|
||||
"//packages/kbn-i18n",
|
||||
"//packages/kbn-i18n:npm_module_types",
|
||||
"@npm//antlr4ts",
|
||||
"@npm//monaco-editor",
|
||||
"@npm//rxjs",
|
||||
"@npm//tslib",
|
||||
"@npm//@types/jest",
|
||||
"@npm//@types/node",
|
||||
]
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import React, { useState } from 'react';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { FormattedMessage, I18nProvider } from '@kbn/i18n/react';
|
||||
import { FormattedMessage, I18nProvider } from '@kbn/i18n-react';
|
||||
import { BrowserRouter as Router } from 'react-router-dom';
|
||||
|
||||
import {
|
||||
|
|
|
@ -37,7 +37,7 @@ NPM_MODULE_EXTRA_FILES = [
|
|||
|
||||
RUNTIME_DEPS = [
|
||||
"//packages/kbn-dev-utils",
|
||||
"//packages/kbn-i18n",
|
||||
"//packages/kbn-i18n-react",
|
||||
"//packages/kbn-std",
|
||||
"//packages/kbn-utils",
|
||||
"@npm//@elastic/elasticsearch",
|
||||
|
@ -73,7 +73,7 @@ RUNTIME_DEPS = [
|
|||
|
||||
TYPES_DEPS = [
|
||||
"//packages/kbn-dev-utils",
|
||||
"//packages/kbn-i18n",
|
||||
"//packages/kbn-i18n-react:npm_module_types",
|
||||
"//packages/kbn-utils",
|
||||
"@npm//@elastic/elasticsearch",
|
||||
"@npm//del",
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
* intl context around them.
|
||||
*/
|
||||
|
||||
import { I18nProvider, InjectedIntl, intlShape, __IntlProvider } from '@kbn/i18n/react';
|
||||
import { I18nProvider, InjectedIntl, intlShape, __IntlProvider } from '@kbn/i18n-react';
|
||||
import { mount, ReactWrapper, render, shallow } from 'enzyme';
|
||||
import React, { ReactElement, ValidationMap } from 'react';
|
||||
import { act as reactAct } from 'react-dom/test-utils';
|
||||
|
|
|
@ -35,6 +35,7 @@ RUNTIME_DEPS = [
|
|||
"//packages/kbn-analytics",
|
||||
"//packages/kbn-babel-preset",
|
||||
"//packages/kbn-i18n",
|
||||
"//packages/kbn-i18n-react",
|
||||
"//packages/kbn-monaco",
|
||||
"//packages/kbn-std",
|
||||
"//packages/kbn-ui-shared-deps-npm",
|
||||
|
@ -45,7 +46,8 @@ TYPES_DEPS = [
|
|||
"//packages/elastic-safer-lodash-set",
|
||||
"//packages/kbn-analytics",
|
||||
"//packages/kbn-babel-preset",
|
||||
"//packages/kbn-i18n",
|
||||
"//packages/kbn-i18n:npm_module_types",
|
||||
"//packages/kbn-i18n-react:npm_module_types",
|
||||
"//packages/kbn-monaco",
|
||||
"//packages/kbn-std",
|
||||
"//packages/kbn-ui-shared-deps-npm",
|
||||
|
|
|
@ -15,7 +15,7 @@ require('./flot_charts');
|
|||
|
||||
// stateful deps
|
||||
export const KbnI18n = require('@kbn/i18n');
|
||||
export const KbnI18nReact = require('@kbn/i18n/react');
|
||||
export const KbnI18nReact = require('@kbn/i18n-react');
|
||||
export const EmotionReact = require('@emotion/react');
|
||||
export const Moment = require('moment');
|
||||
export const MomentTimezone = require('moment-timezone/moment-timezone');
|
||||
|
|
|
@ -31,7 +31,7 @@ exports.externals = {
|
|||
* stateful deps
|
||||
*/
|
||||
'@kbn/i18n': '__kbnSharedDeps__.KbnI18n',
|
||||
'@kbn/i18n/react': '__kbnSharedDeps__.KbnI18nReact',
|
||||
'@kbn/i18n-react': '__kbnSharedDeps__.KbnI18nReact',
|
||||
'@emotion/react': '__kbnSharedDeps__.EmotionReact',
|
||||
jquery: '__kbnSharedDeps__.Jquery',
|
||||
moment: '__kbnSharedDeps__.Moment',
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
import React, { ReactElement } from 'react';
|
||||
import { act } from 'react-dom/test-utils';
|
||||
import { mount } from 'enzyme';
|
||||
import { I18nProvider } from '@kbn/i18n/react';
|
||||
import { I18nProvider } from '@kbn/i18n-react';
|
||||
|
||||
import { AppMountParameters } from '../types';
|
||||
import { MockedMounterTuple, Mountable } from '../test_types';
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
import { EuiEmptyPrompt, EuiPage, EuiPageBody, EuiPageContent } from '@elastic/eui';
|
||||
import React from 'react';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
import { FormattedMessage } from '@kbn/i18n-react';
|
||||
|
||||
export const AppNotFound = () => (
|
||||
<EuiPage style={{ minHeight: '100%' }} data-test-subj="appNotFoundPageContent">
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
import { FormattedMessage } from '@kbn/i18n-react';
|
||||
import { BehaviorSubject, combineLatest, merge, Observable, of, ReplaySubject } from 'rxjs';
|
||||
import { flatMap, map, takeUntil } from 'rxjs/operators';
|
||||
import { parse } from 'url';
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
import React, { Component, Fragment } from 'react';
|
||||
import { combineLatest, Observable, Subscription } from 'rxjs';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
import { FormattedMessage } from '@kbn/i18n-react';
|
||||
import {
|
||||
EuiButtonEmpty,
|
||||
EuiButtonEmptyProps,
|
||||
|
|
|
@ -10,7 +10,7 @@ import React, { ReactChild, useState, useLayoutEffect } from 'react';
|
|||
import ReactDOM from 'react-dom';
|
||||
import { History } from 'history';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { I18nProvider } from '@kbn/i18n/react';
|
||||
import { I18nProvider } from '@kbn/i18n-react';
|
||||
|
||||
import { EuiEmptyPrompt, EuiPage, EuiPageBody, EuiPageContent } from '@elastic/eui';
|
||||
import { UrlOverflowUi } from './url_overflow_ui';
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
import React from 'react';
|
||||
import { EuiButton, EuiFlexGroup, EuiFlexItem } from '@elastic/eui';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
import { FormattedMessage } from '@kbn/i18n-react';
|
||||
|
||||
import type { HttpStart, NotificationsStart } from '../..';
|
||||
import type { DocLinksStart } from '../../doc_links';
|
||||
|
|
|
@ -10,7 +10,7 @@ import React from 'react';
|
|||
import { History, Location } from 'history';
|
||||
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
import { FormattedMessage } from '@kbn/i18n-react';
|
||||
|
||||
import { mountReactNode } from '../../utils';
|
||||
import { IToasts } from '../../notifications';
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
import React from 'react';
|
||||
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
import { FormattedMessage } from '@kbn/i18n-react';
|
||||
import { EuiText } from '@elastic/eui';
|
||||
|
||||
import { IBasePath } from '../../http';
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
import React, { FunctionComponent } from 'react';
|
||||
import { EuiText, EuiFlexGroup, EuiFlexItem, EuiTitle, EuiBadge } from '@elastic/eui';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
import { FormattedMessage } from '@kbn/i18n-react';
|
||||
import type { FormattedStatus } from '../lib';
|
||||
|
||||
interface ServerStateProps {
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import { I18nProvider } from '@kbn/i18n/react';
|
||||
import { I18nProvider } from '@kbn/i18n-react';
|
||||
import type { AppMountParameters } from '../../application';
|
||||
import type { HttpSetup } from '../../http';
|
||||
import type { NotificationsSetup } from '../../notifications';
|
||||
|
|
|
@ -18,7 +18,7 @@ import {
|
|||
EuiFlexGroup,
|
||||
EuiFlexItem,
|
||||
} from '@elastic/eui';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
import { FormattedMessage } from '@kbn/i18n-react';
|
||||
import { HttpSetup } from '../../http';
|
||||
import { NotificationsSetup } from '../../notifications';
|
||||
import { loadStatus, ProcessedServerResponse } from './lib';
|
||||
|
|
|
@ -20,7 +20,7 @@ import React from 'react';
|
|||
import * as Rx from 'rxjs';
|
||||
import { tap } from 'rxjs/operators';
|
||||
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
import { FormattedMessage } from '@kbn/i18n-react';
|
||||
|
||||
import { FatalErrorInfo } from './get_error_info';
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
import React from 'react';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
import { FormattedMessage } from '@kbn/i18n-react';
|
||||
import { EuiTokensObject } from '@elastic/eui';
|
||||
|
||||
interface EuiValues {
|
||||
|
|
|
@ -16,7 +16,7 @@ jest.mock('@elastic/eui', () => {
|
|||
};
|
||||
});
|
||||
|
||||
jest.mock('@kbn/i18n/react', () => {
|
||||
jest.mock('@kbn/i18n-react', () => {
|
||||
return {
|
||||
I18nProvider: function MockI18nProvider() {
|
||||
// no-op
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
import React from 'react';
|
||||
import { EuiContext } from '@elastic/eui';
|
||||
import { I18nProvider } from '@kbn/i18n/react';
|
||||
import { I18nProvider } from '@kbn/i18n-react';
|
||||
|
||||
import { getEuiContextMapping } from './i18n_eui_mapping';
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ import {
|
|||
EuiModalHeaderTitle,
|
||||
} from '@elastic/eui';
|
||||
import { EuiSpacer } from '@elastic/eui';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
import { FormattedMessage } from '@kbn/i18n-react';
|
||||
import { OverlayStart } from 'kibana/public';
|
||||
import { I18nStart } from '../../i18n';
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ import ReactDOM from 'react-dom';
|
|||
import { filter } from 'rxjs/operators';
|
||||
import { Subscription } from 'rxjs';
|
||||
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
import { FormattedMessage } from '@kbn/i18n-react';
|
||||
import { EuiCallOut, EuiButton, EuiLoadingSpinner } from '@elastic/eui';
|
||||
|
||||
import { I18nStart } from '../../i18n';
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import { I18nProvider } from '@kbn/i18n/react';
|
||||
import { I18nProvider } from '@kbn/i18n-react';
|
||||
import { pairwise, startWith } from 'rxjs/operators';
|
||||
|
||||
import { InternalChromeStart } from '../chrome';
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
import React, { useEffect, useRef } from 'react';
|
||||
import { render, unmountComponentAtNode } from 'react-dom';
|
||||
import { I18nProvider } from '@kbn/i18n/react';
|
||||
import { I18nProvider } from '@kbn/i18n-react';
|
||||
import { MountPoint } from '../types';
|
||||
|
||||
const defaultWrapperClass = 'kbnMountWrapper';
|
||||
|
|
|
@ -36,6 +36,7 @@ export async function extractUntrackedMessagesTask({
|
|||
'**/build/**',
|
||||
'**/__fixtures__/**',
|
||||
'**/packages/kbn-i18n/**',
|
||||
'**/packages/kbn-i18n-react/**',
|
||||
'**/packages/kbn-plugin-generator/template/**',
|
||||
'**/target/**',
|
||||
'**/test/**',
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
import React from 'react';
|
||||
import { EuiText } from '@elastic/eui';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
import { FormattedMessage } from '@kbn/i18n-react';
|
||||
|
||||
export const PageTitle = () => {
|
||||
return (
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
*/
|
||||
|
||||
import React, { Component } from 'react';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
import { FormattedMessage } from '@kbn/i18n-react';
|
||||
import { EuiScreenReaderOnly, EuiDelayRender } from '@elastic/eui';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { FieldSetting } from '../../types';
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
import React from 'react';
|
||||
|
||||
import { EuiCallOut } from '@elastic/eui';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
import { FormattedMessage } from '@kbn/i18n-react';
|
||||
|
||||
export const CallOuts = () => {
|
||||
return (
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { I18nProvider } from '@kbn/i18n/react';
|
||||
import { I18nProvider } from '@kbn/i18n-react';
|
||||
import { shallowWithI18nProvider, mountWithI18nProvider } from '@kbn/test/jest';
|
||||
import { mount, ReactWrapper } from 'enzyme';
|
||||
import { FieldSetting } from '../../types';
|
||||
|
|
|
@ -34,7 +34,7 @@ import {
|
|||
EuiToolTip,
|
||||
} from '@elastic/eui';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
import { FormattedMessage } from '@kbn/i18n-react';
|
||||
import { FieldSetting, FieldState } from '../../types';
|
||||
import { isDefaultValue } from '../../lib';
|
||||
import { UiSettingsType, DocLinksStart, ToastsStart } from '../../../../../../core/public';
|
||||
|
|
|
@ -22,7 +22,7 @@ import {
|
|||
EuiButtonEmpty,
|
||||
EuiTitle,
|
||||
} from '@elastic/eui';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
import { FormattedMessage } from '@kbn/i18n-react';
|
||||
import { isEmpty } from 'lodash';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { UiCounterMetricType } from '@kbn/analytics';
|
||||
|
|
|
@ -11,7 +11,7 @@ import ReactDOM from 'react-dom';
|
|||
import { Router, Switch, Route, Redirect, RouteChildrenProps } from 'react-router-dom';
|
||||
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { I18nProvider } from '@kbn/i18n/react';
|
||||
import { I18nProvider } from '@kbn/i18n-react';
|
||||
|
||||
import { LocationDescriptor } from 'history';
|
||||
import { url } from '../../../kibana_utils/public';
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
*/
|
||||
|
||||
import React, { useCallback, useState, useMemo } from 'react';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
import { FormattedMessage } from '@kbn/i18n-react';
|
||||
import { throttle } from 'lodash';
|
||||
import { EuiIconTip, EuiResizeObserver } from '@elastic/eui';
|
||||
import { Chart, Settings, Wordcloud, RenderChangeListener } from '@elastic/charts';
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
import React, { lazy } from 'react';
|
||||
import { render, unmountComponentAtNode } from 'react-dom';
|
||||
import { I18nProvider } from '@kbn/i18n/react';
|
||||
import { I18nProvider } from '@kbn/i18n-react';
|
||||
import { ClassNames } from '@emotion/react';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { VisualizationContainer } from '../../../../visualizations/public';
|
||||
|
|
|
@ -17,7 +17,7 @@ import {
|
|||
EuiScreenReaderOnly,
|
||||
EuiFlexGroup,
|
||||
} from '@elastic/eui';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
import { FormattedMessage } from '@kbn/i18n-react';
|
||||
import { lightenColor } from '../../services/palettes/lighten_color';
|
||||
import './color_picker.scss';
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ import {
|
|||
EuiLink,
|
||||
} from '@elastic/eui';
|
||||
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
import { FormattedMessage } from '@kbn/i18n-react';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
|
||||
interface Props {
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
import { FormattedMessage } from '@kbn/i18n-react';
|
||||
import {
|
||||
EuiText,
|
||||
EuiFlyout,
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
import _ from 'lodash';
|
||||
import React, { Fragment, useState } from 'react';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
import { FormattedMessage } from '@kbn/i18n-react';
|
||||
|
||||
import {
|
||||
EuiButton,
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
*/
|
||||
|
||||
import React, { FunctionComponent, useEffect } from 'react';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
import { FormattedMessage } from '@kbn/i18n-react';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { EuiCallOut, EuiText, EuiButton, EuiSpacer } from '@elastic/eui';
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
import { FormattedMessage } from '@kbn/i18n-react';
|
||||
|
||||
// @ts-ignore
|
||||
import {
|
||||
|
|
|
@ -10,7 +10,7 @@ import './editor.test.mock';
|
|||
|
||||
import React from 'react';
|
||||
import { mount } from 'enzyme';
|
||||
import { I18nProvider } from '@kbn/i18n/react';
|
||||
import { I18nProvider } from '@kbn/i18n-react';
|
||||
import { act } from 'react-dom/test-utils';
|
||||
import * as sinon from 'sinon';
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ import {
|
|||
useEuiTheme,
|
||||
} from '@elastic/eui';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
import { FormattedMessage } from '@kbn/i18n-react';
|
||||
|
||||
import { CustomIntegration } from '../../../common';
|
||||
import { usePlatformService } from '../../services';
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
import React from 'react';
|
||||
|
||||
import { DecoratorFn } from '@storybook/react';
|
||||
import { I18nProvider } from '@kbn/i18n/react';
|
||||
import { I18nProvider } from '@kbn/i18n-react';
|
||||
|
||||
import { PluginServiceRegistry } from '../../presentation_util/public';
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ import React from 'react';
|
|||
import { History } from 'history';
|
||||
import { Provider } from 'react-redux';
|
||||
import { first } from 'rxjs/operators';
|
||||
import { I18nProvider } from '@kbn/i18n/react';
|
||||
import { I18nProvider } from '@kbn/i18n-react';
|
||||
import { parse, ParsedQuery } from 'query-string';
|
||||
import { render, unmountComponentAtNode } from 'react-dom';
|
||||
import { Switch, Route, RouteComponentProps, HashRouter, Redirect } from 'react-router-dom';
|
||||
|
|
|
@ -12,7 +12,7 @@ import { mount } from 'enzyme';
|
|||
import { findTestSubject, nextTick } from '@kbn/test/jest';
|
||||
import { DashboardContainer, DashboardContainerServices } from './dashboard_container';
|
||||
import { getSampleDashboardInput, getSampleDashboardPanel } from '../test_helpers';
|
||||
import { I18nProvider } from '@kbn/i18n/react';
|
||||
import { I18nProvider } from '@kbn/i18n-react';
|
||||
import { embeddablePluginMock } from 'src/plugins/embeddable/public/mocks';
|
||||
|
||||
import { KibanaContextProvider } from '../../services/kibana_react';
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
import _ from 'lodash';
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import { I18nProvider } from '@kbn/i18n/react';
|
||||
import { I18nProvider } from '@kbn/i18n-react';
|
||||
import uuid from 'uuid';
|
||||
import { CoreStart, IUiSettingsClient, KibanaExecutionContext } from 'src/core/public';
|
||||
import { Start as InspectorStartContract } from 'src/plugins/inspector/public';
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { I18nProvider } from '@kbn/i18n/react';
|
||||
import { I18nProvider } from '@kbn/i18n-react';
|
||||
import {
|
||||
EuiIcon,
|
||||
EuiSpacer,
|
||||
|
|
|
@ -12,7 +12,7 @@ import 'react-resizable/css/styles.css';
|
|||
// @ts-ignore
|
||||
import sizeMe from 'react-sizeme';
|
||||
|
||||
import { injectI18n } from '@kbn/i18n/react';
|
||||
import { injectI18n } from '@kbn/i18n-react';
|
||||
import classNames from 'classnames';
|
||||
import _ from 'lodash';
|
||||
import React from 'react';
|
||||
|
|
|
@ -10,7 +10,7 @@ import { findTestSubject } from '@elastic/eui/lib/test';
|
|||
import React from 'react';
|
||||
import { skip } from 'rxjs/operators';
|
||||
import { mount } from 'enzyme';
|
||||
import { I18nProvider } from '@kbn/i18n/react';
|
||||
import { I18nProvider } from '@kbn/i18n-react';
|
||||
import { nextTick } from '@kbn/test/jest';
|
||||
import { DashboardViewport, DashboardViewportProps } from './dashboard_viewport';
|
||||
import { DashboardContainer, DashboardContainerServices } from '../dashboard_container';
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
import React from 'react';
|
||||
import { mount } from 'enzyme';
|
||||
import { I18nProvider } from '@kbn/i18n/react';
|
||||
import { I18nProvider } from '@kbn/i18n-react';
|
||||
|
||||
import { DashboardAppServices } from '../../types';
|
||||
import { SimpleSavedObject } from '../../../../../core/public';
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
import { FormattedMessage } from '@kbn/i18n-react';
|
||||
import { EuiLink, EuiButton, EuiEmptyPrompt, EuiBasicTableColumn } from '@elastic/eui';
|
||||
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
||||
import { attemptLoadDashboardByTitle } from '../lib';
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
import { i18n } from '@kbn/i18n';
|
||||
import React, { useEffect } from 'react';
|
||||
import { EuiCallOut } from '@elastic/eui';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
import { FormattedMessage } from '@kbn/i18n-react';
|
||||
import { RouteComponentProps } from 'react-router-dom';
|
||||
|
||||
import { useKibana, toMountPoint } from '../../services/kibana_react';
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
import { I18nProvider } from '@kbn/i18n/react';
|
||||
import { I18nProvider } from '@kbn/i18n-react';
|
||||
import { findTestSubject } from '@elastic/eui/lib/test';
|
||||
import { waitFor } from '@testing-library/react';
|
||||
import { mount } from 'enzyme';
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
import React, { Fragment } from 'react';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
import { FormattedMessage } from '@kbn/i18n-react';
|
||||
|
||||
import {
|
||||
EuiButton,
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
*/
|
||||
|
||||
import React, { Fragment } from 'react';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
import { FormattedMessage } from '@kbn/i18n-react';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { EuiFormRow, EuiTextArea, EuiSwitch } from '@elastic/eui';
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { I18nProvider } from '@kbn/i18n/react';
|
||||
import { I18nProvider } from '@kbn/i18n-react';
|
||||
import { DashboardCloneModal } from './clone_modal';
|
||||
|
||||
export function showCloneModal(
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import { I18nProvider } from '@kbn/i18n/react';
|
||||
import { I18nProvider } from '@kbn/i18n-react';
|
||||
import { EuiWrappingPopover } from '@elastic/eui';
|
||||
|
||||
import { OptionsMenu } from './options';
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
import React from 'react';
|
||||
import { $Keys } from 'utility-types';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
import { FormattedMessage } from '@kbn/i18n-react';
|
||||
import { KqlQuerySuggestionProvider } from './types';
|
||||
import {
|
||||
QuerySuggestion,
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
import React from 'react';
|
||||
import { flatten } from 'lodash';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
import { FormattedMessage } from '@kbn/i18n-react';
|
||||
import { escapeKuery } from './lib/escape_kuery';
|
||||
import { sortPrefixFirst } from './sort_prefix_first';
|
||||
import {
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
import { FormattedMessage } from '@kbn/i18n-react';
|
||||
import { $Keys } from 'utility-types';
|
||||
import { flatten } from 'lodash';
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
import React from 'react';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { EuiButton, EuiSpacer, EuiText, EuiCodeBlock } from '@elastic/eui';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
import { FormattedMessage } from '@kbn/i18n-react';
|
||||
import { ApplicationStart } from 'kibana/public';
|
||||
import { IEsError, isEsError } from './types';
|
||||
import { EsError } from './es_error';
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
import { EuiLink, EuiSpacer, EuiText } from '@elastic/eui';
|
||||
import { CoreStart } from 'kibana/public';
|
||||
import React from 'react';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
import { FormattedMessage } from '@kbn/i18n-react';
|
||||
|
||||
export const SearchSessionIncompleteWarning = (docLinks: CoreStart['docLinks']) => (
|
||||
<>
|
||||
|
|
|
@ -17,7 +17,7 @@ import {
|
|||
EuiModalHeaderTitle,
|
||||
EuiCheckbox,
|
||||
} from '@elastic/eui';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
import { FormattedMessage } from '@kbn/i18n-react';
|
||||
import React, { Component } from 'react';
|
||||
import { IIndexPattern } from '../..';
|
||||
import { Filter } from '../../../common';
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
*/
|
||||
|
||||
import { EuiButtonEmpty, EuiFlexGroup, EuiFlexItem, EuiPopover } from '@elastic/eui';
|
||||
import { FormattedMessage, InjectedIntl, injectI18n } from '@kbn/i18n/react';
|
||||
import { FormattedMessage, InjectedIntl, injectI18n } from '@kbn/i18n-react';
|
||||
import {
|
||||
buildEmptyFilter,
|
||||
Filter,
|
||||
|
|
|
@ -20,7 +20,7 @@ import {
|
|||
EuiSwitchEvent,
|
||||
} from '@elastic/eui';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { FormattedMessage, InjectedIntl, injectI18n } from '@kbn/i18n/react';
|
||||
import { FormattedMessage, InjectedIntl, injectI18n } from '@kbn/i18n-react';
|
||||
import {
|
||||
Filter,
|
||||
FieldFilter,
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
*/
|
||||
|
||||
import { EuiFormRow } from '@elastic/eui';
|
||||
import { InjectedIntl, injectI18n } from '@kbn/i18n/react';
|
||||
import { InjectedIntl, injectI18n } from '@kbn/i18n-react';
|
||||
import { uniq } from 'lodash';
|
||||
import React from 'react';
|
||||
import { GenericComboBox, GenericComboBoxProps } from './generic_combo_box';
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
*/
|
||||
|
||||
import { EuiFormRow } from '@elastic/eui';
|
||||
import { InjectedIntl, injectI18n } from '@kbn/i18n/react';
|
||||
import { InjectedIntl, injectI18n } from '@kbn/i18n-react';
|
||||
import { uniq } from 'lodash';
|
||||
import React from 'react';
|
||||
import { GenericComboBox, GenericComboBoxProps } from './generic_combo_box';
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
import moment from 'moment';
|
||||
import { EuiFormControlLayoutDelimited } from '@elastic/eui';
|
||||
import { InjectedIntl, injectI18n } from '@kbn/i18n/react';
|
||||
import { InjectedIntl, injectI18n } from '@kbn/i18n-react';
|
||||
import { get } from 'lodash';
|
||||
import React from 'react';
|
||||
import { useKibana } from '../../../../../kibana_react/public';
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
*/
|
||||
|
||||
import { EuiFieldNumber, EuiFieldText, EuiSelect } from '@elastic/eui';
|
||||
import { InjectedIntl, injectI18n } from '@kbn/i18n/react';
|
||||
import { InjectedIntl, injectI18n } from '@kbn/i18n-react';
|
||||
import { isEmpty } from 'lodash';
|
||||
import React, { Component } from 'react';
|
||||
import { validateParams } from './lib/filter_editor_utils';
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue