Skip to content

Commit

Permalink
2.4.1 Improvements (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
bttf committed Nov 8, 2023
1 parent 30cf6ac commit 5a3a4e2
Show file tree
Hide file tree
Showing 55 changed files with 2,145 additions and 1,115 deletions.
23 changes: 21 additions & 2 deletions devtools.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,31 @@ import {
UpdateVisualChangesetPayload,
} from "./src/background";

declare global {
interface Window {
__gb_global_js_err?: (error: string) => void;
}
}

export type DebugLogs = [string, any][];

export type CopyMode = "energetic" | "concise" | "humorous";

export type ErrorCode = "csp-error" | BGErrorCode;

export type CSPError = {
violatedDirective: string;
};

export interface VisualEditorVariation {
name: string;
description: string;
css?: string;
js?: string;
domMutations: APIDomMutation[];
variationId: string;
}

export interface APIExperiment {
id: string;
variations: {
Expand All @@ -31,9 +50,9 @@ export type APIExperimentVariation = APIExperiment["variations"][number];
export interface APIVisualChangeset {
id: string;
urlPatterns: {
include?: boolean;
include: boolean;
/** @enum {string} */
type: "simple" | "exact" | "regex";
type: "simple" | "regex";
pattern: string;
}[];
editorUrl: string;
Expand Down
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gb-devtools",
"version": "0.3.2",
"version": "0.3.3",
"private": true,
"scripts": {
"dev": "webpack --config webpack/webpack.dev.js --watch",
Expand All @@ -19,10 +19,12 @@
"@chakra-ui/react": "^2.4.9",
"@emotion/react": "^11.10.5",
"@emotion/styled": "^11.10.5",
"@growthbook/growthbook": "^0.29.0",
"@growthbook/growthbook": "^0.30.0",
"@medv/finder": "^2.1.0",
"@radix-ui/react-accordion": "^1.1.2",
"@radix-ui/react-tooltip": "^1.0.7",
"clsx": "^1.2.1",
"dom-mutator": "^0.5.0",
"dom-mutator": "^0.6.0",
"framer-motion": "^8.4.3",
"json-stringify-pretty-compact": "^4.0.0",
"lodash": "^4.17.21",
Expand Down
3 changes: 0 additions & 3 deletions src/global.css

This file was deleted.

119 changes: 0 additions & 119 deletions src/visual_editor/DOMMutationList.tsx

This file was deleted.

92 changes: 0 additions & 92 deletions src/visual_editor/FloatingFrame.tsx

This file was deleted.

22 changes: 0 additions & 22 deletions src/visual_editor/SelectorDisplay.tsx

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import clsx from "clsx";
import React, { FC, MouseEvent, useCallback, useEffect, useState } from "react";
import TextareaAutosize from "react-textarea-autosize";
import { BiLoaderCircle } from "react-icons/bi";
import { CopyMode } from "../../devtools";
import { TransformCopyFn } from "./lib/hooks/useApi";
import { CopyMode } from "../../../devtools";
import { TransformCopyFn } from "../lib/hooks/useAiCopySuggestion";

const AICopySuggestor: FC<{
parentElement: Element;
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,7 @@ import { validAttributeName } from "dom-mutator";
import React, { FC, useCallback, useState } from "react";
import TextareaAutosize from "react-textarea-autosize";
import { RxCross2, RxPlus, RxCheck } from "react-icons/rx";
import { hoverAttributeName, selectedAttributeName } from "./lib/selectionMode";

export const IGNORED_ATTRS = [
"class",
hoverAttributeName,
selectedAttributeName,
];
import { IGNORED_ATTRS } from "../lib/hooks/useEditMode";

const isValidAttrName = (attrName: string) => {
if (IGNORED_ATTRS.includes(attrName)) return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import React, { FC } from "react";

const BackToGBButton: FC<{
experimentUrl: string | null;
children: React.ReactNode;
}> = ({ experimentUrl, children }) => (
}> = ({ experimentUrl }) => (
<button
className={clsx(
"gb-w-full",
Expand All @@ -23,7 +22,7 @@ const BackToGBButton: FC<{
}
}}
>
{children}
Back to GrowthBook
</button>
);

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { FC, useCallback, useEffect, useState } from "react";
import { IconType } from "react-icons";
import {
BiAlignLeft,
BiBold,
Expand Down Expand Up @@ -29,7 +30,6 @@ import { MdBorderColor } from "react-icons/md";
import { TbFloatCenter } from "react-icons/tb";
import styleToObject from "style-to-object";
import CSSTextInput from "./CSSTextInput";
import { IconType } from "react-icons";

interface CSSAttribute {
name: string;
Expand Down
File renamed without changes.
Loading

0 comments on commit 5a3a4e2

Please sign in to comment.