@pairz/directory 0.0.1 → 1.0.0-rc.81
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/LICENSE +21 -0
- package/README.md +70 -1
- package/WORDS.md +198 -0
- package/actions/code.d.ts +4 -0
- package/actions/code.js +135 -0
- package/actions/host.d.ts +2 -0
- package/actions/host.js +55 -0
- package/actions/invite.d.ts +5 -0
- package/actions/invite.js +129 -0
- package/actions/org.d.ts +10 -0
- package/actions/org.js +273 -0
- package/collections/credit-code.d.ts +107 -0
- package/collections/credit-code.js +28 -0
- package/collections/invite.d.ts +74 -0
- package/collections/invite.js +20 -0
- package/collections/membership.d.ts +65 -0
- package/collections/membership.js +22 -0
- package/collections/org-host.d.ts +55 -0
- package/collections/org-host.js +30 -0
- package/collections/org.d.ts +134 -0
- package/collections/org.js +58 -0
- package/collections/staff.d.ts +35 -0
- package/collections/staff.js +12 -0
- package/contract.d.ts +8 -0
- package/contract.js +8 -0
- package/mod.d.ts +67 -0
- package/mod.js +123 -0
- package/package.json +63 -3
- package/routes/console.d.ts +26 -0
- package/routes/console.js +129 -0
- package/routes/enter.d.ts +18 -0
- package/routes/enter.js +47 -0
- package/routes/forward.d.ts +35 -0
- package/routes/forward.js +120 -0
- package/routes/orgs.d.ts +25 -0
- package/routes/orgs.js +113 -0
- package/routes/signout.d.ts +11 -0
- package/routes/signout.js +36 -0
- package/shared/enter.d.ts +36 -0
- package/shared/enter.js +82 -0
- package/shared/http.d.ts +44 -0
- package/shared/http.js +79 -0
- package/shared/member.d.ts +21 -0
- package/shared/member.js +73 -0
- package/shared/settings.d.ts +53 -0
- package/shared/settings.js +16 -0
- package/shared/state.d.ts +74 -0
- package/shared/state.js +101 -0
- package/views/web/codes.d.ts +27 -0
- package/views/web/codes.js +50 -0
- package/views/web/console-codes.d.ts +37 -0
- package/views/web/console-codes.js +166 -0
- package/views/web/console.d.ts +37 -0
- package/views/web/console.js +224 -0
- package/views/web/lists.d.ts +48 -0
- package/views/web/lists.js +42 -0
- package/views/web/org.d.ts +12 -0
- package/views/web/org.js +62 -0
- package/views/web/orgs.d.ts +148 -0
- package/views/web/orgs.js +253 -0
- package/views/web/style.d.ts +6 -0
- package/views/web/style.js +197 -0
- package/views/web/switcher.d.ts +81 -0
- package/views/web/switcher.js +367 -0
- package/views/web/words.d.ts +10 -0
- package/views/web/words.js +206 -0
- package/web.d.ts +36 -0
- package/web.js +57 -0
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The words of the directory's front end, in English: the org switcher, going between orgs, the
|
|
3
|
+
* org's page and staff's console keep the keys they had in the web shell (`shell.<key>`), so an
|
|
4
|
+
* app's own words for them still hold; what an org is called where it shows is `directory.<key>`.
|
|
5
|
+
*/
|
|
6
|
+
import { defineWords } from "pairz/web/words";
|
|
7
|
+
const shell = {
|
|
8
|
+
// Going home, and staff in an org (org.tsx, switcher.tsx)
|
|
9
|
+
goHome: "Go home",
|
|
10
|
+
staffLine: "You're in this org as platform staff: what you do is on its record.",
|
|
11
|
+
// In the account menu and the palette (web.tsx)
|
|
12
|
+
orgSettings: "Organization settings",
|
|
13
|
+
aboutOrg: "About this organization",
|
|
14
|
+
allOrgsConsole: "All orgs (console)",
|
|
15
|
+
// Standing (lists.ts)
|
|
16
|
+
staff: "Staff",
|
|
17
|
+
// The org's page (org.tsx)
|
|
18
|
+
organization: "Organization",
|
|
19
|
+
oneOrg: "One organization here",
|
|
20
|
+
oneOrgAbout: "This app serves a single organization, so there's nothing to set here.",
|
|
21
|
+
notInOrg: "You're not in an organization",
|
|
22
|
+
chooseOrg: "Choose one from the switcher at the top of the sidebar.",
|
|
23
|
+
personalOrg: "Personal org",
|
|
24
|
+
teamOrg: "Team org",
|
|
25
|
+
staffAccess: "Staff access",
|
|
26
|
+
orgAboutStaff: "You're here as platform staff: what you do is on {name}'s record.",
|
|
27
|
+
orgAboutPersonal: "Your own organization: just you, and what you make alone.",
|
|
28
|
+
orgAboutRuns: "Who's in {name}, what it uses, and what it's called.",
|
|
29
|
+
orgAboutGuest: "What {name} is. As a guest, you work in the spaces you're invited to.",
|
|
30
|
+
orgAboutMember: "What {name} is, and who's in it.",
|
|
31
|
+
orgSection: "{name}: {section}",
|
|
32
|
+
heldBack: "{section} is for this org's owners and admins. Ask one of them if you need something changed there.",
|
|
33
|
+
orgSettingsOf: "{name}'s settings",
|
|
34
|
+
nothingToSet: "Nothing to set here",
|
|
35
|
+
nothingToSetAbout: "This app adds no sections to an organization's page.",
|
|
36
|
+
// Orgs: the switcher, the new-org dialog, going between orgs, the palette (switcher.tsx)
|
|
37
|
+
justYou: "Just you",
|
|
38
|
+
yourOrgs: "Your organizations",
|
|
39
|
+
organizations: "Organizations",
|
|
40
|
+
inAsStaffTitle: "You're in {name} as platform staff: what you do is on its record",
|
|
41
|
+
switchOrg: "{name}: switch organization",
|
|
42
|
+
// …on the rail, the sidebar folded, with invitations waiting
|
|
43
|
+
switchOrgWaiting: {
|
|
44
|
+
one: "{name}: switch organization ({count} invitation)",
|
|
45
|
+
other: "{name}: switch organization ({count} invitations)",
|
|
46
|
+
},
|
|
47
|
+
invitationsCount: "{count} invitations",
|
|
48
|
+
signedInAs: "Signed in as {who}",
|
|
49
|
+
inAsStaff: "You're in {name} as staff. What you do here is on its record.",
|
|
50
|
+
continueAs: "Continue as {role}",
|
|
51
|
+
invitations: "Invitations",
|
|
52
|
+
newOrgMore: "New organization…",
|
|
53
|
+
enterAsStaff: "Enter as staff",
|
|
54
|
+
suspendedTitle: "{name} is suspended: nobody goes in for now",
|
|
55
|
+
yourOwn: "Your own",
|
|
56
|
+
suspended: "Suspended",
|
|
57
|
+
invitedFromAsAt: "{from} invited you, as {role} · {time}",
|
|
58
|
+
invitedAsAt: "You're invited, as {role} · {time}",
|
|
59
|
+
invitedFromAs: "{from} invited you, as {role}",
|
|
60
|
+
invitedAs: "You're invited, as {role}",
|
|
61
|
+
join: "Join",
|
|
62
|
+
joinNamed: "Join {name}",
|
|
63
|
+
decline: "Decline",
|
|
64
|
+
newOrg: "New organization",
|
|
65
|
+
newOrgAbout: "For a team: you'll own it, and invite people by email.",
|
|
66
|
+
cancel: "Cancel",
|
|
67
|
+
createOrg: "Create organization",
|
|
68
|
+
name: "Name",
|
|
69
|
+
newOrgNameHint: "Usually your team's or company's name. You can change it later.",
|
|
70
|
+
atMost: "At most {count} characters",
|
|
71
|
+
newOrgPlaceholder: "e.g. Acme",
|
|
72
|
+
goingInto: "Going into {name}",
|
|
73
|
+
enteringAsStaff: "Entering as staff",
|
|
74
|
+
switchingTo: "Switching to",
|
|
75
|
+
movedOrg: "You're no longer in the org you were in. You're in {name}.",
|
|
76
|
+
youreIn: "You're in {name}",
|
|
77
|
+
nameIt: "Name it",
|
|
78
|
+
createNamed: "Create “{name}”",
|
|
79
|
+
switchTo: "Switch to {name}",
|
|
80
|
+
yourOwnOrg: "Your own org",
|
|
81
|
+
declineOrgInvite: "Decline {name}'s invitation",
|
|
82
|
+
// Words the palette finds an item by, apart by spaces
|
|
83
|
+
keysSwitch: "organization org switch",
|
|
84
|
+
keysNewOrg: "create team organization org",
|
|
85
|
+
keysOrgSettings: "members usage invite roles organization",
|
|
86
|
+
keysConsole: "staff console platform suspend",
|
|
87
|
+
keysAcceptOrgInvite: "invitation accept organization",
|
|
88
|
+
keysOrgInvite: "invitation organization",
|
|
89
|
+
// Staff's console (console.tsx)
|
|
90
|
+
filterAll: "All",
|
|
91
|
+
filterTeams: "Teams",
|
|
92
|
+
personal: "Personal",
|
|
93
|
+
giftCodes: "Gift codes",
|
|
94
|
+
consoleTitle: "Console",
|
|
95
|
+
forStaff: "For platform staff",
|
|
96
|
+
forStaffAbout: "The console lists every organization, for the people who run this app.",
|
|
97
|
+
consoleShows: "What the console shows",
|
|
98
|
+
giftCodesAbout: "Credits waiting to be claimed. Someone who runs an org types one in under Billing, and its credits are that org's.",
|
|
99
|
+
consoleAbout: "Every org on this app: what each last reported, where its rows live, and what you can do about it. Nothing here reads an org's content.",
|
|
100
|
+
refresh: "Refresh",
|
|
101
|
+
teamOrgs: "Team orgs",
|
|
102
|
+
people: "People",
|
|
103
|
+
searchPlaceholder: "Search by name, id, schema or maker",
|
|
104
|
+
searchOrgs: "Search organizations",
|
|
105
|
+
whichOrgs: "Which organizations",
|
|
106
|
+
spaces: "Spaces",
|
|
107
|
+
lastActive: "Last active",
|
|
108
|
+
placement: "Placement",
|
|
109
|
+
status: "Status",
|
|
110
|
+
actions: "Actions",
|
|
111
|
+
noMatch: "No organization matches",
|
|
112
|
+
nothingMatches: "Nothing matches “{search}”",
|
|
113
|
+
nothingYet: "Nothing in this list yet.",
|
|
114
|
+
footAll: {
|
|
115
|
+
one: "{count} organization · the most recently active first",
|
|
116
|
+
other: "{count} organizations · the most recently active first",
|
|
117
|
+
},
|
|
118
|
+
footSome: "{shown} of {total} organizations · the most recently active first",
|
|
119
|
+
hereAsStaff: "You're here as staff",
|
|
120
|
+
youreHere: "You're here",
|
|
121
|
+
team: "Team",
|
|
122
|
+
copyOrgId: "Copy the org's id",
|
|
123
|
+
notYet: "Not yet",
|
|
124
|
+
active: "Active",
|
|
125
|
+
inItAsStaff: "You're in it as staff",
|
|
126
|
+
goIntoAsStaff: "Go into {name} as staff: what you do there is on its record",
|
|
127
|
+
moreOf: "{name}: more",
|
|
128
|
+
renameMore: "Rename…",
|
|
129
|
+
liftMore: "Lift the suspension…",
|
|
130
|
+
suspendMore: "Suspend…",
|
|
131
|
+
moveMore: "Move to another schema…",
|
|
132
|
+
exportRows: "Export its rows (SQL)",
|
|
133
|
+
deleteMore: "Delete for good…",
|
|
134
|
+
unsupported: "This app doesn't do that yet. ({reason})",
|
|
135
|
+
renamedTo: "Renamed to “{name}”.",
|
|
136
|
+
renameOrg: "Rename organization",
|
|
137
|
+
renameOrgAbout: "Its people see the new name at once, everywhere.",
|
|
138
|
+
rename: "Rename",
|
|
139
|
+
liftTitle: "Lift the suspension of {name}?",
|
|
140
|
+
suspendTitle: "Suspend {name}?",
|
|
141
|
+
openAgain: "{name} is open again.",
|
|
142
|
+
isSuspended: "{name} is suspended.",
|
|
143
|
+
lift: "Lift the suspension",
|
|
144
|
+
suspend: "Suspend",
|
|
145
|
+
liftAbout: "Its people can go in again, as before. Nothing in it changed while it was suspended.",
|
|
146
|
+
suspendAbout: "Nobody but staff goes in until you lift it: its people see that it's suspended. Nothing in it is changed or deleted.",
|
|
147
|
+
nowLivesIn: "{name} now lives in “{schema}”.",
|
|
148
|
+
moveTitle: "Move {name}",
|
|
149
|
+
moveAbout: "For big orgs: gives it a schema of its own, so its load and its rows stand apart from the shared pool.",
|
|
150
|
+
moveRows: "Move its rows",
|
|
151
|
+
moveText: "It's closed for a moment, its rows are copied to the new schema as they are, and it opens there on its next use. Its people may see it reconnect.",
|
|
152
|
+
nowIn: "Now in",
|
|
153
|
+
newSchema: "New schema",
|
|
154
|
+
sameSchema: "That's where it is now.",
|
|
155
|
+
schemaRule: "Lowercase letters, digits and _, starting with a letter.",
|
|
156
|
+
isDeleted: "{name} is deleted.",
|
|
157
|
+
deleteTitle: "Delete {name} for good?",
|
|
158
|
+
deleteForGood: "Delete for good",
|
|
159
|
+
cantUndo: "This can't be undone",
|
|
160
|
+
deleteAbout: "Everything in it goes: its people's memberships, spaces, conversations, agents, files and usage. Its people are signed out of it at once. Export its rows first if you may need them.",
|
|
161
|
+
exportFirst: "Export its rows (SQL) first",
|
|
162
|
+
typeToConfirm: "Type {name} to confirm",
|
|
163
|
+
// Gift codes (console-codes.tsx, codes.ts)
|
|
164
|
+
codeWaiting: "Waiting",
|
|
165
|
+
codeClaimed: "Claimed",
|
|
166
|
+
codeRevoked: "Taken back",
|
|
167
|
+
codeExpired: "Expired",
|
|
168
|
+
sayDollars: "Say how many dollars of credits.",
|
|
169
|
+
codesCount: { one: "{count} code, the newest first", other: "{count} codes, the newest first" },
|
|
170
|
+
newGiftCode: "New gift code",
|
|
171
|
+
tryAgain: "Try again",
|
|
172
|
+
noCodes: "No gift codes yet",
|
|
173
|
+
noCodesAbout: "A gift code gives whoever claims it credits for their org.",
|
|
174
|
+
termsLapse: "Credits lapse {lapse}",
|
|
175
|
+
termsNoLapse: "Credits don't lapse",
|
|
176
|
+
termsLapseClaim: "Credits lapse {lapse} · claim by {until}",
|
|
177
|
+
termsNoLapseClaim: "Credits don't lapse · claim by {until}",
|
|
178
|
+
codeShortTitle: "Only the start of what's kept: it can't be claimed with this",
|
|
179
|
+
codeMade: "· made {time}",
|
|
180
|
+
claimedBy: "by {org}, {day}",
|
|
181
|
+
takeBack: "Take back",
|
|
182
|
+
makeCode: "Make a {amount} code",
|
|
183
|
+
makeTheCode: "Make the code",
|
|
184
|
+
credits: "Credits",
|
|
185
|
+
lapseOn: "Credits lapse on",
|
|
186
|
+
lapseHint: "Empty: they don't lapse.",
|
|
187
|
+
claimBy: "Claim by",
|
|
188
|
+
claimHint: "Empty: any time.",
|
|
189
|
+
whatFor: "What it's for",
|
|
190
|
+
whatForHint: "Whoever claims it sees this in their history.",
|
|
191
|
+
notePlaceholder: "Conference, November",
|
|
192
|
+
yourCode: "Your {amount} gift code",
|
|
193
|
+
keptIt: "Done, I've kept it",
|
|
194
|
+
copyCode: "Copy the code",
|
|
195
|
+
notShownAgain: "This won't be shown again",
|
|
196
|
+
notShownAgainAbout: "Only a fingerprint of it is kept, so nobody can look it up later. Copy it now. If it's lost, take this one back and make another.",
|
|
197
|
+
takeBackTitle: "Take back this {amount} code?",
|
|
198
|
+
takeItBack: "Take it back",
|
|
199
|
+
takeBackAbout: "Nobody can claim it after this, and that can't be undone. If someone still needs it, make them a new one.",
|
|
200
|
+
};
|
|
201
|
+
/** What an org is called where it shows: everyone's own. */
|
|
202
|
+
const directory = { personalOrg: "Personal" };
|
|
203
|
+
export const say = defineWords("shell", shell);
|
|
204
|
+
export const sayOrg = defineWords("directory", directory);
|
|
205
|
+
/** Every word of the directory's front end, by area (WORDS.md lists them). */
|
|
206
|
+
export const PHRASES = { shell, directory };
|
package/web.d.ts
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The directory's web front end, for apps that serve many orgs behind one
|
|
3
|
+
* address: it fills the web shell's `orgs` slot, and draws the org's pages.
|
|
4
|
+
* Add it beside the web shell's, in the browser; without it, the shell has no
|
|
5
|
+
* org switcher.
|
|
6
|
+
*
|
|
7
|
+
* - **The switcher** (`orgs.switcher`), at the top of the sidebar beside the
|
|
8
|
+
* app's mark: the org you're in and your standing there; opened, your orgs
|
|
9
|
+
* (Personal first), invitations to join or decline in place, a new org, the
|
|
10
|
+
* org's settings, and for staff, every org. On the rail, the sidebar folded
|
|
11
|
+
* (`orgs.rail`), the org's face under the app's mark, opening the same.
|
|
12
|
+
* - **Beside every page** (`orgs.overlay`): the dialog that makes an org, the
|
|
13
|
+
* short transition while the page goes into another and the word once it's
|
|
14
|
+
* there, and, while in an org as platform staff, a line along the top.
|
|
15
|
+
* - **The shell's menu and palette** (`useShellOrgs`, the slot's hook): the
|
|
16
|
+
* person's email, the org's page and (for staff) every org, and orgs to
|
|
17
|
+
* switch to, invitations and a new org in the palette.
|
|
18
|
+
* - **The org's page** (`org`, at `/org`): its name, your standing, and the
|
|
19
|
+
* sections front ends add (the shell's `orgSettings` resource: spaces'
|
|
20
|
+
* About and Members, usage's Usage), each for the roles it names.
|
|
21
|
+
* - **Staff's console** (`console`, at `/console`): every org, to enter,
|
|
22
|
+
* rename, suspend, move, export or delete, and gift codes of credits.
|
|
23
|
+
*
|
|
24
|
+
* Its browser half (`useOrgs`, `enterOrg`, `refreshOrgs`…) is here too, and in
|
|
25
|
+
* its contract.ts for other plugins' front ends. Its words keep the keys they
|
|
26
|
+
* had in the shell (`shell.<key>`; see views/web/words.ts).
|
|
27
|
+
*
|
|
28
|
+
* ```ts
|
|
29
|
+
* await web({ plugins: [webShell, chatWeb, spacesWeb, directoryWeb], root });
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
import { type Plugin } from "pairz";
|
|
33
|
+
export * from "./views/web/orgs.js";
|
|
34
|
+
export { openNewOrg, useShellOrgs } from "./views/web/switcher.js";
|
|
35
|
+
export declare const directoryWeb: Plugin;
|
|
36
|
+
export default directoryWeb;
|
package/web.js
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The directory's web front end, for apps that serve many orgs behind one
|
|
3
|
+
* address: it fills the web shell's `orgs` slot, and draws the org's pages.
|
|
4
|
+
* Add it beside the web shell's, in the browser; without it, the shell has no
|
|
5
|
+
* org switcher.
|
|
6
|
+
*
|
|
7
|
+
* - **The switcher** (`orgs.switcher`), at the top of the sidebar beside the
|
|
8
|
+
* app's mark: the org you're in and your standing there; opened, your orgs
|
|
9
|
+
* (Personal first), invitations to join or decline in place, a new org, the
|
|
10
|
+
* org's settings, and for staff, every org. On the rail, the sidebar folded
|
|
11
|
+
* (`orgs.rail`), the org's face under the app's mark, opening the same.
|
|
12
|
+
* - **Beside every page** (`orgs.overlay`): the dialog that makes an org, the
|
|
13
|
+
* short transition while the page goes into another and the word once it's
|
|
14
|
+
* there, and, while in an org as platform staff, a line along the top.
|
|
15
|
+
* - **The shell's menu and palette** (`useShellOrgs`, the slot's hook): the
|
|
16
|
+
* person's email, the org's page and (for staff) every org, and orgs to
|
|
17
|
+
* switch to, invitations and a new org in the palette.
|
|
18
|
+
* - **The org's page** (`org`, at `/org`): its name, your standing, and the
|
|
19
|
+
* sections front ends add (the shell's `orgSettings` resource: spaces'
|
|
20
|
+
* About and Members, usage's Usage), each for the roles it names.
|
|
21
|
+
* - **Staff's console** (`console`, at `/console`): every org, to enter,
|
|
22
|
+
* rename, suspend, move, export or delete, and gift codes of credits.
|
|
23
|
+
*
|
|
24
|
+
* Its browser half (`useOrgs`, `enterOrg`, `refreshOrgs`…) is here too, and in
|
|
25
|
+
* its contract.ts for other plugins' front ends. Its words keep the keys they
|
|
26
|
+
* had in the shell (`shell.<key>`; see views/web/words.ts).
|
|
27
|
+
*
|
|
28
|
+
* ```ts
|
|
29
|
+
* await web({ plugins: [webShell, chatWeb, spacesWeb, directoryWeb], root });
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
import { definePlugin } from "pairz";
|
|
33
|
+
import { consoleView } from "./views/web/console.js";
|
|
34
|
+
import { orgView } from "./views/web/org.js";
|
|
35
|
+
import { overlayView, switcherRailView, switcherView, useShellOrgs, } from "./views/web/switcher.js";
|
|
36
|
+
export * from "./views/web/orgs.js";
|
|
37
|
+
export { openNewOrg, useShellOrgs } from "./views/web/switcher.js";
|
|
38
|
+
export const directoryWeb = definePlugin({
|
|
39
|
+
name: "directory-web",
|
|
40
|
+
requires: ["web-shell"],
|
|
41
|
+
views: {
|
|
42
|
+
"orgs.switcher": switcherView,
|
|
43
|
+
"orgs.rail": switcherRailView,
|
|
44
|
+
"orgs.overlay": overlayView,
|
|
45
|
+
org: orgView,
|
|
46
|
+
console: consoleView,
|
|
47
|
+
},
|
|
48
|
+
resources: {
|
|
49
|
+
orgs: {
|
|
50
|
+
switcher: "orgs.switcher",
|
|
51
|
+
rail: "orgs.rail",
|
|
52
|
+
overlay: "orgs.overlay",
|
|
53
|
+
use: useShellOrgs,
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
export default directoryWeb;
|