@pontive/pontkit-core 1.40.0 → 1.41.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/catalog.json +1 -1
- package/custom-elements.json +1 -1
- package/dist/index.js +1283 -873
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +13084 -10797
- package/dist/index.mjs.map +1 -1
- package/dist/pont2/core/format.d.ts +46 -0
- package/dist/pont2/core/icons.d.ts +5 -0
- package/dist/pont2/core/index.d.ts +1 -0
- package/dist/pont2/core/messages.d.ts +107 -2
- package/dist/pont2/custom-elements.json +20404 -14583
- package/dist/pont2/index.mjs +4800 -2651
- package/dist/pont2/index.mjs.map +1 -1
- package/dist/pont2/kit/account-menu/account-menu.d.ts +115 -0
- package/dist/pont2/kit/account-settings/account-settings.d.ts +157 -0
- package/dist/pont2/kit/account-settings/profile.d.ts +74 -0
- package/dist/pont2/kit/index.d.ts +4 -0
- package/dist/pont2/kit/member-management/errors.d.ts +60 -0
- package/dist/pont2/kit/member-management/member-management.d.ts +237 -0
- package/dist/pont2/kit/member-management/roles.d.ts +42 -0
- package/dist/pont2/kit/organization-switcher/organization-switcher.d.ts +111 -0
- package/dist/pont2/kit/provider/account-client.d.ts +355 -0
- package/dist/pont2/kit/provider/account-controller.d.ts +47 -0
- package/dist/pont2/kit/provider/account-user.d.ts +16 -0
- package/dist/pont2/kit/provider/provider.d.ts +43 -9
- package/dist/pont2/kit/provider/sdk.d.ts +14 -0
- package/dist/pont2/styles.css +482 -0
- package/dist/styles.css +482 -0
- package/package.json +2 -2
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* # Dates and numbers in the page's language (tracker I-3, I-4; carry-over §3)
|
|
3
|
+
*
|
|
4
|
+
* The legacy `src/utils/format.ts`, done properly: every function formats with
|
|
5
|
+
* the language the page was last served in (`currentLocale()`, from the
|
|
6
|
+
* server's message set; the browser's own until then), and the relative day
|
|
7
|
+
* ("Today", "Yesterday") comes from `Intl.RelativeTimeFormat`, so it is in
|
|
8
|
+
* that language too instead of English. No message codes are needed.
|
|
9
|
+
*
|
|
10
|
+
* Every function takes the locale and "now" as options so it can be tested.
|
|
11
|
+
*/
|
|
12
|
+
/** What the management API sends for a moment: Unix seconds, Unix milliseconds, an ISO string, or a Date. */
|
|
13
|
+
export type DateInput = number | string | Date | null | undefined;
|
|
14
|
+
export interface FormatOptions {
|
|
15
|
+
/** BCP-47 tag (default `currentLocale()`, then the browser's). */
|
|
16
|
+
locale?: string;
|
|
17
|
+
/** For relative labels: the moment to compare with (default now). */
|
|
18
|
+
now?: Date;
|
|
19
|
+
/** Format in this time zone (default the browser's). For tests. */
|
|
20
|
+
timeZone?: string;
|
|
21
|
+
}
|
|
22
|
+
/** `value` as a valid Date, or `null` (missing, unparsable). */
|
|
23
|
+
export declare function toDate(value: DateInput): Date | null;
|
|
24
|
+
/** "Jan 15, 2024" (en), "15 janv. 2024" (fr): the medium date. Empty for no date. */
|
|
25
|
+
export declare function formatDate(value: DateInput, options?: FormatOptions): string;
|
|
26
|
+
/** "2:30 PM" (en-US), "14:30" (de): hours and minutes in the language's own clock. Empty for no date. */
|
|
27
|
+
export declare function formatTime(value: DateInput, options?: FormatOptions): string;
|
|
28
|
+
/** Date and time together ("Jan 15, 2024, 2:30 PM"), e.g. for a `title` tooltip. Empty for no date. */
|
|
29
|
+
export declare function formatDateTime(value: DateInput, options?: FormatOptions): string;
|
|
30
|
+
/** Whole calendar days from `now` to `date` (negative: in the past), in the browser's (or `timeZone`'s) days. */
|
|
31
|
+
export declare function calendarDaysBetween(date: Date, now: Date, timeZone?: string): number;
|
|
32
|
+
/**
|
|
33
|
+
* A day as people say it, relative to today, in the page's language:
|
|
34
|
+
*
|
|
35
|
+
* - the same day, the day before or after: `Intl.RelativeTimeFormat` with `numeric: "auto"`
|
|
36
|
+
* ("Today", "Yesterday", "Tomorrow"; "Aujourd’hui", "Hier", "Demain"), first letter capitalised;
|
|
37
|
+
* - two to six days either side: the weekday ("Monday", "lundi");
|
|
38
|
+
* - anything further: the medium date (`formatDate`).
|
|
39
|
+
*
|
|
40
|
+
* The legacy `formatRelativeDateLabel` returned English "Today" / "Yesterday" in every language,
|
|
41
|
+
* and treated a future day (an invitation's expiry) like a past one; both are fixed here (I-4).
|
|
42
|
+
* Empty for no date.
|
|
43
|
+
*/
|
|
44
|
+
export declare function formatRelativeDay(value: DateInput, options?: FormatOptions): string;
|
|
45
|
+
/** A number in the page's language ("1,234" / "1.234"). */
|
|
46
|
+
export declare function formatNumber(value: number, options?: Pick<FormatOptions, "locale">): string;
|
|
@@ -30,5 +30,10 @@ export declare const icons: {
|
|
|
30
30
|
download: (a?: AttrMap) => TemplateResult<1>;
|
|
31
31
|
arrowRight: (a?: AttrMap) => TemplateResult<1>;
|
|
32
32
|
userRoundKey: (a?: AttrMap) => TemplateResult<1>;
|
|
33
|
+
plus: (a?: AttrMap) => TemplateResult<1>;
|
|
34
|
+
refreshCw: (a?: AttrMap) => TemplateResult<1>;
|
|
35
|
+
mail: (a?: AttrMap) => TemplateResult<1>;
|
|
36
|
+
shieldAlert: (a?: AttrMap) => TemplateResult<1>;
|
|
37
|
+
externalLink: (a?: AttrMap) => TemplateResult<1>;
|
|
33
38
|
};
|
|
34
39
|
export type IconName = keyof typeof icons;
|
|
@@ -21,8 +21,8 @@ import { ReactiveController, ReactiveControllerHost } from 'lit';
|
|
|
21
21
|
* Elements that render `msg()` add a `MessagesController`, so text that arrives
|
|
22
22
|
* after they first rendered reaches them.
|
|
23
23
|
*
|
|
24
|
-
* The account widgets' codes (carry-over §3) join this table
|
|
25
|
-
* built (migration tracker I-2, W-7…W-10).
|
|
24
|
+
* The account widgets' codes (carry-over §3) join this table as they are
|
|
25
|
+
* built (migration tracker I-2, W-7…W-10): the menu's and the switcher's are in.
|
|
26
26
|
*/
|
|
27
27
|
export declare const KIT_MESSAGES_EN: {
|
|
28
28
|
readonly connection_failed: "We couldn't reach the server. Check your connection and try again.";
|
|
@@ -60,6 +60,111 @@ export declare const KIT_MESSAGES_EN: {
|
|
|
60
60
|
readonly invite_emails_required: "Enter at least one email address.";
|
|
61
61
|
readonly search_roles: "Search roles";
|
|
62
62
|
readonly no_options: "Nothing found.";
|
|
63
|
+
readonly account_settings: "Account settings";
|
|
64
|
+
readonly log_out: "Log out";
|
|
65
|
+
readonly select_organization: "Select organization";
|
|
66
|
+
readonly organization_switch_failed: "You can't switch to that organization.";
|
|
67
|
+
readonly organization_switching: "Switching…";
|
|
68
|
+
readonly action_save: "Save";
|
|
69
|
+
readonly action_saving: "Saving";
|
|
70
|
+
readonly action_cancel: "Cancel";
|
|
71
|
+
readonly action_edit: "Edit";
|
|
72
|
+
readonly action_submit: "Submit";
|
|
73
|
+
readonly action_submitting: "Submitting";
|
|
74
|
+
readonly action_retry: "Try again";
|
|
75
|
+
readonly action_refresh: "Refresh";
|
|
76
|
+
readonly field_email: "Email";
|
|
77
|
+
readonly tab_profile: "Profile";
|
|
78
|
+
readonly tab_security: "Security";
|
|
79
|
+
readonly not_added: "Not added";
|
|
80
|
+
readonly field_phone: "Phone number";
|
|
81
|
+
readonly field_photo: "Photo";
|
|
82
|
+
readonly field_photo_url: "Photo URL";
|
|
83
|
+
readonly avatar_alt: "Avatar";
|
|
84
|
+
readonly change_photo: "Change photo";
|
|
85
|
+
readonly login_info: "Login info";
|
|
86
|
+
readonly personal_info: "Personal info";
|
|
87
|
+
readonly location_section: "Location";
|
|
88
|
+
readonly links_section: "Links";
|
|
89
|
+
readonly field_username: "Username";
|
|
90
|
+
readonly field_first_name: "First name";
|
|
91
|
+
readonly field_middle_name: "Middle name";
|
|
92
|
+
readonly field_last_name: "Last name";
|
|
93
|
+
readonly field_nickname: "Nickname";
|
|
94
|
+
readonly field_gender: "Gender";
|
|
95
|
+
readonly field_bio: "Bio";
|
|
96
|
+
readonly field_location: "Location";
|
|
97
|
+
readonly field_timezone: "Time zone";
|
|
98
|
+
readonly field_website: "Website";
|
|
99
|
+
readonly select_gender: "Select gender";
|
|
100
|
+
readonly gender_male: "Male";
|
|
101
|
+
readonly gender_female: "Female";
|
|
102
|
+
readonly gender_other: "Other";
|
|
103
|
+
readonly select_timezone: "Select a time zone";
|
|
104
|
+
readonly timezone_hint: "Choose a time zone from the list.";
|
|
105
|
+
readonly username_hint: "Use 3 to 30 characters: letters, numbers, dots, underscores or hyphens.";
|
|
106
|
+
readonly url_hint: "Enter a full URL, including https://";
|
|
107
|
+
readonly url_scheme_invalid: "Only http:// and https:// addresses are allowed.";
|
|
108
|
+
readonly photo_update_failed: "We couldn't update your photo. Please try again.";
|
|
109
|
+
readonly personal_update_failed: "We couldn't update your personal information. Please try again.";
|
|
110
|
+
readonly location_update_failed: "We couldn't update your location. Please try again.";
|
|
111
|
+
readonly website_update_failed: "We couldn't update your website. Please try again.";
|
|
112
|
+
readonly security_title: "Security settings";
|
|
113
|
+
readonly security_coming_soon: "Advanced security features are coming soon. Manage your passwords, two-factor authentication, active sessions and more in future updates.";
|
|
114
|
+
readonly profile_load_failed: "We couldn't load your profile. Please try again.";
|
|
115
|
+
readonly account_settings_unavailable: "Account settings aren't available in this app.";
|
|
116
|
+
readonly member_management_title: "Member management";
|
|
117
|
+
readonly member_management_subtitle: "Manage who belongs to this organization, their roles and invitations.";
|
|
118
|
+
readonly tab_members: "Members";
|
|
119
|
+
readonly tab_invitations: "Invitations";
|
|
120
|
+
readonly members_unavailable: "This app can't manage organization members.";
|
|
121
|
+
readonly members_forbidden: "You don't have permission to manage this organization's members.";
|
|
122
|
+
readonly members_load_failed: "We couldn't load this organization's members. Please try again.";
|
|
123
|
+
readonly members_no_organization: "Choose an organization to manage its members.";
|
|
124
|
+
readonly search_members: "Search members";
|
|
125
|
+
readonly search_invitations: "Search invitations";
|
|
126
|
+
readonly field_roles: "Roles";
|
|
127
|
+
readonly column_name: "Name";
|
|
128
|
+
readonly column_joined: "Joined";
|
|
129
|
+
readonly column_invited_by: "Invited by";
|
|
130
|
+
readonly column_sent: "Sent";
|
|
131
|
+
readonly column_expires: "Expires";
|
|
132
|
+
readonly members_empty: "No members found.";
|
|
133
|
+
readonly invitations_empty: "No pending invitations.";
|
|
134
|
+
readonly rows_per_page: "Rows per page";
|
|
135
|
+
readonly unknown_user: "Unknown user";
|
|
136
|
+
readonly manage_roles: "Manage roles";
|
|
137
|
+
readonly manage_roles_subtitle: "Choose the roles this member has in the organization.";
|
|
138
|
+
readonly roles_locked_hint: "Roles you can't assign or remove are locked.";
|
|
139
|
+
readonly roles_required: "Choose at least one role.";
|
|
140
|
+
readonly update_roles_failed: "We couldn't update this member's roles. Please try again.";
|
|
141
|
+
readonly self_role_change: "You can't change your own roles.";
|
|
142
|
+
readonly role_ceiling: "You can only assign or remove roles whose permissions you have yourself.";
|
|
143
|
+
readonly member_roles_changed: "This member's roles changed while you were editing. Review them and try again.";
|
|
144
|
+
readonly owner_transfer_required: "Only someone who can transfer ownership can give, change or remove the owner role.";
|
|
145
|
+
readonly leave_disabled: "This organization doesn't let members leave. Ask an administrator to remove you.";
|
|
146
|
+
readonly member_change_refused: "You can't make this change.";
|
|
147
|
+
readonly remove_member: "Remove member";
|
|
148
|
+
readonly remove_member_confirm: "Remove this member from the organization?";
|
|
149
|
+
readonly remove_member_warning: "They lose access to the organization immediately and need a new invitation to rejoin.";
|
|
150
|
+
readonly remove_member_failed: "We couldn't remove this member. Please try again.";
|
|
151
|
+
readonly resend_invitation: "Resend invitation";
|
|
152
|
+
readonly resend_invitation_confirm: "Send this invitation again?";
|
|
153
|
+
readonly resend_invitation_failed: "We couldn't resend this invitation. Please try again.";
|
|
154
|
+
readonly revoke_invitation: "Revoke invitation";
|
|
155
|
+
readonly revoke_invitation_confirm: "Revoke this invitation?";
|
|
156
|
+
readonly revoke_invitation_warning: "The invitation link stops working and can no longer be used to join.";
|
|
157
|
+
readonly revoke_invitation_failed: "We couldn't revoke this invitation. Please try again.";
|
|
158
|
+
readonly invite_members: "Invite members";
|
|
159
|
+
readonly invite_members_subtitle: "Invite people to this organization by email.";
|
|
160
|
+
readonly invite_emails_label: "Email addresses";
|
|
161
|
+
readonly invite_roles_hint: "The roles people will have when they join.";
|
|
162
|
+
readonly invite_message_label: "Personal message (optional)";
|
|
163
|
+
readonly invite_message_placeholder: "Add a note to the invitation email";
|
|
164
|
+
readonly send_invitations: "Send invitations";
|
|
165
|
+
readonly sending_invitations: "Sending";
|
|
166
|
+
readonly invite_failed: "We couldn't send the invitations. Please try again.";
|
|
167
|
+
readonly revoke_invitation_notify: "Email the invitee that the invitation was revoked";
|
|
63
168
|
};
|
|
64
169
|
export type KitMessageCode = keyof typeof KIT_MESSAGES_EN;
|
|
65
170
|
/**
|