-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update schema * Move to claimInterpreter * Move to claimInterpreter * Fix test * Add entry * Add replyAction as deprecated * Add deprecation notes * Remove unnecessary code * Add new Schema.org things * Add sensitivity label * Fix text ellipsis and add tests * Remove Schema.org types (moved to core) * Add valibot for Schema.org * Componentize LinkDefinitions * Rename props * Cache const * Ellipsis on overflow * Chevron should not shrink * Read message sensitivity label from entities * Add event * Turn plural into singular * Add getOrgSchemaMessage * Deprecate older Schema.org types * Remove deprecated Schema.org types * Allow no accessory * Clean up * Should render link definitions without claims * Add test for message sensitivity label * Test accordion text * Better tooltip * Rename props * Update snapshot * Fix backward compatibility * Support non-numeric identifier * Turn unknown scheme into button * Update snapshots * Add tests * No wrap on identifier * Wrap pure identifier with zero-width space * Update screenshot for word wrap * Fix legacy VoteAction * Fix timestamp * Fix test * Show citation only when its thing is in the graph * Revert * Dereference unconnected blank nodes * Rename files * Add isEncrypted * Add reference sample * Update schema * Add zero-width space * Fix test * Fix test * Fix ESLint
- Loading branch information
Showing
113 changed files
with
2,451 additions
and
620 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+44.4 KB
...apshots__/html/badge-js-link-definition-should-display-text-ellipsis-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+36 Bytes
(100%)
...-accordion-js-citation-accordion-should-expand-and-collapse-on-click-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+36 Bytes
(100%)
...-accordion-js-citation-accordion-should-expand-and-collapse-on-click-3-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+36 Bytes
(100%)
..._/__image_snapshots__/html/citation-basic-js-citation-should-display-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+1.53 KB
(100%)
...-js-citation-modal-dialog-should-close-when-clicking-on-close-button-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+32 Bytes
(100%)
...-js-citation-modal-dialog-should-close-when-clicking-on-close-button-2-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+1.53 KB
(100%)
...ape-js-citation-modal-dialog-should-close-when-escape-key-is-pressed-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+32 Bytes
(100%)
...ape-js-citation-modal-dialog-should-close-when-escape-key-is-pressed-2-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+1.53 KB
(100%)
...dal-dialog-should-show-when-clicking-on-citation-in-link-definitions-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+1.54 KB
(100%)
...dal-dialog-should-show-when-clicking-on-citation-in-link-definitions-2-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+1.53 KB
(100%)
...ation-modal-dialog-should-show-when-clicking-on-citation-in-markdown-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+1.54 KB
(100%)
...ation-modal-dialog-should-show-when-clicking-on-citation-in-markdown-2-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-4 Bytes
(100%)
...dal-width-desktop-js-citation-modal-dialog-should-show-60-on-desktop-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+2.02 KB
(100%)
...dal-width-desktop-js-citation-modal-dialog-should-show-60-on-desktop-2-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+36 Bytes
(100%)
...ile-js-citation-modal-dialog-should-show-full-width-on-mobile-device-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+1.53 KB
(100%)
...ile-js-citation-modal-dialog-should-show-full-width-on-mobile-device-2-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Binary file added
BIN
+31.5 KB
...s-string-js-link-definition-should-display-identifier-of-type-string-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+55.9 KB
...napshots__/html/reference-js-link-definition-should-reference-sample-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+11.5 KB
...__/html/reply-action-js-originator-using-reply-action-should-display-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+30.5 KB
...n-should-word-wrap-pure-identifier-to-next-line-but-not-text-content-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,148 @@ | ||
<!doctype html> | ||
<html lang="en-US"> | ||
<head> | ||
<link href="/assets/index.css" rel="stylesheet" type="text/css" /> | ||
<script crossorigin="anonymous" src="/test-harness.js"></script> | ||
<script crossorigin="anonymous" src="/test-page-object.js"></script> | ||
<script crossorigin="anonymous" src="/__dist__/webchat-es5.js"></script> | ||
</head> | ||
<body> | ||
<main id="webchat"></main> | ||
<script> | ||
run(async function () { | ||
const { directLine, store } = testHelpers.createDirectLineEmulator(); | ||
|
||
WebChat.renderWebChat( | ||
{ | ||
directLine, | ||
store | ||
}, | ||
document.getElementById('webchat') | ||
); | ||
|
||
await pageConditions.uiConnected(); | ||
|
||
await directLine.emulateIncomingActivity({ | ||
entities: [ | ||
{ | ||
'@context': 'https://schema.org', | ||
'@id': '', | ||
'@type': 'Message', | ||
citation: [ | ||
{ | ||
'@type': 'Claim', | ||
appearance: { | ||
'@type': 'DigitalDocument', | ||
url: 'https://example.com/1/', | ||
usageInfo: { | ||
'@id': '_:1', | ||
'@type': 'CreativeWork', | ||
description: | ||
'Nisi quis ut sint elit est nulla enim eiusmod. Deserunt commodo pariatur nostrud culpa aliquip esse pariatur exercitation nulla do proident. Est qui eiusmod aliquip deserunt labore consequat fugiat. Ullamco reprehenderit nostrud eiusmod nisi nulla esse id. Reprehenderit aliqua quis consectetur sit cupidatat fugiat Lorem ex labore. Eiusmod velit laborum quis tempor incididunt excepteur culpa esse nulla.', | ||
keywords: ['encrypted-content'], | ||
name: 'Sit veniam do irure velit est et quis ut Lorem reprehenderit commodo cillum occaecat', | ||
pattern: { | ||
'@type': 'DefinedTerm', | ||
inDefinedTermSet: 'https://www.w3.org/TR/css-color-4/', | ||
name: 'color', | ||
termCode: 'orange' | ||
} | ||
} | ||
}, | ||
position: 1 | ||
}, | ||
{ | ||
'@type': 'Claim', | ||
appearance: { | ||
'@type': 'DigitalDocument', | ||
text: 'Incididunt amet dolore anim commodo fugiat occaecat elit nulla do consequat. Quis incididunt occaecat labore adipisicing. Cillum sunt velit consequat irure ipsum ullamco sint ea aute. Sunt et eu ut enim aliqua cupidatat non adipisicing dolore commodo dolor magna enim. Commodo reprehenderit excepteur ad nostrud ex id aliquip deserunt eiusmod. Esse non labore nulla voluptate.', | ||
usageInfo: { | ||
'@type': 'CreativeWork', | ||
name: 'Velit exercitation', | ||
pattern: { | ||
'@type': 'DefinedTerm', | ||
inDefinedTermSet: 'https://www.w3.org/TR/css-color-4/', | ||
name: 'color', | ||
termCode: 'Yellow' | ||
} | ||
} | ||
}, | ||
position: 3 | ||
}, | ||
{ | ||
'@type': 'Claim', | ||
appearance: { | ||
'@type': 'DigitalDocument', | ||
text: 'Ea nisi nostrud duis dolore aliqua sit reprehenderit minim est nisi id est sit. Amet mollit ex fugiat sint aliquip Lorem eiusmod incididunt nulla laboris labore nulla. In id exercitation ut non non Lorem consequat cupidatat deserunt do aliqua exercitation. Minim commodo aliquip dolore exercitation officia commodo sint aute aute. Fugiat laborum proident cupidatat quis eiusmod excepteur voluptate commodo. Ullamco minim duis id deserunt laboris ullamco cupidatat dolor est sint ut. Anim pariatur non ea do occaecat dolor sint ad.' | ||
}, | ||
position: 4 | ||
} | ||
], | ||
type: 'https://schema.org/Message', | ||
usageInfo: { '@id': '_:1' } | ||
} | ||
], | ||
text: 'Ipsum[1] dolore[2] cupidatat[3] magna[4] consectetur[5] do tempor est excepteur.\n\n[1]: https://example.com/1/ "Sint amet id officia dolor ex eiusmod ipsum ipsum magna fugiat"\n[2]: https://example.com/2/ "Laboris cupidatat voluptate"\n[3]: _:3 "Velit nulla culpa eu ea consectetur consectetur dolore velit"\n[4]: _:4 "Adipisicing enim nulla"\n[5]: https://example.com/5', | ||
type: 'message' | ||
}); | ||
|
||
await host.snapshot(); | ||
|
||
const [firstActivityElement] = pageElements.activities(); | ||
|
||
const linkDefinitions = firstActivityElement.querySelectorAll('.webchat__link-definitions__list-item'); | ||
|
||
expect(linkDefinitions).toHaveProperty('length', 5); | ||
|
||
expect(linkDefinitions[0].querySelector('.webchat__link-definitions__list-item-box').tagName).toBe('A'); | ||
expect( | ||
linkDefinitions[0].querySelector('.webchat__link-definitions__list-item-text').getAttribute('title') | ||
).toBe('Sint amet id officia dolor ex eiusmod ipsum ipsum magna fugiat'); | ||
expect( | ||
linkDefinitions[0].querySelector('.webchat__link-definitions__list-item-badge').getAttribute('title') | ||
).toBe( | ||
'Sit veniam do irure velit est et quis ut Lorem reprehenderit commodo cillum occaecat\n\nNisi quis ut sint elit est nulla enim eiusmod. Deserunt commodo pariatur nostrud culpa aliquip esse pariatur exercitation nulla do proident. Est qui eiusmod aliquip deserunt labore consequat fugiat. Ullamco reprehenderit nostrud eiusmod nisi nulla esse id. Reprehenderit aliqua quis consectetur sit cupidatat fugiat Lorem ex labore. Eiusmod velit laborum quis tempor incididunt excepteur culpa esse nulla.' | ||
); | ||
|
||
expect(linkDefinitions[1].querySelector('.webchat__link-definitions__list-item-box').tagName).toBe('A'); | ||
expect( | ||
linkDefinitions[1].querySelector('.webchat__link-definitions__list-item-text').getAttribute('title') | ||
).toBe('Laboris cupidatat voluptate'); | ||
expect(linkDefinitions[1].querySelector('.webchat__link-definitions__list-item-badge')).toBeNull(); | ||
|
||
expect(linkDefinitions[2].querySelector('.webchat__link-definitions__list-item-box').tagName).toBe('BUTTON'); | ||
expect( | ||
linkDefinitions[2].querySelector('.webchat__link-definitions__list-item-text').getAttribute('title') | ||
).toBe('Velit nulla culpa eu ea consectetur consectetur dolore velit'); | ||
expect( | ||
linkDefinitions[2].querySelector('.webchat__link-definitions__list-item-badge').getAttribute('title') | ||
).toBe('Velit exercitation'); | ||
|
||
expect(linkDefinitions[3].querySelector('.webchat__link-definitions__list-item-box').tagName).toBe('BUTTON'); | ||
expect( | ||
linkDefinitions[3].querySelector('.webchat__link-definitions__list-item-text').getAttribute('title') | ||
).toBe('Adipisicing enim nulla'); | ||
expect(linkDefinitions[3].querySelector('.webchat__link-definitions__list-item-badge')).toBeNull(); | ||
|
||
expect(document.querySelector('.webchat__link-definitions__header-text')).toHaveProperty( | ||
'textContent', | ||
'5 references' | ||
); | ||
|
||
expect(document.querySelector('.webchat__link-definitions__message-sensitivity-label-text')).toHaveProperty( | ||
'textContent', | ||
'Sit veniam do irure velit est et quis ut Lorem reprehenderit commodo cillum occaecat' | ||
); | ||
|
||
expect(document.querySelector('.webchat__link-definitions__message-sensitivity-label')).toHaveProperty( | ||
'title', | ||
'Sit veniam do irure velit est et quis ut Lorem reprehenderit commodo cillum occaecat\n\nNisi quis ut sint elit est nulla enim eiusmod. Deserunt commodo pariatur nostrud culpa aliquip esse pariatur exercitation nulla do proident. Est qui eiusmod aliquip deserunt labore consequat fugiat. Ullamco reprehenderit nostrud eiusmod nisi nulla esse id. Reprehenderit aliqua quis consectetur sit cupidatat fugiat Lorem ex labore. Eiusmod velit laborum quis tempor incididunt excepteur culpa esse nulla.' | ||
); | ||
|
||
expect( | ||
document.querySelector('.webchat__link-definitions__message-sensitivity-label--is-encrypted') | ||
).toBeTruthy(); | ||
}); | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/** @jest-environment ./packages/test/harness/src/host/jest/WebDriverEnvironment.js */ | ||
|
||
describe('link definition', () => { | ||
test('should display text ellipsis', () => runHTML('linkDefinition/badge.html')); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<!doctype html> | ||
<html lang="en-US"> | ||
<head> | ||
<link href="/assets/index.css" rel="stylesheet" type="text/css" /> | ||
<script crossorigin="anonymous" src="/test-harness.js"></script> | ||
<script crossorigin="anonymous" src="/test-page-object.js"></script> | ||
<script crossorigin="anonymous" src="/__dist__/webchat-es5.js"></script> | ||
</head> | ||
<body> | ||
<main id="webchat"></main> | ||
<script> | ||
run(async function () { | ||
const { directLine, store } = testHelpers.createDirectLineEmulator(); | ||
|
||
WebChat.renderWebChat( | ||
{ | ||
directLine, | ||
store | ||
}, | ||
document.getElementById('webchat') | ||
); | ||
|
||
await pageConditions.uiConnected(); | ||
|
||
await directLine.emulateIncomingActivity({ | ||
text: 'Ipsum[Abc] dolore[DEF] cupidatat[xyz] magna consectetur do tempor est excepteur.\n\n[Abc]: https://example.com/1/ "Sint amet id officia dolor ex eiusmod ipsum ipsum magna fugiat"\n[DEF]: https://example.com/2/ "Laboris cupidatat voluptate"\n[xyz]: https://example.com/3/ "Velit nulla culpa eu ea consectetur consectetur dolore velit"', | ||
type: 'message' | ||
}); | ||
|
||
await host.snapshot(); | ||
|
||
const [firstActivityElement] = pageElements.activities(); | ||
|
||
const linkDefinitions = firstActivityElement.querySelectorAll('.webchat__link-definitions__list-item'); | ||
|
||
expect(linkDefinitions).toHaveProperty('length', 3); | ||
|
||
expect(linkDefinitions[0].querySelector('.webchat__link-definitions__list-item-box').tagName).toBe('A'); | ||
expect( | ||
linkDefinitions[0].querySelector('.webchat__link-definitions__list-item-text').getAttribute('title') | ||
).toBe('Sint amet id officia dolor ex eiusmod ipsum ipsum magna fugiat'); | ||
|
||
expect(linkDefinitions[1].querySelector('.webchat__link-definitions__list-item-box').tagName).toBe('A'); | ||
expect( | ||
linkDefinitions[1].querySelector('.webchat__link-definitions__list-item-text').getAttribute('title') | ||
).toBe('Laboris cupidatat voluptate'); | ||
expect(linkDefinitions[1].querySelector('.webchat__link-definitions__list-item-badge')).toBeNull(); | ||
|
||
expect(linkDefinitions[2].querySelector('.webchat__link-definitions__list-item-box').tagName).toBe('A'); | ||
expect( | ||
linkDefinitions[2].querySelector('.webchat__link-definitions__list-item-text').getAttribute('title') | ||
).toBe('Velit nulla culpa eu ea consectetur consectetur dolore velit'); | ||
|
||
expect( | ||
[].map.call( | ||
firstActivityElement.querySelectorAll('.webchat__link-definitions__badge'), | ||
({ textContent }) => textContent | ||
) | ||
).toEqual(['Abc', 'DEF', 'xyz']); | ||
}); | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/** @jest-environment ./packages/test/harness/src/host/jest/WebDriverEnvironment.js */ | ||
|
||
describe('link definition', () => { | ||
test('should display identifier of type string', () => runHTML('linkDefinition/identifierAsString.html')); | ||
}); |
Oops, something went wrong.