profile-pane 3.2.3-0 → 3.2.3-2

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.
Files changed (107) hide show
  1. package/lib/ProfileView.css +73 -236
  2. package/lib/ProfileView.d.ts +2 -1
  3. package/lib/ProfileView.d.ts.map +1 -1
  4. package/lib/ProfileView.js +19 -18
  5. package/lib/index.d.ts.map +1 -1
  6. package/lib/index.js +35 -35
  7. package/lib/profile-pane.js +17229 -25377
  8. package/lib/profile-pane.js.map +1 -1
  9. package/lib/profile-pane.min.js +809 -1579
  10. package/lib/profile-pane.min.js.map +1 -1
  11. package/lib/sections/bio/BioSection.css +16 -123
  12. package/lib/sections/bio/BioSection.d.ts +2 -2
  13. package/lib/sections/bio/BioSection.d.ts.map +1 -1
  14. package/lib/sections/bio/BioSection.js +23 -32
  15. package/lib/sections/contactInfo/ContactInfoEditDialog.css +33 -66
  16. package/lib/sections/contactInfo/ContactInfoEditDialog.d.ts.map +1 -1
  17. package/lib/sections/contactInfo/ContactInfoEditDialog.js +15 -39
  18. package/lib/sections/contactInfo/ContactInfoSection.css +7 -7
  19. package/lib/sections/contactInfo/ContactInfoSection.d.ts +2 -2
  20. package/lib/sections/contactInfo/ContactInfoSection.d.ts.map +1 -1
  21. package/lib/sections/contactInfo/ContactInfoSection.js +34 -49
  22. package/lib/sections/education/EducationSection.d.ts +1 -1
  23. package/lib/sections/education/EducationSection.d.ts.map +1 -1
  24. package/lib/sections/education/EducationSection.js +2 -3
  25. package/lib/sections/heading/HeadingEditDialog.d.ts.map +1 -1
  26. package/lib/sections/heading/HeadingEditDialog.js +1 -9
  27. package/lib/sections/heading/HeadingSection.css +122 -346
  28. package/lib/sections/heading/HeadingSection.d.ts +2 -3
  29. package/lib/sections/heading/HeadingSection.d.ts.map +1 -1
  30. package/lib/sections/heading/HeadingSection.js +13 -19
  31. package/lib/sections/languages/LanguageEditDialog.d.ts.map +1 -1
  32. package/lib/sections/languages/LanguageEditDialog.js +7 -8
  33. package/lib/sections/languages/LanguageSection.css +6 -6
  34. package/lib/sections/languages/LanguageSection.d.ts +2 -2
  35. package/lib/sections/languages/LanguageSection.d.ts.map +1 -1
  36. package/lib/sections/languages/LanguageSection.js +33 -49
  37. package/lib/sections/projects/ProjectEditDialog.d.ts +0 -1
  38. package/lib/sections/projects/ProjectEditDialog.d.ts.map +1 -1
  39. package/lib/sections/projects/ProjectEditDialog.js +2 -6
  40. package/lib/sections/projects/ProjectSection.css +36 -94
  41. package/lib/sections/projects/ProjectSection.d.ts +2 -2
  42. package/lib/sections/projects/ProjectSection.d.ts.map +1 -1
  43. package/lib/sections/projects/ProjectSection.js +28 -49
  44. package/lib/sections/resume/ResumeEditDialog.d.ts +0 -1
  45. package/lib/sections/resume/ResumeEditDialog.d.ts.map +1 -1
  46. package/lib/sections/resume/ResumeEditDialog.js +20 -40
  47. package/lib/sections/resume/ResumeSection.css +51 -133
  48. package/lib/sections/resume/ResumeSection.d.ts +3 -3
  49. package/lib/sections/resume/ResumeSection.d.ts.map +1 -1
  50. package/lib/sections/resume/ResumeSection.js +28 -42
  51. package/lib/sections/shared/sectionCardHelpers.js +15 -15
  52. package/lib/sections/skills/SkillsEditDialog.d.ts.map +1 -1
  53. package/lib/sections/skills/SkillsEditDialog.js +1 -3
  54. package/lib/sections/skills/SkillsSection.css +20 -67
  55. package/lib/sections/skills/SkillsSection.d.ts +2 -2
  56. package/lib/sections/skills/SkillsSection.d.ts.map +1 -1
  57. package/lib/sections/skills/SkillsSection.js +36 -55
  58. package/lib/sections/social/SocialEditDialog.d.ts.map +1 -1
  59. package/lib/sections/social/SocialEditDialog.js +4 -9
  60. package/lib/sections/social/SocialSection.css +19 -70
  61. package/lib/sections/social/SocialSection.d.ts +2 -2
  62. package/lib/sections/social/SocialSection.d.ts.map +1 -1
  63. package/lib/sections/social/SocialSection.js +37 -61
  64. package/lib/specialButtons/addMeToYourFriends.d.ts.map +1 -1
  65. package/lib/specialButtons/addMeToYourFriends.js +0 -2
  66. package/lib/styles/CollapsibleSection.css +39 -223
  67. package/lib/styles/EditDialogs.css +90 -284
  68. package/lib/styles/EditDialogs.responsive.css +72 -147
  69. package/lib/types.d.ts +1 -0
  70. package/lib/types.d.ts.map +1 -1
  71. package/lib/ui/dialog.css +18 -89
  72. package/lib/ui/dialog.d.ts.map +1 -1
  73. package/lib/ui/dialog.js +5 -9
  74. package/lib/ui/dialog.responsive.css +31 -34
  75. package/lib/ui/responsiveActionButton.d.ts +19 -0
  76. package/lib/ui/responsiveActionButton.d.ts.map +1 -0
  77. package/lib/ui/responsiveActionButton.js +34 -0
  78. package/lib/utils/resize.d.ts +2 -0
  79. package/lib/utils/resize.d.ts.map +1 -0
  80. package/lib/utils/resize.js +40 -0
  81. package/package.json +19 -19
  82. package/lib/303.profile-pane.js +0 -1362
  83. package/lib/303.profile-pane.js.map +0 -1
  84. package/lib/303.profile-pane.min.js +0 -2
  85. package/lib/303.profile-pane.min.js.map +0 -1
  86. package/lib/specialButtons/addContact/AddMeToYourContacts.css +0 -1118
  87. package/lib/specialButtons/addContact/ContactCreationDialog.d.ts +0 -10
  88. package/lib/specialButtons/addContact/ContactCreationDialog.d.ts.map +0 -1
  89. package/lib/specialButtons/addContact/ContactCreationDialog.js +0 -1123
  90. package/lib/specialButtons/addContact/addMeToYourContacts.d.ts +0 -16
  91. package/lib/specialButtons/addContact/addMeToYourContacts.d.ts.map +0 -1
  92. package/lib/specialButtons/addContact/addMeToYourContacts.js +0 -136
  93. package/lib/specialButtons/addContact/contactsErrors.d.ts +0 -8
  94. package/lib/specialButtons/addContact/contactsErrors.d.ts.map +0 -1
  95. package/lib/specialButtons/addContact/contactsErrors.js +0 -106
  96. package/lib/specialButtons/addContact/contactsTypes.d.ts +0 -43
  97. package/lib/specialButtons/addContact/contactsTypes.d.ts.map +0 -1
  98. package/lib/specialButtons/addContact/contactsTypes.js +0 -5
  99. package/lib/specialButtons/addContact/helpers.d.ts +0 -7
  100. package/lib/specialButtons/addContact/helpers.d.ts.map +0 -1
  101. package/lib/specialButtons/addContact/helpers.js +0 -103
  102. package/lib/specialButtons/addContact/mutations.d.ts +0 -16
  103. package/lib/specialButtons/addContact/mutations.d.ts.map +0 -1
  104. package/lib/specialButtons/addContact/mutations.js +0 -300
  105. package/lib/specialButtons/addContact/selectors.d.ts +0 -10
  106. package/lib/specialButtons/addContact/selectors.d.ts.map +0 -1
  107. package/lib/specialButtons/addContact/selectors.js +0 -163
