@ni/nimble-components 20.1.13 → 20.1.15
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/dist/all-components-bundle.js +8895 -8329
- package/dist/all-components-bundle.js.map +1 -1
- package/dist/all-components-bundle.min.js +1584 -1524
- package/dist/all-components-bundle.min.js.map +1 -1
- package/dist/esm/rich-text-editor/index.d.ts +24 -1
- package/dist/esm/rich-text-editor/index.js +100 -1
- package/dist/esm/rich-text-editor/index.js.map +1 -1
- package/dist/esm/rich-text-editor/styles.js +4 -0
- package/dist/esm/rich-text-editor/styles.js.map +1 -1
- package/dist/esm/rich-text-editor/template.js +1 -5
- package/dist/esm/rich-text-editor/template.js.map +1 -1
- package/dist/esm/rich-text-editor/testing/rich-text-editor.pageobject.d.ts +11 -10
- package/dist/esm/rich-text-editor/testing/rich-text-editor.pageobject.js +20 -20
- package/dist/esm/rich-text-editor/testing/rich-text-editor.pageobject.js.map +1 -1
- package/dist/esm/src/rich-text-editor/index.d.ts +24 -1
- package/dist/esm/src/rich-text-editor/testing/rich-text-editor.pageobject.d.ts +11 -10
- package/dist/esm/src/table-column/number-text/index.d.ts +6 -1
- package/dist/esm/src/table-column/number-text/types.d.ts +10 -0
- package/dist/esm/src/table-column/text-base/cell-view/index.d.ts +5 -0
- package/dist/esm/src/table-column/text-base/cell-view/types.d.ts +8 -0
- package/dist/esm/table-column/number-text/cell-view/index.js +2 -0
- package/dist/esm/table-column/number-text/cell-view/index.js.map +1 -1
- package/dist/esm/table-column/number-text/index.d.ts +6 -1
- package/dist/esm/table-column/number-text/index.js +23 -2
- package/dist/esm/table-column/number-text/index.js.map +1 -1
- package/dist/esm/table-column/number-text/types.d.ts +10 -0
- package/dist/esm/table-column/number-text/types.js +9 -0
- package/dist/esm/table-column/number-text/types.js.map +1 -1
- package/dist/esm/table-column/text-base/cell-view/index.d.ts +5 -0
- package/dist/esm/table-column/text-base/cell-view/index.js +8 -0
- package/dist/esm/table-column/text-base/cell-view/index.js.map +1 -1
- package/dist/esm/table-column/text-base/cell-view/styles.js +4 -0
- package/dist/esm/table-column/text-base/cell-view/styles.js.map +1 -1
- package/dist/esm/table-column/text-base/cell-view/template.js +12 -5
- package/dist/esm/table-column/text-base/cell-view/template.js.map +1 -1
- package/dist/esm/table-column/text-base/cell-view/types.d.ts +8 -0
- package/dist/esm/table-column/text-base/cell-view/types.js +8 -0
- package/dist/esm/table-column/text-base/cell-view/types.js.map +1 -0
- package/package.json +1 -1
|
@@ -28,8 +28,14 @@ export declare class RichTextEditor extends FoundationElement {
|
|
|
28
28
|
/**
|
|
29
29
|
* @internal
|
|
30
30
|
*/
|
|
31
|
-
|
|
31
|
+
editorContainer: HTMLDivElement;
|
|
32
32
|
private tiptapEditor;
|
|
33
|
+
private editor;
|
|
34
|
+
private readonly markdownParser;
|
|
35
|
+
private readonly markdownSerializer;
|
|
36
|
+
private readonly domSerializer;
|
|
37
|
+
private readonly xmlSerializer;
|
|
38
|
+
constructor();
|
|
33
39
|
/**
|
|
34
40
|
* @internal
|
|
35
41
|
*/
|
|
@@ -78,10 +84,27 @@ export declare class RichTextEditor extends FoundationElement {
|
|
|
78
84
|
* @internal
|
|
79
85
|
*/
|
|
80
86
|
numberedListButtonKeyDown(event: KeyboardEvent): boolean;
|
|
87
|
+
/**
|
|
88
|
+
* This function load tip tap editor with provided markdown content by parsing into html
|
|
89
|
+
* @public
|
|
90
|
+
*/
|
|
91
|
+
setMarkdown(markdown: string): void;
|
|
92
|
+
/**
|
|
93
|
+
* This function returns markdown string by serializing tiptap editor document using prosemirror MarkdownSerializer
|
|
94
|
+
* @public
|
|
95
|
+
*/
|
|
96
|
+
getMarkdown(): string;
|
|
81
97
|
/**
|
|
82
98
|
* @internal
|
|
83
99
|
*/
|
|
84
100
|
stopEventPropagation(event: Event): boolean;
|
|
101
|
+
/**
|
|
102
|
+
* This function takes the Fragment from parseMarkdownToDOM function and return the serialized string using XMLSerializer
|
|
103
|
+
*/
|
|
104
|
+
private getHtmlContent;
|
|
105
|
+
private initializeMarkdownParser;
|
|
106
|
+
private initializeMarkdownSerializer;
|
|
107
|
+
private parseMarkdownToDOM;
|
|
85
108
|
private initializeEditor;
|
|
86
109
|
/**
|
|
87
110
|
* Binding the "transaction" event to the editor allows continuous monitoring the events and updating the button state in response to
|
|
@@ -3,6 +3,8 @@ import { observable } from '@microsoft/fast-element';
|
|
|
3
3
|
import { DesignSystem, FoundationElement } from '@microsoft/fast-foundation';
|
|
4
4
|
import { keyEnter, keySpace } from '@microsoft/fast-web-utilities';
|
|
5
5
|
import { Editor } from '@tiptap/core';
|
|
6
|
+
import { schema, defaultMarkdownParser, MarkdownParser, MarkdownSerializer, defaultMarkdownSerializer } from 'prosemirror-markdown';
|
|
7
|
+
import { DOMSerializer } from 'prosemirror-model';
|
|
6
8
|
import Bold from '@tiptap/extension-bold';
|
|
7
9
|
import BulletList from '@tiptap/extension-bullet-list';
|
|
8
10
|
import Document from '@tiptap/extension-document';
|
|
@@ -18,12 +20,22 @@ import { styles } from './styles';
|
|
|
18
20
|
* A nimble styled rich text editor
|
|
19
21
|
*/
|
|
20
22
|
export class RichTextEditor extends FoundationElement {
|
|
23
|
+
constructor() {
|
|
24
|
+
super();
|
|
25
|
+
this.markdownParser = this.initializeMarkdownParser();
|
|
26
|
+
this.markdownSerializer = this.initializeMarkdownSerializer();
|
|
27
|
+
this.domSerializer = DOMSerializer.fromSchema(schema);
|
|
28
|
+
this.xmlSerializer = new XMLSerializer();
|
|
29
|
+
this.initializeEditor();
|
|
30
|
+
}
|
|
21
31
|
/**
|
|
22
32
|
* @internal
|
|
23
33
|
*/
|
|
24
34
|
connectedCallback() {
|
|
25
35
|
super.connectedCallback();
|
|
26
|
-
this.
|
|
36
|
+
if (!this.editor.isConnected) {
|
|
37
|
+
this.editorContainer.append(this.editor);
|
|
38
|
+
}
|
|
27
39
|
this.bindEditorTransactionEvent();
|
|
28
40
|
}
|
|
29
41
|
/**
|
|
@@ -105,6 +117,22 @@ export class RichTextEditor extends FoundationElement {
|
|
|
105
117
|
}
|
|
106
118
|
return true;
|
|
107
119
|
}
|
|
120
|
+
/**
|
|
121
|
+
* This function load tip tap editor with provided markdown content by parsing into html
|
|
122
|
+
* @public
|
|
123
|
+
*/
|
|
124
|
+
setMarkdown(markdown) {
|
|
125
|
+
const html = this.getHtmlContent(markdown);
|
|
126
|
+
this.tiptapEditor.commands.setContent(html);
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* This function returns markdown string by serializing tiptap editor document using prosemirror MarkdownSerializer
|
|
130
|
+
* @public
|
|
131
|
+
*/
|
|
132
|
+
getMarkdown() {
|
|
133
|
+
const markdownContent = this.markdownSerializer.serialize(this.tiptapEditor.state.doc);
|
|
134
|
+
return markdownContent;
|
|
135
|
+
}
|
|
108
136
|
/**
|
|
109
137
|
* @internal
|
|
110
138
|
*/
|
|
@@ -114,7 +142,78 @@ export class RichTextEditor extends FoundationElement {
|
|
|
114
142
|
event.stopPropagation();
|
|
115
143
|
return false;
|
|
116
144
|
}
|
|
145
|
+
/**
|
|
146
|
+
* This function takes the Fragment from parseMarkdownToDOM function and return the serialized string using XMLSerializer
|
|
147
|
+
*/
|
|
148
|
+
getHtmlContent(markdown) {
|
|
149
|
+
const documentFragment = this.parseMarkdownToDOM(markdown);
|
|
150
|
+
return this.xmlSerializer.serializeToString(documentFragment);
|
|
151
|
+
}
|
|
152
|
+
initializeMarkdownParser() {
|
|
153
|
+
/**
|
|
154
|
+
* It configures the tokenizer of the default Markdown parser with the 'zero' preset.
|
|
155
|
+
* The 'zero' preset is a configuration with no rules enabled by default to selectively enable specific rules.
|
|
156
|
+
* https://github.com/markdown-it/markdown-it/blob/2b6cac25823af011ff3bc7628bc9b06e483c5a08/lib/presets/zero.js#L1
|
|
157
|
+
*
|
|
158
|
+
*/
|
|
159
|
+
const zeroTokenizerConfiguration = defaultMarkdownParser.tokenizer.configure('zero');
|
|
160
|
+
// The detailed information of the supported rules were provided in the below CommonMark spec document.
|
|
161
|
+
// https://spec.commonmark.org/0.30/
|
|
162
|
+
const supportedTokenizerRules = zeroTokenizerConfiguration.enable([
|
|
163
|
+
'emphasis',
|
|
164
|
+
'list'
|
|
165
|
+
]);
|
|
166
|
+
return new MarkdownParser(schema, supportedTokenizerRules, defaultMarkdownParser.tokens);
|
|
167
|
+
}
|
|
168
|
+
initializeMarkdownSerializer() {
|
|
169
|
+
/**
|
|
170
|
+
* orderedList Node is getting 'order' attribute which it is not present in the
|
|
171
|
+
* tip-tap orderedList Node and having start instead of order, Changed it to start (nodes.attrs.start)
|
|
172
|
+
* Assigned updated node in place of orderedList node from defaultMarkdownSerializer
|
|
173
|
+
* https://github.com/ProseMirror/prosemirror-markdown/blob/b7c1fd2fb74c7564bfe5428c7c8141ded7ebdd9f/src/to_markdown.ts#L94C2-L101C7
|
|
174
|
+
*/
|
|
175
|
+
const orderedListNode = function orderedList(state, node) {
|
|
176
|
+
const start = node.attrs.start || 1;
|
|
177
|
+
const maxW = String(start + node.childCount - 1).length;
|
|
178
|
+
const space = state.repeat(' ', maxW + 2);
|
|
179
|
+
state.renderList(node, space, i => {
|
|
180
|
+
const nStr = String(start + i);
|
|
181
|
+
return `${state.repeat(' ', maxW - nStr.length) + nStr}. `;
|
|
182
|
+
});
|
|
183
|
+
};
|
|
184
|
+
/**
|
|
185
|
+
* Internally Tiptap editor creates it own schema ( Nodes AND Marks ) based on the extensions ( Here Starter Kit is used for Bold, italic, orderedList and
|
|
186
|
+
* bulletList extensions) and defaultMarkdownSerializer uses schema from prosemirror-markdown to serialize the markdown.
|
|
187
|
+
* So, there is variations in the nodes and marks name (Eg. 'ordered_list' in prosemirror-markdown schema whereas 'orderedList' in tip tap editor schema),
|
|
188
|
+
* To fix up this reassigned the respective nodes and marks with tip-tap editor schema.
|
|
189
|
+
*/
|
|
190
|
+
const nodes = {
|
|
191
|
+
bulletList: defaultMarkdownSerializer.nodes.bullet_list,
|
|
192
|
+
listItem: defaultMarkdownSerializer.nodes.list_item,
|
|
193
|
+
orderedList: orderedListNode,
|
|
194
|
+
doc: defaultMarkdownSerializer.nodes.doc,
|
|
195
|
+
paragraph: defaultMarkdownSerializer.nodes.paragraph,
|
|
196
|
+
text: defaultMarkdownSerializer.nodes.text
|
|
197
|
+
};
|
|
198
|
+
const marks = {
|
|
199
|
+
italic: defaultMarkdownSerializer.marks.em,
|
|
200
|
+
bold: defaultMarkdownSerializer.marks.strong
|
|
201
|
+
};
|
|
202
|
+
return new MarkdownSerializer(nodes, marks);
|
|
203
|
+
}
|
|
204
|
+
parseMarkdownToDOM(value) {
|
|
205
|
+
const parsedMarkdownContent = this.markdownParser.parse(value);
|
|
206
|
+
if (parsedMarkdownContent === null) {
|
|
207
|
+
return document.createDocumentFragment();
|
|
208
|
+
}
|
|
209
|
+
return this.domSerializer.serializeFragment(parsedMarkdownContent.content);
|
|
210
|
+
}
|
|
117
211
|
initializeEditor() {
|
|
212
|
+
// Create div from the constructor because the TipTap editor requires its host element before the template is instantiated.
|
|
213
|
+
this.editor = document.createElement('div');
|
|
214
|
+
this.editor.className = 'editor';
|
|
215
|
+
this.editor.setAttribute('aria-multiline', 'true');
|
|
216
|
+
this.editor.setAttribute('role', 'textbox');
|
|
118
217
|
/**
|
|
119
218
|
* For more information on the extensions for the supported formatting options, refer to the links below.
|
|
120
219
|
* Tiptap marks: https://tiptap.dev/api/marks
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/rich-text-editor/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC7E,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,IAAI,MAAM,wBAAwB,CAAC;AAC1C,OA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;;;;;;4BAOrC,WAAW;;;;;yBAKd,gBAAgB;;4BAEb,UAAU;;;;+BAIP,gBAAgB;;;;;;;;;;;;;;kBAc7B,WAAW
|
|
1
|
+
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/rich-text-editor/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACrD,OAAO,EACH,QAAQ,EACR,aAAa,EACb,gBAAgB,EAChB,qBAAqB,EACrB,WAAW,EACX,UAAU,EACV,eAAe,EAClB,MAAM,iCAAiC,CAAC;AAEzC,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;MACnB,OAAO,CAAC,aAAa,CAAC;;;gBAGZ,QAAQ;;iBAEP,aAAa;;;cAGhB,WAAW;;;UAGf;AACE,qHAAqH,CAAC,EAC1H;;;;;;;;;kBASU,WAAW,eAAe,qBAAqB;;;;;;;4BAOrC,WAAW;;;;;yBAKd,gBAAgB;;4BAEb,UAAU;;;;+BAIP,gBAAgB;;;;;;;;;;;;;;kBAc7B,WAAW;;;;;;;;;;;;;UAanB;AACE;;;GAGG,CAAC,EACR;;;;kBAIU,WAAW;;;;;;;;;;MAUvB;AACE;;;;;GAKG,CAAC,EACR;;;;;;;;;;;;;;;;;MAiBE,CAAA,+DAAgE,EAAE;;;;;;;;;;;;;;;;;;;;;kBAqBtD,WAAW;iCACI,qBAAqB;;;;;;;;;;;;;;;;;6BAiBzB,eAAe;eAC7B,eAAe;;;CAG7B,CAAC"}
|
|
@@ -9,11 +9,7 @@ import { iconNumberListTag } from '../icons/number-list';
|
|
|
9
9
|
export const template = html `
|
|
10
10
|
<template>
|
|
11
11
|
<div class="container">
|
|
12
|
-
<section
|
|
13
|
-
${ref('editor')}
|
|
14
|
-
class="editor"
|
|
15
|
-
role="textbox"
|
|
16
|
-
aria-multiline="true">
|
|
12
|
+
<section ${ref('editorContainer')} class="editor-container">
|
|
17
13
|
</section>
|
|
18
14
|
<section class="footer-section" part="footer-section">
|
|
19
15
|
<${toolbarTag}>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template.js","sourceRoot":"","sources":["../../../src/rich-text-editor/template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAEpD,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,kBAAkB;AAClB,MAAM,CAAC,MAAM,QAAQ,GAAG,IAAI,CAAgB
|
|
1
|
+
{"version":3,"file":"template.js","sourceRoot":"","sources":["../../../src/rich-text-editor/template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAEpD,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,kBAAkB;AAClB,MAAM,CAAC,MAAM,QAAQ,GAAG,IAAI,CAAgB;;;uBAGrB,GAAG,CAAC,iBAAiB,CAAC;;;mBAG1B,UAAU;uBACN,eAAe;0BACZ,GAAG,CAAC,YAAY,CAAC;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CACxC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,yBAAyB,CAAC,CAAC,CAAC,KAAsB,CAAC;;;2BAGvE,iBAAiB,mBAAmB,iBAAiB;wBACxD,eAAe;oBACnB,UAAU;;;;;;;CAO7B,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { RichTextEditor } from '..';
|
|
2
|
+
import type { ToolbarButton } from './types';
|
|
2
3
|
/**
|
|
3
4
|
* Page object for the `nimble-rich-text-editor` component.
|
|
4
5
|
*/
|
|
@@ -13,29 +14,29 @@ export declare class RichTextEditorPageObject {
|
|
|
13
14
|
pressShiftTabKeysInEditor(): Promise<void>;
|
|
14
15
|
/**
|
|
15
16
|
* To click a formatting button in the footer section, pass its position value as an index (starting from '0')
|
|
16
|
-
* @param
|
|
17
|
+
* @param button can be imported from an enum for each button using the `ButtonIndex`.
|
|
17
18
|
*/
|
|
18
|
-
clickFooterButton(
|
|
19
|
+
clickFooterButton(button: ToolbarButton): Promise<void>;
|
|
19
20
|
/**
|
|
20
21
|
* To retrieve the checked state of the button, provide its position value as an index (starting from '0')
|
|
21
|
-
* @param
|
|
22
|
+
* @param button can be imported from an enum for each button using the `ButtonIndex`.
|
|
22
23
|
*/
|
|
23
|
-
getButtonCheckedState(
|
|
24
|
+
getButtonCheckedState(button: ToolbarButton): boolean;
|
|
24
25
|
/**
|
|
25
26
|
* To retrieve the tab index of the button, provide its position value as an index (starting from '0')
|
|
26
|
-
* @param
|
|
27
|
+
* @param button can be imported from an enum for each button using the `ButtonIndex`.
|
|
27
28
|
*/
|
|
28
|
-
getButtonTabIndex(
|
|
29
|
+
getButtonTabIndex(button: ToolbarButton): number;
|
|
29
30
|
/**
|
|
30
31
|
* To trigger a space key press for the button, provide its position value as an index (starting from '0')
|
|
31
|
-
* @param
|
|
32
|
+
* @param button can be imported from an enum for each button using the `ButtonIndex`.
|
|
32
33
|
*/
|
|
33
|
-
spaceKeyActivatesButton(
|
|
34
|
+
spaceKeyActivatesButton(button: ToolbarButton): void;
|
|
34
35
|
/**
|
|
35
36
|
* To trigger a enter key press for the button, provide its position value as an index (starting from '0')
|
|
36
|
-
* @param
|
|
37
|
+
* @param button can be imported from an enum for each button using the `ButtonIndex`.
|
|
37
38
|
*/
|
|
38
|
-
enterKeyActivatesButton(
|
|
39
|
+
enterKeyActivatesButton(button: ToolbarButton): void;
|
|
39
40
|
setEditorTextContent(value: string): Promise<void>;
|
|
40
41
|
getEditorFirstChildTagName(): string;
|
|
41
42
|
getEditorFirstChildTextContent(): string;
|
|
@@ -60,50 +60,50 @@ export class RichTextEditorPageObject {
|
|
|
60
60
|
}
|
|
61
61
|
/**
|
|
62
62
|
* To click a formatting button in the footer section, pass its position value as an index (starting from '0')
|
|
63
|
-
* @param
|
|
63
|
+
* @param button can be imported from an enum for each button using the `ButtonIndex`.
|
|
64
64
|
*/
|
|
65
|
-
async clickFooterButton(
|
|
66
|
-
const
|
|
67
|
-
|
|
65
|
+
async clickFooterButton(button) {
|
|
66
|
+
const toggleButton = this.getFormattingButton(button);
|
|
67
|
+
toggleButton.click();
|
|
68
68
|
await waitForUpdatesAsync();
|
|
69
69
|
}
|
|
70
70
|
/**
|
|
71
71
|
* To retrieve the checked state of the button, provide its position value as an index (starting from '0')
|
|
72
|
-
* @param
|
|
72
|
+
* @param button can be imported from an enum for each button using the `ButtonIndex`.
|
|
73
73
|
*/
|
|
74
|
-
getButtonCheckedState(
|
|
75
|
-
const
|
|
76
|
-
return
|
|
74
|
+
getButtonCheckedState(button) {
|
|
75
|
+
const toggleButton = this.getFormattingButton(button);
|
|
76
|
+
return toggleButton.checked;
|
|
77
77
|
}
|
|
78
78
|
/**
|
|
79
79
|
* To retrieve the tab index of the button, provide its position value as an index (starting from '0')
|
|
80
|
-
* @param
|
|
80
|
+
* @param button can be imported from an enum for each button using the `ButtonIndex`.
|
|
81
81
|
*/
|
|
82
|
-
getButtonTabIndex(
|
|
83
|
-
const
|
|
84
|
-
return
|
|
82
|
+
getButtonTabIndex(button) {
|
|
83
|
+
const toggleButton = this.getFormattingButton(button);
|
|
84
|
+
return toggleButton.tabIndex;
|
|
85
85
|
}
|
|
86
86
|
/**
|
|
87
87
|
* To trigger a space key press for the button, provide its position value as an index (starting from '0')
|
|
88
|
-
* @param
|
|
88
|
+
* @param button can be imported from an enum for each button using the `ButtonIndex`.
|
|
89
89
|
*/
|
|
90
|
-
spaceKeyActivatesButton(
|
|
91
|
-
const
|
|
90
|
+
spaceKeyActivatesButton(button) {
|
|
91
|
+
const toggleButton = this.getFormattingButton(button);
|
|
92
92
|
const event = new KeyboardEvent('keypress', {
|
|
93
93
|
key: keySpace
|
|
94
94
|
});
|
|
95
|
-
|
|
95
|
+
toggleButton.control.dispatchEvent(event);
|
|
96
96
|
}
|
|
97
97
|
/**
|
|
98
98
|
* To trigger a enter key press for the button, provide its position value as an index (starting from '0')
|
|
99
|
-
* @param
|
|
99
|
+
* @param button can be imported from an enum for each button using the `ButtonIndex`.
|
|
100
100
|
*/
|
|
101
|
-
enterKeyActivatesButton(
|
|
102
|
-
const
|
|
101
|
+
enterKeyActivatesButton(button) {
|
|
102
|
+
const toggleButton = this.getFormattingButton(button);
|
|
103
103
|
const event = new KeyboardEvent('keypress', {
|
|
104
104
|
key: keyEnter
|
|
105
105
|
});
|
|
106
|
-
|
|
106
|
+
toggleButton.control.dispatchEvent(event);
|
|
107
107
|
}
|
|
108
108
|
async setEditorTextContent(value) {
|
|
109
109
|
let lastElement = this.getTiptapEditor()?.lastElementChild;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rich-text-editor.pageobject.js","sourceRoot":"","sources":["../../../../src/rich-text-editor/testing/rich-text-editor.pageobject.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AAE3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"rich-text-editor.pageobject.js","sourceRoot":"","sources":["../../../../src/rich-text-editor/testing/rich-text-editor.pageobject.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AAE3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAIlE;;GAEG;AACH,MAAM,OAAO,wBAAwB;IACjC,YACqB,qBAAqC;QAArC,0BAAqB,GAArB,qBAAqB,CAAgB;IACvD,CAAC;IAEG,0BAA0B;QAC7B,MAAM,aAAa,GAAG,IAAI,CAAC,gBAAgB,EAAE,CAAC;QAC9C,OAAO,aAAc,CAAC,aAAa,EAAE,CAAC;IAC1C,CAAC;IAEM,0CAA0C;QAC7C,MAAM,aAAa,GAAG,IAAI,CAAC,gBAAgB,EAAE,CAAC;QAC9C,OAAO,aAAc,CAAC,iBAAkB,CAAC,SAAS,CAAC;IACvD,CAAC;IAEM,KAAK,CAAC,uBAAuB,CAChC,WAAmB,EACnB,UAAmB;QAEnB,MAAM,MAAM,GAAG,IAAI,CAAC,eAAe,EAAE,CAAC;QACtC,MAAM,KAAK,GAAG,IAAI,aAAa,CAAC,SAAS,EAAE;YACvC,GAAG,EAAE,WAAW;YAChB,OAAO,EAAE,IAAI;YACb,QAAQ,EAAE,UAAU;YACpB,OAAO,EAAE,IAAI;YACb,UAAU,EAAE,IAAI;SACnB,CAAC,CAAC;QACH,MAAO,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAC7B,MAAM,mBAAmB,EAAE,CAAC;IAChC,CAAC;IAEM,KAAK,CAAC,qBAAqB;QAC9B,MAAM,MAAM,GAAG,IAAI,CAAC,eAAe,EAAE,CAAC;QACtC,MAAM,KAAK,GAAG,IAAI,aAAa,CAAC,SAAS,EAAE;YACvC,GAAG,EAAE,QAAQ;YACb,OAAO,EAAE,IAAI;YACb,UAAU,EAAE,IAAI;SACnB,CAAC,CAAC;QACH,MAAO,CAAC,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E,CAAC,EAAE,CAAC,OAAO,CACnB,CAAC;IACN,CAAC;IAEM,qBAAqB;QACxB,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,eAAe,EAAG,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC;aAC3D,MAAM,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,EAAE;YACd,OAAO,EAAE,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,CAAC;QACpC,CAAC,CAAC;aACD,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,WAAW,IAAI,EAAE,CAAC,CAAC;IACzC,CAAC;IAEO,gBAAgB;QACpB,OAAO,IAAI,CAAC,qBAAqB,CAAC,UAAU,EAAE,aAAa,CAAC,SAAS,CAAC,CAAC;IAC3E,CAAC;IAEO,eAAe;QACnB,OAAO,IAAI,CAAC,qBAAqB,CAAC,UAAU,EAAE,aAAa,CACvD,cAAc,CACjB,CAAC;IACN,CAAC;IAEO,mBAAmB,CACvB,KAAoB;QAEpB,MAAM,OAAO,GAA6B,IAAI,CAAC,qBAAqB,CAAC,UAAW,CAAC,gBAAgB,CAC7F,sBAAsB,CACzB,CAAC;QACF,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC;IAC1B,CAAC;CACJ"}
|
|
@@ -28,8 +28,14 @@ export declare class RichTextEditor extends FoundationElement {
|
|
|
28
28
|
/**
|
|
29
29
|
* @internal
|
|
30
30
|
*/
|
|
31
|
-
|
|
31
|
+
editorContainer: HTMLDivElement;
|
|
32
32
|
private tiptapEditor;
|
|
33
|
+
private editor;
|
|
34
|
+
private readonly markdownParser;
|
|
35
|
+
private readonly markdownSerializer;
|
|
36
|
+
private readonly domSerializer;
|
|
37
|
+
private readonly xmlSerializer;
|
|
38
|
+
constructor();
|
|
33
39
|
/**
|
|
34
40
|
* @internal
|
|
35
41
|
*/
|
|
@@ -78,10 +84,27 @@ export declare class RichTextEditor extends FoundationElement {
|
|
|
78
84
|
* @internal
|
|
79
85
|
*/
|
|
80
86
|
numberedListButtonKeyDown(event: KeyboardEvent): boolean;
|
|
87
|
+
/**
|
|
88
|
+
* This function load tip tap editor with provided markdown content by parsing into html
|
|
89
|
+
* @public
|
|
90
|
+
*/
|
|
91
|
+
setMarkdown(markdown: string): void;
|
|
92
|
+
/**
|
|
93
|
+
* This function returns markdown string by serializing tiptap editor document using prosemirror MarkdownSerializer
|
|
94
|
+
* @public
|
|
95
|
+
*/
|
|
96
|
+
getMarkdown(): string;
|
|
81
97
|
/**
|
|
82
98
|
* @internal
|
|
83
99
|
*/
|
|
84
100
|
stopEventPropagation(event: Event): boolean;
|
|
101
|
+
/**
|
|
102
|
+
* This function takes the Fragment from parseMarkdownToDOM function and return the serialized string using XMLSerializer
|
|
103
|
+
*/
|
|
104
|
+
private getHtmlContent;
|
|
105
|
+
private initializeMarkdownParser;
|
|
106
|
+
private initializeMarkdownSerializer;
|
|
107
|
+
private parseMarkdownToDOM;
|
|
85
108
|
private initializeEditor;
|
|
86
109
|
/**
|
|
87
110
|
* Binding the "transaction" event to the editor allows continuous monitoring the events and updating the button state in response to
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { RichTextEditor } from '..';
|
|
2
|
+
import type { ToolbarButton } from './types';
|
|
2
3
|
/**
|
|
3
4
|
* Page object for the `nimble-rich-text-editor` component.
|
|
4
5
|
*/
|
|
@@ -13,29 +14,29 @@ export declare class RichTextEditorPageObject {
|
|
|
13
14
|
pressShiftTabKeysInEditor(): Promise<void>;
|
|
14
15
|
/**
|
|
15
16
|
* To click a formatting button in the footer section, pass its position value as an index (starting from '0')
|
|
16
|
-
* @param
|
|
17
|
+
* @param button can be imported from an enum for each button using the `ButtonIndex`.
|
|
17
18
|
*/
|
|
18
|
-
clickFooterButton(
|
|
19
|
+
clickFooterButton(button: ToolbarButton): Promise<void>;
|
|
19
20
|
/**
|
|
20
21
|
* To retrieve the checked state of the button, provide its position value as an index (starting from '0')
|
|
21
|
-
* @param
|
|
22
|
+
* @param button can be imported from an enum for each button using the `ButtonIndex`.
|
|
22
23
|
*/
|
|
23
|
-
getButtonCheckedState(
|
|
24
|
+
getButtonCheckedState(button: ToolbarButton): boolean;
|
|
24
25
|
/**
|
|
25
26
|
* To retrieve the tab index of the button, provide its position value as an index (starting from '0')
|
|
26
|
-
* @param
|
|
27
|
+
* @param button can be imported from an enum for each button using the `ButtonIndex`.
|
|
27
28
|
*/
|
|
28
|
-
getButtonTabIndex(
|
|
29
|
+
getButtonTabIndex(button: ToolbarButton): number;
|
|
29
30
|
/**
|
|
30
31
|
* To trigger a space key press for the button, provide its position value as an index (starting from '0')
|
|
31
|
-
* @param
|
|
32
|
+
* @param button can be imported from an enum for each button using the `ButtonIndex`.
|
|
32
33
|
*/
|
|
33
|
-
spaceKeyActivatesButton(
|
|
34
|
+
spaceKeyActivatesButton(button: ToolbarButton): void;
|
|
34
35
|
/**
|
|
35
36
|
* To trigger a enter key press for the button, provide its position value as an index (starting from '0')
|
|
36
|
-
* @param
|
|
37
|
+
* @param button can be imported from an enum for each button using the `ButtonIndex`.
|
|
37
38
|
*/
|
|
38
|
-
enterKeyActivatesButton(
|
|
39
|
+
enterKeyActivatesButton(button: ToolbarButton): void;
|
|
39
40
|
setEditorTextContent(value: string): Promise<void>;
|
|
40
41
|
getEditorFirstChildTagName(): string;
|
|
41
42
|
getEditorFirstChildTextContent(): string;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import type { TableNumberField } from '../../table/types';
|
|
2
2
|
import { TableColumnTextBase } from '../text-base';
|
|
3
3
|
import type { ColumnInternalsOptions } from '../base/models/column-internals';
|
|
4
|
-
import { NumberTextFormat } from './types';
|
|
4
|
+
import { NumberTextAlignment, NumberTextFormat } from './types';
|
|
5
5
|
import type { NumberFormatter } from './models/number-formatter';
|
|
6
|
+
import { TextCellViewBaseAlignment } from '../text-base/cell-view/types';
|
|
6
7
|
export declare type TableColumnNumberTextCellRecord = TableNumberField<'value'>;
|
|
7
8
|
export interface TableColumnNumberTextColumnConfig {
|
|
8
9
|
formatter: NumberFormatter;
|
|
10
|
+
alignment: TextCellViewBaseAlignment;
|
|
9
11
|
}
|
|
10
12
|
declare global {
|
|
11
13
|
interface HTMLElementTagNameMap {
|
|
@@ -17,10 +19,13 @@ declare global {
|
|
|
17
19
|
*/
|
|
18
20
|
export declare class TableColumnNumberText extends TableColumnTextBase {
|
|
19
21
|
format: NumberTextFormat;
|
|
22
|
+
alignment: NumberTextAlignment;
|
|
20
23
|
connectedCallback(): void;
|
|
21
24
|
protected getColumnInternalsOptions(): ColumnInternalsOptions;
|
|
22
25
|
private formatChanged;
|
|
26
|
+
private alignmentChanged;
|
|
23
27
|
private updateColumnConfig;
|
|
24
28
|
private createFormatter;
|
|
29
|
+
private determineCellContentAlignment;
|
|
25
30
|
}
|
|
26
31
|
export declare const tableColumnNumberTextTag: string;
|
|
@@ -6,3 +6,13 @@ export declare const NumberTextFormat: {
|
|
|
6
6
|
readonly roundToInteger: "round-to-integer";
|
|
7
7
|
};
|
|
8
8
|
export declare type NumberTextFormat = (typeof NumberTextFormat)[keyof typeof NumberTextFormat];
|
|
9
|
+
/**
|
|
10
|
+
* The aligment of the value in the number-text table column.
|
|
11
|
+
* The `default` alignment is determined by the column's `NumberTextFormat`.
|
|
12
|
+
*/
|
|
13
|
+
export declare const NumberTextAlignment: {
|
|
14
|
+
readonly default: undefined;
|
|
15
|
+
readonly left: "left";
|
|
16
|
+
readonly right: "right";
|
|
17
|
+
};
|
|
18
|
+
export declare type NumberTextAlignment = (typeof NumberTextAlignment)[keyof typeof NumberTextAlignment];
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { TableCellView } from '../../base/cell-view';
|
|
2
2
|
import type { TableCellRecord } from '../../base/types';
|
|
3
|
+
import { TextCellViewBaseAlignment } from './types';
|
|
3
4
|
/**
|
|
4
5
|
* The cell view base class for displaying fields of any type as text.
|
|
5
6
|
*/
|
|
@@ -10,4 +11,8 @@ export declare abstract class TableColumnTextCellViewBase<TCellRecord extends Ta
|
|
|
10
11
|
* Text to render in the cell.
|
|
11
12
|
*/
|
|
12
13
|
text: string;
|
|
14
|
+
/**
|
|
15
|
+
* The alignment of the text within the cell.
|
|
16
|
+
*/
|
|
17
|
+
alignment: TextCellViewBaseAlignment;
|
|
13
18
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The aligment of the value in a TableColumnTextCellViewBase instance.
|
|
3
|
+
*/
|
|
4
|
+
export declare const TextCellViewBaseAlignment: {
|
|
5
|
+
readonly left: "left";
|
|
6
|
+
readonly right: "right";
|
|
7
|
+
};
|
|
8
|
+
export declare type TextCellViewBaseAlignment = (typeof TextCellViewBaseAlignment)[keyof typeof TextCellViewBaseAlignment];
|
|
@@ -2,12 +2,14 @@ import { DesignSystem } from '@microsoft/fast-foundation';
|
|
|
2
2
|
import { template } from '../../text-base/cell-view/template';
|
|
3
3
|
import { styles } from '../../text-base/cell-view/styles';
|
|
4
4
|
import { TableColumnTextCellViewBase } from '../../text-base/cell-view';
|
|
5
|
+
import { TextCellViewBaseAlignment } from '../../text-base/cell-view/types';
|
|
5
6
|
/**
|
|
6
7
|
* A cell view for displaying number fields as text
|
|
7
8
|
*/
|
|
8
9
|
export class TableColumnNumberTextCellView extends TableColumnTextCellViewBase {
|
|
9
10
|
columnConfigChanged() {
|
|
10
11
|
this.updateText();
|
|
12
|
+
this.alignment = this.columnConfig?.alignment ?? TextCellViewBaseAlignment.left;
|
|
11
13
|
}
|
|
12
14
|
cellRecordChanged() {
|
|
13
15
|
this.updateText();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/table-column/number-text/cell-view/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AAK9D,OAAO,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAC1D,OAAO,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/table-column/number-text/cell-view/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AAK9D,OAAO,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAC1D,OAAO,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;AACxE,OAAO,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAQ5E;;GAEG;AACH,MAAM,OAAO,6BAA8B,SAAQ,2BAGlD;IACW,mBAAmB;QACvB,IAAI,CAAC,UAAU,EAAE,CAAC;QAClB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,YAAY,EAAE,SAAS,IAAI,yBAAyB,CAAC,IAAI,CAAC;IACpF,CAAC;IAEO,iBAAiB;QACrB,IAAI,CAAC,UAAU,EAAE,CAAC;IACtB,CAAC;IAEO,UAAU;QACd,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,YAAY,EAAE,SAAS,EAAE,WAAW,CAAC,IAAI,CAAC,UAAU,EAAE,KAAK,CAAC;eACtE,EAAE,CAAC;IACd,CAAC;CACJ;AAED,MAAM,kBAAkB,GAAG,6BAA6B,CAAC,OAAO,CAAC;IAC7D,QAAQ,EAAE,oCAAoC;IAC9C,QAAQ;IACR,MAAM;CACT,CAAC,CAAC;AACH,YAAY,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,kBAAkB,EAAE,CAAC,CAAC;AAC/E,MAAM,CAAC,MAAM,gCAAgC,GAAG,YAAY,CAAC,MAAM,CAC/D,6BAA6B,CAChC,CAAC"}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import type { TableNumberField } from '../../table/types';
|
|
2
2
|
import { TableColumnTextBase } from '../text-base';
|
|
3
3
|
import type { ColumnInternalsOptions } from '../base/models/column-internals';
|
|
4
|
-
import { NumberTextFormat } from './types';
|
|
4
|
+
import { NumberTextAlignment, NumberTextFormat } from './types';
|
|
5
5
|
import type { NumberFormatter } from './models/number-formatter';
|
|
6
|
+
import { TextCellViewBaseAlignment } from '../text-base/cell-view/types';
|
|
6
7
|
export declare type TableColumnNumberTextCellRecord = TableNumberField<'value'>;
|
|
7
8
|
export interface TableColumnNumberTextColumnConfig {
|
|
8
9
|
formatter: NumberFormatter;
|
|
10
|
+
alignment: TextCellViewBaseAlignment;
|
|
9
11
|
}
|
|
10
12
|
declare global {
|
|
11
13
|
interface HTMLElementTagNameMap {
|
|
@@ -17,10 +19,13 @@ declare global {
|
|
|
17
19
|
*/
|
|
18
20
|
export declare class TableColumnNumberText extends TableColumnTextBase {
|
|
19
21
|
format: NumberTextFormat;
|
|
22
|
+
alignment: NumberTextAlignment;
|
|
20
23
|
connectedCallback(): void;
|
|
21
24
|
protected getColumnInternalsOptions(): ColumnInternalsOptions;
|
|
22
25
|
private formatChanged;
|
|
26
|
+
private alignmentChanged;
|
|
23
27
|
private updateColumnConfig;
|
|
24
28
|
private createFormatter;
|
|
29
|
+
private determineCellContentAlignment;
|
|
25
30
|
}
|
|
26
31
|
export declare const tableColumnNumberTextTag: string;
|