@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.
- package/dist/lib/api/codegen/graphql.d.ts +1 -0
- package/dist/lib/api/codegen/graphql.js +8 -8
- package/dist/lib/custom-fields/components/details/is-list/custom-field-is-list.js +6 -4
- package/dist/lib/custom-fields/components/details/use-form/form-schema.d.ts +1 -0
- package/dist/lib/custom-fields/components/details/use-form/form-schema.js +4 -3
- package/dist/lib/custom-fields/components/fields/custom-field.js +44 -36
- package/dist/lib/custom-fields/components/fields/rich-text.d.ts +8 -0
- package/dist/lib/custom-fields/components/fields/rich-text.js +17 -0
- package/dist/lib/custom-fields/components/fields/shared/primitive.d.ts +2 -1
- package/dist/lib/custom-fields/components/fields/shared/primitive.js +67 -61
- package/dist/lib/custom-fields/utils/custom-field.utils.js +63 -51
- package/dist/lib/translate/components/form/translate-form-row-data.d.ts +2 -1
- package/dist/lib/translate/components/form/translate-form-row-data.js +51 -19
- package/dist/lib/translate/components/form/translate-rich-text.d.ts +8 -0
- package/dist/lib/translate/components/form/translate-rich-text.js +65 -0
- package/dist/lib/translate/components/product-form/custom-fields/translate-product-custom-fields.js +95 -63
- package/dist/lib/translate/components/product-form/translate-product-form.js +19 -18
- package/dist/node_modules/@tiptap/core/dist/index.js +876 -872
- package/dist/node_modules/@tiptap/extensions/dist/index.js +288 -0
- package/dist/node_modules/@tiptap/react/dist/index.js +35 -34
- package/dist/node_modules/es-toolkit/dist/compat/object/cloneDeep.js +1 -1
- package/dist/node_modules/es-toolkit/dist/object/cloneDeep.js +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/layout-list.js +13 -0
- package/dist/node_modules/prosemirror-dropcursor/dist/index.js +86 -0
- package/dist/node_modules/prosemirror-gapcursor/dist/index.js +204 -0
- package/dist/node_modules/prosemirror-history/dist/index.js +248 -0
- package/dist/node_modules/rope-sequence/dist/index.js +100 -0
- package/dist/shared/components/rich-editor/rich-editor.d.ts +3 -1
- package/dist/shared/components/rich-editor/rich-editor.js +40 -36
- package/dist/shared/components/rich-editor/toolbar/bold/rich-editor-toolbar-bold.js +10 -9
- package/dist/shared/components/rich-editor/toolbar/color/rich-editor-toolbar-color.js +1 -0
- package/dist/shared/components/rich-editor/toolbar/heading/rich-editor-toolbar-heading.js +1 -0
- package/dist/shared/components/rich-editor/toolbar/italic/rich-editor-toolbar-italic.js +5 -4
- package/dist/shared/components/rich-editor/toolbar/link/rich-editor-toolbar-link.js +8 -7
- package/dist/shared/components/rich-editor/toolbar/ol-list/rich-editor-toolbar-ul-list.js +1 -0
- package/dist/shared/components/rich-editor/toolbar/table/rich-editor-toolbar-table.js +9 -8
- package/dist/shared/components/rich-editor/toolbar/ul-list/rich-editor-toolbar-ul-list.js +7 -6
- package/dist/shared/components/rich-editor/toolbar/underline/rich-editor-toolbar-underline.js +3 -2
- package/package.json +1 -1
|
@@ -32,23 +32,24 @@ import "../../../../../packages/lune-ui/dist/node_modules/@radix-ui/react-toggle
|
|
|
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 { useCurrentEditor as
|
|
36
|
-
import
|
|
35
|
+
import { useCurrentEditor as s, useEditorState as n } from "../../../../../node_modules/@tiptap/react/dist/index.js";
|
|
36
|
+
import d from "../../../../../node_modules/lucide-react/dist/esm/icons/bold.js";
|
|
37
37
|
const U = () => {
|
|
38
|
-
const { editor:
|
|
39
|
-
editor:
|
|
40
|
-
selector({ editor:
|
|
41
|
-
if (
|
|
38
|
+
const { editor: t } = s(), i = n({
|
|
39
|
+
editor: t,
|
|
40
|
+
selector({ editor: o }) {
|
|
41
|
+
if (o)
|
|
42
42
|
return {
|
|
43
|
-
isBoldActive:
|
|
43
|
+
isBoldActive: o.isActive("bold")
|
|
44
44
|
};
|
|
45
45
|
}
|
|
46
46
|
}), m = () => {
|
|
47
|
-
|
|
47
|
+
t?.commands.toggleBold();
|
|
48
48
|
};
|
|
49
49
|
return /* @__PURE__ */ r(
|
|
50
50
|
e,
|
|
51
51
|
{
|
|
52
|
+
disabled: !t?.isEditable,
|
|
52
53
|
type: "button",
|
|
53
54
|
variant: "ghost",
|
|
54
55
|
className: p(
|
|
@@ -56,7 +57,7 @@ const U = () => {
|
|
|
56
57
|
i?.isBoldActive && "bg-input/75! hover:bg-input/75!"
|
|
57
58
|
),
|
|
58
59
|
onClick: m,
|
|
59
|
-
children: /* @__PURE__ */ r(
|
|
60
|
+
children: /* @__PURE__ */ r(d, {})
|
|
60
61
|
}
|
|
61
62
|
);
|
|
62
63
|
};
|
|
@@ -32,10 +32,10 @@ import "../../../../../packages/lune-ui/dist/node_modules/@radix-ui/react-toggle
|
|
|
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 { useCurrentEditor as c, useEditorState as
|
|
36
|
-
import
|
|
35
|
+
import { useCurrentEditor as c, useEditorState as s } from "../../../../../node_modules/@tiptap/react/dist/index.js";
|
|
36
|
+
import a from "../../../../../node_modules/lucide-react/dist/esm/icons/italic.js";
|
|
37
37
|
const U = () => {
|
|
38
|
-
const { editor: t } = c(), r =
|
|
38
|
+
const { editor: t } = c(), r = s({
|
|
39
39
|
editor: t,
|
|
40
40
|
selector({ editor: i }) {
|
|
41
41
|
if (i)
|
|
@@ -49,6 +49,7 @@ const U = () => {
|
|
|
49
49
|
return /* @__PURE__ */ o(
|
|
50
50
|
e,
|
|
51
51
|
{
|
|
52
|
+
disabled: !t?.isEditable,
|
|
52
53
|
type: "button",
|
|
53
54
|
variant: "ghost",
|
|
54
55
|
className: p(
|
|
@@ -56,7 +57,7 @@ const U = () => {
|
|
|
56
57
|
r?.isItalicActive && "bg-input/75! hover:bg-input/75!"
|
|
57
58
|
),
|
|
58
59
|
onClick: m,
|
|
59
|
-
children: /* @__PURE__ */ o(
|
|
60
|
+
children: /* @__PURE__ */ o(a, {})
|
|
60
61
|
}
|
|
61
62
|
);
|
|
62
63
|
};
|
|
@@ -20,7 +20,7 @@ import "../../../../../packages/lune-ui/dist/components/dialog.js";
|
|
|
20
20
|
import "../../../../../packages/lune-ui/dist/node_modules/@radix-ui/react-dropdown-menu/dist/index.js";
|
|
21
21
|
import "../../../../../packages/lune-ui/dist/node_modules/@radix-ui/react-label/dist/index.js";
|
|
22
22
|
import "../../../../../packages/lune-ui/dist/components/phone-input.js";
|
|
23
|
-
import { Popover as
|
|
23
|
+
import { Popover as s, PopoverTrigger as n, PopoverContent as a } from "../../../../../packages/lune-ui/dist/components/popover.js";
|
|
24
24
|
import "../../../../../packages/lune-ui/dist/node_modules/@radix-ui/react-radio-group/dist/index.js";
|
|
25
25
|
import "../../../../../packages/lune-ui/dist/node_modules/@radix-ui/react-select/dist/index.js";
|
|
26
26
|
import "../../../../../packages/lune-ui/dist/node_modules/@radix-ui/react-dialog/dist/index.js";
|
|
@@ -36,21 +36,22 @@ import { useCurrentEditor as c, useEditorState as d } from "../../../../../node_
|
|
|
36
36
|
import { RickEditorToolbarLinkForm as l } from "./rich-editor-toolbar-link-form.js";
|
|
37
37
|
import u from "../../../../../node_modules/lucide-react/dist/esm/icons/link.js";
|
|
38
38
|
const Z = () => {
|
|
39
|
-
const { editor: r } = c(),
|
|
39
|
+
const { editor: r } = c(), i = d({
|
|
40
40
|
editor: r,
|
|
41
|
-
selector: (
|
|
42
|
-
isLink:
|
|
41
|
+
selector: (t) => ({
|
|
42
|
+
isLink: t.editor?.isActive("link")
|
|
43
43
|
})
|
|
44
44
|
});
|
|
45
|
-
return /* @__PURE__ */ m(
|
|
46
|
-
/* @__PURE__ */ o(
|
|
45
|
+
return /* @__PURE__ */ m(s, { children: [
|
|
46
|
+
/* @__PURE__ */ o(n, { asChild: !0, children: /* @__PURE__ */ o(
|
|
47
47
|
e,
|
|
48
48
|
{
|
|
49
|
+
disabled: !r?.isEditable,
|
|
49
50
|
type: "button",
|
|
50
51
|
variant: "ghost",
|
|
51
52
|
className: p(
|
|
52
53
|
"size-8! hover:bg-input/30!",
|
|
53
|
-
|
|
54
|
+
i?.isLink && "bg-input/75! hover:bg-input/75!"
|
|
54
55
|
),
|
|
55
56
|
children: /* @__PURE__ */ o(u, {})
|
|
56
57
|
}
|
|
@@ -33,8 +33,8 @@ 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
35
|
import { useCurrentEditor as w } from "../../../../../node_modules/@tiptap/react/dist/index.js";
|
|
36
|
-
import
|
|
37
|
-
import
|
|
36
|
+
import b from "../../../../../node_modules/lucide-react/dist/esm/icons/table.js";
|
|
37
|
+
import C from "../../../../../node_modules/lucide-react/dist/esm/icons/chevron-down.js";
|
|
38
38
|
import T from "../../../../../node_modules/lucide-react/dist/esm/icons/grid-2x2-plus.js";
|
|
39
39
|
import R from "../../../../../node_modules/lucide-react/dist/esm/icons/between-horizontal-end.js";
|
|
40
40
|
import v from "../../../../../node_modules/lucide-react/dist/esm/icons/between-vertical-end.js";
|
|
@@ -50,15 +50,16 @@ const ho = () => {
|
|
|
50
50
|
t?.chain().focus().deleteColumn().run();
|
|
51
51
|
}, l = () => {
|
|
52
52
|
t?.chain().focus().deleteRow().run();
|
|
53
|
-
}, c = () => {
|
|
54
|
-
t?.chain().focus().addRowAfter().run();
|
|
55
53
|
}, a = () => {
|
|
54
|
+
t?.chain().focus().addRowAfter().run();
|
|
55
|
+
}, c = () => {
|
|
56
56
|
t?.chain().focus().deleteTable().run();
|
|
57
57
|
};
|
|
58
58
|
return /* @__PURE__ */ r(u, { children: [
|
|
59
59
|
/* @__PURE__ */ o(f, { asChild: !0, children: /* @__PURE__ */ r(
|
|
60
60
|
d,
|
|
61
61
|
{
|
|
62
|
+
disabled: !t?.isEditable,
|
|
62
63
|
type: "button",
|
|
63
64
|
variant: "ghost",
|
|
64
65
|
size: "icon",
|
|
@@ -67,8 +68,8 @@ const ho = () => {
|
|
|
67
68
|
!1
|
|
68
69
|
),
|
|
69
70
|
children: [
|
|
70
|
-
/* @__PURE__ */ o(
|
|
71
|
-
/* @__PURE__ */ o(
|
|
71
|
+
/* @__PURE__ */ o(b, {}),
|
|
72
|
+
/* @__PURE__ */ o(C, {})
|
|
72
73
|
]
|
|
73
74
|
}
|
|
74
75
|
) }),
|
|
@@ -78,7 +79,7 @@ const ho = () => {
|
|
|
78
79
|
"Insert table"
|
|
79
80
|
] }),
|
|
80
81
|
/* @__PURE__ */ o(e, {}),
|
|
81
|
-
/* @__PURE__ */ r(i, { onClick:
|
|
82
|
+
/* @__PURE__ */ r(i, { onClick: a, children: [
|
|
82
83
|
/* @__PURE__ */ o(R, {}),
|
|
83
84
|
"Insert row"
|
|
84
85
|
] }),
|
|
@@ -95,7 +96,7 @@ const ho = () => {
|
|
|
95
96
|
/* @__PURE__ */ o(g, {}),
|
|
96
97
|
"Remove column"
|
|
97
98
|
] }),
|
|
98
|
-
/* @__PURE__ */ r(i, { onClick:
|
|
99
|
+
/* @__PURE__ */ r(i, { onClick: c, children: [
|
|
99
100
|
/* @__PURE__ */ o(D, {}),
|
|
100
101
|
"Remove table"
|
|
101
102
|
] })
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as i } 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
4
|
import { cn as p } from "../../../../../packages/lune-ui/dist/lib/utils.js";
|
|
@@ -33,9 +33,9 @@ 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
35
|
import { useCurrentEditor as s, useEditorState as n } from "../../../../../node_modules/@tiptap/react/dist/index.js";
|
|
36
|
-
import
|
|
36
|
+
import d from "../../../../../node_modules/lucide-react/dist/esm/icons/list-ordered.js";
|
|
37
37
|
const U = () => {
|
|
38
|
-
const { editor: t } = s(),
|
|
38
|
+
const { editor: t } = s(), o = n({
|
|
39
39
|
editor: t,
|
|
40
40
|
selector({ editor: r }) {
|
|
41
41
|
if (r)
|
|
@@ -46,17 +46,18 @@ const U = () => {
|
|
|
46
46
|
}), m = () => {
|
|
47
47
|
t?.commands.toggleOrderedList();
|
|
48
48
|
};
|
|
49
|
-
return /* @__PURE__ */
|
|
49
|
+
return /* @__PURE__ */ i(
|
|
50
50
|
e,
|
|
51
51
|
{
|
|
52
|
+
disabled: !t?.isEditable,
|
|
52
53
|
type: "button",
|
|
53
54
|
variant: "ghost",
|
|
54
55
|
className: p(
|
|
55
56
|
"size-8! hover:bg-input/30!",
|
|
56
|
-
|
|
57
|
+
o?.isListActive && "bg-input/75! hover:bg-input/75!"
|
|
57
58
|
),
|
|
58
59
|
onClick: m,
|
|
59
|
-
children: /* @__PURE__ */
|
|
60
|
+
children: /* @__PURE__ */ i(d, {})
|
|
60
61
|
}
|
|
61
62
|
);
|
|
62
63
|
};
|
package/dist/shared/components/rich-editor/toolbar/underline/rich-editor-toolbar-underline.js
CHANGED
|
@@ -33,7 +33,7 @@ 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
35
|
import { useCurrentEditor as n, useEditorState as s } from "../../../../../node_modules/@tiptap/react/dist/index.js";
|
|
36
|
-
import
|
|
36
|
+
import l from "../../../../../node_modules/lucide-react/dist/esm/icons/underline.js";
|
|
37
37
|
const Q = () => {
|
|
38
38
|
const { editor: t } = n(), o = s({
|
|
39
39
|
editor: t,
|
|
@@ -49,6 +49,7 @@ const Q = () => {
|
|
|
49
49
|
return /* @__PURE__ */ i(
|
|
50
50
|
e,
|
|
51
51
|
{
|
|
52
|
+
disabled: !t?.isEditable,
|
|
52
53
|
type: "button",
|
|
53
54
|
variant: "ghost",
|
|
54
55
|
className: p(
|
|
@@ -56,7 +57,7 @@ const Q = () => {
|
|
|
56
57
|
o?.isUnderlineActive && "bg-input/75! hover:bg-input/75!"
|
|
57
58
|
),
|
|
58
59
|
onClick: m,
|
|
59
|
-
children: /* @__PURE__ */ i(
|
|
60
|
+
children: /* @__PURE__ */ i(l, {})
|
|
60
61
|
}
|
|
61
62
|
);
|
|
62
63
|
};
|