@platecms/delta-smart-text 0.4.1 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.example +7 -0
- package/__generated__/fragment-masking.ts +87 -0
- package/__generated__/gql.ts +238 -0
- package/__generated__/graphql.ts +3441 -0
- package/__generated__/index.ts +2 -0
- package/codegen.config.ts +24 -0
- package/eslint.config.mjs +43 -0
- package/i18n.js +28 -0
- package/package.json +5 -5
- package/project.json +54 -0
- package/src/components/DeltaSlateEditor.vue +74 -0
- package/src/components/icon/FontAwesomeIcon.vue +21 -0
- package/src/graphql/apiTokens/apiTokens.fragments.gql +8 -0
- package/src/graphql/assets/assets.fragments.gql +10 -0
- package/src/graphql/blueprints/blueprints.fragments.gql +52 -0
- package/src/graphql/buildingBlockFieldFulfillments/buildingBlockFieldFullfillment.fragements.gql +6 -0
- package/src/graphql/buildingBlockFields/buildingBlockField.fragments.gql +8 -0
- package/src/graphql/buildingBlocks/buildingBlocks.fragments.gql +11 -0
- package/src/graphql/channels/channels.fragments.gql +9 -0
- package/src/graphql/contentExperiences/allContentExperiences.query.gql +24 -0
- package/src/graphql/contentExperiences/contentExperience.query.gql +20 -0
- package/src/graphql/contentExperiences/contentExperiences.fragments.gql +14 -0
- package/src/graphql/contentFields/contentFields.fragments.gql +7 -0
- package/src/graphql/contentItems/allContentItems.query.gql +48 -0
- package/src/graphql/contentItems/contentItems.fragments.gql +11 -0
- package/src/graphql/contentTypes/allContentTypes.query.gql +26 -0
- package/src/graphql/contentTypes/contentTypes.fragments.gql +11 -0
- package/src/graphql/contentValidations/contentValidationRule.fragments.gql +34 -0
- package/src/graphql/contentValues/allContentValues.query.gql +41 -0
- package/src/graphql/contentValues/contentValues.fragments.gql +9 -0
- package/src/graphql/contentValues/createContentValue.mutation.gql +17 -0
- package/src/graphql/experienceComponents/experienceComponent.fragments.gql +13 -0
- package/src/graphql/fragments.gql +6 -0
- package/src/graphql/gridDefinition/gridDefinition.fragments.gql +5 -0
- package/src/graphql/gridPlacements/gridPlacement.fragments.gql +7 -0
- package/src/graphql/grids/grid.fragments.gql +7 -0
- package/src/graphql/invitations/invitations.fragments.gql +7 -0
- package/src/graphql/organizations/organizations.fragments.gql +13 -0
- package/src/graphql/pathParts/pathParts.fragments.gql +19 -0
- package/src/graphql/plateMaintainers/plateMaintainer.fragements.gql +10 -0
- package/src/graphql/roleAssignments/roleAssignment.fragments.gql +9 -0
- package/src/graphql/roles/roles.fragments.gql +7 -0
- package/src/graphql/subject/subject.fragments.gql +8 -0
- package/src/graphql/tags/tags.fragments.gql +17 -0
- package/src/graphql/themes/themes.fragments.gql +8 -0
- package/src/index.css +1 -0
- package/src/index.ts +21 -0
- package/src/locales/en.json +52 -0
- package/src/locales/nl.json +52 -0
- package/src/react/components/DeltaSlateEditor.tsx +243 -0
- package/src/react/components/DeltaSlateEditorConnector.tsx +50 -0
- package/src/react/components/Element.spec.tsx +244 -0
- package/src/react/components/Element.tsx +151 -0
- package/src/react/components/FontAwesomeIcon.tsx +17 -0
- package/src/react/components/Leaf.spec.tsx +61 -0
- package/src/react/components/Leaf.tsx +22 -0
- package/src/react/components/elements/CodeElement.tsx +16 -0
- package/src/react/components/elements/ContentValueElement.tsx +33 -0
- package/src/react/components/elements/LinkElement.tsx +44 -0
- package/src/react/components/inputs/SearchInput.tsx +22 -0
- package/src/react/components/inputs/TextInput.tsx +30 -0
- package/src/react/components/menus/ContentAndFormatMenu.tsx +272 -0
- package/src/react/components/menus/ContentLibraryMenu.tsx +48 -0
- package/src/react/components/menus/ReusableContentMenu.tsx +190 -0
- package/src/react/components/menus/content/ContentItemsMenu.tsx +215 -0
- package/src/react/components/menus/content/ContentTypesMenu.tsx +129 -0
- package/src/react/components/menus/content/partials/ContentFieldMenuItem.tsx +11 -0
- package/src/react/components/menus/content/partials/ContentValueMenuItem.tsx +58 -0
- package/src/react/components/menus/link/AnchorInput.tsx +123 -0
- package/src/react/components/menus/link/LinkInput.tsx +195 -0
- package/src/react/components/menus/link/LinkMenu.spec.tsx +145 -0
- package/src/react/components/menus/link/LinkMenu.tsx +289 -0
- package/src/react/components/menus/partials/MenuButton.tsx +52 -0
- package/src/react/components/menus/partials/MenuContainer.tsx +9 -0
- package/src/react/components/menus/partials/MenuHeader.tsx +11 -0
- package/src/react/components/toolbar/Toolbar.tsx +249 -0
- package/src/react/components/toolbar/ToolbarBlockButton.tsx +31 -0
- package/src/react/components/toolbar/ToolbarHeadingDropdownButton.tsx +76 -0
- package/src/react/components/toolbar/ToolbarLinkButton.tsx +33 -0
- package/src/react/components/toolbar/ToolbarMarkButton.tsx +25 -0
- package/src/react/components/toolbar/content/ContentExtractToolbarButton.tsx +68 -0
- package/src/react/components/toolbar/content/ContentLibraryToolbarButton.tsx +43 -0
- package/src/react/components/toolbar/content/ContentToolbar.tsx +37 -0
- package/src/react/components/toolbar/link/ToolbarDisplayLink.tsx +36 -0
- package/src/react/components/toolbar/link/UnlinkButton.tsx +25 -0
- package/src/react/config/hotkeys.ts +8 -0
- package/src/react/plugins/index.ts +59 -0
- package/src/react/store/editorSlice.ts +124 -0
- package/src/react/store/store.ts +12 -0
- package/src/react/types.ts +87 -0
- package/src/react/utils/decorator.ts +61 -0
- package/src/react/utils/index.ts +110 -0
- package/src/vue-shims.d.ts +5 -0
- package/tsconfig.json +26 -0
- package/tsconfig.lib.json +25 -0
- package/tsconfig.spec.json +22 -0
- package/vite.config.ts +67 -0
- package/components/DeltaSlateEditor.vue.d.ts +0 -26
- package/index.cjs +0 -381
- package/index.css +0 -1
- package/index.d.ts +0 -12
- package/index.js +0 -49254
- package/react/components/DeltaSlateEditor.d.ts +0 -7
- package/react/components/DeltaSlateEditorConnector.d.ts +0 -12
- package/react/components/Element.d.ts +0 -8
- package/react/components/FontAwesomeIcon.d.ts +0 -6
- package/react/components/Leaf.d.ts +0 -3
- package/react/components/elements/CodeElement.d.ts +0 -8
- package/react/components/elements/ContentValueElement.d.ts +0 -8
- package/react/components/elements/LinkElement.d.ts +0 -8
- package/react/components/inputs/SearchInput.d.ts +0 -5
- package/react/components/inputs/TextInput.d.ts +0 -7
- package/react/components/menus/ContentAndFormatMenu.d.ts +0 -10
- package/react/components/menus/ContentLibraryMenu.d.ts +0 -4
- package/react/components/menus/ReusableContentMenu.d.ts +0 -3
- package/react/components/menus/content/ContentItemsMenu.d.ts +0 -5
- package/react/components/menus/content/ContentTypesMenu.d.ts +0 -6
- package/react/components/menus/content/partials/ContentFieldMenuItem.d.ts +0 -6
- package/react/components/menus/content/partials/ContentValueMenuItem.d.ts +0 -7
- package/react/components/menus/link/AnchorInput.d.ts +0 -8
- package/react/components/menus/link/LinkInput.d.ts +0 -11
- package/react/components/menus/link/LinkMenu.d.ts +0 -18
- package/react/components/menus/partials/MenuButton.d.ts +0 -7
- package/react/components/menus/partials/MenuContainer.d.ts +0 -4
- package/react/components/menus/partials/MenuHeader.d.ts +0 -5
- package/react/components/toolbar/Toolbar.d.ts +0 -6
- package/react/components/toolbar/ToolbarBlockButton.d.ts +0 -12
- package/react/components/toolbar/ToolbarHeadingDropdownButton.d.ts +0 -2
- package/react/components/toolbar/ToolbarLinkButton.d.ts +0 -6
- package/react/components/toolbar/ToolbarMarkButton.d.ts +0 -6
- package/react/components/toolbar/content/ContentExtractToolbarButton.d.ts +0 -2
- package/react/components/toolbar/content/ContentLibraryToolbarButton.d.ts +0 -5
- package/react/components/toolbar/content/ContentToolbar.d.ts +0 -4
- package/react/components/toolbar/link/ToolbarDisplayLink.d.ts +0 -2
- package/react/components/toolbar/link/UnlinkButton.d.ts +0 -2
- package/react/config/hotkeys.d.ts +0 -2
- package/react/plugins/index.d.ts +0 -3
- package/react/store/editorSlice.d.ts +0 -169
- package/react/store/store.d.ts +0 -5
- package/react/types.d.ts +0 -65
- package/react/utils/decorator.d.ts +0 -15
- package/react/utils/index.d.ts +0 -17
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { ApolloClient, NormalizedCacheObject } from '@apollo/client';
|
|
2
|
-
import { Organization } from '../../../__generated__/graphql';
|
|
3
|
-
export declare class DeltaSlateEditorConnector {
|
|
4
|
-
private readonly root;
|
|
5
|
-
private readonly uuid;
|
|
6
|
-
private readonly context;
|
|
7
|
-
private readonly client;
|
|
8
|
-
private readonly organization;
|
|
9
|
-
private readonly isDisabled?;
|
|
10
|
-
constructor(targetEl: HTMLElement, uuid: string, client: ApolloClient<NormalizedCacheObject>, context: HTMLElement | null, organization: Organization | undefined, isDisabled?: boolean);
|
|
11
|
-
render(): void;
|
|
12
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { default as React, HTMLAttributes, ReactNode } from 'react';
|
|
2
|
-
import { DeltaElement } from '../types';
|
|
3
|
-
export declare function Element({ attributes, children, element, lastKey, }: {
|
|
4
|
-
attributes: HTMLAttributes<HTMLElement>;
|
|
5
|
-
children: ReactNode;
|
|
6
|
-
element: DeltaElement;
|
|
7
|
-
lastKey: string | undefined;
|
|
8
|
-
}): React.ReactElement;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
-
import { CodeElement as CodeElementType } from '../../types';
|
|
3
|
-
export declare function CodeElement(props: {
|
|
4
|
-
attributes: HTMLAttributes<HTMLElement>;
|
|
5
|
-
children: ReactNode;
|
|
6
|
-
element: CodeElementType;
|
|
7
|
-
}): React.ReactElement;
|
|
8
|
-
export default CodeElement;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { default as React, HTMLAttributes, ReactNode } from 'react';
|
|
2
|
-
import { ContentValueElement as ContentValueElementType } from '../../types';
|
|
3
|
-
export declare function ContentValueElement({ attributes, children, element, }: {
|
|
4
|
-
attributes: HTMLAttributes<HTMLElement>;
|
|
5
|
-
children: ReactNode;
|
|
6
|
-
element: ContentValueElementType;
|
|
7
|
-
}): React.ReactElement;
|
|
8
|
-
export default ContentValueElement;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { default as React, HTMLAttributes, ReactNode } from 'react';
|
|
2
|
-
import { LinkElement as LinkElementType } from '../../types';
|
|
3
|
-
export declare function LinkElement({ attributes, children, element, }: {
|
|
4
|
-
attributes: HTMLAttributes<HTMLElement>;
|
|
5
|
-
children: ReactNode;
|
|
6
|
-
element: LinkElementType;
|
|
7
|
-
}): React.ReactElement;
|
|
8
|
-
export default LinkElement;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
export declare function ContentAndFormatMenu({ uuid, ref, linkMenuIsOpen, openLinkMenu, searchValue, }: {
|
|
3
|
-
uuid: string;
|
|
4
|
-
ref: React.RefObject<{
|
|
5
|
-
escapeContentAndFormatMenu: () => void;
|
|
6
|
-
} | null>;
|
|
7
|
-
linkMenuIsOpen: boolean;
|
|
8
|
-
openLinkMenu: () => void;
|
|
9
|
-
searchValue: string | null;
|
|
10
|
-
}): React.ReactElement | null;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { ContentType } from './../../../../../__generated__/graphql';
|
|
2
|
-
export declare function ContentTypesMenu({ onContentTypeClick, }: {
|
|
3
|
-
uuid: string;
|
|
4
|
-
onContentTypeClick: (contentType: ContentType) => void;
|
|
5
|
-
}): React.ReactElement;
|
|
6
|
-
export default ContentTypesMenu;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
import { ContentValue } from '../../../../../../__generated__/graphql';
|
|
3
|
-
export declare function ContentValueMenuItem({ contentValue, onClick, }: {
|
|
4
|
-
contentValue: ContentValue;
|
|
5
|
-
onClick?: (event: React.MouseEvent) => void;
|
|
6
|
-
}): React.ReactElement;
|
|
7
|
-
export default ContentValueMenuItem;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { GridPlacement } from '../../../../../__generated__/graphql';
|
|
2
|
-
export declare function AnchorInput({ label, value, contentExperiencePrn, gridPlacementPrn, onGridPlacementChanged, }: {
|
|
3
|
-
label: string;
|
|
4
|
-
value: string;
|
|
5
|
-
contentExperiencePrn: string;
|
|
6
|
-
gridPlacementPrn: string | undefined;
|
|
7
|
-
onGridPlacementChanged: (gridPlacement?: GridPlacement) => void;
|
|
8
|
-
}): React.ReactElement | null;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { ContentExperience } from '../../../../../__generated__/graphql';
|
|
2
|
-
import { LinkData } from './LinkMenu';
|
|
3
|
-
export declare function LinkInput({ onChange, onContentExperienceChanged, value, placeholder, label, contentExperiencePrn, gridPlacementPrn, }: {
|
|
4
|
-
onChange: (partial: Partial<LinkData>) => void;
|
|
5
|
-
onContentExperienceChanged: (contentExperience?: ContentExperience) => void;
|
|
6
|
-
value: string;
|
|
7
|
-
placeholder?: string;
|
|
8
|
-
label: string;
|
|
9
|
-
contentExperiencePrn?: string;
|
|
10
|
-
gridPlacementPrn?: string;
|
|
11
|
-
}): React.ReactElement;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
import { LinkElement } from '../../../types';
|
|
3
|
-
export interface LinkData {
|
|
4
|
-
text: string;
|
|
5
|
-
url: string;
|
|
6
|
-
target: LinkElement["target"];
|
|
7
|
-
internal?: {
|
|
8
|
-
prn: string;
|
|
9
|
-
anchor?: boolean;
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
export declare function LinkMenu({ showLinkTextInput, buttonText, menuClass, showMenu, onClose, }: {
|
|
13
|
-
showLinkTextInput?: boolean;
|
|
14
|
-
buttonText: string;
|
|
15
|
-
menuClass?: string;
|
|
16
|
-
showMenu?: boolean;
|
|
17
|
-
onClose: () => void;
|
|
18
|
-
}): React.ReactElement | null;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { default as React, ReactNode } from 'react';
|
|
2
|
-
import { HeadingElement, ListElement } from '../../types';
|
|
3
|
-
export declare function ToolbarBlockButton({ format, properties, icon, children, }: {
|
|
4
|
-
format: "code" | "heading" | "list";
|
|
5
|
-
icon: [string, string];
|
|
6
|
-
properties?: {
|
|
7
|
-
level?: HeadingElement["level"];
|
|
8
|
-
ordered?: ListElement["ordered"];
|
|
9
|
-
};
|
|
10
|
-
children?: ReactNode;
|
|
11
|
-
}): React.ReactElement;
|
|
12
|
-
export default ToolbarBlockButton;
|
package/react/plugins/index.d.ts
DELETED
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
import { BaseSelection, Descendant } from 'slate';
|
|
2
|
-
import { ContentItem, ContentType, Organization } from '../../../__generated__/graphql';
|
|
3
|
-
interface EditorSlice {
|
|
4
|
-
organization: Organization | undefined;
|
|
5
|
-
states: EditorState[];
|
|
6
|
-
}
|
|
7
|
-
export interface EditorState {
|
|
8
|
-
uuid: string;
|
|
9
|
-
search: string;
|
|
10
|
-
target: BaseSelection | undefined;
|
|
11
|
-
initialValue: Descendant[];
|
|
12
|
-
value: Descendant[];
|
|
13
|
-
selected: {
|
|
14
|
-
contentType: string | undefined;
|
|
15
|
-
contentItem: string | undefined;
|
|
16
|
-
};
|
|
17
|
-
options: {
|
|
18
|
-
contentTypes: ContentType[];
|
|
19
|
-
contentItems: Record<string, ContentItem[]>;
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
export declare const defaultEditorFieldState: Omit<EditorState, "uuid">;
|
|
23
|
-
declare function selectStates(state: EditorSlice): EditorState[];
|
|
24
|
-
declare function selectStateIndex(state: EditorSlice, uuid: string): number;
|
|
25
|
-
declare function selectCurrentOrganization(state: EditorSlice): Organization | undefined;
|
|
26
|
-
export declare const selectById: import('@reduxjs/toolkit').Selector<{
|
|
27
|
-
editor: EditorSlice;
|
|
28
|
-
}, EditorState, [uuid: string]> & {
|
|
29
|
-
unwrapped: ((state: EditorSlice, uuid: string) => EditorState) & {
|
|
30
|
-
clearCache: () => void;
|
|
31
|
-
resultsCount: () => number;
|
|
32
|
-
resetResultsCount: () => void;
|
|
33
|
-
} & {
|
|
34
|
-
resultFunc: (resultFuncArgs_0: EditorState[], resultFuncArgs_1: number) => EditorState;
|
|
35
|
-
memoizedResultFunc: ((resultFuncArgs_0: EditorState[], resultFuncArgs_1: number) => EditorState) & {
|
|
36
|
-
clearCache: () => void;
|
|
37
|
-
resultsCount: () => number;
|
|
38
|
-
resetResultsCount: () => void;
|
|
39
|
-
};
|
|
40
|
-
lastResult: () => EditorState;
|
|
41
|
-
dependencies: [typeof selectStates, typeof selectStateIndex];
|
|
42
|
-
recomputations: () => number;
|
|
43
|
-
resetRecomputations: () => void;
|
|
44
|
-
dependencyRecomputations: () => number;
|
|
45
|
-
resetDependencyRecomputations: () => void;
|
|
46
|
-
} & {
|
|
47
|
-
memoize: typeof import('@reduxjs/toolkit').weakMapMemoize;
|
|
48
|
-
argsMemoize: typeof import('@reduxjs/toolkit').weakMapMemoize;
|
|
49
|
-
};
|
|
50
|
-
}, selectByIdTarget: import('@reduxjs/toolkit').Selector<{
|
|
51
|
-
editor: EditorSlice;
|
|
52
|
-
}, BaseSelection | undefined, [uuid: string]> & {
|
|
53
|
-
unwrapped: ((state: EditorSlice, uuid: string) => BaseSelection | undefined) & {
|
|
54
|
-
clearCache: () => void;
|
|
55
|
-
resultsCount: () => number;
|
|
56
|
-
resetResultsCount: () => void;
|
|
57
|
-
} & {
|
|
58
|
-
resultFunc: (resultFuncArgs_0: EditorState) => BaseSelection | undefined;
|
|
59
|
-
memoizedResultFunc: ((resultFuncArgs_0: EditorState) => BaseSelection | undefined) & {
|
|
60
|
-
clearCache: () => void;
|
|
61
|
-
resultsCount: () => number;
|
|
62
|
-
resetResultsCount: () => void;
|
|
63
|
-
};
|
|
64
|
-
lastResult: () => BaseSelection | undefined;
|
|
65
|
-
dependencies: [((state: EditorSlice, uuid: string) => EditorState) & {
|
|
66
|
-
clearCache: () => void;
|
|
67
|
-
resultsCount: () => number;
|
|
68
|
-
resetResultsCount: () => void;
|
|
69
|
-
} & {
|
|
70
|
-
resultFunc: (resultFuncArgs_0: EditorState[], resultFuncArgs_1: number) => EditorState;
|
|
71
|
-
memoizedResultFunc: ((resultFuncArgs_0: EditorState[], resultFuncArgs_1: number) => EditorState) & {
|
|
72
|
-
clearCache: () => void;
|
|
73
|
-
resultsCount: () => number;
|
|
74
|
-
resetResultsCount: () => void;
|
|
75
|
-
};
|
|
76
|
-
lastResult: () => EditorState;
|
|
77
|
-
dependencies: [typeof selectStates, typeof selectStateIndex];
|
|
78
|
-
recomputations: () => number;
|
|
79
|
-
resetRecomputations: () => void;
|
|
80
|
-
dependencyRecomputations: () => number;
|
|
81
|
-
resetDependencyRecomputations: () => void;
|
|
82
|
-
} & {
|
|
83
|
-
memoize: typeof import('@reduxjs/toolkit').weakMapMemoize;
|
|
84
|
-
argsMemoize: typeof import('@reduxjs/toolkit').weakMapMemoize;
|
|
85
|
-
}];
|
|
86
|
-
recomputations: () => number;
|
|
87
|
-
resetRecomputations: () => void;
|
|
88
|
-
dependencyRecomputations: () => number;
|
|
89
|
-
resetDependencyRecomputations: () => void;
|
|
90
|
-
} & {
|
|
91
|
-
memoize: typeof import('@reduxjs/toolkit').weakMapMemoize;
|
|
92
|
-
argsMemoize: typeof import('@reduxjs/toolkit').weakMapMemoize;
|
|
93
|
-
};
|
|
94
|
-
}, selectByIdSelected: import('@reduxjs/toolkit').Selector<{
|
|
95
|
-
editor: EditorSlice;
|
|
96
|
-
}, {
|
|
97
|
-
contentType: string | undefined;
|
|
98
|
-
contentItem: string | undefined;
|
|
99
|
-
}, [uuid: string]> & {
|
|
100
|
-
unwrapped: ((state: EditorSlice, uuid: string) => {
|
|
101
|
-
contentType: string | undefined;
|
|
102
|
-
contentItem: string | undefined;
|
|
103
|
-
}) & {
|
|
104
|
-
clearCache: () => void;
|
|
105
|
-
resultsCount: () => number;
|
|
106
|
-
resetResultsCount: () => void;
|
|
107
|
-
} & {
|
|
108
|
-
resultFunc: (resultFuncArgs_0: EditorState) => {
|
|
109
|
-
contentType: string | undefined;
|
|
110
|
-
contentItem: string | undefined;
|
|
111
|
-
};
|
|
112
|
-
memoizedResultFunc: ((resultFuncArgs_0: EditorState) => {
|
|
113
|
-
contentType: string | undefined;
|
|
114
|
-
contentItem: string | undefined;
|
|
115
|
-
}) & {
|
|
116
|
-
clearCache: () => void;
|
|
117
|
-
resultsCount: () => number;
|
|
118
|
-
resetResultsCount: () => void;
|
|
119
|
-
};
|
|
120
|
-
lastResult: () => {
|
|
121
|
-
contentType: string | undefined;
|
|
122
|
-
contentItem: string | undefined;
|
|
123
|
-
};
|
|
124
|
-
dependencies: [((state: EditorSlice, uuid: string) => EditorState) & {
|
|
125
|
-
clearCache: () => void;
|
|
126
|
-
resultsCount: () => number;
|
|
127
|
-
resetResultsCount: () => void;
|
|
128
|
-
} & {
|
|
129
|
-
resultFunc: (resultFuncArgs_0: EditorState[], resultFuncArgs_1: number) => EditorState;
|
|
130
|
-
memoizedResultFunc: ((resultFuncArgs_0: EditorState[], resultFuncArgs_1: number) => EditorState) & {
|
|
131
|
-
clearCache: () => void;
|
|
132
|
-
resultsCount: () => number;
|
|
133
|
-
resetResultsCount: () => void;
|
|
134
|
-
};
|
|
135
|
-
lastResult: () => EditorState;
|
|
136
|
-
dependencies: [typeof selectStates, typeof selectStateIndex];
|
|
137
|
-
recomputations: () => number;
|
|
138
|
-
resetRecomputations: () => void;
|
|
139
|
-
dependencyRecomputations: () => number;
|
|
140
|
-
resetDependencyRecomputations: () => void;
|
|
141
|
-
} & {
|
|
142
|
-
memoize: typeof import('@reduxjs/toolkit').weakMapMemoize;
|
|
143
|
-
argsMemoize: typeof import('@reduxjs/toolkit').weakMapMemoize;
|
|
144
|
-
}];
|
|
145
|
-
recomputations: () => number;
|
|
146
|
-
resetRecomputations: () => void;
|
|
147
|
-
dependencyRecomputations: () => number;
|
|
148
|
-
resetDependencyRecomputations: () => void;
|
|
149
|
-
} & {
|
|
150
|
-
memoize: typeof import('@reduxjs/toolkit').weakMapMemoize;
|
|
151
|
-
argsMemoize: typeof import('@reduxjs/toolkit').weakMapMemoize;
|
|
152
|
-
};
|
|
153
|
-
}, selectOrganization: import('@reduxjs/toolkit').Selector<{
|
|
154
|
-
editor: EditorSlice;
|
|
155
|
-
}, Organization | undefined, []> & {
|
|
156
|
-
unwrapped: typeof selectCurrentOrganization;
|
|
157
|
-
};
|
|
158
|
-
export declare const setState: import('@reduxjs/toolkit').ActionCreatorWithPayload<{
|
|
159
|
-
uuid: string;
|
|
160
|
-
state?: Partial<Omit<EditorState, "uuid">>;
|
|
161
|
-
context?: string;
|
|
162
|
-
}, "editor/setState">, setOrganization: import('@reduxjs/toolkit').ActionCreatorWithPayload<{
|
|
163
|
-
organization: Organization | undefined;
|
|
164
|
-
}, "editor/setOrganization">, setInitialValue: import('@reduxjs/toolkit').ActionCreatorWithPayload<{
|
|
165
|
-
uuid: string;
|
|
166
|
-
initialValue: Descendant[];
|
|
167
|
-
}, "editor/setInitialValue">;
|
|
168
|
-
declare const _default: import('@reduxjs/toolkit').Reducer<EditorSlice>;
|
|
169
|
-
export default _default;
|
package/react/store/store.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { Action, Store, ThunkAction } from '@reduxjs/toolkit';
|
|
2
|
-
export declare const store: Store;
|
|
3
|
-
export type RootState = ReturnType<typeof store.getState>;
|
|
4
|
-
export type AppDispatch = typeof store.dispatch;
|
|
5
|
-
export type AppThunk<ReturnType = void> = ThunkAction<ReturnType, RootState, unknown, Action<string>>;
|
package/react/types.d.ts
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { BaseEditor } from 'slate';
|
|
2
|
-
import { ReactEditor } from 'slate-react';
|
|
3
|
-
import { Root } from '../../../cast/src/index.ts';
|
|
4
|
-
declare module "slate" {
|
|
5
|
-
interface CustomTypes {
|
|
6
|
-
Editor: BaseEditor & ReactEditor;
|
|
7
|
-
Element: DeltaElement;
|
|
8
|
-
Text: DeltaLeaf;
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
export interface DeltaLeafMarkdown {
|
|
12
|
-
title?: boolean;
|
|
13
|
-
}
|
|
14
|
-
export type DeltaElement = BlockquoteElement | CodeElement | ContentValueElement | HeadingElement | LinkElement | ListElement | ListItemElement | ParagraphElement;
|
|
15
|
-
export type DeltaLeaf = DeltaLeafMarkdown & {
|
|
16
|
-
text: string;
|
|
17
|
-
bold?: true;
|
|
18
|
-
italic?: true;
|
|
19
|
-
underline?: true;
|
|
20
|
-
strikethrough?: true;
|
|
21
|
-
inlineCode?: true;
|
|
22
|
-
highlight?: true;
|
|
23
|
-
};
|
|
24
|
-
export interface ParagraphElement {
|
|
25
|
-
type: "paragraph";
|
|
26
|
-
children: (ContentValueElement | DeltaLeaf | LinkElement)[];
|
|
27
|
-
}
|
|
28
|
-
export interface HeadingElement {
|
|
29
|
-
type: "heading";
|
|
30
|
-
level: 1 | 2 | 3 | 4 | 5 | 6;
|
|
31
|
-
children: DeltaLeaf[];
|
|
32
|
-
}
|
|
33
|
-
export interface ListElement {
|
|
34
|
-
type: "list";
|
|
35
|
-
ordered: boolean;
|
|
36
|
-
children: ListItemElement[];
|
|
37
|
-
}
|
|
38
|
-
export interface ListItemElement {
|
|
39
|
-
type: "listItem";
|
|
40
|
-
children: DeltaLeaf[];
|
|
41
|
-
}
|
|
42
|
-
export interface BlockquoteElement {
|
|
43
|
-
type: "blockquote";
|
|
44
|
-
children: DeltaLeaf[];
|
|
45
|
-
}
|
|
46
|
-
export interface CodeElement {
|
|
47
|
-
type: "code";
|
|
48
|
-
children: DeltaLeaf[];
|
|
49
|
-
}
|
|
50
|
-
export interface ContentValueElement {
|
|
51
|
-
type: "contentValue";
|
|
52
|
-
prn: string;
|
|
53
|
-
root: Root | undefined;
|
|
54
|
-
children: DeltaLeaf[];
|
|
55
|
-
}
|
|
56
|
-
export interface LinkElement {
|
|
57
|
-
type: "link";
|
|
58
|
-
url: string;
|
|
59
|
-
children: DeltaLeaf[];
|
|
60
|
-
target?: "_parent" | "_top" | "blank" | "self";
|
|
61
|
-
internal?: {
|
|
62
|
-
prn: string;
|
|
63
|
-
anchor?: boolean;
|
|
64
|
-
};
|
|
65
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { DeltaLeaf } from '../types';
|
|
2
|
-
export type Decorator<T> = (element: T, decorations: string[]) => string[];
|
|
3
|
-
export type LeafDecorator = Decorator<DeltaLeaf>;
|
|
4
|
-
declare function fontWeight(leaf: DeltaLeaf, decorations: string[]): string[];
|
|
5
|
-
declare function fontSize(leaf: DeltaLeaf, decorations: string[]): string[];
|
|
6
|
-
declare function fontStyle(leaf: DeltaLeaf, decorations: string[]): string[];
|
|
7
|
-
declare function textDecoration(leaf: DeltaLeaf, decorations: string[]): string[];
|
|
8
|
-
export declare class DecoratorBuilder<T extends object> {
|
|
9
|
-
private readonly element;
|
|
10
|
-
private readonly decorators;
|
|
11
|
-
constructor(element: T);
|
|
12
|
-
add(decorator: Decorator<T>): DecoratorBuilder<T>;
|
|
13
|
-
build(): (decorations: string[]) => string[];
|
|
14
|
-
}
|
|
15
|
-
export { fontSize, fontWeight, fontStyle, textDecoration };
|
package/react/utils/index.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { BaseEditor, Editor, Element } from 'slate';
|
|
2
|
-
import { DeltaLeaf, HeadingElement, ListElement } from '../types';
|
|
3
|
-
import { ReactEditor } from 'slate-react';
|
|
4
|
-
import { default as React } from 'react';
|
|
5
|
-
export declare function hasMark(editor: Editor, format: keyof Omit<DeltaLeaf, "text">): boolean;
|
|
6
|
-
export declare function toggleMark(editor: Editor, format: keyof Omit<DeltaLeaf, "text">): void;
|
|
7
|
-
export declare function isBlockActive(editor: BaseEditor & ReactEditor, format: "code" | "heading" | "list", properties?: {
|
|
8
|
-
level?: HeadingElement["level"];
|
|
9
|
-
ordered?: ListElement["ordered"];
|
|
10
|
-
}): boolean;
|
|
11
|
-
export declare function toggleBlock(editor: BaseEditor & ReactEditor, format: "code" | "heading" | "list", properties?: {
|
|
12
|
-
level?: HeadingElement["level"];
|
|
13
|
-
ordered?: ListElement["ordered"];
|
|
14
|
-
}): void;
|
|
15
|
-
export declare function useClickOutside(ref: React.RefObject<HTMLElement | null>, callback: () => void): void;
|
|
16
|
-
export declare function findElement(editor: Editor, elementType: string): [Element, number[]] | undefined;
|
|
17
|
-
export declare function hasElementSelected(editor: Editor, elementType: string): boolean;
|