@rulab/adminjs-components 0.0.7 → 0.0.8

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 CHANGED
@@ -32,6 +32,7 @@ var src_exports = {};
32
32
  __export(src_exports, {
33
33
  CustomSlug: () => CustomSlug_default,
34
34
  Editor: () => Editor_default,
35
+ EditorList: () => EditorList_default,
35
36
  EditorShow: () => EditorShow_default,
36
37
  StringList: () => StringList_default,
37
38
  StringListShow: () => StringListShow_default
@@ -398,9 +399,7 @@ var StyledEditorWrapper = (0, import_styled_components8.styled)(import_design_sy
398
399
  margin-bottom: 24px;
399
400
  border: 1px solid rgb(187, 195, 203);
400
401
  `;
401
- var StyledEditorShowWrapper = (0, import_styled_components8.styled)(import_design_system7.Box)`
402
- margin-bottom: 24px;
403
-
402
+ var StyledEditorViewWrapper = (0, import_styled_components8.styled)(import_design_system7.Box)`
404
403
  h1,
405
404
  h2,
406
405
  h3 {
@@ -438,6 +437,9 @@ var StyledEditorShowWrapper = (0, import_styled_components8.styled)(import_desig
438
437
  list-style: inherit;
439
438
  }
440
439
  `;
440
+ var StyledEditorShowWrapper = (0, import_styled_components8.styled)(StyledEditorViewWrapper)`
441
+ margin-bottom: 24px;
442
+ `;
441
443
  var StyledEditor = import_styled_components8.styled.div`
442
444
  .cdx-block,
443
445
  .ce-header {
@@ -558,10 +560,21 @@ var EditorShow = ({ property, record }) => {
558
560
  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 } })));
559
561
  };
560
562
  var EditorShow_default = EditorShow;
563
+
564
+ // src/components/Editor/EditorList.jsx
565
+ var import_react9 = __toESM(require("react"), 1);
566
+ var import_styled_components11 = require("styled-components");
567
+ var import_design_system10 = require("@adminjs/design-system");
568
+ var EditorList = ({ property, record }) => {
569
+ const htmlContent = parseHtml(record.params[property.path]);
570
+ return /* @__PURE__ */ import_react9.default.createElement(import_styled_components11.ThemeProvider, { theme: import_design_system10.theme }, /* @__PURE__ */ import_react9.default.createElement(StyledEditorViewWrapper, null, htmlContent && /* @__PURE__ */ import_react9.default.createElement("div", { dangerouslySetInnerHTML: { __html: htmlContent } })));
571
+ };
572
+ var EditorList_default = EditorList;
561
573
  // Annotate the CommonJS export names for ESM import in node:
562
574
  0 && (module.exports = {
563
575
  CustomSlug,
564
576
  Editor,
577
+ EditorList,
565
578
  EditorShow,
566
579
  StringList,
567
580
  StringListShow
package/dist/index.d.cts CHANGED
@@ -27,4 +27,9 @@ declare function EditorShow({ property, record }: {
27
27
  record: any;
28
28
  }): React.JSX.Element;
29
29
 
30
- export { CustomSlug, Editor, EditorShow, StringList, StringListShow };
30
+ declare function EditorList({ property, record }: {
31
+ property: any;
32
+ record: any;
33
+ }): React.JSX.Element;
34
+
35
+ export { CustomSlug, Editor, EditorList, EditorShow, StringList, StringListShow };
package/dist/index.d.ts CHANGED
@@ -27,4 +27,9 @@ declare function EditorShow({ property, record }: {
27
27
  record: any;
28
28
  }): React.JSX.Element;
29
29
 
30
- export { CustomSlug, Editor, EditorShow, StringList, StringListShow };
30
+ declare function EditorList({ property, record }: {
31
+ property: any;
32
+ record: any;
33
+ }): React.JSX.Element;
34
+
35
+ export { CustomSlug, Editor, EditorList, EditorShow, StringList, StringListShow };
package/dist/index.js CHANGED
@@ -377,9 +377,7 @@ var StyledEditorWrapper = styled5(Box3)`
377
377
  margin-bottom: 24px;
378
378
  border: 1px solid rgb(187, 195, 203);
379
379
  `;
380
- var StyledEditorShowWrapper = styled5(Box3)`
381
- margin-bottom: 24px;
382
-
380
+ var StyledEditorViewWrapper = styled5(Box3)`
383
381
  h1,
384
382
  h2,
385
383
  h3 {
@@ -417,6 +415,9 @@ var StyledEditorShowWrapper = styled5(Box3)`
417
415
  list-style: inherit;
418
416
  }
419
417
  `;
418
+ var StyledEditorShowWrapper = styled5(StyledEditorViewWrapper)`
419
+ margin-bottom: 24px;
420
+ `;
420
421
  var StyledEditor = styled5.div`
421
422
  .cdx-block,
422
423
  .ce-header {
@@ -515,7 +516,7 @@ var Editor = ({ property, record, onChangeAdmin, editorId }) => {
515
516
  var Editor_default = Editor;
516
517
 
517
518
  // src/components/Editor/EditorShow.jsx
518
- import React8, { memo as memo3, useState as useState6, useEffect as useEffect5, useRef as useRef3 } from "react";
519
+ import React8 from "react";
519
520
  import { ThemeProvider as ThemeProvider5 } from "styled-components";
520
521
  import { theme as theme5 } from "@adminjs/design-system";
521
522
 
@@ -537,9 +538,20 @@ var EditorShow = ({ property, record }) => {
537
538
  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 } })));
