@rulab/adminjs-components 0.0.13 → 0.1.0-alpha.10
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/LICENSE +21 -21
- package/dist/components/ColorStatus/ColorStatusEdit.d.ts +5 -0
- package/dist/components/ColorStatus/ColorStatusEdit.js +58 -0
- package/dist/components/ColorStatus/ColorStatusList.d.ts +4 -0
- package/dist/components/ColorStatus/ColorStatusList.js +7 -0
- package/dist/components/ColorStatus/ColorStatusShow.d.ts +4 -0
- package/dist/components/ColorStatus/ColorStatusShow.js +9 -0
- package/dist/components/ColorStatus/index.d.ts +3 -0
- package/dist/components/ColorStatus/index.js +3 -0
- package/dist/components/ColorStatus/styles.d.ts +5 -0
- package/dist/components/ColorStatus/styles.js +25 -0
- package/dist/components/ColorStatus/types.d.ts +5 -0
- package/dist/components/ColorStatus/types.js +1 -0
- package/dist/components/Editor/Editor.d.ts +11 -0
- package/dist/components/Editor/Editor.js +33 -0
- package/dist/components/Editor/EditorList.d.ts +9 -0
- package/dist/components/Editor/EditorList.js +10 -0
- package/dist/components/Editor/EditorShow.d.ts +9 -0
- package/dist/components/Editor/EditorShow.js +10 -0
- package/dist/components/Editor/config.d.ts +29 -0
- package/dist/components/Editor/config.js +26 -3
- package/dist/components/Editor/index.d.ts +3 -0
- package/dist/components/Editor/index.js +3 -1
- package/dist/components/Editor/styles.d.ts +6 -0
- package/dist/components/Editor/styles.js +140 -59
- package/dist/components/Slug/SlugEdit.d.ts +5 -0
- package/dist/components/Slug/SlugEdit.js +27 -0
- package/dist/components/Slug/SlugFeature.d.ts +7 -0
- package/dist/components/Slug/SlugFeature.js +21 -0
- package/dist/components/Slug/index.d.ts +1 -0
- package/dist/components/Slug/index.js +1 -0
- package/dist/components/Slug/styles.d.ts +4 -0
- package/dist/components/{CustomSlug → Slug}/styles.js +14 -9
- package/dist/components/StringList/SortableList/SortableList.d.ts +18 -0
- package/dist/components/StringList/SortableList/{SortableList.jsx → SortableList.js} +13 -19
- package/dist/components/StringList/SortableList/components/SortableItem/DragHandle.d.ts +7 -0
- package/dist/components/StringList/SortableList/components/SortableItem/DragHandle.js +8 -0
- package/dist/components/StringList/SortableList/components/SortableItem/SortableItem.d.ts +8 -0
- package/dist/components/StringList/SortableList/components/SortableItem/{SortableItem.jsx → SortableItem.js} +7 -11
- package/dist/components/StringList/SortableList/components/SortableItem/styles.d.ts +2 -0
- package/dist/components/StringList/SortableList/components/SortableItem/styles.js +18 -18
- package/dist/components/StringList/SortableList/components/SortableItem/types.d.ts +6 -0
- package/dist/components/StringList/SortableList/components/index.d.ts +2 -0
- package/dist/components/StringList/SortableList/index.d.ts +1 -0
- package/dist/components/StringList/SortableList/styles.d.ts +1 -0
- package/dist/components/StringList/SortableList/styles.js +6 -6
- package/dist/components/StringList/StringList.d.ts +8 -0
- package/dist/components/StringList/StringList.js +60 -0
- package/dist/components/StringList/StringListShow.d.ts +7 -0
- package/dist/components/StringList/StringListShow.js +14 -0
- package/dist/components/StringList/constants.d.ts +1 -0
- package/dist/components/StringList/constants.js +1 -0
- package/dist/components/StringList/index.d.ts +2 -0
- package/dist/components/StringList/index.js +2 -1
- package/dist/components/StringList/styles.d.ts +8 -0
- package/dist/components/StringList/styles.js +28 -11
- package/dist/components/index.d.ts +7 -0
- package/dist/components/index.js +9 -2
- package/dist/index.d.ts +2 -44
- package/dist/index.js +2 -757
- package/dist/scripts/fix-import-extensions.d.ts +1 -0
- package/dist/scripts/fix-import-extensions.js +39 -0
- package/dist/utils/bundle-component.d.ts +2 -0
- package/dist/utils/bundle-component.js +8 -0
- package/{src/utils/index.ts → dist/utils/index.d.ts} +0 -1
- package/dist/utils/index.js +1 -0
- package/dist/utils/parseHtml.d.ts +1 -0
- package/dist/utils/parseHtml.js +37 -0
- package/dist/utils/slugifyImport.d.ts +3 -0
- package/dist/utils/slugifyImport.js +1 -1
- package/dist/utils/slugifyTitle.d.ts +1 -0
- package/dist/utils/slugifyTitle.js +3 -3
- package/package.json +14 -8
- package/src/components/ColorStatus/ColorStatusEdit.d.ts +5 -0
- package/src/components/ColorStatus/ColorStatusEdit.js +58 -0
- package/src/components/ColorStatus/ColorStatusEdit.tsx +94 -94
- package/src/components/ColorStatus/ColorStatusList.d.ts +4 -0
- package/src/components/ColorStatus/ColorStatusList.js +7 -0
- package/src/components/ColorStatus/ColorStatusList.tsx +20 -20
- package/src/components/ColorStatus/ColorStatusShow.d.ts +4 -0
- package/src/components/ColorStatus/ColorStatusShow.js +9 -0
- package/src/components/ColorStatus/ColorStatusShow.tsx +23 -23
- package/src/components/ColorStatus/index.d.ts +3 -0
- package/src/components/ColorStatus/index.js +3 -0
- package/src/components/ColorStatus/index.ts +3 -3
- package/src/components/ColorStatus/styles.d.ts +5 -0
- package/src/components/ColorStatus/styles.js +25 -0
- package/src/components/ColorStatus/styles.ts +30 -30
- package/src/components/ColorStatus/types.d.ts +5 -0
- package/src/components/ColorStatus/types.js +1 -0
- package/src/components/ColorStatus/types.ts +5 -5
- package/src/components/Editor/Editor.d.ts +8 -0
- package/src/components/Editor/Editor.js +36 -0
- package/src/components/Editor/Editor.jsx +49 -49
- package/src/components/Editor/EditorList.d.ts +6 -0
- package/src/components/Editor/EditorList.js +11 -0
- package/src/components/Editor/EditorList.jsx +22 -22
- package/src/components/Editor/EditorShow.d.ts +6 -0
- package/src/components/Editor/EditorShow.js +13 -0
- package/src/components/Editor/EditorShow.jsx +24 -24
- package/src/components/Editor/config.d.ts +29 -0
- package/src/components/Editor/config.js +34 -0
- package/src/components/Editor/config.ts +35 -35
- package/src/components/Editor/index.d.ts +3 -0
- package/src/components/Editor/index.js +3 -0
- package/src/components/Editor/index.ts +3 -3
- package/src/components/Editor/styles.d.ts +6 -0
- package/src/components/Editor/styles.js +145 -0
- package/src/components/Editor/styles.ts +151 -151
- package/src/components/Slug/SlugEdit.d.ts +5 -0
- package/src/components/Slug/SlugEdit.js +27 -0
- package/src/components/{CustomSlug/CustomSlug.tsx → Slug/SlugEdit.tsx} +68 -68
- package/src/components/Slug/SlugFeature.d.ts +7 -0
- package/src/components/Slug/SlugFeature.js +21 -0
- package/src/components/Slug/SlugFeature.ts +30 -0
- package/src/components/Slug/index.d.ts +1 -0
- package/src/components/Slug/index.js +1 -0
- package/src/components/Slug/index.ts +1 -0
- package/src/components/Slug/styles.d.ts +4 -0
- package/src/components/Slug/styles.js +20 -0
- package/src/components/{CustomSlug → Slug}/styles.ts +24 -24
- package/src/components/StringList/SortableList/SortableList.d.ts +18 -0
- package/src/components/StringList/SortableList/SortableList.js +37 -0
- package/src/components/StringList/SortableList/SortableList.tsx +98 -98
- package/src/components/StringList/SortableList/components/SortableItem/DragHandle.d.ts +7 -0
- package/src/components/StringList/SortableList/components/SortableItem/DragHandle.js +8 -0
- package/src/components/StringList/SortableList/components/SortableItem/DragHandle.tsx +20 -20
- package/src/components/StringList/SortableList/components/SortableItem/SortableItem.d.ts +8 -0
- package/src/components/StringList/SortableList/components/SortableItem/SortableItem.js +28 -0
- package/src/components/StringList/SortableList/components/SortableItem/SortableItem.tsx +59 -59
- package/src/components/StringList/SortableList/components/SortableItem/styles.d.ts +2 -0
- package/src/components/StringList/SortableList/components/SortableItem/styles.js +20 -0
- package/src/components/StringList/SortableList/components/SortableItem/styles.ts +22 -22
- package/src/components/StringList/SortableList/components/SortableItem/types.d.ts +6 -0
- package/src/components/StringList/SortableList/components/SortableItem/types.js +1 -0
- package/src/components/StringList/SortableList/components/SortableItem/types.ts +7 -7
- package/src/components/StringList/SortableList/components/index.d.ts +2 -0
- package/src/components/StringList/SortableList/components/index.js +2 -0
- package/src/components/StringList/SortableList/components/index.ts +2 -2
- package/src/components/StringList/SortableList/index.d.ts +1 -0
- package/src/components/StringList/SortableList/index.js +1 -0
- package/src/components/StringList/SortableList/index.ts +1 -1
- package/src/components/StringList/SortableList/styles.d.ts +1 -0
- package/src/components/StringList/SortableList/styles.js +8 -0
- package/src/components/StringList/SortableList/styles.ts +9 -9
- package/src/components/StringList/StringList.d.ts +8 -0
- package/src/components/StringList/StringList.js +60 -0
- package/src/components/StringList/StringList.tsx +136 -136
- package/src/components/StringList/StringListShow.d.ts +7 -0
- package/src/components/StringList/StringListShow.js +14 -0
- package/src/components/StringList/StringListShow.tsx +37 -37
- package/src/components/StringList/constants.d.ts +1 -0
- package/src/components/StringList/constants.js +1 -0
- package/src/components/StringList/constants.ts +1 -1
- package/src/components/StringList/index.d.ts +2 -0
- package/src/components/StringList/index.js +2 -0
- package/src/components/StringList/index.ts +2 -2
- package/src/components/StringList/styles.d.ts +8 -0
- package/src/components/StringList/styles.js +33 -0
- package/src/components/StringList/styles.ts +41 -41
- package/src/components/index.d.ts +7 -0
- package/src/components/index.js +10 -0
- package/src/components/index.ts +10 -9
- package/dist/bundle.js +0 -8
- package/dist/components/CustomSlug/CustomSlug.jsx +0 -29
- package/dist/components/CustomSlug/index.js +0 -1
- package/dist/components/StringList/SortableList/components/SortableItem/DragHandle.jsx +0 -10
- package/dist/components/StringList/StringList.jsx +0 -67
- package/dist/editorFeature.js +0 -16
- package/dist/index.cjs +0 -784
- package/dist/index.d.cts +0 -44
- package/dist/index.d.mts +0 -8
- package/dist/index.mjs +0 -37
- package/src/components/CustomSlug/index.ts +0 -1
- package/src/index.ts +0 -2
- package/src/types.d.ts +0 -3
- package/src/utils/parseHtml.ts +0 -56
- package/src/utils/slugifyImport.ts +0 -4
- package/src/utils/slugifyTitle.ts +0 -11
- package/tsconfig.json +0 -17
package/dist/index.d.cts
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import React, { FC } from 'react';
|
|
2
|
-
import { EditPropertyProps, ShowPropertyProps } from 'adminjs';
|
|
3
|
-
|
|
4
|
-
type ColorStatusTypes = Omit<EditPropertyProps, "where" | "resource">;
|
|
5
|
-
declare const ColorStatus: FC<ColorStatusTypes>;
|
|
6
|
-
|
|
7
|
-
declare const ColorStatusShow: FC<ShowPropertyProps>;
|
|
8
|
-
|
|
9
|
-
declare const ColorStatusList: FC<ShowPropertyProps>;
|
|
10
|
-
|
|
11
|
-
type CustomSlugTypes = Omit<EditPropertyProps, "where">;
|
|
12
|
-
declare const CustomSlug: FC<CustomSlugTypes>;
|
|
13
|
-
|
|
14
|
-
declare function Editor({ property, record, onChangeAdmin, editorId }: {
|
|
15
|
-
property: any;
|
|
16
|
-
record: any;
|
|
17
|
-
onChangeAdmin: any;
|
|
18
|
-
editorId: any;
|
|
19
|
-
}): React.JSX.Element;
|
|
20
|
-
|
|
21
|
-
declare function EditorList({ property, record }: {
|
|
22
|
-
property: any;
|
|
23
|
-
record: any;
|
|
24
|
-
}): React.JSX.Element;
|
|
25
|
-
|
|
26
|
-
declare function EditorShow({ property, record }: {
|
|
27
|
-
property: any;
|
|
28
|
-
record: any;
|
|
29
|
-
}): React.JSX.Element;
|
|
30
|
-
|
|
31
|
-
type StringListTypes = Omit<EditPropertyProps, "where" | "resource">;
|
|
32
|
-
interface StringListShowPropsType$1 extends StringListTypes {
|
|
33
|
-
stringListSeparator?: string;
|
|
34
|
-
}
|
|
35
|
-
declare const StringList: FC<StringListShowPropsType$1>;
|
|
36
|
-
|
|
37
|
-
interface StringListShowPropsType extends ShowPropertyProps {
|
|
38
|
-
stringListSeparator?: string;
|
|
39
|
-
}
|
|
40
|
-
declare const StringListShow: FC<StringListShowPropsType>;
|
|
41
|
-
|
|
42
|
-
declare const parseHtml: (jsonData: string) => string | undefined;
|
|
43
|
-
|
|
44
|
-
export { ColorStatus as ColorStatusEdit, ColorStatusList, ColorStatusShow, CustomSlug, Editor, EditorList, EditorShow, StringList, StringListShow, parseHtml };
|
package/dist/index.d.mts
DELETED
package/dist/index.mjs
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
// src/features/editorFeature.ts
|
|
2
|
-
import {
|
|
3
|
-
buildFeature
|
|
4
|
-
} from "adminjs";
|
|
5
|
-
|
|
6
|
-
// src/bundle.ts
|
|
7
|
-
import path from "path";
|
|
8
|
-
import * as url from "url";
|
|
9
|
-
var __dirname = url.fileURLToPath(new URL(".", import.meta.url));
|
|
10
|
-
var bundle = (loader, componentName) => {
|
|
11
|
-
const componentPath = path.join(__dirname, `./components/${componentName}`);
|
|
12
|
-
return loader.add(componentName, componentPath);
|
|
13
|
-
};
|
|
14
|
-
var bundle_default = bundle;
|
|
15
|
-
|
|
16
|
-
// src/features/editorFeature.ts
|
|
17
|
-
var editorFeature = (options) => {
|
|
18
|
-
const { componentLoader } = options;
|
|
19
|
-
const editComponent = bundle_default(componentLoader, "Editor");
|
|
20
|
-
return buildFeature({
|
|
21
|
-
properties: {
|
|
22
|
-
editor: {
|
|
23
|
-
components: {
|
|
24
|
-
edit: editComponent
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
};
|
|
30
|
-
var editorFeature_default = editorFeature;
|
|
31
|
-
|
|
32
|
-
// src/index.ts
|
|
33
|
-
var src_default = editorFeature_default;
|
|
34
|
-
export {
|
|
35
|
-
src_default as default,
|
|
36
|
-
editorFeature_default as editorFeature
|
|
37
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from "./CustomSlug.js";
|
package/src/index.ts
DELETED
package/src/types.d.ts
DELETED
package/src/utils/parseHtml.ts
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import edjsHTML from "editorjs-html";
|
|
2
|
-
|
|
3
|
-
type TableBlockType = {
|
|
4
|
-
type: "table";
|
|
5
|
-
data: {
|
|
6
|
-
content: string[][];
|
|
7
|
-
withHeadings: boolean;
|
|
8
|
-
};
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
type AudioPlayerBlockType = {
|
|
12
|
-
type: "audioPlayer";
|
|
13
|
-
data: {
|
|
14
|
-
src: string;
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
const tableParser = (block: TableBlockType) => {
|
|
19
|
-
const rows = block.data.content.map((row, index) => {
|
|
20
|
-
const tableHtml = [];
|
|
21
|
-
if (block.data.withHeadings && index === 0) {
|
|
22
|
-
tableHtml.push(`<tr>${row.map((cell) => `<th>${cell}</th>`)}</tr>`);
|
|
23
|
-
} else {
|
|
24
|
-
tableHtml.push(`<tr>${row.map((cell) => `<td>${cell}</td>`)}</tr>`);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
return tableHtml;
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
if (block.data.withHeadings) {
|
|
31
|
-
const heading = rows[0] as string[];
|
|
32
|
-
const [, ...content] = rows;
|
|
33
|
-
|
|
34
|
-
return `<table><thead>${heading.join("")}</thead><tbody>${content.join("")}</tbody></table>`;
|
|
35
|
-
} else {
|
|
36
|
-
return `<table><tbody>${rows.join("")}</tbody></table>`;
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
const audioPlayerParser = (block: AudioPlayerBlockType) => {
|
|
41
|
-
return `<audio controls src={${block.data.src}} />`;
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
export const parseHtml = (jsonData: string) => {
|
|
45
|
-
const edjsParser = edjsHTML({
|
|
46
|
-
table: tableParser,
|
|
47
|
-
audioPlayer: audioPlayerParser,
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
try {
|
|
51
|
-
const data = edjsParser.parse(JSON.parse(jsonData));
|
|
52
|
-
return String(data).replace(/>,</g, "><");
|
|
53
|
-
} catch (e) {
|
|
54
|
-
console.log("error", e);
|
|
55
|
-
}
|
|
56
|
-
};
|
package/tsconfig.json
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"esModuleInterop": true,
|
|
4
|
-
"skipLibCheck": true,
|
|
5
|
-
"target": "es2022",
|
|
6
|
-
"allowJs": true,
|
|
7
|
-
"resolveJsonModule": true,
|
|
8
|
-
"moduleDetection": "force",
|
|
9
|
-
"strict": true,
|
|
10
|
-
"noUncheckedIndexedAccess": true,
|
|
11
|
-
"moduleResolution": "Bundler",
|
|
12
|
-
"module": "ESNext",
|
|
13
|
-
"lib": ["es2022", "dom", "dom.iterable"],
|
|
14
|
-
"jsx": "react",
|
|
15
|
-
"noEmit": true
|
|
16
|
-
}
|
|
17
|
-
}
|