@lunejs/admin-ui 0.1.5 → 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 (115) hide show
  1. package/dist/_virtual/index10.js +5 -2
  2. package/dist/_virtual/index11.js +4 -0
  3. package/dist/_virtual/index6.js +3 -3
  4. package/dist/_virtual/index8.js +3 -5
  5. package/dist/lib/api/codegen/graphql.d.ts +1 -0
  6. package/dist/lib/api/codegen/graphql.js +8 -8
  7. package/dist/lib/collections/components/collection-details/cards/general-card.js +20 -14
  8. package/dist/lib/custom-fields/components/details/is-list/custom-field-is-list.js +6 -4
  9. package/dist/lib/custom-fields/components/details/use-form/form-schema.d.ts +1 -0
  10. package/dist/lib/custom-fields/components/details/use-form/form-schema.js +4 -3
  11. package/dist/lib/custom-fields/components/fields/color.js +3 -3
  12. package/dist/lib/custom-fields/components/fields/custom-field.js +44 -36
  13. package/dist/lib/custom-fields/components/fields/rich-text.d.ts +8 -0
  14. package/dist/lib/custom-fields/components/fields/rich-text.js +17 -0
  15. package/dist/lib/custom-fields/components/fields/shared/primitive.d.ts +2 -1
  16. package/dist/lib/custom-fields/components/fields/shared/primitive.js +67 -61
  17. package/dist/lib/custom-fields/utils/custom-field.utils.js +63 -51
  18. package/dist/lib/dashboard/pages/dashboard-page.js +5 -5
  19. package/dist/lib/product/components/product-details/cards/general-product-card.js +18 -12
  20. package/dist/lib/translate/components/form/translate-form-row-data.d.ts +2 -1
  21. package/dist/lib/translate/components/form/translate-form-row-data.js +51 -19
  22. package/dist/lib/translate/components/form/translate-rich-text.d.ts +8 -0
  23. package/dist/lib/translate/components/form/translate-rich-text.js +65 -0
  24. package/dist/lib/translate/components/product-form/custom-fields/translate-product-custom-fields.js +95 -63
  25. package/dist/lib/translate/components/product-form/translate-product-form.js +19 -18
  26. package/dist/node_modules/@tiptap/core/dist/index.js +3566 -0
  27. package/dist/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.js +17 -0
  28. package/dist/node_modules/@tiptap/extension-bold/dist/index.js +80 -0
  29. package/dist/node_modules/@tiptap/extension-document/dist/index.js +13 -0
  30. package/dist/node_modules/@tiptap/extension-heading/dist/index.js +64 -0
  31. package/dist/node_modules/@tiptap/extension-italic/dist/index.js +78 -0
  32. package/dist/node_modules/@tiptap/extension-link/dist/index.js +305 -0
  33. package/dist/node_modules/@tiptap/extension-list/dist/index.js +713 -0
  34. package/dist/node_modules/@tiptap/extension-paragraph/dist/index.js +42 -0
  35. package/dist/node_modules/@tiptap/extension-table/dist/index.js +380 -0
  36. package/dist/node_modules/@tiptap/extension-text/dist/index.js +14 -0
  37. package/dist/node_modules/@tiptap/extension-text-style/dist/index.js +240 -0
  38. package/dist/node_modules/@tiptap/extension-underline/dist/index.js +66 -0
  39. package/dist/node_modules/@tiptap/extensions/dist/index.js +288 -0
  40. package/dist/node_modules/@tiptap/react/dist/index.js +482 -0
  41. package/dist/node_modules/es-toolkit/dist/compat/object/cloneDeep.js +1 -1
  42. package/dist/node_modules/es-toolkit/dist/object/cloneDeep.js +1 -1
  43. package/dist/node_modules/eventemitter3/index.js +1 -1
  44. package/dist/node_modules/eventemitter3/index2.js +1 -1
  45. package/dist/node_modules/fast-equals/dist/es/index.js +324 -0
  46. package/dist/node_modules/linkifyjs/dist/linkify.js +707 -0
  47. package/dist/node_modules/lucide-react/dist/esm/icons/baseline.js +10 -0
  48. package/dist/node_modules/lucide-react/dist/esm/icons/between-horizontal-end.js +10 -0
  49. package/dist/node_modules/lucide-react/dist/esm/icons/between-vertical-end.js +10 -0
  50. package/dist/node_modules/lucide-react/dist/esm/icons/bold.js +11 -0
  51. package/dist/node_modules/lucide-react/dist/esm/icons/grid-2x2-plus.js +16 -0
  52. package/dist/node_modules/lucide-react/dist/esm/icons/grid-2x2-x.js +16 -0
  53. package/dist/node_modules/lucide-react/dist/esm/icons/italic.js +10 -0
  54. package/dist/node_modules/lucide-react/dist/esm/icons/layout-list.js +13 -0
  55. package/dist/node_modules/lucide-react/dist/esm/icons/link.js +9 -0
  56. package/dist/node_modules/lucide-react/dist/esm/icons/list-ordered.js +13 -0
  57. package/dist/node_modules/lucide-react/dist/esm/icons/table-columns-split.js +18 -0
  58. package/dist/node_modules/lucide-react/dist/esm/icons/table-rows-split.js +18 -0
  59. package/dist/node_modules/lucide-react/dist/esm/icons/table.js +11 -0
  60. package/dist/node_modules/lucide-react/dist/esm/icons/underline.js +9 -0
  61. package/dist/node_modules/orderedmap/dist/index.js +103 -0
  62. package/dist/node_modules/prosemirror-commands/dist/index.js +388 -0
  63. package/dist/node_modules/prosemirror-dropcursor/dist/index.js +86 -0
  64. package/dist/node_modules/prosemirror-gapcursor/dist/index.js +204 -0
  65. package/dist/node_modules/prosemirror-history/dist/index.js +248 -0
  66. package/dist/node_modules/prosemirror-keymap/dist/index.js +62 -0
  67. package/dist/node_modules/prosemirror-model/dist/index.js +2733 -0
  68. package/dist/node_modules/prosemirror-schema-list/dist/index.js +88 -0
  69. package/dist/node_modules/prosemirror-state/dist/index.js +822 -0
  70. package/dist/node_modules/prosemirror-tables/dist/index.js +1446 -0
  71. package/dist/node_modules/prosemirror-transform/dist/index.js +1520 -0
  72. package/dist/node_modules/prosemirror-view/dist/index.js +3772 -0
  73. package/dist/node_modules/react-is/index.js +1 -1
  74. package/dist/node_modules/recharts/es6/util/Events.js +1 -1
  75. package/dist/node_modules/recharts/es6/util/ReactUtils.js +1 -1
  76. package/dist/node_modules/rope-sequence/dist/index.js +100 -0
  77. package/dist/node_modules/use-sync-external-store/shim/index.js +1 -1
  78. package/dist/node_modules/w3c-keyname/index.js +93 -0
  79. package/dist/packages/lune-ui/dist/_virtual/index3.js +2 -5
  80. package/dist/packages/lune-ui/dist/_virtual/index6.js +5 -2
  81. package/dist/packages/lune-ui/dist/components/popover.js +15 -11
  82. package/dist/packages/lune-ui/dist/components/select.js +6 -6
  83. package/dist/packages/lune-ui/dist/form/form-date-picker.js +2 -2
  84. package/dist/packages/lune-ui/dist/form/form.js +4 -4
  85. package/dist/packages/lune-ui/dist/node_modules/@radix-ui/react-popover/dist/index.js +39 -38
  86. package/dist/packages/lune-ui/dist/node_modules/prop-types/index.js +1 -1
  87. package/dist/packages/lune-ui/dist/packages/lune-ui/node_modules/recharts/es6/util/Events.js +1 -1
  88. package/dist/shared/components/color-picker/color-picker.d.ts +2 -1
  89. package/dist/shared/components/color-picker/color-picker.js +11 -11
  90. package/dist/shared/components/data-table/data-table-filter.js +4 -4
  91. package/dist/shared/components/rich-editor/rich-editor.d.ts +8 -0
  92. package/dist/shared/components/rich-editor/rich-editor.js +97 -0
  93. package/dist/shared/components/rich-editor/toolbar/bold/rich-editor-toolbar-bold.d.ts +1 -0
  94. package/dist/shared/components/rich-editor/toolbar/bold/rich-editor-toolbar-bold.js +66 -0
  95. package/dist/shared/components/rich-editor/toolbar/color/rich-editor-toolbar-color.d.ts +1 -0
  96. package/dist/shared/components/rich-editor/toolbar/color/rich-editor-toolbar-color.js +66 -0
  97. package/dist/shared/components/rich-editor/toolbar/heading/rich-editor-toolbar-heading.d.ts +1 -0
  98. package/dist/shared/components/rich-editor/toolbar/heading/rich-editor-toolbar-heading.js +115 -0
  99. package/dist/shared/components/rich-editor/toolbar/italic/rich-editor-toolbar-italic.d.ts +1 -0
  100. package/dist/shared/components/rich-editor/toolbar/italic/rich-editor-toolbar-italic.js +66 -0
  101. package/dist/shared/components/rich-editor/toolbar/link/rich-editor-toolbar-link-form.d.ts +2 -0
  102. package/dist/shared/components/rich-editor/toolbar/link/rich-editor-toolbar-link-form.js +103 -0
  103. package/dist/shared/components/rich-editor/toolbar/link/rich-editor-toolbar-link.d.ts +1 -0
  104. package/dist/shared/components/rich-editor/toolbar/link/rich-editor-toolbar-link.js +64 -0
  105. package/dist/shared/components/rich-editor/toolbar/ol-list/rich-editor-toolbar-ul-list.d.ts +1 -0
  106. package/dist/shared/components/rich-editor/toolbar/ol-list/rich-editor-toolbar-ul-list.js +66 -0
  107. package/dist/shared/components/rich-editor/toolbar/table/rich-editor-toolbar-table.d.ts +1 -0
  108. package/dist/shared/components/rich-editor/toolbar/table/rich-editor-toolbar-table.js +108 -0
  109. package/dist/shared/components/rich-editor/toolbar/toolbar.d.ts +1 -0
  110. package/dist/shared/components/rich-editor/toolbar/toolbar.js +64 -0
  111. package/dist/shared/components/rich-editor/toolbar/ul-list/rich-editor-toolbar-ul-list.d.ts +1 -0
  112. package/dist/shared/components/rich-editor/toolbar/ul-list/rich-editor-toolbar-ul-list.js +66 -0
  113. package/dist/shared/components/rich-editor/toolbar/underline/rich-editor-toolbar-underline.d.ts +1 -0
  114. package/dist/shared/components/rich-editor/toolbar/underline/rich-editor-toolbar-underline.js +66 -0
  115. package/package.json +6 -1
