@appcorp/stellar-solutions-modules 0.1.37 → 0.1.39
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/components/theme-provider.js +1 -1
- package/components/theme-switcher.js +3 -3
- package/components/ui/badge.js +1 -1
- package/components/ui/button.js +1 -1
- package/components/ui/card.js +1 -1
- package/components/ui/checkbox.js +2 -2
- package/components/ui/combobox.js +5 -5
- package/components/ui/command.d.ts +1 -1
- package/components/ui/command.js +2 -2
- package/components/ui/dialog.js +1 -1
- package/components/ui/drawer.js +1 -1
- package/components/ui/dropdown-menu.js +1 -1
- package/components/ui/enhanced-table-footer-action.js +1 -1
- package/components/ui/enhanced-table-footer-page.js +1 -1
- package/components/ui/enhanced-table-footer-pagination.js +1 -1
- package/components/ui/enhanced-table.js +1 -1
- package/components/ui/form.js +2 -2
- package/components/ui/input.js +2 -2
- package/components/ui/label.js +1 -1
- package/components/ui/popover.js +1 -1
- package/components/ui/select.js +1 -1
- package/components/ui/separator.js +1 -1
- package/components/ui/switch.js +2 -2
- package/components/ui/table.js +1 -1
- package/components/ui/textarea.js +2 -2
- package/global-modules/bank/context.js +1 -1
- package/global-modules/bank/drawer.js +2 -2
- package/global-modules/bank/form.js +2 -2
- package/global-modules/bank/types.d.ts +1 -1
- package/global-modules/branch/branch.js +4 -4
- package/global-modules/branch/context.js +1 -1
- package/global-modules/branch/drawer.js +2 -2
- package/global-modules/branch/form.js +2 -2
- package/global-modules/branch/types.d.ts +1 -1
- package/global-modules/payment-mode/context.js +1 -1
- package/global-modules/payment-mode/drawer.js +2 -2
- package/global-modules/payment-mode/form.js +2 -2
- package/global-modules/payment-mode/payment-mode.js +4 -4
- package/global-modules/payment-mode/types.d.ts +1 -1
- package/global-modules/preferences/currency.js +2 -2
- package/global-modules/tax/context.js +1 -1
- package/global-modules/tax/drawer.js +2 -2
- package/global-modules/tax/form.js +2 -2
- package/global-modules/tax/tax.js +4 -4
- package/global-modules/tax/types.d.ts +1 -1
- package/package.json +12 -1
- package/supabase/supabase.d.ts +2 -80
- package/supabase/supabase.js +3 -284
|
@@ -59,7 +59,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
59
59
|
exports.ThemeProvider = ThemeProvider;
|
|
60
60
|
var react_1 = __importStar(require("react"));
|
|
61
61
|
var next_themes_1 = require("next-themes");
|
|
62
|
-
var themes_1 = require("
|
|
62
|
+
var themes_1 = require("../lib/themes");
|
|
63
63
|
// Component that applies theme variables when theme changes
|
|
64
64
|
function ThemeApplier(_a) {
|
|
65
65
|
var children = _a.children;
|
|
@@ -10,9 +10,9 @@ exports.ThemeSwitcher = ThemeSwitcher;
|
|
|
10
10
|
var react_1 = __importDefault(require("react"));
|
|
11
11
|
var lucide_react_1 = require("lucide-react");
|
|
12
12
|
var next_themes_1 = require("next-themes");
|
|
13
|
-
var button_1 = require("
|
|
14
|
-
var dropdown_menu_1 = require("
|
|
15
|
-
var themes_1 = require("
|
|
13
|
+
var button_1 = require("../components/ui/button");
|
|
14
|
+
var dropdown_menu_1 = require("../components/ui/dropdown-menu");
|
|
15
|
+
var themes_1 = require("../lib/themes");
|
|
16
16
|
function ThemeToggle() {
|
|
17
17
|
var setTheme = (0, next_themes_1.useTheme)().setTheme;
|
|
18
18
|
return (react_1.default.createElement(dropdown_menu_1.DropdownMenu, null,
|
package/components/ui/badge.js
CHANGED
|
@@ -60,7 +60,7 @@ exports.Badge = Badge;
|
|
|
60
60
|
var React = __importStar(require("react"));
|
|
61
61
|
var react_slot_1 = require("@radix-ui/react-slot");
|
|
62
62
|
var class_variance_authority_1 = require("class-variance-authority");
|
|
63
|
-
var utils_1 = require("
|
|
63
|
+
var utils_1 = require("../../lib/utils");
|
|
64
64
|
var badgeVariants = (0, class_variance_authority_1.cva)("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden", {
|
|
65
65
|
variants: {
|
|
66
66
|
variant: {
|
package/components/ui/button.js
CHANGED
|
@@ -60,7 +60,7 @@ exports.Button = Button;
|
|
|
60
60
|
var React = __importStar(require("react"));
|
|
61
61
|
var react_slot_1 = require("@radix-ui/react-slot");
|
|
62
62
|
var class_variance_authority_1 = require("class-variance-authority");
|
|
63
|
-
var utils_1 = require("
|
|
63
|
+
var utils_1 = require("../../lib/utils");
|
|
64
64
|
var buttonVariants = (0, class_variance_authority_1.cva)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive", {
|
|
65
65
|
variants: {
|
|
66
66
|
variant: {
|
package/components/ui/card.js
CHANGED
|
@@ -63,7 +63,7 @@ exports.CardAction = CardAction;
|
|
|
63
63
|
exports.CardDescription = CardDescription;
|
|
64
64
|
exports.CardContent = CardContent;
|
|
65
65
|
var React = __importStar(require("react"));
|
|
66
|
-
var utils_1 = require("
|
|
66
|
+
var utils_1 = require("../../lib/utils");
|
|
67
67
|
function Card(_a) {
|
|
68
68
|
var className = _a.className, props = __rest(_a, ["className"]);
|
|
69
69
|
return (React.createElement("div", __assign({ "data-slot": "card", className: (0, utils_1.cn)("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm", className) }, props)));
|
|
@@ -60,8 +60,8 @@ exports.Checkbox = Checkbox;
|
|
|
60
60
|
var React = __importStar(require("react"));
|
|
61
61
|
var CheckboxPrimitive = __importStar(require("@radix-ui/react-checkbox"));
|
|
62
62
|
var lucide_react_1 = require("lucide-react");
|
|
63
|
-
var utils_1 = require("
|
|
64
|
-
var label_1 = require("
|
|
63
|
+
var utils_1 = require("../../lib/utils");
|
|
64
|
+
var label_1 = require("../../components/ui/label");
|
|
65
65
|
function Checkbox(_a) {
|
|
66
66
|
var className = _a.className, error = _a.error, info = _a.info, label = _a.label, id = _a.id, props = __rest(_a, ["className", "error", "info", "label", "id"]);
|
|
67
67
|
// Determine if there's an error (for aria-invalid and styling)
|
|
@@ -39,11 +39,11 @@ exports.CompanyCombobox = CompanyCombobox;
|
|
|
39
39
|
exports.CountryCombobox = CountryCombobox;
|
|
40
40
|
var react_1 = __importStar(require("react"));
|
|
41
41
|
var lucide_react_1 = require("lucide-react");
|
|
42
|
-
var utils_1 = require("
|
|
43
|
-
var button_1 = require("
|
|
44
|
-
var label_1 = require("
|
|
45
|
-
var command_1 = require("
|
|
46
|
-
var popover_1 = require("
|
|
42
|
+
var utils_1 = require("../../lib/utils");
|
|
43
|
+
var button_1 = require("../../components/ui/button");
|
|
44
|
+
var label_1 = require("../../components/ui/label");
|
|
45
|
+
var command_1 = require("../../components/ui/command");
|
|
46
|
+
var popover_1 = require("../../components/ui/popover");
|
|
47
47
|
function VirtualizedList(_a) {
|
|
48
48
|
var options = _a.options, selectedValue = _a.selectedValue, onSelect = _a.onSelect, scrollContainer = _a.scrollContainer;
|
|
49
49
|
var _b = (0, react_1.useState)({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { Command as CommandPrimitive } from "cmdk";
|
|
3
|
-
import { Dialog } from "
|
|
3
|
+
import { Dialog } from "../../components/ui/dialog";
|
|
4
4
|
declare function Command({ className, ...props }: React.ComponentProps<typeof CommandPrimitive>): React.JSX.Element;
|
|
5
5
|
declare function CommandDialog({ title, description, children, className, showCloseButton, ...props }: React.ComponentProps<typeof Dialog> & {
|
|
6
6
|
title?: string;
|
package/components/ui/command.js
CHANGED
|
@@ -68,8 +68,8 @@ exports.CommandSeparator = CommandSeparator;
|
|
|
68
68
|
var React = __importStar(require("react"));
|
|
69
69
|
var cmdk_1 = require("cmdk");
|
|
70
70
|
var lucide_react_1 = require("lucide-react");
|
|
71
|
-
var utils_1 = require("
|
|
72
|
-
var dialog_1 = require("
|
|
71
|
+
var utils_1 = require("../../lib/utils");
|
|
72
|
+
var dialog_1 = require("../../components/ui/dialog");
|
|
73
73
|
function Command(_a) {
|
|
74
74
|
var className = _a.className, props = __rest(_a, ["className"]);
|
|
75
75
|
return (React.createElement(cmdk_1.Command, __assign({ "data-slot": "command", className: (0, utils_1.cn)("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md", className) }, props)));
|
package/components/ui/dialog.js
CHANGED
|
@@ -69,7 +69,7 @@ exports.DialogTrigger = DialogTrigger;
|
|
|
69
69
|
var React = __importStar(require("react"));
|
|
70
70
|
var DialogPrimitive = __importStar(require("@radix-ui/react-dialog"));
|
|
71
71
|
var lucide_react_1 = require("lucide-react");
|
|
72
|
-
var utils_1 = require("
|
|
72
|
+
var utils_1 = require("../../lib/utils");
|
|
73
73
|
function Dialog(_a) {
|
|
74
74
|
var props = __rest(_a, []);
|
|
75
75
|
return React.createElement(DialogPrimitive.Root, __assign({ "data-slot": "dialog" }, props));
|
package/components/ui/drawer.js
CHANGED
|
@@ -68,7 +68,7 @@ exports.DrawerTitle = DrawerTitle;
|
|
|
68
68
|
exports.DrawerDescription = DrawerDescription;
|
|
69
69
|
var React = __importStar(require("react"));
|
|
70
70
|
var vaul_1 = require("vaul");
|
|
71
|
-
var utils_1 = require("
|
|
71
|
+
var utils_1 = require("../../lib/utils");
|
|
72
72
|
function Drawer(_a) {
|
|
73
73
|
var props = __rest(_a, []);
|
|
74
74
|
return React.createElement(vaul_1.Drawer.Root, __assign({ "data-slot": "drawer" }, props));
|
|
@@ -74,7 +74,7 @@ exports.DropdownMenuSubContent = DropdownMenuSubContent;
|
|
|
74
74
|
var React = __importStar(require("react"));
|
|
75
75
|
var DropdownMenuPrimitive = __importStar(require("@radix-ui/react-dropdown-menu"));
|
|
76
76
|
var lucide_react_1 = require("lucide-react");
|
|
77
|
-
var utils_1 = require("
|
|
77
|
+
var utils_1 = require("../../lib/utils");
|
|
78
78
|
function DropdownMenu(_a) {
|
|
79
79
|
var props = __rest(_a, []);
|
|
80
80
|
return React.createElement(DropdownMenuPrimitive.Root, __assign({ "data-slot": "dropdown-menu" }, props));
|
|
@@ -22,7 +22,7 @@ var react_1 = __importDefault(require("react"));
|
|
|
22
22
|
var lucide_react_1 = require("lucide-react");
|
|
23
23
|
var next_intl_1 = require("next-intl");
|
|
24
24
|
var button_1 = require("./button");
|
|
25
|
-
var use_rtl_1 = require("
|
|
25
|
+
var use_rtl_1 = require("../../hooks/use-rtl");
|
|
26
26
|
var EnhancedTableFooterAction = function (_a) {
|
|
27
27
|
var handleNextOnClick = _a.handleNextOnClick, handlePreviousOnClick = _a.handlePreviousOnClick, isNextDisabled = _a.isNextDisabled, isPreviousDisabled = _a.isPreviousDisabled, loading = _a.loading, ariaLabels = _a.ariaLabels;
|
|
28
28
|
var t = (0, next_intl_1.useTranslations)();
|
|
@@ -19,7 +19,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
19
19
|
exports.EnhancedTableFooterPage = void 0;
|
|
20
20
|
var react_1 = __importDefault(require("react"));
|
|
21
21
|
var next_intl_1 = require("next-intl");
|
|
22
|
-
var use_rtl_1 = require("
|
|
22
|
+
var use_rtl_1 = require("../../hooks/use-rtl");
|
|
23
23
|
var EnhancedTableFooterPage = function (_a) {
|
|
24
24
|
var currentPage = _a.currentPage, loading = _a.loading, totalPages = _a.totalPages, translationMap = _a.translationMap, _b = _a.className, className = _b === void 0 ? "" : _b;
|
|
25
25
|
var t = (0, next_intl_1.useTranslations)();
|
|
@@ -21,7 +21,7 @@ exports.EnhancedTableFooterPagination = void 0;
|
|
|
21
21
|
var select_1 = require("./select");
|
|
22
22
|
var react_1 = __importDefault(require("react"));
|
|
23
23
|
var next_intl_1 = require("next-intl");
|
|
24
|
-
var use_rtl_1 = require("
|
|
24
|
+
var use_rtl_1 = require("../../hooks/use-rtl");
|
|
25
25
|
var EnhancedTableFooterPagination = function (_a) {
|
|
26
26
|
var handleOnSelect = _a.handleOnSelect, listOptions = _a.listOptions, loading = _a.loading, nodeSelectKey = _a.nodeSelectKey, pageLimit = _a.pageLimit, labelText = _a.labelText, _b = _a.className, className = _b === void 0 ? "" : _b;
|
|
27
27
|
var t = (0, next_intl_1.useTranslations)();
|
|
@@ -10,7 +10,7 @@ var lucide_react_1 = require("lucide-react");
|
|
|
10
10
|
var table_1 = require("./table");
|
|
11
11
|
var button_1 = require("./button");
|
|
12
12
|
var dropdown_menu_1 = require("./dropdown-menu");
|
|
13
|
-
var utils_1 = require("
|
|
13
|
+
var utils_1 = require("../../lib/utils");
|
|
14
14
|
var enhanced_table_footer_action_1 = require("./enhanced-table-footer-action");
|
|
15
15
|
var enhanced_table_footer_page_1 = require("./enhanced-table-footer-page");
|
|
16
16
|
var enhanced_table_footer_pagination_1 = require("./enhanced-table-footer-pagination");
|
package/components/ui/form.js
CHANGED
|
@@ -65,8 +65,8 @@ exports.FormMessage = FormMessage;
|
|
|
65
65
|
var React = __importStar(require("react"));
|
|
66
66
|
var react_slot_1 = require("@radix-ui/react-slot");
|
|
67
67
|
var react_hook_form_1 = require("react-hook-form");
|
|
68
|
-
var utils_1 = require("
|
|
69
|
-
var label_1 = require("
|
|
68
|
+
var utils_1 = require("../../lib/utils");
|
|
69
|
+
var label_1 = require("../../components/ui/label");
|
|
70
70
|
var Form = react_hook_form_1.FormProvider;
|
|
71
71
|
exports.Form = Form;
|
|
72
72
|
var FormFieldContext = React.createContext({});
|
package/components/ui/input.js
CHANGED
|
@@ -57,8 +57,8 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
57
57
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
58
58
|
exports.Input = void 0;
|
|
59
59
|
var React = __importStar(require("react"));
|
|
60
|
-
var utils_1 = require("
|
|
61
|
-
var label_1 = require("
|
|
60
|
+
var utils_1 = require("../../lib/utils");
|
|
61
|
+
var label_1 = require("../../components/ui/label");
|
|
62
62
|
var Input = React.forwardRef(function (_a, ref) {
|
|
63
63
|
var className = _a.className, type = _a.type, error = _a.error, info = _a.info, label = _a.label, required = _a.required, id = _a.id, props = __rest(_a, ["className", "type", "error", "info", "label", "required", "id"]);
|
|
64
64
|
// Determine if there's an error (for aria-invalid and styling)
|
package/components/ui/label.js
CHANGED
|
@@ -59,7 +59,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
59
59
|
exports.Label = Label;
|
|
60
60
|
var React = __importStar(require("react"));
|
|
61
61
|
var LabelPrimitive = __importStar(require("@radix-ui/react-label"));
|
|
62
|
-
var utils_1 = require("
|
|
62
|
+
var utils_1 = require("../../lib/utils");
|
|
63
63
|
function Label(_a) {
|
|
64
64
|
var className = _a.className, _b = _a.required, required = _b === void 0 ? false : _b, children = _a.children, props = __rest(_a, ["className", "required", "children"]);
|
|
65
65
|
return (React.createElement(LabelPrimitive.Root, __assign({ "data-slot": "label", className: (0, utils_1.cn)("flex items-center gap-1 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50", className) }, props),
|
package/components/ui/popover.js
CHANGED
|
@@ -62,7 +62,7 @@ exports.PopoverContent = PopoverContent;
|
|
|
62
62
|
exports.PopoverAnchor = PopoverAnchor;
|
|
63
63
|
var React = __importStar(require("react"));
|
|
64
64
|
var PopoverPrimitive = __importStar(require("@radix-ui/react-popover"));
|
|
65
|
-
var utils_1 = require("
|
|
65
|
+
var utils_1 = require("../../lib/utils");
|
|
66
66
|
function Popover(_a) {
|
|
67
67
|
var props = __rest(_a, []);
|
|
68
68
|
return React.createElement(PopoverPrimitive.Root, __assign({ "data-slot": "popover" }, props));
|
package/components/ui/select.js
CHANGED
|
@@ -69,7 +69,7 @@ exports.SelectValue = SelectValue;
|
|
|
69
69
|
var React = __importStar(require("react"));
|
|
70
70
|
var SelectPrimitive = __importStar(require("@radix-ui/react-select"));
|
|
71
71
|
var lucide_react_1 = require("lucide-react");
|
|
72
|
-
var utils_1 = require("
|
|
72
|
+
var utils_1 = require("../../lib/utils");
|
|
73
73
|
function Select(_a) {
|
|
74
74
|
var props = __rest(_a, []);
|
|
75
75
|
return React.createElement(SelectPrimitive.Root, __assign({ "data-slot": "select" }, props));
|
|
@@ -59,7 +59,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
59
59
|
exports.Separator = Separator;
|
|
60
60
|
var React = __importStar(require("react"));
|
|
61
61
|
var SeparatorPrimitive = __importStar(require("@radix-ui/react-separator"));
|
|
62
|
-
var utils_1 = require("
|
|
62
|
+
var utils_1 = require("../../lib/utils");
|
|
63
63
|
function Separator(_a) {
|
|
64
64
|
var className = _a.className, _b = _a.orientation, orientation = _b === void 0 ? "horizontal" : _b, _c = _a.decorative, decorative = _c === void 0 ? true : _c, props = __rest(_a, ["className", "orientation", "decorative"]);
|
|
65
65
|
return (React.createElement(SeparatorPrimitive.Root, __assign({ "data-slot": "separator", decorative: decorative, orientation: orientation, className: (0, utils_1.cn)("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px", className) }, props)));
|
package/components/ui/switch.js
CHANGED
|
@@ -59,8 +59,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
59
59
|
exports.Switch = void 0;
|
|
60
60
|
var React = __importStar(require("react"));
|
|
61
61
|
var SwitchPrimitive = __importStar(require("@radix-ui/react-switch"));
|
|
62
|
-
var utils_1 = require("
|
|
63
|
-
var label_1 = require("
|
|
62
|
+
var utils_1 = require("../../lib/utils");
|
|
63
|
+
var label_1 = require("../../components/ui/label");
|
|
64
64
|
var Switch = React.forwardRef(function (_a, ref) {
|
|
65
65
|
var className = _a.className, error = _a.error, info = _a.info, label = _a.label, required = _a.required, id = _a.id, props = __rest(_a, ["className", "error", "info", "label", "required", "id"]);
|
|
66
66
|
// Determine if there's an error (for aria-invalid and styling)
|
package/components/ui/table.js
CHANGED
|
@@ -65,7 +65,7 @@ exports.TableRow = TableRow;
|
|
|
65
65
|
exports.TableCell = TableCell;
|
|
66
66
|
exports.TableCaption = TableCaption;
|
|
67
67
|
var React = __importStar(require("react"));
|
|
68
|
-
var utils_1 = require("
|
|
68
|
+
var utils_1 = require("../../lib/utils");
|
|
69
69
|
function Table(_a) {
|
|
70
70
|
var className = _a.className, props = __rest(_a, ["className"]);
|
|
71
71
|
return (React.createElement("div", { "data-slot": "table-container", className: "relative w-full overflow-x-auto" },
|
|
@@ -57,8 +57,8 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
57
57
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
58
58
|
exports.Textarea = void 0;
|
|
59
59
|
var React = __importStar(require("react"));
|
|
60
|
-
var utils_1 = require("
|
|
61
|
-
var label_1 = require("
|
|
60
|
+
var utils_1 = require("../../lib/utils");
|
|
61
|
+
var label_1 = require("../../components/ui/label");
|
|
62
62
|
var Textarea = React.forwardRef(function (_a, ref) {
|
|
63
63
|
var className = _a.className, error = _a.error, info = _a.info, label = _a.label, required = _a.required, id = _a.id, props = __rest(_a, ["className", "error", "info", "label", "required", "id"]);
|
|
64
64
|
// Determine if there's an error (for aria-invalid and styling)
|
|
@@ -84,7 +84,7 @@ var util_functions_1 = require("@react-pakistan/util-functions");
|
|
|
84
84
|
var actions_1 = require("./actions");
|
|
85
85
|
var constants_1 = require("./constants");
|
|
86
86
|
var reducer_1 = require("./reducer");
|
|
87
|
-
var toast_utils_1 = require("
|
|
87
|
+
var toast_utils_1 = require("../../lib/toast-utils");
|
|
88
88
|
var types_1 = require("./types");
|
|
89
89
|
var validate_1 = require("./validate");
|
|
90
90
|
var context_1 = require("../preferences/context");
|
|
@@ -26,8 +26,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
26
26
|
exports.BankDrawer = void 0;
|
|
27
27
|
var react_1 = __importDefault(require("react"));
|
|
28
28
|
var lucide_react_1 = require("lucide-react");
|
|
29
|
-
var button_1 = require("
|
|
30
|
-
var drawer_1 = require("
|
|
29
|
+
var button_1 = require("../../components/ui/button");
|
|
30
|
+
var drawer_1 = require("../../components/ui/drawer");
|
|
31
31
|
var context_1 = require("./context");
|
|
32
32
|
var form_1 = require("./form");
|
|
33
33
|
// ============================================================================
|
|
@@ -19,8 +19,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
19
19
|
exports.Form = void 0;
|
|
20
20
|
var react_1 = __importDefault(require("react"));
|
|
21
21
|
var next_intl_1 = require("next-intl");
|
|
22
|
-
var input_1 = require("
|
|
23
|
-
var switch_1 = require("
|
|
22
|
+
var input_1 = require("../../components/ui/input");
|
|
23
|
+
var switch_1 = require("../../components/ui/switch");
|
|
24
24
|
var context_1 = require("./context");
|
|
25
25
|
var Form = function (_a) {
|
|
26
26
|
var isRTL = _a.isRTL, translationMap = _a.translationMap;
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
* - Types: PascalCase following interface conventions
|
|
24
24
|
*/
|
|
25
25
|
import { Dispatch } from "react";
|
|
26
|
-
import { RowAction, HeaderAction } from "
|
|
26
|
+
import { RowAction, HeaderAction } from "../../components/ui/enhanced-table";
|
|
27
27
|
import { BankActions } from "./actions";
|
|
28
28
|
import { PreferenceBE as PreferenceTypeBE } from "@react-pakistan/util-functions/api/stellar-solutions/type";
|
|
29
29
|
/**
|
|
@@ -7,10 +7,10 @@ exports.Branch = void 0;
|
|
|
7
7
|
var react_1 = __importDefault(require("react"));
|
|
8
8
|
var next_intl_1 = require("next-intl");
|
|
9
9
|
var util_functions_1 = require("@react-pakistan/util-functions");
|
|
10
|
-
var use_rtl_1 = require("
|
|
11
|
-
var enhanced_table_1 = require("
|
|
12
|
-
var sonner_1 = require("
|
|
13
|
-
var theme_switcher_1 = require("
|
|
10
|
+
var use_rtl_1 = require("../../hooks/use-rtl");
|
|
11
|
+
var enhanced_table_1 = require("../../components/ui/enhanced-table");
|
|
12
|
+
var sonner_1 = require("../../components/ui/sonner");
|
|
13
|
+
var theme_switcher_1 = require("../../components/theme-switcher");
|
|
14
14
|
var constants_1 = require("./constants");
|
|
15
15
|
var context_1 = require("./context");
|
|
16
16
|
var drawer_1 = require("./drawer");
|
|
@@ -84,7 +84,7 @@ var util_functions_1 = require("@react-pakistan/util-functions");
|
|
|
84
84
|
var actions_1 = require("./actions");
|
|
85
85
|
var constants_1 = require("./constants");
|
|
86
86
|
var reducer_1 = require("./reducer");
|
|
87
|
-
var toast_utils_1 = require("
|
|
87
|
+
var toast_utils_1 = require("../../lib/toast-utils");
|
|
88
88
|
var types_1 = require("./types");
|
|
89
89
|
var validate_1 = require("./validate");
|
|
90
90
|
var context_1 = require("../preferences/context");
|
|
@@ -26,8 +26,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
26
26
|
exports.BranchDrawer = void 0;
|
|
27
27
|
var react_1 = __importDefault(require("react"));
|
|
28
28
|
var lucide_react_1 = require("lucide-react");
|
|
29
|
-
var button_1 = require("
|
|
30
|
-
var drawer_1 = require("
|
|
29
|
+
var button_1 = require("../../components/ui/button");
|
|
30
|
+
var drawer_1 = require("../../components/ui/drawer");
|
|
31
31
|
var context_1 = require("./context");
|
|
32
32
|
var form_1 = require("./form");
|
|
33
33
|
// ============================================================================
|
|
@@ -19,8 +19,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
19
19
|
exports.Form = void 0;
|
|
20
20
|
var react_1 = __importDefault(require("react"));
|
|
21
21
|
var next_intl_1 = require("next-intl");
|
|
22
|
-
var input_1 = require("
|
|
23
|
-
var switch_1 = require("
|
|
22
|
+
var input_1 = require("../../components/ui/input");
|
|
23
|
+
var switch_1 = require("../../components/ui/switch");
|
|
24
24
|
var context_1 = require("./context");
|
|
25
25
|
var Form = function (_a) {
|
|
26
26
|
var isRTL = _a.isRTL, translationMap = _a.translationMap;
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
* - Types: PascalCase following interface conventions
|
|
24
24
|
*/
|
|
25
25
|
import { Dispatch } from "react";
|
|
26
|
-
import { RowAction, HeaderAction } from "
|
|
26
|
+
import { RowAction, HeaderAction } from "../../components/ui/enhanced-table";
|
|
27
27
|
import { BranchActions } from "./actions";
|
|
28
28
|
/**
|
|
29
29
|
* Branch Context Interface
|
|
@@ -84,7 +84,7 @@ var util_functions_1 = require("@react-pakistan/util-functions");
|
|
|
84
84
|
var actions_1 = require("./actions");
|
|
85
85
|
var constants_1 = require("./constants");
|
|
86
86
|
var reducer_1 = require("./reducer");
|
|
87
|
-
var toast_utils_1 = require("
|
|
87
|
+
var toast_utils_1 = require("../../lib/toast-utils");
|
|
88
88
|
var types_1 = require("./types");
|
|
89
89
|
var validate_1 = require("./validate");
|
|
90
90
|
var context_1 = require("../preferences/context");
|
|
@@ -26,8 +26,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
26
26
|
exports.PaymentModeDrawer = void 0;
|
|
27
27
|
var react_1 = __importDefault(require("react"));
|
|
28
28
|
var lucide_react_1 = require("lucide-react");
|
|
29
|
-
var button_1 = require("
|
|
30
|
-
var drawer_1 = require("
|
|
29
|
+
var button_1 = require("../../components/ui/button");
|
|
30
|
+
var drawer_1 = require("../../components/ui/drawer");
|
|
31
31
|
var context_1 = require("./context");
|
|
32
32
|
var form_1 = require("./form");
|
|
33
33
|
// ============================================================================
|
|
@@ -19,8 +19,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
19
19
|
exports.PaymentModeForm = void 0;
|
|
20
20
|
var react_1 = __importDefault(require("react"));
|
|
21
21
|
var next_intl_1 = require("next-intl");
|
|
22
|
-
var input_1 = require("
|
|
23
|
-
var switch_1 = require("
|
|
22
|
+
var input_1 = require("../../components/ui/input");
|
|
23
|
+
var switch_1 = require("../../components/ui/switch");
|
|
24
24
|
var context_1 = require("./context");
|
|
25
25
|
var PaymentModeForm = function (_a) {
|
|
26
26
|
var isRTL = _a.isRTL, translationMap = _a.translationMap;
|
|
@@ -8,10 +8,10 @@ exports.PaymentMode = void 0;
|
|
|
8
8
|
var react_1 = __importDefault(require("react"));
|
|
9
9
|
var next_intl_1 = require("next-intl");
|
|
10
10
|
var util_functions_1 = require("@react-pakistan/util-functions");
|
|
11
|
-
var use_rtl_1 = require("
|
|
12
|
-
var enhanced_table_1 = require("
|
|
13
|
-
var sonner_1 = require("
|
|
14
|
-
var theme_switcher_1 = require("
|
|
11
|
+
var use_rtl_1 = require("../../hooks/use-rtl");
|
|
12
|
+
var enhanced_table_1 = require("../../components/ui/enhanced-table");
|
|
13
|
+
var sonner_1 = require("../../components/ui/sonner");
|
|
14
|
+
var theme_switcher_1 = require("../../components/theme-switcher");
|
|
15
15
|
var constants_1 = require("./constants");
|
|
16
16
|
var context_1 = require("./context");
|
|
17
17
|
var drawer_1 = require("./drawer");
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
* - Types: PascalCase following interface conventions
|
|
24
24
|
*/
|
|
25
25
|
import { Dispatch } from "react";
|
|
26
|
-
import { RowAction, HeaderAction } from "
|
|
26
|
+
import { RowAction, HeaderAction } from "../../components/ui/enhanced-table";
|
|
27
27
|
import { PaymentModeActions } from "./actions";
|
|
28
28
|
/**
|
|
29
29
|
* Payment Mode Context Interface
|
|
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.Currency = void 0;
|
|
7
7
|
var react_1 = __importDefault(require("react"));
|
|
8
8
|
var util_functions_1 = require("@react-pakistan/util-functions");
|
|
9
|
-
var checkbox_1 = require("
|
|
10
|
-
var button_1 = require("
|
|
9
|
+
var checkbox_1 = require("../../components/ui/checkbox");
|
|
10
|
+
var button_1 = require("../../components/ui/button");
|
|
11
11
|
var context_1 = require("./context");
|
|
12
12
|
var outline_1 = require("@heroicons/react/24/outline");
|
|
13
13
|
var Currency = function () {
|
|
@@ -85,7 +85,7 @@ var actions_1 = require("./actions");
|
|
|
85
85
|
var constants_1 = require("./constants");
|
|
86
86
|
var reducer_1 = require("./reducer");
|
|
87
87
|
var types_1 = require("./types");
|
|
88
|
-
var toast_utils_1 = require("
|
|
88
|
+
var toast_utils_1 = require("../../lib/toast-utils");
|
|
89
89
|
var validate_1 = require("./validate");
|
|
90
90
|
var context_1 = require("../preferences/context");
|
|
91
91
|
// ============================================================================
|
|
@@ -26,8 +26,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
26
26
|
exports.TaxDrawer = void 0;
|
|
27
27
|
var react_1 = __importDefault(require("react"));
|
|
28
28
|
var lucide_react_1 = require("lucide-react");
|
|
29
|
-
var button_1 = require("
|
|
30
|
-
var drawer_1 = require("
|
|
29
|
+
var button_1 = require("../../components/ui/button");
|
|
30
|
+
var drawer_1 = require("../../components/ui/drawer");
|
|
31
31
|
var context_1 = require("./context");
|
|
32
32
|
var form_1 = require("./form");
|
|
33
33
|
// ============================================================================
|
|
@@ -20,8 +20,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
20
20
|
exports.TaxForm = void 0;
|
|
21
21
|
var react_1 = __importDefault(require("react"));
|
|
22
22
|
var next_intl_1 = require("next-intl");
|
|
23
|
-
var input_1 = require("
|
|
24
|
-
var switch_1 = require("
|
|
23
|
+
var input_1 = require("../../components/ui/input");
|
|
24
|
+
var switch_1 = require("../../components/ui/switch");
|
|
25
25
|
var context_1 = require("./context");
|
|
26
26
|
// ============================================================================
|
|
27
27
|
// COMPONENT
|
|
@@ -8,10 +8,10 @@ exports.Tax = void 0;
|
|
|
8
8
|
var react_1 = __importDefault(require("react"));
|
|
9
9
|
var next_intl_1 = require("next-intl");
|
|
10
10
|
var util_functions_1 = require("@react-pakistan/util-functions");
|
|
11
|
-
var use_rtl_1 = require("
|
|
12
|
-
var enhanced_table_1 = require("
|
|
13
|
-
var sonner_1 = require("
|
|
14
|
-
var theme_switcher_1 = require("
|
|
11
|
+
var use_rtl_1 = require("../../hooks/use-rtl");
|
|
12
|
+
var enhanced_table_1 = require("../../components/ui/enhanced-table");
|
|
13
|
+
var sonner_1 = require("../../components/ui/sonner");
|
|
14
|
+
var theme_switcher_1 = require("../../components/theme-switcher");
|
|
15
15
|
var constants_1 = require("./constants");
|
|
16
16
|
var context_1 = require("./context");
|
|
17
17
|
var drawer_1 = require("./drawer");
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
* - Types: PascalCase following interface conventions
|
|
24
24
|
*/
|
|
25
25
|
import { Dispatch } from "react";
|
|
26
|
-
import { RowAction, HeaderAction } from "
|
|
26
|
+
import { RowAction, HeaderAction } from "../../components/ui/enhanced-table";
|
|
27
27
|
import { TaxActions } from "./actions";
|
|
28
28
|
/**
|
|
29
29
|
* Tax Context Interface
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@appcorp/stellar-solutions-modules",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.39",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"automate": "./automate.sh",
|
|
6
6
|
"build": "yarn clean && yarn build:ts && cp package.json lib && cp README.md lib && cp yarn.lock lib",
|
|
@@ -20,6 +20,8 @@
|
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"@appcorp/app-corp-vista": "^0.3.44",
|
|
23
|
+
"@dnd-kit/core": "^6.3.1",
|
|
24
|
+
"@dnd-kit/modifiers": "^9.0.0",
|
|
23
25
|
"@eslint/eslintrc": "^3",
|
|
24
26
|
"@headlessui/react": "^2",
|
|
25
27
|
"@heroicons/react": "^2",
|
|
@@ -35,22 +37,31 @@
|
|
|
35
37
|
"@supabase/supabase-js": "^2",
|
|
36
38
|
"@tailwindcss/forms": "^0",
|
|
37
39
|
"@tailwindcss/postcss": "^4",
|
|
40
|
+
"@tanstack/react-table": "^8.21.3",
|
|
41
|
+
"@types/lodash.throttle": "^4",
|
|
38
42
|
"@types/node": "^22",
|
|
39
43
|
"@types/react": "^19",
|
|
40
44
|
"@types/react-dom": "^19",
|
|
41
45
|
"@types/react-slick": "^0",
|
|
46
|
+
"@uidotdev/usehooks": "^2.4.1",
|
|
42
47
|
"class-variance-authority": "^0.7.1",
|
|
43
48
|
"clsx": "^2.1.1",
|
|
44
49
|
"cmdk": "^1.1.1",
|
|
50
|
+
"color": "^5.0.2",
|
|
51
|
+
"date-fns": "^4.1.0",
|
|
45
52
|
"dayjs": "^1",
|
|
46
53
|
"eslint": "^9",
|
|
47
54
|
"eslint-config-next": "^15",
|
|
48
55
|
"husky": "^9",
|
|
56
|
+
"jotai": "^2.15.0",
|
|
49
57
|
"libphonenumber-js": "^1",
|
|
58
|
+
"lodash.throttle": "^4.1.1",
|
|
50
59
|
"lucide-react": "^0.544.0",
|
|
60
|
+
"motion": "^12.23.22",
|
|
51
61
|
"next": "^15",
|
|
52
62
|
"next-intl": "^4",
|
|
53
63
|
"next-themes": "^0.4.6",
|
|
64
|
+
"radix-ui": "^1.4.3",
|
|
54
65
|
"react": "^19",
|
|
55
66
|
"react-copy-to-clipboard": "^5",
|
|
56
67
|
"react-dom": "^19",
|
package/supabase/supabase.d.ts
CHANGED
|
@@ -1,83 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Supabase Client Configuration
|
|
3
|
-
*
|
|
4
|
-
* This module provides centralized Supabase client configuration and utilities.
|
|
5
|
-
* Handles authentication, storage URLs, and client initialization with proper error handling.
|
|
6
|
-
*
|
|
7
|
-
* Features:
|
|
8
|
-
* - Centralized Supabase client configuration
|
|
9
|
-
* - Storage URL management for public and private buckets
|
|
10
|
-
* - Environment variable validation
|
|
11
|
-
* - Type-safe client creation
|
|
12
|
-
* - Authentication persistence configuration
|
|
13
|
-
*
|
|
14
|
-
* Environment Variables Required:
|
|
15
|
-
* - NEXT_PUBLIC_SUPABASE_URL: Supabase project URL
|
|
16
|
-
* - NEXT_PUBLIC_SUPABASE_ANON_KEY: Supabase anonymous key
|
|
17
|
-
* - NEXT_PUBLIC_SUPABASE_STORAGE_URL: Storage base URL
|
|
18
|
-
* - NEXT_PUBLIC_SUPABASE_PRIVATE_BUCKET: Private bucket name
|
|
19
|
-
* - NEXT_PUBLIC_SUPABASE_PUBLIC_BUCKET: Public bucket name
|
|
20
|
-
*/
|
|
21
|
-
import { SupabaseClient } from "@supabase/supabase-js";
|
|
22
|
-
/**
|
|
23
|
-
* Storage bucket types for type safety
|
|
24
|
-
*/
|
|
25
|
-
export type StorageBucketType = "public" | "private" | "authenticated";
|
|
26
|
-
/**
|
|
27
|
-
* Base URL for Supabase storage
|
|
28
|
-
*/
|
|
29
1
|
export declare const supabaseStorageBaseUrl: string;
|
|
30
|
-
/**
|
|
31
|
-
* Private storage URL for authenticated users
|
|
32
|
-
* Format: {storageBaseUrl}/authenticated/{privateBucket}
|
|
33
|
-
*/
|
|
34
2
|
export declare const supabasePrivateStorageUrl: string;
|
|
35
|
-
/**
|
|
36
|
-
* Public storage URL for publicly accessible files
|
|
37
|
-
* Format: {storageBaseUrl}/public/{publicBucket}
|
|
38
|
-
*/
|
|
39
3
|
export declare const supabasePublicStorageUrl: string;
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
* Configured with authentication persistence and optimized settings
|
|
43
|
-
*/
|
|
44
|
-
export declare const supabaseClient: SupabaseClient;
|
|
45
|
-
/**
|
|
46
|
-
* Get storage URL for a specific bucket type
|
|
47
|
-
* @param bucketType - Type of storage bucket
|
|
48
|
-
* @returns Full storage URL for the bucket
|
|
49
|
-
*/
|
|
50
|
-
export declare const getStorageUrl: (bucketType: StorageBucketType) => string;
|
|
51
|
-
/**
|
|
52
|
-
* Get public file URL from Supabase storage
|
|
53
|
-
* @param bucket - Bucket name
|
|
54
|
-
* @param filePath - Path to the file within the bucket
|
|
55
|
-
* @returns Public URL for the file
|
|
56
|
-
*/
|
|
57
|
-
export declare const getPublicFileUrl: (bucket: string, filePath: string) => string;
|
|
58
|
-
/**
|
|
59
|
-
* Get authenticated file URL from Supabase storage
|
|
60
|
-
* @param bucket - Bucket name
|
|
61
|
-
* @param filePath - Path to the file within the bucket
|
|
62
|
-
* @returns Authenticated URL for the file
|
|
63
|
-
*/
|
|
64
|
-
export declare const getAuthenticatedFileUrl: (bucket: string, filePath: string) => string;
|
|
65
|
-
/**
|
|
66
|
-
* Check if Supabase client is properly initialized
|
|
67
|
-
* @returns True if client is initialized, false otherwise
|
|
68
|
-
*/
|
|
69
|
-
export declare const isSupabaseClientReady: () => boolean;
|
|
70
|
-
/**
|
|
71
|
-
* Get current session from Supabase auth
|
|
72
|
-
* @returns Current user session or null
|
|
73
|
-
*/
|
|
74
|
-
export declare const getCurrentSession: () => Promise<import("@supabase/supabase-js").AuthSession | null>;
|
|
75
|
-
/**
|
|
76
|
-
* Check if user is authenticated
|
|
77
|
-
* @returns True if user is authenticated, false otherwise
|
|
78
|
-
*/
|
|
79
|
-
export declare const isAuthenticated: () => Promise<boolean>;
|
|
80
|
-
/**
|
|
81
|
-
* Re-export Supabase types for convenience
|
|
82
|
-
*/
|
|
83
|
-
export type { SupabaseClient } from "@supabase/supabase-js";
|
|
4
|
+
export declare const supabaseUrl: string;
|
|
5
|
+
export declare const supabaseKey: string;
|
package/supabase/supabase.js
CHANGED
|
@@ -1,290 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Supabase Client Configuration
|
|
4
|
-
*
|
|
5
|
-
* This module provides centralized Supabase client configuration and utilities.
|
|
6
|
-
* Handles authentication, storage URLs, and client initialization with proper error handling.
|
|
7
|
-
*
|
|
8
|
-
* Features:
|
|
9
|
-
* - Centralized Supabase client configuration
|
|
10
|
-
* - Storage URL management for public and private buckets
|
|
11
|
-
* - Environment variable validation
|
|
12
|
-
* - Type-safe client creation
|
|
13
|
-
* - Authentication persistence configuration
|
|
14
|
-
*
|
|
15
|
-
* Environment Variables Required:
|
|
16
|
-
* - NEXT_PUBLIC_SUPABASE_URL: Supabase project URL
|
|
17
|
-
* - NEXT_PUBLIC_SUPABASE_ANON_KEY: Supabase anonymous key
|
|
18
|
-
* - NEXT_PUBLIC_SUPABASE_STORAGE_URL: Storage base URL
|
|
19
|
-
* - NEXT_PUBLIC_SUPABASE_PRIVATE_BUCKET: Private bucket name
|
|
20
|
-
* - NEXT_PUBLIC_SUPABASE_PUBLIC_BUCKET: Public bucket name
|
|
21
|
-
*/
|
|
22
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
23
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
24
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
25
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
26
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
27
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
28
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
29
|
-
});
|
|
30
|
-
};
|
|
31
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
32
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
33
|
-
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
34
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
35
|
-
function step(op) {
|
|
36
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
37
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
38
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
39
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
40
|
-
switch (op[0]) {
|
|
41
|
-
case 0: case 1: t = op; break;
|
|
42
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
43
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
44
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
45
|
-
default:
|
|
46
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
47
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
48
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
49
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
50
|
-
if (t[2]) _.ops.pop();
|
|
51
|
-
_.trys.pop(); continue;
|
|
52
|
-
}
|
|
53
|
-
op = body.call(thisArg, _);
|
|
54
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
55
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
59
|
-
exports.
|
|
60
|
-
var supabase_js_1 = require("@supabase/supabase-js");
|
|
61
|
-
// ============================================================================
|
|
62
|
-
// ENVIRONMENT VALIDATION
|
|
63
|
-
// ============================================================================
|
|
64
|
-
/**
|
|
65
|
-
* Validates required Supabase environment variables
|
|
66
|
-
* Throws an error if any required environment variable is missing
|
|
67
|
-
*/
|
|
68
|
-
var validateEnvironmentVariables = function () {
|
|
69
|
-
var requiredVars = [
|
|
70
|
-
"NEXT_PUBLIC_SUPABASE_URL",
|
|
71
|
-
"NEXT_PUBLIC_SUPABASE_ANON_KEY",
|
|
72
|
-
"NEXT_PUBLIC_SUPABASE_STORAGE_URL",
|
|
73
|
-
"NEXT_PUBLIC_SUPABASE_PRIVATE_BUCKET",
|
|
74
|
-
"NEXT_PUBLIC_SUPABASE_PUBLIC_BUCKET",
|
|
75
|
-
];
|
|
76
|
-
var missingVars = requiredVars.filter(function (varName) { return !process.env[varName]; });
|
|
77
|
-
if (missingVars.length > 0) {
|
|
78
|
-
throw new Error("Missing required Supabase environment variables: ".concat(missingVars.join(", ")));
|
|
79
|
-
}
|
|
80
|
-
};
|
|
81
|
-
// ============================================================================
|
|
82
|
-
// CONFIGURATION CONSTANTS
|
|
83
|
-
// ============================================================================
|
|
84
|
-
/**
|
|
85
|
-
* Supabase client configuration options
|
|
86
|
-
*/
|
|
87
|
-
var SUPABASE_CONFIG = {
|
|
88
|
-
auth: {
|
|
89
|
-
persistSession: true,
|
|
90
|
-
autoRefreshToken: true,
|
|
91
|
-
detectSessionInUrl: true,
|
|
92
|
-
},
|
|
93
|
-
realtime: {
|
|
94
|
-
params: {
|
|
95
|
-
eventsPerSecond: 10,
|
|
96
|
-
},
|
|
97
|
-
},
|
|
98
|
-
global: {
|
|
99
|
-
headers: {
|
|
100
|
-
"X-Client-Info": "stellar-solutions-modules",
|
|
101
|
-
},
|
|
102
|
-
},
|
|
103
|
-
};
|
|
104
|
-
// ============================================================================
|
|
105
|
-
// STORAGE URL CONFIGURATION
|
|
106
|
-
// ============================================================================
|
|
107
|
-
/**
|
|
108
|
-
* Base URL for Supabase storage
|
|
109
|
-
*/
|
|
3
|
+
exports.supabaseKey = exports.supabaseUrl = exports.supabasePublicStorageUrl = exports.supabasePrivateStorageUrl = exports.supabaseStorageBaseUrl = void 0;
|
|
110
4
|
exports.supabaseStorageBaseUrl = process.env
|
|
111
5
|
.NEXT_PUBLIC_SUPABASE_STORAGE_URL;
|
|
112
|
-
/**
|
|
113
|
-
* Private storage URL for authenticated users
|
|
114
|
-
* Format: {storageBaseUrl}/authenticated/{privateBucket}
|
|
115
|
-
*/
|
|
116
6
|
exports.supabasePrivateStorageUrl = "".concat(exports.supabaseStorageBaseUrl, "/authenticated/").concat(process.env.NEXT_PUBLIC_SUPABASE_PRIVATE_BUCKET);
|
|
117
|
-
/**
|
|
118
|
-
* Public storage URL for publicly accessible files
|
|
119
|
-
* Format: {storageBaseUrl}/public/{publicBucket}
|
|
120
|
-
*/
|
|
121
7
|
exports.supabasePublicStorageUrl = "".concat(exports.supabaseStorageBaseUrl, "/public/").concat(process.env.NEXT_PUBLIC_SUPABASE_PUBLIC_BUCKET);
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
// ============================================================================
|
|
125
|
-
/**
|
|
126
|
-
* Supabase project URL from environment variables
|
|
127
|
-
*/
|
|
128
|
-
var supabaseUrl = process.env.NEXT_PUBLIC_SUPABASE_URL;
|
|
129
|
-
/**
|
|
130
|
-
* Supabase anonymous key from environment variables
|
|
131
|
-
*/
|
|
132
|
-
var supabaseKey = process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY;
|
|
133
|
-
/**
|
|
134
|
-
* Main Supabase client instance
|
|
135
|
-
* Configured with authentication persistence and optimized settings
|
|
136
|
-
*/
|
|
137
|
-
exports.supabaseClient = (function () {
|
|
138
|
-
// Validate environment variables before creating client
|
|
139
|
-
validateEnvironmentVariables();
|
|
140
|
-
try {
|
|
141
|
-
return (0, supabase_js_1.createClient)(supabaseUrl, supabaseKey, SUPABASE_CONFIG);
|
|
142
|
-
}
|
|
143
|
-
catch (error) {
|
|
144
|
-
console.error("Failed to initialize Supabase client:", error);
|
|
145
|
-
throw new Error("Supabase client initialization failed. Check your environment variables.");
|
|
146
|
-
}
|
|
147
|
-
})();
|
|
148
|
-
// ============================================================================
|
|
149
|
-
// UTILITY FUNCTIONS
|
|
150
|
-
// ============================================================================
|
|
151
|
-
/**
|
|
152
|
-
* Get storage URL for a specific bucket type
|
|
153
|
-
* @param bucketType - Type of storage bucket
|
|
154
|
-
* @returns Full storage URL for the bucket
|
|
155
|
-
*/
|
|
156
|
-
var getStorageUrl = function (bucketType) {
|
|
157
|
-
switch (bucketType) {
|
|
158
|
-
case "public":
|
|
159
|
-
return exports.supabasePublicStorageUrl;
|
|
160
|
-
case "private":
|
|
161
|
-
case "authenticated":
|
|
162
|
-
return exports.supabasePrivateStorageUrl;
|
|
163
|
-
default:
|
|
164
|
-
throw new Error("Invalid bucket type: ".concat(bucketType));
|
|
165
|
-
}
|
|
166
|
-
};
|
|
167
|
-
exports.getStorageUrl = getStorageUrl;
|
|
168
|
-
/**
|
|
169
|
-
* Get public file URL from Supabase storage
|
|
170
|
-
* @param bucket - Bucket name
|
|
171
|
-
* @param filePath - Path to the file within the bucket
|
|
172
|
-
* @returns Public URL for the file
|
|
173
|
-
*/
|
|
174
|
-
var getPublicFileUrl = function (bucket, filePath) {
|
|
175
|
-
return "".concat(exports.supabaseStorageBaseUrl, "/public/").concat(bucket, "/").concat(filePath);
|
|
176
|
-
};
|
|
177
|
-
exports.getPublicFileUrl = getPublicFileUrl;
|
|
178
|
-
/**
|
|
179
|
-
* Get authenticated file URL from Supabase storage
|
|
180
|
-
* @param bucket - Bucket name
|
|
181
|
-
* @param filePath - Path to the file within the bucket
|
|
182
|
-
* @returns Authenticated URL for the file
|
|
183
|
-
*/
|
|
184
|
-
var getAuthenticatedFileUrl = function (bucket, filePath) {
|
|
185
|
-
return "".concat(exports.supabaseStorageBaseUrl, "/authenticated/").concat(bucket, "/").concat(filePath);
|
|
186
|
-
};
|
|
187
|
-
exports.getAuthenticatedFileUrl = getAuthenticatedFileUrl;
|
|
188
|
-
/**
|
|
189
|
-
* Check if Supabase client is properly initialized
|
|
190
|
-
* @returns True if client is initialized, false otherwise
|
|
191
|
-
*/
|
|
192
|
-
var isSupabaseClientReady = function () {
|
|
193
|
-
try {
|
|
194
|
-
return !!exports.supabaseClient && typeof exports.supabaseClient.from === "function";
|
|
195
|
-
}
|
|
196
|
-
catch (_a) {
|
|
197
|
-
return false;
|
|
198
|
-
}
|
|
199
|
-
};
|
|
200
|
-
exports.isSupabaseClientReady = isSupabaseClientReady;
|
|
201
|
-
/**
|
|
202
|
-
* Get current session from Supabase auth
|
|
203
|
-
* @returns Current user session or null
|
|
204
|
-
*/
|
|
205
|
-
var getCurrentSession = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
206
|
-
var _a, session, error, error_1;
|
|
207
|
-
return __generator(this, function (_b) {
|
|
208
|
-
switch (_b.label) {
|
|
209
|
-
case 0:
|
|
210
|
-
_b.trys.push([0, 2, , 3]);
|
|
211
|
-
return [4 /*yield*/, exports.supabaseClient.auth.getSession()];
|
|
212
|
-
case 1:
|
|
213
|
-
_a = _b.sent(), session = _a.data.session, error = _a.error;
|
|
214
|
-
if (error) {
|
|
215
|
-
console.warn("Failed to get current session:", error.message);
|
|
216
|
-
return [2 /*return*/, null];
|
|
217
|
-
}
|
|
218
|
-
return [2 /*return*/, session];
|
|
219
|
-
case 2:
|
|
220
|
-
error_1 = _b.sent();
|
|
221
|
-
console.error("Error getting current session:", error_1);
|
|
222
|
-
return [2 /*return*/, null];
|
|
223
|
-
case 3: return [2 /*return*/];
|
|
224
|
-
}
|
|
225
|
-
});
|
|
226
|
-
}); };
|
|
227
|
-
exports.getCurrentSession = getCurrentSession;
|
|
228
|
-
/**
|
|
229
|
-
* Check if user is authenticated
|
|
230
|
-
* @returns True if user is authenticated, false otherwise
|
|
231
|
-
*/
|
|
232
|
-
var isAuthenticated = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
233
|
-
var session;
|
|
234
|
-
return __generator(this, function (_a) {
|
|
235
|
-
switch (_a.label) {
|
|
236
|
-
case 0: return [4 /*yield*/, (0, exports.getCurrentSession)()];
|
|
237
|
-
case 1:
|
|
238
|
-
session = _a.sent();
|
|
239
|
-
return [2 /*return*/, !!(session === null || session === void 0 ? void 0 : session.user)];
|
|
240
|
-
}
|
|
241
|
-
});
|
|
242
|
-
}); };
|
|
243
|
-
exports.isAuthenticated = isAuthenticated;
|
|
244
|
-
// ============================================================================
|
|
245
|
-
// OPTIMIZATION SUMMARY
|
|
246
|
-
// ============================================================================
|
|
247
|
-
/*
|
|
248
|
-
* Supabase Configuration File Optimizations Applied:
|
|
249
|
-
*
|
|
250
|
-
* 1. **Comprehensive Documentation**
|
|
251
|
-
* - Added detailed JSDoc comments for all exports and functions
|
|
252
|
-
* - Explained environment variable requirements
|
|
253
|
-
* - Documented configuration options and their purposes
|
|
254
|
-
*
|
|
255
|
-
* 2. **Enhanced Error Handling**
|
|
256
|
-
* - Added environment variable validation with descriptive error messages
|
|
257
|
-
* - Wrapped client creation in try-catch with proper error handling
|
|
258
|
-
* - Added runtime checks for client initialization
|
|
259
|
-
*
|
|
260
|
-
* 3. **Improved Configuration**
|
|
261
|
-
* - Enhanced Supabase client configuration with additional options
|
|
262
|
-
* - Added proper TypeScript types for storage bucket types
|
|
263
|
-
* - Organized configuration into logical constants
|
|
264
|
-
*
|
|
265
|
-
* 4. **Utility Functions**
|
|
266
|
-
* - Added helper functions for common storage operations
|
|
267
|
-
* - Implemented authentication state checking utilities
|
|
268
|
-
* - Created type-safe URL generation functions
|
|
269
|
-
*
|
|
270
|
-
* 5. **Type Safety Improvements**
|
|
271
|
-
* - Added proper TypeScript types and interfaces
|
|
272
|
-
* - Exported Supabase types for external use
|
|
273
|
-
* - Used const assertions for configuration objects
|
|
274
|
-
*
|
|
275
|
-
* 6. **Developer Experience**
|
|
276
|
-
* - Clear separation of concerns with section headers
|
|
277
|
-
* - Self-documenting code with comprehensive comments
|
|
278
|
-
* - Easy to extend and maintain
|
|
279
|
-
* - Proper error messages for debugging
|
|
280
|
-
*
|
|
281
|
-
* 7. **Performance Optimizations**
|
|
282
|
-
* - Lazy initialization of Supabase client
|
|
283
|
-
* - Efficient environment variable validation
|
|
284
|
-
* - Optimized configuration for better performance
|
|
285
|
-
*
|
|
286
|
-
* 8. **Security Enhancements**
|
|
287
|
-
* - Proper validation of environment variables
|
|
288
|
-
* - Secure handling of authentication tokens
|
|
289
|
-
* - Type-safe operations to prevent runtime errors
|
|
290
|
-
*/
|
|
8
|
+
exports.supabaseUrl = process.env.NEXT_PUBLIC_SUPABASE_URL;
|
|
9
|
+
exports.supabaseKey = process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY;
|