@rulab/adminjs-components 0.1.0-alpha.8 → 0.1.0-beta.1

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.
Files changed (159) hide show
  1. package/dist/components/ColorStatus/ColorStatusEdit.d.ts +2 -2
  2. package/dist/components/ColorStatus/ColorStatusEdit.js +3 -3
  3. package/dist/components/ColorStatus/ColorStatusFeature.d.ts +9 -0
  4. package/dist/components/ColorStatus/ColorStatusFeature.js +23 -0
  5. package/dist/components/ColorStatus/ColorStatusList.d.ts +1 -1
  6. package/dist/components/ColorStatus/ColorStatusList.js +4 -2
  7. package/dist/components/ColorStatus/ColorStatusShow.d.ts +1 -1
  8. package/dist/components/ColorStatus/ColorStatusShow.js +5 -3
  9. package/dist/components/ColorStatus/index.d.ts +4 -3
  10. package/dist/components/ColorStatus/index.js +4 -3
  11. package/dist/components/ColorStatus/styles.js +2 -1
  12. package/dist/components/Editor/Editor.d.ts +4 -2
  13. package/dist/components/Editor/Editor.js +79 -16
  14. package/dist/components/Editor/EditorFeature.d.ts +10 -0
  15. package/dist/components/Editor/EditorFeature.js +82 -0
  16. package/dist/components/Editor/EditorList.d.ts +2 -2
  17. package/dist/components/Editor/EditorList.js +1 -1
  18. package/dist/components/Editor/EditorShow.d.ts +2 -2
  19. package/dist/components/Editor/EditorShow.js +2 -2
  20. package/dist/components/Editor/index.d.ts +4 -3
  21. package/dist/components/Editor/index.js +4 -3
  22. package/dist/components/FeatureTabs/FeatureTabsEdit.d.ts +4 -0
  23. package/dist/components/FeatureTabs/FeatureTabsEdit.js +105 -0
  24. package/dist/components/FeatureTabs/FeatureTabsFeature.d.ts +8 -0
  25. package/dist/components/FeatureTabs/FeatureTabsFeature.js +28 -0
  26. package/dist/components/FeatureTabs/FeatureTabsShow.d.ts +4 -0
  27. package/dist/components/FeatureTabs/FeatureTabsShow.js +61 -0
  28. package/dist/components/FeatureTabs/index.d.ts +4 -0
  29. package/dist/components/FeatureTabs/index.js +4 -0
  30. package/dist/components/Preview/PreviewAction.d.ts +4 -0
  31. package/dist/components/Preview/PreviewAction.js +22 -0
  32. package/dist/components/Preview/PreviewFeature.d.ts +9 -0
  33. package/dist/components/Preview/PreviewFeature.js +31 -0
  34. package/dist/components/Preview/index.d.ts +2 -0
  35. package/dist/components/Preview/index.js +2 -0
  36. package/dist/components/Slug/SlugEdit.d.ts +1 -1
  37. package/dist/components/Slug/SlugEdit.js +9 -3
  38. package/dist/components/Slug/SlugFeature.d.ts +3 -6
  39. package/dist/components/Slug/SlugFeature.js +12 -14
  40. package/dist/components/Slug/SlugOptions.type.d.ts +7 -0
  41. package/dist/components/StringList/StringList.d.ts +1 -1
  42. package/dist/components/StringList/StringList.js +4 -4
  43. package/dist/components/StringList/StringListFeature.d.ts +7 -0
  44. package/dist/components/StringList/StringListFeature.js +20 -0
  45. package/dist/components/StringList/StringListShow.d.ts +1 -1
  46. package/dist/components/StringList/StringListShow.js +2 -2
  47. package/dist/components/StringList/index.d.ts +3 -2
  48. package/dist/components/StringList/index.js +3 -2
  49. package/dist/components/StringList/styles.js +2 -1
  50. package/dist/components/Tabs/TabsEdit.d.ts +4 -0
  51. package/dist/components/Tabs/TabsEdit.js +103 -0
  52. package/dist/components/Tabs/TabsFeature.d.ts +7 -0
  53. package/dist/components/Tabs/TabsFeature.js +26 -0
  54. package/dist/components/Tabs/TabsShow.d.ts +4 -0
  55. package/dist/components/Tabs/TabsShow.js +61 -0
  56. package/dist/components/Tabs/index.d.ts +3 -0
  57. package/dist/components/Tabs/index.js +3 -0
  58. package/dist/components/index.d.ts +15 -7
  59. package/dist/components/index.js +15 -10
  60. package/dist/index.d.ts +1 -0
  61. package/dist/index.js +1 -0
  62. package/dist/types/upload-provider.d.ts +13 -0
  63. package/dist/utils/bundle-component.d.ts +1 -1
  64. package/dist/utils/bundle-component.js +5 -8
  65. package/dist/utils/component-loader.d.ts +3 -0
  66. package/dist/utils/component-loader.js +10 -0
  67. package/dist/utils/index.d.ts +1 -0
  68. package/dist/utils/index.js +1 -0
  69. package/package.json +12 -11
  70. package/src/components/ColorStatus/ColorStatusEdit.d.ts +0 -5
  71. package/src/components/ColorStatus/ColorStatusEdit.js +0 -58
  72. package/src/components/ColorStatus/ColorStatusEdit.tsx +0 -94
  73. package/src/components/ColorStatus/ColorStatusList.d.ts +0 -4
  74. package/src/components/ColorStatus/ColorStatusList.js +0 -7
  75. package/src/components/ColorStatus/ColorStatusList.tsx +0 -20
  76. package/src/components/ColorStatus/ColorStatusShow.d.ts +0 -4
  77. package/src/components/ColorStatus/ColorStatusShow.js +0 -9
  78. package/src/components/ColorStatus/ColorStatusShow.tsx +0 -23
  79. package/src/components/ColorStatus/index.d.ts +0 -3
  80. package/src/components/ColorStatus/index.js +0 -3
  81. package/src/components/ColorStatus/index.ts +0 -3
  82. package/src/components/ColorStatus/styles.d.ts +0 -5
  83. package/src/components/ColorStatus/styles.js +0 -25
  84. package/src/components/ColorStatus/styles.ts +0 -30
  85. package/src/components/ColorStatus/types.d.ts +0 -5
  86. package/src/components/ColorStatus/types.ts +0 -5
  87. package/src/components/Editor/Editor.d.ts +0 -8
  88. package/src/components/Editor/Editor.js +0 -36
  89. package/src/components/Editor/Editor.jsx +0 -49
  90. package/src/components/Editor/EditorList.d.ts +0 -6
  91. package/src/components/Editor/EditorList.js +0 -11
  92. package/src/components/Editor/EditorList.jsx +0 -22
  93. package/src/components/Editor/EditorShow.d.ts +0 -6
  94. package/src/components/Editor/EditorShow.js +0 -13
  95. package/src/components/Editor/EditorShow.jsx +0 -24
  96. package/src/components/Editor/config.d.ts +0 -29
  97. package/src/components/Editor/config.js +0 -34
  98. package/src/components/Editor/config.ts +0 -35
  99. package/src/components/Editor/index.d.ts +0 -3
  100. package/src/components/Editor/index.js +0 -3
  101. package/src/components/Editor/index.ts +0 -3
  102. package/src/components/Editor/styles.d.ts +0 -6
  103. package/src/components/Editor/styles.js +0 -145
  104. package/src/components/Editor/styles.ts +0 -151
  105. package/src/components/Slug/SlugEdit.d.ts +0 -5
  106. package/src/components/Slug/SlugEdit.js +0 -27
  107. package/src/components/Slug/SlugEdit.tsx +0 -68
  108. package/src/components/Slug/SlugFeature.d.ts +0 -7
  109. package/src/components/Slug/SlugFeature.js +0 -21
  110. package/src/components/Slug/SlugFeature.ts +0 -30
  111. package/src/components/Slug/index.d.ts +0 -1
  112. package/src/components/Slug/index.js +0 -1
  113. package/src/components/Slug/index.ts +0 -1
  114. package/src/components/Slug/styles.d.ts +0 -4
  115. package/src/components/Slug/styles.js +0 -20
  116. package/src/components/Slug/styles.ts +0 -24
  117. package/src/components/StringList/SortableList/SortableList.d.ts +0 -18
  118. package/src/components/StringList/SortableList/SortableList.js +0 -37
  119. package/src/components/StringList/SortableList/SortableList.tsx +0 -98
  120. package/src/components/StringList/SortableList/components/SortableItem/DragHandle.d.ts +0 -7
  121. package/src/components/StringList/SortableList/components/SortableItem/DragHandle.js +0 -8
  122. package/src/components/StringList/SortableList/components/SortableItem/DragHandle.tsx +0 -20
  123. package/src/components/StringList/SortableList/components/SortableItem/SortableItem.d.ts +0 -8
  124. package/src/components/StringList/SortableList/components/SortableItem/SortableItem.js +0 -28
  125. package/src/components/StringList/SortableList/components/SortableItem/SortableItem.tsx +0 -59
  126. package/src/components/StringList/SortableList/components/SortableItem/styles.d.ts +0 -2
  127. package/src/components/StringList/SortableList/components/SortableItem/styles.js +0 -20
  128. package/src/components/StringList/SortableList/components/SortableItem/styles.ts +0 -22
  129. package/src/components/StringList/SortableList/components/SortableItem/types.d.ts +0 -6
  130. package/src/components/StringList/SortableList/components/SortableItem/types.ts +0 -7
  131. package/src/components/StringList/SortableList/components/index.d.ts +0 -2
  132. package/src/components/StringList/SortableList/components/index.js +0 -2
  133. package/src/components/StringList/SortableList/components/index.ts +0 -2
  134. package/src/components/StringList/SortableList/index.d.ts +0 -1
  135. package/src/components/StringList/SortableList/index.js +0 -1
  136. package/src/components/StringList/SortableList/index.ts +0 -1
  137. package/src/components/StringList/SortableList/styles.d.ts +0 -1
  138. package/src/components/StringList/SortableList/styles.js +0 -8
  139. package/src/components/StringList/SortableList/styles.ts +0 -9
  140. package/src/components/StringList/StringList.d.ts +0 -8
  141. package/src/components/StringList/StringList.js +0 -60
  142. package/src/components/StringList/StringList.tsx +0 -136
  143. package/src/components/StringList/StringListShow.d.ts +0 -7
  144. package/src/components/StringList/StringListShow.js +0 -14
  145. package/src/components/StringList/StringListShow.tsx +0 -37
  146. package/src/components/StringList/constants.d.ts +0 -1
  147. package/src/components/StringList/constants.js +0 -1
  148. package/src/components/StringList/constants.ts +0 -1
  149. package/src/components/StringList/index.d.ts +0 -2
  150. package/src/components/StringList/index.js +0 -2
  151. package/src/components/StringList/index.ts +0 -2
  152. package/src/components/StringList/styles.d.ts +0 -8
  153. package/src/components/StringList/styles.js +0 -33
  154. package/src/components/StringList/styles.ts +0 -41
  155. package/src/components/index.d.ts +0 -7
  156. package/src/components/index.js +0 -10
  157. package/src/components/index.ts +0 -10
  158. /package/{src/components/ColorStatus/types.js → dist/components/Slug/SlugOptions.type.js} +0 -0
  159. /package/{src/components/StringList/SortableList/components/SortableItem/types.js → dist/types/upload-provider.js} +0 -0