@@ -4,64 +4,76 @@ import u from "../../../node_modules/lucide-react/dist/esm/icons/boxes.js";
4
4
  import s from "../../../node_modules/lucide-react/dist/esm/icons/package.js";
5
5
  import p from "../../../node_modules/lucide-react/dist/esm/icons/pipette.js";
6
6
  import f from "../../../node_modules/lucide-react/dist/esm/icons/calendar.js";
7
- import C from "../../../node_modules/lucide-react/dist/esm/icons/toggle-left.js";
8
- import b from "../../../node_modules/lucide-react/dist/esm/icons/image.js";
7
+ import b from "../../../node_modules/lucide-react/dist/esm/icons/toggle-left.js";
8
+ import C from "../../../node_modules/lucide-react/dist/esm/icons/image.js";
9
9
  import g from "../../../node_modules/lucide-react/dist/esm/icons/dollar-sign.js";
10
- import a from "../../../node_modules/lucide-react/dist/esm/icons/hash.js";
10
+ import c from "../../../node_modules/lucide-react/dist/esm/icons/hash.js";
11
+ import T from "../../../node_modules/lucide-react/dist/esm/icons/layout-list.js";
11
12
  import d from "../../../node_modules/lucide-react/dist/esm/icons/earth.js";
12
- import T from "../../../node_modules/lucide-react/dist/esm/icons/text.js";
13
- import v from "../../../node_modules/lucide-react/dist/esm/icons/type.js";
14
- import x from "../../../node_modules/lucide-react/dist/esm/icons/shopping-cart.js";
15
- import D from "../../../node_modules/lucide-react/dist/esm/icons/user.js";
16
- class o {
17
- constructor(n, i) {
18
- this.title = n, this.icon = i;
13
+ import x from "../../../node_modules/lucide-react/dist/esm/icons/text.js";
14
+ import R from "../../../node_modules/lucide-react/dist/esm/icons/type.js";
15
+ import v from "../../../node_modules/lucide-react/dist/esm/icons/shopping-cart.js";
16
+ import w from "../../../node_modules/lucide-react/dist/esm/icons/user.js";
17
+ class t {
18
+ constructor(i, n) {
19
+ this.title = i, this.icon = n;
19
20
  }
20
21
  }
21
- const w = {
22
+ const D = {
22
23
  // Text
23
- [e.SingleLineText]: new o("Single line text", v),
24
- [e.MultiLineText]: new o("Multi line text", T),
25
- [e.Url]: new o("URL", d),
24
+ [e.SingleLineText]: new t("Single line text", R),
25
+ [e.MultiLineText]: new t("Multi line text", x),
26
+ [e.Url]: new t("URL", d),
27
+ [e.RichText]: new t("Rich text", T),
26
28
  // Number
27
- [e.Integer]: new o("Integer", a),
28
- [e.Decimal]: new o("Decimal", a),
29
- [e.Money]: new o("Money", g),
29
+ [e.Integer]: new t("Integer", c),
30
+ [e.Decimal]: new t("Decimal", c),
31
+ [e.Money]: new t("Money", g),
30
32
  // Media
31
- [e.Image]: new o("Image", b),
33
+ [e.Image]: new t("Image", C),
32
34
  // Other
33
- [e.Boolean]: new o("Boolean", C),
34
- [e.Date]: new o("Date", f),
35
- [e.Color]: new o("Color", p),
35
+ [e.Boolean]: new t("Boolean", b),
36
+ [e.Date]: new t("Date", f),
37
+ [e.Color]: new t("Color", p),
36
38
  // Reference
37
- [e.ProductReference]: new o("Product", s),
38
- [e.CollectionReference]: new o("Collection", u),
39
- [e.CustomObjectReference]: new o("Custom object", m),
40
- customer: new o("Customer", D),
41
- order: new o("Order", x)
42
- }, N = (t) => ({
39
+ [e.ProductReference]: new t("Product", s),
40
+ [e.CollectionReference]: new t("Collection", u),
41
+ [e.CustomObjectReference]: new t("Custom object", m),
42
+ customer: new t("Customer", w),
43
+ order: new t("Order", v)
44
+ }, _ = (l) => ({
43
45
  [r.Product]: "Product",
44
46
  [r.Collection]: "Collection",
45
47
  [r.CustomObject]: "Custom object",
46
48
  [r.OptionValue]: "Option value"
47
- })[t], l = (t) => w[t], V = (t) => [e.SingleLineText, e.MultiLineText].includes(t), _ = [
49
+ })[l], o = (l) => D[l], G = (l) => [
50
+ e.SingleLineText,
51
+ e.MultiLineText,
52
+ e.RichText,
53
+ e.Url
54
+ ].includes(l), $ = [
48
55
  {
49
56
  label: "Text",
50
57
  items: [
51
58
  {
52
59
  label: "Single line text",
53
60
  value: e.SingleLineText,
54
- icon: l(e.SingleLineText).icon
61
+ icon: o(e.SingleLineText).icon
55
62
  },
56
63
  {
57
64
  label: "Multi line text",
58
65
  value: e.MultiLineText,
59
- icon: l(e.MultiLineText).icon
66
+ icon: o(e.MultiLineText).icon
60
67
  },
61
68
  {
62
- label: l(e.Url).title,
69
+ label: o(e.RichText).title,
70
+ value: e.RichText,
71
+ icon: o(e.RichText).icon
72
+ },
73
+ {
74
+ label: o(e.Url).title,
63
75
  value: e.Url,
64
- icon: l(e.Url).icon
76
+ icon: o(e.Url).icon
65
77
  }
66
78
  ]
67
79
  },
@@ -71,17 +83,17 @@ const w = {
71
83
  {
72
84
  label: "Integer",
73
85
  value: e.Integer,
74
- icon: l(e.Integer).icon
86
+ icon: o(e.Integer).icon
75
87
  },
76
88
  {
77
89
  label: "Decimal",
78
90
  value: e.Decimal,
79
- icon: l(e.Decimal).icon
91
+ icon: o(e.Decimal).icon
80
92
  },
81
93
  {
82
94
  label: "Money",
83
95
  value: e.Money,
84
- icon: l(e.Money).icon
96
+ icon: o(e.Money).icon
85
97
  }
86
98
  ]
87
99
  },
@@ -91,7 +103,7 @@ const w = {
91
103
  {
92
104
  label: "Image",
93
105
  value: e.Image,
94
- icon: l(e.Image).icon
106
+ icon: o(e.Image).icon
95
107
  }
96
108
  ]
97
109
  },
@@ -101,17 +113,17 @@ const w = {
101
113
  {
102
114
  label: "Product",
103
115
  value: e.ProductReference,
104
- icon: l(e.ProductReference).icon
116
+ icon: o(e.ProductReference).icon
105
117
  },
106
118
  {
107
119
  label: "Collection",
108
120
  value: e.CollectionReference,
109
- icon: l(e.CollectionReference).icon
121
+ icon: o(e.CollectionReference).icon
110
122
  },
111
123
  {
112
124
  label: "Custom object",
113
125
  value: e.CustomObjectReference,
114
- icon: l(e.CustomObjectReference).icon
126
+ icon: o(e.CustomObjectReference).icon
115
127
  }
116
128
  ]
117
129
  },
@@ -121,28 +133,28 @@ const w = {
121
133
  {
122
134
  label: "Boolean",
123
135
  value: e.Boolean,
124
- icon: l(e.Boolean).icon
136
+ icon: o(e.Boolean).icon
125
137
  },
126
138
  {
127
139
  label: "Date",
128
140
  value: e.Date,
129
- icon: l(e.Date).icon
141
+ icon: o(e.Date).icon
130
142
  },
131
143
  {
132
- label: l(e.Color).title,
144
+ label: o(e.Color).title,
133
145
  value: e.Color,
134
- icon: l(e.Color).icon
146
+ icon: o(e.Color).icon
135
147
  }
136
148
  ]
137
149
  }
