Compare commits
7 Commits
@portaljs/
...
@portaljs/
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4a1ccd2f8d | ||
|
|
728d5b1465 | ||
|
|
a43d4a3b86 | ||
|
|
4bc7ce5ce7 | ||
|
|
8c5c6a2112 | ||
|
|
8e896138c6 | ||
|
|
88ccee6f0a |
@@ -1,5 +1,11 @@
|
||||
# @portaljs/ckan
|
||||
|
||||
## 0.0.5
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- [#1009](https://github.com/datopian/portaljs/pull/1009) [`88ccee6f`](https://github.com/datopian/portaljs/commit/88ccee6f0aa05decd3efbe7279925340ae817127) Thanks [@luccasmmg](https://github.com/luccasmmg)! - added package_count to organization type
|
||||
|
||||
## 0.0.4
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@portaljs/ckan",
|
||||
"version": "0.0.4",
|
||||
"version": "0.0.5",
|
||||
"type": "module",
|
||||
"description": "https://portaljs.org",
|
||||
"keywords": [
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
# @portaljs/components
|
||||
|
||||
## 0.3.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- [#1011](https://github.com/datopian/portaljs/pull/1011) [`8e896138`](https://github.com/datopian/portaljs/commit/8e896138c622615d9bd9bd1d4a18de0cf38d85ec) Thanks [@luccasmmg](https://github.com/luccasmmg)! - fix bug when there were multiple flatuitable components at the same time
|
||||
|
||||
## 0.3.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@portaljs/components",
|
||||
"version": "0.3.1",
|
||||
"version": "0.3.2",
|
||||
"type": "module",
|
||||
"description": "https://portaljs.org",
|
||||
"keywords": [
|
||||
|
||||
Binary file not shown.
@@ -42,6 +42,7 @@ export interface FlatUiTableProps {
|
||||
data?: { [key: string]: number | string }[];
|
||||
rawCsv?: string;
|
||||
corsProxy?: string;
|
||||
randomId?: number;
|
||||
}
|
||||
export const FlatUiTable: React.FC<FlatUiTableProps> = ({
|
||||
url,
|
||||
@@ -49,10 +50,17 @@ export const FlatUiTable: React.FC<FlatUiTableProps> = ({
|
||||
rawCsv,
|
||||
corsProxy,
|
||||
}) => {
|
||||
const randomId = Math.random();
|
||||
return (
|
||||
// Provide the client to your App
|
||||
<QueryClientProvider client={queryClient}>
|
||||
<TableInner corsProxy={corsProxy} url={url} data={data} rawCsv={rawCsv} />
|
||||
<TableInner
|
||||
corsProxy={corsProxy}
|
||||
url={url}
|
||||
data={data}
|
||||
rawCsv={rawCsv}
|
||||
randomId={randomId}
|
||||
/>
|
||||
</QueryClientProvider>
|
||||
);
|
||||
};
|
||||
@@ -62,6 +70,7 @@ const TableInner: React.FC<FlatUiTableProps> = ({
|
||||
data,
|
||||
rawCsv,
|
||||
corsProxy,
|
||||
randomId,
|
||||
}) => {
|
||||
if (data) {
|
||||
return (
|
||||
@@ -71,12 +80,12 @@ const TableInner: React.FC<FlatUiTableProps> = ({
|
||||
);
|
||||
}
|
||||
const { data: csvString, isLoading: isDownloadingCSV } = useQuery(
|
||||
['dataCsv', url],
|
||||
['dataCsv', url, randomId],
|
||||
() => getCsv(url as string, corsProxy),
|
||||
{ enabled: !!url }
|
||||
);
|
||||
const { data: parsedData, isLoading: isParsing } = useQuery(
|
||||
['dataPreview', csvString],
|
||||
['dataPreview', csvString, randomId],
|
||||
() => parseCsv(rawCsv ? (rawCsv as string) : (csvString as string)),
|
||||
{ enabled: rawCsv ? true : !!csvString }
|
||||
);
|
||||
|
||||
@@ -3,31 +3,6 @@ import ButtonLink from './ButtonLink';
|
||||
import NewsletterForm from './NewsletterForm';
|
||||
import Image from 'next/image';
|
||||
import DatahubExampleImg from '@/public/images/showcases/datahub.webp';
|
||||
|
||||
const codeLanguage = 'javascript';
|
||||
const code = `export default {
|
||||
strategy: 'predictive',
|
||||
engine: {
|
||||
cpus: 12,
|
||||
backups: ['./storage/cache.wtf'],
|
||||
},
|
||||
}`;
|
||||
|
||||
const tabs = [
|
||||
{ name: 'cache-advance.config.js', isActive: true },
|
||||
{ name: 'package.json', isActive: false },
|
||||
];
|
||||
|
||||
function TrafficLightsIcon(props) {
|
||||
return (
|
||||
<svg aria-hidden="true" viewBox="0 0 42 10" fill="none" {...props}>
|
||||
<circle cx="5" cy="5" r="4.5" />
|
||||
<circle cx="21" cy="5" r="4.5" />
|
||||
<circle cx="37" cy="5" r="4.5" />
|
||||
</svg>
|
||||
);
|
||||
}
|
||||
|
||||
/* eslint jsx-a11y/label-has-associated-control: off */
|
||||
export function Hero() {
|
||||
const el = useRef(null);
|
||||
@@ -50,7 +25,7 @@ export function Hero() {
|
||||
Rapidly build rich data portals using a modern frontend framework.
|
||||
</p>
|
||||
|
||||
<ButtonLink className="mt-8" href="/docs">
|
||||
<ButtonLink style="secondary" className="mt-8" href="/docs">
|
||||
Get started
|
||||
</ButtonLink>
|
||||
|
||||
|
||||
@@ -1,14 +1,37 @@
|
||||
import { loadScripts } from '@/lib/loadNewsletterScripts';
|
||||
import Script from 'next/script';
|
||||
import { useEffect } from 'react';
|
||||
import { CloudIcon } from '@heroicons/react/solid';
|
||||
|
||||
export default function NewsletterForm() {
|
||||
useEffect(() => {
|
||||
/*
|
||||
* The newsletter scripts MUST be loaded after
|
||||
* the document is loaded, as they depend on
|
||||
* the presence of some elements
|
||||
*
|
||||
*/
|
||||
if (document.readyState === 'complete') {
|
||||
const { resetElements } = loadScripts();
|
||||
|
||||
return () => {
|
||||
resetElements();
|
||||
};
|
||||
} else {
|
||||
window.addEventListener('load', loadScripts);
|
||||
return () => window.removeEventListener('load', loadScripts);
|
||||
}
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<div>
|
||||
<div
|
||||
id="sib-form-container"
|
||||
className="mt-8 sm:mx-auto sm:text-center lg:text-left lg:mx-0"
|
||||
>
|
||||
<p className="text-base font-medium text-slate-400 dark:text-slate-400">
|
||||
Sign up to get notified about updates
|
||||
<p className="text-base font-medium flex items-center">
|
||||
<CloudIcon className="w-6 h-6 mr-1" />
|
||||
Join the PortalJS Cloud waitlist and get early access!
|
||||
</p>
|
||||
<div id="sib-container" className="!bg-transparent !p-0 !pb-5">
|
||||
<form
|
||||
@@ -47,7 +70,7 @@ export default function NewsletterForm() {
|
||||
>
|
||||
<path d="M460.116 373.846l-20.823-12.022c-5.541-3.199-7.54-10.159-4.663-15.874 30.137-59.886 28.343-131.652-5.386-189.946-33.641-58.394-94.896-95.833-161.827-99.676C261.028 55.961 256 50.751 256 44.352V20.309c0-6.904 5.808-12.337 12.703-11.982 83.556 4.306 160.163 50.864 202.11 123.677 42.063 72.696 44.079 162.316 6.031 236.832-3.14 6.148-10.75 8.461-16.728 5.01z" />
|
||||
</svg>
|
||||
Notify Me
|
||||
Join now
|
||||
</button>
|
||||
<input
|
||||
type="text"
|
||||
@@ -88,37 +111,6 @@ export default function NewsletterForm() {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<Script
|
||||
id="newsletter-form-validation-message"
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: `
|
||||
window.REQUIRED_CODE_ERROR_MESSAGE = 'Please choose a country code';
|
||||
window.LOCALE = 'en';
|
||||
window.EMAIL_INVALID_MESSAGE = window.SMS_INVALID_MESSAGE = "The information provided is invalid. Please review the field format and try again.";
|
||||
|
||||
window.REQUIRED_ERROR_MESSAGE = "This field cannot be left blank. ";
|
||||
|
||||
window.GENERIC_INVALID_MESSAGE = "The information provided is invalid. Please review the field format and try again.";
|
||||
|
||||
|
||||
|
||||
|
||||
window.translation = {
|
||||
common: {
|
||||
selectedList: '{quantity} list selected',
|
||||
selectedLists: '{quantity} lists selected'
|
||||
}
|
||||
};
|
||||
|
||||
var AUTOHIDE = Boolean(0);
|
||||
`,
|
||||
}}
|
||||
/>
|
||||
<Script
|
||||
strategy="worker"
|
||||
id="newsletter-submit-form"
|
||||
src="https://sibforms.com/forms/end-form/build/main.js"
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
45
site/lib/loadNewsletterScripts.ts
Normal file
45
site/lib/loadNewsletterScripts.ts
Normal file
@@ -0,0 +1,45 @@
|
||||
|
||||
import { HTMLProps } from "react";
|
||||
|
||||
const loadScript = (
|
||||
props: HTMLProps<HTMLScriptElement> & { textContent?: string }
|
||||
): (() => void) => {
|
||||
const script = document.createElement("script");
|
||||
Object.assign(script, props);
|
||||
document.head.appendChild(script);
|
||||
return () => document.head.removeChild(script);
|
||||
};
|
||||
|
||||
export const loadScripts = () => {
|
||||
const formValidationScript = loadScript({
|
||||
id: "newsletter-form-validation-message",
|
||||
textContent: `
|
||||
window.LOCALE = 'en';
|
||||
window.EMAIL_INVALID_MESSAGE = "The information provided is invalid. Please review the field format and try again.";
|
||||
window.REQUIRED_ERROR_MESSAGE = "This field cannot be left blank. ";
|
||||
window.GENERIC_INVALID_MESSAGE = "The information provided is invalid. Please review the field format and try again.";
|
||||
window.translation = {
|
||||
common: {
|
||||
selectedList: '{quantity} list selected',
|
||||
selectedLists: '{quantity} lists selected'
|
||||
}
|
||||
};
|
||||
var AUTOHIDE = Boolean(0);
|
||||
`,
|
||||
});
|
||||
|
||||
const formSubmitScript = loadScript({
|
||||
id: "newsletter-submit-form",
|
||||
src: "https://sibforms.com/forms/end-form/build/main.js",
|
||||
async: true,
|
||||
defer: true,
|
||||
});
|
||||
|
||||
return {
|
||||
resetElements: () => {
|
||||
formSubmitScript();
|
||||
formValidationScript();
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
8
site/package-lock.json
generated
8
site/package-lock.json
generated
@@ -9,7 +9,7 @@
|
||||
"version": "0.1.0",
|
||||
"dependencies": {
|
||||
"@headlessui/react": "^1.3.0",
|
||||
"@heroicons/react": "^1.0.3",
|
||||
"@heroicons/react": "^1.0.6",
|
||||
"@mdx-js/loader": "^2.3.0",
|
||||
"@portaljs/core": "^1.0.6",
|
||||
"@portaljs/remark-callouts": "^1.0.5",
|
||||
@@ -367,9 +367,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@heroicons/react": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/@heroicons/react/-/react-1.0.3.tgz",
|
||||
"integrity": "sha512-wdzWbDiFKzeL6xFJsgY2PqvDkx4hFmQDpEFRVj872EA71XOjr8g0DQj5rHWm0y7LwfGOFL0eQmEiMbTyGNOnTQ==",
|
||||
"version": "1.0.6",
|
||||
"resolved": "https://registry.npmjs.org/@heroicons/react/-/react-1.0.6.tgz",
|
||||
"integrity": "sha512-JJCXydOFWMDpCP4q13iEplA503MQO3xLoZiKum+955ZCtHINWnx26CUxVxxFQu/uLb4LW3ge15ZpzIkXKkJ8oQ==",
|
||||
"peerDependencies": {
|
||||
"react": ">= 16"
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@headlessui/react": "^1.3.0",
|
||||
"@heroicons/react": "^1.0.3",
|
||||
"@heroicons/react": "^1.0.6",
|
||||
"@mdx-js/loader": "^2.3.0",
|
||||
"@portaljs/core": "^1.0.6",
|
||||
"@portaljs/remark-callouts": "^1.0.5",
|
||||
|
||||
Reference in New Issue
Block a user