@byline/ui 1.0.0 → 1.2.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/dist/admin/group.d.ts +2 -2
- package/dist/admin/group.js +2 -2
- package/dist/admin/row.d.ts +2 -2
- package/dist/admin/row.js +2 -2
- package/dist/admin/tabs.d.ts +4 -4
- package/dist/admin/tabs.js +2 -2
- package/dist/forms/form-renderer.js +6 -6
- package/dist/react.d.ts +66 -2
- package/dist/react.js +48 -1
- package/package.json +4 -33
- package/src/admin/group.tsx +2 -2
- package/src/admin/row.tsx +2 -2
- package/src/admin/tabs.tsx +4 -4
- package/src/forms/form-renderer.tsx +7 -7
- package/src/forms/path-widget.test.tsx +1 -1
- package/src/react.ts +94 -10
- package/dist/admin.d.ts +0 -23
- package/dist/admin.js +0 -18
- package/dist/fields.d.ts +0 -27
- package/dist/fields.js +0 -23
- package/dist/forms.d.ts +0 -9
- package/dist/forms.js +0 -5
- package/dist/services.d.ts +0 -9
- package/dist/services.js +0 -1
- package/src/admin.ts +0 -39
- package/src/fields.ts +0 -28
- package/src/forms.ts +0 -10
- package/src/services.ts +0 -18
package/dist/admin/group.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* Copyright (c) Infonomic Company Limited
|
|
7
7
|
*/
|
|
8
8
|
import type { ReactNode } from 'react';
|
|
9
|
-
interface
|
|
9
|
+
interface AdminGroupProps {
|
|
10
10
|
/** Optional heading rendered as a `<legend>` above the cluster. */
|
|
11
11
|
label?: string;
|
|
12
12
|
children: ReactNode;
|
|
@@ -23,5 +23,5 @@ interface GroupProps {
|
|
|
23
23
|
* `.byline-admin-group-legend` on the legend (alongside the hashed
|
|
24
24
|
* CSS-modules locals).
|
|
25
25
|
*/
|
|
26
|
-
export declare const
|
|
26
|
+
export declare const AdminGroup: ({ label, children, className }: AdminGroupProps) => import("react").JSX.Element;
|
|
27
27
|
export {};
|
package/dist/admin/group.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import classnames from "classnames";
|
|
3
3
|
import group_module from "./group.module.js";
|
|
4
|
-
const
|
|
4
|
+
const AdminGroup = ({ label, children, className })=>/*#__PURE__*/ jsxs("fieldset", {
|
|
5
5
|
className: classnames('byline-admin-group', group_module.group, className),
|
|
6
6
|
children: [
|
|
7
7
|
label && /*#__PURE__*/ jsx("legend", {
|
|
@@ -11,4 +11,4 @@ const Group = ({ label, children, className })=>/*#__PURE__*/ jsxs("fieldset", {
|
|
|
11
11
|
children
|
|
12
12
|
]
|
|
13
13
|
});
|
|
14
|
-
export {
|
|
14
|
+
export { AdminGroup };
|
package/dist/admin/row.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* Copyright (c) Infonomic Company Limited
|
|
7
7
|
*/
|
|
8
8
|
import type { ReactNode } from 'react';
|
|
9
|
-
interface
|
|
9
|
+
interface AdminRowProps {
|
|
10
10
|
children: ReactNode;
|
|
11
11
|
className?: string;
|
|
12
12
|
}
|
|
@@ -21,5 +21,5 @@ interface RowProps {
|
|
|
21
21
|
* The element carries `.byline-admin-row` as a stable global class for
|
|
22
22
|
* host overrides (alongside the hashed CSS-modules local).
|
|
23
23
|
*/
|
|
24
|
-
export declare const
|
|
24
|
+
export declare const AdminRow: ({ children, className }: AdminRowProps) => import("react").JSX.Element;
|
|
25
25
|
export {};
|
package/dist/admin/row.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import classnames from "classnames";
|
|
3
3
|
import row_module from "./row.module.js";
|
|
4
|
-
const
|
|
4
|
+
const AdminRow = ({ children, className })=>/*#__PURE__*/ jsx("div", {
|
|
5
5
|
className: classnames('byline-admin-row', row_module.row, className),
|
|
6
6
|
children: children
|
|
7
7
|
});
|
|
8
|
-
export {
|
|
8
|
+
export { AdminRow };
|
package/dist/admin/tabs.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export interface
|
|
1
|
+
export interface AdminTabItem {
|
|
2
2
|
name: string;
|
|
3
3
|
label: string;
|
|
4
4
|
}
|
|
5
|
-
interface
|
|
6
|
-
tabs:
|
|
5
|
+
interface AdminTabsProps {
|
|
6
|
+
tabs: AdminTabItem[];
|
|
7
7
|
activeTab: string;
|
|
8
8
|
onChange: (name: string) => void;
|
|
9
9
|
/** Error counts keyed by tab name — shows a danger badge when > 0. */
|
|
@@ -21,5 +21,5 @@ interface TabsProps {
|
|
|
21
21
|
* `.byline-admin-tab-active`, `.byline-admin-tab-label`,
|
|
22
22
|
* `.byline-admin-tab-badge`.
|
|
23
23
|
*/
|
|
24
|
-
export declare const
|
|
24
|
+
export declare const AdminTabs: ({ tabs, activeTab, onChange, errorCounts, className }: AdminTabsProps) => import("react").JSX.Element;
|
|
25
25
|
export {};
|
package/dist/admin/tabs.js
CHANGED
|
@@ -3,7 +3,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import classnames from "classnames";
|
|
4
4
|
import { Badge } from "../uikit.js";
|
|
5
5
|
import tabs_module from "./tabs.module.js";
|
|
6
|
-
const
|
|
6
|
+
const AdminTabs = ({ tabs, activeTab, onChange, errorCounts, className })=>/*#__PURE__*/ jsx("div", {
|
|
7
7
|
role: "tablist",
|
|
8
8
|
"aria-label": "Form tabs",
|
|
9
9
|
className: classnames('byline-admin-tabs', tabs_module.tabs, className),
|
|
@@ -32,4 +32,4 @@ const Tabs = ({ tabs, activeTab, onChange, errorCounts, className })=>/*#__PURE_
|
|
|
32
32
|
}, tab.name);
|
|
33
33
|
})
|
|
34
34
|
});
|
|
35
|
-
export {
|
|
35
|
+
export { AdminTabs };
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
4
4
|
import classnames from "classnames";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { AdminGroup } from "../admin/group.js";
|
|
6
|
+
import { AdminRow } from "../admin/row.js";
|
|
7
|
+
import { AdminTabs } from "../admin/tabs.js";
|
|
8
8
|
import { FieldRenderer } from "../fields/field-renderer.js";
|
|
9
9
|
import { LocalDateTime } from "../fields/local-date-time.js";
|
|
10
10
|
import { useBylineFieldServices } from "../services/field-services-context.js";
|
|
@@ -337,10 +337,10 @@ const FormContent = ({ mode, fields, onSubmit, onCancel, onStatusChange, onUnpub
|
|
|
337
337
|
if (row) return renderRow(row);
|
|
338
338
|
return renderField(name);
|
|
339
339
|
};
|
|
340
|
-
const renderRow = (row)=>/*#__PURE__*/ jsx(
|
|
340
|
+
const renderRow = (row)=>/*#__PURE__*/ jsx(AdminRow, {
|
|
341
341
|
children: row.fields.map((name)=>renderField(name))
|
|
342
342
|
}, `row:${row.name}`);
|
|
343
|
-
const renderGroup = (group)=>/*#__PURE__*/ jsx(
|
|
343
|
+
const renderGroup = (group)=>/*#__PURE__*/ jsx(AdminGroup, {
|
|
344
344
|
label: group.label,
|
|
345
345
|
children: group.fields.map((name)=>renderItem(name))
|
|
346
346
|
}, `group:${group.name}`);
|
|
@@ -352,7 +352,7 @@ const FormContent = ({ mode, fields, onSubmit, onCancel, onStatusChange, onUnpub
|
|
|
352
352
|
return /*#__PURE__*/ jsxs("div", {
|
|
353
353
|
className: classnames('byline-form-tabset', form_renderer_module.tabset),
|
|
354
354
|
children: [
|
|
355
|
-
visibleTabs.length > 0 && /*#__PURE__*/ jsx(
|
|
355
|
+
visibleTabs.length > 0 && /*#__PURE__*/ jsx(AdminTabs, {
|
|
356
356
|
tabs: visibleTabs,
|
|
357
357
|
activeTab: resolvedActive,
|
|
358
358
|
onChange: (tabName)=>handleTabChange(set.name, tabName),
|
package/dist/react.d.ts
CHANGED
|
@@ -1,6 +1,70 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* NOTE: We put a .js ending on imports here to satisfy
|
|
3
|
-
* TS / dist output
|
|
3
|
+
* TS / dist output.
|
|
4
|
+
*
|
|
5
|
+
* Single unified entry point for `@byline/ui`. Everything React-side
|
|
6
|
+
* exports through this barrel — uikit foundations, drag-and-drop
|
|
7
|
+
* helpers, the admin module surface, field widgets, form runtime, and
|
|
8
|
+
* the framework-neutral service contracts.
|
|
9
|
+
*
|
|
10
|
+
* Why one barrel: previous releases split this into per-area subpath
|
|
11
|
+
* exports (`./react/admin`, `./react/fields`, `./react/forms`,
|
|
12
|
+
* `./react/services`). Bundlers that pre-bundle subpaths individually
|
|
13
|
+
* (e.g. Vite's `optimizeDeps.include`) would inline a private copy of
|
|
14
|
+
* the React Contexts in `services/*` per subpath — provider mounted on
|
|
15
|
+
* one Context identity, hooks reading another. Collapsing to a single
|
|
16
|
+
* specifier eliminates the trap structurally. Tree-shaking inside the
|
|
17
|
+
* single ESM bundle handles unused exports for public-site consumers
|
|
18
|
+
* (sideEffects is set to CSS only).
|
|
4
19
|
*/
|
|
5
|
-
export * from './
|
|
20
|
+
export * from './admin/components/admin-account/change-password.js';
|
|
21
|
+
export * from './admin/components/admin-account/container.js';
|
|
22
|
+
export * from './admin/components/admin-account/update.js';
|
|
23
|
+
export * from './admin/components/admin-permissions/inspector.js';
|
|
24
|
+
export * from './admin/components/admin-roles/create.js';
|
|
25
|
+
export * from './admin/components/admin-roles/permissions.js';
|
|
26
|
+
export * from './admin/components/admin-roles/update.js';
|
|
27
|
+
export * from './admin/components/admin-users/create.js';
|
|
28
|
+
export * from './admin/components/admin-users/roles.js';
|
|
29
|
+
export * from './admin/components/admin-users/set-password.js';
|
|
30
|
+
export * from './admin/components/admin-users/update.js';
|
|
31
|
+
export * from './admin/components/auth/sign-in-form.js';
|
|
32
|
+
export * from './admin/components/collections/diff-modal.js';
|
|
33
|
+
export * from './admin/components/collections/status-badge.js';
|
|
34
|
+
export * from './admin/group.js';
|
|
35
|
+
export * from './admin/row.js';
|
|
36
|
+
export * from './admin/tabs.js';
|
|
6
37
|
export * from './dnd/draggable-sortable/index.js';
|
|
38
|
+
export * from './fields/array/array-field.js';
|
|
39
|
+
export * from './fields/blocks/blocks-field.js';
|
|
40
|
+
export * from './fields/checkbox/checkbox-field.js';
|
|
41
|
+
export * from './fields/column-formatter.js';
|
|
42
|
+
export * from './fields/date-time-formatter.js';
|
|
43
|
+
export * from './fields/datetime/datetime-field.js';
|
|
44
|
+
export * from './fields/draggable-context-menu.js';
|
|
45
|
+
export * from './fields/field-helpers.js';
|
|
46
|
+
export * from './fields/field-renderer.js';
|
|
47
|
+
export * from './fields/file/file-field.js';
|
|
48
|
+
export * from './fields/group/group-field.js';
|
|
49
|
+
export * from './fields/image/image-field.js';
|
|
50
|
+
export * from './fields/image/image-upload-field.js';
|
|
51
|
+
export * from './fields/local-date-time.js';
|
|
52
|
+
export * from './fields/locale-badge.js';
|
|
53
|
+
export * from './fields/numerical/numerical-field.js';
|
|
54
|
+
export * from './fields/relation/relation-field.js';
|
|
55
|
+
export * from './fields/relation/relation-picker.js';
|
|
56
|
+
export * from './fields/select/select-field.js';
|
|
57
|
+
export * from './fields/sortable-item.js';
|
|
58
|
+
export * from './fields/text/text-field.js';
|
|
59
|
+
export * from './fields/text-area/text-area-field.js';
|
|
60
|
+
export * from './fields/use-field-change-handler.js';
|
|
61
|
+
export * from './forms/document-actions.js';
|
|
62
|
+
export * from './forms/form-context.js';
|
|
63
|
+
export * from './forms/form-renderer.js';
|
|
64
|
+
export * from './forms/navigation-guard.js';
|
|
65
|
+
export * from './forms/path-widget.js';
|
|
66
|
+
export * from './services/admin-services-context.js';
|
|
67
|
+
export * from './services/field-services-context.js';
|
|
68
|
+
export * from './uikit.js';
|
|
69
|
+
export type { AdminServiceCall, BylineAdminServices, ChangeAccountPasswordInput, CreateAdminRoleInput, CreateAdminUserInput, SetAdminUserPasswordInput, SetRoleAbilitiesInput, SetUserRolesInput, SignInInput, SignInResult, UpdateAccountInput, UpdateAdminRoleInput, UpdateAdminUserInput, WhoHasAbilityInput, } from './services/admin-services-types.js';
|
|
70
|
+
export type { BylineFieldServices, CollectionListDoc, CollectionListParams, CollectionListResponse, GetCollectionDocumentsFn, UploadedFileResult, UploadFieldFn, } from './services/field-services-types.js';
|
package/dist/react.js
CHANGED
|
@@ -1,2 +1,49 @@
|
|
|
1
|
-
export * from "./
|
|
1
|
+
export * from "./admin/components/admin-account/change-password.js";
|
|
2
|
+
export * from "./admin/components/admin-account/container.js";
|
|
3
|
+
export * from "./admin/components/admin-account/update.js";
|
|
4
|
+
export * from "./admin/components/admin-permissions/inspector.js";
|
|
5
|
+
export * from "./admin/components/admin-roles/create.js";
|
|
6
|
+
export * from "./admin/components/admin-roles/permissions.js";
|
|
7
|
+
export * from "./admin/components/admin-roles/update.js";
|
|
8
|
+
export * from "./admin/components/admin-users/create.js";
|
|
9
|
+
export * from "./admin/components/admin-users/roles.js";
|
|
10
|
+
export * from "./admin/components/admin-users/set-password.js";
|
|
11
|
+
export * from "./admin/components/admin-users/update.js";
|
|
12
|
+
export * from "./admin/components/auth/sign-in-form.js";
|
|
13
|
+
export * from "./admin/components/collections/diff-modal.js";
|
|
14
|
+
export * from "./admin/components/collections/status-badge.js";
|
|
15
|
+
export * from "./admin/group.js";
|
|
16
|
+
export * from "./admin/row.js";
|
|
17
|
+
export * from "./admin/tabs.js";
|
|
2
18
|
export * from "./dnd/draggable-sortable/index.js";
|
|
19
|
+
export * from "./fields/array/array-field.js";
|
|
20
|
+
export * from "./fields/blocks/blocks-field.js";
|
|
21
|
+
export * from "./fields/checkbox/checkbox-field.js";
|
|
22
|
+
export * from "./fields/column-formatter.js";
|
|
23
|
+
export * from "./fields/date-time-formatter.js";
|
|
24
|
+
export * from "./fields/datetime/datetime-field.js";
|
|
25
|
+
export * from "./fields/draggable-context-menu.js";
|
|
26
|
+
export * from "./fields/field-helpers.js";
|
|
27
|
+
export * from "./fields/field-renderer.js";
|
|
28
|
+
export * from "./fields/file/file-field.js";
|
|
29
|
+
export * from "./fields/group/group-field.js";
|
|
30
|
+
export * from "./fields/image/image-field.js";
|
|
31
|
+
export * from "./fields/image/image-upload-field.js";
|
|
32
|
+
export * from "./fields/local-date-time.js";
|
|
33
|
+
export * from "./fields/locale-badge.js";
|
|
34
|
+
export * from "./fields/numerical/numerical-field.js";
|
|
35
|
+
export * from "./fields/relation/relation-field.js";
|
|
36
|
+
export * from "./fields/relation/relation-picker.js";
|
|
37
|
+
export * from "./fields/select/select-field.js";
|
|
38
|
+
export * from "./fields/sortable-item.js";
|
|
39
|
+
export * from "./fields/text/text-field.js";
|
|
40
|
+
export * from "./fields/text-area/text-area-field.js";
|
|
41
|
+
export * from "./fields/use-field-change-handler.js";
|
|
42
|
+
export * from "./forms/document-actions.js";
|
|
43
|
+
export * from "./forms/form-context.js";
|
|
44
|
+
export * from "./forms/form-renderer.js";
|
|
45
|
+
export * from "./forms/navigation-guard.js";
|
|
46
|
+
export * from "./forms/path-widget.js";
|
|
47
|
+
export * from "./services/admin-services-context.js";
|
|
48
|
+
export * from "./services/field-services-context.js";
|
|
49
|
+
export * from "./uikit.js";
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"private": false,
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MPL-2.0",
|
|
6
|
-
"version": "1.
|
|
6
|
+
"version": "1.2.0",
|
|
7
7
|
"engines": {
|
|
8
8
|
"node": ">=20.9.0"
|
|
9
9
|
},
|
|
@@ -25,46 +25,17 @@
|
|
|
25
25
|
"sideEffects": [
|
|
26
26
|
"**/*.css"
|
|
27
27
|
],
|
|
28
|
-
"types": "./dist/react.d.ts",
|
|
29
|
-
"module": "./dist/react.js",
|
|
30
|
-
"main": "./dist/react.js",
|
|
31
28
|
"files": [
|
|
32
29
|
"dist/",
|
|
33
30
|
"src/"
|
|
34
31
|
],
|
|
35
32
|
"exports": {
|
|
36
|
-
".": {
|
|
37
|
-
"types": "./dist/react.d.ts",
|
|
38
|
-
"import": "./dist/react.js",
|
|
39
|
-
"main": "./dist/react.js",
|
|
40
|
-
"default": "./dist/react.js"
|
|
41
|
-
},
|
|
42
33
|
"./react": {
|
|
43
34
|
"types": "./dist/react.d.ts",
|
|
44
35
|
"import": "./dist/react.js",
|
|
45
36
|
"main": "./dist/react.js",
|
|
46
37
|
"default": "./dist/react.js"
|
|
47
38
|
},
|
|
48
|
-
"./react/admin": {
|
|
49
|
-
"types": "./dist/admin.d.ts",
|
|
50
|
-
"import": "./dist/admin.js",
|
|
51
|
-
"default": "./dist/admin.js"
|
|
52
|
-
},
|
|
53
|
-
"./react/fields": {
|
|
54
|
-
"types": "./dist/fields.d.ts",
|
|
55
|
-
"import": "./dist/fields.js",
|
|
56
|
-
"default": "./dist/fields.js"
|
|
57
|
-
},
|
|
58
|
-
"./react/forms": {
|
|
59
|
-
"types": "./dist/forms.d.ts",
|
|
60
|
-
"import": "./dist/forms.js",
|
|
61
|
-
"default": "./dist/forms.js"
|
|
62
|
-
},
|
|
63
|
-
"./react/services": {
|
|
64
|
-
"types": "./dist/services.d.ts",
|
|
65
|
-
"import": "./dist/services.js",
|
|
66
|
-
"default": "./dist/services.js"
|
|
67
|
-
},
|
|
68
39
|
"./reset.css": {
|
|
69
40
|
"import": "./dist/styles/reset.css",
|
|
70
41
|
"default": "./dist/styles/reset.css"
|
|
@@ -94,9 +65,9 @@
|
|
|
94
65
|
"react-diff-viewer-continued": "^4.2.2",
|
|
95
66
|
"zod": "^4.4.2",
|
|
96
67
|
"zod-form-data": "^3.0.1",
|
|
97
|
-
"@byline/
|
|
98
|
-
"@byline/
|
|
99
|
-
"@byline/
|
|
68
|
+
"@byline/client": "1.2.0",
|
|
69
|
+
"@byline/core": "1.2.0",
|
|
70
|
+
"@byline/admin": "1.2.0"
|
|
100
71
|
},
|
|
101
72
|
"peerDependencies": {
|
|
102
73
|
"react": "^19.0.0",
|
package/src/admin/group.tsx
CHANGED
|
@@ -12,7 +12,7 @@ import cx from 'classnames'
|
|
|
12
12
|
|
|
13
13
|
import styles from './group.module.css'
|
|
14
14
|
|
|
15
|
-
interface
|
|
15
|
+
interface AdminGroupProps {
|
|
16
16
|
/** Optional heading rendered as a `<legend>` above the cluster. */
|
|
17
17
|
label?: string
|
|
18
18
|
children: ReactNode
|
|
@@ -30,7 +30,7 @@ interface GroupProps {
|
|
|
30
30
|
* `.byline-admin-group-legend` on the legend (alongside the hashed
|
|
31
31
|
* CSS-modules locals).
|
|
32
32
|
*/
|
|
33
|
-
export const
|
|
33
|
+
export const AdminGroup = ({ label, children, className }: AdminGroupProps) => {
|
|
34
34
|
return (
|
|
35
35
|
<fieldset className={cx('byline-admin-group', styles.group, className)}>
|
|
36
36
|
{label && <legend className={cx('byline-admin-group-legend', styles.legend)}>{label}</legend>}
|
package/src/admin/row.tsx
CHANGED
|
@@ -12,7 +12,7 @@ import cx from 'classnames'
|
|
|
12
12
|
|
|
13
13
|
import styles from './row.module.css'
|
|
14
14
|
|
|
15
|
-
interface
|
|
15
|
+
interface AdminRowProps {
|
|
16
16
|
children: ReactNode
|
|
17
17
|
className?: string
|
|
18
18
|
}
|
|
@@ -28,6 +28,6 @@ interface RowProps {
|
|
|
28
28
|
* The element carries `.byline-admin-row` as a stable global class for
|
|
29
29
|
* host overrides (alongside the hashed CSS-modules local).
|
|
30
30
|
*/
|
|
31
|
-
export const
|
|
31
|
+
export const AdminRow = ({ children, className }: AdminRowProps) => {
|
|
32
32
|
return <div className={cx('byline-admin-row', styles.row, className)}>{children}</div>
|
|
33
33
|
}
|
package/src/admin/tabs.tsx
CHANGED
|
@@ -13,13 +13,13 @@ import cx from 'classnames'
|
|
|
13
13
|
import { Badge } from '../uikit.js'
|
|
14
14
|
import styles from './tabs.module.css'
|
|
15
15
|
|
|
16
|
-
export interface
|
|
16
|
+
export interface AdminTabItem {
|
|
17
17
|
name: string
|
|
18
18
|
label: string
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
interface
|
|
22
|
-
tabs:
|
|
21
|
+
interface AdminTabsProps {
|
|
22
|
+
tabs: AdminTabItem[]
|
|
23
23
|
activeTab: string
|
|
24
24
|
onChange: (name: string) => void
|
|
25
25
|
/** Error counts keyed by tab name — shows a danger badge when > 0. */
|
|
@@ -38,7 +38,7 @@ interface TabsProps {
|
|
|
38
38
|
* `.byline-admin-tab-active`, `.byline-admin-tab-label`,
|
|
39
39
|
* `.byline-admin-tab-badge`.
|
|
40
40
|
*/
|
|
41
|
-
export const
|
|
41
|
+
export const AdminTabs = ({ tabs, activeTab, onChange, errorCounts, className }: AdminTabsProps) => {
|
|
42
42
|
return (
|
|
43
43
|
<div
|
|
44
44
|
role="tablist"
|
|
@@ -20,9 +20,9 @@ import type {
|
|
|
20
20
|
} from '@byline/core'
|
|
21
21
|
import cx from 'classnames'
|
|
22
22
|
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
23
|
+
import { AdminGroup } from '../admin/group'
|
|
24
|
+
import { AdminRow } from '../admin/row'
|
|
25
|
+
import { AdminTabs } from '../admin/tabs'
|
|
26
26
|
import { FieldRenderer } from '../fields/field-renderer'
|
|
27
27
|
import { LocalDateTime } from '../fields/local-date-time'
|
|
28
28
|
import { useBylineFieldServices } from '../services/field-services-context'
|
|
@@ -558,13 +558,13 @@ const FormContent = ({
|
|
|
558
558
|
}
|
|
559
559
|
|
|
560
560
|
const renderRow = (row: RowDefinition): ReactNode => (
|
|
561
|
-
<
|
|
561
|
+
<AdminRow key={`row:${row.name}`}>{row.fields.map((name) => renderField(name))}</AdminRow>
|
|
562
562
|
)
|
|
563
563
|
|
|
564
564
|
const renderGroup = (group: GroupDefinition): ReactNode => (
|
|
565
|
-
<
|
|
565
|
+
<AdminGroup key={`group:${group.name}`} label={group.label}>
|
|
566
566
|
{group.fields.map((name) => renderItem(name))}
|
|
567
|
-
</
|
|
567
|
+
</AdminGroup>
|
|
568
568
|
)
|
|
569
569
|
|
|
570
570
|
const renderTabSet = (set: TabSetDefinition): ReactNode => {
|
|
@@ -579,7 +579,7 @@ const FormContent = ({
|
|
|
579
579
|
return (
|
|
580
580
|
<div key={`tabset:${set.name}`} className={cx('byline-form-tabset', styles.tabset)}>
|
|
581
581
|
{visibleTabs.length > 0 && (
|
|
582
|
-
<
|
|
582
|
+
<AdminTabs
|
|
583
583
|
tabs={visibleTabs}
|
|
584
584
|
activeTab={resolvedActive}
|
|
585
585
|
onChange={(tabName) => handleTabChange(set.name, tabName)}
|
|
@@ -13,7 +13,7 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
|
|
|
13
13
|
|
|
14
14
|
// Lightweight uikit stubs — we don't care about the visual rendering, only
|
|
15
15
|
// that the Input forwards props and the Label renders its htmlFor.
|
|
16
|
-
vi.mock('@byline/ui', () => ({
|
|
16
|
+
vi.mock('@byline/ui/react', () => ({
|
|
17
17
|
Label: ({ id, htmlFor, label }: { id?: string; htmlFor?: string; label?: string }) => (
|
|
18
18
|
<label id={id} htmlFor={htmlFor}>
|
|
19
19
|
{label}
|
package/src/react.ts
CHANGED
|
@@ -1,17 +1,101 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* NOTE: We put a .js ending on imports here to satisfy
|
|
3
|
-
* TS / dist output
|
|
3
|
+
* TS / dist output.
|
|
4
|
+
*
|
|
5
|
+
* Single unified entry point for `@byline/ui`. Everything React-side
|
|
6
|
+
* exports through this barrel — uikit foundations, drag-and-drop
|
|
7
|
+
* helpers, the admin module surface, field widgets, form runtime, and
|
|
8
|
+
* the framework-neutral service contracts.
|
|
9
|
+
*
|
|
10
|
+
* Why one barrel: previous releases split this into per-area subpath
|
|
11
|
+
* exports (`./react/admin`, `./react/fields`, `./react/forms`,
|
|
12
|
+
* `./react/services`). Bundlers that pre-bundle subpaths individually
|
|
13
|
+
* (e.g. Vite's `optimizeDeps.include`) would inline a private copy of
|
|
14
|
+
* the React Contexts in `services/*` per subpath — provider mounted on
|
|
15
|
+
* one Context identity, hooks reading another. Collapsing to a single
|
|
16
|
+
* specifier eliminates the trap structurally. Tree-shaking inside the
|
|
17
|
+
* single ESM bundle handles unused exports for public-site consumers
|
|
18
|
+
* (sideEffects is set to CSS only).
|
|
4
19
|
*/
|
|
5
20
|
|
|
21
|
+
// Admin module components + admin services context.
|
|
22
|
+
export * from './admin/components/admin-account/change-password.js'
|
|
23
|
+
export * from './admin/components/admin-account/container.js'
|
|
24
|
+
export * from './admin/components/admin-account/update.js'
|
|
25
|
+
export * from './admin/components/admin-permissions/inspector.js'
|
|
26
|
+
export * from './admin/components/admin-roles/create.js'
|
|
27
|
+
export * from './admin/components/admin-roles/permissions.js'
|
|
28
|
+
export * from './admin/components/admin-roles/update.js'
|
|
29
|
+
export * from './admin/components/admin-users/create.js'
|
|
30
|
+
export * from './admin/components/admin-users/roles.js'
|
|
31
|
+
export * from './admin/components/admin-users/set-password.js'
|
|
32
|
+
export * from './admin/components/admin-users/update.js'
|
|
33
|
+
export * from './admin/components/auth/sign-in-form.js'
|
|
34
|
+
export * from './admin/components/collections/diff-modal.js'
|
|
35
|
+
export * from './admin/components/collections/status-badge.js'
|
|
36
|
+
export * from './admin/group.js'
|
|
37
|
+
export * from './admin/row.js'
|
|
38
|
+
export * from './admin/tabs.js'
|
|
39
|
+
// Drag-and-drop helpers.
|
|
40
|
+
export * from './dnd/draggable-sortable/index.js'
|
|
41
|
+
// Field widgets.
|
|
42
|
+
export * from './fields/array/array-field.js'
|
|
43
|
+
export * from './fields/blocks/blocks-field.js'
|
|
44
|
+
export * from './fields/checkbox/checkbox-field.js'
|
|
45
|
+
export * from './fields/column-formatter.js'
|
|
46
|
+
export * from './fields/date-time-formatter.js'
|
|
47
|
+
export * from './fields/datetime/datetime-field.js'
|
|
48
|
+
export * from './fields/draggable-context-menu.js'
|
|
49
|
+
export * from './fields/field-helpers.js'
|
|
50
|
+
export * from './fields/field-renderer.js'
|
|
51
|
+
export * from './fields/file/file-field.js'
|
|
52
|
+
export * from './fields/group/group-field.js'
|
|
53
|
+
export * from './fields/image/image-field.js'
|
|
54
|
+
export * from './fields/image/image-upload-field.js'
|
|
55
|
+
export * from './fields/local-date-time.js'
|
|
56
|
+
export * from './fields/locale-badge.js'
|
|
57
|
+
export * from './fields/numerical/numerical-field.js'
|
|
58
|
+
export * from './fields/relation/relation-field.js'
|
|
59
|
+
export * from './fields/relation/relation-picker.js'
|
|
60
|
+
export * from './fields/select/select-field.js'
|
|
61
|
+
export * from './fields/sortable-item.js'
|
|
62
|
+
export * from './fields/text/text-field.js'
|
|
63
|
+
export * from './fields/text-area/text-area-field.js'
|
|
64
|
+
export * from './fields/use-field-change-handler.js'
|
|
65
|
+
// Form runtime.
|
|
66
|
+
export * from './forms/document-actions.js'
|
|
67
|
+
export * from './forms/form-context.js'
|
|
68
|
+
export * from './forms/form-renderer.js'
|
|
69
|
+
export * from './forms/navigation-guard.js'
|
|
70
|
+
export * from './forms/path-widget.js'
|
|
71
|
+
export * from './services/admin-services-context.js'
|
|
72
|
+
// Field-side service contract types + Context provider/hook.
|
|
73
|
+
export * from './services/field-services-context.js'
|
|
6
74
|
// Foundational surface — synced from @infonomic/uikit. See
|
|
7
75
|
// scripts/sync-from-uikit.sh and src/.uikit-sync.json.
|
|
8
76
|
export * from './uikit.js'
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
77
|
+
export type {
|
|
78
|
+
AdminServiceCall,
|
|
79
|
+
BylineAdminServices,
|
|
80
|
+
ChangeAccountPasswordInput,
|
|
81
|
+
CreateAdminRoleInput,
|
|
82
|
+
CreateAdminUserInput,
|
|
83
|
+
SetAdminUserPasswordInput,
|
|
84
|
+
SetRoleAbilitiesInput,
|
|
85
|
+
SetUserRolesInput,
|
|
86
|
+
SignInInput,
|
|
87
|
+
SignInResult,
|
|
88
|
+
UpdateAccountInput,
|
|
89
|
+
UpdateAdminRoleInput,
|
|
90
|
+
UpdateAdminUserInput,
|
|
91
|
+
WhoHasAbilityInput,
|
|
92
|
+
} from './services/admin-services-types.js'
|
|
93
|
+
export type {
|
|
94
|
+
BylineFieldServices,
|
|
95
|
+
CollectionListDoc,
|
|
96
|
+
CollectionListParams,
|
|
97
|
+
CollectionListResponse,
|
|
98
|
+
GetCollectionDocumentsFn,
|
|
99
|
+
UploadedFileResult,
|
|
100
|
+
UploadFieldFn,
|
|
101
|
+
} from './services/field-services-types.js'
|
package/dist/admin.d.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* NOTE: We put a .js ending on imports here to satisfy
|
|
3
|
-
* TS / dist output
|
|
4
|
-
*/
|
|
5
|
-
export * from './admin/components/admin-account/change-password.js';
|
|
6
|
-
export * from './admin/components/admin-account/container.js';
|
|
7
|
-
export * from './admin/components/admin-account/update.js';
|
|
8
|
-
export * from './admin/components/admin-permissions/inspector.js';
|
|
9
|
-
export * from './admin/components/admin-roles/create.js';
|
|
10
|
-
export * from './admin/components/admin-roles/permissions.js';
|
|
11
|
-
export * from './admin/components/admin-roles/update.js';
|
|
12
|
-
export * from './admin/components/admin-users/create.js';
|
|
13
|
-
export * from './admin/components/admin-users/roles.js';
|
|
14
|
-
export * from './admin/components/admin-users/set-password.js';
|
|
15
|
-
export * from './admin/components/admin-users/update.js';
|
|
16
|
-
export * from './admin/components/auth/sign-in-form.js';
|
|
17
|
-
export * from './admin/components/collections/diff-modal.js';
|
|
18
|
-
export * from './admin/components/collections/status-badge.js';
|
|
19
|
-
export * from './admin/group.js';
|
|
20
|
-
export * from './admin/row.js';
|
|
21
|
-
export * from './admin/tabs.js';
|
|
22
|
-
export * from './services/admin-services-context.js';
|
|
23
|
-
export type { AdminServiceCall, BylineAdminServices, ChangeAccountPasswordInput, CreateAdminRoleInput, CreateAdminUserInput, SetAdminUserPasswordInput, SetRoleAbilitiesInput, SetUserRolesInput, SignInInput, SignInResult, UpdateAccountInput, UpdateAdminRoleInput, UpdateAdminUserInput, WhoHasAbilityInput, } from './services/admin-services-types.js';
|
package/dist/admin.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export * from "./admin/components/admin-account/change-password.js";
|
|
2
|
-
export * from "./admin/components/admin-account/container.js";
|
|
3
|
-
export * from "./admin/components/admin-account/update.js";
|
|
4
|
-
export * from "./admin/components/admin-permissions/inspector.js";
|
|
5
|
-
export * from "./admin/components/admin-roles/create.js";
|
|
6
|
-
export * from "./admin/components/admin-roles/permissions.js";
|
|
7
|
-
export * from "./admin/components/admin-roles/update.js";
|
|
8
|
-
export * from "./admin/components/admin-users/create.js";
|
|
9
|
-
export * from "./admin/components/admin-users/roles.js";
|
|
10
|
-
export * from "./admin/components/admin-users/set-password.js";
|
|
11
|
-
export * from "./admin/components/admin-users/update.js";
|
|
12
|
-
export * from "./admin/components/auth/sign-in-form.js";
|
|
13
|
-
export * from "./admin/components/collections/diff-modal.js";
|
|
14
|
-
export * from "./admin/components/collections/status-badge.js";
|
|
15
|
-
export * from "./admin/group.js";
|
|
16
|
-
export * from "./admin/row.js";
|
|
17
|
-
export * from "./admin/tabs.js";
|
|
18
|
-
export * from "./services/admin-services-context.js";
|
package/dist/fields.d.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* NOTE: We put a .js ending on imports here to satisfy
|
|
3
|
-
* TS / dist output
|
|
4
|
-
*/
|
|
5
|
-
export * from './fields/array/array-field.js';
|
|
6
|
-
export * from './fields/blocks/blocks-field.js';
|
|
7
|
-
export * from './fields/checkbox/checkbox-field.js';
|
|
8
|
-
export * from './fields/column-formatter.js';
|
|
9
|
-
export * from './fields/date-time-formatter.js';
|
|
10
|
-
export * from './fields/datetime/datetime-field.js';
|
|
11
|
-
export * from './fields/draggable-context-menu.js';
|
|
12
|
-
export * from './fields/field-helpers.js';
|
|
13
|
-
export * from './fields/field-renderer.js';
|
|
14
|
-
export * from './fields/file/file-field.js';
|
|
15
|
-
export * from './fields/group/group-field.js';
|
|
16
|
-
export * from './fields/image/image-field.js';
|
|
17
|
-
export * from './fields/image/image-upload-field.js';
|
|
18
|
-
export * from './fields/local-date-time.js';
|
|
19
|
-
export * from './fields/locale-badge.js';
|
|
20
|
-
export * from './fields/numerical/numerical-field.js';
|
|
21
|
-
export * from './fields/relation/relation-field.js';
|
|
22
|
-
export * from './fields/relation/relation-picker.js';
|
|
23
|
-
export * from './fields/select/select-field.js';
|
|
24
|
-
export * from './fields/sortable-item.js';
|
|
25
|
-
export * from './fields/text/text-field.js';
|
|
26
|
-
export * from './fields/text-area/text-area-field.js';
|
|
27
|
-
export * from './fields/use-field-change-handler.js';
|
package/dist/fields.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export * from "./fields/array/array-field.js";
|
|
2
|
-
export * from "./fields/blocks/blocks-field.js";
|
|
3
|
-
export * from "./fields/checkbox/checkbox-field.js";
|
|
4
|
-
export * from "./fields/column-formatter.js";
|
|
5
|
-
export * from "./fields/date-time-formatter.js";
|
|
6
|
-
export * from "./fields/datetime/datetime-field.js";
|
|
7
|
-
export * from "./fields/draggable-context-menu.js";
|
|
8
|
-
export * from "./fields/field-helpers.js";
|
|
9
|
-
export * from "./fields/field-renderer.js";
|
|
10
|
-
export * from "./fields/file/file-field.js";
|
|
11
|
-
export * from "./fields/group/group-field.js";
|
|
12
|
-
export * from "./fields/image/image-field.js";
|
|
13
|
-
export * from "./fields/image/image-upload-field.js";
|
|
14
|
-
export * from "./fields/local-date-time.js";
|
|
15
|
-
export * from "./fields/locale-badge.js";
|
|
16
|
-
export * from "./fields/numerical/numerical-field.js";
|
|
17
|
-
export * from "./fields/relation/relation-field.js";
|
|
18
|
-
export * from "./fields/relation/relation-picker.js";
|
|
19
|
-
export * from "./fields/select/select-field.js";
|
|
20
|
-
export * from "./fields/sortable-item.js";
|
|
21
|
-
export * from "./fields/text/text-field.js";
|
|
22
|
-
export * from "./fields/text-area/text-area-field.js";
|
|
23
|
-
export * from "./fields/use-field-change-handler.js";
|
package/dist/forms.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* NOTE: We put a .js ending on imports here to satisfy
|
|
3
|
-
* TS / dist output
|
|
4
|
-
*/
|
|
5
|
-
export * from './forms/document-actions.js';
|
|
6
|
-
export * from './forms/form-context.js';
|
|
7
|
-
export * from './forms/form-renderer.js';
|
|
8
|
-
export * from './forms/navigation-guard.js';
|
|
9
|
-
export * from './forms/path-widget.js';
|
package/dist/forms.js
DELETED
package/dist/services.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* NOTE: We put a .js ending on imports here to satisfy
|
|
3
|
-
* TS / dist output.
|
|
4
|
-
*
|
|
5
|
-
* Field-side services only. Admin services live under the `./admin`
|
|
6
|
-
* subpath export — see src/admin.ts.
|
|
7
|
-
*/
|
|
8
|
-
export * from './services/field-services-context.js';
|
|
9
|
-
export type { BylineFieldServices, CollectionListDoc, CollectionListParams, CollectionListResponse, GetCollectionDocumentsFn, UploadedFileResult, UploadFieldFn, } from './services/field-services-types.js';
|
package/dist/services.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./services/field-services-context.js";
|
package/src/admin.ts
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* NOTE: We put a .js ending on imports here to satisfy
|
|
3
|
-
* TS / dist output
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
export * from './admin/components/admin-account/change-password.js'
|
|
7
|
-
export * from './admin/components/admin-account/container.js'
|
|
8
|
-
export * from './admin/components/admin-account/update.js'
|
|
9
|
-
export * from './admin/components/admin-permissions/inspector.js'
|
|
10
|
-
export * from './admin/components/admin-roles/create.js'
|
|
11
|
-
export * from './admin/components/admin-roles/permissions.js'
|
|
12
|
-
export * from './admin/components/admin-roles/update.js'
|
|
13
|
-
export * from './admin/components/admin-users/create.js'
|
|
14
|
-
export * from './admin/components/admin-users/roles.js'
|
|
15
|
-
export * from './admin/components/admin-users/set-password.js'
|
|
16
|
-
export * from './admin/components/admin-users/update.js'
|
|
17
|
-
export * from './admin/components/auth/sign-in-form.js'
|
|
18
|
-
export * from './admin/components/collections/diff-modal.js'
|
|
19
|
-
export * from './admin/components/collections/status-badge.js'
|
|
20
|
-
export * from './admin/group.js'
|
|
21
|
-
export * from './admin/row.js'
|
|
22
|
-
export * from './admin/tabs.js'
|
|
23
|
-
export * from './services/admin-services-context.js'
|
|
24
|
-
export type {
|
|
25
|
-
AdminServiceCall,
|
|
26
|
-
BylineAdminServices,
|
|
27
|
-
ChangeAccountPasswordInput,
|
|
28
|
-
CreateAdminRoleInput,
|
|
29
|
-
CreateAdminUserInput,
|
|
30
|
-
SetAdminUserPasswordInput,
|
|
31
|
-
SetRoleAbilitiesInput,
|
|
32
|
-
SetUserRolesInput,
|
|
33
|
-
SignInInput,
|
|
34
|
-
SignInResult,
|
|
35
|
-
UpdateAccountInput,
|
|
36
|
-
UpdateAdminRoleInput,
|
|
37
|
-
UpdateAdminUserInput,
|
|
38
|
-
WhoHasAbilityInput,
|
|
39
|
-
} from './services/admin-services-types.js'
|
package/src/fields.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* NOTE: We put a .js ending on imports here to satisfy
|
|
3
|
-
* TS / dist output
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
export * from './fields/array/array-field.js'
|
|
7
|
-
export * from './fields/blocks/blocks-field.js'
|
|
8
|
-
export * from './fields/checkbox/checkbox-field.js'
|
|
9
|
-
export * from './fields/column-formatter.js'
|
|
10
|
-
export * from './fields/date-time-formatter.js'
|
|
11
|
-
export * from './fields/datetime/datetime-field.js'
|
|
12
|
-
export * from './fields/draggable-context-menu.js'
|
|
13
|
-
export * from './fields/field-helpers.js'
|
|
14
|
-
export * from './fields/field-renderer.js'
|
|
15
|
-
export * from './fields/file/file-field.js'
|
|
16
|
-
export * from './fields/group/group-field.js'
|
|
17
|
-
export * from './fields/image/image-field.js'
|
|
18
|
-
export * from './fields/image/image-upload-field.js'
|
|
19
|
-
export * from './fields/local-date-time.js'
|
|
20
|
-
export * from './fields/locale-badge.js'
|
|
21
|
-
export * from './fields/numerical/numerical-field.js'
|
|
22
|
-
export * from './fields/relation/relation-field.js'
|
|
23
|
-
export * from './fields/relation/relation-picker.js'
|
|
24
|
-
export * from './fields/select/select-field.js'
|
|
25
|
-
export * from './fields/sortable-item.js'
|
|
26
|
-
export * from './fields/text/text-field.js'
|
|
27
|
-
export * from './fields/text-area/text-area-field.js'
|
|
28
|
-
export * from './fields/use-field-change-handler.js'
|
package/src/forms.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* NOTE: We put a .js ending on imports here to satisfy
|
|
3
|
-
* TS / dist output
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
export * from './forms/document-actions.js'
|
|
7
|
-
export * from './forms/form-context.js'
|
|
8
|
-
export * from './forms/form-renderer.js'
|
|
9
|
-
export * from './forms/navigation-guard.js'
|
|
10
|
-
export * from './forms/path-widget.js'
|
package/src/services.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* NOTE: We put a .js ending on imports here to satisfy
|
|
3
|
-
* TS / dist output.
|
|
4
|
-
*
|
|
5
|
-
* Field-side services only. Admin services live under the `./admin`
|
|
6
|
-
* subpath export — see src/admin.ts.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
export * from './services/field-services-context.js'
|
|
10
|
-
export type {
|
|
11
|
-
BylineFieldServices,
|
|
12
|
-
CollectionListDoc,
|
|
13
|
-
CollectionListParams,
|
|
14
|
-
CollectionListResponse,
|
|
15
|
-
GetCollectionDocumentsFn,
|
|
16
|
-
UploadedFileResult,
|
|
17
|
-
UploadFieldFn,
|
|
18
|
-
} from './services/field-services-types.js'
|