Skip to content

Commit

Permalink
Add GFM support, update markdown deps, prepare for markdown polls (Zc…
Browse files Browse the repository at this point in the history
  • Loading branch information
skyl authored Jun 10, 2024
1 parent 3a8c2ed commit f052f1c
Show file tree
Hide file tree
Showing 14 changed files with 15,365 additions and 8,703 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ def PROMPT(page): return f"""
```
by {page.creator.full_name or page.creator.username}
A complete description for this zPage in under 150 characters,
ending with a period, suitable for use as a meta description tag in HTML:
A complete description for this zPage in under 150 characters:
"""


Expand Down
7 changes: 3 additions & 4 deletions py/dj/free2z/prod_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,9 @@
}
}

# Allows localhost to be used for testing
# GPT doesn't really like it:
# https://chat.openai.com/share/5b2b1c2c-08f4-40f3-acd7-f0c16f3e1ce1
# CSRF_TRUSTED_ORIGINS = []
CSRF_TRUSTED_ORIGINS = [
'https://test.free2z.com',
]

USE_X_FORWARDED_HOST = True
SENDGRID_SANDBOX_MODE_IN_DEBUG = False
23,457 changes: 15,015 additions & 8,442 deletions ts/react/free2z/package-lock.json

Large diffs are not rendered by default.

48 changes: 26 additions & 22 deletions ts/react/free2z/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,36 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@dytesdk/react-ui-kit": "^1.66.3",
"@dytesdk/react-web-core": "^1.36.5",
"@dytesdk/react-ui-kit": "^1.68.3",
"@dytesdk/react-web-core": "^1.36.9",
"@emotion/react": "^11.11.4",
"@emotion/styled": "^11.11.5",
"@fontsource/roboto": "^5.0.13",
"@mui/base": "^5.0.0-beta.23",
"@mui/icons-material": "^5.15.16",
"@mui/material": "^5.15.16",
"@mui/x-date-pickers": "^6.19.9",
"@mui/icons-material": "^5.15.19",
"@mui/material": "^5.15.19",
"@mui/x-date-pickers": "^6.20.1",
"@react-three/cannon": "^6.6.0",
"@react-three/drei": "^9.105.6",
"@react-three/fiber": "^8.16.3",
"@react-three/drei": "^9.106.0",
"@react-three/fiber": "^8.16.8",
"@stripe/stripe-js": "^2.4.0",
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"@types/jest": "^27.5.2",
"@types/node": "^16.18.96",
"@types/react": "^18.3.1",
"@types/node": "^16.18.98",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@uiw/react-md-editor": "3.24.1",
"ajv": "^8.16.0",
"ajv-keywords": "^3.5.2",
"axios": "^0.26.1",
"buffer": "^6.0.3",
"clipboard-copy": "^4.0.1",
"formik": "^2.4.6",
"js-cookie": "^3.0.5",
"js-yaml": "^4.1.0",
"mdast-util-toc": "^7.0.1",
"mdast-util-toc": "^7.1.0",
"moment": "^2.30.1",
"mui-markdown": "^0.5.7",
"notistack": "^3.0.1",
Expand All @@ -44,41 +46,43 @@
"react-helmet": "^6.1.0",
"react-helmet-async": "^1.3.0",
"react-hooks-global-state": "^2.1.0",
"react-intersection-observer": "^9.10.2",
"react-markdown": "^8.0.7",
"react-intersection-observer": "^9.10.3",
"react-markdown": "^9.0.1",
"react-player": "^2.16.0",
"react-qr-code": "^2.0.12",
"react-qr-code": "^2.0.14",
"react-query": "^3.39.3",
"react-router-dom": "6.11.2",
"react-scripts": "5.0.0",
"react-swipeable-views": "npm:react-swipeable-views-react-18-fix@^0.14.1",
"react-tiny-oembed": "^1.1.0",
"react-transition-group": "^4.4.5",
"react-virtuoso": "^4.7.10",
"react-virtuoso": "^4.7.11",
"react-web-share": "^2.0.2",
"react-webcam": "^7.2.0",
"redux": "^4.2.1",
"rehype-mathjax": "^4.0.3",
"rehype-mathjax": "^6.0.0",
"rehype-prism-plus": "^1.6.3",
"rehype-raw": "^6.1.1",
"rehype-slug": "^6.0.0",
"remark-directive": "^2.0.1",
"remark-directive": "^3.0.0",
"remark-frontmatter": "^5.0.0",
"remark-gfm": "^3.0.1",
"remark-math": "^5.1.1",
"remark-mermaidjs": "^4.1.1",
"remark-gfm": "^4.0.0",
"remark-math": "^6.0.0",
"remark-mermaidjs": "^6.0.0",
"remark-oembed": "^1.2.2",
"slugify": "^1.6.6",
"swiper": "^9.4.1",
"three": "^0.147.0",
"typescript": "^4.9.5",
"unified": "^11.0.4",
"unist-util-visit": "^5.0.0",
"url": "^0.11.3",
"web-vitals": "^2.1.4",
"zod": "^3.23.6",
"zod": "^3.23.8",
"zod-formik-adapter": "^1.3.0"
},
"_proxy": "http://127.0.0.1:8000",
"proxy": "https://free2z.com",
"proxy": "https://test.free2z.com",
"scripts": {
"start": "react-app-rewired start --host 0.0.0.0",
"build": "react-app-rewired build",
Expand Down Expand Up @@ -119,4 +123,4 @@
"prettier": "2.6.2",
"react-app-rewired": "^2.2.1"
}
}
}
44 changes: 44 additions & 0 deletions ts/react/free2z/src/components/CustomTableComponents.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import React, { forwardRef } from 'react';
import { TableBody, TableBodyProps, TableCell, TableCellProps, TableRow, TableRowProps } from '@mui/material';
import { ReactNode } from 'react';

