@deenruv/replicate-simple-bg-plugin 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +23 -0
- package/README.md +54 -0
- package/dist/plugin-server/constants.d.ts +13 -0
- package/dist/plugin-server/constants.js +122 -0
- package/dist/plugin-server/entities/replicate-simple-bg.d.ts +11 -0
- package/dist/plugin-server/entities/replicate-simple-bg.js +49 -0
- package/dist/plugin-server/extensions/replicate-simple-bg.extension.d.ts +1 -0
- package/dist/plugin-server/extensions/replicate-simple-bg.extension.js +105 -0
- package/dist/plugin-server/graphql/generated-admin-types.d.ts +5807 -0
- package/dist/plugin-server/graphql/generated-admin-types.js +1030 -0
- package/dist/plugin-server/index.d.ts +5 -0
- package/dist/plugin-server/index.js +40 -0
- package/dist/plugin-server/resolvers/replicate-simple-bg-admin.resolver.d.ts +51 -0
- package/dist/plugin-server/resolvers/replicate-simple-bg-admin.resolver.js +105 -0
- package/dist/plugin-server/services/replicate-simple-bg.service.d.ts +45 -0
- package/dist/plugin-server/services/replicate-simple-bg.service.js +254 -0
- package/dist/plugin-server/types.d.ts +29 -0
- package/dist/plugin-server/types.js +2 -0
- package/dist/plugin-server/zeus/const.d.ts +6 -0
- package/dist/plugin-server/zeus/const.js +3714 -0
- package/dist/plugin-server/zeus/index.d.ts +18885 -0
- package/dist/plugin-server/zeus/index.js +1101 -0
- package/dist/plugin-server/zeus/typedDocumentNode.d.ts +3 -0
- package/dist/plugin-server/zeus/typedDocumentNode.js +13 -0
- package/dist/plugin-ui/components/FileUpload.d.ts +11 -0
- package/dist/plugin-ui/components/FileUpload.js +50 -0
- package/dist/plugin-ui/components/RoomStyleSelect.d.ts +7 -0
- package/dist/plugin-ui/components/RoomStyleSelect.js +19 -0
- package/dist/plugin-ui/components/RoomTypeSelect.d.ts +7 -0
- package/dist/plugin-ui/components/RoomTypeSelect.js +21 -0
- package/dist/plugin-ui/components/index.d.ts +1 -0
- package/dist/plugin-ui/components/index.js +1 -0
- package/dist/plugin-ui/constants.d.ts +1 -0
- package/dist/plugin-ui/constants.js +15 -0
- package/dist/plugin-ui/graphql/mutations.d.ts +22 -0
- package/dist/plugin-ui/graphql/mutations.js +21 -0
- package/dist/plugin-ui/graphql/queries.d.ts +87 -0
- package/dist/plugin-ui/graphql/queries.js +32 -0
- package/dist/plugin-ui/graphql/selectors.d.ts +43 -0
- package/dist/plugin-ui/graphql/selectors.js +38 -0
- package/dist/plugin-ui/index.d.ts +1 -0
- package/dist/plugin-ui/index.js +33 -0
- package/dist/plugin-ui/locales/en/index.d.ts +67 -0
- package/dist/plugin-ui/locales/en/index.js +2 -0
- package/dist/plugin-ui/locales/en/simpleBg.json +66 -0
- package/dist/plugin-ui/locales/pl/index.d.ts +67 -0
- package/dist/plugin-ui/locales/pl/index.js +2 -0
- package/dist/plugin-ui/locales/pl/simpleBg.json +66 -0
- package/dist/plugin-ui/pages/ReplicatePage.d.ts +2 -0
- package/dist/plugin-ui/pages/ReplicatePage.js +282 -0
- package/dist/plugin-ui/pages/ReplicateProductSidebar.d.ts +2 -0
- package/dist/plugin-ui/pages/ReplicateProductSidebar.js +186 -0
- package/dist/plugin-ui/translation-ns.d.ts +1 -0
- package/dist/plugin-ui/translation-ns.js +1 -0
- package/dist/plugin-ui/tsconfig.json +18 -0
- package/dist/plugin-ui/types.d.ts +35 -0
- package/dist/plugin-ui/types.js +15 -0
- package/dist/plugin-ui/zeus/const.d.ts +6 -0
- package/dist/plugin-ui/zeus/const.js +3711 -0
- package/dist/plugin-ui/zeus/index.d.ts +18885 -0
- package/dist/plugin-ui/zeus/index.js +1093 -0
- package/dist/plugin-ui/zeus/scalars.d.ts +18 -0
- package/dist/plugin-ui/zeus/scalars.js +25 -0
- package/dist/plugin-ui/zeus/typedDocumentNode.d.ts +3 -0
- package/dist/plugin-ui/zeus/typedDocumentNode.js +9 -0
- package/package.json +53 -0
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { TypedDocumentNode } from '@graphql-typed-document-node/core';
|
|
2
|
+
import { ValueTypes, GenericOperation, OperationOptions, GraphQLTypes, InputType, ScalarDefinition, ThunderGraphQLOptions, ExtractVariables } from './index.js';
|
|
3
|
+
export declare const typedGql: <O extends "mutation" | "query", SCLR extends ScalarDefinition, R extends keyof ValueTypes = GenericOperation<O>>(operation: O, graphqlOptions?: ThunderGraphQLOptions<SCLR> | undefined) => <Z extends ValueTypes[R]>(o: Z & { [P in keyof Z]: P extends keyof ValueTypes[R] ? Z[P] : never; }, ops?: OperationOptions) => TypedDocumentNode<InputType<GraphQLTypes[R], Z, SCLR>, ExtractVariables<Z>>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.typedGql = void 0;
|
|
4
|
+
const graphql_tag_1 = require("graphql-tag");
|
|
5
|
+
const index_js_1 = require("./index.js");
|
|
6
|
+
const typedGql = (operation, graphqlOptions) => (o, ops) => {
|
|
7
|
+
const str = (0, index_js_1.Zeus)(operation, o, {
|
|
8
|
+
operationOptions: ops,
|
|
9
|
+
scalars: graphqlOptions === null || graphqlOptions === void 0 ? void 0 : graphqlOptions.scalars,
|
|
10
|
+
});
|
|
11
|
+
return (0, graphql_tag_1.gql)(str);
|
|
12
|
+
};
|
|
13
|
+
exports.typedGql = typedGql;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface FileUploadProps {
|
|
3
|
+
value: File | null;
|
|
4
|
+
onChange: (file: File | null) => void;
|
|
5
|
+
accept?: Record<string, string[]>;
|
|
6
|
+
maxSize?: number;
|
|
7
|
+
className?: string;
|
|
8
|
+
error?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function FileUpload({ value, onChange, accept, maxSize, className, error, }: FileUploadProps): React.JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import React, { useCallback, useState } from "react";
|
|
2
|
+
import { X, Upload } from "lucide-react";
|
|
3
|
+
import { Button, cn } from "@deenruv/react-ui-devkit";
|
|
4
|
+
import { useDropzone } from "react-dropzone";
|
|
5
|
+
export function FileUpload({ value, onChange, accept = { "image/*": [] }, maxSize = 5 * 1024 * 1024, className, error, }) {
|
|
6
|
+
const [preview, setPreview] = useState(null);
|
|
7
|
+
const onDrop = useCallback((acceptedFiles) => {
|
|
8
|
+
if (acceptedFiles?.length > 0) {
|
|
9
|
+
const file = acceptedFiles[0];
|
|
10
|
+
onChange(file);
|
|
11
|
+
// Create preview
|
|
12
|
+
const objectUrl = URL.createObjectURL(file);
|
|
13
|
+
setPreview(objectUrl);
|
|
14
|
+
}
|
|
15
|
+
}, [onChange]);
|
|
16
|
+
const { getRootProps, getInputProps, isDragActive, fileRejections } = useDropzone({
|
|
17
|
+
onDrop,
|
|
18
|
+
accept,
|
|
19
|
+
maxSize,
|
|
20
|
+
multiple: false,
|
|
21
|
+
});
|
|
22
|
+
const removeFile = () => {
|
|
23
|
+
if (preview) {
|
|
24
|
+
URL.revokeObjectURL(preview);
|
|
25
|
+
setPreview(null);
|
|
26
|
+
}
|
|
27
|
+
onChange(null);
|
|
28
|
+
};
|
|
29
|
+
// Show file rejection errors
|
|
30
|
+
const fileRejectionError = fileRejections[0]?.errors[0]?.message;
|
|
31
|
+
return (React.createElement("div", { className: "space-y-2" },
|
|
32
|
+
!value && (React.createElement("div", { ...getRootProps(), className: cn("border-2 border-dashed rounded-lg p-6 transition-colors cursor-pointer", isDragActive
|
|
33
|
+
? "border-primary bg-primary/5"
|
|
34
|
+
: "border-muted-foreground/20 hover:border-primary/50", className) },
|
|
35
|
+
React.createElement("input", { ...getInputProps() }),
|
|
36
|
+
React.createElement("div", { className: "flex flex-col items-center justify-center gap-2 text-center" },
|
|
37
|
+
React.createElement(Upload, { className: "h-10 w-10 text-muted-foreground" }),
|
|
38
|
+
React.createElement("p", { className: "text-sm font-medium" }, isDragActive
|
|
39
|
+
? "Drop the image here"
|
|
40
|
+
: "Drag & drop an image here, or click to select"),
|
|
41
|
+
React.createElement("p", { className: "text-xs text-muted-foreground" },
|
|
42
|
+
"Supported formats: JPEG, PNG, WebP (Max ",
|
|
43
|
+
maxSize / (1024 * 1024),
|
|
44
|
+
"MB)")))),
|
|
45
|
+
value && preview && (React.createElement("div", { className: "relative rounded-lg overflow-hidden border border-border" },
|
|
46
|
+
React.createElement("img", { src: preview || "/placeholder.svg", alt: "Preview", className: "w-full h-64 object-cover" }),
|
|
47
|
+
React.createElement(Button, { variant: "destructive", size: "icon", className: "absolute top-2 right-2 h-8 w-8 rounded-full opacity-90", onClick: removeFile, type: "button" },
|
|
48
|
+
React.createElement(X, { className: "h-4 w-4" })))),
|
|
49
|
+
(error || fileRejectionError) && (React.createElement("p", { className: "text-sm text-destructive" }, error || fileRejectionError))));
|
|
50
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Label, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, cn, useTranslation, } from "@deenruv/react-ui-devkit";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { translationNS } from "../translation-ns.js";
|
|
4
|
+
export const RoomStyleSelect = ({ roomThemes, onSelect, selectedValue }) => {
|
|
5
|
+
const { t } = useTranslation(translationNS);
|
|
6
|
+
return (React.createElement("div", { className: "flex flex-col gap-2" },
|
|
7
|
+
React.createElement(Label, { className: "text-sm font-medium" }, t("room_style")),
|
|
8
|
+
React.createElement("div", { className: "p-2 grid grid-cols-4 gap-4 grid-auto-flow-dense" }, roomThemes?.map(({ image, label, value }) => (React.createElement(TooltipProvider, null,
|
|
9
|
+
React.createElement(Tooltip, { delayDuration: 0 },
|
|
10
|
+
React.createElement(TooltipTrigger, null,
|
|
11
|
+
React.createElement("div", { key: value, className: cn("relative aspect-square rounded-lg overflow-hidden group focus:outline-none focus:ring-2 focus:ring-primary", "transition-transform hover:scale-[1.02]", "w-full h-[75px] p-0.5", selectedValue === value ? "ring-2 ring-primary" : ""), onClick: () => {
|
|
12
|
+
if (!image || !label || !value)
|
|
13
|
+
return;
|
|
14
|
+
onSelect(value);
|
|
15
|
+
} },
|
|
16
|
+
React.createElement("img", { src: image || "/placeholder.svg", alt: `${label} theme preview`, className: "absolute inset-0 w-full h-full object-cover rounded-md" }))),
|
|
17
|
+
React.createElement(TooltipContent, null,
|
|
18
|
+
React.createElement("p", { className: "text-sm font-semibold" }, t(label))))))))));
|
|
19
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Label, Select, SelectContent, SelectItem, SelectTrigger, SelectValue, useTranslation, } from "@deenruv/react-ui-devkit";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { translationNS } from "../translation-ns.js";
|
|
4
|
+
export const RoomTypeSelect = ({ roomTypes, onValueChange, selectedValue }) => {
|
|
5
|
+
const { t } = useTranslation(translationNS);
|
|
6
|
+
return (React.createElement("div", { className: "flex flex-col gap-2" },
|
|
7
|
+
React.createElement(Label, { className: "text-sm font-medium" }, t("room_type")),
|
|
8
|
+
React.createElement(Select, { value: selectedValue, onValueChange: (newValue) => {
|
|
9
|
+
const selectedOption = roomTypes?.find((option) => option.value === newValue);
|
|
10
|
+
if (!selectedOption)
|
|
11
|
+
return;
|
|
12
|
+
const { value, label } = selectedOption;
|
|
13
|
+
if (!value || !label)
|
|
14
|
+
return;
|
|
15
|
+
onValueChange(value);
|
|
16
|
+
} },
|
|
17
|
+
React.createElement(SelectTrigger, { id: "room-type" },
|
|
18
|
+
React.createElement(SelectValue, { placeholder: t("select_room_type") })),
|
|
19
|
+
React.createElement(SelectContent, null, roomTypes?.map(({ label, value }) => (React.createElement(SelectItem, { key: value, value: value }, t(label)))))),
|
|
20
|
+
" "));
|
|
21
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../pages/ReplicateProductSidebar.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../pages/ReplicateProductSidebar.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getStatusColor: (status: string) => "bg-green-500" | "bg-red-500" | "bg-blue-500" | "bg-yellow-500" | "bg-gray-500";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { PredictionSimpleBgStatus } from "./zeus/index.js";
|
|
2
|
+
export const getStatusColor = (status) => {
|
|
3
|
+
switch (status) {
|
|
4
|
+
case PredictionSimpleBgStatus.succeeded:
|
|
5
|
+
return "bg-green-500";
|
|
6
|
+
case PredictionSimpleBgStatus.failed:
|
|
7
|
+
return "bg-red-500";
|
|
8
|
+
case PredictionSimpleBgStatus.starting:
|
|
9
|
+
return "bg-blue-500";
|
|
10
|
+
case PredictionSimpleBgStatus.preprocessing:
|
|
11
|
+
return "bg-yellow-500";
|
|
12
|
+
default:
|
|
13
|
+
return "bg-gray-500";
|
|
14
|
+
}
|
|
15
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare const startGenerateSimpleBgMutation: import("@graphql-typed-document-node/core").TypedDocumentNode<{
|
|
2
|
+
startGenerateSimpleBg: string;
|
|
3
|
+
}, {} & {
|
|
4
|
+
input: {
|
|
5
|
+
assetId?: string | import("../zeus/index.js").Variable<any, string> | null | undefined;
|
|
6
|
+
roomType?: string | import("../zeus/index.js").Variable<any, string> | null | undefined;
|
|
7
|
+
roomStyle?: string | import("../zeus/index.js").Variable<any, string> | null | undefined;
|
|
8
|
+
prompt?: string | import("../zeus/index.js").Variable<any, string> | null | undefined;
|
|
9
|
+
};
|
|
10
|
+
}>;
|
|
11
|
+
export declare const getPredictionAssetMutation: import("@graphql-typed-document-node/core").TypedDocumentNode<{
|
|
12
|
+
getPredictionAsset: {
|
|
13
|
+
id: string;
|
|
14
|
+
source: string;
|
|
15
|
+
preview: string;
|
|
16
|
+
};
|
|
17
|
+
}, {} & {
|
|
18
|
+
input: {
|
|
19
|
+
predictionId: string | import("../zeus/index.js").Variable<any, string>;
|
|
20
|
+
productId: string | import("../zeus/index.js").Variable<any, string>;
|
|
21
|
+
};
|
|
22
|
+
}>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { typedGql } from "../zeus/typedDocumentNode.js";
|
|
2
|
+
import { $ } from "../zeus/index.js";
|
|
3
|
+
import { scalars } from "@deenruv/admin-types";
|
|
4
|
+
export const startGenerateSimpleBgMutation = typedGql("mutation", { scalars })({
|
|
5
|
+
startGenerateSimpleBg: [
|
|
6
|
+
{ input: $("input", "StartGenerateSimpleBgInput!") },
|
|
7
|
+
true,
|
|
8
|
+
],
|
|
9
|
+
});
|
|
10
|
+
export const getPredictionAssetMutation = typedGql("mutation", {
|
|
11
|
+
scalars,
|
|
12
|
+
})({
|
|
13
|
+
getPredictionAsset: [
|
|
14
|
+
{ input: $("input", "GetPredictionAssetInput!") },
|
|
15
|
+
{
|
|
16
|
+
id: true,
|
|
17
|
+
preview: true,
|
|
18
|
+
source: true,
|
|
19
|
+
},
|
|
20
|
+
],
|
|
21
|
+
});
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
export declare const getPredictionSimpleBGIDQuery: import("@graphql-typed-document-node/core").TypedDocumentNode<{
|
|
2
|
+
getSimpleBgID?: string | null | undefined;
|
|
3
|
+
}, {} & {
|
|
4
|
+
prediction_simple_bg_entity_id: string;
|
|
5
|
+
}>;
|
|
6
|
+
export declare const getSimpleBgPredictionsQuery: import("@graphql-typed-document-node/core").TypedDocumentNode<{
|
|
7
|
+
getSimpleBgPredictions: {
|
|
8
|
+
items: {
|
|
9
|
+
id: string;
|
|
10
|
+
status: import("../zeus").PredictionSimpleBgStatus;
|
|
11
|
+
finishedAt?: string | null | undefined;
|
|
12
|
+
}[];
|
|
13
|
+
totalItems: number;
|
|
14
|
+
};
|
|
15
|
+
}, {
|
|
16
|
+
options?: {
|
|
17
|
+
skip?: number | import("../zeus").Variable<any, string> | null | undefined;
|
|
18
|
+
take?: number | import("../zeus").Variable<any, string> | null | undefined;
|
|
19
|
+
sort?: {
|
|
20
|
+
id?: import("../zeus").SortOrder | import("../zeus").Variable<any, string> | null | undefined;
|
|
21
|
+
finishedAt?: import("../zeus").SortOrder | import("../zeus").Variable<any, string> | null | undefined;
|
|
22
|
+
} | import("../zeus").Variable<any, string> | null | undefined;
|
|
23
|
+
filter?: {
|
|
24
|
+
id?: {
|
|
25
|
+
eq?: string | import("../zeus").Variable<any, string> | null | undefined;
|
|
26
|
+
notEq?: string | import("../zeus").Variable<any, string> | null | undefined;
|
|
27
|
+
in?: string[] | import("../zeus").Variable<any, string> | null | undefined;
|
|
28
|
+
notIn?: string[] | import("../zeus").Variable<any, string> | null | undefined;
|
|
29
|
+
isNull?: boolean | import("../zeus").Variable<any, string> | null | undefined;
|
|
30
|
+
} | import("../zeus").Variable<any, string> | null | undefined;
|
|
31
|
+
status?: {
|
|
32
|
+
eq?: string | import("../zeus").Variable<any, string> | null | undefined;
|
|
33
|
+
notEq?: string | import("../zeus").Variable<any, string> | null | undefined;
|
|
34
|
+
contains?: string | import("../zeus").Variable<any, string> | null | undefined;
|
|
35
|
+
notContains?: string | import("../zeus").Variable<any, string> | null | undefined;
|
|
36
|
+
in?: string[] | import("../zeus").Variable<any, string> | null | undefined;
|
|
37
|
+
notIn?: string[] | import("../zeus").Variable<any, string> | null | undefined;
|
|
38
|
+
regex?: string | import("../zeus").Variable<any, string> | null | undefined;
|
|
39
|
+
isNull?: boolean | import("../zeus").Variable<any, string> | null | undefined;
|
|
40
|
+
} | import("../zeus").Variable<any, string> | null | undefined;
|
|
41
|
+
finishedAt?: {
|
|
42
|
+
eq?: unknown;
|
|
43
|
+
before?: unknown;
|
|
44
|
+
after?: unknown;
|
|
45
|
+
between?: {
|
|
46
|
+
start: unknown;
|
|
47
|
+
end: unknown;
|
|
48
|
+
} | import("../zeus").Variable<any, string> | null | undefined;
|
|
49
|
+
isNull?: boolean | import("../zeus").Variable<any, string> | null | undefined;
|
|
50
|
+
} | import("../zeus").Variable<any, string> | null | undefined;
|
|
51
|
+
_and?: import("../zeus").Variable<any, string> | any[] | null | undefined;
|
|
52
|
+
_or?: import("../zeus").Variable<any, string> | any[] | null | undefined;
|
|
53
|
+
} | import("../zeus").Variable<any, string> | null | undefined;
|
|
54
|
+
filterOperator?: import("../zeus").LogicalOperator | import("../zeus").Variable<any, string> | null | undefined;
|
|
55
|
+
} | undefined;
|
|
56
|
+
} & {}>;
|
|
57
|
+
export declare const getSimpleBgItemQuery: import("@graphql-typed-document-node/core").TypedDocumentNode<{
|
|
58
|
+
getSimpleBgItem: {
|
|
59
|
+
id: string;
|
|
60
|
+
image?: string | null | undefined;
|
|
61
|
+
status?: import("../zeus").PredictionSimpleBgStatus | null | undefined;
|
|
62
|
+
roomType?: string | null | undefined;
|
|
63
|
+
roomStyle?: string | null | undefined;
|
|
64
|
+
};
|
|
65
|
+
}, {} & {
|
|
66
|
+
id: string;
|
|
67
|
+
}>;
|
|
68
|
+
export declare const getSimpleBgThemeAssetQuery: import("@graphql-typed-document-node/core").TypedDocumentNode<{
|
|
69
|
+
getSimpleBgThemeAsset: {
|
|
70
|
+
url: string;
|
|
71
|
+
};
|
|
72
|
+
}, {} & {
|
|
73
|
+
url: string;
|
|
74
|
+
}>;
|
|
75
|
+
export declare const getSimpleBgRoomOptions: import("@graphql-typed-document-node/core").TypedDocumentNode<{
|
|
76
|
+
getSimpleBgOptions: {
|
|
77
|
+
roomTypes?: {
|
|
78
|
+
value?: string | null | undefined;
|
|
79
|
+
label?: string | null | undefined;
|
|
80
|
+
}[] | undefined;
|
|
81
|
+
roomThemes?: {
|
|
82
|
+
value?: string | null | undefined;
|
|
83
|
+
label?: string | null | undefined;
|
|
84
|
+
image?: string | null | undefined;
|
|
85
|
+
}[] | undefined;
|
|
86
|
+
};
|
|
87
|
+
}, {} & {}>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { typedGql } from "../zeus/typedDocumentNode";
|
|
2
|
+
import { $ } from "../zeus";
|
|
3
|
+
import { scalars } from "@deenruv/admin-types";
|
|
4
|
+
import { ReplicateSimpleBgEntityListSelector, PredictionSelector, ImageSelector, RoomTypeSelector, RoomThemeSelector, } from "./selectors";
|
|
5
|
+
export const getPredictionSimpleBGIDQuery = typedGql("query", { scalars })({
|
|
6
|
+
getSimpleBgID: [
|
|
7
|
+
{
|
|
8
|
+
input: {
|
|
9
|
+
prediction_simple_bg_entity_id: $("prediction_simple_bg_entity_id", "String!"),
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
true,
|
|
13
|
+
],
|
|
14
|
+
});
|
|
15
|
+
export const getSimpleBgPredictionsQuery = typedGql("query", { scalars })({
|
|
16
|
+
getSimpleBgPredictions: [
|
|
17
|
+
{ options: $("options", "ReplicateSimpleBgEntityListOptions") },
|
|
18
|
+
ReplicateSimpleBgEntityListSelector,
|
|
19
|
+
],
|
|
20
|
+
});
|
|
21
|
+
export const getSimpleBgItemQuery = typedGql("query", { scalars })({
|
|
22
|
+
getSimpleBgItem: [{ id: $("id", "String!") }, PredictionSelector],
|
|
23
|
+
});
|
|
24
|
+
export const getSimpleBgThemeAssetQuery = typedGql("query", { scalars })({
|
|
25
|
+
getSimpleBgThemeAsset: [{ url: $("url", "String!") }, ImageSelector],
|
|
26
|
+
});
|
|
27
|
+
export const getSimpleBgRoomOptions = typedGql("query", { scalars })({
|
|
28
|
+
getSimpleBgOptions: {
|
|
29
|
+
roomTypes: RoomTypeSelector,
|
|
30
|
+
roomThemes: RoomThemeSelector,
|
|
31
|
+
},
|
|
32
|
+
});
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { FromSelectorWithScalars } from "../zeus/scalars.js";
|
|
2
|
+
export declare const PredictionSelector: {
|
|
3
|
+
id: true;
|
|
4
|
+
status: true;
|
|
5
|
+
image: true;
|
|
6
|
+
roomType: true;
|
|
7
|
+
roomStyle: true;
|
|
8
|
+
};
|
|
9
|
+
export declare const ReplicateSimpleBgEntityListSelector: {
|
|
10
|
+
items: {
|
|
11
|
+
id: true;
|
|
12
|
+
status: true;
|
|
13
|
+
finishedAt: true;
|
|
14
|
+
};
|
|
15
|
+
totalItems: true;
|
|
16
|
+
};
|
|
17
|
+
export declare const ImageSelector: {
|
|
18
|
+
url: true;
|
|
19
|
+
};
|
|
20
|
+
export declare const RoomTypeSelector: {
|
|
21
|
+
label: true;
|
|
22
|
+
value: true;
|
|
23
|
+
};
|
|
24
|
+
export declare const RoomThemeSelector: {
|
|
25
|
+
label: true;
|
|
26
|
+
value: true;
|
|
27
|
+
image: true;
|
|
28
|
+
};
|
|
29
|
+
export declare const ProductSelector: {
|
|
30
|
+
items: {
|
|
31
|
+
createdAt: true;
|
|
32
|
+
updatedAt: true;
|
|
33
|
+
name: true;
|
|
34
|
+
slug: true;
|
|
35
|
+
id: true;
|
|
36
|
+
};
|
|
37
|
+
totalItems: true;
|
|
38
|
+
};
|
|
39
|
+
export type ReplicateRoomType = FromSelectorWithScalars<typeof RoomTypeSelector, "RoomType">;
|
|
40
|
+
export type ReplicateRoomStyle = FromSelectorWithScalars<typeof RoomThemeSelector, "RoomTheme">;
|
|
41
|
+
export type ReplicatePredictionListType = FromSelectorWithScalars<typeof PredictionSelector, "PredictionSimpleBgResult">;
|
|
42
|
+
export type ReplicateSimpleBgEntityListType = FromSelectorWithScalars<typeof ReplicateSimpleBgEntityListSelector, "ReplicateSimpleBgEntityList">;
|
|
43
|
+
export type SimpleBgProductListType = FromSelectorWithScalars<typeof ProductSelector, "SimpleBgProductList">;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Selector } from "../zeus";
|
|
2
|
+
export const PredictionSelector = Selector("PredictionSimpleBgResult")({
|
|
3
|
+
id: true,
|
|
4
|
+
status: true,
|
|
5
|
+
image: true,
|
|
6
|
+
roomType: true,
|
|
7
|
+
roomStyle: true,
|
|
8
|
+
});
|
|
9
|
+
export const ReplicateSimpleBgEntityListSelector = Selector("ReplicateSimpleBgEntityList")({
|
|
10
|
+
items: {
|
|
11
|
+
id: true,
|
|
12
|
+
status: true,
|
|
13
|
+
finishedAt: true,
|
|
14
|
+
},
|
|
15
|
+
totalItems: true,
|
|
16
|
+
});
|
|
17
|
+
export const ImageSelector = Selector("Image")({
|
|
18
|
+
url: true,
|
|
19
|
+
});
|
|
20
|
+
export const RoomTypeSelector = Selector("RoomType")({
|
|
21
|
+
label: true,
|
|
22
|
+
value: true,
|
|
23
|
+
});
|
|
24
|
+
export const RoomThemeSelector = Selector("RoomTheme")({
|
|
25
|
+
label: true,
|
|
26
|
+
value: true,
|
|
27
|
+
image: true,
|
|
28
|
+
});
|
|
29
|
+
export const ProductSelector = Selector("SimpleBgProductList")({
|
|
30
|
+
items: {
|
|
31
|
+
createdAt: true,
|
|
32
|
+
updatedAt: true,
|
|
33
|
+
name: true,
|
|
34
|
+
slug: true,
|
|
35
|
+
id: true,
|
|
36
|
+
},
|
|
37
|
+
totalItems: true,
|
|
38
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ReplicateSimpleBGUiPlugin: import("@deenruv/react-ui-devkit").DeenruvUIPlugin<Record<string, any>>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { createDeenruvUIPlugin } from "@deenruv/react-ui-devkit";
|
|
2
|
+
import pl from "./locales/pl";
|
|
3
|
+
import en from "./locales/en";
|
|
4
|
+
import { translationNS } from "./translation-ns";
|
|
5
|
+
import React from "react";
|
|
6
|
+
import { NotebookPenIcon } from "lucide-react";
|
|
7
|
+
import { ReplicateProductSidebar } from "./pages/ReplicateProductSidebar.js";
|
|
8
|
+
import { ReplicatePage } from "./pages/ReplicatePage.js";
|
|
9
|
+
export const ReplicateSimpleBGUiPlugin = createDeenruvUIPlugin({
|
|
10
|
+
version: "1.0.0",
|
|
11
|
+
name: "Replicate Simple BG Plugin",
|
|
12
|
+
pages: [{ element: React.createElement(ReplicatePage, null), path: "simple-bg-model" }],
|
|
13
|
+
components: [
|
|
14
|
+
{
|
|
15
|
+
id: "products-detail-view-sidebar",
|
|
16
|
+
tab: "product",
|
|
17
|
+
component: ReplicateProductSidebar,
|
|
18
|
+
},
|
|
19
|
+
],
|
|
20
|
+
navMenuLinks: [
|
|
21
|
+
{
|
|
22
|
+
groupId: "promotions-group",
|
|
23
|
+
href: "simple-bg-model",
|
|
24
|
+
id: "simple-bg-model",
|
|
25
|
+
labelId: "Simple Background Model",
|
|
26
|
+
icon: NotebookPenIcon,
|
|
27
|
+
},
|
|
28
|
+
],
|
|
29
|
+
translations: {
|
|
30
|
+
ns: translationNS,
|
|
31
|
+
data: { en, pl },
|
|
32
|
+
},
|
|
33
|
+
});
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
input: string;
|
|
3
|
+
output: string;
|
|
4
|
+
run_model: string;
|
|
5
|
+
upload_furniture_image: string;
|
|
6
|
+
original_room: string;
|
|
7
|
+
choose_room_type_and_theme: string;
|
|
8
|
+
select_room_type: string;
|
|
9
|
+
select_room_theme: string;
|
|
10
|
+
generated_room: string;
|
|
11
|
+
loading: string;
|
|
12
|
+
download_image: string;
|
|
13
|
+
bedroom: string;
|
|
14
|
+
living_room: string;
|
|
15
|
+
dining_room: string;
|
|
16
|
+
kitchen: string;
|
|
17
|
+
bathroom: string;
|
|
18
|
+
office: string;
|
|
19
|
+
modern: string;
|
|
20
|
+
summer: string;
|
|
21
|
+
professional: string;
|
|
22
|
+
tropical: string;
|
|
23
|
+
coastal: string;
|
|
24
|
+
vintage: string;
|
|
25
|
+
industrial: string;
|
|
26
|
+
neoclassic: string;
|
|
27
|
+
choose_file: string;
|
|
28
|
+
no_file_chosen: string;
|
|
29
|
+
previous_predictions: string;
|
|
30
|
+
starting: string;
|
|
31
|
+
preprocessing: string;
|
|
32
|
+
succeeded: string;
|
|
33
|
+
failed: string;
|
|
34
|
+
generate_new_background: string;
|
|
35
|
+
no_room_style: string;
|
|
36
|
+
no_room_type: string;
|
|
37
|
+
no_file: string;
|
|
38
|
+
refresh: string;
|
|
39
|
+
status: string;
|
|
40
|
+
room_style: string;
|
|
41
|
+
room_type: string;
|
|
42
|
+
prediction: string;
|
|
43
|
+
prediction_details: string;
|
|
44
|
+
generating_asset: string;
|
|
45
|
+
asset_assigned: string;
|
|
46
|
+
prompt_placeholder: string;
|
|
47
|
+
prompt: string;
|
|
48
|
+
error: {
|
|
49
|
+
loading: string;
|
|
50
|
+
};
|
|
51
|
+
modal: {
|
|
52
|
+
title: string;
|
|
53
|
+
choose_room_type: string;
|
|
54
|
+
choose_room_theme: string;
|
|
55
|
+
generate_new: string;
|
|
56
|
+
close: string;
|
|
57
|
+
add_to_product: string;
|
|
58
|
+
assign_prediction_to_product: string;
|
|
59
|
+
product_name: string;
|
|
60
|
+
product_sku: string;
|
|
61
|
+
product_action: string;
|
|
62
|
+
product_assign: string;
|
|
63
|
+
run_model_again: string;
|
|
64
|
+
input_prompt: string;
|
|
65
|
+
};
|
|
66
|
+
}[];
|
|
67
|
+
export default _default;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
{
|
|
2
|
+
"input": "Input",
|
|
3
|
+
"output": "Output",
|
|
4
|
+
"run_model": "Run Model",
|
|
5
|
+
"upload_furniture_image": "Upload furniture image",
|
|
6
|
+
"original_room": "Original Room",
|
|
7
|
+
"choose_room_type_and_theme": "Choose room type and theme",
|
|
8
|
+
"select_room_type": "Select the room type",
|
|
9
|
+
"select_room_theme": "Select the theme",
|
|
10
|
+
"generated_room": "Generated Room",
|
|
11
|
+
"loading": "Waiting for result... (approx. 2 min)",
|
|
12
|
+
"download_image": "Download Image",
|
|
13
|
+
"bedroom": "Bedroom",
|
|
14
|
+
"living_room": "Living Room",
|
|
15
|
+
"dining_room": "Dining Room",
|
|
16
|
+
"kitchen": "Kitchen",
|
|
17
|
+
"bathroom": "Bathroom",
|
|
18
|
+
"office": "Office",
|
|
19
|
+
"modern": "Modern",
|
|
20
|
+
"summer": "Summer",
|
|
21
|
+
"professional": "Professional",
|
|
22
|
+
"tropical": "Tropical",
|
|
23
|
+
"coastal": "Coastal",
|
|
24
|
+
"vintage": "Vintage",
|
|
25
|
+
"industrial": "Industrial",
|
|
26
|
+
"neoclassic": "Neo Classical",
|
|
27
|
+
"choose_file": "Choose file",
|
|
28
|
+
"no_file_chosen": "No file chosen",
|
|
29
|
+
"previous_predictions": "Previous Predictions",
|
|
30
|
+
"starting": "In progress",
|
|
31
|
+
"preprocessing": "Preprocessing",
|
|
32
|
+
"succeeded": "Completed",
|
|
33
|
+
"failed": "Failed",
|
|
34
|
+
"generate_new_background": "Generate new background",
|
|
35
|
+
"no_room_style": "No room style",
|
|
36
|
+
"no_room_type": "No room type",
|
|
37
|
+
"no_file": "No file",
|
|
38
|
+
"refresh": "Refresh list",
|
|
39
|
+
"status": "Status",
|
|
40
|
+
"room_style": "Room Style",
|
|
41
|
+
"room_type": "Room Type",
|
|
42
|
+
"prediction": "Prediction",
|
|
43
|
+
"prediction_details": "Prediction Details",
|
|
44
|
+
"generating_asset": "Generating asset..",
|
|
45
|
+
"asset_assigned": "Asset assigned to product",
|
|
46
|
+
"prompt_placeholder": "Would you like to change something? Describe it here!",
|
|
47
|
+
"prompt": "Prompt",
|
|
48
|
+
"error": {
|
|
49
|
+
"loading": "Generating asset.."
|
|
50
|
+
},
|
|
51
|
+
"modal": {
|
|
52
|
+
"title": "Predicition",
|
|
53
|
+
"choose_room_type": "Choose Room Type",
|
|
54
|
+
"choose_room_theme": "Choose Room Theme",
|
|
55
|
+
"generate_new": "Generate New",
|
|
56
|
+
"close": "Close",
|
|
57
|
+
"add_to_product": "Add to Product",
|
|
58
|
+
"assign_prediction_to_product": "Assign prediction to product",
|
|
59
|
+
"product_name": "Name",
|
|
60
|
+
"product_sku": "SKU",
|
|
61
|
+
"product_action": "Action",
|
|
62
|
+
"product_assign": "Assign",
|
|
63
|
+
"run_model_again": "Run the model again",
|
|
64
|
+
"input_prompt": "Would you like to change something? Describe it here!"
|
|
65
|
+
}
|
|
66
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
input: string;
|
|
3
|
+
output: string;
|
|
4
|
+
run_model: string;
|
|
5
|
+
upload_furniture_image: string;
|
|
6
|
+
original_room: string;
|
|
7
|
+
choose_room_type_and_theme: string;
|
|
8
|
+
select_room_type: string;
|
|
9
|
+
select_room_theme: string;
|
|
10
|
+
generated_room: string;
|
|
11
|
+
loading: string;
|
|
12
|
+
download_image: string;
|
|
13
|
+
bedroom: string;
|
|
14
|
+
living_room: string;
|
|
15
|
+
dining_room: string;
|
|
16
|
+
kitchen: string;
|
|
17
|
+
bathroom: string;
|
|
18
|
+
office: string;
|
|
19
|
+
modern: string;
|
|
20
|
+
summer: string;
|
|
21
|
+
professional: string;
|
|
22
|
+
tropical: string;
|
|
23
|
+
coastal: string;
|
|
24
|
+
vintage: string;
|
|
25
|
+
industrial: string;
|
|
26
|
+
neoclassic: string;
|
|
27
|
+
choose_file: string;
|
|
28
|
+
no_file_chosen: string;
|
|
29
|
+
previous_predictions: string;
|
|
30
|
+
starting: string;
|
|
31
|
+
preprocessing: string;
|
|
32
|
+
succeeded: string;
|
|
33
|
+
failed: string;
|
|
34
|
+
generate_new_background: string;
|
|
35
|
+
no_room_style: string;
|
|
36
|
+
no_room_type: string;
|
|
37
|
+
no_file: string;
|
|
38
|
+
refresh: string;
|
|
39
|
+
status: string;
|
|
40
|
+
room_type: string;
|
|
41
|
+
room_style: string;
|
|
42
|
+
prediction: string;
|
|
43
|
+
prediction_details: string;
|
|
44
|
+
generating_asset: string;
|
|
45
|
+
asset_assigned: string;
|
|
46
|
+
prompt_placeholder: string;
|
|
47
|
+
prompt: string;
|
|
48
|
+
error: {
|
|
49
|
+
loading: string;
|
|
50
|
+
};
|
|
51
|
+
modal: {
|
|
52
|
+
title: string;
|
|
53
|
+
choose_room_type: string;
|
|
54
|
+
choose_room_theme: string;
|
|
55
|
+
generate_new: string;
|
|
56
|
+
close: string;
|
|
57
|
+
add_to_product: string;
|
|
58
|
+
assign_prediction_to_product: string;
|
|
59
|
+
product_name: string;
|
|
60
|
+
product_sku: string;
|
|
61
|
+
product_action: string;
|
|
62
|
+
product_assign: string;
|
|
63
|
+
run_model_again: string;
|
|
64
|
+
input_prompt: string;
|
|
65
|
+
};
|
|
66
|
+
}[];
|
|
67
|
+
export default _default;
|