Fix types build
This commit is contained in:
parent
a84861140b
commit
6e9e5c53ef
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@staticcms/core",
|
"name": "@staticcms/core",
|
||||||
"version": "1.0.0-alpha32",
|
"version": "1.0.0-alpha33",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"description": "Static CMS core application.",
|
"description": "Static CMS core application.",
|
||||||
"repository": "https://github.com/StaticJsCMS/static-cms",
|
"repository": "https://github.com/StaticJsCMS/static-cms",
|
||||||
@ -13,7 +13,7 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"build:webpack": "webpack",
|
"build:webpack": "webpack",
|
||||||
"build:types": "tsc",
|
"build:types": "tsc",
|
||||||
"build": "cross-env NODE_ENV=production run-s build:webpack build:types",
|
"build": "cross-env NODE_ENV=production run-s clean build:webpack build:types",
|
||||||
"clean": "rimraf dist dev-test/dist",
|
"clean": "rimraf dist dev-test/dist",
|
||||||
"develop": "webpack serve",
|
"develop": "webpack serve",
|
||||||
"format:prettier": "prettier \"{{src,scripts,website}/**/,}*.{js,jsx,ts,tsx,css}\"",
|
"format:prettier": "prettier \"{{src,scripts,website}/**/,}*.{js,jsx,ts,tsx,css}\"",
|
||||||
|
@ -1,67 +1,11 @@
|
|||||||
import React, { useCallback, useEffect, useState } from 'react';
|
|
||||||
import { css } from '@emotion/react';
|
|
||||||
import { styled } from '@mui/material/styles';
|
|
||||||
import copyToClipboard from 'copy-text-to-clipboard';
|
|
||||||
import Button from '@mui/material/Button';
|
import Button from '@mui/material/Button';
|
||||||
|
import copyToClipboard from 'copy-text-to-clipboard';
|
||||||
|
import React, { useCallback, useEffect, useState } from 'react';
|
||||||
|
|
||||||
import { buttons, shadows, zIndex } from '../../components/UI/styles';
|
|
||||||
import { isAbsolutePath } from '../../lib/util';
|
import { isAbsolutePath } from '../../lib/util';
|
||||||
import { FileUploadButton } from '../UI';
|
|
||||||
|
|
||||||
import type { TranslatedProps } from '../../interface';
|
import type { TranslatedProps } from '../../interface';
|
||||||
|
|
||||||
const styles = {
|
|
||||||
button: css`
|
|
||||||
${buttons.button};
|
|
||||||
${buttons.default};
|
|
||||||
display: inline-block;
|
|
||||||
margin-left: 15px;
|
|
||||||
margin-right: 2px;
|
|
||||||
|
|
||||||
&[disabled] {
|
|
||||||
${buttons.disabled};
|
|
||||||
cursor: default;
|
|
||||||
}
|
|
||||||
`,
|
|
||||||
};
|
|
||||||
|
|
||||||
export const UploadButton = styled(FileUploadButton)`
|
|
||||||
${styles.button};
|
|
||||||
${buttons.gray};
|
|
||||||
${shadows.dropMain};
|
|
||||||
margin-bottom: 0;
|
|
||||||
|
|
||||||
span {
|
|
||||||
font-size: 14px;
|
|
||||||
font-weight: 500;
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
input {
|
|
||||||
height: 0.1px;
|
|
||||||
width: 0.1px;
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
opacity: 0;
|
|
||||||
overflow: hidden;
|
|
||||||
position: absolute;
|
|
||||||
z-index: ${zIndex.zIndex0};
|
|
||||||
outline: none;
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
|
|
||||||
export const DeleteButton = styled('button')`
|
|
||||||
${styles.button};
|
|
||||||
${buttons.lightRed};
|
|
||||||
`;
|
|
||||||
|
|
||||||
export const InsertButton = styled('button')`
|
|
||||||
${styles.button};
|
|
||||||
${buttons.green};
|
|
||||||
`;
|
|
||||||
|
|
||||||
export interface CopyToClipBoardButtonProps {
|
export interface CopyToClipBoardButtonProps {
|
||||||
disabled: boolean;
|
disabled: boolean;
|
||||||
draft?: boolean;
|
draft?: boolean;
|
||||||
|
@ -3,8 +3,10 @@ import Button from '@mui/material/Button';
|
|||||||
import DialogTitle from '@mui/material/DialogTitle';
|
import DialogTitle from '@mui/material/DialogTitle';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import { CopyToClipBoardButton, UploadButton } from './MediaLibraryButtons';
|
import { CopyToClipBoardButton } from './MediaLibraryButtons';
|
||||||
import MediaLibrarySearch from './MediaLibrarySearch';
|
import MediaLibrarySearch from './MediaLibrarySearch';
|
||||||
|
import { buttons, shadows, zIndex } from '../../components/UI/styles';
|
||||||
|
import FileUploadButton from '../UI/FileUploadButton';
|
||||||
|
|
||||||
import type { ChangeEvent, ChangeEventHandler, KeyboardEventHandler } from 'react';
|
import type { ChangeEvent, ChangeEventHandler, KeyboardEventHandler } from 'react';
|
||||||
import type { MediaFile, TranslatedProps } from '../../interface';
|
import type { MediaFile, TranslatedProps } from '../../interface';
|
||||||
@ -27,6 +29,43 @@ const StyledDialogTitle = styled(DialogTitle)`
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
const UploadButton = styled(FileUploadButton)`
|
||||||
|
${buttons.button};
|
||||||
|
${buttons.default};
|
||||||
|
display: inline-block;
|
||||||
|
margin-left: 15px;
|
||||||
|
margin-right: 2px;
|
||||||
|
|
||||||
|
&[disabled] {
|
||||||
|
${buttons.disabled};
|
||||||
|
cursor: default;
|
||||||
|
}
|
||||||
|
|
||||||
|
${buttons.gray};
|
||||||
|
${shadows.dropMain};
|
||||||
|
margin-bottom: 0;
|
||||||
|
|
||||||
|
span {
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 500;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
input {
|
||||||
|
height: 0.1px;
|
||||||
|
width: 0.1px;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
opacity: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
position: absolute;
|
||||||
|
z-index: ${zIndex.zIndex0};
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
export interface MediaLibraryTopProps {
|
export interface MediaLibraryTopProps {
|
||||||
onClose: () => void;
|
onClose: () => void;
|
||||||
forImage?: boolean;
|
forImage?: boolean;
|
||||||
|
@ -94,4 +94,4 @@ const Icon = ({ type, direction, width, height, size = 'medium', className }: Ic
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default styled(Icon)``;
|
export default Icon;
|
||||||
|
@ -1,7 +1,18 @@
|
|||||||
|
import React from 'react';
|
||||||
import { styled } from '@mui/material/styles';
|
import { styled } from '@mui/material/styles';
|
||||||
|
|
||||||
const WidgetPreviewContainer = styled('div')`
|
import type { ReactNode } from 'react';
|
||||||
|
|
||||||
|
const StyledWidgetPreviewContainer = styled('div')`
|
||||||
margin: 15px 2px;
|
margin: 15px 2px;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
interface WidgetPreviewContainerProps {
|
||||||
|
children?: ReactNode;
|
||||||
|
}
|
||||||
|
|
||||||
|
const WidgetPreviewContainer = ({ children }: WidgetPreviewContainerProps) => {
|
||||||
|
return <StyledWidgetPreviewContainer>{children}</StyledWidgetPreviewContainer>;
|
||||||
|
};
|
||||||
|
|
||||||
export default WidgetPreviewContainer;
|
export default WidgetPreviewContainer;
|
||||||
|
@ -1,3 +1,2 @@
|
|||||||
export { default as ErrorBoundary } from './ErrorBoundary';
|
export { default as ErrorBoundary } from './ErrorBoundary';
|
||||||
export { default as FileUploadButton } from './FileUploadButton';
|
|
||||||
export { default as SettingsDropdown } from './SettingsDropdown';
|
export { default as SettingsDropdown } from './SettingsDropdown';
|
||||||
|
@ -2,14 +2,14 @@
|
|||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"declaration": true,
|
"declaration": true,
|
||||||
"declarationDir": "dist",
|
"declarationDir": "dist",
|
||||||
"emitDeclarationOnly": false,
|
"emitDeclarationOnly": true,
|
||||||
"jsx": "react",
|
"jsx": "react",
|
||||||
"target": "esnext",
|
"target": "esnext",
|
||||||
"module": "esnext",
|
"module": "esnext",
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "node",
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
"preserveSymlinks": true,
|
"preserveSymlinks": true,
|
||||||
"noEmit": true,
|
"noEmit": false,
|
||||||
"strict": true,
|
"strict": true,
|
||||||
"isolatedModules": true,
|
"isolatedModules": true,
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user