@react-pakistan/util-functions 1.23.32 → 1.23.34
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/api/cors/index.js +6 -6
- package/api/stellar-solutions/app-user/index.js +97 -38
- package/api/stellar-solutions/banking-detail/index.js +107 -48
- package/api/stellar-solutions/branch/index.js +107 -48
- package/api/stellar-solutions/company/index.js +124 -57
- package/api/stellar-solutions/company-report/index.js +48 -13
- package/api/stellar-solutions/contact/index.js +132 -65
- package/api/stellar-solutions/currency/index.js +101 -42
- package/api/stellar-solutions/customer/index.js +149 -74
- package/api/stellar-solutions/expense/index.js +132 -65
- package/api/stellar-solutions/expense-category/index.js +133 -66
- package/api/stellar-solutions/lead/index.js +132 -65
- package/api/stellar-solutions/menu-order/index.js +97 -38
- package/api/stellar-solutions/payment/index.js +135 -77
- package/api/stellar-solutions/payment-mode/index.js +90 -31
- package/api/stellar-solutions/preference/index.js +71 -28
- package/api/stellar-solutions/product/index.js +144 -77
- package/api/stellar-solutions/product-category/index.js +130 -63
- package/api/stellar-solutions/profile/index.js +152 -77
- package/api/stellar-solutions/quote-invoice/index.js +280 -201
- package/api/stellar-solutions/quote-invoice-report/index.js +48 -13
- package/api/stellar-solutions/tax/index.js +103 -44
- package/constants/react-pakistan.js +11 -22
- package/constants/social-media-sizes.js +33 -32
- package/general/basic-get.js +68 -6
- package/general/basic-post.js +55 -6
- package/general/camel-to-sentence-case.js +3 -3
- package/general/check-even-odd-length.js +1 -1
- package/general/create-date.js +4 -4
- package/general/dynamic-page-limit.js +15 -4
- package/general/enum-to-text.js +2 -2
- package/general/fetch-supabase-image.js +53 -15
- package/general/format-date.js +13 -12
- package/general/generate-blog-schema.js +10 -9
- package/general/generate-breadcrumb-schema.js +5 -4
- package/general/generate-faq-schema.js +5 -3
- package/general/generate-grid.js +2 -2
- package/general/generate-organization-schema.js +14 -13
- package/general/get-day-name.js +1 -1
- package/general/get-full-name.js +4 -1
- package/general/get-href.js +1 -1
- package/general/get-month-name.js +1 -1
- package/general/get-pathname.js +1 -1
- package/general/index.d.ts +2 -2
- package/general/index.js +2 -2
- package/general/is-next-button-disabled.js +1 -1
- package/general/is-odd.js +1 -1
- package/general/is-previous-button-disabled.js +1 -1
- package/general/remove-data-image-prefix.js +2 -2
- package/general/repeat-times.js +3 -3
- package/general/resolve-anchor-link.js +4 -4
- package/general/resolve-current-date.js +2 -2
- package/general/resolve-grid.js +1 -1
- package/general/resolve-initials.js +2 -2
- package/general/set-timezone.js +6 -3
- package/general/slugify.js +2 -2
- package/general/text-to-enum.js +1 -1
- package/general/text-to-sentence-case.js +1 -1
- package/general/truncate-text.js +1 -1
- package/general/upload-blob-to-private-supabase.d.ts +11 -0
- package/general/upload-blob-to-private-supabase.js +62 -0
- package/general/upload-blob-to-public-supabase.d.ts +11 -0
- package/general/upload-blob-to-public-supabase.js +62 -0
- package/general/upload-image-to-private-supabase.js +51 -15
- package/general/upload-image-to-public-supabase.js +51 -15
- package/general/url-to-sentence-case.js +4 -4
- package/general/validate-comment.js +1 -1
- package/general/validate-email.js +2 -2
- package/general/validate-name.js +1 -1
- package/hooks/index.d.ts +0 -1
- package/hooks/index.js +0 -1
- package/hooks/use-change.js +14 -5
- package/hooks/use-debounce.js +7 -6
- package/hooks/use-fetch.js +82 -31
- package/hooks/use-force-render.js +3 -3
- package/hooks/use-ip-geo-location.js +57 -22
- package/hooks/use-is-mobile.js +6 -6
- package/hooks/use-position.js +16 -16
- package/hooks/use-sticky.js +9 -8
- package/hooks/use-toggle-state.js +6 -5
- package/hooks/use-window-event-listener.js +4 -4
- package/local-storage/get-storage-value.js +2 -2
- package/local-storage/remove-storage-value.js +1 -1
- package/local-storage/set-storage-value.js +1 -1
- package/package.json +1 -1
- package/storybook/generate-sitemap.js +6 -22
- package/storybook/preview.js +13 -2
- package/storybook/react-design-story-script.js +7 -11
- package/storybook/react-emoji-collection.js +23 -33
- package/storybook/react-emoji-story-script.js +9 -13
- package/storybook/react-emoji-story-template.js +1 -46
- package/storybook/react-icon-collection.js +17 -27
- package/storybook/react-icon-story-script.js +9 -13
- package/storybook/react-icon-story-template.js +1 -46
- package/storybook/react-logo-collection.js +17 -27
- package/storybook/react-logo-story-script.js +9 -13
- package/storybook/react-logo-story-template.js +1 -46
- package/storybook/responsive-component.js +11 -46
- package/storybook/theme.js +4 -4
- package/general/upload-image-blob-to-private-supabase.d.ts +0 -11
- package/general/upload-image-blob-to-private-supabase.js +0 -27
- package/general/upload-image-blob-to-public-supabase.d.ts +0 -11
- package/general/upload-image-blob-to-public-supabase.js +0 -27
- package/hooks/with-seo.d.ts +0 -9
- package/hooks/with-seo.js +0 -43
|
@@ -12,41 +12,31 @@
|
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
exports.generateReactLogos = void 0;
|
|
14
14
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
var react_logo_story_template_1 = require("./react-logo-story-template");
|
|
16
|
+
var generateReactLogos = function (fs) {
|
|
17
|
+
var logoDir = './assets/';
|
|
18
|
+
var saveDir = './src/__stories__/';
|
|
19
|
+
var logoListOutput = '';
|
|
20
|
+
var level1FileName = '';
|
|
21
21
|
// Read root Logo directory
|
|
22
|
-
fs.readdirSync(logoDir).forEach((fileName)
|
|
22
|
+
fs.readdirSync(logoDir).forEach(function (fileName) {
|
|
23
23
|
if (fileName === '.DS_Store')
|
|
24
24
|
return;
|
|
25
|
-
|
|
26
|
-
logoListOutput =
|
|
27
|
-
* Generated by scripts/generate-logos.js
|
|
28
|
-
* DO NOT EDIT!
|
|
29
|
-
*/
|
|
30
|
-
|
|
31
|
-
import * as Logos from '../${fileName}';
|
|
32
|
-
|
|
33
|
-
export const LOGO_LIST = [
|
|
34
|
-
`;
|
|
25
|
+
var level1Dir = "".concat(logoDir).concat(fileName);
|
|
26
|
+
logoListOutput = "/**\n * Generated by scripts/generate-logos.js\n * DO NOT EDIT!\n */\n\nimport * as Logos from '../".concat(fileName, "';\n\nexport const LOGO_LIST = [\n");
|
|
35
27
|
// Read level1-directory
|
|
36
|
-
fs.readdirSync(level1Dir).forEach((_level1FileName)
|
|
28
|
+
fs.readdirSync(level1Dir).forEach(function (_level1FileName) {
|
|
37
29
|
if (_level1FileName === '.DS_Store')
|
|
38
30
|
return;
|
|
39
31
|
level1FileName = _level1FileName;
|
|
40
|
-
logoListOutput +=
|
|
41
|
-
`;
|
|
32
|
+
logoListOutput += " { logo: Logos.".concat(level1FileName.split('.')[0], ", name: '").concat(level1FileName.split('.')[0], "' },\n");
|
|
42
33
|
});
|
|
43
|
-
logoListOutput +=
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
fs.writeFileSync(
|
|
49
|
-
fs.writeFileSync(`${saveDir}/${fileName}.story.tsx`, story);
|
|
34
|
+
logoListOutput += "];\n";
|
|
35
|
+
var categoryName = fileName.split('-')
|
|
36
|
+
.map(function (str) { return str[0].toUpperCase() + str.slice(1); }).join('');
|
|
37
|
+
var story = (0, react_logo_story_template_1.reactLogoStoryTemplate)(categoryName, fileName);
|
|
38
|
+
fs.writeFileSync("".concat(saveDir, "/").concat(fileName, ".ts"), logoListOutput);
|
|
39
|
+
fs.writeFileSync("".concat(saveDir, "/").concat(fileName, ".story.tsx"), story);
|
|
50
40
|
});
|
|
51
41
|
};
|
|
52
42
|
exports.generateReactLogos = generateReactLogos;
|
|
@@ -11,23 +11,19 @@
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.generateReactLogoScript = void 0;
|
|
13
13
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
# DO NO EDIT
|
|
19
|
-
|
|
20
|
-
`;
|
|
14
|
+
var generateReactLogoScript = function (fs) {
|
|
15
|
+
var svgDir = './assets/';
|
|
16
|
+
var saveDir = './scripts/';
|
|
17
|
+
var scriptOutput = "# Generated by scripts/generate-script.js\n# DO NO EDIT\n\n";
|
|
21
18
|
// Read root Svg logo directory
|
|
22
|
-
fs.readdirSync(svgDir).forEach((folderName)
|
|
19
|
+
fs.readdirSync(svgDir).forEach(function (folderName) {
|
|
23
20
|
if (folderName === '.DS_Store')
|
|
24
21
|
return;
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
var flowArray = folderName.split('-');
|
|
23
|
+
var flow = flowArray[flowArray.length - 1];
|
|
27
24
|
// eslint-disable-next-line max-len
|
|
28
|
-
scriptOutput +=
|
|
29
|
-
`;
|
|
25
|
+
scriptOutput += "svgr --template scripts/svgr-template.js --config-file scripts/.svgrrc-".concat(flow, ".js -d src/").concat(folderName, " --ext tsx assets/").concat(folderName, "\n");
|
|
30
26
|
});
|
|
31
|
-
fs.writeFileSync(
|
|
27
|
+
fs.writeFileSync("".concat(saveDir, "all-scripts.sh"), scriptOutput);
|
|
32
28
|
};
|
|
33
29
|
exports.generateReactLogoScript = generateReactLogoScript;
|
|
@@ -11,50 +11,5 @@
|
|
|
11
11
|
/** End file docs */
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
exports.reactLogoStoryTemplate = void 0;
|
|
14
|
-
|
|
15
|
-
* Generated by scripts/generate-logos.js
|
|
16
|
-
* DO NOT EDIT!
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
import React, { FC, ReactElement } from 'react';
|
|
20
|
-
import { LogoWrapper, LogoTextWrapper, LogoItem, ILogoProps } from '../styled';
|
|
21
|
-
import { StyledStory } from '../styled-app';
|
|
22
|
-
import { LOGO_LIST } from './${logoListDirName}';
|
|
23
|
-
|
|
24
|
-
const logoStyle = { width: '7rem', height: '7rem' };
|
|
25
|
-
|
|
26
|
-
const renderItem = (
|
|
27
|
-
item: { logo: FC<ILogoProps>, name: string }
|
|
28
|
-
): ReactElement => {
|
|
29
|
-
const Logo = item.logo;
|
|
30
|
-
return (
|
|
31
|
-
<LogoItem
|
|
32
|
-
key={item.name}
|
|
33
|
-
>
|
|
34
|
-
<Logo style={logoStyle} />
|
|
35
|
-
<LogoTextWrapper>
|
|
36
|
-
{item.name}
|
|
37
|
-
</LogoTextWrapper>
|
|
38
|
-
</LogoItem>
|
|
39
|
-
);
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
const logos = LOGO_LIST.map(renderItem);
|
|
43
|
-
|
|
44
|
-
export const ${category} = (): ReactElement => (
|
|
45
|
-
<StyledStory>
|
|
46
|
-
<LogoWrapper>
|
|
47
|
-
{logos}
|
|
48
|
-
</LogoWrapper>
|
|
49
|
-
</StyledStory>
|
|
50
|
-
);
|
|
51
|
-
|
|
52
|
-
export default {
|
|
53
|
-
title: 'Logo/${category}',
|
|
54
|
-
|
|
55
|
-
parameters: {
|
|
56
|
-
component: ${category},
|
|
57
|
-
},
|
|
58
|
-
};
|
|
59
|
-
`;
|
|
14
|
+
var reactLogoStoryTemplate = function (category, logoListDirName) { return "/*\n * Generated by scripts/generate-logos.js\n * DO NOT EDIT!\n */\n\nimport React, { FC, ReactElement } from 'react';\nimport { LogoWrapper, LogoTextWrapper, LogoItem, ILogoProps } from '../styled';\nimport { StyledStory } from '../styled-app';\nimport { LOGO_LIST } from './".concat(logoListDirName, "';\n\nconst logoStyle = { width: '7rem', height: '7rem' };\n\nconst renderItem = (\n item: { logo: FC<ILogoProps>, name: string }\n): ReactElement => {\n const Logo = item.logo;\n return (\n <LogoItem\n key={item.name}\n >\n <Logo style={logoStyle} />\n <LogoTextWrapper>\n {item.name}\n </LogoTextWrapper>\n </LogoItem>\n );\n};\n\nconst logos = LOGO_LIST.map(renderItem);\n\nexport const ").concat(category, " = (): ReactElement => (\n <StyledStory>\n <LogoWrapper>\n {logos}\n </LogoWrapper>\n </StyledStory>\n);\n\nexport default {\n title: 'Logo/").concat(category, "',\n\n parameters: {\n component: ").concat(category, ",\n },\n};\n"); };
|
|
60
15
|
exports.reactLogoStoryTemplate = reactLogoStoryTemplate;
|
|
@@ -1,51 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.responsiveComponent = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
@media
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
@media
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
`;
|
|
16
|
-
const mobileLToReturn = $mobileL && `
|
|
17
|
-
@media ${theme_1.theme.breakpoints.mobileL} {
|
|
18
|
-
${$mobileL}
|
|
19
|
-
}
|
|
20
|
-
`;
|
|
21
|
-
const tabletToReturn = $tablet && `
|
|
22
|
-
@media ${theme_1.theme.breakpoints.tablet} {
|
|
23
|
-
${$tablet}
|
|
24
|
-
}
|
|
25
|
-
`;
|
|
26
|
-
const laptopToReturn = $laptop && `
|
|
27
|
-
@media ${theme_1.theme.breakpoints.laptop} {
|
|
28
|
-
${$laptop}
|
|
29
|
-
}
|
|
30
|
-
`;
|
|
31
|
-
const laptopLToReturn = $laptopL && `
|
|
32
|
-
@media ${theme_1.theme.breakpoints.laptopL} {
|
|
33
|
-
${$laptopL}
|
|
34
|
-
}
|
|
35
|
-
`;
|
|
36
|
-
const desktopToReturn = $desktop && `
|
|
37
|
-
@media ${theme_1.theme.breakpoints.desktop} {
|
|
38
|
-
${$desktop}
|
|
39
|
-
}
|
|
40
|
-
`;
|
|
41
|
-
return `
|
|
42
|
-
${mobileSToReturn}
|
|
43
|
-
${mobileMToReturn}
|
|
44
|
-
${mobileLToReturn}
|
|
45
|
-
${tabletToReturn}
|
|
46
|
-
${laptopToReturn}
|
|
47
|
-
${laptopLToReturn}
|
|
48
|
-
${desktopToReturn}
|
|
49
|
-
`;
|
|
4
|
+
var theme_1 = require("./theme");
|
|
5
|
+
var responsiveComponent = function (_a) {
|
|
6
|
+
var $desktop = _a.$desktop, $laptop = _a.$laptop, $laptopL = _a.$laptopL, $mobileL = _a.$mobileL, $mobileM = _a.$mobileM, $mobileS = _a.$mobileS, $tablet = _a.$tablet;
|
|
7
|
+
var mobileSToReturn = $mobileS && "\n @media ".concat(theme_1.theme.breakpoints.mobileS, " {\n ").concat($mobileS, "\n }\n ");
|
|
8
|
+
var mobileMToReturn = $mobileM && "\n @media ".concat(theme_1.theme.breakpoints.mobileM, " {\n ").concat($mobileM, "\n }\n ");
|
|
9
|
+
var mobileLToReturn = $mobileL && "\n @media ".concat(theme_1.theme.breakpoints.mobileL, " {\n ").concat($mobileL, "\n }\n ");
|
|
10
|
+
var tabletToReturn = $tablet && "\n @media ".concat(theme_1.theme.breakpoints.tablet, " {\n ").concat($tablet, "\n }\n ");
|
|
11
|
+
var laptopToReturn = $laptop && "\n @media ".concat(theme_1.theme.breakpoints.laptop, " {\n ").concat($laptop, "\n }\n ");
|
|
12
|
+
var laptopLToReturn = $laptopL && "\n @media ".concat(theme_1.theme.breakpoints.laptopL, " {\n ").concat($laptopL, "\n }\n ");
|
|
13
|
+
var desktopToReturn = $desktop && "\n @media ".concat(theme_1.theme.breakpoints.desktop, " {\n ").concat($desktop, "\n }\n ");
|
|
14
|
+
return "\n ".concat(mobileSToReturn, "\n ").concat(mobileMToReturn, "\n ").concat(mobileLToReturn, "\n ").concat(tabletToReturn, "\n ").concat(laptopToReturn, "\n ").concat(laptopLToReturn, "\n ").concat(desktopToReturn, "\n ");
|
|
50
15
|
};
|
|
51
16
|
exports.responsiveComponent = responsiveComponent;
|
package/storybook/theme.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.theme = void 0;
|
|
4
|
-
|
|
4
|
+
var colors = {
|
|
5
5
|
absoluteWhite: '#FFFFFF',
|
|
6
6
|
absoluteBlack: '#000000',
|
|
7
7
|
ash50: '#FBFBFD',
|
|
@@ -427,7 +427,7 @@ const colors = {
|
|
|
427
427
|
skyBlue: '#1E90FF',
|
|
428
428
|
white: '#FFFFFF',
|
|
429
429
|
};
|
|
430
|
-
|
|
430
|
+
var typography = {
|
|
431
431
|
fontFamily: 'Montserrat',
|
|
432
432
|
h1: {
|
|
433
433
|
fontFamily: 'Playfair Display',
|
|
@@ -692,7 +692,7 @@ const typography = {
|
|
|
692
692
|
},
|
|
693
693
|
};
|
|
694
694
|
exports.theme = {
|
|
695
|
-
typography,
|
|
695
|
+
typography: typography,
|
|
696
696
|
avatarSizes: {
|
|
697
697
|
small: '16px',
|
|
698
698
|
medium: '24px',
|
|
@@ -708,7 +708,7 @@ exports.theme = {
|
|
|
708
708
|
laptopL: 'only screen and (min-width: 1440px) and (max-width: 2559px)',
|
|
709
709
|
desktop: 'only screen and (min-width: 2560px)',
|
|
710
710
|
},
|
|
711
|
-
colors,
|
|
711
|
+
colors: colors,
|
|
712
712
|
// light: {
|
|
713
713
|
// neutral0: '',
|
|
714
714
|
// get neutral0Val() { return this.colors.white; },
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export interface UploadImageBlobToPrivateSupabaseArgs {
|
|
2
|
-
blob: Blob;
|
|
3
|
-
contentType: string;
|
|
4
|
-
fileRef: string;
|
|
5
|
-
supabase: any;
|
|
6
|
-
upsert: boolean;
|
|
7
|
-
}
|
|
8
|
-
export declare const uploadImageBlobToPrivateSupabase: ({ blob, contentType, fileRef, supabase, upsert, }: UploadImageBlobToPrivateSupabaseArgs) => Promise<{
|
|
9
|
-
data: any;
|
|
10
|
-
error: any;
|
|
11
|
-
}>;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
3
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
4
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
5
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
6
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
7
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
8
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
9
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
10
|
-
});
|
|
11
|
-
};
|
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.uploadImageBlobToPrivateSupabase = void 0;
|
|
14
|
-
const uploadImageBlobToPrivateSupabase = (_a) => __awaiter(void 0, [_a], void 0, function* ({ blob, contentType, fileRef, supabase, upsert, }) {
|
|
15
|
-
const { data, error } = yield supabase.storage
|
|
16
|
-
.from(process.env.NEXT_PUBLIC_SUPABASE_PRIVATE_BUCKET)
|
|
17
|
-
.upload(fileRef, blob, {
|
|
18
|
-
cacheControl: process.env.NEXT_PUBLIC_SUPABASE_CACHE_CONTROL,
|
|
19
|
-
contentType,
|
|
20
|
-
upsert,
|
|
21
|
-
});
|
|
22
|
-
return {
|
|
23
|
-
data,
|
|
24
|
-
error,
|
|
25
|
-
};
|
|
26
|
-
});
|
|
27
|
-
exports.uploadImageBlobToPrivateSupabase = uploadImageBlobToPrivateSupabase;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export interface UploadImageBlobToPublicSupabaseArgs {
|
|
2
|
-
blob: Blob;
|
|
3
|
-
contentType: string;
|
|
4
|
-
fileRef: string;
|
|
5
|
-
supabase: any;
|
|
6
|
-
upsert: boolean;
|
|
7
|
-
}
|
|
8
|
-
export declare const uploadImageBlobToPublicSupabase: ({ blob, contentType, fileRef, supabase, upsert, }: UploadImageBlobToPublicSupabaseArgs) => Promise<{
|
|
9
|
-
data: any;
|
|
10
|
-
error: any;
|
|
11
|
-
}>;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
3
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
4
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
5
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
6
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
7
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
8
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
9
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
10
|
-
});
|
|
11
|
-
};
|
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.uploadImageBlobToPublicSupabase = void 0;
|
|
14
|
-
const uploadImageBlobToPublicSupabase = (_a) => __awaiter(void 0, [_a], void 0, function* ({ blob, contentType, fileRef, supabase, upsert, }) {
|
|
15
|
-
const { data, error } = yield supabase.storage
|
|
16
|
-
.from(process.env.NEXT_PUBLIC_SUPABASE_PUBLIC_BUCKET)
|
|
17
|
-
.upload(fileRef, blob, {
|
|
18
|
-
cacheControl: process.env.NEXT_PUBLIC_SUPABASE_CACHE_CONTROL,
|
|
19
|
-
contentType,
|
|
20
|
-
upsert,
|
|
21
|
-
});
|
|
22
|
-
return {
|
|
23
|
-
data,
|
|
24
|
-
error,
|
|
25
|
-
};
|
|
26
|
-
});
|
|
27
|
-
exports.uploadImageBlobToPublicSupabase = uploadImageBlobToPublicSupabase;
|
package/hooks/with-seo.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ComponentType } from 'react';
|
|
2
|
-
interface WrapperProps {
|
|
3
|
-
organizationJsonLd?: unknown;
|
|
4
|
-
breadcrumbJsonLd?: unknown;
|
|
5
|
-
faqJsonLd?: unknown;
|
|
6
|
-
[key: string]: unknown;
|
|
7
|
-
}
|
|
8
|
-
export declare const withSEO: (Component: ComponentType<WrapperProps>, rest: WrapperProps) => any;
|
|
9
|
-
export {};
|
package/hooks/with-seo.js
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.withSEO = void 0;
|
|
27
|
-
const react_1 = __importStar(require("react"));
|
|
28
|
-
const DynamicScript = (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('next/script'))));
|
|
29
|
-
const withSEO = (Component, rest) => {
|
|
30
|
-
const EnhancedComponent = () => (react_1.default.createElement(react_1.default.Fragment, null,
|
|
31
|
-
react_1.default.createElement(Component, Object.assign({}, rest)),
|
|
32
|
-
rest.organizationJsonLd && (react_1.default.createElement(DynamicScript, { id: 'organization-schema', type: 'application/ld+json', dangerouslySetInnerHTML: {
|
|
33
|
-
__html: JSON.stringify(rest.organizationJsonLd),
|
|
34
|
-
} })),
|
|
35
|
-
rest.breadcrumbJsonLd && (react_1.default.createElement(DynamicScript, { id: 'breadcrumb-schema', type: 'application/ld+json', dangerouslySetInnerHTML: {
|
|
36
|
-
__html: JSON.stringify(rest.breadcrumbJsonLd),
|
|
37
|
-
} })),
|
|
38
|
-
rest.faqJsonLd && (react_1.default.createElement(DynamicScript, { id: 'faq-schema', type: 'application/ld+json', dangerouslySetInnerHTML: {
|
|
39
|
-
__html: JSON.stringify(rest.faqJsonLd),
|
|
40
|
-
} }))));
|
|
41
|
-
return EnhancedComponent;
|
|
42
|
-
};
|
|
43
|
-
exports.withSEO = withSEO;
|