138
- ], G = (t, n) => {
139
- const i = t.values.find((c) => c.field.id === n.displayField?.id);
140
- return i ? i.value : `${n.name}#${t.slug.toUpperCase()}`;
150
+ ], k = (l, i) => {
151
+ const n = l.values.find((a) => a.field.id === i.displayField?.id);
152
+ return n ? n.value : `${i.name}#${l.slug.toUpperCase()}`;
141
153
  };
142
154
  export {
143
- _ as CUSTOM_FIELD_TYPE_GROUPS,
144
- l as getCustomFieldTypeData,
145
- G as getDisplayFieldValue,
146
- N as getEntityName,
147
- V as isTranslatable
155
+ $ as CUSTOM_FIELD_TYPE_GROUPS,
156
+ o as getCustomFieldTypeData,
157
+ k as getDisplayFieldValue,
158
+ _ as getEntityName,
159
+ G as isTranslatable
148
160
  };
@@ -1,5 +1,5 @@
1
1
  import { jsx as t, Fragment as f, jsxs as e } from "react/jsx-runtime";
2
- import { useState as C, useMemo as N, useEffect as P } from "react";
2
+ import { useState as N, useMemo as v, useEffect as P } from "react";
3
3
  import { UTCDate as m } from "../../../node_modules/@date-fns/utc/date/index.js";