538
539
  };
539
540
  var EditorShow_default = EditorShow;
541
+
542
+ // src/components/Editor/EditorList.jsx
543
+ import React9 from "react";
544
+ import { ThemeProvider as ThemeProvider6 } from "styled-components";
545
+ import { theme as theme6 } from "@adminjs/design-system";
546
+ var EditorList = ({ property, record }) => {
547
+ const htmlContent = parseHtml(record.params[property.path]);
548
+ return /* @__PURE__ */ React9.createElement(ThemeProvider6, { theme: theme6 }, /* @__PURE__ */ React9.createElement(StyledEditorViewWrapper, null, htmlContent && /* @__PURE__ */ React9.createElement("div", { dangerouslySetInnerHTML: { __html: htmlContent } })));
549
+ };
550
+ var EditorList_default = EditorList;
540
551
  export {
541
552
  CustomSlug_default as CustomSlug,
542
553
  Editor_default as Editor,
554
+ EditorList_default as EditorList,
543
555
  EditorShow_default as EditorShow,
544
556
  StringList_default as StringList,
545
557
  StringListShow_default as StringListShow
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rulab/adminjs-components",
3
- "version": "0.0.7",
3
+ "version": "0.0.8",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.mjs",
6
6
  "types": "dist/index.d.ts",
@@ -0,0 +1,23 @@
1
+ import React from "react";
2
+ import { ThemeProvider } from "styled-components";
3
+ import { theme } from "@adminjs/design-system";
4
+
5
+ import { parseHtml } from "../../utils/parseHtml";
6
+
7
+ import { StyledEditorViewWrapper } from "./styles";
8
+
9
+ const EditorList = ({ property, record }) => {
10
+ const htmlContent = parseHtml(record.params[property.path]);
11
+
12
+ return (
13
+ <ThemeProvider theme={theme}>
14
+ <StyledEditorViewWrapper>
15
+ {htmlContent && (
16
+ <div dangerouslySetInnerHTML={{ __html: htmlContent }} />
17
+ )}
18
+ </StyledEditorViewWrapper>
19
+ </ThemeProvider>
20
+ );
21
+ };
22
+
23
+ export default EditorList;
@@ -1,4 +1,4 @@
1
- import React, { memo, useState, useEffect, useRef } from "react";
1
+ import React from "react";
2
2
  import { ThemeProvider } from "styled-components";
3
3
  import { theme } from "@adminjs/design-system";
4
4
 
@@ -1,2 +1,3 @@
1
1
  export * from "./Editor.jsx";
2
2
  export * from "./EditorShow.jsx";
3
+ export * from "./EditorList.jsx";
@@ -18,9 +18,7 @@ export const StyledEditorWrapper = styled(Box)`
18
18
  border: 1px solid rgb(187, 195, 203);
19
19
  `;
20
20
 
21
- export const StyledEditorShowWrapper = styled(Box)`
22
- margin-bottom: 24px;
23
-
21
+ export const StyledEditorViewWrapper = styled(Box)`
24
22
  h1,
25
23
  h2,
26
24
  h3 {
@@ -59,6 +57,10 @@ export const StyledEditorShowWrapper = styled(Box)`
59
57
  }
60
58
  `;
61
59
 
60
+ export const StyledEditorShowWrapper = styled(StyledEditorViewWrapper)`
61
+ margin-bottom: 24px;
62
+ `;
63
+
62
64
  export const StyledEditor = styled.div`
63
65
  .cdx-block,
64
66
  .ce-header {
@@ -3,3 +3,4 @@ export { default as StringList } from "./StringList/StringList.js";
3
3
  export { default as StringListShow } from "./StringList/StringListShow.js";
4
4
  export { default as Editor } from "./Editor/Editor.jsx";
5
5
  export { default as EditorShow } from "./Editor/EditorShow.jsx";
6
+ export { default as EditorList } from "./Editor/EditorList.jsx";