@byline/ui 2.4.0 → 2.4.1
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/dist/react.d.ts +10 -18
- package/dist/react.js +2 -15
- package/dist/{admin/components/collections → widgets/diff-viewer}/diff-modal.d.ts +8 -1
- package/dist/{admin/components/collections → widgets/diff-viewer}/diff-modal.js +4 -6
- package/dist/widgets/diff-viewer/diff-modal.module.js +14 -0
- package/dist/{admin/components/collections → widgets/diff-viewer}/diff-modal_module.css +9 -9
- package/dist/{admin/components/collections → widgets/status-badge}/status-badge.js +1 -1
- package/dist/{admin/components/collections → widgets/status-badge}/status-badge.module.js +3 -3
- package/dist/{admin/components/collections → widgets/status-badge}/status-badge_module.css +3 -3
- package/package.json +2 -4
- package/src/react.ts +12 -34
- package/src/{admin/components/collections → widgets/diff-viewer}/diff-modal.tsx +16 -5
- package/src/{admin/components/collections → widgets/status-badge}/status-badge.tsx +1 -1
- package/dist/admin/components/admin-account/change-password.d.ts +0 -8
- package/dist/admin/components/admin-account/change-password.js +0 -192
- package/dist/admin/components/admin-account/change-password.module.js +0 -8
- package/dist/admin/components/admin-account/change-password_module.css +0 -27
- package/dist/admin/components/admin-account/container.d.ts +0 -29
- package/dist/admin/components/admin-account/container.js +0 -299
- package/dist/admin/components/admin-account/container.module.js +0 -28
- package/dist/admin/components/admin-account/container_module.css +0 -106
- package/dist/admin/components/admin-account/update.d.ts +0 -8
- package/dist/admin/components/admin-account/update.js +0 -207
- package/dist/admin/components/admin-account/update.module.js +0 -8
- package/dist/admin/components/admin-account/update_module.css +0 -27
- package/dist/admin/components/admin-permissions/inspector.d.ts +0 -4
- package/dist/admin/components/admin-permissions/inspector.js +0 -284
- package/dist/admin/components/admin-permissions/inspector.module.js +0 -56
- package/dist/admin/components/admin-permissions/inspector_module.css +0 -238
- package/dist/admin/components/admin-roles/create.d.ts +0 -7
- package/dist/admin/components/admin-roles/create.js +0 -177
- package/dist/admin/components/admin-roles/create.module.js +0 -8
- package/dist/admin/components/admin-roles/create_module.css +0 -27
- package/dist/admin/components/admin-roles/permissions.d.ts +0 -10
- package/dist/admin/components/admin-roles/permissions.js +0 -303
- package/dist/admin/components/admin-roles/permissions.module.js +0 -44
- package/dist/admin/components/admin-roles/permissions_module.css +0 -192
- package/dist/admin/components/admin-roles/update.d.ts +0 -8
- package/dist/admin/components/admin-roles/update.js +0 -166
- package/dist/admin/components/admin-roles/update.module.js +0 -8
- package/dist/admin/components/admin-roles/update_module.css +0 -27
- package/dist/admin/components/admin-users/create.d.ts +0 -8
- package/dist/admin/components/admin-users/create.js +0 -268
- package/dist/admin/components/admin-users/create.module.js +0 -10
- package/dist/admin/components/admin-users/create_module.css +0 -45
- package/dist/admin/components/admin-users/roles.d.ts +0 -11
- package/dist/admin/components/admin-users/roles.js +0 -148
- package/dist/admin/components/admin-users/roles.module.js +0 -18
- package/dist/admin/components/admin-users/roles_module.css +0 -75
- package/dist/admin/components/admin-users/set-password.d.ts +0 -8
- package/dist/admin/components/admin-users/set-password.js +0 -170
- package/dist/admin/components/admin-users/set-password.module.js +0 -9
- package/dist/admin/components/admin-users/set-password_module.css +0 -31
- package/dist/admin/components/admin-users/update.d.ts +0 -8
- package/dist/admin/components/admin-users/update.js +0 -254
- package/dist/admin/components/admin-users/update.module.js +0 -9
- package/dist/admin/components/admin-users/update_module.css +0 -34
- package/dist/admin/components/auth/sign-in-form.d.ts +0 -12
- package/dist/admin/components/auth/sign-in-form.js +0 -115
- package/dist/admin/components/auth/sign-in-form.module.js +0 -12
- package/dist/admin/components/auth/sign-in-form_module.css +0 -41
- package/dist/admin/components/collections/diff-modal.module.js +0 -14
- package/dist/services/admin-services-context.d.ts +0 -16
- package/dist/services/admin-services-context.js +0 -13
- package/dist/services/admin-services-types.d.ts +0 -129
- package/dist/services/admin-services-types.js +0 -1
- package/src/admin/components/admin-account/change-password.module.css +0 -40
- package/src/admin/components/admin-account/change-password.tsx +0 -232
- package/src/admin/components/admin-account/container.module.css +0 -158
- package/src/admin/components/admin-account/container.tsx +0 -230
- package/src/admin/components/admin-account/update.module.css +0 -40
- package/src/admin/components/admin-account/update.tsx +0 -263
- package/src/admin/components/admin-permissions/inspector.module.css +0 -326
- package/src/admin/components/admin-permissions/inspector.tsx +0 -298
- package/src/admin/components/admin-roles/create.module.css +0 -40
- package/src/admin/components/admin-roles/create.tsx +0 -218
- package/src/admin/components/admin-roles/permissions.module.css +0 -279
- package/src/admin/components/admin-roles/permissions.tsx +0 -396
- package/src/admin/components/admin-roles/update.module.css +0 -40
- package/src/admin/components/admin-roles/update.tsx +0 -218
- package/src/admin/components/admin-users/create.module.css +0 -63
- package/src/admin/components/admin-users/create.tsx +0 -323
- package/src/admin/components/admin-users/roles.module.css +0 -119
- package/src/admin/components/admin-users/roles.tsx +0 -172
- package/src/admin/components/admin-users/set-password.module.css +0 -46
- package/src/admin/components/admin-users/set-password.tsx +0 -199
- package/src/admin/components/admin-users/update.module.css +0 -49
- package/src/admin/components/admin-users/update.tsx +0 -328
- package/src/admin/components/auth/sign-in-form.module.css +0 -62
- package/src/admin/components/auth/sign-in-form.tsx +0 -132
- package/src/services/admin-services-context.tsx +0 -35
- package/src/services/admin-services-types.ts +0 -177
- /package/dist/{admin/components/collections → widgets/status-badge}/status-badge.d.ts +0 -0
- /package/src/{admin/components/collections → widgets/diff-viewer}/diff-modal.module.css +0 -0
- /package/src/{admin/components/collections → widgets/status-badge}/status-badge.module.css +0 -0
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This Source Code is subject to the terms of the Mozilla Public
|
|
3
|
-
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
4
|
-
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) Infonomic Company Limited
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Framework-neutral function contracts that admin UI components in
|
|
11
|
-
* `@byline/ui` need from the host application. The host wires concrete
|
|
12
|
-
* implementations via `BylineAdminServicesProvider` — typically thin
|
|
13
|
-
* adapters around TanStack Start server functions, Next.js server
|
|
14
|
-
* actions, or any other RPC-style transport.
|
|
15
|
-
*
|
|
16
|
-
* The call shape `(args: { data: TInput }) => Promise<TOutput>` mirrors
|
|
17
|
-
* TanStack Start's `createServerFn().handler()` calling convention so a
|
|
18
|
-
* webapp host can pass its server fns through as-is. Other transports
|
|
19
|
-
* just need a tiny adapter.
|
|
20
|
-
*
|
|
21
|
-
* Scope: Phase 2.1 covers the framework-neutral admin UI components
|
|
22
|
-
* only — the 15 forms, modals, and inner widgets that don't touch
|
|
23
|
-
* TanStack Router. Page containers (list/edit/delete pages) keep using
|
|
24
|
-
* server fns directly today and move into `@byline/host-tanstack-start`
|
|
25
|
-
* in Phase 3 along with the route factories.
|
|
26
|
-
*/
|
|
27
|
-
|
|
28
|
-
import type {
|
|
29
|
-
AccountResponse,
|
|
30
|
-
ChangeAccountPasswordRequest,
|
|
31
|
-
UpdateAccountRequest,
|
|
32
|
-
} from '@byline/admin/admin-account'
|
|
33
|
-
import type {
|
|
34
|
-
SetRoleAbilitiesResponse,
|
|
35
|
-
WhoHasAbilityResponse,
|
|
36
|
-
} from '@byline/admin/admin-permissions'
|
|
37
|
-
import type { AdminRoleResponse, UserRolesResponse } from '@byline/admin/admin-roles'
|
|
38
|
-
import type { AdminUserResponse } from '@byline/admin/admin-users'
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* The TanStack Start `createServerFn(...).handler(...)` calling shape:
|
|
42
|
-
* `fn({ data: input }) → Promise<output>`. Hosts using a different
|
|
43
|
-
* transport supply small adapters that match this shape.
|
|
44
|
-
*/
|
|
45
|
-
export type AdminServiceCall<TInput, TOutput> = (args: { data: TInput }) => Promise<TOutput>
|
|
46
|
-
|
|
47
|
-
// --- Auth -----------------------------------------------------------------
|
|
48
|
-
|
|
49
|
-
export interface SignInInput {
|
|
50
|
-
email: string
|
|
51
|
-
password: string
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* The admin UI's sign-in form does not consume the `SignInResult`
|
|
56
|
-
* payload directly — on success it navigates via `window.location`. The
|
|
57
|
-
* shape is left as `unknown` here so each host's session provider can
|
|
58
|
-
* supply whatever envelope it produces without forcing a public type.
|
|
59
|
-
*/
|
|
60
|
-
export type SignInResult = unknown
|
|
61
|
-
|
|
62
|
-
// --- Account self-service -------------------------------------------------
|
|
63
|
-
|
|
64
|
-
/** Same shape as `UpdateAccountRequest` from `@byline/admin/admin-account`. */
|
|
65
|
-
export type UpdateAccountInput = UpdateAccountRequest
|
|
66
|
-
|
|
67
|
-
/** Same shape as `ChangeAccountPasswordRequest` from `@byline/admin/admin-account`. */
|
|
68
|
-
export type ChangeAccountPasswordInput = ChangeAccountPasswordRequest
|
|
69
|
-
|
|
70
|
-
// --- Admin users ----------------------------------------------------------
|
|
71
|
-
|
|
72
|
-
export interface CreateAdminUserInput {
|
|
73
|
-
email: string
|
|
74
|
-
password: string
|
|
75
|
-
given_name?: string | null
|
|
76
|
-
family_name?: string | null
|
|
77
|
-
username?: string | null
|
|
78
|
-
is_super_admin: boolean
|
|
79
|
-
is_enabled: boolean
|
|
80
|
-
is_email_verified: boolean
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
export interface UpdateAdminUserInput {
|
|
84
|
-
id: string
|
|
85
|
-
vid: number
|
|
86
|
-
patch: {
|
|
87
|
-
email?: string
|
|
88
|
-
given_name?: string | null
|
|
89
|
-
family_name?: string | null
|
|
90
|
-
username?: string | null
|
|
91
|
-
is_super_admin?: boolean
|
|
92
|
-
is_enabled?: boolean
|
|
93
|
-
is_email_verified?: boolean
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
export interface SetAdminUserPasswordInput {
|
|
98
|
-
id: string
|
|
99
|
-
vid: number
|
|
100
|
-
password: string
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
export interface SetUserRolesInput {
|
|
104
|
-
userId: string
|
|
105
|
-
roleIds: string[]
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
// --- Admin roles ----------------------------------------------------------
|
|
109
|
-
|
|
110
|
-
export interface CreateAdminRoleInput {
|
|
111
|
-
name: string
|
|
112
|
-
machine_name: string
|
|
113
|
-
description: string | null
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
export interface UpdateAdminRoleInput {
|
|
117
|
-
id: string
|
|
118
|
-
vid: number
|
|
119
|
-
patch: {
|
|
120
|
-
name?: string
|
|
121
|
-
description?: string | null
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
// --- Permissions ----------------------------------------------------------
|
|
126
|
-
|
|
127
|
-
export interface SetRoleAbilitiesInput {
|
|
128
|
-
id: string
|
|
129
|
-
abilities: string[]
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
export interface WhoHasAbilityInput {
|
|
133
|
-
ability: string
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
// --- Service contract -----------------------------------------------------
|
|
137
|
-
|
|
138
|
-
export interface BylineAdminServices {
|
|
139
|
-
// Auth
|
|
140
|
-
adminSignIn: AdminServiceCall<SignInInput, SignInResult>
|
|
141
|
-
|
|
142
|
-
// Account self-service
|
|
143
|
-
updateAccount: AdminServiceCall<UpdateAccountInput, AccountResponse>
|
|
144
|
-
changeAccountPassword: AdminServiceCall<ChangeAccountPasswordInput, AccountResponse>
|
|
145
|
-
|
|
146
|
-
// Admin user writes (page-container reads stay in the host for now)
|
|
147
|
-
createAdminUser: AdminServiceCall<CreateAdminUserInput, AdminUserResponse>
|
|
148
|
-
updateAdminUser: AdminServiceCall<UpdateAdminUserInput, AdminUserResponse>
|
|
149
|
-
setAdminUserPassword: AdminServiceCall<SetAdminUserPasswordInput, AdminUserResponse>
|
|
150
|
-
setUserRoles: AdminServiceCall<SetUserRolesInput, UserRolesResponse>
|
|
151
|
-
|
|
152
|
-
// Admin role writes
|
|
153
|
-
createAdminRole: AdminServiceCall<CreateAdminRoleInput, AdminRoleResponse>
|
|
154
|
-
updateAdminRole: AdminServiceCall<UpdateAdminRoleInput, AdminRoleResponse>
|
|
155
|
-
|
|
156
|
-
// Permissions
|
|
157
|
-
setRoleAbilities: AdminServiceCall<SetRoleAbilitiesInput, SetRoleAbilitiesResponse>
|
|
158
|
-
whoHasAbility: AdminServiceCall<WhoHasAbilityInput, WhoHasAbilityResponse>
|
|
159
|
-
|
|
160
|
-
/**
|
|
161
|
-
* Diff helper. Loads a specific historical version of a document so
|
|
162
|
-
* the diff modal can compare it against the current version. Returns
|
|
163
|
-
* the same shape as the regular document loader — the diff modal
|
|
164
|
-
* consumes only `doc.fields` (or strips known meta keys when an
|
|
165
|
-
* older flat-shape doc is encountered).
|
|
166
|
-
*
|
|
167
|
-
* Positional-args shape rather than `{ data }` because this helper
|
|
168
|
-
* predates the contract and is consumed only by `DiffModal`. Hosts
|
|
169
|
-
* adapt their server fn into this call signature.
|
|
170
|
-
*/
|
|
171
|
-
getCollectionDocumentVersion: (
|
|
172
|
-
collection: string,
|
|
173
|
-
documentId: string,
|
|
174
|
-
versionId: string,
|
|
175
|
-
locale: string | undefined
|
|
176
|
-
) => Promise<Record<string, unknown>>
|
|
177
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|