@ni/nimble-components 32.11.5 → 32.11.6

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.
@@ -1,6 +1,3 @@
1
- import type { MappingUser } from '../../../mapping/user';
2
- import type { RichTextMentionTest } from '../../../rich-text-mention/base/tests/rich-text-mention.fixtures';
3
- import type { RichTextMentionUsers } from '../../../rich-text-mention/users';
4
1
  export declare const ToolbarButton: {
5
2
  readonly bold: 0;
6
3
  readonly italics: 1;
@@ -17,14 +14,6 @@ export declare const ArrowKeyButton: {
17
14
  export type ArrowKeyButton = (typeof ArrowKeyButton)[keyof typeof ArrowKeyButton];
18
15
  export type LabelProvider = 'toggleBold' | 'toggleItalics' | 'toggleBulletedList' | 'toggleNumberedList';
19
16
  export type ToolbarButtonKey = keyof typeof ToolbarButton;
20
- export interface UserMentionElements {
21
- userMentionElement: RichTextMentionUsers;
22
- mappingElements: MappingUser[];
23
- }
24
- export interface TestMentionElements {
25
- testMentionElement: RichTextMentionTest;
26
- mappingElements: MappingUser[];
27
- }
28
17
  export interface MappingConfiguration {
29
18
  key?: string;
30
19
  displayName?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/rich-text/editor/testing/types.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,UAAU,EACb,MAAM,+BAA+B,CAAC;AAKvC,MAAM,CAAC,MAAM,aAAa,GAAG;IACzB,IAAI,EAAE,CAAC;IACP,OAAO,EAAE,CAAC;IACV,UAAU,EAAE,CAAC;IACb,YAAY,EAAE,CAAC;CACT,CAAC;AAGX,MAAM,CAAC,MAAM,cAAc,GAAG;IAC1B,EAAE,EAAE,UAAU;IACd,IAAI,EAAE,YAAY;IAClB,IAAI,EAAE,YAAY;IAClB,KAAK,EAAE,aAAa;CACd,CAAC","sourcesContent":["import {\n keyArrowDown,\n keyArrowLeft,\n keyArrowRight,\n keyArrowUp\n} from '@microsoft/fast-web-utilities';\nimport type { MappingUser } from '../../../mapping/user';\nimport type { RichTextMentionTest } from '../../../rich-text-mention/base/tests/rich-text-mention.fixtures';\nimport type { RichTextMentionUsers } from '../../../rich-text-mention/users';\n\nexport const ToolbarButton = {\n bold: 0,\n italics: 1,\n bulletList: 2,\n numberedList: 3\n} as const;\nexport type ToolbarButton = (typeof ToolbarButton)[keyof typeof ToolbarButton];\n\nexport const ArrowKeyButton = {\n up: keyArrowUp,\n down: keyArrowDown,\n left: keyArrowLeft,\n right: keyArrowRight\n} as const;\nexport type ArrowKeyButton =\n (typeof ArrowKeyButton)[keyof typeof ArrowKeyButton];\n\nexport type LabelProvider =\n | 'toggleBold'\n | 'toggleItalics'\n | 'toggleBulletedList'\n | 'toggleNumberedList';\n\nexport type ToolbarButtonKey = keyof typeof ToolbarButton;\n\nexport interface UserMentionElements {\n userMentionElement: RichTextMentionUsers;\n mappingElements: MappingUser[];\n}\n\nexport interface TestMentionElements {\n testMentionElement: RichTextMentionTest;\n mappingElements: MappingUser[];\n}\n\nexport interface MappingConfiguration {\n key?: string;\n displayName?: string;\n}\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/rich-text/editor/testing/types.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,UAAU,EACb,MAAM,+BAA+B,CAAC;AAEvC,MAAM,CAAC,MAAM,aAAa,GAAG;IACzB,IAAI,EAAE,CAAC;IACP,OAAO,EAAE,CAAC;IACV,UAAU,EAAE,CAAC;IACb,YAAY,EAAE,CAAC;CACT,CAAC;AAGX,MAAM,CAAC,MAAM,cAAc,GAAG;IAC1B,EAAE,EAAE,UAAU;IACd,IAAI,EAAE,YAAY;IAClB,IAAI,EAAE,YAAY;IAClB,KAAK,EAAE,aAAa;CACd,CAAC","sourcesContent":["import {\n keyArrowDown,\n keyArrowLeft,\n keyArrowRight,\n keyArrowUp\n} from '@microsoft/fast-web-utilities';\n\nexport const ToolbarButton = {\n bold: 0,\n italics: 1,\n bulletList: 2,\n numberedList: 3\n} as const;\nexport type ToolbarButton = (typeof ToolbarButton)[keyof typeof ToolbarButton];\n\nexport const ArrowKeyButton = {\n up: keyArrowUp,\n down: keyArrowDown,\n left: keyArrowLeft,\n right: keyArrowRight\n} as const;\nexport type ArrowKeyButton =\n (typeof ArrowKeyButton)[keyof typeof ArrowKeyButton];\n\nexport type LabelProvider =\n | 'toggleBold'\n | 'toggleItalics'\n | 'toggleBulletedList'\n | 'toggleNumberedList';\n\nexport type ToolbarButtonKey = keyof typeof ToolbarButton;\n\nexport interface MappingConfiguration {\n key?: string;\n displayName?: string;\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ni/nimble-components",
3
- "version": "32.11.5",
3
+ "version": "32.11.6",
4
4
  "description": "Styled web components for the NI Nimble Design System",
5
5
  "scripts": {
6
6
  "build": "npm run generate-icons && npm run generate-workers && npm run build-components && npm run bundle-components && npm run generate-scss",
@@ -1,6 +0,0 @@
1
- import type { RichTextEditor } from '..';
2
- import { type RichTextMentionUsers } from '../../../rich-text-mention/users';
3
- import type { MappingConfiguration, UserMentionElements, TestMentionElements } from './types';
4
- export declare function appendUserMentionConfiguration(element: RichTextEditor, mappings?: MappingConfiguration[]): Promise<UserMentionElements>;
5
- export declare function appendTestMentionConfiguration(element: RichTextEditor, mappings?: MappingConfiguration[]): Promise<TestMentionElements>;
6
- export declare function replaceUserMappingElements(element: RichTextMentionUsers, mappings: MappingConfiguration[]): Promise<void>;
@@ -1,52 +0,0 @@
1
- import { mappingUserTag } from '../../../mapping/user';
2
- import { richTextMentionTestTag } from '../../../rich-text-mention/base/tests/rich-text-mention.fixtures';
3
- import { richTextMentionUsersTag } from '../../../rich-text-mention/users';
4
- import { waitForUpdatesAsync } from '../../../testing/async-helpers';
5
- export async function appendUserMentionConfiguration(element, mappings) {
6
- const userMentionElement = document.createElement(richTextMentionUsersTag);
7
- userMentionElement.pattern = '^user:(.*)';
8
- const mappingElements = [];
9
- mappings?.forEach(mapping => {
10
- const mappingUser = document.createElement(mappingUserTag);
11
- mappingUser.key = mapping.key ?? '';
12
- mappingUser.displayName = mapping.displayName;
13
- userMentionElement.appendChild(mappingUser);
14
- mappingElements.push(mappingUser);
15
- });
16
- element.appendChild(userMentionElement);
17
- await waitForUpdatesAsync();
18
- return {
19
- userMentionElement,
20
- mappingElements
21
- };
22
- }
23
- export async function appendTestMentionConfiguration(element, mappings) {
24
- const testMentionElement = document.createElement(richTextMentionTestTag);
25
- testMentionElement.pattern = '^test:(.*)';
26
- const mappingElements = [];
27
- mappings?.forEach(mapping => {
28
- const mappingUser = document.createElement(mappingUserTag);
29
- mappingUser.key = mapping.key;
30
- mappingUser.displayName = mapping.displayName;
31
- testMentionElement.appendChild(mappingUser);
32
- mappingElements.push(mappingUser);
33
- });
34
- element.appendChild(testMentionElement);
35
- await waitForUpdatesAsync();
36
- return {
37
- testMentionElement,
38
- mappingElements
39
- };
40
- }
41
- export async function replaceUserMappingElements(element, mappings) {
42
- const newUserMappingElements = [];
43
- mappings.forEach(mapping => {
44
- const mappingUser = document.createElement(mappingUserTag);
45
- mappingUser.key = mapping.key ?? '';
46
- mappingUser.displayName = mapping.displayName ?? '';
47
- newUserMappingElements.push(mappingUser);
48
- });
49
- element.replaceChildren(...newUserMappingElements);
50
- await waitForUpdatesAsync();
51
- }
52
- //# sourceMappingURL=rich-text-editor-utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"rich-text-editor-utils.js","sourceRoot":"","sources":["../../../../../src/rich-text/editor/testing/rich-text-editor-utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACzE,OAAO,EAAE,sBAAsB,EAAE,MAAM,kEAAkE,CAAC;AAC1G,OAAO,EACH,uBAAuB,EAE1B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,g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W,CAAC,CAAC;QAC5C,eAAe,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;IACH,OAAO,CAAC,WAAW,CAAC,kBAAkB,CAAC,CAAC;IACxC,MAAM,mBAAmB,EAAE,CAAC;IAC5B,OAAO;QACH,kBAAkB;QAClB,eAAe;KAClB,CAAC;AACN,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,0BAA0B,CAC5C,OAA6B,EAC7B,QAAgC;IAEhC,MAAM,sBAAsB,GAAkB,EAAE,CAAC;IACjD,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;QACvB,MAAM,WAAW,GAAG,QAAQ,CAAC,aAAa,CAAC,cAAc,CAAC,CAAC;QAC3D,WAAW,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,IAAI,EAAE,CAAC;QACpC,WAAW,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,IAAI,EAAE,CAAC;QACpD,sBAAsB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC;IACH,OAAO,CAAC,eAAe,CAAC,GAAG,sBAAsB,CAAC,CAAC;IACnD,MAAM,mBAAmB,EAAE,CAAC;AAChC,CAAC","sourcesContent":["import type { RichTextEditor } from '..';\nimport { type MappingUser, mappingUserTag } from '../../../mapping/user';\nimport { richTextMentionTestTag } from '../../../rich-text-mention/base/tests/rich-text-mention.fixtures';\nimport {\n richTextMentionUsersTag,\n type RichTextMentionUsers\n} from '../../../rich-text-mention/users';\nimport { waitForUpdatesAsync } from '../../../testing/async-helpers';\nimport type {\n MappingConfiguration,\n UserMentionElements,\n TestMentionElements\n} from './types';\n\nexport async function appendUserMentionConfiguration(\n element: RichTextEditor,\n mappings?: MappingConfiguration[]\n): Promise<UserMentionElements> {\n const userMentionElement = document.createElement(richTextMentionUsersTag);\n userMentionElement.pattern = '^user:(.*)';\n const mappingElements: MappingUser[] = [];\n mappings?.forEach(mapping => {\n const mappingUser = document.createElement(mappingUserTag);\n mappingUser.key = mapping.key ?? '';\n mappingUser.displayName = mapping.displayName;\n userMentionElement.appendChild(mappingUser);\n mappingElements.push(mappingUser);\n });\n element.appendChild(userMentionElement);\n await waitForUpdatesAsync();\n return {\n userMentionElement,\n mappingElements\n };\n}\n\nexport async function appendTestMentionConfiguration(\n element: RichTextEditor,\n mappings?: MappingConfiguration[]\n): Promise<TestMentionElements> {\n const testMentionElement = document.createElement(richTextMentionTestTag);\n testMentionElement.pattern = '^test:(.*)';\n const mappingElements: MappingUser[] = [];\n mappings?.forEach(mapping => {\n const mappingUser = document.createElement(mappingUserTag);\n mappingUser.key = mapping.key;\n mappingUser.displayName = mapping.displayName;\n testMentionElement.appendChild(mappingUser);\n mappingElements.push(mappingUser);\n });\n element.appendChild(testMentionElement);\n await waitForUpdatesAsync();\n return {\n testMentionElement,\n mappingElements\n };\n}\n\nexport async function replaceUserMappingElements(\n element: RichTextMentionUsers,\n mappings: MappingConfiguration[]\n): Promise<void> {\n const newUserMappingElements: MappingUser[] = [];\n mappings.forEach(mapping => {\n const mappingUser = document.createElement(mappingUserTag);\n mappingUser.key = mapping.key ?? '';\n mappingUser.displayName = mapping.displayName ?? '';\n newUserMappingElements.push(mappingUser);\n });\n element.replaceChildren(...newUserMappingElements);\n await waitForUpdatesAsync();\n}\n"]}