profile-pane 3.2.1 → 3.2.2-test.0
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/README.md +50 -0
- package/lib/303.profile-pane.js +1362 -0
- package/lib/303.profile-pane.js.map +1 -0
- package/lib/303.profile-pane.min.js +2 -0
- package/lib/303.profile-pane.min.js.map +1 -0
- package/lib/ProfileView.css +1090 -0
- package/lib/ProfileView.d.ts +2 -1
- package/lib/ProfileView.d.ts.map +1 -1
- package/lib/ProfileView.js +64 -36
- package/lib/buttonsHelper.d.ts +1 -1
- package/lib/buttonsHelper.d.ts.map +1 -1
- package/lib/buttonsHelper.js +2 -1
- package/lib/editProfilePane/EditCVCard.js +1 -1
- package/lib/editProfilePane/EditCommunitiesCard.js +1 -1
- package/lib/editProfilePane/EditFriendsCard.js +1 -1
- package/lib/editProfilePane/EditProfileView.d.ts +1 -1
- package/lib/editProfilePane/EditProfileView.d.ts.map +1 -1
- package/lib/editProfilePane/EditProfileView.js +4 -5
- package/lib/editProfilePane/editProfilePresenter.d.ts.map +1 -1
- package/lib/editProfilePane/editProfilePresenter.js +5 -4
- package/lib/icons-svg/profileIcons.d.ts +1 -1
- package/lib/icons-svg/profileIcons.d.ts.map +1 -1
- package/lib/icons-svg/profileIcons.js +9 -17
- package/lib/index.d.ts +1 -8
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +74 -40
- package/lib/ontology/otherPreferencesForm.ttl +32 -0
- package/lib/ontology/resumeForm.ttl +349 -0
- package/lib/ontology/socialMedia.ttl +433 -0
- package/lib/profile-pane.js +32266 -13247
- package/lib/profile-pane.js.map +1 -1
- package/lib/profile-pane.min.js +2315 -935
- package/lib/profile-pane.min.js.map +1 -1
- package/lib/rdfFormsHelper.d.ts +13 -1
- package/lib/rdfFormsHelper.d.ts.map +1 -1
- package/lib/rdfFormsHelper.js +13 -1
- package/lib/sections/bio/BioEditDialog.d.ts.map +1 -1
- package/lib/sections/bio/BioEditDialog.js +7 -7
- package/lib/sections/bio/BioSection.css +300 -0
- package/lib/sections/bio/BioSection.d.ts +3 -2
- package/lib/sections/bio/BioSection.d.ts.map +1 -1
- package/lib/sections/bio/BioSection.js +26 -19
- package/lib/sections/bio/mutations.d.ts.map +1 -1
- package/lib/sections/bio/mutations.js +14 -3
- package/lib/sections/contactInfo/ContactInfoEditDialog.css +354 -0
- package/lib/sections/contactInfo/ContactInfoEditDialog.d.ts +3 -1
- package/lib/sections/contactInfo/ContactInfoEditDialog.d.ts.map +1 -1
- package/lib/sections/contactInfo/ContactInfoEditDialog.js +183 -98
- package/lib/sections/contactInfo/ContactInfoSection.css +125 -0
- package/lib/sections/contactInfo/ContactInfoSection.d.ts +2 -0
- package/lib/sections/contactInfo/ContactInfoSection.d.ts.map +1 -1
- package/lib/sections/contactInfo/ContactInfoSection.js +64 -41
- package/lib/sections/contactInfo/mutations.d.ts.map +1 -1
- package/lib/sections/contactInfo/mutations.js +51 -16
- package/lib/sections/education/EducationEditDialog.d.ts +3 -1
- package/lib/sections/education/EducationEditDialog.d.ts.map +1 -1
- package/lib/sections/education/EducationEditDialog.js +170 -92
- package/lib/sections/education/EducationSection.css +133 -0
- package/lib/sections/education/EducationSection.d.ts +3 -2
- package/lib/sections/education/EducationSection.d.ts.map +1 -1
- package/lib/sections/education/EducationSection.js +32 -25
- package/lib/sections/education/mutations.d.ts.map +1 -1
- package/lib/sections/education/mutations.js +14 -3
- package/lib/sections/heading/HeadingEditDialog.d.ts +4 -1
- package/lib/sections/heading/HeadingEditDialog.d.ts.map +1 -1
- package/lib/sections/heading/HeadingEditDialog.js +287 -162
- package/lib/sections/heading/HeadingSection.css +862 -0
- package/lib/sections/heading/HeadingSection.d.ts +3 -2
- package/lib/sections/heading/HeadingSection.d.ts.map +1 -1
- package/lib/sections/heading/HeadingSection.js +63 -32
- package/lib/sections/heading/imageHelpers.d.ts +1 -0
- package/lib/sections/heading/imageHelpers.d.ts.map +1 -1
- package/lib/sections/heading/imageHelpers.js +40 -1
- package/lib/sections/heading/mutations.d.ts.map +1 -1
- package/lib/sections/heading/mutations.js +86 -23
- package/lib/sections/heading/selectors.d.ts.map +1 -1
- package/lib/sections/heading/selectors.js +14 -3
- package/lib/sections/heading/types.d.ts +1 -2
- package/lib/sections/heading/types.d.ts.map +1 -1
- package/lib/sections/languages/LanguageEditDialog.d.ts +3 -1
- package/lib/sections/languages/LanguageEditDialog.d.ts.map +1 -1
- package/lib/sections/languages/LanguageEditDialog.js +202 -119
- package/lib/sections/languages/LanguageSection.css +53 -0
- package/lib/sections/languages/LanguageSection.d.ts +2 -0
- package/lib/sections/languages/LanguageSection.d.ts.map +1 -1
- package/lib/sections/languages/LanguageSection.js +42 -31
- package/lib/sections/languages/mutations.d.ts.map +1 -1
- package/lib/sections/languages/mutations.js +60 -161
- package/lib/sections/languages/selectors.d.ts.map +1 -1
- package/lib/sections/languages/selectors.js +1 -2
- package/lib/sections/projects/ProjectEditDialog.d.ts +2 -1
- package/lib/sections/projects/ProjectEditDialog.d.ts.map +1 -1
- package/lib/sections/projects/ProjectEditDialog.js +13 -24
- package/lib/sections/projects/ProjectSection.css +368 -0
- package/lib/sections/projects/ProjectSection.d.ts +2 -1
- package/lib/sections/projects/ProjectSection.d.ts.map +1 -1
- package/lib/sections/projects/ProjectSection.js +116 -34
- package/lib/sections/projects/mutations.d.ts.map +1 -1
- package/lib/sections/projects/mutations.js +109 -132
- package/lib/sections/projects/selectors.d.ts.map +1 -1
- package/lib/sections/projects/selectors.js +4 -45
- package/lib/{QRCodeCard.d.ts → sections/qrcode/QRCodeCard.d.ts} +2 -1
- package/lib/sections/qrcode/QRCodeCard.d.ts.map +1 -0
- package/lib/{QRCodeCard.js → sections/qrcode/QRCodeCard.js} +59 -11
- package/lib/sections/qrcode/QRCodeSection.css +108 -0
- package/lib/sections/qrcode/QRCodeSection.d.ts +4 -0
- package/lib/sections/qrcode/QRCodeSection.d.ts.map +1 -0
- package/lib/sections/qrcode/QRCodeSection.js +17 -0
- package/lib/sections/resume/ResumeEditDialog.d.ts +10 -1
- package/lib/sections/resume/ResumeEditDialog.d.ts.map +1 -1
- package/lib/sections/resume/ResumeEditDialog.js +531 -149
- package/lib/sections/resume/ResumeSection.css +350 -0
- package/lib/sections/resume/ResumeSection.d.ts +3 -2
- package/lib/sections/resume/ResumeSection.d.ts.map +1 -1
- package/lib/sections/resume/ResumeSection.js +78 -49
- package/lib/sections/resume/mutations.d.ts.map +1 -1
- package/lib/sections/resume/mutations.js +17 -3
- package/lib/sections/resume/selectors.d.ts.map +1 -1
- package/lib/sections/resume/selectors.js +1 -0
- package/lib/sections/resume/types.d.ts +1 -0
- package/lib/sections/resume/types.d.ts.map +1 -1
- package/lib/sections/shared/collapsibleSection.d.ts.map +1 -1
- package/lib/sections/shared/collapsibleSection.js +1 -0
- package/lib/sections/shared/phoneCountries.d.ts +1 -1
- package/lib/sections/shared/phoneCountries.d.ts.map +1 -1
- package/lib/sections/shared/phoneCountries.js +2 -2
- package/lib/sections/shared/projectCommunityNodes.d.ts +6 -0
- package/lib/sections/shared/projectCommunityNodes.d.ts.map +1 -0
- package/lib/sections/shared/projectCommunityNodes.js +56 -0
- package/lib/sections/shared/rdfMutationHelpers.d.ts +35 -2
- package/lib/sections/shared/rdfMutationHelpers.d.ts.map +1 -1
- package/lib/sections/shared/rdfMutationHelpers.js +290 -14
- package/lib/sections/shared/sectionCardHelpers.d.ts.map +1 -1
- package/lib/sections/shared/sectionCardHelpers.js +80 -11
- package/lib/sections/shared/types.d.ts +24 -0
- package/lib/sections/shared/types.d.ts.map +1 -1
- package/lib/sections/skills/SkillsEditDialog.d.ts +3 -1
- package/lib/sections/skills/SkillsEditDialog.d.ts.map +1 -1
- package/lib/sections/skills/SkillsEditDialog.js +136 -115
- package/lib/sections/skills/SkillsSection.css +173 -0
- package/lib/sections/skills/SkillsSection.d.ts +2 -0
- package/lib/sections/skills/SkillsSection.d.ts.map +1 -1
- package/lib/sections/skills/SkillsSection.js +107 -47
- package/lib/sections/skills/mutations.d.ts.map +1 -1
- package/lib/sections/skills/mutations.js +25 -21
- package/lib/sections/skills/selectors.d.ts.map +1 -1
- package/lib/sections/skills/selectors.js +5 -3
- package/lib/sections/social/SocialEditDialog.d.ts +3 -1
- package/lib/sections/social/SocialEditDialog.d.ts.map +1 -1
- package/lib/sections/social/SocialEditDialog.js +170 -62
- package/lib/sections/social/SocialSection.css +194 -0
- package/lib/sections/social/SocialSection.d.ts +4 -3
- package/lib/sections/social/SocialSection.d.ts.map +1 -1
- package/lib/sections/social/SocialSection.js +59 -43
- package/lib/sections/social/mutations.d.ts.map +1 -1
- package/lib/sections/social/mutations.js +23 -132
- package/lib/specialButtons/AddMeToYourFriends.css +54 -0
- package/lib/specialButtons/addContact/AddMeToYourContacts.css +1118 -0
- package/lib/specialButtons/addContact/ContactCreationDialog.d.ts +10 -0
- package/lib/specialButtons/addContact/ContactCreationDialog.d.ts.map +1 -0
- package/lib/specialButtons/addContact/ContactCreationDialog.js +1123 -0
- package/lib/specialButtons/addContact/addMeToYourContacts.d.ts +16 -0
- package/lib/specialButtons/addContact/addMeToYourContacts.d.ts.map +1 -0
- package/lib/specialButtons/addContact/addMeToYourContacts.js +136 -0
- package/lib/specialButtons/addContact/contactsErrors.d.ts +8 -0
- package/lib/specialButtons/addContact/contactsErrors.d.ts.map +1 -0
- package/lib/specialButtons/addContact/contactsErrors.js +106 -0
- package/lib/specialButtons/addContact/contactsTypes.d.ts +43 -0
- package/lib/specialButtons/addContact/contactsTypes.d.ts.map +1 -0
- package/lib/specialButtons/addContact/contactsTypes.js +5 -0
- package/lib/specialButtons/addContact/helpers.d.ts +7 -0
- package/lib/specialButtons/addContact/helpers.d.ts.map +1 -0
- package/lib/specialButtons/addContact/helpers.js +103 -0
- package/lib/specialButtons/addContact/mutations.d.ts +16 -0
- package/lib/specialButtons/addContact/mutations.d.ts.map +1 -0
- package/lib/specialButtons/addContact/mutations.js +300 -0
- package/lib/specialButtons/addContact/selectors.d.ts +10 -0
- package/lib/specialButtons/addContact/selectors.d.ts.map +1 -0
- package/lib/specialButtons/addContact/selectors.js +163 -0
- package/lib/{addMeToYourFriends.d.ts → specialButtons/addMeToYourFriends.d.ts} +6 -4
- package/lib/specialButtons/addMeToYourFriends.d.ts.map +1 -0
- package/lib/{addMeToYourFriends.js → specialButtons/addMeToYourFriends.js} +46 -11
- package/lib/styles/CollapsibleSection.css +519 -0
- package/lib/styles/EditDialogs.css +506 -686
- package/lib/styles/EditDialogs.responsive.css +989 -0
- package/lib/texts/buttonTexts.d.ts +9 -0
- package/lib/texts/buttonTexts.d.ts.map +1 -0
- package/lib/texts/buttonTexts.js +14 -0
- package/lib/texts/dialogTexts.d.ts +14 -0
- package/lib/texts/dialogTexts.d.ts.map +1 -0
- package/lib/texts/dialogTexts.js +19 -0
- package/lib/texts/messageTexts.d.ts +42 -0
- package/lib/texts/messageTexts.d.ts.map +1 -0
- package/lib/texts/messageTexts.js +47 -0
- package/lib/texts/profileTexts.d.ts +14 -0
- package/lib/texts/profileTexts.d.ts.map +1 -0
- package/lib/texts/profileTexts.js +19 -0
- package/lib/texts/qrCodeTexts.d.ts +2 -0
- package/lib/texts/qrCodeTexts.d.ts.map +1 -0
- package/lib/texts/qrCodeTexts.js +7 -0
- package/lib/texts.d.ts +5 -60
- package/lib/texts.d.ts.map +1 -1
- package/lib/texts.js +55 -70
- package/lib/ui/dialog.css +233 -0
- package/lib/ui/dialog.d.ts +15 -1
- package/lib/ui/dialog.d.ts.map +1 -1
- package/lib/ui/dialog.js +245 -45
- package/lib/ui/dialog.responsive.css +195 -0
- package/lib/ui/errors.d.ts.map +1 -1
- package/lib/ui/errors.js +2 -1
- package/lib/ui/spinner.d.ts +3 -0
- package/lib/ui/spinner.d.ts.map +1 -0
- package/lib/ui/spinner.js +13 -0
- package/lib/utils/debug.d.ts +5 -0
- package/lib/utils/debug.d.ts.map +1 -0
- package/lib/utils/debug.js +23 -0
- package/lib/utils/errorDisplay.d.ts +2 -0
- package/lib/utils/errorDisplay.d.ts.map +1 -0
- package/lib/utils/errorDisplay.js +19 -0
- package/package.json +32 -25
- package/lib/ChatWithMe.d.ts +0 -7
- package/lib/ChatWithMe.d.ts.map +0 -1
- package/lib/ChatWithMe.js +0 -90
- package/lib/QRCodeCard.d.ts.map +0 -1
- package/lib/addMeToYourFriends.d.ts.map +0 -1
- package/lib/sections/heading/camera.d.ts +0 -19
- package/lib/sections/heading/camera.d.ts.map +0 -1
- package/lib/sections/heading/camera.js +0 -199
- package/lib/styles/BioSection.css +0 -77
- package/lib/styles/CVCard.css +0 -142
- package/lib/styles/ChatWithMe.css +0 -6
- package/lib/styles/ContactInfoEditDialog.css +0 -153
- package/lib/styles/EducationCard.css +0 -103
- package/lib/styles/HeadingSection.css +0 -309
- package/lib/styles/ProfileCard.css +0 -66
- package/lib/styles/ProfileView.css +0 -65
- package/lib/styles/ProjectsCard.css +0 -206
- package/lib/styles/QRCodeCard.css +0 -43
- package/lib/styles/SocialCard.css +0 -89
- package/lib/styles/dialog.css +0 -209
- package/lib/styles/utilities.css +0 -740
package/lib/ui/dialog.js
CHANGED
|
@@ -4,19 +4,129 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.alertDialog = alertDialog;
|
|
7
|
+
exports.closeSharedDialog = closeSharedDialog;
|
|
8
|
+
exports.getSharedDialogCancelButton = getSharedDialogCancelButton;
|
|
9
|
+
exports.getSharedDialogSaveButton = getSharedDialogSaveButton;
|
|
7
10
|
exports.openInputDialog = openInputDialog;
|
|
8
|
-
|
|
11
|
+
exports.setSharedDialogSavingState = setSharedDialogSavingState;
|
|
12
|
+
require("./dialog.css");
|
|
13
|
+
require("solid-ui/components/actions/button");
|
|
9
14
|
var _litHtml = require("lit-html");
|
|
10
15
|
var _profileIcons = require("../icons-svg/profileIcons");
|
|
16
|
+
var _spinner = require("./spinner");
|
|
17
|
+
var _errorDisplay = require("../utils/errorDisplay");
|
|
11
18
|
/* Copied from issue-pane, minor typescript adjustments */
|
|
12
19
|
/* Changed modal from div to dialog element */
|
|
13
20
|
let modalDialog = null;
|
|
14
|
-
let
|
|
21
|
+
let scrollLockCount = 0;
|
|
22
|
+
let previousHtmlOverflow = '';
|
|
23
|
+
let previousBodyOverflow = '';
|
|
24
|
+
let removeDocumentScrollGuard = null;
|
|
25
|
+
function getEventTargetElement(target) {
|
|
26
|
+
if (target instanceof HTMLElement) return target;
|
|
27
|
+
if (target instanceof Node) return target.parentElement;
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
function getEventPath(event) {
|
|
31
|
+
if (typeof event.composedPath === 'function') {
|
|
32
|
+
return event.composedPath();
|
|
33
|
+
}
|
|
34
|
+
return event.target ? [event.target] : [];
|
|
35
|
+
}
|
|
36
|
+
function isDialogScrollRegionTarget(event) {
|
|
37
|
+
const path = getEventPath(event);
|
|
38
|
+
const description = modalDialog?.querySelector('#modal-desc');
|
|
39
|
+
if (description && path.includes(description)) {
|
|
40
|
+
return true;
|
|
41
|
+
}
|
|
42
|
+
if (modalDialog && path.includes(modalDialog)) {
|
|
43
|
+
return true;
|
|
44
|
+
}
|
|
45
|
+
const targetElement = getEventTargetElement(event.target);
|
|
46
|
+
if (!targetElement || !modalDialog || !modalDialog.contains(targetElement)) {
|
|
47
|
+
return false;
|
|
48
|
+
}
|
|
49
|
+
return Boolean(targetElement.closest('#modal-desc'));
|
|
50
|
+
}
|
|
51
|
+
function installDocumentScrollGuard(dom) {
|
|
52
|
+
if (removeDocumentScrollGuard) return;
|
|
53
|
+
const preventBackgroundScroll = event => {
|
|
54
|
+
if (!isDialogScrollRegionTarget(event)) {
|
|
55
|
+
event.preventDefault();
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
dom.addEventListener('wheel', preventBackgroundScroll, {
|
|
59
|
+
capture: true,
|
|
60
|
+
passive: false
|
|
61
|
+
});
|
|
62
|
+
dom.addEventListener('touchmove', preventBackgroundScroll, {
|
|
63
|
+
capture: true,
|
|
64
|
+
passive: false
|
|
65
|
+
});
|
|
66
|
+
removeDocumentScrollGuard = () => {
|
|
67
|
+
dom.removeEventListener('wheel', preventBackgroundScroll, true);
|
|
68
|
+
dom.removeEventListener('touchmove', preventBackgroundScroll, true);
|
|
69
|
+
removeDocumentScrollGuard = null;
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
function lockDocumentScroll(dom) {
|
|
73
|
+
if (scrollLockCount === 0) {
|
|
74
|
+
previousHtmlOverflow = dom.documentElement.style.overflow;
|
|
75
|
+
previousBodyOverflow = dom.body.style.overflow;
|
|
76
|
+
dom.documentElement.style.overflow = 'hidden';
|
|
77
|
+
dom.body.style.overflow = 'hidden';
|
|
78
|
+
installDocumentScrollGuard(dom);
|
|
79
|
+
}
|
|
80
|
+
scrollLockCount += 1;
|
|
81
|
+
}
|
|
82
|
+
function unlockDocumentScroll(dom) {
|
|
83
|
+
if (scrollLockCount === 0) return;
|
|
84
|
+
scrollLockCount -= 1;
|
|
85
|
+
if (scrollLockCount > 0) return;
|
|
86
|
+
dom.documentElement.style.overflow = previousHtmlOverflow;
|
|
87
|
+
dom.body.style.overflow = previousBodyOverflow;
|
|
88
|
+
removeDocumentScrollGuard?.();
|
|
89
|
+
}
|
|
90
|
+
function getDialogMountTarget(dom) {
|
|
91
|
+
return dom.body;
|
|
92
|
+
}
|
|
93
|
+
function isSolidUiButton(control) {
|
|
94
|
+
return control?.tagName === 'SOLID-UI-BUTTON';
|
|
95
|
+
}
|
|
96
|
+
function setDialogActionDisabled(control, disabled) {
|
|
97
|
+
if (!control) return;
|
|
98
|
+
control.disabled = disabled;
|
|
99
|
+
control.toggleAttribute('disabled', disabled);
|
|
100
|
+
}
|
|
101
|
+
function setDialogActionLabel(control, label) {
|
|
102
|
+
if (!control) return;
|
|
103
|
+
if (isSolidUiButton(control)) {
|
|
104
|
+
control.label = label;
|
|
105
|
+
control.setAttribute('label', label);
|
|
106
|
+
control.textContent = label;
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
;
|
|
110
|
+
control.textContent = label;
|
|
111
|
+
}
|
|
112
|
+
function getSharedDialogSaveButton(root) {
|
|
113
|
+
return root.querySelector('#modal-buttons [data-dialog-primary="true"]');
|
|
114
|
+
}
|
|
115
|
+
function getSharedDialogCancelButton(root) {
|
|
116
|
+
return root.querySelector('#modal-buttons [data-cancel="true"]');
|
|
117
|
+
}
|
|
15
118
|
function ensureModalDialog(dom) {
|
|
119
|
+
const mountTarget = getDialogMountTarget(dom);
|
|
120
|
+
|
|
16
121
|
// if we previously created a dialog but it was removed from the document
|
|
17
122
|
// (tests clear body), rebuild it. Checking presence ensures our reference
|
|
18
123
|
// doesn't point at a detached element.
|
|
19
|
-
if (modalDialog && dom.body.contains(modalDialog))
|
|
124
|
+
if (modalDialog && dom.body.contains(modalDialog)) {
|
|
125
|
+
if (modalDialog.parentElement !== mountTarget) {
|
|
126
|
+
mountTarget.appendChild(modalDialog);
|
|
127
|
+
}
|
|
128
|
+
return modalDialog;
|
|
129
|
+
}
|
|
20
130
|
modalDialog = null;
|
|
21
131
|
modalDialog = dom.createElement('dialog');
|
|
22
132
|
modalDialog.id = 'profile-modal';
|
|
@@ -25,16 +135,17 @@ function ensureModalDialog(dom) {
|
|
|
25
135
|
modalDialog.setAttribute('aria-describedby', 'modal-desc');
|
|
26
136
|
modalDialog.innerHTML = `
|
|
27
137
|
<div class="modal">
|
|
28
|
-
<div class="modal-header">
|
|
138
|
+
<div class="modal-header flex-row align-center justify-between">
|
|
29
139
|
<h2 id="modal-title"></h2>
|
|
30
|
-
<div id="modal-header-action"></div>
|
|
140
|
+
<div id="modal-header-action" class="flex-row align-center"></div>
|
|
31
141
|
</div>
|
|
32
142
|
<div id="modal-desc"></div>
|
|
33
|
-
<section id="modal-error" class="modal__error-section" aria-live="assertive" role="alert" hidden></section>
|
|
34
|
-
<div id="modal-buttons"></div>
|
|
143
|
+
<section id="modal-error" class="modal__error-section" aria-live="assertive" aria-atomic="true" aria-hidden="true" role="alert" tabindex="-1" hidden></section>
|
|
144
|
+
<div id="modal-buttons" class="flex-row align-center justify-end"></div>
|
|
145
|
+
<div id="modal-saving-overlay" hidden></div>
|
|
35
146
|
</div>
|
|
36
147
|
`;
|
|
37
|
-
|
|
148
|
+
mountTarget.appendChild(modalDialog);
|
|
38
149
|
return modalDialog;
|
|
39
150
|
}
|
|
40
151
|
function getDialogElements(dialog) {
|
|
@@ -44,18 +155,22 @@ function getDialogElements(dialog) {
|
|
|
44
155
|
headerAction: dialog.querySelector('#modal-header-action'),
|
|
45
156
|
description: dialog.querySelector('#modal-desc'),
|
|
46
157
|
error: dialog.querySelector('#modal-error'),
|
|
47
|
-
buttons: dialog.querySelector('#modal-buttons')
|
|
158
|
+
buttons: dialog.querySelector('#modal-buttons'),
|
|
159
|
+
savingOverlay: dialog.querySelector('#modal-saving-overlay')
|
|
48
160
|
};
|
|
49
161
|
}
|
|
50
162
|
function clearModalError(elements) {
|
|
51
163
|
elements.error.textContent = '';
|
|
164
|
+
elements.error.setAttribute('aria-hidden', 'true');
|
|
52
165
|
elements.error.hidden = true;
|
|
53
166
|
}
|
|
54
|
-
function setModalError(elements,
|
|
55
|
-
elements.error.textContent =
|
|
167
|
+
function setModalError(elements, error, fallbackMessage) {
|
|
168
|
+
elements.error.textContent = (0, _errorDisplay.formatDisplayError)(error, fallbackMessage);
|
|
169
|
+
elements.error.setAttribute('aria-hidden', 'false');
|
|
56
170
|
elements.error.hidden = false;
|
|
57
171
|
}
|
|
58
172
|
function openDialogElement(dialog) {
|
|
173
|
+
lockDocumentScroll(dialog.ownerDocument);
|
|
59
174
|
if (typeof dialog.showModal === 'function') {
|
|
60
175
|
try {
|
|
61
176
|
if (!dialog.open) dialog.showModal();
|
|
@@ -67,32 +182,53 @@ function openDialogElement(dialog) {
|
|
|
67
182
|
dialog.setAttribute('open', '');
|
|
68
183
|
}
|
|
69
184
|
function closeDialogElement(dialog) {
|
|
70
|
-
|
|
71
|
-
dialog.close
|
|
72
|
-
|
|
185
|
+
try {
|
|
186
|
+
if (typeof dialog.close === 'function' && dialog.open) {
|
|
187
|
+
dialog.close();
|
|
188
|
+
return;
|
|
189
|
+
}
|
|
190
|
+
dialog.removeAttribute('open');
|
|
191
|
+
} finally {
|
|
192
|
+
unlockDocumentScroll(dialog.ownerDocument);
|
|
73
193
|
}
|
|
74
|
-
dialog.removeAttribute('open');
|
|
75
194
|
}
|
|
76
|
-
function
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
195
|
+
function isMobileDialogLayout(dom) {
|
|
196
|
+
return Boolean(dom.querySelector('[data-layout=\'mobile\']'));
|
|
197
|
+
}
|
|
198
|
+
function isFocusableElement(element) {
|
|
199
|
+
if (element.hasAttribute('disabled')) return false;
|
|
200
|
+
if (element.getAttribute('aria-hidden') === 'true') return false;
|
|
201
|
+
if (element.getAttribute('hidden') !== null) return false;
|
|
202
|
+
if (element.tabIndex < 0) return false;
|
|
203
|
+
return true;
|
|
204
|
+
}
|
|
205
|
+
function findPreferredInitialFocusTarget(container) {
|
|
206
|
+
const focusableControls = container.querySelectorAll(['input:not([type="hidden"]):not([disabled])', 'textarea:not([disabled])', 'select:not([disabled])', 'solid-ui-select:not([disabled])', 'solid-ui-combobox:not([disabled])', '[contenteditable="true"]', 'button:not([disabled])', 'solid-ui-button:not([disabled])', '[tabindex]:not([tabindex="-1"])'].join(','));
|
|
207
|
+
for (const match of focusableControls) {
|
|
208
|
+
if (match instanceof HTMLElement && isFocusableElement(match)) return match;
|
|
82
209
|
}
|
|
83
210
|
return null;
|
|
84
211
|
}
|
|
85
|
-
function focusInitialDialogTarget(description, buttons) {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
212
|
+
function focusInitialDialogTarget(dialog, description, buttons) {
|
|
213
|
+
if (isMobileDialogLayout(dialog.ownerDocument)) {
|
|
214
|
+
const activeElement = dialog.ownerDocument.activeElement;
|
|
215
|
+
if (activeElement && dialog.contains(activeElement)) {
|
|
216
|
+
activeElement.blur();
|
|
217
|
+
}
|
|
218
|
+
return;
|
|
219
|
+
}
|
|
220
|
+
const initialTarget = findPreferredInitialFocusTarget(description);
|
|
221
|
+
if (initialTarget) {
|
|
222
|
+
initialTarget.focus();
|
|
223
|
+
if (initialTarget instanceof HTMLInputElement || initialTarget instanceof HTMLTextAreaElement) {
|
|
224
|
+
initialTarget.select();
|
|
91
225
|
}
|
|
92
226
|
return;
|
|
93
227
|
}
|
|
94
|
-
const firstButton = buttons
|
|
95
|
-
if (firstButton)
|
|
228
|
+
const firstButton = findPreferredInitialFocusTarget(buttons);
|
|
229
|
+
if (firstButton) {
|
|
230
|
+
firstButton.focus();
|
|
231
|
+
}
|
|
96
232
|
}
|
|
97
233
|
function collectFormValues(form) {
|
|
98
234
|
const data = new FormData(form);
|
|
@@ -111,7 +247,6 @@ function openModal({
|
|
|
111
247
|
}) {
|
|
112
248
|
const dialog = ensureModalDialog(dom);
|
|
113
249
|
const elements = getDialogElements(dialog);
|
|
114
|
-
previousFocus = dom.activeElement;
|
|
115
250
|
openDialogElement(dialog);
|
|
116
251
|
elements.title.textContent = title || '';
|
|
117
252
|
elements.description.innerHTML = '';
|
|
@@ -128,7 +263,7 @@ function openModal({
|
|
|
128
263
|
resolve(value);
|
|
129
264
|
};
|
|
130
265
|
const requestCancel = () => {
|
|
131
|
-
const cancelBtn = dialog
|
|
266
|
+
const cancelBtn = getSharedDialogCancelButton(dialog);
|
|
132
267
|
if (cancelBtn) {
|
|
133
268
|
cancelBtn.click();
|
|
134
269
|
return;
|
|
@@ -144,17 +279,25 @@ function openModal({
|
|
|
144
279
|
type: 'close'
|
|
145
280
|
};
|
|
146
281
|
if (resolvedHeaderAction.type === 'close') {
|
|
147
|
-
const closeButton = dom.createElement('button');
|
|
282
|
+
const closeButton = dom.createElement('solid-ui-button');
|
|
148
283
|
closeButton.setAttribute('type', 'button');
|
|
284
|
+
closeButton.setAttribute('variant', 'icon');
|
|
285
|
+
closeButton.setAttribute('size', 'sm');
|
|
149
286
|
closeButton.setAttribute('aria-label', 'Close dialog');
|
|
150
|
-
|
|
287
|
+
const iconSlot = dom.createElement('span');
|
|
288
|
+
iconSlot.setAttribute('slot', 'icon');
|
|
289
|
+
(0, _litHtml.render)(_profileIcons.closeIcon, iconSlot);
|
|
290
|
+
closeButton.appendChild(iconSlot);
|
|
151
291
|
closeButton.onclick = () => requestCancel();
|
|
152
292
|
elements.headerAction.appendChild(closeButton);
|
|
153
293
|
} else if (resolvedHeaderAction.type === 'button') {
|
|
154
|
-
const actionButton = dom.createElement('button');
|
|
294
|
+
const actionButton = dom.createElement('solid-ui-button');
|
|
155
295
|
actionButton.setAttribute('type', 'button');
|
|
296
|
+
actionButton.setAttribute('variant', 'secondary');
|
|
297
|
+
actionButton.setAttribute('size', 'sm');
|
|
156
298
|
actionButton.className = resolvedHeaderAction.className || 'modal__header-action-button profile__action-button profile-action-text flex-center';
|
|
157
299
|
actionButton.textContent = resolvedHeaderAction.label;
|
|
300
|
+
actionButton.setAttribute('label', resolvedHeaderAction.label);
|
|
158
301
|
actionButton.setAttribute('aria-label', resolvedHeaderAction.ariaLabel || resolvedHeaderAction.label);
|
|
159
302
|
actionButton.onclick = async () => {
|
|
160
303
|
if (resolvedHeaderAction.onClick) {
|
|
@@ -164,12 +307,16 @@ function openModal({
|
|
|
164
307
|
elements.headerAction.appendChild(actionButton);
|
|
165
308
|
}
|
|
166
309
|
buttons.forEach(btn => {
|
|
167
|
-
const b = dom.createElement('button');
|
|
310
|
+
const b = dom.createElement('solid-ui-button');
|
|
168
311
|
b.setAttribute('type', 'button');
|
|
312
|
+
b.setAttribute('label', btn.label);
|
|
313
|
+
b.setAttribute('size', 'md');
|
|
314
|
+
b.setAttribute('variant', btn.primary ? 'primary' : 'secondary');
|
|
169
315
|
b.textContent = btn.label;
|
|
170
|
-
if (btn.primary)
|
|
316
|
+
if (btn.primary) {
|
|
317
|
+
b.setAttribute('data-dialog-primary', 'true');
|
|
318
|
+
}
|
|
171
319
|
if (btn.cancel) {
|
|
172
|
-
b.classList.add('btn-light');
|
|
173
320
|
b.setAttribute('data-cancel', 'true');
|
|
174
321
|
}
|
|
175
322
|
b.addEventListener('click', async () => {
|
|
@@ -181,7 +328,10 @@ function openModal({
|
|
|
181
328
|
});
|
|
182
329
|
elements.buttons.appendChild(b);
|
|
183
330
|
});
|
|
184
|
-
|
|
331
|
+
const scheduleInitialFocus = dom.defaultView?.requestAnimationFrame ? callback => dom.defaultView?.requestAnimationFrame(() => callback()) : callback => setTimeout(callback, 0);
|
|
332
|
+
scheduleInitialFocus(() => {
|
|
333
|
+
focusInitialDialogTarget(dialog, elements.description, elements.buttons);
|
|
334
|
+
});
|
|
185
335
|
});
|
|
186
336
|
}
|
|
187
337
|
function closeModal(_result) {
|
|
@@ -190,9 +340,11 @@ function closeModal(_result) {
|
|
|
190
340
|
modalDialog.oncancel = null;
|
|
191
341
|
const headerActionButton = modalDialog.querySelector('#modal-header-action button');
|
|
192
342
|
if (headerActionButton) headerActionButton.onclick = null;
|
|
193
|
-
if (previousFocus && 'focus' in previousFocus) previousFocus.focus();
|
|
194
343
|
}
|
|
195
344
|
}
|
|
345
|
+
function closeSharedDialog() {
|
|
346
|
+
closeModal(null);
|
|
347
|
+
}
|
|
196
348
|
function alertDialog(message, title = 'Information', dom) {
|
|
197
349
|
return openModal({
|
|
198
350
|
title,
|
|
@@ -205,6 +357,42 @@ function alertDialog(message, title = 'Information', dom) {
|
|
|
205
357
|
dom
|
|
206
358
|
});
|
|
207
359
|
}
|
|
360
|
+
function updateSavingUI(dialog, submitLabel, isSaving) {
|
|
361
|
+
const elements = getDialogElements(dialog);
|
|
362
|
+
const saveButton = getSharedDialogSaveButton(dialog);
|
|
363
|
+
const cancelButton = getSharedDialogCancelButton(dialog);
|
|
364
|
+
dialog.classList.toggle('modal--saving', isSaving);
|
|
365
|
+
dialog.setAttribute('aria-busy', String(isSaving));
|
|
366
|
+
elements.description.toggleAttribute('inert', isSaving);
|
|
367
|
+
if (isSaving) {
|
|
368
|
+
const activeElement = dialog.ownerDocument.activeElement;
|
|
369
|
+
if (activeElement && dialog.contains(activeElement)) {
|
|
370
|
+
activeElement.blur();
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
if (saveButton) {
|
|
374
|
+
setDialogActionDisabled(saveButton, isSaving);
|
|
375
|
+
saveButton.setAttribute('aria-busy', String(isSaving));
|
|
376
|
+
setDialogActionLabel(saveButton, submitLabel);
|
|
377
|
+
}
|
|
378
|
+
if (cancelButton) {
|
|
379
|
+
setDialogActionDisabled(cancelButton, isSaving);
|
|
380
|
+
}
|
|
381
|
+
elements.savingOverlay.hidden = !isSaving;
|
|
382
|
+
if (isSaving) {
|
|
383
|
+
(0, _litHtml.render)((0, _litHtml.html)`
|
|
384
|
+
<div class="modal__saving-indicator inline-flex-row justify-center" aria-live="polite" aria-label="Saving changes">
|
|
385
|
+
${(0, _spinner.createSpinner)()}
|
|
386
|
+
</div>
|
|
387
|
+
`, elements.savingOverlay);
|
|
388
|
+
} else {
|
|
389
|
+
(0, _litHtml.render)((0, _litHtml.html)``, elements.savingOverlay);
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
function setSharedDialogSavingState(dom, isSaving, submitLabel = 'Saving Changes') {
|
|
393
|
+
const dialog = ensureModalDialog(dom);
|
|
394
|
+
updateSavingUI(dialog, submitLabel, isSaving);
|
|
395
|
+
}
|
|
208
396
|
/* Function below generated by AI Model: GPT-5.3-Codex */
|
|
209
397
|
/* Prompt: write me a reusable function to open a dialog with a form and return the form values on submit.
|
|
210
398
|
The function should also support validation and display error messages in the dialog.
|
|
@@ -221,11 +409,11 @@ function openInputDialog(options) {
|
|
|
221
409
|
options.form.appendChild(submitProxy);
|
|
222
410
|
const handleSubmit = event => {
|
|
223
411
|
event.preventDefault();
|
|
224
|
-
const saveButton = dialog
|
|
412
|
+
const saveButton = getSharedDialogSaveButton(dialog);
|
|
225
413
|
saveButton?.click();
|
|
226
414
|
};
|
|
227
415
|
options.form.addEventListener('submit', handleSubmit);
|
|
228
|
-
|
|
416
|
+
const dialogPromise = openModal({
|
|
229
417
|
title: options.title,
|
|
230
418
|
message: options.form,
|
|
231
419
|
headerAction: options.headerAction,
|
|
@@ -239,6 +427,9 @@ function openInputDialog(options) {
|
|
|
239
427
|
primary: true,
|
|
240
428
|
beforeClose: async () => {
|
|
241
429
|
clearModalError(elements);
|
|
430
|
+
if (options.shouldCloseWithoutSave && (await options.shouldCloseWithoutSave())) {
|
|
431
|
+
return true;
|
|
432
|
+
}
|
|
242
433
|
if (options.validate) {
|
|
243
434
|
const validationMessage = await options.validate();
|
|
244
435
|
if (validationMessage) {
|
|
@@ -248,21 +439,30 @@ function openInputDialog(options) {
|
|
|
248
439
|
}
|
|
249
440
|
if (!options.onSave) return true;
|
|
250
441
|
try {
|
|
442
|
+
updateSavingUI(dialog, submitLabel, true);
|
|
251
443
|
await options.onSave();
|
|
252
444
|
return true;
|
|
253
445
|
} catch (error) {
|
|
254
|
-
|
|
255
|
-
const
|
|
256
|
-
setModalError(elements,
|
|
446
|
+
updateSavingUI(dialog, submitLabel, false);
|
|
447
|
+
const fallback = options.formatSaveError ? options.formatSaveError(error) : undefined;
|
|
448
|
+
setModalError(elements, error, fallback);
|
|
257
449
|
return false;
|
|
258
450
|
}
|
|
259
451
|
}
|
|
260
452
|
}],
|
|
261
453
|
dom: options.dom
|
|
262
|
-
})
|
|
454
|
+
});
|
|
455
|
+
const scheduleOpenCallback = options.dom.defaultView?.requestAnimationFrame ? callback => options.dom.defaultView?.requestAnimationFrame(() => callback()) : callback => setTimeout(callback, 0);
|
|
456
|
+
if (options.onOpen) {
|
|
457
|
+
scheduleOpenCallback(options.onOpen);
|
|
458
|
+
}
|
|
459
|
+
elements.buttons.hidden = Boolean(options.hideFooterButtons);
|
|
460
|
+
return dialogPromise.then(result => {
|
|
263
461
|
if (result !== 'save') return null;
|
|
264
462
|
return collectFormValues(options.form);
|
|
265
463
|
}).finally(() => {
|
|
464
|
+
elements.buttons.hidden = false;
|
|
465
|
+
updateSavingUI(dialog, submitLabel, false);
|
|
266
466
|
options.form.removeEventListener('submit', handleSubmit);
|
|
267
467
|
submitProxy.remove();
|
|
268
468
|
});
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
/* Responsive dialog rules and mobile-affecting overrides live separately from the base modal layout. */
|
|
2
|
+
|
|
3
|
+
#profile-modal .modal:has(.profile-edit-dialog__social-account-select[popup-open]) #modal-desc,
|
|
4
|
+
#profile-modal .modal:has(#modal-desc > .profile__edit-form solid-ui-combobox:focus-within) #modal-desc {
|
|
5
|
+
padding-bottom: calc(var(--profile-modal-panel-inline-padding) + 1.875rem);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
@media (max-width: 576px) {
|
|
9
|
+
#profile-modal {
|
|
10
|
+
--profile-modal-panel-max-height: calc(100dvh - 4 * var(--spacing-sm));
|
|
11
|
+
padding-top: env(safe-area-inset-top);
|
|
12
|
+
padding-right: 0;
|
|
13
|
+
padding-bottom: max(var(--spacing-sm), env(safe-area-inset-bottom));
|
|
14
|
+
padding-left: 0;
|
|
15
|
+
place-items: center;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
#profile-modal .modal {
|
|
19
|
+
width: var(--profile-modal-panel-width);
|
|
20
|
+
max-width: var(--profile-modal-panel-max-width);
|
|
21
|
+
min-width: 0;
|
|
22
|
+
padding: 0;
|
|
23
|
+
border-radius: var(--border-radius-base);
|
|
24
|
+
overscroll-behavior: contain;
|
|
25
|
+
justify-self: center;
|
|
26
|
+
align-self: center;
|
|
27
|
+
margin: 0;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
#profile-modal .modal .modal-header {
|
|
31
|
+
gap: var(--spacing-lg, 1.5625rem);
|
|
32
|
+
padding: var(--spacing-sm, 0.938rem);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
#profile-modal .modal #modal-title {
|
|
36
|
+
font-size: var(--font-size-lg, 1.125rem);
|
|
37
|
+
line-height: var(--line-height-tight, 1.4);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
#profile-modal .modal #modal-desc {
|
|
41
|
+
padding: var(--spacing-sm, 0.938rem) var(--spacing-sm, 0.938rem) var(--spacing-lg, 1.5625rem);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
#profile-modal .modal #modal-desc:has(> .profile__edit-form--projects) {
|
|
45
|
+
padding: var(--spacing-sm, 0.938rem) var(--spacing-sm, 0.938rem) var(--spacing-lg, 1.5625rem);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
#profile-modal #modal-desc > .profile__edit-form--bio {
|
|
49
|
+
display: flex;
|
|
50
|
+
flex-direction: column;
|
|
51
|
+
gap: var(--spacing-md, 1.25rem);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
#profile-modal #modal-buttons {
|
|
55
|
+
flex-direction: row;
|
|
56
|
+
align-items: center;
|
|
57
|
+
justify-content: flex-end;
|
|
58
|
+
gap: var(--profile-modal-button-gap);
|
|
59
|
+
padding: var(--profile-modal-compact-padding);
|
|
60
|
+
width: 100%;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
#profile-modal #modal-buttons > solid-ui-button {
|
|
64
|
+
flex: 1 0 0;
|
|
65
|
+
width: auto;
|
|
66
|
+
min-width: 0;
|
|
67
|
+
--button-font-size-md: var(--font-size-md, 1rem);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
html[data-layout='mobile'] #profile-modal {
|
|
72
|
+
--profile-modal-panel-max-height: calc(100dvh - 4 * var(--spacing-sm));
|
|
73
|
+
padding-top: env(safe-area-inset-top);
|
|
74
|
+
padding-right: 0;
|
|
75
|
+
padding-bottom: max(var(--spacing-sm), env(safe-area-inset-bottom));
|
|
76
|
+
padding-left: 0;
|
|
77
|
+
place-items: center;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
html[data-layout='mobile'] #profile-modal .modal {
|
|
81
|
+
width: var(--profile-modal-panel-width);
|
|
82
|
+
height: auto;
|
|
83
|
+
max-height: var(--profile-modal-panel-max-height);
|
|
84
|
+
max-width: var(--profile-modal-panel-max-width);
|
|
85
|
+
min-width: 0;
|
|
86
|
+
padding: 0;
|
|
87
|
+
border-radius: var(--border-radius-base);
|
|
88
|
+
overscroll-behavior: contain;
|
|
89
|
+
justify-self: center;
|
|
90
|
+
align-self: center;
|
|
91
|
+
margin: 0;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
html[data-layout='mobile'] #profile-modal .modal .modal-header {
|
|
95
|
+
gap: var(--spacing-lg, 1.5625rem);
|
|
96
|
+
padding: var(--spacing-sm, 0.938rem);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
html[data-layout='mobile'] #profile-modal .modal #modal-title {
|
|
100
|
+
font-size: var(--font-size-lg, 1.125rem);
|
|
101
|
+
line-height: var(--line-height-tight, 1.4);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
html[data-layout='mobile'] #profile-modal .modal #modal-desc {
|
|
105
|
+
padding: var(--spacing-sm, 0.938rem) var(--spacing-sm, 0.938rem) var(--spacing-lg, 1.5625rem);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
html[data-layout='mobile'] #profile-modal .modal #modal-desc:has(> .profile__edit-form--projects) {
|
|
109
|
+
padding: var(--spacing-sm, 0.938rem) var(--spacing-sm, 0.938rem) var(--spacing-lg, 1.5625rem);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
html[data-layout='mobile'] #profile-modal #modal-desc > .profile__edit-form--bio {
|
|
113
|
+
display: flex;
|
|
114
|
+
flex-direction: column;
|
|
115
|
+
gap: var(--spacing-md, 1.25rem);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
html[data-layout='mobile'] #profile-modal #modal-buttons {
|
|
119
|
+
flex-direction: row;
|
|
120
|
+
align-items: center;
|
|
121
|
+
justify-content: flex-end;
|
|
122
|
+
gap: var(--profile-modal-button-gap);
|
|
123
|
+
padding: var(--profile-modal-compact-padding);
|
|
124
|
+
width: 100%;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
html[data-layout='mobile'] #profile-modal #modal-buttons > solid-ui-button {
|
|
128
|
+
flex: 1 0 0;
|
|
129
|
+
width: auto;
|
|
130
|
+
min-width: 0;
|
|
131
|
+
--button-font-size-md: var(--font-size-md, 1rem);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
@container profile-pane (max-width: 576px) {
|
|
135
|
+
#profile-modal {
|
|
136
|
+
--profile-modal-panel-max-height: calc(100dvh - 4 * var(--spacing-sm));
|
|
137
|
+
padding-top: env(safe-area-inset-top);
|
|
138
|
+
padding-right: 0;
|
|
139
|
+
padding-bottom: max(var(--spacing-sm), env(safe-area-inset-bottom));
|
|
140
|
+
padding-left: 0;
|
|
141
|
+
place-items: center;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
#profile-modal .modal {
|
|
145
|
+
width: var(--profile-modal-panel-width);
|
|
146
|
+
max-width: var(--profile-modal-panel-max-width);
|
|
147
|
+
min-width: 0;
|
|
148
|
+
padding: 0;
|
|
149
|
+
border-radius: var(--border-radius-base);
|
|
150
|
+
overscroll-behavior: contain;
|
|
151
|
+
justify-self: center;
|
|
152
|
+
align-self: center;
|
|
153
|
+
margin: 0;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
#profile-modal .modal .modal-header {
|
|
157
|
+
gap: var(--spacing-lg, 1.5625rem);
|
|
158
|
+
padding: var(--spacing-sm, 0.938rem);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
#profile-modal .modal #modal-title {
|
|
162
|
+
font-size: var(--font-size-lg, 1.125rem);
|
|
163
|
+
line-height: var(--line-height-tight, 1.4);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
#profile-modal .modal #modal-desc {
|
|
167
|
+
padding: var(--spacing-sm, 0.938rem) var(--spacing-sm, 0.938rem) var(--spacing-lg, 1.5625rem);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
#profile-modal .modal #modal-desc:has(> .profile__edit-form--projects) {
|
|
171
|
+
padding: var(--spacing-sm, 0.938rem) var(--spacing-sm, 0.938rem) var(--spacing-lg, 1.5625rem);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
#profile-modal #modal-desc > .profile__edit-form--bio {
|
|
175
|
+
display: flex;
|
|
176
|
+
flex-direction: column;
|
|
177
|
+
gap: var(--spacing-md, 1.25rem);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
#profile-modal #modal-buttons {
|
|
181
|
+
flex-direction: row;
|
|
182
|
+
align-items: center;
|
|
183
|
+
justify-content: flex-end;
|
|
184
|
+
gap: var(--profile-modal-button-gap);
|
|
185
|
+
padding: var(--profile-modal-compact-padding);
|
|
186
|
+
width: 100%;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
#profile-modal #modal-buttons > solid-ui-button {
|
|
190
|
+
flex: 1 0 0;
|
|
191
|
+
width: auto;
|
|
192
|
+
min-width: 0;
|
|
193
|
+
--button-font-size-md: var(--font-size-md, 1rem);
|
|
194
|
+
}
|
|
195
|
+
}
|
package/lib/ui/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/ui/errors.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/ui/errors.ts"],"names":[],"mappings":"AAGA,wBAAgB,QAAQ,CAAE,GAAG,EAAE,WAAW,EAAE,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI,CAE/E"}
|
package/lib/ui/errors.js
CHANGED
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.complain = complain;
|
|
7
7
|
var _solidUi = require("solid-ui");
|
|
8
|
+
var _errorDisplay = require("../utils/errorDisplay");
|
|
8
9
|
function complain(div, d, message) {
|
|
9
|
-
div.appendChild(_solidUi.widgets.errorMessageBlock(d, message, 'pink'));
|
|
10
|
+
div.appendChild(_solidUi.widgets.errorMessageBlock(d, (0, _errorDisplay.formatDisplayError)(message), 'pink'));
|
|
10
11
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spinner.d.ts","sourceRoot":"","sources":["../../src/ui/spinner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,cAAc,EAAE,MAAM,UAAU,CAAA;AAE/C,wBAAgB,aAAa,IAAK,cAAc,CAK/C"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createSpinner = createSpinner;
|
|
7
|
+
var _litHtml = require("lit-html");
|
|
8
|
+
function createSpinner() {
|
|
9
|
+
return (0, _litHtml.html)`
|
|
10
|
+
<span class="loading-spinner" aria-hidden="true"></span>
|
|
11
|
+
<span class="sr-only">Saving...</span>
|
|
12
|
+
`;
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debug.d.ts","sourceRoot":"","sources":["../../src/utils/debug.ts"],"names":[],"mappings":"AAEA,wBAAgB,GAAG,CAAE,GAAG,IAAI,OAAA,QAE3B;AAED,wBAAgB,IAAI,CAAE,GAAG,IAAI,OAAA,QAE5B;AAED,wBAAgB,KAAK,CAAE,GAAG,IAAI,OAAA,QAE7B;AAED,wBAAgB,KAAK,CAAE,GAAG,IAAI,OAAA,QAE7B"}
|