@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
|
@@ -249,6 +249,14 @@ function Field({
|
|
|
249
249
|
value: (_value$value = value.value) !== null && _value$value !== void 0 ? _value$value : NaN
|
|
250
250
|
});
|
|
251
251
|
}
|
|
252
|
+
const Cell = ({
|
|
253
|
+
value
|
|
254
|
+
}) => {
|
|
255
|
+
return typeof value === 'number' && Number.isFinite(value) ? /*#__PURE__*/jsxRuntime.jsx(typography.Text, {
|
|
256
|
+
children: value
|
|
257
|
+
}) : null;
|
|
258
|
+
};
|
|
252
259
|
|
|
260
|
+
exports.Cell = Cell;
|
|
253
261
|
exports.Field = Field;
|
|
254
262
|
exports.controller = controller;
|
|
@@ -245,5 +245,12 @@ function Field({
|
|
|
245
245
|
value: (_value$value = value.value) !== null && _value$value !== void 0 ? _value$value : NaN
|
|
246
246
|
});
|
|
247
247
|
}
|
|
248
|
+
const Cell = ({
|
|
249
|
+
value
|
|
250
|
+
}) => {
|
|
251
|
+
return typeof value === 'number' && Number.isFinite(value) ? /*#__PURE__*/jsx(Text, {
|
|
252
|
+
children: value
|
|
253
|
+
}) : null;
|
|
254
|
+
};
|
|
248
255
|
|
|
249
|
-
export { Field, controller };
|
|
256
|
+
export { Cell, Field, controller };
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
var react = require('react');
|
|
5
6
|
var style = require('@keystar/ui/style');
|
|
6
7
|
var textField = require('@keystar/ui/text-field');
|
|
7
8
|
var typography = require('@keystar/ui/typography');
|
|
@@ -15,7 +16,8 @@ const Field = props => {
|
|
|
15
16
|
onChange,
|
|
16
17
|
value
|
|
17
18
|
} = props;
|
|
18
|
-
const
|
|
19
|
+
const [isDirty, setDirty] = react.useState(false);
|
|
20
|
+
const errorMessage = (isDirty || forceValidation) && !isValidJSON(value) ? 'Invalid JSON' : undefined;
|
|
19
21
|
return /*#__PURE__*/jsxRuntime.jsx(textField.TextArea, {
|
|
20
22
|
autoFocus: autoFocus,
|
|
21
23
|
description: field.description,
|
|
@@ -23,6 +25,7 @@ const Field = props => {
|
|
|
23
25
|
isReadOnly: onChange === undefined,
|
|
24
26
|
label: field.label,
|
|
25
27
|
onChange: onChange,
|
|
28
|
+
onBlur: () => setDirty(true),
|
|
26
29
|
value: value,
|
|
27
30
|
UNSAFE_className: style.css({
|
|
28
31
|
textarea: {
|
|
@@ -32,12 +35,24 @@ const Field = props => {
|
|
|
32
35
|
})
|
|
33
36
|
});
|
|
34
37
|
};
|
|
38
|
+
function isValidJSON(value) {
|
|
39
|
+
if (!value) return true;
|
|
40
|
+
try {
|
|
41
|
+
JSON.parse(value);
|
|
42
|
+
return true;
|
|
43
|
+
} catch {
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
35
47
|
const Cell = ({
|
|
36
48
|
value
|
|
37
49
|
}) => {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
50
|
+
if (value == null) return null;
|
|
51
|
+
const stringified = JSON.stringify(value);
|
|
52
|
+
const truncated = stringified.length > 100 ? `${stringified.slice(0, 100)}…` : stringified;
|
|
53
|
+
return /*#__PURE__*/jsxRuntime.jsx(typography.Text, {
|
|
54
|
+
children: truncated
|
|
55
|
+
});
|
|
41
56
|
};
|
|
42
57
|
function controller(config) {
|
|
43
58
|
return {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
1
2
|
import { css, tokenSchema } from '@keystar/ui/style';
|
|
2
3
|
import { TextArea } from '@keystar/ui/text-field';
|
|
3
4
|
import { Text } from '@keystar/ui/typography';
|
|
@@ -11,7 +12,8 @@ const Field = props => {
|
|
|
11
12
|
onChange,
|
|
12
13
|
value
|
|
13
14
|
} = props;
|
|
14
|
-
const
|
|
15
|
+
const [isDirty, setDirty] = useState(false);
|
|
16
|
+
const errorMessage = (isDirty || forceValidation) && !isValidJSON(value) ? 'Invalid JSON' : undefined;
|
|
15
17
|
return /*#__PURE__*/jsx(TextArea, {
|
|
16
18
|
autoFocus: autoFocus,
|
|
17
19
|
description: field.description,
|
|
@@ -19,6 +21,7 @@ const Field = props => {
|
|
|
19
21
|
isReadOnly: onChange === undefined,
|
|
20
22
|
label: field.label,
|
|
21
23
|
onChange: onChange,
|
|
24
|
+
onBlur: () => setDirty(true),
|
|
22
25
|
value: value,
|
|
23
26
|
UNSAFE_className: css({
|
|
24
27
|
textarea: {
|
|
@@ -28,12 +31,24 @@ const Field = props => {
|
|
|
28
31
|
})
|
|
29
32
|
});
|
|
30
33
|
};
|
|
34
|
+
function isValidJSON(value) {
|
|
35
|
+
if (!value) return true;
|
|
36
|
+
try {
|
|
37
|
+
JSON.parse(value);
|
|
38
|
+
return true;
|
|
39
|
+
} catch {
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
31
43
|
const Cell = ({
|
|
32
44
|
value
|
|
33
45
|
}) => {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
46
|
+
if (value == null) return null;
|
|
47
|
+
const stringified = JSON.stringify(value);
|
|
48
|
+
const truncated = stringified.length > 100 ? `${stringified.slice(0, 100)}…` : stringified;
|
|
49
|
+
return /*#__PURE__*/jsx(Text, {
|
|
50
|
+
children: truncated
|
|
51
|
+
});
|
|
37
52
|
};
|
|
38
53
|
function controller(config) {
|
|
39
54
|
return {
|
package/fields/types/multiselect/views/dist/nixxie-cms-core-fields-types-multiselect-views.cjs.js
CHANGED
|
@@ -100,7 +100,10 @@ const Cell = ({
|
|
|
100
100
|
style: 'short',
|
|
101
101
|
type: 'conjunction'
|
|
102
102
|
});
|
|
103
|
-
const labels = value.map(x =>
|
|
103
|
+
const labels = value.map(x => {
|
|
104
|
+
var _field$valuesToOption, _field$valuesToOption2;
|
|
105
|
+
return (_field$valuesToOption = (_field$valuesToOption2 = field.valuesToOptionsWithStringValues[x]) === null || _field$valuesToOption2 === void 0 ? void 0 : _field$valuesToOption2.label) !== null && _field$valuesToOption !== void 0 ? _field$valuesToOption : x;
|
|
106
|
+
});
|
|
104
107
|
const cellContent = value.length > 3 ? listFormatter.format([labels[0], `${value.length - 1} more`]) : listFormatter.format(labels);
|
|
105
108
|
return /*#__PURE__*/jsxRuntime.jsx(typography.Text, {
|
|
106
109
|
children: cellContent
|
|
@@ -121,13 +124,25 @@ function controller(config) {
|
|
|
121
124
|
type: config.fieldMeta.type,
|
|
122
125
|
options: optionsWithStringValues,
|
|
123
126
|
valuesToOptionsWithStringValues,
|
|
124
|
-
defaultValue: config.fieldMeta.defaultValue.map(x =>
|
|
127
|
+
defaultValue: config.fieldMeta.defaultValue.map(x => {
|
|
128
|
+
var _valuesToOptionsWithS;
|
|
129
|
+
return (_valuesToOptionsWithS = valuesToOptionsWithStringValues[x]) !== null && _valuesToOptionsWithS !== void 0 ? _valuesToOptionsWithS : {
|
|
130
|
+
label: x.toString(),
|
|
131
|
+
value: x.toString()
|
|
132
|
+
};
|
|
133
|
+
}),
|
|
125
134
|
deserialize: data => {
|
|
126
135
|
var _data$config$fieldKey;
|
|
127
136
|
// if we get null from the GraphQL API (which will only happen if field read access control failed)
|
|
128
137
|
// we'll just show it as nothing being selected for now.
|
|
129
138
|
const values = (_data$config$fieldKey = data[config.fieldKey]) !== null && _data$config$fieldKey !== void 0 ? _data$config$fieldKey : [];
|
|
130
|
-
const selectedOptions = values.map(x =>
|
|
139
|
+
const selectedOptions = values.map(x => {
|
|
140
|
+
var _valuesToOptionsWithS2;
|
|
141
|
+
return (_valuesToOptionsWithS2 = valuesToOptionsWithStringValues[x]) !== null && _valuesToOptionsWithS2 !== void 0 ? _valuesToOptionsWithS2 : {
|
|
142
|
+
label: x.toString(),
|
|
143
|
+
value: x.toString()
|
|
144
|
+
};
|
|
145
|
+
});
|
|
131
146
|
return selectedOptions;
|
|
132
147
|
},
|
|
133
148
|
serialize: value => ({
|
package/fields/types/multiselect/views/dist/nixxie-cms-core-fields-types-multiselect-views.esm.js
CHANGED
|
@@ -96,7 +96,10 @@ const Cell = ({
|
|
|
96
96
|
style: 'short',
|
|
97
97
|
type: 'conjunction'
|
|
98
98
|
});
|
|
99
|
-
const labels = value.map(x =>
|
|
99
|
+
const labels = value.map(x => {
|
|
100
|
+
var _field$valuesToOption, _field$valuesToOption2;
|
|
101
|
+
return (_field$valuesToOption = (_field$valuesToOption2 = field.valuesToOptionsWithStringValues[x]) === null || _field$valuesToOption2 === void 0 ? void 0 : _field$valuesToOption2.label) !== null && _field$valuesToOption !== void 0 ? _field$valuesToOption : x;
|
|
102
|
+
});
|
|
100
103
|
const cellContent = value.length > 3 ? listFormatter.format([labels[0], `${value.length - 1} more`]) : listFormatter.format(labels);
|
|
101
104
|
return /*#__PURE__*/jsx(Text, {
|
|
102
105
|
children: cellContent
|
|
@@ -117,13 +120,25 @@ function controller(config) {
|
|
|
117
120
|
type: config.fieldMeta.type,
|
|
118
121
|
options: optionsWithStringValues,
|
|
119
122
|
valuesToOptionsWithStringValues,
|
|
120
|
-
defaultValue: config.fieldMeta.defaultValue.map(x =>
|
|
123
|
+
defaultValue: config.fieldMeta.defaultValue.map(x => {
|
|
124
|
+
var _valuesToOptionsWithS;
|
|
125
|
+
return (_valuesToOptionsWithS = valuesToOptionsWithStringValues[x]) !== null && _valuesToOptionsWithS !== void 0 ? _valuesToOptionsWithS : {
|
|
126
|
+
label: x.toString(),
|
|
127
|
+
value: x.toString()
|
|
128
|
+
};
|
|
129
|
+
}),
|
|
121
130
|
deserialize: data => {
|
|
122
131
|
var _data$config$fieldKey;
|
|
123
132
|
// if we get null from the GraphQL API (which will only happen if field read access control failed)
|
|
124
133
|
// we'll just show it as nothing being selected for now.
|
|
125
134
|
const values = (_data$config$fieldKey = data[config.fieldKey]) !== null && _data$config$fieldKey !== void 0 ? _data$config$fieldKey : [];
|
|
126
|
-
const selectedOptions = values.map(x =>
|
|
135
|
+
const selectedOptions = values.map(x => {
|
|
136
|
+
var _valuesToOptionsWithS2;
|
|
137
|
+
return (_valuesToOptionsWithS2 = valuesToOptionsWithStringValues[x]) !== null && _valuesToOptionsWithS2 !== void 0 ? _valuesToOptionsWithS2 : {
|
|
138
|
+
label: x.toString(),
|
|
139
|
+
value: x.toString()
|
|
140
|
+
};
|
|
141
|
+
});
|
|
127
142
|
return selectedOptions;
|
|
128
143
|
},
|
|
129
144
|
serialize: value => ({
|
|
@@ -188,7 +188,7 @@ function Field(props) {
|
|
|
188
188
|
}), /*#__PURE__*/jsxRuntime.jsxs(layout.Flex, {
|
|
189
189
|
gap: "regular",
|
|
190
190
|
children: [/*#__PURE__*/jsxRuntime.jsxs(button.ToggleButton, {
|
|
191
|
-
"aria-label":
|
|
191
|
+
"aria-label": secureTextEntry ? 'Show password' : 'Hide password',
|
|
192
192
|
isSelected: !secureTextEntry,
|
|
193
193
|
onPress: () => setSecureTextEntry(bool => !bool),
|
|
194
194
|
children: [/*#__PURE__*/jsxRuntime.jsx(icon.Icon, {
|
|
@@ -180,7 +180,7 @@ function Field(props) {
|
|
|
180
180
|
}), /*#__PURE__*/jsxs(Flex, {
|
|
181
181
|
gap: "regular",
|
|
182
182
|
children: [/*#__PURE__*/jsxs(ToggleButton, {
|
|
183
|
-
"aria-label":
|
|
183
|
+
"aria-label": secureTextEntry ? 'Show password' : 'Hide password',
|
|
184
184
|
isSelected: !secureTextEntry,
|
|
185
185
|
onPress: () => setSecureTextEntry(bool => !bool),
|
|
186
186
|
children: [/*#__PURE__*/jsx(Icon, {
|
package/fields/types/relationship/views/dist/nixxie-cms-core-fields-types-relationship-views.cjs.js
CHANGED
|
@@ -22,39 +22,40 @@ require('@keystar/ui/icon/icons/alertTriangleIcon');
|
|
|
22
22
|
require('@keystar/ui/notice');
|
|
23
23
|
require('@keystar/ui/slots');
|
|
24
24
|
require('next/link');
|
|
25
|
-
var adminUi_context_dist_nixxieCmsCoreAdminUiContext = require('../../../../../dist/context-
|
|
25
|
+
var adminUi_context_dist_nixxieCmsCoreAdminUiContext = require('../../../../../dist/context-2ce61d0b.cjs.js');
|
|
26
26
|
require('next/router');
|
|
27
27
|
require('next/head');
|
|
28
|
-
|
|
28
|
+
require('@react-aria/utils');
|
|
29
|
+
var CreateItemDialog = require('../../../../../dist/CreateItemDialog-96b044ce.cjs.js');
|
|
29
30
|
var client = require('@apollo/client');
|
|
30
31
|
var arrowUpRightIcon = require('@keystar/ui/icon/icons/arrowUpRightIcon');
|
|
31
32
|
var combobox = require('@keystar/ui/combobox');
|
|
32
33
|
var isDeepEqual = require('fast-deep-equal');
|
|
33
34
|
var react$1 = require('@apollo/client/react');
|
|
34
|
-
var useFilter = require('../../../../../dist/useFilter-
|
|
35
|
+
var useFilter = require('../../../../../dist/useFilter-c29f17a8.cjs.js');
|
|
35
36
|
var plusIcon = require('@keystar/ui/icon/icons/plusIcon');
|
|
36
37
|
var menu = require('@keystar/ui/menu');
|
|
37
38
|
var tooltip = require('@keystar/ui/tooltip');
|
|
38
39
|
var field = require('@keystar/ui/field');
|
|
39
40
|
var textSelectIcon = require('@keystar/ui/icon/icons/textSelectIcon');
|
|
40
41
|
var utils = require('../../../../../dist/utils-230cddb1.cjs.js');
|
|
41
|
-
require('@react-aria/utils');
|
|
42
42
|
require('@keystar/ui/icon/icons/chevronRightIcon');
|
|
43
43
|
require('@keystar/ui/icon/icons/textCursorInputIcon');
|
|
44
44
|
require('@keystar/ui/toast');
|
|
45
45
|
require('graphql');
|
|
46
|
-
var GraphQLErrorNotice = require('../../../../../dist/GraphQLErrorNotice-
|
|
46
|
+
var GraphQLErrorNotice = require('../../../../../dist/GraphQLErrorNotice-c8890f80.cjs.js');
|
|
47
47
|
var progress = require('@keystar/ui/progress');
|
|
48
48
|
require('apollo-upload-client/UploadHttpLink.mjs');
|
|
49
49
|
require('@keystar/ui/core');
|
|
50
50
|
require('@nixxie-cms/core/admin-ui/router');
|
|
51
51
|
require('@keystar/ui/icon/icons/chevronLeftIcon');
|
|
52
52
|
require('@keystar/ui/icon/icons/undo2Icon');
|
|
53
|
+
require('@keystar/ui/number-field');
|
|
53
54
|
require('@keystar/ui/picker');
|
|
54
55
|
require('../../../../../dist/admin-meta-graphql-306c224a.cjs.js');
|
|
55
56
|
require('../../../../../dist/filters-b3e5eb50.cjs.js');
|
|
56
|
-
require('../../../../../dist/
|
|
57
|
-
require('../../../../../dist/useCreateItem-
|
|
57
|
+
require('../../../../../dist/usePreventNavigation-d4f9f4fa.cjs.js');
|
|
58
|
+
require('../../../../../dist/useCreateItem-acf06f77.cjs.js');
|
|
58
59
|
require('@keystar/ui/utils');
|
|
59
60
|
|
|
60
61
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
@@ -717,6 +718,7 @@ function Field(props) {
|
|
|
717
718
|
gap: "small",
|
|
718
719
|
alignItems: "end",
|
|
719
720
|
children: [textField$1, /*#__PURE__*/jsxRuntime.jsx(button.ActionButton, {
|
|
721
|
+
"aria-label": `Go to ${field.label}`,
|
|
720
722
|
href: `/${foreignList.path}?${buildQueryForRelationshipFieldWithForeignField(foreignList, field.refFieldKey, value.id)}`,
|
|
721
723
|
children: /*#__PURE__*/jsxRuntime.jsx(icon.Icon, {
|
|
722
724
|
src: arrowUpRightIcon.arrowUpRightIcon
|
package/fields/types/relationship/views/dist/nixxie-cms-core-fields-types-relationship-views.esm.js
CHANGED
|
@@ -18,39 +18,40 @@ import '@keystar/ui/icon/icons/alertTriangleIcon';
|
|
|
18
18
|
import '@keystar/ui/notice';
|
|
19
19
|
import '@keystar/ui/slots';
|
|
20
20
|
import 'next/link';
|
|
21
|
-
import { a as useList, P as PaginationControls } from '../../../../../dist/context-
|
|
21
|
+
import { a as useList, P as PaginationControls } from '../../../../../dist/context-2924eaaa.esm.js';
|
|
22
22
|
import 'next/router';
|
|
23
23
|
import 'next/head';
|
|
24
|
-
import
|
|
24
|
+
import '@react-aria/utils';
|
|
25
|
+
import { B as BuildItemDialog } from '../../../../../dist/CreateItemDialog-66621fe8.esm.js';
|
|
25
26
|
import { gql, ApolloClient, InMemoryCache } from '@apollo/client';
|
|
26
27
|
import { arrowUpRightIcon } from '@keystar/ui/icon/icons/arrowUpRightIcon';
|
|
27
28
|
import { ComboboxMulti, Item, Combobox } from '@keystar/ui/combobox';
|
|
28
29
|
import isDeepEqual from 'fast-deep-equal';
|
|
29
30
|
import { useApolloClient, useQuery } from '@apollo/client/react';
|
|
30
|
-
import { u as useSearchFilter } from '../../../../../dist/useFilter-
|
|
31
|
+
import { u as useSearchFilter } from '../../../../../dist/useFilter-f79b2abb.esm.js';
|
|
31
32
|
import { plusIcon } from '@keystar/ui/icon/icons/plusIcon';
|
|
32
33
|
import { ActionMenu, Item as Item$1 } from '@keystar/ui/menu';
|
|
33
34
|
import { TooltipTrigger, Tooltip } from '@keystar/ui/tooltip';
|
|
34
35
|
import { Field as Field$1 } from '@keystar/ui/field';
|
|
35
36
|
import { textSelectIcon } from '@keystar/ui/icon/icons/textSelectIcon';
|
|
36
37
|
import { E as EmptyState } from '../../../../../dist/utils-5e1d4d28.esm.js';
|
|
37
|
-
import '@react-aria/utils';
|
|
38
38
|
import '@keystar/ui/icon/icons/chevronRightIcon';
|
|
39
39
|
import '@keystar/ui/icon/icons/textCursorInputIcon';
|
|
40
40
|
import '@keystar/ui/toast';
|
|
41
41
|
import 'graphql';
|
|
42
|
-
import { G as GraphQLErrorNotice } from '../../../../../dist/GraphQLErrorNotice-
|
|
42
|
+
import { G as GraphQLErrorNotice } from '../../../../../dist/GraphQLErrorNotice-7594a9f8.esm.js';
|
|
43
43
|
import { ProgressCircle } from '@keystar/ui/progress';
|
|
44
44
|
import 'apollo-upload-client/UploadHttpLink.mjs';
|
|
45
45
|
import '@keystar/ui/core';
|
|
46
46
|
import '@nixxie-cms/core/admin-ui/router';
|
|
47
47
|
import '@keystar/ui/icon/icons/chevronLeftIcon';
|
|
48
48
|
import '@keystar/ui/icon/icons/undo2Icon';
|
|
49
|
+
import '@keystar/ui/number-field';
|
|
49
50
|
import '@keystar/ui/picker';
|
|
50
51
|
import '../../../../../dist/admin-meta-graphql-0e6e606e.esm.js';
|
|
51
52
|
import '../../../../../dist/filters-8c8616f9.esm.js';
|
|
52
|
-
import '../../../../../dist/
|
|
53
|
-
import '../../../../../dist/useCreateItem-
|
|
53
|
+
import '../../../../../dist/usePreventNavigation-093389dd.esm.js';
|
|
54
|
+
import '../../../../../dist/useCreateItem-36a75f1c.esm.js';
|
|
54
55
|
import '@keystar/ui/utils';
|
|
55
56
|
|
|
56
57
|
function useDebouncedValue(value, limitMs) {
|
|
@@ -709,6 +710,7 @@ function Field(props) {
|
|
|
709
710
|
gap: "small",
|
|
710
711
|
alignItems: "end",
|
|
711
712
|
children: [textField, /*#__PURE__*/jsx(ActionButton, {
|
|
713
|
+
"aria-label": `Go to ${field.label}`,
|
|
712
714
|
href: `/${foreignList.path}?${buildQueryForRelationshipFieldWithForeignField(foreignList, field.refFieldKey, value.id)}`,
|
|
713
715
|
children: /*#__PURE__*/jsx(Icon, {
|
|
714
716
|
src: arrowUpRightIcon
|
|
@@ -30,7 +30,7 @@ require('@nixxie-cms/core/admin-ui/router');
|
|
|
30
30
|
require('@keystar/ui/icon/icons/chevronLeftIcon');
|
|
31
31
|
require('@keystar/ui/icon/icons/chevronRightIcon');
|
|
32
32
|
require('@keystar/ui/icon/icons/undo2Icon');
|
|
33
|
-
require('@keystar/ui/
|
|
33
|
+
require('@keystar/ui/number-field');
|
|
34
34
|
require('@keystar/ui/tooltip');
|
|
35
35
|
require('../../../../../dist/admin-meta-graphql-306c224a.cjs.js');
|
|
36
36
|
require('@apollo/client');
|
|
@@ -249,9 +249,10 @@ const Cell = ({
|
|
|
249
249
|
field
|
|
250
250
|
}) => {
|
|
251
251
|
var _field$options$find3;
|
|
252
|
+
if (value == null) return null;
|
|
252
253
|
const label = (_field$options$find3 = field.options.find(x => x.value === value)) === null || _field$options$find3 === void 0 ? void 0 : _field$options$find3.label;
|
|
253
254
|
return /*#__PURE__*/jsxRuntime.jsx(typography.Text, {
|
|
254
|
-
children: label
|
|
255
|
+
children: label !== null && label !== void 0 ? label : String(value)
|
|
255
256
|
});
|
|
256
257
|
};
|
|
257
258
|
function validate(value, isRequired) {
|
|
@@ -26,7 +26,7 @@ import '@nixxie-cms/core/admin-ui/router';
|
|
|
26
26
|
import '@keystar/ui/icon/icons/chevronLeftIcon';
|
|
27
27
|
import '@keystar/ui/icon/icons/chevronRightIcon';
|
|
28
28
|
import '@keystar/ui/icon/icons/undo2Icon';
|
|
29
|
-
import '@keystar/ui/
|
|
29
|
+
import '@keystar/ui/number-field';
|
|
30
30
|
import '@keystar/ui/tooltip';
|
|
31
31
|
import '../../../../../dist/admin-meta-graphql-0e6e606e.esm.js';
|
|
32
32
|
import '@apollo/client';
|
|
@@ -245,9 +245,10 @@ const Cell = ({
|
|
|
245
245
|
field
|
|
246
246
|
}) => {
|
|
247
247
|
var _field$options$find3;
|
|
248
|
+
if (value == null) return null;
|
|
248
249
|
const label = (_field$options$find3 = field.options.find(x => x.value === value)) === null || _field$options$find3 === void 0 ? void 0 : _field$options$find3.label;
|
|
249
250
|
return /*#__PURE__*/jsx(Text, {
|
|
250
|
-
children: label
|
|
251
|
+
children: label !== null && label !== void 0 ? label : String(value)
|
|
251
252
|
});
|
|
252
253
|
};
|
|
253
254
|
function validate(value, isRequired) {
|
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var react = require('react');
|
|
6
6
|
var textField = require('@keystar/ui/text-field');
|
|
7
|
+
var typography = require('@keystar/ui/typography');
|
|
7
8
|
require('@keystar/ui/table');
|
|
8
9
|
var jsxRuntime = require('react/jsx-runtime');
|
|
9
10
|
require('@keystar/ui/style');
|
|
@@ -16,7 +17,6 @@ require('@keystar/ui/icon/icons/alertTriangleIcon');
|
|
|
16
17
|
require('@keystar/ui/layout');
|
|
17
18
|
require('@keystar/ui/notice');
|
|
18
19
|
require('@keystar/ui/slots');
|
|
19
|
-
require('@keystar/ui/typography');
|
|
20
20
|
require('next/link');
|
|
21
21
|
require('apollo-upload-client/UploadHttpLink.mjs');
|
|
22
22
|
require('next/head');
|
|
@@ -26,8 +26,8 @@ require('@nixxie-cms/core/admin-ui/router');
|
|
|
26
26
|
require('@keystar/ui/icon/icons/chevronLeftIcon');
|
|
27
27
|
require('@keystar/ui/icon/icons/chevronRightIcon');
|
|
28
28
|
require('@keystar/ui/icon/icons/undo2Icon');
|
|
29
|
+
require('@keystar/ui/number-field');
|
|
29
30
|
require('@keystar/ui/picker');
|
|
30
|
-
require('@keystar/ui/tag');
|
|
31
31
|
require('@keystar/ui/tooltip');
|
|
32
32
|
require('../../../../../dist/admin-meta-graphql-306c224a.cjs.js');
|
|
33
33
|
require('@apollo/client');
|
|
@@ -81,7 +81,9 @@ function Field(props) {
|
|
|
81
81
|
autoFocus: autoFocus,
|
|
82
82
|
description: field.description,
|
|
83
83
|
label: field.label,
|
|
84
|
-
errorMessage: !!validationMessages.length && (shouldShowErrors || forceValidation) ? validationMessages.
|
|
84
|
+
errorMessage: !!validationMessages.length && (shouldShowErrors || forceValidation) ? validationMessages.length === 1 ? validationMessages[0] : validationMessages.map((message, i) => /*#__PURE__*/jsxRuntime.jsxs(typography.Text, {
|
|
85
|
+
children: [i > 0 && /*#__PURE__*/jsxRuntime.jsx("br", {}), message]
|
|
86
|
+
}, i)) : undefined,
|
|
85
87
|
isDisabled: isNull,
|
|
86
88
|
isReadOnly: isReadOnly,
|
|
87
89
|
isRequired: isRequired,
|
|
@@ -105,6 +107,14 @@ function Field(props) {
|
|
|
105
107
|
})
|
|
106
108
|
});
|
|
107
109
|
}
|
|
110
|
+
const Cell = ({
|
|
111
|
+
value
|
|
112
|
+
}) => {
|
|
113
|
+
return value ? /*#__PURE__*/jsxRuntime.jsx(typography.Text, {
|
|
114
|
+
truncate: true,
|
|
115
|
+
children: value
|
|
116
|
+
}) : null;
|
|
117
|
+
};
|
|
108
118
|
function validate(value, validation, isRequired, fieldLabel) {
|
|
109
119
|
var _validation$length$mi;
|
|
110
120
|
// if the value is the same as the initial for an update, we don't want to block saving
|
|
@@ -312,5 +322,6 @@ function controller(config) {
|
|
|
312
322
|
};
|
|
313
323
|
}
|
|
314
324
|
|
|
325
|
+
exports.Cell = Cell;
|
|
315
326
|
exports.Field = Field;
|
|
316
327
|
exports.controller = controller;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { useState } from 'react';
|
|
2
2
|
import { TextField, TextArea } from '@keystar/ui/text-field';
|
|
3
|
+
import { Text } from '@keystar/ui/typography';
|
|
3
4
|
import '@keystar/ui/table';
|
|
4
|
-
import { jsx } from 'react/jsx-runtime';
|
|
5
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
5
6
|
import '@keystar/ui/style';
|
|
6
7
|
import { N as NullableFieldWrapper } from '../../../../../dist/NullableFieldWrapper-6ea48af3.esm.js';
|
|
7
8
|
import '@babel/runtime/helpers/defineProperty';
|
|
@@ -12,7 +13,6 @@ import '@keystar/ui/icon/icons/alertTriangleIcon';
|
|
|
12
13
|
import '@keystar/ui/layout';
|
|
13
14
|
import '@keystar/ui/notice';
|
|
14
15
|
import '@keystar/ui/slots';
|
|
15
|
-
import '@keystar/ui/typography';
|
|
16
16
|
import 'next/link';
|
|
17
17
|
import 'apollo-upload-client/UploadHttpLink.mjs';
|
|
18
18
|
import 'next/head';
|
|
@@ -22,8 +22,8 @@ import '@nixxie-cms/core/admin-ui/router';
|
|
|
22
22
|
import '@keystar/ui/icon/icons/chevronLeftIcon';
|
|
23
23
|
import '@keystar/ui/icon/icons/chevronRightIcon';
|
|
24
24
|
import '@keystar/ui/icon/icons/undo2Icon';
|
|
25
|
+
import '@keystar/ui/number-field';
|
|
25
26
|
import '@keystar/ui/picker';
|
|
26
|
-
import '@keystar/ui/tag';
|
|
27
27
|
import '@keystar/ui/tooltip';
|
|
28
28
|
import '../../../../../dist/admin-meta-graphql-0e6e606e.esm.js';
|
|
29
29
|
import '@apollo/client';
|
|
@@ -77,7 +77,9 @@ function Field(props) {
|
|
|
77
77
|
autoFocus: autoFocus,
|
|
78
78
|
description: field.description,
|
|
79
79
|
label: field.label,
|
|
80
|
-
errorMessage: !!validationMessages.length && (shouldShowErrors || forceValidation) ? validationMessages.
|
|
80
|
+
errorMessage: !!validationMessages.length && (shouldShowErrors || forceValidation) ? validationMessages.length === 1 ? validationMessages[0] : validationMessages.map((message, i) => /*#__PURE__*/jsxs(Text, {
|
|
81
|
+
children: [i > 0 && /*#__PURE__*/jsx("br", {}), message]
|
|
82
|
+
}, i)) : undefined,
|
|
81
83
|
isDisabled: isNull,
|
|
82
84
|
isReadOnly: isReadOnly,
|
|
83
85
|
isRequired: isRequired,
|
|
@@ -101,6 +103,14 @@ function Field(props) {
|
|
|
101
103
|
})
|
|
102
104
|
});
|
|
103
105
|
}
|
|
106
|
+
const Cell = ({
|
|
107
|
+
value
|
|
108
|
+
}) => {
|
|
109
|
+
return value ? /*#__PURE__*/jsx(Text, {
|
|
110
|
+
truncate: true,
|
|
111
|
+
children: value
|
|
112
|
+
}) : null;
|
|
113
|
+
};
|
|
104
114
|
function validate(value, validation, isRequired, fieldLabel) {
|
|
105
115
|
var _validation$length$mi;
|
|
106
116
|
// if the value is the same as the initial for an update, we don't want to block saving
|
|
@@ -308,4 +318,4 @@ function controller(config) {
|
|
|
308
318
|
};
|
|
309
319
|
}
|
|
310
320
|
|
|
311
|
-
export { Field, controller };
|
|
321
|
+
export { Cell, Field, controller };
|
package/fields/types/timestamp/views/dist/nixxie-cms-core-fields-types-timestamp-views.cjs.js
CHANGED
|
@@ -45,7 +45,8 @@ function Field(props) {
|
|
|
45
45
|
description: field.description,
|
|
46
46
|
isDisabled: !parsedValue,
|
|
47
47
|
isReadOnly: true,
|
|
48
|
-
|
|
48
|
+
placeholder: "yyyy-mm-dd --:--:--",
|
|
49
|
+
value: parsedValue ? isReadonlyUTC ? parsedValue.toAbsoluteString() : dateFormatter.format(parsedValue.toDate()) : ''
|
|
49
50
|
}), !!parsedValue && /*#__PURE__*/jsxRuntime.jsxs(tooltip.TooltipTrigger, {
|
|
50
51
|
children: [/*#__PURE__*/jsxRuntime.jsx(button.ToggleButton, {
|
|
51
52
|
"aria-label": "utc time",
|
package/fields/types/timestamp/views/dist/nixxie-cms-core-fields-types-timestamp-views.esm.js
CHANGED
|
@@ -41,7 +41,8 @@ function Field(props) {
|
|
|
41
41
|
description: field.description,
|
|
42
42
|
isDisabled: !parsedValue,
|
|
43
43
|
isReadOnly: true,
|
|
44
|
-
|
|
44
|
+
placeholder: "yyyy-mm-dd --:--:--",
|
|
45
|
+
value: parsedValue ? isReadonlyUTC ? parsedValue.toAbsoluteString() : dateFormatter.format(parsedValue.toDate()) : ''
|
|
45
46
|
}), !!parsedValue && /*#__PURE__*/jsxs(TooltipTrigger, {
|
|
46
47
|
children: [/*#__PURE__*/jsx(ToggleButton, {
|
|
47
48
|
"aria-label": "utc time",
|
|
@@ -21,12 +21,24 @@ function Field(props) {
|
|
|
21
21
|
value
|
|
22
22
|
} = props;
|
|
23
23
|
if (value === createViewValue) return null;
|
|
24
|
+
const stringified = stringify(value);
|
|
25
|
+
// multi-line values (e.g. pretty-printed JSON) get clipped in a single-line
|
|
26
|
+
// TextField, so render them in a read-only TextArea instead
|
|
27
|
+
if (stringified.includes('\n')) {
|
|
28
|
+
return /*#__PURE__*/jsxRuntime.jsx(textField.TextArea, {
|
|
29
|
+
autoFocus: autoFocus,
|
|
30
|
+
description: field.description,
|
|
31
|
+
label: field.label,
|
|
32
|
+
isReadOnly: true,
|
|
33
|
+
value: stringified
|
|
34
|
+
});
|
|
35
|
+
}
|
|
24
36
|
return /*#__PURE__*/jsxRuntime.jsx(textField.TextField, {
|
|
25
37
|
autoFocus: autoFocus,
|
|
26
38
|
description: field.description,
|
|
27
39
|
label: field.label,
|
|
28
40
|
isReadOnly: true,
|
|
29
|
-
value:
|
|
41
|
+
value: stringified
|
|
30
42
|
});
|
|
31
43
|
}
|
|
32
44
|
const Cell = ({
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TextField } from '@keystar/ui/text-field';
|
|
1
|
+
import { TextArea, TextField } from '@keystar/ui/text-field';
|
|
2
2
|
import { Text } from '@keystar/ui/typography';
|
|
3
3
|
import { jsx } from 'react/jsx-runtime';
|
|
4
4
|
|
|
@@ -17,12 +17,24 @@ function Field(props) {
|
|
|
17
17
|
value
|
|
18
18
|
} = props;
|
|
19
19
|
if (value === createViewValue) return null;
|
|
20
|
+
const stringified = stringify(value);
|
|
21
|
+
// multi-line values (e.g. pretty-printed JSON) get clipped in a single-line
|
|
22
|
+
// TextField, so render them in a read-only TextArea instead
|
|
23
|
+
if (stringified.includes('\n')) {
|
|
24
|
+
return /*#__PURE__*/jsx(TextArea, {
|
|
25
|
+
autoFocus: autoFocus,
|
|
26
|
+
description: field.description,
|
|
27
|
+
label: field.label,
|
|
28
|
+
isReadOnly: true,
|
|
29
|
+
value: stringified
|
|
30
|
+
});
|
|
31
|
+
}
|
|
20
32
|
return /*#__PURE__*/jsx(TextField, {
|
|
21
33
|
autoFocus: autoFocus,
|
|
22
34
|
description: field.description,
|
|
23
35
|
label: field.label,
|
|
24
36
|
isReadOnly: true,
|
|
25
|
-
value:
|
|
37
|
+
value: stringified
|
|
26
38
|
});
|
|
27
39
|
}
|
|
28
40
|
const Cell = ({
|
|
@@ -12,14 +12,14 @@ require('@keystar/ui/layout');
|
|
|
12
12
|
require('@keystar/ui/typography');
|
|
13
13
|
var Errors = require('../../../../../dist/Errors-575adfa3.cjs.js');
|
|
14
14
|
require('next/link');
|
|
15
|
-
var adminUi_context_dist_nixxieCmsCoreAdminUiContext = require('../../../../../dist/context-
|
|
15
|
+
var adminUi_context_dist_nixxieCmsCoreAdminUiContext = require('../../../../../dist/context-2ce61d0b.cjs.js');
|
|
16
16
|
require('react');
|
|
17
17
|
require('next/router');
|
|
18
18
|
require('next/head');
|
|
19
|
+
require('@react-aria/utils');
|
|
19
20
|
require('@keystar/ui/button');
|
|
20
21
|
require('@keystar/ui/dialog');
|
|
21
22
|
require('@keystar/ui/slots');
|
|
22
|
-
require('@react-aria/utils');
|
|
23
23
|
require('@keystar/ui/icon/icons/chevronRightIcon');
|
|
24
24
|
require('@keystar/ui/icon/icons/textCursorInputIcon');
|
|
25
25
|
require('@keystar/ui/utils');
|
|
@@ -36,8 +36,8 @@ require('@keystar/ui/core');
|
|
|
36
36
|
require('@nixxie-cms/core/admin-ui/router');
|
|
37
37
|
require('@keystar/ui/icon/icons/chevronLeftIcon');
|
|
38
38
|
require('@keystar/ui/icon/icons/undo2Icon');
|
|
39
|
+
require('@keystar/ui/number-field');
|
|
39
40
|
require('@keystar/ui/picker');
|
|
40
|
-
require('@keystar/ui/tag');
|
|
41
41
|
require('@keystar/ui/tooltip');
|
|
42
42
|
require('../../../../../dist/admin-meta-graphql-306c224a.cjs.js');
|
|
43
43
|
require('../../../../../dist/filters-b3e5eb50.cjs.js');
|
|
@@ -8,14 +8,14 @@ import '@keystar/ui/layout';
|
|
|
8
8
|
import '@keystar/ui/typography';
|
|
9
9
|
import { E as ErrorBoundary } from '../../../../../dist/Errors-bf24759e.esm.js';
|
|
10
10
|
import 'next/link';
|
|
11
|
-
import { N as NixxieProvider } from '../../../../../dist/context-
|
|
11
|
+
import { N as NixxieProvider } from '../../../../../dist/context-2924eaaa.esm.js';
|
|
12
12
|
import 'react';
|
|
13
13
|
import 'next/router';
|
|
14
14
|
import 'next/head';
|
|
15
|
+
import '@react-aria/utils';
|
|
15
16
|
import '@keystar/ui/button';
|
|
16
17
|
import '@keystar/ui/dialog';
|
|
17
18
|
import '@keystar/ui/slots';
|
|
18
|
-
import '@react-aria/utils';
|
|
19
19
|
import '@keystar/ui/icon/icons/chevronRightIcon';
|
|
20
20
|
import '@keystar/ui/icon/icons/textCursorInputIcon';
|
|
21
21
|
import '@keystar/ui/utils';
|
|
@@ -32,8 +32,8 @@ import '@keystar/ui/core';
|
|
|
32
32
|
import '@nixxie-cms/core/admin-ui/router';
|
|
33
33
|
import '@keystar/ui/icon/icons/chevronLeftIcon';
|
|
34
34
|
import '@keystar/ui/icon/icons/undo2Icon';
|
|
35
|
+
import '@keystar/ui/number-field';
|
|
35
36
|
import '@keystar/ui/picker';
|
|
36
|
-
import '@keystar/ui/tag';
|
|
37
37
|
import '@keystar/ui/tooltip';
|
|
38
38
|
import '../../../../../dist/admin-meta-graphql-0e6e606e.esm.js';
|
|
39
39
|
import '../../../../../dist/filters-8c8616f9.esm.js';
|