@@ -74,9 +74,7 @@ | |||||
"require": "./dist/cjs/production/index.js", | "require": "./dist/cjs/production/index.js", | ||||
"import": "./dist/esm/production/index.js", | "import": "./dist/esm/production/index.js", | ||||
"types": "./dist/types/index.d.ts" | "types": "./dist/types/index.d.ts" | ||||
}, | |||||
"./dist/RadioButton.css": "./dist/RadioButton.css", | |||||
"./dist/RadioTickBox.css": "./dist/RadioTickBox.css" | |||||
} | |||||
}, | }, | ||||
"typesVersions": { | "typesVersions": { | ||||
"*": {} | "*": {} | ||||
@@ -76,11 +76,7 @@ | |||||
"require": "./dist/cjs/production/index.js", | "require": "./dist/cjs/production/index.js", | ||||
"import": "./dist/esm/production/index.js", | "import": "./dist/esm/production/index.js", | ||||
"types": "./dist/types/index.d.ts" | "types": "./dist/types/index.d.ts" | ||||
}, | |||||
"./dist/TagInput.css": "./dist/TagInput.css", | |||||
"./dist/ToggleButton.css": "./dist/ToggleButton.css", | |||||
"./dist/ToggleSwitch.css": "./dist/ToggleSwitch.css", | |||||
"./dist/ToggleTickBox.css": "./dist/ToggleTickBox.css" | |||||
} | |||||
}, | }, | ||||
"typesVersions": { | "typesVersions": { | ||||
"*": {} | "*": {} | ||||
@@ -74,9 +74,7 @@ | |||||
"require": "./dist/cjs/production/index.js", | "require": "./dist/cjs/production/index.js", | ||||
"import": "./dist/esm/production/index.js", | "import": "./dist/esm/production/index.js", | ||||
"types": "./dist/types/index.d.ts" | "types": "./dist/types/index.d.ts" | ||||
}, | |||||
"./dist/Slider.css": "./dist/Slider.css", | |||||
"./dist/Spinner.css": "./dist/Spinner.css" | |||||
} | |||||
}, | }, | ||||
"typesVersions": { | "typesVersions": { | ||||
"*": {} | "*": {} | ||||
@@ -1,5 +1,5 @@ | |||||
{ | { | ||||
"name": "@modal-soft/audio-utils", | |||||
"name": "@modal-sh/audio-utils", | |||||
"version": "0.0.0", | "version": "0.0.0", | ||||
"files": [ | "files": [ | ||||
"dist", | "dist", | ||||
@@ -1,5 +1,5 @@ | |||||
{ | { | ||||
"name": "@modal-soft/image-utils", | |||||
"name": "@modal-sh/image-utils", | |||||
"version": "0.0.0", | "version": "0.0.0", | ||||
"files": [ | "files": [ | ||||
"dist", | "dist", | ||||
@@ -0,0 +1,9 @@ | |||||
{ | |||||
"root": true, | |||||
"extends": [ | |||||
"lxsmnsyc/typescript/react" | |||||
], | |||||
"parserOptions": { | |||||
"project": "./tsconfig.eslint.json" | |||||
} | |||||
} |
@@ -0,0 +1,107 @@ | |||||
# Logs | |||||
logs | |||||
*.log | |||||
npm-debug.log* | |||||
yarn-debug.log* | |||||
yarn-error.log* | |||||
lerna-debug.log* | |||||
# Diagnostic reports (https://nodejs.org/api/report.html) | |||||
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json | |||||
# Runtime data | |||||
pids | |||||
*.pid | |||||
*.seed | |||||
*.pid.lock | |||||
# Directory for instrumented libs generated by jscoverage/JSCover | |||||
lib-cov | |||||
# Coverage directory used by tools like istanbul | |||||
coverage | |||||
*.lcov | |||||
# nyc test coverage | |||||
.nyc_output | |||||
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) | |||||
.grunt | |||||
# Bower dependency directory (https://bower.io/) | |||||
bower_components | |||||
# node-waf configuration | |||||
.lock-wscript | |||||
# Compiled binary addons (https://nodejs.org/api/addons.html) | |||||
build/Release | |||||
# Dependency directories | |||||
node_modules/ | |||||
jspm_packages/ | |||||
# TypeScript v1 declaration files | |||||
typings/ | |||||
# TypeScript cache | |||||
*.tsbuildinfo | |||||
# Optional npm cache directory | |||||
.npm | |||||
# Optional eslint cache | |||||
.eslintcache | |||||
# Microbundle cache | |||||
.rpt2_cache/ | |||||
.rts2_cache_cjs/ | |||||
.rts2_cache_es/ | |||||
.rts2_cache_umd/ | |||||
# Optional REPL history | |||||
.node_repl_history | |||||
# Output of 'npm pack' | |||||
*.tgz | |||||
# Yarn Integrity file | |||||
.yarn-integrity | |||||
# dotenv environment variables file | |||||
.env | |||||
.env.production | |||||
.env.development | |||||
# parcel-bundler cache (https://parceljs.org/) | |||||
.cache | |||||
# Next.js build output | |||||
.next | |||||
# Nuxt.js build / generate output | |||||
.nuxt | |||||
dist | |||||
# Gatsby files | |||||
.cache/ | |||||
# Comment in the public line in if your project uses Gatsby and *not* Next.js | |||||
# https://nextjs.org/blog/next-9-1#public-directory-support | |||||
# public | |||||
# vuepress build output | |||||
.vuepress/dist | |||||
# Serverless directories | |||||
.serverless/ | |||||
# FuseBox cache | |||||
.fusebox/ | |||||
# DynamoDB Local files | |||||
.dynamodb/ | |||||
# TernJS port file | |||||
.tern-port | |||||
.npmrc |
@@ -0,0 +1,7 @@ | |||||
MIT License Copyright (c) 2023 TheoryOfNekomata <allan.crisostomo@outlook.com> | |||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |||||
The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. | |||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
@@ -0,0 +1,77 @@ | |||||
{ | |||||
"name": "@modal-sh/react-binary-data-canvas", | |||||
"version": "0.0.0", | |||||
"files": [ | |||||
"dist", | |||||
"src" | |||||
], | |||||
"engines": { | |||||
"node": ">=12" | |||||
}, | |||||
"license": "MIT", | |||||
"keywords": [ | |||||
"pridepack" | |||||
], | |||||
"devDependencies": { | |||||
"@testing-library/jest-dom": "^5.16.5", | |||||
"@testing-library/react": "^13.4.0", | |||||
"@types/node": "^18.14.1", | |||||
"@types/react": "^18.0.27", | |||||
"eslint": "^8.35.0", | |||||
"eslint-config-lxsmnsyc": "^0.5.0", | |||||
"jsdom": "^21.1.0", | |||||
"pridepack": "2.4.4", | |||||
"react": "^18.2.0", | |||||
"react-dom": "^18.2.0", | |||||
"react-test-renderer": "^18.2.0", | |||||
"tslib": "^2.5.0", | |||||
"typescript": "^4.9.5", | |||||
"vitest": "^0.28.1" | |||||
}, | |||||
"peerDependencies": { | |||||
"react": "^16.8 || ^17.0 || ^18.0", | |||||
"react-dom": "^16.8 || ^17.0 || ^18.0" | |||||
}, | |||||
"scripts": { | |||||
"prepublishOnly": "pridepack clean && pridepack build", | |||||
"build": "pridepack build", | |||||
"type-check": "pridepack check", | |||||
"lint": "pridepack lint", | |||||
"clean": "pridepack clean", | |||||
"watch": "pridepack watch", | |||||
"start": "pridepack start", | |||||
"dev": "pridepack dev", | |||||
"test": "vitest" | |||||
}, | |||||
"private": false, | |||||
"description": "Displays binary data into a grid of bytes.", | |||||
"repository": { | |||||
"url": "", | |||||
"type": "git" | |||||
}, | |||||
"homepage": "", | |||||
"bugs": { | |||||
"url": "" | |||||
}, | |||||
"author": "TheoryOfNekomata <allan.crisostomo@outlook.com>", | |||||
"publishConfig": { | |||||
"access": "public" | |||||
}, | |||||
"types": "./dist/types/index.d.ts", | |||||
"main": "./dist/cjs/production/index.js", | |||||
"module": "./dist/esm/production/index.js", | |||||
"exports": { | |||||
".": { | |||||
"development": { | |||||
"require": "./dist/cjs/development/index.js", | |||||
"import": "./dist/esm/development/index.js" | |||||
}, | |||||
"require": "./dist/cjs/production/index.js", | |||||
"import": "./dist/esm/production/index.js", | |||||
"types": "./dist/types/index.d.ts" | |||||
} | |||||
}, | |||||
"typesVersions": { | |||||
"*": {} | |||||
} | |||||
} |
@@ -0,0 +1,3 @@ | |||||
{ | |||||
"target": "es2018" | |||||
} |
@@ -1,5 +1,4 @@ | |||||
import * as React from 'react'; | import * as React from 'react'; | ||||
import styles from './style.module.css'; | |||||
export type BinaryDataCanvasDerivedElement = HTMLDivElement; | export type BinaryDataCanvasDerivedElement = HTMLDivElement; | ||||
@@ -21,36 +20,50 @@ export const BinaryDataCanvas = React.forwardRef<BinaryDataCanvasDerivedElement, | |||||
style, | style, | ||||
...etcProps | ...etcProps | ||||
}, forwardedRef) => { | }, forwardedRef) => { | ||||
const bytesGrouped = arrayBuffer ? (Array.from(new Uint8Array(arrayBuffer)).slice(0, BYTES_PER_LINE * 20) as number[]) | |||||
.reduce( | |||||
(byteArray: number[][], byte: number, i) => { | |||||
if (i % BYTES_PER_LINE === 0) { | |||||
return [ | |||||
...byteArray, | |||||
[byte], | |||||
] | |||||
} | |||||
const bytesGrouped = arrayBuffer | |||||
? (Array.from(new Uint8Array(arrayBuffer)).slice(0, BYTES_PER_LINE * 20) as number[]) | |||||
.reduce( | |||||
(byteArray: number[][], byte: number, i) => { | |||||
if (i % BYTES_PER_LINE === 0) { | |||||
return [ | |||||
...byteArray, | |||||
[byte], | |||||
]; | |||||
} | |||||
const lastLine = byteArray.at(-1) as number[] | |||||
const lastLine = byteArray.at(-1) as number[]; | |||||
return [ | |||||
...(byteArray.slice(0, -1)), | |||||
[...lastLine, byte], | |||||
] | |||||
}, | |||||
[] as number[][], | |||||
) : [] as number[][]; | |||||
return [ | |||||
...(byteArray.slice(0, -1)), | |||||
[...lastLine, byte], | |||||
]; | |||||
}, | |||||
[] as number[][], | |||||
) | |||||
: [] as number[][]; | |||||
return ( | return ( | ||||
<div | <div | ||||
{...etcProps} | {...etcProps} | ||||
className={`${styles['react-binary-data-canvas']} ${className ?? ''}`.trim()} | |||||
style={style} | |||||
className={`react-binary-data-canvas ${className ?? ''}`.trim()} | |||||
style={{ | |||||
...style, | |||||
display: 'flex', | |||||
alignItems: 'flex-start', | |||||
}} | |||||
ref={forwardedRef} | ref={forwardedRef} | ||||
> | > | ||||
{headers && ( | {headers && ( | ||||
<pre | <pre | ||||
className={styles['line-numbers']} | |||||
className="line-numbers" | |||||
style={{ | |||||
overflow: 'visible', | |||||
padding: 0, | |||||
margin: 0, | |||||
lineHeight: 1.2, | |||||
textAlign: 'right', | |||||
userSelect: 'none', | |||||
}} | |||||
> | > | ||||
<code> | <code> | ||||
{'\u00a0'} | {'\u00a0'} | ||||
@@ -59,7 +72,10 @@ export const BinaryDataCanvas = React.forwardRef<BinaryDataCanvasDerivedElement, | |||||
<React.Fragment key={i}> | <React.Fragment key={i}> | ||||
{'\n'} | {'\n'} | ||||
<code | <code | ||||
className={styles['code']} | |||||
className="code" | |||||
style={{ | |||||
whiteSpace: 'nowrap', | |||||
}} | |||||
> | > | ||||
0x{(BYTES_PER_LINE * i).toString(16).padStart(2, '0')} | 0x{(BYTES_PER_LINE * i).toString(16).padStart(2, '0')} | ||||
</code> | </code> | ||||
@@ -69,7 +85,14 @@ export const BinaryDataCanvas = React.forwardRef<BinaryDataCanvasDerivedElement, | |||||
</pre> | </pre> | ||||
)} | )} | ||||
<div className="highlight"> | <div className="highlight"> | ||||
<pre> | |||||
<pre | |||||
style={{ | |||||
overflow: 'visible', | |||||
padding: 0, | |||||
margin: 0, | |||||
lineHeight: 1.2, | |||||
}} | |||||
> | |||||
<code> | <code> | ||||
{headers && new Array(BYTES_PER_LINE).fill(0).map((_, i) => ( | {headers && new Array(BYTES_PER_LINE).fill(0).map((_, i) => ( | ||||
<span | <span | ||||
@@ -104,7 +127,7 @@ export const BinaryDataCanvas = React.forwardRef<BinaryDataCanvasDerivedElement, | |||||
</pre> | </pre> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
) | |||||
); | |||||
}); | }); | ||||
BinaryDataCanvas.displayName = 'BinaryDataCanvas'; | BinaryDataCanvas.displayName = 'BinaryDataCanvas'; |
@@ -0,0 +1 @@ | |||||
export * from './BinaryDataCanvas'; |
@@ -0,0 +1,21 @@ | |||||
{ | |||||
"exclude": ["node_modules"], | |||||
"include": ["src", "types", "test"], | |||||
"compilerOptions": { | |||||
"module": "ESNext", | |||||
"lib": ["DOM", "ESNext"], | |||||
"importHelpers": true, | |||||
"declaration": true, | |||||
"sourceMap": true, | |||||
"rootDir": "./", | |||||
"strict": true, | |||||
"noUnusedLocals": true, | |||||
"noUnusedParameters": true, | |||||
"noImplicitReturns": true, | |||||
"noFallthroughCasesInSwitch": true, | |||||
"moduleResolution": "node", | |||||
"jsx": "react", | |||||
"esModuleInterop": true, | |||||
"target": "es2018" | |||||
} | |||||
} |
@@ -0,0 +1,21 @@ | |||||
{ | |||||
"exclude": ["node_modules"], | |||||
"include": ["src", "types"], | |||||
"compilerOptions": { | |||||
"module": "ESNext", | |||||
"lib": ["DOM", "ESNext"], | |||||
"importHelpers": true, | |||||
"declaration": true, | |||||
"sourceMap": true, | |||||
"rootDir": "./src", | |||||
"strict": true, | |||||
"noUnusedLocals": true, | |||||
"noUnusedParameters": true, | |||||
"noImplicitReturns": true, | |||||
"noFallthroughCasesInSwitch": true, | |||||
"moduleResolution": "node", | |||||
"jsx": "react", | |||||
"esModuleInterop": true, | |||||
"target": "es2018" | |||||
} | |||||
} |
@@ -0,0 +1,8 @@ | |||||
/// <reference types="vitest" /> | |||||
export default ({ | |||||
test: { | |||||
global: true, | |||||
environment: 'jsdom', | |||||
}, | |||||
}); |
@@ -1,5 +1,5 @@ | |||||
{ | { | ||||
"name": "@modal-soft/text-utils", | |||||
"name": "@modal-sh/text-utils", | |||||
"version": "0.0.0", | "version": "0.0.0", | ||||
"files": [ | "files": [ | ||||
"dist", | "dist", | ||||
@@ -1,5 +1,5 @@ | |||||
{ | { | ||||
"name": "@modal-soft/video-utils", | |||||
"name": "@modal-sh/video-utils", | |||||
"version": "0.0.0", | "version": "0.0.0", | ||||
"files": [ | "files": [ | ||||
"dist", | "dist", | ||||
@@ -30,11 +30,12 @@ | |||||
"tailwindcss": "3.3.2", | "tailwindcss": "3.3.2", | ||||
"typescript": "5.1.3", | "typescript": "5.1.3", | ||||
"wavesurfer.js": "7.0.0-beta.11", | "wavesurfer.js": "7.0.0-beta.11", | ||||
"@modal-soft/audio-utils": "workspace:*", | |||||
"@modal-soft/image-utils": "workspace:*", | |||||
"@modal-soft/text-utils": "workspace:*", | |||||
"@modal-soft/video-utils": "workspace:*", | |||||
"@modal-sh/audio-utils": "workspace:*", | |||||
"@modal-sh/image-utils": "workspace:*", | |||||
"@modal-sh/text-utils": "workspace:*", | |||||
"@modal-sh/video-utils": "workspace:*", | |||||
"@modal-sh/react-utils": "workspace:*", | "@modal-sh/react-utils": "workspace:*", | ||||
"@modal-sh/react-binary-data-canvas": "workspace:*", | |||||
"@tesseract-design/web-base": "workspace:*", | "@tesseract-design/web-base": "workspace:*", | ||||
"@tesseract-design/web-action-react": "workspace:*", | "@tesseract-design/web-action-react": "workspace:*", | ||||
"@tesseract-design/web-color-react": "workspace:*", | "@tesseract-design/web-color-react": "workspace:*", | ||||
@@ -11,10 +11,10 @@ import {useMediaControls} from '../../hooks/interactive'; | |||||
import {useFileMetadata, useFileUrl} from '@/categories/blob/react'; | import {useFileMetadata, useFileUrl} from '@/categories/blob/react'; | ||||
import clsx from 'clsx'; | import clsx from 'clsx'; | ||||
import {SpectrogramCanvas, WaveformCanvas} from '@modal-soft/react-wavesurfer'; | |||||
import {SpectrogramCanvas, WaveformCanvas} from '@modal-sh/react-wavesurfer'; | |||||
import {Slider} from '@tesseract-design/web-number-react'; | import {Slider} from '@tesseract-design/web-number-react'; | ||||
import {KeyValueTable} from '@tesseract-design/web-information-react'; | import {KeyValueTable} from '@tesseract-design/web-information-react'; | ||||
import {useClientSide} from '@modal-soft/react-utils'; | |||||
import {useClientSide} from '@modal-sh/react-utils'; | |||||
import {CommonPreviewProps} from '@/categories/blob/react/common'; | import {CommonPreviewProps} from '@/categories/blob/react/common'; | ||||
export type AudioFilePreviewDerivedElement = HTMLAudioElement; | export type AudioFilePreviewDerivedElement = HTMLAudioElement; | ||||
@@ -4,8 +4,8 @@ import theme from '@/styles/theme'; | |||||
import {useMediaControls} from '../../hooks/interactive'; | import {useMediaControls} from '../../hooks/interactive'; | ||||
import {useFileMetadata, useFileUrl} from '@/categories/blob/react'; | import {useFileMetadata, useFileUrl} from '@/categories/blob/react'; | ||||
import clsx from 'clsx'; | import clsx from 'clsx'; | ||||
import {SpectrogramCanvas, WaveformCanvas} from '@modal-soft/react-wavesurfer'; | |||||
import {useClientSide} from '@modal-soft/react-utils'; | |||||
import {SpectrogramCanvas, WaveformCanvas} from '@modal-sh/react-wavesurfer'; | |||||
import {useClientSide} from '@modal-sh/react-utils'; | |||||
export type AudioMiniFilePreviewDerivedElement = HTMLAudioElement; | export type AudioMiniFilePreviewDerivedElement = HTMLAudioElement; | ||||
@@ -4,8 +4,8 @@ import {formatFileSize, formatNumeral} from '@/utils/numeral'; | |||||
import {useFileMetadata, useFileUrl} from '@/categories/blob/react'; | import {useFileMetadata, useFileUrl} from '@/categories/blob/react'; | ||||
import clsx from 'clsx'; | import clsx from 'clsx'; | ||||
import {KeyValueTable} from '@tesseract-design/web-information-react'; | import {KeyValueTable} from '@tesseract-design/web-information-react'; | ||||
import {BinaryDataCanvas} from '@modal-soft/react-binary-data-canvas'; | |||||
import {useClientSide} from '@modal-soft/react-utils'; | |||||
import {BinaryDataCanvas} from '@modal-sh/react-binary-data-canvas'; | |||||
import {useClientSide} from '@modal-sh/react-utils'; | |||||
import {CommonPreviewProps} from '@/categories/blob/react/common'; | import {CommonPreviewProps} from '@/categories/blob/react/common'; | ||||
export type BinaryFilePreviewDerivedElement = HTMLDivElement; | export type BinaryFilePreviewDerivedElement = HTMLDivElement; | ||||
@@ -7,9 +7,8 @@ import {ImageFilePreview} from '../ImageFilePreview'; | |||||
import {VideoFilePreview} from '../VideoFilePreview'; | import {VideoFilePreview} from '../VideoFilePreview'; | ||||
import {TextFilePreview} from '../TextFilePreview'; | import {TextFilePreview} from '../TextFilePreview'; | ||||
import {AudioMiniFilePreview} from '../AudioMiniFilePreview'; | import {AudioMiniFilePreview} from '../AudioMiniFilePreview'; | ||||
import {delegateTriggerEvent} from '@modal-sh/react-utils'; | |||||
import {delegateTriggerEvent, useClientSide} from '@modal-sh/react-utils'; | |||||
import clsx from 'clsx'; | import clsx from 'clsx'; | ||||
import {useClientSide} from '@modal-soft/react-utils'; | |||||
import {FilePreviewComponent} from '@/categories/blob/react/common'; | import {FilePreviewComponent} from '@/categories/blob/react/common'; | ||||
const FILE_PREVIEW_COMPONENTS: Record<ContentType, FilePreviewComponent> = { | const FILE_PREVIEW_COMPONENTS: Record<ContentType, FilePreviewComponent> = { | ||||
@@ -4,7 +4,7 @@ import {formatFileSize, formatNumeral} from '@/utils/numeral'; | |||||
import clsx from 'clsx'; | import clsx from 'clsx'; | ||||
import {useFileMetadata, useFileUrl, useImageControls} from '@/categories/blob/react'; | import {useFileMetadata, useFileUrl, useImageControls} from '@/categories/blob/react'; | ||||
import {KeyValueTable} from '@tesseract-design/web-information-react'; | import {KeyValueTable} from '@tesseract-design/web-information-react'; | ||||
import {useClientSide} from '@modal-soft/react-utils'; | |||||
import {useClientSide} from '@modal-sh/react-utils'; | |||||
import {CommonPreviewProps} from '@/categories/blob/react/common'; | import {CommonPreviewProps} from '@/categories/blob/react/common'; | ||||
import {Swatch} from '@tesseract-design/web-color-react'; | import {Swatch} from '@tesseract-design/web-color-react'; | ||||
@@ -4,8 +4,8 @@ import {useFileMetadata, useFileUrl} from '@/categories/blob/react'; | |||||
import {augmentTextFile, getMimeTypeDescription} from '@/utils/blob'; | import {augmentTextFile, getMimeTypeDescription} from '@/utils/blob'; | ||||
import clsx from 'clsx'; | import clsx from 'clsx'; | ||||
import {KeyValueTable} from '@tesseract-design/web-information-react'; | import {KeyValueTable} from '@tesseract-design/web-information-react'; | ||||
import {Refractor} from '@modal-soft/react-refractor'; | |||||
import {useClientSide} from '@modal-soft/react-utils'; | |||||
import {Refractor} from '@modal-sh/react-refractor'; | |||||
import {useClientSide} from '@modal-sh/react-utils'; | |||||
import {CommonPreviewProps} from '@/categories/blob/react/common'; | import {CommonPreviewProps} from '@/categories/blob/react/common'; | ||||
type TextFilePreviewDerivedComponent = HTMLDivElement; | type TextFilePreviewDerivedComponent = HTMLDivElement; | ||||
@@ -5,7 +5,7 @@ import {useFileMetadata, useFileUrl, useMediaControls} from '@tesseract-design/w | |||||
import clsx from 'clsx'; | import clsx from 'clsx'; | ||||
import {Slider} from '@tesseract-design/web-number-react'; | import {Slider} from '@tesseract-design/web-number-react'; | ||||
import {KeyValueTable} from '@tesseract-design/web-information-react'; | import {KeyValueTable} from '@tesseract-design/web-information-react'; | ||||
import {useClientSide} from '@modal-soft/react-utils'; | |||||
import {useClientSide} from '@modal-sh/react-utils'; | |||||
import {CommonPreviewProps} from '@/categories/blob/react/common'; | import {CommonPreviewProps} from '@/categories/blob/react/common'; | ||||
export type VideoFilePreviewDerivedComponent = HTMLVideoElement; | export type VideoFilePreviewDerivedComponent = HTMLVideoElement; | ||||
@@ -1,20 +0,0 @@ | |||||
.react-binary-data-canvas { | |||||
display: flex; | |||||
align-items: flex-start; | |||||
} | |||||
.react-binary-data-canvas pre { | |||||
overflow: visible; | |||||
padding: 0; | |||||
margin: 0; | |||||
line-height: 1.2; | |||||
} | |||||
.line-numbers { | |||||
text-align: right; | |||||
user-select: none; | |||||
} | |||||
.code { | |||||
white-space: nowrap; | |||||
} |
@@ -1,18 +0,0 @@ | |||||
import * as React from 'react'; | |||||
export interface UseEnhancedOptions { | |||||
clientSide: boolean; | |||||
initial?: boolean; | |||||
} | |||||
export const useClientSide = (options: UseEnhancedOptions) => { | |||||
const { clientSide: enhancedProp, initial = false } = options; | |||||
const [enhanced, setEnhanced] = React.useState(initial); | |||||
React.useEffect(() => { | |||||
setEnhanced(enhancedProp); | |||||
}, [enhancedProp]); | |||||
return React.useMemo(() => ({ | |||||
clientSide: enhanced, | |||||
}), [enhanced]); | |||||
}; |
@@ -1,4 +1,4 @@ | |||||
import {Refractor} from '@modal-soft/react-refractor'; | |||||
import {Refractor} from '@modal-sh/react-refractor'; | |||||
import {NextPage} from 'next'; | import {NextPage} from 'next'; | ||||
import * as React from 'react'; | import * as React from 'react'; | ||||
import {getFormValues} from '@theoryofnekomata/formxtra'; | import {getFormValues} from '@theoryofnekomata/formxtra'; | ||||
@@ -25,7 +25,7 @@ const BlogPostPage: NextPage = () => { | |||||
Using Refractor on your Next website | Using Refractor on your Next website | ||||
</h1> | </h1> | ||||
<p> | <p> | ||||
Use <code>@modal-soft/react-refractor</code> as follows on your page: | |||||
Use <code>@modal-sh/react-refractor</code> as follows on your page: | |||||
</p> | </p> | ||||
</div> | </div> | ||||
<div className="bg-shade/20 overflow-auto pt-4 pb-8 text-sm"> | <div className="bg-shade/20 overflow-auto pt-4 pb-8 text-sm"> | ||||
@@ -38,7 +38,7 @@ const BlogPostPage: NextPage = () => { | |||||
actions={ | actions={ | ||||
<></> | <></> | ||||
} | } | ||||
code={`import {Refractor} from '@modal-soft/react-refractor'; | |||||
code={`import {Refractor} from '@modal-sh/react-refractor'; | |||||
import {NextPage} from 'next'; | import {NextPage} from 'next'; | ||||
const BlogPostPage: NextPage = () => { | const BlogPostPage: NextPage = () => { | ||||
@@ -47,7 +47,7 @@ const BlogPostPage: NextPage = () => { | |||||
<Refractor | <Refractor | ||||
language="tsx" | language="tsx" | ||||
code={\` | code={\` | ||||
import {Refractor} from '@modal-soft/react-refractor'; | |||||
import {Refractor} from '@modal-sh/react-refractor'; | |||||
\`} | \`} | ||||
/> | /> | ||||
</div> | </div> | ||||
@@ -1,8 +1,8 @@ | |||||
import * as mimeTypes from 'mime-types'; | import * as mimeTypes from 'mime-types'; | ||||
import {getTextMetadata, TextMetadata} from '@modal-soft/text-utils'; | |||||
import {getMetadataFromUrl as getImageMetadataFromUrl, ImageMetadata} from '@modal-soft/image-utils'; | |||||
import {getMetadataFromUrl as getAudioMetadataFromUrl, AudioMetadata} from '@modal-soft/audio-utils'; | |||||
import {getMetadataFromUrl as getVideoMetadataFromUrl, VideoMetadata} from '@modal-soft/video-utils'; | |||||
import {getTextMetadata, TextMetadata} from '@modal-sh/text-utils'; | |||||
import {getMetadataFromUrl as getImageMetadataFromUrl, ImageMetadata} from '@modal-sh/image-utils'; | |||||
import {getMetadataFromUrl as getAudioMetadataFromUrl, AudioMetadata} from '@modal-sh/audio-utils'; | |||||
import {getMetadataFromUrl as getVideoMetadataFromUrl, VideoMetadata} from '@modal-sh/video-utils'; | |||||
const MIME_TYPE_DESCRIPTIONS = { | const MIME_TYPE_DESCRIPTIONS = { | ||||
'image/gif': 'GIF Image', | 'image/gif': 'GIF Image', | ||||
@@ -18,8 +18,7 @@ | |||||
"@/*": ["./src/*"], | "@/*": ["./src/*"], | ||||
"tailwind.config": ["./tailwind.config.js"], | "tailwind.config": ["./tailwind.config.js"], | ||||
"@tesseract-design/web-blob-react": ["./src/categories/blob/react"], | "@tesseract-design/web-blob-react": ["./src/categories/blob/react"], | ||||
"@tesseract-design/web-number-react": ["./src/categories/number/react"], | |||||
"@modal-soft/*": ["./src/packages/*"], | |||||
"@modal-sh/*": ["./src/packages/*"], | |||||
} | } | ||||
}, | }, | ||||
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"], | "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"], | ||||
@@ -572,6 +572,51 @@ importers: | |||||
specifier: ^0.28.1 | specifier: ^0.28.1 | ||||
version: 0.28.1(jsdom@21.1.0) | version: 0.28.1(jsdom@21.1.0) | ||||
packages/react-binary-data-canvas: | |||||
devDependencies: | |||||
'@testing-library/jest-dom': | |||||
specifier: ^5.16.5 | |||||
version: 5.16.5 | |||||
'@testing-library/react': | |||||
specifier: ^13.4.0 | |||||
version: 13.4.0(react-dom@18.2.0)(react@18.2.0) | |||||
'@types/node': | |||||
specifier: ^18.14.1 | |||||
version: 18.14.1 | |||||
'@types/react': | |||||
specifier: ^18.0.27 | |||||
version: 18.2.14 | |||||
eslint: | |||||
specifier: ^8.35.0 | |||||
version: 8.43.0 | |||||
eslint-config-lxsmnsyc: | |||||
specifier: ^0.5.0 | |||||
version: 0.5.0(eslint@8.43.0)(typescript@4.9.5) | |||||
jsdom: | |||||
specifier: ^21.1.0 | |||||
version: 21.1.0 | |||||
pridepack: | |||||
specifier: 2.4.4 | |||||
version: 2.4.4(eslint@8.43.0)(tslib@2.6.0)(typescript@4.9.5) | |||||
react: | |||||
specifier: ^18.2.0 | |||||
version: 18.2.0 | |||||
react-dom: | |||||
specifier: ^18.2.0 | |||||
version: 18.2.0(react@18.2.0) | |||||
react-test-renderer: | |||||
specifier: ^18.2.0 | |||||
version: 18.2.0(react@18.2.0) | |||||
tslib: | |||||
specifier: ^2.5.0 | |||||
version: 2.6.0 | |||||
typescript: | |||||
specifier: ^4.9.5 | |||||
version: 4.9.5 | |||||
vitest: | |||||
specifier: ^0.28.1 | |||||
version: 0.28.1(jsdom@21.1.0) | |||||
packages/react-utils: | packages/react-utils: | ||||
devDependencies: | devDependencies: | ||||
'@testing-library/jest-dom': | '@testing-library/jest-dom': | ||||
@@ -677,19 +722,22 @@ importers: | |||||
packages/web-kitchensink-reactnext: | packages/web-kitchensink-reactnext: | ||||
dependencies: | dependencies: | ||||
'@modal-sh/react-utils': | |||||
specifier: workspace:* | |||||
version: link:../react-utils | |||||
'@modal-soft/audio-utils': | |||||
'@modal-sh/audio-utils': | |||||
specifier: workspace:* | specifier: workspace:* | ||||
version: link:../audio-utils | version: link:../audio-utils | ||||
'@modal-soft/image-utils': | |||||
'@modal-sh/image-utils': | |||||
specifier: workspace:* | specifier: workspace:* | ||||
version: link:../image-utils | version: link:../image-utils | ||||
'@modal-soft/text-utils': | |||||
'@modal-sh/react-binary-data-canvas': | |||||
specifier: workspace:* | |||||
version: link:../react-binary-data-canvas | |||||
'@modal-sh/react-utils': | |||||
specifier: workspace:* | |||||
version: link:../react-utils | |||||
'@modal-sh/text-utils': | |||||
specifier: workspace:* | specifier: workspace:* | ||||
version: link:../text-utils | version: link:../text-utils | ||||
'@modal-soft/video-utils': | |||||
'@modal-sh/video-utils': | |||||
specifier: workspace:* | specifier: workspace:* | ||||
version: link:../video-utils | version: link:../video-utils | ||||
'@tesseract-design/web-action-react': | '@tesseract-design/web-action-react': | ||||