Skip to content

Commit

Permalink
ts config paths
Browse files Browse the repository at this point in the history
  • Loading branch information
gajda-w committed May 19, 2022
1 parent 0383f48 commit 53b85b4
Show file tree
Hide file tree
Showing 85 changed files with 287 additions and 227 deletions.
119 changes: 119 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"react-dom": "^16.14.0",
"style-loader": "0.23.1",
"ts-loader": "^6.2.2",
"tsconfig-paths-webpack-plugin": "^3.5.2",
"typescript": "^3.9.10",
"url-loader": "^2.3.0",
"webpack": "^4.46.0",
Expand Down
2 changes: 2 additions & 0 deletions sandbox/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ var sourcePath = path.join(__dirname, "./");
var outPath = path.join(__dirname, "../public");
var HtmlWebpackPlugin = require("html-webpack-plugin");
var WebpackCleanupPlugin = require("webpack-cleanup-plugin");
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
// const config = require('./config.js')

module.exports = {
Expand All @@ -20,6 +21,7 @@ module.exports = {
target: "web",
mode: "development",
resolve: {
plugins: [new TsconfigPathsPlugin({/* options: see below */})],
extensions: [".js", ".jsx", ".ts", ".tsx"],
mainFields: ["module", "browser", "main"],
alias: {
Expand Down
2 changes: 1 addition & 1 deletion src/components/atoms/ButtonSimple.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from "react";
import * as styles from "../styles/ButtonSimple";
import * as styles from "@styles/ButtonSimple";
export interface ButtonSimpleProps {
onClick: () => void;
children: React.ReactNode;
Expand Down
4 changes: 2 additions & 2 deletions src/components/atoms/Checkbox.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from "react";
import classnames from "classnames";
import { CheckBox } from "../icons";
import * as styles from "../styles/CheckboxStyles";
import { CheckBox } from "@components/icons"
import * as styles from "@styles/CheckboxStyles";

export interface ICheckBoxProps {
value?: boolean;
Expand Down
2 changes: 1 addition & 1 deletion src/components/atoms/IconButton.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from "react";
import * as styles from "../styles/IconButton";
import * as styles from "@styles/IconButton";
export interface IconButtonProps {
onClick: () => void;
children: React.ReactNode;
Expand Down
2 changes: 1 addition & 1 deletion src/components/editor/ColumnComponent.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";
import { PartialObjects } from "../../graphql-zeus";
import { PartialObjects } from "@/graphql-zeus";
import { FeatureComponent } from "./FeatureComponent";
import * as styles from "./styles/Column";
import { Controls } from "./Controls";
Expand Down
6 changes: 3 additions & 3 deletions src/components/editor/ColumnsComponent.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React from "react";
import { PartialObjects } from "../../graphql-zeus";
import { PartialObjects } from "@/graphql-zeus";
import * as styles from "./styles/Columns";
import { ColumnComponent } from "./ColumnComponent";
import { Colors } from "../../Colors";
import { Colors } from "@/Colors";
import { Resizable } from "re-resizable";
import { translated } from "../../models";
import { translated } from "@/models";
import * as Icons from "react-feather";
import * as styles1 from "./styles/Feature";
import cx from "classnames";
Expand Down
4 changes: 2 additions & 2 deletions src/components/editor/Controls.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React, { useState } from "react";
import * as styles from "./styles/Controls";
import { BuiltInStyles, PartialObjects } from "../../graphql-zeus";
import { BuiltInStyles, PartialObjects } from "@/graphql-zeus";
import { PlusCircle, MinusCircle } from "react-feather";
import { translated } from "../../models";
import { translated } from "@/models";
export interface ControlsProps {
features: PartialObjects["Feature"][];
mutateWholeObject: () => void;
Expand Down
4 changes: 2 additions & 2 deletions src/components/editor/DocumentComponent.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import * as React from "react";
import { PartialObjects } from "../../graphql-zeus";
import { PartialObjects } from "@/graphql-zeus";
import { Editor } from "..";
import { Rolloutable } from "./display/Rolloutable";
import { Confirm } from "../molecules/Confirm";
import { Confirm } from "@components/molecules/Confirm";
import * as Icons from "react-feather";
import * as styles from "./styles/Feature";
import cx from "classnames";
Expand Down
2 changes: 1 addition & 1 deletion src/components/editor/EmptyFeatureComponent.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from "react";
import { PartialObjects } from "../../graphql-zeus";
import { PartialObjects } from "@/graphql-zeus";
import { Controls } from "./Controls";
export interface EmptyFeatureComponentProps {
feature: PartialObjects["Feature"];
Expand Down
4 changes: 2 additions & 2 deletions src/components/editor/FeatureComponent.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import * as React from "react";
import { PartialObjects } from "../../graphql-zeus";
import { PartialObjects } from "@/graphql-zeus";
import {
isTextBlock,
isImage,
isStack,
isListBlock,
isTableBlock,
isTimeStamp
} from "../../utils";
} from "@/utils";
import { TextBlockComponent } from "./TextBlockComponent";
import { ImageComponent } from "./ImageComponent";
import { StackComponent } from "./StackComponent";
Expand Down
18 changes: 9 additions & 9 deletions src/components/editor/ImageComponent.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import React, { useState } from "react";
import { PartialObjects } from "../../graphql-zeus";
import { PartialObjects } from "@/graphql-zeus";
import * as styles from "./styles/Image";
import { translated } from "../../models";
import { MAX_IMAGE_WIDTH } from "../../constants";
import { translated } from "@/models";
import { MAX_IMAGE_WIDTH } from "@/constants";
import {
DeleteAndEditIconsComponentProps,
DeleteAndEditIconsComponent
} from "./display/DeleteAndEdit";

import { TopMenuProps, TopMenu } from "../../topmenu/index";
import { TopMenuProps, TopMenu } from "@/topmenu/index";

const t = translated("ImageComponentTxt");

Expand All @@ -25,7 +25,7 @@ function getBase64(file: Blob): Promise<string> {
}
export interface ImageComponentProps
extends DeleteAndEditIconsComponentProps,
TopMenuProps {
TopMenuProps {
image: PartialObjects["Image"];
onChange: () => void;
}
Expand All @@ -44,10 +44,10 @@ export const ImageComponent = ({
<div>
<div
className={styles.ImageTitleDiv}
// style={{
// display: "flex",
// justifyContent: "center"
// }}
// style={{
// display: "flex",
// justifyContent: "center"
// }}
>
<p className={styles.ImageTitle}>{t("ImageTitle")}</p>

Expand Down
26 changes: 13 additions & 13 deletions src/components/editor/ListBlockComponent.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import * as React from "react";
import { PartialObjects } from "../../graphql-zeus";
import { PartialObjects } from "@/graphql-zeus";
import { FeatureComponent } from "./FeatureComponent";
import { Controls } from "./Controls";
import {
Rolloutable,
} from "./display/Rolloutable";
import { DeleteAndEditIconsComponentProps } from "./display/DeleteAndEdit";
import { swapInArray } from "../../utils";
import { translated } from "../../models";
import { TopMenu } from "../../topmenu/index";
import { swapInArray } from "@/utils";
import { translated } from "@/models";
import { TopMenu } from "@/topmenu/index";
// import { TextBlockComponentProps } from "livepdf/livecomponents/editor";
export interface ListBlockComponentProps extends DeleteAndEditIconsComponentProps {
listBlock: PartialObjects["ListBlock"];
Expand All @@ -20,7 +20,7 @@ export interface ListBlockComponentProps extends DeleteAndEditIconsComponentProp
const t = translated("ListBlockComponentTxt");

export const ListBlockComponent = (props: ListBlockComponentProps) => {
const { onChange,onEdit,listBlock } = props;
const { onChange, onEdit, listBlock } = props;
return (
<Rolloutable title={t("TitleList")} {...props}>
<TopMenu editedFeature={listBlock} onChange={onChange} />
Expand All @@ -39,25 +39,25 @@ export const ListBlockComponent = (props: ListBlockComponentProps) => {
onMoveDown={
index !== listBlock.items!.length - 1
? () => {
swapInArray(listBlock.items!, index, index + 1);
onChange();
}
swapInArray(listBlock.items!, index, index + 1);
onChange();
}
: undefined
}
onMoveUp={
index !== 0 && listBlock.items!.length > 1
? () => {
swapInArray(listBlock.items!, index, index - 1);
onChange();
}
swapInArray(listBlock.items!, index, index - 1);
onChange();
}
: undefined
}
/>
);
})}
{listBlock.items && (
<Controls 
parent={listBlock}
<Controls
parent={listBlock}
features={listBlock.items}
mutateWholeObject={onChange}
clean={() => {
Expand Down
20 changes: 10 additions & 10 deletions src/components/editor/StackComponent.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import * as React from "react";
import { PartialObjects } from "../../graphql-zeus";
import { PartialObjects } from "@/graphql-zeus";
import { FeatureComponent } from "./FeatureComponent";
import { Controls } from "./Controls";
import { Rolloutable } from "./display/Rolloutable";
import { DeleteAndEditIconsComponentProps } from "./display/DeleteAndEdit";
import { swapInArray } from "../../utils";
import { translated } from "../../models";
import { TopMenu } from "../../topmenu/index";
import { swapInArray } from "@/utils";
import { translated } from "@/models";
import { TopMenu } from "@/topmenu/index";
export interface StackComponentProps extends DeleteAndEditIconsComponentProps {
stack: PartialObjects["Stack"];
onChange: () => void;
Expand Down Expand Up @@ -38,17 +38,17 @@ export const StackComponent = (props: StackComponentProps) => {
onMoveDown={
index !== stack.items!.length - 1
? () => {
swapInArray(stack.items!, index, index + 1);
onChange();
}
swapInArray(stack.items!, index, index + 1);
onChange();
}
: undefined
}
onMoveUp={
index !== 0 && stack.items!.length > 1
? () => {
swapInArray(stack.items!, index, index - 1);
onChange();
}
swapInArray(stack.items!, index, index - 1);
onChange();
}
: undefined
}
/>
Expand Down
Loading

0 comments on commit 53b85b4

Please sign in to comment.