4
4
  import "../../../node_modules/@date-fns/utc/date/mini.js";
5
5
  import "../../../packages/lune-ui/dist/node_modules/@radix-ui/react-accordion/dist/index.js";
@@ -49,16 +49,16 @@ import { formatDate as a } from "../../../node_modules/date-fns/format.js";
49
49
  import H from "../../../node_modules/lucide-react/dist/esm/icons/calendar-range.js";
50
50
  import I from "../../../node_modules/lucide-react/dist/esm/icons/inbox.js";
51
51
  function Et() {
52
- const [r, L] = C({
52
+ const [r, L] = N({
53
53
  from: g(new m()),
54
54
  to: h(new m())
55
- }), o = N(
55
+ }), o = v(
56
56
  () => ({
57
57
  startsAt: r?.from ?? g(new m()),
58
58
  endsAt: r?.to ?? h(new m())
59
59
  }),
60
60
  [r]
61
- ), { totalSales: w, ...s } = F(o), { totalOrders: x, ...l } = B(o), { totalNewCustomers: O, ...n } = $(o), { totalAvgOrderValue: v, ...d } = k(o), { count: i } = j({ filters: { states: [u.Placed] } });
61
+ ), { totalSales: w, ...s } = F(o), { totalOrders: x, ...l } = B(o), { totalNewCustomers: O, ...n } = $(o), { totalAvgOrderValue: C, ...d } = k(o), { count: i } = j({ filters: { states: [u.Placed] } });
62
62
  return P(() => {
63
63
  s.refetch(), l.refetch(), n.refetch(), d.refetch();
64
64
  }, [r]), s.isLoading || l.isLoading || n.isLoading || d.isLoading ? /* @__PURE__ */ t(G, {}) : /* @__PURE__ */ t(f, { children: /* @__PURE__ */ e(z, { className: "max-w-3xl mx-auto w-full flex flex-col gap-8", children: [
@@ -108,7 +108,7 @@ function Et() {
108
108
  totalSales: w,
109
109
  ordersCount: x,
110
110
  newCustomers: O,
111
- avgOrderValue: v
111
+ avgOrderValue: C
112
112
  }
113
113
  ),
114
114
  !!i && /* @__PURE__ */ e("div", { className: "flex items-center gap-4", children: [
@@ -10,7 +10,7 @@ import "../../../../../packages/lune-ui/dist/node_modules/react-day-picker/dist/
10
10
  import "../../../../../packages/lune-ui/dist/node_modules/@date-fns/tz/date/mini.js";
11
11
  import "../../../../../packages/lune-ui/dist/node_modules/react-day-picker/dist/esm/helpers/calculateFocusTarget.js";
12
12
  import "../../../../../packages/lune-ui/dist/node_modules/react-day-picker/dist/esm/locale/en-US.js";
13
- import { Card as i, CardHeader as p, CardTitle as e, CardContent as a } from "../../../../../packages/lune-ui/dist/components/card.js";
13
+ import { Card as p, CardHeader as e, CardTitle as a, CardContent as l } from "../../../../../packages/lune-ui/dist/components/card.js";
14
14
  import "../../../../../packages/lune-ui/dist/components/chart.js";
15
15
  import "../../../../../packages/lune-ui/dist/node_modules/@radix-ui/react-checkbox/dist/index.js";
16
16
  import "../../../../../packages/lune-ui/dist/node_modules/@radix-ui/react-collapsible/dist/index.js";
@@ -31,21 +31,27 @@ import "../../../../../packages/lune-ui/dist/node_modules/@radix-ui/react-toggle
31
31
  import "../../../../../packages/lune-ui/dist/components/toggle-group.js";
32
32
  import "../../../../../packages/lune-ui/dist/node_modules/@radix-ui/react-tooltip/dist/index.js";
33
33
  import "../../../../../packages/lune-ui/dist/form/form.js";
34
- import { FormInput as l } from "../../../../../packages/lune-ui/dist/form/form-input.js";
35
- import { FormTextarea as n } from "../../../../../packages/lune-ui/dist/form/form-textarea.js";
36
- import { ProductAssetUploader as s } from "../../asset-uploader/product-asset-uploader.js";
34
+ import { FormInput as s } from "../../../../../packages/lune-ui/dist/form/form-input.js";
35
+ import { RichEditor as d } from "../../../../../shared/components/rich-editor/rich-editor.js";
36
+ import { ProductAssetUploader as n } from "../../asset-uploader/product-asset-uploader.js";
37
37
  import { useProductDetailsFormContext as c } from "../use-form/use-product-details-form.js";
38
- const X = () => {
38
+ const Y = () => {
39
39
  const { product: m, ...o } = c();
40
- return /* @__PURE__ */ t(i, { children: [
41
- /* @__PURE__ */ r(p, { className: "flex", children: /* @__PURE__ */ r(e, { children: "General" }) }),
42
- /* @__PURE__ */ t(a, { className: "flex flex-col gap-3", children: [
43
- /* @__PURE__ */ r(l, { control: o.control, name: "name", label: "Name", placeholder: "T-Shirt" }),
44
- /* @__PURE__ */ r(n, { control: o.control, name: "description", label: "Description" }),
45
- /* @__PURE__ */ r(s, { product: m })
40
+ return /* @__PURE__ */ t(p, { children: [
41
+ /* @__PURE__ */ r(e, { className: "flex", children: /* @__PURE__ */ r(a, { children: "General" }) }),
42
+ /* @__PURE__ */ t(l, { className: "flex flex-col gap-3", children: [
43
+ /* @__PURE__ */ r(s, { control: o.control, name: "name", label: "Name", placeholder: "T-Shirt" }),
44
+ /* @__PURE__ */ r(
45
+ d,
46
+ {
47
+ defaultValue: o.formState.defaultValues?.description,
48
+ onChange: (i) => o.setValue("description", i)
49
+ }
50
+ ),
51
+ /* @__PURE__ */ r(n, { product: m })
46
52
  ] })
47
53
  ] });
48
54
  };
49
55
  export {
50
- X as GeneralProductCard
56
+ Y as GeneralProductCard
51
57
  };
@@ -1,5 +1,5 @@
1
1
  import { PropsWithChildren } from 'react';
2
- export declare const TranslateFormRowData: ({ children, field, reference, className }: Props) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const TranslateFormRowData: ({ children, field, reference, richText, className }: Props) => import("react/jsx-runtime").JSX.Element;
3
3
  type Props = PropsWithChildren & {
4
4
  className?: string | {
5
5
  row?: string;
@@ -8,5 +8,6 @@ type Props = PropsWithChildren & {
8
8
  };
9
9
  field: string | null | undefined;
10
10
  reference: string | null | undefined;
11
+ richText?: boolean;
11
12
  };
12
13
  export {};
@@ -1,7 +1,7 @@
1
- import { jsxs as n, Fragment as a, jsx as r } from "react/jsx-runtime";
1
+ import { jsxs as a, Fragment as s, jsx as r } from "react/jsx-runtime";
2
2
  import "react";
3
3
  import "../../../../packages/lune-ui/dist/node_modules/@radix-ui/react-accordion/dist/index.js";
4
- import { cn as l } from "../../../../packages/lune-ui/dist/lib/utils.js";
4
+ import { cn as p } from "../../../../packages/lune-ui/dist/lib/utils.js";
5
5
  import "../../../../packages/lune-ui/dist/node_modules/@radix-ui/react-alert-dialog/dist/index.js";
6
6
  import "../../../../packages/lune-ui/dist/node_modules/@radix-ui/react-avatar/dist/index.js";
7
7
  import "../../../../packages/lune-ui/dist/node_modules/@radix-ui/react-separator/dist/index.js";
@@ -24,7 +24,7 @@ import "../../../../packages/lune-ui/dist/node_modules/@radix-ui/react-radio-gro
24
24
  import "../../../../packages/lune-ui/dist/node_modules/@radix-ui/react-select/dist/index.js";
25
25
  import "../../../../packages/lune-ui/dist/node_modules/@radix-ui/react-dialog/dist/index.js";
26
26
  import "../../../../packages/lune-ui/dist/node_modules/@radix-ui/react-switch/dist/index.js";
27
- import { TableRow as d } from "../../../../packages/lune-ui/dist/components/table.js";
27
+ import { TableRow as u } from "../../../../packages/lune-ui/dist/components/table.js";
28
28
  import "../../../../packages/lune-ui/dist/node_modules/@radix-ui/react-tabs/dist/index.js";
29
29
  import "../../../../packages/lune-ui/dist/components/theme-provider.js";
30
30
  import "../../../../packages/lune-ui/dist/node_modules/sonner/dist/index.js";
@@ -32,37 +32,69 @@ import "../../../../packages/lune-ui/dist/node_modules/@radix-ui/react-toggle/di
32
32
  import "../../../../packages/lune-ui/dist/components/toggle-group.js";
33
33
  import "../../../../packages/lune-ui/dist/node_modules/@radix-ui/react-tooltip/dist/index.js";
34
34
  import "../../../../packages/lune-ui/dist/form/form.js";
35
- import { TranslateFormCell as o } from "./translate-form-cell.js";
36
- import { TranslateFormRow as p } from "./translate-form-row.js";
37
- const V = ({ children: e, field: i, reference: m, className: t }) => /* @__PURE__ */ n(a, { children: [
38
- /* @__PURE__ */ n(
39
- d,
35
+ import { RichEditor as l } from "../../../../shared/components/rich-editor/rich-editor.js";
36
+ import { TranslateFormCell as i } from "./translate-form-cell.js";
37
+ import { TranslateFormRow as e } from "./translate-form-row.js";
38
+ const X = ({
39
+ children: n,
40
+ field: m,
41
+ reference: o,
42
+ richText: d,
43
+ className: t
44
+ }) => /* @__PURE__ */ a(s, { children: [
45
+ /* @__PURE__ */ a(
46
+ u,
40
47
  {
41
- className: l(
48
+ className: p(
42
49
  "bg-transparent! hidden lg:table-row",
43
50
  typeof t == "string" ? t : t?.row
44
51
  ),
45
52
  children: [
46
- /* @__PURE__ */ r(o, { children: i }),
47
- /* @__PURE__ */ r(
48
- o,
53
+ /* @__PURE__ */ r(i, { children: m }),
54
+ d ? /* @__PURE__ */ r(
55
+ i,
49
56
  {
50
- className: l(
57
+ isDisabled: !0,
58
+ className: p(
59
+ typeof t == "string" ? void 0 : t?.referenceCell,
60
+ "text-muted-foreground p-0"
61
+ ),
62
+ children: /* @__PURE__ */ r(
63
+ l,
64
+ {
65
+ disabled: !0,
66
+ className: "rounded-none [&_.tiptap]:max-h-48 ring-0! border-none! [&_.rich-editor-content]:text-muted-foreground!",
67
+ defaultValue: o ?? ""
68
+ }
69
+ )
70
+ }
71
+ ) : /* @__PURE__ */ r(
72
+ i,
73
+ {
74
+ className: p(
51
75
  typeof t == "string" ? void 0 : t?.referenceCell,
52
76
  "text-muted-foreground"
53
77
  ),
54
78
  isDisabled: !0,
55
- children: m
79
+ children: o
56
80
  }
57
81
  ),
58
- e
82
+ n
59
83
  ]
60
84
  }
61
85
  ),
62
- i && /* @__PURE__ */ r(p, { className: "lg:hidden", children: /* @__PURE__ */ r(o, { children: i }) }),
63
- m && /* @__PURE__ */ r(p, { className: "lg:hidden", children: /* @__PURE__ */ r(o, { isDisabled: !0, className: "text-muted-foreground", children: m }) }),
64
- /* @__PURE__ */ r(p, { className: "lg:hidden", children: e })
86
+ m && /* @__PURE__ */ r(e, { className: "lg:hidden", children: /* @__PURE__ */ r(i, { children: m }) }),
87
+ o && !d && /* @__PURE__ */ r(e, { className: "lg:hidden", children: /* @__PURE__ */ r(i, { isDisabled: !0, className: "text-muted-foreground", children: o }) }),
88
+ o && d && /* @__PURE__ */ r(e, { className: "lg:hidden", children: /* @__PURE__ */ r(i, { isDisabled: !0, className: "text-muted-foreground p-0", children: /* @__PURE__ */ r(
89
+ l,
90
+ {
91
+ disabled: !0,
92
+ className: "rounded-none [&_.tiptap]:max-h-48 ring-0! border-none! [&_.rich-editor-content]:text-muted-foreground!",
93
+ defaultValue: o ?? ""
94
+ }
95
+ ) }) }),
96
+ /* @__PURE__ */ r(e, { className: "lg:hidden", children: n })
65
97
  ] });
66
98
  export {
67
- V as TranslateFormRowData
99
+ X as TranslateFormRowData
68
100
  };
@@ -0,0 +1,8 @@
1
+ export declare const TranslateRichText: ({ onChange, defaultValue, label, className }: Props) => import("react/jsx-runtime").JSX.Element;
2
+ type Props = {
3
+ className?: string;
4
+ label?: string;
5
+ defaultValue?: string;
6
+ onChange: (html: string) => void;
7
+ };
8
+ export {};
@@ -0,0 +1,65 @@
1
+ import { jsxs as e, jsx as o } from "react/jsx-runtime";
2
+ import { useId as l } from "react";
3
+ import "../../../../packages/lune-ui/dist/node_modules/@radix-ui/react-accordion/dist/index.js";
4
+ import { cn as s } from "../../../../packages/lune-ui/dist/lib/utils.js";
5
+ import "../../../../packages/lune-ui/dist/node_modules/@radix-ui/react-alert-dialog/dist/index.js";
6
+ import "../../../../packages/lune-ui/dist/node_modules/@radix-ui/react-avatar/dist/index.js";
7
+ import "../../../../packages/lune-ui/dist/node_modules/@radix-ui/react-separator/dist/index.js";
8
+ import "../../../../packages/lune-ui/dist/node_modules/react-day-picker/dist/esm/UI.js";
9
+ import "../../../../packages/lune-ui/dist/node_modules/react-day-picker/dist/esm/classes/DateLib.js";
10
+ import "../../../../packages/lune-ui/dist/node_modules/react-day-picker/dist/esm/useDayPicker.js";
11
+ import "../../../../packages/lune-ui/dist/node_modules/@date-fns/tz/date/mini.js";
12
+ import "../../../../packages/lune-ui/dist/node_modules/react-day-picker/dist/esm/helpers/calculateFocusTarget.js";
13
+ import "../../../../packages/lune-ui/dist/node_modules/react-day-picker/dist/esm/locale/en-US.js";
14
+ import "../../../../packages/lune-ui/dist/components/chart.js";
15
+ import "../../../../packages/lune-ui/dist/node_modules/@radix-ui/react-checkbox/dist/index.js";
16
+ import "../../../../packages/lune-ui/dist/node_modules/@radix-ui/react-collapsible/dist/index.js";
17
+ import "../../../../packages/lune-ui/dist/node_modules/cmdk/dist/index.js";
18
+ import "../../../../packages/lune-ui/dist/components/dialog.js";
19
+ import "../../../../packages/lune-ui/dist/node_modules/@radix-ui/react-dropdown-menu/dist/index.js";
20
+ import "../../../../packages/lune-ui/dist/node_modules/@radix-ui/react-label/dist/index.js";
21
+ import "../../../../packages/lune-ui/dist/components/phone-input.js";
22
+ import "../../../../packages/lune-ui/dist/node_modules/@radix-ui/react-popover/dist/index.js";
23
+ import "../../../../packages/lune-ui/dist/node_modules/@radix-ui/react-radio-group/dist/index.js";
24
+ import "../../../../packages/lune-ui/dist/node_modules/@radix-ui/react-select/dist/index.js";
25
+ import "../../../../packages/lune-ui/dist/node_modules/@radix-ui/react-dialog/dist/index.js";
26
+ import "../../../../packages/lune-ui/dist/node_modules/@radix-ui/react-switch/dist/index.js";
27
+ import { TableCell as a } from "../../../../packages/lune-ui/dist/components/table.js";
28
+ import "../../../../packages/lune-ui/dist/node_modules/@radix-ui/react-tabs/dist/index.js";
29
+ import "../../../../packages/lune-ui/dist/components/theme-provider.js";
30
+ import "../../../../packages/lune-ui/dist/node_modules/sonner/dist/index.js";
31
+ import "../../../../packages/lune-ui/dist/node_modules/@radix-ui/react-toggle/dist/index.js";
32
+ import "../../../../packages/lune-ui/dist/components/toggle-group.js";
33
+ import "../../../../packages/lune-ui/dist/node_modules/@radix-ui/react-tooltip/dist/index.js";
34
+ import "../../../../packages/lune-ui/dist/form/form.js";
35
+ import { RichEditor as n } from "../../../../shared/components/rich-editor/rich-editor.js";
36
+ const S = ({ onChange: i, defaultValue: m, label: r, className: p }) => {
37
+ const t = l();
38
+ return /* @__PURE__ */ e(
39
+ a,
40
+ {
41
+ onClick: () => {
42
+ document.getElementById(t)?.focus();
43
+ },
44
+ className: s(
45
+ "cursor-text align-top h-full p-0 [&:has(textarea:focus-visible)]:ring-primary/50 [&:has(textarea:focus-visible)]:ring-[1px]",
46
+ r && "flex flex-col gap-1 w-full lg:table-cell",
47
+ p
48
+ ),
49
+ children: [
50
+ r && /* @__PURE__ */ o("label", { className: "pl-4 pt-4 text-muted-foreground lg:hidden", htmlFor: t, children: r }),
51
+ /* @__PURE__ */ o(
52
+ n,
53
+ {
54
+ className: "rounded-none [&_.tiptap]:max-h-48 ring-0! border-none!",
55
+ defaultValue: m,
56
+ onChange: i
57
+ }
58
+ )
59
+ ]
60
+ }
61
+ );
62
+ };
63
+ export {
64
+ S as TranslateRichText
65
+ };