@nixxie-cms/core 2.1.0 → 2.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/admin-ui/components/dist/nixxie-cms-core-admin-ui-components.cjs.js +7 -7
- package/admin-ui/components/dist/nixxie-cms-core-admin-ui-components.esm.js +7 -7
- package/admin-ui/context/dist/nixxie-cms-core-admin-ui-context.cjs.js +2 -2
- package/admin-ui/context/dist/nixxie-cms-core-admin-ui-context.esm.js +2 -2
- package/admin-ui/utils/dist/nixxie-cms-core-admin-ui-utils.cjs.js +5 -5
- package/admin-ui/utils/dist/nixxie-cms-core-admin-ui-utils.esm.js +3 -3
- package/dist/{CreateItemDialog-7008b050.esm.js → CreateItemDialog-66621fe8.esm.js} +3 -3
- package/dist/{CreateItemDialog-a0cab315.cjs.js → CreateItemDialog-96b044ce.cjs.js} +4 -4
- package/dist/{Field-47f85161.esm.js → Field-1820c4e6.esm.js} +1 -0
- package/dist/{Field-ed8d7627.cjs.js → Field-38d3cdf9.cjs.js} +1 -0
- package/dist/GraphQLErrorNotice-7594a9f8.esm.js +64 -0
- package/dist/GraphQLErrorNotice-c8890f80.cjs.js +66 -0
- package/dist/{PageContainer-5ae731cc.esm.js → PageContainer-355cfbfa.esm.js} +362 -156
- package/dist/{PageContainer-abd7159f.cjs.js → PageContainer-4095555a.cjs.js} +361 -155
- package/dist/{context-af9957ed.esm.js → context-2924eaaa.esm.js} +53 -58
- package/dist/{context-b5204629.cjs.js → context-2ce61d0b.cjs.js} +53 -58
- package/dist/declarations/src/admin-ui/components/GraphQLErrorNotice.d.ts.map +1 -1
- package/dist/declarations/src/admin-ui/components/Navigation.d.ts.map +1 -1
- package/dist/declarations/src/admin-ui/components/PageContainer.d.ts.map +1 -1
- package/dist/declarations/src/admin-ui/context.d.ts.map +1 -1
- package/dist/declarations/src/admin-ui/utils/useCreateItem.d.ts.map +1 -1
- package/dist/declarations/src/fields/types/bigInt/views/index.d.ts +2 -1
- package/dist/declarations/src/fields/types/bigInt/views/index.d.ts.map +1 -1
- package/dist/declarations/src/fields/types/bytes/views/index.d.ts +2 -1
- package/dist/declarations/src/fields/types/bytes/views/index.d.ts.map +1 -1
- package/dist/declarations/src/fields/types/calendarDay/views/index.d.ts.map +1 -1
- package/dist/declarations/src/fields/types/decimal/views/index.d.ts +2 -1
- package/dist/declarations/src/fields/types/decimal/views/index.d.ts.map +1 -1
- package/dist/declarations/src/fields/types/float/views/index.d.ts +2 -1
- package/dist/declarations/src/fields/types/float/views/index.d.ts.map +1 -1
- package/dist/declarations/src/fields/types/integer/views/index.d.ts +2 -1
- package/dist/declarations/src/fields/types/integer/views/index.d.ts.map +1 -1
- package/dist/declarations/src/fields/types/json/views/index.d.ts.map +1 -1
- package/dist/declarations/src/fields/types/multiselect/views/index.d.ts.map +1 -1
- package/dist/declarations/src/fields/types/relationship/views/index.d.ts.map +1 -1
- package/dist/declarations/src/fields/types/select/views/index.d.ts.map +1 -1
- package/dist/declarations/src/fields/types/text/views/index.d.ts +2 -1
- package/dist/declarations/src/fields/types/text/views/index.d.ts.map +1 -1
- package/dist/declarations/src/fields/types/timestamp/views/index.d.ts.map +1 -1
- package/dist/declarations/src/fields/types/virtual/views/index.d.ts.map +1 -1
- package/dist/declarations/src/internal-unstable/admin-ui/pages/HomePage/index.d.ts.map +1 -1
- package/dist/declarations/src/internal-unstable/admin-ui/pages/ItemPage/index.d.ts.map +1 -1
- package/dist/pick-4c785a54.esm.js +34 -0
- package/dist/pick-906341bb.cjs.js +37 -0
- package/dist/{useCreateItem-1f94d252.esm.js → useCreateItem-36a75f1c.esm.js} +26 -26
- package/dist/{useCreateItem-1be4987e.cjs.js → useCreateItem-acf06f77.cjs.js} +37 -37
- package/dist/{useFilter-acc9d413.cjs.js → useFilter-c29f17a8.cjs.js} +1 -1
- package/dist/{useFilter-9b6db1f9.esm.js → useFilter-f79b2abb.esm.js} +1 -1
- package/dist/{Fields-956d9a14.esm.js → usePreventNavigation-093389dd.esm.js} +28 -2
- package/dist/{Fields-e2c28056.cjs.js → usePreventNavigation-d4f9f4fa.cjs.js} +27 -0
- package/fields/types/bigInt/views/dist/nixxie-cms-core-fields-types-bigInt-views.cjs.js +8 -0
- package/fields/types/bigInt/views/dist/nixxie-cms-core-fields-types-bigInt-views.esm.js +8 -1
- package/fields/types/bytes/views/dist/nixxie-cms-core-fields-types-bytes-views.cjs.js +14 -3
- package/fields/types/bytes/views/dist/nixxie-cms-core-fields-types-bytes-views.esm.js +15 -5
- package/fields/types/calendarDay/views/dist/nixxie-cms-core-fields-types-calendarDay-views.cjs.js +2 -1
- package/fields/types/calendarDay/views/dist/nixxie-cms-core-fields-types-calendarDay-views.esm.js +2 -1
- package/fields/types/decimal/views/dist/nixxie-cms-core-fields-types-decimal-views.cjs.js +10 -1
- package/fields/types/decimal/views/dist/nixxie-cms-core-fields-types-decimal-views.esm.js +10 -2
- package/fields/types/file/views/dist/nixxie-cms-core-fields-types-file-views.cjs.js +1 -1
- package/fields/types/file/views/dist/nixxie-cms-core-fields-types-file-views.esm.js +2 -2
- package/fields/types/float/views/dist/nixxie-cms-core-fields-types-float-views.cjs.js +10 -1
- package/fields/types/float/views/dist/nixxie-cms-core-fields-types-float-views.esm.js +10 -2
- package/fields/types/image/views/dist/nixxie-cms-core-fields-types-image-views.cjs.js +2 -1
- package/fields/types/image/views/dist/nixxie-cms-core-fields-types-image-views.esm.js +2 -1
- package/fields/types/integer/views/dist/nixxie-cms-core-fields-types-integer-views.cjs.js +8 -0
- package/fields/types/integer/views/dist/nixxie-cms-core-fields-types-integer-views.esm.js +8 -1
- package/fields/types/json/views/dist/nixxie-cms-core-fields-types-json-views.cjs.js +19 -4
- package/fields/types/json/views/dist/nixxie-cms-core-fields-types-json-views.esm.js +19 -4
- package/fields/types/multiselect/views/dist/nixxie-cms-core-fields-types-multiselect-views.cjs.js +18 -3
- package/fields/types/multiselect/views/dist/nixxie-cms-core-fields-types-multiselect-views.esm.js +18 -3
- package/fields/types/password/views/dist/nixxie-cms-core-fields-types-password-views.cjs.js +1 -1
- package/fields/types/password/views/dist/nixxie-cms-core-fields-types-password-views.esm.js +1 -1
- package/fields/types/relationship/views/dist/nixxie-cms-core-fields-types-relationship-views.cjs.js +9 -7
- package/fields/types/relationship/views/dist/nixxie-cms-core-fields-types-relationship-views.esm.js +9 -7
- package/fields/types/select/views/dist/nixxie-cms-core-fields-types-select-views.cjs.js +3 -2
- package/fields/types/select/views/dist/nixxie-cms-core-fields-types-select-views.esm.js +3 -2
- package/fields/types/text/views/dist/nixxie-cms-core-fields-types-text-views.cjs.js +14 -3
- package/fields/types/text/views/dist/nixxie-cms-core-fields-types-text-views.esm.js +15 -5
- package/fields/types/timestamp/views/dist/nixxie-cms-core-fields-types-timestamp-views.cjs.js +2 -1
- package/fields/types/timestamp/views/dist/nixxie-cms-core-fields-types-timestamp-views.esm.js +2 -1
- package/fields/types/virtual/views/dist/nixxie-cms-core-fields-types-virtual-views.cjs.js +13 -1
- package/fields/types/virtual/views/dist/nixxie-cms-core-fields-types-virtual-views.esm.js +14 -2
- package/internal-unstable/admin-ui/pages/App/dist/nixxie-cms-core-internal-unstable-admin-ui-pages-App.cjs.js +3 -3
- package/internal-unstable/admin-ui/pages/App/dist/nixxie-cms-core-internal-unstable-admin-ui-pages-App.esm.js +3 -3
- package/internal-unstable/admin-ui/pages/CreateItemPage/dist/nixxie-cms-core-internal-unstable-admin-ui-pages-CreateItemPage.cjs.js +7 -7
- package/internal-unstable/admin-ui/pages/CreateItemPage/dist/nixxie-cms-core-internal-unstable-admin-ui-pages-CreateItemPage.esm.js +6 -6
- package/internal-unstable/admin-ui/pages/HomePage/dist/nixxie-cms-core-internal-unstable-admin-ui-pages-HomePage.cjs.js +34 -33
- package/internal-unstable/admin-ui/pages/HomePage/dist/nixxie-cms-core-internal-unstable-admin-ui-pages-HomePage.esm.js +35 -34
- package/internal-unstable/admin-ui/pages/ItemPage/dist/nixxie-cms-core-internal-unstable-admin-ui-pages-ItemPage.cjs.js +53 -13
- package/internal-unstable/admin-ui/pages/ItemPage/dist/nixxie-cms-core-internal-unstable-admin-ui-pages-ItemPage.esm.js +52 -12
- package/internal-unstable/admin-ui/pages/ListPage/dist/nixxie-cms-core-internal-unstable-admin-ui-pages-ListPage.cjs.js +36 -25
- package/internal-unstable/admin-ui/pages/ListPage/dist/nixxie-cms-core-internal-unstable-admin-ui-pages-ListPage.esm.js +36 -25
- package/package.json +2 -2
- package/src/admin-ui/components/CommandPalette.tsx +134 -27
- package/src/admin-ui/components/CreateButtonLink.tsx +20 -46
- package/src/admin-ui/components/GraphQLErrorNotice.tsx +39 -33
- package/src/admin-ui/components/Logo.tsx +5 -5
- package/src/admin-ui/components/Navigation.tsx +41 -27
- package/src/admin-ui/components/PageContainer.tsx +171 -15
- package/src/admin-ui/components/WelcomeDialog.tsx +14 -14
- package/src/admin-ui/context.tsx +5 -2
- package/src/admin-ui/utils/useCreateItem.ts +21 -1
- package/src/fields/types/bigInt/views/index.tsx +10 -1
- package/src/fields/types/bytes/views/index.tsx +14 -1
- package/src/fields/types/calendarDay/views/index.tsx +2 -1
- package/src/fields/types/decimal/views/index.tsx +7 -1
- package/src/fields/types/file/views/Field.tsx +1 -1
- package/src/fields/types/float/views/index.tsx +7 -1
- package/src/fields/types/image/views/index.tsx +1 -1
- package/src/fields/types/integer/views/index.tsx +5 -0
- package/src/fields/types/json/views/index.tsx +20 -2
- package/src/fields/types/multiselect/views/index.tsx +7 -3
- package/src/fields/types/password/views/index.tsx +1 -1
- package/src/fields/types/relationship/views/index.tsx +1 -0
- package/src/fields/types/select/views/index.tsx +2 -1
- package/src/fields/types/text/views/index.tsx +14 -1
- package/src/fields/types/timestamp/views/index.tsx +2 -1
- package/src/fields/types/virtual/views/index.tsx +17 -2
- package/src/internal-unstable/admin-ui/pages/HomePage/index.tsx +40 -31
- package/src/internal-unstable/admin-ui/pages/ItemPage/index.tsx +36 -3
- package/src/internal-unstable/admin-ui/pages/ListPage/PaginationControls.tsx +20 -33
- package/src/internal-unstable/admin-ui/pages/ListPage/index.tsx +24 -16
- package/dist/GraphQLErrorNotice-cd74180d.cjs.js +0 -57
- package/dist/GraphQLErrorNotice-d9f0931b.esm.js +0 -55
- package/dist/pick-5fe45878.cjs.js +0 -71
- package/dist/pick-b7ef3115.esm.js +0 -68
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var router = require('next/router');
|
|
6
6
|
var button = require('@keystar/ui/button');
|
|
7
7
|
var layout = require('@keystar/ui/layout');
|
|
8
|
-
var adminUi_context_dist_nixxieCmsCoreAdminUiContext = require('../../../../../dist/context-
|
|
8
|
+
var adminUi_context_dist_nixxieCmsCoreAdminUiContext = require('../../../../../dist/context-2ce61d0b.cjs.js');
|
|
9
9
|
require('@keystar/ui/table');
|
|
10
10
|
var jsxRuntime = require('react/jsx-runtime');
|
|
11
11
|
require('@keystar/ui/style');
|
|
@@ -20,10 +20,10 @@ require('@keystar/ui/icon/icons/alertTriangleIcon');
|
|
|
20
20
|
require('@keystar/ui/notice');
|
|
21
21
|
require('@keystar/ui/slots');
|
|
22
22
|
require('next/link');
|
|
23
|
-
var PageContainer = require('../../../../../dist/PageContainer-
|
|
24
|
-
var
|
|
25
|
-
var useCreateItem = require('../../../../../dist/useCreateItem-
|
|
26
|
-
var GraphQLErrorNotice = require('../../../../../dist/GraphQLErrorNotice-
|
|
23
|
+
var PageContainer = require('../../../../../dist/PageContainer-4095555a.cjs.js');
|
|
24
|
+
var usePreventNavigation = require('../../../../../dist/usePreventNavigation-d4f9f4fa.cjs.js');
|
|
25
|
+
var useCreateItem = require('../../../../../dist/useCreateItem-acf06f77.cjs.js');
|
|
26
|
+
var GraphQLErrorNotice = require('../../../../../dist/GraphQLErrorNotice-c8890f80.cjs.js');
|
|
27
27
|
require('fast-deep-equal');
|
|
28
28
|
require('graphql');
|
|
29
29
|
var common = require('../../../../../dist/common-5933f758.cjs.js');
|
|
@@ -35,8 +35,8 @@ require('@nixxie-cms/core/admin-ui/router');
|
|
|
35
35
|
require('@keystar/ui/icon/icons/chevronLeftIcon');
|
|
36
36
|
require('@keystar/ui/icon/icons/chevronRightIcon');
|
|
37
37
|
require('@keystar/ui/icon/icons/undo2Icon');
|
|
38
|
+
require('@keystar/ui/number-field');
|
|
38
39
|
require('@keystar/ui/picker');
|
|
39
|
-
require('@keystar/ui/tag');
|
|
40
40
|
require('@keystar/ui/tooltip');
|
|
41
41
|
require('../../../../../dist/admin-meta-graphql-306c224a.cjs.js');
|
|
42
42
|
require('@apollo/client');
|
|
@@ -97,7 +97,7 @@ function CreateItemPage({
|
|
|
97
97
|
minWidth: 0,
|
|
98
98
|
children: [/*#__PURE__*/jsxRuntime.jsx(GraphQLErrorNotice.GraphQLErrorNotice, {
|
|
99
99
|
errors: [createItem.error]
|
|
100
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
100
|
+
}), /*#__PURE__*/jsxRuntime.jsx(usePreventNavigation.Fields, {
|
|
101
101
|
...createItem.props
|
|
102
102
|
})]
|
|
103
103
|
}), /*#__PURE__*/jsxRuntime.jsx(common.BaseToolbar, {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useRouter } from 'next/router';
|
|
2
2
|
import { Button } from '@keystar/ui/button';
|
|
3
3
|
import { VStack } from '@keystar/ui/layout';
|
|
4
|
-
import { a as useList } from '../../../../../dist/context-
|
|
4
|
+
import { a as useList } from '../../../../../dist/context-2924eaaa.esm.js';
|
|
5
5
|
import '@keystar/ui/table';
|
|
6
6
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
7
7
|
import '@keystar/ui/style';
|
|
@@ -16,10 +16,10 @@ import '@keystar/ui/icon/icons/alertTriangleIcon';
|
|
|
16
16
|
import '@keystar/ui/notice';
|
|
17
17
|
import '@keystar/ui/slots';
|
|
18
18
|
import 'next/link';
|
|
19
|
-
import { P as PageContainer } from '../../../../../dist/PageContainer-
|
|
20
|
-
import { F as Fields } from '../../../../../dist/
|
|
21
|
-
import { u as useCreateItem } from '../../../../../dist/useCreateItem-
|
|
22
|
-
import { G as GraphQLErrorNotice } from '../../../../../dist/GraphQLErrorNotice-
|
|
19
|
+
import { P as PageContainer } from '../../../../../dist/PageContainer-355cfbfa.esm.js';
|
|
20
|
+
import { F as Fields } from '../../../../../dist/usePreventNavigation-093389dd.esm.js';
|
|
21
|
+
import { u as useCreateItem } from '../../../../../dist/useCreateItem-36a75f1c.esm.js';
|
|
22
|
+
import { G as GraphQLErrorNotice } from '../../../../../dist/GraphQLErrorNotice-7594a9f8.esm.js';
|
|
23
23
|
import 'fast-deep-equal';
|
|
24
24
|
import 'graphql';
|
|
25
25
|
import { I as ItemPageHeader, C as ColumnLayout, B as BaseToolbar } from '../../../../../dist/common-ea5c441a.esm.js';
|
|
@@ -31,8 +31,8 @@ import '@nixxie-cms/core/admin-ui/router';
|
|
|
31
31
|
import '@keystar/ui/icon/icons/chevronLeftIcon';
|
|
32
32
|
import '@keystar/ui/icon/icons/chevronRightIcon';
|
|
33
33
|
import '@keystar/ui/icon/icons/undo2Icon';
|
|
34
|
+
import '@keystar/ui/number-field';
|
|
34
35
|
import '@keystar/ui/picker';
|
|
35
|
-
import '@keystar/ui/tag';
|
|
36
36
|
import '@keystar/ui/tooltip';
|
|
37
37
|
import '../../../../../dist/admin-meta-graphql-0e6e606e.esm.js';
|
|
38
38
|
import '@apollo/client';
|
|
@@ -7,9 +7,9 @@ var style = require('@keystar/ui/style');
|
|
|
7
7
|
var typography = require('@keystar/ui/typography');
|
|
8
8
|
var client = require('@apollo/client');
|
|
9
9
|
var react$1 = require('@apollo/client/react');
|
|
10
|
-
var GraphQLErrorNotice = require('../../../../../dist/GraphQLErrorNotice-
|
|
11
|
-
var PageContainer = require('../../../../../dist/PageContainer-
|
|
12
|
-
var adminUi_context_dist_nixxieCmsCoreAdminUiContext = require('../../../../../dist/context-
|
|
10
|
+
var GraphQLErrorNotice = require('../../../../../dist/GraphQLErrorNotice-c8890f80.cjs.js');
|
|
11
|
+
var PageContainer = require('../../../../../dist/PageContainer-4095555a.cjs.js');
|
|
12
|
+
var adminUi_context_dist_nixxieCmsCoreAdminUiContext = require('../../../../../dist/context-2ce61d0b.cjs.js');
|
|
13
13
|
var jsxRuntime = require('react/jsx-runtime');
|
|
14
14
|
require('@keystar/ui/layout');
|
|
15
15
|
require('@keystar/ui/notice');
|
|
@@ -17,6 +17,7 @@ require('@keystar/ui/slots');
|
|
|
17
17
|
require('next/head');
|
|
18
18
|
require('next/link');
|
|
19
19
|
require('next/router');
|
|
20
|
+
require('@react-aria/utils');
|
|
20
21
|
require('apollo-upload-client/UploadHttpLink.mjs');
|
|
21
22
|
require('@keystar/ui/core');
|
|
22
23
|
require('@keystar/ui/toast');
|
|
@@ -26,8 +27,8 @@ require('@keystar/ui/icon');
|
|
|
26
27
|
require('@keystar/ui/icon/icons/chevronLeftIcon');
|
|
27
28
|
require('@keystar/ui/icon/icons/chevronRightIcon');
|
|
28
29
|
require('@keystar/ui/icon/icons/undo2Icon');
|
|
30
|
+
require('@keystar/ui/number-field');
|
|
29
31
|
require('@keystar/ui/picker');
|
|
30
|
-
require('@keystar/ui/tag');
|
|
31
32
|
require('@keystar/ui/tooltip');
|
|
32
33
|
require('../../../../../dist/admin-meta-graphql-306c224a.cjs.js');
|
|
33
34
|
require('../../../../../dist/filters-b3e5eb50.cjs.js');
|
|
@@ -42,14 +43,14 @@ function CollectionCard({
|
|
|
42
43
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
43
44
|
className: style.css({
|
|
44
45
|
position: 'relative',
|
|
45
|
-
backgroundColor:
|
|
46
|
-
border:
|
|
46
|
+
backgroundColor: style.tokenSchema.color.background.canvas,
|
|
47
|
+
border: `1px solid ${style.tokenSchema.color.border.muted}`,
|
|
47
48
|
borderRadius: 8,
|
|
48
49
|
overflow: 'hidden',
|
|
49
50
|
transition: 'box-shadow 180ms, border-color 180ms',
|
|
50
51
|
'&:hover': {
|
|
51
|
-
boxShadow:
|
|
52
|
-
borderColor:
|
|
52
|
+
boxShadow: `0 2px 12px ${style.tokenSchema.color.shadow.muted}`,
|
|
53
|
+
borderColor: style.tokenSchema.color.border.emphasis
|
|
53
54
|
}
|
|
54
55
|
}),
|
|
55
56
|
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
@@ -63,7 +64,7 @@ function CollectionCard({
|
|
|
63
64
|
fontWeight: 600,
|
|
64
65
|
letterSpacing: '0.09em',
|
|
65
66
|
textTransform: 'uppercase',
|
|
66
|
-
color:
|
|
67
|
+
color: style.tokenSchema.color.foreground.neutralSecondary,
|
|
67
68
|
display: 'flex',
|
|
68
69
|
alignItems: 'center',
|
|
69
70
|
justifyContent: 'space-between'
|
|
@@ -83,11 +84,11 @@ function CollectionCard({
|
|
|
83
84
|
display: 'inline-flex',
|
|
84
85
|
alignItems: 'center',
|
|
85
86
|
justifyContent: 'center',
|
|
86
|
-
width:
|
|
87
|
-
height:
|
|
87
|
+
width: 28,
|
|
88
|
+
height: 28,
|
|
88
89
|
borderRadius: 5,
|
|
89
|
-
border:
|
|
90
|
-
color:
|
|
90
|
+
border: `1px solid ${style.tokenSchema.color.border.muted}`,
|
|
91
|
+
color: style.tokenSchema.color.foreground.neutralSecondary,
|
|
91
92
|
textDecoration: 'none',
|
|
92
93
|
fontSize: 14,
|
|
93
94
|
lineHeight: 1,
|
|
@@ -95,9 +96,9 @@ function CollectionCard({
|
|
|
95
96
|
marginLeft: 6,
|
|
96
97
|
transition: 'border-color 130ms, color 130ms, background 130ms',
|
|
97
98
|
'&:hover': {
|
|
98
|
-
borderColor:
|
|
99
|
-
color:
|
|
100
|
-
background:
|
|
99
|
+
borderColor: style.tokenSchema.color.scale.black,
|
|
100
|
+
color: style.tokenSchema.color.foreground.neutralEmphasis,
|
|
101
|
+
background: style.tokenSchema.color.background.surfaceSecondary
|
|
101
102
|
}
|
|
102
103
|
}),
|
|
103
104
|
children: "+"
|
|
@@ -119,7 +120,7 @@ function CollectionCard({
|
|
|
119
120
|
fontSize: 34,
|
|
120
121
|
fontWeight: 700,
|
|
121
122
|
letterSpacing: '-0.05em',
|
|
122
|
-
color: count === null ?
|
|
123
|
+
color: count === null ? style.tokenSchema.color.border.muted : style.tokenSchema.color.foreground.neutralEmphasis,
|
|
123
124
|
lineHeight: 1,
|
|
124
125
|
fontVariantNumeric: 'tabular-nums'
|
|
125
126
|
}),
|
|
@@ -128,13 +129,13 @@ function CollectionCard({
|
|
|
128
129
|
className: style.css({
|
|
129
130
|
margin: 0,
|
|
130
131
|
fontSize: 12,
|
|
131
|
-
color:
|
|
132
|
+
color: style.tokenSchema.color.foreground.neutralSecondary,
|
|
132
133
|
display: 'flex',
|
|
133
134
|
alignItems: 'center',
|
|
134
135
|
gap: 4,
|
|
135
136
|
transition: 'color 130ms',
|
|
136
137
|
'a:hover &': {
|
|
137
|
-
color:
|
|
138
|
+
color: style.tokenSchema.color.foreground.neutralEmphasis
|
|
138
139
|
}
|
|
139
140
|
}),
|
|
140
141
|
children: [list.isSingleton ? 'Open' : 'View all', /*#__PURE__*/jsxRuntime.jsx("svg", {
|
|
@@ -175,7 +176,7 @@ function QuickCreate() {
|
|
|
175
176
|
fontWeight: 600,
|
|
176
177
|
letterSpacing: '0.10em',
|
|
177
178
|
textTransform: 'uppercase',
|
|
178
|
-
color:
|
|
179
|
+
color: style.tokenSchema.color.foreground.neutralSecondary
|
|
179
180
|
}),
|
|
180
181
|
children: "Quick Create"
|
|
181
182
|
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
@@ -193,17 +194,17 @@ function QuickCreate() {
|
|
|
193
194
|
paddingInline: '12px',
|
|
194
195
|
paddingBlock: '6px',
|
|
195
196
|
borderRadius: 6,
|
|
196
|
-
border:
|
|
197
|
-
backgroundColor:
|
|
197
|
+
border: `1px solid ${style.tokenSchema.color.border.muted}`,
|
|
198
|
+
backgroundColor: style.tokenSchema.color.background.canvas,
|
|
198
199
|
fontSize: 12.5,
|
|
199
200
|
fontWeight: 500,
|
|
200
|
-
color:
|
|
201
|
+
color: style.tokenSchema.color.foreground.neutral,
|
|
201
202
|
textDecoration: 'none',
|
|
202
203
|
transition: 'border-color 130ms, color 130ms, background 130ms',
|
|
203
204
|
'&:hover': {
|
|
204
|
-
borderColor:
|
|
205
|
-
color:
|
|
206
|
-
background:
|
|
205
|
+
borderColor: style.tokenSchema.color.scale.black,
|
|
206
|
+
color: style.tokenSchema.color.foreground.neutralEmphasis,
|
|
207
|
+
background: style.tokenSchema.color.background.surface
|
|
207
208
|
}
|
|
208
209
|
}),
|
|
209
210
|
children: [/*#__PURE__*/jsxRuntime.jsx("svg", {
|
|
@@ -268,20 +269,20 @@ function HomePage() {
|
|
|
268
269
|
className: style.css({
|
|
269
270
|
marginBottom: 28
|
|
270
271
|
}),
|
|
271
|
-
children: [/*#__PURE__*/jsxRuntime.jsx("
|
|
272
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("h2", {
|
|
272
273
|
className: style.css({
|
|
273
274
|
margin: '0 0 4px',
|
|
274
275
|
fontSize: 20,
|
|
275
276
|
fontWeight: 700,
|
|
276
277
|
letterSpacing: '-0.03em',
|
|
277
|
-
color:
|
|
278
|
+
color: style.tokenSchema.color.foreground.neutralEmphasis
|
|
278
279
|
}),
|
|
279
280
|
children: "Overview"
|
|
280
281
|
}), /*#__PURE__*/jsxRuntime.jsxs("p", {
|
|
281
282
|
className: style.css({
|
|
282
283
|
margin: 0,
|
|
283
284
|
fontSize: 13,
|
|
284
|
-
color:
|
|
285
|
+
color: style.tokenSchema.color.foreground.neutralSecondary
|
|
285
286
|
}),
|
|
286
287
|
children: [visibleLists.length, " collection", visibleLists.length !== 1 ? 's' : '']
|
|
287
288
|
})]
|
|
@@ -308,7 +309,7 @@ function HomePage() {
|
|
|
308
309
|
className: style.css({
|
|
309
310
|
marginTop: 48,
|
|
310
311
|
fontSize: 11.5,
|
|
311
|
-
color:
|
|
312
|
+
color: style.tokenSchema.color.foreground.neutralSecondary,
|
|
312
313
|
display: 'flex',
|
|
313
314
|
alignItems: 'center',
|
|
314
315
|
gap: 6
|
|
@@ -317,12 +318,12 @@ function HomePage() {
|
|
|
317
318
|
className: style.css({
|
|
318
319
|
display: 'inline-flex',
|
|
319
320
|
padding: '1px 6px',
|
|
320
|
-
background:
|
|
321
|
-
border:
|
|
321
|
+
background: style.tokenSchema.color.background.canvas,
|
|
322
|
+
border: `1px solid ${style.tokenSchema.color.border.muted}`,
|
|
322
323
|
borderRadius: 4,
|
|
323
324
|
fontSize: 10.5,
|
|
324
325
|
fontFamily: 'inherit',
|
|
325
|
-
color:
|
|
326
|
+
color: style.tokenSchema.color.foreground.neutralSecondary
|
|
326
327
|
}),
|
|
327
328
|
children: "\u2318K"
|
|
328
329
|
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { useMemo } from 'react';
|
|
2
|
-
import { css } from '@keystar/ui/style';
|
|
2
|
+
import { css, tokenSchema } from '@keystar/ui/style';
|
|
3
3
|
import { Heading } from '@keystar/ui/typography';
|
|
4
4
|
import { gql } from '@apollo/client';
|
|
5
5
|
import { useQuery } from '@apollo/client/react';
|
|
6
|
-
import { G as GraphQLErrorNotice } from '../../../../../dist/GraphQLErrorNotice-
|
|
7
|
-
import { P as PageContainer } from '../../../../../dist/PageContainer-
|
|
8
|
-
import { u as useNixxie, a as useList } from '../../../../../dist/context-
|
|
6
|
+
import { G as GraphQLErrorNotice } from '../../../../../dist/GraphQLErrorNotice-7594a9f8.esm.js';
|
|
7
|
+
import { P as PageContainer } from '../../../../../dist/PageContainer-355cfbfa.esm.js';
|
|
8
|
+
import { u as useNixxie, a as useList } from '../../../../../dist/context-2924eaaa.esm.js';
|
|
9
9
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
10
10
|
import '@keystar/ui/layout';
|
|
11
11
|
import '@keystar/ui/notice';
|
|
@@ -13,6 +13,7 @@ import '@keystar/ui/slots';
|
|
|
13
13
|
import 'next/head';
|
|
14
14
|
import 'next/link';
|
|
15
15
|
import 'next/router';
|
|
16
|
+
import '@react-aria/utils';
|
|
16
17
|
import 'apollo-upload-client/UploadHttpLink.mjs';
|
|
17
18
|
import '@keystar/ui/core';
|
|
18
19
|
import '@keystar/ui/toast';
|
|
@@ -22,8 +23,8 @@ import '@keystar/ui/icon';
|
|
|
22
23
|
import '@keystar/ui/icon/icons/chevronLeftIcon';
|
|
23
24
|
import '@keystar/ui/icon/icons/chevronRightIcon';
|
|
24
25
|
import '@keystar/ui/icon/icons/undo2Icon';
|
|
26
|
+
import '@keystar/ui/number-field';
|
|
25
27
|
import '@keystar/ui/picker';
|
|
26
|
-
import '@keystar/ui/tag';
|
|
27
28
|
import '@keystar/ui/tooltip';
|
|
28
29
|
import '../../../../../dist/admin-meta-graphql-0e6e606e.esm.js';
|
|
29
30
|
import '../../../../../dist/filters-8c8616f9.esm.js';
|
|
@@ -38,14 +39,14 @@ function CollectionCard({
|
|
|
38
39
|
return /*#__PURE__*/jsx("div", {
|
|
39
40
|
className: css({
|
|
40
41
|
position: 'relative',
|
|
41
|
-
backgroundColor:
|
|
42
|
-
border:
|
|
42
|
+
backgroundColor: tokenSchema.color.background.canvas,
|
|
43
|
+
border: `1px solid ${tokenSchema.color.border.muted}`,
|
|
43
44
|
borderRadius: 8,
|
|
44
45
|
overflow: 'hidden',
|
|
45
46
|
transition: 'box-shadow 180ms, border-color 180ms',
|
|
46
47
|
'&:hover': {
|
|
47
|
-
boxShadow:
|
|
48
|
-
borderColor:
|
|
48
|
+
boxShadow: `0 2px 12px ${tokenSchema.color.shadow.muted}`,
|
|
49
|
+
borderColor: tokenSchema.color.border.emphasis
|
|
49
50
|
}
|
|
50
51
|
}),
|
|
51
52
|
children: /*#__PURE__*/jsxs("div", {
|
|
@@ -59,7 +60,7 @@ function CollectionCard({
|
|
|
59
60
|
fontWeight: 600,
|
|
60
61
|
letterSpacing: '0.09em',
|
|
61
62
|
textTransform: 'uppercase',
|
|
62
|
-
color:
|
|
63
|
+
color: tokenSchema.color.foreground.neutralSecondary,
|
|
63
64
|
display: 'flex',
|
|
64
65
|
alignItems: 'center',
|
|
65
66
|
justifyContent: 'space-between'
|
|
@@ -79,11 +80,11 @@ function CollectionCard({
|
|
|
79
80
|
display: 'inline-flex',
|
|
80
81
|
alignItems: 'center',
|
|
81
82
|
justifyContent: 'center',
|
|
82
|
-
width:
|
|
83
|
-
height:
|
|
83
|
+
width: 28,
|
|
84
|
+
height: 28,
|
|
84
85
|
borderRadius: 5,
|
|
85
|
-
border:
|
|
86
|
-
color:
|
|
86
|
+
border: `1px solid ${tokenSchema.color.border.muted}`,
|
|
87
|
+
color: tokenSchema.color.foreground.neutralSecondary,
|
|
87
88
|
textDecoration: 'none',
|
|
88
89
|
fontSize: 14,
|
|
89
90
|
lineHeight: 1,
|
|
@@ -91,9 +92,9 @@ function CollectionCard({
|
|
|
91
92
|
marginLeft: 6,
|
|
92
93
|
transition: 'border-color 130ms, color 130ms, background 130ms',
|
|
93
94
|
'&:hover': {
|
|
94
|
-
borderColor:
|
|
95
|
-
color:
|
|
96
|
-
background:
|
|
95
|
+
borderColor: tokenSchema.color.scale.black,
|
|
96
|
+
color: tokenSchema.color.foreground.neutralEmphasis,
|
|
97
|
+
background: tokenSchema.color.background.surfaceSecondary
|
|
97
98
|
}
|
|
98
99
|
}),
|
|
99
100
|
children: "+"
|
|
@@ -115,7 +116,7 @@ function CollectionCard({
|
|
|
115
116
|
fontSize: 34,
|
|
116
117
|
fontWeight: 700,
|
|
117
118
|
letterSpacing: '-0.05em',
|
|
118
|
-
color: count === null ?
|
|
119
|
+
color: count === null ? tokenSchema.color.border.muted : tokenSchema.color.foreground.neutralEmphasis,
|
|
119
120
|
lineHeight: 1,
|
|
120
121
|
fontVariantNumeric: 'tabular-nums'
|
|
121
122
|
}),
|
|
@@ -124,13 +125,13 @@ function CollectionCard({
|
|
|
124
125
|
className: css({
|
|
125
126
|
margin: 0,
|
|
126
127
|
fontSize: 12,
|
|
127
|
-
color:
|
|
128
|
+
color: tokenSchema.color.foreground.neutralSecondary,
|
|
128
129
|
display: 'flex',
|
|
129
130
|
alignItems: 'center',
|
|
130
131
|
gap: 4,
|
|
131
132
|
transition: 'color 130ms',
|
|
132
133
|
'a:hover &': {
|
|
133
|
-
color:
|
|
134
|
+
color: tokenSchema.color.foreground.neutralEmphasis
|
|
134
135
|
}
|
|
135
136
|
}),
|
|
136
137
|
children: [list.isSingleton ? 'Open' : 'View all', /*#__PURE__*/jsx("svg", {
|
|
@@ -171,7 +172,7 @@ function QuickCreate() {
|
|
|
171
172
|
fontWeight: 600,
|
|
172
173
|
letterSpacing: '0.10em',
|
|
173
174
|
textTransform: 'uppercase',
|
|
174
|
-
color:
|
|
175
|
+
color: tokenSchema.color.foreground.neutralSecondary
|
|
175
176
|
}),
|
|
176
177
|
children: "Quick Create"
|
|
177
178
|
}), /*#__PURE__*/jsx("div", {
|
|
@@ -189,17 +190,17 @@ function QuickCreate() {
|
|
|
189
190
|
paddingInline: '12px',
|
|
190
191
|
paddingBlock: '6px',
|
|
191
192
|
borderRadius: 6,
|
|
192
|
-
border:
|
|
193
|
-
backgroundColor:
|
|
193
|
+
border: `1px solid ${tokenSchema.color.border.muted}`,
|
|
194
|
+
backgroundColor: tokenSchema.color.background.canvas,
|
|
194
195
|
fontSize: 12.5,
|
|
195
196
|
fontWeight: 500,
|
|
196
|
-
color:
|
|
197
|
+
color: tokenSchema.color.foreground.neutral,
|
|
197
198
|
textDecoration: 'none',
|
|
198
199
|
transition: 'border-color 130ms, color 130ms, background 130ms',
|
|
199
200
|
'&:hover': {
|
|
200
|
-
borderColor:
|
|
201
|
-
color:
|
|
202
|
-
background:
|
|
201
|
+
borderColor: tokenSchema.color.scale.black,
|
|
202
|
+
color: tokenSchema.color.foreground.neutralEmphasis,
|
|
203
|
+
background: tokenSchema.color.background.surface
|
|
203
204
|
}
|
|
204
205
|
}),
|
|
205
206
|
children: [/*#__PURE__*/jsx("svg", {
|
|
@@ -264,20 +265,20 @@ function HomePage() {
|
|
|
264
265
|
className: css({
|
|
265
266
|
marginBottom: 28
|
|
266
267
|
}),
|
|
267
|
-
children: [/*#__PURE__*/jsx("
|
|
268
|
+
children: [/*#__PURE__*/jsx("h2", {
|
|
268
269
|
className: css({
|
|
269
270
|
margin: '0 0 4px',
|
|
270
271
|
fontSize: 20,
|
|
271
272
|
fontWeight: 700,
|
|
272
273
|
letterSpacing: '-0.03em',
|
|
273
|
-
color:
|
|
274
|
+
color: tokenSchema.color.foreground.neutralEmphasis
|
|
274
275
|
}),
|
|
275
276
|
children: "Overview"
|
|
276
277
|
}), /*#__PURE__*/jsxs("p", {
|
|
277
278
|
className: css({
|
|
278
279
|
margin: 0,
|
|
279
280
|
fontSize: 13,
|
|
280
|
-
color:
|
|
281
|
+
color: tokenSchema.color.foreground.neutralSecondary
|
|
281
282
|
}),
|
|
282
283
|
children: [visibleLists.length, " collection", visibleLists.length !== 1 ? 's' : '']
|
|
283
284
|
})]
|
|
@@ -304,7 +305,7 @@ function HomePage() {
|
|
|
304
305
|
className: css({
|
|
305
306
|
marginTop: 48,
|
|
306
307
|
fontSize: 11.5,
|
|
307
|
-
color:
|
|
308
|
+
color: tokenSchema.color.foreground.neutralSecondary,
|
|
308
309
|
display: 'flex',
|
|
309
310
|
alignItems: 'center',
|
|
310
311
|
gap: 6
|
|
@@ -313,12 +314,12 @@ function HomePage() {
|
|
|
313
314
|
className: css({
|
|
314
315
|
display: 'inline-flex',
|
|
315
316
|
padding: '1px 6px',
|
|
316
|
-
background:
|
|
317
|
-
border:
|
|
317
|
+
background: tokenSchema.color.background.canvas,
|
|
318
|
+
border: `1px solid ${tokenSchema.color.border.muted}`,
|
|
318
319
|
borderRadius: 4,
|
|
319
320
|
fontSize: 10.5,
|
|
320
321
|
fontFamily: 'inherit',
|
|
321
|
-
color:
|
|
322
|
+
color: tokenSchema.color.foreground.neutralSecondary
|
|
322
323
|
}),
|
|
323
324
|
children: "\u2318K"
|
|
324
325
|
}), /*#__PURE__*/jsx("span", {
|
|
@@ -15,33 +15,34 @@ var toast = require('@keystar/ui/toast');
|
|
|
15
15
|
var typography = require('@keystar/ui/typography');
|
|
16
16
|
var client = require('@apollo/client');
|
|
17
17
|
var react$1 = require('@apollo/client/react');
|
|
18
|
-
var pick = require('../../../../../dist/pick-
|
|
18
|
+
var pick = require('../../../../../dist/pick-906341bb.cjs.js');
|
|
19
19
|
var Errors = require('../../../../../dist/Errors-575adfa3.cjs.js');
|
|
20
|
-
var GraphQLErrorNotice = require('../../../../../dist/GraphQLErrorNotice-
|
|
21
|
-
var PageContainer = require('../../../../../dist/PageContainer-
|
|
22
|
-
var adminUi_context_dist_nixxieCmsCoreAdminUiContext = require('../../../../../dist/context-
|
|
23
|
-
var
|
|
20
|
+
var GraphQLErrorNotice = require('../../../../../dist/GraphQLErrorNotice-c8890f80.cjs.js');
|
|
21
|
+
var PageContainer = require('../../../../../dist/PageContainer-4095555a.cjs.js');
|
|
22
|
+
var adminUi_context_dist_nixxieCmsCoreAdminUiContext = require('../../../../../dist/context-2ce61d0b.cjs.js');
|
|
23
|
+
var usePreventNavigation = require('../../../../../dist/usePreventNavigation-d4f9f4fa.cjs.js');
|
|
24
24
|
var filters = require('../../../../../dist/filters-b3e5eb50.cjs.js');
|
|
25
25
|
var utils = require('../../../../../dist/utils-230cddb1.cjs.js');
|
|
26
26
|
var common = require('../../../../../dist/common-5933f758.cjs.js');
|
|
27
27
|
var jsxRuntime = require('react/jsx-runtime');
|
|
28
|
-
require('@keystar/ui/
|
|
28
|
+
require('@keystar/ui/icon/icons/plusIcon');
|
|
29
29
|
require('@babel/runtime/helpers/defineProperty');
|
|
30
30
|
require('@keystar/ui/icon/icons/alertTriangleIcon');
|
|
31
31
|
require('@keystar/ui/notice');
|
|
32
|
+
require('@keystar/ui/style');
|
|
32
33
|
require('next/head');
|
|
33
34
|
require('next/link');
|
|
35
|
+
require('@react-aria/utils');
|
|
34
36
|
require('apollo-upload-client/UploadHttpLink.mjs');
|
|
35
37
|
require('@keystar/ui/core');
|
|
36
38
|
require('@nixxie-cms/core/admin-ui/router');
|
|
37
39
|
require('@keystar/ui/icon/icons/chevronLeftIcon');
|
|
38
40
|
require('@keystar/ui/icon/icons/chevronRightIcon');
|
|
39
41
|
require('@keystar/ui/icon/icons/undo2Icon');
|
|
42
|
+
require('@keystar/ui/number-field');
|
|
40
43
|
require('@keystar/ui/picker');
|
|
41
|
-
require('@keystar/ui/tag');
|
|
42
44
|
require('@keystar/ui/tooltip');
|
|
43
45
|
require('../../../../../dist/admin-meta-graphql-306c224a.cjs.js');
|
|
44
|
-
require('@react-aria/utils');
|
|
45
46
|
require('@keystar/ui/icon/icons/textCursorInputIcon');
|
|
46
47
|
require('@keystar/ui/utils');
|
|
47
48
|
require('fast-deep-equal');
|
|
@@ -65,6 +66,27 @@ function useEventCallback(callback) {
|
|
|
65
66
|
});
|
|
66
67
|
return cb;
|
|
67
68
|
}
|
|
69
|
+
|
|
70
|
+
// after forcing validation, move focus to the first invalid field so the user
|
|
71
|
+
// can see and fix it. runs on the next frame so the DOM reflects the new
|
|
72
|
+
// aria-invalid state, and is fully defensive so it can never throw.
|
|
73
|
+
function focusFirstInvalidField() {
|
|
74
|
+
requestAnimationFrame(() => {
|
|
75
|
+
try {
|
|
76
|
+
const el = document.querySelector('[aria-invalid="true"]');
|
|
77
|
+
if (!el) return;
|
|
78
|
+
el.focus({
|
|
79
|
+
preventScroll: false
|
|
80
|
+
});
|
|
81
|
+
el.scrollIntoView({
|
|
82
|
+
block: 'center',
|
|
83
|
+
behavior: 'smooth'
|
|
84
|
+
});
|
|
85
|
+
} catch {
|
|
86
|
+
// ignore — focusing is a best-effort enhancement
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
}
|
|
68
90
|
function DeleteButton({
|
|
69
91
|
list,
|
|
70
92
|
itemId,
|
|
@@ -163,7 +185,6 @@ function ResetButton(props) {
|
|
|
163
185
|
title: "Reset changes",
|
|
164
186
|
cancelLabel: "Cancel",
|
|
165
187
|
primaryActionLabel: "Yes, reset",
|
|
166
|
-
autoFocusButton: "primary",
|
|
167
188
|
onPrimaryAction: props.onReset,
|
|
168
189
|
children: "Are you sure? Any unsaved changes will be lost and cannot be recovered."
|
|
169
190
|
})]
|
|
@@ -203,7 +224,11 @@ function ItemForm({
|
|
|
203
224
|
e.preventDefault();
|
|
204
225
|
const newForceValidation = invalidFields.size !== 0;
|
|
205
226
|
setForceValidation(newForceValidation);
|
|
206
|
-
if (newForceValidation)
|
|
227
|
+
if (newForceValidation) {
|
|
228
|
+
toast.toastQueue.critical('Please fix the highlighted field(s) before saving.');
|
|
229
|
+
focusFirstInvalidField();
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
207
232
|
const {
|
|
208
233
|
error: _error
|
|
209
234
|
} = await update({
|
|
@@ -227,9 +252,18 @@ function ItemForm({
|
|
|
227
252
|
toast.toastQueue.positive(`Saved changes to ${list.singular.toLocaleLowerCase()}.`, {
|
|
228
253
|
timeout: 5000
|
|
229
254
|
});
|
|
255
|
+
|
|
256
|
+
// reset the navigation guard before refetch so saving and then navigating
|
|
257
|
+
// away doesn't prompt for unsaved changes
|
|
258
|
+
shouldPreventNavigationRef.current = false;
|
|
230
259
|
onSaveSuccess();
|
|
231
260
|
});
|
|
232
261
|
const hasChangedFields = utils.useHasChanges('update', list.fields, value, initialValue);
|
|
262
|
+
const shouldPreventNavigationRef = react.useRef(hasChangedFields);
|
|
263
|
+
react.useEffect(() => {
|
|
264
|
+
shouldPreventNavigationRef.current = hasChangedFields;
|
|
265
|
+
}, [hasChangedFields]);
|
|
266
|
+
usePreventNavigation.usePreventNavigation(shouldPreventNavigationRef);
|
|
233
267
|
return /*#__PURE__*/jsxRuntime.jsxs(react.Fragment, {
|
|
234
268
|
children: [/*#__PURE__*/jsxRuntime.jsxs("form", {
|
|
235
269
|
onSubmit: onSave,
|
|
@@ -251,7 +285,7 @@ function ItemForm({
|
|
|
251
285
|
var _x$path2;
|
|
252
286
|
return x.path === undefined || ((_x$path2 = x.path) === null || _x$path2 === void 0 ? void 0 : _x$path2.length) === 1;
|
|
253
287
|
}) : [error]
|
|
254
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
288
|
+
}), /*#__PURE__*/jsxRuntime.jsx(usePreventNavigation.Fields, {
|
|
255
289
|
view: "itemView",
|
|
256
290
|
position: "form",
|
|
257
291
|
fields: list.fields,
|
|
@@ -265,7 +299,7 @@ function ItemForm({
|
|
|
265
299
|
isRequireds: isRequireds
|
|
266
300
|
})]
|
|
267
301
|
}), /*#__PURE__*/jsxRuntime.jsx(common.StickySidebar, {
|
|
268
|
-
children: /*#__PURE__*/jsxRuntime.jsx(
|
|
302
|
+
children: /*#__PURE__*/jsxRuntime.jsx(usePreventNavigation.Fields, {
|
|
269
303
|
view: "itemView",
|
|
270
304
|
position: "sidebar",
|
|
271
305
|
fields: list.fields,
|
|
@@ -325,7 +359,13 @@ function ItemPage({
|
|
|
325
359
|
const item = data === null || data === void 0 ? void 0 : data.item;
|
|
326
360
|
const itemLabel_ = (_item$list$labelField = item === null || item === void 0 ? void 0 : item[list.labelField]) !== null && _item$list$labelField !== void 0 ? _item$list$labelField : item === null || item === void 0 ? void 0 : item.id;
|
|
327
361
|
const itemLabel = typeof itemLabel_ === 'string' ? itemLabel_ : itemId !== null && itemId !== void 0 ? itemId : '';
|
|
328
|
-
|
|
362
|
+
|
|
363
|
+
// Only show the full-page spinner on the INITIAL load (no data yet). On a
|
|
364
|
+
// post-save refetch Apollo keeps `data` populated while `loading` flips back
|
|
365
|
+
// to true; gating on `!data` keeps the form mounted (no scroll reset / flash)
|
|
366
|
+
// during background refetches while still showing the spinner before the
|
|
367
|
+
// first result arrives.
|
|
368
|
+
const pageLoading = loading && !data || itemId === undefined;
|
|
329
369
|
const pageLabel = itemLabel || itemId;
|
|
330
370
|
const pageTitle = list.isSingleton || typeof pageLabel !== 'string' ? list.label : pageLabel;
|
|
331
371
|
const initialValue = react.useMemo(() => {
|