diff --git a/packages/design-system/package.json b/packages/design-system/package.json index 8c4259b01..a24fb3bdd 100644 --- a/packages/design-system/package.json +++ b/packages/design-system/package.json @@ -16,6 +16,7 @@ }, "dependencies": { "@heroicons/react": "2.0.17", + "@jeromefitz/shared": "workspace:*", "@radix-ui/primitive": "1.0.0", "@radix-ui/react-accessible-icon": "1.0.2", "@radix-ui/react-accordion": "1.1.1", @@ -80,7 +81,7 @@ "@jeromefitz/storybook-config": "workspace:*", "@jeromefitz/tailwind-config": "workspace:*", "@mantine/hooks": "6.0.10", - "next": "13.3.4", + "next": "13.4.1", "react": "18.2.0", "react-dom": "18.2.0" } diff --git a/packages/design-system/src/components/Button/Button.stories.tsx b/packages/design-system/src/components/Button/Button.stories.tsx index 99c07cae8..50f067b33 100644 --- a/packages/design-system/src/components/Button/Button.stories.tsx +++ b/packages/design-system/src/components/Button/Button.stories.tsx @@ -1,7 +1,6 @@ +import { cx } from '@jeromefitz/shared/src/utils' import type { Meta, StoryObj } from '@storybook/react' -import { cx } from '../../utils/cx' - import { Button } from './Button' import { VARIANTS } from './Button.vars' diff --git a/packages/design-system/src/components/Button/Button.styles.ts b/packages/design-system/src/components/Button/Button.styles.ts index 526406b2e..53d0ac4b7 100644 --- a/packages/design-system/src/components/Button/Button.styles.ts +++ b/packages/design-system/src/components/Button/Button.styles.ts @@ -1,4 +1,4 @@ -import { cx } from '../../utils/cx' +import { cx } from '@jeromefitz/shared/src/utils' import type { Variant } from './Button.types' @@ -13,8 +13,8 @@ export const commonStyles = cx( ) export const variantStyles = { - default: cx('tomato-button'), - empty: cx(), + default: cx(), + empty: cx(''), ghost: cx(), primary: cx('tomato-button-cta'), secondary: cx('tomato-button-outline'), diff --git a/packages/design-system/src/components/Button/Button.tsx b/packages/design-system/src/components/Button/Button.tsx index 45b43fdc6..6e216ce45 100644 --- a/packages/design-system/src/components/Button/Button.tsx +++ b/packages/design-system/src/components/Button/Button.tsx @@ -1,8 +1,7 @@ +import { cx } from '@jeromefitz/shared/src/utils' import { forwardRef } from 'react' import type { ButtonHTMLAttributes, ForwardRefRenderFunction } from 'react' -import { cx } from '../../utils/cx' - import { commonStyles, variantStyles } from './Button.styles' import type { Classname, Variant } from './Button.types' import { VARIANTS } from './Button.vars' diff --git a/packages/design-system/src/components/Button/ButtonLink.stories.tsx b/packages/design-system/src/components/Button/ButtonLink.stories.tsx index b84eee296..cb4671d31 100644 --- a/packages/design-system/src/components/Button/ButtonLink.stories.tsx +++ b/packages/design-system/src/components/Button/ButtonLink.stories.tsx @@ -1,7 +1,6 @@ +import { cx } from '@jeromefitz/shared/src/utils' import type { Meta, StoryObj } from '@storybook/react' -import { cx } from '../../utils/cx' - import { ButtonLink } from './ButtonLink' const meta = { diff --git a/packages/design-system/src/components/Button/ButtonLink.tsx b/packages/design-system/src/components/Button/ButtonLink.tsx index f6b885a9d..78ab50095 100644 --- a/packages/design-system/src/components/Button/ButtonLink.tsx +++ b/packages/design-system/src/components/Button/ButtonLink.tsx @@ -1,10 +1,8 @@ -// eslint-disable-next-line no-restricted-imports +import { cx } from '@jeromefitz/shared/src/utils' import Link from 'next/link' import { forwardRef } from 'react' import type { ComponentProps, ForwardRefRenderFunction } from 'react' -import { cx } from '../../utils/cx' - import { commonStyles, variantStyles } from './Button.styles' import type { Variant } from './Button.types' import { VARIANTS } from './Button.vars' diff --git a/packages/design-system/src/components/Icon/Icon.stories.tsx b/packages/design-system/src/components/Icon/Icon.stories.tsx index ccd5f2a21..1144910fc 100644 --- a/packages/design-system/src/components/Icon/Icon.stories.tsx +++ b/packages/design-system/src/components/Icon/Icon.stories.tsx @@ -1,7 +1,6 @@ +import { cx } from '@jeromefitz/shared/src/utils' import type { Meta, StoryObj } from '@storybook/react' -import { cx } from '../../utils/cx' - import { MapIcon } from './Icon' const meta = { diff --git a/packages/design-system/src/components/Icon/Icon.tsx b/packages/design-system/src/components/Icon/Icon.tsx index ab2316be9..3bcdee1f0 100644 --- a/packages/design-system/src/components/Icon/Icon.tsx +++ b/packages/design-system/src/components/Icon/Icon.tsx @@ -72,7 +72,7 @@ import { } from '@radix-ui/react-icons' // import { Slot } from '@radix-ui/react-slot' -import { cx } from '../../utils/cx' +import { cx } from '@jeromefitz/shared/src/utils' import { IconProps } from './Icon.types' diff --git a/packages/design-system/src/ui/blocks/Callout.tsx b/packages/design-system/src/ui/blocks/Callout.tsx new file mode 100644 index 000000000..398e782e7 --- /dev/null +++ b/packages/design-system/src/ui/blocks/Callout.tsx @@ -0,0 +1,5 @@ +function Callout({ children }) { + return
{children}
+} + +export { Callout } diff --git a/packages/design-system/src/ui/blocks/Column.tsx b/packages/design-system/src/ui/blocks/Column.tsx new file mode 100644 index 000000000..3f305293c --- /dev/null +++ b/packages/design-system/src/ui/blocks/Column.tsx @@ -0,0 +1,7 @@ +function Column({ children }) { + return ( +
{children}
+ ) +} + +export { Column } diff --git a/packages/design-system/src/ui/blocks/ColumnList.tsx b/packages/design-system/src/ui/blocks/ColumnList.tsx new file mode 100644 index 000000000..5fc6c3c38 --- /dev/null +++ b/packages/design-system/src/ui/blocks/ColumnList.tsx @@ -0,0 +1,7 @@ +function ColumnList({ children }) { + return ( +
{children}
+ ) +} + +export { ColumnList } diff --git a/packages/design-system/src/ui/blocks/Divider.tsx b/packages/design-system/src/ui/blocks/Divider.tsx new file mode 100644 index 000000000..6e5153f63 --- /dev/null +++ b/packages/design-system/src/ui/blocks/Divider.tsx @@ -0,0 +1,9 @@ +function Divider() { + return ( +
+
+
+ ) +} + +export { Divider } diff --git a/packages/design-system/src/ui/blocks/Heading1.tsx b/packages/design-system/src/ui/blocks/Heading1.tsx new file mode 100644 index 000000000..1b8ccd1de --- /dev/null +++ b/packages/design-system/src/ui/blocks/Heading1.tsx @@ -0,0 +1,9 @@ +/** + * @note(notion) PageHeader, previous to Notion Content is H1 + * => All Headings from Notion are bumped up by 1 as a result. + */ +function Heading1({ children }) { + return

{children}

+} + +export { Heading1 } diff --git a/packages/design-system/src/ui/blocks/Heading2.tsx b/packages/design-system/src/ui/blocks/Heading2.tsx new file mode 100644 index 000000000..eece62913 --- /dev/null +++ b/packages/design-system/src/ui/blocks/Heading2.tsx @@ -0,0 +1,11 @@ +/** + * @note(notion) PageHeader, previous to Notion Content is H1 + * => All Headings from Notion are bumped up by 1 as a result. + */ +function Heading2({ children }) { + return ( +

{children}

+ ) +} + +export { Heading2 } diff --git a/packages/design-system/src/ui/blocks/Heading3.tsx b/packages/design-system/src/ui/blocks/Heading3.tsx new file mode 100644 index 000000000..53fe680b5 --- /dev/null +++ b/packages/design-system/src/ui/blocks/Heading3.tsx @@ -0,0 +1,9 @@ +/** + * @note(notion) PageHeader, previous to Notion Content is H1 + * => All Headings from Notion are bumped up by 1 as a result. + */ +function Heading3({ children }) { + return

{children}

+} + +export { Heading3 } diff --git a/packages/design-system/src/ui/blocks/ListBulleted.tsx b/packages/design-system/src/ui/blocks/ListBulleted.tsx new file mode 100644 index 000000000..ed9f01638 --- /dev/null +++ b/packages/design-system/src/ui/blocks/ListBulleted.tsx @@ -0,0 +1,5 @@ +function ListBulleted({ children }) { + return +} + +export { ListBulleted } diff --git a/packages/design-system/src/ui/blocks/ListItem.tsx b/packages/design-system/src/ui/blocks/ListItem.tsx new file mode 100644 index 000000000..3775ddf63 --- /dev/null +++ b/packages/design-system/src/ui/blocks/ListItem.tsx @@ -0,0 +1,9 @@ +function ListItem({ children }) { + return ( +
  • + {children} +
  • + ) +} + +export { ListItem } diff --git a/packages/design-system/src/ui/blocks/ListNumbered.tsx b/packages/design-system/src/ui/blocks/ListNumbered.tsx new file mode 100644 index 000000000..a9a491492 --- /dev/null +++ b/packages/design-system/src/ui/blocks/ListNumbered.tsx @@ -0,0 +1,5 @@ +function ListNumbered({ children }) { + return
      {children}
    +} + +export { ListNumbered } diff --git a/packages/design-system/src/ui/blocks/Paragraph.tsx b/packages/design-system/src/ui/blocks/Paragraph.tsx new file mode 100644 index 000000000..9021a98a1 --- /dev/null +++ b/packages/design-system/src/ui/blocks/Paragraph.tsx @@ -0,0 +1,5 @@ +function Paragraph({ children }) { + return

    {children}

    +} + +export { Paragraph } diff --git a/packages/design-system/src/ui/blocks/Quote.tsx b/packages/design-system/src/ui/blocks/Quote.tsx new file mode 100644 index 000000000..8eb3b8141 --- /dev/null +++ b/packages/design-system/src/ui/blocks/Quote.tsx @@ -0,0 +1,5 @@ +function Quote({ children }) { + return
    {children}
    +} + +export { Quote } diff --git a/packages/design-system/src/ui/blocks/index.ts b/packages/design-system/src/ui/blocks/index.ts new file mode 100644 index 000000000..582a81bbb --- /dev/null +++ b/packages/design-system/src/ui/blocks/index.ts @@ -0,0 +1,12 @@ +export { Callout } from './Callout' +export { Column } from './Column' +export { ColumnList } from './ColumnList' +export { Divider } from './Divider' +export { Heading1 } from './Heading1' +export { Heading2 } from './Heading2' +export { Heading3 } from './Heading3' +export { ListBulleted } from './ListBulleted' +export { ListItem } from './ListItem' +export { ListNumbered } from './ListNumbered' +export { Paragraph } from './Paragraph' +export { Quote } from './Quote' diff --git a/packages/design-system/src/utils/.gitkeep b/packages/design-system/src/utils/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/packages/next-notion/package.json b/packages/next-notion/package.json index 3f50d8267..f08f051e6 100644 --- a/packages/next-notion/package.json +++ b/packages/next-notion/package.json @@ -41,6 +41,7 @@ "react-dom": "^18.2.0" }, "dependencies": { + "@jeromefitz/shared": "workspace:*", "@jeromefitz/utils": "2.2.2", "clsx": "1.2.1", "fast-json-stable-stringify": "2.1.0", diff --git a/packages/next-notion/src/app/components/code.tsx b/packages/next-notion/src/app/components/code.tsx index 003806447..4348c3433 100644 --- a/packages/next-notion/src/app/components/code.tsx +++ b/packages/next-notion/src/app/components/code.tsx @@ -1,4 +1,5 @@ -import { cx } from '../../utils' +import { cx } from '@jeromefitz/shared/src/utils' + import getContentTypeDetail from '../utils/getContentTypeDetail' const code = ({ content, id }) => { diff --git a/packages/next-notion/src/app/components/link.tsx b/packages/next-notion/src/app/components/link.tsx index 8b5b0f381..95392fae3 100644 --- a/packages/next-notion/src/app/components/link.tsx +++ b/packages/next-notion/src/app/components/link.tsx @@ -1,6 +1,7 @@ +import { cx } from '@jeromefitz/shared/src/utils' import NextLink from 'next/link' -import { cx, getNextLink } from '../../utils' +import { getNextLink } from '../../utils' const nextSeo = { url: `https://${process.env.NEXT_PUBLIC__SITE}` } const domain = new URL(nextSeo.url) diff --git a/packages/next-notion/src/app/utils/TextAnnotations.tsx b/packages/next-notion/src/app/utils/TextAnnotations.tsx index 93ccbd0c3..7528c2dc0 100644 --- a/packages/next-notion/src/app/utils/TextAnnotations.tsx +++ b/packages/next-notion/src/app/utils/TextAnnotations.tsx @@ -1,6 +1,5 @@ -// eslint-disable-next-line @typescript-eslint/ban-ts-comment -// @ts-ignore -import { cx } from '../../../../../sites/jeromefitzgerald.com/src/utils/cx' +import { cx } from '@jeromefitz/shared/src/utils' + import { CONTENT_NODE_TYPES, getContentNode } from '../index' // const EmojiParser = dynamic( diff --git a/packages/next-notion/src/utils/cx.ts b/packages/next-notion/src/utils/cx.ts deleted file mode 100644 index a503eae8c..000000000 --- a/packages/next-notion/src/utils/cx.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { ClassValue, clsx } from 'clsx' -import { twMerge } from 'tailwind-merge' - -function cx(...inputs: ClassValue[]) { - return twMerge(clsx(inputs)) -} - -export { cx } diff --git a/packages/next-notion/src/utils/index.ts b/packages/next-notion/src/utils/index.ts index 77ce2fa90..487ac8973 100644 --- a/packages/next-notion/src/utils/index.ts +++ b/packages/next-notion/src/utils/index.ts @@ -1,4 +1,3 @@ -import { cx } from './cx' import { getKeysByJoin, getKeysBySlugger } from './getKey' import getNextLink from './getNextLink' import getNextPageStatus from './getNextPageStatus' @@ -7,7 +6,6 @@ import isActiveLink from './isActiveLink' import { isElementOfType } from './isElementOfType' export { - cx, getKeysByJoin, getKeysBySlugger, getNextLink, diff --git a/packages/shared/package.json b/packages/shared/package.json index d5dba3d21..3f320731e 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -30,6 +30,7 @@ "dependencies": { "@jeromefitz/design-system": "4.2.1", "@tanem/react-nprogress": "5.0.37", + "clsx": "1.2.1", "fathom-client": "3.5.0", "lodash": "4.17.21", "next": "13.4.1", @@ -37,13 +38,13 @@ "plaiceholder": "2.5.0", "react": "18.2.0", "react-dom": "18.2.0", - "swr": "2.1.5" + "swr": "2.1.5", + "tailwind-merge": "1.12.0" }, "devDependencies": { "@types/lodash": "4.14.194", "@types/react": "18.2.6", - "@types/react-dom": "18.2.4", - "next-notion": "workspace:*" + "@types/react-dom": "18.2.4" }, "publishConfig": { "access": "public" diff --git a/packages/design-system/src/utils/cx.ts b/packages/shared/src/utils/cx.ts similarity index 100% rename from packages/design-system/src/utils/cx.ts rename to packages/shared/src/utils/cx.ts diff --git a/packages/shared/src/utils/index.ts b/packages/shared/src/utils/index.ts new file mode 100644 index 000000000..664d9fd83 --- /dev/null +++ b/packages/shared/src/utils/index.ts @@ -0,0 +1 @@ +export { cx } from './cx' diff --git a/packages/tailwind-config/radix.plugin.js b/packages/tailwind-config/radix.plugin.js index 9dea20139..0286318b4 100644 --- a/packages/tailwind-config/radix.plugin.js +++ b/packages/tailwind-config/radix.plugin.js @@ -1,8 +1,17 @@ const radixColors = require('@radix-ui/colors') const plugin = require('tailwindcss/plugin') -const { backgrounds, buttons } = require('./src/index') +const { backgrounds, buttons, notion, notionColors } = require('./src/index') +/** + * @debug + */ +// console.dir(`> backgrounds`) +// console.dir(backgrounds) +// console.dir(`> buttons`) +// console.dir(buttons) +// console.dir(`> notion`) +// console.dir(notion) /** * @note(tailwind) radix-colors-for-tailwind * @@ -53,7 +62,7 @@ const radixPlugin = plugin.withOptions( ) darkColors = { ...darkColors, ...dark, ...darkA } lightColors = { ...lightColors, ...light, ...lightA } - radixStyles = { ...radixStyles, ...backgrounds, ...buttons } + radixStyles = { ...radixStyles, ...backgrounds, ...buttons, ...notion } }) addBase({ ':root': { @@ -63,6 +72,8 @@ const radixPlugin = plugin.withOptions( ...darkColors, }, }) + // console.dir(`>> radixStyles > notions`) + // console.dir(notion) addComponents(radixStyles) } }, @@ -90,14 +101,25 @@ const radixPlugin = plugin.withOptions( ) return obj }, {}) + // const filteredNotion = {} + // notionColors.map((n) => { + // filteredNotion[n] = n.includes('_background') + // ? `var(--${n.split('_')[0]}6)` + // : `var(--${n}11)` + // }) + + const radix = { + ...filtered, + ...filteredA, + // ...filteredNotion, + } + // console.dir(`>> radix > filteredNotion`) + // console.dir(filteredNotion) return { theme: { extend: { colors: { - radix: { - ...filtered, - ...filteredA, - }, + radix, }, }, }, diff --git a/packages/tailwind-config/src/backgrounds.js b/packages/tailwind-config/src/backgrounds.js index e66e3a70e..2f609f241 100644 --- a/packages/tailwind-config/src/backgrounds.js +++ b/packages/tailwind-config/src/backgrounds.js @@ -3,11 +3,11 @@ * https://www.radix-ui.com/docs/colors/palette-composition/understanding-the-scale * */ -const { colors, excludes } = require('./lib/const') +const { excludes, radixColors } = require('./lib/const') const backgrounds = {} -colors.map((_color) => { +radixColors.map((_color) => { let color = _color if (excludes.includes(color)) { color = `${color}A` diff --git a/packages/tailwind-config/src/buttons.js b/packages/tailwind-config/src/buttons.js index fda8b555f..700fc00f0 100644 --- a/packages/tailwind-config/src/buttons.js +++ b/packages/tailwind-config/src/buttons.js @@ -3,13 +3,13 @@ * https://www.radix-ui.com/docs/colors/palette-composition/understanding-the-scale * */ -const { colors, excludes, foregroundTextBlack } = require('./lib/const') +const { excludes, foregroundTextBlack, radixColors } = require('./lib/const') const buttons = {} const types = ['', '-cta', '-outline', '-solid', '-transparent'] const buttonTypes = [] -colors.map((color) => { +radixColors.map((color) => { if (excludes.includes(color)) { return } diff --git a/packages/tailwind-config/src/index.js b/packages/tailwind-config/src/index.js index 1cbab44f0..0b2b78e1d 100644 --- a/packages/tailwind-config/src/index.js +++ b/packages/tailwind-config/src/index.js @@ -1,5 +1,13 @@ const { backgrounds } = require('./backgrounds') const { buttons, buttonTypes } = require('./buttons') -const { colors } = require('./lib/const') +const { radixColors } = require('./lib/const') +const { notion, notionColors } = require('./notion') -module.exports = { backgrounds, buttons, buttonTypes, colors } +module.exports = { + backgrounds, + buttons, + buttonTypes, + notion, + notionColors, + radixColors, +} diff --git a/packages/tailwind-config/src/lib/const.js b/packages/tailwind-config/src/lib/const.js index 01cf01278..259400764 100644 --- a/packages/tailwind-config/src/lib/const.js +++ b/packages/tailwind-config/src/lib/const.js @@ -1,4 +1,4 @@ -const colors = [ +const radixColors = [ 'tomato', 'red', 'crimson', @@ -42,4 +42,4 @@ const colors = [ const foregroundTextBlack = ['sky', 'mint', 'lime', 'yellow', 'amber'] const excludes = ['white', 'black'] -module.exports = { colors, excludes, foregroundTextBlack } +module.exports = { excludes, foregroundTextBlack, radixColors } diff --git a/packages/tailwind-config/src/notion.js b/packages/tailwind-config/src/notion.js new file mode 100644 index 000000000..72ce0c1d9 --- /dev/null +++ b/packages/tailwind-config/src/notion.js @@ -0,0 +1,36 @@ +const notionColors = [ + // 'default', + 'gray', + 'brown', + 'orange', + 'yellow', + 'green', + 'blue', + 'purple', + 'pink', + 'red', + 'gray_background', + 'brown_background', + 'orange_background', + 'yellow_background', + 'green_background', + 'blue_background', + 'purple_background', + 'pink_background', + 'red_background', +] + +const notion = {} +notionColors.map((color) => { + if (color.includes('_background')) { + notion['.notion-' + color] = { + backgroundColor: `var(--${color.split('_')[0]}5)`, + } + } else { + notion['.notion-' + color] = { + color: `var(--${color}11)`, + } + } +}) + +module.exports = { notion, notionColors } diff --git a/packages/tailwind-config/tailwind.config.js b/packages/tailwind-config/tailwind.config.js index 59751a0d6..f21c325c7 100644 --- a/packages/tailwind-config/tailwind.config.js +++ b/packages/tailwind-config/tailwind.config.js @@ -2,7 +2,18 @@ const theme = require('tailwindcss/defaultTheme') const hocusPlugin = require('./hocus.plugin') const radixPlugin = require('./radix.plugin') -const { colors } = require('./src/index') +const { notionColors, radixColors } = require('./src/index') + +const safelist = [] +notionColors.map((color) => { + safelist.push(`notion-${color}`) +}) +const buttonTypes = ['', '-cta', '-outline', '-solid', '-transparent'] +radixColors.map((color) => { + buttonTypes.map((type) => { + safelist.push(`${color}-button${type}`) + }) +}) /** @type {import('tailwindcss').Config} */ const config = ({}) => ({ @@ -20,6 +31,7 @@ const config = ({}) => ({ // purgeLayersByDefault: true, // }, // purge: ['./components/**/*.{js,ts,jsx,tsx}', './pages/**/*.{js,ts,jsx,tsx}'], + safelist, theme: { ...theme, colors: {}, @@ -57,6 +69,16 @@ const config = ({}) => ({ slideIn: 'slideIn 150ms cubic-bezier(0.16, 1, 0.3, 1)', swipeOut: 'swipeOut 100ms ease-out', }, + backgroundImage: { + breeze: 'linear-gradient(140deg, rgb(207, 47, 152), rgb(106, 61, 236))', + candy: 'linear-gradient(140deg, rgb(165, 142, 251), rgb(233, 191, 248))', + crimson: 'linear-gradient(140deg, rgb(255, 99, 99), rgb(115, 52, 52))', + falcon: 'linear-gradient(140deg, rgb(189, 227, 236), rgb(54, 54, 84))', + meadow: 'linear-gradient(140deg, rgb(89, 212, 153), rgb(160, 135, 45))', + midnight: 'linear-gradient(140deg, rgb(76, 200, 200), rgb(32, 32, 51))', + raindrop: 'linear-gradient(140deg, rgb(142, 199, 251), rgb(28, 85, 170))', + sunset: 'linear-gradient(140deg, rgb(255, 207, 115), rgb(255, 122, 47))', + }, boxShadow: { slider: '0 0 0 5px rgba(0, 0, 0, 0.3)', }, @@ -192,7 +214,7 @@ const config = ({}) => ({ require('@tailwindcss/typography'), // require('@plaiceholder/tailwindcss'), require('@tailwindcss/forms'), - radixPlugin({ colors }), + radixPlugin({ colors: radixColors }), require('tailwindcss-radix')({ variantPrefix: 'radix' }), ], variants: { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8e0d17ff4..3cd306bdc 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -82,6 +82,9 @@ importers: '@heroicons/react': specifier: 2.0.17 version: 2.0.17(react@18.2.0) + '@jeromefitz/shared': + specifier: workspace:* + version: link:../shared '@radix-ui/primitive': specifier: 1.0.0 version: 1.0.0 @@ -270,8 +273,8 @@ importers: specifier: 6.0.10 version: 6.0.10(react@18.2.0) next: - specifier: 13.3.4 - version: 13.3.4(react-dom@18.2.0)(react@18.2.0) + specifier: 13.4.1 + version: 13.4.1(react-dom@18.2.0)(react@18.2.0) react: specifier: 18.2.0 version: 18.2.0 @@ -361,6 +364,9 @@ importers: packages/next-notion: dependencies: + '@jeromefitz/shared': + specifier: workspace:* + version: link:../shared '@jeromefitz/utils': specifier: 2.2.2 version: 2.2.2(lodash@4.17.21) @@ -476,6 +482,9 @@ importers: '@tanem/react-nprogress': specifier: 5.0.37 version: 5.0.37(react-dom@18.2.0)(react@18.2.0) + clsx: + specifier: 1.2.1 + version: 1.2.1 fathom-client: specifier: 3.5.0 version: 3.5.0 @@ -500,6 +509,9 @@ importers: swr: specifier: 2.1.5 version: 2.1.5(react@18.2.0) + tailwind-merge: + specifier: 1.12.0 + version: 1.12.0 devDependencies: '@types/lodash': specifier: 4.14.194 @@ -510,9 +522,6 @@ importers: '@types/react-dom': specifier: 18.2.4 version: 18.2.4 - next-notion: - specifier: workspace:* - version: link:../next-notion packages/storybook-config: devDependencies: @@ -604,7 +613,365 @@ importers: specifier: 2.8.0 version: 2.8.0 - sites/jeromefitzgerald.com: + sites/jeromefitzgerald.com: + dependencies: + '@heroicons/react': + specifier: 2.0.17 + version: 2.0.17(react@18.2.0) + '@jeromefitz/design-system': + specifier: 4.2.1 + version: 4.2.1(@heroicons/react@2.0.17)(@radix-ui/react-icons@1.3.0)(@types/react@18.2.6)(cmdk@0.2.0)(framer-motion@10.12.8)(lodash@4.17.21)(next@13.4.1)(react-dom@18.2.0)(react@18.2.0)(swr@2.1.5) + '@jeromefitz/notion': + specifier: 4.0.5 + version: 4.0.5(@jeromefitz/utils@2.2.2)(lodash@4.17.21) + '@jeromefitz/spotify': + specifier: 3.0.3 + version: 3.0.3(@jeromefitz/utils@2.2.2)(lodash@4.17.21)(sharp@0.32.1) + '@jeromefitz/utils': + specifier: 2.2.2 + version: 2.2.2(lodash@4.17.21) + '@mantine/hooks': + specifier: 6.0.10 + version: 6.0.10(react@18.2.0) + '@radix-ui/primitive': + specifier: 1.0.0 + version: 1.0.0 + '@radix-ui/react-accessible-icon': + specifier: 1.0.2 + version: 1.0.2(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-accordion': + specifier: 1.1.1 + version: 1.1.1(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-alert-dialog': + specifier: 1.0.3 + version: 1.0.3(@types/react@18.2.6)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-announce': + specifier: 0.1.7 + version: 0.1.7(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-arrow': + specifier: 1.0.2 + version: 1.0.2(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-aspect-ratio': + specifier: 1.0.2 + version: 1.0.2(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-avatar': + specifier: 1.0.2 + version: 1.0.2(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-checkbox': + specifier: 1.0.3 + version: 1.0.3(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-collapsible': + specifier: 1.0.2 + version: 1.0.2(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-collection': + specifier: 1.0.2 + version: 1.0.2(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-compose-refs': + specifier: 1.0.0 + version: 1.0.0(react@18.2.0) + '@radix-ui/react-context': + specifier: 1.0.0 + version: 1.0.0(react@18.2.0) + '@radix-ui/react-context-menu': + specifier: 2.1.3 + version: 2.1.3(@types/react@18.2.6)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-dialog': + specifier: 1.0.3 + version: 1.0.3(@types/react@18.2.6)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-direction': + specifier: 1.0.0 + version: 1.0.0(react@18.2.0) + '@radix-ui/react-dismissable-layer': + specifier: 1.0.3 + version: 1.0.3(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-dropdown-menu': + specifier: 2.0.4 + version: 2.0.4(@types/react@18.2.6)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-focus-guards': + specifier: 1.0.0 + version: 1.0.0(react@18.2.0) + '@radix-ui/react-focus-scope': + specifier: 1.0.2 + version: 1.0.2(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-hover-card': + specifier: 1.0.5 + version: 1.0.5(@types/react@18.2.6)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-icons': + specifier: 1.3.0 + version: 1.3.0(react@18.2.0) + '@radix-ui/react-id': + specifier: 1.0.0 + version: 1.0.0(react@18.2.0) + '@radix-ui/react-label': + specifier: 2.0.1 + version: 2.0.1(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-menu': + specifier: 2.0.4 + version: 2.0.4(@types/react@18.2.6)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-navigation-menu': + specifier: 1.1.2 + version: 1.1.2(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-popover': + specifier: 1.0.5 + version: 1.0.5(@types/react@18.2.6)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-popper': + specifier: 1.1.1 + version: 1.1.1(@types/react@18.2.6)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-portal': + specifier: 1.0.2 + version: 1.0.2(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-presence': + specifier: 1.0.0 + version: 1.0.0(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-primitive': + specifier: 1.0.2 + version: 1.0.2(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-progress': + specifier: 1.0.2 + version: 1.0.2(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-radio-group': + specifier: 1.1.2 + version: 1.1.2(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-roving-focus': + specifier: 1.0.3 + version: 1.0.3(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-scroll-area': + specifier: 1.0.3 + version: 1.0.3(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-select': + specifier: 1.2.1 + version: 1.2.1(@types/react@18.2.6)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-separator': + specifier: 1.0.2 + version: 1.0.2(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-slider': + specifier: 1.1.1 + version: 1.1.1(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-slot': + specifier: 1.0.1 + version: 1.0.1(react@18.2.0) + '@radix-ui/react-switch': + specifier: 1.0.2 + version: 1.0.2(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-tabs': + specifier: 1.0.3 + version: 1.0.3(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-toast': + specifier: 1.1.3 + version: 1.1.3(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-toggle': + specifier: 1.0.2 + version: 1.0.2(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-toggle-group': + specifier: 1.0.3 + version: 1.0.3(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-toolbar': + specifier: 1.0.3 + version: 1.0.3(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-tooltip': + specifier: 1.0.5 + version: 1.0.5(@types/react@18.2.6)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-use-callback-ref': + specifier: 1.0.0 + version: 1.0.0(react@18.2.0) + '@radix-ui/react-use-controllable-state': + specifier: 1.0.0 + version: 1.0.0(react@18.2.0) + '@radix-ui/react-use-escape-keydown': + specifier: 1.0.2 + version: 1.0.2(react@18.2.0) + '@radix-ui/react-use-layout-effect': + specifier: 1.0.0 + version: 1.0.0(react@18.2.0) + '@radix-ui/react-use-previous': + specifier: 1.0.0 + version: 1.0.0(react@18.2.0) + '@radix-ui/react-use-rect': + specifier: 1.0.0 + version: 1.0.0(react@18.2.0) + '@radix-ui/react-use-size': + specifier: 1.0.0 + version: 1.0.0(react@18.2.0) + '@radix-ui/react-visually-hidden': + specifier: 1.0.2 + version: 1.0.2(react-dom@18.2.0)(react@18.2.0) + '@tanem/react-nprogress': + specifier: 5.0.37 + version: 5.0.37(react-dom@18.2.0)(react@18.2.0) + '@upstash/ratelimit': + specifier: 0.4.2 + version: 0.4.2(@upstash/redis@1.20.6) + '@upstash/redis': + specifier: 1.20.6 + version: 1.20.6 + '@vercel/analytics': + specifier: 1.0.1 + version: 1.0.1 + '@vercel/og': + specifier: 0.5.4 + version: 0.5.4 + clsx: + specifier: 1.2.1 + version: 1.2.1 + cmdk: + specifier: 0.2.0 + version: 0.2.0(@types/react@18.2.6)(react-dom@18.2.0)(react@18.2.0) + date-fns: + specifier: 2.30.0 + version: 2.30.0 + date-fns-tz: + specifier: 2.0.0 + version: 2.0.0(date-fns@2.30.0) + fast-json-stable-stringify: + specifier: 2.1.0 + version: 2.1.0 + fathom-client: + specifier: 3.5.0 + version: 3.5.0 + focus-trap-react: + specifier: 10.1.1 + version: 10.1.1(react-dom@18.2.0)(react@18.2.0) + framer-motion: + specifier: 10.12.8 + version: 10.12.8(react-dom@18.2.0)(react@18.2.0) + github-slugger: + specifier: 2.0.0 + version: 2.0.0 + immer: + specifier: 10.0.1 + version: 10.0.1 + ioredis: + specifier: 5.3.2 + version: 5.3.2 + isomorphic-unfetch: + specifier: 4.0.2 + version: 4.0.2 + ms: + specifier: 3.0.0-canary.1 + version: 3.0.0-canary.1 + next: + specifier: 13.4.1 + version: 13.4.1(react-dom@18.2.0)(react@18.2.0) + next-sitemap: + specifier: 4.0.9 + version: 4.0.9(next@13.4.1) + next-themes: + specifier: 0.2.1 + version: 0.2.1(next@13.4.1)(react-dom@18.2.0)(react@18.2.0) + plaiceholder: + specifier: 2.5.0 + version: 2.5.0(sharp@0.32.1) + pluralize: + specifier: 8.0.0 + version: 8.0.0 + podcast: + specifier: 2.0.1 + version: 2.0.1 + ramda: + specifier: 0.29.0 + version: 0.29.0 + react: + specifier: 18.2.0 + version: 18.2.0 + react-dom: + specifier: 18.2.0 + version: 18.2.0(react@18.2.0) + react-swipeable: + specifier: 7.0.0 + version: 7.0.0(react@18.2.0) + react-use: + specifier: 17.4.0 + version: 17.4.0(react-dom@18.2.0)(react@18.2.0) + react-wrap-balancer: + specifier: 0.4.1 + version: 0.4.1(react@18.2.0) + server-only: + specifier: 0.0.1 + version: 0.0.1 + sharp: + specifier: 0.32.1 + version: 0.32.1 + smoothscroll-polyfill: + specifier: 0.4.4 + version: 0.4.4 + swr: + specifier: 2.1.5 + version: 2.1.5(react@18.2.0) + title: + specifier: 3.5.3 + version: 3.5.3 + ts-node: + specifier: 10.9.1 + version: 10.9.1(@types/node@18.16.5)(typescript@5.0.4) + use-sound: + specifier: 4.0.1 + version: 4.0.1(react@18.2.0) + uuid: + specifier: 9.0.0 + version: 9.0.0 + zod: + specifier: 3.21.4 + version: 3.21.4 + zustand: + specifier: 4.3.8 + version: 4.3.8(immer@10.0.1)(react@18.2.0) + devDependencies: + '@jeromefitz/jest-config': + specifier: workspace:* + version: link:../../packages/jest-config + '@jeromefitz/lighthouse-config': + specifier: workspace:* + version: link:../../packages/lighthouse-config + '@jeromefitz/next-config': + specifier: workspace:* + version: link:../../packages/next-config + '@jeromefitz/playwright-config': + specifier: workspace:* + version: link:../../packages/playwright-config + '@jeromefitz/shared': + specifier: workspace:* + version: link:../../packages/shared + '@jeromefitz/storybook-config': + specifier: workspace:* + version: link:../../packages/storybook-config + '@jeromefitz/tailwind-config': + specifier: workspace:* + version: link:../../packages/tailwind-config + '@jeromefitz/tsconfig': + specifier: 1.1.3 + version: 1.1.3 + '@types/ms': + specifier: 0.7.31 + version: 0.7.31 + '@types/pluralize': + specifier: 0.0.29 + version: 0.0.29 + '@types/ramda': + specifier: 0.29.1 + version: 0.29.1 + '@types/react': + specifier: 18.2.6 + version: 18.2.6 + '@types/react-dom': + specifier: 18.2.4 + version: 18.2.4 + '@types/title': + specifier: 3.4.1 + version: 3.4.1 + '@types/uuid': + specifier: 9.0.1 + version: 9.0.1 + next-notion: + specifier: workspace:* + version: link:../../packages/next-notion + next-unused: + specifier: 0.0.6 + version: 0.0.6 + tailwind-merge: + specifier: 1.12.0 + version: 1.12.0 + + sites/test.com: dependencies: '@heroicons/react': specifier: 2.0.17 @@ -624,6 +991,9 @@ importers: '@mantine/hooks': specifier: 6.0.10 version: 6.0.10(react@18.2.0) + '@notionhq/client': + specifier: 2.2.5 + version: 2.2.5 '@radix-ui/primitive': specifier: 1.0.0 version: 1.0.0 @@ -3213,6 +3583,7 @@ packages: engines: {node: '>=6.9.0'} dependencies: regenerator-runtime: 0.13.11 + dev: true /@babel/runtime@7.21.5: resolution: {integrity: sha512-8jI69toZqqcsnqGGqwGS4Qb1VwLOEp4hz+CXPywcvjs60u3B4Pom/U/7rm4W8tMOYEB+E9wgD0mW1l3r8qlI9Q==} @@ -4377,10 +4748,6 @@ packages: - utf-8-validate dev: true - /@next/env@13.3.4: - resolution: {integrity: sha512-oTK/wRV2qga86m/4VdrR1+/56UA6U1Qv3sIgowB+bZjahniZLEG5BmmQjfoGv7ZuLXBZ8Eec6hkL9BqJcrEL2g==} - dev: true - /@next/env@13.4.1: resolution: {integrity: sha512-eD6WCBMFjLFooLM19SIhSkWBHtaFrZFfg2Cxnyl3vS3DAdFRfnx5TY2RxlkuKXdIRCC0ySbtK9JXXt8qLCqzZg==} @@ -4390,15 +4757,6 @@ packages: glob: 7.1.7 dev: true - /@next/swc-darwin-arm64@13.3.4: - resolution: {integrity: sha512-vux7RWfzxy1lD21CMwZsy9Ej+0+LZdIIj1gEhVmzOQqQZ5N56h8JamrjIVCfDL+Lpj8KwOmFZbPHE8qaYnL2pg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - requiresBuild: true - dev: true - optional: true - /@next/swc-darwin-arm64@13.4.1: resolution: {integrity: sha512-eF8ARHtYfnoYtDa6xFHriUKA/Mfj/cCbmKb3NofeKhMccs65G6/loZ15a6wYCCx4rPAd6x4t1WmVYtri7EdeBg==} engines: {node: '>= 10'} @@ -4407,15 +4765,6 @@ packages: requiresBuild: true optional: true - /@next/swc-darwin-x64@13.3.4: - resolution: {integrity: sha512-1tb+6JT98+t7UIhVQpKL7zegKnCs9RKU6cKNyj+DYKuC/NVl49/JaIlmwCwK8Ibl+RXxJrK7uSXSIO71feXsgw==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - requiresBuild: true - dev: true - optional: true - /@next/swc-darwin-x64@13.4.1: resolution: {integrity: sha512-7cmDgF9tGWTgn5Gw+vP17miJbH4wcraMHDCOHTYWkO/VeKT73dUWG23TNRLfgtCNSPgH4V5B4uLHoZTanx9bAw==} engines: {node: '>= 10'} @@ -4424,15 +4773,6 @@ packages: requiresBuild: true optional: true - /@next/swc-linux-arm64-gnu@13.3.4: - resolution: {integrity: sha512-UqcKkYTKslf5YAJNtZ5XV1D5MQJIkVtDHL8OehDZERHzqOe7jvy41HFto33IDPPU8gJiP5eJb3V9U26uifqHjw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - requiresBuild: true - dev: true - optional: true - /@next/swc-linux-arm64-gnu@13.4.1: resolution: {integrity: sha512-qwJqmCri2ie8aTtE5gjTSr8S6O8B67KCYgVZhv9gKH44yvc/zXbAY8u23QGULsYOyh1islWE5sWfQNLOj9iryg==} engines: {node: '>= 10'} @@ -4441,15 +4781,6 @@ packages: requiresBuild: true optional: true - /@next/swc-linux-arm64-musl@13.3.4: - resolution: {integrity: sha512-HE/FmE8VvstAfehyo/XsrhGgz97cEr7uf9IfkgJ/unqSXE0CDshDn/4as6rRid74eDR8/exi7c2tdo49Tuqxrw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - requiresBuild: true - dev: true - optional: true - /@next/swc-linux-arm64-musl@13.4.1: resolution: {integrity: sha512-qcC54tWNGDv/VVIFkazxhqH1Bnagjfs4enzELVRlUOoJPD2BGJTPI7z08pQPbbgxLtRiu8gl2mXvpB8WlOkMeA==} engines: {node: '>= 10'} @@ -4458,15 +4789,6 @@ packages: requiresBuild: true optional: true - /@next/swc-linux-x64-gnu@13.3.4: - resolution: {integrity: sha512-xU+ugaupGA4SL5aK1ZYEqVHrW3TPOhxVcpaJLfpANm2443J4GfxCmOacu9XcSgy5c51Mq7C9uZ1LODKHfZosRQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - requiresBuild: true - dev: true - optional: true - /@next/swc-linux-x64-gnu@13.4.1: resolution: {integrity: sha512-9TeWFlpLsBosZ+tsm/rWBaMwt5It9tPH8m3nawZqFUUrZyGRfGcI67js774vtx0k3rL9qbyY6+3pw9BCVpaYUA==} engines: {node: '>= 10'} @@ -4475,15 +4797,6 @@ packages: requiresBuild: true optional: true - /@next/swc-linux-x64-musl@13.3.4: - resolution: {integrity: sha512-cZvmf5KcYeTfIK6bCypfmxGUjme53Ep7hx94JJtGrYgCA1VwEuYdh+KouubJaQCH3aqnNE7+zGnVEupEKfoaaA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - requiresBuild: true - dev: true - optional: true - /@next/swc-linux-x64-musl@13.4.1: resolution: {integrity: sha512-sNDGaWmSqTS4QRUzw61wl4mVPeSqNIr1OOjLlQTRuyInxMxtqImRqdvzDvFTlDfdeUMU/DZhWGYoHrXLlZXe6A==} engines: {node: '>= 10'} @@ -4492,15 +4805,6 @@ packages: requiresBuild: true optional: true - /@next/swc-win32-arm64-msvc@13.3.4: - resolution: {integrity: sha512-7dL+CAUAjmgnVbjXPIpdj7/AQKFqEUL3bKtaOIE1JzJ5UMHHAXCPwzQtibrsvQpf9MwcAmiv8aburD3xH1xf8w==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - requiresBuild: true - dev: true - optional: true - /@next/swc-win32-arm64-msvc@13.4.1: resolution: {integrity: sha512-+CXZC7u1iXdLRudecoUYbhbsXpglYv8KFYsFxKBPn7kg+bk7eJo738wAA4jXIl8grTF2mPdmO93JOQym+BlYGA==} engines: {node: '>= 10'} @@ -4509,15 +4813,6 @@ packages: requiresBuild: true optional: true - /@next/swc-win32-ia32-msvc@13.3.4: - resolution: {integrity: sha512-qplTyzEl1vPkS+/DRK3pKSL0HeXrPHkYsV7U6gboHYpfqoHY+bcLUj3gwVUa9PEHRIoq4vXvPzx/WtzE6q52ng==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - requiresBuild: true - dev: true - optional: true - /@next/swc-win32-ia32-msvc@13.4.1: resolution: {integrity: sha512-vIoXVVc7UYO68VwVMDKwJC2+HqAZQtCYiVlApyKEeIPIQpz2gpufzGxk1z3/gwrJt/kJ5CDZjlhYDCzd3hdz+g==} engines: {node: '>= 10'} @@ -4526,15 +4821,6 @@ packages: requiresBuild: true optional: true - /@next/swc-win32-x64-msvc@13.3.4: - resolution: {integrity: sha512-usdvZT7JHrTuXC+4OKN5mCzUkviFkCyJJTkEz8jhBpucg+T7s83e7owm3oNFzmj5iKfvxU2St6VkcnSgpFvEYA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - requiresBuild: true - dev: true - optional: true - /@next/swc-win32-x64-msvc@13.4.1: resolution: {integrity: sha512-n8V5ImLQZibKTu10UUdI3nIeTLkliEXe628qxqW9v8My3BAH2a7H0SaCqkV2OgqFnn8sG1wxKYw9/SNJ632kSA==} engines: {node: '>= 10'} @@ -4576,6 +4862,16 @@ packages: transitivePeerDependencies: - encoding + /@notionhq/client@2.2.5: + resolution: {integrity: sha512-NobSaeSK0DMuxAIy2pg53Iv850tGFxXYEYacFBQgO634L1uwQv7WQCAdeFQpD3kJiEycQfSYv6RGC5VENEXjiQ==} + engines: {node: '>=12'} + dependencies: + '@types/node-fetch': 2.6.3 + node-fetch: 2.6.9 + transitivePeerDependencies: + - encoding + dev: false + /@octokit/auth-token@3.0.3: resolution: {integrity: sha512-/aFM2M4HVDBT/jjDBa84sJniv1t9Gm/rLkalaz9htOm+L+8JMj1k9w0CkUdcxNyNxZPlTxKPVko+m1VlM58ZVA==} engines: {node: '>= 14'} @@ -4780,7 +5076,7 @@ packages: /@radix-ui/primitive@1.0.0: resolution: {integrity: sha512-3e7rn8FDMin4CgeL7Z/49smCA3rFYY3Ha2rUQ7HRWFadS5iCRw08ZgVT1LaNTCNqgvrUiyczLflrVrF0SRQtNA==} dependencies: - '@babel/runtime': 7.21.0 + '@babel/runtime': 7.21.5 /@radix-ui/react-accessible-icon@1.0.2(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-YcZBOOB1xdbVVBK0sQzrpU4kABloQGfjKdp60mmFFq7oIKcWuH7d+auYS63vZMZH1rAijU6TFLawt2hLoPZWfA==} @@ -4788,7 +5084,7 @@ packages: react: ^16.8 || ^17.0 || ^18.0 react-dom: ^16.8 || ^17.0 || ^18.0 dependencies: - '@babel/runtime': 7.21.0 + '@babel/runtime': 7.21.5 '@radix-ui/react-visually-hidden': 1.0.2(react-dom@18.2.0)(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) @@ -4799,7 +5095,7 @@ packages: react: ^16.8 || ^17.0 || ^18.0 react-dom: ^16.8 || ^17.0 || ^18.0 dependencies: - '@babel/runtime': 7.21.0 + '@babel/runtime': 7.21.5 '@radix-ui/primitive': 1.0.0 '@radix-ui/react-collapsible': 1.0.2(react-dom@18.2.0)(react@18.2.0) '@radix-ui/react-collection': 1.0.2(react-dom@18.2.0)(react@18.2.0) @@ -4818,7 +5114,7 @@ packages: react: ^16.8 || ^17.0 || ^18.0 react-dom: ^16.8 || ^17.0 || ^18.0 dependencies: - '@babel/runtime': 7.21.0 + '@babel/runtime': 7.21.5 '@radix-ui/primitive': 1.0.0 '@radix-ui/react-compose-refs': 1.0.0(react@18.2.0) '@radix-ui/react-context': 1.0.0(react@18.2.0) @@ -4836,7 +5132,7 @@ packages: react: ^16.8 || ^17.0 || ^18.0 react-dom: ^16.8 || ^17.0 || ^18.0 dependencies: - '@babel/runtime': 7.21.0 + '@babel/runtime': 7.21.5 '@radix-ui/primitive': 1.0.0 '@radix-ui/react-compose-refs': 1.0.0(react@18.2.0) '@radix-ui/react-context': 1.0.0(react@18.2.0) @@ -4855,7 +5151,7 @@ packages: react: ^16.8 || ^17.0 || ^18.0 react-dom: ^16.8 || ^17.0 || ^18.0 dependencies: - '@babel/runtime': 7.21.0 + '@babel/runtime': 7.21.5 '@radix-ui/react-compose-refs': 1.0.0(react@18.2.0) '@radix-ui/react-primitive': 1.0.2(react-dom@18.2.0)(react@18.2.0) '@radix-ui/react-use-layout-effect': 1.0.0(react@18.2.0) @@ -4868,7 +5164,7 @@ packages: react: ^16.8 || ^17.0 || ^18.0 react-dom: ^16.8 || ^17.0 || ^18.0 dependencies: - '@babel/runtime': 7.21.0 + '@babel/runtime': 7.21.5 '@radix-ui/react-primitive': 1.0.2(react-dom@18.2.0)(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) @@ -4879,7 +5175,7 @@ packages: react: ^16.8 || ^17.0 || ^18.0 react-dom: ^16.8 || ^17.0 || ^18.0 dependencies: - '@babel/runtime': 7.21.0 + '@babel/runtime': 7.21.5 '@radix-ui/react-primitive': 1.0.2(react-dom@18.2.0)(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) @@ -4890,7 +5186,7 @@ packages: react: ^16.8 || ^17.0 || ^18.0 react-dom: ^16.8 || ^17.0 || ^18.0 dependencies: - '@babel/runtime': 7.21.0 + '@babel/runtime': 7.21.5 '@radix-ui/react-context': 1.0.0(react@18.2.0) '@radix-ui/react-primitive': 1.0.2(react-dom@18.2.0)(react@18.2.0) '@radix-ui/react-use-callback-ref': 1.0.0(react@18.2.0) @@ -4904,7 +5200,7 @@ packages: react: ^16.8 || ^17.0 || ^18.0 react-dom: ^16.8 || ^17.0 || ^18.0 dependencies: - '@babel/runtime': 7.21.0 + '@babel/runtime': 7.21.5 '@radix-ui/primitive': 1.0.0 '@radix-ui/react-compose-refs': 1.0.0(react@18.2.0) '@radix-ui/react-context': 1.0.0(react@18.2.0) @@ -4922,7 +5218,7 @@ packages: react: ^16.8 || ^17.0 || ^18.0 react-dom: ^16.8 || ^17.0 || ^18.0 dependencies: - '@babel/runtime': 7.21.0 + '@babel/runtime': 7.21.5 '@radix-ui/primitive': 1.0.0 '@radix-ui/react-compose-refs': 1.0.0(react@18.2.0) '@radix-ui/react-context': 1.0.0(react@18.2.0) @@ -4940,7 +5236,7 @@ packages: react: ^16.8 || ^17.0 || ^18.0 react-dom: ^16.8 || ^17.0 || ^18.0 dependencies: - '@babel/runtime': 7.21.0 + '@babel/runtime': 7.21.5 '@radix-ui/react-compose-refs': 1.0.0(react@18.2.0) '@radix-ui/react-context': 1.0.0(react@18.2.0) '@radix-ui/react-primitive': 1.0.2(react-dom@18.2.0)(react@18.2.0) @@ -4953,7 +5249,7 @@ packages: peerDependencies: react: ^16.8 || ^17.0 || ^18.0 dependencies: - '@babel/runtime': 7.21.0 + '@babel/runtime': 7.21.5 react: 18.2.0 /@radix-ui/react-context-menu@2.1.3(@types/react@18.2.6)(react-dom@18.2.0)(react@18.2.0): @@ -4962,7 +5258,7 @@ packages: react: ^16.8 || ^17.0 || ^18.0 react-dom: ^16.8 || ^17.0 || ^18.0 dependencies: - '@babel/runtime': 7.21.0 + '@babel/runtime': 7.21.5 '@radix-ui/primitive': 1.0.0 '@radix-ui/react-context': 1.0.0(react@18.2.0) '@radix-ui/react-menu': 2.0.4(@types/react@18.2.6)(react-dom@18.2.0)(react@18.2.0) @@ -4980,7 +5276,7 @@ packages: react: ^16.8 || ^17.0 || ^18.0 react-dom: ^16.8 || ^17.0 || ^18.0 dependencies: - '@babel/runtime': 7.21.0 + '@babel/runtime': 7.21.5 '@radix-ui/primitive': 1.0.0 '@radix-ui/react-context': 1.0.0(react@18.2.0) '@radix-ui/react-menu': 2.0.4(react-dom@18.2.0)(react@18.2.0) @@ -4998,7 +5294,7 @@ packages: peerDependencies: react: ^16.8 || ^17.0 || ^18.0 dependencies: - '@babel/runtime': 7.21.0 + '@babel/runtime': 7.21.5 react: 18.2.0 /@radix-ui/react-dialog@1.0.0(@types/react@18.2.6)(react-dom@18.2.0)(react@18.2.0): @@ -5061,7 +5357,7 @@ packages: react: ^16.8 || ^17.0 || ^18.0 react-dom: ^16.8 || ^17.0 || ^18.0 dependencies: - '@babel/runtime': 7.21.0 + '@babel/runtime': 7.21.5 '@radix-ui/primitive': 1.0.0 '@radix-ui/react-compose-refs': 1.0.0(react@18.2.0) '@radix-ui/react-context': 1.0.0(react@18.2.0) @@ -5087,7 +5383,7 @@ packages: react: ^16.8 || ^17.0 || ^18.0 react-dom: ^16.8 || ^17.0 || ^18.0 dependencies: - '@babel/runtime': 7.21.0 + '@babel/runtime': 7.21.5 '@radix-ui/primitive': 1.0.0 '@radix-ui/react-compose-refs': 1.0.0(react@18.2.0) '@radix-ui/react-context': 1.0.0(react@18.2.0) @@ -5113,7 +5409,7 @@ packages: peerDependencies: react: ^16.8 || ^17.0 || ^18.0 dependencies: - '@babel/runtime': 7.21.0 + '@babel/runtime': 7.21.5 react: 18.2.0 /@radix-ui/react-dismissable-layer@1.0.0(react-dom@18.2.0)(react@18.2.0): @@ -5138,7 +5434,7 @@ packages: react: ^16.8 || ^17.0 || ^18.0 react-dom: ^16.8 || ^17.0 || ^18.0 dependencies: - '@babel/runtime': 7.21.0 + '@babel/runtime': 7.21.5 '@radix-ui/primitive': 1.0.0 '@radix-ui/react-compose-refs': 1.0.0(react@18.2.0) '@radix-ui/react-primitive': 1.0.2(react-dom@18.2.0)(react@18.2.0) @@ -5153,7 +5449,7 @@ packages: react: ^16.8 || ^17.0 || ^18.0 react-dom: ^16.8 || ^17.0 || ^18.0 dependencies: - '@babel/runtime': 7.21.0 + '@babel/runtime': 7.21.5 '@radix-ui/primitive': 1.0.0 '@radix-ui/react-compose-refs': 1.0.0(react@18.2.0) '@radix-ui/react-context': 1.0.0(react@18.2.0) @@ -5172,7 +5468,7 @@ packages: react: ^16.8 || ^17.0 || ^18.0 react-dom: ^16.8 || ^17.0 || ^18.0 dependencies: - '@babel/runtime': 7.21.0 + '@babel/runtime': 7.21.5 '@radix-ui/primitive': 1.0.0 '@radix-ui/react-compose-refs': 1.0.0(react@18.2.0) '@radix-ui/react-context': 1.0.0(react@18.2.0) @@ -5191,7 +5487,7 @@ packages: peerDependencies: react: ^16.8 || ^17.0 || ^18.0 dependencies: - '@babel/runtime': 7.21.0 + '@babel/runtime': 7.21.5 react: 18.2.0 /@radix-ui/react-focus-scope@1.0.0(react-dom@18.2.0)(react@18.2.0): @@ -5214,7 +5510,7 @@ packages: react: ^16.8 || ^17.0 || ^18.0 react-dom: ^16.8 || ^17.0 || ^18.0 dependencies: - '@babel/runtime': 7.21.0 + '@babel/runtime': 7.21.5 '@radix-ui/react-compose-refs': 1.0.0(react@18.2.0) '@radix-ui/react-primitive': 1.0.2(react-dom@18.2.0)(react@18.2.0) '@radix-ui/react-use-callback-ref': 1.0.0(react@18.2.0) @@ -5227,7 +5523,7 @@ packages: react: ^16.8 || ^17.0 || ^18.0 react-dom: ^16.8 || ^17.0 || ^18.0 dependencies: - '@babel/runtime': 7.21.0 + '@babel/runtime': 7.21.5 '@radix-ui/primitive': 1.0.0 '@radix-ui/react-compose-refs': 1.0.0(react@18.2.0) '@radix-ui/react-context': 1.0.0(react@18.2.0) @@ -5248,7 +5544,7 @@ packages: react: ^16.8 || ^17.0 || ^18.0 react-dom: ^16.8 || ^17.0 || ^18.0 dependencies: - '@babel/runtime': 7.21.0 + '@babel/runtime': 7.21.5 '@radix-ui/primitive': 1.0.0 '@radix-ui/react-compose-refs': 1.0.0(react@18.2.0) '@radix-ui/react-context': 1.0.0(react@18.2.0) @@ -5277,7 +5573,7 @@ packages: peerDependencies: react: ^16.8 || ^17.0 || ^18.0 dependencies: - '@babel/runtime': 7.21.0 + '@babel/runtime': 7.21.5 '@radix-ui/react-use-layout-effect': 1.0.0(react@18.2.0) react: 18.2.0 @@ -5287,7 +5583,7 @@ packages: react: ^16.8 || ^17.0 || ^18.0 react-dom: ^16.8 || ^17.0 || ^18.0 dependencies: - '@babel/runtime': 7.21.0 + '@babel/runtime': 7.21.5 '@radix-ui/react-primitive': 1.0.2(react-dom@18.2.0)(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) @@ -5298,7 +5594,7 @@ packages: react: ^16.8 || ^17.0 || ^18.0 react-dom: ^16.8 || ^17.0 || ^18.0 dependencies: - '@babel/runtime': 7.21.0 + '@babel/runtime': 7.21.5 '@radix-ui/primitive': 1.0.0 '@radix-ui/react-collection': 1.0.2(react-dom@18.2.0)(react@18.2.0) '@radix-ui/react-compose-refs': 1.0.0(react@18.2.0) @@ -5328,7 +5624,7 @@ packages: react: ^16.8 || ^17.0 || ^18.0 react-dom: ^16.8 || ^17.0 || ^18.0 dependencies: - '@babel/runtime': 7.21.0 + '@babel/runtime': 7.21.5 '@radix-ui/primitive': 1.0.0 '@radix-ui/react-collection': 1.0.2(react-dom@18.2.0)(react@18.2.0) '@radix-ui/react-compose-refs': 1.0.0(react@18.2.0) @@ -5359,7 +5655,7 @@ packages: react: ^16.8 || ^17.0 || ^18.0 react-dom: ^16.8 || ^17.0 || ^18.0 dependencies: - '@babel/runtime': 7.21.0 + '@babel/runtime': 7.21.5 '@radix-ui/primitive': 1.0.0 '@radix-ui/react-collection': 1.0.2(react-dom@18.2.0)(react@18.2.0) '@radix-ui/react-compose-refs': 1.0.0(react@18.2.0) @@ -5383,7 +5679,7 @@ packages: react: ^16.8 || ^17.0 || ^18.0 react-dom: ^16.8 || ^17.0 || ^18.0 dependencies: - '@babel/runtime': 7.21.0 + '@babel/runtime': 7.21.5 '@radix-ui/primitive': 1.0.0 '@radix-ui/react-compose-refs': 1.0.0(react@18.2.0) '@radix-ui/react-context': 1.0.0(react@18.2.0) @@ -5410,7 +5706,7 @@ packages: react: ^16.8 || ^17.0 || ^18.0 react-dom: ^16.8 || ^17.0 || ^18.0 dependencies: - '@babel/runtime': 7.21.0 + '@babel/runtime': 7.21.5 '@radix-ui/primitive': 1.0.0 '@radix-ui/react-compose-refs': 1.0.0(react@18.2.0) '@radix-ui/react-context': 1.0.0(react@18.2.0) @@ -5438,7 +5734,7 @@ packages: react: ^16.8 || ^17.0 || ^18.0 react-dom: ^16.8 || ^17.0 || ^18.0 dependencies: - '@babel/runtime': 7.21.0 + '@babel/runtime': 7.21.5 '@floating-ui/react-dom': 0.7.2(@types/react@18.2.6)(react-dom@18.2.0)(react@18.2.0) '@radix-ui/react-arrow': 1.0.2(react-dom@18.2.0)(react@18.2.0) '@radix-ui/react-compose-refs': 1.0.0(react@18.2.0) @@ -5460,7 +5756,7 @@ packages: react: ^16.8 || ^17.0 || ^18.0 react-dom: ^16.8 || ^17.0 || ^18.0 dependencies: - '@babel/runtime': 7.21.0 + '@babel/runtime': 7.21.5 '@floating-ui/react-dom': 0.7.2(react-dom@18.2.0)(react@18.2.0) '@radix-ui/react-arrow': 1.0.2(react-dom@18.2.0)(react@18.2.0) '@radix-ui/react-compose-refs': 1.0.0(react@18.2.0) @@ -5495,7 +5791,7 @@ packages: react: ^16.8 || ^17.0 || ^18.0 react-dom: ^16.8 || ^17.0 || ^18.0 dependencies: - '@babel/runtime': 7.21.0 + '@babel/runtime': 7.21.5 '@radix-ui/react-primitive': 1.0.2(react-dom@18.2.0)(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) @@ -5506,7 +5802,7 @@ packages: react: ^16.8 || ^17.0 || ^18.0 react-dom: ^16.8 || ^17.0 || ^18.0 dependencies: - '@babel/runtime': 7.21.0 + '@babel/runtime': 7.21.5 '@radix-ui/react-compose-refs': 1.0.0(react@18.2.0) '@radix-ui/react-use-layout-effect': 1.0.0(react@18.2.0) react: 18.2.0 @@ -5530,7 +5826,7 @@ packages: react: ^16.8 || ^17.0 || ^18.0 react-dom: ^16.8 || ^17.0 || ^18.0 dependencies: - '@babel/runtime': 7.21.0 + '@babel/runtime': 7.21.5 '@radix-ui/react-slot': 1.0.1(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) @@ -5541,7 +5837,7 @@ packages: react: ^16.8 || ^17.0 || ^18.0 react-dom: ^16.8 || ^17.0 || ^18.0 dependencies: - '@babel/runtime': 7.21.0 + '@babel/runtime': 7.21.5 '@radix-ui/react-context': 1.0.0(react@18.2.0) '@radix-ui/react-primitive': 1.0.2(react-dom@18.2.0)(react@18.2.0) react: 18.2.0 @@ -5553,7 +5849,7 @@ packages: react: ^16.8 || ^17.0 || ^18.0 react-dom: ^16.8 || ^17.0 || ^18.0 dependencies: - '@babel/runtime': 7.21.0 + '@babel/runtime': 7.21.5 '@radix-ui/primitive': 1.0.0 '@radix-ui/react-compose-refs': 1.0.0(react@18.2.0) '@radix-ui/react-context': 1.0.0(react@18.2.0) @@ -5573,7 +5869,7 @@ packages: react: ^16.8 || ^17.0 || ^18.0 react-dom: ^16.8 || ^17.0 || ^18.0 dependencies: - '@babel/runtime': 7.21.0 + '@babel/runtime': 7.21.5 '@radix-ui/primitive': 1.0.0 '@radix-ui/react-collection': 1.0.2(react-dom@18.2.0)(react@18.2.0) '@radix-ui/react-compose-refs': 1.0.0(react@18.2.0) @@ -5592,7 +5888,7 @@ packages: react: ^16.8 || ^17.0 || ^18.0 react-dom: ^16.8 || ^17.0 || ^18.0 dependencies: - '@babel/runtime': 7.21.0 + '@babel/runtime': 7.21.5 '@radix-ui/number': 1.0.0 '@radix-ui/primitive': 1.0.0 '@radix-ui/react-compose-refs': 1.0.0(react@18.2.0) @@ -5611,7 +5907,7 @@ packages: react: ^16.8 || ^17.0 || ^18.0 react-dom: ^16.8 || ^17.0 || ^18.0 dependencies: - '@babel/runtime': 7.21.0 + '@babel/runtime': 7.21.5 '@radix-ui/number': 1.0.0 '@radix-ui/primitive': 1.0.0 '@radix-ui/react-collection': 1.0.2(react-dom@18.2.0)(react@18.2.0) @@ -5644,7 +5940,7 @@ packages: react: ^16.8 || ^17.0 || ^18.0 react-dom: ^16.8 || ^17.0 || ^18.0 dependencies: - '@babel/runtime': 7.21.0 + '@babel/runtime': 7.21.5 '@radix-ui/number': 1.0.0 '@radix-ui/primitive': 1.0.0 '@radix-ui/react-collection': 1.0.2(react-dom@18.2.0)(react@18.2.0) @@ -5678,7 +5974,7 @@ packages: react: ^16.8 || ^17.0 || ^18.0 react-dom: ^16.8 || ^17.0 || ^18.0 dependencies: - '@babel/runtime': 7.21.0 + '@babel/runtime': 7.21.5 '@radix-ui/react-primitive': 1.0.2(react-dom@18.2.0)(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) @@ -5689,7 +5985,7 @@ packages: react: ^16.8 || ^17.0 || ^18.0 react-dom: ^16.8 || ^17.0 || ^18.0 dependencies: - '@babel/runtime': 7.21.0 + '@babel/runtime': 7.21.5 '@radix-ui/number': 1.0.0 '@radix-ui/primitive': 1.0.0 '@radix-ui/react-collection': 1.0.2(react-dom@18.2.0)(react@18.2.0) @@ -5719,7 +6015,7 @@ packages: peerDependencies: react: ^16.8 || ^17.0 || ^18.0 dependencies: - '@babel/runtime': 7.21.0 + '@babel/runtime': 7.21.5 '@radix-ui/react-compose-refs': 1.0.0(react@18.2.0) react: 18.2.0 @@ -5729,7 +6025,7 @@ packages: react: ^16.8 || ^17.0 || ^18.0 react-dom: ^16.8 || ^17.0 || ^18.0 dependencies: - '@babel/runtime': 7.21.0 + '@babel/runtime': 7.21.5 '@radix-ui/primitive': 1.0.0 '@radix-ui/react-compose-refs': 1.0.0(react@18.2.0) '@radix-ui/react-context': 1.0.0(react@18.2.0) @@ -5746,7 +6042,7 @@ packages: react: ^16.8 || ^17.0 || ^18.0 react-dom: ^16.8 || ^17.0 || ^18.0 dependencies: - '@babel/runtime': 7.21.0 + '@babel/runtime': 7.21.5 '@radix-ui/primitive': 1.0.0 '@radix-ui/react-context': 1.0.0(react@18.2.0) '@radix-ui/react-direction': 1.0.0(react@18.2.0) @@ -5764,7 +6060,7 @@ packages: react: ^16.8 || ^17.0 || ^18.0 react-dom: ^16.8 || ^17.0 || ^18.0 dependencies: - '@babel/runtime': 7.21.0 + '@babel/runtime': 7.21.5 '@radix-ui/primitive': 1.0.0 '@radix-ui/react-collection': 1.0.2(react-dom@18.2.0)(react@18.2.0) '@radix-ui/react-compose-refs': 1.0.0(react@18.2.0) @@ -5786,7 +6082,7 @@ packages: react: ^16.8 || ^17.0 || ^18.0 react-dom: ^16.8 || ^17.0 || ^18.0 dependencies: - '@babel/runtime': 7.21.0 + '@babel/runtime': 7.21.5 '@radix-ui/primitive': 1.0.0 '@radix-ui/react-context': 1.0.0(react@18.2.0) '@radix-ui/react-direction': 1.0.0(react@18.2.0) @@ -5803,7 +6099,7 @@ packages: react: ^16.8 || ^17.0 || ^18.0 react-dom: ^16.8 || ^17.0 || ^18.0 dependencies: - '@babel/runtime': 7.21.0 + '@babel/runtime': 7.21.5 '@radix-ui/primitive': 1.0.0 '@radix-ui/react-primitive': 1.0.2(react-dom@18.2.0)(react@18.2.0) '@radix-ui/react-use-controllable-state': 1.0.0(react@18.2.0) @@ -5816,7 +6112,7 @@ packages: react: ^16.8 || ^17.0 || ^18.0 react-dom: ^16.8 || ^17.0 || ^18.0 dependencies: - '@babel/runtime': 7.21.0 + '@babel/runtime': 7.21.5 '@radix-ui/primitive': 1.0.0 '@radix-ui/react-context': 1.0.0(react@18.2.0) '@radix-ui/react-direction': 1.0.0(react@18.2.0) @@ -5833,7 +6129,7 @@ packages: react: ^16.8 || ^17.0 || ^18.0 react-dom: ^16.8 || ^17.0 || ^18.0 dependencies: - '@babel/runtime': 7.21.0 + '@babel/runtime': 7.21.5 '@radix-ui/primitive': 1.0.0 '@radix-ui/react-compose-refs': 1.0.0(react@18.2.0) '@radix-ui/react-context': 1.0.0(react@18.2.0) @@ -5857,7 +6153,7 @@ packages: react: ^16.8 || ^17.0 || ^18.0 react-dom: ^16.8 || ^17.0 || ^18.0 dependencies: - '@babel/runtime': 7.21.0 + '@babel/runtime': 7.21.5 '@radix-ui/primitive': 1.0.0 '@radix-ui/react-compose-refs': 1.0.0(react@18.2.0) '@radix-ui/react-context': 1.0.0(react@18.2.0) @@ -5881,7 +6177,7 @@ packages: peerDependencies: react: ^16.8 || ^17.0 || ^18.0 dependencies: - '@babel/runtime': 7.21.0 + '@babel/runtime': 7.21.5 react: 18.2.0 /@radix-ui/react-use-controllable-state@1.0.0(react@18.2.0): @@ -5889,7 +6185,7 @@ packages: peerDependencies: react: ^16.8 || ^17.0 || ^18.0 dependencies: - '@babel/runtime': 7.21.0 + '@babel/runtime': 7.21.5 '@radix-ui/react-use-callback-ref': 1.0.0(react@18.2.0) react: 18.2.0 @@ -5908,7 +6204,7 @@ packages: peerDependencies: react: ^16.8 || ^17.0 || ^18.0 dependencies: - '@babel/runtime': 7.21.0 + '@babel/runtime': 7.21.5 '@radix-ui/react-use-callback-ref': 1.0.0(react@18.2.0) react: 18.2.0 @@ -5917,7 +6213,7 @@ packages: peerDependencies: react: ^16.8 || ^17.0 || ^18.0 dependencies: - '@babel/runtime': 7.21.0 + '@babel/runtime': 7.21.5 react: 18.2.0 /@radix-ui/react-use-previous@1.0.0(react@18.2.0): @@ -5925,7 +6221,7 @@ packages: peerDependencies: react: ^16.8 || ^17.0 || ^18.0 dependencies: - '@babel/runtime': 7.21.0 + '@babel/runtime': 7.21.5 react: 18.2.0 /@radix-ui/react-use-rect@1.0.0(react@18.2.0): @@ -5933,7 +6229,7 @@ packages: peerDependencies: react: ^16.8 || ^17.0 || ^18.0 dependencies: - '@babel/runtime': 7.21.0 + '@babel/runtime': 7.21.5 '@radix-ui/rect': 1.0.0 react: 18.2.0 @@ -5942,7 +6238,7 @@ packages: peerDependencies: react: ^16.8 || ^17.0 || ^18.0 dependencies: - '@babel/runtime': 7.21.0 + '@babel/runtime': 7.21.5 '@radix-ui/react-use-layout-effect': 1.0.0(react@18.2.0) react: 18.2.0 @@ -5952,7 +6248,7 @@ packages: react: ^16.8 || ^17.0 || ^18.0 react-dom: ^16.8 || ^17.0 || ^18.0 dependencies: - '@babel/runtime': 7.21.0 + '@babel/runtime': 7.21.5 '@radix-ui/react-primitive': 1.0.2(react-dom@18.2.0)(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) @@ -9303,7 +9599,7 @@ packages: engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} hasBin: true dependencies: - caniuse-lite: 1.0.30001482 + caniuse-lite: 1.0.30001486 electron-to-chromium: 1.4.369 node-releases: 2.0.10 update-browserslist-db: 1.0.11(browserslist@4.21.5) @@ -9478,6 +9774,10 @@ packages: /caniuse-lite@1.0.30001482: resolution: {integrity: sha512-F1ZInsg53cegyjroxLNW9DmrEQ1SuGRTO1QlpA0o2/6OpQ0gFeDRoq1yFmnr8Sakn9qwwt9DmbxHB6w167OSuQ==} + dev: true + + /caniuse-lite@1.0.30001486: + resolution: {integrity: sha512-uv7/gXuHi10Whlj0pp5q/tsK/32J2QSqVRKQhs2j8VsDCjgyruAh/eEXHF822VqO9yT6iZKw3nRwZRSPBE9OQg==} /cardinal@2.1.1: resolution: {integrity: sha512-JSr5eOgoEymtYHBjNWyjrMqet9Am2miJhlfKNdqLp6zoeAh0KN5dRAcxlecj5mAJrmQomgiOBj35xHLrFjqBpw==} @@ -10298,7 +10598,7 @@ packages: resolution: {integrity: sha512-fnULvOpxnC5/Vg3NCiWelDsLiUc9bRwAPs/+LfTLNvetFCtCTN+yQz15C/fs4AwX1R9K5GLtLfn8QW+dWisaAw==} engines: {node: '>=0.11'} dependencies: - '@babel/runtime': 7.21.0 + '@babel/runtime': 7.21.5 /dateformat@3.0.3: resolution: {integrity: sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q==} @@ -14713,50 +15013,6 @@ packages: - supports-color dev: true - /next@13.3.4(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-sod7HeokBSvH5QV0KB+pXeLfcXUlLrGnVUXxHpmhilQ+nQYT3Im2O8DswD5e4uqbR8Pvdu9pcWgb1CbXZQZlmQ==} - engines: {node: '>=16.8.0'} - hasBin: true - peerDependencies: - '@opentelemetry/api': ^1.1.0 - fibers: '>= 3.1.0' - node-sass: ^6.0.0 || ^7.0.0 - react: ^18.2.0 - react-dom: ^18.2.0 - sass: ^1.3.0 - peerDependenciesMeta: - '@opentelemetry/api': - optional: true - fibers: - optional: true - node-sass: - optional: true - sass: - optional: true - dependencies: - '@next/env': 13.3.4 - '@swc/helpers': 0.5.1 - busboy: 1.6.0 - caniuse-lite: 1.0.30001482 - postcss: 8.4.14 - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - styled-jsx: 5.1.1(react@18.2.0) - optionalDependencies: - '@next/swc-darwin-arm64': 13.3.4 - '@next/swc-darwin-x64': 13.3.4 - '@next/swc-linux-arm64-gnu': 13.3.4 - '@next/swc-linux-arm64-musl': 13.3.4 - '@next/swc-linux-x64-gnu': 13.3.4 - '@next/swc-linux-x64-musl': 13.3.4 - '@next/swc-win32-arm64-msvc': 13.3.4 - '@next/swc-win32-ia32-msvc': 13.3.4 - '@next/swc-win32-x64-msvc': 13.3.4 - transitivePeerDependencies: - - '@babel/core' - - babel-plugin-macros - dev: true - /next@13.4.1: resolution: {integrity: sha512-JBw2kAIyhKDpjhEWvNVoFeIzNp9xNxg8wrthDOtMctfn3EpqGCmW0FSviNyGgOSOSn6zDaX48pmvbdf6X2W9xA==} engines: {node: '>=16.8.0'} @@ -14781,7 +15037,7 @@ packages: '@next/env': 13.4.1 '@swc/helpers': 0.5.1 busboy: 1.6.0 - caniuse-lite: 1.0.30001482 + caniuse-lite: 1.0.30001486 postcss: 8.4.14 styled-jsx: 5.1.1 zod: 3.21.4 @@ -14824,7 +15080,7 @@ packages: '@next/env': 13.4.1 '@swc/helpers': 0.5.1 busboy: 1.6.0 - caniuse-lite: 1.0.30001482 + caniuse-lite: 1.0.30001486 postcss: 8.4.14 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) diff --git a/sites/jeromefitzgerald.com/src/app/(notion)/books/page.tsx b/sites/jeromefitzgerald.com/src/app/(notion)/books/page.tsx index 8e739aa63..9fdb3da2a 100644 --- a/sites/jeromefitzgerald.com/src/app/(notion)/books/page.tsx +++ b/sites/jeromefitzgerald.com/src/app/(notion)/books/page.tsx @@ -5,6 +5,7 @@ import { Pencil2Icon as PencilWithPaper, } from '@jeromefitz/ds/components/Icon' import type { Page } from '@jeromefitz/notion/schema' +import { cx } from '@jeromefitz/shared/src/utils' import _filter from 'lodash/filter' import _map from 'lodash/map' import _orderBy from 'lodash/orderBy' @@ -15,7 +16,6 @@ import { Debug } from '~components/Debug' // @todo(next) https://github.com/vercel/next.js/issues/46756 // import { Icon } from '@jeromefitz/ds/Icon' import { PageHeading } from '~ui/PageHeading' -import { cx } from '~utils/cx' // import { log } from '~utils/log' const ROUTE_TYPE = 'books' diff --git a/sites/jeromefitzgerald.com/src/app/(notion)/events/[[...catchAll]]/Listing.tsx b/sites/jeromefitzgerald.com/src/app/(notion)/events/[[...catchAll]]/Listing.tsx index 2e6a5b0fa..ad594a5b0 100644 --- a/sites/jeromefitzgerald.com/src/app/(notion)/events/[[...catchAll]]/Listing.tsx +++ b/sites/jeromefitzgerald.com/src/app/(notion)/events/[[...catchAll]]/Listing.tsx @@ -1,11 +1,11 @@ import type { Event } from '@jeromefitz/notion/schema' import { TZ } from '@jeromefitz/shared/src/lib/constants' +import { cx } from '@jeromefitz/shared/src/utils' import _parseISO from 'date-fns/parseISO' import { formatInTimeZone as _formatInTimeZone } from 'date-fns-tz' import _orderBy from 'lodash/orderBy' import { Anchor } from '~components/Anchor' -import { cx } from '~utils/cx' import { formatDateForSlug } from '~utils/formatDateForSlug' import { filterForEventsInFuture } from '~utils/isEventInFuture' import { filterForEventsInPast } from '~utils/isEventInPast' diff --git a/sites/jeromefitzgerald.com/src/app/(notion)/events/[[...catchAll]]/Slug.tsx b/sites/jeromefitzgerald.com/src/app/(notion)/events/[[...catchAll]]/Slug.tsx index 0643a2c4a..5513d6537 100644 --- a/sites/jeromefitzgerald.com/src/app/(notion)/events/[[...catchAll]]/Slug.tsx +++ b/sites/jeromefitzgerald.com/src/app/(notion)/events/[[...catchAll]]/Slug.tsx @@ -3,6 +3,7 @@ import { ButtonLink } from '@jeromefitz/ds/components/Button' import { ExternalLinkIcon as ExternalLink } from '@jeromefitz/ds/components/Icon' import type { Event } from '@jeromefitz/notion/schema' import { TZ } from '@jeromefitz/shared/src/lib/constants' +import { cx } from '@jeromefitz/shared/src/utils' import { isObject } from '@jeromefitz/utils' import _parseISO from 'date-fns/parseISO' import { formatInTimeZone as _formatInTimeZone } from 'date-fns-tz' @@ -12,7 +13,6 @@ import { Meta } from '~components/Meta' // @todo(next) https://github.com/vercel/next.js/issues/46756 // import { Icon } from '@jeromefitz/ds/components/Icon' import { useNotion } from '~hooks/useNotion' -import { cx } from '~utils/cx' import { isEventInPast } from '~utils/isEventInPast' // import { log } from '~utils/log' diff --git a/sites/jeromefitzgerald.com/src/app/(notion)/shows/[[...catchAll]]/Item.tsx b/sites/jeromefitzgerald.com/src/app/(notion)/shows/[[...catchAll]]/Item.tsx index 608353523..bc41641ac 100644 --- a/sites/jeromefitzgerald.com/src/app/(notion)/shows/[[...catchAll]]/Item.tsx +++ b/sites/jeromefitzgerald.com/src/app/(notion)/shows/[[...catchAll]]/Item.tsx @@ -1,11 +1,11 @@ 'use client' +import { cx } from '@jeromefitz/shared/src/utils' import * as AspectRatio from '@radix-ui/react-aspect-ratio' import { motion } from 'framer-motion' import Image from 'next/image' import { useState } from 'react' import useSWR from 'swr' -import { cx } from '~utils/cx' // import { log } from '~utils/log' // // import { UpcomingEvents } from './UpcomingEvents' diff --git a/sites/jeromefitzgerald.com/src/app/(notion)/shows/[[...catchAll]]/Listing.tsx b/sites/jeromefitzgerald.com/src/app/(notion)/shows/[[...catchAll]]/Listing.tsx index 321826fea..1bcdedae3 100644 --- a/sites/jeromefitzgerald.com/src/app/(notion)/shows/[[...catchAll]]/Listing.tsx +++ b/sites/jeromefitzgerald.com/src/app/(notion)/shows/[[...catchAll]]/Listing.tsx @@ -1,9 +1,7 @@ import type { Show } from '@jeromefitz/notion/schema' -// eslint-disable-next-line no-restricted-imports +import { cx } from '@jeromefitz/shared/src/utils' import NextLink from 'next/link' -import { cx } from '~utils/cx' - import { Item } from './Item' // eslint-disable-next-line @typescript-eslint/no-unused-vars diff --git a/sites/jeromefitzgerald.com/src/app/(notion)/shows/[[...catchAll]]/UpcomingEvents.tsx b/sites/jeromefitzgerald.com/src/app/(notion)/shows/[[...catchAll]]/UpcomingEvents.tsx index 8f749fd7c..0d527c98f 100644 --- a/sites/jeromefitzgerald.com/src/app/(notion)/shows/[[...catchAll]]/UpcomingEvents.tsx +++ b/sites/jeromefitzgerald.com/src/app/(notion)/shows/[[...catchAll]]/UpcomingEvents.tsx @@ -1,9 +1,9 @@ 'use client' +import { cx } from '@jeromefitz/shared/src/utils' import _filter from 'lodash/filter' import { Listing } from '~app/(notion)/events/[[...catchAll]]/Listing' import { useNotion } from '~hooks/useNotion' -import { cx } from '~utils/cx' import { isEventInFuture } from '~utils/isEventInFuture' const ROUTE_TYPE = 'events' diff --git a/sites/jeromefitzgerald.com/src/app/layout.tsx b/sites/jeromefitzgerald.com/src/app/layout.tsx index 39f0c88a1..b00ecfcb5 100644 --- a/sites/jeromefitzgerald.com/src/app/layout.tsx +++ b/sites/jeromefitzgerald.com/src/app/layout.tsx @@ -3,6 +3,7 @@ import '@jeromefitz/tailwind-config/styles/globals.css' // import '~styles/output.css' +import { cx } from '@jeromefitz/shared/src/utils' import localFont from 'next/font/local' import { Fragment, Suspense } from 'react' @@ -14,7 +15,6 @@ import { NavigationBar } from '~components/NavigationBar' import { Providers } from '~components/Providers' import { ScrollToTopHack } from '~components/ScrollToTopHack' import { metadata as seo } from '~config/metadata' -import { cx } from '~utils/cx' // import { log } from '~utils/log' // const DEBUG_KEY = 'layout.ts >> (root) > ' diff --git a/sites/jeromefitzgerald.com/src/app/testing/page.tsx b/sites/jeromefitzgerald.com/src/app/testing/page.tsx index 613cd587b..b0fe65cd0 100644 --- a/sites/jeromefitzgerald.com/src/app/testing/page.tsx +++ b/sites/jeromefitzgerald.com/src/app/testing/page.tsx @@ -1,10 +1,10 @@ +import { cx } from '@jeromefitz/shared/src/utils' import Image from 'next/image' import { Suspense } from 'react' // import { Anchor } from '~components/Anchor' import { Debug } from '~components/Debug' import { PageHeading } from '~ui/PageHeading' -import { cx } from '~utils/cx' // import { log } from '~utils/log' // const ROUTE_TYPE = 'testing' diff --git a/sites/jeromefitzgerald.com/src/components/Anchor/Anchor.tsx b/sites/jeromefitzgerald.com/src/components/Anchor/Anchor.tsx index e6b0bcf5c..8bf2db131 100644 --- a/sites/jeromefitzgerald.com/src/components/Anchor/Anchor.tsx +++ b/sites/jeromefitzgerald.com/src/components/Anchor/Anchor.tsx @@ -15,7 +15,7 @@ import { handleRouterChange, LinkRouterChangeContext, } from '~context/LinkRouterChangeContext' -import { cx } from '~utils/cx' +import { cx } from '@jeromefitz/shared/src/utils' function AnchorNav({ href, diff --git a/sites/jeromefitzgerald.com/src/components/Debug/Debug.tsx b/sites/jeromefitzgerald.com/src/components/Debug/Debug.tsx index 09f74da4f..96df1eccc 100644 --- a/sites/jeromefitzgerald.com/src/components/Debug/Debug.tsx +++ b/sites/jeromefitzgerald.com/src/components/Debug/Debug.tsx @@ -6,7 +6,7 @@ import { AnimatePresence, motion, useAnimationControls } from 'framer-motion' import { usePathname } from 'next/navigation' import { useEffect, useState } from 'react' -import { cx } from '~utils/cx' +import { cx } from '@jeromefitz/shared/src/utils' // import { log } from '~utils/log' // const DEBUG_KEY = '~components/Debug >> ' diff --git a/sites/jeromefitzgerald.com/src/components/Footer/Footer.tsx b/sites/jeromefitzgerald.com/src/components/Footer/Footer.tsx index baa6e3123..0fc2c0af5 100644 --- a/sites/jeromefitzgerald.com/src/components/Footer/Footer.tsx +++ b/sites/jeromefitzgerald.com/src/components/Footer/Footer.tsx @@ -23,7 +23,7 @@ import buildInfo from '~config/build-info.json' // @todo(next) https://github.com/vercel/next.js/issues/46756 // import { Icon } from '@jeromefitz/ds/components/Icon' import { Tooltip } from '~ui/Tooltip' -import { cx } from '~utils/cx' +import { cx } from '@jeromefitz/shared/src/utils' const { isBranchMain, prerelease, version } = buildInfo diff --git a/sites/jeromefitzgerald.com/src/components/Loading/Loading.tsx b/sites/jeromefitzgerald.com/src/components/Loading/Loading.tsx index 39bd696ec..463b58d40 100644 --- a/sites/jeromefitzgerald.com/src/components/Loading/Loading.tsx +++ b/sites/jeromefitzgerald.com/src/components/Loading/Loading.tsx @@ -2,7 +2,7 @@ import { useNProgress } from '@tanem/react-nprogress' import { motion } from 'framer-motion' import { useEffect } from 'react' -import { cx } from '~utils/cx' +import { cx } from '@jeromefitz/shared/src/utils' const Loading: React.FC<{ isRouteChanging: boolean }> = ({ isRouteChanging }) => { const { isFinished, progress } = useNProgress({ diff --git a/sites/jeromefitzgerald.com/src/components/Meta/Meta.tsx b/sites/jeromefitzgerald.com/src/components/Meta/Meta.tsx index 08f228df5..8d01775ac 100644 --- a/sites/jeromefitzgerald.com/src/components/Meta/Meta.tsx +++ b/sites/jeromefitzgerald.com/src/components/Meta/Meta.tsx @@ -12,7 +12,7 @@ import pluralize from 'pluralize' import useSWRImmutable from 'swr/immutable' import { notionConfig } from '~config/index' -import { cx } from '~utils/cx' +import { cx } from '@jeromefitz/shared/src/utils' // import { log } from '~utils/log' const { NOTION } = notionConfig diff --git a/sites/jeromefitzgerald.com/src/components/Music/Music.tsx b/sites/jeromefitzgerald.com/src/components/Music/Music.tsx index e1acafa38..44f0aba63 100644 --- a/sites/jeromefitzgerald.com/src/components/Music/Music.tsx +++ b/sites/jeromefitzgerald.com/src/components/Music/Music.tsx @@ -12,7 +12,7 @@ import { useSpotify } from '~hooks/useSpotify' // @todo(next) https://github.com/vercel/next.js/issues/46756 // import { Icon } from '@jeromefitz/ds/components/Icon' import { RadioGroup } from '~ui/RadioGroup' -import { cx } from '~utils/cx' +import { cx } from '@jeromefitz/shared/src/utils' // import { log } from '~utils/log' // const DEBUG_KEY = `~components/Music >> ` diff --git a/sites/jeromefitzgerald.com/src/components/Music/NowPlaying/NowPlaying.tsx b/sites/jeromefitzgerald.com/src/components/Music/NowPlaying/NowPlaying.tsx index 93a46168b..907994d03 100644 --- a/sites/jeromefitzgerald.com/src/components/Music/NowPlaying/NowPlaying.tsx +++ b/sites/jeromefitzgerald.com/src/components/Music/NowPlaying/NowPlaying.tsx @@ -16,7 +16,7 @@ import { Anchor } from '~components/Anchor' import { nowPlaying } from '~data/mock/music' // @todo(next) https://github.com/vercel/next.js/issues/46756 // import { Icon } from '@jeromefitz/ds/components/Icon' -import { cx } from '~utils/cx' +import { cx } from '@jeromefitz/shared/src/utils' // import { log } from '~utils/log' // const HOUR = 3600000 diff --git a/sites/jeromefitzgerald.com/src/components/Music/Top/Top.tsx b/sites/jeromefitzgerald.com/src/components/Music/Top/Top.tsx index 7646175d9..1eb6a73ee 100644 --- a/sites/jeromefitzgerald.com/src/components/Music/Top/Top.tsx +++ b/sites/jeromefitzgerald.com/src/components/Music/Top/Top.tsx @@ -6,6 +6,7 @@ import { ExternalLinkIcon as ExternalLink, TagIcon as Tag, } from '@jeromefitz/ds/components/Icon' +import { cx } from '@jeromefitz/shared/src/utils' import { useComposedRefs } from '@radix-ui/react-compose-refs' import _map from 'lodash/map' // import _size from 'lodash/size' @@ -34,7 +35,6 @@ import { } from '~ui/Carousel' // @todo(next) https://github.com/vercel/next.js/issues/46756 // import { Icon } from '@jeromefitz/ds/components/Icon' -import { cx } from '~utils/cx' // import { log } from '~utils/log' // const ROUTE_TYPE = 'Top' diff --git a/sites/jeromefitzgerald.com/src/components/Upcoming/Upcoming.tsx b/sites/jeromefitzgerald.com/src/components/Upcoming/Upcoming.tsx index b8bd5447d..071b3926e 100644 --- a/sites/jeromefitzgerald.com/src/components/Upcoming/Upcoming.tsx +++ b/sites/jeromefitzgerald.com/src/components/Upcoming/Upcoming.tsx @@ -18,7 +18,7 @@ import { } from '~context/LinkRouterChangeContext' import { useDimensions } from '~hooks/useDimensions' import { useNotion } from '~hooks/useNotion' -import { cx } from '~utils/cx' +import { cx } from '@jeromefitz/shared/src/utils' import { filterForEventsInFuture } from '~utils/isEventInFuture' // import { log } from '~utils/log' diff --git a/sites/jeromefitzgerald.com/src/pages/api/v1/og/index.tsx b/sites/jeromefitzgerald.com/src/pages/api/v1/og/index.tsx index 8f154eb26..fc478d58b 100644 --- a/sites/jeromefitzgerald.com/src/pages/api/v1/og/index.tsx +++ b/sites/jeromefitzgerald.com/src/pages/api/v1/og/index.tsx @@ -1,7 +1,7 @@ import { ImageResponse } from '@vercel/og' import { NextRequest } from 'next/server' -import { cx } from '~utils/cx' +import { cx } from '@jeromefitz/shared/src/utils' export const config = { runtime: 'edge', diff --git a/sites/jeromefitzgerald.com/src/playground/Carousel/Carousel.tsx b/sites/jeromefitzgerald.com/src/playground/Carousel/Carousel.tsx index 36f06c1a1..da0e3ed37 100644 --- a/sites/jeromefitzgerald.com/src/playground/Carousel/Carousel.tsx +++ b/sites/jeromefitzgerald.com/src/playground/Carousel/Carousel.tsx @@ -10,7 +10,7 @@ import { } from 'framer-motion' import { useCallback, useEffect, useRef, useState } from 'react' -import { cx } from '~utils/cx' +import { cx } from '@jeromefitz/shared/src/utils' const images = [ '/static/images/carousel-temp/1.jpg', diff --git a/sites/jeromefitzgerald.com/src/playground/Carousel/Carousel2.tsx b/sites/jeromefitzgerald.com/src/playground/Carousel/Carousel2.tsx index fc675721a..70aa58516 100644 --- a/sites/jeromefitzgerald.com/src/playground/Carousel/Carousel2.tsx +++ b/sites/jeromefitzgerald.com/src/playground/Carousel/Carousel2.tsx @@ -3,7 +3,7 @@ import './styles.css' import { animate, motion, useMotionValue, useScroll } from 'framer-motion' import { useEffect, useRef, useState } from 'react' -import { cx } from '~utils/cx' +import { cx } from '@jeromefitz/shared/src/utils' function Carousel2() { const ref = useRef(null) diff --git a/sites/jeromefitzgerald.com/src/ui/Carousel/Carousel.tsx b/sites/jeromefitzgerald.com/src/ui/Carousel/Carousel.tsx index d93d390d3..fc29cef26 100644 --- a/sites/jeromefitzgerald.com/src/ui/Carousel/Carousel.tsx +++ b/sites/jeromefitzgerald.com/src/ui/Carousel/Carousel.tsx @@ -4,6 +4,7 @@ * @ref https://github.com/radix-ui/website * */ +import { cx } from '@jeromefitz/shared/src/utils' import { composeEventHandlers } from '@radix-ui/primitive' import { useComposedRefs } from '@radix-ui/react-compose-refs' import { createContext } from '@radix-ui/react-context' @@ -13,7 +14,6 @@ import type { RefObject } from 'react' import { useCallback, useEffect, useRef, useState } from 'react' import smoothscroll from 'smoothscroll-polyfill' -import { cx } from '~utils/cx' // import { log } from '~utils/log' const [CarouselProvider, useCarouselContext] = createContext<{ diff --git a/sites/jeromefitzgerald.com/src/ui/CommandMenu/CommandMenu.tsx b/sites/jeromefitzgerald.com/src/ui/CommandMenu/CommandMenu.tsx index 9d3f5e20e..1cb8e194a 100644 --- a/sites/jeromefitzgerald.com/src/ui/CommandMenu/CommandMenu.tsx +++ b/sites/jeromefitzgerald.com/src/ui/CommandMenu/CommandMenu.tsx @@ -1,11 +1,11 @@ import { DocumentMagnifyingGlassIcon } from '@heroicons/react/24/outline' +import { cx } from '@jeromefitz/shared/src/utils' import { DividerVerticalIcon } from '@radix-ui/react-icons' import { Command, useCommandState } from 'cmdk' import { AnimatePresence, motion, useAnimationControls } from 'framer-motion' import { useCallback, useEffect, useRef } from 'react' import { useStore } from '~store/useStore' -import { cx } from '~utils/cx' // import { log } from '~utils/log' import { sleep } from '~utils/sleep' diff --git a/sites/jeromefitzgerald.com/src/ui/DropdownMenu/DropdownMenu.tsx b/sites/jeromefitzgerald.com/src/ui/DropdownMenu/DropdownMenu.tsx index 90f9d6be2..73332bff7 100644 --- a/sites/jeromefitzgerald.com/src/ui/DropdownMenu/DropdownMenu.tsx +++ b/sites/jeromefitzgerald.com/src/ui/DropdownMenu/DropdownMenu.tsx @@ -1,8 +1,8 @@ +import { cx } from '@jeromefitz/shared/src/utils' import * as DropdownMenu from '@radix-ui/react-dropdown-menu' import { AnimatePresence, motion, useAnimationControls } from 'framer-motion' import { ReactNode, useEffect, useState } from 'react' -import { cx } from '~utils/cx' // import { sleep } from '~utils/sleep' function Item({ diff --git a/sites/jeromefitzgerald.com/src/ui/NavigationBar/NavigationBar.tsx b/sites/jeromefitzgerald.com/src/ui/NavigationBar/NavigationBar.tsx index 1a6d9b142..3b67b0612 100644 --- a/sites/jeromefitzgerald.com/src/ui/NavigationBar/NavigationBar.tsx +++ b/sites/jeromefitzgerald.com/src/ui/NavigationBar/NavigationBar.tsx @@ -1,5 +1,6 @@ 'use client' +import { cx } from '@jeromefitz/shared/src/utils' import { HomeIcon } from '@radix-ui/react-icons' import { motion } from 'framer-motion' import { usePathname } from 'next/navigation' @@ -7,7 +8,6 @@ import { useEffect, useState } from 'react' import { Anchor } from '~components/Anchor' import { useStore } from '~store/useStore' -import { cx } from '~utils/cx' // import { log } from '~utils/log' // const items = ['events', 'shows', 'about', 'currently'] diff --git a/sites/jeromefitzgerald.com/src/ui/PageHeading/PageHeading.tsx b/sites/jeromefitzgerald.com/src/ui/PageHeading/PageHeading.tsx index 9582a8d4c..b301a5db0 100644 --- a/sites/jeromefitzgerald.com/src/ui/PageHeading/PageHeading.tsx +++ b/sites/jeromefitzgerald.com/src/ui/PageHeading/PageHeading.tsx @@ -1,4 +1,4 @@ -import { cx } from '~utils/cx' +import { cx } from '@jeromefitz/shared/src/utils' type PageHeadingProps = { overline: string diff --git a/sites/jeromefitzgerald.com/src/ui/RadioGroup/RadioGroup.tsx b/sites/jeromefitzgerald.com/src/ui/RadioGroup/RadioGroup.tsx index 9084376ef..0e62014ff 100644 --- a/sites/jeromefitzgerald.com/src/ui/RadioGroup/RadioGroup.tsx +++ b/sites/jeromefitzgerald.com/src/ui/RadioGroup/RadioGroup.tsx @@ -1,7 +1,6 @@ +import { cx } from '@jeromefitz/shared/src/utils' import * as RadioGroup from '@radix-ui/react-radio-group' -import { cx } from '~utils/cx' - const RadioGroupDemo = ({ items, label, onValueChange }) => (
    { diff --git a/sites/jeromefitzgerald.com/src/utils/cx.ts b/sites/jeromefitzgerald.com/src/utils/cx.ts deleted file mode 100644 index a503eae8c..000000000 --- a/sites/jeromefitzgerald.com/src/utils/cx.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { ClassValue, clsx } from 'clsx' -import { twMerge } from 'tailwind-merge' - -function cx(...inputs: ClassValue[]) { - return twMerge(clsx(inputs)) -} - -export { cx } diff --git a/sites/test.com/README.md b/sites/test.com/README.md new file mode 100644 index 000000000..b726232a3 --- /dev/null +++ b/sites/test.com/README.md @@ -0,0 +1,41 @@ +# test.com + +## Notion + +### Reduce Route Type Complexity + +Reduce complexity of **Notion** Integration (`@jeromefitz/notion|next-notion`) by using `RSC` (React Server Components) and `Next` App Directory (`next@13.x`). + +- [x] Move away from `./src/pages/api/v1/cms` logic and only use `./src/app/(notion)` +- [x] Move away from `@upstash/redis` cache of `Notion` data and call directly via `@notionhq/client` + +### Improve Notion Data + +Improve `Notion` Properties by introducing **Formulas**. + +- [x] `Slug.Preview`: Create Formula to mimic route in `Next` within `Notion` + - Use this `property` as the basis for any `[[...catchAll]]` + - This removes the need for a complicated `Blog|Event` Date Search + - Also removes the need for a `Slug` and `RouteType` Match Sequence +- [x] Handle `Date.XYZ` formatting at `Notion` level, not `Next` + - `Date.Event|Date.ISO|Date.Showtime|Date.Timezone` +- [x] Add `ID` Formula to have `page_id` within `Properties` without any finagling + +### Improve RSC via Suspense and Notion Relations + +Certain Datapoints we _do not need_ at render. (Example: Upcoming Event Times for a Show.) Move away from `SWR` and continue to migrate fully to `RSC` with `Suspense`. + +For each `Notion` Database / `Next` Routetype, clearly identify which `fetch` calls need to be blocking (SEO, Content [X Blocks], etc.) and which do not. + +### Improve Notion Blocks + +Since we are moving away from an intricate normalizer and looking to fully utilize the `@notionhq/client` responses (with types) we can move away from `node.node` based rendering and stick to strict `React`. + +#### TextAnnotations => Links + +As we move away from complex route logic in favor of the `Notion` formula `Slug.Preview` we can handle 3 types of links: + +- [x] External: Any `http` link that is not the Website itself +- [x] Internal Rewrite: Any `http` link that is a mask of the Website itself +- [x] Notion Rewrite: For any `Notion` link we can pull teh `Slug.Preview` from the `page_id` referenced and create the `Next` Dynamic Link. + - This is paramount to have a Notion site and Next site that function similiarly diff --git a/sites/test.com/next-env.d.ts b/sites/test.com/next-env.d.ts new file mode 100644 index 000000000..4f11a03dc --- /dev/null +++ b/sites/test.com/next-env.d.ts @@ -0,0 +1,5 @@ +/// +/// + +// NOTE: This file should not be edited +// see https://nextjs.org/docs/basic-features/typescript for more information. diff --git a/sites/test.com/next.config.js b/sites/test.com/next.config.js new file mode 100644 index 000000000..534bc6d2a --- /dev/null +++ b/sites/test.com/next.config.js @@ -0,0 +1,24 @@ +const path = require('path') + +const isCI = require('is-ci') +!isCI && require('dotenv').config({ path: './.env' }) + +const buildInfoConfig = { + owner: 'jeromefitz', + repo: 'jeromefitzgerald.com', +} + +const serverComponentsExternalPackages = [ + '@jeromefitz/notion', + '@notionhq/client', + 'plaiceholder', +] +const transpilePackages = ['@jeromefitz/shared', 'next-notion'] + +module.exports = require('@jeromefitz/next-config')({ + basePath: '', + buildInfoConfig, + pathDirName: path.join(__dirname), + serverComponentsExternalPackages, + transpilePackages, +}) diff --git a/sites/test.com/package.json b/sites/test.com/package.json new file mode 100644 index 000000000..322a94cb8 --- /dev/null +++ b/sites/test.com/package.json @@ -0,0 +1,164 @@ +{ + "name": "test.com", + "version": "0.0.0", + "description": "Website for Jerome Fitzgerald (he/him).", + "repository": "jeromefitz/websites.git", + "author": { + "name": "Jerome Fitzgerald", + "email": "j@jeromefitzgerald.com", + "url": "https://jeromefitzgerald.com" + }, + "license": "MIT", + "scripts": { + "analyze": "ANALYZE=true pnpm build", + "build": "CI=1 next build && pnpm postbuild", + "build:css": "tailwindcss ./src/app/globals.css --output ./src/app/output.css && next build", + "clean": "rm -rf ./.lighthouseci ./.next ./.turbo ./coverage ./e2e-report ./e2e-results ./storybook-static", + "clean:install": "pnpm clean && rm -rf ./.cache ./node_modules", + "copy": "echo mkdir -p ./dist && ./scripts/copy.sh", + "dev": "next dev", + "dev:css": "concurrently \"next dev\" \"tailwindcss --input ./src/styles/globals.css --output ./src/styles/output.css --watch\"", + "dev:turbo": "next dev --turbo", + "format": "pnpm run format:lint", + "format:lint": "pnpm lint:eslint --fix", + "lhci": "lhci autorun --config=lighthouse.config.js", + "lint": "concurrently \"pnpm run lint:eslint\" \"pnpm run lint:typescript:dev\"", + "lint:eslint": "eslint ./src --ext cjs,js,jsx,mjs,ts,tsx --max-warnings=0", + "lint:typescript": "tsc --noEmit --declaration", + "lint:typescript:dev": "pnpm run lint:typescript -p ./tsconfig.dev.json", + "lint:typescript:prod": "pnpm run lint:typescript -p ./tsconfig.prod.json", + "postbuild": "next-sitemap --config next.sitemap.js", + "semantic-release": "semantic-release", + "start": "next start", + "start:isr": "next start -H localhost", + "storybook:build": "storybook build", + "storybook:dev": "storybook dev --quiet --port 6002", + "test:e2e": "playwright test", + "test:unit": "jest --ci --coverage", + "test:watch": "jest --watch", + "unused": "pnpm next-unused" + }, + "dependencies": { + "@heroicons/react": "2.0.17", + "@jeromefitz/design-system": "4.2.1", + "@jeromefitz/notion": "4.0.5", + "@jeromefitz/spotify": "3.0.3", + "@jeromefitz/utils": "2.2.2", + "@mantine/hooks": "6.0.10", + "@notionhq/client": "2.2.5", + "@radix-ui/primitive": "1.0.0", + "@radix-ui/react-accessible-icon": "1.0.2", + "@radix-ui/react-accordion": "1.1.1", + "@radix-ui/react-alert-dialog": "1.0.3", + "@radix-ui/react-announce": "0.1.7", + "@radix-ui/react-arrow": "1.0.2", + "@radix-ui/react-aspect-ratio": "1.0.2", + "@radix-ui/react-avatar": "1.0.2", + "@radix-ui/react-checkbox": "1.0.3", + "@radix-ui/react-collapsible": "1.0.2", + "@radix-ui/react-collection": "1.0.2", + "@radix-ui/react-compose-refs": "1.0.0", + "@radix-ui/react-context": "1.0.0", + "@radix-ui/react-context-menu": "2.1.3", + "@radix-ui/react-dialog": "1.0.3", + "@radix-ui/react-direction": "1.0.0", + "@radix-ui/react-dismissable-layer": "1.0.3", + "@radix-ui/react-dropdown-menu": "2.0.4", + "@radix-ui/react-focus-guards": "1.0.0", + "@radix-ui/react-focus-scope": "1.0.2", + "@radix-ui/react-hover-card": "1.0.5", + "@radix-ui/react-icons": "1.3.0", + "@radix-ui/react-id": "1.0.0", + "@radix-ui/react-label": "2.0.1", + "@radix-ui/react-menu": "2.0.4", + "@radix-ui/react-navigation-menu": "1.1.2", + "@radix-ui/react-popover": "1.0.5", + "@radix-ui/react-popper": "1.1.1", + "@radix-ui/react-portal": "1.0.2", + "@radix-ui/react-presence": "1.0.0", + "@radix-ui/react-primitive": "1.0.2", + "@radix-ui/react-progress": "1.0.2", + "@radix-ui/react-radio-group": "1.1.2", + "@radix-ui/react-roving-focus": "1.0.3", + "@radix-ui/react-scroll-area": "1.0.3", + "@radix-ui/react-select": "1.2.1", + "@radix-ui/react-separator": "1.0.2", + "@radix-ui/react-slider": "1.1.1", + "@radix-ui/react-slot": "1.0.1", + "@radix-ui/react-switch": "1.0.2", + "@radix-ui/react-tabs": "1.0.3", + "@radix-ui/react-toast": "1.1.3", + "@radix-ui/react-toggle": "1.0.2", + "@radix-ui/react-toggle-group": "1.0.3", + "@radix-ui/react-toolbar": "1.0.3", + "@radix-ui/react-tooltip": "1.0.5", + "@radix-ui/react-use-callback-ref": "1.0.0", + "@radix-ui/react-use-controllable-state": "1.0.0", + "@radix-ui/react-use-escape-keydown": "1.0.2", + "@radix-ui/react-use-layout-effect": "1.0.0", + "@radix-ui/react-use-previous": "1.0.0", + "@radix-ui/react-use-rect": "1.0.0", + "@radix-ui/react-use-size": "1.0.0", + "@radix-ui/react-visually-hidden": "1.0.2", + "@tanem/react-nprogress": "5.0.37", + "@upstash/ratelimit": "0.4.2", + "@upstash/redis": "1.20.6", + "@vercel/analytics": "1.0.1", + "@vercel/og": "0.5.4", + "clsx": "1.2.1", + "cmdk": "0.2.0", + "date-fns": "2.30.0", + "date-fns-tz": "2.0.0", + "fast-json-stable-stringify": "2.1.0", + "fathom-client": "3.5.0", + "focus-trap-react": "10.1.1", + "framer-motion": "10.12.8", + "github-slugger": "2.0.0", + "immer": "10.0.1", + "ioredis": "5.3.2", + "isomorphic-unfetch": "4.0.2", + "ms": "3.0.0-canary.1", + "next": "13.4.1", + "next-sitemap": "4.0.9", + "next-themes": "0.2.1", + "plaiceholder": "2.5.0", + "pluralize": "8.0.0", + "podcast": "2.0.1", + "ramda": "0.29.0", + "react": "18.2.0", + "react-dom": "18.2.0", + "react-swipeable": "7.0.0", + "react-use": "17.4.0", + "react-wrap-balancer": "0.4.1", + "server-only": "0.0.1", + "sharp": "0.32.1", + "smoothscroll-polyfill": "0.4.4", + "swr": "2.1.5", + "title": "3.5.3", + "ts-node": "10.9.1", + "use-sound": "4.0.1", + "uuid": "9.0.0", + "zod": "3.21.4", + "zustand": "4.3.8" + }, + "devDependencies": { + "@jeromefitz/jest-config": "workspace:*", + "@jeromefitz/lighthouse-config": "workspace:*", + "@jeromefitz/next-config": "workspace:*", + "@jeromefitz/playwright-config": "workspace:*", + "@jeromefitz/shared": "workspace:*", + "@jeromefitz/storybook-config": "workspace:*", + "@jeromefitz/tailwind-config": "workspace:*", + "@jeromefitz/tsconfig": "1.1.3", + "@types/ms": "0.7.31", + "@types/pluralize": "0.0.29", + "@types/ramda": "0.29.1", + "@types/react": "18.2.6", + "@types/react-dom": "18.2.4", + "@types/title": "3.4.1", + "@types/uuid": "9.0.1", + "next-notion": "workspace:*", + "next-unused": "0.0.6", + "tailwind-merge": "1.12.0" + } +} diff --git a/sites/test.com/postcss.config.js b/sites/test.com/postcss.config.js new file mode 100644 index 000000000..c208749da --- /dev/null +++ b/sites/test.com/postcss.config.js @@ -0,0 +1 @@ +module.exports = require('@jeromefitz/tailwind-config/postcss.config') diff --git a/sites/test.com/public/static/fonts/inter/inter-var-full.woff2 b/sites/test.com/public/static/fonts/inter/inter-var-full.woff2 new file mode 100644 index 000000000..2ca20a4f1 Binary files /dev/null and b/sites/test.com/public/static/fonts/inter/inter-var-full.woff2 differ diff --git a/sites/test.com/public/static/fonts/inter/inter-var-italic.woff2 b/sites/test.com/public/static/fonts/inter/inter-var-italic.woff2 new file mode 100644 index 000000000..3c3adc138 Binary files /dev/null and b/sites/test.com/public/static/fonts/inter/inter-var-italic.woff2 differ diff --git a/sites/test.com/public/static/fonts/inter/inter-var-latin.woff2 b/sites/test.com/public/static/fonts/inter/inter-var-latin.woff2 new file mode 100644 index 000000000..5aafd8929 Binary files /dev/null and b/sites/test.com/public/static/fonts/inter/inter-var-latin.woff2 differ diff --git a/sites/test.com/public/static/fonts/inter/inter-var.woff2 b/sites/test.com/public/static/fonts/inter/inter-var.woff2 new file mode 100644 index 000000000..5aafd8929 Binary files /dev/null and b/sites/test.com/public/static/fonts/inter/inter-var.woff2 differ diff --git a/sites/test.com/src/app/(notion)/(utils)/Notion.types.ts b/sites/test.com/src/app/(notion)/(utils)/Notion.types.ts new file mode 100644 index 000000000..73744ec01 --- /dev/null +++ b/sites/test.com/src/app/(notion)/(utils)/Notion.types.ts @@ -0,0 +1,86 @@ +import type { + BlockObjectResponse, + PartialUserObjectResponse, +} from '@notionhq/client/build/src/api-endpoints' + +/** + * @note(typescript) we need to take over the Notion returns + * @ref: + */ +type OptionalPropertyNames = { + [K in keyof T]-?: object extends { [P in K]: T[K] } ? K : never +}[keyof T] + +type SpreadProperties = { + [P in K]: L[P] | Exclude +} + +type Id = T extends infer U ? { [K in keyof U]: U[K] } : never + +type SpreadTwo = Id< + Pick> & + Pick>> & + Pick, keyof L>> & + SpreadProperties & keyof L> +> + +type Spread = A extends [infer L, ...infer R] + ? SpreadTwo> + : unknown +/** + * + */ +type Direction = 'ascending' | 'descending' +type SortItem = { + property: string + direction: Direction +} +type FilterType = + | 'equals' + | 'does_not_equal' + | 'contains' + | 'does_not_contain' + | 'starts_with' + | 'ends_with' + +type BulletedListBlockObjectResponse = { + type: 'bulleted_list' + bulleted_list: any + parent: + | { type: 'database_id'; database_id: string } + | { type: 'page_id'; page_id: string } + | { type: 'block_id'; block_id: string } + | { type: 'workspace'; workspace: true } + object: 'block' + id: string + created_time: string + created_by: PartialUserObjectResponse + last_edited_time: string + last_edited_by: PartialUserObjectResponse + has_children: boolean + archived: boolean +} +type NumberedListBlockObjectResponse = { + type: 'numbered_list' + numbered_list: any + parent: + | { type: 'database_id'; database_id: string } + | { type: 'page_id'; page_id: string } + | { type: 'block_id'; block_id: string } + | { type: 'workspace'; workspace: true } + object: 'block' + id: string + created_time: string + created_by: PartialUserObjectResponse + last_edited_time: string + last_edited_by: PartialUserObjectResponse + has_children: boolean + archived: boolean +} + +type BlockObjectResponseCustom = + | BlockObjectResponse + | BulletedListBlockObjectResponse + | NumberedListBlockObjectResponse + +export type { BlockObjectResponseCustom, Direction, FilterType, SortItem, Spread } diff --git a/sites/test.com/src/app/(notion)/(utils)/NotionBlocks.tsx b/sites/test.com/src/app/(notion)/(utils)/NotionBlocks.tsx new file mode 100644 index 000000000..a88783860 --- /dev/null +++ b/sites/test.com/src/app/(notion)/(utils)/NotionBlocks.tsx @@ -0,0 +1,57 @@ +import type { ListBlockChildrenResponse } from '@notionhq/client/build/src/api-endpoints' +import { lazy, Suspense } from 'react' + +import type { BlockObjectResponseCustom } from './Notion.types' + +const OBJECTS = { LIST: 'list' } +const TYPES = { BLOCK: 'block', CHILD_PAGE: 'child_page' } + +/** + * @note(react) do not think this actually helps anything to be honest + * same with Suspense over 10 Blocks :/ + */ +const NOTION_TO_REACT_MAP = { + bulleted_list: lazy(() => import('./blocks/ListBulleted')), + callout: lazy(() => import('./blocks/Callout')), + column_list: lazy(() => import('./blocks/ColumnList')), + divider: lazy(() => import('./blocks/Divider')), + heading_1: lazy(() => import('./blocks/Heading1')), + heading_2: lazy(() => import('./blocks/Heading2')), + heading_3: lazy(() => import('./blocks/Heading3')), + image: lazy(() => import('./blocks/Image')), + numbered_list: lazy(() => import('./blocks/ListNumbered')), + paragraph: lazy(() => import('./blocks/Paragraph')), + quote: lazy(() => import('./blocks/Quote')), +} + +function NotionBlocks({ data }: { data: ListBlockChildrenResponse }) { + const { object, type, results } = data + const isListBlock = object === OBJECTS.LIST && type === TYPES.BLOCK + if (!isListBlock) { + console.dir(`⚠️ Throw Error: NotionBlocks`) + return null + } + + return ( + <> + {!!results && + results.map((block: BlockObjectResponseCustom, i) => { + const Component = NOTION_TO_REACT_MAP[block.type] + if (!Component) { + console.dir(`>> unsupported: ${block.type} (${block.id})`) + return null + } + if (i > 10) { + return ( + Loading...

    }> + +
    + ) + } + return + })} + + ) +} + +export { NotionBlocks } diff --git a/sites/test.com/src/app/(notion)/(utils)/blocks/Callout.tsx b/sites/test.com/src/app/(notion)/(utils)/blocks/Callout.tsx new file mode 100644 index 000000000..4632e7d6c --- /dev/null +++ b/sites/test.com/src/app/(notion)/(utils)/blocks/Callout.tsx @@ -0,0 +1,15 @@ +import { Callout } from '@jeromefitz/ds/ui/blocks/index' +import type { BlockObjectResponse } from '@notionhq/client/build/src/api-endpoints' + +import { TextAnnotations } from './TextAnnotations' + +function CalloutImpl({ block }: { block: BlockObjectResponse }) { + return ( + + + + ) +} + +export { CalloutImpl as Callout } +export default CalloutImpl diff --git a/sites/test.com/src/app/(notion)/(utils)/blocks/Column.tsx b/sites/test.com/src/app/(notion)/(utils)/blocks/Column.tsx new file mode 100644 index 000000000..9d07db03e --- /dev/null +++ b/sites/test.com/src/app/(notion)/(utils)/blocks/Column.tsx @@ -0,0 +1,16 @@ +import { Column } from '@jeromefitz/ds/ui/blocks/index' +import type { BlockObjectResponse } from '@notionhq/client/build/src/api-endpoints' + +import { NotionBlocks } from '../NotionBlocks' +import { getBlockChildrenDataParent } from '../queries/index' + +async function ColumnImpl({ block }: { block: BlockObjectResponse }) { + const data = await getBlockChildrenDataParent(block.id) + return ( + + {!!data?.results && } + + ) +} + +export { ColumnImpl as Column } diff --git a/sites/test.com/src/app/(notion)/(utils)/blocks/ColumnList.tsx b/sites/test.com/src/app/(notion)/(utils)/blocks/ColumnList.tsx new file mode 100644 index 000000000..cc257e1c4 --- /dev/null +++ b/sites/test.com/src/app/(notion)/(utils)/blocks/ColumnList.tsx @@ -0,0 +1,21 @@ +import { ColumnList } from '@jeromefitz/ds/ui/blocks/index' +import type { BlockObjectResponse } from '@notionhq/client/build/src/api-endpoints' + +import { Column } from './Column' + +function ColumnListImpl({ block }: { block: BlockObjectResponse }) { + if (!block[block.type][block.type]) return null + const { results } = block[block.type][block.type] + return ( + + {!!results && + results.map((data, i) => { + // @ts-expect-error Async Server Component + return + })} + + ) +} + +export { ColumnListImpl as ColumnList } +export default ColumnListImpl diff --git a/sites/test.com/src/app/(notion)/(utils)/blocks/Divider.tsx b/sites/test.com/src/app/(notion)/(utils)/blocks/Divider.tsx new file mode 100644 index 000000000..8111176b7 --- /dev/null +++ b/sites/test.com/src/app/(notion)/(utils)/blocks/Divider.tsx @@ -0,0 +1,10 @@ +import { Divider } from '@jeromefitz/ds/ui/blocks/index' +import type { BlockObjectResponse } from '@notionhq/client/build/src/api-endpoints' + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function DividerImpl({ block }: { block: BlockObjectResponse }) { + return +} + +export { DividerImpl as Divider } +export default DividerImpl diff --git a/sites/test.com/src/app/(notion)/(utils)/blocks/Heading1.tsx b/sites/test.com/src/app/(notion)/(utils)/blocks/Heading1.tsx new file mode 100644 index 000000000..28863e5b3 --- /dev/null +++ b/sites/test.com/src/app/(notion)/(utils)/blocks/Heading1.tsx @@ -0,0 +1,19 @@ +import { Heading1 } from '@jeromefitz/ds/ui/blocks/index' +import type { BlockObjectResponse } from '@notionhq/client/build/src/api-endpoints' + +import { TextAnnotations } from './TextAnnotations' + +/** + * @note(notion) PageHeader, previous to Notion Content is H1 + * => All Headings from Notion are bumped up by 1 as a result. + */ +function Heading1Impl({ block }: { block: BlockObjectResponse }) { + return ( + + + + ) +} + +export { Heading1Impl as Heading1 } +export default Heading1Impl diff --git a/sites/test.com/src/app/(notion)/(utils)/blocks/Heading2.tsx b/sites/test.com/src/app/(notion)/(utils)/blocks/Heading2.tsx new file mode 100644 index 000000000..44e2d6f39 --- /dev/null +++ b/sites/test.com/src/app/(notion)/(utils)/blocks/Heading2.tsx @@ -0,0 +1,18 @@ +import { Heading2 } from '@jeromefitz/ds/ui/blocks/index' +import type { BlockObjectResponse } from '@notionhq/client/build/src/api-endpoints' + +import { TextAnnotations } from './TextAnnotations' +/** + * @note(notion) PageHeader, previous to Notion Content is H1 + * => All Headings from Notion are bumped up by 1 as a result. + */ +function Heading2Impl({ block }: { block: BlockObjectResponse }) { + return ( + + + + ) +} + +export { Heading2Impl as Heading2 } +export default Heading2Impl diff --git a/sites/test.com/src/app/(notion)/(utils)/blocks/Heading3.tsx b/sites/test.com/src/app/(notion)/(utils)/blocks/Heading3.tsx new file mode 100644 index 000000000..bb5ea6a07 --- /dev/null +++ b/sites/test.com/src/app/(notion)/(utils)/blocks/Heading3.tsx @@ -0,0 +1,15 @@ +import { Heading3 } from '@jeromefitz/ds/ui/blocks/index' +import type { BlockObjectResponse } from '@notionhq/client/build/src/api-endpoints' + +import { TextAnnotations } from './TextAnnotations' + +function Heading3Impl({ block }: { block: BlockObjectResponse }) { + return ( + + + + ) +} + +export { Heading3Impl as Heading3 } +export default Heading3Impl diff --git a/sites/test.com/src/app/(notion)/(utils)/blocks/Image.tsx b/sites/test.com/src/app/(notion)/(utils)/blocks/Image.tsx new file mode 100644 index 000000000..186ae53af --- /dev/null +++ b/sites/test.com/src/app/(notion)/(utils)/blocks/Image.tsx @@ -0,0 +1,11 @@ +// import { Image } from '@jeromefitz/ds/ui/blocks/index' +import type { BlockObjectResponse } from '@notionhq/client/build/src/api-endpoints' + +function ImageImpl({ block }: { block: BlockObjectResponse }) { + // console.dir(`> ImageImpl`) + // console.dir(block) + return <> +} + +export { ImageImpl as Image } +export default ImageImpl diff --git a/sites/test.com/src/app/(notion)/(utils)/blocks/Link.tsx b/sites/test.com/src/app/(notion)/(utils)/blocks/Link.tsx new file mode 100644 index 000000000..09e1b3e4d --- /dev/null +++ b/sites/test.com/src/app/(notion)/(utils)/blocks/Link.tsx @@ -0,0 +1,46 @@ +import { ExternalLinkIcon as ExternalLink } from '@jeromefitz/ds/components/Icon' +import NextLink from 'next/link' + +import { cx } from '@jeromefitz/shared/src/utils' + +// const fetcher = (url) => fetch(url).then((r) => r.json()) +const nextSeo = { url: `https://${process.env.NEXT_PUBLIC__SITE}` } +const domain = new URL(nextSeo.url) + +const Link = ({ className, href, plain_text }) => { + const isExternal = !href.includes(domain.hostname.replace('www.', '')) + const isNotion = !href.includes('http') + + const styles = cx( + className, + 'inline-flex flex-row items-center gap-1', + 'underline-offset-4', + 'underline', + // 'decoration-radix-mauve4 hover:decoration-radix-mauve5', + // 'text-radix-mauve11 hover:text-radix-mauve12', + 'transition-all duration-200 ease-in', + '' + ) + + if (isExternal && !isNotion) { + return ( +
    + <>{plain_text} + + + ) + } + + if (!href) return null + + const _href = href.replace(nextSeo.url, '') + const props = { + className: styles, + href: _href === '' ? '/' : _href, + } + + return {plain_text} +} + +export { Link } +export default Link diff --git a/sites/test.com/src/app/(notion)/(utils)/blocks/ListBulleted.tsx b/sites/test.com/src/app/(notion)/(utils)/blocks/ListBulleted.tsx new file mode 100644 index 000000000..79fe324c4 --- /dev/null +++ b/sites/test.com/src/app/(notion)/(utils)/blocks/ListBulleted.tsx @@ -0,0 +1,18 @@ +import { ListBulleted } from '@jeromefitz/ds/ui/blocks/index' + +import type { BlockObjectResponseCustom } from '../Notion.types' + +import { ListItem } from './ListItem' + +function ListBulletedImpl({ block }: { block: BlockObjectResponseCustom }) { + return ( + + {block[block.type][block.type].map((item) => { + return + })} + + ) +} + +export { ListBulletedImpl as ListBulleted } +export default ListBulletedImpl diff --git a/sites/test.com/src/app/(notion)/(utils)/blocks/ListItem.tsx b/sites/test.com/src/app/(notion)/(utils)/blocks/ListItem.tsx new file mode 100644 index 000000000..9ef78f406 --- /dev/null +++ b/sites/test.com/src/app/(notion)/(utils)/blocks/ListItem.tsx @@ -0,0 +1,15 @@ +import { ListItem } from '@jeromefitz/ds/ui/blocks/index' +import type { BlockObjectResponse } from '@notionhq/client/build/src/api-endpoints' + +import { TextAnnotations } from './TextAnnotations' + +function ListItemImpl({ block }: { block: BlockObjectResponse }) { + return ( + + + + ) +} + +export { ListItemImpl as ListItem } +export default ListItemImpl diff --git a/sites/test.com/src/app/(notion)/(utils)/blocks/ListNumbered.tsx b/sites/test.com/src/app/(notion)/(utils)/blocks/ListNumbered.tsx new file mode 100644 index 000000000..9fb222d8a --- /dev/null +++ b/sites/test.com/src/app/(notion)/(utils)/blocks/ListNumbered.tsx @@ -0,0 +1,18 @@ +import { ListNumbered } from '@jeromefitz/ds/ui/blocks/index' + +import type { BlockObjectResponseCustom } from '../Notion.types' + +import { ListItem } from './ListItem' + +function ListNumberedImpl({ block }: { block: BlockObjectResponseCustom }) { + return ( + + {block[block.type][block.type].map((item) => { + return + })} + + ) +} + +export { ListNumberedImpl as ListNumbered } +export default ListNumberedImpl diff --git a/sites/test.com/src/app/(notion)/(utils)/blocks/Paragraph.tsx b/sites/test.com/src/app/(notion)/(utils)/blocks/Paragraph.tsx new file mode 100644 index 000000000..7eac94bc3 --- /dev/null +++ b/sites/test.com/src/app/(notion)/(utils)/blocks/Paragraph.tsx @@ -0,0 +1,15 @@ +import { Paragraph } from '@jeromefitz/ds/ui/blocks/index' +import type { BlockObjectResponse } from '@notionhq/client/build/src/api-endpoints' + +import { TextAnnotations } from './TextAnnotations' + +function ParagraphImpl({ block }: { block: BlockObjectResponse }) { + return ( + + + + ) +} + +export { ParagraphImpl as Paragraph } +export default ParagraphImpl diff --git a/sites/test.com/src/app/(notion)/(utils)/blocks/Quote.tsx b/sites/test.com/src/app/(notion)/(utils)/blocks/Quote.tsx new file mode 100644 index 000000000..679ad8f7e --- /dev/null +++ b/sites/test.com/src/app/(notion)/(utils)/blocks/Quote.tsx @@ -0,0 +1,15 @@ +import { Quote } from '@jeromefitz/ds/ui/blocks/index' +import type { BlockObjectResponse } from '@notionhq/client/build/src/api-endpoints' + +import { TextAnnotations } from './TextAnnotations' + +function QuoteImpl({ block }: { block: BlockObjectResponse }) { + return ( + + + + ) +} + +export { QuoteImpl as Quote } +export default QuoteImpl diff --git a/sites/test.com/src/app/(notion)/(utils)/blocks/TextAnnotations.tsx b/sites/test.com/src/app/(notion)/(utils)/blocks/TextAnnotations.tsx new file mode 100644 index 000000000..b5c185be7 --- /dev/null +++ b/sites/test.com/src/app/(notion)/(utils)/blocks/TextAnnotations.tsx @@ -0,0 +1,63 @@ +import { cx } from '@jeromefitz/shared/src/utils' +import type { + BlockObjectResponse, + TextRichTextItemResponse, +} from '@notionhq/client/build/src/api-endpoints' + +import { getPageData } from '../queries/index' + +import { Link } from './Link' + +function TextAnnotations({ block }: { block: BlockObjectResponse }) { + const key = `${block.id}-${block.type}` + const { rich_text } = block[block.type] + + return ( + <> + {/* eslint-disable-next-line complexity */} + {rich_text.map(async (rt: TextRichTextItemResponse, i) => { + const { annotations, href, plain_text } = rt + const { bold, code, color, italic, strikethrough, underline } = annotations + const props = { + className: cx( + code && 'font-mono', + italic && 'italic', + bold && 'font-bold', + strikethrough && 'line-through', + underline && 'underline', + color === 'default' ? '' : `notion-${color}`, + 'break-words', + '' + ), + href: '', + plain_text, + } + + const isInternalToNotion = !!href && !href?.includes('http') + + if (!!href && !isInternalToNotion) { + props['href'] = href + return + } + + if (isInternalToNotion) { + // @todo(types) data + const data: any = await getPageData(href.replace('/', '')) + props['href'] = + data.properties['Slug.Preview'].formula[ + data.properties['Slug.Preview'].formula.type + ] + return + } + return ( + + {plain_text} + + ) + })} + + ) +} + +export { TextAnnotations } +export default TextAnnotations diff --git a/sites/test.com/src/app/(notion)/(utils)/blocks/index.ts b/sites/test.com/src/app/(notion)/(utils)/blocks/index.ts new file mode 100644 index 000000000..eac3368ed --- /dev/null +++ b/sites/test.com/src/app/(notion)/(utils)/blocks/index.ts @@ -0,0 +1,14 @@ +export { Callout } from './Callout' +export { Column } from './Column' +export { ColumnList } from './ColumnList' +export { Divider } from './Divider' +export { Heading1 } from './Heading1' +export { Heading2 } from './Heading2' +export { Heading3 } from './Heading3' +export { Link } from './Link' +export { ListBulleted } from './ListBulleted' +export { ListItem } from './ListItem' +export { ListNumbered } from './ListNumbered' +export { Paragraph } from './Paragraph' +export { Quote } from './Quote' +export { TextAnnotations } from './TextAnnotations' diff --git a/sites/test.com/src/app/(notion)/(utils)/queries/getBlockChildrenData.ts b/sites/test.com/src/app/(notion)/(utils)/queries/getBlockChildrenData.ts new file mode 100644 index 000000000..d6f7d4919 --- /dev/null +++ b/sites/test.com/src/app/(notion)/(utils)/queries/getBlockChildrenData.ts @@ -0,0 +1,13 @@ +import { Client } from '@notionhq/client' + +const notion = new Client({ auth: process.env.NOTION_API_KEY }) + +async function getBlockChildrenData(block_id) { + const response = await notion.blocks.children.list({ + block_id, + page_size: 100, // max + }) + return response +} + +export { getBlockChildrenData } diff --git a/sites/test.com/src/app/(notion)/(utils)/queries/getBlockChildrenDataParent.ts b/sites/test.com/src/app/(notion)/(utils)/queries/getBlockChildrenDataParent.ts new file mode 100644 index 000000000..e16516780 --- /dev/null +++ b/sites/test.com/src/app/(notion)/(utils)/queries/getBlockChildrenDataParent.ts @@ -0,0 +1,88 @@ +import { asyncForEach } from '@jeromefitz/utils' +import type { BlockObjectResponse } from '@notionhq/client/build/src/api-endpoints' +import _noop from 'lodash/noop' + +import { getBlockChildrenData } from './getBlockChildrenData' +import { getColumnData } from './getColumnData' + +async function getBlockChildrenDataParent(block_id) { + const response = await getBlockChildrenData(block_id) + + let isListItemStart = false, + isListItemType = '', + isListItemId = '' + const blocks: any = [] + + // response.results.map(async (block: BlockObjectResponse, i) => { + // eslint-disable-next-line complexity + await asyncForEach(response.results, async (block: BlockObjectResponse) => { + // console.dir(`asyncForEach: ${block.type}`) + /** + * LIST ITEMS + */ + if ( + !isListItemStart && + (block.type === 'bulleted_list_item' || block.type === 'numbered_list_item') + ) { + isListItemStart = true + isListItemType = block.type + isListItemId = block.id + + const listItemType = + block.type === 'bulleted_list_item' ? 'bulleted_list' : 'numbered_list' + blocks.push({ + object: 'block', + id: isListItemId, + parent: block.parent, + created_time: block.created_time, + last_edited_time: block.last_edited_time, + created_by: block.created_by, + last_edited_by: block.last_edited_time, + has_children: true, + archived: false, + type: listItemType, + [listItemType]: { [listItemType]: [] }, + }) + } + if (isListItemStart && block.type === isListItemType) { + const listItemType = + block.type === 'bulleted_list_item' ? 'bulleted_list' : 'numbered_list' + const temp = blocks.pop() + temp[listItemType][listItemType].push(block) + blocks.push(temp) + } + if (isListItemStart && block.type !== isListItemType) { + isListItemStart = false + isListItemType = '' + isListItemId = '' + } + + /** + * COLUMNS + */ + // @todo(notion) or `has_children===true` ?? + if (block.type === 'column_list') { + const columnListChildrenData: any = await getBlockChildrenData(block.id) + const columnListData = await getColumnData(columnListChildrenData) + const columnList = { + ...block, + column_list: { ...columnListData }, + } + await blocks.push(columnList) + } + + /** + * EVERYTHING ELSE + */ + if (!isListItemStart) { + await blocks.push(block) + } + }).catch(_noop) + + return { + ...response, + results: blocks, + } +} + +export { getBlockChildrenDataParent } diff --git a/sites/test.com/src/app/(notion)/(utils)/queries/getColumnData.ts b/sites/test.com/src/app/(notion)/(utils)/queries/getColumnData.ts new file mode 100644 index 000000000..8da8fb561 --- /dev/null +++ b/sites/test.com/src/app/(notion)/(utils)/queries/getColumnData.ts @@ -0,0 +1,25 @@ +import { asyncForEach } from '@jeromefitz/utils' +import _noop from 'lodash/noop' + +import { getBlockChildrenData } from './getBlockChildrenData' + +async function getColumnData(columnListData) { + const columnResults: any = [] + await asyncForEach(columnListData.results, async (columnData: any) => { + const columnDataColumn = await getBlockChildrenData(columnData.id) + const column = { + ...columnData, + columnDataColumn, + } + columnResults.push(column) + }).catch(_noop) + const columnList = { + column_list: { + ...columnListData, + results: columnResults, + }, + } + return columnList +} + +export { getColumnData } diff --git a/sites/test.com/src/app/(notion)/(utils)/queries/getDatabaseQuery.ts b/sites/test.com/src/app/(notion)/(utils)/queries/getDatabaseQuery.ts new file mode 100644 index 000000000..cc03d53ab --- /dev/null +++ b/sites/test.com/src/app/(notion)/(utils)/queries/getDatabaseQuery.ts @@ -0,0 +1,142 @@ +/* eslint-disable @typescript-eslint/no-unused-vars */ +import { Client } from '@notionhq/client' +import { addDays, format } from 'date-fns' + +const notion = new Client({ auth: process.env.NOTION_API_KEY }) + +import type { FilterType, SortItem } from '../Notion.types' + +const DATABASE_ID = process.env.NOTION__DATABASE__PAGES ?? '' + +type GetDatabaseQueryTypes = { + database_id?: string + filterType?: FilterType + sortProperty?: SortItem + slug: string +} + +async function getDatabaseQuery({ + database_id, + filterType = 'equals', + sortProperty, + slug, +}: GetDatabaseQueryTypes) { + const filterData = { + and: [ + { + property: 'Slug.Preview', + rich_text: { + [filterType]: slug, + }, + }, + // @todo(next) if PREVIEW remove this + // { + // property: 'Is.Published', + // checkbox: { + // equals: true, + // }, + // }, + ], + } + + const sortsData: SortItem[] = [] + // const sortsData: SortItem[] = [ + // { + // property: 'Date.Event', + // direction: 'descending', + // }, + // ] + + const filter = filterData + const sorts = sortsData + + const options = { + database_id: !!database_id ? database_id : DATABASE_ID, + filter, + sorts, + } + + // console.dir(`> options`) + // console.dir(options) + + // @ts-expect-error Property 'is_not_empty' is missing in type + const response = await notion.databases.query(options) + + return response +} + +/** + * @todo(notion) move this to a TYPE of `getDatabaseQuery` + */ +// @todo(types) +const getNotionQueryDatePrepartion = (val, type) => { + const year = val[0] + const month = val[1] + const date = val[2] + const tsPrep = + type === 'from' + ? // eslint-disable-next-line @typescript-eslint/restrict-plus-operands + `${year}-${('00' + month).substr(-2)}-${('00' + date).substr( + -2 + )}T00:00:00.000Z` + : // eslint-disable-next-line @typescript-eslint/restrict-plus-operands + `${year}-${('00' + month).substr(-2)}-${('00' + date).substr( + -2 + )}T23:59:59.999Z` + const tsNew = new Date(tsPrep) + if (type === 'to') { + return format(addDays(tsNew, 1), 'yyyy-MM-dd') + } + return format(tsNew, 'yyyy-MM-dd') +} +async function getDatabaseQueryByDateRange({ + database_id, + filterType = 'equals', + sortProperty, + slug, +}: GetDatabaseQueryTypes) { + const property = 'Date.Event' + // @note(notion) first item is empty + const slugArray = slug.split('/') + const fromArray = slugArray.slice(2, 5) + const toArray = slugArray.slice(6, 9) + const from = getNotionQueryDatePrepartion(fromArray, 'from') + const to = getNotionQueryDatePrepartion(toArray, 'to') + + const filterData = { + and: [ + { + property, + date: { + on_or_after: from, + }, + }, + { + property, + date: { + on_or_before: to, + }, + }, + ], + } + const sortsData: SortItem[] = [ + { + property: 'Date.Event', + direction: 'descending', + }, + ] + const filter = filterData + const sorts = sortsData + + const options = { + database_id: !!database_id ? database_id : DATABASE_ID, + filter, + sorts, + } + + const response = await notion.databases.query(options) + + return response +} + +export { getDatabaseQuery, getDatabaseQueryByDateRange } diff --git a/sites/test.com/src/app/(notion)/(utils)/queries/getPageData.ts b/sites/test.com/src/app/(notion)/(utils)/queries/getPageData.ts new file mode 100644 index 000000000..a6bdb8956 --- /dev/null +++ b/sites/test.com/src/app/(notion)/(utils)/queries/getPageData.ts @@ -0,0 +1,17 @@ +import { Client } from '@notionhq/client' +// import type { GetPageResponse } from '@notionhq/client/build/src/api-endpoints' + +// import type { PageObjectResponseShow } from '../../shows/[[...catchAll]]/Show.types' + +const notion = new Client({ auth: process.env.NOTION_API_KEY }) + +type PageData = any + +async function getPageData(page_id) { + const response: PageData = await notion.pages.retrieve({ + page_id, + }) + return response +} + +export { getPageData } diff --git a/sites/test.com/src/app/(notion)/(utils)/queries/index.ts b/sites/test.com/src/app/(notion)/(utils)/queries/index.ts new file mode 100644 index 000000000..7c30a4b12 --- /dev/null +++ b/sites/test.com/src/app/(notion)/(utils)/queries/index.ts @@ -0,0 +1,5 @@ +export { getBlockChildrenData } from './getBlockChildrenData' +export { getBlockChildrenDataParent } from './getBlockChildrenDataParent' +export { getColumnData } from './getColumnData' +export { getDatabaseQuery, getDatabaseQueryByDateRange } from './getDatabaseQuery' +export { getPageData } from './getPageData' diff --git a/sites/test.com/src/app/(notion)/(utils)/utils/getPropertyTypeData.ts b/sites/test.com/src/app/(notion)/(utils)/utils/getPropertyTypeData.ts new file mode 100644 index 000000000..8ba6b33af --- /dev/null +++ b/sites/test.com/src/app/(notion)/(utils)/utils/getPropertyTypeData.ts @@ -0,0 +1,45 @@ +/** + * @todo(notion) getFormulaData + */ +// function getCalloutData(){} +// function getCheckboxData(){} +// function getChildPageData(){} +// function getFormulaData(){} +// function getImageData(){} +// function getMultiSelectData(){} +// function getRelationData(){} +// function getRollupData(){} +// function getRichTextData(){} // @note(notion) formerly TextAnnotations +// function getSelectData(){} +// function getQuoteData(){} + +function getPropertyTypeData(properties, property) { + const type = properties[property].type + const typeData = properties[property][type] + + const typeDataType = typeData?.type + // let typeDataData + + // if (typeDataType === 'formula') { + // // properties['Slug.Preview'].formula.string + // typeDataData = typeData[typeDataType] + // } + // if (typeDataType === 'relation') { + // // properties['Relation.Shows.Producer'].relation + // typeDataData = typeDataType + // } + // if (typeDataType === 'rich_text') { + // // properties['Slug'].rich_text + // // const returnData = { [typeDataType]: typeDataData } + // return typeDataType + // } + // if (typeDataType === 'select') { + // // properties['Pronouns'].select + // // const returnData = { [typeDataType]: typeDataData } + // return typeDataType?.name + // } + const returnData = { [typeDataType]: typeData[typeDataType] } + return returnData +} + +export { getPropertyTypeData } diff --git a/sites/test.com/src/app/(notion)/(utils)/utils/getSegmentInfo.ts b/sites/test.com/src/app/(notion)/(utils)/utils/getSegmentInfo.ts new file mode 100644 index 000000000..1e5b4cb12 --- /dev/null +++ b/sites/test.com/src/app/(notion)/(utils)/utils/getSegmentInfo.ts @@ -0,0 +1,40 @@ +import _first from 'lodash/first' +import _isInteger from 'lodash/isInteger' +import _last from 'lodash/last' + +const getSegmentInfo = ({ SEGMENT, ...props }) => { + const segment = SEGMENT + const catchAll = [segment] + !!props.params?.catchAll && catchAll.push(...props.params?.catchAll) + + const first: string = _first(catchAll) + const last: string = _last(catchAll) + + const isIndex = first === last || _isInteger(parseInt(last)) + const segmentCount = catchAll.length + const hasMeta = catchAll.length >= 2 + + // // @todo(notion) remove this if possible + // const segmentOptions = {} + // if (segment === 'events') { + // const isDateRange = catchAll.includes('to') + // segmentOptions.isDateRange = isDateRange + // } + + const segmentInfo = { + catchAll, + isIndex, + hasMeta, + segment, + segmentCount, + // segmentOptions, + slug: `/${catchAll.join('/')}`, + } + + // console.dir(`> segmentInfo`) + // console.dir(segmentInfo) + + return segmentInfo +} + +export { getSegmentInfo } diff --git a/sites/test.com/src/app/(notion)/(utils)/utils/getSlugPreview.ts b/sites/test.com/src/app/(notion)/(utils)/utils/getSlugPreview.ts new file mode 100644 index 000000000..cedff1d52 --- /dev/null +++ b/sites/test.com/src/app/(notion)/(utils)/utils/getSlugPreview.ts @@ -0,0 +1,7 @@ +import { getPropertyTypeData } from './getPropertyTypeData' + +function getSlugPreview(properties) { + return getPropertyTypeData(properties, 'Slug.Preview') +} + +export { getPropertyTypeData, getSlugPreview } diff --git a/sites/test.com/src/app/(notion)/(utils)/utils/index.ts b/sites/test.com/src/app/(notion)/(utils)/utils/index.ts new file mode 100644 index 000000000..c9eac1db0 --- /dev/null +++ b/sites/test.com/src/app/(notion)/(utils)/utils/index.ts @@ -0,0 +1,3 @@ +export { getPropertyTypeData } from './getPropertyTypeData' +export { getSegmentInfo } from './getSegmentInfo' +export { getSlugPreview } from './getSlugPreview' diff --git a/sites/test.com/src/app/(notion)/events/[[...catchAll]]/Event.constants.ts b/sites/test.com/src/app/(notion)/events/[[...catchAll]]/Event.constants.ts new file mode 100644 index 000000000..b9e729804 --- /dev/null +++ b/sites/test.com/src/app/(notion)/events/[[...catchAll]]/Event.constants.ts @@ -0,0 +1,4 @@ +const DATABASE_ID = process.env.NOTION__DATABASE__EVENTS ?? '' +const SEGMENT = 'events' + +export { DATABASE_ID, SEGMENT } diff --git a/sites/test.com/src/app/(notion)/events/[[...catchAll]]/Event.tsx b/sites/test.com/src/app/(notion)/events/[[...catchAll]]/Event.tsx new file mode 100644 index 000000000..2476be2b9 --- /dev/null +++ b/sites/test.com/src/app/(notion)/events/[[...catchAll]]/Event.tsx @@ -0,0 +1,57 @@ +import _map from 'lodash/map' +import _size from 'lodash/size' + +import type { PageObjectResponseEvent } from './Event.types' + +const keysToKeep = new Set([ + 'Date.Day', + 'Date.Event', + 'Date.ISO', + 'Date.Showtime', + 'Date.Timezone', + 'ID', + 'Is.Indexed', + 'Is.Published', + 'Override.Slug', + 'Override.Tags', + 'Override.Title', + // 'Payout.Amount', + // 'Payout.Gross.Profit', + // 'Payout.Ticket.Sales', + // 'Relation.People.HouseManager', + // 'Relation.People.Interns', + // 'Relation.People.StageManager', + 'Relation.Shows.Supporting', + 'Rollup.Primary.Slug', + // 'Rollup.Producer', + 'Rollup.Secondary.Tags', + // 'Rollup.Shows.Complexity', + 'Rollup.Shows.Type', + 'Slug.Preview', + 'Stage', + // 'Status', + // 'Tickets.Attended', + 'Title', + 'URL.Ticket', +]) + +function Event({ data }) { + const event: PageObjectResponseEvent = data + const { properties } = event + const result = {} + _map(properties, (value, key) => { + if (keysToKeep.has(key)) { + result[key] = value + } + }) + + return ( + <> +

    + Event ({_size(result)}/{_size(properties)}) +

    + + ) +} + +export { Event } diff --git a/sites/test.com/src/app/(notion)/events/[[...catchAll]]/Event.types.ts b/sites/test.com/src/app/(notion)/events/[[...catchAll]]/Event.types.ts new file mode 100644 index 000000000..aa033487a --- /dev/null +++ b/sites/test.com/src/app/(notion)/events/[[...catchAll]]/Event.types.ts @@ -0,0 +1,54 @@ +import type { + CheckboxPropertyItemObjectResponse, + DatePropertyItemObjectResponse, + FormulaPropertyItemObjectResponse, + MultiSelectPropertyItemObjectResponse, + NumberPropertyItemObjectResponse, + PageObjectResponse, + RelationPropertyItemObjectResponse, + RichTextPropertyItemObjectResponse, + RollupPropertyItemObjectResponse, + SelectPropertyItemObjectResponse, + StatusPropertyItemObjectResponse, + TitlePropertyItemObjectResponse, + UrlPropertyItemObjectResponse, +} from '@notionhq/client/build/src/api-endpoints' + +import type { Spread } from '../../(utils)/Notion.types' + +type EventProperties = { + 'Date.Day': FormulaPropertyItemObjectResponse + 'Date.Event': DatePropertyItemObjectResponse + 'Date.ISO': FormulaPropertyItemObjectResponse + 'Date.Showtime': FormulaPropertyItemObjectResponse + 'Date.Timezone': FormulaPropertyItemObjectResponse + 'Is.Indexed': CheckboxPropertyItemObjectResponse + 'Is.Published': CheckboxPropertyItemObjectResponse + 'Override.Slug': RichTextPropertyItemObjectResponse + 'Override.Tags': MultiSelectPropertyItemObjectResponse + 'Override.Title': CheckboxPropertyItemObjectResponse + 'Payout.Amount': NumberPropertyItemObjectResponse + 'Payout.Gross.Profit': FormulaPropertyItemObjectResponse + 'Payout.Ticket.Sales': NumberPropertyItemObjectResponse + 'Relation.People.HouseManager': RelationPropertyItemObjectResponse + 'Relation.People.Interns': RelationPropertyItemObjectResponse + 'Relation.People.StageManager': RelationPropertyItemObjectResponse + 'Relation.Shows.Supporting': RelationPropertyItemObjectResponse + 'Rollup.Primary.Slug': RollupPropertyItemObjectResponse + 'Rollup.Producer': RollupPropertyItemObjectResponse + 'Rollup.Secondary.Tags': RollupPropertyItemObjectResponse + 'Rollup.Shows.Complexity': RollupPropertyItemObjectResponse + 'Rollup.Shows.Type': RollupPropertyItemObjectResponse + 'Slug.Preview': FormulaPropertyItemObjectResponse + 'Tickets.Attended': NumberPropertyItemObjectResponse + 'URL.Ticket': UrlPropertyItemObjectResponse + ID: FormulaPropertyItemObjectResponse + Stage: SelectPropertyItemObjectResponse + Status: StatusPropertyItemObjectResponse + Title: TitlePropertyItemObjectResponse +} +type PageObjectResponseEvent = Spread< + [PageObjectResponse, { properties: EventProperties }] +> + +export type { PageObjectResponseEvent } diff --git a/sites/test.com/src/app/(notion)/events/[[...catchAll]]/page.tsx b/sites/test.com/src/app/(notion)/events/[[...catchAll]]/page.tsx new file mode 100644 index 000000000..b11cfcda5 --- /dev/null +++ b/sites/test.com/src/app/(notion)/events/[[...catchAll]]/page.tsx @@ -0,0 +1,145 @@ +import type { QueryDatabaseResponse } from '@notionhq/client/build/src/api-endpoints' +import NextLink from 'next/link' + +import { NotionBlocks } from '~app/(notion)/(utils)/NotionBlocks' +import { + getBlockChildrenDataParent, + getDatabaseQuery, + getDatabaseQueryByDateRange, +} from '~app/(notion)/(utils)/queries/index' +import { getSegmentInfo, getPropertyTypeData } from '~app/(notion)/(utils)/utils' +import { PageHeading } from '~ui/PageHeading' + +import { Event } from './Event' +import { DATABASE_ID, SEGMENT } from './Event.constants' +import type { PageObjectResponseEvent } from './Event.types' + +export const dynamicParams = true + +async function Listing({ segmentInfo }) { + const { slug } = segmentInfo + /** + * @note(notion) GET CONTENT + */ + const databaseQueryData: QueryDatabaseResponse = await getDatabaseQuery({ + database_id: '', + filterType: 'equals', + slug, + }) + const data: any = databaseQueryData.results[0] + + let notionData + if (!!data) { + const blockChildrenParentData = getBlockChildrenDataParent(data?.id) + const [blockChildrenParent] = await Promise.all([blockChildrenParentData]) + notionData = blockChildrenParent + } + + /** + * @note(notion) GET ITEMS + */ + const eventsData: QueryDatabaseResponse = slug.includes('/to/') + ? await getDatabaseQueryByDateRange({ + database_id: DATABASE_ID, + slug, + }) + : await getDatabaseQuery({ + database_id: DATABASE_ID, + filterType: 'starts_with', + slug, + }) + const hasEvents = eventsData?.results?.length > 0 + return ( + <> + + {!!data && } + {/* @todo(notion) Events */} + {hasEvents && ( +
      + {eventsData.results.map((event: PageObjectResponseEvent) => { + const { properties } = event + const propertyTypeData: any = getPropertyTypeData( + properties, + 'Slug.Preview' + ) + const href = propertyTypeData?.string + return ( +
    • + {href} +
    • + ) + })} +
    + )} + + Back to Home. + + + ) +} + +async function Slug({ segmentInfo }) { + const { slug } = segmentInfo + const databaseQueryData: QueryDatabaseResponse = await getDatabaseQuery({ + database_id: DATABASE_ID, + slug, + }) + // @todo(types) + const data: any = databaseQueryData.results[0] + const blockChildrenParentData = getBlockChildrenDataParent(data.id) + const [blockChildrenParent] = await Promise.all([blockChildrenParentData]) + + // @todo(next) but not a 404 empty please + /** + * @todo(notion) FALLBACK DATA FROM: Relation.Shows.Primary + * - [x] NotionContent + * - [ ] SEO Information + */ + let notionData = blockChildrenParent + if (blockChildrenParent.results.length === 0) { + // console.dir(`Event Content... has no data, pull from Show Information`) + // console.dir(blockChildrenParent) + // console.dir(data.properties['Relation.Shows.Primary']) + const showId = + data.properties['Relation.Shows.Primary'][ + data.properties['Relation.Shows.Primary'].type + ][0].id + const blockChildrenParentDataFallback = getBlockChildrenDataParent(showId) + const [blockChildrenParentFallback] = await Promise.all([ + blockChildrenParentDataFallback, + ]) + notionData = blockChildrenParentFallback + } + + return ( + <> + + + + + Back to Home. + + + ) +} + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +export default function Page({ preview = false, ...props }) { + const segmentInfo = getSegmentInfo({ SEGMENT, ...props }) + + if (segmentInfo.isIndex) { + // @ts-expect-error Async Server Component + return + } + // @ts-expect-error Async Server Component + return +} diff --git a/sites/test.com/src/app/(notion)/people/[[...catchAll]]/Person.constants.ts b/sites/test.com/src/app/(notion)/people/[[...catchAll]]/Person.constants.ts new file mode 100644 index 000000000..e064f5136 --- /dev/null +++ b/sites/test.com/src/app/(notion)/people/[[...catchAll]]/Person.constants.ts @@ -0,0 +1,4 @@ +const DATABASE_ID = process.env.NOTION__DATABASE__PEOPLE ?? '' +const SEGMENT = 'people' + +export { DATABASE_ID, SEGMENT } diff --git a/sites/test.com/src/app/(notion)/people/[[...catchAll]]/Person.tsx b/sites/test.com/src/app/(notion)/people/[[...catchAll]]/Person.tsx new file mode 100644 index 000000000..eca0a8879 --- /dev/null +++ b/sites/test.com/src/app/(notion)/people/[[...catchAll]]/Person.tsx @@ -0,0 +1,79 @@ +import { cx } from '@jeromefitz/shared/src/utils' +import type { RelationPropertyItemObjectResponse } from '@notionhq/client/build/src/api-endpoints' +import _map from 'lodash/map' +import _size from 'lodash/size' +import NextLink from 'next/link' + +import { getPageData } from '../../(utils)/queries/index' +// import type { PageObjectResponseEvent } from '../../events/[[...catchAll]]/Event.types' +import type { PageObjectResponseShow } from '../../shows/[[...catchAll]]/Show.types' + +import { getPropertyTypeData } from '~app/(notion)/(utils)/utils' + +import type { PageObjectResponsePerson } from './Person.types' + +function Person({ data }) { + const person: PageObjectResponsePerson = data + const { properties } = person + const showData = properties['Relation.Shows.Cast'] + const shows = _map( + showData.relation, + (show: RelationPropertyItemObjectResponse) => show.id + ) + // const eventData = properties['Relation.Shows.Cast'] + // const events = _map( + // eventData.relation, + // (event: RelationPropertyItemObjectResponse) => event.id + // ) + + return ( + <> +

    Person ({_size(properties)})

    + {!!shows && ( +
      + {} + {_map( + showData.relation, + async (show: RelationPropertyItemObjectResponse) => { + const showsCast: PageObjectResponseShow = await getPageData(show.id) + const { properties } = showsCast + const propertyTypeData: any = getPropertyTypeData( + properties, + 'Slug.Preview' + ) + const href = propertyTypeData?.string + return ( +
    • + {href} +
    • + ) + } + )} +
    + )} + {/* {!!events && ( +
      + {_map( + eventData.relation, + async (event: RelationPropertyItemObjectResponse) => { + const eventsAll: PageObjectResponseEvent = await getPageData(event.id) + const { properties } = eventsAll + const propertyTypeData: any = getPropertyTypeData( + properties, + 'Slug.Preview' + ) + const href = propertyTypeData?.string + return ( +
    • + {href} +
    • + ) + } + )} +
    + )} */} + + ) +} + +export { Person } diff --git a/sites/test.com/src/app/(notion)/people/[[...catchAll]]/Person.types.ts b/sites/test.com/src/app/(notion)/people/[[...catchAll]]/Person.types.ts new file mode 100644 index 000000000..725ec3fa8 --- /dev/null +++ b/sites/test.com/src/app/(notion)/people/[[...catchAll]]/Person.types.ts @@ -0,0 +1,39 @@ +import type { + CheckboxPropertyItemObjectResponse, + DatePropertyItemObjectResponse, + EmailPropertyItemObjectResponse, + FormulaPropertyItemObjectResponse, + MultiSelectPropertyItemObjectResponse, + PageObjectResponse, + PhoneNumberPropertyItemObjectResponse, + RelationPropertyItemObjectResponse, + RichTextPropertyItemObjectResponse, + SelectPropertyItemObjectResponse, + TitlePropertyItemObjectResponse, +} from '@notionhq/client/build/src/api-endpoints' + +import type { Spread } from '../../(utils)/Notion.types' + +type PersonProperties = { + 'Is.Active': CheckboxPropertyItemObjectResponse + 'Is.Indexed': CheckboxPropertyItemObjectResponse + 'Is.OkayToText': CheckboxPropertyItemObjectResponse + 'Is.Published': CheckboxPropertyItemObjectResponse + 'Relation.Events.HouseManager': RelationPropertyItemObjectResponse + 'Relation.Events.Interns': RelationPropertyItemObjectResponse + 'Relation.Events.StageManager': RelationPropertyItemObjectResponse + 'Relation.Shows.Cast': RelationPropertyItemObjectResponse + 'Relation.Shows.Producer': RelationPropertyItemObjectResponse + 'Slug.Preview': FormulaPropertyItemObjectResponse + Date: DatePropertyItemObjectResponse + Email: EmailPropertyItemObjectResponse + ID: FormulaPropertyItemObjectResponse + Phone: PhoneNumberPropertyItemObjectResponse + Pronouns: SelectPropertyItemObjectResponse + Roles: MultiSelectPropertyItemObjectResponse + Slug: RichTextPropertyItemObjectResponse + Title: TitlePropertyItemObjectResponse +} +export type PageObjectResponsePerson = Spread< + [PageObjectResponse, { properties: PersonProperties }] +> diff --git a/sites/test.com/src/app/(notion)/people/[[...catchAll]]/PersonAsync.tsx b/sites/test.com/src/app/(notion)/people/[[...catchAll]]/PersonAsync.tsx new file mode 100644 index 000000000..3ae936075 --- /dev/null +++ b/sites/test.com/src/app/(notion)/people/[[...catchAll]]/PersonAsync.tsx @@ -0,0 +1,19 @@ +import _size from 'lodash/size' + +import type { PageObjectResponsePeople } from '../../(utils)/Notion.types' + +async function PersonAsync({ promise }) { + const person: PageObjectResponsePeople = await promise + const { properties } = person + // console.dir(`>> Person > person`) + // console.dir(properties.Title) + // console.dir(properties.ID) + + return ( + <> +

    PersonAsync ({_size(properties)})

    + + ) +} + +export { PersonAsync } diff --git a/sites/test.com/src/app/(notion)/people/[[...catchAll]]/page.tsx b/sites/test.com/src/app/(notion)/people/[[...catchAll]]/page.tsx new file mode 100644 index 000000000..8c87be7fc --- /dev/null +++ b/sites/test.com/src/app/(notion)/people/[[...catchAll]]/page.tsx @@ -0,0 +1,134 @@ +import type { QueryDatabaseResponse } from '@notionhq/client/build/src/api-endpoints' +import NextLink from 'next/link' + +import { NotionBlocks } from '~app/(notion)/(utils)/NotionBlocks' +import { + getBlockChildrenDataParent, + getDatabaseQuery, +} from '~app/(notion)/(utils)/queries/index' +import { getSegmentInfo, getPropertyTypeData } from '~app/(notion)/(utils)/utils' +import { PageHeading } from '~ui/PageHeading' + +import { Person } from './Person' +import { DATABASE_ID, SEGMENT } from './Person.constants' +import type { PageObjectResponsePerson } from './Person.types' + +export const dynamicParams = true + +async function Listing({ segmentInfo }) { + const { slug } = segmentInfo + /** + * @note(notion) GET CONTENT + */ + const databaseQueryData: QueryDatabaseResponse = await getDatabaseQuery({ + database_id: '', + filterType: 'equals', + slug, + }) + const data: any = databaseQueryData.results[0] + if (!data) { + return ( + <> + + + Back to Home. + + + ) + } + + const blockChildrenParentData = getBlockChildrenDataParent(data.id) + const [blockChildrenParent] = await Promise.all([blockChildrenParentData]) + const notionData = blockChildrenParent + /** + * @note(notion) GET ITEMS + */ + const personData: QueryDatabaseResponse = await getDatabaseQuery({ + database_id: DATABASE_ID, + filterType: 'starts_with', + slug, + }) + const hasContent = personData?.results?.length > 0 + return ( + <> + + + {/* @todo(notion) Person */} + {hasContent && ( +
      + {personData.results.map((person: PageObjectResponsePerson) => { + const { properties } = person + const propertyTypeData: any = getPropertyTypeData( + properties, + 'Slug.Preview' + ) + const href = propertyTypeData?.string + return ( +
    • + {href} +
    • + ) + })} +
    + )} + + Back to Home. + + + ) +} + +async function Slug({ segmentInfo }) { + const { slug } = segmentInfo + const databaseQueryData: QueryDatabaseResponse = await getDatabaseQuery({ + database_id: DATABASE_ID, + slug, + }) + // @todo(types) + const data: any = databaseQueryData.results[0] + const blockChildrenParentData = getBlockChildrenDataParent(data.id) + const [blockChildrenParent] = await Promise.all([blockChildrenParentData]) + + // @todo(next) but not a 404 empty please + /** + * @todo(notion) FALLBACK DATA FROM: Relation.Shows.Primary + * - [x] NotionContent + * - [ ] SEO Information + */ + const notionData = blockChildrenParent + + return ( + <> + + + + + Back to Home. + + + ) +} + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +export default function Page({ preview = false, ...props }) { + const segmentInfo = getSegmentInfo({ SEGMENT, ...props }) + + if (segmentInfo.isIndex) { + // @ts-expect-error Async Server Component + return + } + // @ts-expect-error Async Server Component + return +} diff --git a/sites/test.com/src/app/(notion)/shows/[[...catchAll]]/Show.constants.ts b/sites/test.com/src/app/(notion)/shows/[[...catchAll]]/Show.constants.ts new file mode 100644 index 000000000..2cd719a81 --- /dev/null +++ b/sites/test.com/src/app/(notion)/shows/[[...catchAll]]/Show.constants.ts @@ -0,0 +1,4 @@ +const DATABASE_ID = process.env.NOTION__DATABASE__SHOWS ?? '' +const SEGMENT = 'shows' + +export { DATABASE_ID, SEGMENT } diff --git a/sites/test.com/src/app/(notion)/shows/[[...catchAll]]/Show.tsx b/sites/test.com/src/app/(notion)/shows/[[...catchAll]]/Show.tsx new file mode 100644 index 000000000..9fa09c741 --- /dev/null +++ b/sites/test.com/src/app/(notion)/shows/[[...catchAll]]/Show.tsx @@ -0,0 +1,85 @@ +import { cx } from '@jeromefitz/shared/src/utils' +import type { RelationPropertyItemObjectResponse } from '@notionhq/client/build/src/api-endpoints' +import _map from 'lodash/map' +import _size from 'lodash/size' +import NextLink from 'next/link' + +import { getPageData } from '../../(utils)/queries/index' +import type { PageObjectResponseEvent } from '../../events/[[...catchAll]]/Event.types' +import type { PageObjectResponsePerson } from '../../people/[[...catchAll]]/Person.types' + +import { getPropertyTypeData } from '~app/(notion)/(utils)/utils' + +import type { PageObjectResponseShow } from './Show.types' + +// Jerome +// const personId = '69a7d8ca4b314067a0e672c32c7b607e' + +function Show({ data }) { + const show: PageObjectResponseShow = data + const { properties } = show + // console.dir(`>> Show > show`) + // console.dir(properties.Title) + // console.dir(properties.ID) + + const castData = properties['Relation.People.Cast'] + const cast = _map( + castData.relation, + (c: RelationPropertyItemObjectResponse) => c.id + ) + const eventData = properties['Relation.Events.Primary'] + const events = _map( + eventData.relation, + (event: RelationPropertyItemObjectResponse) => event.id + ) + + return ( + <> +

    + Show ({_size(properties)}); Cast: {_size(cast)} +

    + {!!cast && ( +
      + {} + {_map(castData.relation, async (c: RelationPropertyItemObjectResponse) => { + const castMember: PageObjectResponsePerson = await getPageData(c.id) + const { properties } = castMember + const propertyTypeData: any = getPropertyTypeData( + properties, + 'Slug.Preview' + ) + const href = propertyTypeData?.string + return ( +
    • + {href} +
    • + ) + })} +
    + )} + {!!events && ( +
      + {_map( + eventData.relation, + async (event: RelationPropertyItemObjectResponse) => { + const eventsAll: PageObjectResponseEvent = await getPageData(event.id) + const { properties } = eventsAll + const propertyTypeData: any = getPropertyTypeData( + properties, + 'Slug.Preview' + ) + const href = propertyTypeData?.string + return ( +
    • + {href} +
    • + ) + } + )} +
    + )} + + ) +} + +export { Show } diff --git a/sites/test.com/src/app/(notion)/shows/[[...catchAll]]/Show.types.ts b/sites/test.com/src/app/(notion)/shows/[[...catchAll]]/Show.types.ts new file mode 100644 index 000000000..bc1fc8e75 --- /dev/null +++ b/sites/test.com/src/app/(notion)/shows/[[...catchAll]]/Show.types.ts @@ -0,0 +1,41 @@ +import type { + CheckboxPropertyItemObjectResponse, + FilesPropertyItemObjectResponse, + FormulaPropertyItemObjectResponse, + MultiSelectPropertyItemObjectResponse, + PageObjectResponse, + RelationPropertyItemObjectResponse, + RichTextPropertyItemObjectResponse, + SelectPropertyItemObjectResponse, + TitlePropertyItemObjectResponse, +} from '@notionhq/client/build/src/api-endpoints' + +import type { Spread } from '../../(utils)/Notion.types' + +type ShowProperties = { + 'Is.Active': CheckboxPropertyItemObjectResponse + 'Is.HouseTeam.Past': CheckboxPropertyItemObjectResponse + 'Is.HouseTeam': CheckboxPropertyItemObjectResponse + 'Is.Indexed': CheckboxPropertyItemObjectResponse + 'Is.Published': CheckboxPropertyItemObjectResponse + 'Is.Recurring': CheckboxPropertyItemObjectResponse + 'Relation.Events.Primary': RelationPropertyItemObjectResponse + 'Relation.Events.Supporting': RelationPropertyItemObjectResponse + 'Relation.People.Cast': RelationPropertyItemObjectResponse + 'SEO.Description': RichTextPropertyItemObjectResponse + 'SEO.Image.Description': RichTextPropertyItemObjectResponse + 'SEO.Image': FilesPropertyItemObjectResponse + 'SEO.Keywords': RichTextPropertyItemObjectResponse + 'Slug.Preview': FormulaPropertyItemObjectResponse + Complexity: SelectPropertyItemObjectResponse + ID: FormulaPropertyItemObjectResponse + Slug: RichTextPropertyItemObjectResponse + Tags: MultiSelectPropertyItemObjectResponse + Title: TitlePropertyItemObjectResponse + Type: SelectPropertyItemObjectResponse +} +type PageObjectResponseShow = Spread< + [PageObjectResponse, { properties: ShowProperties }] +> + +export type { PageObjectResponseShow } diff --git a/sites/test.com/src/app/(notion)/shows/[[...catchAll]]/page.tsx b/sites/test.com/src/app/(notion)/shows/[[...catchAll]]/page.tsx new file mode 100644 index 000000000..1ee40d862 --- /dev/null +++ b/sites/test.com/src/app/(notion)/shows/[[...catchAll]]/page.tsx @@ -0,0 +1,134 @@ +import type { QueryDatabaseResponse } from '@notionhq/client/build/src/api-endpoints' +import NextLink from 'next/link' + +import { NotionBlocks } from '~app/(notion)/(utils)/NotionBlocks' +import { + getBlockChildrenDataParent, + getDatabaseQuery, +} from '~app/(notion)/(utils)/queries/index' +import { getSegmentInfo, getPropertyTypeData } from '~app/(notion)/(utils)/utils' +import { PageHeading } from '~ui/PageHeading' + +import { Show } from './Show' +import { DATABASE_ID, SEGMENT } from './Show.constants' +import type { PageObjectResponseShow } from './Show.types' + +export const dynamicParams = true + +async function Listing({ segmentInfo }) { + const { slug } = segmentInfo + /** + * @note(notion) GET CONTENT + */ + const databaseQueryData: QueryDatabaseResponse = await getDatabaseQuery({ + database_id: '', + filterType: 'equals', + slug, + }) + const data: any = databaseQueryData.results[0] + if (!data) { + return ( + <> + + + Back to Home. + + + ) + } + + const blockChildrenParentData = getBlockChildrenDataParent(data.id) + const [blockChildrenParent] = await Promise.all([blockChildrenParentData]) + const notionData = blockChildrenParent + /** + * @note(notion) GET ITEMS + */ + const showData: QueryDatabaseResponse = await getDatabaseQuery({ + database_id: DATABASE_ID, + filterType: 'starts_with', + slug, + }) + const hasContent = showData?.results?.length > 0 + return ( + <> + + + {/* @todo(notion) Show */} + {hasContent && ( +
      + {showData.results.map((show: PageObjectResponseShow) => { + const { properties } = show + const propertyTypeData: any = getPropertyTypeData( + properties, + 'Slug.Preview' + ) + const href = propertyTypeData?.string + return ( +
    • + {href} +
    • + ) + })} +
    + )} + + Back to Home. + + + ) +} + +async function Slug({ segmentInfo }) { + const { slug } = segmentInfo + const databaseQueryData: QueryDatabaseResponse = await getDatabaseQuery({ + database_id: DATABASE_ID, + slug, + }) + // @todo(types) + const data: any = databaseQueryData.results[0] + const blockChildrenParentData = getBlockChildrenDataParent(data.id) + const [blockChildrenParent] = await Promise.all([blockChildrenParentData]) + + // @todo(next) but not a 404 empty please + /** + * @todo(notion) FALLBACK DATA FROM: Relation.Shows.Primary + * - [x] NotionContent + * - [ ] SEO Information + */ + const notionData = blockChildrenParent + + return ( + <> + + + + + Back to Home. + + + ) +} + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +export default function Page({ preview = false, ...props }) { + const segmentInfo = getSegmentInfo({ SEGMENT, ...props }) + + if (segmentInfo.isIndex) { + // @ts-expect-error Async Server Component + return + } + // @ts-expect-error Async Server Component + return +} diff --git a/sites/test.com/src/app/ThemeToggle.tsx b/sites/test.com/src/app/ThemeToggle.tsx new file mode 100644 index 000000000..b8b1e2001 --- /dev/null +++ b/sites/test.com/src/app/ThemeToggle.tsx @@ -0,0 +1,27 @@ +'use client' +import { Button } from '@jeromefitz/ds/components/Button' +import { useTheme } from 'next-themes' + +import { useThemeToggle } from '~hooks/useThemeToggle' + +function ThemeToggle() { + const { resolvedTheme: theme, setTheme } = useTheme() + const handleThemeToggle = useThemeToggle({ setTheme, theme }) + return ( + <> +
    +
    +
    + +
    +
    + + ) +} + +export { ThemeToggle } diff --git a/sites/test.com/src/app/design-system/page.tsx b/sites/test.com/src/app/design-system/page.tsx new file mode 100644 index 000000000..25b5bbcb5 --- /dev/null +++ b/sites/test.com/src/app/design-system/page.tsx @@ -0,0 +1,122 @@ +import { Button } from '@jeromefitz/ds/components/Button' +import NextLink from 'next/link' + +import { PageHeading } from '~ui/PageHeading' + +const notionColors = [ + // 'default', + 'gray', + 'brown', + 'orange', + 'yellow', + 'green', + 'blue', + 'purple', + 'pink', + 'red', + 'gray_background', + 'brown_background', + 'orange_background', + 'yellow_background', + 'green_background', + 'blue_background', + 'purple_background', + 'pink_background', + 'red_background', +] +const radixColors = [ + 'tomato', + 'red', + 'crimson', + 'pink', + 'plum', + 'purple', + 'violet', + 'indigo', + 'blue', + 'cyan', + 'teal', + 'green', + 'grass', + 'orange', + 'brown', + // bright + 'sky', + 'mint', + 'lime', + 'yellow', + 'amber', + // grays + 'gray', + 'mauve', + 'slate', + 'sage', + 'olive', + 'sand', + // metals + 'gold', + 'bronze', + // overlays + 'black', + 'white', +] + +const buttonTypes = ['', '-cta', '-outline', '-solid', '-transparent'] + +function TailwindHackForDynamicallyLoadedStylesColors() { + return ( +
      + {notionColors.map((notionColor) => { + if (notionColor.includes('white')) { + return null + } + return ( +
    • + {notionColor} +
    • + ) + })} +
    + ) +} + +function TailwindHackForDynamicallyLoadedStylesButtons() { + return ( +
      + {radixColors.map((radixColor) => { + if (radixColor.includes('black') || radixColor.includes('white')) { + return null + } + return buttonTypes.map((buttonType) => { + return ( +
    • + +
    • + ) + }) + })} +
    + ) +} + +export default function Page() { + return ( + <> + + + + + Back to Home. + + + ) +} diff --git a/sites/test.com/src/app/layout.tsx b/sites/test.com/src/app/layout.tsx new file mode 100644 index 000000000..08b97c8a7 --- /dev/null +++ b/sites/test.com/src/app/layout.tsx @@ -0,0 +1,50 @@ +import '@jeromefitz/tailwind-config/styles/globals.css' + +import { cx } from '@jeromefitz/shared/src/utils' +import localFont from 'next/font/local' + +import { Providers } from '~components/Providers' +const fontSans = localFont({ + display: 'swap', + declarations: [ + { + prop: 'unicode-range', + value: + 'U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD', + }, + ], + src: '../../public/static/fonts/inter/inter-var.woff2', + style: 'normal', + variable: '--font-inter', + weight: '100 900', +}) + +export const metadata = { + title: 'Notion Refactor', + description: 'Der', +} + +export default function RootLayout({ children }: { children: React.ReactNode }) { + return ( + + + +
    +
    + {children} +
    +
    +
    + + + ) +} diff --git a/sites/test.com/src/app/page.tsx b/sites/test.com/src/app/page.tsx new file mode 100644 index 000000000..68f6880a9 --- /dev/null +++ b/sites/test.com/src/app/page.tsx @@ -0,0 +1,39 @@ +import NextLink from 'next/link' + +import { PageHeading } from '~ui/PageHeading' + +import { ThemeToggle } from './ThemeToggle' + +const links = [ + '/events/2023/06/16/jerome-and', + '/events/2023/06/16', + '/events/2023/06', + '/events/2023', + '/events', + '/people/jerome-fitzgerald', + '/people', + '/shows/jerome-and', + '/shows', + // + '/design-system', + // '/kitchen-sink', +] + +export default function Page() { + return ( + <> + +
      + {links.map((href, i) => { + return ( +
    • + {href} +
    • + ) + })} +
    + +
    + + ) +} diff --git a/sites/test.com/src/components/ErrorBoundary/ErrorBoundary.tsx b/sites/test.com/src/components/ErrorBoundary/ErrorBoundary.tsx new file mode 100644 index 000000000..9c90abf8d --- /dev/null +++ b/sites/test.com/src/components/ErrorBoundary/ErrorBoundary.tsx @@ -0,0 +1,52 @@ +/* eslint-disable @typescript-eslint/no-unused-vars */ +import * as React from 'react' + +import { PageHeading } from '~ui/PageHeading' + +type PropsChildren = { + children?: React.ReactNode +} + +class ErrorBoundary extends React.Component { + constructor(props: any) { + super(props) + this.state = { hasError: false } + } + + static getDerivedStateFromError(error: any) { + // Update state so the next render will show the fallback UI. + return { hasError: true } + } + + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + componentDidCatch(error, errorInfo) { + // // You can also log the error to an error reporting service + // // logErrorToMyService(error, errorInfo) + // console.dir(`> componentDidCatch`) + // console.dir(errorInfo) + // console.dir(error) + } + + render() { + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + if (this.state.hasError) { + return ( +
    +
    + +

    + Something is so broke, that this showed up. Feel free to reach out, + however, I am sure Jerome has gotten a few alerts already. +

    +
    +
    + ) + } + + return this.props.children + } +} + +export { ErrorBoundary } diff --git a/sites/test.com/src/components/ErrorBoundary/index.ts b/sites/test.com/src/components/ErrorBoundary/index.ts new file mode 100644 index 000000000..97d788f99 --- /dev/null +++ b/sites/test.com/src/components/ErrorBoundary/index.ts @@ -0,0 +1 @@ +export { ErrorBoundary } from './ErrorBoundary' diff --git a/sites/test.com/src/components/Loading/Loading.tsx b/sites/test.com/src/components/Loading/Loading.tsx new file mode 100644 index 000000000..ccaca4d07 --- /dev/null +++ b/sites/test.com/src/components/Loading/Loading.tsx @@ -0,0 +1,45 @@ +import { cx } from '@jeromefitz/shared/src/utils' +import { useNProgress } from '@tanem/react-nprogress' +import { motion } from 'framer-motion' +import { useEffect } from 'react' + +const Loading: React.FC<{ isRouteChanging: boolean }> = ({ isRouteChanging }) => { + const { isFinished, progress } = useNProgress({ + isAnimating: isRouteChanging, + minimum: 0.08, + }) + + useEffect(() => { + isFinished + ? document.body.classList.remove('loading') + : document.body.classList.add('loading') + + return () => { + document.body.classList.remove('loading') + } + }, [isFinished]) + + return ( + + ) +} + +export { Loading } diff --git a/sites/test.com/src/components/Loading/index.ts b/sites/test.com/src/components/Loading/index.ts new file mode 100644 index 000000000..71170faae --- /dev/null +++ b/sites/test.com/src/components/Loading/index.ts @@ -0,0 +1 @@ +export { Loading } from './Loading' diff --git a/sites/test.com/src/components/Providers/Providers.tsx b/sites/test.com/src/components/Providers/Providers.tsx new file mode 100644 index 000000000..d5f696cf6 --- /dev/null +++ b/sites/test.com/src/components/Providers/Providers.tsx @@ -0,0 +1,83 @@ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +/* eslint-disable @typescript-eslint/no-unused-vars */ +'use client' +import { IMAGE__FALLBACKS__SHOWS } from '@jeromefitz/shared/src/lib/constants' +import { usePathname } from 'next/navigation' +import { ThemeProvider } from 'next-themes' +// import pluralize from 'pluralize' +// @ts-ignore +import { createContext, useContext, useEffect, useState } from 'react' +import { Provider as ReactWrapBalancerProvider } from 'react-wrap-balancer' +import { SWRConfig } from 'swr' +// @ts-ignore +import { createStore, useStore } from 'zustand' + +import { ErrorBoundary } from '~components/ErrorBoundary' +import { Loading } from '~components/Loading' +// import { pluralRules } from '~config/index' +// import { LinkRouterChangeContext } from '~context/LinkRouterChangeContext' +/** + * @note(next) this needs to be in a client component, not server + */ +// pluralRules.map(({ rule, replacement }) => { +// pluralize.addPluralRule(rule, replacement) +// }) + +// @ts-ignore +const store = createStore((set) => ({ + bears: 0, + // eslint-disable-next-line @typescript-eslint/restrict-plus-operands + increasePopulation: () => set((state) => ({ bears: state.bears + 1 })), + removeAllBears: () => set({ bears: 0 }), +})) +// @ts-ignore +const MyContext = createContext<() => void>(() => {}) + +function RouterEventWrapper({ children }) { + const pathname = usePathname() + + const [isRouteChanging, isRouteChangingSet] = useState(false) + useEffect(() => { + isRouteChangingSet(false) + }, [pathname]) + + return ( + <> + {/* isRouteChangingSet(true)}> */} + + {children} + {/* */} + + ) +} + +function Providers({ children }) { + return ( + + {/* */} + + new Map(), + }} + > + + {children} + + + + {/* */} + + ) +} + +// const useMyStore = (selector) => useStore(useContext(MyContext), selector) + +// export { useMyStore, Providers } +export { Providers } diff --git a/sites/test.com/src/components/Providers/index.ts b/sites/test.com/src/components/Providers/index.ts new file mode 100644 index 000000000..950c2b3d5 --- /dev/null +++ b/sites/test.com/src/components/Providers/index.ts @@ -0,0 +1 @@ +export { Providers } from './Providers' diff --git a/sites/test.com/src/config/.gitkeep b/sites/test.com/src/config/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/sites/test.com/src/hooks/useThemeToggle.ts b/sites/test.com/src/hooks/useThemeToggle.ts new file mode 100644 index 000000000..00c6918aa --- /dev/null +++ b/sites/test.com/src/hooks/useThemeToggle.ts @@ -0,0 +1,11 @@ +import React from 'react' + +function useThemeToggle({ setTheme, theme }) { + return React.useCallback(() => { + const newTheme = theme === 'dark' ? 'light' : 'dark' + document.documentElement.style.setProperty('color-scheme', newTheme) + setTheme(newTheme) + }, [setTheme, theme]) +} + +export { useThemeToggle } diff --git a/sites/test.com/src/ui/PageHeading/PageHeading.tsx b/sites/test.com/src/ui/PageHeading/PageHeading.tsx new file mode 100644 index 000000000..b301a5db0 --- /dev/null +++ b/sites/test.com/src/ui/PageHeading/PageHeading.tsx @@ -0,0 +1,36 @@ +import { cx } from '@jeromefitz/shared/src/utils' + +type PageHeadingProps = { + overline: string + title: string +} + +const PageHeading = ({ overline, title }: PageHeadingProps) => { + return ( + <> +

    + {overline}/ +

    +

    + {title} +

    +
    + + ) +} + +export { PageHeading } diff --git a/sites/test.com/src/ui/PageHeading/index.ts b/sites/test.com/src/ui/PageHeading/index.ts new file mode 100644 index 000000000..9fccbf5cf --- /dev/null +++ b/sites/test.com/src/ui/PageHeading/index.ts @@ -0,0 +1 @@ +export { PageHeading } from './PageHeading' diff --git a/sites/test.com/src/utils/.gitkeep b/sites/test.com/src/utils/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/sites/test.com/tailwind.config.js b/sites/test.com/tailwind.config.js new file mode 100644 index 000000000..f3d1dc191 --- /dev/null +++ b/sites/test.com/tailwind.config.js @@ -0,0 +1 @@ +module.exports = require('@jeromefitz/tailwind-config/tailwind.config')({}) diff --git a/sites/test.com/tsconfig.dev.json b/sites/test.com/tsconfig.dev.json new file mode 100644 index 000000000..8684dd2cb --- /dev/null +++ b/sites/test.com/tsconfig.dev.json @@ -0,0 +1,43 @@ +{ + "extends": "../../tsconfig.json", + // "extends": "@jeromefitz/tsconfig/next.json", + "compilerOptions": { + // @hack(typescript) next does not put autogenerated in this folder + // "rootDir": "src", + // // "rootDir": ".", + // "outDir": "dist", + "baseUrl": ".", + "preserveSymlinks": true, + "paths": { + "@jeromefitz/ds/*": ["../../packages/design-system/src/*"], + "~app/*": ["src/app/*"], + "~components/*": ["src/components/*"], + "~config/*": ["src/config/*"], + "~containers/*": ["src/containers/*"], + "~context/*": ["src/context/*"], + "~custom/*": ["src/custom/*"], + "~data/*": ["src/data/*"], + "~hooks/*": ["src/hooks/*"], + "~lib/*": ["src/lib/*"], + "~pages/*": ["src/pages/*"], + "~playground/*": ["src/playground/*"], + "~routes/*": ["src/routes/*"], + "~scripts/*": ["src/scripts/*"], + "~store/*": ["src/store/*"], + "~styles/*": ["src/styles/*"], + "~svg/*": ["src/svg/*"], + "~theme/*": ["src/theme/*"], + "~ui/*": ["src/ui/*"], + "~utils/*": ["src/utils/*"] + }, + "plugins": [ + { + "name": "next" + } + ], + "skipLibCheck": true, + "strictNullChecks": true + }, + "include": ["src", "index.d.ts", "next-env.d.ts"], + "exclude": ["node_modules", "tests/*.test.ts"] +} diff --git a/sites/test.com/tsconfig.json b/sites/test.com/tsconfig.json new file mode 100644 index 000000000..4390a70e6 --- /dev/null +++ b/sites/test.com/tsconfig.json @@ -0,0 +1,47 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + // @hack(typescript) next does not put autogenerated in this folder + // // "rootDir": "src", + // "rootDir": ".", + // "outDir": "dist", + "baseUrl": ".", + "preserveSymlinks": true, + "paths": { + "@jeromefitz/ds/*": ["../../packages/design-system/src/*"], + "~app/*": ["src/app/*"], + "~components/*": ["src/components/*"], + "~config/*": ["src/config/*"], + "~containers/*": ["src/containers/*"], + "~context/*": ["src/context/*"], + "~custom/*": ["src/custom/*"], + "~data/*": ["src/data/*"], + "~hooks/*": ["src/hooks/*"], + "~lib/*": ["src/lib/*"], + "~pages/*": ["src/pages/*"], + "~playground/*": ["src/playground/*"], + "~routes/*": ["src/routes/*"], + "~scripts/*": ["src/scripts/*"], + "~store/*": ["src/store/*"], + "~styles/*": ["src/styles/*"], + "~svg/*": ["src/svg/*"], + "~theme/*": ["src/theme/*"], + "~ui/*": ["src/ui/*"], + "~utils/*": ["src/utils/*"] + }, + "plugins": [ + { + "name": "next" + } + ], + "strictNullChecks": true + }, + "include": [ + "./.next/types/**/*.ts", + ".next/types/**/*.ts", + "index.d.ts", + "next-env.d.ts", + "src" + ], + "exclude": ["node_modules", "tests/*.test.ts"] +}