@@ -1,29 +0,0 @@
1
- import Quote from "@editorjs/quote";
2
- import Table from "@editorjs/table";
3
- export declare const EDITOR_TOOLS: {
4
- paragraph: {
5
- class: any;
6
- inlineToolbar: boolean;
7
- };
8
- list: {
9
- class: any;
10
- inlineToolbar: boolean;
11
- };
12
- header: {
13
- class: any;
14
- config: {
15
- placeholder: string;
16
- levels: number[];
17
- defaultLevel: number;
18
- };
19
- };
20
- table: {
21
- class: typeof Table;
22
- inlineToolbar: boolean;
23
- };
24
- quote: {
25
- class: typeof Quote;
26
- inlineToolbar: boolean;
27
- };
28
- audioPlayer: any;
29
- };
@@ -1,34 +0,0 @@
1
- import Header from "@editorjs/header";
2
- import List from "@editorjs/list";
3
- import Paragraph from "@editorjs/paragraph";
4
- import Quote from "@editorjs/quote";
5
- import Table from "@editorjs/table";
6
- // @ts-ignore
7
- import AudioPlayer from "editorjs-audio-player";
8
- export const EDITOR_TOOLS = {
9
- paragraph: {
10
- class: Paragraph,
11
- inlineToolbar: true,
12
- },
13
- list: {
14
- class: List,
15
- inlineToolbar: true,
16
- },
17
- header: {
18
- class: Header,
19
- config: {
20
- placeholder: "Enter a header",
21
- levels: [2, 3, 4],
22
- defaultLevel: 2,
23
- },
24
- },
25
- table: {
26
- class: Table,
27
- inlineToolbar: true,
28
- },
29
- quote: {
30
- class: Quote,
31
- inlineToolbar: true,
32
- },
33
- audioPlayer: AudioPlayer,
34
- };
@@ -1,35 +0,0 @@
1
- import Header from "@editorjs/header";
2
- import List from "@editorjs/list";
3
- import Paragraph from "@editorjs/paragraph";
4
- import Quote from "@editorjs/quote";
5
- import Table from "@editorjs/table";
6
- // @ts-ignore
7
- import AudioPlayer from "editorjs-audio-player";
8
-
9
- export const EDITOR_TOOLS = {
10
- paragraph: {
11
- class: Paragraph,
12
- inlineToolbar: true,
13
- },
14
- list: {
15
- class: List,
16
- inlineToolbar: true,
17
- },
18
- header: {
19
- class: Header,
20
- config: {
21
- placeholder: "Enter a header",
22
- levels: [2, 3, 4],
23
- defaultLevel: 2,
24
- },
25
- },
26
- table: {
27
- class: Table,
28
- inlineToolbar: true,
29
- },
30
- quote: {
31
- class: Quote,
32
- inlineToolbar: true,
33
- },
34
- audioPlayer: AudioPlayer,
35
- };
@@ -1,3 +0,0 @@
1
- export * from "./Editor.jsx";
2
- export * from "./EditorShow.jsx";
3
- export * from "./EditorList.jsx";
@@ -1,3 +0,0 @@
1
- export * from "./Editor.jsx";
2
- export * from "./EditorShow.jsx";
3
- export * from "./EditorList.jsx";
@@ -1,3 +0,0 @@
1
- export * from "./Editor.jsx";
2
- export * from "./EditorShow.jsx";
3
- export * from "./EditorList.jsx";
@@ -1,6 +0,0 @@
1
- export declare const StyledLabel: any;
2
- export declare const StyledShowLabel: any;
3
- export declare const StyledEditorWrapper: any;
4
- export declare const StyledEditorViewWrapper: any;
5
- export declare const StyledEditorShowWrapper: any;
6
- export declare const StyledEditor: any;
@@ -1,145 +0,0 @@
1
- import { Box } from "@adminjs/design-system";
2
- import { styled } from "@adminjs/design-system/styled-components";
3
- export const StyledLabel = styled.div `
4
- font-size: 12px;
5
- margin-bottom: 8px;
6
- text-transform: capitalize;
7
- `;
8
- export const StyledShowLabel = styled(StyledLabel) `
9
- color: rgb(137, 138, 154);
10
- font-weight: 300;
11
- `;
12
- export const StyledEditorWrapper = styled(Box) `
13
- padding: 12px;
14
- margin-bottom: 24px;
15
- border: 1px solid rgb(187, 195, 203);
16
- `;
17
- export const StyledEditorViewWrapper = styled(Box) `
18
- h1,
19
- h2,
20
- h3 {
21
- margin-bottom: 5px;
22
- font-weight: bold;
23
- }
24
-
25
- h1 {
26
- font-size: 18px;
27
- }
28
-
29
- h2 {
30
- font-size: 16px;
31
- }
32
-
33
- h3 {
34
- font-size: 14px;
35
- }
36
-
37
- p {
38
- margin-bottom: 8px;
39
- }
40
-
41
- ol,
42
- ul {
43
- margin-left: 20px;
44
- margin-bottom: 8px;
45
- }
46
-
47
- ol {
48
- list-style: auto;
49
- }
50
-
51
- ul {
52
- list-style: inherit;
53
- }
54
-
55
- table,
56
- audio {
57
- margin: 16px 0;
58
- }
59
-
60
- table,
61
- th,
62
- td {
63
- border: 1px solid;
64
- }
65
-
66
- th {
67
- font-weight: bold;
68
- }
69
-
70
- th,
71
- td {
72
- padding: 4px;
73
- }
74
-
75
- blockquote {
76
- display: block;
77
- padding: 5px 8px;
78
- width: fit-content;
79
- border-radius: 4px;
80
- background-color: #e6e6e6;
81
- }
82
- `;
83
- export const StyledEditorShowWrapper = styled(StyledEditorViewWrapper) `
84
- margin-bottom: 24px;
85
- `;
86
- export const StyledEditor = styled.div `
87
- audio,
88
- .cdx-block,
89
- .ce-header {
90
- padding-left: 58px;
91
- }
92
-
93
- input {
94
- margin-left: 58px;
95
- width: auto;
96
- }
97
-
98
- .cdx-list {
99
- padding-left: 85px;
100
- }
101
-
102
- .ce-block__content {
103
- width: 100%;
104
- max-width: none;
105
- }
106
-
107
- .ce-toolbar__content {
108
- max-width: none;
109
- left: 0;
110
- }
111
-
112
- .ce-toolbar__actions {
113
- left: 0;
114
- }
115
-
116
- h1.ce-header {
117
- font-size: 22px;
118
- font-weight: bold;
119
- }
120
-
121
- h2.ce-header {
122
- font-size: 20px;
123
- font-weight: bold;
124
- }
125
-
126
- h3.ce-header {
127
- font-size: 18px;
128
- font-weight: bold;
129
- }
130
-
131
- h4.ce-header {
132
- font-size: 16px;
133
- font-weight: bold;
134
- }
135
-
136
- h5.ce-header {
137
- font-size: 15px;
138
- font-weight: bold;
139
- }
140
-
141
- h6.ce-header {
142
- font-size: 14px;
143
- font-weight: bold;
144
- }
145
- `;
@@ -1,151 +0,0 @@
1
- import { Box } from "@adminjs/design-system";
2
- import { styled } from "@adminjs/design-system/styled-components";
3
-
4
- export const StyledLabel = styled.div`
5
- font-size: 12px;
6
- margin-bottom: 8px;
7
- text-transform: capitalize;
8
- `;
9
-
10
- export const StyledShowLabel = styled(StyledLabel)`
11
- color: rgb(137, 138, 154);
12
- font-weight: 300;
13
- `;
14
-
15
- export const StyledEditorWrapper = styled(Box)`
16
- padding: 12px;
17
- margin-bottom: 24px;
18
- border: 1px solid rgb(187, 195, 203);
19
- `;
20
-
21
- export const StyledEditorViewWrapper = styled(Box)`
22
- h1,
23
- h2,
24
- h3 {
25
- margin-bottom: 5px;
26
- font-weight: bold;
27
- }
28
-
29
- h1 {
30
- font-size: 18px;
31
- }
32
-
33
- h2 {
34
- font-size: 16px;
35
- }
36
-
37
- h3 {
38
- font-size: 14px;
39
- }
40
-
41
- p {
42
- margin-bottom: 8px;
43
- }
44
-
45
- ol,
46
- ul {
47
- margin-left: 20px;
48
- margin-bottom: 8px;
49
- }
50
-
51
- ol {
52
- list-style: auto;
53
- }
54
-
55
- ul {
56
- list-style: inherit;
57
- }
58
-
59
- table,
60
- audio {
61
- margin: 16px 0;
62
- }
63
-
64
- table,
65
- th,
66
- td {
67
- border: 1px solid;
68
- }
69
-
70
- th {
71
- font-weight: bold;
72
- }
73
-
74
- th,
75
- td {
76
- padding: 4px;
77
- }
78
-
79
- blockquote {
80
- display: block;
81
- padding: 5px 8px;
82
- width: fit-content;
83
- border-radius: 4px;
84
- background-color: #e6e6e6;
85
- }
86
- `;
87
-
88
- export const StyledEditorShowWrapper = styled(StyledEditorViewWrapper)`
89
- margin-bottom: 24px;
90
- `;
91
-
92
- export const StyledEditor = styled.div`
93
- audio,
94
- .cdx-block,
95
- .ce-header {
96
- padding-left: 58px;
97
- }
98
-
99
- input {
100
- margin-left: 58px;
101
- width: auto;
102
- }
103
-
104
- .cdx-list {
105
- padding-left: 85px;
106
- }
107
-
108
- .ce-block__content {
109
- width: 100%;
110
- max-width: none;
111
- }
112
-
113
- .ce-toolbar__content {
114
- max-width: none;
115
- left: 0;
116
- }
117
-
118
- .ce-toolbar__actions {
119
- left: 0;
120
- }
121
-
122
- h1.ce-header {
123
- font-size: 22px;
124
- font-weight: bold;
125
- }
126
-
127
- h2.ce-header {
128
- font-size: 20px;
129
- font-weight: bold;
130
- }
131
-
132
- h3.ce-header {
133
- font-size: 18px;
134
- font-weight: bold;
135
- }
136
-
137
- h4.ce-header {
138
- font-size: 16px;
139
- font-weight: bold;
140
- }
141
-
142
- h5.ce-header {
143
- font-size: 15px;
144
- font-weight: bold;
145
- }
146
-
147
- h6.ce-header {
148
- font-size: 14px;
149
- font-weight: bold;
150
- }
151
- `;
@@ -1,5 +0,0 @@
1
- import { EditPropertyProps } from "adminjs";
2
- import { FC } from "react";
3
- type CustomSlugTypes = Omit<EditPropertyProps, "where">;
4
- declare const SlugEdit: FC<CustomSlugTypes>;
5
- export default SlugEdit;
@@ -1,27 +0,0 @@
1
- import React, { useEffect, useState, } from "react";
2
- import { ThemeProvider } from "styled-components";
3
- import { theme } from "@adminjs/design-system";
4
- import { slugifyTitle } from "../../utils";
5
- import { StyledCustomInput, StyledGenerateButton, StyledInputWrapper, StyledLabel, } from "./styles.js";
6
- const SlugEdit = ({ property, record, resource, onChange, }) => {
7
- const [inputValue, setInputValue] = useState(record.params.slug);
8
- useEffect(() => {
9
- onChange(property.path, inputValue);
10
- }, [inputValue]);
11
- return (React.createElement(ThemeProvider, { theme: theme },
12
- React.createElement(StyledLabel, { htmlFor: "customSlug" }, property.path),
13
- React.createElement(StyledInputWrapper, null,
14
- React.createElement(StyledCustomInput, { id: property.path, name: property.path, value: inputValue, onChange: handleInput }),
15
- React.createElement(StyledGenerateButton, { variant: "outlined", onClick: generateSlug }, "Generate Slug"))));
16
- function handleInput(e) {
17
- setInputValue(e.target.value);
18
- }
19
- function generateSlug(e) {
20
- e.preventDefault();
21
- const slugSource = record.params[property.props.sourceField ?? resource.titleProperty.name];
22
- if (slugSource) {
23
- setInputValue(slugifyTitle(slugSource));
24
- }
25
- }
26
- };
27
- export default SlugEdit;
@@ -1,68 +0,0 @@
1
- import { EditPropertyProps } from "adminjs";
2
- import React, {
3
- ChangeEvent,
4
- FC,
5
- SyntheticEvent,
6
- useEffect,
7
- useState,
8
- } from "react";
9
- import { ThemeProvider } from "styled-components";
10
-
11
- import { theme } from "@adminjs/design-system";
12
-
13
- import { slugifyTitle } from "../../utils";
14
-
15
- import {
16
- StyledCustomInput,
17
- StyledGenerateButton,
18
- StyledInputWrapper,
19
- StyledLabel,
20
- } from "./styles.js";
21
-
22
- type CustomSlugTypes = Omit<EditPropertyProps, "where">;
23
-
24
- const SlugEdit: FC<CustomSlugTypes> = ({
25
- property,
26
- record,
27
- resource,
28
- onChange,
29
- }) => {
30
- const [inputValue, setInputValue] = useState(record.params.slug);
31
-
32
- useEffect(() => {
33
- onChange(property.path, inputValue);
34
- }, [inputValue]);
35
-
36
- return (
37
- <ThemeProvider theme={theme}>
38
- <StyledLabel htmlFor="customSlug">{property.path}</StyledLabel>
39
- <StyledInputWrapper>
40
- <StyledCustomInput
41
- id={property.path}
42
- name={property.path}
43
- value={inputValue}
44
- onChange={handleInput}
45
- />
46
- <StyledGenerateButton variant="outlined" onClick={generateSlug}>
47
- Generate Slug
48
- </StyledGenerateButton>
49
- </StyledInputWrapper>
50
- </ThemeProvider>
51
- );
52
-
53
- function handleInput(e: ChangeEvent<HTMLInputElement>) {
54
- setInputValue(e.target.value);
55
- }
56
-
57
- function generateSlug(e: SyntheticEvent<HTMLInputElement>) {
58
- e.preventDefault();
59
- const slugSource =
60
- record.params[property.props.sourceField ?? resource.titleProperty.name];
61
-
62
- if (slugSource) {
63
- setInputValue(slugifyTitle(slugSource));
64
- }
65
- }
66
- };
67
-
68
- export default SlugEdit;
@@ -1,7 +0,0 @@
1
- import { ComponentLoader, FeatureType } from "adminjs";
2
- type SlugOptions = {
3
- componentLoader: ComponentLoader;
4
- key: string;
5
- };
6
- declare const SlugFeature: (config: SlugOptions) => FeatureType;
7
- export default SlugFeature;
@@ -1,21 +0,0 @@
1
- import { buildFeature } from "adminjs";
2
- import { bundleComponent } from "../../utils/bundle-component";
3
- const COMPONENT_NAME = 'Slug';
4
- const SlugFeature = (config) => {
5
- const { componentLoader, key } = config;
6
- const slugFeature = () => {
7
- const editComponent = bundleComponent(componentLoader, COMPONENT_NAME, 'SlugEdit.tsx');
8
- return buildFeature({
9
- properties: {
10
- [key]: {
11
- isVisible: { show: false, edit: true, list: false, filter: false },
12
- components: {
13
- edit: editComponent,
14
- },
15
- },
16
- },
17
- });
18
- };
19
- return slugFeature();
20
- };
21
- export default SlugFeature;
@@ -1,30 +0,0 @@
1
- import {buildFeature, ComponentLoader, FeatureType} from "adminjs";
2
- import {bundleComponent} from "../../utils/bundle-component";
3
-
4
- const COMPONENT_NAME = 'Slug'
5
-
6
- type SlugOptions = {
7
- componentLoader: ComponentLoader
8
- key: string
9
- }
10
- const SlugFeature = (config: SlugOptions): FeatureType => {
11
- const {componentLoader,key} = config
12
-
13
- const slugFeature = () => {
14
- const editComponent = bundleComponent(componentLoader, COMPONENT_NAME, 'SlugEdit')
15
- return buildFeature({
16
- properties: {
17
- [key]: {
18
- isVisible: { show: false, edit: true, list: false, filter: false },
19
- components: {
20
- edit: editComponent,
21
- },
22
- },
23
- },
24
- })
25
- }
26
-
27
- return slugFeature()
28
- }
29
-
30
- export default SlugFeature
@@ -1 +0,0 @@
1
- export { default } from "./SlugFeature.js";
@@ -1 +0,0 @@
1
- export { default } from "./SlugFeature.js";
@@ -1 +0,0 @@
1
- export { default } from "./SlugFeature.js";
@@ -1,4 +0,0 @@
1
- export declare const StyledInputWrapper: any;
2
- export declare const StyledCustomInput: any;
3
- export declare const StyledGenerateButton: any;
4
- export declare const StyledLabel: any;
@@ -1,20 +0,0 @@
1
- // @ts-ignore
2
- import { styled } from "@adminjs/design-system/styled-components";
3
- // @ts-ignore
4
- import { Box, Button, Input } from "@adminjs/design-system";
5
- export const StyledInputWrapper = styled(Box) `
6
- display: flex;
7
- margin-bottom: 40px;
8
- `;
9
- export const StyledCustomInput = styled(Input) `
10
- width: 100%;
11
- margin-right: 10px;
12
- `;
13
- export const StyledGenerateButton = styled(Button) `
14
- white-space: nowrap;
15
- `;
16
- export const StyledLabel = styled.div `
17
- font-size: 12px;
18
- margin-bottom: 8px;
19
- text-transform: capitalize;
20
- `;
@@ -1,24 +0,0 @@
1
- // @ts-ignore
2
- import { styled } from "@adminjs/design-system/styled-components";
3
- // @ts-ignore
4
- import { Box, Button, Input } from "@adminjs/design-system";
5
-
6
- export const StyledInputWrapper = styled(Box)`
7
- display: flex;
8
- margin-bottom: 40px;
9
- `;
10
-
11
- export const StyledCustomInput = styled(Input)`
12
- width: 100%;
13
- margin-right: 10px;
14
- `;
15
-
16
- export const StyledGenerateButton = styled(Button)`
17
- white-space: nowrap;
18
- `;
19
-
20
- export const StyledLabel = styled.div`
21
- font-size: 12px;
22
- margin-bottom: 8px;
23
- text-transform: capitalize;
24
- `;
@@ -1,18 +0,0 @@
1
- import React from "react";
2
- import type { ReactNode } from "react";
3
- import { SortableItem } from "./components/index.js";
4
- import type { UniqueIdentifier } from "@dnd-kit/core";
5
- interface BaseItem {
6
- id: UniqueIdentifier;
7
- value: string;
8
- }
9
- interface Props<T extends BaseItem> {
10
- items: T[];
11
- onChange(items: T[]): void;
12
- renderItem(item: T): ReactNode;
13
- }
14
- export declare function SortableList<T extends BaseItem>({ items, onChange, renderItem, }: Props<T>): React.JSX.Element;
15
- export declare namespace SortableList {
16
- var Item: typeof SortableItem;
17
- }
18
- export {};