@ni/nimble-components 20.15.0 → 20.15.1
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 +12405 -11698
- package/dist/all-components-bundle.js.map +1 -1
- package/dist/all-components-bundle.min.js +2923 -2830
- package/dist/all-components-bundle.min.js.map +1 -1
- package/dist/esm/rich-text/base/index.d.ts +36 -0
- package/dist/esm/rich-text/base/index.js +73 -0
- package/dist/esm/rich-text/base/index.js.map +1 -0
- package/dist/esm/rich-text/editor/index.d.ts +25 -27
- package/dist/esm/rich-text/editor/index.js +95 -173
- package/dist/esm/rich-text/editor/index.js.map +1 -1
- package/dist/esm/rich-text/editor/models/create-tiptap-editor.d.ts +3 -0
- package/dist/esm/rich-text/editor/models/create-tiptap-editor.js +228 -0
- package/dist/esm/rich-text/editor/models/create-tiptap-editor.js.map +1 -0
- package/dist/esm/rich-text/editor/styles.js +9 -1
- package/dist/esm/rich-text/editor/styles.js.map +1 -1
- package/dist/esm/rich-text/editor/template.js +2 -2
- package/dist/esm/rich-text/editor/template.js.map +1 -1
- package/dist/esm/rich-text/editor/testing/rich-text-editor.pageobject.d.ts +4 -0
- package/dist/esm/rich-text/editor/testing/rich-text-editor.pageobject.js +24 -4
- package/dist/esm/rich-text/editor/testing/rich-text-editor.pageobject.js.map +1 -1
- package/dist/esm/rich-text/editor/testing/types.d.ts +15 -0
- package/dist/esm/rich-text/editor/testing/types.js.map +1 -1
- package/dist/esm/rich-text/editor/types.d.ts +1 -0
- package/dist/esm/rich-text/editor/types.js +1 -0
- package/dist/esm/rich-text/editor/types.js.map +1 -1
- package/dist/esm/rich-text/models/configuration.d.ts +10 -0
- package/dist/esm/rich-text/models/configuration.js +15 -0
- package/dist/esm/rich-text/models/configuration.js.map +1 -0
- package/dist/esm/rich-text/models/editor-configuration.d.ts +10 -0
- package/dist/esm/rich-text/models/editor-configuration.js +14 -0
- package/dist/esm/rich-text/models/editor-configuration.js.map +1 -0
- package/dist/esm/rich-text/models/markdown-parser-mention-configuration.d.ts +2 -2
- package/dist/esm/rich-text/models/markdown-parser-mention-configuration.js +5 -1
- package/dist/esm/rich-text/models/markdown-parser-mention-configuration.js.map +1 -1
- package/dist/esm/rich-text/models/markdown-parser.d.ts +8 -1
- package/dist/esm/rich-text/models/markdown-parser.js +20 -4
- package/dist/esm/rich-text/models/markdown-parser.js.map +1 -1
- package/dist/esm/rich-text/models/markdown-serializer.d.ts +4 -3
- package/dist/esm/rich-text/models/markdown-serializer.js +16 -5
- package/dist/esm/rich-text/models/markdown-serializer.js.map +1 -1
- package/dist/esm/rich-text/models/mention-extension-configuration.d.ts +15 -0
- package/dist/esm/rich-text/models/mention-extension-configuration.js +18 -0
- package/dist/esm/rich-text/models/mention-extension-configuration.js.map +1 -0
- package/dist/esm/rich-text/viewer/index.d.ts +5 -23
- package/dist/esm/rich-text/viewer/index.js +13 -61
- package/dist/esm/rich-text/viewer/index.js.map +1 -1
- package/dist/esm/rich-text/viewer/styles.js +2 -1
- package/dist/esm/rich-text/viewer/styles.js.map +1 -1
- package/dist/esm/rich-text-mention/base/index.d.ts +17 -16
- package/dist/esm/rich-text-mention/base/index.js +34 -20
- package/dist/esm/rich-text-mention/base/index.js.map +1 -1
- package/dist/esm/rich-text-mention/base/models/mention-internals.d.ts +9 -4
- package/dist/esm/rich-text-mention/base/models/mention-internals.js +6 -2
- package/dist/esm/rich-text-mention/base/models/mention-internals.js.map +1 -1
- package/dist/esm/rich-text-mention/base/models/mention-validator.d.ts +3 -5
- package/dist/esm/rich-text-mention/base/models/mention-validator.js +6 -10
- package/dist/esm/rich-text-mention/base/models/mention-validator.js.map +1 -1
- package/dist/esm/rich-text-mention/base/template.d.ts +1 -1
- package/dist/esm/rich-text-mention/base/template.js +1 -1
- package/dist/esm/rich-text-mention/base/template.js.map +1 -1
- package/dist/esm/rich-text-mention/base/types.d.ts +10 -0
- package/dist/esm/rich-text-mention/base/types.js +2 -0
- package/dist/esm/rich-text-mention/base/types.js.map +1 -0
- package/dist/esm/rich-text-mention/users/index.d.ts +2 -3
- package/dist/esm/rich-text-mention/users/index.js +1 -6
- package/dist/esm/rich-text-mention/users/index.js.map +1 -1
- package/dist/esm/rich-text-mention/{base → users}/models/mapping-user-config.d.ts +1 -1
- package/dist/esm/rich-text-mention/{base → users}/models/mapping-user-config.js +1 -1
- package/dist/esm/rich-text-mention/users/models/mapping-user-config.js.map +1 -0
- package/dist/esm/rich-text-mention/users/models/rich-text-mention-users-validator.d.ts +4 -2
- package/dist/esm/rich-text-mention/users/models/rich-text-mention-users-validator.js +11 -2
- package/dist/esm/rich-text-mention/users/models/rich-text-mention-users-validator.js.map +1 -1
- package/dist/esm/rich-text-mention/users/view/styles.js +8 -3
- package/dist/esm/rich-text-mention/users/view/styles.js.map +1 -1
- package/package.json +3 -1
- package/dist/esm/rich-text-mention/base/models/mapping-user-config.js.map +0 -1
|
@@ -4,14 +4,13 @@ import type { MentionInternals } from './mention-internals';
|
|
|
4
4
|
export interface RichTextMentionValidity extends ValidityObject {
|
|
5
5
|
}
|
|
6
6
|
declare type FlagNames<T> = T extends readonly (infer U)[] ? U : never;
|
|
7
|
-
export declare const baseValidityFlagNames: readonly ["
|
|
7
|
+
export declare const baseValidityFlagNames: readonly ["duplicateMappingMentionHref", "missingMentionHrefValue", "mentionHrefNotValidUrl", "mentionHrefDoesNotMatchPattern", "missingPatternAttribute", "unsupportedPatternValue"];
|
|
8
8
|
/**
|
|
9
9
|
* Validator for RichTextMention
|
|
10
10
|
*/
|
|
11
|
-
export declare class RichTextMentionValidator<ValidityFlagNames extends readonly string[]> extends Validator<typeof baseValidityFlagNames | ValidityFlagNames> {
|
|
11
|
+
export declare class RichTextMentionValidator<ValidityFlagNames extends readonly string[] = typeof baseValidityFlagNames> extends Validator<typeof baseValidityFlagNames | ValidityFlagNames> {
|
|
12
12
|
private readonly mentionInternals;
|
|
13
|
-
|
|
14
|
-
constructor(mentionInternals: MentionInternals<unknown>, configValidityKeys: ValidityFlagNames, supportedMappingElements: readonly (typeof Mapping<unknown>)[]);
|
|
13
|
+
constructor(mentionInternals: MentionInternals, configValidityKeys: ValidityFlagNames);
|
|
15
14
|
validate(mappings: Mapping<unknown>[], pattern: string | undefined): void;
|
|
16
15
|
/**
|
|
17
16
|
* @returns an object containing flags for various ways the configuation can be invalid
|
|
@@ -24,7 +23,6 @@ export declare class RichTextMentionValidator<ValidityFlagNames extends readonly
|
|
|
24
23
|
private updateMentionInternalsFlag;
|
|
25
24
|
private validateMissingPattern;
|
|
26
25
|
private validatePattern;
|
|
27
|
-
private validateMappingTypes;
|
|
28
26
|
private validateUniqueMentionHref;
|
|
29
27
|
private validateNoMissingMentionHref;
|
|
30
28
|
private validateHrefForUrl;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Validator } from '../../../utilities/models/validator';
|
|
2
2
|
export const baseValidityFlagNames = [
|
|
3
|
-
'unsupportedMappingType',
|
|
4
3
|
'duplicateMappingMentionHref',
|
|
5
4
|
'missingMentionHrefValue',
|
|
6
5
|
'mentionHrefNotValidUrl',
|
|
@@ -12,15 +11,13 @@ export const baseValidityFlagNames = [
|
|
|
12
11
|
* Validator for RichTextMention
|
|
13
12
|
*/
|
|
14
13
|
export class RichTextMentionValidator extends Validator {
|
|
15
|
-
constructor(mentionInternals, configValidityKeys
|
|
14
|
+
constructor(mentionInternals, configValidityKeys) {
|
|
16
15
|
super(configValidityKeys);
|
|
17
16
|
this.mentionInternals = mentionInternals;
|
|
18
|
-
this.supportedMappingElements = supportedMappingElements;
|
|
19
17
|
}
|
|
20
18
|
validate(mappings, pattern) {
|
|
21
19
|
this.untrackAll();
|
|
22
20
|
const mentionHrefs = mappings.map(mapping => mapping.key);
|
|
23
|
-
this.validateMappingTypes(mappings);
|
|
24
21
|
this.validateNoMissingMentionHref(mentionHrefs);
|
|
25
22
|
this.validateUniqueMentionHref(mentionHrefs);
|
|
26
23
|
this.validateMissingPattern(pattern);
|
|
@@ -55,10 +52,6 @@ export class RichTextMentionValidator extends Validator {
|
|
|
55
52
|
validatePattern(pattern) {
|
|
56
53
|
this.setConditionValue('unsupportedPatternValue', pattern === undefined || this.isInvalidRegex(pattern));
|
|
57
54
|
}
|
|
58
|
-
validateMappingTypes(mappings) {
|
|
59
|
-
const valid = mappings.every(mapping => this.supportedMappingElements.some(mappingClass => mapping instanceof mappingClass));
|
|
60
|
-
this.setConditionValue('unsupportedMappingType', !valid);
|
|
61
|
-
}
|
|
62
55
|
validateUniqueMentionHref(mentionHref) {
|
|
63
56
|
const invalid = new Set(mentionHref).size !== mentionHref.length;
|
|
64
57
|
this.setConditionValue('duplicateMappingMentionHref', invalid);
|
|
@@ -81,12 +74,13 @@ export class RichTextMentionValidator extends Validator {
|
|
|
81
74
|
: mentionHrefs.some(href => {
|
|
82
75
|
return (href === undefined
|
|
83
76
|
|| typeof href !== 'string'
|
|
84
|
-
|| !RegExp(pattern).test(href));
|
|
77
|
+
|| !new RegExp(pattern).test(href));
|
|
85
78
|
});
|
|
86
79
|
this.setConditionValue('mentionHrefDoesNotMatchPattern', invalid);
|
|
87
80
|
}
|
|
88
81
|
isInvalidUrl(url) {
|
|
89
82
|
try {
|
|
83
|
+
// Check whether the constructor throws an error for an Invalid URL.
|
|
90
84
|
// eslint-disable-next-line no-new
|
|
91
85
|
new URL(url);
|
|
92
86
|
return false;
|
|
@@ -97,7 +91,9 @@ export class RichTextMentionValidator extends Validator {
|
|
|
97
91
|
}
|
|
98
92
|
isInvalidRegex(pattern) {
|
|
99
93
|
try {
|
|
100
|
-
|
|
94
|
+
// Check whether the constructor throws an error when it cannot be parsed as a valid regular expression.
|
|
95
|
+
// eslint-disable-next-line no-new
|
|
96
|
+
new RegExp(pattern);
|
|
101
97
|
return false;
|
|
102
98
|
}
|
|
103
99
|
catch (error) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mention-validator.js","sourceRoot":"","sources":["../../../../../src/rich-text-mention/base/models/mention-validator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAkB,MAAM,qCAAqC,CAAC;AAQhF,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACjC,
|
|
1
|
+
{"version":3,"file":"mention-validator.js","sourceRoot":"","sources":["../../../../../src/rich-text-mention/base/models/mention-validator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAkB,MAAM,qCAAqC,CAAC;AAQhF,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACjC,6BAA6B;IAC7B,yBAAyB;IACzB,wBAAwB;IACxB,gCAAgC;IAChC,yBAAyB;IACzB,yBAAyB;CACnB,CAAC;AAEX;;GAEG;AACH,MAAM,OAAO,wBAEX,SAAQ,SAA2D;IACjE,YACqB,gBAAkC,EACnD,kBAAqC;QAErC,KAAK,CAAC,kBAAkB,CAAC,CAAC;QAHT,qBAAgB,GAAhB,gBAAgB,CAAkB;IAIvD,CAAC;IAEM,QAAQ,CACX,QAA4B,EAC5B,OAA2B;QAE3B,IAAI,CAAC,UAAU,EAAE,CAAC;QAClB,MAAM,YAAY,GAAG,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAC1D,IAAI,CAAC,4BAA4B,CAAC,YAAY,CAAC,CAAC;QAChD,IAAI,CAAC,yBAAyB,CAAC,YAAY,CAAC,CAAC;QAC7C,IAAI,CAAC,sBAAsB,CAAC,OAAO,CAAC,CAAC;QACrC,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;QAC9B,IAAI,CAAC,sBAAsB,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;QACnD,IAAI,CAAC,kBAAkB,CAAC,YAAY,CAAC,CAAC;IAC1C,CAAC;IAED;;OAEG;IACI,WAAW;QACd,OAAO,IAAI,CAAC,kBAAkB,EAAE,CAAC;IACrC,CAAC;IAED;;OAEG;IACO,iBAAiB,CACvB,IAAiE,EACjE,SAAkB;QAElB,IAAI,SAAS,EAAE;YAC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AE,OAAO,CAAC,CAAC;IAC9D,CAAC;IAEO,sBAAsB,CAC1B,YAAuB,EACvB,OAA2B;QAE3B,MAAM,OAAO,GAAG,OAAO,KAAK,SAAS,IAAI,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC;YACjE,CAAC,CAAC,IAAI;YACN,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;gBACvB,OAAO,CACH,IAAI,KAAK,SAAS;uBACT,OAAO,IAAI,KAAK,QAAQ;uBACxB,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAC3C,CAAC;YACN,CAAC,CAAC,CAAC;QACP,IAAI,CAAC,iBAAiB,CAAC,gCAAgC,EAAE,OAAO,CAAC,CAAC;IACtE,CAAC;IAEO,YAAY,CAAC,GAAW;QAC5B,IAAI;YACA,oEAAoE;YACpE,kCAAkC;YAClC,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;YACb,OAAO,KAAK,CAAC;SAChB;QAAC,OAAO,KAAK,EAAE;YACZ,OAAO,IAAI,CAAC;SACf;IACL,CAAC;IAEO,cAAc,CAAC,OAAe;QAClC,IAAI;YACA,wGAAwG;YACxG,kCAAkC;YAClC,IAAI,MAAM,CAAC,OAAO,CAAC,CAAC;YACpB,OAAO,KAAK,CAAC;SAChB;QAAC,OAAO,KAAK,EAAE;YACZ,OAAO,IAAI,CAAC;SACf;IACL,CAAC;CACJ"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { RichTextMention } from '.';
|
|
2
|
-
export declare const template: import("@microsoft/fast-element").ViewTemplate<RichTextMention<import("
|
|
2
|
+
export declare const template: import("@microsoft/fast-element").ViewTemplate<RichTextMention<import("./models/mention-validator").RichTextMentionValidator<readonly ["duplicateMappingMentionHref", "missingMentionHrefValue", "mentionHrefNotValidUrl", "mentionHrefDoesNotMatchPattern", "missingPatternAttribute", "unsupportedPatternValue"]>>, any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template.js","sourceRoot":"","sources":["../../../../src/rich-text-mention/base/template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAGxD,MAAM,CAAC,MAAM,QAAQ,GAAG,IAAI,CAAiB;MACvC,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"template.js","sourceRoot":"","sources":["../../../../src/rich-text-mention/base/template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAGxD,MAAM,CAAC,MAAM,QAAQ,GAAG,IAAI,CAAiB;MACvC,OAAO,CAAC,iBAAiB,CAAC;;SAEvB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { MappingConfig } from './models/mapping-config';
|
|
2
|
+
/**
|
|
3
|
+
* The type of the detail associated with the `mention-update`
|
|
4
|
+
* event on the banner.
|
|
5
|
+
*/
|
|
6
|
+
export interface MentionUpdateEventDetail {
|
|
7
|
+
filter: string;
|
|
8
|
+
}
|
|
9
|
+
export declare type MappingConfigs = ReadonlyMap<string, MappingConfig>;
|
|
10
|
+
export declare type MentionUpdateEmitter = (filter: string) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/rich-text-mention/base/types.ts"],"names":[],"mappings":""}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { MentionInternalsOptions } from '../base/models/mention-internals';
|
|
2
|
-
import {
|
|
2
|
+
import { RichTextMention } from '../base';
|
|
3
3
|
import type { MappingConfig } from '../base/models/mapping-config';
|
|
4
4
|
import type { Mapping } from '../../mapping/base';
|
|
5
5
|
import type { MappingUserKey } from '../../mapping/base/types';
|
|
@@ -12,10 +12,9 @@ declare global {
|
|
|
12
12
|
/**
|
|
13
13
|
* Rich Text user mention configuration element which will have MappingMentionUser elements as children
|
|
14
14
|
*/
|
|
15
|
-
export declare class RichTextMentionUsers extends RichTextMention<
|
|
15
|
+
export declare class RichTextMentionUsers extends RichTextMention<RichTextMentionUsersValidator> {
|
|
16
16
|
protected createValidator(): RichTextMentionUsersValidator;
|
|
17
17
|
protected getMentionInternalsOptions(): MentionInternalsOptions;
|
|
18
|
-
protected createMentionConfig(mappingConfigs: MappingConfigs): RichTextMentionConfig;
|
|
19
18
|
protected createMappingConfig(mapping: Mapping<MappingUserKey>): MappingConfig;
|
|
20
19
|
}
|
|
21
20
|
export declare const richTextMentionUsersTag: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DesignSystem } from '@microsoft/fast-foundation';
|
|
2
2
|
import { RichTextMention } from '../base';
|
|
3
|
-
import { MappingUserConfig } from '
|
|
3
|
+
import { MappingUserConfig } from './models/mapping-user-config';
|
|
4
4
|
import { template } from '../base/template';
|
|
5
5
|
import { iconAtTag } from '../../icons/at';
|
|
6
6
|
import { MappingUser } from '../../mapping/user';
|
|
@@ -20,11 +20,6 @@ export class RichTextMentionUsers extends RichTextMention {
|
|
|
20
20
|
viewElement: richTextMentionUsersViewTag
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
|
-
createMentionConfig(mappingConfigs) {
|
|
24
|
-
return {
|
|
25
|
-
mappingConfigs
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
23
|
createMappingConfig(mapping) {
|
|
29
24
|
if (mapping instanceof MappingUser) {
|
|
30
25
|
return new MappingUserConfig(mapping.key, mapping.displayName);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/rich-text-mention/users/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/rich-text-mention/users/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4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|
+
{"version":3,"file":"mapping-user-config.js","sourceRoot":"","sources":["../../../../../src/rich-text-mention/users/models/mapping-user-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAEjE;;GAEG;AACH,MAAM,OAAO,iBAAkB,SAAQ,aAAa;CAAG"}
|
|
@@ -2,13 +2,15 @@ import type { Mapping } from '../../../mapping/base';
|
|
|
2
2
|
import type { MappingUserKey } from '../../../mapping/base/types';
|
|
3
3
|
import type { MentionInternals } from '../../base/models/mention-internals';
|
|
4
4
|
import { RichTextMentionValidator } from '../../base/models/mention-validator';
|
|
5
|
-
declare const usersValidityFlagNames: readonly ["
|
|
5
|
+
declare const usersValidityFlagNames: readonly ["duplicateMappingMentionHref", "missingMentionHrefValue", "mentionHrefNotValidUrl", "mentionHrefDoesNotMatchPattern", "missingPatternAttribute", "unsupportedPatternValue", "missingDisplayNameValue", "unsupportedMappingType"];
|
|
6
6
|
/**
|
|
7
7
|
* Validator for RichTextMentionUsers
|
|
8
8
|
*/
|
|
9
9
|
export declare class RichTextMentionUsersValidator extends RichTextMentionValidator<typeof usersValidityFlagNames> {
|
|
10
|
-
constructor(columnInternals: MentionInternals
|
|
10
|
+
constructor(columnInternals: MentionInternals);
|
|
11
|
+
private static isSupportedMappingElement;
|
|
11
12
|
validate(mappings: Mapping<MappingUserKey>[], pattern: string): void;
|
|
12
13
|
private validateNoMissingDisplayName;
|
|
14
|
+
private validateMappingTypes;
|
|
13
15
|
}
|
|
14
16
|
export {};
|
|
@@ -2,22 +2,31 @@ import { MappingUser } from '../../../mapping/user';
|
|
|
2
2
|
import { baseValidityFlagNames, RichTextMentionValidator } from '../../base/models/mention-validator';
|
|
3
3
|
const usersValidityFlagNames = [
|
|
4
4
|
...baseValidityFlagNames,
|
|
5
|
-
'missingDisplayNameValue'
|
|
5
|
+
'missingDisplayNameValue',
|
|
6
|
+
'unsupportedMappingType'
|
|
6
7
|
];
|
|
7
8
|
/**
|
|
8
9
|
* Validator for RichTextMentionUsers
|
|
9
10
|
*/
|
|
10
11
|
export class RichTextMentionUsersValidator extends RichTextMentionValidator {
|
|
11
12
|
constructor(columnInternals) {
|
|
12
|
-
super(columnInternals, usersValidityFlagNames
|
|
13
|
+
super(columnInternals, usersValidityFlagNames);
|
|
14
|
+
}
|
|
15
|
+
static isSupportedMappingElement(mapping) {
|
|
16
|
+
return mapping instanceof MappingUser;
|
|
13
17
|
}
|
|
14
18
|
validate(mappings, pattern) {
|
|
15
19
|
super.validate(mappings, pattern);
|
|
20
|
+
this.validateMappingTypes(mappings);
|
|
16
21
|
this.validateNoMissingDisplayName(mappings);
|
|
17
22
|
}
|
|
18
23
|
validateNoMissingDisplayName(mappings) {
|
|
19
24
|
const invalid = mappings.some(mapping => mapping.displayName === undefined);
|
|
20
25
|
this.setConditionValue('missingDisplayNameValue', invalid);
|
|
21
26
|
}
|
|
27
|
+
validateMappingTypes(mappings) {
|
|
28
|
+
const valid = mappings.every(RichTextMentionUsersValidator.isSupportedMappingElement);
|
|
29
|
+
this.setConditionValue('unsupportedMappingType', !valid);
|
|
30
|
+
}
|
|
22
31
|
}
|
|
23
32
|
//# sourceMappingURL=rich-text-mention-users-validator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rich-text-mention-users-validator.js","sourceRoot":"","sources":["../../../../../src/rich-text-mention/users/models/rich-text-mention-users-validator.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEpD,OAAO,EACH,qBAAqB,EACrB,wBAAwB,EAC3B,MAAM,qCAAqC,CAAC;AAE7C,MAAM,sBAAsB,GAAG;IAC3B,GAAG,qBAAqB;IACxB,yBAAyB;
|
|
1
|
+
{"version":3,"file":"rich-text-mention-users-validator.js","sourceRoot":"","sources":["../../../../../src/rich-text-mention/users/models/rich-text-mention-users-validator.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEpD,OAAO,EACH,qBAAqB,EACrB,wBAAwB,EAC3B,MAAM,qCAAqC,CAAC;AAE7C,MAAM,sBAAsB,GAAG;IAC3B,GAAG,qBAAqB;IACxB,yBAAyB;IACzB,wBAAwB;CAClB,CAAC;AAEX;;GAEG;AACH,MAAM,OAAO,6BAA8B,SAAQ,wBAElD;IACG,YAAmB,eAAiC;QAChD,KAAK,CAAC,eAAe,EAAE,sBAAsB,CAAC,CAAC;IACnD,CAAC;IAEO,MAAM,CAAC,yBAAyB,CACpC,OAAyB;QAEzB,OAAO,OAAO,YAAY,WAAW,CAAC;IAC1C,CAAC;IAEe,QAAQ,CACpB,QAAmC,EACnC,OAAe;QAEf,KAAK,CAAC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QAClC,IAAI,CAAC,oBAAoB,CAAC,QAAQ,CAAC,CAAC;QACpC,IAAI,CAAC,4BAA4B,CAAC,QAAQ,CAAC,CAAC;IAChD,CAAC;IAEO,4BAA4B,CAAC,QAAuB;QACxD,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CACzB,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,WAAW,KAAK,SAAS,CAC/C,CAAC;QACF,IAAI,CAAC,iBAAiB,CAAC,yBAAyB,EAAE,OAAO,CAAC,CAAC;IAC/D,CAAC;IAEO,oBAAoB,CAAC,QAA4B;QACrD,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CACxB,6BAA6B,CAAC,yBAAyB,CAC1D,CAAC;QACF,IAAI,CAAC,iBAAiB,CAAC,wBAAwB,EAAE,CAAC,KAAK,CAAC,CAAC;IAC7D,CAAC;CACJ"}
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import { css } from '@microsoft/fast-element';
|
|
2
2
|
import { display } from '@microsoft/fast-foundation';
|
|
3
|
-
import {
|
|
3
|
+
import { mentionDisabledFontColor, bodyFontColor, bodyFont, mentionFont, bodyDisabledFontColor } from '../../../theme-provider/design-tokens';
|
|
4
4
|
export const styles = css `
|
|
5
5
|
${display('inline-block')}
|
|
6
6
|
|
|
7
7
|
:host {
|
|
8
8
|
box-sizing: border-box;
|
|
9
|
-
font: ${
|
|
9
|
+
font: ${bodyFont};
|
|
10
10
|
color: ${bodyFontColor};
|
|
11
11
|
white-space: normal;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
.control {
|
|
15
|
-
|
|
15
|
+
font: ${mentionFont};
|
|
16
|
+
color: var(--ni-nimble-private-mention-font-color);
|
|
16
17
|
display: none;
|
|
17
18
|
}
|
|
18
19
|
|
|
@@ -24,6 +25,10 @@ export const styles = css `
|
|
|
24
25
|
color: ${mentionDisabledFontColor};
|
|
25
26
|
}
|
|
26
27
|
|
|
28
|
+
:host([disabled]) {
|
|
29
|
+
color: ${bodyDisabledFontColor};
|
|
30
|
+
}
|
|
31
|
+
|
|
27
32
|
:host([disable-editing]) slot {
|
|
28
33
|
display: none;
|
|
29
34
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../../../src/rich-text-mention/users/view/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACrD,OAAO,EACH,
|
|
1
|
+
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../../../src/rich-text-mention/users/view/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACrD,OAAO,EACH,wBAAwB,EACxB,aAAa,EACb,QAAQ,EACR,WAAW,EACX,qBAAqB,EACxB,MAAM,uCAAuC,CAAC;AAE/C,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;MACnB,OAAO,CAAC,cAAc,CAAC;;;;gBAIb,QAAQ;iBACP,aAAa;;;;;gBAKd,WAAW;;;;;;;;;;iBAUV,wBAAwB;;;;iBAIxB,qBAAqB;;;;;;CAMrC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ni/nimble-components",
|
|
3
|
-
"version": "20.15.
|
|
3
|
+
"version": "20.15.1",
|
|
4
4
|
"description": "Styled web components for the NI Nimble Design System",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "npm run generate-icons && npm run build-components && npm run bundle-components && npm run generate-scss && npm run build-storybook",
|
|
@@ -72,6 +72,7 @@
|
|
|
72
72
|
"@tiptap/extension-italic": "^2.1.6",
|
|
73
73
|
"@tiptap/extension-link": "^2.1.6",
|
|
74
74
|
"@tiptap/extension-list-item": "^2.1.6",
|
|
75
|
+
"@tiptap/extension-mention": "^2.1.6",
|
|
75
76
|
"@tiptap/extension-ordered-list": "^2.1.6",
|
|
76
77
|
"@tiptap/extension-paragraph": "^2.1.6",
|
|
77
78
|
"@tiptap/extension-placeholder": "^2.1.6",
|
|
@@ -90,6 +91,7 @@
|
|
|
90
91
|
"d3-zoom": "^3.0.0",
|
|
91
92
|
"prosemirror-markdown": "^1.11.2",
|
|
92
93
|
"prosemirror-model": "^1.19.2",
|
|
94
|
+
"prosemirror-state": "^1.4.3",
|
|
93
95
|
"tslib": "^2.2.0"
|
|
94
96
|
},
|
|
95
97
|
"devDependencies": {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mapping-user-config.js","sourceRoot":"","sources":["../../../../../src/rich-text-mention/base/models/mapping-user-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD;;GAEG;AACH,MAAM,OAAO,iBAAkB,SAAQ,aAAa;CAAG"}
|