From 0738b7e32d6476ae1b5b312ffe5e8979c3e9bb4d Mon Sep 17 00:00:00 2001 From: KaWaite <34051327+KaWaite@users.noreply.github.com> Date: Mon, 31 Jul 2023 14:38:39 +0900 Subject: [PATCH] chore(web): add widget and align system update functionality (#604) --- web/src/beta/components/Icon/Icons/plugin.svg | 3 + web/src/beta/components/Icon/icons.ts | 2 + .../Editor/Visualizer/CanvasArea/hooks.ts | 19 ++- .../tabs/widgets/SidePanel/Settings/index.tsx | 6 +- web/src/services/api/widgetsApi/index.ts | 115 +++++++++++++++++- web/src/services/api/widgetsApi/utils.ts | 2 +- web/src/services/gql/__gen__/gql.ts | 10 ++ web/src/services/gql/__gen__/graphql.ts | 27 ++++ web/src/services/gql/queries/widget.ts | 72 +++++++++++ web/src/services/i18n/translations/en.yml | 5 +- web/src/services/i18n/translations/ja.yml | 5 +- 11 files changed, 246 insertions(+), 20 deletions(-) create mode 100644 web/src/beta/components/Icon/Icons/plugin.svg diff --git a/web/src/beta/components/Icon/Icons/plugin.svg b/web/src/beta/components/Icon/Icons/plugin.svg new file mode 100644 index 000000000..b8948fad0 --- /dev/null +++ b/web/src/beta/components/Icon/Icons/plugin.svg @@ -0,0 +1,3 @@ + + + diff --git a/web/src/beta/components/Icon/icons.ts b/web/src/beta/components/Icon/icons.ts index 397091da2..a274aac9f 100644 --- a/web/src/beta/components/Icon/icons.ts +++ b/web/src/beta/components/Icon/icons.ts @@ -83,6 +83,7 @@ import NavigatorAngle from "./Icons/navigatorAngle.svg"; import Compass from "./Icons/compass.svg"; import CompassFocus from "./Icons/compassFocus.svg"; import House from "./Icons/house.svg"; +import Plugin from "./Icons/plugin.svg"; // Logos import Logo from "./Icons/reearthLogo.svg"; @@ -152,4 +153,5 @@ export default { compass: Compass, compassFocus: CompassFocus, house: House, + plugin: Plugin, }; diff --git a/web/src/beta/features/Editor/Visualizer/CanvasArea/hooks.ts b/web/src/beta/features/Editor/Visualizer/CanvasArea/hooks.ts index 73ac97112..062fb617f 100644 --- a/web/src/beta/features/Editor/Visualizer/CanvasArea/hooks.ts +++ b/web/src/beta/features/Editor/Visualizer/CanvasArea/hooks.ts @@ -3,7 +3,7 @@ import { useMemo, useEffect, useCallback, useState } from "react"; import type { Alignment, Location } from "@reearth/beta/lib/core/Crust"; import type { LatLng, Tag, ValueTypes, ComputedLayer } from "@reearth/beta/lib/core/mantle"; import type { Layer, LayerSelectionReason, Cluster } from "@reearth/beta/lib/core/Map"; -import { useSceneFetcher } from "@reearth/services/api"; +import { useSceneFetcher, useWidgetsFetcher } from "@reearth/services/api"; import { config } from "@reearth/services/config"; import { useSceneMode, @@ -20,6 +20,7 @@ import { convertWidgets } from "./convert"; import { BlockType } from "./type"; export default ({ sceneId, isBuilt }: { sceneId?: string; isBuilt?: boolean }) => { + const { useUpdateWidget, useUpdateWidgetAlignSystem } = useWidgetsFetcher(); const { useSceneQuery } = useSceneFetcher(); const { scene } = useSceneQuery({ sceneId }); @@ -173,21 +174,17 @@ export default ({ sceneId, isBuilt }: { sceneId?: string; isBuilt?: boolean }) = ); const onWidgetUpdate = useCallback( - async (_id: string, _update: { location?: Location; extended?: boolean; index?: number }) => { - if (!sceneId) return; - - console.log("Widget has been updated!"); + async (id: string, update: { location?: Location; extended?: boolean; index?: number }) => { + await useUpdateWidget(id, update, sceneId); }, - [sceneId], + [sceneId, useUpdateWidget], ); const onWidgetAlignSystemUpdate = useCallback( - async (_location: Location, _align: Alignment) => { - if (!sceneId) return; - - console.log("WAS has been updated!"); + async (location: Location, align: Alignment) => { + await useUpdateWidgetAlignSystem(location, align, sceneId); }, - [sceneId], + [sceneId, useUpdateWidgetAlignSystem], ); const engineMeta = useMemo( diff --git a/web/src/beta/features/Editor/tabs/widgets/SidePanel/Settings/index.tsx b/web/src/beta/features/Editor/tabs/widgets/SidePanel/Settings/index.tsx index ce0466e85..9e2555401 100644 --- a/web/src/beta/features/Editor/tabs/widgets/SidePanel/Settings/index.tsx +++ b/web/src/beta/features/Editor/tabs/widgets/SidePanel/Settings/index.tsx @@ -23,11 +23,11 @@ const Settings: React.FC = ({ widgetPropertyId, propertyItems }) => { const value = !isList ? i.fields.find(f => f.id === sf.id)?.value : sf.defaultValue; return sf.type === "string" ? ( sf.ui === "color" ? ( -

Color field

+

Color field

) : sf.ui === "selection" || sf.choices ? ( -

Selection or choices field

+

Selection or choices field

) : sf.ui === "buttons" ? ( -

Button radio field

+

Button radio field

) : ( { [addWidgetMutation, setNotification, t], ); + const [updateWidget] = useMutation(UPDATE_WIDGET, { refetchQueries: ["GetScene"] }); + + const useUpdateWidget = useCallback( + async ( + id: string, + update: { location?: WidgetLocation; extended?: boolean; index?: number }, + sceneId?: string, + ) => { + if (!sceneId) { + console.log("GraphQL: Failed to update widget because there is no sceneId provided"); + setNotification({ type: "error", text: t("Failed to update widget.") }); + return { + status: "error", + }; + } + + const { data, errors } = await updateWidget({ + variables: { + sceneId, + widgetId: id, + enabled: true, + location: update.location + ? { + zone: update.location.zone?.toUpperCase() as WidgetZoneType, + section: update.location.section?.toUpperCase() as WidgetSectionType, + area: update.location.area?.toUpperCase() as WidgetAreaType, + } + : undefined, + extended: update.extended, + index: update.index, + }, + }); + + if (errors || !data?.updateWidget) { + console.log("GraphQL: Failed to update widget", errors); + setNotification({ type: "error", text: t("Failed to update widget.") }); + + return { status: "error" }; + } + + return { + data: data.updateWidget.scene.widgets, + status: "success", + }; + }, + [updateWidget, setNotification, t], + ); + const [removeWidget] = useMutation(REMOVE_WIDGET, { refetchQueries: ["GetScene"] }); const useRemoveWidget = useCallback( @@ -103,10 +162,15 @@ export default () => { sceneId?: string, widgetId?: string, ): Promise[]>> => { - if (!sceneId || !widgetId) + if (!sceneId || !widgetId) { + console.log( + "GraphQL: Failed to remove widget because there is either no sceneId or widgetId provided", + ); + setNotification({ type: "error", text: t("Failed to update widget.") }); return { status: "error", }; + } const { data, errors } = await removeWidget({ variables: { sceneId: sceneId ?? "", widgetId }, @@ -127,10 +191,55 @@ export default () => { [removeWidget, setNotification, t], ); + const [updateWidgetAlignSystem] = useMutation(UPDATE_WIDGET_ALIGN_SYSTEM, { + refetchQueries: ["GetScene"], + }); + + const useUpdateWidgetAlignSystem = useCallback( + async (location: WidgetLocation, align: WidgetAlignment, sceneId?: string) => { + if (!sceneId) { + console.log( + "GraphQL: Failed to update the widget align system because there is no sceneId provided", + ); + setNotification({ type: "error", text: t("Failed to update widget alignment.") }); + return { + status: "error", + }; + } + + const { data, errors } = await updateWidgetAlignSystem({ + variables: { + sceneId, + location: { + zone: location.zone.toUpperCase() as WidgetZoneType, + section: location.section.toUpperCase() as WidgetSectionType, + area: location.area.toUpperCase() as WidgetAreaType, + }, + align: align?.toUpperCase() as WidgetAreaAlign, + }, + }); + + if (errors || !data?.updateWidgetAlignSystem) { + console.log("GraphQL: Failed to update the widget align system", errors); + setNotification({ type: "error", text: t("Failed to update the widget align system.") }); + + return { status: "error" }; + } + + return { + data: data.updateWidgetAlignSystem.scene.widgetAlignSystem, + status: "success", + }; + }, + [updateWidgetAlignSystem, setNotification, t], + ); + return { useInstallableWidgetsQuery, useInstalledWidgetsQuery, useAddWidget, + useUpdateWidget, + useUpdateWidgetAlignSystem, useRemoveWidget, }; }; diff --git a/web/src/services/api/widgetsApi/utils.ts b/web/src/services/api/widgetsApi/utils.ts index 5d52b3c52..65e636f4f 100644 --- a/web/src/services/api/widgetsApi/utils.ts +++ b/web/src/services/api/widgetsApi/utils.ts @@ -45,7 +45,7 @@ export const getInstallableWidgets = (rawScene?: GetSceneQuery) => { undefined, }; }) - .filter((w): w is InstallableWidget => !!w); + .filter((w): w is InstallableWidget => !!w && !w.title.includes("legacy")); }) .reduce((a, b) => (b ? [...a, ...b] : a), []); }; diff --git a/web/src/services/gql/__gen__/gql.ts b/web/src/services/gql/__gen__/gql.ts index 0091a972a..b7bd864e9 100644 --- a/web/src/services/gql/__gen__/gql.ts +++ b/web/src/services/gql/__gen__/gql.ts @@ -40,7 +40,9 @@ const documents = { "\n mutation UpdateMe(\n $name: String\n $email: String\n $lang: Lang\n $theme: Theme\n $password: String\n $passwordConfirmation: String\n ) {\n updateMe(\n input: {\n name: $name\n email: $email\n lang: $lang\n theme: $theme\n password: $password\n passwordConfirmation: $passwordConfirmation\n }\n ) {\n me {\n id\n name\n email\n lang\n theme\n myTeam {\n id\n name\n }\n }\n }\n }\n": types.UpdateMeDocument, "\n mutation DeleteMe($userId: ID!) {\n deleteMe(input: { userId: $userId }) {\n userId\n }\n }\n": types.DeleteMeDocument, " mutation AddWidget($sceneId: ID!, $pluginId: ID!, $extensionId: ID!, $lang: Lang) {\n addWidget(\n input: {sceneId: $sceneId, pluginId: $pluginId, extensionId: $extensionId}\n ) {\n scene {\n id\n widgets {\n id\n enabled\n pluginId\n extensionId\n propertyId\n property {\n id\n ...PropertyFragment\n }\n }\n }\n sceneWidget {\n id\n enabled\n pluginId\n extensionId\n }\n }\n }": types.AddWidgetDocument, + "\n mutation UpdateWidget(\n $sceneId: ID!\n $widgetId: ID!\n $enabled: Boolean\n $location: WidgetLocationInput\n $extended: Boolean\n $index: Int\n ) {\n updateWidget(\n input: {\n sceneId: $sceneId\n widgetId: $widgetId\n enabled: $enabled\n location: $location\n extended: $extended\n index: $index\n }\n ) {\n scene {\n id\n widgets {\n id\n enabled\n extended\n pluginId\n extensionId\n propertyId\n }\n }\n }\n }\n": types.UpdateWidgetDocument, "\n mutation RemoveWidget($sceneId: ID!, $widgetId: ID!) {\n removeWidget(input: { sceneId: $sceneId, widgetId: $widgetId }) {\n scene {\n id\n widgets {\n id\n enabled\n pluginId\n extensionId\n propertyId\n }\n }\n }\n }\n": types.RemoveWidgetDocument, + "\n mutation UpdateWidgetAlignSystem(\n $sceneId: ID!\n $location: WidgetLocationInput!\n $align: WidgetAreaAlign\n $padding: WidgetAreaPaddingInput\n $gap: Int\n $centered: Boolean\n $background: String\n ) {\n updateWidgetAlignSystem(\n input: {\n sceneId: $sceneId\n location: $location\n align: $align\n padding: $padding\n gap: $gap\n centered: $centered\n background: $background\n }\n ) {\n scene {\n id\n widgets {\n id\n enabled\n pluginId\n extensionId\n propertyId\n }\n widgetAlignSystem {\n ...WidgetAlignSystemFragment\n }\n }\n }\n }\n": types.UpdateWidgetAlignSystemDocument, "\n mutation CreateWorkspace($name: String!) {\n createTeam(input: { name: $name }) {\n team {\n id\n name\n members {\n user {\n id\n name\n email\n }\n userId\n role\n }\n personal\n policyId\n policy {\n id\n name\n projectCount\n memberCount\n publishedProjectCount\n layerCount\n assetStorageSize\n datasetSchemaCount\n datasetCount\n }\n }\n }\n }\n": types.CreateWorkspaceDocument, }; @@ -166,10 +168,18 @@ export function gql(source: "\n mutation DeleteMe($userId: ID!) {\n deleteMe * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ export function gql(source: " mutation AddWidget($sceneId: ID!, $pluginId: ID!, $extensionId: ID!, $lang: Lang) {\n addWidget(\n input: {sceneId: $sceneId, pluginId: $pluginId, extensionId: $extensionId}\n ) {\n scene {\n id\n widgets {\n id\n enabled\n pluginId\n extensionId\n propertyId\n property {\n id\n ...PropertyFragment\n }\n }\n }\n sceneWidget {\n id\n enabled\n pluginId\n extensionId\n }\n }\n }"): (typeof documents)[" mutation AddWidget($sceneId: ID!, $pluginId: ID!, $extensionId: ID!, $lang: Lang) {\n addWidget(\n input: {sceneId: $sceneId, pluginId: $pluginId, extensionId: $extensionId}\n ) {\n scene {\n id\n widgets {\n id\n enabled\n pluginId\n extensionId\n propertyId\n property {\n id\n ...PropertyFragment\n }\n }\n }\n sceneWidget {\n id\n enabled\n pluginId\n extensionId\n }\n }\n }"]; +/** + * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. + */ +export function gql(source: "\n mutation UpdateWidget(\n $sceneId: ID!\n $widgetId: ID!\n $enabled: Boolean\n $location: WidgetLocationInput\n $extended: Boolean\n $index: Int\n ) {\n updateWidget(\n input: {\n sceneId: $sceneId\n widgetId: $widgetId\n enabled: $enabled\n location: $location\n extended: $extended\n index: $index\n }\n ) {\n scene {\n id\n widgets {\n id\n enabled\n extended\n pluginId\n extensionId\n propertyId\n }\n }\n }\n }\n"): (typeof documents)["\n mutation UpdateWidget(\n $sceneId: ID!\n $widgetId: ID!\n $enabled: Boolean\n $location: WidgetLocationInput\n $extended: Boolean\n $index: Int\n ) {\n updateWidget(\n input: {\n sceneId: $sceneId\n widgetId: $widgetId\n enabled: $enabled\n location: $location\n extended: $extended\n index: $index\n }\n ) {\n scene {\n id\n widgets {\n id\n enabled\n extended\n pluginId\n extensionId\n propertyId\n }\n }\n }\n }\n"]; /** * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ export function gql(source: "\n mutation RemoveWidget($sceneId: ID!, $widgetId: ID!) {\n removeWidget(input: { sceneId: $sceneId, widgetId: $widgetId }) {\n scene {\n id\n widgets {\n id\n enabled\n pluginId\n extensionId\n propertyId\n }\n }\n }\n }\n"): (typeof documents)["\n mutation RemoveWidget($sceneId: ID!, $widgetId: ID!) {\n removeWidget(input: { sceneId: $sceneId, widgetId: $widgetId }) {\n scene {\n id\n widgets {\n id\n enabled\n pluginId\n extensionId\n propertyId\n }\n }\n }\n }\n"]; +/** + * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. + */ +export function gql(source: "\n mutation UpdateWidgetAlignSystem(\n $sceneId: ID!\n $location: WidgetLocationInput!\n $align: WidgetAreaAlign\n $padding: WidgetAreaPaddingInput\n $gap: Int\n $centered: Boolean\n $background: String\n ) {\n updateWidgetAlignSystem(\n input: {\n sceneId: $sceneId\n location: $location\n align: $align\n padding: $padding\n gap: $gap\n centered: $centered\n background: $background\n }\n ) {\n scene {\n id\n widgets {\n id\n enabled\n pluginId\n extensionId\n propertyId\n }\n widgetAlignSystem {\n ...WidgetAlignSystemFragment\n }\n }\n }\n }\n"): (typeof documents)["\n mutation UpdateWidgetAlignSystem(\n $sceneId: ID!\n $location: WidgetLocationInput!\n $align: WidgetAreaAlign\n $padding: WidgetAreaPaddingInput\n $gap: Int\n $centered: Boolean\n $background: String\n ) {\n updateWidgetAlignSystem(\n input: {\n sceneId: $sceneId\n location: $location\n align: $align\n padding: $padding\n gap: $gap\n centered: $centered\n background: $background\n }\n ) {\n scene {\n id\n widgets {\n id\n enabled\n pluginId\n extensionId\n propertyId\n }\n widgetAlignSystem {\n ...WidgetAlignSystemFragment\n }\n }\n }\n }\n"]; /** * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ diff --git a/web/src/services/gql/__gen__/graphql.ts b/web/src/services/gql/__gen__/graphql.ts index 7851fc520..8ba40098b 100644 --- a/web/src/services/gql/__gen__/graphql.ts +++ b/web/src/services/gql/__gen__/graphql.ts @@ -2517,6 +2517,18 @@ export type AddWidgetMutationVariables = Exact<{ export type AddWidgetMutation = { __typename?: 'Mutation', addWidget?: { __typename?: 'AddWidgetPayload', scene: { __typename?: 'Scene', id: string, widgets: Array<{ __typename?: 'SceneWidget', id: string, enabled: boolean, pluginId: string, extensionId: string, propertyId: string, property?: { __typename?: 'Property', id: string, schema?: { __typename?: 'PropertySchema', id: string, groups: Array<{ __typename?: 'PropertySchemaGroup', schemaGroupId: string, title?: string | null, translatedTitle: string, isList: boolean, representativeFieldId?: string | null, isAvailableIf?: { __typename?: 'PropertyCondition', fieldId: string, type: ValueType, value?: any | null } | null, fields: Array<{ __typename?: 'PropertySchemaField', fieldId: string, title: string, description: string, translatedTitle: string, translatedDescription: string, prefix?: string | null, suffix?: string | null, type: ValueType, defaultValue?: any | null, ui?: PropertySchemaFieldUi | null, min?: number | null, max?: number | null, choices?: Array<{ __typename?: 'PropertySchemaFieldChoice', key: string, icon?: string | null, title: string, translatedTitle: string }> | null, isAvailableIf?: { __typename?: 'PropertyCondition', fieldId: string, type: ValueType, value?: any | null } | null }> }> } | null, items: Array<{ __typename?: 'PropertyGroup', id: string, schemaGroupId: string, fields: Array<{ __typename?: 'PropertyField', id: string, fieldId: string, type: ValueType, value?: any | null, links?: Array<{ __typename?: 'PropertyFieldLink', datasetId?: string | null, datasetSchemaId: string, datasetSchemaFieldId: string }> | null }> } | { __typename?: 'PropertyGroupList', id: string, schemaGroupId: string, groups: Array<{ __typename?: 'PropertyGroup', id: string, schemaGroupId: string, fields: Array<{ __typename?: 'PropertyField', id: string, fieldId: string, type: ValueType, value?: any | null, links?: Array<{ __typename?: 'PropertyFieldLink', datasetId?: string | null, datasetSchemaId: string, datasetSchemaFieldId: string }> | null }> }> }> } | null }> }, sceneWidget: { __typename?: 'SceneWidget', id: string, enabled: boolean, pluginId: string, extensionId: string } } | null }; +export type UpdateWidgetMutationVariables = Exact<{ + sceneId: Scalars['ID']['input']; + widgetId: Scalars['ID']['input']; + enabled?: InputMaybe; + location?: InputMaybe; + extended?: InputMaybe; + index?: InputMaybe; +}>; + + +export type UpdateWidgetMutation = { __typename?: 'Mutation', updateWidget?: { __typename?: 'UpdateWidgetPayload', scene: { __typename?: 'Scene', id: string, widgets: Array<{ __typename?: 'SceneWidget', id: string, enabled: boolean, extended: boolean, pluginId: string, extensionId: string, propertyId: string }> } } | null }; + export type RemoveWidgetMutationVariables = Exact<{ sceneId: Scalars['ID']['input']; widgetId: Scalars['ID']['input']; @@ -2525,6 +2537,19 @@ export type RemoveWidgetMutationVariables = Exact<{ export type RemoveWidgetMutation = { __typename?: 'Mutation', removeWidget?: { __typename?: 'RemoveWidgetPayload', scene: { __typename?: 'Scene', id: string, widgets: Array<{ __typename?: 'SceneWidget', id: string, enabled: boolean, pluginId: string, extensionId: string, propertyId: string }> } } | null }; +export type UpdateWidgetAlignSystemMutationVariables = Exact<{ + sceneId: Scalars['ID']['input']; + location: WidgetLocationInput; + align?: InputMaybe; + padding?: InputMaybe; + gap?: InputMaybe; + centered?: InputMaybe; + background?: InputMaybe; +}>; + + +export type UpdateWidgetAlignSystemMutation = { __typename?: 'Mutation', updateWidgetAlignSystem?: { __typename?: 'UpdateWidgetAlignSystemPayload', scene: { __typename?: 'Scene', id: string, widgets: Array<{ __typename?: 'SceneWidget', id: string, enabled: boolean, pluginId: string, extensionId: string, propertyId: string }>, widgetAlignSystem?: { __typename?: 'WidgetAlignSystem', outer?: { __typename?: 'WidgetZone', left?: { __typename?: 'WidgetSection', top?: { __typename?: 'WidgetArea', widgetIds: Array, align: WidgetAreaAlign, gap?: number | null, centered: boolean, background?: string | null, padding?: { __typename?: 'WidgetAreaPadding', top: number, bottom: number, left: number, right: number } | null } | null, middle?: { __typename?: 'WidgetArea', widgetIds: Array, align: WidgetAreaAlign, gap?: number | null, centered: boolean, background?: string | null, padding?: { __typename?: 'WidgetAreaPadding', top: number, bottom: number, left: number, right: number } | null } | null, bottom?: { __typename?: 'WidgetArea', widgetIds: Array, align: WidgetAreaAlign, gap?: number | null, centered: boolean, background?: string | null, padding?: { __typename?: 'WidgetAreaPadding', top: number, bottom: number, left: number, right: number } | null } | null } | null, center?: { __typename?: 'WidgetSection', top?: { __typename?: 'WidgetArea', widgetIds: Array, align: WidgetAreaAlign, gap?: number | null, centered: boolean, background?: string | null, padding?: { __typename?: 'WidgetAreaPadding', top: number, bottom: number, left: number, right: number } | null } | null, middle?: { __typename?: 'WidgetArea', widgetIds: Array, align: WidgetAreaAlign, gap?: number | null, centered: boolean, background?: string | null, padding?: { __typename?: 'WidgetAreaPadding', top: number, bottom: number, left: number, right: number } | null } | null, bottom?: { __typename?: 'WidgetArea', widgetIds: Array, align: WidgetAreaAlign, gap?: number | null, centered: boolean, background?: string | null, padding?: { __typename?: 'WidgetAreaPadding', top: number, bottom: number, left: number, right: number } | null } | null } | null, right?: { __typename?: 'WidgetSection', top?: { __typename?: 'WidgetArea', widgetIds: Array, align: WidgetAreaAlign, gap?: number | null, centered: boolean, background?: string | null, padding?: { __typename?: 'WidgetAreaPadding', top: number, bottom: number, left: number, right: number } | null } | null, middle?: { __typename?: 'WidgetArea', widgetIds: Array, align: WidgetAreaAlign, gap?: number | null, centered: boolean, background?: string | null, padding?: { __typename?: 'WidgetAreaPadding', top: number, bottom: number, left: number, right: number } | null } | null, bottom?: { __typename?: 'WidgetArea', widgetIds: Array, align: WidgetAreaAlign, gap?: number | null, centered: boolean, background?: string | null, padding?: { __typename?: 'WidgetAreaPadding', top: number, bottom: number, left: number, right: number } | null } | null } | null } | null, inner?: { __typename?: 'WidgetZone', left?: { __typename?: 'WidgetSection', top?: { __typename?: 'WidgetArea', widgetIds: Array, align: WidgetAreaAlign, gap?: number | null, centered: boolean, background?: string | null, padding?: { __typename?: 'WidgetAreaPadding', top: number, bottom: number, left: number, right: number } | null } | null, middle?: { __typename?: 'WidgetArea', widgetIds: Array, align: WidgetAreaAlign, gap?: number | null, centered: boolean, background?: string | null, padding?: { __typename?: 'WidgetAreaPadding', top: number, bottom: number, left: number, right: number } | null } | null, bottom?: { __typename?: 'WidgetArea', widgetIds: Array, align: WidgetAreaAlign, gap?: number | null, centered: boolean, background?: string | null, padding?: { __typename?: 'WidgetAreaPadding', top: number, bottom: number, left: number, right: number } | null } | null } | null, center?: { __typename?: 'WidgetSection', top?: { __typename?: 'WidgetArea', widgetIds: Array, align: WidgetAreaAlign, gap?: number | null, centered: boolean, background?: string | null, padding?: { __typename?: 'WidgetAreaPadding', top: number, bottom: number, left: number, right: number } | null } | null, middle?: { __typename?: 'WidgetArea', widgetIds: Array, align: WidgetAreaAlign, gap?: number | null, centered: boolean, background?: string | null, padding?: { __typename?: 'WidgetAreaPadding', top: number, bottom: number, left: number, right: number } | null } | null, bottom?: { __typename?: 'WidgetArea', widgetIds: Array, align: WidgetAreaAlign, gap?: number | null, centered: boolean, background?: string | null, padding?: { __typename?: 'WidgetAreaPadding', top: number, bottom: number, left: number, right: number } | null } | null } | null, right?: { __typename?: 'WidgetSection', top?: { __typename?: 'WidgetArea', widgetIds: Array, align: WidgetAreaAlign, gap?: number | null, centered: boolean, background?: string | null, padding?: { __typename?: 'WidgetAreaPadding', top: number, bottom: number, left: number, right: number } | null } | null, middle?: { __typename?: 'WidgetArea', widgetIds: Array, align: WidgetAreaAlign, gap?: number | null, centered: boolean, background?: string | null, padding?: { __typename?: 'WidgetAreaPadding', top: number, bottom: number, left: number, right: number } | null } | null, bottom?: { __typename?: 'WidgetArea', widgetIds: Array, align: WidgetAreaAlign, gap?: number | null, centered: boolean, background?: string | null, padding?: { __typename?: 'WidgetAreaPadding', top: number, bottom: number, left: number, right: number } | null } | null } | null } | null } | null } } | null }; + export type CreateWorkspaceMutationVariables = Exact<{ name: Scalars['String']['input']; }>; @@ -2592,5 +2617,7 @@ export const GetMeDocument = {"kind":"Document","definitions":[{"kind":"Operatio export const UpdateMeDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UpdateMe"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"name"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"email"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"lang"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Lang"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"theme"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Theme"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"password"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"passwordConfirmation"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"updateMe"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"name"},"value":{"kind":"Variable","name":{"kind":"Name","value":"name"}}},{"kind":"ObjectField","name":{"kind":"Name","value":"email"},"value":{"kind":"Variable","name":{"kind":"Name","value":"email"}}},{"kind":"ObjectField","name":{"kind":"Name","value":"lang"},"value":{"kind":"Variable","name":{"kind":"Name","value":"lang"}}},{"kind":"ObjectField","name":{"kind":"Name","value":"theme"},"value":{"kind":"Variable","name":{"kind":"Name","value":"theme"}}},{"kind":"ObjectField","name":{"kind":"Name","value":"password"},"value":{"kind":"Variable","name":{"kind":"Name","value":"password"}}},{"kind":"ObjectField","name":{"kind":"Name","value":"passwordConfirmation"},"value":{"kind":"Variable","name":{"kind":"Name","value":"passwordConfirmation"}}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"me"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"lang"}},{"kind":"Field","name":{"kind":"Name","value":"theme"}},{"kind":"Field","name":{"kind":"Name","value":"myTeam"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}}]}}]}}]} as unknown as DocumentNode; export const DeleteMeDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"DeleteMe"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"userId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"deleteMe"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"userId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"userId"}}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"userId"}}]}}]}}]} as unknown as DocumentNode; export const AddWidgetDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"AddWidget"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"sceneId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"pluginId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"extensionId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"lang"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Lang"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"addWidget"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"sceneId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"sceneId"}}},{"kind":"ObjectField","name":{"kind":"Name","value":"pluginId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"pluginId"}}},{"kind":"ObjectField","name":{"kind":"Name","value":"extensionId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"extensionId"}}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"scene"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"widgets"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"enabled"}},{"kind":"Field","name":{"kind":"Name","value":"pluginId"}},{"kind":"Field","name":{"kind":"Name","value":"extensionId"}},{"kind":"Field","name":{"kind":"Name","value":"propertyId"}},{"kind":"Field","name":{"kind":"Name","value":"property"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"PropertyFragment"}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"sceneWidget"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"enabled"}},{"kind":"Field","name":{"kind":"Name","value":"pluginId"}},{"kind":"Field","name":{"kind":"Name","value":"extensionId"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PropertyFieldLink"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PropertyFieldLink"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"datasetId"}},{"kind":"Field","name":{"kind":"Name","value":"datasetSchemaId"}},{"kind":"Field","name":{"kind":"Name","value":"datasetSchemaFieldId"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PropertyFieldFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PropertyField"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"fieldId"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"value"}},{"kind":"Field","name":{"kind":"Name","value":"links"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PropertyFieldLink"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PropertyGroupFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PropertyGroup"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"schemaGroupId"}},{"kind":"Field","name":{"kind":"Name","value":"fields"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PropertyFieldFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PropertyItemFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PropertyItem"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PropertyGroupList"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"schemaGroupId"}},{"kind":"Field","name":{"kind":"Name","value":"groups"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PropertyGroupFragment"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PropertyGroup"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PropertyGroupFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PropertyFragmentWithoutSchema"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Property"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PropertyItemFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PropertySchemaFieldFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PropertySchemaField"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"fieldId"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"translatedTitle"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"lang"},"value":{"kind":"Variable","name":{"kind":"Name","value":"lang"}}}]},{"kind":"Field","name":{"kind":"Name","value":"translatedDescription"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"lang"},"value":{"kind":"Variable","name":{"kind":"Name","value":"lang"}}}]},{"kind":"Field","name":{"kind":"Name","value":"prefix"}},{"kind":"Field","name":{"kind":"Name","value":"suffix"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"defaultValue"}},{"kind":"Field","name":{"kind":"Name","value":"ui"}},{"kind":"Field","name":{"kind":"Name","value":"min"}},{"kind":"Field","name":{"kind":"Name","value":"max"}},{"kind":"Field","name":{"kind":"Name","value":"choices"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"translatedTitle"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"lang"},"value":{"kind":"Variable","name":{"kind":"Name","value":"lang"}}}]}]}},{"kind":"Field","name":{"kind":"Name","value":"isAvailableIf"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"fieldId"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"value"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PropertySchemaGroupFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PropertySchemaGroup"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"schemaGroupId"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"translatedTitle"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"lang"},"value":{"kind":"Variable","name":{"kind":"Name","value":"lang"}}}]},{"kind":"Field","name":{"kind":"Name","value":"isList"}},{"kind":"Field","name":{"kind":"Name","value":"representativeFieldId"}},{"kind":"Field","name":{"kind":"Name","value":"isAvailableIf"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"fieldId"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"value"}}]}},{"kind":"Field","name":{"kind":"Name","value":"fields"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PropertySchemaFieldFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PropertyFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Property"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"PropertyFragmentWithoutSchema"}},{"kind":"Field","name":{"kind":"Name","value":"schema"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"groups"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PropertySchemaGroupFragment"}}]}}]}}]}}]} as unknown as DocumentNode; +export const UpdateWidgetDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UpdateWidget"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"sceneId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"widgetId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"enabled"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Boolean"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"location"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"WidgetLocationInput"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"extended"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Boolean"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"index"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"updateWidget"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"sceneId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"sceneId"}}},{"kind":"ObjectField","name":{"kind":"Name","value":"widgetId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"widgetId"}}},{"kind":"ObjectField","name":{"kind":"Name","value":"enabled"},"value":{"kind":"Variable","name":{"kind":"Name","value":"enabled"}}},{"kind":"ObjectField","name":{"kind":"Name","value":"location"},"value":{"kind":"Variable","name":{"kind":"Name","value":"location"}}},{"kind":"ObjectField","name":{"kind":"Name","value":"extended"},"value":{"kind":"Variable","name":{"kind":"Name","value":"extended"}}},{"kind":"ObjectField","name":{"kind":"Name","value":"index"},"value":{"kind":"Variable","name":{"kind":"Name","value":"index"}}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"scene"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"widgets"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"enabled"}},{"kind":"Field","name":{"kind":"Name","value":"extended"}},{"kind":"Field","name":{"kind":"Name","value":"pluginId"}},{"kind":"Field","name":{"kind":"Name","value":"extensionId"}},{"kind":"Field","name":{"kind":"Name","value":"propertyId"}}]}}]}}]}}]}}]} as unknown as DocumentNode; export const RemoveWidgetDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"RemoveWidget"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"sceneId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"widgetId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"removeWidget"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"sceneId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"sceneId"}}},{"kind":"ObjectField","name":{"kind":"Name","value":"widgetId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"widgetId"}}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"scene"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"widgets"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"enabled"}},{"kind":"Field","name":{"kind":"Name","value":"pluginId"}},{"kind":"Field","name":{"kind":"Name","value":"extensionId"}},{"kind":"Field","name":{"kind":"Name","value":"propertyId"}}]}}]}}]}}]}}]} as unknown as DocumentNode; +export const UpdateWidgetAlignSystemDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UpdateWidgetAlignSystem"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"sceneId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"location"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"WidgetLocationInput"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"align"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"WidgetAreaAlign"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"padding"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"WidgetAreaPaddingInput"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"gap"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"centered"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Boolean"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"background"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"updateWidgetAlignSystem"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"sceneId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"sceneId"}}},{"kind":"ObjectField","name":{"kind":"Name","value":"location"},"value":{"kind":"Variable","name":{"kind":"Name","value":"location"}}},{"kind":"ObjectField","name":{"kind":"Name","value":"align"},"value":{"kind":"Variable","name":{"kind":"Name","value":"align"}}},{"kind":"ObjectField","name":{"kind":"Name","value":"padding"},"value":{"kind":"Variable","name":{"kind":"Name","value":"padding"}}},{"kind":"ObjectField","name":{"kind":"Name","value":"gap"},"value":{"kind":"Variable","name":{"kind":"Name","value":"gap"}}},{"kind":"ObjectField","name":{"kind":"Name","value":"centered"},"value":{"kind":"Variable","name":{"kind":"Name","value":"centered"}}},{"kind":"ObjectField","name":{"kind":"Name","value":"background"},"value":{"kind":"Variable","name":{"kind":"Name","value":"background"}}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"scene"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"widgets"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"enabled"}},{"kind":"Field","name":{"kind":"Name","value":"pluginId"}},{"kind":"Field","name":{"kind":"Name","value":"extensionId"}},{"kind":"Field","name":{"kind":"Name","value":"propertyId"}}]}},{"kind":"Field","name":{"kind":"Name","value":"widgetAlignSystem"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"WidgetAlignSystemFragment"}}]}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"WidgetAreaFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WidgetArea"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"widgetIds"}},{"kind":"Field","name":{"kind":"Name","value":"align"}},{"kind":"Field","name":{"kind":"Name","value":"padding"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"top"}},{"kind":"Field","name":{"kind":"Name","value":"bottom"}},{"kind":"Field","name":{"kind":"Name","value":"left"}},{"kind":"Field","name":{"kind":"Name","value":"right"}}]}},{"kind":"Field","name":{"kind":"Name","value":"gap"}},{"kind":"Field","name":{"kind":"Name","value":"centered"}},{"kind":"Field","name":{"kind":"Name","value":"background"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"WidgetSectionFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WidgetSection"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"top"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"WidgetAreaFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"middle"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"WidgetAreaFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"bottom"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"WidgetAreaFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"WidgetZoneFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WidgetZone"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"left"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"WidgetSectionFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"center"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"WidgetSectionFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"right"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"WidgetSectionFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"WidgetAlignSystemFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WidgetAlignSystem"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"outer"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"WidgetZoneFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"inner"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"WidgetZoneFragment"}}]}}]}}]} as unknown as DocumentNode; export const CreateWorkspaceDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"CreateWorkspace"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"name"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"createTeam"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"name"},"value":{"kind":"Variable","name":{"kind":"Name","value":"name"}}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"team"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"members"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"user"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"email"}}]}},{"kind":"Field","name":{"kind":"Name","value":"userId"}},{"kind":"Field","name":{"kind":"Name","value":"role"}}]}},{"kind":"Field","name":{"kind":"Name","value":"personal"}},{"kind":"Field","name":{"kind":"Name","value":"policyId"}},{"kind":"Field","name":{"kind":"Name","value":"policy"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"projectCount"}},{"kind":"Field","name":{"kind":"Name","value":"memberCount"}},{"kind":"Field","name":{"kind":"Name","value":"publishedProjectCount"}},{"kind":"Field","name":{"kind":"Name","value":"layerCount"}},{"kind":"Field","name":{"kind":"Name","value":"assetStorageSize"}},{"kind":"Field","name":{"kind":"Name","value":"datasetSchemaCount"}},{"kind":"Field","name":{"kind":"Name","value":"datasetCount"}}]}}]}}]}}]}}]} as unknown as DocumentNode; \ No newline at end of file diff --git a/web/src/services/gql/queries/widget.ts b/web/src/services/gql/queries/widget.ts index 3d110ce0a..0e78baa66 100644 --- a/web/src/services/gql/queries/widget.ts +++ b/web/src/services/gql/queries/widget.ts @@ -28,6 +28,40 @@ export const ADD_WIDGET = } }`); +export const UPDATE_WIDGET = gql(` + mutation UpdateWidget( + $sceneId: ID! + $widgetId: ID! + $enabled: Boolean + $location: WidgetLocationInput + $extended: Boolean + $index: Int + ) { + updateWidget( + input: { + sceneId: $sceneId + widgetId: $widgetId + enabled: $enabled + location: $location + extended: $extended + index: $index + } + ) { + scene { + id + widgets { + id + enabled + extended + pluginId + extensionId + propertyId + } + } + } + } +`); + export const REMOVE_WIDGET = gql(` mutation RemoveWidget($sceneId: ID!, $widgetId: ID!) { removeWidget(input: { sceneId: $sceneId, widgetId: $widgetId }) { @@ -44,3 +78,41 @@ export const REMOVE_WIDGET = gql(` } } `); + +export const UPDATE_WIDGET_ALIGN_SYSTEM = gql(` + mutation UpdateWidgetAlignSystem( + $sceneId: ID! + $location: WidgetLocationInput! + $align: WidgetAreaAlign + $padding: WidgetAreaPaddingInput + $gap: Int + $centered: Boolean + $background: String + ) { + updateWidgetAlignSystem( + input: { + sceneId: $sceneId + location: $location + align: $align + padding: $padding + gap: $gap + centered: $centered + background: $background + } + ) { + scene { + id + widgets { + id + enabled + pluginId + extensionId + propertyId + } + widgetAlignSystem { + ...WidgetAlignSystemFragment + } + } + } + } +`); diff --git a/web/src/services/i18n/translations/en.yml b/web/src/services/i18n/translations/en.yml index 09c2ec875..7178d7acb 100644 --- a/web/src/services/i18n/translations/en.yml +++ b/web/src/services/i18n/translations/en.yml @@ -411,4 +411,7 @@ Successfully removed member from the workspace.: Successfully removed member fro Some error has occurred. Please wait a moment and try again.: Some error has occurred. Please wait a moment and try again. Failed to update property.: Failed to update property Failed to add widget.: Failed to add widget. -Failed to remove widget.: '' +Failed to update widget.: Failed to update widget. +Failed to remove widget.: Failed to remove widget. +Failed to update widget alignment.: Failed to update widget alignment. +Failed to update the widget align system.: Failed to update the widget align system. diff --git a/web/src/services/i18n/translations/ja.yml b/web/src/services/i18n/translations/ja.yml index bae1f9d77..ba5a08402 100644 --- a/web/src/services/i18n/translations/ja.yml +++ b/web/src/services/i18n/translations/ja.yml @@ -372,4 +372,7 @@ Successfully removed member from the workspace.: このワークスペースか Some error has occurred. Please wait a moment and try again.: エラーが発生しました。少し待ってからもう一度試してみてください。 Failed to update property.: プロパティのアップデートに失敗しました。 Failed to add widget.: ウィジェットの作成に失敗しました。 -Failed to remove widget.: '' +Failed to update widget.: ウィジェットのアップデートに失敗しました。 +Failed to remove widget.: ウィジェットの削除に失敗しました。 +Failed to update widget alignment.: ウィジェットのアラインメントのアップデートに失敗しました。 +Failed to update the widget align system.: ウィジェットのアラインシステムのアップデートに失敗しました。