@rulab/adminjs-components 0.0.6 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +29 -17
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +33 -21
- package/package.json +1 -1
- package/src/components/CustomSlug/CustomSlug.tsx +5 -4
- package/src/components/CustomSlug/styles.ts +7 -1
- package/src/components/Editor/Editor.jsx +4 -4
- package/src/components/Editor/EditorShow.jsx +4 -6
- package/src/components/Editor/styles.ts +8 -3
- package/src/components/StringList/SortableList/SortableList.tsx +9 -9
- package/src/components/StringList/SortableList/components/SortableItem/DragHandle.tsx +5 -5
- package/src/components/StringList/SortableList/components/SortableItem/styles.ts +2 -2
- package/src/components/StringList/StringList.tsx +9 -8
- package/src/components/StringList/StringListShow.tsx +5 -5
- package/src/components/StringList/styles.ts +8 -4
package/dist/index.cjs
CHANGED
|
@@ -72,6 +72,11 @@ var StyledCustomInput = (0, import_styled_components.styled)(import_design_syste
|
|
|
72
72
|
var StyledGenerateButton = (0, import_styled_components.styled)(import_design_system.Button)`
|
|
73
73
|
white-space: nowrap;
|
|
74
74
|
`;
|
|
75
|
+
var StyledLabel = import_styled_components.styled.div`
|
|
76
|
+
font-size: 12px;
|
|
77
|
+
margin-bottom: 8px;
|
|
78
|
+
text-transform: capitalize;
|
|
79
|
+
`;
|
|
75
80
|
|
|
76
81
|
// src/components/CustomSlug/CustomSlug.tsx
|
|
77
82
|
var CustomSlug = ({ property, record, onChange }) => {
|
|
@@ -79,7 +84,7 @@ var CustomSlug = ({ property, record, onChange }) => {
|
|
|
79
84
|
(0, import_react.useEffect)(() => {
|
|
80
85
|
onChange(property.path, inputValue);
|
|
81
86
|
}, [inputValue]);
|
|
82
|
-
return /* @__PURE__ */ import_react.default.createElement(import_styled_components2.ThemeProvider, { theme: import_design_system2.theme }, /* @__PURE__ */ import_react.default.createElement(
|
|
87
|
+
return /* @__PURE__ */ import_react.default.createElement(import_styled_components2.ThemeProvider, { theme: import_design_system2.theme }, /* @__PURE__ */ import_react.default.createElement(StyledLabel, { htmlFor: "customSlug" }, property.path), /* @__PURE__ */ import_react.default.createElement(StyledInputWrapper, null, /* @__PURE__ */ import_react.default.createElement(
|
|
83
88
|
StyledCustomInput,
|
|
84
89
|
{
|
|
85
90
|
id: property.path,
|
|
@@ -102,13 +107,13 @@ var CustomSlug = ({ property, record, onChange }) => {
|
|
|
102
107
|
var CustomSlug_default = CustomSlug;
|
|
103
108
|
|
|
104
109
|
// src/components/StringList/StringList.tsx
|
|
110
|
+
var import_design_system5 = require("@adminjs/design-system");
|
|
105
111
|
var import_react5 = __toESM(require("react"), 1);
|
|
106
112
|
var import_styled_components6 = require("styled-components");
|
|
107
|
-
var import_design_system5 = require("@adminjs/design-system");
|
|
108
113
|
|
|
109
114
|
// src/components/StringList/styles.ts
|
|
110
|
-
var import_styled_components3 = require("@adminjs/design-system/styled-components");
|
|
111
115
|
var import_design_system3 = require("@adminjs/design-system");
|
|
116
|
+
var import_styled_components3 = require("@adminjs/design-system/styled-components");
|
|
112
117
|
var StyledWrapper = (0, import_styled_components3.styled)(import_design_system3.Box)`
|
|
113
118
|
display: flex;
|
|
114
119
|
flex-direction: column;
|
|
@@ -124,17 +129,20 @@ var StyledInputWrapper2 = (0, import_styled_components3.styled)(import_design_sy
|
|
|
124
129
|
var StyledListWrapper = (0, import_styled_components3.styled)(import_design_system3.Box)`
|
|
125
130
|
margin-bottom: 15px;
|
|
126
131
|
`;
|
|
127
|
-
var
|
|
132
|
+
var StyledLabel2 = import_styled_components3.styled.div`
|
|
128
133
|
font-size: 12px;
|
|
129
134
|
margin-bottom: 8px;
|
|
130
135
|
text-transform: capitalize;
|
|
136
|
+
`;
|
|
137
|
+
var StyledShowLabel = (0, import_styled_components3.styled)(StyledLabel2)`
|
|
131
138
|
line-height: 16px;
|
|
132
139
|
color: rgb(137, 138, 154);
|
|
140
|
+
font-weight: 300;
|
|
133
141
|
`;
|
|
134
|
-
var
|
|
142
|
+
var StyledShowWrapper = (0, import_styled_components3.styled)(import_design_system3.Box)`
|
|
135
143
|
margin-bottom: 35px;
|
|
136
144
|
`;
|
|
137
|
-
var
|
|
145
|
+
var StyledListItem = import_styled_components3.styled.li`
|
|
138
146
|
margin-bottom: 5px;
|
|
139
147
|
`;
|
|
140
148
|
|
|
@@ -153,7 +161,7 @@ var import_react2 = __toESM(require("react"), 1);
|
|
|
153
161
|
|
|
154
162
|
// src/components/StringList/SortableList/components/SortableItem/styles.ts
|
|
155
163
|
var import_styled_components4 = require("@adminjs/design-system/styled-components");
|
|
156
|
-
var
|
|
164
|
+
var StyledListItem2 = import_styled_components4.styled.li`
|
|
157
165
|
display: flex;
|
|
158
166
|
justify-content: space-between;
|
|
159
167
|
align-items: center;
|
|
@@ -165,7 +173,7 @@ var StyledListItem = import_styled_components4.styled.li`
|
|
|
165
173
|
border-radius: 5px;
|
|
166
174
|
list-style: none;
|
|
167
175
|
`;
|
|
168
|
-
var
|
|
176
|
+
var StyledDragButton = import_styled_components4.styled.button`
|
|
169
177
|
padding: 3px;
|
|
170
178
|
margin-right: 15px;
|
|
171
179
|
cursor: move;
|
|
@@ -176,7 +184,7 @@ var DragButton = import_styled_components4.styled.button`
|
|
|
176
184
|
// src/components/StringList/SortableList/components/SortableItem/DragHandle.tsx
|
|
177
185
|
var DragHandle = ({ context }) => {
|
|
178
186
|
const { attributes, listeners, ref } = (0, import_react2.useContext)(context);
|
|
179
|
-
return /* @__PURE__ */ import_react2.default.createElement(
|
|
187
|
+
return /* @__PURE__ */ import_react2.default.createElement(StyledDragButton, { ...attributes, ...listeners, ref }, /* @__PURE__ */ import_react2.default.createElement("svg", { viewBox: "0 0 20 20", width: "13" }, /* @__PURE__ */ import_react2.default.createElement("path", { d: "M7 2a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 2zm0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 8zm0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 14zm6-8a2 2 0 1 0-.001-4.001A2 2 0 0 0 13 6zm0 2a2 2 0 1 0 .001 4.001A2 2 0 0 0 13 8zm0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 13 14z" })));
|
|
180
188
|
};
|
|
181
189
|
|
|
182
190
|
// src/components/StringList/SortableList/components/SortableItem/SortableItem.tsx
|
|
@@ -203,7 +211,7 @@ function SortableItem({
|
|
|
203
211
|
const style = {
|
|
204
212
|
opacity: isDragging ? 0.4 : void 0
|
|
205
213
|
};
|
|
206
|
-
return /* @__PURE__ */ import_react3.default.createElement(SortableItemContext.Provider, { value: context }, /* @__PURE__ */ import_react3.default.createElement(
|
|
214
|
+
return /* @__PURE__ */ import_react3.default.createElement(SortableItemContext.Provider, { value: context }, /* @__PURE__ */ import_react3.default.createElement(StyledListItem2, { ref: setNodeRef, style }, /* @__PURE__ */ import_react3.default.createElement("div", null, /* @__PURE__ */ import_react3.default.createElement(DragHandle, { context: SortableItemContext }), children), /* @__PURE__ */ import_react3.default.createElement(
|
|
207
215
|
import_design_system4.Button,
|
|
208
216
|
{
|
|
209
217
|
variant: "outlined",
|
|
@@ -294,7 +302,7 @@ var StringList = ({
|
|
|
294
302
|
(0, import_react5.useEffect)(() => {
|
|
295
303
|
onChange(property.path, serializedData);
|
|
296
304
|
}, [serializedData]);
|
|
297
|
-
return /* @__PURE__ */ import_react5.default.createElement(import_styled_components6.ThemeProvider, { theme: import_design_system5.theme }, /* @__PURE__ */ import_react5.default.createElement(
|
|
305
|
+
return /* @__PURE__ */ import_react5.default.createElement(import_styled_components6.ThemeProvider, { theme: import_design_system5.theme }, /* @__PURE__ */ import_react5.default.createElement(StyledLabel2, { htmlFor: "custom" }, property.path), /* @__PURE__ */ import_react5.default.createElement(StyledWrapper, null, /* @__PURE__ */ import_react5.default.createElement(StyledListWrapper, null, /* @__PURE__ */ import_react5.default.createElement(
|
|
298
306
|
SortableList,
|
|
299
307
|
{
|
|
300
308
|
items: list,
|
|
@@ -363,7 +371,7 @@ var StringListShow = ({
|
|
|
363
371
|
record,
|
|
364
372
|
stringListSeparator = separator
|
|
365
373
|
}) => {
|
|
366
|
-
return /* @__PURE__ */ import_react6.default.createElement(import_styled_components7.ThemeProvider, { theme: import_design_system6.theme }, /* @__PURE__ */ import_react6.default.createElement(
|
|
374
|
+
return /* @__PURE__ */ import_react6.default.createElement(import_styled_components7.ThemeProvider, { theme: import_design_system6.theme }, /* @__PURE__ */ import_react6.default.createElement(StyledShowWrapper, null, /* @__PURE__ */ import_react6.default.createElement(StyledShowLabel, null, property.path), record.params.facts && /* @__PURE__ */ import_react6.default.createElement("ul", null, record.params.facts.split(stringListSeparator).map((item, index) => /* @__PURE__ */ import_react6.default.createElement(StyledListItem, { key: index }, `- ${item}`)))));
|
|
367
375
|
};
|
|
368
376
|
var StringListShow_default = StringListShow;
|
|
369
377
|
|
|
@@ -376,17 +384,21 @@ var import_design_system8 = require("@adminjs/design-system");
|
|
|
376
384
|
// src/components/Editor/styles.ts
|
|
377
385
|
var import_design_system7 = require("@adminjs/design-system");
|
|
378
386
|
var import_styled_components8 = require("@adminjs/design-system/styled-components");
|
|
379
|
-
var
|
|
387
|
+
var StyledLabel3 = import_styled_components8.styled.div`
|
|
380
388
|
font-size: 12px;
|
|
381
389
|
margin-bottom: 8px;
|
|
390
|
+
text-transform: capitalize;
|
|
391
|
+
`;
|
|
392
|
+
var StyledShowLabel2 = (0, import_styled_components8.styled)(StyledLabel3)`
|
|
382
393
|
color: rgb(137, 138, 154);
|
|
394
|
+
font-weight: 300;
|
|
383
395
|
`;
|
|
384
|
-
var
|
|
396
|
+
var StyledEditorWrapper = (0, import_styled_components8.styled)(import_design_system7.Box)`
|
|
385
397
|
padding: 12px;
|
|
386
398
|
margin-bottom: 24px;
|
|
387
399
|
border: 1px solid rgb(187, 195, 203);
|
|
388
400
|
`;
|
|
389
|
-
var
|
|
401
|
+
var StyledEditorShowWrapper = (0, import_styled_components8.styled)(import_design_system7.Box)`
|
|
390
402
|
margin-bottom: 24px;
|
|
391
403
|
|
|
392
404
|
h1,
|
|
@@ -519,7 +531,7 @@ var Editor = ({ property, record, onChangeAdmin, editorId }) => {
|
|
|
519
531
|
ref?.current?.destroy?.();
|
|
520
532
|
};
|
|
521
533
|
}, []);
|
|
522
|
-
return /* @__PURE__ */ import_react7.default.createElement(import_styled_components9.ThemeProvider, { theme: import_design_system8.theme }, /* @__PURE__ */ import_react7.default.createElement(
|
|
534
|
+
return /* @__PURE__ */ import_react7.default.createElement(import_styled_components9.ThemeProvider, { theme: import_design_system8.theme }, /* @__PURE__ */ import_react7.default.createElement(StyledLabel3, null, property.path), /* @__PURE__ */ import_react7.default.createElement(StyledEditorWrapper, null, /* @__PURE__ */ import_react7.default.createElement(StyledEditor, { id: editorId })));
|
|
523
535
|
};
|
|
524
536
|
var Editor_default = Editor;
|
|
525
537
|
|
|
@@ -543,7 +555,7 @@ var parseHtml = (jsonData) => {
|
|
|
543
555
|
// src/components/Editor/EditorShow.jsx
|
|
544
556
|
var EditorShow = ({ property, record }) => {
|
|
545
557
|
const htmlContent = parseHtml(record.params[property.path]);
|
|
546
|
-
return /* @__PURE__ */ import_react8.default.createElement(import_styled_components10.ThemeProvider, { theme: import_design_system9.theme }, /* @__PURE__ */ import_react8.default.createElement(
|
|
558
|
+
return /* @__PURE__ */ import_react8.default.createElement(import_styled_components10.ThemeProvider, { theme: import_design_system9.theme }, /* @__PURE__ */ import_react8.default.createElement(StyledEditorShowWrapper, null, /* @__PURE__ */ import_react8.default.createElement(StyledShowLabel2, null, property.path), htmlContent && /* @__PURE__ */ import_react8.default.createElement("div", { dangerouslySetInnerHTML: { __html: htmlContent } })));
|
|
547
559
|
};
|
|
548
560
|
var EditorShow_default = EditorShow;
|
|
549
561
|
// Annotate the CommonJS export names for ESM import in node:
|
package/dist/index.d.cts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import React, {
|
|
|
4
4
|
useState
|
|
5
5
|
} from "react";
|
|
6
6
|
import { ThemeProvider } from "styled-components";
|
|
7
|
-
import { theme
|
|
7
|
+
import { theme } from "@adminjs/design-system";
|
|
8
8
|
|
|
9
9
|
// src/utils/slugifyImport.ts
|
|
10
10
|
import slugify from "slugify";
|
|
@@ -23,7 +23,7 @@ var slugifyTitle = (title) => {
|
|
|
23
23
|
|
|
24
24
|
// src/components/CustomSlug/styles.ts
|
|
25
25
|
import { styled } from "@adminjs/design-system/styled-components";
|
|
26
|
-
import {
|
|
26
|
+
import { Box, Button, Input } from "@adminjs/design-system";
|
|
27
27
|
var StyledInputWrapper = styled(Box)`
|
|
28
28
|
display: flex;
|
|
29
29
|
margin-bottom: 40px;
|
|
@@ -35,6 +35,11 @@ var StyledCustomInput = styled(Input)`
|
|
|
35
35
|
var StyledGenerateButton = styled(Button)`
|
|
36
36
|
white-space: nowrap;
|
|
37
37
|
`;
|
|
38
|
+
var StyledLabel = styled.div`
|
|
39
|
+
font-size: 12px;
|
|
40
|
+
margin-bottom: 8px;
|
|
41
|
+
text-transform: capitalize;
|
|
42
|
+
`;
|
|
38
43
|
|
|
39
44
|
// src/components/CustomSlug/CustomSlug.tsx
|
|
40
45
|
var CustomSlug = ({ property, record, onChange }) => {
|
|
@@ -42,7 +47,7 @@ var CustomSlug = ({ property, record, onChange }) => {
|
|
|
42
47
|
useEffect(() => {
|
|
43
48
|
onChange(property.path, inputValue);
|
|
44
49
|
}, [inputValue]);
|
|
45
|
-
return /* @__PURE__ */ React.createElement(ThemeProvider, { theme }, /* @__PURE__ */ React.createElement(
|
|
50
|
+
return /* @__PURE__ */ React.createElement(ThemeProvider, { theme }, /* @__PURE__ */ React.createElement(StyledLabel, { htmlFor: "customSlug" }, property.path), /* @__PURE__ */ React.createElement(StyledInputWrapper, null, /* @__PURE__ */ React.createElement(
|
|
46
51
|
StyledCustomInput,
|
|
47
52
|
{
|
|
48
53
|
id: property.path,
|
|
@@ -65,16 +70,16 @@ var CustomSlug = ({ property, record, onChange }) => {
|
|
|
65
70
|
var CustomSlug_default = CustomSlug;
|
|
66
71
|
|
|
67
72
|
// src/components/StringList/StringList.tsx
|
|
73
|
+
import { Button as Button3, Input as Input3, theme as theme2 } from "@adminjs/design-system";
|
|
68
74
|
import React5, {
|
|
69
|
-
|
|
70
|
-
|
|
75
|
+
useEffect as useEffect2,
|
|
76
|
+
useState as useState3
|
|
71
77
|
} from "react";
|
|
72
78
|
import { ThemeProvider as ThemeProvider2 } from "styled-components";
|
|
73
|
-
import { theme as theme2, Button as Button3, Input as Input3, Label as Label2 } from "@adminjs/design-system";
|
|
74
79
|
|
|
75
80
|
// src/components/StringList/styles.ts
|
|
76
|
-
import { styled as styled2 } from "@adminjs/design-system/styled-components";
|
|
77
81
|
import { Box as Box2, Input as Input2 } from "@adminjs/design-system";
|
|
82
|
+
import { styled as styled2 } from "@adminjs/design-system/styled-components";
|
|
78
83
|
var StyledWrapper = styled2(Box2)`
|
|
79
84
|
display: flex;
|
|
80
85
|
flex-direction: column;
|
|
@@ -90,17 +95,20 @@ var StyledInputWrapper2 = styled2(Box2)`
|
|
|
90
95
|
var StyledListWrapper = styled2(Box2)`
|
|
91
96
|
margin-bottom: 15px;
|
|
92
97
|
`;
|
|
93
|
-
var
|
|
98
|
+
var StyledLabel2 = styled2.div`
|
|
94
99
|
font-size: 12px;
|
|
95
100
|
margin-bottom: 8px;
|
|
96
101
|
text-transform: capitalize;
|
|
102
|
+
`;
|
|
103
|
+
var StyledShowLabel = styled2(StyledLabel2)`
|
|
97
104
|
line-height: 16px;
|
|
98
105
|
color: rgb(137, 138, 154);
|
|
106
|
+
font-weight: 300;
|
|
99
107
|
`;
|
|
100
|
-
var
|
|
108
|
+
var StyledShowWrapper = styled2(Box2)`
|
|
101
109
|
margin-bottom: 35px;
|
|
102
110
|
`;
|
|
103
|
-
var
|
|
111
|
+
var StyledListItem = styled2.li`
|
|
104
112
|
margin-bottom: 5px;
|
|
105
113
|
`;
|
|
106
114
|
|
|
@@ -132,7 +140,7 @@ import React2, { useContext } from "react";
|
|
|
132
140
|
|
|
133
141
|
// src/components/StringList/SortableList/components/SortableItem/styles.ts
|
|
134
142
|
import { styled as styled3 } from "@adminjs/design-system/styled-components";
|
|
135
|
-
var
|
|
143
|
+
var StyledListItem2 = styled3.li`
|
|
136
144
|
display: flex;
|
|
137
145
|
justify-content: space-between;
|
|
138
146
|
align-items: center;
|
|
@@ -144,7 +152,7 @@ var StyledListItem = styled3.li`
|
|
|
144
152
|
border-radius: 5px;
|
|
145
153
|
list-style: none;
|
|
146
154
|
`;
|
|
147
|
-
var
|
|
155
|
+
var StyledDragButton = styled3.button`
|
|
148
156
|
padding: 3px;
|
|
149
157
|
margin-right: 15px;
|
|
150
158
|
cursor: move;
|
|
@@ -155,7 +163,7 @@ var DragButton = styled3.button`
|
|
|
155
163
|
// src/components/StringList/SortableList/components/SortableItem/DragHandle.tsx
|
|
156
164
|
var DragHandle = ({ context }) => {
|
|
157
165
|
const { attributes, listeners, ref } = useContext(context);
|
|
158
|
-
return /* @__PURE__ */ React2.createElement(
|
|
166
|
+
return /* @__PURE__ */ React2.createElement(StyledDragButton, { ...attributes, ...listeners, ref }, /* @__PURE__ */ React2.createElement("svg", { viewBox: "0 0 20 20", width: "13" }, /* @__PURE__ */ React2.createElement("path", { d: "M7 2a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 2zm0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 8zm0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 14zm6-8a2 2 0 1 0-.001-4.001A2 2 0 0 0 13 6zm0 2a2 2 0 1 0 .001 4.001A2 2 0 0 0 13 8zm0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 13 14z" })));
|
|
159
167
|
};
|
|
160
168
|
|
|
161
169
|
// src/components/StringList/SortableList/components/SortableItem/SortableItem.tsx
|
|
@@ -182,7 +190,7 @@ function SortableItem({
|
|
|
182
190
|
const style = {
|
|
183
191
|
opacity: isDragging ? 0.4 : void 0
|
|
184
192
|
};
|
|
185
|
-
return /* @__PURE__ */ React3.createElement(SortableItemContext.Provider, { value: context }, /* @__PURE__ */ React3.createElement(
|
|
193
|
+
return /* @__PURE__ */ React3.createElement(SortableItemContext.Provider, { value: context }, /* @__PURE__ */ React3.createElement(StyledListItem2, { ref: setNodeRef, style }, /* @__PURE__ */ React3.createElement("div", null, /* @__PURE__ */ React3.createElement(DragHandle, { context: SortableItemContext }), children), /* @__PURE__ */ React3.createElement(
|
|
186
194
|
Button2,
|
|
187
195
|
{
|
|
188
196
|
variant: "outlined",
|
|
@@ -273,7 +281,7 @@ var StringList = ({
|
|
|
273
281
|
useEffect2(() => {
|
|
274
282
|
onChange(property.path, serializedData);
|
|
275
283
|
}, [serializedData]);
|
|
276
|
-
return /* @__PURE__ */ React5.createElement(ThemeProvider2, { theme: theme2 }, /* @__PURE__ */ React5.createElement(
|
|
284
|
+
return /* @__PURE__ */ React5.createElement(ThemeProvider2, { theme: theme2 }, /* @__PURE__ */ React5.createElement(StyledLabel2, { htmlFor: "custom" }, property.path), /* @__PURE__ */ React5.createElement(StyledWrapper, null, /* @__PURE__ */ React5.createElement(StyledListWrapper, null, /* @__PURE__ */ React5.createElement(
|
|
277
285
|
SortableList,
|
|
278
286
|
{
|
|
279
287
|
items: list,
|
|
@@ -342,7 +350,7 @@ var StringListShow = ({
|
|
|
342
350
|
record,
|
|
343
351
|
stringListSeparator = separator
|
|
344
352
|
}) => {
|
|
345
|
-
return /* @__PURE__ */ React6.createElement(ThemeProvider3, { theme: theme3 }, /* @__PURE__ */ React6.createElement(
|
|
353
|
+
return /* @__PURE__ */ React6.createElement(ThemeProvider3, { theme: theme3 }, /* @__PURE__ */ React6.createElement(StyledShowWrapper, null, /* @__PURE__ */ React6.createElement(StyledShowLabel, null, property.path), record.params.facts && /* @__PURE__ */ React6.createElement("ul", null, record.params.facts.split(stringListSeparator).map((item, index) => /* @__PURE__ */ React6.createElement(StyledListItem, { key: index }, `- ${item}`)))));
|
|
346
354
|
};
|
|
347
355
|
var StringListShow_default = StringListShow;
|
|
348
356
|
|
|
@@ -355,17 +363,21 @@ import { theme as theme4 } from "@adminjs/design-system";
|
|
|
355
363
|
// src/components/Editor/styles.ts
|
|
356
364
|
import { Box as Box3 } from "@adminjs/design-system";
|
|
357
365
|
import { styled as styled5 } from "@adminjs/design-system/styled-components";
|
|
358
|
-
var
|
|
366
|
+
var StyledLabel3 = styled5.div`
|
|
359
367
|
font-size: 12px;
|
|
360
368
|
margin-bottom: 8px;
|
|
369
|
+
text-transform: capitalize;
|
|
370
|
+
`;
|
|
371
|
+
var StyledShowLabel2 = styled5(StyledLabel3)`
|
|
361
372
|
color: rgb(137, 138, 154);
|
|
373
|
+
font-weight: 300;
|
|
362
374
|
`;
|
|
363
|
-
var
|
|
375
|
+
var StyledEditorWrapper = styled5(Box3)`
|
|
364
376
|
padding: 12px;
|
|
365
377
|
margin-bottom: 24px;
|
|
366
378
|
border: 1px solid rgb(187, 195, 203);
|
|
367
379
|
`;
|
|
368
|
-
var
|
|
380
|
+
var StyledEditorShowWrapper = styled5(Box3)`
|
|
369
381
|
margin-bottom: 24px;
|
|
370
382
|
|
|
371
383
|
h1,
|
|
@@ -498,7 +510,7 @@ var Editor = ({ property, record, onChangeAdmin, editorId }) => {
|
|
|
498
510
|
ref?.current?.destroy?.();
|
|
499
511
|
};
|
|
500
512
|
}, []);
|
|
501
|
-
return /* @__PURE__ */ React7.createElement(ThemeProvider4, { theme: theme4 }, /* @__PURE__ */ React7.createElement(
|
|
513
|
+
return /* @__PURE__ */ React7.createElement(ThemeProvider4, { theme: theme4 }, /* @__PURE__ */ React7.createElement(StyledLabel3, null, property.path), /* @__PURE__ */ React7.createElement(StyledEditorWrapper, null, /* @__PURE__ */ React7.createElement(StyledEditor, { id: editorId })));
|
|
502
514
|
};
|
|
503
515
|
var Editor_default = Editor;
|
|
504
516
|
|
|
@@ -522,7 +534,7 @@ var parseHtml = (jsonData) => {
|
|
|
522
534
|
// src/components/Editor/EditorShow.jsx
|
|
523
535
|
var EditorShow = ({ property, record }) => {
|
|
524
536
|
const htmlContent = parseHtml(record.params[property.path]);
|
|
525
|
-
return /* @__PURE__ */ React8.createElement(ThemeProvider5, { theme: theme5 }, /* @__PURE__ */ React8.createElement(
|
|
537
|
+
return /* @__PURE__ */ React8.createElement(ThemeProvider5, { theme: theme5 }, /* @__PURE__ */ React8.createElement(StyledEditorShowWrapper, null, /* @__PURE__ */ React8.createElement(StyledShowLabel2, null, property.path), htmlContent && /* @__PURE__ */ React8.createElement("div", { dangerouslySetInnerHTML: { __html: htmlContent } })));
|
|
526
538
|
};
|
|
527
539
|
var EditorShow_default = EditorShow;
|
|
528
540
|
export {
|
package/package.json
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { EditPropertyProps } from "adminjs";
|
|
1
2
|
import React, {
|
|
2
3
|
ChangeEvent,
|
|
3
4
|
FC,
|
|
@@ -6,16 +7,16 @@ import React, {
|
|
|
6
7
|
useState,
|
|
7
8
|
} from "react";
|
|
8
9
|
import { ThemeProvider } from "styled-components";
|
|
9
|
-
import { EditPropertyProps } from "adminjs";
|
|
10
10
|
|
|
11
|
-
import { theme
|
|
11
|
+
import { theme } from "@adminjs/design-system";
|
|
12
12
|
|
|
13
13
|
import { slugifyTitle } from "../../utils/index.js";
|
|
14
14
|
|
|
15
15
|
import {
|
|
16
|
-
StyledInputWrapper,
|
|
17
16
|
StyledCustomInput,
|
|
18
17
|
StyledGenerateButton,
|
|
18
|
+
StyledInputWrapper,
|
|
19
|
+
StyledLabel,
|
|
19
20
|
} from "./styles.js";
|
|
20
21
|
|
|
21
22
|
type CustomSlugTypes = Omit<EditPropertyProps, "where" | "resource">;
|
|
@@ -29,7 +30,7 @@ const CustomSlug: FC<CustomSlugTypes> = ({ property, record, onChange }) => {
|
|
|
29
30
|
|
|
30
31
|
return (
|
|
31
32
|
<ThemeProvider theme={theme}>
|
|
32
|
-
<
|
|
33
|
+
<StyledLabel htmlFor="customSlug">{property.path}</StyledLabel>
|
|
33
34
|
<StyledInputWrapper>
|
|
34
35
|
<StyledCustomInput
|
|
35
36
|
id={property.path}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @ts-ignore
|
|
2
2
|
import { styled } from "@adminjs/design-system/styled-components";
|
|
3
3
|
// @ts-ignore
|
|
4
|
-
import {
|
|
4
|
+
import { Box, Button, Input } from "@adminjs/design-system";
|
|
5
5
|
|
|
6
6
|
export const StyledInputWrapper = styled(Box)`
|
|
7
7
|
display: flex;
|
|
@@ -16,3 +16,9 @@ export const StyledCustomInput = styled(Input)`
|
|
|
16
16
|
export const StyledGenerateButton = styled(Button)`
|
|
17
17
|
white-space: nowrap;
|
|
18
18
|
`;
|
|
19
|
+
|
|
20
|
+
export const StyledLabel = styled.div`
|
|
21
|
+
font-size: 12px;
|
|
22
|
+
margin-bottom: 8px;
|
|
23
|
+
text-transform: capitalize;
|
|
24
|
+
`;
|
|
@@ -3,7 +3,7 @@ import { ThemeProvider } from "styled-components";
|
|
|
3
3
|
import EditorJS from "@editorjs/editorjs";
|
|
4
4
|
import { theme } from "@adminjs/design-system";
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import { StyledLabel, StyledEditor, StyledEditorWrapper } from "./styles";
|
|
7
7
|
|
|
8
8
|
import { EDITOR_TOOLS } from "./config";
|
|
9
9
|
|
|
@@ -38,10 +38,10 @@ const Editor = ({ property, record, onChangeAdmin, editorId }) => {
|
|
|
38
38
|
|
|
39
39
|
return (
|
|
40
40
|
<ThemeProvider theme={theme}>
|
|
41
|
-
<
|
|
42
|
-
<
|
|
41
|
+
<StyledLabel>{property.path}</StyledLabel>
|
|
42
|
+
<StyledEditorWrapper>
|
|
43
43
|
<StyledEditor id={editorId} />
|
|
44
|
-
</
|
|
44
|
+
</StyledEditorWrapper>
|
|
45
45
|
</ThemeProvider>
|
|
46
46
|
);
|
|
47
47
|
};
|
|
@@ -4,21 +4,19 @@ import { theme } from "@adminjs/design-system";
|
|
|
4
4
|
|
|
5
5
|
import { parseHtml } from "../../utils/parseHtml";
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
import { Label } from "./styles";
|
|
7
|
+
import { StyledEditorShowWrapper, StyledShowLabel } from "./styles";
|
|
10
8
|
|
|
11
9
|
const EditorShow = ({ property, record }) => {
|
|
12
10
|
const htmlContent = parseHtml(record.params[property.path]);
|
|
13
11
|
|
|
14
12
|
return (
|
|
15
13
|
<ThemeProvider theme={theme}>
|
|
16
|
-
<
|
|
17
|
-
<
|
|
14
|
+
<StyledEditorShowWrapper>
|
|
15
|
+
<StyledShowLabel>{property.path}</StyledShowLabel>
|
|
18
16
|
{htmlContent && (
|
|
19
17
|
<div dangerouslySetInnerHTML={{ __html: htmlContent }} />
|
|
20
18
|
)}
|
|
21
|
-
</
|
|
19
|
+
</StyledEditorShowWrapper>
|
|
22
20
|
</ThemeProvider>
|
|
23
21
|
);
|
|
24
22
|
};
|
|
@@ -1,19 +1,24 @@
|
|
|
1
1
|
import { Box } from "@adminjs/design-system";
|
|
2
2
|
import { styled } from "@adminjs/design-system/styled-components";
|
|
3
3
|
|
|
4
|
-
export const
|
|
4
|
+
export const StyledLabel = styled.div`
|
|
5
5
|
font-size: 12px;
|
|
6
6
|
margin-bottom: 8px;
|
|
7
|
+
text-transform: capitalize;
|
|
8
|
+
`;
|
|
9
|
+
|
|
10
|
+
export const StyledShowLabel = styled(StyledLabel)`
|
|
7
11
|
color: rgb(137, 138, 154);
|
|
12
|
+
font-weight: 300;
|
|
8
13
|
`;
|
|
9
14
|
|
|
10
|
-
export const
|
|
15
|
+
export const StyledEditorWrapper = styled(Box)`
|
|
11
16
|
padding: 12px;
|
|
12
17
|
margin-bottom: 24px;
|
|
13
18
|
border: 1px solid rgb(187, 195, 203);
|
|
14
19
|
`;
|
|
15
20
|
|
|
16
|
-
export const
|
|
21
|
+
export const StyledEditorShowWrapper = styled(Box)`
|
|
17
22
|
margin-bottom: 24px;
|
|
18
23
|
|
|
19
24
|
h1,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React, { Fragment, useMemo, useState } from
|
|
2
|
-
import type { ReactNode } from
|
|
1
|
+
import React, { Fragment, useMemo, useState } from "react";
|
|
2
|
+
import type { ReactNode } from "react";
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
DndContext,
|
|
@@ -9,20 +9,20 @@ import {
|
|
|
9
9
|
useSensors,
|
|
10
10
|
DragOverlay,
|
|
11
11
|
defaultDropAnimationSideEffects,
|
|
12
|
-
} from
|
|
12
|
+
} from "@dnd-kit/core";
|
|
13
13
|
import {
|
|
14
14
|
SortableContext,
|
|
15
15
|
arrayMove,
|
|
16
16
|
sortableKeyboardCoordinates,
|
|
17
17
|
verticalListSortingStrategy,
|
|
18
|
-
} from
|
|
18
|
+
} from "@dnd-kit/sortable";
|
|
19
19
|
|
|
20
|
-
import type { DropAnimation } from
|
|
20
|
+
import type { DropAnimation } from "@dnd-kit/core";
|
|
21
21
|
|
|
22
|
-
import {
|
|
23
|
-
import { StyledListWrapper } from
|
|
22
|
+
import { SortableItem } from "./components/index.js";
|
|
23
|
+
import { StyledListWrapper } from "./styles.js";
|
|
24
24
|
|
|
25
|
-
import type { Active, UniqueIdentifier } from
|
|
25
|
+
import type { Active, UniqueIdentifier } from "@dnd-kit/core";
|
|
26
26
|
|
|
27
27
|
interface BaseItem {
|
|
28
28
|
id: UniqueIdentifier;
|
|
@@ -39,7 +39,7 @@ const dropAnimationConfig: DropAnimation = {
|
|
|
39
39
|
sideEffects: defaultDropAnimationSideEffects({
|
|
40
40
|
styles: {
|
|
41
41
|
active: {
|
|
42
|
-
opacity:
|
|
42
|
+
opacity: "0.4",
|
|
43
43
|
},
|
|
44
44
|
},
|
|
45
45
|
}),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import React, { Context, FC, useContext } from
|
|
1
|
+
import React, { Context, FC, useContext } from "react";
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import type { DragContext } from
|
|
3
|
+
import { StyledDragButton } from "./styles.js";
|
|
4
|
+
import type { DragContext } from "./types.js";
|
|
5
5
|
|
|
6
6
|
interface DragHandlePropsType {
|
|
7
7
|
context: Context<DragContext>;
|
|
@@ -11,10 +11,10 @@ export const DragHandle: FC<DragHandlePropsType> = ({ context }) => {
|
|
|
11
11
|
const { attributes, listeners, ref } = useContext(context);
|
|
12
12
|
|
|
13
13
|
return (
|
|
14
|
-
<
|
|
14
|
+
<StyledDragButton {...attributes} {...listeners} ref={ref}>
|
|
15
15
|
<svg viewBox="0 0 20 20" width="13">
|
|
16
16
|
<path d="M7 2a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 2zm0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 8zm0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 14zm6-8a2 2 0 1 0-.001-4.001A2 2 0 0 0 13 6zm0 2a2 2 0 1 0 .001 4.001A2 2 0 0 0 13 8zm0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 13 14z"></path>
|
|
17
17
|
</svg>
|
|
18
|
-
</
|
|
18
|
+
</StyledDragButton>
|
|
19
19
|
);
|
|
20
20
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { styled } from
|
|
1
|
+
import { styled } from "@adminjs/design-system/styled-components";
|
|
2
2
|
|
|
3
3
|
export const StyledListItem = styled.li`
|
|
4
4
|
display: flex;
|
|
@@ -13,7 +13,7 @@ export const StyledListItem = styled.li`
|
|
|
13
13
|
list-style: none;
|
|
14
14
|
`;
|
|
15
15
|
|
|
16
|
-
export const
|
|
16
|
+
export const StyledDragButton = styled.button`
|
|
17
17
|
padding: 3px;
|
|
18
18
|
margin-right: 15px;
|
|
19
19
|
cursor: move;
|
|
@@ -1,20 +1,21 @@
|
|
|
1
|
+
import { Button, Input, theme } from "@adminjs/design-system";
|
|
2
|
+
import { EditPropertyProps } from "adminjs";
|
|
1
3
|
import React, {
|
|
2
|
-
useState,
|
|
3
|
-
useEffect,
|
|
4
4
|
ChangeEvent,
|
|
5
|
+
FC,
|
|
5
6
|
KeyboardEvent,
|
|
6
7
|
SyntheticEvent,
|
|
7
|
-
|
|
8
|
+
useEffect,
|
|
9
|
+
useState,
|
|
8
10
|
} from "react";
|
|
9
11
|
import { ThemeProvider } from "styled-components";
|
|
10
|
-
import { EditPropertyProps } from "adminjs";
|
|
11
|
-
import { theme, Button, Input, Label } from "@adminjs/design-system";
|
|
12
12
|
|
|
13
13
|
import {
|
|
14
|
-
StyledWrapper,
|
|
15
14
|
StyledCustomInput,
|
|
16
|
-
StyledListWrapper,
|
|
17
15
|
StyledInputWrapper,
|
|
16
|
+
StyledLabel,
|
|
17
|
+
StyledListWrapper,
|
|
18
|
+
StyledWrapper,
|
|
18
19
|
} from "./styles.js";
|
|
19
20
|
|
|
20
21
|
import { SortableList } from "./SortableList/SortableList.js";
|
|
@@ -55,7 +56,7 @@ const StringList: FC<StringListShowPropsType> = ({
|
|
|
55
56
|
|
|
56
57
|
return (
|
|
57
58
|
<ThemeProvider theme={theme}>
|
|
58
|
-
<
|
|
59
|
+
<StyledLabel htmlFor="custom">{property.path}</StyledLabel>
|
|
59
60
|
<StyledWrapper>
|
|
60
61
|
<StyledListWrapper>
|
|
61
62
|
<SortableList
|
|
@@ -4,7 +4,7 @@ import { ShowPropertyProps } from "adminjs";
|
|
|
4
4
|
import { ThemeProvider } from "styled-components";
|
|
5
5
|
import { theme } from "@adminjs/design-system";
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { StyledShowLabel, StyledShowWrapper, StyledListItem } from "./styles";
|
|
8
8
|
import { separator } from "./constants";
|
|
9
9
|
|
|
10
10
|
interface StringListShowPropsType extends ShowPropertyProps {
|
|
@@ -18,18 +18,18 @@ const StringListShow: FC<StringListShowPropsType> = ({
|
|
|
18
18
|
}) => {
|
|
19
19
|
return (
|
|
20
20
|
<ThemeProvider theme={theme}>
|
|
21
|
-
<
|
|
22
|
-
<
|
|
21
|
+
<StyledShowWrapper>
|
|
22
|
+
<StyledShowLabel>{property.path}</StyledShowLabel>
|
|
23
23
|
{record.params.facts && (
|
|
24
24
|
<ul>
|
|
25
25
|
{record.params.facts
|
|
26
26
|
.split(stringListSeparator)
|
|
27
27
|
.map((item: string, index: number) => (
|
|
28
|
-
<
|
|
28
|
+
<StyledListItem key={index}>{`- ${item}`}</StyledListItem>
|
|
29
29
|
))}
|
|
30
30
|
</ul>
|
|
31
31
|
)}
|
|
32
|
-
</
|
|
32
|
+
</StyledShowWrapper>
|
|
33
33
|
</ThemeProvider>
|
|
34
34
|
);
|
|
35
35
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { styled } from "@adminjs/design-system/styled-components";
|
|
2
1
|
import { Box, Input } from "@adminjs/design-system";
|
|
2
|
+
import { styled } from "@adminjs/design-system/styled-components";
|
|
3
3
|
|
|
4
4
|
export const StyledWrapper = styled(Box)`
|
|
5
5
|
display: flex;
|
|
@@ -20,18 +20,22 @@ export const StyledListWrapper = styled(Box)`
|
|
|
20
20
|
margin-bottom: 15px;
|
|
21
21
|
`;
|
|
22
22
|
|
|
23
|
-
export const
|
|
23
|
+
export const StyledLabel = styled.div`
|
|
24
24
|
font-size: 12px;
|
|
25
25
|
margin-bottom: 8px;
|
|
26
26
|
text-transform: capitalize;
|
|
27
|
+
`;
|
|
28
|
+
|
|
29
|
+
export const StyledShowLabel = styled(StyledLabel)`
|
|
27
30
|
line-height: 16px;
|
|
28
31
|
color: rgb(137, 138, 154);
|
|
32
|
+
font-weight: 300;
|
|
29
33
|
`;
|
|
30
34
|
|
|
31
|
-
export const
|
|
35
|
+
export const StyledShowWrapper = styled(Box)`
|
|
32
36
|
margin-bottom: 35px;
|
|
33
37
|
`;
|
|
34
38
|
|
|
35
|
-
export const
|
|
39
|
+
export const StyledListItem = styled.li`
|
|
36
40
|
margin-bottom: 5px;
|
|
37
41
|
`;
|