@lunejs/admin-ui 0.2.0 → 0.2.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 (39) hide show
  1. package/dist/lib/api/codegen/graphql.d.ts +1 -0
  2. package/dist/lib/api/codegen/graphql.js +8 -8
  3. package/dist/lib/custom-fields/components/details/is-list/custom-field-is-list.js +6 -4
  4. package/dist/lib/custom-fields/components/details/use-form/form-schema.d.ts +1 -0
  5. package/dist/lib/custom-fields/components/details/use-form/form-schema.js +4 -3
  6. package/dist/lib/custom-fields/components/fields/custom-field.js +44 -36
  7. package/dist/lib/custom-fields/components/fields/rich-text.d.ts +8 -0
  8. package/dist/lib/custom-fields/components/fields/rich-text.js +17 -0
  9. package/dist/lib/custom-fields/components/fields/shared/primitive.d.ts +2 -1
  10. package/dist/lib/custom-fields/components/fields/shared/primitive.js +67 -61
  11. package/dist/lib/custom-fields/utils/custom-field.utils.js +63 -51
  12. package/dist/lib/translate/components/form/translate-form-row-data.d.ts +2 -1
  13. package/dist/lib/translate/components/form/translate-form-row-data.js +51 -19
  14. package/dist/lib/translate/components/form/translate-rich-text.d.ts +8 -0
  15. package/dist/lib/translate/components/form/translate-rich-text.js +65 -0
  16. package/dist/lib/translate/components/product-form/custom-fields/translate-product-custom-fields.js +95 -63
  17. package/dist/lib/translate/components/product-form/translate-product-form.js +19 -18
  18. package/dist/node_modules/@tiptap/core/dist/index.js +876 -872
  19. package/dist/node_modules/@tiptap/extensions/dist/index.js +288 -0
  20. package/dist/node_modules/@tiptap/react/dist/index.js +35 -34
  21. package/dist/node_modules/es-toolkit/dist/compat/object/cloneDeep.js +1 -1
  22. package/dist/node_modules/es-toolkit/dist/object/cloneDeep.js +1 -1
  23. package/dist/node_modules/lucide-react/dist/esm/icons/layout-list.js +13 -0
  24. package/dist/node_modules/prosemirror-dropcursor/dist/index.js +86 -0
  25. package/dist/node_modules/prosemirror-gapcursor/dist/index.js +204 -0
  26. package/dist/node_modules/prosemirror-history/dist/index.js +248 -0
  27. package/dist/node_modules/rope-sequence/dist/index.js +100 -0
  28. package/dist/shared/components/rich-editor/rich-editor.d.ts +3 -1
  29. package/dist/shared/components/rich-editor/rich-editor.js +40 -36
  30. package/dist/shared/components/rich-editor/toolbar/bold/rich-editor-toolbar-bold.js +10 -9
  31. package/dist/shared/components/rich-editor/toolbar/color/rich-editor-toolbar-color.js +1 -0
  32. package/dist/shared/components/rich-editor/toolbar/heading/rich-editor-toolbar-heading.js +1 -0
  33. package/dist/shared/components/rich-editor/toolbar/italic/rich-editor-toolbar-italic.js +5 -4
  34. package/dist/shared/components/rich-editor/toolbar/link/rich-editor-toolbar-link.js +8 -7
  35. package/dist/shared/components/rich-editor/toolbar/ol-list/rich-editor-toolbar-ul-list.js +1 -0
  36. package/dist/shared/components/rich-editor/toolbar/table/rich-editor-toolbar-table.js +9 -8
  37. package/dist/shared/components/rich-editor/toolbar/ul-list/rich-editor-toolbar-ul-list.js +7 -6
  38. package/dist/shared/components/rich-editor/toolbar/underline/rich-editor-toolbar-underline.js +3 -2
  39. package/package.json +1 -1
@@ -35,23 +35,23 @@ import "../../../../packages/lune-ui/dist/node_modules/@radix-ui/react-tooltip/d
35
35
  import { Form as b } from "../../../../packages/lune-ui/dist/form/form.js";
36
36
  import { H4 as x } from "../../../../packages/lune-ui/dist/typography/h4.js";
37
37
  import { isTranslatable as u } from "../../../custom-fields/utils/custom-field.utils.js";
38
- import { ImagePlaceholder as g } from "../../../../shared/components/placeholders/image-placeholder.js";
39
- import { TranslateFormHeader as T } from "../form/translate-form-header.js";
38
+ import { ImagePlaceholder as T } from "../../../../shared/components/placeholders/image-placeholder.js";
39
+ import { TranslateFormHeader as g } from "../form/translate-form-header.js";
40
40
  import { TranslateFormRowData as s } from "../form/translate-form-row-data.js";
41
41
  import { TranslateFormSeparator as a } from "../form/translate-form-separator.js";
42
42
  import { TranslateInput as N } from "../form/translate-input.js";
