@zipify/wysiwyg 4.1.0 → 4.2.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/.editorconfig +1 -1
- package/.eslintignore +1 -0
- package/.eslintrc.js +63 -4
- package/.github/actions/lint-css/action.yaml +2 -2
- package/.github/actions/lint-js/action.yaml +7 -7
- package/.github/actions/setup/action.yaml +6 -12
- package/.github/actions/unit-tests/action.yaml +2 -2
- package/.github/dependabot.yaml +12 -12
- package/.github/workflows/frontend-ci.yaml +58 -56
- package/config/build/cli.config.js +15 -12
- package/config/build/{example.config.mjs → example.config.ts} +4 -11
- package/config/build/{lib.config.mjs → lib.config.ts} +9 -14
- package/config/build/settings.js +9 -3
- package/dist/cli.js +17 -2
- package/dist/types/Wysiwyg.vue.d.ts +176 -0
- package/dist/types/components/base/Button.vue.d.ts +19 -0
- package/dist/types/components/base/ButtonToggle.vue.d.ts +19 -0
- package/dist/types/components/base/Checkbox.vue.d.ts +10 -0
- package/dist/types/components/base/FieldLabel.vue.d.ts +12 -0
- package/dist/types/components/base/Icon.vue.d.ts +11 -0
- package/dist/types/components/base/Modal.vue.d.ts +28 -0
- package/dist/types/components/base/ModalFloating.vue.d.ts +20 -0
- package/dist/types/components/base/NumberField.vue.d.ts +22 -0
- package/dist/types/components/base/Range.vue.d.ts +16 -0
- package/dist/types/components/base/ScrollView.vue.d.ts +7 -0
- package/dist/types/components/base/TextField.vue.d.ts +14 -0
- package/dist/types/components/base/colorPicker/ColorPicker.vue.d.ts +18 -0
- package/dist/types/components/base/colorPicker/composables/index.d.ts +2 -0
- package/dist/types/components/base/colorPicker/composables/usePickerApi.d.ts +14 -0
- package/dist/types/components/base/colorPicker/composables/usePickerHotkeys.d.ts +5 -0
- package/dist/types/components/base/colorPicker/index.d.ts +1 -0
- package/dist/types/components/base/composables/index.d.ts +8 -0
- package/dist/types/components/base/composables/useActivatedListener.d.ts +7 -0
- package/dist/types/components/base/composables/useDeselectionLock.d.ts +4 -0
- package/dist/types/components/base/composables/useElementRef.d.ts +1 -0
- package/dist/types/components/base/composables/useModalToggler.d.ts +9 -0
- package/dist/types/components/base/composables/useNumberValue.d.ts +12 -0
- package/dist/types/components/base/composables/useScrollView.d.ts +6 -0
- package/dist/types/components/base/composables/useTempValue.d.ts +4 -0
- package/dist/types/components/base/composables/useValidator.d.ts +7 -0
- package/dist/types/components/base/dropdown/Dropdown.vue.d.ts +22 -0
- package/dist/types/components/base/dropdown/DropdownActivator.vue.d.ts +17 -0
- package/dist/types/components/base/dropdown/DropdownDivider.vue.d.ts +2 -0
- package/dist/types/components/base/dropdown/DropdownGroup.vue.d.ts +14 -0
- package/dist/types/components/base/dropdown/DropdownMenu.vue.d.ts +14 -0
- package/dist/types/components/base/dropdown/DropdownOption.vue.d.ts +12 -0
- package/dist/types/components/base/dropdown/composables/index.d.ts +2 -0
- package/dist/types/components/base/dropdown/composables/useActiveOptionManager.d.ts +11 -0
- package/dist/types/components/base/dropdown/composables/useDropdownEntityTitle.d.ts +1 -0
- package/dist/types/components/base/dropdown/index.d.ts +1 -0
- package/dist/types/components/base/dropdown/injectionTokens.d.ts +5 -0
- package/dist/types/components/base/index.d.ts +3 -0
- package/dist/types/components/index.d.ts +1 -0
- package/dist/types/components/toolbar/Toolbar.vue.d.ts +17 -0
- package/dist/types/components/toolbar/ToolbarFloating.vue.d.ts +14 -0
- package/dist/types/components/toolbar/base/ToolbarDivider.vue.d.ts +32 -0
- package/dist/types/components/toolbar/base/ToolbarGroup.vue.d.ts +2 -0
- package/dist/types/components/toolbar/base/ToolbarRow.vue.d.ts +2 -0
- package/dist/types/components/toolbar/base/index.d.ts +1 -0
- package/dist/types/components/toolbar/controls/AlignmentControl.vue.d.ts +4 -0
- package/dist/types/components/toolbar/controls/BackgroundColorControl.vue.d.ts +2 -0
- package/dist/types/components/toolbar/controls/CaseStyleControl.vue.d.ts +2 -0
- package/dist/types/components/toolbar/controls/FontColorControl.vue.d.ts +2 -0
- package/dist/types/components/toolbar/controls/FontFamilyControl.vue.d.ts +2 -0
- package/dist/types/components/toolbar/controls/FontSizeControl.vue.d.ts +2 -0
- package/dist/types/components/toolbar/controls/FontWeightControl.vue.d.ts +2 -0
- package/dist/types/components/toolbar/controls/ItalicControl.vue.d.ts +2 -0
- package/dist/types/components/toolbar/controls/LineHeightControl.vue.d.ts +2 -0
- package/dist/types/components/toolbar/controls/ListControl.vue.d.ts +2 -0
- package/dist/types/components/toolbar/controls/RemoveFormatControl.vue.d.ts +2 -0
- package/dist/types/components/toolbar/controls/StrikeThroughControl.vue.d.ts +2 -0
- package/dist/types/components/toolbar/controls/SuperscriptControl.vue.d.ts +2 -0
- package/dist/types/components/toolbar/controls/UnderlineControl.vue.d.ts +2 -0
- package/dist/types/components/toolbar/controls/composables/index.d.ts +1 -0
- package/dist/types/components/toolbar/controls/composables/useRecentFonts.d.ts +7 -0
- package/dist/types/components/toolbar/controls/index.d.ts +2 -0
- package/dist/types/components/toolbar/controls/link/LinkControl.vue.d.ts +2 -0
- package/dist/types/components/toolbar/controls/link/LinkControlHeader.vue.d.ts +4 -0
- package/dist/types/components/toolbar/controls/link/composables/index.d.ts +1 -0
- package/dist/types/components/toolbar/controls/link/composables/useLink.d.ts +22 -0
- package/dist/types/components/toolbar/controls/link/destination/LinkControlDestination.vue.d.ts +10 -0
- package/dist/types/components/toolbar/controls/link/destination/LinkControlPageBlock.vue.d.ts +8 -0
- package/dist/types/components/toolbar/controls/link/destination/LinkControlUrl.vue.d.ts +12 -0
- package/dist/types/components/toolbar/controls/link/destination/index.d.ts +1 -0
- package/dist/types/components/toolbar/controls/link/index.d.ts +1 -0
- package/dist/types/components/toolbar/controls/stylePreset/StylePresetControl.vue.d.ts +2 -0
- package/dist/types/components/toolbar/controls/stylePreset/StylePresetOption.vue.d.ts +22 -0
- package/dist/types/components/toolbar/controls/stylePreset/index.d.ts +1 -0
- package/dist/types/components/toolbar/index.d.ts +1 -0
- package/dist/types/components/toolbar/layouts/ToolbarDesktop.vue.d.ts +7 -0
- package/dist/types/components/toolbar/layouts/ToolbarMobile.vue.d.ts +2 -0
- package/dist/types/components/toolbar/layouts/ToolbarPopup.vue.d.ts +7 -0
- package/dist/types/components/toolbar/layouts/index.d.ts +1 -0
- package/dist/types/composables/index.d.ts +2 -0
- package/dist/types/composables/useEditor.d.ts +15 -0
- package/dist/types/directives/index.d.ts +2 -0
- package/dist/types/directives/outClick.d.ts +9 -0
- package/dist/types/directives/tooltip.d.ts +4 -0
- package/{lib/entryLib.js → dist/types/entryLib.d.ts} +1 -1
- package/dist/types/enums/Alignments.d.ts +7 -0
- package/dist/types/enums/CaseStyles.d.ts +5 -0
- package/dist/types/enums/Devices.d.ts +7 -0
- package/dist/types/enums/LinkDestinations.d.ts +4 -0
- package/dist/types/enums/LinkTargets.d.ts +4 -0
- package/dist/types/enums/ListTypes.d.ts +10 -0
- package/dist/types/enums/MarkGroups.d.ts +4 -0
- package/dist/types/enums/NodeTypes.d.ts +9 -0
- package/dist/types/enums/TextSettings.d.ts +19 -0
- package/dist/types/enums/index.d.ts +9 -0
- package/dist/types/extensions/Alignment.d.ts +2 -0
- package/dist/types/extensions/BackgroundColor.d.ts +2 -0
- package/dist/types/extensions/CaseStyle.d.ts +2 -0
- package/dist/types/extensions/DeviceManager.d.ts +2 -0
- package/dist/types/extensions/FontColor.d.ts +2 -0
- package/dist/types/extensions/FontFamily.d.ts +4 -0
- package/dist/types/extensions/FontSize.d.ts +5 -0
- package/dist/types/extensions/FontStyle.d.ts +2 -0
- package/dist/types/extensions/FontWeight.d.ts +2 -0
- package/dist/types/extensions/LineHeight.d.ts +2 -0
- package/dist/types/extensions/Link.d.ts +1 -0
- package/dist/types/extensions/Margin.d.ts +2 -0
- package/dist/types/extensions/StylePreset.d.ts +2 -0
- package/dist/types/extensions/Superscript.d.ts +2 -0
- package/dist/types/extensions/TextDecoration.d.ts +2 -0
- package/dist/types/extensions/core/Document.d.ts +1 -0
- package/dist/types/extensions/core/Heading.d.ts +6 -0
- package/dist/types/extensions/core/NodeProcessor.d.ts +2 -0
- package/dist/types/extensions/core/Paragraph.d.ts +5 -0
- package/dist/types/extensions/core/SelectionProcessor.d.ts +4 -0
- package/dist/types/extensions/core/TextProcessor.d.ts +2 -0
- package/dist/types/extensions/core/index.d.ts +2 -0
- package/dist/types/extensions/index.d.ts +1 -0
- package/dist/types/extensions/list/List.d.ts +5 -0
- package/dist/types/extensions/list/ListItem.d.ts +5 -0
- package/dist/types/extensions/list/index.d.ts +1 -0
- package/dist/types/extensions/proseMirror/PasteLinkPlugin.d.ts +8 -0
- package/dist/types/extensions/proseMirror/PastePlugin.d.ts +22 -0
- package/dist/types/extensions/proseMirror/PlaceholderPlugin.d.ts +12 -0
- package/dist/types/extensions/proseMirror/ProseMirrorPlugin.d.ts +9 -0
- package/dist/types/extensions/proseMirror/index.d.ts +3 -0
- package/dist/types/extensions/steps/SetDocAttr.d.ts +19 -0
- package/dist/types/extensions/steps/index.d.ts +1 -0
- package/dist/types/injectionTokens.d.ts +8 -0
- package/dist/types/models/Font.d.ts +17 -0
- package/dist/types/models/index.d.ts +2 -0
- package/dist/types/regExps.d.ts +6 -0
- package/dist/types/services/ContentSerializer.d.ts +15 -0
- package/dist/types/services/ContextWindow.d.ts +8 -0
- package/dist/types/services/FavoriteColors.d.ts +8 -0
- package/dist/types/services/HtmlToJsonParser.d.ts +6 -0
- package/dist/types/services/JsonSerializer.d.ts +4 -0
- package/dist/types/services/NodeFactory.d.ts +128 -0
- package/dist/types/services/NodeSelector.d.ts +9 -0
- package/dist/types/services/Storage.d.ts +10 -0
- package/dist/types/services/StylePresetRenderer.d.ts +15 -0
- package/dist/types/services/index.d.ts +10 -0
- package/dist/types/services/normalizer/BaseNormalizer.d.ts +7 -0
- package/dist/types/services/normalizer/BrowserDomParser.d.ts +5 -0
- package/dist/types/services/normalizer/ContentNormalizer.d.ts +8 -0
- package/dist/types/services/normalizer/HtmlNormalizer.d.ts +41 -0
- package/dist/types/services/normalizer/JsonNormalizer.d.ts +14 -0
- package/dist/types/services/normalizer/index.d.ts +1 -0
- package/dist/types/utils/capitalize.d.ts +1 -0
- package/dist/types/utils/convertAlignment.d.ts +1 -0
- package/dist/types/utils/convertColor.d.ts +1 -0
- package/dist/types/utils/convertFontSize.d.ts +1 -0
- package/dist/types/utils/convertLineHeight.d.ts +1 -0
- package/dist/types/utils/copyMark.d.ts +1 -0
- package/dist/types/utils/createCommand.d.ts +1 -0
- package/dist/types/utils/createKeyboardShortcut.d.ts +3 -0
- package/dist/types/utils/findMarkByType.d.ts +1 -0
- package/dist/types/utils/importIcon.d.ts +1 -0
- package/{lib/utils/index.js → dist/types/utils/index.d.ts} +1 -0
- package/dist/types/utils/isMarkAppliedToParent.d.ts +1 -0
- package/dist/types/utils/isNodeFullySelected.d.ts +1 -0
- package/dist/types/utils/isWysiwygContent.d.ts +7 -0
- package/dist/types/utils/renderInlineSetting.d.ts +4 -0
- package/dist/types/utils/resolvePositionOffset.d.ts +1 -0
- package/dist/types/utils/resolveTextPosition.d.ts +4 -0
- package/dist/wysiwyg.d.ts +1 -0
- package/dist/wysiwyg.mjs +194 -152
- package/example/ExampleApp.vue +1 -1
- package/example/{example.js → example.ts} +1 -1
- package/example/index.html +1 -1
- package/jest.config.js +20 -5
- package/lib/Wysiwyg.vue +16 -12
- package/lib/components/base/__tests__/Modal.test.js +2 -2
- package/lib/composables/index.ts +2 -0
- package/lib/composables/{useEditor.js → useEditor.ts} +24 -7
- package/lib/entryLib.ts +6 -0
- package/lib/extensions/StylePreset.js +3 -3
- package/lib/models/{Font.js → Font.ts} +19 -8
- package/lib/models/index.ts +2 -0
- package/lib/utils/importIcon.js +1 -1
- package/lib/utils/index.ts +17 -0
- package/lib/utils/isWysiwygContent.ts +18 -0
- package/package.json +47 -33
- package/tsconfig.json +32 -0
- package/tsconfig.types.json +23 -0
- package/lib/composables/index.js +0 -1
- package/lib/models/index.js +0 -1
- package/lib/utils/isWysiwygContent.js +0 -12
- /package/lib/{entryCli.js → entryCli.ts} +0 -0
- /package/lib/models/__tests__/{Font.test.js → Font.test.ts} +0 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export class SetDocAttr extends Step {
|
|
2
|
+
static fromJSON(json: any): SetDocAttr;
|
|
3
|
+
constructor(key: any, value: any, schema: any, stepType?: string);
|
|
4
|
+
key: any;
|
|
5
|
+
value: any;
|
|
6
|
+
schema: any;
|
|
7
|
+
stepType: string;
|
|
8
|
+
apply(doc: any): StepResult;
|
|
9
|
+
prevValue: any;
|
|
10
|
+
invert(): SetDocAttr;
|
|
11
|
+
map(): null;
|
|
12
|
+
toJSON(): {
|
|
13
|
+
stepType: string;
|
|
14
|
+
key: any;
|
|
15
|
+
value: any;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
import { Step } from '@tiptap/pm/transform';
|
|
19
|
+
import { StepResult } from '@tiptap/pm/transform';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SetDocAttr } from "./SetDocAttr";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface IFontJson {
|
|
2
|
+
name: string;
|
|
3
|
+
category: string;
|
|
4
|
+
styles: string[];
|
|
5
|
+
}
|
|
6
|
+
export declare class Font {
|
|
7
|
+
name: string;
|
|
8
|
+
category: string;
|
|
9
|
+
styles: string[];
|
|
10
|
+
weights: string[];
|
|
11
|
+
constructor({ name, category, styles }: IFontJson);
|
|
12
|
+
private getWeights;
|
|
13
|
+
isWeightSupported(weight: string): boolean;
|
|
14
|
+
isItalicSupported(weight: string): boolean;
|
|
15
|
+
isWeightItalicOnly(weight: string): boolean;
|
|
16
|
+
findClosestWeight(searchingWeight: string): string;
|
|
17
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export class ContentSerializer {
|
|
2
|
+
static build({ config, nodeDomParser }: {
|
|
3
|
+
config: any;
|
|
4
|
+
nodeDomParser: any;
|
|
5
|
+
}): ContentSerializer;
|
|
6
|
+
constructor({ schema, domParser, nodeDomParser }: {
|
|
7
|
+
schema: any;
|
|
8
|
+
domParser: any;
|
|
9
|
+
nodeDomParser: any;
|
|
10
|
+
});
|
|
11
|
+
_schema: any;
|
|
12
|
+
_domParser: any;
|
|
13
|
+
_nodeDomParser: any;
|
|
14
|
+
toJSON(html: any): any;
|
|
15
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export class ContextWindow {
|
|
2
|
+
static window: Window & typeof globalThis;
|
|
3
|
+
static use(window: any): void;
|
|
4
|
+
static get document(): Document;
|
|
5
|
+
static get body(): HTMLElement;
|
|
6
|
+
static get head(): HTMLHeadElement;
|
|
7
|
+
static getComputedStyle(element: any): CSSStyleDeclaration;
|
|
8
|
+
}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {Object} NodeJson
|
|
3
|
+
* @property {String} type
|
|
4
|
+
* @property {Array<MarkJson>} [marks]
|
|
5
|
+
* @property {AttrsJson} [attrs]
|
|
6
|
+
*
|
|
7
|
+
* @typedef {Object} MarkJson
|
|
8
|
+
* @property {String} type
|
|
9
|
+
* @property {AttrsJson} attrs
|
|
10
|
+
*
|
|
11
|
+
* @typedef {Object} AttrsJson
|
|
12
|
+
*/
|
|
13
|
+
export class NodeFactory {
|
|
14
|
+
/**
|
|
15
|
+
* @param {Array<NodeJson>} content
|
|
16
|
+
* @returns {NodeJson}
|
|
17
|
+
*/
|
|
18
|
+
static doc(content: Array<NodeJson>): NodeJson;
|
|
19
|
+
/**
|
|
20
|
+
* @param {String} type
|
|
21
|
+
* @param {Array<String | NodeJson>} items
|
|
22
|
+
* @returns {NodeJson}
|
|
23
|
+
*/
|
|
24
|
+
static list(type: string, items: Array<string | NodeJson>): NodeJson;
|
|
25
|
+
/**
|
|
26
|
+
* @type {{
|
|
27
|
+
* ((content: String | NodeJson) => NodeJson);
|
|
28
|
+
* ((attrs: AttrsJson, content: String | NodeJson) => NodeJson);
|
|
29
|
+
* ((attrs: AttrsJson, marks: Array<MarkJson>, content: String | NodeJson) => NodeJson);
|
|
30
|
+
* }}
|
|
31
|
+
*/
|
|
32
|
+
static listItem(...args: any[]): {
|
|
33
|
+
content: {
|
|
34
|
+
marks?: any;
|
|
35
|
+
attrs?: any;
|
|
36
|
+
content: any;
|
|
37
|
+
type: "paragraph";
|
|
38
|
+
}[];
|
|
39
|
+
marks?: any;
|
|
40
|
+
attrs?: any;
|
|
41
|
+
type: "listItem";
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* @type {{
|
|
45
|
+
* ((level: Number, content: String | NodeJson) => NodeJson);
|
|
46
|
+
* ((level: Number, attrs: AttrsJson, content: String | NodeJson) => NodeJson);
|
|
47
|
+
* ((level: Number, attrs: AttrsJson, marks: Array<MarkJson>, content: String | NodeJson) => NodeJson);
|
|
48
|
+
* }}
|
|
49
|
+
*/
|
|
50
|
+
static heading(level: any, ...args: any[]): {
|
|
51
|
+
marks?: any;
|
|
52
|
+
attrs?: any;
|
|
53
|
+
content: any;
|
|
54
|
+
type: "heading";
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* @type {{
|
|
58
|
+
* ((content: String | NodeJson) => NodeJson);
|
|
59
|
+
* ((attrs: AttrsJson, content: String | NodeJson) => NodeJson);
|
|
60
|
+
* ((attrs: AttrsJson, marks: Array<MarkJson>, content: String | NodeJson) => NodeJson);
|
|
61
|
+
* }}
|
|
62
|
+
*/
|
|
63
|
+
static paragraph(...args: any[]): {
|
|
64
|
+
marks?: any;
|
|
65
|
+
attrs?: any;
|
|
66
|
+
content: any;
|
|
67
|
+
type: "paragraph";
|
|
68
|
+
};
|
|
69
|
+
static _textBlock(args: any): {
|
|
70
|
+
marks?: any;
|
|
71
|
+
attrs?: any;
|
|
72
|
+
content: any;
|
|
73
|
+
};
|
|
74
|
+
static _normalizeTextBlockArgs(args: any): {
|
|
75
|
+
attrs: any;
|
|
76
|
+
marks: any;
|
|
77
|
+
content: any;
|
|
78
|
+
};
|
|
79
|
+
/**
|
|
80
|
+
* @param {String} text
|
|
81
|
+
* @param {Array<MarkJson>} [marks]
|
|
82
|
+
* @returns {NodeJson}
|
|
83
|
+
*/
|
|
84
|
+
static text(text: string, marks?: MarkJson[] | undefined): NodeJson;
|
|
85
|
+
/**
|
|
86
|
+
* @typedef {'_self'|'_blank'} LinkTarget
|
|
87
|
+
* @typedef {'url'|'block'} LinkDestination
|
|
88
|
+
*
|
|
89
|
+
* @typedef {Object} LinkAttrs
|
|
90
|
+
* @property {LinkTarget} target
|
|
91
|
+
* @property {LinkDestination} destination
|
|
92
|
+
*/
|
|
93
|
+
/**
|
|
94
|
+
* @param {String} text
|
|
95
|
+
* @param {LinkAttrs} attrs
|
|
96
|
+
* @param {Array<MarkJson>} marks
|
|
97
|
+
* @returns {NodeJson}
|
|
98
|
+
*/
|
|
99
|
+
static link(text: string, attrs: {
|
|
100
|
+
target: "_blank" | "_self";
|
|
101
|
+
destination: "url" | "block";
|
|
102
|
+
}, marks?: Array<MarkJson>): NodeJson;
|
|
103
|
+
/**
|
|
104
|
+
* @param {String} type
|
|
105
|
+
* @param {AttrsJson} attrs
|
|
106
|
+
* @returns {MarkJson}
|
|
107
|
+
*/
|
|
108
|
+
static mark(type: string, attrs: AttrsJson): MarkJson;
|
|
109
|
+
/**
|
|
110
|
+
* @param {*} value
|
|
111
|
+
* @returns {{tablet, desktop, mobile}}
|
|
112
|
+
*/
|
|
113
|
+
static populateAllDevices(value: any): {
|
|
114
|
+
tablet;
|
|
115
|
+
desktop;
|
|
116
|
+
mobile;
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
export type NodeJson = {
|
|
120
|
+
type: string;
|
|
121
|
+
marks?: MarkJson[] | undefined;
|
|
122
|
+
attrs?: Object | undefined;
|
|
123
|
+
};
|
|
124
|
+
export type MarkJson = {
|
|
125
|
+
type: string;
|
|
126
|
+
attrs: AttrsJson;
|
|
127
|
+
};
|
|
128
|
+
export type AttrsJson = Object;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export class NodeSelector {
|
|
2
|
+
static _instance: any;
|
|
3
|
+
static get instance(): any;
|
|
4
|
+
static query(containerNode: any, selector: any): any;
|
|
5
|
+
query(containerNode: any, selector: any): any;
|
|
6
|
+
matchNode(node: any, selector: any): boolean;
|
|
7
|
+
getMark(node: any, selector: any): any;
|
|
8
|
+
matchMark(mark: any, selector: any): boolean;
|
|
9
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export class Storage {
|
|
2
|
+
constructor(storage: any);
|
|
3
|
+
nativeStorage: any;
|
|
4
|
+
KEY_PREFIX: string;
|
|
5
|
+
makeKey(key: any): string;
|
|
6
|
+
setItem(key: any, value: any): void;
|
|
7
|
+
getItem(key: any): any;
|
|
8
|
+
accessToStorage(action: any): any;
|
|
9
|
+
onPrivateModeEnabled(error: any): void;
|
|
10
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export class StylePresetRenderer {
|
|
2
|
+
constructor({ baseClass, makeVariable, linkPresetId }: {
|
|
3
|
+
baseClass: any;
|
|
4
|
+
makeVariable: any;
|
|
5
|
+
linkPresetId: any;
|
|
6
|
+
});
|
|
7
|
+
_baseClass: any;
|
|
8
|
+
_makeVariable: any;
|
|
9
|
+
_linkPresetId: any;
|
|
10
|
+
inject(hostEl: any, presets: any): void;
|
|
11
|
+
render(presets: any): string;
|
|
12
|
+
_makeInternalVariableName(setting: any, device: any): string;
|
|
13
|
+
makePresetHtmlClass(preset: any): any;
|
|
14
|
+
makePresetCssClass(preset: any): any;
|
|
15
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { JsonSerializer } from "./JsonSerializer";
|
|
2
|
+
export { ContentSerializer } from "./ContentSerializer";
|
|
3
|
+
export { Storage } from "./Storage";
|
|
4
|
+
export { FavoriteColors } from "./FavoriteColors";
|
|
5
|
+
export { ContentNormalizer } from "./normalizer";
|
|
6
|
+
export { ContextWindow } from "./ContextWindow";
|
|
7
|
+
export { NodeFactory } from "./NodeFactory";
|
|
8
|
+
export { HtmlToJsonParser } from "./HtmlToJsonParser";
|
|
9
|
+
export { StylePresetRenderer } from "./StylePresetRenderer";
|
|
10
|
+
export { NodeSelector } from "./NodeSelector";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export class ContentNormalizer {
|
|
2
|
+
static build(content: any, options?: {}): HtmlNormalizer | JsonNormalizer;
|
|
3
|
+
static _buildHtml(content: any, options: any): HtmlNormalizer;
|
|
4
|
+
static _buildJson(content: any): JsonNormalizer;
|
|
5
|
+
static normalize(content: any, options?: {}): any;
|
|
6
|
+
}
|
|
7
|
+
import { HtmlNormalizer } from './HtmlNormalizer';
|
|
8
|
+
import { JsonNormalizer } from './JsonNormalizer';
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export class HtmlNormalizer extends BaseNormalizer {
|
|
2
|
+
static BLOCK_NODE_NAMES: string[];
|
|
3
|
+
static ROOT_NODE_NAMES: string[];
|
|
4
|
+
static BLOCK_STYLES: string[];
|
|
5
|
+
constructor({ content, parser }: {
|
|
6
|
+
content: any;
|
|
7
|
+
parser: any;
|
|
8
|
+
});
|
|
9
|
+
_parser: any;
|
|
10
|
+
dom: any;
|
|
11
|
+
normalize(): any;
|
|
12
|
+
normalizeHTML(): void;
|
|
13
|
+
get normalizedHTML(): any;
|
|
14
|
+
get _NodeFilter(): any;
|
|
15
|
+
get _Node(): any;
|
|
16
|
+
_removeComments(): void;
|
|
17
|
+
_normalizeRootTags(): void;
|
|
18
|
+
_createNodeIterator(whatToShow: any, filter: any): any;
|
|
19
|
+
_iterateNodes(handler: any, condition?: () => boolean): void;
|
|
20
|
+
_runIterator(iterator: any, handler: any): void;
|
|
21
|
+
_removeEmptyNodes(node: any): void;
|
|
22
|
+
_normalizeListItems(itemEl: any): void;
|
|
23
|
+
_isBlockNode(node: any): boolean;
|
|
24
|
+
_isRootNode(node: any): boolean;
|
|
25
|
+
_assignElementProperties(target: any, source: any, properties?: any[]): void;
|
|
26
|
+
_removeStyleProperties(element: any, properties?: any[]): void;
|
|
27
|
+
_normalizeBreakLines({ parentElement }: {
|
|
28
|
+
parentElement: any;
|
|
29
|
+
}): void;
|
|
30
|
+
_normalizeBlockTextDecoration(): void;
|
|
31
|
+
_moveTextDecorationToChildren(blockEl: any): void;
|
|
32
|
+
_parseTextDecoration(element: any): {
|
|
33
|
+
none: any;
|
|
34
|
+
underline: any;
|
|
35
|
+
line_through: any;
|
|
36
|
+
};
|
|
37
|
+
_normalizeBlockBackgroundColor(): void;
|
|
38
|
+
_moveBackgroundColorToChildren(blockEl: any): void;
|
|
39
|
+
_wrapTextNode(parent: any, node: any): any;
|
|
40
|
+
}
|
|
41
|
+
import { BaseNormalizer } from './BaseNormalizer';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export class JsonNormalizer extends BaseNormalizer {
|
|
2
|
+
normalize(): any;
|
|
3
|
+
_iterateNodes(handler: any): void;
|
|
4
|
+
_iterateChildNodes(node: any, handler: any): void;
|
|
5
|
+
_bubbleMarks(node: any): void;
|
|
6
|
+
_canBubbleMark(node: any, childMark: any): boolean;
|
|
7
|
+
_includesMark(node: any, checkingMark: any): any;
|
|
8
|
+
_includesMarkType(node: any, type: any): any;
|
|
9
|
+
_isLink(node: any): any;
|
|
10
|
+
_removeMark(node: any, mark: any): void;
|
|
11
|
+
_addMark(node: any, mark: any): void;
|
|
12
|
+
_findMarkIndexByType(node: any, type: any): any;
|
|
13
|
+
}
|
|
14
|
+
import { BaseNormalizer } from './BaseNormalizer';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ContentNormalizer } from "./ContentNormalizer";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function capitalize(text: any): any;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function convertAlignment(alignment: any): any;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function convertColor(raw: any): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function convertFontSize(value: any, wrapperEl: any): number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function convertLineHeight(value: any, sourceEl: any, wrapperEl: any): any;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function copyMark(mark: any): any;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function createCommand(exec: any): (...args: any[]) => (context: any) => any;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function findMarkByType(list: any, typeOrName: any): any;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function importIcon(name: any): any;
|
|
@@ -8,6 +8,7 @@ export { convertFontSize } from './convertFontSize';
|
|
|
8
8
|
export { convertAlignment } from './convertAlignment';
|
|
9
9
|
export { importIcon } from './importIcon';
|
|
10
10
|
export { isWysiwygContent, markWysiwygContent, unmarkWysiwygContent } from './isWysiwygContent';
|
|
11
|
+
export type { WysiwygContent } from './isWysiwygContent';
|
|
11
12
|
export { resolveTextPosition } from './resolveTextPosition';
|
|
12
13
|
export { resolvePositionOffset } from './resolvePositionOffset';
|
|
13
14
|
export { isNodeFullySelected } from './isNodeFullySelected';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function isMarkAppliedToParent(doc: any, position: any, checkingMark: any, comparator?: (parentMark: any, mark: any) => any): boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function isNodeFullySelected(doc: any, selection: any, node: any, position: any): boolean;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { JSONContent } from '@tiptap/core';
|
|
2
|
+
export interface WysiwygContent extends JSONContent {
|
|
3
|
+
__wswg__: true;
|
|
4
|
+
}
|
|
5
|
+
export declare function isWysiwygContent(content: string | object): content is JSONContent;
|
|
6
|
+
export declare function unmarkWysiwygContent({ __wswg__, ...content }: WysiwygContent): JSONContent;
|
|
7
|
+
export declare function markWysiwygContent(content: JSONContent): WysiwygContent;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function resolvePositionOffset(doc: any, position: any): any;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type * from './types/entryLib';
|