interface CustomTableRowProps extends TableRowProps {
children: ReactNode;
node: any; // Adjust the type based on your specific needs
darkMode: boolean;
}

export const CustomTableRow = forwardRef<HTMLTableRowElement, CustomTableRowProps>(({ children, node, darkMode, ...otherProps }, ref) => {
const isOdd = Number(node?.position?.start.line) % 2 === 0;

return (
<TableRow
component="tr"
sx={{
backgroundColor: (theme) => {
let gray = "#f5f5f5";
if (darkMode) {
gray = "#000000";
}
return isOdd ? "inherit" : gray;
},
}}
ref={ref}
{...otherProps}
>
{children}
</TableRow>
);
});

interface CustomTableBodyProps extends TableBodyProps {
children: ReactNode;
}

export const CustomTableBody = forwardRef<HTMLTableSectionElement, CustomTableBodyProps>((props, ref) => {
return (
<TableBody component="tbody" ref={ref} {...props}>
{props.children}
</TableBody>
);
});
19 changes: 19 additions & 0 deletions ts/react/free2z/src/components/MLink.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import React from 'react';
import { Link, LinkProps } from '@mui/material';

type MLinkProps = Omit<LinkProps, 'color'> & Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'color'>;

const MLink: React.FC<MLinkProps> = ({ href, ...props }) => {
const isInternalLink = href?.startsWith('#');

return (
<Link
href={href}
target={isInternalLink ? undefined : '_blank'}
rel={isInternalLink ? undefined : 'noopener noreferrer'}
{...props}
/>
);
};

export default MLink;
4 changes: 4 additions & 0 deletions ts/react/free2z/src/components/MathMarkdown.css
Original file line number Diff line number Diff line change
Expand Up @@ -358,4 +358,8 @@ pre {
display: block;
margin: auto;
padding: 0.5em;
}

mjx-container {
overflow: scroll;
}
Loading

0 comments on commit f052f1c

Please sign in to comment.