@@ -1,16 +0,0 @@
1
- import { TemplateResult } from 'lit-html';
2
- import 'solid-ui/components/button';
3
- import type { Button as SolidUIButtonElement } from 'solid-ui/components/button';
4
- import { DataBrowserContext } from 'pane-registry';
5
- import { NamedNode } from 'rdflib';
6
- import { AddressBooksData } from './contactsTypes';
7
- import './AddMeToYourContacts.css';
8
- import type ContactsModuleRdfLib from '@solid-data-modules/contacts-rdflib';
9
- type RefreshableSolidUIButton = SolidUIButtonElement & {
10
- refresh?: () => void;
11
- };
12
- declare const addMeToYourContactsDiv: (subject: NamedNode, context: DataBrowserContext) => Promise<TemplateResult>;
13
- declare const createAddMeToYourContactsButton: (subject: NamedNode, context: DataBrowserContext) => Promise<RefreshableSolidUIButton>;
14
- declare function saveNewContact(subject: NamedNode, context: DataBrowserContext, contactsModule: ContactsModuleRdfLib, addressBooksData: AddressBooksData): Promise<void>;
15
- export { addMeToYourContactsDiv, createAddMeToYourContactsButton, saveNewContact };
16
- //# sourceMappingURL=addMeToYourContacts.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"addMeToYourContacts.d.ts","sourceRoot":"","sources":["../../../src/specialButtons/addContact/addMeToYourContacts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,cAAc,EAAE,MAAM,UAAU,CAAA;AACvD,OAAO,4BAA4B,CAAA;AACnC,OAAO,KAAK,EAAE,MAAM,IAAI,oBAAoB,EAAE,MAAM,4BAA4B,CAAA;AAChF,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAElD,OAAO,EAAa,SAAS,EAAE,MAAM,QAAQ,CAAA;AAM7C,OAAO,EAAE,gBAAgB,EAAe,MAAM,iBAAiB,CAAA;AAK/D,OAAO,2BAA2B,CAAA;AAClC,OAAO,KAAK,oBAAoB,MAAM,qCAAqC,CAAA;AAK3E,KAAK,wBAAwB,GAAG,oBAAoB,GAAG;IAAE,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;CAAE,CAAA;AAuB/E,QAAA,MAAM,sBAAsB,GAC1B,SAAS,SAAS,EAClB,SAAS,kBAAkB,KAC1B,OAAO,CAAC,cAAc,CAaxB,CAAA;AAED,QAAA,MAAM,+BAA+B,GACnC,SAAS,SAAS,EAClB,SAAS,kBAAkB,KAC1B,OAAO,CAAC,wBAAwB,CAyDlC,CAAA;AAED,iBAAe,cAAc,CAC3B,OAAO,EAAE,SAAS,EAClB,OAAO,EAAE,kBAAkB,EAC3B,cAAc,EAAE,oBAAoB,EACpC,gBAAgB,EAAE,gBAAgB,GACjC,OAAO,CAAC,IAAI,CAAC,CA4Bf;AAED,OAAO,EACL,sBAAsB,EACtB,+BAA+B,EAC/B,cAAc,EACf,CAAA"}
@@ -1,136 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.createAddMeToYourContactsButton = exports.addMeToYourContactsDiv = void 0;
7
- exports.saveNewContact = saveNewContact;
8
- var _litHtml = require("lit-html");
9
- require("solid-ui/components/button");
10
- var _solidLogic = require("solid-logic");
11
- var _buttonsHelper = require("../../buttonsHelper");
12
- var _selectors = require("./selectors");
13
- var _mutations = require("./mutations");
14
- var _texts = require("../../texts");
15
- require("./AddMeToYourContacts.css");
16
- var _contactsErrors = require("./contactsErrors");
17
- var _ContactCreationDialog = require("./ContactCreationDialog");
18
- var _profileIcons = require("../../icons-svg/profileIcons");
19
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
20
- function renderAddToContactsButtonLabel(button, label, showIcon = false) {
21
- const buttonDocument = button.ownerDocument;
22
- const content = [];
23
- if (showIcon) {
24
- const iconWrapper = buttonDocument.createElement('span');
25
- iconWrapper.className = 'profile__btn-contacts-icon inline-flex-row justify-center';
26
- iconWrapper.setAttribute('aria-hidden', 'true');
27
- (0, _litHtml.render)(_profileIcons.plusIcon, iconWrapper);
28
- content.push(iconWrapper);
29
- }
30
- const labelWrapper = buttonDocument.createElement('span');
31
- labelWrapper.className = 'profile__btn-contacts-label';
32
- labelWrapper.textContent = label;
33
- content.push(labelWrapper);
34
- button.replaceChildren(...content);
35
- }
36
- let buttonContainer = document.createElement('section');
37
- const addMeToYourContactsDiv = async (subject, context) => {
38
- buttonContainer = context.dom.createElement('section');
39
- buttonContainer.setAttribute('id', 'add-to-contacts-button-container');
40
- buttonContainer.setAttribute('class', 'profile-contacts-button__section text-truncate text-center section-centered');
41
- buttonContainer.setAttribute('aria-label', 'Add me to your contacts actions');
42
- buttonContainer.setAttribute('data-testid', 'button');
43
- buttonContainer.hidden = true;
44
- const button = await createAddMeToYourContactsButton(subject, context);
45
- button.classList.add('profile__action-button', 'profile__btn-contacts', 'flex-center');
46
- buttonContainer.appendChild(button);
47
- return (0, _litHtml.html)`${buttonContainer}`;
48
- };
49
- exports.addMeToYourContactsDiv = addMeToYourContactsDiv;
50
- const createAddMeToYourContactsButton = async (subject, context) => {
51
- const me = _solidLogic.authn.currentUser();
52
- let addressBooksData = null;
53
- let contactData = null;
54
- const store = context.session.store;
55
- const fetcher = store.fetcher;
56
- const updater = store.updater;
57
- const {
58
- default: ContactsModuleRdfLib
59
- } = await Promise.resolve().then(() => _interopRequireWildcard(require('@solid-data-modules/contacts-rdflib')));
60
- const contactsModule = new ContactsModuleRdfLib({
61
- store,
62
- fetcher,
63
- updater
64
- });
65
- try {
66
- addressBooksData = await (0, _selectors.getAddressBooksData)(context, contactsModule);
67
- contactData = await (0, _selectors.getContactData)(store, subject);
68
- } catch (error) {
69
- (0, _contactsErrors.addErrorToErrorDisplay)(context, error);
70
- }
71
- function setButtonHandler(event) {
72
- event.preventDefault();
73
- saveNewContact(subject, context, contactsModule, addressBooksData).catch(error => {
74
- (0, _buttonsHelper.clearPreviousMessage)(buttonContainer);
75
- (0, _buttonsHelper.complain)(buttonContainer, context, error);
76
- });
77
- }
78
- const label = (0, _buttonsHelper.checkIfAnyUserLoggedIn)(me) ? _texts.addMeToYourContactsButtonText : _texts.logInAddMeToYourContactsButtonText;
79
- const button = context.dom.createElement('solid-ui-button');
80
- button.setAttribute('type', 'button');
81
- button.setAttribute('variant', 'secondary');
82
- button.setAttribute('size', 'sm');
83
- button.addEventListener('click', setButtonHandler);
84
- button.setAttribute('id', 'add-to-contacts-button');
85
- renderAddToContactsButtonLabel(button, label, (0, _buttonsHelper.checkIfAnyUserLoggedIn)(me));
86
- button.refresh = refreshButton;
87
- refreshButton();
88
- function refreshButton() {
89
- if ((0, _buttonsHelper.checkIfAnyUserLoggedIn)(me)) {
90
- button.disabled = false;
91
- button.removeAttribute('disabled');
92
- const contactExistsByWebID = contactData ? (0, _selectors.checkIfContactExistsByWebID)(addressBooksData, contactData.webID) : false;
93
- const contactExistsByName = contactData ? (0, _selectors.checkIfContactExistsByName)(addressBooksData, contactData.name) : false;
94
- if (contactExistsByWebID) {
95
- renderAddToContactsButtonLabel(button, _texts.contactExistsAlreadyButtonText);
96
- button.disabled = true;
97
- button.setAttribute('disabled', 'true');
98
- } else if (contactExistsByName) {
99
- renderAddToContactsButtonLabel(button, _texts.contactExistsAlreadyByNameButtonText);
100
- } else {
101
- renderAddToContactsButtonLabel(button, _texts.addMeToYourContactsButtonText, true);
102
- }
103
- } else {
104
- renderAddToContactsButtonLabel(button, _texts.logInAddMeToYourContactsButtonText);
105
- }
106
- }
107
- return button;
108
- };
109
- exports.createAddMeToYourContactsButton = createAddMeToYourContactsButton;
110
- async function saveNewContact(subject, context, contactsModule, addressBooksData) {
111
- const me = _solidLogic.authn.currentUser();
112
- const store = context.session.store;
113
-
114
- // need to find out where the user wants to add the Contact
115
- if ((0, _buttonsHelper.checkIfAnyUserLoggedIn)(me)) {
116
- if (!(0, _selectors.checkIfContactExistsByWebID)(addressBooksData, subject.value)) {
117
- //if contact does not exist, we add her/him
118
- await store.fetcher.load(me);
119
- try {
120
- const contactData = await (0, _selectors.getContactData)(store, subject);
121
- const contactExistsByNameUri = (0, _selectors.checkIfContactExistsByName)(addressBooksData, contactData.name);
122
- if (contactExistsByNameUri) {
123
- const fromRegisteredAddressBook = true;
124
- const handled = (0, _ContactCreationDialog.handleContactExistsByName)(context, addressBooksData, contactData, contactExistsByNameUri, fromRegisteredAddressBook);
125
- if (!handled) (0, _contactsErrors.addErrorToErrorDisplay)(context, _texts.errorAddingContactWebIDToAddressBook);
126
- } else {
127
- await (0, _mutations.addContactToAddressBook)(context, contactsModule, contactData, addressBooksData, buttonContainer);
128
- }
129
- } catch (error) {
130
- let errorMessage = error;
131
- if (errorMessage.toString().includes('Unauthenticated')) errorMessage = _texts.userNotLoggedInErrorMessage;
132
- throw new Error(errorMessage);
133
- }
134
- } else throw new Error(_texts.contactExistsMessage);
135
- } else throw new Error(_texts.userNotLoggedInErrorMessage);
136
- }
@@ -1,8 +0,0 @@
1
- import { DataBrowserContext } from 'pane-registry';
2
- declare function formatContactsDialogError(prefix: string, error: unknown): string;
3
- declare const addErrorToErrorDisplay: (context: DataBrowserContext, message: string) => void;
4
- declare const checkAndAddErrorToDisplay: (context: DataBrowserContext, message: string) => void;
5
- declare const createErrorDisplaySection: (context: DataBrowserContext) => HTMLElement;
6
- declare const checkAndRemoveErrorDisplay: (context: DataBrowserContext) => void;
7
- export { createErrorDisplaySection, checkAndRemoveErrorDisplay, addErrorToErrorDisplay, checkAndAddErrorToDisplay, formatContactsDialogError };
8
- //# sourceMappingURL=contactsErrors.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"contactsErrors.d.ts","sourceRoot":"","sources":["../../../src/specialButtons/addContact/contactsErrors.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAO,eAAe,CAAA;AAOnD,iBAAS,yBAAyB,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,MAAM,CAGzE;AAMD,QAAA,MAAM,sBAAsB,GAC1B,SAAS,kBAAkB,EAC3B,SAAS,MAAM,SA4BhB,CAAA;AAED,QAAA,MAAM,yBAAyB,GAC7B,SAAS,kBAAkB,EAC3B,SAAS,MAAM,SAWhB,CAAA;AAED,QAAA,MAAM,yBAAyB,GAC7B,SAAS,kBAAkB,KAC1B,WAmCF,CAAA;AAED,QAAA,MAAM,0BAA0B,GAC9B,SAAS,kBAAkB,SAiB5B,CAAA;AAED,OAAO,EACL,yBAAyB,EACzB,0BAA0B,EAC1B,sBAAsB,EACtB,yBAAyB,EACzB,yBAAyB,EACzB,CAAA"}
@@ -1,106 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.createErrorDisplaySection = exports.checkAndRemoveErrorDisplay = exports.checkAndAddErrorToDisplay = exports.addErrorToErrorDisplay = void 0;
7
- exports.formatContactsDialogError = formatContactsDialogError;
8
- var _buttonsHelper = require("../../buttonsHelper");
9
- function toErrorMessage(error) {
10
- return error instanceof Error ? error.message : String(error);
11
- }
12
- function formatContactsDialogError(prefix, error) {
13
- const message = toErrorMessage(error);
14
- return message.startsWith(prefix) ? message : `${prefix}\n${message}`;
15
- }
16
- function getSharedDialogErrorSection(context) {
17
- return context.dom.querySelector('#profile-modal #modal-error');
18
- }
19
- const addErrorToErrorDisplay = (context, message) => {
20
- const sharedDialogErrorSection = getSharedDialogErrorSection(context);
21
- if (sharedDialogErrorSection && context.dom.getElementById('contacts-addressbook-picker-dialog')) {
22
- sharedDialogErrorSection.textContent = message;
23
- sharedDialogErrorSection.setAttribute('aria-hidden', 'false');
24
- sharedDialogErrorSection.hidden = false;
25
- sharedDialogErrorSection.focus();
26
- return;
27
- }
28
- const errorDisplaySection = context.dom.getElementById('error-display-section');
29
- if (errorDisplaySection) {
30
- const errorMessage = context.dom.getElementById('error-display-message');
31
- errorDisplaySection.classList.add('contacts-dialog__error--visible');
32
- errorDisplaySection.setAttribute('aria-hidden', 'false');
33
- if (errorMessage) {
34
- errorMessage.textContent = message;
35
- } else {
36
- errorDisplaySection.textContent = message;
37
- }
38
- if (errorDisplaySection instanceof HTMLElement) {
39
- errorDisplaySection.focus();
40
- }
41
- } else {
42
- const buttonContainer = context.dom.getElementById('add-to-contacts-button-container');
43
- (0, _buttonsHelper.complain)(buttonContainer, context, message);
44
- }
45
- };
46
- exports.addErrorToErrorDisplay = addErrorToErrorDisplay;
47
- const checkAndAddErrorToDisplay = (context, message) => {
48
- const selectedGroupElements = context.dom.querySelectorAll('#group-list .contacts-dialog__list-button[selected]');
49
- const groupNameField = context.dom.querySelector('#groupNameInput');
50
- // @ts-ignore
51
- const enteredGroupName = groupNameField.value;
52
- if (selectedGroupElements.length === 0 && !enteredGroupName) {
53
- addErrorToErrorDisplay(context, message);
54
- }
55
- };
56
- exports.checkAndAddErrorToDisplay = checkAndAddErrorToDisplay;
57
- const createErrorDisplaySection = context => {
58
- const setButtonOnClickHandler = event => {
59
- event.preventDefault();
60
- errorDisplaySection.classList.remove('contacts-dialog__error--visible');
61
- errorDisplaySection.setAttribute('aria-hidden', 'true');
62
- const errorMessage = context.dom.getElementById('error-display-message');
63
- if (errorMessage) errorMessage.textContent = '';
64
- };
65
- const errorDisplaySection = context.dom.createElement('section');
66
- errorDisplaySection.setAttribute('role', 'alert');
67
- errorDisplaySection.setAttribute('aria-live', 'assertive');
68
- errorDisplaySection.setAttribute('aria-atomic', 'true');
69
- errorDisplaySection.setAttribute('aria-hidden', 'true');
70
- errorDisplaySection.setAttribute('aria-label', 'Section to display error messages related to contact creation');
71
- errorDisplaySection.setAttribute('id', 'error-display-section');
72
- errorDisplaySection.setAttribute('tabindex', '-1');
73
- errorDisplaySection.classList.add('contacts-dialog__error');
74
- const closeButton = context.dom.createElement('solid-ui-button');
75
- closeButton.setAttribute('type', 'button');
76
- closeButton.setAttribute('variant', 'icon');
77
- closeButton.setAttribute('size', 'sm');
78
- closeButton.setAttribute('aria-label', 'Close error');
79
- closeButton.setAttribute('label', 'Close error');
80
- closeButton.classList.add('contacts-dialog__error-close');
81
- closeButton.textContent = 'x';
82
- closeButton.addEventListener('click', setButtonOnClickHandler);
83
- const errorMessage = context.dom.createElement('p');
84
- errorMessage.setAttribute('id', 'error-display-message');
85
- errorDisplaySection.appendChild(closeButton);
86
- errorDisplaySection.appendChild(errorMessage);
87
- return errorDisplaySection;
88
- };
89
- exports.createErrorDisplaySection = createErrorDisplaySection;
90
- const checkAndRemoveErrorDisplay = context => {
91
- const sharedDialogErrorSection = getSharedDialogErrorSection(context);
92
- if (sharedDialogErrorSection && context.dom.getElementById('contacts-addressbook-picker-dialog')) {
93
- sharedDialogErrorSection.textContent = '';
94
- sharedDialogErrorSection.setAttribute('aria-hidden', 'true');
95
- sharedDialogErrorSection.hidden = true;
96
- return;
97
- }
98
- const errorDisplaySection = context.dom.getElementById('error-display-section');
99
- if (errorDisplaySection && errorDisplaySection.classList.contains('contacts-dialog__error--visible')) {
100
- errorDisplaySection.classList.remove('contacts-dialog__error--visible');
101
- errorDisplaySection.setAttribute('aria-hidden', 'true');
102
- const errorMessage = context.dom.getElementById('error-display-message');
103
- if (errorMessage) errorMessage.textContent = '';
104
- }
105
- };
106
- exports.checkAndRemoveErrorDisplay = checkAndRemoveErrorDisplay;
@@ -1,43 +0,0 @@
1
- import { NamedNode } from 'rdflib';
2
- export interface SelectedAddressBookUris {
3
- addressBookUri: string;
4
- groupUris: string[];
5
- }
6
- export type GroupData = {
7
- name: string;
8
- uri: string;
9
- };
10
- export type ContactDataFromAddressBook = {
11
- name: string;
12
- uri: string;
13
- };
14
- export interface AddressBookDetails {
15
- name: string;
16
- groups: GroupData[];
17
- contacts: ContactDataFromAddressBook[];
18
- }
19
- export interface AddressBooksData {
20
- public: Map<string, AddressBookDetails>;
21
- private: Map<string, AddressBookDetails>;
22
- contactWebIDs: Map<string, string>;
23
- contactNames: Map<string, string>;
24
- }
25
- export interface EmailDetails {
26
- type: NamedNode;
27
- email: NamedNode;
28
- }
29
- export interface PhoneDetails {
30
- type: NamedNode;
31
- phoneNumber: NamedNode;
32
- }
33
- export interface ContactData {
34
- name: string;
35
- nickname?: string;
36
- preferredSubjectPronoun?: string;
37
- preferredObjectPronoun?: string;
38
- preferredRelativePronoun?: string;
39
- emails?: EmailDetails[];
40
- phoneNumbers?: PhoneDetails[];
41
- webID: string;
42
- }
43
- //# sourceMappingURL=contactsTypes.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"contactsTypes.d.ts","sourceRoot":"","sources":["../../../src/specialButtons/addContact/contactsTypes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAElC,MAAM,WAAW,uBAAuB;IACtC,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,EAAG,CAAA;CACrB;AACD,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAA;CACZ,CAAA;AAED,MAAM,MAAM,0BAA0B,GAAG;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAA;CACZ,CAAA;AACD,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,SAAS,EAAE,CAAA;IACnB,QAAQ,EAAE,0BAA0B,EAAE,CAAA;CACvC;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;IACxC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;IACzC,aAAa,EAAE,GAAG,CAAC,MAAM,EAAC,MAAM,CAAC,CAAA;IACjC,YAAY,EAAE,GAAG,CAAC,MAAM,EAAC,MAAM,CAAC,CAAA;CACjC;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,EAAE,SAAS,CAAA;CACjB;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,SAAS,CAAC;IAChB,WAAW,EAAE,SAAS,CAAA;CACvB;AACD,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,MAAM,CAAC,EAAE,YAAY,EAAE,CAAC;IACxB,YAAY,CAAC,EAAE,YAAY,EAAE,CAAC;IAC9B,KAAK,EAAE,MAAM,CAAA;CACd"}
@@ -1,5 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
@@ -1,7 +0,0 @@
1
- import { DataBrowserContext } from 'pane-registry';
2
- import { AddressBookDetails, AddressBooksData, ContactData, GroupData } from './contactsTypes';
3
- declare function refreshButton(context: DataBrowserContext, addressBooksData: AddressBooksData, contactData: ContactData): void;
4
- declare function addGroupToAddressBookData(addressBooksData: AddressBooksData, addressBookUri: string, group: GroupData): boolean;
5
- declare function addAddressBookToAddressBooksData(addressBooksData: AddressBooksData, addressBookUri: string, addressBook: AddressBookDetails, visibility?: 'public' | 'private'): AddressBooksData;
6
- export { refreshButton, addGroupToAddressBookData, addAddressBookToAddressBooksData };
7
- //# sourceMappingURL=helpers.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/specialButtons/addContact/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAQlD,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAmC9F,iBAAS,aAAa,CACpB,OAAO,EAAE,kBAAkB,EAC3B,gBAAgB,EAAE,gBAAgB,EAClC,WAAW,EAAE,WAAW,QAoBzB;AAED,iBAAS,yBAAyB,CAChC,gBAAgB,EAAE,gBAAgB,EAClC,cAAc,EAAE,MAAM,EACtB,KAAK,EAAE,SAAS,GACf,OAAO,CA0BT;AAED,iBAAS,gCAAgC,CACvC,gBAAgB,EAAE,gBAAgB,EAClC,cAAc,EAAE,MAAM,EACtB,WAAW,EAAE,kBAAkB,EAC/B,UAAU,GAAE,QAAQ,GAAG,SAAqB,GAC3C,gBAAgB,CAuBlB;AAED,OAAO,EACL,aAAa,EACb,yBAAyB,EACzB,gCAAgC,EACjC,CAAA"}
@@ -1,103 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.addAddressBookToAddressBooksData = addAddressBookToAddressBooksData;
7
- exports.addGroupToAddressBookData = addGroupToAddressBookData;
8
- exports.refreshButton = refreshButton;
9
- var _solidLogic = require("solid-logic");
10
- var _texts = require("../../texts");
11
- var _buttonsHelper = require("../../buttonsHelper");
12
- var _selectors = require("./selectors");
13
- var _profileIcons = require("../../icons-svg/profileIcons");
14
- const addAsContactButtonText = 'Add as Contact';
15
- function setAddToContactsButtonContent(button, label, showIcon = false) {
16
- if (!button) return;
17
- const {
18
- ownerDocument
19
- } = button;
20
- const content = [];
21
- if (showIcon) {
22
- const iconWrapper = ownerDocument.createElement('span');
23
- iconWrapper.className = 'profile__btn-contacts-icon inline-flex-row justify-center';
24
- iconWrapper.setAttribute('aria-hidden', 'true');
25
- renderIconIntoElement(iconWrapper);
26
- content.push(iconWrapper);
27
- }
28
- const labelWrapper = ownerDocument.createElement('span');
29
- labelWrapper.className = 'profile__btn-contacts-label';
30
- labelWrapper.textContent = label;
31
- content.push(labelWrapper);
32
- button.replaceChildren(...content);
33
- }
34
- function renderIconIntoElement(element) {
35
- const svgTemplate = _profileIcons.plusIcon;
36
- if ('innerHTML' in element && svgTemplate && Array.isArray(svgTemplate.strings)) {
37
- element.innerHTML = svgTemplate.strings.join('');
38
- }
39
- }
40
- function refreshButton(context, addressBooksData, contactData) {
41
- const me = _solidLogic.authn.currentUser();
42
- const button = context.dom.getElementById('add-to-contacts-button');
43
- if ((0, _buttonsHelper.checkIfAnyUserLoggedIn)(me)) {
44
- const contactExistsByWebID = (0, _selectors.checkIfContactExistsByWebID)(addressBooksData, contactData.webID);
45
- const contactExistsByName = (0, _selectors.checkIfContactExistsByName)(addressBooksData, contactData.name);
46
- if (contactExistsByWebID) {
47
- setAddToContactsButtonContent(button, _texts.contactExistsAlreadyButtonText);
48
- button.onclick = null;
49
- button.setAttribute('disabled', '');
50
- } else if (contactExistsByName) {
51
- setAddToContactsButtonContent(button, _texts.contactExistsAlreadyByNameButtonText);
52
- button.removeAttribute('disabled');
53
- } else {
54
- setAddToContactsButtonContent(button, addAsContactButtonText, true);
55
- }
56
- } else {
57
- setAddToContactsButtonContent(button, _texts.logInAddMeToYourContactsButtonText);
58
- }
59
- }
60
- function addGroupToAddressBookData(addressBooksData, addressBookUri, group) {
61
- const publicAddressBook = addressBooksData.public.get(addressBookUri);
62
- if (publicAddressBook) {
63
- const groupExists = publicAddressBook.groups.some(existingGroup => existingGroup.uri === group.uri);
64
- if (!groupExists) {
65
- addressBooksData.public.set(addressBookUri, {
66
- ...publicAddressBook,
67
- groups: [...publicAddressBook.groups, group]
68
- });
69
- }
70
- return true;
71
- }
72
- const privateAddressBook = addressBooksData.private.get(addressBookUri);
73
- if (privateAddressBook) {
74
- const groupExists = privateAddressBook.groups.some(existingGroup => existingGroup.uri === group.uri);
75
- if (!groupExists) {
76
- addressBooksData.private.set(addressBookUri, {
77
- ...privateAddressBook,
78
- groups: [...privateAddressBook.groups, group]
79
- });
80
- }
81
- return true;
82
- }
83
- return false;
84
- }
85
- function addAddressBookToAddressBooksData(addressBooksData, addressBookUri, addressBook, visibility = 'private') {
86
- const nextAddressBooksData = {
87
- public: new Map(addressBooksData.public),
88
- private: new Map(addressBooksData.private),
89
- contactWebIDs: addressBooksData.contactWebIDs,
90
- contactNames: addressBooksData.contactNames
91
- };
92
- const existingAddressBook = nextAddressBooksData.public.get(addressBookUri) || nextAddressBooksData.private.get(addressBookUri);
93
- const nextAddressBook = existingAddressBook ? {
94
- ...existingAddressBook,
95
- ...addressBook,
96
- groups: addressBook.groups.length ? addressBook.groups : existingAddressBook.groups,
97
- contacts: addressBook.contacts.length ? addressBook.contacts : existingAddressBook.contacts
98
- } : addressBook;
99
- nextAddressBooksData.public.delete(addressBookUri);
100
- nextAddressBooksData.private.delete(addressBookUri);
101
- nextAddressBooksData[visibility].set(addressBookUri, nextAddressBook);
102
- return nextAddressBooksData;
103
- }
@@ -1,16 +0,0 @@
1
- import ContactsModuleRdfLib from '@solid-data-modules/contacts-rdflib';
2
- import { DataBrowserContext } from 'pane-registry';
3
- import { AddressBookDetails, AddressBooksData, ContactData, SelectedAddressBookUris } from './contactsTypes';
4
- declare function addContactToAddressBook(context: DataBrowserContext, contactsModule: ContactsModuleRdfLib, contactData: ContactData, addressBooksData: AddressBooksData, container: HTMLDivElement): Promise<void>;
5
- declare function addANewAddressBookUriToAddressBooks(context: DataBrowserContext, contactsModule: ContactsModuleRdfLib, _addressBooksData: AddressBooksData, enteredAddressBookUri: string): Promise<{
6
- addressBooksData: AddressBooksData;
7
- addressBook: AddressBookDetails;
8
- addressBookUri: string | null;
9
- }>;
10
- declare function createContactInAddressBook(context: DataBrowserContext, contactsModule: ContactsModuleRdfLib, contactData: ContactData, selectedAddressBookUris: SelectedAddressBookUris): Promise<string>;
11
- declare function addAddressToTypeIndex(context: DataBrowserContext, typeOfIndex: string, addressBookUri: string): Promise<boolean>;
12
- declare function addWebIDToExistingContact(context: DataBrowserContext, contactData: ContactData, contactUri: string): Promise<void>;
13
- declare function updateAddressBookName(context: DataBrowserContext, addressBookUri: string, newName: string): Promise<void>;
14
- declare function handleAddressBookCreation(dataBrowserContext: DataBrowserContext, containerName: string, enteredAddressName: string): Promise<string>;
15
- export { addContactToAddressBook, createContactInAddressBook, addAddressToTypeIndex, addWebIDToExistingContact, addANewAddressBookUriToAddressBooks, updateAddressBookName, handleAddressBookCreation };
16
- //# sourceMappingURL=mutations.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mutations.d.ts","sourceRoot":"","sources":["../../../src/specialButtons/addContact/mutations.ts"],"names":[],"mappings":"AAEA,OAAO,oBAAoB,MAAM,qCAAqC,CAAA;AAEtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAclD,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,WAAW,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAA;AAK5G,iBAAe,uBAAuB,CACpC,OAAO,EAAE,kBAAkB,EAC3B,cAAc,EAAE,oBAAoB,EACpC,WAAW,EAAE,WAAW,EACxB,gBAAgB,EAAE,gBAAgB,EAClC,SAAS,EAAE,cAAc,iBAgC1B;AAqDD,iBAAe,mCAAmC,CAChD,OAAO,EAAE,kBAAkB,EAC3B,cAAc,EAAE,oBAAoB,EACpC,iBAAiB,EAAE,gBAAgB,EACnC,qBAAqB,EAAE,MAAM,GAC5B,OAAO,CAAC;IAAE,gBAAgB,EAAE,gBAAgB,CAAC;IAAC,WAAW,EAAE,kBAAkB,CAAC;IAAC,cAAc,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAC,CAUjH;AAqDD,iBAAe,0BAA0B,CACvC,OAAO,EAAE,kBAAkB,EAC3B,cAAc,EAAE,oBAAoB,EACpC,WAAW,EAAE,WAAW,EACxB,uBAAuB,EAAE,uBAAuB,GAC/C,OAAO,CAAC,MAAM,CAAC,CAkCjB;AAED,iBAAe,qBAAqB,CAClC,OAAO,EAAE,kBAAkB,EAC3B,WAAW,EAAE,MAAM,EACnB,cAAc,EAAE,MAAM,GACrB,OAAO,CAAC,OAAO,CAAC,CAsBlB;AAED,iBAAe,yBAAyB,CACtC,OAAO,EAAE,kBAAkB,EAC3B,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,MAAM,iBAYnB;AAkED,iBAAe,qBAAqB,CAClC,OAAO,EAAE,kBAAkB,EAC3B,cAAc,EAAE,MAAM,EACtB,OAAO,EAAE,MAAM,iBA0BhB;AAED,iBAAe,yBAAyB,CACtC,kBAAkB,EAAE,kBAAkB,EACtC,aAAa,EAAE,MAAM,EACrB,kBAAkB,EAAE,MAAM,GACzB,OAAO,CAAC,MAAM,CAAC,CA6CjB;AAED,OAAO,EACL,uBAAuB,EACvB,0BAA0B,EAC1B,qBAAqB,EACrB,yBAAyB,EACzB,mCAAmC,EACnC,qBAAqB,EACrB,yBAAyB,EAC1B,CAAA"}