mirror of https://github.com/grafana/grafana.git
Chore: Update slate and related packages (#54566)
* Chore: Update slate and related packages
This commit is contained in:
parent
9c6a6ca487
commit
a70aba1384
|
@ -11,19 +11,19 @@ exports[`no enzyme tests`] = {
|
|||
"packages/grafana-ui/src/components/Logs/LogRowContextProvider.test.tsx:3786619094": [
|
||||
[0, 17, 13, "RegExp match", "2409514259"]
|
||||
],
|
||||
"packages/grafana-ui/src/components/QueryField/QueryField.test.tsx:375894800": [
|
||||
"packages/grafana-ui/src/components/QueryField/QueryField.test.tsx:2976628669": [
|
||||
[0, 26, 13, "RegExp match", "2409514259"]
|
||||
],
|
||||
"packages/grafana-ui/src/slate-plugins/braces.test.tsx:823049948": [
|
||||
[0, 19, 13, "RegExp match", "2409514259"]
|
||||
],
|
||||
"packages/grafana-ui/src/slate-plugins/braces.test.tsx:4104231341": [
|
||||
"packages/grafana-ui/src/slate-plugins/clear.test.tsx:3927593033": [
|
||||
[0, 19, 13, "RegExp match", "2409514259"]
|
||||
],
|
||||
"packages/grafana-ui/src/slate-plugins/clear.test.tsx:1085648664": [
|
||||
"packages/grafana-ui/src/slate-plugins/runner.test.tsx:1123710822": [
|
||||
[0, 19, 13, "RegExp match", "2409514259"]
|
||||
],
|
||||
"packages/grafana-ui/src/slate-plugins/runner.test.tsx:446043290": [
|
||||
[0, 19, 13, "RegExp match", "2409514259"]
|
||||
],
|
||||
"packages/grafana-ui/src/slate-plugins/suggestions.test.tsx:3654981205": [
|
||||
"packages/grafana-ui/src/slate-plugins/suggestions.test.tsx:2682912140": [
|
||||
[0, 18, 13, "RegExp match", "2409514259"]
|
||||
],
|
||||
"packages/jaeger-ui-components/src/TracePageHeader/SpanGraph/Scrubber.test.js:4256741694": [
|
||||
|
@ -1296,8 +1296,7 @@ exports[`better eslint`] = {
|
|||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "1"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "2"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "3"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "4"]
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "3"]
|
||||
],
|
||||
"packages/grafana-ui/src/components/DataLinks/SelectionReference.ts:5381": [
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"]
|
||||
|
@ -1856,42 +1855,16 @@ exports[`better eslint`] = {
|
|||
],
|
||||
"packages/grafana-ui/src/slate-plugins/braces.ts:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "1"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "2"]
|
||||
[0, 0, 0, "Do not use any type assertions.", "1"]
|
||||
],
|
||||
"packages/grafana-ui/src/slate-plugins/clear.test.tsx:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "2"]
|
||||
],
|
||||
"packages/grafana-ui/src/slate-plugins/clear.ts:5381": [
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"]
|
||||
],
|
||||
"packages/grafana-ui/src/slate-plugins/clipboard.ts:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "1"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "2"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "3"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "4"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "5"]
|
||||
],
|
||||
"packages/grafana-ui/src/slate-plugins/indentation.ts:5381": [
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"]
|
||||
],
|
||||
"packages/grafana-ui/src/slate-plugins/newline.ts:5381": [
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"]
|
||||
],
|
||||
"packages/grafana-ui/src/slate-plugins/runner.test.tsx:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
||||
],
|
||||
"packages/grafana-ui/src/slate-plugins/runner.ts:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "1"]
|
||||
],
|
||||
"packages/grafana-ui/src/slate-plugins/selection_shortcuts.ts:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "1"]
|
||||
],
|
||||
"packages/grafana-ui/src/slate-plugins/slate-prism/index.ts:5381": [
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "1"],
|
||||
|
@ -1913,8 +1886,7 @@ exports[`better eslint`] = {
|
|||
"packages/grafana-ui/src/slate-plugins/suggestions.tsx:5381": [
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "1"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "2"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "3"]
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "2"]
|
||||
],
|
||||
"packages/grafana-ui/src/themes/ThemeContext.tsx:5381": [
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"],
|
||||
|
|
|
@ -4,12 +4,10 @@
|
|||
],
|
||||
"enabledManagers": ["npm"],
|
||||
"ignoreDeps": [
|
||||
"@grafana/slate-react", // should be updated when the `slate` package is updated
|
||||
"@types/systemjs",
|
||||
"@types/d3-force", // we should bump this once we move to esm modules
|
||||
"@types/d3-interpolate", // we should bump this once we move to esm modules
|
||||
"@types/d3-scale-chromatic", // we should bump this once we move to esm modules
|
||||
"@types/grafana__slate-react", // should be updated when the `slate` package is updated
|
||||
"@types/react-icons", // jaeger-ui-components is being refactored to use @grafana/ui icons instead
|
||||
"commander", // we are planning to remove this, so no need to update it
|
||||
"d3",
|
||||
|
@ -25,8 +23,6 @@
|
|||
"react-icons", // jaeger-ui-components is being refactored to use @grafana/ui icons instead
|
||||
"react-redux", // react-beautiful-dnd depends on react-redux 7.x, we need to update that one first
|
||||
"react-router-dom", // we should bump this together with history
|
||||
"slate",
|
||||
"slate-plain-serializer",
|
||||
"systemjs",
|
||||
"copy-webpack-plugin", // try to upgrade with newer yarn release. Not working with 3.1.1
|
||||
"ts-loader", // we should remove ts-loader and use babel-loader instead
|
||||
|
|
|
@ -119,6 +119,7 @@ pkg/cmd/grafana-server/__debug_bin
|
|||
|
||||
/scripts/build/release_publisher/release_publisher
|
||||
*.patch
|
||||
!.yarn/patches/*.patch
|
||||
|
||||
# Ignoring frontend packages specifics
|
||||
/packages/**/dist
|
||||
|
|
File diff suppressed because one or more lines are too long
55
.yarnrc.yml
55
.yarnrc.yml
|
@ -3,40 +3,37 @@ enableTelemetry: false
|
|||
nodeLinker: pnp
|
||||
|
||||
packageExtensions:
|
||||
"@grafana/slate-react@0.22.10-grafana":
|
||||
peerDependencies:
|
||||
slate-react: ">=0.22.0"
|
||||
"@mdx-js/loader@1.6.22":
|
||||
'@mdx-js/loader@1.6.22':
|
||||
peerDependencies:
|
||||
react: 17.0.1
|
||||
"@storybook/addon-docs@6.4.21":
|
||||
'@storybook/addon-docs@6.4.21':
|
||||
peerDependencies:
|
||||
"@storybook/manager-webpack5": 6.4.21
|
||||
"@storybook/addon-essentials@6.4.21":
|
||||
'@storybook/manager-webpack5': 6.4.21
|
||||
'@storybook/addon-essentials@6.4.21':
|
||||
peerDependencies:
|
||||
"@storybook/components": 6.4.21
|
||||
"@storybook/core-events": 6.4.21
|
||||
"@storybook/manager-webpack5": 6.4.21
|
||||
"@storybook/theming": 6.4.21
|
||||
"@storybook/core-server@6.4.21":
|
||||
'@storybook/components': 6.4.21
|
||||
'@storybook/core-events': 6.4.21
|
||||
'@storybook/manager-webpack5': 6.4.21
|
||||
'@storybook/theming': 6.4.21
|
||||
'@storybook/core-server@6.4.21':
|
||||
peerDependencies:
|
||||
"@babel/core": ^7.0.0
|
||||
"@storybook/core@6.4.21":
|
||||
'@babel/core': ^7.0.0
|
||||
'@storybook/core@6.4.21':
|
||||
peerDependencies:
|
||||
"@babel/core": ^7.0.0
|
||||
"@storybook/manager-webpack5": 6.4.21
|
||||
"@storybook/csf-tools@6.4.21":
|
||||
'@babel/core': ^7.0.0
|
||||
'@storybook/manager-webpack5': 6.4.21
|
||||
'@storybook/csf-tools@6.4.21':
|
||||
peerDependencies:
|
||||
"@babel/core": ^7.0.0
|
||||
"@storybook/react@6.4.21":
|
||||
'@babel/core': ^7.0.0
|
||||
'@storybook/react@6.4.21':
|
||||
peerDependencies:
|
||||
"@storybook/manager-webpack5": 6.4.21
|
||||
'@storybook/manager-webpack5': 6.4.21
|
||||
doctrine@3.0.0:
|
||||
dependencies:
|
||||
assert: 2.0.0
|
||||
moveable@0.30.0:
|
||||
dependencies:
|
||||
"@daybrush/utils": 1.7.0
|
||||
'@daybrush/utils': 1.7.0
|
||||
framework-utils: ^1.1.0
|
||||
rc-time-picker@3.7.3:
|
||||
peerDependencies:
|
||||
|
@ -51,9 +48,9 @@ packageExtensions:
|
|||
react-simple-compat: 1.2.2
|
||||
react-compat-moveable@0.18.0:
|
||||
dependencies:
|
||||
"@egjs/agent": ^2.2.1
|
||||
"@egjs/children-differ": ^1.0.1
|
||||
"@scena/matrix": 1.1.1
|
||||
'@egjs/agent': ^2.2.1
|
||||
'@egjs/children-differ': ^1.0.1
|
||||
'@scena/matrix': 1.1.1
|
||||
css-to-mat: ^1.0.3
|
||||
gesto: ^1.9.0
|
||||
overlap-area: ^1.0.0
|
||||
|
@ -65,20 +62,20 @@ packageExtensions:
|
|||
webpack: 4.41.5
|
||||
react-icons@2.2.7:
|
||||
peerDependencies:
|
||||
prop-types: "*"
|
||||
prop-types: '*'
|
||||
react-resizable@3.0.4:
|
||||
peerDependencies:
|
||||
react-dom: 17.0.1
|
||||
"@npmcli/run-script@4.1.3":
|
||||
'@npmcli/run-script@4.1.3':
|
||||
dependencies:
|
||||
which: ^2.0.2
|
||||
|
||||
plugins:
|
||||
- path: .yarn/plugins/@yarnpkg/plugin-typescript.cjs
|
||||
spec: "@yarnpkg/plugin-typescript"
|
||||
spec: '@yarnpkg/plugin-typescript'
|
||||
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
|
||||
spec: "@yarnpkg/plugin-interactive-tools"
|
||||
spec: '@yarnpkg/plugin-interactive-tools'
|
||||
- path: .yarn/plugins/@yarnpkg/plugin-outdated.cjs
|
||||
spec: "https://mskelton.dev/yarn-outdated/v2"
|
||||
spec: 'https://mskelton.dev/yarn-outdated/v2'
|
||||
|
||||
yarnPath: .yarn/releases/yarn-3.2.2.cjs
|
||||
|
|
15
package.json
15
package.json
|
@ -124,7 +124,6 @@
|
|||
"@types/eslint": "8.4.5",
|
||||
"@types/file-saver": "2.0.5",
|
||||
"@types/google.analytics": "^0.0.42",
|
||||
"@types/grafana__slate-react": "npm:@types/slate-react@0.22.5",
|
||||
"@types/history": "4.7.11",
|
||||
"@types/hoist-non-react-statics": "3.3.1",
|
||||
"@types/jest": "28.1.6",
|
||||
|
@ -158,8 +157,9 @@
|
|||
"@types/redux-mock-store": "1.0.3",
|
||||
"@types/reselect": "2.2.0",
|
||||
"@types/semver": "7.3.10",
|
||||
"@types/slate": "0.47.2",
|
||||
"@types/slate": "0.47.9",
|
||||
"@types/slate-plain-serializer": "0.7.2",
|
||||
"@types/slate-react": "0.22.9",
|
||||
"@types/testing-library__jest-dom": "5.14.5",
|
||||
"@types/testing-library__react-hooks": "^3.2.0",
|
||||
"@types/tinycolor2": "1.4.3",
|
||||
|
@ -257,7 +257,6 @@
|
|||
"@grafana/lezer-logql": "0.0.18",
|
||||
"@grafana/runtime": "workspace:*",
|
||||
"@grafana/schema": "workspace:*",
|
||||
"@grafana/slate-react": "0.22.10-grafana",
|
||||
"@grafana/ui": "workspace:*",
|
||||
"@jaegertracing/jaeger-ui-components": "workspace:*",
|
||||
"@kusto/monaco-kusto": "5.1.8",
|
||||
|
@ -387,8 +386,9 @@
|
|||
"sass": "link:./public/sass",
|
||||
"selecto": "1.19.1",
|
||||
"semver": "7.3.7",
|
||||
"slate": "0.47.8",
|
||||
"slate-plain-serializer": "0.7.10",
|
||||
"slate": "0.47.9",
|
||||
"slate-plain-serializer": "0.7.11",
|
||||
"slate-react": "0.22.10",
|
||||
"sql-formatter-plus": "^1.3.6",
|
||||
"symbol-observable": "4.0.0",
|
||||
"test": "link:./public/test",
|
||||
|
@ -403,12 +403,13 @@
|
|||
},
|
||||
"resolutions": {
|
||||
"underscore": "1.13.4",
|
||||
"@types/slate": "0.47.2",
|
||||
"@types/slate": "0.47.9",
|
||||
"@rushstack/node-core-library": "3.49.0",
|
||||
"@rushstack/rig-package": "0.3.13",
|
||||
"@rushstack/ts-command-line": "4.12.1",
|
||||
"@storybook/react/webpack": "5.74.0",
|
||||
"node-fetch": "2.6.7"
|
||||
"node-fetch": "2.6.7",
|
||||
"slate-dev-environment@^0.2.2": "patch:slate-dev-environment@npm:0.2.5#.yarn/patches/slate-dev-environment-npm-0.2.5-9aeb7da7b5.patch"
|
||||
},
|
||||
"workspaces": {
|
||||
"packages": [
|
||||
|
|
|
@ -174,7 +174,7 @@ const getBaseWebpackConfig: WebpackConfigurationGetter = async (options) => {
|
|||
'@emotion/css',
|
||||
'prismjs',
|
||||
'slate-plain-serializer',
|
||||
'@grafana/slate-react',
|
||||
'slate-react',
|
||||
'react',
|
||||
'react-dom',
|
||||
'react-redux',
|
||||
|
|
|
@ -48,7 +48,6 @@
|
|||
"@grafana/data": "9.2.0-pre",
|
||||
"@grafana/e2e-selectors": "9.2.0-pre",
|
||||
"@grafana/schema": "9.2.0-pre",
|
||||
"@grafana/slate-react": "0.22.10-grafana",
|
||||
"@monaco-editor/react": "4.4.5",
|
||||
"@popperjs/core": "2.11.5",
|
||||
"@react-aria/button": "3.6.1",
|
||||
|
@ -97,8 +96,9 @@
|
|||
"react-use": "17.4.0",
|
||||
"react-window": "1.8.7",
|
||||
"rxjs": "7.5.6",
|
||||
"slate": "0.47.8",
|
||||
"slate-plain-serializer": "0.7.10",
|
||||
"slate": "0.47.9",
|
||||
"slate-plain-serializer": "0.7.11",
|
||||
"slate-react": "0.22.10",
|
||||
"tinycolor2": "1.4.2",
|
||||
"tslib": "2.4.0",
|
||||
"uplot": "1.6.22",
|
||||
|
@ -135,7 +135,6 @@
|
|||
"@types/d3": "7.4.0",
|
||||
"@types/enzyme": "3.10.12",
|
||||
"@types/enzyme-adapter-react-16": "1.0.6",
|
||||
"@types/grafana__slate-react": "npm:@types/slate-react@0.22.5",
|
||||
"@types/hoist-non-react-statics": "3.3.1",
|
||||
"@types/is-hotkey": "0.1.7",
|
||||
"@types/jest": "28.1.6",
|
||||
|
@ -155,8 +154,9 @@
|
|||
"@types/react-test-renderer": "17.0.1",
|
||||
"@types/react-transition-group": "4.4.5",
|
||||
"@types/react-window": "1.8.5",
|
||||
"@types/slate": "0.47.2",
|
||||
"@types/slate": "0.47.9",
|
||||
"@types/slate-plain-serializer": "0.7.2",
|
||||
"@types/slate-react": "0.22.9",
|
||||
"@types/testing-library__jest-dom": "5.14.5",
|
||||
"@types/testing-library__react-hooks": "^3.2.0",
|
||||
"@types/tinycolor2": "1.4.3",
|
||||
|
|
|
@ -5,9 +5,9 @@ import { Popper as ReactPopper } from 'react-popper';
|
|||
import usePrevious from 'react-use/lib/usePrevious';
|
||||
import { Value } from 'slate';
|
||||
import Plain from 'slate-plain-serializer';
|
||||
import { Editor } from 'slate-react';
|
||||
|
||||
import { DataLinkBuiltInVars, GrafanaTheme2, VariableOrigin, VariableSuggestion } from '@grafana/data';
|
||||
import { Editor } from '@grafana/slate-react';
|
||||
|
||||
import { makeValue } from '../../index';
|
||||
import { SlatePrism } from '../../slate-plugins';
|
||||
|
@ -95,7 +95,7 @@ export const DataLinkInput: React.FC<DataLinkInputProps> = memo(
|
|||
// SelectionReference is used to position the variables suggestion relatively to current DOM selection
|
||||
const selectionRef = useMemo(() => new SelectionReference(), []);
|
||||
|
||||
const onKeyDown = React.useCallback((event: KeyboardEvent, next: () => any) => {
|
||||
const onKeyDown = React.useCallback((event: React.KeyboardEvent, next: () => any) => {
|
||||
if (!stateRef.current.showingSuggestions) {
|
||||
if (event.key === '=' || event.key === '$' || (event.keyCode === 32 && event.ctrlKey)) {
|
||||
return setShowingSuggestions(true);
|
||||
|
@ -208,7 +208,7 @@ export const DataLinkInput: React.FC<DataLinkInputProps> = memo(
|
|||
placeholder={placeholder}
|
||||
value={stateRef.current.linkUrl}
|
||||
onChange={onUrlChange}
|
||||
onKeyDown={(event, _editor, next) => onKeyDown(event as KeyboardEvent, next)}
|
||||
onKeyDown={(event, _editor, next) => onKeyDown(event, next)}
|
||||
plugins={plugins}
|
||||
className={cx(
|
||||
styles.editor,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { shallow } from 'enzyme';
|
||||
import { mount, shallow } from 'enzyme';
|
||||
import React from 'react';
|
||||
import { Editor } from 'slate';
|
||||
import { Editor } from 'slate-react';
|
||||
|
||||
import { createTheme } from '@grafana/data';
|
||||
|
||||
|
@ -30,7 +30,7 @@ describe('<QueryField />', () => {
|
|||
|
||||
it('should execute query on blur', () => {
|
||||
const onRun = jest.fn();
|
||||
const wrapper = shallow(
|
||||
const wrapper = mount(
|
||||
<UnThemedQueryField
|
||||
theme={createTheme()}
|
||||
query="my query"
|
||||
|
@ -40,8 +40,9 @@ describe('<QueryField />', () => {
|
|||
/>
|
||||
);
|
||||
const field = wrapper.instance() as UnThemedQueryField;
|
||||
const ed = wrapper.find(Editor).instance() as Editor;
|
||||
expect(onRun.mock.calls.length).toBe(0);
|
||||
field.handleBlur(new Event('bogus'), new Editor({}), () => {});
|
||||
field.handleBlur(undefined, ed, () => {});
|
||||
expect(onRun.mock.calls.length).toBe(1);
|
||||
});
|
||||
|
||||
|
@ -65,7 +66,7 @@ describe('<QueryField />', () => {
|
|||
it('should run custom on blur, but not necessarily execute query', () => {
|
||||
const onBlur = jest.fn();
|
||||
const onRun = jest.fn();
|
||||
const wrapper = shallow(
|
||||
const wrapper = mount(
|
||||
<UnThemedQueryField
|
||||
theme={createTheme()}
|
||||
query="my query"
|
||||
|
@ -76,9 +77,10 @@ describe('<QueryField />', () => {
|
|||
/>
|
||||
);
|
||||
const field = wrapper.instance() as UnThemedQueryField;
|
||||
const ed = wrapper.find(Editor).instance() as Editor;
|
||||
expect(onBlur.mock.calls.length).toBe(0);
|
||||
expect(onRun.mock.calls.length).toBe(0);
|
||||
field.handleBlur(new Event('bogus'), new Editor({}), () => {});
|
||||
field.handleBlur(undefined, ed, () => {});
|
||||
expect(onBlur.mock.calls.length).toBe(1);
|
||||
expect(onRun.mock.calls.length).toBe(0);
|
||||
});
|
||||
|
|
|
@ -2,12 +2,12 @@ import { css, cx } from '@emotion/css';
|
|||
import classnames from 'classnames';
|
||||
import { debounce } from 'lodash';
|
||||
import React, { Context, PureComponent } from 'react';
|
||||
import { Value, Editor as CoreEditor } from 'slate';
|
||||
import { Value } from 'slate';
|
||||
import Plain from 'slate-plain-serializer';
|
||||
import { Editor, Plugin } from 'slate-react';
|
||||
|
||||
import { GrafanaTheme2 } from '@grafana/data';
|
||||
import { selectors } from '@grafana/e2e-selectors';
|
||||
import { Editor, Plugin } from '@grafana/slate-react';
|
||||
|
||||
import {
|
||||
makeValue,
|
||||
|
@ -42,7 +42,7 @@ export interface QueryFieldProps extends Themeable2 {
|
|||
onBlur?: () => void;
|
||||
onChange?: (value: string) => void;
|
||||
onRichValueChange?: (value: Value) => void;
|
||||
onClick?: (event: Event, editor: CoreEditor, next: () => any) => any;
|
||||
onClick?: (event: Event | React.MouseEvent, editor: Editor, next: () => any) => any;
|
||||
onTypeahead?: (typeahead: TypeaheadInput) => Promise<TypeaheadOutput>;
|
||||
onWillApplySuggestion?: (suggestion: string, state: SuggestionsState) => string;
|
||||
placeholder?: string;
|
||||
|
@ -67,7 +67,7 @@ export interface QueryFieldState {
|
|||
* Implement props.onTypeahead to use suggestions, see PromQueryField.tsx as an example.
|
||||
*/
|
||||
export class UnThemedQueryField extends PureComponent<QueryFieldProps, QueryFieldState> {
|
||||
plugins: Plugin[];
|
||||
plugins: Array<Plugin<Editor>>;
|
||||
runOnChangeDebounced: Function;
|
||||
lastExecutedValue: Value | null = null;
|
||||
mounted = false;
|
||||
|
@ -185,7 +185,7 @@ export class UnThemedQueryField extends PureComponent<QueryFieldProps, QueryFiel
|
|||
/**
|
||||
* We need to handle blur events here mainly because of dashboard panels which expect to have query executed on blur.
|
||||
*/
|
||||
handleBlur = (event: Event, editor: CoreEditor, next: Function) => {
|
||||
handleBlur = (_: React.FocusEvent | undefined, editor: Editor, next: Function) => {
|
||||
const { onBlur } = this.props;
|
||||
|
||||
if (onBlur) {
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
import { shallow } from 'enzyme';
|
||||
import React from 'react';
|
||||
import Plain from 'slate-plain-serializer';
|
||||
|
||||
import { Editor } from '@grafana/slate-react';
|
||||
import { Editor } from 'slate-react';
|
||||
|
||||
import { BracesPlugin } from './braces';
|
||||
|
||||
|
@ -14,7 +13,7 @@ describe('braces', () => {
|
|||
const value = Plain.deserialize('');
|
||||
const editor = shallow<Editor>(<Editor value={value} />);
|
||||
const event = new window.KeyboardEvent('keydown', { key: '(' });
|
||||
expect(handler(event as Event, editor.instance() as any, nextMock)).toBeTruthy();
|
||||
expect(handler(event as any, editor.instance(), nextMock)).toBeTruthy();
|
||||
expect(Plain.serialize(editor.instance().value)).toEqual('()');
|
||||
});
|
||||
|
||||
|
@ -22,7 +21,8 @@ describe('braces', () => {
|
|||
const value = Plain.deserialize('time()');
|
||||
const editor = shallow<Editor>(<Editor value={value} />);
|
||||
const event = new window.KeyboardEvent('keydown', { key: 'Backspace' });
|
||||
handler(event as Event, editor.instance().moveForward(5) as any, nextMock);
|
||||
editor.instance().moveForward(5);
|
||||
handler(event as any, editor.instance(), nextMock);
|
||||
expect(Plain.serialize(editor.instance().value)).toEqual('time');
|
||||
});
|
||||
|
||||
|
@ -30,7 +30,8 @@ describe('braces', () => {
|
|||
const value = Plain.deserialize('time(value)');
|
||||
const editor = shallow<Editor>(<Editor value={value} />);
|
||||
const event = new window.KeyboardEvent('keydown', { key: 'Backspace' });
|
||||
const handled = handler(event as Event, editor.instance().moveForward(5) as any, nextMock);
|
||||
editor.instance().moveForward(5);
|
||||
const handled = handler(event as any, editor.instance(), nextMock);
|
||||
expect(handled).toBeFalsy();
|
||||
});
|
||||
|
||||
|
@ -38,9 +39,9 @@ describe('braces', () => {
|
|||
const value = Plain.deserialize('');
|
||||
const editor = shallow<Editor>(<Editor value={value} />);
|
||||
const opening = new window.KeyboardEvent('keydown', { key: '(' });
|
||||
expect(handler(opening as Event, editor.instance() as any, nextMock)).toBeTruthy();
|
||||
expect(handler(opening as any, editor.instance(), nextMock)).toBeTruthy();
|
||||
const closing = new window.KeyboardEvent('keydown', { key: ')' });
|
||||
expect(handler(closing as Event, editor.instance() as any, nextMock)).toBeTruthy();
|
||||
expect(handler(closing as any, editor.instance(), nextMock)).toBeTruthy();
|
||||
expect(Plain.serialize(editor.instance().value)).toEqual('()');
|
||||
});
|
||||
|
||||
|
@ -48,9 +49,10 @@ describe('braces', () => {
|
|||
const value = Plain.deserialize('');
|
||||
const editor = shallow<Editor>(<Editor value={value} />);
|
||||
const event1 = new window.KeyboardEvent('keydown', { key: ')' });
|
||||
expect(handler(event1 as Event, editor.instance() as any, nextMock)).toBeFalsy();
|
||||
expect(handler(event1 as any, editor.instance(), nextMock)).toBeFalsy();
|
||||
const event2 = new window.KeyboardEvent('keydown', { key: ')' });
|
||||
expect(handler(event2 as Event, editor.instance().moveBackward(1) as any, nextMock)).toBeFalsy();
|
||||
editor.instance().moveBackward(1);
|
||||
expect(handler(event2 as any, editor.instance(), nextMock)).toBeFalsy();
|
||||
expect(Plain.serialize(editor.instance().value)).toEqual('))');
|
||||
});
|
||||
});
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
import { Editor as CoreEditor, Annotation } from 'slate';
|
||||
import { Annotation } from 'slate';
|
||||
import { Plugin } from 'slate-react';
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
|
||||
import { Plugin } from '@grafana/slate-react';
|
||||
|
||||
const BRACES: any = {
|
||||
'[': ']',
|
||||
'{': '}',
|
||||
|
@ -13,11 +12,10 @@ const MATCH_MARK = 'brace_match';
|
|||
|
||||
export function BracesPlugin(): Plugin {
|
||||
return {
|
||||
onKeyDown(event: Event, editor: CoreEditor, next: Function) {
|
||||
const keyEvent = event as KeyboardEvent;
|
||||
onKeyDown(event, editor, next) {
|
||||
const { value } = editor;
|
||||
|
||||
switch (keyEvent.key) {
|
||||
switch (event.key) {
|
||||
case '(':
|
||||
case '{':
|
||||
case '[': {
|
||||
|
@ -30,10 +28,10 @@ export function BracesPlugin(): Plugin {
|
|||
|
||||
// If text is selected, wrap selected text in parens
|
||||
if (value.selection.isExpanded) {
|
||||
keyEvent.preventDefault();
|
||||
event.preventDefault();
|
||||
editor
|
||||
.insertTextByKey(startKey, startOffset, keyEvent.key)
|
||||
.insertTextByKey(endKey, endOffset + 1, BRACES[keyEvent.key])
|
||||
.insertTextByKey(startKey, startOffset, event.key)
|
||||
.insertTextByKey(endKey, endOffset + 1, BRACES[event.key])
|
||||
.moveEndBackward(1);
|
||||
return true;
|
||||
} else if (
|
||||
|
@ -42,8 +40,8 @@ export function BracesPlugin(): Plugin {
|
|||
text[focusOffset] === ' ' ||
|
||||
Object.values(BRACES).includes(text[focusOffset])
|
||||
) {
|
||||
keyEvent.preventDefault();
|
||||
const complement = BRACES[keyEvent.key];
|
||||
event.preventDefault();
|
||||
const complement = BRACES[event.key];
|
||||
const matchAnnotation = {
|
||||
key: `${MATCH_MARK}-${uuidv4()}`,
|
||||
type: `${MATCH_MARK}-${complement}`,
|
||||
|
@ -59,7 +57,7 @@ export function BracesPlugin(): Plugin {
|
|||
},
|
||||
object: 'annotation',
|
||||
} as Annotation;
|
||||
editor.insertText(keyEvent.key).insertText(complement).addAnnotation(matchAnnotation).moveBackward(1);
|
||||
editor.insertText(event.key).insertText(complement).addAnnotation(matchAnnotation).moveBackward(1);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -73,13 +71,13 @@ export function BracesPlugin(): Plugin {
|
|||
const offset = value.selection.anchor.offset;
|
||||
const nextChar = text[offset];
|
||||
// Handle closing brace when it's already the next character
|
||||
const complement = keyEvent.key;
|
||||
const complement = event.key;
|
||||
const annotationType = `${MATCH_MARK}-${complement}`;
|
||||
const annotation = value.annotations.find(
|
||||
(a) => a?.type === annotationType && a.anchor.key === value.anchorText.key
|
||||
);
|
||||
if (annotation && nextChar === complement && !value.selection.isExpanded) {
|
||||
keyEvent.preventDefault();
|
||||
event.preventDefault();
|
||||
editor.moveFocusForward(1).removeAnnotation(annotation).moveAnchorForward(1);
|
||||
return true;
|
||||
}
|
||||
|
@ -92,7 +90,7 @@ export function BracesPlugin(): Plugin {
|
|||
const previousChar = text[offset - 1];
|
||||
const nextChar = text[offset];
|
||||
if (BRACES[previousChar] && BRACES[previousChar] === nextChar) {
|
||||
keyEvent.preventDefault();
|
||||
event.preventDefault();
|
||||
// Remove closing brace if directly following
|
||||
editor.deleteBackward(1).deleteForward(1).focus();
|
||||
return true;
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
import { shallow } from 'enzyme';
|
||||
import React from 'react';
|
||||
import Plain from 'slate-plain-serializer';
|
||||
|
||||
import { Editor } from '@grafana/slate-react';
|
||||
import { Editor } from 'slate-react';
|
||||
|
||||
import { ClearPlugin } from './clear';
|
||||
|
||||
|
@ -16,7 +15,7 @@ describe('clear', () => {
|
|||
key: 'k',
|
||||
ctrlKey: true,
|
||||
});
|
||||
handler(event as Event, editor.instance() as any, () => {});
|
||||
handler(event as any, editor.instance(), () => {});
|
||||
expect(Plain.serialize(editor.instance().value)).toEqual('');
|
||||
});
|
||||
|
||||
|
@ -27,7 +26,7 @@ describe('clear', () => {
|
|||
key: 'k',
|
||||
ctrlKey: true,
|
||||
});
|
||||
handler(event as Event, editor.instance() as any, () => {});
|
||||
handler(event as any, editor.instance(), () => {});
|
||||
expect(Plain.serialize(editor.instance().value)).toEqual('');
|
||||
});
|
||||
|
||||
|
@ -38,7 +37,8 @@ describe('clear', () => {
|
|||
key: 'k',
|
||||
ctrlKey: true,
|
||||
});
|
||||
handler(event as Event, editor.instance().moveForward(4) as any, () => {});
|
||||
editor.instance().moveForward(4);
|
||||
handler(event as any, editor.instance(), () => {});
|
||||
expect(Plain.serialize(editor.instance().value)).toEqual('foo ');
|
||||
});
|
||||
});
|
||||
|
|
|
@ -1,20 +1,17 @@
|
|||
import { Editor as CoreEditor } from 'slate';
|
||||
|
||||
import { Plugin } from '@grafana/slate-react';
|
||||
import { Plugin } from 'slate-react';
|
||||
|
||||
// Clears the rest of the line after the caret
|
||||
export function ClearPlugin(): Plugin {
|
||||
return {
|
||||
onKeyDown(event: Event, editor: CoreEditor, next: Function) {
|
||||
const keyEvent = event as KeyboardEvent;
|
||||
onKeyDown(event, editor, next) {
|
||||
const value = editor.value;
|
||||
|
||||
if (value.selection.isExpanded) {
|
||||
return next();
|
||||
}
|
||||
|
||||
if (keyEvent.key === 'k' && keyEvent.ctrlKey) {
|
||||
keyEvent.preventDefault();
|
||||
if (event.key === 'k' && event.ctrlKey) {
|
||||
event.preventDefault();
|
||||
const text = value.anchorText.text;
|
||||
const offset = value.selection.anchor.offset;
|
||||
const length = text.length;
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
import { Editor as CoreEditor } from 'slate';
|
||||
|
||||
import { Plugin } from '@grafana/slate-react';
|
||||
import { Plugin } from 'slate-react';
|
||||
|
||||
const getCopiedText = (textBlocks: string[], startOffset: number, endOffset: number) => {
|
||||
if (!textBlocks.length) {
|
||||
|
@ -18,9 +16,8 @@ const removeBom = (str: string | undefined): string | undefined => {
|
|||
|
||||
export function ClipboardPlugin(): Plugin {
|
||||
const clipboardPlugin: Plugin = {
|
||||
onCopy(event: Event, editor: CoreEditor, next: () => any) {
|
||||
const clipEvent = event as ClipboardEvent;
|
||||
clipEvent.preventDefault();
|
||||
onCopy(event, editor, next) {
|
||||
event.preventDefault();
|
||||
|
||||
const { document, selection } = editor.value;
|
||||
const {
|
||||
|
@ -33,18 +30,17 @@ export function ClipboardPlugin(): Plugin {
|
|||
.map((block) => block.text);
|
||||
|
||||
const copiedText = removeBom(getCopiedText(selectedBlocks, startOffset, endOffset));
|
||||
if (copiedText && clipEvent.clipboardData) {
|
||||
clipEvent.clipboardData.setData('Text', copiedText);
|
||||
if (copiedText && event.clipboardData) {
|
||||
event.clipboardData.setData('Text', copiedText);
|
||||
}
|
||||
|
||||
return true;
|
||||
},
|
||||
|
||||
onPaste(event: Event, editor: CoreEditor, next: () => any) {
|
||||
const clipEvent = event as ClipboardEvent;
|
||||
clipEvent.preventDefault();
|
||||
if (clipEvent.clipboardData) {
|
||||
const pastedValue = removeBom(clipEvent.clipboardData.getData('Text'));
|
||||
onPaste(event, editor, next) {
|
||||
event.preventDefault();
|
||||
if (event.clipboardData) {
|
||||
const pastedValue = removeBom(event.clipboardData.getData('Text'));
|
||||
const lines = pastedValue?.split('\n');
|
||||
|
||||
if (lines && lines.length) {
|
||||
|
@ -61,9 +57,8 @@ export function ClipboardPlugin(): Plugin {
|
|||
|
||||
return {
|
||||
...clipboardPlugin,
|
||||
onCut(event: Event, editor: CoreEditor, next: () => any) {
|
||||
const clipEvent = event as ClipboardEvent;
|
||||
clipboardPlugin.onCopy!(clipEvent, editor, next);
|
||||
onCut(event, editor, next) {
|
||||
clipboardPlugin.onCopy!(event, editor, next);
|
||||
editor.deleteAtRange(editor.value.selection);
|
||||
|
||||
return true;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { isKeyHotkey } from 'is-hotkey';
|
||||
import { RangeJSON, Range as SlateRange, Editor as CoreEditor } from 'slate';
|
||||
|
||||
import { Plugin } from '@grafana/slate-react';
|
||||
import React from 'react';
|
||||
import { RangeJSON, Range as SlateRange } from 'slate';
|
||||
import { Editor, Plugin } from 'slate-react';
|
||||
|
||||
const isIndentLeftHotkey = isKeyHotkey('mod+[');
|
||||
const isShiftTabHotkey = isKeyHotkey('shift+tab');
|
||||
|
@ -9,7 +9,7 @@ const isIndentRightHotkey = isKeyHotkey('mod+]');
|
|||
|
||||
const SLATE_TAB = ' ';
|
||||
|
||||
const handleTabKey = (event: KeyboardEvent, editor: CoreEditor, next: Function): void => {
|
||||
const handleTabKey = (event: React.KeyboardEvent<Element>, editor: Editor, next: Function): void => {
|
||||
const {
|
||||
startBlock,
|
||||
endBlock,
|
||||
|
@ -31,7 +31,7 @@ const handleTabKey = (event: KeyboardEvent, editor: CoreEditor, next: Function):
|
|||
}
|
||||
};
|
||||
|
||||
const handleIndent = (editor: CoreEditor, indentDirection: 'left' | 'right') => {
|
||||
const handleIndent = (editor: Editor, indentDirection: 'left' | 'right') => {
|
||||
const curSelection = editor.value.selection;
|
||||
const selectedBlocks = editor.value.document.getLeafBlocksAtRange(curSelection).toArray();
|
||||
|
||||
|
@ -74,17 +74,16 @@ const handleIndent = (editor: CoreEditor, indentDirection: 'left' | 'right') =>
|
|||
// Clears the rest of the line after the caret
|
||||
export function IndentationPlugin(): Plugin {
|
||||
return {
|
||||
onKeyDown(event: Event, editor: CoreEditor, next: Function) {
|
||||
const keyEvent = event as KeyboardEvent;
|
||||
if (isIndentLeftHotkey(keyEvent) || isShiftTabHotkey(keyEvent)) {
|
||||
keyEvent.preventDefault();
|
||||
onKeyDown(event, editor, next) {
|
||||
if (isIndentLeftHotkey(event) || isShiftTabHotkey(event)) {
|
||||
event.preventDefault();
|
||||
handleIndent(editor, 'left');
|
||||
} else if (isIndentRightHotkey(keyEvent)) {
|
||||
keyEvent.preventDefault();
|
||||
} else if (isIndentRightHotkey(event)) {
|
||||
event.preventDefault();
|
||||
handleIndent(editor, 'right');
|
||||
} else if (keyEvent.key === 'Tab') {
|
||||
keyEvent.preventDefault();
|
||||
handleTabKey(keyEvent, editor, next);
|
||||
} else if (event.key === 'Tab') {
|
||||
event.preventDefault();
|
||||
handleTabKey(event, editor, next);
|
||||
} else {
|
||||
return next();
|
||||
}
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
import { Editor as CoreEditor } from 'slate';
|
||||
|
||||
import { Plugin } from '@grafana/slate-react';
|
||||
import { Plugin } from 'slate-react';
|
||||
|
||||
function getIndent(text: string) {
|
||||
let offset = text.length - text.trimLeft().length;
|
||||
|
@ -16,16 +14,15 @@ function getIndent(text: string) {
|
|||
|
||||
export function NewlinePlugin(): Plugin {
|
||||
return {
|
||||
onKeyDown(event: Event, editor: CoreEditor, next: Function) {
|
||||
const keyEvent = event as KeyboardEvent;
|
||||
onKeyDown(event, editor, next) {
|
||||
const value = editor.value;
|
||||
|
||||
if (value.selection.isExpanded) {
|
||||
return next();
|
||||
}
|
||||
|
||||
if (keyEvent.key === 'Enter') {
|
||||
keyEvent.preventDefault();
|
||||
if (event.key === 'Enter') {
|
||||
event.preventDefault();
|
||||
|
||||
const { startBlock } = value;
|
||||
const currentLineText = startBlock.text;
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
import { shallow } from 'enzyme';
|
||||
import React from 'react';
|
||||
import Plain from 'slate-plain-serializer';
|
||||
|
||||
import { Editor } from '@grafana/slate-react';
|
||||
import { Editor } from 'slate-react';
|
||||
|
||||
import { RunnerPlugin } from './runner';
|
||||
|
||||
|
@ -12,10 +11,13 @@ describe('runner', () => {
|
|||
|
||||
it('should execute query when enter with shift is pressed', () => {
|
||||
const value = Plain.deserialize('');
|
||||
const editor = shallow<Editor>(<Editor value={value} />);
|
||||
const editor = shallow(<Editor value={value} />);
|
||||
handler(
|
||||
{ key: 'Enter', shiftKey: true, preventDefault: () => {} } as KeyboardEvent,
|
||||
editor.instance() as any,
|
||||
new window.KeyboardEvent('keydown', {
|
||||
key: 'Enter',
|
||||
shiftKey: true,
|
||||
}) as any,
|
||||
editor.instance() as Editor,
|
||||
() => {}
|
||||
);
|
||||
expect(mockHandler).toBeCalled();
|
||||
|
|
|
@ -1,17 +1,14 @@
|
|||
import { Editor as CoreEditor } from 'slate';
|
||||
import React from 'react';
|
||||
import { Plugin } from 'slate-react';
|
||||
|
||||
import { Plugin } from '@grafana/slate-react';
|
||||
|
||||
export function RunnerPlugin({ handler }: any): Plugin {
|
||||
export function RunnerPlugin({ handler }: { handler?: (e: React.KeyboardEvent) => void }): Plugin {
|
||||
return {
|
||||
onKeyDown(event: Event, editor: CoreEditor, next: Function) {
|
||||
const keyEvent = event as KeyboardEvent;
|
||||
|
||||
onKeyDown(event, editor, next) {
|
||||
// Handle enter
|
||||
if (handler && keyEvent.key === 'Enter' && (keyEvent.shiftKey || keyEvent.ctrlKey)) {
|
||||
if (handler && event.key === 'Enter' && (event.shiftKey || event.ctrlKey)) {
|
||||
// Submit on Enter
|
||||
keyEvent.preventDefault();
|
||||
handler(keyEvent);
|
||||
event.preventDefault();
|
||||
handler(event);
|
||||
return editor;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,17 +1,14 @@
|
|||
import { isKeyHotkey } from 'is-hotkey';
|
||||
import { Editor as CoreEditor } from 'slate';
|
||||
|
||||
import { Plugin } from '@grafana/slate-react';
|
||||
import { Plugin } from 'slate-react';
|
||||
|
||||
const isSelectLineHotkey = isKeyHotkey('mod+l');
|
||||
|
||||
// Clears the rest of the line after the caret
|
||||
export function SelectionShortcutsPlugin(): Plugin {
|
||||
return {
|
||||
onKeyDown(event: Event, editor: CoreEditor, next: () => any) {
|
||||
const keyEvent = event as KeyboardEvent;
|
||||
if (isSelectLineHotkey(keyEvent)) {
|
||||
keyEvent.preventDefault();
|
||||
onKeyDown(event, editor, next) {
|
||||
if (isSelectLineHotkey(event)) {
|
||||
event.preventDefault();
|
||||
const { focusBlock, document } = editor.value;
|
||||
|
||||
editor.moveAnchorToStartOfBlock();
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import Prism, { LanguageMap } from 'prismjs';
|
||||
import { Block, Text, Decoration } from 'slate';
|
||||
|
||||
import { Plugin } from '@grafana/slate-react';
|
||||
import { Plugin } from 'slate-react';
|
||||
|
||||
import TOKEN_MARK from './TOKEN_MARK';
|
||||
import Options, { OptionsFormat } from './options';
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
import { Record } from 'immutable';
|
||||
import React from 'react';
|
||||
import { Mark, Node, Decoration } from 'slate';
|
||||
|
||||
import { Editor } from '@grafana/slate-react';
|
||||
import { Editor } from 'slate-react';
|
||||
|
||||
import TOKEN_MARK from './TOKEN_MARK';
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import { render } from 'enzyme';
|
||||
import _ from 'lodash'; // eslint-disable-line lodash/import-scope
|
||||
|
||||
import { Plugin as SlatePlugin } from '@grafana/slate-react';
|
||||
import { Plugin as SlatePlugin } from 'slate-react';
|
||||
|
||||
import { CompletionItemGroup, SuggestionsState } from '../types';
|
||||
import { SearchFunctionType } from '../utils';
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
import { debounce, sortBy } from 'lodash';
|
||||
import React from 'react';
|
||||
import { Editor as CoreEditor } from 'slate';
|
||||
|
||||
import { Plugin as SlatePlugin } from '@grafana/slate-react';
|
||||
import { Editor, Plugin as SlatePlugin } from 'slate-react';
|
||||
|
||||
import { Typeahead } from '../components/Typeahead/Typeahead';
|
||||
import { CompletionItem, SuggestionsState, TypeaheadInput, TypeaheadOutput } from '../types';
|
||||
|
@ -15,8 +13,8 @@ export const TYPEAHEAD_DEBOUNCE = 250;
|
|||
|
||||
// Commands added to the editor by this plugin.
|
||||
interface SuggestionsPluginCommands {
|
||||
selectSuggestion: (suggestion: CompletionItem) => CoreEditor;
|
||||
applyTypeahead: (suggestion: CompletionItem) => CoreEditor;
|
||||
selectSuggestion: (suggestion: CompletionItem) => Editor;
|
||||
applyTypeahead: (suggestion: CompletionItem) => Editor;
|
||||
}
|
||||
|
||||
export function SuggestionsPlugin({
|
||||
|
@ -65,16 +63,15 @@ export function SuggestionsPlugin({
|
|||
return next();
|
||||
},
|
||||
|
||||
onKeyDown: (event: Event, editor, next) => {
|
||||
const keyEvent = event as KeyboardEvent;
|
||||
onKeyDown: (event, editor, next) => {
|
||||
const currentSuggestions = state.groupedItems;
|
||||
|
||||
const hasSuggestions = currentSuggestions.length;
|
||||
|
||||
switch (keyEvent.key) {
|
||||
switch (event.key) {
|
||||
case 'Escape': {
|
||||
if (hasSuggestions) {
|
||||
keyEvent.preventDefault();
|
||||
event.preventDefault();
|
||||
|
||||
state = {
|
||||
...state,
|
||||
|
@ -91,16 +88,16 @@ export function SuggestionsPlugin({
|
|||
case 'ArrowDown':
|
||||
case 'ArrowUp':
|
||||
if (hasSuggestions) {
|
||||
keyEvent.preventDefault();
|
||||
typeaheadRef.moveMenuIndex(keyEvent.key === 'ArrowDown' ? 1 : -1);
|
||||
event.preventDefault();
|
||||
typeaheadRef.moveMenuIndex(event.key === 'ArrowDown' ? 1 : -1);
|
||||
return;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 'Enter': {
|
||||
if (!(keyEvent.shiftKey || keyEvent.ctrlKey) && hasSuggestions) {
|
||||
keyEvent.preventDefault();
|
||||
if (!(event.shiftKey || event.ctrlKey) && hasSuggestions) {
|
||||
event.preventDefault();
|
||||
return typeaheadRef.insertSuggestion();
|
||||
}
|
||||
|
||||
|
@ -109,7 +106,7 @@ export function SuggestionsPlugin({
|
|||
|
||||
case 'Tab': {
|
||||
if (hasSuggestions) {
|
||||
keyEvent.preventDefault();
|
||||
event.preventDefault();
|
||||
return typeaheadRef.insertSuggestion();
|
||||
}
|
||||
|
||||
|
@ -118,7 +115,7 @@ export function SuggestionsPlugin({
|
|||
|
||||
default: {
|
||||
// Don't react on meta keys
|
||||
if (keyEvent.key.length === 1) {
|
||||
if (event.key.length === 1) {
|
||||
handleTypeaheadDebounced(editor, setState, onTypeahead, cleanText);
|
||||
}
|
||||
break;
|
||||
|
@ -129,7 +126,7 @@ export function SuggestionsPlugin({
|
|||
},
|
||||
|
||||
commands: {
|
||||
selectSuggestion: (editor: CoreEditor, suggestion: CompletionItem): CoreEditor => {
|
||||
selectSuggestion: (editor, suggestion: CompletionItem): Editor => {
|
||||
const suggestions = state.groupedItems;
|
||||
if (!suggestions || !suggestions.length) {
|
||||
return editor;
|
||||
|
@ -141,7 +138,7 @@ export function SuggestionsPlugin({
|
|||
return ed;
|
||||
},
|
||||
|
||||
applyTypeahead: (editor: CoreEditor, suggestion: CompletionItem): CoreEditor => {
|
||||
applyTypeahead: (editor, suggestion: CompletionItem) => {
|
||||
let suggestionText = suggestion.insertText || suggestion.label;
|
||||
|
||||
const preserveSuffix = suggestion.kind === 'function';
|
||||
|
@ -169,7 +166,8 @@ export function SuggestionsPlugin({
|
|||
// If new-lines, apply suggestion as block
|
||||
if (suggestionText.match(/\n/)) {
|
||||
const fragment = makeFragment(suggestionText);
|
||||
return editor.deleteBackward(backward).deleteForward(forward).insertFragment(fragment).focus();
|
||||
editor.deleteBackward(backward).deleteForward(forward).insertFragment(fragment).focus();
|
||||
return editor;
|
||||
}
|
||||
|
||||
state = {
|
||||
|
@ -177,13 +175,15 @@ export function SuggestionsPlugin({
|
|||
groupedItems: [],
|
||||
};
|
||||
|
||||
return editor
|
||||
editor
|
||||
.snapshotSelection()
|
||||
.deleteBackward(backward)
|
||||
.deleteForward(forward)
|
||||
.insertText(suggestionText)
|
||||
.moveForward(move)
|
||||
.focus();
|
||||
|
||||
return editor;
|
||||
},
|
||||
},
|
||||
|
||||
|
@ -203,7 +203,7 @@ export function SuggestionsPlugin({
|
|||
prefix={state.typeaheadPrefix}
|
||||
isOpen={!!state.groupedItems.length}
|
||||
groupedItems={state.groupedItems}
|
||||
onSelectSuggestion={(editor as CoreEditor & SuggestionsPluginCommands).selectSuggestion}
|
||||
onSelectSuggestion={(editor as Editor & SuggestionsPluginCommands).selectSuggestion}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
|
@ -212,7 +212,7 @@ export function SuggestionsPlugin({
|
|||
}
|
||||
|
||||
const handleTypeahead = async (
|
||||
editor: CoreEditor,
|
||||
editor: Editor,
|
||||
onStateChange: (state: Partial<SuggestionsState>) => void,
|
||||
onTypeahead?: (typeahead: TypeaheadInput) => Promise<TypeaheadOutput>,
|
||||
cleanText?: (text: string) => string
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import { Value, Editor as CoreEditor } from 'slate';
|
||||
import { Value } from 'slate';
|
||||
import { Editor } from 'slate-react';
|
||||
|
||||
import { SearchFunctionType } from '../utils';
|
||||
|
||||
|
@ -133,7 +134,7 @@ export interface TypeaheadInput {
|
|||
wrapperClasses: string[];
|
||||
labelKey?: string;
|
||||
value?: Value;
|
||||
editor?: CoreEditor;
|
||||
editor?: Editor;
|
||||
}
|
||||
|
||||
export interface SuggestionsState {
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
"compilerOptions": {
|
||||
"paths": {
|
||||
"@emotion/core": ["./src/types/emotion-core-stub.d.ts"],
|
||||
"@grafana/slate-react": ["slate-react"],
|
||||
"@grafana/ui": ["."]
|
||||
}
|
||||
},
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
"@testing-library/user-event": "14.4.3",
|
||||
"@types/classnames": "^2.2.7",
|
||||
"@types/deep-freeze": "^0.1.1",
|
||||
"@types/grafana__slate-react": "npm:@types/slate-react@0.22.5",
|
||||
"@types/hoist-non-react-statics": "^3.3.1",
|
||||
"@types/jest": "28.1.6",
|
||||
"@types/lodash": "4.14.182",
|
||||
|
@ -23,6 +22,7 @@
|
|||
"@types/react": "17.0.42",
|
||||
"@types/react-icons": "2.2.7",
|
||||
"@types/reselect": "2.2.0",
|
||||
"@types/slate-react": "0.22.9",
|
||||
"@types/testing-library__jest-dom": "5.14.5",
|
||||
"@types/tinycolor2": "1.4.3",
|
||||
"enzyme": "3.11.0",
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import { css, cx } from '@emotion/css';
|
||||
import { LanguageMap, languages as prismLanguages } from 'prismjs';
|
||||
import React, { FC, useMemo } from 'react';
|
||||
import { Editor } from 'slate-react';
|
||||
|
||||
import { GrafanaTheme } from '@grafana/data';
|
||||
import { Editor } from '@grafana/slate-react';
|
||||
import { makeValue, SlatePrism, useStyles } from '@grafana/ui';
|
||||
import LogqlSyntax from 'app/plugins/datasource/loki/syntax';
|
||||
import PromqlSyntax from 'app/plugins/datasource/prometheus/promql';
|
||||
|
|
|
@ -13,10 +13,10 @@ import * as rxjs from 'rxjs';
|
|||
import * as rxjsOperators from 'rxjs/operators';
|
||||
import slate from 'slate';
|
||||
import slatePlain from 'slate-plain-serializer';
|
||||
import slateReact from 'slate-react';
|
||||
|
||||
import * as grafanaData from '@grafana/data';
|
||||
import * as grafanaRuntime from '@grafana/runtime';
|
||||
import slateReact from '@grafana/slate-react';
|
||||
import * as grafanaUIraw from '@grafana/ui';
|
||||
import TableModel from 'app/core/TableModel';
|
||||
import config from 'app/core/config';
|
||||
|
@ -85,7 +85,7 @@ exposeToPlugin('react-router-dom', reactRouter);
|
|||
// Experimental modules
|
||||
exposeToPlugin('prismjs', prismjs);
|
||||
exposeToPlugin('slate', slate);
|
||||
exposeToPlugin('@grafana/slate-react', slateReact);
|
||||
exposeToPlugin('slate-react', slateReact);
|
||||
exposeToPlugin('slate-plain-serializer', slatePlain);
|
||||
exposeToPlugin('react', react);
|
||||
exposeToPlugin('react-dom', reactDom);
|
||||
|
|
|
@ -2,6 +2,7 @@ import { css } from '@emotion/css';
|
|||
import { LanguageMap, languages as prismLanguages } from 'prismjs';
|
||||
import React, { ReactNode } from 'react';
|
||||
import { Node, Plugin } from 'slate';
|
||||
import { Editor } from 'slate-react';
|
||||
|
||||
import { AbsoluteTimeRange, QueryEditorProps } from '@grafana/data';
|
||||
import { BracesPlugin, LegacyForms, QueryField, SlatePrism, TypeaheadInput, TypeaheadOutput } from '@grafana/ui';
|
||||
|
@ -48,7 +49,7 @@ export class CloudWatchLogsQueryField extends React.PureComponent<CloudWatchLogs
|
|||
hint: undefined,
|
||||
};
|
||||
|
||||
plugins: Plugin[];
|
||||
plugins: Array<Plugin<Editor>>;
|
||||
|
||||
constructor(props: CloudWatchLogsQueryFieldProps, context: React.Context<any>) {
|
||||
super(props, context);
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import { LanguageMap, languages as prismLanguages } from 'prismjs';
|
||||
import React, { ReactNode } from 'react';
|
||||
import { Plugin, Node } from 'slate';
|
||||
import { Editor } from 'slate-react';
|
||||
|
||||
import { QueryEditorProps } from '@grafana/data';
|
||||
import { reportInteraction } from '@grafana/runtime';
|
||||
|
@ -83,7 +84,7 @@ interface LokiQueryFieldState {
|
|||
}
|
||||
|
||||
export class LokiQueryField extends React.PureComponent<LokiQueryFieldProps, LokiQueryFieldState> {
|
||||
plugins: Plugin[];
|
||||
plugins: Array<Plugin<Editor>>;
|
||||
_isMounted = false;
|
||||
|
||||
constructor(props: LokiQueryFieldProps) {
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import { LanguageMap, languages as prismLanguages } from 'prismjs';
|
||||
import React, { ReactNode } from 'react';
|
||||
import { Plugin } from 'slate';
|
||||
import { Editor } from 'slate-react';
|
||||
|
||||
import { CoreApp, isDataFrame, QueryEditorProps, QueryHint, TimeRange, toLegacyResponseData } from '@grafana/data';
|
||||
import { reportInteraction } from '@grafana/runtime/src';
|
||||
|
@ -85,7 +86,7 @@ interface PromQueryFieldState {
|
|||
}
|
||||
|
||||
class PromQueryField extends React.PureComponent<PromQueryFieldProps, PromQueryFieldState> {
|
||||
plugins: Plugin[];
|
||||
plugins: Array<Plugin<Editor>>;
|
||||
declare languageProviderInitializationPromise: CancelablePromise<any>;
|
||||
|
||||
constructor(props: PromQueryFieldProps, context: React.Context<any>) {
|
||||
|
|
145
yarn.lock
145
yarn.lock
|
@ -5036,35 +5036,6 @@ __metadata:
|
|||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
"@grafana/slate-react@npm:0.22.10-grafana":
|
||||
version: 0.22.10-grafana
|
||||
resolution: "@grafana/slate-react@npm:0.22.10-grafana"
|
||||
dependencies:
|
||||
debug: ^3.1.0
|
||||
get-window: ^1.1.1
|
||||
is-window: ^1.0.2
|
||||
lodash: ^4.1.1
|
||||
memoize-one: ^4.0.0
|
||||
prop-types: ^15.5.8
|
||||
react-immutable-proptypes: ^2.1.0
|
||||
selection-is-backward: ^1.0.0
|
||||
slate-base64-serializer: ^0.2.111
|
||||
slate-dev-environment: ^0.2.2
|
||||
slate-hotkeys: ^0.2.9
|
||||
slate-plain-serializer: ^0.7.10
|
||||
slate-prop-types: ^0.5.41
|
||||
slate-react-placeholder: ^0.2.8
|
||||
tiny-invariant: ^1.0.1
|
||||
tiny-warning: ^0.0.3
|
||||
peerDependencies:
|
||||
immutable: ">=3.8.1 || >4.0.0-rc"
|
||||
react: ">=16.6.0"
|
||||
react-dom: ">=16.6.0"
|
||||
slate: ">=0.47.0"
|
||||
checksum: 3417c53d9d0d2f46d3624037b1094a6786019c52e84d4ed3a91fbac232e67805cb299c3a6af7a1b8fd98cc2c60455103dd1d87eb6e7dd95df3b96b72f94cedd5
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@grafana/toolkit@9.2.0-pre, @grafana/toolkit@workspace:*, @grafana/toolkit@workspace:packages/grafana-toolkit":
|
||||
version: 0.0.0-use.local
|
||||
resolution: "@grafana/toolkit@workspace:packages/grafana-toolkit"
|
||||
|
@ -5177,7 +5148,6 @@ __metadata:
|
|||
"@grafana/data": 9.2.0-pre
|
||||
"@grafana/e2e-selectors": 9.2.0-pre
|
||||
"@grafana/schema": 9.2.0-pre
|
||||
"@grafana/slate-react": 0.22.10-grafana
|
||||
"@grafana/tsconfig": ^1.2.0-rc1
|
||||
"@mdx-js/react": 1.6.22
|
||||
"@monaco-editor/react": 4.4.5
|
||||
|
@ -5217,7 +5187,6 @@ __metadata:
|
|||
"@types/d3": 7.4.0
|
||||
"@types/enzyme": 3.10.12
|
||||
"@types/enzyme-adapter-react-16": 1.0.6
|
||||
"@types/grafana__slate-react": "npm:@types/slate-react@0.22.5"
|
||||
"@types/hoist-non-react-statics": 3.3.1
|
||||
"@types/is-hotkey": 0.1.7
|
||||
"@types/jest": 28.1.6
|
||||
|
@ -5237,8 +5206,9 @@ __metadata:
|
|||
"@types/react-test-renderer": 17.0.1
|
||||
"@types/react-transition-group": 4.4.5
|
||||
"@types/react-window": 1.8.5
|
||||
"@types/slate": 0.47.2
|
||||
"@types/slate": 0.47.9
|
||||
"@types/slate-plain-serializer": 0.7.2
|
||||
"@types/slate-react": 0.22.9
|
||||
"@types/testing-library__jest-dom": 5.14.5
|
||||
"@types/testing-library__react-hooks": ^3.2.0
|
||||
"@types/tinycolor2": 1.4.3
|
||||
|
@ -5306,8 +5276,9 @@ __metadata:
|
|||
rollup-plugin-svg-import: ^1.6.0
|
||||
rxjs: 7.5.6
|
||||
sass-loader: 13.0.2
|
||||
slate: 0.47.8
|
||||
slate-plain-serializer: 0.7.10
|
||||
slate: 0.47.9
|
||||
slate-plain-serializer: 0.7.11
|
||||
slate-react: 0.22.10
|
||||
storybook-dark-mode: 1.1.0
|
||||
style-loader: 3.3.1
|
||||
terser-webpack-plugin: 5.3.3
|
||||
|
@ -5463,7 +5434,6 @@ __metadata:
|
|||
"@testing-library/user-event": 14.4.3
|
||||
"@types/classnames": ^2.2.7
|
||||
"@types/deep-freeze": ^0.1.1
|
||||
"@types/grafana__slate-react": "npm:@types/slate-react@0.22.5"
|
||||
"@types/hoist-non-react-statics": ^3.3.1
|
||||
"@types/jest": 28.1.6
|
||||
"@types/lodash": 4.14.182
|
||||
|
@ -5471,6 +5441,7 @@ __metadata:
|
|||
"@types/react": 17.0.42
|
||||
"@types/react-icons": 2.2.7
|
||||
"@types/reselect": 2.2.0
|
||||
"@types/slate-react": 0.22.9
|
||||
"@types/testing-library__jest-dom": 5.14.5
|
||||
"@types/tinycolor2": 1.4.3
|
||||
chance: ^1.0.10
|
||||
|
@ -11198,17 +11169,6 @@ __metadata:
|
|||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@types/grafana__slate-react@npm:@types/slate-react@0.22.5":
|
||||
version: 0.22.5
|
||||
resolution: "@types/slate-react@npm:0.22.5"
|
||||
dependencies:
|
||||
"@types/react": "*"
|
||||
"@types/slate": "*"
|
||||
immutable: ^3.8.2
|
||||
checksum: afc83c7f47d19cc6776a8b4c14eb3894b18db2410e8274058133ed53d78ee82976f1318a707597ddc7277b1b857a4baf97b152687679f4e9757bb8c662508164
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@types/hast@npm:^2.0.0":
|
||||
version: 2.3.4
|
||||
resolution: "@types/hast@npm:2.3.4"
|
||||
|
@ -12143,13 +12103,24 @@ __metadata:
|
|||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@types/slate@npm:0.47.2":
|
||||
version: 0.47.2
|
||||
resolution: "@types/slate@npm:0.47.2"
|
||||
"@types/slate-react@npm:0.22.9":
|
||||
version: 0.22.9
|
||||
resolution: "@types/slate-react@npm:0.22.9"
|
||||
dependencies:
|
||||
"@types/react": "*"
|
||||
"@types/slate": "*"
|
||||
immutable: ^3.8.2
|
||||
checksum: d74812f6bf651c508afb2a4fae4ae919cba992ec920ac017d1bf73b1b469959145793a716d5d114b93d1082683ab7378b5cb5b68f0ff01a6d121c8ddbbb8e2e1
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@types/slate@npm:0.47.9":
|
||||
version: 0.47.9
|
||||
resolution: "@types/slate@npm:0.47.9"
|
||||
dependencies:
|
||||
"@types/react": "*"
|
||||
immutable: ^3.8.2
|
||||
checksum: c92350f1ef366b5907356a7f3b7bd41dda548dc1002cc2bd79f6b0ff1356d3189c124a54b363ddbe22cbdeb2a75f9d1b67d4f5b2a1bb6b89b714ecf7cf0c49c2
|
||||
checksum: ce88a5c6f502fbfe9a299983766d2eb67e4fbe2f746178b2ef31330b1392b62eca96d8618753ca2af3e858b6aa4ada91a64a3dfc4e70c60785f172c240e06a45
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
|
@ -21755,7 +21726,6 @@ __metadata:
|
|||
"@grafana/lezer-logql": 0.0.18
|
||||
"@grafana/runtime": "workspace:*"
|
||||
"@grafana/schema": "workspace:*"
|
||||
"@grafana/slate-react": 0.22.10-grafana
|
||||
"@grafana/toolkit": "workspace:*"
|
||||
"@grafana/tsconfig": ^1.2.0-rc1
|
||||
"@grafana/ui": "workspace:*"
|
||||
|
@ -21813,7 +21783,6 @@ __metadata:
|
|||
"@types/eslint": 8.4.5
|
||||
"@types/file-saver": 2.0.5
|
||||
"@types/google.analytics": ^0.0.42
|
||||
"@types/grafana__slate-react": "npm:@types/slate-react@0.22.5"
|
||||
"@types/history": 4.7.11
|
||||
"@types/hoist-non-react-statics": 3.3.1
|
||||
"@types/jest": 28.1.6
|
||||
|
@ -21849,8 +21818,9 @@ __metadata:
|
|||
"@types/redux-mock-store": 1.0.3
|
||||
"@types/reselect": 2.2.0
|
||||
"@types/semver": 7.3.10
|
||||
"@types/slate": 0.47.2
|
||||
"@types/slate": 0.47.9
|
||||
"@types/slate-plain-serializer": 0.7.2
|
||||
"@types/slate-react": 0.22.9
|
||||
"@types/testing-library__jest-dom": 5.14.5
|
||||
"@types/testing-library__react-hooks": ^3.2.0
|
||||
"@types/tinycolor2": 1.4.3
|
||||
|
@ -22015,8 +21985,9 @@ __metadata:
|
|||
selecto: 1.19.1
|
||||
semver: 7.3.7
|
||||
sinon: 14.0.0
|
||||
slate: 0.47.8
|
||||
slate-plain-serializer: 0.7.10
|
||||
slate: 0.47.9
|
||||
slate-plain-serializer: 0.7.11
|
||||
slate-react: 0.22.10
|
||||
sql-formatter-plus: ^1.3.6
|
||||
style-loader: 3.3.1
|
||||
stylelint: 14.9.1
|
||||
|
@ -34352,7 +34323,7 @@ __metadata:
|
|||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"slate-base64-serializer@npm:^0.2.111":
|
||||
"slate-base64-serializer@npm:^0.2.112":
|
||||
version: 0.2.115
|
||||
resolution: "slate-base64-serializer@npm:0.2.115"
|
||||
dependencies:
|
||||
|
@ -34363,7 +34334,7 @@ __metadata:
|
|||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"slate-dev-environment@npm:^0.2.2":
|
||||
"slate-dev-environment@npm:0.2.5":
|
||||
version: 0.2.5
|
||||
resolution: "slate-dev-environment@npm:0.2.5"
|
||||
dependencies:
|
||||
|
@ -34372,6 +34343,15 @@ __metadata:
|
|||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"slate-dev-environment@patch:slate-dev-environment@npm:0.2.5#.yarn/patches/slate-dev-environment-npm-0.2.5-9aeb7da7b5.patch::locator=grafana%40workspace%3A.":
|
||||
version: 0.2.5
|
||||
resolution: "slate-dev-environment@patch:slate-dev-environment@npm%3A0.2.5#.yarn/patches/slate-dev-environment-npm-0.2.5-9aeb7da7b5.patch::version=0.2.5&hash=13521e&locator=grafana%40workspace%3A."
|
||||
dependencies:
|
||||
is-in-browser: ^1.1.3
|
||||
checksum: 1be7514ac0b10b0232f3c19e02bf5f9211850e119a235743fd46ab2f182c8b892dc58edf40130308d85d14f755b348b86ab2daea757e8ee0beb74746f653fc03
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"slate-hotkeys@npm:^0.2.9":
|
||||
version: 0.2.11
|
||||
resolution: "slate-hotkeys@npm:0.2.11"
|
||||
|
@ -34382,17 +34362,17 @@ __metadata:
|
|||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"slate-plain-serializer@npm:0.7.10":
|
||||
version: 0.7.10
|
||||
resolution: "slate-plain-serializer@npm:0.7.10"
|
||||
"slate-plain-serializer@npm:0.7.11":
|
||||
version: 0.7.11
|
||||
resolution: "slate-plain-serializer@npm:0.7.11"
|
||||
peerDependencies:
|
||||
immutable: ">=3.8.1"
|
||||
slate: ">=0.46.0"
|
||||
checksum: 0fe3f736cbc48c4b9cf7cf5ec03d9cc51c0f3320e46841de4aef50767a2ef14952660e0e2e5dfe1696e7d5c952408d95144543a9a9a86973e893de840782cd2e
|
||||
checksum: b8d2989562a140c4c6cada381483aa2f419c3532ebb4ed51abfa5df8128dfd8f3d845ca324d737e3711343d651a95804f91aaa1d2cdd8e96cd9602c747781a5b
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"slate-plain-serializer@npm:^0.7.10":
|
||||
"slate-plain-serializer@npm:^0.7.11":
|
||||
version: 0.7.13
|
||||
resolution: "slate-plain-serializer@npm:0.7.13"
|
||||
peerDependencies:
|
||||
|
@ -34402,7 +34382,7 @@ __metadata:
|
|||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"slate-prop-types@npm:^0.5.41":
|
||||
"slate-prop-types@npm:^0.5.42":
|
||||
version: 0.5.44
|
||||
resolution: "slate-prop-types@npm:0.5.44"
|
||||
peerDependencies:
|
||||
|
@ -34412,7 +34392,7 @@ __metadata:
|
|||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"slate-react-placeholder@npm:^0.2.8":
|
||||
"slate-react-placeholder@npm:^0.2.9":
|
||||
version: 0.2.9
|
||||
resolution: "slate-react-placeholder@npm:0.2.9"
|
||||
peerDependencies:
|
||||
|
@ -34423,9 +34403,38 @@ __metadata:
|
|||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"slate@npm:0.47.8":
|
||||
version: 0.47.8
|
||||
resolution: "slate@npm:0.47.8"
|
||||
"slate-react@npm:0.22.10":
|
||||
version: 0.22.10
|
||||
resolution: "slate-react@npm:0.22.10"
|
||||
dependencies:
|
||||
debug: ^3.1.0
|
||||
get-window: ^1.1.1
|
||||
is-window: ^1.0.2
|
||||
lodash: ^4.1.1
|
||||
memoize-one: ^4.0.0
|
||||
prop-types: ^15.5.8
|
||||
react-immutable-proptypes: ^2.1.0
|
||||
selection-is-backward: ^1.0.0
|
||||
slate-base64-serializer: ^0.2.112
|
||||
slate-dev-environment: ^0.2.2
|
||||
slate-hotkeys: ^0.2.9
|
||||
slate-plain-serializer: ^0.7.11
|
||||
slate-prop-types: ^0.5.42
|
||||
slate-react-placeholder: ^0.2.9
|
||||
tiny-invariant: ^1.0.1
|
||||
tiny-warning: ^0.0.3
|
||||
peerDependencies:
|
||||
immutable: ">=3.8.1 || >4.0.0-rc"
|
||||
react: ">=16.6.0"
|
||||
react-dom: ">=16.6.0"
|
||||
slate: ">=0.47.0"
|
||||
checksum: 1ecddaf0f635205249680961d7e772cf25a60179b39ca69a34f874b2797e3c122ef405921fa2787ea0c559af48d1d79f10d7e169749f0f084c6bf366aeffdfc8
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"slate@npm:0.47.9":
|
||||
version: 0.47.9
|
||||
resolution: "slate@npm:0.47.9"
|
||||
dependencies:
|
||||
debug: ^3.1.0
|
||||
direction: ^0.1.5
|
||||
|
@ -34437,7 +34446,7 @@ __metadata:
|
|||
type-of: ^2.0.1
|
||||
peerDependencies:
|
||||
immutable: ">=3.8.1 || >4.0.0-rc"
|
||||
checksum: 6d3541abe1a727f498e0835118b98efd1a8ea2cfa9bb1b3fe9f77faf42b4afce4259e765b60bd5b8c2bd34686d5f9bcfb80b9a8807c54fee1e496a92bad563d6
|
||||
checksum: a128d1eaa4c203dbb13d197d69758341df485e42e52aea1739d05939b16df42633949f116ae9b75b95b647ec39b18867ca5c8a05dbe97eeb15cf31bc8d2edc7f
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
|
|
Loading…
Reference in New Issue