@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
|
@@ -897,21 +897,29 @@ function ActionItemsDialog({
|
|
|
897
897
|
id
|
|
898
898
|
}
|
|
899
899
|
}`
|
|
900
|
+
// The ids actually included in the mutation payload, in the exact order
|
|
901
|
+
// they are sent to the server. Server error paths reference indices into
|
|
902
|
+
// this array, so error/affected-record attribution must be done against it
|
|
903
|
+
// rather than the original (possibly larger) itemIds list.
|
|
904
|
+
const sentIds: string[] = []
|
|
905
|
+
const mutationData =
|
|
906
|
+
action.key === 'delete'
|
|
907
|
+
? itemIds.map(id => {
|
|
908
|
+
sentIds.push(id)
|
|
909
|
+
return { id }
|
|
910
|
+
})
|
|
911
|
+
: itemIds.flatMap(id => {
|
|
912
|
+
const row = items.find(item => String(item.id) === id)
|
|
913
|
+
if (!row) {
|
|
914
|
+
return []
|
|
915
|
+
}
|
|
916
|
+
const deserialized = deserializeItemToValue(list.fields, row)
|
|
917
|
+
const args = getActionArguments(list, action, deserialized)
|
|
918
|
+
sentIds.push(id)
|
|
919
|
+
return { where: { id }, ...args }
|
|
920
|
+
})
|
|
900
921
|
const [actionOnItems] = useMutation<{ results?: ({ id: string } | null)[] }>(actionMutation, {
|
|
901
|
-
variables:
|
|
902
|
-
action.key === 'delete'
|
|
903
|
-
? { where: itemIds.map(id => ({ id })) }
|
|
904
|
-
: {
|
|
905
|
-
data: itemIds.flatMap(id => {
|
|
906
|
-
const row = items.find(item => String(item.id) === id)
|
|
907
|
-
if (!row) {
|
|
908
|
-
return []
|
|
909
|
-
}
|
|
910
|
-
const deserialized = deserializeItemToValue(list.fields, row)
|
|
911
|
-
const args = getActionArguments(list, action, deserialized)
|
|
912
|
-
return { where: { id }, ...args }
|
|
913
|
-
}),
|
|
914
|
-
},
|
|
922
|
+
variables: action.key === 'delete' ? { where: mutationData } : { data: mutationData },
|
|
915
923
|
errorPolicy: 'all',
|
|
916
924
|
})
|
|
917
925
|
const { messages: m } = action
|
|
@@ -927,14 +935,14 @@ function ActionItemsDialog({
|
|
|
927
935
|
for (const err of error.errors ?? []) {
|
|
928
936
|
const i = err.path?.[1]
|
|
929
937
|
if (typeof i !== 'number') continue
|
|
930
|
-
const itemId =
|
|
938
|
+
const itemId = sentIds[i]
|
|
931
939
|
|
|
932
940
|
failed.add(itemId)
|
|
933
941
|
actionErrors[itemId] ??= []
|
|
934
942
|
actionErrors[itemId].push(err)
|
|
935
943
|
}
|
|
936
944
|
}
|
|
937
|
-
const countSuccess =
|
|
945
|
+
const countSuccess = sentIds.length - countFail
|
|
938
946
|
|
|
939
947
|
if (countSuccess) {
|
|
940
948
|
toastQueue.neutral(
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var client = require('@apollo/client');
|
|
4
|
-
var layout = require('@keystar/ui/layout');
|
|
5
|
-
var notice = require('@keystar/ui/notice');
|
|
6
|
-
var slots = require('@keystar/ui/slots');
|
|
7
|
-
var typography = require('@keystar/ui/typography');
|
|
8
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
9
|
-
|
|
10
|
-
function GraphQLErrorNotice({
|
|
11
|
-
errors: errors_ = []
|
|
12
|
-
}) {
|
|
13
|
-
let errors = errors_.flatMap(x => {
|
|
14
|
-
if (!x) return [];
|
|
15
|
-
if (client.CombinedGraphQLErrors.is(x)) {
|
|
16
|
-
return x.errors;
|
|
17
|
-
}
|
|
18
|
-
return x;
|
|
19
|
-
});
|
|
20
|
-
if (!errors.length) return null;
|
|
21
|
-
return /*#__PURE__*/jsxRuntime.jsxs(notice.Notice, {
|
|
22
|
-
tone: "critical",
|
|
23
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(typography.Heading, {
|
|
24
|
-
children: "Errors"
|
|
25
|
-
}), /*#__PURE__*/jsxRuntime.jsx(slots.Content, {
|
|
26
|
-
children: /*#__PURE__*/jsxRuntime.jsx(layout.VStack, {
|
|
27
|
-
elementType: "ul",
|
|
28
|
-
gap: "large",
|
|
29
|
-
children: [...function* () {
|
|
30
|
-
let i = 0;
|
|
31
|
-
for (const error of errors) {
|
|
32
|
-
const lines = error.message.split('\n');
|
|
33
|
-
for (const line of lines) {
|
|
34
|
-
yield /*#__PURE__*/jsxRuntime.jsx(typography.Text, {
|
|
35
|
-
elementType: "li",
|
|
36
|
-
children: line
|
|
37
|
-
}, i++);
|
|
38
|
-
}
|
|
39
|
-
if ('result' in error && typeof error.result === 'object' && error.result !== null && 'errors' in error.result && Array.isArray(error.result.errors)) {
|
|
40
|
-
for (const {
|
|
41
|
-
message
|
|
42
|
-
} of error.result.errors) {
|
|
43
|
-
if (typeof message !== 'string') continue;
|
|
44
|
-
yield /*#__PURE__*/jsxRuntime.jsx(typography.Text, {
|
|
45
|
-
elementType: "li",
|
|
46
|
-
children: message
|
|
47
|
-
}, i++);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}()]
|
|
52
|
-
})
|
|
53
|
-
})]
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
exports.GraphQLErrorNotice = GraphQLErrorNotice;
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { CombinedGraphQLErrors } from '@apollo/client';
|
|
2
|
-
import { VStack } from '@keystar/ui/layout';
|
|
3
|
-
import { Notice } from '@keystar/ui/notice';
|
|
4
|
-
import { Content } from '@keystar/ui/slots';
|
|
5
|
-
import { Heading, Text } from '@keystar/ui/typography';
|
|
6
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
7
|
-
|
|
8
|
-
function GraphQLErrorNotice({
|
|
9
|
-
errors: errors_ = []
|
|
10
|
-
}) {
|
|
11
|
-
let errors = errors_.flatMap(x => {
|
|
12
|
-
if (!x) return [];
|
|
13
|
-
if (CombinedGraphQLErrors.is(x)) {
|
|
14
|
-
return x.errors;
|
|
15
|
-
}
|
|
16
|
-
return x;
|
|
17
|
-
});
|
|
18
|
-
if (!errors.length) return null;
|
|
19
|
-
return /*#__PURE__*/jsxs(Notice, {
|
|
20
|
-
tone: "critical",
|
|
21
|
-
children: [/*#__PURE__*/jsx(Heading, {
|
|
22
|
-
children: "Errors"
|
|
23
|
-
}), /*#__PURE__*/jsx(Content, {
|
|
24
|
-
children: /*#__PURE__*/jsx(VStack, {
|
|
25
|
-
elementType: "ul",
|
|
26
|
-
gap: "large",
|
|
27
|
-
children: [...function* () {
|
|
28
|
-
let i = 0;
|
|
29
|
-
for (const error of errors) {
|
|
30
|
-
const lines = error.message.split('\n');
|
|
31
|
-
for (const line of lines) {
|
|
32
|
-
yield /*#__PURE__*/jsx(Text, {
|
|
33
|
-
elementType: "li",
|
|
34
|
-
children: line
|
|
35
|
-
}, i++);
|
|
36
|
-
}
|
|
37
|
-
if ('result' in error && typeof error.result === 'object' && error.result !== null && 'errors' in error.result && Array.isArray(error.result.errors)) {
|
|
38
|
-
for (const {
|
|
39
|
-
message
|
|
40
|
-
} of error.result.errors) {
|
|
41
|
-
if (typeof message !== 'string') continue;
|
|
42
|
-
yield /*#__PURE__*/jsx(Text, {
|
|
43
|
-
elementType: "li",
|
|
44
|
-
children: message
|
|
45
|
-
}, i++);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}()]
|
|
50
|
-
})
|
|
51
|
-
})]
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export { GraphQLErrorNotice as G };
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var style = require('@keystar/ui/style');
|
|
4
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
5
|
-
|
|
6
|
-
function CreateButtonLink(props) {
|
|
7
|
-
const {
|
|
8
|
-
list,
|
|
9
|
-
children = `New ${list.singular}`
|
|
10
|
-
} = props;
|
|
11
|
-
return /*#__PURE__*/jsxRuntime.jsxs("a", {
|
|
12
|
-
href: `/${list.path}/create`,
|
|
13
|
-
"aria-label": `New ${list.singular}`,
|
|
14
|
-
className: style.css({
|
|
15
|
-
display: 'inline-flex',
|
|
16
|
-
alignItems: 'center',
|
|
17
|
-
gap: 6,
|
|
18
|
-
paddingInline: '13px',
|
|
19
|
-
paddingBlock: '7px',
|
|
20
|
-
borderRadius: 6,
|
|
21
|
-
border: '1px solid transparent',
|
|
22
|
-
backgroundColor: '#111827',
|
|
23
|
-
color: '#ffffff',
|
|
24
|
-
fontSize: 13,
|
|
25
|
-
fontWeight: 500,
|
|
26
|
-
fontFamily: 'inherit',
|
|
27
|
-
textDecoration: 'none',
|
|
28
|
-
cursor: 'pointer',
|
|
29
|
-
whiteSpace: 'nowrap',
|
|
30
|
-
flexShrink: 0,
|
|
31
|
-
letterSpacing: '-0.01em',
|
|
32
|
-
transition: 'background 130ms',
|
|
33
|
-
'&:hover': {
|
|
34
|
-
backgroundColor: '#1f2937'
|
|
35
|
-
},
|
|
36
|
-
'&:active': {
|
|
37
|
-
backgroundColor: '#374151'
|
|
38
|
-
},
|
|
39
|
-
'&:focus-visible': {
|
|
40
|
-
outline: '2px solid #111827',
|
|
41
|
-
outlineOffset: 2
|
|
42
|
-
}
|
|
43
|
-
}),
|
|
44
|
-
children: [/*#__PURE__*/jsxRuntime.jsx("svg", {
|
|
45
|
-
width: "12",
|
|
46
|
-
height: "12",
|
|
47
|
-
viewBox: "0 0 12 12",
|
|
48
|
-
fill: "none",
|
|
49
|
-
"aria-hidden": true,
|
|
50
|
-
children: /*#__PURE__*/jsxRuntime.jsx("path", {
|
|
51
|
-
d: "M6 1.5v9M1.5 6h9",
|
|
52
|
-
stroke: "currentColor",
|
|
53
|
-
strokeWidth: "1.5",
|
|
54
|
-
strokeLinecap: "round"
|
|
55
|
-
})
|
|
56
|
-
}), children]
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
function pick(value, keys) {
|
|
61
|
-
const result = {};
|
|
62
|
-
for (const key of keys) {
|
|
63
|
-
if (Object.prototype.hasOwnProperty.call(value, key)) {
|
|
64
|
-
result[key] = value[key];
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
return result;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
exports.CreateButtonLink = CreateButtonLink;
|
|
71
|
-
exports.pick = pick;
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { css } from '@keystar/ui/style';
|
|
2
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
-
|
|
4
|
-
function CreateButtonLink(props) {
|
|
5
|
-
const {
|
|
6
|
-
list,
|
|
7
|
-
children = `New ${list.singular}`
|
|
8
|
-
} = props;
|
|
9
|
-
return /*#__PURE__*/jsxs("a", {
|
|
10
|
-
href: `/${list.path}/create`,
|
|
11
|
-
"aria-label": `New ${list.singular}`,
|
|
12
|
-
className: css({
|
|
13
|
-
display: 'inline-flex',
|
|
14
|
-
alignItems: 'center',
|
|
15
|
-
gap: 6,
|
|
16
|
-
paddingInline: '13px',
|
|
17
|
-
paddingBlock: '7px',
|
|
18
|
-
borderRadius: 6,
|
|
19
|
-
border: '1px solid transparent',
|
|
20
|
-
backgroundColor: '#111827',
|
|
21
|
-
color: '#ffffff',
|
|
22
|
-
fontSize: 13,
|
|
23
|
-
fontWeight: 500,
|
|
24
|
-
fontFamily: 'inherit',
|
|
25
|
-
textDecoration: 'none',
|
|
26
|
-
cursor: 'pointer',
|
|
27
|
-
whiteSpace: 'nowrap',
|
|
28
|
-
flexShrink: 0,
|
|
29
|
-
letterSpacing: '-0.01em',
|
|
30
|
-
transition: 'background 130ms',
|
|
31
|
-
'&:hover': {
|
|
32
|
-
backgroundColor: '#1f2937'
|
|
33
|
-
},
|
|
34
|
-
'&:active': {
|
|
35
|
-
backgroundColor: '#374151'
|
|
36
|
-
},
|
|
37
|
-
'&:focus-visible': {
|
|
38
|
-
outline: '2px solid #111827',
|
|
39
|
-
outlineOffset: 2
|
|
40
|
-
}
|
|
41
|
-
}),
|
|
42
|
-
children: [/*#__PURE__*/jsx("svg", {
|
|
43
|
-
width: "12",
|
|
44
|
-
height: "12",
|
|
45
|
-
viewBox: "0 0 12 12",
|
|
46
|
-
fill: "none",
|
|
47
|
-
"aria-hidden": true,
|
|
48
|
-
children: /*#__PURE__*/jsx("path", {
|
|
49
|
-
d: "M6 1.5v9M1.5 6h9",
|
|
50
|
-
stroke: "currentColor",
|
|
51
|
-
strokeWidth: "1.5",
|
|
52
|
-
strokeLinecap: "round"
|
|
53
|
-
})
|
|
54
|
-
}), children]
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
function pick(value, keys) {
|
|
59
|
-
const result = {};
|
|
60
|
-
for (const key of keys) {
|
|
61
|
-
if (Object.prototype.hasOwnProperty.call(value, key)) {
|
|
62
|
-
result[key] = value[key];
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
return result;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
export { CreateButtonLink as C, pick as p };
|