43
- import { TranslateTextarea as v } from "../form/translate-textarea.js";
44
- import { LocaleSelector as F } from "../locale-selector/locale-selector.js";
43
+ import { TranslateRichText as F } from "../form/translate-rich-text.js";
44
+ import { LocaleSelector as v } from "../locale-selector/locale-selector.js";
45
45
  import { TranslateProductCustomField as C } from "./custom-fields/translate-product-custom-fields.js";
46
46
  import { TranslateOptions as w } from "./options/translate-product-options.js";
47
47
  import { ReplaceProductSheet as S } from "./replace-product/replace-product-sheet.js";
48
48
  import { TranslateProductFormSubmitButton as j } from "./submit-button/translate-product-form-submit-button.js";
49
49
  import { useTranslateProductForm as P } from "./use-form/use-translate-product-form.js";
50
50
  const Ce = ({ product: r }) => {
51
- const o = P(r), i = !!r.options.length, l = !!r.customFieldEntries.filter(
52
- (m) => u(m.definition.type)
51
+ const i = P(r), m = !!r.options.length, l = !!r.customFieldEntries.filter(
52
+ (o) => u(o.definition.type)
53
53
  ).length;
54
- return /* @__PURE__ */ e(b, { ...o, children: /* @__PURE__ */ t("form", { onSubmit: o.onSubmit, className: "w-full border-l", children: [
54
+ return /* @__PURE__ */ e(b, { ...i, children: /* @__PURE__ */ t("form", { onSubmit: i.onSubmit, className: "w-full border-l", children: [
55
55
  /* @__PURE__ */ t("header", { className: "flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between w-full p-4 border-b", children: [
56
56
  /* @__PURE__ */ t("div", { className: "flex items-center gap-3", children: [
57
57
  r.assets.items?.[0]?.source ? /* @__PURE__ */ e(
@@ -62,7 +62,7 @@ const Ce = ({ product: r }) => {
62
62
  className: "shrink-0 size-10 sm:size-9 rounded-sm object-cover"
63
63
  }
64
64
  ) : /* @__PURE__ */ e(
65
- g,
65
+ T,
66
66
  {
67
67
  className: "shrink-0 size-10 sm:size-9 rounded-sm object-cover",
68
68
  initial: r.name
@@ -72,40 +72,41 @@ const Ce = ({ product: r }) => {
72
72
  ] }),
73
73
  /* @__PURE__ */ t("div", { className: "flex flex-col sm:flex-row items-center gap-3", children: [
74
74
  /* @__PURE__ */ e(S, {}),
75
- /* @__PURE__ */ e(F, {}),
75
+ /* @__PURE__ */ e(v, {}),
76
76
  /* @__PURE__ */ e(j, { product: r })
77
77
  ] })
78
78
  ] }),
79
79
  /* @__PURE__ */ e("div", { className: "p-4 sm:h-[calc(100vh-69px-69px-32px)] overflow-y-auto", children: /* @__PURE__ */ t(p, { className: "pb-0", children: [
80
80
  /* @__PURE__ */ e("div", { className: "flex items-center justify-between px-4", children: /* @__PURE__ */ e(c, { children: "General" }) }),
81
- /* @__PURE__ */ e(f, { className: "p-0 border-t lg:border-t-0", children: /* @__PURE__ */ t(d, { children: [
82
- /* @__PURE__ */ e(T, {}),
81
+ /* @__PURE__ */ e(f, { className: "p-0 border-t lg:border-t-0", children: /* @__PURE__ */ t(d, { className: "table-fixed", children: [
82
+ /* @__PURE__ */ e(g, {}),
83
83
  /* @__PURE__ */ t(h, { children: [
84
84
  /* @__PURE__ */ e(s, { field: "Name", reference: r.name, children: /* @__PURE__ */ e(
85
85
  N,
86
86
  {
87
87
  label: "English",
88
- ...o.register("name"),
89
- onChange: (m) => o.setValue("name", m.target.value)
88
+ ...i.register("name"),
89
+ onChange: (o) => i.setValue("name", o.target.value)
90
90
  }
91
91
  ) }),
92
92
  /* @__PURE__ */ e(
93
93
  s,
94
94
  {
95
+ richText: !0,
95
96
  field: "Description",
96
97
  reference: r.description,
97
- className: n(!i && "border-b-0"),
98
+ className: n(!m && "border-b-0"),
98
99
  children: /* @__PURE__ */ e(
99
- v,
100
+ F,
100
101
  {
101
102
  label: "English",
102
- ...o.register("description"),
103
- onChange: (m) => o.setValue("description", m.target.value)
103
+ ...i.register("description"),
104
+ onChange: (o) => i.setValue("description", o)
104
105
  }
105
106
  )
106
107
  }
107
108
  ),
108
- i && /* @__PURE__ */ e(a, { text: "Options" }),
109
+ m && /* @__PURE__ */ e(a, { text: "Options" }),
109
110
  /* @__PURE__ */ e(w, { product: r }),
110
111
  l && /* @__PURE__ */ e(a, { text: "Custom fields", className: "border-t!" }),
111
112
  /* @__PURE__ */ e(C, { product: r })