Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
edenvidal committed Jul 11, 2024
2 parents 13ed81c + f3b8273 commit 3cfc5af
Show file tree
Hide file tree
Showing 179 changed files with 1,605 additions and 1,550 deletions.
Empty file removed .example.env
Empty file.
5 changes: 0 additions & 5 deletions .preetierignore

This file was deleted.

1 change: 0 additions & 1 deletion .prettierrc.json

This file was deleted.

1 change: 1 addition & 0 deletions CNAME
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rnbw.design
14 changes: 0 additions & 14 deletions actions/turnInto.action.ts

This file was deleted.

16 changes: 0 additions & 16 deletions src/_node/file/handlers/constants.ts

This file was deleted.

2 changes: 0 additions & 2 deletions src/_node/file/handlers/index.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/_redux/main/codeView/slice.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { createSlice, PayloadAction } from "@reduxjs/toolkit";

import { TCodeViewReducerState } from "./types";
import { TNodeUid } from "@_node/types";
import { TNodeUid } from "@_api/types";

const codeViewReducerInitialState: TCodeViewReducerState = {
editingNodeUid: null,
Expand Down
2 changes: 1 addition & 1 deletion src/_redux/main/codeView/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { TNodeUid } from "@_node/types";
import { TNodeUid } from "@_api/types";

export type TCodeViewReducerState = {
editingNodeUid: TNodeUid | null;
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { createSlice, PayloadAction } from "@reduxjs/toolkit";

import { StageViewSyncConfigs, TStageViewReducerState } from "./types";
import { DesignViewSyncConfigs, TDesignViewReducerState } from "./types";

const stageViewReducerInitialState: TStageViewReducerState = {
const DesignViewReducerInitialState: TDesignViewReducerState = {
iframeSrc: null,
iframeLoading: false,
linkToOpen: null,
syncConfigs: {},
};
const stageViewSlice = createSlice({
name: "stageView",
initialState: stageViewReducerInitialState,
const DesignViewSlice = createSlice({
name: "DesignView",
initialState: DesignViewReducerInitialState,
reducers: {
setIframeSrc(state, actions: PayloadAction<string | null>) {
const iframeSrc = actions.payload;
Expand All @@ -24,12 +24,12 @@ const stageViewSlice = createSlice({
const linkToOpen = actions.payload;
state.linkToOpen = linkToOpen;
},
setSyncConfigs(state, action: PayloadAction<StageViewSyncConfigs>) {
setSyncConfigs(state, action: PayloadAction<DesignViewSyncConfigs>) {
const syncConfigs = action.payload;
state.syncConfigs = syncConfigs;
},
},
});
export const { setIframeSrc, setIframeLoading, setLinkToOpen, setSyncConfigs } =
stageViewSlice.actions;
export const StageViewReducer = stageViewSlice.reducer;
DesignViewSlice.actions;
export const DesignViewReducer = DesignViewSlice.reducer;
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
export type TStageViewReducerState = {
export type TDesignViewReducerState = {
iframeSrc: string | null;
iframeLoading: boolean;
linkToOpen: string | null;
syncConfigs: StageViewSyncConfigs;
syncConfigs: DesignViewSyncConfigs;
};

export type StageViewSyncConfigs = {
export type DesignViewSyncConfigs = {
matchIds?: string[] | null;
skipFromChildren?: boolean;
};
2 changes: 1 addition & 1 deletion src/_redux/main/fileTree/event/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { TNodeUid } from "@_node/types";
import { TNodeUid } from "@_api/types";

export type TFileEventReducerState = {
fileAction: TFileAction;
Expand Down
4 changes: 2 additions & 2 deletions src/_redux/main/fileTree/slice.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { TFileNode, TFileNodeTreeData } from "@_node/index";
import { TNodeUid } from "@_node/types";
import { TFileNode, TFileNodeTreeData } from "@_api/index";
import { TNodeUid } from "@_api/types";
import { createSlice, PayloadAction } from "@reduxjs/toolkit";

import { TUpdateTreeViewStatePayload } from "../types";
Expand Down
4 changes: 2 additions & 2 deletions src/_redux/main/fileTree/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { TFileNodeTreeData } from "@_node/index";
import { TNodeUid } from "@_node/types";
import { TFileNodeTreeData } from "@_api/index";
import { TNodeUid } from "@_api/types";

import { TTreeViewState } from "../types";
import { TFileAction } from "./event";
Expand Down
2 changes: 1 addition & 1 deletion src/_redux/main/nodeTree/event/slice.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import undoable from "redux-undo";

import { TNodeUid } from "@_node/types";
import { TNodeUid } from "@_api/types";
import { createSlice, PayloadAction } from "@reduxjs/toolkit";

import {
Expand Down
2 changes: 1 addition & 1 deletion src/_redux/main/nodeTree/event/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { TNodeUid } from "@_node/types";
import { TNodeUid } from "@_api/types";

export type TNodeEventReducerState = {
currentFileContent: string;
Expand Down
6 changes: 3 additions & 3 deletions src/_redux/main/nodeTree/slice.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { TNodeTreeData, TNodeUid } from "@_node/types";
import { TNodeTreeData, TNodeUid } from "@_api/types";
import { createSlice, PayloadAction } from "@reduxjs/toolkit";

import { TUpdateTreeViewStatePayload } from "../types";
import { TNodeTreeReducerState } from "./types";
import { TCodeSelection } from "@_components/main/codeView";
import { getValidNodeTree } from "@_pages/main/processor/helpers";
import { TCodeSelection } from "@src/codeView";
import { getValidNodeTree } from "@src/processor/helpers";

const nodeTreeReducerInitialState: TNodeTreeReducerState = {
nodeTree: {},
Expand Down
4 changes: 2 additions & 2 deletions src/_redux/main/nodeTree/types.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { TNodeTreeData, TNodeUid } from "@_node/types";
import { TNodeTreeData, TNodeUid } from "@_api/types";

import { TTreeViewState } from "../types";
import { TCodeSelection } from "@_components/main/codeView";
import { TCodeSelection } from "@src/codeView";

export type TNodeTreeReducerState = {
nodeTree: TNodeTreeData;
Expand Down
2 changes: 1 addition & 1 deletion src/_redux/main/processor/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { TNodeUid } from "@_node/index";
import { TNodeUid } from "@_api/index";

export type TProcessorReducerState = {
navigatorDropdownType: TNavigatorDropdownType;
Expand Down
2 changes: 1 addition & 1 deletion src/_redux/main/project/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { TNodeUid } from "@_node/types";
import { TNodeUid } from "@_api/types";
import { TProjectContext } from "../fileTree";

export type TFileHandlerCollection = {
Expand Down
4 changes: 2 additions & 2 deletions src/_redux/main/slice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import { NodeTreeReducer } from "./nodeTree";
import { NodeEventReducer } from "./nodeTree/event";
import { ProcessorReduer } from "./processor";
import { ReferenceReducer } from "./reference";
import { StageViewReducer } from "./stageView";
import { ProjectReducer } from "./project";

import { persistReducer } from "redux-persist";
import createWebStorage from "redux-persist/es/storage/createWebStorage";
import { DesignViewReducer } from "./designView";

export function createPersistStore() {
const isServer = typeof window === "undefined";
Expand Down Expand Up @@ -57,5 +57,5 @@ export const MainReducer = combineReducers({

codeView: CodeViewReducer,

stageView: StageViewReducer,
designView: DesignViewReducer,
});
2 changes: 1 addition & 1 deletion src/_redux/main/types.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { MutableRefObject } from "react";
import { editor } from "monaco-editor";

import { TNodeUid, TValidNodeUid } from "@_node/types";
import { TNodeUid, TValidNodeUid } from "@_api/types";

import { TFileAction, TProjectContext } from "./fileTree";

Expand Down
2 changes: 1 addition & 1 deletion src/_redux/useAppState.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export const useAppState = () => {
present: { currentFileContent, selectedNodeUids, currentFileUid },
future: nodeEventFuture,
},
stageView: { iframeSrc, iframeLoading, linkToOpen, syncConfigs },
designView: { iframeSrc, iframeLoading, linkToOpen, syncConfigs },
codeView: {
editingNodeUid: editingNodeUidInCodeView,
codeViewTabSize,
Expand Down
2 changes: 1 addition & 1 deletion src/actions/useFormatCode.action.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Range, editor } from "monaco-editor";
// once when the action is executed, this improves the History Management
const helperModel = editor.createModel("", "html");

import { sortUidsByMaxEndIndex } from "@_components/main/actionsPanel/nodeTreeView/helpers";
import { sortUidsByMaxEndIndex } from "@src/sidebarView/nodeTreeView/helpers";
import { useAppState } from "@_redux/useAppState";
import { PrettyCode } from "@_services/useElementsHelper";

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { FileSystemFileHandle } from "file-system-access";

import { verifyFileHandlerPermission } from "@_services/main";
import { verifyFileHandlerPermission } from "../../rnbw";

import {
TFileHandlerCollection,
Expand Down
2 changes: 1 addition & 1 deletion src/_node/file/actions.ts → src/api/file/actions.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { LogAllow } from "@_constants/global";
import { LogAllow } from "@src/rnbwTSX";
import { TProjectContext } from "@_redux/main/fileTree";

import { TFileHandlerCollection, TFileNodeTreeData, TNodeUid } from "../";
Expand Down
8 changes: 4 additions & 4 deletions src/_node/file/apis.ts → src/api/file/apis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ import { Buffer } from "buffer";
import { FileSystemFileHandle } from "file-system-access";
import JSZip from "jszip";

import { LogAllow } from "@_constants/global";
import { LogAllow } from "@src/rnbwTSX";
import {
ParsableFileTypes,
RootNodeUid,
StagePreviewPathPrefix,
} from "@_constants/main";
} from "@src/rnbwTSX";
import { TOsType } from "@_redux/global";
import { SystemDirectories } from "@_ref/SystemDirectories";
import { verifyFileHandlerPermission } from "@_services/main";
import { SystemDirectories } from "../../commandMenu/SystemDirectories";
import { verifyFileHandlerPermission } from "../../rnbw";

import {
fileHandlers,
Expand Down
35 changes: 22 additions & 13 deletions src/_node/file/handlers/handlers.ts → src/api/file/handlers.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,33 @@
import * as parse5 from "parse5";

import { RainbowAppName } from "@_constants/global";
import { RootNodeUid } from "@_constants/main";

import { TFileParserResponse, TNodeUid, TValidNodeUid } from "../../";
import { RainbowAppName } from "@src/rnbwTSX";
import { RootNodeUid } from "@src/rnbwTSX";
import { TFileParserResponse, TNodeUid, TValidNodeUid } from "..";
import {
THtmlDomNode,
THtmlNode,
THtmlNodeAttribs,
THtmlNodeTreeData,
THtmlParserResponse,
} from "../../node/type/html";
import {
DataSequencedUid,
StageNodeIdAttr,
PARSING_ERROR_MESSAGES,
ValidStageNodeUid,
} from "./constants";
} from "../node/type/html";
import { toast } from "react-toastify";

export const StageNodeIdAttr = "data-rnbw-stage-node-id";
export const PreserveRnbwNode = "data-rnbw-preserve-node";
export const DataSequencedUid = "data-sequenced-uid";
export const ValidStageNodeUid = "data-rnbw-stage-valid-uid";

export const PARSING_ERROR_MESSAGES: Record<string, string> = {
"unexpected-solidus-in-tag": "Unexpected symbol in tag",
"missing-end-tag-name": "Missing end tag name",
"end-tag-with-trailing-solidus": "end-tag-with-trailing-solidus",
"missing-attribute-value": "Missing attribute value",
"duplicate-attribute": "Duplicate attribute",
"invalid-character-sequence-after-doctype-name":
"Invalid character sequence after doctype name",
"missing-doctype": "Missing doctype",
"abrupt-closing-of-empty-comment": "Abrupt closing of empty comment",
};

export const parseHtml = (
content: string,
callback?: (validNodeUid: TValidNodeUid) => void,
Expand Down Expand Up @@ -242,4 +251,4 @@ export const fileHandlers: {
) => TFileParserResponse;
} = {
html: parseHtml,
};
};
2 changes: 1 addition & 1 deletion src/_node/file/helpers.ts → src/api/file/helpers.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FileChangeAlertMessage, RootNodeUid } from "@_constants/main";
import { FileChangeAlertMessage, RootNodeUid } from "@src/rnbwTSX";
import {
htmlElementsReferences,
THtmlElementsReference,
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/_node/helpers.ts → src/api/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
RenameFileActionPrefix,
RenameNodeActionPrefix,
RootNodeUid,
} from "@_constants/main";
} from "@src/rnbwTSX";
import { THtmlReferenceData } from "@_types/main";

import {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
37 changes: 0 additions & 37 deletions src/app/App.tsx

This file was deleted.

3 changes: 0 additions & 3 deletions src/app/index.ts

This file was deleted.

Loading

0 comments on commit 3cfc5af

Please sign in to comment.