@lunejs/admin-ui 0.1.4 → 0.2.0
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/_virtual/index10.js +5 -2
- package/dist/_virtual/index11.js +4 -0
- package/dist/_virtual/index6.js +3 -3
- package/dist/_virtual/index8.js +3 -5
- package/dist/lib/api/fetchers/gql-fetcher.js +6 -6
- package/dist/lib/collections/components/collection-details/cards/general-card.js +20 -14
- package/dist/lib/custom-fields/components/fields/color.js +3 -3
- package/dist/lib/dashboard/pages/dashboard-page.js +5 -5
- package/dist/lib/product/components/product-details/cards/general-product-card.js +18 -12
- package/dist/node_modules/@tiptap/core/dist/index.js +3562 -0
- package/dist/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.js +17 -0
- package/dist/node_modules/@tiptap/extension-bold/dist/index.js +80 -0
- package/dist/node_modules/@tiptap/extension-document/dist/index.js +13 -0
- package/dist/node_modules/@tiptap/extension-heading/dist/index.js +64 -0
- package/dist/node_modules/@tiptap/extension-italic/dist/index.js +78 -0
- package/dist/node_modules/@tiptap/extension-link/dist/index.js +305 -0
- package/dist/node_modules/@tiptap/extension-list/dist/index.js +713 -0
- package/dist/node_modules/@tiptap/extension-paragraph/dist/index.js +42 -0
- package/dist/node_modules/@tiptap/extension-table/dist/index.js +380 -0
- package/dist/node_modules/@tiptap/extension-text/dist/index.js +14 -0
- package/dist/node_modules/@tiptap/extension-text-style/dist/index.js +240 -0
- package/dist/node_modules/@tiptap/extension-underline/dist/index.js +66 -0
- package/dist/node_modules/@tiptap/react/dist/index.js +481 -0
- package/dist/node_modules/eventemitter3/index.js +1 -1
- package/dist/node_modules/eventemitter3/index2.js +1 -1
- package/dist/node_modules/fast-equals/dist/es/index.js +324 -0
- package/dist/node_modules/linkifyjs/dist/linkify.js +707 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/baseline.js +10 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/between-horizontal-end.js +10 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/between-vertical-end.js +10 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/bold.js +11 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/grid-2x2-plus.js +16 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/grid-2x2-x.js +16 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/italic.js +10 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/link.js +9 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/list-ordered.js +13 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/table-columns-split.js +18 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/table-rows-split.js +18 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/table.js +11 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/underline.js +9 -0
- package/dist/node_modules/orderedmap/dist/index.js +103 -0
- package/dist/node_modules/prosemirror-commands/dist/index.js +388 -0
- package/dist/node_modules/prosemirror-keymap/dist/index.js +62 -0
- package/dist/node_modules/prosemirror-model/dist/index.js +2733 -0
- package/dist/node_modules/prosemirror-schema-list/dist/index.js +88 -0
- package/dist/node_modules/prosemirror-state/dist/index.js +822 -0
- package/dist/node_modules/prosemirror-tables/dist/index.js +1446 -0
- package/dist/node_modules/prosemirror-transform/dist/index.js +1520 -0
- package/dist/node_modules/prosemirror-view/dist/index.js +3772 -0
- package/dist/node_modules/react-is/index.js +1 -1
- package/dist/node_modules/recharts/es6/util/Events.js +1 -1
- package/dist/node_modules/recharts/es6/util/ReactUtils.js +1 -1
- package/dist/node_modules/use-sync-external-store/shim/index.js +1 -1
- package/dist/node_modules/w3c-keyname/index.js +93 -0
- package/dist/packages/lune-ui/dist/_virtual/index3.js +2 -5
- package/dist/packages/lune-ui/dist/_virtual/index6.js +5 -2
- package/dist/packages/lune-ui/dist/components/popover.js +15 -11
- package/dist/packages/lune-ui/dist/components/select.js +6 -6
- package/dist/packages/lune-ui/dist/form/form-date-picker.js +2 -2
- package/dist/packages/lune-ui/dist/form/form.js +4 -4
- package/dist/packages/lune-ui/dist/node_modules/@radix-ui/react-popover/dist/index.js +39 -38
- package/dist/packages/lune-ui/dist/node_modules/prop-types/index.js +1 -1
- package/dist/packages/lune-ui/dist/packages/lune-ui/node_modules/recharts/es6/util/Events.js +1 -1
- package/dist/shared/components/color-picker/color-picker.d.ts +2 -1
- package/dist/shared/components/color-picker/color-picker.js +11 -11
- package/dist/shared/components/data-table/data-table-filter.js +4 -4
- package/dist/shared/components/rich-editor/rich-editor.d.ts +6 -0
- package/dist/shared/components/rich-editor/rich-editor.js +93 -0
- package/dist/shared/components/rich-editor/toolbar/bold/rich-editor-toolbar-bold.d.ts +1 -0
- package/dist/shared/components/rich-editor/toolbar/bold/rich-editor-toolbar-bold.js +65 -0
- package/dist/shared/components/rich-editor/toolbar/color/rich-editor-toolbar-color.d.ts +1 -0
- package/dist/shared/components/rich-editor/toolbar/color/rich-editor-toolbar-color.js +65 -0
- package/dist/shared/components/rich-editor/toolbar/heading/rich-editor-toolbar-heading.d.ts +1 -0
- package/dist/shared/components/rich-editor/toolbar/heading/rich-editor-toolbar-heading.js +114 -0
- package/dist/shared/components/rich-editor/toolbar/italic/rich-editor-toolbar-italic.d.ts +1 -0
- package/dist/shared/components/rich-editor/toolbar/italic/rich-editor-toolbar-italic.js +65 -0
- package/dist/shared/components/rich-editor/toolbar/link/rich-editor-toolbar-link-form.d.ts +2 -0
- package/dist/shared/components/rich-editor/toolbar/link/rich-editor-toolbar-link-form.js +103 -0
- package/dist/shared/components/rich-editor/toolbar/link/rich-editor-toolbar-link.d.ts +1 -0
- package/dist/shared/components/rich-editor/toolbar/link/rich-editor-toolbar-link.js +63 -0
- package/dist/shared/components/rich-editor/toolbar/ol-list/rich-editor-toolbar-ul-list.d.ts +1 -0
- package/dist/shared/components/rich-editor/toolbar/ol-list/rich-editor-toolbar-ul-list.js +65 -0
- package/dist/shared/components/rich-editor/toolbar/table/rich-editor-toolbar-table.d.ts +1 -0
- package/dist/shared/components/rich-editor/toolbar/table/rich-editor-toolbar-table.js +107 -0
- package/dist/shared/components/rich-editor/toolbar/toolbar.d.ts +1 -0
- package/dist/shared/components/rich-editor/toolbar/toolbar.js +64 -0
- package/dist/shared/components/rich-editor/toolbar/ul-list/rich-editor-toolbar-ul-list.d.ts +1 -0
- package/dist/shared/components/rich-editor/toolbar/ul-list/rich-editor-toolbar-ul-list.js +65 -0
- package/dist/shared/components/rich-editor/toolbar/underline/rich-editor-toolbar-underline.d.ts +1 -0
- package/dist/shared/components/rich-editor/toolbar/underline/rich-editor-toolbar-underline.js +65 -0
- package/package.json +6 -1
package/dist/_virtual/index10.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import { getDefaultExportFromCjs as t } from "./_commonjsHelpers.js";
|
|
2
|
+
import { __require as e } from "../node_modules/eventemitter3/index2.js";
|
|
3
|
+
var r = e();
|
|
4
|
+
const i = /* @__PURE__ */ t(r);
|
|
2
5
|
export {
|
|
3
|
-
|
|
6
|
+
i as default
|
|
4
7
|
};
|
package/dist/_virtual/index6.js
CHANGED
package/dist/_virtual/index8.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
var r = e();
|
|
4
|
-
const i = /* @__PURE__ */ t(r);
|
|
1
|
+
import { __require as r } from "../node_modules/react-is/index.js";
|
|
2
|
+
var a = r();
|
|
5
3
|
export {
|
|
6
|
-
|
|
4
|
+
a as r
|
|
7
5
|
};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { ClientError as
|
|
1
|
+
import { ClientError as a } from "../../../node_modules/graphql-request/build/legacy/classes/ClientError.js";
|
|
2
2
|
import { gqlClient as o } from "../../../app/app.js";
|
|
3
|
-
import { getCookie as t, setCookie as
|
|
3
|
+
import { getCookie as t, setCookie as m } from "../../../shared/cookies/cookies.js";
|
|
4
4
|
import { CookiesKeys as r } from "../../../shared/cookies/keys.js";
|
|
5
|
-
async function
|
|
5
|
+
async function d(i, n) {
|
|
6
6
|
try {
|
|
7
7
|
const e = t(r.UserToken), s = t(r.ActiveShop);
|
|
8
|
-
return o.setHeader("Authorization", e ? `Bearer ${e}` : ""), o.setHeader("x_lune_shop_id", s ?? ""), await o.request({
|
|
8
|
+
return o.setHeader("Authorization", e ? `Bearer ${e}` : ""), o.setHeader("x_lune_shop_id", s ?? ""), o.setHeader("x_lune_timezone", Intl.DateTimeFormat().resolvedOptions().timeZone), await o.request({
|
|
9
9
|
document: i,
|
|
10
10
|
variables: n
|
|
11
11
|
});
|
|
12
12
|
} catch (e) {
|
|
13
|
-
throw e instanceof
|
|
13
|
+
throw e instanceof a && e.response.errors?.[0].extensions.code === "UNAUTHORIZED" && (m(r.UserToken, ""), window.location.href = "/login"), e;
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
export {
|
|
17
|
-
|
|
17
|
+
d as gqlFetcher
|
|
18
18
|
};
|
|
@@ -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
|
|
13
|
+
import { Card as m, CardHeader as e, CardTitle as p, 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
|
|
35
|
-
import {
|
|
36
|
-
import { CollectionAssetUploader as
|
|
37
|
-
import { useCollectionDetailsFormContext as
|
|
38
|
-
const
|
|
39
|
-
const r =
|
|
40
|
-
return /* @__PURE__ */ t(
|
|
41
|
-
/* @__PURE__ */ o(
|
|
42
|
-
/* @__PURE__ */ t(
|
|
43
|
-
/* @__PURE__ */ o(
|
|
44
|
-
/* @__PURE__ */ o(
|
|
45
|
-
|
|
34
|
+
import { FormInput as a } from "../../../../../packages/lune-ui/dist/form/form-input.js";
|
|
35
|
+
import { RichEditor as n } from "../../../../../shared/components/rich-editor/rich-editor.js";
|
|
36
|
+
import { CollectionAssetUploader as c } from "../../asset-uploader/collection-asset-uploader.js";
|
|
37
|
+
import { useCollectionDetailsFormContext as s } from "../use-form/use-form.js";
|
|
38
|
+
const X = () => {
|
|
39
|
+
const r = s();
|
|
40
|
+
return /* @__PURE__ */ t(m, { children: [
|
|
41
|
+
/* @__PURE__ */ o(e, { className: "flex", children: /* @__PURE__ */ o(p, { children: "General" }) }),
|
|
42
|
+
/* @__PURE__ */ t(l, { className: "flex flex-col gap-3", children: [
|
|
43
|
+
/* @__PURE__ */ o(a, { control: r.control, name: "name", label: "Name", placeholder: "Electronics" }),
|
|
44
|
+
/* @__PURE__ */ o(
|
|
45
|
+
n,
|
|
46
|
+
{
|
|
47
|
+
defaultValue: r.formState.defaultValues?.description,
|
|
48
|
+
onChange: (i) => r.setValue("description", i)
|
|
49
|
+
}
|
|
50
|
+
),
|
|
51
|
+
/* @__PURE__ */ o(c, { collection: r.collection })
|
|
46
52
|
] })
|
|
47
53
|
] });
|
|
48
54
|
};
|
|
49
55
|
export {
|
|
50
|
-
|
|
56
|
+
X as CollectionGeneralCard
|
|
51
57
|
};
|
|
@@ -38,7 +38,7 @@ import { CustomFieldPreviewContainer as L } from "./shared/preview/custom-field-
|
|
|
38
38
|
import F from "../../../../node_modules/lucide-react/dist/esm/icons/pipette.js";
|
|
39
39
|
import j from "../../../../node_modules/lucide-react/dist/esm/icons/x.js";
|
|
40
40
|
const gr = ({ onChange: a, definition: m, defaultValues: p }) => {
|
|
41
|
-
const d = N(), { items: s, build: u, append: n, remove: h, reset: g, update:
|
|
41
|
+
const d = N(), { items: s, build: u, append: n, remove: h, reset: g, update: f } = z(p ?? [""]), [v, C] = k(
|
|
42
42
|
p?.map((i) => u(i)) ?? []
|
|
43
43
|
);
|
|
44
44
|
return /* @__PURE__ */ t(
|
|
@@ -53,7 +53,7 @@ const gr = ({ onChange: a, definition: m, defaultValues: p }) => {
|
|
|
53
53
|
children: [
|
|
54
54
|
/* @__PURE__ */ t("div", { className: "group grid grid-cols-1 items-center gap-2 md:grid-cols-[25%_1fr] md:gap-4 cursor-default", children: [
|
|
55
55
|
/* @__PURE__ */ r(c, { htmlFor: d, className: "w-full", children: m.name }),
|
|
56
|
-
/* @__PURE__ */ r(P, { asChild: !0, children: /* @__PURE__ */ r(L, { className: "px-2", children:
|
|
56
|
+
/* @__PURE__ */ r(P, { asChild: !0, children: /* @__PURE__ */ r(L, { className: "px-2", children: v.map((i) => /* @__PURE__ */ r("div", { className: "w-5 h-5 rounded shrink-0", style: { backgroundColor: i.value } })) }) })
|
|
57
57
|
] }),
|
|
58
58
|
/* @__PURE__ */ r(b, { className: "w-auto min-w-72 max-w-lg", align: "start", children: /* @__PURE__ */ t("div", { className: "flex flex-col gap-2", children: [
|
|
59
59
|
/* @__PURE__ */ r(c, { children: m.name }),
|
|
@@ -65,7 +65,7 @@ const gr = ({ onChange: a, definition: m, defaultValues: p }) => {
|
|
|
65
65
|
style: { backgroundColor: i.value || "#000" }
|
|
66
66
|
}
|
|
67
67
|
),
|
|
68
|
-
/* @__PURE__ */ r(y, { onChange: (o) =>
|
|
68
|
+
/* @__PURE__ */ r(y, { onChange: (o) => f(i.id, o), children: /* @__PURE__ */ t(l, { size: "sm", variant: "outline", children: [
|
|
69
69
|
/* @__PURE__ */ r(F, { size: 16 }),
|
|
70
70
|
"Pick color"
|
|
71
71
|
] }) }),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as t, Fragment as f, jsxs as e } from "react/jsx-runtime";
|
|
2
|
-
import { useState as
|
|
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] =
|
|
52
|
+
const [r, L] = N({
|
|
53
53
|
from: g(new m()),
|
|
54
54
|
to: h(new m())
|
|
55
|
-
}), o =
|
|
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:
|
|
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:
|
|
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
|
|
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
|
|
35
|
-
import {
|
|
36
|
-
import { ProductAssetUploader as
|
|
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
|
|
38
|
+
const Y = () => {
|
|
39
39
|
const { product: m, ...o } = c();
|
|
40
|
-
return /* @__PURE__ */ t(
|
|
41
|
-
/* @__PURE__ */ r(
|
|
42
|
-
/* @__PURE__ */ t(
|
|
43
|
-
/* @__PURE__ */ r(
|
|
44
|
-
/* @__PURE__ */ r(
|
|
45
|
-
|
|
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
|
-
|
|
56
|
+
Y as GeneralProductCard
|
|
51
57
|
};
|