From 8fa423ed4abb46d6b93db04c6bfe92297da400fd Mon Sep 17 00:00:00 2001 From: Adam Dierkens Date: Wed, 19 Oct 2022 15:59:37 -0700 Subject: [PATCH 01/52] Save off progress --- WORKSPACE | 12 +- drag-and-drop/README.md | 4 + drag-and-drop/app/BUILD | 46 + drag-and-drop/app/next-env.d.ts | 5 + drag-and-drop/app/next.config.mjs | 12 + drag-and-drop/app/pages/index.tsx | 32 + drag-and-drop/app/tsconfig.json | 30 + drag-and-drop/figma-widget/BUILD | 0 drag-and-drop/library/BUILD | 19 + .../library/src/__tests__/controller.test.tsx | 56 + drag-and-drop/library/src/controller.tsx | 126 ++ drag-and-drop/library/src/hooks/index.ts | 1 + .../library/src/hooks/useDragAndDrop.tsx | 11 + drag-and-drop/library/src/index.tsx | 3 + drag-and-drop/library/src/types.ts | 107 ++ .../library/src/utils/drop-component.tsx | 31 + drag-and-drop/library/src/utils/index.ts | 1 + .../library/src/utils/player-dnd-plugin.ts | 128 ++ .../library/src/utils/runtime-flow-state.ts | 144 ++ jest.config.js | 3 + package.json | 14 +- yarn.lock | 1491 ++++++++++++++++- 22 files changed, 2206 insertions(+), 70 deletions(-) create mode 100644 drag-and-drop/README.md create mode 100644 drag-and-drop/app/BUILD create mode 100644 drag-and-drop/app/next-env.d.ts create mode 100644 drag-and-drop/app/next.config.mjs create mode 100644 drag-and-drop/app/pages/index.tsx create mode 100644 drag-and-drop/app/tsconfig.json create mode 100644 drag-and-drop/figma-widget/BUILD create mode 100644 drag-and-drop/library/BUILD create mode 100644 drag-and-drop/library/src/__tests__/controller.test.tsx create mode 100644 drag-and-drop/library/src/controller.tsx create mode 100644 drag-and-drop/library/src/hooks/index.ts create mode 100644 drag-and-drop/library/src/hooks/useDragAndDrop.tsx create mode 100644 drag-and-drop/library/src/index.tsx create mode 100644 drag-and-drop/library/src/types.ts create mode 100644 drag-and-drop/library/src/utils/drop-component.tsx create mode 100644 drag-and-drop/library/src/utils/index.ts create mode 100644 drag-and-drop/library/src/utils/player-dnd-plugin.ts create mode 100644 drag-and-drop/library/src/utils/runtime-flow-state.ts diff --git a/WORKSPACE b/WORKSPACE index 69ffa190..5082b3a4 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -5,15 +5,13 @@ workspace( }, ) -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") +load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository") -http_archive( - name = "rules_player", - strip_prefix = "rules_player-0.10.0", - urls = ["https://github.com/player-ui/rules_player/archive/refs/tags/v0.10.0.tar.gz"], - sha256 = "73597c76a5ceb6c1f84735e0e086792e4695759c62c22f45e13041862c6b0c33" +git_repository( + name = "rules_player", + remote = "https://github.com/player-ui/rules_player.git", + branch = "esm-native-builds" ) - load("@rules_player//:workspace.bzl", "deps") deps() diff --git a/drag-and-drop/README.md b/drag-and-drop/README.md new file mode 100644 index 00000000..8824cf0f --- /dev/null +++ b/drag-and-drop/README.md @@ -0,0 +1,4 @@ +# Drag and Drop + +This is a collection of utility libraries and reference integrations for constructing a drag-and-drop editor for Player content. + diff --git a/drag-and-drop/app/BUILD b/drag-and-drop/app/BUILD new file mode 100644 index 00000000..04ccadc2 --- /dev/null +++ b/drag-and-drop/app/BUILD @@ -0,0 +1,46 @@ +load("@npm//next:index.bzl", "next") +load("@rules_player//javascript/next:next_build.bzl", "next_export") + +package(default_visibility = ["//visibility:public"]) + +srcs = glob([ + "public/**/*", + "pages/**/*", + "styles/*", + "components/**/*", + "plugins/*", + "utils/*", + "config/*", +]) + [ + "next.config.mjs", + "next-env.d.ts", + "tsconfig.json" +] + +data = [ + "//drag-and-drop/library:@player-tools/dnd-lib", + "//common:@player-tools/static-xlrs", + "@npm//typescript", + "@npm//@types/react", + "@npm//@types/node", +] + +next_export( + name = "app", + data = data, + srcs = srcs, + env = { + "NODE_ENV": "production", + # Need this b/c next will pull from env directly + # This just maps to a value we can stamp w/ later on + "NEXT_PUBLIC_GA_MEASUREMENT_ID": "NEXT_PUBLIC_GA_MEASUREMENT_ID", + }, +) + +next( + name = "start", + args = [ + "dev", './drag-and-drop/app' + ], + data = data + srcs, +) \ No newline at end of file diff --git a/drag-and-drop/app/next-env.d.ts b/drag-and-drop/app/next-env.d.ts new file mode 100644 index 00000000..4f11a03d --- /dev/null +++ b/drag-and-drop/app/next-env.d.ts @@ -0,0 +1,5 @@ +/// +/// + +// NOTE: This file should not be edited +// see https://nextjs.org/docs/basic-features/typescript for more information. diff --git a/drag-and-drop/app/next.config.mjs b/drag-and-drop/app/next.config.mjs new file mode 100644 index 00000000..7541d425 --- /dev/null +++ b/drag-and-drop/app/next.config.mjs @@ -0,0 +1,12 @@ +// This will be replaced during the build stamping +export const BASE_PREFIX = process.env.NODE_ENV === 'production' ? '/DOCS_BASE_PATH' : undefined; + +export default { + reactStrictMode: true, + env: { + NEXT_PUBLIC_BASE_PATH: BASE_PREFIX + }, + basePath: BASE_PREFIX, + assetPrefix: BASE_PREFIX, + pageExtensions: ['jsx', 'js', 'ts', 'tsx'] +}; \ No newline at end of file diff --git a/drag-and-drop/app/pages/index.tsx b/drag-and-drop/app/pages/index.tsx new file mode 100644 index 00000000..90832907 --- /dev/null +++ b/drag-and-drop/app/pages/index.tsx @@ -0,0 +1,32 @@ +import React from 'react'; +import { ChakraProvider } from '@chakra-ui/react'; +import type { DragAndDropControllerOptions } from '@player-tools/dnd-lib'; +import { DragAndDropController } from '@player-tools/dnd-lib'; +import { useDragAndDrop } from '@player-tools/dnd-lib'; +import { ReferenceAssetsPlugin } from '@player-ui/reference-assets-plugin-react'; +import manifest from '@player-tools/static-xlrs/static_xlrs/plugin/xlr/manifest'; + +const config: DragAndDropControllerOptions = { + extensions: [ + { + plugin: ReferenceAssetsPlugin, + manifest: manifest as any, + }, + ], +}; + +const controller = new DragAndDropController(config); + +const App = () => { + return ( + + +
+ +
+
+
+ ); +}; + +export default App; diff --git a/drag-and-drop/app/tsconfig.json b/drag-and-drop/app/tsconfig.json new file mode 100644 index 00000000..a160b879 --- /dev/null +++ b/drag-and-drop/app/tsconfig.json @@ -0,0 +1,30 @@ +{ + "compilerOptions": { + "target": "es5", + "lib": [ + "dom", + "dom.iterable", + "esnext" + ], + "allowJs": true, + "skipLibCheck": true, + "strict": false, + "forceConsistentCasingInFileNames": true, + "noEmit": true, + "incremental": true, + "esModuleInterop": true, + "module": "esnext", + "moduleResolution": "node", + "resolveJsonModule": true, + "isolatedModules": true, + "jsx": "preserve" + }, + "include": [ + "next-env.d.ts", + "**/*.ts", + "**/*.tsx" + ], + "exclude": [ + "node_modules" + ] +} \ No newline at end of file diff --git a/drag-and-drop/figma-widget/BUILD b/drag-and-drop/figma-widget/BUILD new file mode 100644 index 00000000..e69de29b diff --git a/drag-and-drop/library/BUILD b/drag-and-drop/library/BUILD new file mode 100644 index 00000000..cf8dd523 --- /dev/null +++ b/drag-and-drop/library/BUILD @@ -0,0 +1,19 @@ +load("//:index.bzl", "javascript_pipeline") + +javascript_pipeline( + name = "@player-tools/dnd-lib", + dependencies = [ + "//xlr/types:@player-tools/xlr", + "@npm//@player-ui/react", + "@npm//react-dnd", + "@npm//react-dnd-html5-backend", + ], + peer_dependencies = [ + "@npm//react", + "@npm//react-dom" + ], + esm_only = True, + test_data = [ + "//common:@player-tools/static-xlrs", + ] +) \ No newline at end of file diff --git a/drag-and-drop/library/src/__tests__/controller.test.tsx b/drag-and-drop/library/src/__tests__/controller.test.tsx new file mode 100644 index 00000000..e57a6fb8 --- /dev/null +++ b/drag-and-drop/library/src/__tests__/controller.test.tsx @@ -0,0 +1,56 @@ +import { waitFor } from '@testing-library/react'; +import type { InProgressState } from '@player-ui/react'; +import manifest from '@player-tools/static-xlrs/static_xlrs/plugin/xlr/manifest'; +import { DragAndDropController } from '../controller'; +import type { ExtensionProvider } from '../types'; + +const referenceAssetExtension: ExtensionProvider = { + plugin: class test { + name = 'test'; + }, + manifest: manifest as any, +}; + +describe('drag-and-drop', () => { + it('Fills in placeholder assets when dropped', async () => { + const dndController = new DragAndDropController({ + extensions: [referenceAssetExtension], + }); + + const { player } = dndController.webPlayer; + const getView = () => + (player.getState() as InProgressState).controllers?.view.currentView + ?.lastUpdate; + + expect(getView()?.id).toBe('drag-and-drop-view'); + + getView()?.replaceAsset({ + pluginName: 'BaseAssetsPlugin', + name: 'InfoAsset', + }); + + await waitFor(() => { + expect(getView()?.value?.asset.type).toBe('info'); + }); + + getView()?.value.asset.title.asset.replaceAsset({ + pluginName: 'BaseAssetsPlugin', + name: 'TextAsset', + }); + + await waitFor(() => { + expect(getView()?.value?.asset.title.asset.value.asset.type).toBe('text'); + }); + + expect(dndController.exportView()).toStrictEqual({ + id: 'drag-and-drop-view-test-1', + type: 'info', + title: { + asset: { + id: 'drag-and-drop-view-test-title-test-1', + type: 'text', + }, + }, + }); + }); +}); diff --git a/drag-and-drop/library/src/controller.tsx b/drag-and-drop/library/src/controller.tsx new file mode 100644 index 00000000..c01f2870 --- /dev/null +++ b/drag-and-drop/library/src/controller.tsx @@ -0,0 +1,126 @@ +import React from 'react'; +import type { AssetWrapper, View } from '@player-ui/react'; +import { ConsoleLogger, WebPlayer } from '@player-ui/react'; +import { DndProvider } from 'react-dnd'; +import { HTML5Backend } from 'react-dnd-html5-backend'; +import type { ObjectNode } from '@player-tools/xlr'; +import { PlayerDndPlugin } from './utils'; +import type { + DropTargetAssetType, + ExtensionProvider, + TransformedDropTargetAssetType, +} from './types'; +import { isDropTargetAsset } from './types'; +import { RuntimeFlowState } from './utils/runtime-flow-state'; +import { DropComponent } from './utils/drop-component'; + +export interface DragAndDropControllerOptions { + extensions?: Array; + + Component?: React.ComponentType; +} + +export class DragAndDropController { + private readonly options: DragAndDropControllerOptions; + public readonly webPlayer: WebPlayer; + + private readonly dndWebPlayerPlugin: PlayerDndPlugin; + private readonly runtimeState: RuntimeFlowState; + + public get Canvas() { + return this.webPlayer.Component; + } + + public Context: React.ComponentType>; + + constructor(options?: DragAndDropControllerOptions) { + this.options = options ?? {}; + + this.runtimeState = new RuntimeFlowState(); + + this.dndWebPlayerPlugin = new PlayerDndPlugin({ + state: this.runtimeState, + Target: { + Component: this.options.Component ?? DropComponent, + }, + getXLRTypeForAsset: (identifier): ObjectNode => { + const plugin = options?.extensions?.find( + (id) => identifier.pluginName === id.manifest.pluginName + ); + + const asset = plugin?.manifest.capabilities?.Assets.find( + (a) => a.name === identifier.name + ); + + if (asset?.type === 'object') { + return asset as ObjectNode; + } + + throw new Error( + `Unable to find type information for asset identifier: ${identifier.name} in plugin ${identifier.pluginName}` + ); + }, + }); + + this.webPlayer = new WebPlayer({ + plugins: [this.dndWebPlayerPlugin], + }); + + this.webPlayer.player.logger.addHandler(new ConsoleLogger('debug')); + + this.Context = (props: React.PropsWithChildren) => { + return {props.children}; + }; + + this.webPlayer.start(this.runtimeState.flow); + } + + exportView(): View { + const baseView = this.runtimeState.view; + + const removeDndStateFromView = (obj: unknown): any => { + if (obj === baseView && isDropTargetAsset(obj)) { + if (obj.value?.asset) { + return removeDndStateFromView(obj.value.asset); + } + + return undefined; + } + + if (typeof obj === 'object' && obj !== null) { + if ('asset' in obj) { + const asWrapper: AssetWrapper = obj as any; + if ('asset' in obj && isDropTargetAsset(asWrapper.asset)) { + if (asWrapper.asset.value) { + const nestedValue = removeDndStateFromView( + asWrapper.asset.value.asset + ); + + // eslint-disable-next-line max-depth + if (nestedValue) { + return { + asset: nestedValue, + }; + } + } + + return undefined; + } + } + + return Object.fromEntries( + Object.entries(obj).map(([key, value]) => [ + key, + removeDndStateFromView(value), + ]) + ); + } + + return obj; + }; + + // remove any undefined values from the view + // we only want JSON compliant values + return JSON.parse(JSON.stringify(removeDndStateFromView(baseView))); + } +} diff --git a/drag-and-drop/library/src/hooks/index.ts b/drag-and-drop/library/src/hooks/index.ts new file mode 100644 index 00000000..31c4e2f1 --- /dev/null +++ b/drag-and-drop/library/src/hooks/index.ts @@ -0,0 +1 @@ +export * from './useDragAndDrop'; diff --git a/drag-and-drop/library/src/hooks/useDragAndDrop.tsx b/drag-and-drop/library/src/hooks/useDragAndDrop.tsx new file mode 100644 index 00000000..c615f52d --- /dev/null +++ b/drag-and-drop/library/src/hooks/useDragAndDrop.tsx @@ -0,0 +1,11 @@ +import React from 'react'; +import type { DragAndDropControllerOptions } from '../controller'; +import { DragAndDropController } from '../controller'; + +export const useDragAndDrop = (conf?: DragAndDropControllerOptions) => { + const controller = React.useMemo(() => { + return new DragAndDropController(conf); + }, []); + + return controller; +}; diff --git a/drag-and-drop/library/src/index.tsx b/drag-and-drop/library/src/index.tsx new file mode 100644 index 00000000..e24b54ec --- /dev/null +++ b/drag-and-drop/library/src/index.tsx @@ -0,0 +1,3 @@ +export * from './utils'; +export * from './hooks'; +export * from './controller'; diff --git a/drag-and-drop/library/src/types.ts b/drag-and-drop/library/src/types.ts new file mode 100644 index 00000000..b5aff062 --- /dev/null +++ b/drag-and-drop/library/src/types.ts @@ -0,0 +1,107 @@ +import type { ObjectType, TSManifest } from '@player-tools/xlr'; +import type { + Asset, + WebPlayerPlugin, + Flow, + View, + AssetWrapper, +} from '@player-ui/react'; + +export const DroppedItemTypes = { + ASSET: 'ASSET', +}; + +export const DragAndDropAssetType = Symbol('DragAndDropAssetType'); + +export type FlowWithOneView = Flow & { + views: [View]; +}; + +export interface DroppedAsset { + type: typeof DroppedItemTypes.ASSET; + identifier: ExtensionProviderAssetIdentifier; +} + +export interface ExtensionProvider { + /** A constructor to create an instance of the plugin */ + plugin: { + new (): WebPlayerPlugin; + }; + + /** A manifest describing the plugins capabilities */ + manifest: TSManifest; +} + +export interface ExtensionProviderAssetIdentifier { + /** The name of the plugin that supplied this type */ + pluginName: string; + + /** The asset type in the plugin */ + name: string; +} + +export const isDropTargetAsset = (obj: unknown): obj is DropTargetAssetType => { + return ( + typeof obj === 'object' && + obj !== null && + (obj as DropTargetAssetType).__type === DragAndDropAssetType + ); +}; + +export interface DropTargetAssetType extends Asset<'drop-target'> { + /** An opaque identifier for the placeholder */ + __type: typeof DragAndDropAssetType; + + /** + * The context for what this value is in + * Used for determining if a value is allowed to be dropped in this slot or not + */ + context?: { + /** The identifier for the parent asset type */ + parent: ExtensionProviderAssetIdentifier; + + /** The name of the property that this asset fulfills */ + propertyName?: string; + }; + + /** + * An asset that's currently populating this slot + * if not set, then this slot is empty and a placeholder will be shown instead + */ + value?: { + /** The identifier for where the populated asset is from */ + identifier: ExtensionProviderAssetIdentifier; + + /** The current descriptor for the value stored at this asset */ + type: ObjectType; + + /** + * A mapping of asset slot name to drop target handlers + */ + asset: Asset; + }; +} + +export interface TransformedDropTargetAssetType extends DropTargetAssetType { + /** Context relative to the parent's position */ + context?: DropTargetAssetType['context'] & { + /** + * If the slot should accept being appended to + * Set if the parent asset supports an array (and this is the last item) + * or if the parent slot is a single item and we can convert to a collection + */ + allowArrayAppend: boolean; + }; + + /** Set the value of this slot to the replacement value */ + replaceAsset: (identifier: ExtensionProviderAssetIdentifier) => void; + + /** Append the asset to the slot */ + appendAsset: (identifier: ExtensionProviderAssetIdentifier) => void; + + /** + * Remove the value stored at this location + * If the parent slot is a collection we can automatically collapse it + */ + clearAsset: () => void; +} diff --git a/drag-and-drop/library/src/utils/drop-component.tsx b/drag-and-drop/library/src/utils/drop-component.tsx new file mode 100644 index 00000000..2f086dc3 --- /dev/null +++ b/drag-and-drop/library/src/utils/drop-component.tsx @@ -0,0 +1,31 @@ +import React from 'react'; +import { useDrop } from 'react-dnd'; +import { Asset } from '@player-ui/react-asset'; +import { DroppedItemTypes } from '../types'; +import type { + TransformedDropTargetAssetType, + ExtensionProviderAssetIdentifier, +} from '../types'; + +export const DropComponent = (props: TransformedDropTargetAssetType) => { + const [{ isOver }, drop] = useDrop({ + accept: DroppedItemTypes.ASSET, + drop: (item: ExtensionProviderAssetIdentifier) => { + props.replaceAsset(item); + }, + collect: (monitor) => ({ + isOver: monitor.isOver(), + canDrop: monitor.canDrop(), + }), + }); + + if (props.value) { + return ( +
+ +
+ ); + } + + return
Test
; +}; diff --git a/drag-and-drop/library/src/utils/index.ts b/drag-and-drop/library/src/utils/index.ts new file mode 100644 index 00000000..37e9d457 --- /dev/null +++ b/drag-and-drop/library/src/utils/index.ts @@ -0,0 +1 @@ +export * from './player-dnd-plugin'; diff --git a/drag-and-drop/library/src/utils/player-dnd-plugin.ts b/drag-and-drop/library/src/utils/player-dnd-plugin.ts new file mode 100644 index 00000000..39d26fe8 --- /dev/null +++ b/drag-and-drop/library/src/utils/player-dnd-plugin.ts @@ -0,0 +1,128 @@ +import type { ObjectNode } from '@player-tools/xlr'; +import type { + WebPlayer, + WebPlayerPlugin, + Asset, + ViewController, + Player, +} from '@player-ui/react'; +import type { + ExtensionProviderAssetIdentifier, + TransformedDropTargetAssetType, +} from '../types'; +import type { RuntimeFlowState } from './runtime-flow-state'; + +/** Options for controlling the drag-and-drop functionality */ +export interface PlayerDndPluginOptions< + TargetPropsType extends Asset = TransformedDropTargetAssetType +> { + /** The Target component represents a drop-target */ + Target: { + /** The React component to use */ + Component: React.ComponentType; + + /** An optional override for the asset-type */ + type?: TargetPropsType['type']; + }; + + /** An optional override for the transition name when refreshing a flow */ + refreshTransition?: string; + + getXLRTypeForAsset: ( + identifier: ExtensionProviderAssetIdentifier + ) => ObjectNode; + + /** A manager for the current flow state */ + state: RuntimeFlowState; +} + +interface PlayerDndPluginState { + /** Re-render the view with updates from external updates */ + refreshView: () => void; +} + +/** + * A plugin that handles drag and drop integration + */ +export class PlayerDndPlugin implements WebPlayerPlugin { + name = 'player-dnd-plugin'; + + private state: WeakMap = new WeakMap(); + private readonly options: PlayerDndPluginOptions; + + constructor(options: PlayerDndPluginOptions) { + this.options = options; + } + + refresh(p: Player) { + this.state.get(p)?.refreshView(); + } + + apply(player: Player) { + const match = { type: this.options.Target.type ?? 'drop-target' }; + + player.hooks.viewController.tap(this.name, (vc) => { + vc.transformRegistry.set(match, { + resolve: (asset) => { + return { + ...asset, + + // Send back up to the runtime-state handler to compute the new view + replaceAsset: (identifier: ExtensionProviderAssetIdentifier) => { + console.log(`Replacing asset at: ${asset.id}`); + + this.options.state.replace(asset.id, { + identifier, + type: this.options.getXLRTypeForAsset(identifier), + }); + this.refresh(player); + }, + appendAsset: (identifier: ExtensionProviderAssetIdentifier) => { + console.log(`Appending to asset at: ${asset.id}`); + + this.options.state.append(asset.id, { + identifier, + type: this.options.getXLRTypeForAsset(identifier), + }); + this.refresh(player); + }, + clearAsset: () => { + console.log(`Clearing asset at: ${asset.id}`); + + this.options.state.clear(asset.id); + this.refresh(player); + }, + }; + }, + }); + }); + + player.hooks.resolveFlowContent.tap(this.name, () => { + return this.options.state.flow; + }); + + player.hooks.viewController.tap(this.name, (vc: ViewController) => { + vc.hooks.resolveView.tap(this.name, () => { + return this.options.state.view; + }); + }); + + const state: PlayerDndPluginState = { + refreshView: () => { + const s = player.getState(); + if (s.status === 'in-progress') { + s.controllers.flow.transition( + this.options.refreshTransition ?? 'refresh' + ); + } + }, + }; + + this.state.set(player, state); + } + + applyWeb(webPlayer: WebPlayer) { + const match = { type: this.options.Target.type ?? 'drop-target' }; + webPlayer.assetRegistry.set(match, this.options.Target.Component); + } +} diff --git a/drag-and-drop/library/src/utils/runtime-flow-state.ts b/drag-and-drop/library/src/utils/runtime-flow-state.ts new file mode 100644 index 00000000..2cf8725d --- /dev/null +++ b/drag-and-drop/library/src/utils/runtime-flow-state.ts @@ -0,0 +1,144 @@ +import type { ObjectType } from '@player-tools/xlr'; +import type { Asset, View } from '@player-ui/types'; +import type { + ExtensionProviderAssetIdentifier, + FlowWithOneView, + DropTargetAssetType, +} from '../types'; +import { DragAndDropAssetType } from '../types'; + +/** The type for exporting and restoring the flow state */ +export interface ExportedRuntimeFlowState { + root: DropTargetAssetType; +} + +export interface RuntimeFlowStateOptions { + restoreFrom?: { + state: ExportedRuntimeFlowState; + }; +} + +export class RuntimeFlowState { + private ROOT: DropTargetAssetType; + private assetMappings: Record = {}; + + constructor(options?: RuntimeFlowStateOptions) { + this.ROOT = { + __type: DragAndDropAssetType, + id: 'drag-and-drop-view', + type: 'drop-target', + }; + this.assetMappings[this.ROOT.id] = this.ROOT; + } + + export(): ExportedRuntimeFlowState { + return { + root: this.ROOT, + }; + } + + private createNewAsset(idPrefix: string, type: ObjectType): Asset { + const typeProp = + type.properties.type.node.type === 'string' + ? type.properties.type.node.const + : undefined; + + if (typeProp === undefined) { + throw new Error('type property must be a constant'); + } + + const titleGenAsset: DropTargetAssetType = { + id: `${idPrefix}-test-title`, + __type: DragAndDropAssetType, + type: 'drop-target', + context: { + propertyName: 'title', + parent: { + pluginName: 'test', + name: typeProp, + }, + }, + }; + + this.assetMappings[titleGenAsset.id] = titleGenAsset; + + const asset: Asset = { + id: `${idPrefix}-test-1`, + type: typeProp, + title: { + asset: titleGenAsset, + }, + }; + + return asset; + } + + replace( + id: string, + replacement: { + /** The identifier for where the populated asset is from */ + identifier: ExtensionProviderAssetIdentifier; + + /** The current descriptor for the value stored at this asset */ + type: ObjectType; + } + ) { + const asset = this.assetMappings[id]; + if (!asset) { + throw new Error(`Cannot set asset value for unknown id: ${id}`); + } + + const newAsset = this.createNewAsset(id, replacement.type); + + asset.value = { + ...replacement, + asset: newAsset, + }; + } + + append( + id: string, + replacement: { + /** The identifier for where the populated asset is from */ + identifier: ExtensionProviderAssetIdentifier; + + /** The current descriptor for the value stored at this asset */ + type: ObjectType; + } + ) {} + + clear(id: string) { + const asset = this.assetMappings[id]; + if (!asset) { + throw new Error(`Cannot clear asset. Not found: ${id}`); + } + + asset.value = undefined; + } + + get view(): View { + return this.ROOT; + } + + get flow(): FlowWithOneView { + const { view } = this; + + return { + id: 'dnd-controller', + views: [view], + navigation: { + BEGIN: 'FLOW_1', + FLOW_1: { + startState: 'VIEW_1', + VIEW_1: { + state_type: 'VIEW', + ref: view.id, + transitions: { + '*': 'VIEW_1', + }, + }, + }, + }, + }; + } +} diff --git a/jest.config.js b/jest.config.js index b29d8cce..b35aaf58 100644 --- a/jest.config.js +++ b/jest.config.js @@ -33,6 +33,9 @@ module.exports = { 'test-utils', '_backup', ], + "transformIgnorePatterns": [ + "node_modules/(?!react-dnd|dnd-core|@react-dnd)" + ], collectCoverageFrom: [ '**/src/**', '!**/*.json', diff --git a/package.json b/package.json index 09d05105..1eef67ec 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,9 @@ }, "dependencies": { "@auto-it/version-file": "^10.37.2", + "@chakra-ui/react": "^2.2.1", + "@emotion/react": "^11", + "@emotion/styled": "^11", "@babel/cli": "^7.15.7", "duplicate-package-checker-webpack-plugin": "^3.0.0", "uuid": "^8.3.2", @@ -32,14 +35,12 @@ "babel-loader": "^8.2.5", "@babel/runtime": "7.15.4", "@bazel/typescript": "^4.4.2", - "@chakra-ui/react": "^1.0.0", "@devtools-ds/console": "^1.1.2", "@devtools-ds/icon": "^1.1.2", "@devtools-ds/navigation": "^1.1.2", "@devtools-ds/object-inspector": "^1.1.2", "@devtools-ds/table": "^1.1.2", "@devtools-ds/themes": "^1.1.2", - "@emotion/styled": "^11", "@kendallgassner/eslint-plugin-package-json": "^0.2.1", "@oclif/core": "1.9.0", "@oclif/plugin-legacy": "^1.2.7", @@ -47,6 +48,8 @@ "@player-ui/types": "^0.2.0", "@reduxjs/toolkit": "^1.6.1", "@rollup/plugin-image": "^2.1.1", + "@player-ui/react": "^0.2.0", + "@player-ui/reference-assets-plugin-react": "^0.2.0", "@rollup/plugin-json": "^4.1.0", "@rollup/plugin-node-resolve": "^13.0.6", "@testing-library/dom": "^8.10.1", @@ -118,12 +121,15 @@ "micromatch": "^4.0.2", "mkdirp": "^1.0.4", "modify-source-webpack-plugin": "^3.0.0", + "next": "^12.0.7", "oclif": "3.0.1", "patch-package": "^6.4.7", "prettier": "^2.4.1", - "react": "^17.0.2", + "react": "^18.2.0", + "react-dnd": "^16.0.1", + "react-dnd-html5-backend": "^16.0.1", "react-docgen-typescript": "^2.1.1", - "react-dom": "^17.0.2", + "react-dom": "^18.2.0", "react-error-boundary": "^3.1.3", "react-flame-graph": "^1.4.0", "react-flatten-children": "^1.1.2", diff --git a/yarn.lock b/yarn.lock index 2c201433..816c2fcc 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1334,7 +1334,7 @@ dependencies: regenerator-runtime "^0.13.2" -"@babel/runtime@^7.0.0", "@babel/runtime@^7.11.2", "@babel/runtime@^7.12.13", "@babel/runtime@^7.18.3": +"@babel/runtime@^7.0.0", "@babel/runtime@^7.12.13", "@babel/runtime@^7.18.3": version "7.19.4" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.19.4.tgz#a42f814502ee467d55b38dd1c256f53a7b885c78" integrity sha512-EXpLCrk55f+cYqmHsSR+yD/0gAIMxxA9QK9lnQWzhMCvt+YmoBN7Zx94s++Kv0+unHk39vxNO8t+CMA2WSS3wA== @@ -1348,6 +1348,13 @@ dependencies: regenerator-runtime "^0.13.4" +"@babel/runtime@^7.11.2": + version "7.20.1" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.20.1.tgz#1148bb33ab252b165a06698fde7576092a78b4a9" + integrity sha512-mrzLkl6U9YLF8qpqI7TB82PESyEGjm/0Ly91jG575eVxMMlb8fYfOXFZIJ8XfLrJZQbm7dlKry2bJmXBUEkdFg== + dependencies: + regenerator-runtime "^0.13.10" + "@babel/runtime@~7.5.4": version "7.5.5" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.5.5.tgz#74fba56d35efbeca444091c7850ccd494fd2f132" @@ -1454,6 +1461,18 @@ "@chakra-ui/transition" "1.4.8" "@chakra-ui/utils" "1.10.4" +"@chakra-ui/accordion@2.1.2": + version "2.1.2" + resolved "https://registry.yarnpkg.com/@chakra-ui/accordion/-/accordion-2.1.2.tgz#f9d384b80f68a92689fa7ad4e43bd8944e6945c6" + integrity sha512-Jf7A6I0eIGk34zO5TiTW8orJOFQb5A/D1ekNYbaukNccoUPKJg/xdQ/b00oIR6LT93nJxggkoP/vszfmmTHuFg== + dependencies: + "@chakra-ui/descendant" "3.0.10" + "@chakra-ui/icon" "3.0.11" + "@chakra-ui/react-context" "2.0.4" + "@chakra-ui/react-use-controllable-state" "2.0.5" + "@chakra-ui/react-use-merge-refs" "2.0.4" + "@chakra-ui/transition" "2.0.11" + "@chakra-ui/alert@1.3.7": version "1.3.7" resolved "https://registry.yarnpkg.com/@chakra-ui/alert/-/alert-1.3.7.tgz#f36020ffc3b2c26be67025c56bccbf0639a81a67" @@ -1463,6 +1482,15 @@ "@chakra-ui/react-utils" "1.2.3" "@chakra-ui/utils" "1.10.4" +"@chakra-ui/alert@2.0.11": + version "2.0.11" + resolved "https://registry.yarnpkg.com/@chakra-ui/alert/-/alert-2.0.11.tgz#d792b0684ae7810befa3874af5bdd4aa115513a2" + integrity sha512-n40KHU3j1H6EbIdgptjEad92V7Fpv7YD++ZBjy2g1h4w9ay9nw4kGHib3gaIkBupLf52CfLqySEc8w0taoIlXQ== + dependencies: + "@chakra-ui/icon" "3.0.11" + "@chakra-ui/react-context" "2.0.4" + "@chakra-ui/spinner" "2.0.10" + "@chakra-ui/anatomy@1.3.0": version "1.3.0" resolved "https://registry.yarnpkg.com/@chakra-ui/anatomy/-/anatomy-1.3.0.tgz#38a40dd6f2bb076fe8bebe8fb8e4769ea005e03d" @@ -1470,6 +1498,11 @@ dependencies: "@chakra-ui/theme-tools" "^1.3.6" +"@chakra-ui/anatomy@2.0.7": + version "2.0.7" + resolved "https://registry.yarnpkg.com/@chakra-ui/anatomy/-/anatomy-2.0.7.tgz#33e60c7c4d6e5f949f6f8308249dc571f84ead1e" + integrity sha512-vzcB2gcsGCxhrKbldQQV6LnBPys4eSSsH2UA2mLsT+J3WlXw0aodZw0eE/nH7yLxe4zaQ4Gnc0KjkFW4EWNKSg== + "@chakra-ui/avatar@1.3.11": version "1.3.11" resolved "https://registry.yarnpkg.com/@chakra-ui/avatar/-/avatar-1.3.11.tgz#abd8ffa9ad54756e549730f984fdae621ae51baa" @@ -1479,6 +1512,15 @@ "@chakra-ui/react-utils" "1.2.3" "@chakra-ui/utils" "1.10.4" +"@chakra-ui/avatar@2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@chakra-ui/avatar/-/avatar-2.2.0.tgz#58b5e650f7e4b3ab229f50e6a102c54b6eb4b23a" + integrity sha512-mpAkfr/JG+BNBw2WvU55CSRFYKeFBUyAQAu3YulznLzi2U3e7k3IA0J8ofbrDYlSH/9KqkDuuSrxqGZgct+Nug== + dependencies: + "@chakra-ui/image" "2.0.11" + "@chakra-ui/react-children-utils" "2.0.3" + "@chakra-ui/react-context" "2.0.4" + "@chakra-ui/breadcrumb@1.3.6": version "1.3.6" resolved "https://registry.yarnpkg.com/@chakra-ui/breadcrumb/-/breadcrumb-1.3.6.tgz#fe22e162c37add5830bd1292172bb11d859c6f35" @@ -1487,6 +1529,19 @@ "@chakra-ui/react-utils" "1.2.3" "@chakra-ui/utils" "1.10.4" +"@chakra-ui/breadcrumb@2.1.0": + version "2.1.0" + resolved "https://registry.yarnpkg.com/@chakra-ui/breadcrumb/-/breadcrumb-2.1.0.tgz#530ded99f931cfcb9f4bd4d951bc82b0a4e102ac" + integrity sha512-khBR579SLDEo6Wuo3tETRY6m0yJD/WCvSR7Res2g1B6OJgc9OQGM7yIMu4OdLUTwfXsCnlHTDoSQPUxFOVAMIQ== + dependencies: + "@chakra-ui/react-children-utils" "2.0.3" + "@chakra-ui/react-context" "2.0.4" + +"@chakra-ui/breakpoint-utils@2.0.4": + version "2.0.4" + resolved "https://registry.yarnpkg.com/@chakra-ui/breakpoint-utils/-/breakpoint-utils-2.0.4.tgz#6231eff8b20f4e3cbb4eb7c86d05c927679d905b" + integrity sha512-SUUEYnA/FCIKYDHMuEXcnBMwet+6RAAjQ+CqGD1hlwKPTfh7EK9fS8FoVAJa9KpRKAc/AawzPkgwvorzPj8NSg== + "@chakra-ui/button@1.5.10": version "1.5.10" resolved "https://registry.yarnpkg.com/@chakra-ui/button/-/button-1.5.10.tgz#c339f78197b6bd63f109003177fd640ae6e6a632" @@ -1497,6 +1552,15 @@ "@chakra-ui/spinner" "1.2.6" "@chakra-ui/utils" "1.10.4" +"@chakra-ui/button@2.0.11": + version "2.0.11" + resolved "https://registry.yarnpkg.com/@chakra-ui/button/-/button-2.0.11.tgz#98e0aa1e35ea7e193bb50f9a4b5d0ea23202ace8" + integrity sha512-J6iMRITqxTxa0JexHUY9c7BXUrTZtSkl3jZ2hxiFybB4MQL8J2wZ24O846B6M+WTYqy7XVuHRuVURnH4czWesw== + dependencies: + "@chakra-ui/react-context" "2.0.4" + "@chakra-ui/react-use-merge-refs" "2.0.4" + "@chakra-ui/spinner" "2.0.10" + "@chakra-ui/checkbox@1.7.1": version "1.7.1" resolved "https://registry.yarnpkg.com/@chakra-ui/checkbox/-/checkbox-1.7.1.tgz#cd733f177d88c477ae5ece228b81cddc67b70c0e" @@ -1508,6 +1572,22 @@ "@chakra-ui/utils" "1.10.4" "@chakra-ui/visually-hidden" "1.1.6" +"@chakra-ui/checkbox@2.2.2": + version "2.2.2" + resolved "https://registry.yarnpkg.com/@chakra-ui/checkbox/-/checkbox-2.2.2.tgz#494d7090ac11a0a43d05b7849aff6085f7a91045" + integrity sha512-Y6Zbkkk5VNoe0RzqU6F+rKlFVPlubz1KIgYcb7CCNHGOM97dLtRm78eAvJ+7Xmpitr+7zZ4hJLLjfAz+e1X7rA== + dependencies: + "@chakra-ui/form-control" "2.0.11" + "@chakra-ui/react-context" "2.0.4" + "@chakra-ui/react-types" "2.0.3" + "@chakra-ui/react-use-callback-ref" "2.0.4" + "@chakra-ui/react-use-controllable-state" "2.0.5" + "@chakra-ui/react-use-merge-refs" "2.0.4" + "@chakra-ui/react-use-safe-layout-effect" "2.0.2" + "@chakra-ui/react-use-update-effect" "2.0.4" + "@chakra-ui/visually-hidden" "2.0.11" + "@zag-js/focus-visible" "0.1.0" + "@chakra-ui/clickable@1.2.6": version "1.2.6" resolved "https://registry.yarnpkg.com/@chakra-ui/clickable/-/clickable-1.2.6.tgz#7f3deef71580acf47c2395cac2c1734f43418a3f" @@ -1516,6 +1596,13 @@ "@chakra-ui/react-utils" "1.2.3" "@chakra-ui/utils" "1.10.4" +"@chakra-ui/clickable@2.0.10": + version "2.0.10" + resolved "https://registry.yarnpkg.com/@chakra-ui/clickable/-/clickable-2.0.10.tgz#e89b7b3eaf9364753f6205e36fd5128b26a617d8" + integrity sha512-G6JdR6yAMlXpfjOJ70W2FL7aUwNuomiMFtkneeTpk7Q42bJ5iGHfYlbZEx5nJd8iB+UluXVM4xlhMv2MyytjGw== + dependencies: + "@chakra-ui/react-use-merge-refs" "2.0.4" + "@chakra-ui/close-button@1.2.7": version "1.2.7" resolved "https://registry.yarnpkg.com/@chakra-ui/close-button/-/close-button-1.2.7.tgz#6f3073618ae777d7e36a80fb17bc00aaa790e7a5" @@ -1524,6 +1611,13 @@ "@chakra-ui/icon" "2.0.5" "@chakra-ui/utils" "1.10.4" +"@chakra-ui/close-button@2.0.11": + version "2.0.11" + resolved "https://registry.yarnpkg.com/@chakra-ui/close-button/-/close-button-2.0.11.tgz#8b0679da42738229014d3807885d05fac0fdf448" + integrity sha512-9WF/nwwK9BldS89WQ5PtXK2nFS4r8QOgKls2BOwXfE+rGmOUZtOsu8ne/drXRjgkiBRETR6CxdyUjm7EPzXllw== + dependencies: + "@chakra-ui/icon" "3.0.11" + "@chakra-ui/color-mode@1.4.8": version "1.4.8" resolved "https://registry.yarnpkg.com/@chakra-ui/color-mode/-/color-mode-1.4.8.tgz#e5367b909f5b4c782b239f9d37d4cf1a44c28559" @@ -1533,6 +1627,13 @@ "@chakra-ui/react-env" "1.1.6" "@chakra-ui/utils" "1.10.4" +"@chakra-ui/color-mode@2.1.9": + version "2.1.9" + resolved "https://registry.yarnpkg.com/@chakra-ui/color-mode/-/color-mode-2.1.9.tgz#d3a6f9ba9eee15d9e14cc96484e25d44cef1dbc1" + integrity sha512-0kx0I+AQon8oS23/X+qMtnhsv/1BUulyJvU56p3Uh8CRaBfgJ7Ly9CerShoUL+5kadu6hN1M9oty4cugaCwv2w== + dependencies: + "@chakra-ui/react-use-safe-layout-effect" "2.0.2" + "@chakra-ui/control-box@1.1.6": version "1.1.6" resolved "https://registry.yarnpkg.com/@chakra-ui/control-box/-/control-box-1.1.6.tgz#15a40a2cab525799988ae53948b61eed81a7f177" @@ -1540,6 +1641,11 @@ dependencies: "@chakra-ui/utils" "1.10.4" +"@chakra-ui/control-box@2.0.10": + version "2.0.10" + resolved "https://registry.yarnpkg.com/@chakra-ui/control-box/-/control-box-2.0.10.tgz#e8a849c9f0fa085da78ee15dda7e13e1734b983d" + integrity sha512-sHmZanFLEv4IDATl19ZTxq8Bi8PtjfvnsN6xF4k7JGSYUnk1YXUf1coyW7WKdcsczOASrMikfsLc3iEVAzx4Ng== + "@chakra-ui/counter@1.2.10": version "1.2.10" resolved "https://registry.yarnpkg.com/@chakra-ui/counter/-/counter-1.2.10.tgz#544de1f53b783e8577cc74208ae1b0ca74385834" @@ -1548,11 +1654,24 @@ "@chakra-ui/hooks" "1.9.1" "@chakra-ui/utils" "1.10.4" +"@chakra-ui/counter@2.0.10": + version "2.0.10" + resolved "https://registry.yarnpkg.com/@chakra-ui/counter/-/counter-2.0.10.tgz#861f00db021235892dfe0407e739a259f1c233b2" + integrity sha512-MZK8UKUZp4nFMd+GlV/cq0NIARS7UdlubTuCx+wockw9j2JI5OHzsyK0XiWuJiq5psegSTzpbtT99QfAUm3Yiw== + dependencies: + "@chakra-ui/number-utils" "2.0.4" + "@chakra-ui/react-use-callback-ref" "2.0.4" + "@chakra-ui/css-reset@1.1.3": version "1.1.3" resolved "https://registry.yarnpkg.com/@chakra-ui/css-reset/-/css-reset-1.1.3.tgz#da65507ea1d69ed309bc34619881e23b5004ec7d" integrity sha512-AgfrE7bRTJvNi/4zIfacI/kBHmHmHEIeQtHwCvk/0qM9V2gK1VM3ctYlnibf7BTh17F/UszweOGRb1lHSPfWjw== +"@chakra-ui/css-reset@2.0.8": + version "2.0.8" + resolved "https://registry.yarnpkg.com/@chakra-ui/css-reset/-/css-reset-2.0.8.tgz#093ce6b166b37f2dd14e63f246635c463a59c106" + integrity sha512-VuDD1rk1pFc+dItk4yUcstyoC9D2B35hatHDBtlPMqTczFAzpbgVJJYgEHANatXGfulM5SdckmYEIJ3Tac1Rtg== + "@chakra-ui/descendant@2.1.4": version "2.1.4" resolved "https://registry.yarnpkg.com/@chakra-ui/descendant/-/descendant-2.1.4.tgz#b85c52b0b429da0a08d0950b4f8bef61b94f43f6" @@ -1560,6 +1679,19 @@ dependencies: "@chakra-ui/react-utils" "^1.2.3" +"@chakra-ui/descendant@3.0.10": + version "3.0.10" + resolved "https://registry.yarnpkg.com/@chakra-ui/descendant/-/descendant-3.0.10.tgz#e54c95270896c451f61b57d31719ee042f4e1827" + integrity sha512-MHH0Qdm0fGllGP2xgx4WOycmrpctyyEdGw6zxcfs2VqZNlrwmjG3Yb9eVY+Q7UmEv5rwAq6qRn7BhQxgSPn3Cg== + dependencies: + "@chakra-ui/react-context" "2.0.4" + "@chakra-ui/react-use-merge-refs" "2.0.4" + +"@chakra-ui/dom-utils@2.0.3": + version "2.0.3" + resolved "https://registry.yarnpkg.com/@chakra-ui/dom-utils/-/dom-utils-2.0.3.tgz#8a5498b107d3a42662f3502f7b8965cb73bf6a33" + integrity sha512-aeGlRmTxcv0cvW44DyeZHru1i68ZDQsXpfX2dnG1I1yBlT6GlVx1xYjCULis9mjhgvd2O3NfcYPRTkjNWTDUbA== + "@chakra-ui/editable@1.4.2": version "1.4.2" resolved "https://registry.yarnpkg.com/@chakra-ui/editable/-/editable-1.4.2.tgz#92d5266e737d52df1edc91c21a05c0a6048f881f" @@ -1569,6 +1701,26 @@ "@chakra-ui/react-utils" "1.2.3" "@chakra-ui/utils" "1.10.4" +"@chakra-ui/editable@2.0.13": + version "2.0.13" + resolved "https://registry.yarnpkg.com/@chakra-ui/editable/-/editable-2.0.13.tgz#4e6ff480956ae2dcacf4ba2a15019336486bd613" + integrity sha512-GM3n8t3/TOFFcDOWF/tuKsnqn66isZLsU+FkMRY2o0E8XjLBGjCKuXInPW5SRBqhje7EHC+kwViLE780PfwXbw== + dependencies: + "@chakra-ui/react-context" "2.0.4" + "@chakra-ui/react-types" "2.0.3" + "@chakra-ui/react-use-callback-ref" "2.0.4" + "@chakra-ui/react-use-controllable-state" "2.0.5" + "@chakra-ui/react-use-focus-on-pointer-down" "2.0.3" + "@chakra-ui/react-use-merge-refs" "2.0.4" + "@chakra-ui/react-use-safe-layout-effect" "2.0.2" + "@chakra-ui/react-use-update-effect" "2.0.4" + "@chakra-ui/shared-utils" "2.0.2" + +"@chakra-ui/event-utils@2.0.5": + version "2.0.5" + resolved "https://registry.yarnpkg.com/@chakra-ui/event-utils/-/event-utils-2.0.5.tgz#23de21e319d1a70863953402d64cb4b0e6ce322f" + integrity sha512-VXoOAIsM0PFKDlhm+EZxkWlUXd5UFTb/LTux3y3A+S9G5fDxLRvpiLWByPUgTFTCDFcgTCF+YnQtdWJB4DLyxg== + "@chakra-ui/focus-lock@1.2.6": version "1.2.6" resolved "https://registry.yarnpkg.com/@chakra-ui/focus-lock/-/focus-lock-1.2.6.tgz#ecdc9688651c55c67f9059720f0885ea7c02b979" @@ -1577,6 +1729,14 @@ "@chakra-ui/utils" "1.10.4" react-focus-lock "2.5.2" +"@chakra-ui/focus-lock@2.0.12": + version "2.0.12" + resolved "https://registry.yarnpkg.com/@chakra-ui/focus-lock/-/focus-lock-2.0.12.tgz#11c0301a326249efe269c2dd0f54b11a67a04321" + integrity sha512-NvIP59A11ZNbxXZ3qwxSiQ5npjABkpSbTIjK0uZ9bZm5LMfepRnuuA19VsVlq31/BYV9nHFAy6xzIuG+Qf9xMA== + dependencies: + "@chakra-ui/dom-utils" "2.0.3" + react-focus-lock "^2.9.1" + "@chakra-ui/form-control@1.6.0": version "1.6.0" resolved "https://registry.yarnpkg.com/@chakra-ui/form-control/-/form-control-1.6.0.tgz#a2a7b82a385f75fababf3947d39e227b4d073929" @@ -1587,6 +1747,16 @@ "@chakra-ui/react-utils" "1.2.3" "@chakra-ui/utils" "1.10.4" +"@chakra-ui/form-control@2.0.11": + version "2.0.11" + resolved "https://registry.yarnpkg.com/@chakra-ui/form-control/-/form-control-2.0.11.tgz#fbfdddb02d1b5d2c67ffdc721c434ff16693e4bd" + integrity sha512-MVhIe0xY4Zn06IXRXFmS9tCa93snppK1SdUQb1P99Ipo424RrL5ykzLnJ8CAkQrhoVP3sxF7z3eOSzk8/iRfow== + dependencies: + "@chakra-ui/icon" "3.0.11" + "@chakra-ui/react-context" "2.0.4" + "@chakra-ui/react-types" "2.0.3" + "@chakra-ui/react-use-merge-refs" "2.0.4" + "@chakra-ui/hooks@1.9.1": version "1.9.1" resolved "https://registry.yarnpkg.com/@chakra-ui/hooks/-/hooks-1.9.1.tgz#7a00659e6bb4d56cf56022071eca0b77a7df1ac1" @@ -1597,6 +1767,16 @@ compute-scroll-into-view "1.0.14" copy-to-clipboard "3.3.1" +"@chakra-ui/hooks@2.1.0": + version "2.1.0" + resolved "https://registry.yarnpkg.com/@chakra-ui/hooks/-/hooks-2.1.0.tgz#a8df3692e407c2fed8cc551c8ce7f3fcd0ea9864" + integrity sha512-4H6BDITq/YrStW99LXurgPkcz4qHSVy9V/QWXCvt1pCuiDTqNztiW4r508H3ApAOsL9NEbyXcM/zWYD7r5VDjA== + dependencies: + "@chakra-ui/react-utils" "2.0.8" + "@chakra-ui/utils" "2.0.11" + compute-scroll-into-view "1.0.14" + copy-to-clipboard "3.3.1" + "@chakra-ui/icon@2.0.5": version "2.0.5" resolved "https://registry.yarnpkg.com/@chakra-ui/icon/-/icon-2.0.5.tgz#d57f53e6a2c7ae1bae7292a1778fd466c02e2e29" @@ -1604,6 +1784,21 @@ dependencies: "@chakra-ui/utils" "1.10.4" +"@chakra-ui/icon@3.0.11": + version "3.0.11" + resolved "https://registry.yarnpkg.com/@chakra-ui/icon/-/icon-3.0.11.tgz#a51dda24bed2f2ed77b4136ada8f22d3249c9870" + integrity sha512-RG4jf/XmBdaxOYI5J5QstEtTCPoVlmrQ/XiWhvN0LTgAnmZIqVwFl3Uw+satArdStHAs0GmJZg/E/soFTWuFmw== + dependencies: + "@chakra-ui/shared-utils" "2.0.2" + +"@chakra-ui/icons@^1.1.1": + version "1.1.7" + resolved "https://registry.yarnpkg.com/@chakra-ui/icons/-/icons-1.1.7.tgz#f8c0c44a969c8654b90026b7d375b550c4bfbc49" + integrity sha512-YIHxey/B4M2PyFASlHXtAWFyW+tsAtGAChOJ8dsM2kpu1MbVUqm/6nMI1KIFd7Te5IWuNYA75rAHBdLI0Yu61A== + dependencies: + "@chakra-ui/icon" "2.0.5" + "@types/react" "^17.0.15" + "@chakra-ui/image@1.1.10": version "1.1.10" resolved "https://registry.yarnpkg.com/@chakra-ui/image/-/image-1.1.10.tgz#65bae4086559937d25c728660ae743bce9360cb2" @@ -1612,6 +1807,13 @@ "@chakra-ui/hooks" "1.9.1" "@chakra-ui/utils" "1.10.4" +"@chakra-ui/image@2.0.11": + version "2.0.11" + resolved "https://registry.yarnpkg.com/@chakra-ui/image/-/image-2.0.11.tgz#eb880ecd2fce47f22ef50bbbba66cbb027c0304c" + integrity sha512-S6NqAprPcbHnck/J+2wg06r9SSol62v5A01O8Kke2PnAyjalMcS+6P59lDRO7wvPqsdxq4PPbSTZP6Dww2CvcA== + dependencies: + "@chakra-ui/react-use-safe-layout-effect" "2.0.2" + "@chakra-ui/input@1.4.6": version "1.4.6" resolved "https://registry.yarnpkg.com/@chakra-ui/input/-/input-1.4.6.tgz#455f24e7a3f401ef10b50b68d9b0537676fbfec5" @@ -1621,6 +1823,17 @@ "@chakra-ui/react-utils" "1.2.3" "@chakra-ui/utils" "1.10.4" +"@chakra-ui/input@2.0.12": + version "2.0.12" + resolved "https://registry.yarnpkg.com/@chakra-ui/input/-/input-2.0.12.tgz#332db53a831daea4d76e1de6d3b4462fd50ae167" + integrity sha512-lJ5necu+Wt698HdCTC7L/ErA2nNVJAra7+knPe0qMR+AizGEL7LKCV/bdQe7eggjvKsDGD4alJIEczUvm3JVUQ== + dependencies: + "@chakra-ui/form-control" "2.0.11" + "@chakra-ui/object-utils" "2.0.4" + "@chakra-ui/react-children-utils" "2.0.3" + "@chakra-ui/react-context" "2.0.4" + "@chakra-ui/shared-utils" "2.0.2" + "@chakra-ui/layout@1.8.0": version "1.8.0" resolved "https://registry.yarnpkg.com/@chakra-ui/layout/-/layout-1.8.0.tgz#f95e78168644b45ac7327e4e0cfb1f0e6f7c3b4d" @@ -1630,6 +1843,23 @@ "@chakra-ui/react-utils" "1.2.3" "@chakra-ui/utils" "1.10.4" +"@chakra-ui/layout@2.1.9": + version "2.1.9" + resolved "https://registry.yarnpkg.com/@chakra-ui/layout/-/layout-2.1.9.tgz#3e9cc7b5915e033907367e40fc97d218efa5f777" + integrity sha512-ztsavtirtdtjxdqIkGR6fVcrffHp6hs1twRFO/dK14FGXrX3Nn9mi3J1fr1ITBHJq6y5B3yFEj0LHN2fO8dYyw== + dependencies: + "@chakra-ui/breakpoint-utils" "2.0.4" + "@chakra-ui/icon" "3.0.11" + "@chakra-ui/object-utils" "2.0.4" + "@chakra-ui/react-children-utils" "2.0.3" + "@chakra-ui/react-context" "2.0.4" + "@chakra-ui/shared-utils" "2.0.2" + +"@chakra-ui/lazy-utils@2.0.2": + version "2.0.2" + resolved "https://registry.yarnpkg.com/@chakra-ui/lazy-utils/-/lazy-utils-2.0.2.tgz#d85f9afc60c2434ba76376fd4b23a7a0a1341e14" + integrity sha512-MTxutBJZvqNNqrrS0722cI7qrnGu0yUQpIebmTxYwI+F3cOnPEKf5Ni+hrA8hKcw4XJhSY4npAPPYu1zJbOV4w== + "@chakra-ui/live-region@1.1.6": version "1.1.6" resolved "https://registry.yarnpkg.com/@chakra-ui/live-region/-/live-region-1.1.6.tgz#135461a19ae2d479eefb012376ffa0f500b83b16" @@ -1637,6 +1867,11 @@ dependencies: "@chakra-ui/utils" "1.10.4" +"@chakra-ui/live-region@2.0.10": + version "2.0.10" + resolved "https://registry.yarnpkg.com/@chakra-ui/live-region/-/live-region-2.0.10.tgz#d33a784c85feed7ba96e2579553ca1d20c965171" + integrity sha512-eQ2ZIreR/plzi/KGszDYTi1TvIyGEBcPiWP52BQOS7xwpzb1vsoR1FgFAIELxAGJvKnMUs+9qVogfyRBX8PdOg== + "@chakra-ui/media-query@2.0.4": version "2.0.4" resolved "https://registry.yarnpkg.com/@chakra-ui/media-query/-/media-query-2.0.4.tgz#25e8074a19613d4ccce880a1f92c8e733708b079" @@ -1645,6 +1880,14 @@ "@chakra-ui/react-env" "1.1.6" "@chakra-ui/utils" "1.10.4" +"@chakra-ui/media-query@3.2.7": + version "3.2.7" + resolved "https://registry.yarnpkg.com/@chakra-ui/media-query/-/media-query-3.2.7.tgz#ece5b2181136145305bf5e6ec82c696ef1d59a77" + integrity sha512-hbgm6JCe0kYU3PAhxASYYDopFQI26cW9kZnbp+5tRL1fykkVWNMPwoGC8FEZPur9JjXp7aoL6H4Jk7nrxY/XWw== + dependencies: + "@chakra-ui/breakpoint-utils" "2.0.4" + "@chakra-ui/react-env" "2.0.10" + "@chakra-ui/menu@1.8.12": version "1.8.12" resolved "https://registry.yarnpkg.com/@chakra-ui/menu/-/menu-1.8.12.tgz#98f9cbccfc8fbaaea1f19dcea16ffb96a25eb01f" @@ -1658,6 +1901,26 @@ "@chakra-ui/transition" "1.4.8" "@chakra-ui/utils" "1.10.4" +"@chakra-ui/menu@2.1.2": + version "2.1.2" + resolved "https://registry.yarnpkg.com/@chakra-ui/menu/-/menu-2.1.2.tgz#bbe39e1efdb408ba8e6616e0ec290417474f9454" + integrity sha512-6Z7ecXjp6BtZ1ExbFggfxsAj1hwtcathXekmCTxHpXOD+BdjAC/13+oLclwXeuBO85aoTmQrQ2ovfTkO31bzRQ== + dependencies: + "@chakra-ui/clickable" "2.0.10" + "@chakra-ui/descendant" "3.0.10" + "@chakra-ui/lazy-utils" "2.0.2" + "@chakra-ui/popper" "3.0.8" + "@chakra-ui/react-children-utils" "2.0.3" + "@chakra-ui/react-context" "2.0.4" + "@chakra-ui/react-use-animation-state" "2.0.5" + "@chakra-ui/react-use-controllable-state" "2.0.5" + "@chakra-ui/react-use-disclosure" "2.0.5" + "@chakra-ui/react-use-focus-effect" "2.0.5" + "@chakra-ui/react-use-merge-refs" "2.0.4" + "@chakra-ui/react-use-outside-click" "2.0.4" + "@chakra-ui/react-use-update-effect" "2.0.4" + "@chakra-ui/transition" "2.0.11" + "@chakra-ui/modal@1.11.1": version "1.11.1" resolved "https://registry.yarnpkg.com/@chakra-ui/modal/-/modal-1.11.1.tgz#fedd757726cbc7ec3b614e1b0c7b46c7244f988e" @@ -1673,6 +1936,21 @@ aria-hidden "^1.1.1" react-remove-scroll "2.4.1" +"@chakra-ui/modal@2.2.2": + version "2.2.2" + resolved "https://registry.yarnpkg.com/@chakra-ui/modal/-/modal-2.2.2.tgz#bf3ef2673a8641a5c851faceb7811e0c0f323517" + integrity sha512-cCYuqLZO4QqFUI1H+uEqixDk6UiCP3yC+sxkhFTXHIApSG9Z44v5np7BVTd6LKdmAN8pAWcc8Oxf14RvD6LWLw== + dependencies: + "@chakra-ui/close-button" "2.0.11" + "@chakra-ui/focus-lock" "2.0.12" + "@chakra-ui/portal" "2.0.10" + "@chakra-ui/react-context" "2.0.4" + "@chakra-ui/react-types" "2.0.3" + "@chakra-ui/react-use-merge-refs" "2.0.4" + "@chakra-ui/transition" "2.0.11" + aria-hidden "^1.1.1" + react-remove-scroll "^2.5.4" + "@chakra-ui/number-input@1.4.7": version "1.4.7" resolved "https://registry.yarnpkg.com/@chakra-ui/number-input/-/number-input-1.4.7.tgz#9d150c20a7d301e2ffe600251e68d9b6f70fcce0" @@ -1685,6 +1963,33 @@ "@chakra-ui/react-utils" "1.2.3" "@chakra-ui/utils" "1.10.4" +"@chakra-ui/number-input@2.0.12": + version "2.0.12" + resolved "https://registry.yarnpkg.com/@chakra-ui/number-input/-/number-input-2.0.12.tgz#90a8408e6abb2d021793888ef2119d01761d7614" + integrity sha512-3owLjl01sCYpTd3xbq//fJo9QJ0Q3PVYSx9JeOzlXnnTW8ws+yHPrqQzPe7G+tO4yOYynWuUT+NJ9oyCeAJIxA== + dependencies: + "@chakra-ui/counter" "2.0.10" + "@chakra-ui/form-control" "2.0.11" + "@chakra-ui/icon" "3.0.11" + "@chakra-ui/react-context" "2.0.4" + "@chakra-ui/react-types" "2.0.3" + "@chakra-ui/react-use-callback-ref" "2.0.4" + "@chakra-ui/react-use-event-listener" "2.0.4" + "@chakra-ui/react-use-interval" "2.0.2" + "@chakra-ui/react-use-merge-refs" "2.0.4" + "@chakra-ui/react-use-safe-layout-effect" "2.0.2" + "@chakra-ui/react-use-update-effect" "2.0.4" + +"@chakra-ui/number-utils@2.0.4": + version "2.0.4" + resolved "https://registry.yarnpkg.com/@chakra-ui/number-utils/-/number-utils-2.0.4.tgz#0331be05956f2c03125c073d35655e261e267cd4" + integrity sha512-MdYd29GboBoKaXY9jhbY0Wl+0NxG1t/fa32ZSIbU6VrfMsZuAMl4NEJsz7Xvhy50fummLdKn5J6HFS7o5iyIgw== + +"@chakra-ui/object-utils@2.0.4": + version "2.0.4" + resolved "https://registry.yarnpkg.com/@chakra-ui/object-utils/-/object-utils-2.0.4.tgz#d890ce285103a5e9b993f016a4fb38307aa55ac0" + integrity sha512-sY98L4v2wcjpwRX8GCXqT+WzpL0i5FHVxT1Okxw0360T2tGnZt7toAwpMfIOR3dzkemP9LfXMCyBmWR5Hi2zpQ== + "@chakra-ui/pin-input@1.7.11": version "1.7.11" resolved "https://registry.yarnpkg.com/@chakra-ui/pin-input/-/pin-input-1.7.11.tgz#d2bdfc29b10293efae35f6b35203d05b57ab29c3" @@ -1695,6 +2000,17 @@ "@chakra-ui/react-utils" "1.2.3" "@chakra-ui/utils" "1.10.4" +"@chakra-ui/pin-input@2.0.15": + version "2.0.15" + resolved "https://registry.yarnpkg.com/@chakra-ui/pin-input/-/pin-input-2.0.15.tgz#08e65c5e8468cef6192634a53859169b51c2c4a7" + integrity sha512-Ha8siSZm9gyjHHBK8ejwhKT6+75U12I/hNiYFvl2JHhc+Uh8tdi7+N+9SILO5vqbIv9kb+WGitvZ67I0cHjSfw== + dependencies: + "@chakra-ui/descendant" "3.0.10" + "@chakra-ui/react-children-utils" "2.0.3" + "@chakra-ui/react-context" "2.0.4" + "@chakra-ui/react-use-controllable-state" "2.0.5" + "@chakra-ui/react-use-merge-refs" "2.0.4" + "@chakra-ui/popover@1.11.9": version "1.11.9" resolved "https://registry.yarnpkg.com/@chakra-ui/popover/-/popover-1.11.9.tgz#283a52c969f27ee7119774c255b786af6c9b2766" @@ -1706,6 +2022,22 @@ "@chakra-ui/react-utils" "1.2.3" "@chakra-ui/utils" "1.10.4" +"@chakra-ui/popover@2.1.1": + version "2.1.1" + resolved "https://registry.yarnpkg.com/@chakra-ui/popover/-/popover-2.1.1.tgz#1b5e05e334ba5f9bce4bc5bcabfb92563393fc84" + integrity sha512-j09NsesfT+eaYITkITYJXDlRcPoOeQUM80neJZKOBgul2iHkVsEoii8dwS5Ip5ONeu4ane1b6zEOlYvYj2SrkA== + dependencies: + "@chakra-ui/close-button" "2.0.11" + "@chakra-ui/lazy-utils" "2.0.2" + "@chakra-ui/popper" "3.0.8" + "@chakra-ui/react-context" "2.0.4" + "@chakra-ui/react-types" "2.0.3" + "@chakra-ui/react-use-animation-state" "2.0.5" + "@chakra-ui/react-use-disclosure" "2.0.5" + "@chakra-ui/react-use-focus-effect" "2.0.5" + "@chakra-ui/react-use-focus-on-pointer-down" "2.0.3" + "@chakra-ui/react-use-merge-refs" "2.0.4" + "@chakra-ui/popper@2.4.3": version "2.4.3" resolved "https://registry.yarnpkg.com/@chakra-ui/popper/-/popper-2.4.3.tgz#fcdc917d13a56b9d44868c78a009e4dd692697a2" @@ -1714,6 +2046,15 @@ "@chakra-ui/react-utils" "1.2.3" "@popperjs/core" "^2.9.3" +"@chakra-ui/popper@3.0.8": + version "3.0.8" + resolved "https://registry.yarnpkg.com/@chakra-ui/popper/-/popper-3.0.8.tgz#89b6984aee405316974dbb70ba451f85832bf44e" + integrity sha512-246eUwuCRsLpTPxn5T8D8T9/6ODqmmz6pRRJAjGnLlUB0gNHgjisBn0UDBic5Gbxcg0sqKvxOMY3uurbW5lXTA== + dependencies: + "@chakra-ui/react-types" "2.0.3" + "@chakra-ui/react-use-merge-refs" "2.0.4" + "@popperjs/core" "^2.9.3" + "@chakra-ui/portal@1.3.10": version "1.3.10" resolved "https://registry.yarnpkg.com/@chakra-ui/portal/-/portal-1.3.10.tgz#d85b2cf1a8b3e2eca260d8e3ad485da0ee29856b" @@ -1723,6 +2064,14 @@ "@chakra-ui/react-utils" "1.2.3" "@chakra-ui/utils" "1.10.4" +"@chakra-ui/portal@2.0.10": + version "2.0.10" + resolved "https://registry.yarnpkg.com/@chakra-ui/portal/-/portal-2.0.10.tgz#8ac21131cb0666a0bf6565468b3f7e799ef3bc8d" + integrity sha512-VRYvVAggIuqIZ3IQ6XZ1b5ujjjOUgPk9PPdc9jssUngZa7RG+5NXNhgoM8a5TsXv6aPEolBOlDNWuxzRQ4RSSg== + dependencies: + "@chakra-ui/react-context" "2.0.4" + "@chakra-ui/react-use-safe-layout-effect" "2.0.2" + "@chakra-ui/progress@1.2.6": version "1.2.6" resolved "https://registry.yarnpkg.com/@chakra-ui/progress/-/progress-1.2.6.tgz#4a3a40e826c8c72160d3c8ff411e86244e280ebc" @@ -1731,6 +2080,13 @@ "@chakra-ui/theme-tools" "1.3.6" "@chakra-ui/utils" "1.10.4" +"@chakra-ui/progress@2.0.12": + version "2.0.12" + resolved "https://registry.yarnpkg.com/@chakra-ui/progress/-/progress-2.0.12.tgz#7ce57fe2822d1741c26e82960ca02c667a265a05" + integrity sha512-9qtZimZosTliI7siAZkLeCVdCpXCTxmSETCudHcCUsC+FtcFacmA65+We8qij1nOIqmsbm+NYU6PP89TU2n4Hg== + dependencies: + "@chakra-ui/react-context" "2.0.4" + "@chakra-ui/provider@1.7.14": version "1.7.14" resolved "https://registry.yarnpkg.com/@chakra-ui/provider/-/provider-1.7.14.tgz#74d19e3066ab02f2c14fa32d22dc12f8367b56f7" @@ -1743,6 +2099,17 @@ "@chakra-ui/system" "1.12.1" "@chakra-ui/utils" "1.10.4" +"@chakra-ui/provider@2.0.20": + version "2.0.20" + resolved "https://registry.yarnpkg.com/@chakra-ui/provider/-/provider-2.0.20.tgz#2f3f73f6142f4d2b2a5a8ad6dbd777a3fc4390ce" + integrity sha512-mNNfsgm05G4x1VzvHVR9+PNEiuxNnn9xUKDuEwoaO7+IHCMzCRMtPbSJjwmv0xvHUGB9+JChjPpZI5RuHQziJQ== + dependencies: + "@chakra-ui/css-reset" "2.0.8" + "@chakra-ui/portal" "2.0.10" + "@chakra-ui/react-env" "2.0.10" + "@chakra-ui/system" "2.3.0" + "@chakra-ui/utils" "2.0.11" + "@chakra-ui/radio@1.5.1": version "1.5.1" resolved "https://registry.yarnpkg.com/@chakra-ui/radio/-/radio-1.5.1.tgz#d2b691fde944c20eb594873f72eb61dfb84b15da" @@ -1754,6 +2121,27 @@ "@chakra-ui/utils" "1.10.4" "@chakra-ui/visually-hidden" "1.1.6" +"@chakra-ui/radio@2.0.12": + version "2.0.12" + resolved "https://registry.yarnpkg.com/@chakra-ui/radio/-/radio-2.0.12.tgz#d89eb463df0247a0e634cff1fb9ca755bcbab825" + integrity sha512-871hqAGQaufxyUzPP3aautPBIRZQmpi3fw5XPZ6SbY62dV61M4sjcttd46HfCf5SrAonoOADFQLMGQafznjhaA== + dependencies: + "@chakra-ui/form-control" "2.0.11" + "@chakra-ui/react-context" "2.0.4" + "@chakra-ui/react-types" "2.0.3" + "@chakra-ui/react-use-merge-refs" "2.0.4" + "@zag-js/focus-visible" "0.1.0" + +"@chakra-ui/react-children-utils@2.0.3": + version "2.0.3" + resolved "https://registry.yarnpkg.com/@chakra-ui/react-children-utils/-/react-children-utils-2.0.3.tgz#406b984c653befd6c99636fcefb55bd01d436a7d" + integrity sha512-tPQjLEEuAw/DYLRw0cNs/g8tcdhZ3r21Sr9dTAzoyvfk0vbZ24gCXRElltW2GZLiFA63mAidzhPmc+yQF3Wtgg== + +"@chakra-ui/react-context@2.0.4": + version "2.0.4" + resolved "https://registry.yarnpkg.com/@chakra-ui/react-context/-/react-context-2.0.4.tgz#1b6ab260d44d9073c95b975b7d1643f011e65e02" + integrity sha512-eBITFkf7fLSiMZrSdhweK4fYr41WUNMEeIEOP2dCWolE7WgKxNYaYleC+iRGY0GeXkFM2KYywUtixjJe29NuVA== + "@chakra-ui/react-env@1.1.6": version "1.1.6" resolved "https://registry.yarnpkg.com/@chakra-ui/react-env/-/react-env-1.1.6.tgz#9915b02fd1f8ca62ccf578eaec793f1c4dea78b0" @@ -1761,6 +2149,128 @@ dependencies: "@chakra-ui/utils" "1.10.4" +"@chakra-ui/react-env@2.0.10": + version "2.0.10" + resolved "https://registry.yarnpkg.com/@chakra-ui/react-env/-/react-env-2.0.10.tgz#2eaa4ba64a14ecd2d279c32d5edfef7a6b5de3e8" + integrity sha512-3Yab5EbFcCGYzEsoijy4eA3354Z/JoXyk9chYIuW7Uwd+K6g/R8C0mUSAHeTmfp6Fix9kzDgerO5MWNM87b8cA== + +"@chakra-ui/react-types@2.0.3": + version "2.0.3" + resolved "https://registry.yarnpkg.com/@chakra-ui/react-types/-/react-types-2.0.3.tgz#dc454c4703b4de585e6461fd607304ede06fe595" + integrity sha512-1mJYOQldFTALE0Wr3j6tk/MYvgQIp6CKkJulNzZrI8QN+ox/bJOh8OVP4vhwqvfigdLTui0g0k8M9h+j2ub/Mw== + +"@chakra-ui/react-use-animation-state@2.0.5": + version "2.0.5" + resolved "https://registry.yarnpkg.com/@chakra-ui/react-use-animation-state/-/react-use-animation-state-2.0.5.tgz#f022baf0103c35aa494227b041422e7d2401b0d4" + integrity sha512-8gZIqZpMS5yTGlC+IqYoSrV13joiAYoeI0YR2t68WuDagcZ459OrjE57+gF04NLxfdV7eUgwqnpuv7IOLbJX/A== + dependencies: + "@chakra-ui/dom-utils" "2.0.3" + "@chakra-ui/react-use-event-listener" "2.0.4" + +"@chakra-ui/react-use-callback-ref@2.0.4": + version "2.0.4" + resolved "https://registry.yarnpkg.com/@chakra-ui/react-use-callback-ref/-/react-use-callback-ref-2.0.4.tgz#5099ef1df4413af42e434945f541de99394ec96f" + integrity sha512-he7EQfwMA4mwiDDKvX7cHIJaboCqf7UD3KYHGUcIjsF4dSc2Y8X5Ze4w+hmVZoJWIe4DWUzb3ili2SUm8eTgPg== + +"@chakra-ui/react-use-controllable-state@2.0.5": + version "2.0.5" + resolved "https://registry.yarnpkg.com/@chakra-ui/react-use-controllable-state/-/react-use-controllable-state-2.0.5.tgz#5ef9f600ae134a2a37fe080fd6231bbed83544bb" + integrity sha512-JrZZpMX24CUyfDuyqDczw9Z9IMvjH8ujETHK0Zu4M0SIsX/q4EqOwwngUFL03I2gx/O38HfSdeX8hMu4zbTAGA== + dependencies: + "@chakra-ui/react-use-callback-ref" "2.0.4" + +"@chakra-ui/react-use-disclosure@2.0.5": + version "2.0.5" + resolved "https://registry.yarnpkg.com/@chakra-ui/react-use-disclosure/-/react-use-disclosure-2.0.5.tgz#bb52340f0e7d614cc95819bd21cffd050783f96c" + integrity sha512-kPLB9oxImASRhAbKfvfc03/lbAJbsXndEVRzd+nvvL+QZm2RRfnel3k6OIkWvGFOXXYOPE2+slLe8ZPwbTGg9g== + dependencies: + "@chakra-ui/react-use-callback-ref" "2.0.4" + +"@chakra-ui/react-use-event-listener@2.0.4": + version "2.0.4" + resolved "https://registry.yarnpkg.com/@chakra-ui/react-use-event-listener/-/react-use-event-listener-2.0.4.tgz#3f893def57a7b10db6c355740dd1e82cd3216259" + integrity sha512-VqmalfKWMO8D21XuZO19WUtcP5xhbHXKzkggApTChZUN02UC5TC4pe0pYbDygoeUuNBhY+9lJKHeS08vYsljRg== + dependencies: + "@chakra-ui/react-use-callback-ref" "2.0.4" + +"@chakra-ui/react-use-focus-effect@2.0.5": + version "2.0.5" + resolved "https://registry.yarnpkg.com/@chakra-ui/react-use-focus-effect/-/react-use-focus-effect-2.0.5.tgz#b554277c38e84468b019e08a73579e9700e1003a" + integrity sha512-sbe1QnsXXfjukM+laxbKnT0UnMpHe/7kTzEPG/BYM6/ZDUUmrC1Nz+8l+3H/52iWIaruikDBdif/Xd37Yvu3Kg== + dependencies: + "@chakra-ui/dom-utils" "2.0.3" + "@chakra-ui/react-use-event-listener" "2.0.4" + "@chakra-ui/react-use-update-effect" "2.0.4" + +"@chakra-ui/react-use-focus-on-pointer-down@2.0.3": + version "2.0.3" + resolved "https://registry.yarnpkg.com/@chakra-ui/react-use-focus-on-pointer-down/-/react-use-focus-on-pointer-down-2.0.3.tgz#8b605063c9e707a18b021fbcaed8919c8660d1ed" + integrity sha512-8cKmpv26JnblexNaekWxEDI7M+MZnJcp1PJUz6lByjfQ1m4YjFr1cdbdhG4moaqzzYs7vTmO/qL8KVq8ZLUwyQ== + dependencies: + "@chakra-ui/react-use-event-listener" "2.0.4" + +"@chakra-ui/react-use-interval@2.0.2": + version "2.0.2" + resolved "https://registry.yarnpkg.com/@chakra-ui/react-use-interval/-/react-use-interval-2.0.2.tgz#6d1d5d5b5c5604ee2ea47f1e140e6eaf6e885df5" + integrity sha512-5U1c0pEB5n0Yri0E4RdFXWx2RVBZBBhD8Uu49dM33jkIguCbIPmZ+YgVry5DDzCHyz4RgDg4yZKOPK0PI8lEUg== + dependencies: + "@chakra-ui/react-use-callback-ref" "2.0.4" + +"@chakra-ui/react-use-latest-ref@2.0.2": + version "2.0.2" + resolved "https://registry.yarnpkg.com/@chakra-ui/react-use-latest-ref/-/react-use-latest-ref-2.0.2.tgz#4895d3ae2dc93a660ed86aaec7021b729830d3d2" + integrity sha512-Ra/NMV+DSQ3n0AdKsyIqdgnFzls5UntabtIRfDXLrqmJ4tI0a1tDdop2qop0Ue87AcqD9P1KtQue4KPx7wCElw== + +"@chakra-ui/react-use-merge-refs@2.0.4": + version "2.0.4" + resolved "https://registry.yarnpkg.com/@chakra-ui/react-use-merge-refs/-/react-use-merge-refs-2.0.4.tgz#c23f10fda1d3a6327a48708a8a7ad4b62ba918d3" + integrity sha512-aoWvtE5tDQNaLCiNUI6WV+MA2zVcCLR5mHSCISmowlTXyXOqOU5Fo9ZoUftzrmgCJpDu5x1jfUOivxuHUueb0g== + +"@chakra-ui/react-use-outside-click@2.0.4": + version "2.0.4" + resolved "https://registry.yarnpkg.com/@chakra-ui/react-use-outside-click/-/react-use-outside-click-2.0.4.tgz#977d873cfedec615c8e3acd48fca7b094b464b6e" + integrity sha512-uerJKS8dqg2kHs1xozA5vcCqW0UInuwrfCPb+rDWBTpu7aEqxABMw9W3e4gfOABrAjhKz2I0a/bu2i8zbVwdLw== + dependencies: + "@chakra-ui/react-use-callback-ref" "2.0.4" + +"@chakra-ui/react-use-pan-event@2.0.5": + version "2.0.5" + resolved "https://registry.yarnpkg.com/@chakra-ui/react-use-pan-event/-/react-use-pan-event-2.0.5.tgz#9269d4b798d1447e18b00ee0b28fa52c5c8efb26" + integrity sha512-nhE3b85++EEmBD2v6m46TLoA4LehSCZ349P8kvEjw/RC0K6XDOZndaBucIeAlnpEENSSUpczFfMSOLxSHdu0oA== + dependencies: + "@chakra-ui/event-utils" "2.0.5" + "@chakra-ui/react-use-latest-ref" "2.0.2" + framesync "5.3.0" + +"@chakra-ui/react-use-previous@2.0.2": + version "2.0.2" + resolved "https://registry.yarnpkg.com/@chakra-ui/react-use-previous/-/react-use-previous-2.0.2.tgz#1091ae8abc2082ab504e3742f8b1d75409ae7b27" + integrity sha512-ap/teLRPKopaHYD80fnf0TR/NpTWHJO5VdKg6sPyF1y5ediYLAzPT1G2OqMCj4QfJsYDctioT142URDYe0Nn7w== + +"@chakra-ui/react-use-safe-layout-effect@2.0.2": + version "2.0.2" + resolved "https://registry.yarnpkg.com/@chakra-ui/react-use-safe-layout-effect/-/react-use-safe-layout-effect-2.0.2.tgz#31088eeb4b2a6910251683ddb15fb855d6127adf" + integrity sha512-gl5HDq9RVeDJiT8udtpx12KRV8JPLJHDIUX8f/yZcKpXow0C7FFGg5Yy5I9397NQog5ZjKMuOg+AUq9TLJxsyQ== + +"@chakra-ui/react-use-size@2.0.4": + version "2.0.4" + resolved "https://registry.yarnpkg.com/@chakra-ui/react-use-size/-/react-use-size-2.0.4.tgz#3634782f8dab6aa2a37699188afa89251cbae8f3" + integrity sha512-W6rgTLuoSC4ovZtqYco8cG+yBadH3bhlg92T5lgpKDakSDr0mXcZdbGx6g0AOkgxXm0V1jWNGO1743wudtF7ew== + dependencies: + "@zag-js/element-size" "0.1.0" + +"@chakra-ui/react-use-timeout@2.0.2": + version "2.0.2" + resolved "https://registry.yarnpkg.com/@chakra-ui/react-use-timeout/-/react-use-timeout-2.0.2.tgz#f1378de0d5e01f7aee60d5b9ec3205e1fc7d2fc4" + integrity sha512-n6zb3OmxtDmRMxYkDgILqKh15aDOa8jNLHBlqHzmlL6mEGNKmMFPW9j/KvpAqSgKjUTDRnnXcpneprTMKy/yrw== + dependencies: + "@chakra-ui/react-use-callback-ref" "2.0.4" + +"@chakra-ui/react-use-update-effect@2.0.4": + version "2.0.4" + resolved "https://registry.yarnpkg.com/@chakra-ui/react-use-update-effect/-/react-use-update-effect-2.0.4.tgz#522bc58b943fffe540a91f7a096d42e4a91b9748" + integrity sha512-F/I9LVnGAQyvww+x7tQb47wCwjhMYjpxtM1dTg1U3oCEXY0yF1Ts3NJLUAlsr3nAW6epJIwWx61niC7KWpam1w== + "@chakra-ui/react-utils@1.2.3", "@chakra-ui/react-utils@^1.2.3": version "1.2.3" resolved "https://registry.yarnpkg.com/@chakra-ui/react-utils/-/react-utils-1.2.3.tgz#3356c9299bc8faada8fac6c5886ca65ec95bb5be" @@ -1768,7 +2278,14 @@ dependencies: "@chakra-ui/utils" "^1.10.4" -"@chakra-ui/react@^1.0.0": +"@chakra-ui/react-utils@2.0.8": + version "2.0.8" + resolved "https://registry.yarnpkg.com/@chakra-ui/react-utils/-/react-utils-2.0.8.tgz#1db4e920386f4afbf44fe9dd8aaaf6f22eefb371" + integrity sha512-OSHHBKZlJWTi2NZcPnBx1PyZvLQY+n5RPBtcri7/89EDdAwz2NdEhp2Dz1yQRctOSCF1kB/rnCYDP1U0oRk9RQ== + dependencies: + "@chakra-ui/utils" "2.0.11" + +"@chakra-ui/react@^1.7.3": version "1.8.9" resolved "https://registry.yarnpkg.com/@chakra-ui/react/-/react-1.8.9.tgz#1d5a9ed2ce4958d1a006fb192f8a974440c89242" integrity sha512-NfR5XKVqEWhchFLiWaTWkWeYZJK1SNF2O6sQxFVrX6M+nAgJ3Q9tfMk6/I3II+xc4hXJUcYmUvmw37vT92yMaQ== @@ -1821,6 +2338,61 @@ "@chakra-ui/utils" "1.10.4" "@chakra-ui/visually-hidden" "1.1.6" +"@chakra-ui/react@^2.2.1": + version "2.3.6" + resolved "https://registry.yarnpkg.com/@chakra-ui/react/-/react-2.3.6.tgz#a6d3e092cab433fcd9cf8e9876756818c4261df6" + integrity sha512-xo43UU+yMqRGHZLU4fSgzojeRl5stlIfT+GLbT9CUVEm0HMJCt2m8RsNPBvGOMzANdC+bzwSiOm+MNzQBi9IBQ== + dependencies: + "@chakra-ui/accordion" "2.1.2" + "@chakra-ui/alert" "2.0.11" + "@chakra-ui/avatar" "2.2.0" + "@chakra-ui/breadcrumb" "2.1.0" + "@chakra-ui/button" "2.0.11" + "@chakra-ui/checkbox" "2.2.2" + "@chakra-ui/close-button" "2.0.11" + "@chakra-ui/control-box" "2.0.10" + "@chakra-ui/counter" "2.0.10" + "@chakra-ui/css-reset" "2.0.8" + "@chakra-ui/editable" "2.0.13" + "@chakra-ui/form-control" "2.0.11" + "@chakra-ui/hooks" "2.1.0" + "@chakra-ui/icon" "3.0.11" + "@chakra-ui/image" "2.0.11" + "@chakra-ui/input" "2.0.12" + "@chakra-ui/layout" "2.1.9" + "@chakra-ui/live-region" "2.0.10" + "@chakra-ui/media-query" "3.2.7" + "@chakra-ui/menu" "2.1.2" + "@chakra-ui/modal" "2.2.2" + "@chakra-ui/number-input" "2.0.12" + "@chakra-ui/pin-input" "2.0.15" + "@chakra-ui/popover" "2.1.1" + "@chakra-ui/popper" "3.0.8" + "@chakra-ui/portal" "2.0.10" + "@chakra-ui/progress" "2.0.12" + "@chakra-ui/provider" "2.0.20" + "@chakra-ui/radio" "2.0.12" + "@chakra-ui/react-env" "2.0.10" + "@chakra-ui/select" "2.0.12" + "@chakra-ui/skeleton" "2.0.17" + "@chakra-ui/slider" "2.0.12" + "@chakra-ui/spinner" "2.0.10" + "@chakra-ui/stat" "2.0.11" + "@chakra-ui/styled-system" "2.3.4" + "@chakra-ui/switch" "2.0.14" + "@chakra-ui/system" "2.3.0" + "@chakra-ui/table" "2.0.11" + "@chakra-ui/tabs" "2.1.4" + "@chakra-ui/tag" "2.0.11" + "@chakra-ui/textarea" "2.0.12" + "@chakra-ui/theme" "2.1.14" + "@chakra-ui/theme-utils" "2.0.1" + "@chakra-ui/toast" "4.0.0" + "@chakra-ui/tooltip" "2.2.0" + "@chakra-ui/transition" "2.0.11" + "@chakra-ui/utils" "2.0.11" + "@chakra-ui/visually-hidden" "2.0.11" + "@chakra-ui/select@1.2.11": version "1.2.11" resolved "https://registry.yarnpkg.com/@chakra-ui/select/-/select-1.2.11.tgz#7762f2b7974a4587b4eb9536eb93b2295381aa9f" @@ -1829,6 +2401,18 @@ "@chakra-ui/form-control" "1.6.0" "@chakra-ui/utils" "1.10.4" +"@chakra-ui/select@2.0.12": + version "2.0.12" + resolved "https://registry.yarnpkg.com/@chakra-ui/select/-/select-2.0.12.tgz#9b485e6a28c9aa468bc1c0d8a78aabd985b0c370" + integrity sha512-NCDMb0w48GYCHmazVSQ7/ysEpbnri+Up6n+v7yytf6g43TPRkikvK5CsVgLnAEj0lIdCJhWXTcZer5wG5KOEgA== + dependencies: + "@chakra-ui/form-control" "2.0.11" + +"@chakra-ui/shared-utils@2.0.2": + version "2.0.2" + resolved "https://registry.yarnpkg.com/@chakra-ui/shared-utils/-/shared-utils-2.0.2.tgz#1df08133194c12ac4df9302604ec37784c2bb026" + integrity sha512-wC58Fh6wCnFFQyiebVZ0NI7PFW9+Vch0QE6qN7iR+bLseOzQY9miYuzPJ1kMYiFd6QTOmPJkI39M3wHqrPYiOg== + "@chakra-ui/skeleton@1.2.14": version "1.2.14" resolved "https://registry.yarnpkg.com/@chakra-ui/skeleton/-/skeleton-1.2.14.tgz#c2028b03a975c76b13aaecdbbe168872079177b8" @@ -1839,6 +2423,14 @@ "@chakra-ui/system" "1.12.1" "@chakra-ui/utils" "1.10.4" +"@chakra-ui/skeleton@2.0.17": + version "2.0.17" + resolved "https://registry.yarnpkg.com/@chakra-ui/skeleton/-/skeleton-2.0.17.tgz#737e08f771980f5b73060dc6c940691e7759d044" + integrity sha512-dL7viXEKDEzmAJGbHMj+QbGl9PAd0VWztEcWcz5wOGfmAcJllA0lVh6NmG/yqLb6iXPCX4Y1Y0Yurm459TEYWg== + dependencies: + "@chakra-ui/media-query" "3.2.7" + "@chakra-ui/react-use-previous" "2.0.2" + "@chakra-ui/slider@1.5.11": version "1.5.11" resolved "https://registry.yarnpkg.com/@chakra-ui/slider/-/slider-1.5.11.tgz#e03585188547dad3dafdb4a4cbd64bfbf8a4025b" @@ -1848,6 +2440,22 @@ "@chakra-ui/react-utils" "1.2.3" "@chakra-ui/utils" "1.10.4" +"@chakra-ui/slider@2.0.12": + version "2.0.12" + resolved "https://registry.yarnpkg.com/@chakra-ui/slider/-/slider-2.0.12.tgz#42fc5fe385c507276da29f4aa49a6408ee853978" + integrity sha512-Cna04J7e4+F3tJNb7tRNfPP+koicbDsKJBp+f1NpR32JbRzIfrf2Vdr4hfD5/uOfC4RGxnVInNZzZLGBelLtLw== + dependencies: + "@chakra-ui/number-utils" "2.0.4" + "@chakra-ui/react-context" "2.0.4" + "@chakra-ui/react-types" "2.0.3" + "@chakra-ui/react-use-callback-ref" "2.0.4" + "@chakra-ui/react-use-controllable-state" "2.0.5" + "@chakra-ui/react-use-latest-ref" "2.0.2" + "@chakra-ui/react-use-merge-refs" "2.0.4" + "@chakra-ui/react-use-pan-event" "2.0.5" + "@chakra-ui/react-use-size" "2.0.4" + "@chakra-ui/react-use-update-effect" "2.0.4" + "@chakra-ui/spinner@1.2.6": version "1.2.6" resolved "https://registry.yarnpkg.com/@chakra-ui/spinner/-/spinner-1.2.6.tgz#d85fb3d763a69d40570b591507c5087dba38e6c4" @@ -1856,6 +2464,11 @@ "@chakra-ui/utils" "1.10.4" "@chakra-ui/visually-hidden" "1.1.6" +"@chakra-ui/spinner@2.0.10": + version "2.0.10" + resolved "https://registry.yarnpkg.com/@chakra-ui/spinner/-/spinner-2.0.10.tgz#f8b1b6f1c8f45e3aeab44d5ab1f1debc71e52573" + integrity sha512-SwId1xPaaFAaEYrR9eHkQHAuB66CbxwjWaQonEjeEUSh9ecxkd5WbXlsQSyf2hVRIqXJg0m3HIYblcKUsQt9Rw== + "@chakra-ui/stat@1.2.7": version "1.2.7" resolved "https://registry.yarnpkg.com/@chakra-ui/stat/-/stat-1.2.7.tgz#e173171d80f9e756966604e620987bbd7590d291" @@ -1865,6 +2478,14 @@ "@chakra-ui/utils" "1.10.4" "@chakra-ui/visually-hidden" "1.1.6" +"@chakra-ui/stat@2.0.11": + version "2.0.11" + resolved "https://registry.yarnpkg.com/@chakra-ui/stat/-/stat-2.0.11.tgz#0c052aee68486a892e09e802bb569dc984e31eae" + integrity sha512-ZPFK2fKufDSHD8bp/KhO3jLgW/b3PzdG4zV+7iTO7OYjxm5pkBfBAeMqfXGx4cl51rtWUKzsY0HV4vLLjcSjHw== + dependencies: + "@chakra-ui/icon" "3.0.11" + "@chakra-ui/react-context" "2.0.4" + "@chakra-ui/styled-system@1.19.0": version "1.19.0" resolved "https://registry.yarnpkg.com/@chakra-ui/styled-system/-/styled-system-1.19.0.tgz#102fadaefc1a2dfd8e0c4837eafa660531a08419" @@ -1873,6 +2494,14 @@ "@chakra-ui/utils" "1.10.4" csstype "3.0.9" +"@chakra-ui/styled-system@2.3.4": + version "2.3.4" + resolved "https://registry.yarnpkg.com/@chakra-ui/styled-system/-/styled-system-2.3.4.tgz#6022c5a675b54a69b1d3c2d3e60258901dc7b82a" + integrity sha512-Lozbedu+GBj4EbHB/eGv475SFDLApsIEN9gNKiZJBJAE1HIhHn3Seh1iZQSrHC/Beq+D5cQq3Z+yPn3bXtFU7w== + dependencies: + csstype "^3.0.11" + lodash.mergewith "4.6.2" + "@chakra-ui/switch@1.3.10": version "1.3.10" resolved "https://registry.yarnpkg.com/@chakra-ui/switch/-/switch-1.3.10.tgz#6b0a3f199e6e654dbab6e01ccc762e1b29611c62" @@ -1881,6 +2510,13 @@ "@chakra-ui/checkbox" "1.7.1" "@chakra-ui/utils" "1.10.4" +"@chakra-ui/switch@2.0.14": + version "2.0.14" + resolved "https://registry.yarnpkg.com/@chakra-ui/switch/-/switch-2.0.14.tgz#62372355bf73c19896b39fb7e75c132333c5a882" + integrity sha512-6lzhCkJq7vbD3yGaorGLp0ZZU4ewdKwAu0e62qR8TfYZwbcbpkXbBKloIHbA2XKOduISzS2WYqjmoP6jSKIxrA== + dependencies: + "@chakra-ui/checkbox" "2.2.2" + "@chakra-ui/system@1.12.1": version "1.12.1" resolved "https://registry.yarnpkg.com/@chakra-ui/system/-/system-1.12.1.tgz#608655ef3f7cb82eedd8f20d2546458d90d77cce" @@ -1892,6 +2528,18 @@ "@chakra-ui/utils" "1.10.4" react-fast-compare "3.2.0" +"@chakra-ui/system@2.3.0": + version "2.3.0" + resolved "https://registry.yarnpkg.com/@chakra-ui/system/-/system-2.3.0.tgz#b7ba122872d4d48806fbf994f1187680ae2296a6" + integrity sha512-BxikahglBI0uU8FE3anEorDTU5oKTUuBIEKVcQrEVnrbNuRJEy1OVYyCNXfqW3MpruRO9ypYV2bWt02AZZWEaQ== + dependencies: + "@chakra-ui/color-mode" "2.1.9" + "@chakra-ui/react-utils" "2.0.8" + "@chakra-ui/styled-system" "2.3.4" + "@chakra-ui/theme-utils" "2.0.1" + "@chakra-ui/utils" "2.0.11" + react-fast-compare "3.2.0" + "@chakra-ui/table@1.3.6": version "1.3.6" resolved "https://registry.yarnpkg.com/@chakra-ui/table/-/table-1.3.6.tgz#e271676dc03cd4c684e4041df2cf394d86a28510" @@ -1899,6 +2547,13 @@ dependencies: "@chakra-ui/utils" "1.10.4" +"@chakra-ui/table@2.0.11": + version "2.0.11" + resolved "https://registry.yarnpkg.com/@chakra-ui/table/-/table-2.0.11.tgz#9bd25d5383c94982b89e792675bc1d1f667f81f3" + integrity sha512-zQTiqPKEgjdeO/PG0FByn0fH4sPF7dLJF+YszrIzDc6wvpD96iY6MYLeV+CSelbH1g0/uibcJ10PSaFStfGUZg== + dependencies: + "@chakra-ui/react-context" "2.0.4" + "@chakra-ui/tabs@1.6.11": version "1.6.11" resolved "https://registry.yarnpkg.com/@chakra-ui/tabs/-/tabs-1.6.11.tgz#9f3f04f764cec4033711719b1bba8545038ac386" @@ -1910,6 +2565,20 @@ "@chakra-ui/react-utils" "1.2.3" "@chakra-ui/utils" "1.10.4" +"@chakra-ui/tabs@2.1.4": + version "2.1.4" + resolved "https://registry.yarnpkg.com/@chakra-ui/tabs/-/tabs-2.1.4.tgz#38d9748ce2cfa583a123c0f695ea1cbce1a6bd42" + integrity sha512-/CQGj1lC9lvruT5BCYZH6Ok64W4CDSysDXuR2XPZXIih9kVOdXQEMXxG8+3vc63WqTBjHuURtZI0g8ouOy84ew== + dependencies: + "@chakra-ui/clickable" "2.0.10" + "@chakra-ui/descendant" "3.0.10" + "@chakra-ui/lazy-utils" "2.0.2" + "@chakra-ui/react-children-utils" "2.0.3" + "@chakra-ui/react-context" "2.0.4" + "@chakra-ui/react-use-controllable-state" "2.0.5" + "@chakra-ui/react-use-merge-refs" "2.0.4" + "@chakra-ui/react-use-safe-layout-effect" "2.0.2" + "@chakra-ui/tag@1.2.7": version "1.2.7" resolved "https://registry.yarnpkg.com/@chakra-ui/tag/-/tag-1.2.7.tgz#5861a92e83e63825f6fe563921d2704e921b585f" @@ -1918,6 +2587,14 @@ "@chakra-ui/icon" "2.0.5" "@chakra-ui/utils" "1.10.4" +"@chakra-ui/tag@2.0.11": + version "2.0.11" + resolved "https://registry.yarnpkg.com/@chakra-ui/tag/-/tag-2.0.11.tgz#14702adf5d1456dbbb84ea7a4b314953b92c323f" + integrity sha512-iJJcX+4hl+6Se/8eCRzG+xxDwZfiYgc4Ly/8s93M0uW2GLb+ybbfSE2DjeKSyk3mQVeGzuxGkBfDHH2c2v26ew== + dependencies: + "@chakra-ui/icon" "3.0.11" + "@chakra-ui/react-context" "2.0.4" + "@chakra-ui/textarea@1.2.11": version "1.2.11" resolved "https://registry.yarnpkg.com/@chakra-ui/textarea/-/textarea-1.2.11.tgz#24209862cf9227d79228222b7cff2c50f7ff0add" @@ -1926,6 +2603,13 @@ "@chakra-ui/form-control" "1.6.0" "@chakra-ui/utils" "1.10.4" +"@chakra-ui/textarea@2.0.12": + version "2.0.12" + resolved "https://registry.yarnpkg.com/@chakra-ui/textarea/-/textarea-2.0.12.tgz#469c1d64cb855b3b534dcd7fcc1d927e60da8da1" + integrity sha512-msR9YMynRXwZIqR6DgjQ2MogA/cW1syBx/R0v3es+9Zx8zlbuKdoLhYqajHteCup8dUzTeIH2Vs2vAwgq4wu5A== + dependencies: + "@chakra-ui/form-control" "2.0.11" + "@chakra-ui/theme-tools@1.3.6", "@chakra-ui/theme-tools@^1.3.6": version "1.3.6" resolved "https://registry.yarnpkg.com/@chakra-ui/theme-tools/-/theme-tools-1.3.6.tgz#2e5b5c192efd685c158e940a5cedcb0eb51f8602" @@ -1934,6 +2618,23 @@ "@chakra-ui/utils" "1.10.4" "@ctrl/tinycolor" "^3.4.0" +"@chakra-ui/theme-tools@2.0.12": + version "2.0.12" + resolved "https://registry.yarnpkg.com/@chakra-ui/theme-tools/-/theme-tools-2.0.12.tgz#b29d9fb626d35e3b00f532c64f95ea261d8f6997" + integrity sha512-mnMlKSmXkCjHUJsKWmJbgBTGF2vnLaMLv1ihkBn5eQcCubMQrBLTiMAEFl5pZdzuHItU6QdnLGA10smcXbNl0g== + dependencies: + "@chakra-ui/anatomy" "2.0.7" + "@ctrl/tinycolor" "^3.4.0" + +"@chakra-ui/theme-utils@2.0.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@chakra-ui/theme-utils/-/theme-utils-2.0.1.tgz#a3dc99331ba943e155dd683fe25ce302e3084db0" + integrity sha512-NDwzgTPxm+v3PAJlSSU1MORHLMqO9vsRJ+ObELD5wpvE9aEyRziN/AZSoK2oLwCQMPEiU7R99K5ij1E6ptMt7w== + dependencies: + "@chakra-ui/styled-system" "2.3.4" + "@chakra-ui/theme" "2.1.14" + lodash.mergewith "4.6.2" + "@chakra-ui/theme@1.14.1": version "1.14.1" resolved "https://registry.yarnpkg.com/@chakra-ui/theme/-/theme-1.14.1.tgz#84ce1643d4d7c89509e714ac989bcf8acd5578b8" @@ -1943,6 +2644,14 @@ "@chakra-ui/theme-tools" "1.3.6" "@chakra-ui/utils" "1.10.4" +"@chakra-ui/theme@2.1.14": + version "2.1.14" + resolved "https://registry.yarnpkg.com/@chakra-ui/theme/-/theme-2.1.14.tgz#4726d65a65515f8ee96b5f2a725d0d17804ddfc9" + integrity sha512-6EYJCQlrjSjNAJvZmw1un50F8+sQDFsdwu/7UzWe+TeANpKlz4ZcHbh0gkl3PD62lGis+ehITUwqRm8htvDOjw== + dependencies: + "@chakra-ui/anatomy" "2.0.7" + "@chakra-ui/theme-tools" "2.0.12" + "@chakra-ui/toast@1.5.9": version "1.5.9" resolved "https://registry.yarnpkg.com/@chakra-ui/toast/-/toast-1.5.9.tgz#45521dc521186ce88aad07a3796545d15a6f9697" @@ -1956,6 +2665,19 @@ "@chakra-ui/utils" "1.10.4" "@reach/alert" "0.13.2" +"@chakra-ui/toast@4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/@chakra-ui/toast/-/toast-4.0.0.tgz#797c34c4ecfcad7c6899c1cda221af0ff04d5d0b" + integrity sha512-abeeloJac5T9WK2IN76fEM5FSRH+erNXln2HqDf5wLBn33avSBXWyTiUL8riVSUqto0lrIn6FuK/MmKo0DH4og== + dependencies: + "@chakra-ui/alert" "2.0.11" + "@chakra-ui/close-button" "2.0.11" + "@chakra-ui/portal" "2.0.10" + "@chakra-ui/react-use-timeout" "2.0.2" + "@chakra-ui/react-use-update-effect" "2.0.4" + "@chakra-ui/styled-system" "2.3.4" + "@chakra-ui/theme" "2.1.14" + "@chakra-ui/tooltip@1.5.1": version "1.5.1" resolved "https://registry.yarnpkg.com/@chakra-ui/tooltip/-/tooltip-1.5.1.tgz#c338476aa0f00fc89f6357bc22725329f90d8d5d" @@ -1968,6 +2690,18 @@ "@chakra-ui/utils" "1.10.4" "@chakra-ui/visually-hidden" "1.1.6" +"@chakra-ui/tooltip@2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@chakra-ui/tooltip/-/tooltip-2.2.0.tgz#24e005f831cddf1c0e41dd246ed2771a97b8637c" + integrity sha512-oB97aQJBW+U3rRIt1ct7NaDRMnbW16JQ5ZBCl3BzN1VJWO3djiNuscpjVdZSceb+FdGSFo+GoDozp1ZwqdfFeQ== + dependencies: + "@chakra-ui/popper" "3.0.8" + "@chakra-ui/portal" "2.0.10" + "@chakra-ui/react-types" "2.0.3" + "@chakra-ui/react-use-disclosure" "2.0.5" + "@chakra-ui/react-use-event-listener" "2.0.4" + "@chakra-ui/react-use-merge-refs" "2.0.4" + "@chakra-ui/transition@1.4.8": version "1.4.8" resolved "https://registry.yarnpkg.com/@chakra-ui/transition/-/transition-1.4.8.tgz#ac0f4675da929ae69fc9d6db6a1edf61e982772c" @@ -1975,6 +2709,11 @@ dependencies: "@chakra-ui/utils" "1.10.4" +"@chakra-ui/transition@2.0.11": + version "2.0.11" + resolved "https://registry.yarnpkg.com/@chakra-ui/transition/-/transition-2.0.11.tgz#b2cfeb2150871c635cb9d03d9b525481dbe56f56" + integrity sha512-O0grc162LARPurjz1R+J+zr4AAKsVwN5+gaqLfZLMWg6TpvczJhwEA2fLCNAdkC/gomere390bJsy52xfUacUw== + "@chakra-ui/utils@1.10.4", "@chakra-ui/utils@^1.10.4": version "1.10.4" resolved "https://registry.yarnpkg.com/@chakra-ui/utils/-/utils-1.10.4.tgz#40a32d4efd8684b2e7432a40b285796383eacfd3" @@ -1985,6 +2724,16 @@ framesync "5.3.0" lodash.mergewith "4.6.2" +"@chakra-ui/utils@2.0.11": + version "2.0.11" + resolved "https://registry.yarnpkg.com/@chakra-ui/utils/-/utils-2.0.11.tgz#8e773f900a8356bd10c48b59151a781dba1c7b70" + integrity sha512-4ZQdK6tbOuTrUCsAQBHWo7tw5/Q6pBV93ZbVpats61cSWMFGv32AIQw9/hA4un2zDeSWN9ZMVLNjAY2Dq/KQOA== + dependencies: + "@types/lodash.mergewith" "4.6.6" + css-box-model "1.2.1" + framesync "5.3.0" + lodash.mergewith "4.6.2" + "@chakra-ui/visually-hidden@1.1.6": version "1.1.6" resolved "https://registry.yarnpkg.com/@chakra-ui/visually-hidden/-/visually-hidden-1.1.6.tgz#7a546a5aebe4779c8f18d65b1f0e56249720f28d" @@ -1992,6 +2741,11 @@ dependencies: "@chakra-ui/utils" "1.10.4" +"@chakra-ui/visually-hidden@2.0.11": + version "2.0.11" + resolved "https://registry.yarnpkg.com/@chakra-ui/visually-hidden/-/visually-hidden-2.0.11.tgz#b2eb236e803451b39cdfcce3c5ab52e773c066a3" + integrity sha512-e+5amYvnsmEQdiWH4XMyvrtGTdwz//+48vwj5CsNWWcselzkwqodmciy5rIrT71/SCQDOtmgnL7ZWAUOffxfsQ== + "@cspotcode/source-map-support@^0.8.0": version "0.8.1" resolved "https://registry.yarnpkg.com/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz#00629c35a688e05a88b1cda684fb9d5e73f000a1" @@ -2111,6 +2865,24 @@ source-map "^0.5.7" stylis "4.0.13" +"@emotion/babel-plugin@^11.10.5": + version "11.10.5" + resolved "https://registry.yarnpkg.com/@emotion/babel-plugin/-/babel-plugin-11.10.5.tgz#65fa6e1790ddc9e23cc22658a4c5dea423c55c3c" + integrity sha512-xE7/hyLHJac7D2Ve9dKroBBZqBT7WuPQmWcq7HSGb84sUuP4mlOWoB8dvVfD9yk5DHkU1m6RW7xSoDtnQHNQeA== + dependencies: + "@babel/helper-module-imports" "^7.16.7" + "@babel/plugin-syntax-jsx" "^7.17.12" + "@babel/runtime" "^7.18.3" + "@emotion/hash" "^0.9.0" + "@emotion/memoize" "^0.8.0" + "@emotion/serialize" "^1.1.1" + babel-plugin-macros "^3.1.0" + convert-source-map "^1.5.0" + escape-string-regexp "^4.0.0" + find-root "^1.1.0" + source-map "^0.5.7" + stylis "4.1.3" + "@emotion/cache@^11.10.0": version "11.10.3" resolved "https://registry.yarnpkg.com/@emotion/cache/-/cache-11.10.3.tgz#c4f67904fad10c945fea5165c3a5a0583c164b87" @@ -2122,15 +2894,26 @@ "@emotion/weak-memoize" "^0.3.0" stylis "4.0.13" -"@emotion/css@^11.7.1": - version "11.10.0" - resolved "https://registry.yarnpkg.com/@emotion/css/-/css-11.10.0.tgz#270b4fdf2419e59cb07081d0e9f7940d88b8b443" - integrity sha512-dH9f+kSCucc8ilMg0MUA1AemabcyzYpe5EKX24F528PJjD7HyIY/VBNJHxfUdc8l400h2ncAjR6yEDu+DBj2cg== +"@emotion/cache@^11.10.5": + version "11.10.5" + resolved "https://registry.yarnpkg.com/@emotion/cache/-/cache-11.10.5.tgz#c142da9351f94e47527ed458f7bbbbe40bb13c12" + integrity sha512-dGYHWyzTdmK+f2+EnIGBpkz1lKc4Zbj2KHd4cX3Wi8/OWr5pKslNjc3yABKH4adRGCvSX4VDC0i04mrrq0aiRA== dependencies: - "@emotion/babel-plugin" "^11.10.0" - "@emotion/cache" "^11.10.0" - "@emotion/serialize" "^1.1.0" - "@emotion/sheet" "^1.2.0" + "@emotion/memoize" "^0.8.0" + "@emotion/sheet" "^1.2.1" + "@emotion/utils" "^1.2.0" + "@emotion/weak-memoize" "^0.3.0" + stylis "4.1.3" + +"@emotion/css@^11.7.1": + version "11.10.5" + resolved "https://registry.yarnpkg.com/@emotion/css/-/css-11.10.5.tgz#ca01bb83ce60517bc3a5c01d27ccf552fed84d9d" + integrity sha512-maJy0wG82hWsiwfJpc3WrYsyVwUbdu+sdIseKUB+/OLjB8zgc3tqkT6eO0Yt0AhIkJwGGnmMY/xmQwEAgQ4JHA== + dependencies: + "@emotion/babel-plugin" "^11.10.5" + "@emotion/cache" "^11.10.5" + "@emotion/serialize" "^1.1.1" + "@emotion/sheet" "^1.2.1" "@emotion/utils" "^1.2.0" "@emotion/hash@^0.9.0": @@ -2162,7 +2945,7 @@ resolved "https://registry.yarnpkg.com/@emotion/memoize/-/memoize-0.8.0.tgz#f580f9beb67176fa57aae70b08ed510e1b18980f" integrity sha512-G/YwXTkv7Den9mXDO7AhLWkE3q+I92B+VqAE+dYG4NGPaHZGvt3G8Q0p9vmE+sq7rTGphUbAvmQ9YpbfMQGGlA== -"@emotion/react@^11.8.2": +"@emotion/react@^11": version "11.10.4" resolved "https://registry.yarnpkg.com/@emotion/react/-/react-11.10.4.tgz#9dc6bccbda5d70ff68fdb204746c0e8b13a79199" integrity sha512-j0AkMpr6BL8gldJZ6XQsQ8DnS9TxEQu1R+OGmDZiWjBAJtCcbt0tS3I/YffoqHXxH6MjgI7KdMbYKw3MEiU9eA== @@ -2176,6 +2959,20 @@ "@emotion/weak-memoize" "^0.3.0" hoist-non-react-statics "^3.3.1" +"@emotion/react@^11.8.2": + version "11.10.5" + resolved "https://registry.yarnpkg.com/@emotion/react/-/react-11.10.5.tgz#95fff612a5de1efa9c0d535384d3cfa115fe175d" + integrity sha512-TZs6235tCJ/7iF6/rvTaOH4oxQg2gMAcdHemjwLKIjKz4rRuYe1HJ2TQJKnAcRAfOUDdU8XoDadCe1rl72iv8A== + dependencies: + "@babel/runtime" "^7.18.3" + "@emotion/babel-plugin" "^11.10.5" + "@emotion/cache" "^11.10.5" + "@emotion/serialize" "^1.1.1" + "@emotion/use-insertion-effect-with-fallbacks" "^1.0.0" + "@emotion/utils" "^1.2.0" + "@emotion/weak-memoize" "^0.3.0" + hoist-non-react-statics "^3.3.1" + "@emotion/serialize@^1.1.0": version "1.1.0" resolved "https://registry.yarnpkg.com/@emotion/serialize/-/serialize-1.1.0.tgz#b1f97b1011b09346a40e9796c37a3397b4ea8ea8" @@ -2187,11 +2984,27 @@ "@emotion/utils" "^1.2.0" csstype "^3.0.2" +"@emotion/serialize@^1.1.1": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@emotion/serialize/-/serialize-1.1.1.tgz#0595701b1902feded8a96d293b26be3f5c1a5cf0" + integrity sha512-Zl/0LFggN7+L1liljxXdsVSVlg6E/Z/olVWpfxUTxOAmi8NU7YoeWeLfi1RmnB2TATHoaWwIBRoL+FvAJiTUQA== + dependencies: + "@emotion/hash" "^0.9.0" + "@emotion/memoize" "^0.8.0" + "@emotion/unitless" "^0.8.0" + "@emotion/utils" "^1.2.0" + csstype "^3.0.2" + "@emotion/sheet@^1.2.0": version "1.2.0" resolved "https://registry.yarnpkg.com/@emotion/sheet/-/sheet-1.2.0.tgz#771b1987855839e214fc1741bde43089397f7be5" integrity sha512-OiTkRgpxescko+M51tZsMq7Puu/KP55wMT8BgpcXVG2hqXc0Vo0mfymJ/Uj24Hp0i083ji/o0aLddh08UEjq8w== +"@emotion/sheet@^1.2.1": + version "1.2.1" + resolved "https://registry.yarnpkg.com/@emotion/sheet/-/sheet-1.2.1.tgz#0767e0305230e894897cadb6c8df2c51e61a6c2c" + integrity sha512-zxRBwl93sHMsOj4zs+OslQKg/uhF38MB+OMKoCrVuS0nyTkqnau+BM3WGEoOptg9Oz45T/aIGs1qbVAsEFo3nA== + "@emotion/styled@^11": version "11.10.4" resolved "https://registry.yarnpkg.com/@emotion/styled/-/styled-11.10.4.tgz#e93f84a4d54003c2acbde178c3f97b421fce1cd4" @@ -2621,6 +3434,76 @@ package-json-validator "^0.6.3" requireindex "^1.2.0" +"@next/env@12.3.1": + version "12.3.1" + resolved "https://registry.yarnpkg.com/@next/env/-/env-12.3.1.tgz#18266bd92de3b4aa4037b1927aa59e6f11879260" + integrity sha512-9P9THmRFVKGKt9DYqeC2aKIxm8rlvkK38V1P1sRE7qyoPBIs8l9oo79QoSdPtOWfzkbDAVUqvbQGgTMsb8BtJg== + +"@next/swc-android-arm-eabi@12.3.1": + version "12.3.1" + resolved "https://registry.yarnpkg.com/@next/swc-android-arm-eabi/-/swc-android-arm-eabi-12.3.1.tgz#b15ce8ad376102a3b8c0f3c017dde050a22bb1a3" + integrity sha512-i+BvKA8tB//srVPPQxIQN5lvfROcfv4OB23/L1nXznP+N/TyKL8lql3l7oo2LNhnH66zWhfoemg3Q4VJZSruzQ== + +"@next/swc-android-arm64@12.3.1": + version "12.3.1" + resolved "https://registry.yarnpkg.com/@next/swc-android-arm64/-/swc-android-arm64-12.3.1.tgz#85d205f568a790a137cb3c3f720d961a2436ac9c" + integrity sha512-CmgU2ZNyBP0rkugOOqLnjl3+eRpXBzB/I2sjwcGZ7/Z6RcUJXK5Evz+N0ucOxqE4cZ3gkTeXtSzRrMK2mGYV8Q== + +"@next/swc-darwin-arm64@12.3.1": + version "12.3.1" + resolved "https://registry.yarnpkg.com/@next/swc-darwin-arm64/-/swc-darwin-arm64-12.3.1.tgz#b105457d6760a7916b27e46c97cb1a40547114ae" + integrity sha512-hT/EBGNcu0ITiuWDYU9ur57Oa4LybD5DOQp4f22T6zLfpoBMfBibPtR8XktXmOyFHrL/6FC2p9ojdLZhWhvBHg== + +"@next/swc-darwin-x64@12.3.1": + version "12.3.1" + resolved "https://registry.yarnpkg.com/@next/swc-darwin-x64/-/swc-darwin-x64-12.3.1.tgz#6947b39082271378896b095b6696a7791c6e32b1" + integrity sha512-9S6EVueCVCyGf2vuiLiGEHZCJcPAxglyckTZcEwLdJwozLqN0gtS0Eq0bQlGS3dH49Py/rQYpZ3KVWZ9BUf/WA== + +"@next/swc-freebsd-x64@12.3.1": + version "12.3.1" + resolved "https://registry.yarnpkg.com/@next/swc-freebsd-x64/-/swc-freebsd-x64-12.3.1.tgz#2b6c36a4d84aae8b0ea0e0da9bafc696ae27085a" + integrity sha512-qcuUQkaBZWqzM0F1N4AkAh88lLzzpfE6ImOcI1P6YeyJSsBmpBIV8o70zV+Wxpc26yV9vpzb+e5gCyxNjKJg5Q== + +"@next/swc-linux-arm-gnueabihf@12.3.1": + version "12.3.1" + resolved "https://registry.yarnpkg.com/@next/swc-linux-arm-gnueabihf/-/swc-linux-arm-gnueabihf-12.3.1.tgz#6e421c44285cfedac1f4631d5de330dd60b86298" + integrity sha512-diL9MSYrEI5nY2wc/h/DBewEDUzr/DqBjIgHJ3RUNtETAOB3spMNHvJk2XKUDjnQuluLmFMloet9tpEqU2TT9w== + +"@next/swc-linux-arm64-gnu@12.3.1": + version "12.3.1" + resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-12.3.1.tgz#8863f08a81f422f910af126159d2cbb9552ef717" + integrity sha512-o/xB2nztoaC7jnXU3Q36vGgOolJpsGG8ETNjxM1VAPxRwM7FyGCPHOMk1XavG88QZSQf+1r+POBW0tLxQOJ9DQ== + +"@next/swc-linux-arm64-musl@12.3.1": + version "12.3.1" + resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-12.3.1.tgz#0038f07cf0b259d70ae0c80890d826dfc775d9f3" + integrity sha512-2WEasRxJzgAmP43glFNhADpe8zB7kJofhEAVNbDJZANp+H4+wq+/cW1CdDi8DqjkShPEA6/ejJw+xnEyDID2jg== + +"@next/swc-linux-x64-gnu@12.3.1": + version "12.3.1" + resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-12.3.1.tgz#c66468f5e8181ffb096c537f0dbfb589baa6a9c1" + integrity sha512-JWEaMyvNrXuM3dyy9Pp5cFPuSSvG82+yABqsWugjWlvfmnlnx9HOQZY23bFq3cNghy5V/t0iPb6cffzRWylgsA== + +"@next/swc-linux-x64-musl@12.3.1": + version "12.3.1" + resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-12.3.1.tgz#c6269f3e96ac0395bc722ad97ce410ea5101d305" + integrity sha512-xoEWQQ71waWc4BZcOjmatuvPUXKTv6MbIFzpm4LFeCHsg2iwai0ILmNXf81rJR+L1Wb9ifEke2sQpZSPNz1Iyg== + +"@next/swc-win32-arm64-msvc@12.3.1": + version "12.3.1" + resolved "https://registry.yarnpkg.com/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-12.3.1.tgz#83c639ee969cee36ce247c3abd1d9df97b5ecade" + integrity sha512-hswVFYQYIeGHE2JYaBVtvqmBQ1CppplQbZJS/JgrVI3x2CurNhEkmds/yqvDONfwfbttTtH4+q9Dzf/WVl3Opw== + +"@next/swc-win32-ia32-msvc@12.3.1": + version "12.3.1" + resolved "https://registry.yarnpkg.com/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-12.3.1.tgz#52995748b92aa8ad053440301bc2c0d9fbcf27c2" + integrity sha512-Kny5JBehkTbKPmqulr5i+iKntO5YMP+bVM8Hf8UAmjSMVo3wehyLVc9IZkNmcbxi+vwETnQvJaT5ynYBkJ9dWA== + +"@next/swc-win32-x64-msvc@12.3.1": + version "12.3.1" + resolved "https://registry.yarnpkg.com/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-12.3.1.tgz#27d71a95247a9eaee03d47adee7e3bd594514136" + integrity sha512-W1ijvzzg+kPEX6LAc+50EYYSEo0FVu7dmTE+t+DM4iOLqgGHoW9uYSz9wCVdkXOEEMP9xhXfGpcSxsfDucyPkA== + "@nicolo-ribaudo/chokidar-2@2.1.8-no-fsevents.3": version "2.1.8-no-fsevents.3" resolved "https://registry.yarnpkg.com/@nicolo-ribaudo/chokidar-2/-/chokidar-2-2.1.8-no-fsevents.3.tgz#323d72dd25103d0c4fbdce89dadf574a787b1f9b" @@ -3204,7 +4087,107 @@ dependencies: "@octokit/openapi-types" "^12.11.0" -"@player-ui/logger@^0.2.0": +"@player-ui/asset-provider-plugin-react@0.2.0": + version "0.2.0" + resolved "https://registry.yarnpkg.com/@player-ui/asset-provider-plugin-react/-/asset-provider-plugin-react-0.2.0.tgz#6cff232d7e9ce70cf963f996ba6845d49e51ffb9" + integrity sha512-THMru7jpDeGYlRbGpj0tYFNGMLHF1WFkfHHn5zD3LaiKrDsWrZbH2shxz4TmvuEfivTSNWXEPzBInKnasDIr5Q== + dependencies: + "@babel/runtime" "7.15.4" + "@player-ui/react-asset" "0.2.0" + "@player-ui/react-subscribe" "0.2.0" + +"@player-ui/asset-transform-plugin@0.2.0": + version "0.2.0" + resolved "https://registry.yarnpkg.com/@player-ui/asset-transform-plugin/-/asset-transform-plugin-0.2.0.tgz#3e1473229d1189f1d5bc7005cc8c27a144ba96dd" + integrity sha512-MFzdlgukCtnpjnfYcXdTSxkbMHTgBCBqOj6Dv113rfo55W13Npu563t2UkDhpHQkBSsWXTSaFbb6T9I7vqE7PQ== + dependencies: + "@babel/runtime" "7.15.4" + "@player-ui/partial-match-registry" "0.2.0" + +"@player-ui/beacon-plugin-react@0.2.0": + version "0.2.0" + resolved "https://registry.yarnpkg.com/@player-ui/beacon-plugin-react/-/beacon-plugin-react-0.2.0.tgz#5da5fae1bad282a4f3c7043c9bd95cc65931d386" + integrity sha512-3X/t+BgclCDWMb+TMcOvYm6e8wrHHR8MKnGfkIWb7rmC6fnR+0KzBlNsRjP5UQp3n5JCLRFhYrzcxXqyNdTG4w== + dependencies: + "@babel/runtime" "7.15.4" + "@player-ui/beacon-plugin" "0.2.0" + "@player-ui/react-utils" "0.2.0" + +"@player-ui/beacon-plugin@0.2.0": + version "0.2.0" + resolved "https://registry.yarnpkg.com/@player-ui/beacon-plugin/-/beacon-plugin-0.2.0.tgz#597925021b08fd95207e72de73eb5b49faa0b101" + integrity sha512-nhrFAZslLjG5qB4ysq60PzYlf+huCV9iH/LesRT3VYGf7ubmO2YGLVQIFLyqrV7YIX9pEN5zJgyaigsCoSrWhw== + dependencies: + "@babel/runtime" "7.15.4" + tapable-ts "^0.1.0" + timm "^1.6.2" + +"@player-ui/binding-grammar@0.2.0": + version "0.2.0" + resolved "https://registry.yarnpkg.com/@player-ui/binding-grammar/-/binding-grammar-0.2.0.tgz#36e772943f82255602c1c2cd80e5e371f0a22fd4" + integrity sha512-C17FjmMPYW74GYi6PRxgKRcH2bZTPjEgn+5DPKVexmnrq1jvXRhivs4xmOjNbdaxBsMTWV11DPvuABVnwm9xcA== + dependencies: + "@babel/runtime" "7.15.4" + "@types/parsimmon" "^1.10.0" + arr-flatten "^1.1.0" + ebnf "^1.9.0" + parsimmon "^1.12.0" + +"@player-ui/binding@0.2.0": + version "0.2.0" + resolved "https://registry.yarnpkg.com/@player-ui/binding/-/binding-0.2.0.tgz#b13032a704c588bac116c669c3a269d56b5ff36d" + integrity sha512-f1548zZoHVGjCRQjAG4XUZFqJVu+8MkNAq12DvasZIwlUsrT/m+A8n2Zj6TjoBRIzNJLE8UB7Apy4+1fqczxeQ== + dependencies: + "@babel/runtime" "7.15.4" + "@player-ui/binding-grammar" "0.2.0" + "@types/nested-error-stacks" "^2.1.0" + nested-error-stacks "^2.1.1" + tapable-ts "^0.1.0" + +"@player-ui/constants@0.2.0": + version "0.2.0" + resolved "https://registry.yarnpkg.com/@player-ui/constants/-/constants-0.2.0.tgz#7c60739b7c6064b26041fb0389b3fd7314e38c54" + integrity sha512-bHnoUQEtvzD2r5aVDdpYmyJtZ6PIvvJogQp03l2fgvq96Mct9Rp3VelzhKJtakj7scMr5wt2yblD2n13aR8IWQ== + dependencies: + "@babel/runtime" "7.15.4" + +"@player-ui/data@0.2.0": + version "0.2.0" + resolved "https://registry.yarnpkg.com/@player-ui/data/-/data-0.2.0.tgz#a2408102b45818b7fab627768393022d02f308f1" + integrity sha512-0MSDpeQXLWD010uCj/zjCsbGwDE3cvoKGj5Nt75/1cSzQYSNwzxwGtjTs7Kjb0kay7exZA4BeiX4UqyTlqv5mQ== + dependencies: + "@babel/runtime" "7.15.4" + "@player-ui/binding" "0.2.0" + "@types/dlv" "^1.1.2" + dlv "^1.1.3" + tapable-ts "^0.1.0" + timm "^1.6.2" + +"@player-ui/expressions@0.2.0": + version "0.2.0" + resolved "https://registry.yarnpkg.com/@player-ui/expressions/-/expressions-0.2.0.tgz#2fce99572fe187974b939272a3de062fb7f2675a" + integrity sha512-V/FF5WX2Im/ekzAL5zjE4goCya6NeVN/LGosjAW5GoWNCnRNi4z1PXzE/zo3dOjle6bM58JgiIIdTlefj+OE8g== + dependencies: + "@babel/runtime" "7.15.4" + "@player-ui/binding" "0.2.0" + "@player-ui/data" "0.2.0" + "@player-ui/logger" "0.2.0" + "@player-ui/string-resolver" "0.2.0" + "@player-ui/types" "0.2.0" + tapable-ts "^0.1.0" + +"@player-ui/flow@0.2.0": + version "0.2.0" + resolved "https://registry.yarnpkg.com/@player-ui/flow/-/flow-0.2.0.tgz#4834f2d3c23807c54b49a462749531d4269cb643" + integrity sha512-gsfNkRTTKS7c2x8kOQUboUXI+OkLb8SVF4ANtmFnVh4yY7i9fdlw1zWkrdBiSUaU78qBUggM5asN1JRmpXt1ow== + dependencies: + "@babel/runtime" "7.15.4" + "@player-ui/logger" "0.2.0" + "@player-ui/types" "0.2.0" + p-defer "^3.0.0" + tapable-ts "^0.1.0" + +"@player-ui/logger@0.2.0", "@player-ui/logger@^0.2.0": version "0.2.0" resolved "https://registry.yarnpkg.com/@player-ui/logger/-/logger-0.2.0.tgz#8cda9d07922a2f1a4090cb849a42f7e9499fbda9" integrity sha512-rwWOuWDRCEsLv8SpHJgpVei18PcXLzr/F6ZS8SPR2UIlZ4y6T1TxPd/qjIdPMs6CeP5pzOVeZVIevhDQNHO+lQ== @@ -3212,13 +4195,184 @@ "@babel/runtime" "7.15.4" tapable-ts "^0.1.0" -"@player-ui/types@^0.2.0": +"@player-ui/metrics-plugin@0.2.0": + version "0.2.0" + resolved "https://registry.yarnpkg.com/@player-ui/metrics-plugin/-/metrics-plugin-0.2.0.tgz#714dac415f9360abef1d3f324212f15ec9dd49b6" + integrity sha512-Llg5skUncdtTiQf0pSEC0X+kYVUxoIHVOh8l5gyRoiklRMOfoYGiKt70A3vsC1oUt1WacTrD+uug6+Nm4KO1Zw== + dependencies: + "@babel/runtime" "7.15.4" + "@player-ui/beacon-plugin" "0.2.0" + tapable-ts "^0.1.0" + +"@player-ui/partial-match-registry@0.2.0": + version "0.2.0" + resolved "https://registry.yarnpkg.com/@player-ui/partial-match-registry/-/partial-match-registry-0.2.0.tgz#ed1a0b52ea96f06e53f500a092bd83d37b73d74b" + integrity sha512-jikqr0ZBSSfsEUPSbE21ZYsI7vyQlan4oxBHMZdYfnDs3QVaILNQbiqD/EiEj2i6dnCQmO/fMVGF8EjQCoqLoQ== + dependencies: + "@babel/runtime" "7.15.4" + "@types/dlv" "^1.1.2" + dlv "^1.1.3" + sorted-array "^2.0.4" + +"@player-ui/player@0.2.0": + version "0.2.0" + resolved "https://registry.yarnpkg.com/@player-ui/player/-/player-0.2.0.tgz#080252ec597d5b97163a8b8316013e3d4816e93c" + integrity sha512-CV4BaEzIfPBO7usuyYtq/tRRH1lX6Yi9clgC2iW6yEUFwyLvM2JXq4TKlXgbW1cVot+y57Ippd62Xdf71egRSg== + dependencies: + "@babel/runtime" "7.15.4" + "@player-ui/binding" "0.2.0" + "@player-ui/constants" "0.2.0" + "@player-ui/data" "0.2.0" + "@player-ui/expressions" "0.2.0" + "@player-ui/flow" "0.2.0" + "@player-ui/logger" "0.2.0" + "@player-ui/partial-match-registry" "0.2.0" + "@player-ui/schema" "0.2.0" + "@player-ui/string-resolver" "0.2.0" + "@player-ui/types" "0.2.0" + "@player-ui/utils" "0.2.0" + "@player-ui/validator" "0.2.0" + "@player-ui/view" "0.2.0" + babel-plugin-preval "^5.0.0" + dequal "^2.0.2" + p-defer "^3.0.0" + queue-microtask "^1.2.3" + tapable-ts "^0.1.0" + timm "^1.6.2" + +"@player-ui/react-asset@0.2.0": + version "0.2.0" + resolved "https://registry.yarnpkg.com/@player-ui/react-asset/-/react-asset-0.2.0.tgz#7a14e8e768bf7653a8f8784721f1ffef0e3ec643" + integrity sha512-feH55Y0ymoxzHjN95D4LaD7p4P7XO1Affk4K/Z8hulLYRR5Wq95txhLAHSQyYMvEVbpM4LtV2b3HLOcZn+9Z3A== + dependencies: + "@babel/runtime" "7.15.4" + +"@player-ui/react-subscribe@0.2.0": + version "0.2.0" + resolved "https://registry.yarnpkg.com/@player-ui/react-subscribe/-/react-subscribe-0.2.0.tgz#c2f2653f24ab5c80b71a785fbce19ca2db13420b" + integrity sha512-vDkWMorGcl2XQVEFknnUjtXT5/gBmiO/NrZ3JucYuFhSK0+GfHRKZhNzi8GnH5o1Q1M01HBK0WbiaSUvwfWlwg== + dependencies: + "@babel/runtime" "7.15.4" + p-defer "^3.0.0" + +"@player-ui/react-utils@0.2.0": + version "0.2.0" + resolved "https://registry.yarnpkg.com/@player-ui/react-utils/-/react-utils-0.2.0.tgz#7145965af38b50385aa87b0f9e4b918742f7c997" + integrity sha512-SpGE7VOwcz5IWDdN9jgvcs95Nig3X6mpsvLV/YsRU44y6FGSYcMq0MJY4rR+nb0PXpZreuxvpCyAMTt/akjbWA== + dependencies: + "@babel/runtime" "7.15.4" + +"@player-ui/react@^0.2.0": + version "0.2.0" + resolved "https://registry.yarnpkg.com/@player-ui/react/-/react-0.2.0.tgz#6b76ec60571f4891521628402683c033073e1a2e" + integrity sha512-XNLHpO9n1bgFeDC/4OB/yTQn7TJJAMPobYpo7qplXnz3vr0BnnWWOIsN0++N6w6QCTnOk8WyDzHiasSBdqeI2w== + dependencies: + "@babel/runtime" "7.15.4" + "@player-ui/metrics-plugin" "0.2.0" + "@player-ui/partial-match-registry" "0.2.0" + "@player-ui/player" "0.2.0" + "@player-ui/react-asset" "0.2.0" + "@player-ui/react-subscribe" "0.2.0" + "@player-ui/react-utils" "0.2.0" + react-error-boundary "^3.1.3" + tapable-ts "^0.1.0" + +"@player-ui/reference-assets-plugin-react@^0.2.0": + version "0.2.0" + resolved "https://registry.yarnpkg.com/@player-ui/reference-assets-plugin-react/-/reference-assets-plugin-react-0.2.0.tgz#6f296a40982f7d733472b4f64114576dac6ffcc8" + integrity sha512-OavS1QNOChoFv0r2qeJ7CKOoWfHH7jhaflXA7UXAumtQVZl8T9R1X+v/EJXpZ2elLKUcV0JW/b8U311K+/xExA== + dependencies: + "@babel/runtime" "7.15.4" + "@chakra-ui/icons" "^1.1.1" + "@chakra-ui/react" "^1.7.3" + "@player-ui/asset-provider-plugin-react" "0.2.0" + "@player-ui/beacon-plugin-react" "0.2.0" + "@player-ui/partial-match-registry" "0.2.0" + "@player-ui/reference-assets-plugin" "0.2.0" + clsx "^1.1.1" + +"@player-ui/reference-assets-plugin@0.2.0": + version "0.2.0" + resolved "https://registry.yarnpkg.com/@player-ui/reference-assets-plugin/-/reference-assets-plugin-0.2.0.tgz#ccdfc0242be74a99f02dbd6fb37498919db5cb80" + integrity sha512-qmAgUtbxJ2UdsplwJLB7Lb5pfbyNQniTFSOUnLcz3L5vXUF63Qm/7DzjNvqWPeJ2s3KL/XlI0+ILeLe3NFR+7w== + dependencies: + "@babel/runtime" "7.15.4" + "@player-ui/asset-transform-plugin" "0.2.0" + "@player-ui/beacon-plugin" "0.2.0" + +"@player-ui/schema@0.2.0": + version "0.2.0" + resolved "https://registry.yarnpkg.com/@player-ui/schema/-/schema-0.2.0.tgz#0107779cf3789622a81a1e82bfdf3f6408f99030" + integrity sha512-O8RYnrNhBPblh/NgO/pAVjBiKPpHzAUlf1JZPjxYiZ6hN4BxC6Pf47A+IWLdsbhWP7unBfqDD6V1fYaX0hm7AA== + dependencies: + "@babel/runtime" "7.15.4" + "@player-ui/binding" "0.2.0" + "@player-ui/data" "0.2.0" + "@player-ui/types" "0.2.0" + "@player-ui/validator" "0.2.0" + tapable-ts "^0.1.0" + +"@player-ui/string-resolver@0.2.0": + version "0.2.0" + resolved "https://registry.yarnpkg.com/@player-ui/string-resolver/-/string-resolver-0.2.0.tgz#16136a14c3761c500e83d3cb500de588fa4cc8a1" + integrity sha512-5hN7u4BG2O3Dk6NGTKcpArNI+E6patHnYDS4Yxa1mnh5Zi7R0EpAd1wSa5LENtuDKo9ueVvKSWDjtBB9svV7lw== + dependencies: + "@babel/runtime" "7.15.4" + "@player-ui/binding" "0.2.0" + "@player-ui/data" "0.2.0" + "@player-ui/types" "0.2.0" + timm "^1.6.2" + +"@player-ui/types@0.2.0", "@player-ui/types@^0.2.0": version "0.2.0" resolved "https://registry.yarnpkg.com/@player-ui/types/-/types-0.2.0.tgz#72990b70621d65ceebf02da9f813481e8eb17692" integrity sha512-Lj7XNWQ9bHeVQbPJQwObXhYJddvr5iEhFCivCdbREuqiuF7RhG6Sodn3nT88L8EQPr78n88I7oxD6G8fQ/iEjw== dependencies: "@babel/runtime" "7.15.4" +"@player-ui/utils@0.2.0": + version "0.2.0" + resolved "https://registry.yarnpkg.com/@player-ui/utils/-/utils-0.2.0.tgz#a0f8d9b0d3ff365ffbb5e8d1faa08737ab8a3b26" + integrity sha512-4Jt7eKwnuNQT/6rJkJTInO1XrL1P4L//ndRfDPnQq0M2//VD4KVhfKFzmkodQnlHddcUx3KwapJ+F5b+cjrvpw== + dependencies: + "@babel/runtime" "7.15.4" + +"@player-ui/validator@0.2.0": + version "0.2.0" + resolved "https://registry.yarnpkg.com/@player-ui/validator/-/validator-0.2.0.tgz#6e955b30894a692313ce6b35ad69fb60f7f24eb1" + integrity sha512-ETpZXpHtgLn868kkXOAipsn4GBWzko7LLUTCN8a2kb6qNpmI5OtwirHYNLWM07bnpjKEXZ9amdHkKD56iHmiSA== + dependencies: + "@babel/runtime" "7.15.4" + "@player-ui/binding" "0.2.0" + "@player-ui/constants" "0.2.0" + "@player-ui/data" "0.2.0" + "@player-ui/expressions" "0.2.0" + "@player-ui/logger" "0.2.0" + "@player-ui/types" "0.2.0" + tapable-ts "^0.1.0" + timm "^1.6.2" + +"@player-ui/view@0.2.0": + version "0.2.0" + resolved "https://registry.yarnpkg.com/@player-ui/view/-/view-0.2.0.tgz#e118e1d759728251d39a5e21a30e8043943e7b86" + integrity sha512-KaYTGdabtL0wUsINiSNFpEDTgvFnqrc9a4aqhQwDhXq0s+TbaOesYzOMZwQ8KCs4GTnbg9ArOzviitGVBemv9g== + dependencies: + "@babel/runtime" "7.15.4" + "@player-ui/binding" "0.2.0" + "@player-ui/constants" "0.2.0" + "@player-ui/data" "0.2.0" + "@player-ui/expressions" "0.2.0" + "@player-ui/flow" "0.2.0" + "@player-ui/logger" "0.2.0" + "@player-ui/schema" "0.2.0" + "@player-ui/string-resolver" "0.2.0" + "@player-ui/types" "0.2.0" + "@player-ui/validator" "0.2.0" + dequal "^2.0.2" + dlv "^1.1.3" + tapable-ts "^0.1.0" + timm "^1.6.2" + "@popperjs/core@^2.9.3": version "2.11.6" resolved "https://registry.yarnpkg.com/@popperjs/core/-/core-2.11.6.tgz#cee20bd55e68a1720bdab363ecf0c821ded4cd45" @@ -3345,15 +4499,30 @@ prop-types "^15.7.2" tslib "^2.1.0" +"@react-dnd/asap@^5.0.1": + version "5.0.2" + resolved "https://registry.yarnpkg.com/@react-dnd/asap/-/asap-5.0.2.tgz#1f81f124c1cd6f39511c11a881cfb0f715343488" + integrity sha512-WLyfoHvxhs0V9U+GTsGilGgf2QsPl6ZZ44fnv0/b8T3nQyvzxidxsg/ZltbWssbsRDlYW8UKSQMTGotuTotZ6A== + +"@react-dnd/invariant@^4.0.1": + version "4.0.2" + resolved "https://registry.yarnpkg.com/@react-dnd/invariant/-/invariant-4.0.2.tgz#b92edffca10a26466643349fac7cdfb8799769df" + integrity sha512-xKCTqAK/FFauOM9Ta2pswIyT3D8AQlfrYdOi/toTPEhqCuAs1v5tcJ3Y08Izh1cJ5Jchwy9SeAXmMg6zrKs2iw== + +"@react-dnd/shallowequal@^4.0.1": + version "4.0.2" + resolved "https://registry.yarnpkg.com/@react-dnd/shallowequal/-/shallowequal-4.0.2.tgz#d1b4befa423f692fa4abf1c79209702e7d8ae4b4" + integrity sha512-/RVXdLvJxLg4QKvMoM5WlwNR9ViO9z8B/qPcc+C0Sa/teJY7QG7kJ441DwzOjMYEY7GmU4dj5EcGHIkKZiQZCA== + "@reduxjs/toolkit@^1.6.1": - version "1.8.6" - resolved "https://registry.yarnpkg.com/@reduxjs/toolkit/-/toolkit-1.8.6.tgz#147fb7957befcdb75bc9c1230db63628e30e4332" - integrity sha512-4Ia/Loc6WLmdSOzi7k5ff7dLK8CgG2b8aqpLsCAJhazAzGdp//YBUSaj0ceW6a3kDBDNRrq5CRwyCS0wBiL1ig== + version "1.9.0" + resolved "https://registry.yarnpkg.com/@reduxjs/toolkit/-/toolkit-1.9.0.tgz#76b264fcea677d256b18f86cc77e00743a9e02b0" + integrity sha512-ak11IrjYcUXRqlhNPwnz6AcvA2ynJTu8PzDbbqQw4a3xR4KZtgiqbNblQD+10CRbfK4+5C79SOyxnT9dhBqFnA== dependencies: - immer "^9.0.7" - redux "^4.1.2" - redux-thunk "^2.4.1" - reselect "^4.1.5" + immer "^9.0.16" + redux "^4.2.0" + redux-thunk "^2.4.2" + reselect "^4.1.7" "@rollup/plugin-image@^2.1.1": version "2.1.1" @@ -3418,6 +4587,13 @@ dependencies: "@sinonjs/commons" "^1.7.0" +"@swc/helpers@0.4.11": + version "0.4.11" + resolved "https://registry.yarnpkg.com/@swc/helpers/-/helpers-0.4.11.tgz#db23a376761b3d31c26502122f349a21b592c8de" + integrity sha512-rEUrBSGIoSFuYxwBYtlUFMlE2CwGhmW+w9355/5oduSw8e5h2+Tj4UrAGNNgP9915++wj5vkQo0UuOBqOAq4nw== + dependencies: + tslib "^2.4.0" + "@testing-library/dom@^8.0.0", "@testing-library/dom@^8.10.1": version "8.18.1" resolved "https://registry.yarnpkg.com/@testing-library/dom/-/dom-8.18.1.tgz#80f91be02bc171fe5a3a7003f88207be31ac2cf3" @@ -3514,7 +4690,7 @@ resolved "https://registry.yarnpkg.com/@types/aria-query/-/aria-query-4.2.2.tgz#ed4e0ad92306a704f9fb132a0cfcf77486dbe2bc" integrity sha512-HnYpAE1Y6kRyKM/XkEuiRQhTHvkzMBurTHnpFLYLBGPIylZNPs9jJcuOOYWxPLJCSEtmZT0Y8rHDokKN7rRTig== -"@types/babel__core@*", "@types/babel__core@^7.0.0", "@types/babel__core@^7.1.14": +"@types/babel__core@*", "@types/babel__core@^7.0.0", "@types/babel__core@^7.1.12", "@types/babel__core@^7.1.14": version "7.1.19" resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.19.tgz#7b497495b7d1b4812bdb9d02804d0576f43ee460" integrity sha512-WEOTgRsbYkvA/KCsDwVEGkd7WAr1e3g31VHQ8zy5gul/V1qKullU/BU5I68X5v7V3GnB9eotmom4v5a5gjxorw== @@ -3583,6 +4759,11 @@ dependencies: "@types/ms" "*" +"@types/dlv@^1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@types/dlv/-/dlv-1.1.2.tgz#02d4fcc41c5f707753427867c64fdae543031fb9" + integrity sha512-OyiZ3jEKu7RtGO1yp9oOdK0cTwZ/10oE9PDJ6fyN3r9T5wkyOcvr6awdugjYdqF6KVO5eUvt7jx7rk2Eylufow== + "@types/estree@0.0.39": version "0.0.39" resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.39.tgz#e177e699ee1b8c22d23174caaa7422644389509f" @@ -3725,6 +4906,11 @@ resolved "https://registry.yarnpkg.com/@types/ms/-/ms-0.7.31.tgz#31b7ca6407128a3d2bbc27fe2d21b345397f6197" integrity sha512-iiUgKzV9AuaEkZqkOLDIvlQiL6ltuZd9tGcW3gwpnX8JbuiuhFlEGmmFXEXkN50Cvq7Os88IY2v0dkDqXYWVgA== +"@types/nested-error-stacks@^2.1.0": + version "2.1.0" + resolved "https://registry.yarnpkg.com/@types/nested-error-stacks/-/nested-error-stacks-2.1.0.tgz#0e4caf703b874c3c4e6ba74dbc0c6acf88b8ce05" + integrity sha512-7+la7jn6iA603lBgyASoaW5Nk/R5G3+hkJ4Y0gtc9VYHlcixvm/YBV2KV92dTBpeCQJYjpN2owb5jVuKCqxOaA== + "@types/node-fetch@^2.5.12": version "2.6.2" resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.6.2.tgz#d1a9c5fd049d9415dce61571557104dec3ec81da" @@ -3763,6 +4949,11 @@ resolved "https://registry.yarnpkg.com/@types/parse-json/-/parse-json-4.0.0.tgz#2f8bb441434d163b35fb8ffdccd7138927ffb8c0" integrity sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA== +"@types/parsimmon@^1.10.0": + version "1.10.6" + resolved "https://registry.yarnpkg.com/@types/parsimmon/-/parsimmon-1.10.6.tgz#8fcf95990514d2a7624aa5f630c13bf2427f9cdd" + integrity sha512-FwAQwMRbkhx0J6YELkwIpciVzCcgEqXEbIrIn3a2P5d3kGEHQ3wVhlN3YdVepYP+bZzCYO6OjmD4o9TGOZ40rA== + "@types/prettier@^2.1.5": version "2.7.1" resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.7.1.tgz#dfd20e2dc35f027cdd6c1908e80a5ddc7499670e" @@ -3819,7 +5010,7 @@ dependencies: "@types/react" "*" -"@types/react@*", "@types/react@>=16.9.0", "@types/react@^17", "@types/react@^17.0.25": +"@types/react@*", "@types/react@>=16.9.0", "@types/react@^17", "@types/react@^17.0.15", "@types/react@^17.0.25": version "17.0.50" resolved "https://registry.yarnpkg.com/@types/react/-/react-17.0.50.tgz#39abb4f7098f546cfcd6b51207c90c4295ee81fc" integrity sha512-ZCBHzpDb5skMnc1zFXAXnL3l1FAdi+xZvwxK+PkglMmBrwjpp9nKaWuEvrGnSifCJmBFGxZOOFuwC6KH/s0NuA== @@ -4269,6 +5460,16 @@ resolved "https://registry.yarnpkg.com/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz#e77a97fbd345b76d83245edcd17d393b1b41fb31" integrity sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ== +"@zag-js/element-size@0.1.0": + version "0.1.0" + resolved "https://registry.yarnpkg.com/@zag-js/element-size/-/element-size-0.1.0.tgz#dfdb3f66a70328d0c3149aae29b8f99c10590c22" + integrity sha512-QF8wp0+V8++z+FHXiIw93+zudtubYszOtYbNgK39fg3pi+nCZtuSm4L1jC5QZMatNZ83MfOzyNCfgUubapagJQ== + +"@zag-js/focus-visible@0.1.0": + version "0.1.0" + resolved "https://registry.yarnpkg.com/@zag-js/focus-visible/-/focus-visible-0.1.0.tgz#9777bbaff8316d0b3a14a9095631e1494f69dbc7" + integrity sha512-PeaBcTmdZWcFf7n1aM+oiOdZc+sy14qi0emPIeUuGMTjbP0xLGrZu43kdpHnWSXy7/r4Ubp/vlg50MCV8+9Isg== + JSONStream@^1.2.1, JSONStream@^1.3.5: version "1.3.5" resolved "https://registry.yarnpkg.com/JSONStream/-/JSONStream-1.3.5.tgz#3208c1f08d3a4d99261ab64f92302bc15e111ca0" @@ -4866,7 +6067,7 @@ babel-plugin-jest-hoist@^27.5.1: "@types/babel__core" "^7.0.0" "@types/babel__traverse" "^7.0.6" -babel-plugin-macros@^3.1.0: +babel-plugin-macros@^3.0.1, babel-plugin-macros@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/babel-plugin-macros/-/babel-plugin-macros-3.1.0.tgz#9ef6dc74deb934b4db344dc973ee851d148c50c1" integrity sha512-Cg7TFGpIr01vOQNODXOOaGz2NpCU5gl8x1qJFbb6hbZxR7XrcE2vtbAsTAbJ7/xwJtUuJEw8K8Zr/AE0LHlesg== @@ -4899,6 +6100,16 @@ babel-plugin-polyfill-regenerator@^0.4.1: dependencies: "@babel/helper-define-polyfill-provider" "^0.3.3" +babel-plugin-preval@^5.0.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/babel-plugin-preval/-/babel-plugin-preval-5.1.0.tgz#6efb89bf6b97af592cd1400c6df49c0e9e6ab027" + integrity sha512-G5R+xmo5LS41A4UyZjOjV0mp9AvkuCyUOAJ6TOv/jTZS+VKh7L7HUDRcCSOb0YCM/u0fFarh7Diz0wjY8rFNFg== + dependencies: + "@babel/runtime" "^7.12.5" + "@types/babel__core" "^7.1.12" + babel-plugin-macros "^3.0.1" + require-from-string "^2.0.2" + babel-plugin-syntax-trailing-function-commas@^7.0.0-beta.0: version "7.0.0-beta.0" resolved "https://registry.yarnpkg.com/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-7.0.0-beta.0.tgz#aa213c1435e2bffeb6fca842287ef534ad05d5cf" @@ -5442,6 +6653,11 @@ caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001400: resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001414.tgz#5f1715e506e71860b4b07c50060ea6462217611e" integrity sha512-t55jfSaWjCdocnFdKQoO+d2ct9C59UZg4dY3OnUlSZ447r8pUtIKdp0hpAzrGFultmTC+Us+KpKi4GZl/LXlFg== +caniuse-lite@^1.0.30001406: + version "1.0.30001418" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001418.tgz#5f459215192a024c99e3e3a53aac310fc7cf24e6" + integrity sha512-oIs7+JL3K9JRQ3jPZjlH6qyYDp+nBTCais7hjh0s+fuBwufc7uZ7hPYMXrDOJhV360KGMTcczMRObk0/iMqZRg== + capital-case@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/capital-case/-/capital-case-1.0.4.tgz#9d130292353c9249f6b00fa5852bee38a717e669" @@ -5843,7 +7059,7 @@ clsx@1.1.0: resolved "https://registry.yarnpkg.com/clsx/-/clsx-1.1.0.tgz#62937c6adfea771247c34b54d320fb99624f5702" integrity sha512-3avwM37fSK5oP6M5rQ9CNe99lwxhXDOeSWVPAOYF6OazUTgZCMb0yWlJpmdD74REy1gkEaFiub2ULv4fq9GUhA== -clsx@^1.0.4: +clsx@^1.0.4, clsx@^1.1.1: version "1.2.1" resolved "https://registry.yarnpkg.com/clsx/-/clsx-1.2.1.tgz#0ddc4a20a549b59c93a4116bb26f5294ca17dc12" integrity sha512-EcR6r5a8bj6pu3ycsa/E/cKVGuTgZJZdsyUYHOksG/UHIiKfjxzRxYJpyVBwYaQeOvghal9fcc4PidlgzugAQg== @@ -6153,9 +7369,9 @@ copy-to-clipboard@3.3.1: toggle-selection "^1.0.6" copy-to-clipboard@^3.3.2: - version "3.3.2" - resolved "https://registry.yarnpkg.com/copy-to-clipboard/-/copy-to-clipboard-3.3.2.tgz#5b263ec2366224b100181dded7ce0579b340c107" - integrity sha512-Vme1Z6RUDzrb6xAI7EZlVZ5uvOk2F//GaxKUxajDqm9LhOVM1inxNAD2vy+UZDYsd0uyA9s7b3/FVZPSxqrCfg== + version "3.3.3" + resolved "https://registry.yarnpkg.com/copy-to-clipboard/-/copy-to-clipboard-3.3.3.tgz#55ac43a1db8ae639a4bd99511c148cdd1b83a1b0" + integrity sha512-2KV8NhB5JqC3ky0r9PMCAZKbUHSwtEo4CwCs0KXgruG43gX5PMqDEBbVU4OUzw2MuAWUfsuFmWvEKG5QRfSnJA== dependencies: toggle-selection "^1.0.6" @@ -6450,7 +7666,7 @@ csstype@3.0.9: resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.0.9.tgz#6410af31b26bd0520933d02cbc64fce9ce3fbf0b" integrity sha512-rpw6JPxK6Rfg1zLOYCSwle2GFOOsnjmDYDaBwEcwoOg4qlsIVCN789VkBZDJAGi4T07gI4YSutR43t9Zz4Lzuw== -csstype@^3.0.2: +csstype@^3.0.11, csstype@^3.0.2: version "3.1.1" resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.1.1.tgz#841b532c45c758ee546a11d5bd7b7b473c8c30b9" integrity sha512-DJR/VvkAvSZW9bTouZue2sSxDwdTN92uHjqeKVm+0dAqdfNykRzQ95tay8aXMBAAPpUiq4Qcug2L7neoRh2Egw== @@ -6774,6 +7990,20 @@ disparity@^3.1.0: ansi-styles "^4.2.1" diff "^4.0.2" +dlv@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/dlv/-/dlv-1.1.3.tgz#5c198a8a11453596e751494d49874bc7732f2e79" + integrity sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA== + +dnd-core@^16.0.1: + version "16.0.1" + resolved "https://registry.yarnpkg.com/dnd-core/-/dnd-core-16.0.1.tgz#a1c213ed08961f6bd1959a28bb76f1a868360d19" + integrity sha512-HK294sl7tbw6F6IeuK16YSBUoorvHpY8RHO+9yFfaJyCDVb6n7PRcezrOEOa2SBCqiYpemh5Jx20ZcjKdFAVng== + dependencies: + "@react-dnd/asap" "^5.0.1" + "@react-dnd/invariant" "^4.0.1" + redux "^4.2.0" + doctrine@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.1.0.tgz#5cd01fc101621b42c4cd7f5d1a66243716d3f39d" @@ -6902,6 +8132,11 @@ duplicate-package-checker-webpack-plugin@^3.0.0: lodash "^4.17.4" semver "^5.4.1" +ebnf@^1.9.0: + version "1.9.0" + resolved "https://registry.yarnpkg.com/ebnf/-/ebnf-1.9.0.tgz#9c2dd6052f3ed43a69c1f0b07b15bd03cefda764" + integrity sha512-LKK899+j758AgPq00ms+y90mo+2P86fMKUWD28sH0zLKUj7aL6iIH2wy4jejAMM9I2BawJ+2kp6C3mMXj+Ii5g== + ee-first@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" @@ -8259,6 +9494,13 @@ flush-write-stream@^1.0.0, flush-write-stream@^1.0.2: inherits "^2.0.3" readable-stream "^2.3.6" +focus-lock@^0.11.2: + version "0.11.3" + resolved "https://registry.yarnpkg.com/focus-lock/-/focus-lock-0.11.3.tgz#c094e8f109d780f56038abdeec79328fd56b627f" + integrity sha512-4n0pYcPTa/uI7Q66BZna61nRT7lDhnuJ9PJr6wiDjx4uStg491ks41y7uOG+s0umaaa+hulNKSldU9aTg9/yVg== + dependencies: + tslib "^2.0.3" + focus-lock@^0.8.0: version "0.8.1" resolved "https://registry.yarnpkg.com/focus-lock/-/focus-lock-0.8.1.tgz#bb36968abf77a2063fa173cb6c47b12ac8599d33" @@ -9149,11 +10391,16 @@ image-size@^0.6.0: resolved "https://registry.yarnpkg.com/image-size/-/image-size-0.6.3.tgz#e7e5c65bb534bd7cdcedd6cb5166272a85f75fb2" integrity sha512-47xSUiQioGaB96nqtp5/q55m0aBQSQdyIloMOc/x+QVTDZLNmXE892IIDrJ0hM1A5vcNUDD5tDffkSP5lCaIIA== -immer@^9.0.12, immer@^9.0.7: +immer@^9.0.12: version "9.0.15" resolved "https://registry.yarnpkg.com/immer/-/immer-9.0.15.tgz#0b9169e5b1d22137aba7d43f8a81a495dd1b62dc" integrity sha512-2eB/sswms9AEUSkOm4SbV5Y7Vmt/bKRwByd52jfLkW4OLYeaTP3EEiJ9agqU0O/tq6Dk62Zfj+TJSqfm1rLVGQ== +immer@^9.0.16: + version "9.0.16" + resolved "https://registry.yarnpkg.com/immer/-/immer-9.0.16.tgz#8e7caab80118c2b54b37ad43e05758cdefad0198" + integrity sha512-qenGE7CstVm1NrHQbMh8YaSzTZTFNP3zPqr3YU0S0UY441j4bJTg4A2Hh5KAhwgaiU6ZZ1Ar6y/2f4TblnMReQ== + import-cwd@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/import-cwd/-/import-cwd-3.0.0.tgz#20845547718015126ea9b3676b7592fb8bd4cf92" @@ -11750,6 +12997,11 @@ neo-async@^2.5.0, neo-async@^2.6.1: resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.2.tgz#b4aafb93e3aeb2d8174ca53cf163ab7d7308305f" integrity sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw== +nested-error-stacks@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/nested-error-stacks/-/nested-error-stacks-2.1.1.tgz#26c8a3cee6cc05fbcf1e333cd2fc3e003326c0b5" + integrity sha512-9iN1ka/9zmX1ZvLV9ewJYEk9h7RyRRtqdK0woXcqohu8EWIerfPUjYJPg0ULy0UqP7cslmdGc8xKDJcojlKiaw== + nested-error-stacks@~2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/nested-error-stacks/-/nested-error-stacks-2.0.1.tgz#d2cc9fc5235ddb371fc44d506234339c8e4b0a4b" @@ -11763,6 +13015,32 @@ netrc-parser@^3.1.6: debug "^3.1.0" execa "^0.10.0" +next@^12.0.7: + version "12.3.1" + resolved "https://registry.yarnpkg.com/next/-/next-12.3.1.tgz#127b825ad2207faf869b33393ec8c75fe61e50f1" + integrity sha512-l7bvmSeIwX5lp07WtIiP9u2ytZMv7jIeB8iacR28PuUEFG5j0HGAPnMqyG5kbZNBG2H7tRsrQ4HCjuMOPnANZw== + dependencies: + "@next/env" "12.3.1" + "@swc/helpers" "0.4.11" + caniuse-lite "^1.0.30001406" + postcss "8.4.14" + styled-jsx "5.0.7" + use-sync-external-store "1.2.0" + optionalDependencies: + "@next/swc-android-arm-eabi" "12.3.1" + "@next/swc-android-arm64" "12.3.1" + "@next/swc-darwin-arm64" "12.3.1" + "@next/swc-darwin-x64" "12.3.1" + "@next/swc-freebsd-x64" "12.3.1" + "@next/swc-linux-arm-gnueabihf" "12.3.1" + "@next/swc-linux-arm64-gnu" "12.3.1" + "@next/swc-linux-arm64-musl" "12.3.1" + "@next/swc-linux-x64-gnu" "12.3.1" + "@next/swc-linux-x64-musl" "12.3.1" + "@next/swc-win32-arm64-msvc" "12.3.1" + "@next/swc-win32-ia32-msvc" "12.3.1" + "@next/swc-win32-x64-msvc" "12.3.1" + nice-try@^1.0.4: version "1.0.5" resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" @@ -12279,6 +13557,11 @@ osenv@^0.1.3: os-homedir "^1.0.0" os-tmpdir "^1.0.0" +p-defer@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/p-defer/-/p-defer-3.0.0.tgz#d1dceb4ee9b2b604b1d94ffec83760175d4e6f83" + integrity sha512-ugZxsxmtTln604yeYd29EGrNhazN2lywetzpKhfmQjW/VJmhpDmWbiX+h0zL8V91R0UXkhb3KtPmyq9PZw3aYw== + p-filter@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/p-filter/-/p-filter-2.1.0.tgz#1b1472562ae7a0f742f0f3d3d3718ea66ff9c09c" @@ -12562,6 +13845,11 @@ parseurl@~1.3.3: resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4" integrity sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ== +parsimmon@^1.12.0: + version "1.18.1" + resolved "https://registry.yarnpkg.com/parsimmon/-/parsimmon-1.18.1.tgz#d8dd9c28745647d02fc6566f217690897eed7709" + integrity sha512-u7p959wLfGAhJpSDJVYXoyMCXWYwHia78HhRBWqk7AIbxdmlrfdp5wX0l3xv/iTSH5HvhN9K7o26hwwpgS5Nmw== + pascal-case@^3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/pascal-case/-/pascal-case-3.1.2.tgz#b48e0ef2b98e205e7c1dae747d0b1508237660eb" @@ -13050,6 +14338,15 @@ postcss-value-parser@^4.1.0, postcss-value-parser@^4.2.0: resolved "https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz#723c09920836ba6d3e5af019f92bc0971c02e514" integrity sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ== +postcss@8.4.14: + version "8.4.14" + resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.14.tgz#ee9274d5622b4858c1007a74d76e42e56fd21caf" + integrity sha512-E398TUmfAYFPBSdzgeieK2Y1+1cpdxJx8yXbK/m57nRhKSmk1GB2tO4lbLBtlkfPQTDKfe4Xqv1ASWPpayPEig== + dependencies: + nanoid "^3.3.4" + picocolors "^1.0.0" + source-map-js "^1.0.2" + postcss@^7.0.14, postcss@^7.0.32, postcss@^7.0.5, postcss@^7.0.6: version "7.0.39" resolved "https://registry.yarnpkg.com/postcss/-/postcss-7.0.39.tgz#9624375d965630e2e1f2c02a935c82a59cb48309" @@ -13361,7 +14658,7 @@ querystringify@^2.1.1: resolved "https://registry.yarnpkg.com/querystringify/-/querystringify-2.2.0.tgz#3345941b4153cb9d082d8eee4cda2016a9aef7f6" integrity sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ== -queue-microtask@^1.2.2: +queue-microtask@^1.2.2, queue-microtask@^1.2.3: version "1.2.3" resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== @@ -13391,7 +14688,7 @@ rc@^1.2.7, rc@^1.2.8, rc@~1.2.7: minimist "^1.2.0" strip-json-comments "~2.0.1" -react-clientside-effect@^1.2.5: +react-clientside-effect@^1.2.5, react-clientside-effect@^1.2.6: version "1.2.6" resolved "https://registry.yarnpkg.com/react-clientside-effect/-/react-clientside-effect-1.2.6.tgz#29f9b14e944a376b03fb650eed2a754dd128ea3a" integrity sha512-XGGGRQAKY+q25Lz9a/4EPqom7WRjz3z9R2k4jhVKA/puQFH/5Nt27vFZYql4m4NVNdUvX8PS3O7r/Zzm7cjUlg== @@ -13411,19 +14708,36 @@ react-color@^2.19.3: reactcss "^1.2.0" tinycolor2 "^1.4.1" +react-dnd-html5-backend@^16.0.1: + version "16.0.1" + resolved "https://registry.yarnpkg.com/react-dnd-html5-backend/-/react-dnd-html5-backend-16.0.1.tgz#87faef15845d512a23b3c08d29ecfd34871688b6" + integrity sha512-Wu3dw5aDJmOGw8WjH1I1/yTH+vlXEL4vmjk5p+MHxP8HuHJS1lAGeIdG/hze1AvNeXWo/JgULV87LyQOr+r5jw== + dependencies: + dnd-core "^16.0.1" + +react-dnd@^16.0.1: + version "16.0.1" + resolved "https://registry.yarnpkg.com/react-dnd/-/react-dnd-16.0.1.tgz#2442a3ec67892c60d40a1559eef45498ba26fa37" + integrity sha512-QeoM/i73HHu2XF9aKksIUuamHPDvRglEwdHL4jsp784BgUuWcg6mzfxT0QDdQz8Wj0qyRKx2eMg8iZtWvU4E2Q== + dependencies: + "@react-dnd/invariant" "^4.0.1" + "@react-dnd/shallowequal" "^4.0.1" + dnd-core "^16.0.1" + fast-deep-equal "^3.1.3" + hoist-non-react-statics "^3.3.2" + react-docgen-typescript@^2.1.1: version "2.2.2" resolved "https://registry.yarnpkg.com/react-docgen-typescript/-/react-docgen-typescript-2.2.2.tgz#4611055e569edc071204aadb20e1c93e1ab1659c" integrity sha512-tvg2ZtOpOi6QDwsb3GZhOjDkkX0h8Z2gipvTg6OVMUyoYoURhEiRNePT8NZItTVCDh39JJHnLdfCOkzoLbFnTg== -react-dom@^17.0.2: - version "17.0.2" - resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-17.0.2.tgz#ecffb6845e3ad8dbfcdc498f0d0a939736502c23" - integrity sha512-s4h96KtLDUQlsENhMn1ar8t2bEa+q/YAtj8pPPdIjPDGBDIVNsrD9aXNWqspUe6AzKCIG0C1HZZLqLV7qpOBGA== +react-dom@^18.2.0: + version "18.2.0" + resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-18.2.0.tgz#22aaf38708db2674ed9ada224ca4aa708d821e3d" + integrity sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g== dependencies: loose-envify "^1.1.0" - object-assign "^4.1.1" - scheduler "^0.20.2" + scheduler "^0.23.0" react-element-to-jsx-string@^14.3.4: version "14.3.4" @@ -13472,6 +14786,18 @@ react-focus-lock@2.5.2: use-callback-ref "^1.2.5" use-sidecar "^1.0.5" +react-focus-lock@^2.9.1: + version "2.9.1" + resolved "https://registry.yarnpkg.com/react-focus-lock/-/react-focus-lock-2.9.1.tgz#094cfc19b4f334122c73bb0bff65d77a0c92dd16" + integrity sha512-pSWOQrUmiKLkffPO6BpMXN7SNKXMsuOakl652IBuALAu1esk+IcpJyM+ALcYzPTTFz1rD0R54aB9A4HuP5t1Wg== + dependencies: + "@babel/runtime" "^7.0.0" + focus-lock "^0.11.2" + prop-types "^15.6.2" + react-clientside-effect "^1.2.6" + use-callback-ref "^1.3.0" + use-sidecar "^1.1.2" + react-icons@^4.3.1: version "4.4.0" resolved "https://registry.yarnpkg.com/react-icons/-/react-icons-4.4.0.tgz#a13a8a20c254854e1ec9aecef28a95cdf24ef703" @@ -13534,7 +14860,7 @@ react-refresh@^0.4.0: resolved "https://registry.yarnpkg.com/react-refresh/-/react-refresh-0.4.3.tgz#966f1750c191672e76e16c2efa569150cc73ab53" integrity sha512-Hwln1VNuGl/6bVwnd0Xdn1e84gT/8T9aYNL+HAKDArLCS7LWjwr7StE30IEYbIkx0Vi3vs+coQxe+SQDbGbbpA== -react-remove-scroll-bar@^2.1.0: +react-remove-scroll-bar@^2.1.0, react-remove-scroll-bar@^2.3.3: version "2.3.4" resolved "https://registry.yarnpkg.com/react-remove-scroll-bar/-/react-remove-scroll-bar-2.3.4.tgz#53e272d7a5cb8242990c7f144c44d8bd8ab5afd9" integrity sha512-63C4YQBUt0m6ALadE9XV56hV8BgJWDmmTPY758iIJjfQKt2nYwoUrPk0LXRXcB/yIj82T1/Ixfdpdk68LwIB0A== @@ -13553,6 +14879,17 @@ react-remove-scroll@2.4.1: use-callback-ref "^1.2.3" use-sidecar "^1.0.1" +react-remove-scroll@^2.5.4: + version "2.5.5" + resolved "https://registry.yarnpkg.com/react-remove-scroll/-/react-remove-scroll-2.5.5.tgz#1e31a1260df08887a8a0e46d09271b52b3a37e77" + integrity sha512-ImKhrzJJsyXJfBZ4bzu8Bwpka14c/fQt0k+cyFp/PBhTfyDnU5hjOtM4AG/0AMyy8oKzOTR0lDgJIM7pYXI0kw== + dependencies: + react-remove-scroll-bar "^2.3.3" + react-style-singleton "^2.2.1" + tslib "^2.1.0" + use-callback-ref "^1.3.0" + use-sidecar "^1.1.2" + react-split@^2.0.14: version "2.0.14" resolved "https://registry.yarnpkg.com/react-split/-/react-split-2.0.14.tgz#ef198259bf43264d605f792fb3384f15f5b34432" @@ -13589,20 +14926,19 @@ react-virtual@^2.10.4: "@reach/observe-rect" "^1.1.0" react-window@^1: - version "1.8.7" - resolved "https://registry.yarnpkg.com/react-window/-/react-window-1.8.7.tgz#5e9fd0d23f48f432d7022cdb327219353a15f0d4" - integrity sha512-JHEZbPXBpKMmoNO1bNhoXOOLg/ujhL/BU4IqVU9r8eQPcy5KQnGHIHDRkJ0ns9IM5+Aq5LNwt3j8t3tIrePQzA== + version "1.8.8" + resolved "https://registry.yarnpkg.com/react-window/-/react-window-1.8.8.tgz#1b52919f009ddf91970cbdb2050a6c7be44df243" + integrity sha512-D4IiBeRtGXziZ1n0XklnFGu7h9gU684zepqyKzgPNzrsrk7xOCxni+TCckjg2Nr/DiaEEGVVmnhYSlT2rB47dQ== dependencies: "@babel/runtime" "^7.0.0" memoize-one ">=3.1.1 <6" -react@^17.0.2: - version "17.0.2" - resolved "https://registry.yarnpkg.com/react/-/react-17.0.2.tgz#d0b5cc516d29eb3eee383f75b62864cfb6800037" - integrity sha512-gnhPt75i/dq/z3/6q/0asP78D0u592D5L1pd7M8P+dck6Fu/jJeL6iVVK23fptSUZj8Vjf++7wXA8UNclGQcbA== +react@^18.2.0: + version "18.2.0" + resolved "https://registry.yarnpkg.com/react/-/react-18.2.0.tgz#555bd98592883255fa00de14f1151a917b5d77d5" + integrity sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ== dependencies: loose-envify "^1.1.0" - object-assign "^4.1.1" reactcss@^1.2.0: version "1.2.3" @@ -13752,12 +15088,12 @@ reduce-flatten@^2.0.0: resolved "https://registry.yarnpkg.com/reduce-flatten/-/reduce-flatten-2.0.0.tgz#734fd84e65f375d7ca4465c69798c25c9d10ae27" integrity sha512-EJ4UNY/U1t2P/2k6oqotuX2Cc3T6nxJwsM0N0asT7dhrtH1ltUxDn4NalSYmPE2rCkVpcf/X6R0wDwcFpzhd4w== -redux-thunk@^2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/redux-thunk/-/redux-thunk-2.4.1.tgz#0dd8042cf47868f4b29699941de03c9301a75714" - integrity sha512-OOYGNY5Jy2TWvTL1KgAlVy6dcx3siPJ1wTq741EPyUKfn6W6nChdICjZwCd0p8AZBs5kWpZlbkXW2nE/zjUa+Q== +redux-thunk@^2.4.2: + version "2.4.2" + resolved "https://registry.yarnpkg.com/redux-thunk/-/redux-thunk-2.4.2.tgz#b9d05d11994b99f7a91ea223e8b04cf0afa5ef3b" + integrity sha512-+P3TjtnP0k/FEjcBL5FZpoovtvrTNT/UXd4/sluaSyrURlSlhLSzEdfsTBW7WsKB6yPvgd7q/iZPICFjW4o57Q== -redux@^4.0.0, redux@^4.1.2: +redux@^4.0.0, redux@^4.1.2, redux@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/redux/-/redux-4.2.0.tgz#46f10d6e29b6666df758780437651eeb2b969f13" integrity sha512-oSBmcKKIuIR4ME29/AeNUnl5L+hvBq7OaJWzaptTQJAntaPvxIJqfnjbaEiCzzaIz+XmVILfqAM3Ob0aXLPfjA== @@ -13785,6 +15121,11 @@ regenerate@^1.4.2: resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.4.2.tgz#b9346d8827e8f5a32f7ba29637d398b69014848a" integrity sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A== +regenerator-runtime@^0.13.10: + version "0.13.11" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz#f6dca3e7ceec20590d07ada785636a90cdca17f9" + integrity sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg== + regenerator-runtime@^0.13.2: version "0.13.10" resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.10.tgz#ed07b19616bcbec5da6274ebc75ae95634bfc2ee" @@ -13907,6 +15248,11 @@ require-directory@^2.1.1: resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q== +require-from-string@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" + integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw== + require-main-filename@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b" @@ -13931,10 +15277,10 @@ requires-port@^1.0.0: resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff" integrity sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ== -reselect@^4.1.5: - version "4.1.6" - resolved "https://registry.yarnpkg.com/reselect/-/reselect-4.1.6.tgz#19ca2d3d0b35373a74dc1c98692cdaffb6602656" - integrity sha512-ZovIuXqto7elwnxyXbBtCPo9YFEr3uJqj2rRbcOOog1bmu2Ag85M4hixSwFWyaBMKXNgvPaJ9OSu9SkBPIeJHQ== +reselect@^4.1.7: + version "4.1.7" + resolved "https://registry.yarnpkg.com/reselect/-/reselect-4.1.7.tgz#56480d9ff3d3188970ee2b76527bd94a95567a42" + integrity sha512-Zu1xbUt3/OPwsXL46hvOOoQrap2azE7ZQbokq61BQfiXvhewsKDwhMeZjTX9sX0nvw1t/U5Audyn1I9P/m9z0A== resize-observer-polyfill@^1.5.1: version "1.5.1" @@ -14229,6 +15575,13 @@ scheduler@^0.20.2: loose-envify "^1.1.0" object-assign "^4.1.1" +scheduler@^0.23.0: + version "0.23.0" + resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.23.0.tgz#ba8041afc3d30eb206a487b6b384002e4e61fdfe" + integrity sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw== + dependencies: + loose-envify "^1.1.0" + schema-utils@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-1.0.0.tgz#0b79a93204d7b600d4b2850d1f66c2a34951c770" @@ -14559,6 +15912,11 @@ sort-keys@^4.0.0, sort-keys@^4.2.0: dependencies: is-plain-obj "^2.0.0" +sorted-array@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/sorted-array/-/sorted-array-2.0.4.tgz#5d62bbfe64d1bde3cf4b6b79530a6feb95afb5ae" + integrity sha512-58INzrX0rL6ttCfsGoFmOuQY5AjR6A5E/MmGKJ5JvWHOey6gOEOC6vO8K6C0Y2bQR6KJ8o8aFwHjp/mJ/HcYsQ== + source-list-map@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-2.0.1.tgz#3993bd873bfc48479cca9ea3a547835c7c154b34" @@ -14997,6 +16355,11 @@ style-value-types@4.1.4: hey-listen "^1.0.8" tslib "^2.1.0" +styled-jsx@5.0.7: + version "5.0.7" + resolved "https://registry.yarnpkg.com/styled-jsx/-/styled-jsx-5.0.7.tgz#be44afc53771b983769ac654d355ca8d019dff48" + integrity sha512-b3sUzamS086YLRuvnaDigdAewz1/EFYlHpYBP5mZovKEdQQOIIYq8lApylub3HHZ6xFjV051kkGU7cudJmrXEA== + stylehacks@^5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/stylehacks/-/stylehacks-5.1.0.tgz#a40066490ca0caca04e96c6b02153ddc39913520" @@ -15010,6 +16373,11 @@ stylis@4.0.13: resolved "https://registry.yarnpkg.com/stylis/-/stylis-4.0.13.tgz#f5db332e376d13cc84ecfe5dace9a2a51d954c91" integrity sha512-xGPXiFVl4YED9Jh7Euv2V220mriG9u4B2TA6Ybjc1catrstKD2PpIdU3U0RKpkVBC2EhmL/F0sPCr9vrFTNRag== +stylis@4.1.3: + version "4.1.3" + resolved "https://registry.yarnpkg.com/stylis/-/stylis-4.1.3.tgz#fd2fbe79f5fed17c55269e16ed8da14c84d069f7" + integrity sha512-GP6WDNWf+o403jrEp9c5jibKavrtLW+/qYGhFxFrG8maXhwTBI7gLLhiBb0o7uFccWN+EOS9aMO6cGHWAO07OA== + supports-color@8.1.1, supports-color@^8.0.0, supports-color@^8.1.0, supports-color@^8.1.1: version "8.1.1" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" @@ -15278,7 +16646,7 @@ timers-browserify@^2.0.4: dependencies: setimmediate "^1.0.4" -timm@^1.7.1: +timm@^1.6.2, timm@^1.7.1: version "1.7.1" resolved "https://registry.yarnpkg.com/timm/-/timm-1.7.1.tgz#96bab60c7d45b5a10a8a4d0f0117c6b7e5aff76f" integrity sha512-IjZc9KIotudix8bMaBW6QvMuq64BrJWFs1+4V0lXwWGQZwH+LnX87doAYhem4caOEusRP9/g6jVDQmZ8XOk1nw== @@ -15490,7 +16858,7 @@ tslib@^1, tslib@^1.0.0, tslib@^1.14.1, tslib@^1.8.1, tslib@^1.9.0, tslib@^1.9.3: resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== -tslib@^2, tslib@^2.0.0, tslib@^2.0.3, tslib@^2.1.0, tslib@^2.3.1: +tslib@^2, tslib@^2.0.0, tslib@^2.0.3, tslib@^2.1.0, tslib@^2.3.1, tslib@^2.4.0: version "2.4.0" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.0.tgz#7cecaa7f073ce680a05847aa77be941098f36dc3" integrity sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ== @@ -15820,7 +17188,7 @@ url@^0.11.0: punycode "1.3.2" querystring "0.2.0" -use-callback-ref@^1.2.3, use-callback-ref@^1.2.5: +use-callback-ref@^1.2.3, use-callback-ref@^1.2.5, use-callback-ref@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/use-callback-ref/-/use-callback-ref-1.3.0.tgz#772199899b9c9a50526fedc4993fc7fa1f7e32d5" integrity sha512-3FT9PRuRdbB9HfXhEq35u4oZkvpJ5kuYbpqhCfmiZyReuRgpnhDlbr2ZEnnuS0RrJAPn6l23xjFg9kpDM+Ms7w== @@ -15834,7 +17202,7 @@ use-resize-observer@6.1.0: dependencies: resize-observer-polyfill "^1.5.1" -use-sidecar@^1.0.1, use-sidecar@^1.0.5: +use-sidecar@^1.0.1, use-sidecar@^1.0.5, use-sidecar@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/use-sidecar/-/use-sidecar-1.1.2.tgz#2f43126ba2d7d7e117aa5855e5d8f0276dfe73c2" integrity sha512-epTbsLuzZ7lPClpz2TyryBfztm7m+28DlEv2ZCQ3MDr5ssiwyOwGH/e5F9CkfWjJ1t4clvI58yF822/GUkjjhw== @@ -15842,6 +17210,11 @@ use-sidecar@^1.0.1, use-sidecar@^1.0.5: detect-node-es "^1.1.0" tslib "^2.0.0" +use-sync-external-store@1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/use-sync-external-store/-/use-sync-external-store-1.2.0.tgz#7dbefd6ef3fe4e767a0cf5d7287aacfb5846928a" + integrity sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA== + use@^3.1.0: version "3.1.1" resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" From 8ab70a3ad944145355829a3fd719e9cd6dfbaaee Mon Sep 17 00:00:00 2001 From: Adam Dierkens Date: Tue, 8 Nov 2022 14:05:26 -0800 Subject: [PATCH 02/52] Save state --- .github/workflows/release.yml | 39 ----- .github/workflows/tag.yml | 19 --- drag-and-drop/app/pages/index.tsx | 140 ++++++++++++++++-- drag-and-drop/library/src/controller.tsx | 23 ++- drag-and-drop/library/src/hooks/index.ts | 2 + .../library/src/hooks/useDraggableAsset.tsx | 17 +++ .../library/src/hooks/useDroppableAsset.tsx | 25 ++++ drag-and-drop/library/src/index.tsx | 1 + drag-and-drop/library/src/types.ts | 10 +- .../library/src/utils/drop-component.tsx | 37 +++-- .../library/src/utils/player-dnd-plugin.ts | 1 + .../library/src/utils/runtime-flow-state.ts | 61 +++++--- 12 files changed, 259 insertions(+), 116 deletions(-) delete mode 100644 .github/workflows/release.yml delete mode 100644 .github/workflows/tag.yml create mode 100644 drag-and-drop/library/src/hooks/useDraggableAsset.tsx create mode 100644 drag-and-drop/library/src/hooks/useDroppableAsset.tsx diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 764592fa..00000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: Release - -on: - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -jobs: - trigger-release: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Branch name - run: echo running on branch ${GITHUB_REF##*/} - - - name: Create and checkout release branch - run: | - git config --global user.email "opensource-svc@intuit.com" - git config --global user.name "intuit-svc" - git checkout -b release-${GITHUB_REF##*/} - git commit --allow-empty -m "Release ${GITHUB_REF##*/}" - echo "SOURCE_RELEASE_BRANCH=release-${GITHUB_REF##*/}" >> $GITHUB_ENV - git push origin release-${GITHUB_REF##*/} - - - name: create-pr - id: open-pr - uses: repo-sync/pull-request@v2 - with: - source_branch: ${{ env.SOURCE_RELEASE_BRANCH }} - destination_branch: "main" - pr_allow_empty: true - pr_title: "Release ${GITHUB_REF##*/}" - pr_label: "release" - github_token: ${{ secrets.GH_TOKEN }} - - - name: Merge release PR - uses: sudo-bot/action-pull-request-merge@v1.1.1 - with: - github-token: ${{ secrets.GH_TOKEN }} - number: ${{ steps.open-pr.outputs.pr_number }} \ No newline at end of file diff --git a/.github/workflows/tag.yml b/.github/workflows/tag.yml deleted file mode 100644 index 8f7aa77d..00000000 --- a/.github/workflows/tag.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: Tag - -on: - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - inputs: - version: - description: 'Define env name' - required: true - default: 'v0.0.0' -jobs: - create-tag: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: rickstaa/action-create-tag@v1 - with: - tag: "${{ github.event.inputs.version }}" - message: "Latest release" diff --git a/drag-and-drop/app/pages/index.tsx b/drag-and-drop/app/pages/index.tsx index 90832907..ef24380d 100644 --- a/drag-and-drop/app/pages/index.tsx +++ b/drag-and-drop/app/pages/index.tsx @@ -1,12 +1,74 @@ import React from 'react'; -import { ChakraProvider } from '@chakra-ui/react'; -import type { DragAndDropControllerOptions } from '@player-tools/dnd-lib'; -import { DragAndDropController } from '@player-tools/dnd-lib'; -import { useDragAndDrop } from '@player-tools/dnd-lib'; +import { + ChakraProvider, + Box, + Heading, + Flex, + Tag, + Text, +} from '@chakra-ui/react'; +import type { + DragAndDropControllerOptions, + ExtensionProviderAssetIdentifier, + TransformedDropTargetAssetType, +} from '@player-tools/dnd-lib'; +import { Asset } from '@player-ui/react-asset'; +import { + DragAndDropController, + useDroppableAsset, + useDraggableAsset, +} from '@player-tools/dnd-lib'; import { ReferenceAssetsPlugin } from '@player-ui/reference-assets-plugin-react'; import manifest from '@player-tools/static-xlrs/static_xlrs/plugin/xlr/manifest'; +const PropertiesContext = React.createContext<{ + displayedAssetID?: string; + setDisplayedAssetID: (id: string) => void; +}>({ + setDisplayedAssetID: () => {}, +}); + +const AssetDropTarget = (props: TransformedDropTargetAssetType) => { + const [{ isOver }, drop] = useDroppableAsset(props); + const propContext = React.useContext(PropertiesContext); + + if (!props.value && !props.context) { + return ( + + Please Select an Asset + + ); + } + + return ( + { + if (props.value) { + propContext.setDisplayedAssetID(props.value.asset.id); + e.stopPropagation(); + } + }} + > + {props.value ? ( + + ) : ( + + {props.context?.parent.name} - {props.context?.propertyName} + + )} + + ); +}; + const config: DragAndDropControllerOptions = { + Component: AssetDropTarget, extensions: [ { plugin: ReferenceAssetsPlugin, @@ -17,15 +79,71 @@ const config: DragAndDropControllerOptions = { const controller = new DragAndDropController(config); +const DroppableAsset = (props: ExtensionProviderAssetIdentifier) => { + const [, ref] = useDraggableAsset(props) ?? []; + return ( + + {props.name} + + ); +}; + +const AssetSelectorPanel = () => { + return ( + + + Asset Selector Panel + + + {controller.getAvailableAssets().map((asset) => { + return ( + + + + ); + })} + + ); +}; + +const AssetDetailsPanel = () => { + const propContext = React.useContext(PropertiesContext); + + return ( + + Properties + + {propContext.displayedAssetID ?? 'Select an asset'} + + ); +}; + const App = () => { + const [displayedAssetID, setDisplayedAssetID] = React.useState(); + return ( - - -
- -
-
-
+ + + + + + + + + + + + + + + + + ); }; diff --git a/drag-and-drop/library/src/controller.tsx b/drag-and-drop/library/src/controller.tsx index c01f2870..a35fd1bb 100644 --- a/drag-and-drop/library/src/controller.tsx +++ b/drag-and-drop/library/src/controller.tsx @@ -8,6 +8,7 @@ import { PlayerDndPlugin } from './utils'; import type { DropTargetAssetType, ExtensionProvider, + ExtensionProviderAssetIdentifier, TransformedDropTargetAssetType, } from './types'; import { isDropTargetAsset } from './types'; @@ -31,6 +32,17 @@ export class DragAndDropController { return this.webPlayer.Component; } + public getAvailableAssets(): Array { + return (this.options.extensions ?? []).flatMap((extension) => { + return (extension.manifest.capabilities?.Assets ?? []).map((asset) => { + return { + pluginName: extension.manifest.pluginName, + name: asset.name, + }; + }); + }); + } + public Context: React.ComponentType>; constructor(options?: DragAndDropControllerOptions) { @@ -63,7 +75,11 @@ export class DragAndDropController { }); this.webPlayer = new WebPlayer({ - plugins: [this.dndWebPlayerPlugin], + plugins: [ + this.dndWebPlayerPlugin, + // eslint-disable-next-line new-cap + ...(options?.extensions ?? []).map((e) => new e.plugin()), + ], }); this.webPlayer.player.logger.addHandler(new ConsoleLogger('debug')); @@ -75,6 +91,11 @@ export class DragAndDropController { this.webPlayer.start(this.runtimeState.flow); } + setProperties(id: string, properties: Record) { + this.runtimeState.setProperties(id, properties); + this.dndWebPlayerPlugin.refresh(this.webPlayer.player); + } + exportView(): View { const baseView = this.runtimeState.view; diff --git a/drag-and-drop/library/src/hooks/index.ts b/drag-and-drop/library/src/hooks/index.ts index 31c4e2f1..f5ed1d66 100644 --- a/drag-and-drop/library/src/hooks/index.ts +++ b/drag-and-drop/library/src/hooks/index.ts @@ -1 +1,3 @@ export * from './useDragAndDrop'; +export * from './useDraggableAsset'; +export * from './useDroppableAsset'; diff --git a/drag-and-drop/library/src/hooks/useDraggableAsset.tsx b/drag-and-drop/library/src/hooks/useDraggableAsset.tsx new file mode 100644 index 00000000..88b2b8e2 --- /dev/null +++ b/drag-and-drop/library/src/hooks/useDraggableAsset.tsx @@ -0,0 +1,17 @@ +import { useDrag } from 'react-dnd'; +import { DroppedItemTypes } from '../types'; +import type { ExtensionProviderAssetIdentifier } from '../types'; + +export const useDraggableAsset = ( + identifier: ExtensionProviderAssetIdentifier +) => { + const [p, ref] = useDrag(() => ({ + type: DroppedItemTypes.ASSET, + item: identifier, + collect: (m) => ({ + isDragging: m.isDragging(), + }), + })); + + return [p, ref] as const; +}; diff --git a/drag-and-drop/library/src/hooks/useDroppableAsset.tsx b/drag-and-drop/library/src/hooks/useDroppableAsset.tsx new file mode 100644 index 00000000..a3436f39 --- /dev/null +++ b/drag-and-drop/library/src/hooks/useDroppableAsset.tsx @@ -0,0 +1,25 @@ +import { useDrop } from 'react-dnd'; +import type { + ExtensionProviderAssetIdentifier, + TransformedDropTargetAssetType, +} from '../types'; +import { DroppedItemTypes } from '../types'; + +export const useDroppableAsset = (props: TransformedDropTargetAssetType) => { + const [p, ref] = useDrop({ + accept: DroppedItemTypes.ASSET, + drop: (item: ExtensionProviderAssetIdentifier, monitor) => { + if (monitor.didDrop()) { + return; + } + + props.replaceAsset(item); + }, + collect: (monitor) => ({ + isOver: monitor.isOver(), + canDrop: monitor.canDrop(), + }), + }); + + return [p, ref] as const; +}; diff --git a/drag-and-drop/library/src/index.tsx b/drag-and-drop/library/src/index.tsx index e24b54ec..31448df8 100644 --- a/drag-and-drop/library/src/index.tsx +++ b/drag-and-drop/library/src/index.tsx @@ -1,3 +1,4 @@ export * from './utils'; export * from './hooks'; export * from './controller'; +export * from './types'; diff --git a/drag-and-drop/library/src/types.ts b/drag-and-drop/library/src/types.ts index b5aff062..e66d5f0f 100644 --- a/drag-and-drop/library/src/types.ts +++ b/drag-and-drop/library/src/types.ts @@ -1,17 +1,11 @@ import type { ObjectType, TSManifest } from '@player-tools/xlr'; -import type { - Asset, - WebPlayerPlugin, - Flow, - View, - AssetWrapper, -} from '@player-ui/react'; +import type { Asset, WebPlayerPlugin, Flow, View } from '@player-ui/react'; export const DroppedItemTypes = { ASSET: 'ASSET', }; -export const DragAndDropAssetType = Symbol('DragAndDropAssetType'); +export const DragAndDropAssetType = 'test'; export type FlowWithOneView = Flow & { views: [View]; diff --git a/drag-and-drop/library/src/utils/drop-component.tsx b/drag-and-drop/library/src/utils/drop-component.tsx index 2f086dc3..a82b02e4 100644 --- a/drag-and-drop/library/src/utils/drop-component.tsx +++ b/drag-and-drop/library/src/utils/drop-component.tsx @@ -1,31 +1,28 @@ import React from 'react'; -import { useDrop } from 'react-dnd'; import { Asset } from '@player-ui/react-asset'; -import { DroppedItemTypes } from '../types'; -import type { - TransformedDropTargetAssetType, - ExtensionProviderAssetIdentifier, -} from '../types'; +import type { TransformedDropTargetAssetType } from '../types'; +import { useDroppableAsset } from '../hooks'; export const DropComponent = (props: TransformedDropTargetAssetType) => { - const [{ isOver }, drop] = useDrop({ - accept: DroppedItemTypes.ASSET, - drop: (item: ExtensionProviderAssetIdentifier) => { - props.replaceAsset(item); - }, - collect: (monitor) => ({ - isOver: monitor.isOver(), - canDrop: monitor.canDrop(), - }), - }); + const [{ isOver }, drop] = useDroppableAsset(props); - if (props.value) { + if (!props.value && !props.context) { return ( -
- +
+ Please Select an Asset
); } - return
Test
; + return ( +
+ {props.value ? ( + + ) : ( + + {props.context?.parent.name} - {props.context?.propertyName} + + )} +
+ ); }; diff --git a/drag-and-drop/library/src/utils/player-dnd-plugin.ts b/drag-and-drop/library/src/utils/player-dnd-plugin.ts index 39d26fe8..6903bb22 100644 --- a/drag-and-drop/library/src/utils/player-dnd-plugin.ts +++ b/drag-and-drop/library/src/utils/player-dnd-plugin.ts @@ -103,6 +103,7 @@ export class PlayerDndPlugin implements WebPlayerPlugin { player.hooks.viewController.tap(this.name, (vc: ViewController) => { vc.hooks.resolveView.tap(this.name, () => { + console.log(`Current View`, this.options.state.view); return this.options.state.view; }); }); diff --git a/drag-and-drop/library/src/utils/runtime-flow-state.ts b/drag-and-drop/library/src/utils/runtime-flow-state.ts index 2cf8725d..f86e0478 100644 --- a/drag-and-drop/library/src/utils/runtime-flow-state.ts +++ b/drag-and-drop/library/src/utils/runtime-flow-state.ts @@ -37,6 +37,22 @@ export class RuntimeFlowState { }; } + setProperties(id: string, properties: Record) { + const asset = this.assetMappings[id]; + if (!asset) { + throw new Error(`Cannot set asset value for unknown id: ${id}`); + } + + if (!asset.value) { + throw new Error(`Cannot set properties on asset without a value`); + } + + asset.value.asset = { + ...asset.value.asset, + ...properties, + }; + } + private createNewAsset(idPrefix: string, type: ObjectType): Asset { const typeProp = type.properties.type.node.type === 'string' @@ -47,29 +63,38 @@ export class RuntimeFlowState { throw new Error('type property must be a constant'); } - const titleGenAsset: DropTargetAssetType = { - id: `${idPrefix}-test-title`, - __type: DragAndDropAssetType, - type: 'drop-target', - context: { - propertyName: 'title', - parent: { - pluginName: 'test', - name: typeProp, - }, - }, - }; - - this.assetMappings[titleGenAsset.id] = titleGenAsset; - const asset: Asset = { id: `${idPrefix}-test-1`, type: typeProp, - title: { - asset: titleGenAsset, - }, }; + Object.entries(type.properties).forEach(([key, prop]) => { + if (prop.node.type === 'string' && prop.node.const !== undefined) { + asset[key] = prop.node.const; + } + + if ( + prop.node.type === 'ref' && + prop.node.ref.startsWith('AssetWrapper') + ) { + const generatedAsset: DropTargetAssetType = { + __type: DragAndDropAssetType, + id: `${idPrefix}-${key}`, + type: 'drop-target', + context: { + propertyName: key, + parent: { + pluginName: 'test', + name: typeProp, + }, + }, + }; + + this.assetMappings[generatedAsset.id] = generatedAsset; + asset[key] = { asset: generatedAsset }; + } + }); + return asset; } From 14ddc3279d9f4749e32810c4bb1374e51a81a018 Mon Sep 17 00:00:00 2001 From: Ketan Reddy Date: Mon, 21 Nov 2022 15:36:51 -0800 Subject: [PATCH 03/52] Use XLR --- drag-and-drop/app/BUILD | 2 + drag-and-drop/app/next.config.mjs | 8 +- drag-and-drop/app/pages/index.tsx | 7 +- drag-and-drop/library/BUILD | 1 + .../library/src/__tests__/controller.test.tsx | 8 +- drag-and-drop/library/src/controller.tsx | 76 +++++++++++++------ .../library/src/hooks/useDragAndDrop.tsx | 2 +- 7 files changed, 73 insertions(+), 31 deletions(-) diff --git a/drag-and-drop/app/BUILD b/drag-and-drop/app/BUILD index 04ccadc2..10d4f4e3 100644 --- a/drag-and-drop/app/BUILD +++ b/drag-and-drop/app/BUILD @@ -21,6 +21,8 @@ data = [ "//drag-and-drop/library:@player-tools/dnd-lib", "//common:@player-tools/static-xlrs", "@npm//typescript", + "@npm//@chakra-ui/react", + "@npm//@player-ui/reference-assets-plugin-react", "@npm//@types/react", "@npm//@types/node", ] diff --git a/drag-and-drop/app/next.config.mjs b/drag-and-drop/app/next.config.mjs index 7541d425..261ed7ec 100644 --- a/drag-and-drop/app/next.config.mjs +++ b/drag-and-drop/app/next.config.mjs @@ -8,5 +8,11 @@ export default { }, basePath: BASE_PREFIX, assetPrefix: BASE_PREFIX, - pageExtensions: ['jsx', 'js', 'ts', 'tsx'] + pageExtensions: ['jsx', 'js', 'ts', 'tsx'], + webpack: (config) => { + // eslint-disable-next-line no-param-reassign + config.resolve.fallback = { fs: false }; + + return config; + }, }; \ No newline at end of file diff --git a/drag-and-drop/app/pages/index.tsx b/drag-and-drop/app/pages/index.tsx index ef24380d..4e08552a 100644 --- a/drag-and-drop/app/pages/index.tsx +++ b/drag-and-drop/app/pages/index.tsx @@ -19,7 +19,9 @@ import { useDraggableAsset, } from '@player-tools/dnd-lib'; import { ReferenceAssetsPlugin } from '@player-ui/reference-assets-plugin-react'; -import manifest from '@player-tools/static-xlrs/static_xlrs/plugin/xlr/manifest'; +import type { TSManifest } from '@player-tools/xlr'; +import pluginManifest from '@player-tools/static-xlrs/static_xlrs/plugin/xlr/manifest'; +import typesManifest from '@player-tools/static-xlrs/static_xlrs/core/xlr/manifest'; const PropertiesContext = React.createContext<{ displayedAssetID?: string; @@ -69,10 +71,11 @@ const AssetDropTarget = (props: TransformedDropTargetAssetType) => { const config: DragAndDropControllerOptions = { Component: AssetDropTarget, + types: typesManifest as TSManifest, extensions: [ { plugin: ReferenceAssetsPlugin, - manifest: manifest as any, + manifest: pluginManifest as TSManifest, }, ], }; diff --git a/drag-and-drop/library/BUILD b/drag-and-drop/library/BUILD index cf8dd523..74a92801 100644 --- a/drag-and-drop/library/BUILD +++ b/drag-and-drop/library/BUILD @@ -4,6 +4,7 @@ javascript_pipeline( name = "@player-tools/dnd-lib", dependencies = [ "//xlr/types:@player-tools/xlr", + "//language/service:@player-tools/language-service", "@npm//@player-ui/react", "@npm//react-dnd", "@npm//react-dnd-html5-backend", diff --git a/drag-and-drop/library/src/__tests__/controller.test.tsx b/drag-and-drop/library/src/__tests__/controller.test.tsx index e57a6fb8..f2ec2d08 100644 --- a/drag-and-drop/library/src/__tests__/controller.test.tsx +++ b/drag-and-drop/library/src/__tests__/controller.test.tsx @@ -1,6 +1,7 @@ import { waitFor } from '@testing-library/react'; import type { InProgressState } from '@player-ui/react'; -import manifest from '@player-tools/static-xlrs/static_xlrs/plugin/xlr/manifest'; +import pluginManifest from '@player-tools/static-xlrs/static_xlrs/plugin/xlr/manifest'; +import typesManifest from '@player-tools/static-xlrs/static_xlrs/core/xlr/manifest'; import { DragAndDropController } from '../controller'; import type { ExtensionProvider } from '../types'; @@ -8,12 +9,13 @@ const referenceAssetExtension: ExtensionProvider = { plugin: class test { name = 'test'; }, - manifest: manifest as any, + manifest: pluginManifest as any, }; describe('drag-and-drop', () => { it('Fills in placeholder assets when dropped', async () => { const dndController = new DragAndDropController({ + types: typesManifest, extensions: [referenceAssetExtension], }); @@ -47,7 +49,7 @@ describe('drag-and-drop', () => { type: 'info', title: { asset: { - id: 'drag-and-drop-view-test-title-test-1', + id: 'drag-and-drop-view-title-test-1', type: 'text', }, }, diff --git a/drag-and-drop/library/src/controller.tsx b/drag-and-drop/library/src/controller.tsx index a35fd1bb..76f5cb8b 100644 --- a/drag-and-drop/library/src/controller.tsx +++ b/drag-and-drop/library/src/controller.tsx @@ -3,7 +3,9 @@ import type { AssetWrapper, View } from '@player-ui/react'; import { ConsoleLogger, WebPlayer } from '@player-ui/react'; import { DndProvider } from 'react-dnd'; import { HTML5Backend } from 'react-dnd-html5-backend'; -import type { ObjectNode } from '@player-tools/xlr'; +import type { NamedType, ObjectNode, TSManifest } from '@player-tools/xlr'; +import { XLRService } from '@player-tools/language-service'; +import type { TypeMetadata } from '@player-tools/xlr-sdk'; import { PlayerDndPlugin } from './utils'; import type { DropTargetAssetType, @@ -16,61 +18,84 @@ import { RuntimeFlowState } from './utils/runtime-flow-state'; import { DropComponent } from './utils/drop-component'; export interface DragAndDropControllerOptions { + /** + * + */ extensions?: Array; + /** + * + */ + types: TSManifest; + + /** + * + */ Component?: React.ComponentType; } +/** + * + */ export class DragAndDropController { private readonly options: DragAndDropControllerOptions; public readonly webPlayer: WebPlayer; private readonly dndWebPlayerPlugin: PlayerDndPlugin; private readonly runtimeState: RuntimeFlowState; + private readonly PlayerXLRService: XLRService; public get Canvas() { return this.webPlayer.Component; } public getAvailableAssets(): Array { - return (this.options.extensions ?? []).flatMap((extension) => { - return (extension.manifest.capabilities?.Assets ?? []).map((asset) => { - return { - pluginName: extension.manifest.pluginName, - name: asset.name, - }; - }); + const assets = this.PlayerXLRService.XLRSDK.listTypes({ + capabilityFilter: 'Types', + typeFilter: 'Transformed', + }); + return assets.map((asset) => { + const assetName = asset.name; + const typeInfo = this.PlayerXLRService.XLRSDK.getTypeInfo( + assetName + ) as TypeMetadata; + return { + pluginName: typeInfo.plugin, + name: assetName, + }; }); } + public getAssetDetails(assetName: string): NamedType { + return this.PlayerXLRService.XLRSDK.getType( + assetName + ) as NamedType; + } + public Context: React.ComponentType>; - constructor(options?: DragAndDropControllerOptions) { + constructor(options: DragAndDropControllerOptions) { this.options = options ?? {}; this.runtimeState = new RuntimeFlowState(); + this.PlayerXLRService = new XLRService(); + this.PlayerXLRService.XLRSDK.loadDefinitionsFromModule(options.types); + options?.extensions?.forEach((extension) => { + this.PlayerXLRService.XLRSDK.loadDefinitionsFromModule( + extension.manifest + ); + }); + this.dndWebPlayerPlugin = new PlayerDndPlugin({ state: this.runtimeState, Target: { Component: this.options.Component ?? DropComponent, }, getXLRTypeForAsset: (identifier): ObjectNode => { - const plugin = options?.extensions?.find( - (id) => identifier.pluginName === id.manifest.pluginName - ); - - const asset = plugin?.manifest.capabilities?.Assets.find( - (a) => a.name === identifier.name - ); - - if (asset?.type === 'object') { - return asset as ObjectNode; - } - - throw new Error( - `Unable to find type information for asset identifier: ${identifier.name} in plugin ${identifier.pluginName}` - ); + return this.PlayerXLRService.XLRSDK.getType( + identifier.name + ) as NamedType; }, }); @@ -99,6 +124,9 @@ export class DragAndDropController { exportView(): View { const baseView = this.runtimeState.view; + /** + * + */ const removeDndStateFromView = (obj: unknown): any => { if (obj === baseView && isDropTargetAsset(obj)) { if (obj.value?.asset) { diff --git a/drag-and-drop/library/src/hooks/useDragAndDrop.tsx b/drag-and-drop/library/src/hooks/useDragAndDrop.tsx index c615f52d..ea26956c 100644 --- a/drag-and-drop/library/src/hooks/useDragAndDrop.tsx +++ b/drag-and-drop/library/src/hooks/useDragAndDrop.tsx @@ -2,7 +2,7 @@ import React from 'react'; import type { DragAndDropControllerOptions } from '../controller'; import { DragAndDropController } from '../controller'; -export const useDragAndDrop = (conf?: DragAndDropControllerOptions) => { +export const useDragAndDrop = (conf: DragAndDropControllerOptions) => { const controller = React.useMemo(() => { return new DragAndDropController(conf); }, []); From 15592eab1f50a80d0a08e44fc33019e4a27fd83d Mon Sep 17 00:00:00 2001 From: Ketan Reddy Date: Thu, 5 Jan 2023 13:32:59 -0800 Subject: [PATCH 04/52] Restyle and edit dropped assets --- drag-and-drop/app/BUILD | 1 + .../app/pages/components/AssetEditorPanel.tsx | 187 +++ drag-and-drop/app/pages/index.tsx | 174 ++- drag-and-drop/library/src/controller.tsx | 11 +- drag-and-drop/library/src/types.ts | 5 +- .../library/src/utils/drop-component.tsx | 2 +- .../library/src/utils/runtime-flow-state.ts | 21 +- language/service/src/xlr/service.ts | 2 +- package.json | 4 +- yarn.lock | 1368 +++++++++-------- 10 files changed, 1110 insertions(+), 665 deletions(-) create mode 100644 drag-and-drop/app/pages/components/AssetEditorPanel.tsx diff --git a/drag-and-drop/app/BUILD b/drag-and-drop/app/BUILD index 10d4f4e3..29ba808a 100644 --- a/drag-and-drop/app/BUILD +++ b/drag-and-drop/app/BUILD @@ -25,6 +25,7 @@ data = [ "@npm//@player-ui/reference-assets-plugin-react", "@npm//@types/react", "@npm//@types/node", + "@npm//timm", ] next_export( diff --git a/drag-and-drop/app/pages/components/AssetEditorPanel.tsx b/drag-and-drop/app/pages/components/AssetEditorPanel.tsx new file mode 100644 index 00000000..1ba5ecee --- /dev/null +++ b/drag-and-drop/app/pages/components/AssetEditorPanel.tsx @@ -0,0 +1,187 @@ +import { + Box, + Card, + CardBody, + Input, + NumberDecrementStepper, + NumberIncrementStepper, + NumberInput, + NumberInputField, + NumberInputStepper, + Radio, + RadioGroup, + Stack, + Text, +} from '@chakra-ui/react'; +import type { NodeType, ObjectType } from '@player-tools/xlr'; +import type { Asset } from '@player-ui/types'; +import React from 'react'; + +export interface AssetEditorPanelProps { + /** Current authored Asset */ + asset: Asset; + /** Backing XLR Asset */ + type: ObjectType; + /** Function to propagate updates with */ + onUpdate: (path: Array, value: any) => void; +} + +export interface ConstantPropertyBoxProps { + /** The constant value to render */ + value: string | boolean | number; +} + +export interface PropertyBoxProps { + /** Backing XLR type */ + type: NodeType; + /** Portion of an authored Asset */ + asset?: unknown; + /** Is the property required */ + required?: boolean; + /** The name of the parent property being rendered */ + path: Array; + /** Should a title be displayed for the rendered element */ + title?: boolean; + /** Function to propagate updates with */ + onUpdate: (path: Array, value: any) => void; +} + +/** + * Renders a constant value of the type + */ +const ConstantPropertyBox = (props) => { + return ; +}; + +/** + * + */ +const PropertyBox = (props: PropertyBoxProps) => { + const { asset, path, type: node, title = true } = props; + const required = props.required ?? false; + + let renderedComponent; + + if ( + (node.type === 'ref' && node.ref.includes('AssetWrapper')) || + (node.type === 'array' && + node.elementType.type === 'ref' && + node.elementType.ref.includes('AssetWrapper')) + ) { + return null; + } + + if ( + (node.type === 'string' || + node.type === 'number' || + node.type === 'boolean') && + node.const + ) { + renderedComponent = ( + + ); + } else if ( + node.type === 'string' || + (node.type === 'ref' && + (node.ref === 'Expression' || node.ref === 'Binding')) + ) { + renderedComponent = ( + { + props.onUpdate(path, event.target.value); + }} + /> + ); + } else if (node.type === 'number') { + renderedComponent = ( + + + + + + + + ); + } else if (node.type === 'boolean') { + renderedComponent = ( +
+ + + True + False + + +
+ ); + } else if (node.type === 'object') { + const elements = Object.keys(node.properties).map((property) => { + const { required: requiredProperty, node: propertyNode } = + node.properties[property]; + return ( + + ); + }); + + const filteredChildren = React.Children.toArray(elements); + + renderedComponent = ( + + + {filteredChildren} + + + ); + } else if (node.type === 'or') { + renderedComponent = ( + + {node.or.map((element, index) => { + return ( + + ); + })} + + ); + } else { + renderedComponent = {JSON.stringify(node)}; + } + + // Catch unimplemented form controls during development + const parentProperty = path[path.length - 1]; + return ( +
+ {title && {parentProperty}} + {renderedComponent} +
+ ); +}; + +/** + * A top level panel for editing an Asset + */ +export const AssetEditorPanel = (props: AssetEditorPanelProps) => { + return ( + + ); +}; diff --git a/drag-and-drop/app/pages/index.tsx b/drag-and-drop/app/pages/index.tsx index 4e08552a..d2de3a4d 100644 --- a/drag-and-drop/app/pages/index.tsx +++ b/drag-and-drop/app/pages/index.tsx @@ -2,42 +2,70 @@ import React from 'react'; import { ChakraProvider, Box, + Card, + CardHeader, + CardBody, Heading, Flex, - Tag, Text, + CardFooter, + Button, + AccordionButton, + AccordionItem, + Accordion, + AccordionIcon, + AccordionPanel, + VStack, } from '@chakra-ui/react'; +import { setIn } from 'timm'; import type { DragAndDropControllerOptions, ExtensionProviderAssetIdentifier, TransformedDropTargetAssetType, } from '@player-tools/dnd-lib'; import { Asset } from '@player-ui/react-asset'; +import type { Asset as AssetType } from '@player-ui/types'; import { DragAndDropController, useDroppableAsset, useDraggableAsset, } from '@player-tools/dnd-lib'; import { ReferenceAssetsPlugin } from '@player-ui/reference-assets-plugin-react'; -import type { TSManifest } from '@player-tools/xlr'; +import type { ObjectType, TSManifest } from '@player-tools/xlr'; import pluginManifest from '@player-tools/static-xlrs/static_xlrs/plugin/xlr/manifest'; import typesManifest from '@player-tools/static-xlrs/static_xlrs/core/xlr/manifest'; +import { AssetEditorPanel } from './components/AssetEditorPanel'; const PropertiesContext = React.createContext<{ + /** + * Current Asset thats selected + */ displayedAssetID?: string; + /** + * Sets `displayedAssetID` + */ setDisplayedAssetID: (id: string) => void; }>({ setDisplayedAssetID: () => {}, }); +/** + * Component that indicates that an Asset can be placed at this location + */ const AssetDropTarget = (props: TransformedDropTargetAssetType) => { const [{ isOver }, drop] = useDroppableAsset(props); const propContext = React.useContext(PropertiesContext); if (!props.value && !props.context) { return ( - - Please Select an Asset + + Place a component to start designing your screen. ); } @@ -53,7 +81,7 @@ const AssetDropTarget = (props: TransformedDropTargetAssetType) => { }} onClick={(e) => { if (props.value) { - propContext.setDisplayedAssetID(props.value.asset.id); + propContext.setDisplayedAssetID(props.id); e.stopPropagation(); } }} @@ -82,45 +110,137 @@ const config: DragAndDropControllerOptions = { const controller = new DragAndDropController(config); +/** + * Component that can be dropped onto the canvas to add an Asst/View + */ const DroppableAsset = (props: ExtensionProviderAssetIdentifier) => { const [, ref] = useDraggableAsset(props) ?? []; return ( - {props.name} + ); }; +export interface CapabilityPanelProps { + /** Title to show in the Accordion Item */ + displayName: string; + + /** Capabilities to render droppable items for */ + capabilities: ExtensionProviderAssetIdentifier[]; +} + +/** + * + */ +export const CapabilityPanel = (props: CapabilityPanelProps) => { + return ( + + + + {props.displayName} + + + + + + {props.capabilities.length > 0 ? ( + props.capabilities.map((asset) => { + return ( + + + + ); + }) + ) : ( + No Components Loaded + )} + + + + ); +}; + +/** + * Left panel for selecting Assets/Views + */ const AssetSelectorPanel = () => { + const availableComponents = controller.getAvailableAssets(); + const assets = availableComponents.filter((c) => c.capability === 'Assets'); + const views = availableComponents.filter((c) => c.capability === 'Views'); + return ( - - - Asset Selector Panel - - - {controller.getAvailableAssets().map((asset) => { - return ( - - - - ); - })} - + + + Available Components + + + + + + + + ); }; +/** + * Right panel for editing a dropped Asset/View + */ const AssetDetailsPanel = () => { const propContext = React.useContext(PropertiesContext); + const [modifiedAsset, setModifiedAsset] = React.useState< + AssetType | undefined + >(undefined); - return ( - - Properties + if (!propContext.displayedAssetID) { + return ( + + Properties + Select an asset to begin editing + + ); + } - {propContext.displayedAssetID ?? 'Select an asset'} - + const { asset, type } = controller.getAsset(propContext.displayedAssetID); + + /** + * Updates the selected asset thats stored as a temporary value + */ + const updateObject = (path: Array, value: any) => { + setModifiedAsset(setIn(modifiedAsset ?? asset, path, value) as AssetType); + }; + + return ( + + + Properties for {type.name} + + + + + + + + ); }; +/** + * Main Page + */ const App = () => { const [displayedAssetID, setDisplayedAssetID] = React.useState(); @@ -134,13 +254,13 @@ const App = () => { - + - + - + diff --git a/drag-and-drop/library/src/controller.tsx b/drag-and-drop/library/src/controller.tsx index 76f5cb8b..e8adfb1b 100644 --- a/drag-and-drop/library/src/controller.tsx +++ b/drag-and-drop/library/src/controller.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import type { AssetWrapper, View } from '@player-ui/react'; +import type { Asset, AssetWrapper, View } from '@player-ui/react'; import { ConsoleLogger, WebPlayer } from '@player-ui/react'; import { DndProvider } from 'react-dnd'; import { HTML5Backend } from 'react-dnd-html5-backend'; @@ -62,6 +62,7 @@ export class DragAndDropController { return { pluginName: typeInfo.plugin, name: assetName, + capability: typeInfo.capability, }; }); } @@ -72,6 +73,10 @@ export class DragAndDropController { ) as NamedType; } + public getAsset(assetID: string) { + return this.runtimeState.get(assetID); + } + public Context: React.ComponentType>; constructor(options: DragAndDropControllerOptions) { @@ -116,8 +121,8 @@ export class DragAndDropController { this.webPlayer.start(this.runtimeState.flow); } - setProperties(id: string, properties: Record) { - this.runtimeState.setProperties(id, properties); + updateAsset(id: string, newObject: Asset) { + this.runtimeState.updateAsset(id, newObject); this.dndWebPlayerPlugin.refresh(this.webPlayer.player); } diff --git a/drag-and-drop/library/src/types.ts b/drag-and-drop/library/src/types.ts index e66d5f0f..e7bbd4ec 100644 --- a/drag-and-drop/library/src/types.ts +++ b/drag-and-drop/library/src/types.ts @@ -32,6 +32,9 @@ export interface ExtensionProviderAssetIdentifier { /** The asset type in the plugin */ name: string; + + /** The capability the type belongs to */ + capability: string; } export const isDropTargetAsset = (obj: unknown): obj is DropTargetAssetType => { @@ -52,7 +55,7 @@ export interface DropTargetAssetType extends Asset<'drop-target'> { */ context?: { /** The identifier for the parent asset type */ - parent: ExtensionProviderAssetIdentifier; + parent: Omit; /** The name of the property that this asset fulfills */ propertyName?: string; diff --git a/drag-and-drop/library/src/utils/drop-component.tsx b/drag-and-drop/library/src/utils/drop-component.tsx index a82b02e4..be3e0e3e 100644 --- a/drag-and-drop/library/src/utils/drop-component.tsx +++ b/drag-and-drop/library/src/utils/drop-component.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { Asset } from '@player-ui/react-asset'; import type { TransformedDropTargetAssetType } from '../types'; -import { useDroppableAsset } from '../hooks'; +import { useDroppableAsset } from '../hooks/useDroppableAsset'; export const DropComponent = (props: TransformedDropTargetAssetType) => { const [{ isOver }, drop] = useDroppableAsset(props); diff --git a/drag-and-drop/library/src/utils/runtime-flow-state.ts b/drag-and-drop/library/src/utils/runtime-flow-state.ts index f86e0478..0396d7e9 100644 --- a/drag-and-drop/library/src/utils/runtime-flow-state.ts +++ b/drag-and-drop/library/src/utils/runtime-flow-state.ts @@ -37,7 +37,7 @@ export class RuntimeFlowState { }; } - setProperties(id: string, properties: Record) { + updateAsset(id: string, newAsset: Asset) { const asset = this.assetMappings[id]; if (!asset) { throw new Error(`Cannot set asset value for unknown id: ${id}`); @@ -47,10 +47,7 @@ export class RuntimeFlowState { throw new Error(`Cannot set properties on asset without a value`); } - asset.value.asset = { - ...asset.value.asset, - ...properties, - }; + asset.value.asset = newAsset; } private createNewAsset(idPrefix: string, type: ObjectType): Asset { @@ -121,6 +118,20 @@ export class RuntimeFlowState { }; } + get(id: string): { + /** The Asset that correlates to the given ID */ + asset: Asset; + /** The underlying XLR type for the Asset */ + type: ObjectType; + } { + const asset = this.assetMappings[id]; + if (!asset || !asset.value) { + throw new Error(`Cannot get asset value for unknown id: ${id}`); + } + + return { asset: asset.value.asset, type: asset.value.type }; + } + append( id: string, replacement: { diff --git a/language/service/src/xlr/service.ts b/language/service/src/xlr/service.ts index 9ade3659..2b93d26f 100644 --- a/language/service/src/xlr/service.ts +++ b/language/service/src/xlr/service.ts @@ -17,7 +17,7 @@ export interface XLRContext { } /** - * XLRs Manager for + * XLRs Manager for abstracting away Player specific interactions with XLR */ export class XLRService { private baseTypes = [ diff --git a/package.json b/package.json index 1eef67ec..ec0f1381 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ }, "dependencies": { "@auto-it/version-file": "^10.37.2", - "@chakra-ui/react": "^2.2.1", + "@chakra-ui/react": "^2.4.4", "@emotion/react": "^11", "@emotion/styled": "^11", "@babel/cli": "^7.15.7", @@ -105,7 +105,7 @@ "figures": "^3.0.0", "flipper-pkg": "^0.173.0", "flipper-plugin": "^0.173.0", - "framer-motion": "^4", + "framer-motion": "^6", "fs-extra": "^10.0.0", "globby": "^11.0.1", "husky": "^7.0.2", diff --git a/yarn.lock b/yarn.lock index 816c2fcc..f7704ac9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1461,17 +1461,18 @@ "@chakra-ui/transition" "1.4.8" "@chakra-ui/utils" "1.10.4" -"@chakra-ui/accordion@2.1.2": - version "2.1.2" - resolved "https://registry.yarnpkg.com/@chakra-ui/accordion/-/accordion-2.1.2.tgz#f9d384b80f68a92689fa7ad4e43bd8944e6945c6" - integrity sha512-Jf7A6I0eIGk34zO5TiTW8orJOFQb5A/D1ekNYbaukNccoUPKJg/xdQ/b00oIR6LT93nJxggkoP/vszfmmTHuFg== +"@chakra-ui/accordion@2.1.5": + version "2.1.5" + resolved "https://registry.yarnpkg.com/@chakra-ui/accordion/-/accordion-2.1.5.tgz#286f7ef6434a334d4b446bfef9abaee6be9c3901" + integrity sha512-mxpcbnrbraYGNu/tmYC/Y0BNqM8jGXYygl4wzttlMSm8pXrhXApyv0bNBsU6zbBWqeyQE64R14N1ONl4i8CMkQ== dependencies: - "@chakra-ui/descendant" "3.0.10" - "@chakra-ui/icon" "3.0.11" - "@chakra-ui/react-context" "2.0.4" - "@chakra-ui/react-use-controllable-state" "2.0.5" - "@chakra-ui/react-use-merge-refs" "2.0.4" - "@chakra-ui/transition" "2.0.11" + "@chakra-ui/descendant" "3.0.12" + "@chakra-ui/icon" "3.0.14" + "@chakra-ui/react-context" "2.0.6" + "@chakra-ui/react-use-controllable-state" "2.0.7" + "@chakra-ui/react-use-merge-refs" "2.0.6" + "@chakra-ui/shared-utils" "2.0.4" + "@chakra-ui/transition" "2.0.13" "@chakra-ui/alert@1.3.7": version "1.3.7" @@ -1482,14 +1483,15 @@ "@chakra-ui/react-utils" "1.2.3" "@chakra-ui/utils" "1.10.4" -"@chakra-ui/alert@2.0.11": - version "2.0.11" - resolved "https://registry.yarnpkg.com/@chakra-ui/alert/-/alert-2.0.11.tgz#d792b0684ae7810befa3874af5bdd4aa115513a2" - integrity sha512-n40KHU3j1H6EbIdgptjEad92V7Fpv7YD++ZBjy2g1h4w9ay9nw4kGHib3gaIkBupLf52CfLqySEc8w0taoIlXQ== +"@chakra-ui/alert@2.0.14": + version "2.0.14" + resolved "https://registry.yarnpkg.com/@chakra-ui/alert/-/alert-2.0.14.tgz#0c39c1727bdaec81068fe36077f068bfc30512ae" + integrity sha512-dG+tgfOT9LVsx+scvXdKBj3D8XRnZ1pTul4G6TSRK6A4FifSwSTvNnmjvNpoH0Vh1dSMRI0zxpV8PAfs9dS9KA== dependencies: - "@chakra-ui/icon" "3.0.11" - "@chakra-ui/react-context" "2.0.4" - "@chakra-ui/spinner" "2.0.10" + "@chakra-ui/icon" "3.0.14" + "@chakra-ui/react-context" "2.0.6" + "@chakra-ui/shared-utils" "2.0.4" + "@chakra-ui/spinner" "2.0.12" "@chakra-ui/anatomy@1.3.0": version "1.3.0" @@ -1498,10 +1500,10 @@ dependencies: "@chakra-ui/theme-tools" "^1.3.6" -"@chakra-ui/anatomy@2.0.7": - version "2.0.7" - resolved "https://registry.yarnpkg.com/@chakra-ui/anatomy/-/anatomy-2.0.7.tgz#33e60c7c4d6e5f949f6f8308249dc571f84ead1e" - integrity sha512-vzcB2gcsGCxhrKbldQQV6LnBPys4eSSsH2UA2mLsT+J3WlXw0aodZw0eE/nH7yLxe4zaQ4Gnc0KjkFW4EWNKSg== +"@chakra-ui/anatomy@2.1.1": + version "2.1.1" + resolved "https://registry.yarnpkg.com/@chakra-ui/anatomy/-/anatomy-2.1.1.tgz#819a1458ff727157e5500a69fc26bfea6e944495" + integrity sha512-LUHAoqJAgxAqmyckG5bUpBrfEo1FleEyY+1A8hkWciy58gZ+h3GoY9oBpHcdo7XdHPpy3G+3hieK/7i9NLwxAw== "@chakra-ui/avatar@1.3.11": version "1.3.11" @@ -1512,14 +1514,15 @@ "@chakra-ui/react-utils" "1.2.3" "@chakra-ui/utils" "1.10.4" -"@chakra-ui/avatar@2.2.0": - version "2.2.0" - resolved "https://registry.yarnpkg.com/@chakra-ui/avatar/-/avatar-2.2.0.tgz#58b5e650f7e4b3ab229f50e6a102c54b6eb4b23a" - integrity sha512-mpAkfr/JG+BNBw2WvU55CSRFYKeFBUyAQAu3YulznLzi2U3e7k3IA0J8ofbrDYlSH/9KqkDuuSrxqGZgct+Nug== +"@chakra-ui/avatar@2.2.2": + version "2.2.2" + resolved "https://registry.yarnpkg.com/@chakra-ui/avatar/-/avatar-2.2.2.tgz#ac93579a499b2a87406f32a122efa41f825de785" + integrity sha512-wFDK1wT5kQxkpCAX6mPhx9kh0Pi2RnfN32bCRFio4Mmiq0ltfSEWi3/XxlawDr31Ch3T3qbtPVLqn355B4U9ZA== dependencies: - "@chakra-ui/image" "2.0.11" - "@chakra-ui/react-children-utils" "2.0.3" - "@chakra-ui/react-context" "2.0.4" + "@chakra-ui/image" "2.0.13" + "@chakra-ui/react-children-utils" "2.0.5" + "@chakra-ui/react-context" "2.0.6" + "@chakra-ui/shared-utils" "2.0.4" "@chakra-ui/breadcrumb@1.3.6": version "1.3.6" @@ -1529,18 +1532,21 @@ "@chakra-ui/react-utils" "1.2.3" "@chakra-ui/utils" "1.10.4" -"@chakra-ui/breadcrumb@2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@chakra-ui/breadcrumb/-/breadcrumb-2.1.0.tgz#530ded99f931cfcb9f4bd4d951bc82b0a4e102ac" - integrity sha512-khBR579SLDEo6Wuo3tETRY6m0yJD/WCvSR7Res2g1B6OJgc9OQGM7yIMu4OdLUTwfXsCnlHTDoSQPUxFOVAMIQ== +"@chakra-ui/breadcrumb@2.1.2": + version "2.1.2" + resolved "https://registry.yarnpkg.com/@chakra-ui/breadcrumb/-/breadcrumb-2.1.2.tgz#72cc5a25d35dec7637a2135a2945e66317f6d723" + integrity sha512-NbWg9YKCxo6nbwORpfFkD6bIDvcDdCPPLx+tqIqVwoplpaSPeFV5lzPy4Lg/MS6x6Ko6a/GItGpDQGPuey+iWA== dependencies: - "@chakra-ui/react-children-utils" "2.0.3" - "@chakra-ui/react-context" "2.0.4" + "@chakra-ui/react-children-utils" "2.0.5" + "@chakra-ui/react-context" "2.0.6" + "@chakra-ui/shared-utils" "2.0.4" -"@chakra-ui/breakpoint-utils@2.0.4": - version "2.0.4" - resolved "https://registry.yarnpkg.com/@chakra-ui/breakpoint-utils/-/breakpoint-utils-2.0.4.tgz#6231eff8b20f4e3cbb4eb7c86d05c927679d905b" - integrity sha512-SUUEYnA/FCIKYDHMuEXcnBMwet+6RAAjQ+CqGD1hlwKPTfh7EK9fS8FoVAJa9KpRKAc/AawzPkgwvorzPj8NSg== +"@chakra-ui/breakpoint-utils@2.0.6": + version "2.0.6" + resolved "https://registry.yarnpkg.com/@chakra-ui/breakpoint-utils/-/breakpoint-utils-2.0.6.tgz#ed31aeda21ff309eb0102ccd324b1d2096caa08a" + integrity sha512-aigYoZdHtV+PNFr/RTHjbIYK49PsMLvwtpZsowKWJ6xDyPKHtfhwZ2VOBTUyaQf4mXgaB9MNOF46zOTJN8RfLQ== + dependencies: + "@chakra-ui/shared-utils" "2.0.4" "@chakra-ui/button@1.5.10": version "1.5.10" @@ -1552,14 +1558,22 @@ "@chakra-ui/spinner" "1.2.6" "@chakra-ui/utils" "1.10.4" -"@chakra-ui/button@2.0.11": - version "2.0.11" - resolved "https://registry.yarnpkg.com/@chakra-ui/button/-/button-2.0.11.tgz#98e0aa1e35ea7e193bb50f9a4b5d0ea23202ace8" - integrity sha512-J6iMRITqxTxa0JexHUY9c7BXUrTZtSkl3jZ2hxiFybB4MQL8J2wZ24O846B6M+WTYqy7XVuHRuVURnH4czWesw== +"@chakra-ui/button@2.0.14": + version "2.0.14" + resolved "https://registry.yarnpkg.com/@chakra-ui/button/-/button-2.0.14.tgz#9ffc852504a2a6150140e15e46866fd55660ce7e" + integrity sha512-XdP1sB67N2DujDXPWyyXMTjW7frcnbf3yN/3F/asQClZX7ppw8Y36a6uZ94+6Cv67BPc0CokN+m3oQZhINJ+vw== + dependencies: + "@chakra-ui/react-context" "2.0.6" + "@chakra-ui/react-use-merge-refs" "2.0.6" + "@chakra-ui/shared-utils" "2.0.4" + "@chakra-ui/spinner" "2.0.12" + +"@chakra-ui/card@2.1.4": + version "2.1.4" + resolved "https://registry.yarnpkg.com/@chakra-ui/card/-/card-2.1.4.tgz#731bea5cfe76d1768fa0b5bfbee5ca4e6eaac652" + integrity sha512-MO8tjFBX2OZJt+NOthDoKcGRMQW/43NePze8Sju7zXqv1ocq7VB0DvToPLkopgeKaPx6AyYhzRXQjYXLcjYgQw== dependencies: - "@chakra-ui/react-context" "2.0.4" - "@chakra-ui/react-use-merge-refs" "2.0.4" - "@chakra-ui/spinner" "2.0.10" + "@chakra-ui/shared-utils" "2.0.4" "@chakra-ui/checkbox@1.7.1": version "1.7.1" @@ -1572,21 +1586,22 @@ "@chakra-ui/utils" "1.10.4" "@chakra-ui/visually-hidden" "1.1.6" -"@chakra-ui/checkbox@2.2.2": - version "2.2.2" - resolved "https://registry.yarnpkg.com/@chakra-ui/checkbox/-/checkbox-2.2.2.tgz#494d7090ac11a0a43d05b7849aff6085f7a91045" - integrity sha512-Y6Zbkkk5VNoe0RzqU6F+rKlFVPlubz1KIgYcb7CCNHGOM97dLtRm78eAvJ+7Xmpitr+7zZ4hJLLjfAz+e1X7rA== - dependencies: - "@chakra-ui/form-control" "2.0.11" - "@chakra-ui/react-context" "2.0.4" - "@chakra-ui/react-types" "2.0.3" - "@chakra-ui/react-use-callback-ref" "2.0.4" - "@chakra-ui/react-use-controllable-state" "2.0.5" - "@chakra-ui/react-use-merge-refs" "2.0.4" - "@chakra-ui/react-use-safe-layout-effect" "2.0.2" - "@chakra-ui/react-use-update-effect" "2.0.4" - "@chakra-ui/visually-hidden" "2.0.11" - "@zag-js/focus-visible" "0.1.0" +"@chakra-ui/checkbox@2.2.7": + version "2.2.7" + resolved "https://registry.yarnpkg.com/@chakra-ui/checkbox/-/checkbox-2.2.7.tgz#12abfb380838436f8ecf2039aef88f5df825d823" + integrity sha512-9p0U5xRE4OL5AbhZjV6Gw0iECLz8yd0cP43FabyBY8UfqrJPpAT22jxRmQ6Tv+HKbvAmgXOtxyIdwYTb1s1D+g== + dependencies: + "@chakra-ui/form-control" "2.0.14" + "@chakra-ui/react-context" "2.0.6" + "@chakra-ui/react-types" "2.0.6" + "@chakra-ui/react-use-callback-ref" "2.0.6" + "@chakra-ui/react-use-controllable-state" "2.0.7" + "@chakra-ui/react-use-merge-refs" "2.0.6" + "@chakra-ui/react-use-safe-layout-effect" "2.0.4" + "@chakra-ui/react-use-update-effect" "2.0.6" + "@chakra-ui/shared-utils" "2.0.4" + "@chakra-ui/visually-hidden" "2.0.14" + "@zag-js/focus-visible" "0.2.1" "@chakra-ui/clickable@1.2.6": version "1.2.6" @@ -1596,12 +1611,13 @@ "@chakra-ui/react-utils" "1.2.3" "@chakra-ui/utils" "1.10.4" -"@chakra-ui/clickable@2.0.10": - version "2.0.10" - resolved "https://registry.yarnpkg.com/@chakra-ui/clickable/-/clickable-2.0.10.tgz#e89b7b3eaf9364753f6205e36fd5128b26a617d8" - integrity sha512-G6JdR6yAMlXpfjOJ70W2FL7aUwNuomiMFtkneeTpk7Q42bJ5iGHfYlbZEx5nJd8iB+UluXVM4xlhMv2MyytjGw== +"@chakra-ui/clickable@2.0.12": + version "2.0.12" + resolved "https://registry.yarnpkg.com/@chakra-ui/clickable/-/clickable-2.0.12.tgz#479ed8fd2b1af079f6a630f8b2181b106112dd74" + integrity sha512-boZwlHZ1BdsC4P/1r+SRbKRMG+/UzOgc16Fmhl2QkZquVF6jS6QtJBS1/fL+1N8oijz87nuhBoetNECnfWYN+w== dependencies: - "@chakra-ui/react-use-merge-refs" "2.0.4" + "@chakra-ui/react-use-merge-refs" "2.0.6" + "@chakra-ui/shared-utils" "2.0.4" "@chakra-ui/close-button@1.2.7": version "1.2.7" @@ -1611,12 +1627,12 @@ "@chakra-ui/icon" "2.0.5" "@chakra-ui/utils" "1.10.4" -"@chakra-ui/close-button@2.0.11": - version "2.0.11" - resolved "https://registry.yarnpkg.com/@chakra-ui/close-button/-/close-button-2.0.11.tgz#8b0679da42738229014d3807885d05fac0fdf448" - integrity sha512-9WF/nwwK9BldS89WQ5PtXK2nFS4r8QOgKls2BOwXfE+rGmOUZtOsu8ne/drXRjgkiBRETR6CxdyUjm7EPzXllw== +"@chakra-ui/close-button@2.0.14": + version "2.0.14" + resolved "https://registry.yarnpkg.com/@chakra-ui/close-button/-/close-button-2.0.14.tgz#ec83da9f83bfd8fc2fb3de1a76e58752bf7f1f0b" + integrity sha512-C/MR6EH+MUC49QCtKdoeAq/GYvs4CEvl0xjwri6qFYd8+UEkXPfl33Idw0c3kPbGe+aTrh4vMAYrRNwc4BveIg== dependencies: - "@chakra-ui/icon" "3.0.11" + "@chakra-ui/icon" "3.0.14" "@chakra-ui/color-mode@1.4.8": version "1.4.8" @@ -1627,12 +1643,12 @@ "@chakra-ui/react-env" "1.1.6" "@chakra-ui/utils" "1.10.4" -"@chakra-ui/color-mode@2.1.9": - version "2.1.9" - resolved "https://registry.yarnpkg.com/@chakra-ui/color-mode/-/color-mode-2.1.9.tgz#d3a6f9ba9eee15d9e14cc96484e25d44cef1dbc1" - integrity sha512-0kx0I+AQon8oS23/X+qMtnhsv/1BUulyJvU56p3Uh8CRaBfgJ7Ly9CerShoUL+5kadu6hN1M9oty4cugaCwv2w== +"@chakra-ui/color-mode@2.1.11": + version "2.1.11" + resolved "https://registry.yarnpkg.com/@chakra-ui/color-mode/-/color-mode-2.1.11.tgz#9347c1b81a21b7d68bde1aa4a332f7060c8145d4" + integrity sha512-556wqI/MohJAqzP9AD+YsKGi982TzrsAaRGr7RCY5fChNe/wHraLPjMPNITPjjDQWiUmZYkaEos78/4u3qOdpA== dependencies: - "@chakra-ui/react-use-safe-layout-effect" "2.0.2" + "@chakra-ui/react-use-safe-layout-effect" "2.0.4" "@chakra-ui/control-box@1.1.6": version "1.1.6" @@ -1641,10 +1657,10 @@ dependencies: "@chakra-ui/utils" "1.10.4" -"@chakra-ui/control-box@2.0.10": - version "2.0.10" - resolved "https://registry.yarnpkg.com/@chakra-ui/control-box/-/control-box-2.0.10.tgz#e8a849c9f0fa085da78ee15dda7e13e1734b983d" - integrity sha512-sHmZanFLEv4IDATl19ZTxq8Bi8PtjfvnsN6xF4k7JGSYUnk1YXUf1coyW7WKdcsczOASrMikfsLc3iEVAzx4Ng== +"@chakra-ui/control-box@2.0.12": + version "2.0.12" + resolved "https://registry.yarnpkg.com/@chakra-ui/control-box/-/control-box-2.0.12.tgz#d1109b3c28214421a5278c3776be499b8d843e83" + integrity sha512-SR2rG917ttCAda9Kh0eqr0X2AWQii2iRrgTks3fbDGi7seV7m3tkrpK2hr7rPz5zX0UoJi6CFO04Q6cSclFylw== "@chakra-ui/counter@1.2.10": version "1.2.10" @@ -1654,23 +1670,24 @@ "@chakra-ui/hooks" "1.9.1" "@chakra-ui/utils" "1.10.4" -"@chakra-ui/counter@2.0.10": - version "2.0.10" - resolved "https://registry.yarnpkg.com/@chakra-ui/counter/-/counter-2.0.10.tgz#861f00db021235892dfe0407e739a259f1c233b2" - integrity sha512-MZK8UKUZp4nFMd+GlV/cq0NIARS7UdlubTuCx+wockw9j2JI5OHzsyK0XiWuJiq5psegSTzpbtT99QfAUm3Yiw== +"@chakra-ui/counter@2.0.12": + version "2.0.12" + resolved "https://registry.yarnpkg.com/@chakra-ui/counter/-/counter-2.0.12.tgz#68007b194aed7e5e55e185fddd38c778d2467354" + integrity sha512-LselA3J2OvO1GxXo9pTvFEDEYXaSkelEGAOasUfME2ckQnznMOI96x7cLAujyMuhTAuGnz0n4mxAOp/iMHKL4Q== dependencies: - "@chakra-ui/number-utils" "2.0.4" - "@chakra-ui/react-use-callback-ref" "2.0.4" + "@chakra-ui/number-utils" "2.0.6" + "@chakra-ui/react-use-callback-ref" "2.0.6" + "@chakra-ui/shared-utils" "2.0.4" "@chakra-ui/css-reset@1.1.3": version "1.1.3" resolved "https://registry.yarnpkg.com/@chakra-ui/css-reset/-/css-reset-1.1.3.tgz#da65507ea1d69ed309bc34619881e23b5004ec7d" integrity sha512-AgfrE7bRTJvNi/4zIfacI/kBHmHmHEIeQtHwCvk/0qM9V2gK1VM3ctYlnibf7BTh17F/UszweOGRb1lHSPfWjw== -"@chakra-ui/css-reset@2.0.8": - version "2.0.8" - resolved "https://registry.yarnpkg.com/@chakra-ui/css-reset/-/css-reset-2.0.8.tgz#093ce6b166b37f2dd14e63f246635c463a59c106" - integrity sha512-VuDD1rk1pFc+dItk4yUcstyoC9D2B35hatHDBtlPMqTczFAzpbgVJJYgEHANatXGfulM5SdckmYEIJ3Tac1Rtg== +"@chakra-ui/css-reset@2.0.11": + version "2.0.11" + resolved "https://registry.yarnpkg.com/@chakra-ui/css-reset/-/css-reset-2.0.11.tgz#d2b65a543bac785c9788ce152a9eece157595289" + integrity sha512-TnydPIMYaQX8kJ8cKgbXfHaBKLr9wCqZS+UnqUxUo3YzMNRjOUPg4DWVO4n4s+GwuZy860DGsBoJaheLqrilVg== "@chakra-ui/descendant@2.1.4": version "2.1.4" @@ -1679,18 +1696,18 @@ dependencies: "@chakra-ui/react-utils" "^1.2.3" -"@chakra-ui/descendant@3.0.10": - version "3.0.10" - resolved "https://registry.yarnpkg.com/@chakra-ui/descendant/-/descendant-3.0.10.tgz#e54c95270896c451f61b57d31719ee042f4e1827" - integrity sha512-MHH0Qdm0fGllGP2xgx4WOycmrpctyyEdGw6zxcfs2VqZNlrwmjG3Yb9eVY+Q7UmEv5rwAq6qRn7BhQxgSPn3Cg== +"@chakra-ui/descendant@3.0.12": + version "3.0.12" + resolved "https://registry.yarnpkg.com/@chakra-ui/descendant/-/descendant-3.0.12.tgz#823eee949eb56e0045d3ee84bbfd614b4d9203e9" + integrity sha512-jx37SI6PYKMSgn+46Ou8LGa2nbEiBRmU4rzz+0/klVpCSd4yQLcm1c4nPv0D7SoQrhq/cQq4tUPfC2U4tXeovQ== dependencies: - "@chakra-ui/react-context" "2.0.4" - "@chakra-ui/react-use-merge-refs" "2.0.4" + "@chakra-ui/react-context" "2.0.6" + "@chakra-ui/react-use-merge-refs" "2.0.6" -"@chakra-ui/dom-utils@2.0.3": - version "2.0.3" - resolved "https://registry.yarnpkg.com/@chakra-ui/dom-utils/-/dom-utils-2.0.3.tgz#8a5498b107d3a42662f3502f7b8965cb73bf6a33" - integrity sha512-aeGlRmTxcv0cvW44DyeZHru1i68ZDQsXpfX2dnG1I1yBlT6GlVx1xYjCULis9mjhgvd2O3NfcYPRTkjNWTDUbA== +"@chakra-ui/dom-utils@2.0.5": + version "2.0.5" + resolved "https://registry.yarnpkg.com/@chakra-ui/dom-utils/-/dom-utils-2.0.5.tgz#cd34be7342f217a5fad42766a15d3cda1b99be21" + integrity sha512-cZsaji3ntRcJOqrc9xyS2JSGXr/VLPFTTvShLApxg5dCDWvrGrCJGQ+iSP6R2FGHo2D6cpAgMdPO9O65KUyZBA== "@chakra-ui/editable@1.4.2": version "1.4.2" @@ -1701,25 +1718,25 @@ "@chakra-ui/react-utils" "1.2.3" "@chakra-ui/utils" "1.10.4" -"@chakra-ui/editable@2.0.13": - version "2.0.13" - resolved "https://registry.yarnpkg.com/@chakra-ui/editable/-/editable-2.0.13.tgz#4e6ff480956ae2dcacf4ba2a15019336486bd613" - integrity sha512-GM3n8t3/TOFFcDOWF/tuKsnqn66isZLsU+FkMRY2o0E8XjLBGjCKuXInPW5SRBqhje7EHC+kwViLE780PfwXbw== - dependencies: - "@chakra-ui/react-context" "2.0.4" - "@chakra-ui/react-types" "2.0.3" - "@chakra-ui/react-use-callback-ref" "2.0.4" - "@chakra-ui/react-use-controllable-state" "2.0.5" - "@chakra-ui/react-use-focus-on-pointer-down" "2.0.3" - "@chakra-ui/react-use-merge-refs" "2.0.4" - "@chakra-ui/react-use-safe-layout-effect" "2.0.2" - "@chakra-ui/react-use-update-effect" "2.0.4" - "@chakra-ui/shared-utils" "2.0.2" - -"@chakra-ui/event-utils@2.0.5": - version "2.0.5" - resolved "https://registry.yarnpkg.com/@chakra-ui/event-utils/-/event-utils-2.0.5.tgz#23de21e319d1a70863953402d64cb4b0e6ce322f" - integrity sha512-VXoOAIsM0PFKDlhm+EZxkWlUXd5UFTb/LTux3y3A+S9G5fDxLRvpiLWByPUgTFTCDFcgTCF+YnQtdWJB4DLyxg== +"@chakra-ui/editable@2.0.17": + version "2.0.17" + resolved "https://registry.yarnpkg.com/@chakra-ui/editable/-/editable-2.0.17.tgz#f77953dacb08350ac66251bb5504cc886768f654" + integrity sha512-1Yy2rfWPtRg/1qx2yv9ovTwrpuFHFLEB8LyizM44yvKnSEqTb2K6CTYhVHQBzI92bQUbGsorSflLvFFUzB55XQ== + dependencies: + "@chakra-ui/react-context" "2.0.6" + "@chakra-ui/react-types" "2.0.6" + "@chakra-ui/react-use-callback-ref" "2.0.6" + "@chakra-ui/react-use-controllable-state" "2.0.7" + "@chakra-ui/react-use-focus-on-pointer-down" "2.0.5" + "@chakra-ui/react-use-merge-refs" "2.0.6" + "@chakra-ui/react-use-safe-layout-effect" "2.0.4" + "@chakra-ui/react-use-update-effect" "2.0.6" + "@chakra-ui/shared-utils" "2.0.4" + +"@chakra-ui/event-utils@2.0.7": + version "2.0.7" + resolved "https://registry.yarnpkg.com/@chakra-ui/event-utils/-/event-utils-2.0.7.tgz#358db8db4f628ae492eba110fe801b5087f09076" + integrity sha512-OBEIx7CIK5k3nYUGnh2WDhth1oGe26fwXMVQjVM9+2LBUYw2Y1Ufac4o7lMiD1CnyUP+Q70yjMV/mFacvP1EMw== "@chakra-ui/focus-lock@1.2.6": version "1.2.6" @@ -1729,12 +1746,12 @@ "@chakra-ui/utils" "1.10.4" react-focus-lock "2.5.2" -"@chakra-ui/focus-lock@2.0.12": - version "2.0.12" - resolved "https://registry.yarnpkg.com/@chakra-ui/focus-lock/-/focus-lock-2.0.12.tgz#11c0301a326249efe269c2dd0f54b11a67a04321" - integrity sha512-NvIP59A11ZNbxXZ3qwxSiQ5npjABkpSbTIjK0uZ9bZm5LMfepRnuuA19VsVlq31/BYV9nHFAy6xzIuG+Qf9xMA== +"@chakra-ui/focus-lock@2.0.14": + version "2.0.14" + resolved "https://registry.yarnpkg.com/@chakra-ui/focus-lock/-/focus-lock-2.0.14.tgz#2137499570aad7df9404a40dfeb62311d52c3399" + integrity sha512-p4aieMBm4CG+uhfJ/W+2p3koGfPsHzdzSu2A8AYM5kGZ3rCx6IM97XYSneConw5WH7mSQR4lXzuEDjAyDozXFg== dependencies: - "@chakra-ui/dom-utils" "2.0.3" + "@chakra-ui/dom-utils" "2.0.5" react-focus-lock "^2.9.1" "@chakra-ui/form-control@1.6.0": @@ -1747,15 +1764,16 @@ "@chakra-ui/react-utils" "1.2.3" "@chakra-ui/utils" "1.10.4" -"@chakra-ui/form-control@2.0.11": - version "2.0.11" - resolved "https://registry.yarnpkg.com/@chakra-ui/form-control/-/form-control-2.0.11.tgz#fbfdddb02d1b5d2c67ffdc721c434ff16693e4bd" - integrity sha512-MVhIe0xY4Zn06IXRXFmS9tCa93snppK1SdUQb1P99Ipo424RrL5ykzLnJ8CAkQrhoVP3sxF7z3eOSzk8/iRfow== +"@chakra-ui/form-control@2.0.14": + version "2.0.14" + resolved "https://registry.yarnpkg.com/@chakra-ui/form-control/-/form-control-2.0.14.tgz#186aa0c93421b698309c99f78d46d3f13125b92a" + integrity sha512-HPT65tNxQJ6E3AqhREa90aJOdJ1TUj+Y37fLqhIUOMrFX2eLjthE81XswjrUGbcaQk0DuCqMLMBFjeUNxo2Qhw== dependencies: - "@chakra-ui/icon" "3.0.11" - "@chakra-ui/react-context" "2.0.4" - "@chakra-ui/react-types" "2.0.3" - "@chakra-ui/react-use-merge-refs" "2.0.4" + "@chakra-ui/icon" "3.0.14" + "@chakra-ui/react-context" "2.0.6" + "@chakra-ui/react-types" "2.0.6" + "@chakra-ui/react-use-merge-refs" "2.0.6" + "@chakra-ui/shared-utils" "2.0.4" "@chakra-ui/hooks@1.9.1": version "1.9.1" @@ -1767,13 +1785,13 @@ compute-scroll-into-view "1.0.14" copy-to-clipboard "3.3.1" -"@chakra-ui/hooks@2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@chakra-ui/hooks/-/hooks-2.1.0.tgz#a8df3692e407c2fed8cc551c8ce7f3fcd0ea9864" - integrity sha512-4H6BDITq/YrStW99LXurgPkcz4qHSVy9V/QWXCvt1pCuiDTqNztiW4r508H3ApAOsL9NEbyXcM/zWYD7r5VDjA== +"@chakra-ui/hooks@2.1.4": + version "2.1.4" + resolved "https://registry.yarnpkg.com/@chakra-ui/hooks/-/hooks-2.1.4.tgz#b8fc1904fb5d1daa4d19d61ffb64c1f76a28b846" + integrity sha512-FOsBBMK2zl7qdBrBgmkMNMkkbkKzM0RwYoK7oV+ldUG1f7pvjPBmzRFZ3wiIh5FlbffZvlLAH22D3a2xldWDZw== dependencies: - "@chakra-ui/react-utils" "2.0.8" - "@chakra-ui/utils" "2.0.11" + "@chakra-ui/react-utils" "2.0.11" + "@chakra-ui/utils" "2.0.14" compute-scroll-into-view "1.0.14" copy-to-clipboard "3.3.1" @@ -1784,12 +1802,12 @@ dependencies: "@chakra-ui/utils" "1.10.4" -"@chakra-ui/icon@3.0.11": - version "3.0.11" - resolved "https://registry.yarnpkg.com/@chakra-ui/icon/-/icon-3.0.11.tgz#a51dda24bed2f2ed77b4136ada8f22d3249c9870" - integrity sha512-RG4jf/XmBdaxOYI5J5QstEtTCPoVlmrQ/XiWhvN0LTgAnmZIqVwFl3Uw+satArdStHAs0GmJZg/E/soFTWuFmw== +"@chakra-ui/icon@3.0.14": + version "3.0.14" + resolved "https://registry.yarnpkg.com/@chakra-ui/icon/-/icon-3.0.14.tgz#aca6c998f2359ce937203f7463db299a6f8947ba" + integrity sha512-ksNDXSByoLFNec/7UANtiy/lHt2NO3/Xe5KIde3zh70yY1QcRQjO8TjvXgYwqLbR0D6OzMGggrZnJKafeZhjRQ== dependencies: - "@chakra-ui/shared-utils" "2.0.2" + "@chakra-ui/shared-utils" "2.0.4" "@chakra-ui/icons@^1.1.1": version "1.1.7" @@ -1807,12 +1825,13 @@ "@chakra-ui/hooks" "1.9.1" "@chakra-ui/utils" "1.10.4" -"@chakra-ui/image@2.0.11": - version "2.0.11" - resolved "https://registry.yarnpkg.com/@chakra-ui/image/-/image-2.0.11.tgz#eb880ecd2fce47f22ef50bbbba66cbb027c0304c" - integrity sha512-S6NqAprPcbHnck/J+2wg06r9SSol62v5A01O8Kke2PnAyjalMcS+6P59lDRO7wvPqsdxq4PPbSTZP6Dww2CvcA== +"@chakra-ui/image@2.0.13": + version "2.0.13" + resolved "https://registry.yarnpkg.com/@chakra-ui/image/-/image-2.0.13.tgz#adc8bc97a65ef15491d7abfa7e4aa31debb3e4c1" + integrity sha512-zcTN3DuhoLCkCgCwPGvy++F9jaCE2OQjoLKJSU2Rnc0c8WjCZZqXKuRdg3GhaYc80kaVSexMSc6h04Hki+JgVQ== dependencies: - "@chakra-ui/react-use-safe-layout-effect" "2.0.2" + "@chakra-ui/react-use-safe-layout-effect" "2.0.4" + "@chakra-ui/shared-utils" "2.0.4" "@chakra-ui/input@1.4.6": version "1.4.6" @@ -1823,16 +1842,16 @@ "@chakra-ui/react-utils" "1.2.3" "@chakra-ui/utils" "1.10.4" -"@chakra-ui/input@2.0.12": - version "2.0.12" - resolved "https://registry.yarnpkg.com/@chakra-ui/input/-/input-2.0.12.tgz#332db53a831daea4d76e1de6d3b4462fd50ae167" - integrity sha512-lJ5necu+Wt698HdCTC7L/ErA2nNVJAra7+knPe0qMR+AizGEL7LKCV/bdQe7eggjvKsDGD4alJIEczUvm3JVUQ== +"@chakra-ui/input@2.0.16": + version "2.0.16" + resolved "https://registry.yarnpkg.com/@chakra-ui/input/-/input-2.0.16.tgz#23110cdab6b619beaed1e9869aa6a74e3c01f295" + integrity sha512-4ybF7PQa8MQJm/QvD+UogYerB9/nZuNk+A9Eh9Djtg0EMiD/z+2jhZp2a4Te0HE8mq/DaEK7aNgw4s/EmAKnGA== dependencies: - "@chakra-ui/form-control" "2.0.11" - "@chakra-ui/object-utils" "2.0.4" - "@chakra-ui/react-children-utils" "2.0.3" - "@chakra-ui/react-context" "2.0.4" - "@chakra-ui/shared-utils" "2.0.2" + "@chakra-ui/form-control" "2.0.14" + "@chakra-ui/object-utils" "2.0.6" + "@chakra-ui/react-children-utils" "2.0.5" + "@chakra-ui/react-context" "2.0.6" + "@chakra-ui/shared-utils" "2.0.4" "@chakra-ui/layout@1.8.0": version "1.8.0" @@ -1843,22 +1862,22 @@ "@chakra-ui/react-utils" "1.2.3" "@chakra-ui/utils" "1.10.4" -"@chakra-ui/layout@2.1.9": - version "2.1.9" - resolved "https://registry.yarnpkg.com/@chakra-ui/layout/-/layout-2.1.9.tgz#3e9cc7b5915e033907367e40fc97d218efa5f777" - integrity sha512-ztsavtirtdtjxdqIkGR6fVcrffHp6hs1twRFO/dK14FGXrX3Nn9mi3J1fr1ITBHJq6y5B3yFEj0LHN2fO8dYyw== +"@chakra-ui/layout@2.1.12": + version "2.1.12" + resolved "https://registry.yarnpkg.com/@chakra-ui/layout/-/layout-2.1.12.tgz#b75d45de693aabd4585e62e75d97a1718e0024ec" + integrity sha512-iIz9QiS0iB+8NUX5r9TtCbV2JbGzEbKVPiTTtnf48utu12lX4xcdpZJm6jgtgWjvwyo+N+FxyQ8oNff5OqN+Hw== dependencies: - "@chakra-ui/breakpoint-utils" "2.0.4" - "@chakra-ui/icon" "3.0.11" - "@chakra-ui/object-utils" "2.0.4" - "@chakra-ui/react-children-utils" "2.0.3" - "@chakra-ui/react-context" "2.0.4" - "@chakra-ui/shared-utils" "2.0.2" + "@chakra-ui/breakpoint-utils" "2.0.6" + "@chakra-ui/icon" "3.0.14" + "@chakra-ui/object-utils" "2.0.6" + "@chakra-ui/react-children-utils" "2.0.5" + "@chakra-ui/react-context" "2.0.6" + "@chakra-ui/shared-utils" "2.0.4" -"@chakra-ui/lazy-utils@2.0.2": - version "2.0.2" - resolved "https://registry.yarnpkg.com/@chakra-ui/lazy-utils/-/lazy-utils-2.0.2.tgz#d85f9afc60c2434ba76376fd4b23a7a0a1341e14" - integrity sha512-MTxutBJZvqNNqrrS0722cI7qrnGu0yUQpIebmTxYwI+F3cOnPEKf5Ni+hrA8hKcw4XJhSY4npAPPYu1zJbOV4w== +"@chakra-ui/lazy-utils@2.0.4": + version "2.0.4" + resolved "https://registry.yarnpkg.com/@chakra-ui/lazy-utils/-/lazy-utils-2.0.4.tgz#bd0e2f7118e3a8fe470db7666b08bb1f808205a9" + integrity sha512-HaVlEIlWNdk9vuubfc+EJkNkwP4pORXkPanP72KF8CxM4NN1hCSm+2gAvlCZCmWUIKIyhGMO1lXPY923o2Mnug== "@chakra-ui/live-region@1.1.6": version "1.1.6" @@ -1867,10 +1886,10 @@ dependencies: "@chakra-ui/utils" "1.10.4" -"@chakra-ui/live-region@2.0.10": - version "2.0.10" - resolved "https://registry.yarnpkg.com/@chakra-ui/live-region/-/live-region-2.0.10.tgz#d33a784c85feed7ba96e2579553ca1d20c965171" - integrity sha512-eQ2ZIreR/plzi/KGszDYTi1TvIyGEBcPiWP52BQOS7xwpzb1vsoR1FgFAIELxAGJvKnMUs+9qVogfyRBX8PdOg== +"@chakra-ui/live-region@2.0.12": + version "2.0.12" + resolved "https://registry.yarnpkg.com/@chakra-ui/live-region/-/live-region-2.0.12.tgz#932e94cf2c36eb3c004259d9a4cda5c2b6269887" + integrity sha512-hzCvqeYRtocLn0KmlEpVdYbt/7Tb5tBtsjMBfJb2lQkarQRwC9xzZ4arCcsDZAWiR3c3wvXdSob3vZ71biz46g== "@chakra-ui/media-query@2.0.4": version "2.0.4" @@ -1880,13 +1899,14 @@ "@chakra-ui/react-env" "1.1.6" "@chakra-ui/utils" "1.10.4" -"@chakra-ui/media-query@3.2.7": - version "3.2.7" - resolved "https://registry.yarnpkg.com/@chakra-ui/media-query/-/media-query-3.2.7.tgz#ece5b2181136145305bf5e6ec82c696ef1d59a77" - integrity sha512-hbgm6JCe0kYU3PAhxASYYDopFQI26cW9kZnbp+5tRL1fykkVWNMPwoGC8FEZPur9JjXp7aoL6H4Jk7nrxY/XWw== +"@chakra-ui/media-query@3.2.9": + version "3.2.9" + resolved "https://registry.yarnpkg.com/@chakra-ui/media-query/-/media-query-3.2.9.tgz#204002fe04e56a1abfa0bd5e3ad05bad8c34ae3e" + integrity sha512-4vaf8YqgIs5zhaQTLAif+aiiixo9gpk1xiTn4oTiDZQFuTVhKyv4iI93NbAKif/Bls+8XghbMo0rF93DjqRRzg== dependencies: - "@chakra-ui/breakpoint-utils" "2.0.4" - "@chakra-ui/react-env" "2.0.10" + "@chakra-ui/breakpoint-utils" "2.0.6" + "@chakra-ui/react-env" "2.0.12" + "@chakra-ui/shared-utils" "2.0.4" "@chakra-ui/menu@1.8.12": version "1.8.12" @@ -1901,25 +1921,26 @@ "@chakra-ui/transition" "1.4.8" "@chakra-ui/utils" "1.10.4" -"@chakra-ui/menu@2.1.2": - version "2.1.2" - resolved "https://registry.yarnpkg.com/@chakra-ui/menu/-/menu-2.1.2.tgz#bbe39e1efdb408ba8e6616e0ec290417474f9454" - integrity sha512-6Z7ecXjp6BtZ1ExbFggfxsAj1hwtcathXekmCTxHpXOD+BdjAC/13+oLclwXeuBO85aoTmQrQ2ovfTkO31bzRQ== - dependencies: - "@chakra-ui/clickable" "2.0.10" - "@chakra-ui/descendant" "3.0.10" - "@chakra-ui/lazy-utils" "2.0.2" - "@chakra-ui/popper" "3.0.8" - "@chakra-ui/react-children-utils" "2.0.3" - "@chakra-ui/react-context" "2.0.4" - "@chakra-ui/react-use-animation-state" "2.0.5" - "@chakra-ui/react-use-controllable-state" "2.0.5" - "@chakra-ui/react-use-disclosure" "2.0.5" - "@chakra-ui/react-use-focus-effect" "2.0.5" - "@chakra-ui/react-use-merge-refs" "2.0.4" - "@chakra-ui/react-use-outside-click" "2.0.4" - "@chakra-ui/react-use-update-effect" "2.0.4" - "@chakra-ui/transition" "2.0.11" +"@chakra-ui/menu@2.1.6": + version "2.1.6" + resolved "https://registry.yarnpkg.com/@chakra-ui/menu/-/menu-2.1.6.tgz#939a061bc0848528be8ddbcc03c33c35c2630de6" + integrity sha512-/ypgx+JmYgItoBq0bUMetnjDu3aS75lra4xVQeMEG8L7y8/q7B4uIIJeSVh7o8UQJCvV05doxnwsxV7zBW29bw== + dependencies: + "@chakra-ui/clickable" "2.0.12" + "@chakra-ui/descendant" "3.0.12" + "@chakra-ui/lazy-utils" "2.0.4" + "@chakra-ui/popper" "3.0.11" + "@chakra-ui/react-children-utils" "2.0.5" + "@chakra-ui/react-context" "2.0.6" + "@chakra-ui/react-use-animation-state" "2.0.7" + "@chakra-ui/react-use-controllable-state" "2.0.7" + "@chakra-ui/react-use-disclosure" "2.0.7" + "@chakra-ui/react-use-focus-effect" "2.0.8" + "@chakra-ui/react-use-merge-refs" "2.0.6" + "@chakra-ui/react-use-outside-click" "2.0.6" + "@chakra-ui/react-use-update-effect" "2.0.6" + "@chakra-ui/shared-utils" "2.0.4" + "@chakra-ui/transition" "2.0.13" "@chakra-ui/modal@1.11.1": version "1.11.1" @@ -1936,18 +1957,19 @@ aria-hidden "^1.1.1" react-remove-scroll "2.4.1" -"@chakra-ui/modal@2.2.2": - version "2.2.2" - resolved "https://registry.yarnpkg.com/@chakra-ui/modal/-/modal-2.2.2.tgz#bf3ef2673a8641a5c851faceb7811e0c0f323517" - integrity sha512-cCYuqLZO4QqFUI1H+uEqixDk6UiCP3yC+sxkhFTXHIApSG9Z44v5np7BVTd6LKdmAN8pAWcc8Oxf14RvD6LWLw== - dependencies: - "@chakra-ui/close-button" "2.0.11" - "@chakra-ui/focus-lock" "2.0.12" - "@chakra-ui/portal" "2.0.10" - "@chakra-ui/react-context" "2.0.4" - "@chakra-ui/react-types" "2.0.3" - "@chakra-ui/react-use-merge-refs" "2.0.4" - "@chakra-ui/transition" "2.0.11" +"@chakra-ui/modal@2.2.6": + version "2.2.6" + resolved "https://registry.yarnpkg.com/@chakra-ui/modal/-/modal-2.2.6.tgz#5ea5df74f19b4cd173bfa31f5de0378dadd44a9a" + integrity sha512-NyGovs3+MimltfCyqrpr20vtwNOaNykJGQFp7GfsfiInoMU7fOyDAc12JfgcVl3LCwk0bEo60hx1zxZ3GQvUxQ== + dependencies: + "@chakra-ui/close-button" "2.0.14" + "@chakra-ui/focus-lock" "2.0.14" + "@chakra-ui/portal" "2.0.13" + "@chakra-ui/react-context" "2.0.6" + "@chakra-ui/react-types" "2.0.6" + "@chakra-ui/react-use-merge-refs" "2.0.6" + "@chakra-ui/shared-utils" "2.0.4" + "@chakra-ui/transition" "2.0.13" aria-hidden "^1.1.1" react-remove-scroll "^2.5.4" @@ -1963,32 +1985,33 @@ "@chakra-ui/react-utils" "1.2.3" "@chakra-ui/utils" "1.10.4" -"@chakra-ui/number-input@2.0.12": - version "2.0.12" - resolved "https://registry.yarnpkg.com/@chakra-ui/number-input/-/number-input-2.0.12.tgz#90a8408e6abb2d021793888ef2119d01761d7614" - integrity sha512-3owLjl01sCYpTd3xbq//fJo9QJ0Q3PVYSx9JeOzlXnnTW8ws+yHPrqQzPe7G+tO4yOYynWuUT+NJ9oyCeAJIxA== - dependencies: - "@chakra-ui/counter" "2.0.10" - "@chakra-ui/form-control" "2.0.11" - "@chakra-ui/icon" "3.0.11" - "@chakra-ui/react-context" "2.0.4" - "@chakra-ui/react-types" "2.0.3" - "@chakra-ui/react-use-callback-ref" "2.0.4" - "@chakra-ui/react-use-event-listener" "2.0.4" - "@chakra-ui/react-use-interval" "2.0.2" - "@chakra-ui/react-use-merge-refs" "2.0.4" - "@chakra-ui/react-use-safe-layout-effect" "2.0.2" - "@chakra-ui/react-use-update-effect" "2.0.4" - -"@chakra-ui/number-utils@2.0.4": - version "2.0.4" - resolved "https://registry.yarnpkg.com/@chakra-ui/number-utils/-/number-utils-2.0.4.tgz#0331be05956f2c03125c073d35655e261e267cd4" - integrity sha512-MdYd29GboBoKaXY9jhbY0Wl+0NxG1t/fa32ZSIbU6VrfMsZuAMl4NEJsz7Xvhy50fummLdKn5J6HFS7o5iyIgw== +"@chakra-ui/number-input@2.0.15": + version "2.0.15" + resolved "https://registry.yarnpkg.com/@chakra-ui/number-input/-/number-input-2.0.15.tgz#7b8eeac38b9dad188845b8e3cb294978e7c7cbb6" + integrity sha512-x04CqLPFF1bYiIiosB5xoWSoOKYBbrB5EMpm1382X11fdsdrkkR2/3Jqb3Hh0yVV63FtxXaYEeUENb6tJMcGmQ== + dependencies: + "@chakra-ui/counter" "2.0.12" + "@chakra-ui/form-control" "2.0.14" + "@chakra-ui/icon" "3.0.14" + "@chakra-ui/react-context" "2.0.6" + "@chakra-ui/react-types" "2.0.6" + "@chakra-ui/react-use-callback-ref" "2.0.6" + "@chakra-ui/react-use-event-listener" "2.0.6" + "@chakra-ui/react-use-interval" "2.0.4" + "@chakra-ui/react-use-merge-refs" "2.0.6" + "@chakra-ui/react-use-safe-layout-effect" "2.0.4" + "@chakra-ui/react-use-update-effect" "2.0.6" + "@chakra-ui/shared-utils" "2.0.4" + +"@chakra-ui/number-utils@2.0.6": + version "2.0.6" + resolved "https://registry.yarnpkg.com/@chakra-ui/number-utils/-/number-utils-2.0.6.tgz#3db0e61dd542d5753b3db4702bf9fae6653ceb82" + integrity sha512-VLOyoiXGpZ+eCQSPqKdBCEpen9VAo6pc6FDFuf4BNdIVEfh6ee//Zl7XjyTAGr1G4HUANp8ZxVHHPvtQ10VP4w== -"@chakra-ui/object-utils@2.0.4": - version "2.0.4" - resolved "https://registry.yarnpkg.com/@chakra-ui/object-utils/-/object-utils-2.0.4.tgz#d890ce285103a5e9b993f016a4fb38307aa55ac0" - integrity sha512-sY98L4v2wcjpwRX8GCXqT+WzpL0i5FHVxT1Okxw0360T2tGnZt7toAwpMfIOR3dzkemP9LfXMCyBmWR5Hi2zpQ== +"@chakra-ui/object-utils@2.0.6": + version "2.0.6" + resolved "https://registry.yarnpkg.com/@chakra-ui/object-utils/-/object-utils-2.0.6.tgz#6b6125dbb1d1f3a9e5d3faf008d6374a3c4d99f7" + integrity sha512-fw1AjQ4wdL8hqPGiE6ulXyugwh1m70YluG1yWGZDPi909zJj1/uL0DClgiNJY/8zWJrbMwDjGdYziXudLxahgA== "@chakra-ui/pin-input@1.7.11": version "1.7.11" @@ -2000,16 +2023,17 @@ "@chakra-ui/react-utils" "1.2.3" "@chakra-ui/utils" "1.10.4" -"@chakra-ui/pin-input@2.0.15": - version "2.0.15" - resolved "https://registry.yarnpkg.com/@chakra-ui/pin-input/-/pin-input-2.0.15.tgz#08e65c5e8468cef6192634a53859169b51c2c4a7" - integrity sha512-Ha8siSZm9gyjHHBK8ejwhKT6+75U12I/hNiYFvl2JHhc+Uh8tdi7+N+9SILO5vqbIv9kb+WGitvZ67I0cHjSfw== +"@chakra-ui/pin-input@2.0.17": + version "2.0.17" + resolved "https://registry.yarnpkg.com/@chakra-ui/pin-input/-/pin-input-2.0.17.tgz#d1151c010e2b1600d0d5b17bfe79543b838c3a5d" + integrity sha512-uDL8HIjuvvcEO9YBiAOewFtlrjPDqF+xPIWBh4hetDVt6Pd9XavvuyRJjsogjAZt0FsweUg5sF8g/iVLAihCAQ== dependencies: - "@chakra-ui/descendant" "3.0.10" - "@chakra-ui/react-children-utils" "2.0.3" - "@chakra-ui/react-context" "2.0.4" - "@chakra-ui/react-use-controllable-state" "2.0.5" - "@chakra-ui/react-use-merge-refs" "2.0.4" + "@chakra-ui/descendant" "3.0.12" + "@chakra-ui/react-children-utils" "2.0.5" + "@chakra-ui/react-context" "2.0.6" + "@chakra-ui/react-use-controllable-state" "2.0.7" + "@chakra-ui/react-use-merge-refs" "2.0.6" + "@chakra-ui/shared-utils" "2.0.4" "@chakra-ui/popover@1.11.9": version "1.11.9" @@ -2022,21 +2046,22 @@ "@chakra-ui/react-utils" "1.2.3" "@chakra-ui/utils" "1.10.4" -"@chakra-ui/popover@2.1.1": - version "2.1.1" - resolved "https://registry.yarnpkg.com/@chakra-ui/popover/-/popover-2.1.1.tgz#1b5e05e334ba5f9bce4bc5bcabfb92563393fc84" - integrity sha512-j09NsesfT+eaYITkITYJXDlRcPoOeQUM80neJZKOBgul2iHkVsEoii8dwS5Ip5ONeu4ane1b6zEOlYvYj2SrkA== - dependencies: - "@chakra-ui/close-button" "2.0.11" - "@chakra-ui/lazy-utils" "2.0.2" - "@chakra-ui/popper" "3.0.8" - "@chakra-ui/react-context" "2.0.4" - "@chakra-ui/react-types" "2.0.3" - "@chakra-ui/react-use-animation-state" "2.0.5" - "@chakra-ui/react-use-disclosure" "2.0.5" - "@chakra-ui/react-use-focus-effect" "2.0.5" - "@chakra-ui/react-use-focus-on-pointer-down" "2.0.3" - "@chakra-ui/react-use-merge-refs" "2.0.4" +"@chakra-ui/popover@2.1.5": + version "2.1.5" + resolved "https://registry.yarnpkg.com/@chakra-ui/popover/-/popover-2.1.5.tgz#435fe2e8f9bf2c2fd433334edaf5a98e9fefb0e8" + integrity sha512-ERM9312mJ1RbiRRdgn0E8jS10ZNBsACFkLhnEe++Ow27pjuIxL/MCpCatEGx9b97osHSsfPHekHjaLcOoCqVIw== + dependencies: + "@chakra-ui/close-button" "2.0.14" + "@chakra-ui/lazy-utils" "2.0.4" + "@chakra-ui/popper" "3.0.11" + "@chakra-ui/react-context" "2.0.6" + "@chakra-ui/react-types" "2.0.6" + "@chakra-ui/react-use-animation-state" "2.0.7" + "@chakra-ui/react-use-disclosure" "2.0.7" + "@chakra-ui/react-use-focus-effect" "2.0.8" + "@chakra-ui/react-use-focus-on-pointer-down" "2.0.5" + "@chakra-ui/react-use-merge-refs" "2.0.6" + "@chakra-ui/shared-utils" "2.0.4" "@chakra-ui/popper@2.4.3": version "2.4.3" @@ -2046,13 +2071,13 @@ "@chakra-ui/react-utils" "1.2.3" "@popperjs/core" "^2.9.3" -"@chakra-ui/popper@3.0.8": - version "3.0.8" - resolved "https://registry.yarnpkg.com/@chakra-ui/popper/-/popper-3.0.8.tgz#89b6984aee405316974dbb70ba451f85832bf44e" - integrity sha512-246eUwuCRsLpTPxn5T8D8T9/6ODqmmz6pRRJAjGnLlUB0gNHgjisBn0UDBic5Gbxcg0sqKvxOMY3uurbW5lXTA== +"@chakra-ui/popper@3.0.11": + version "3.0.11" + resolved "https://registry.yarnpkg.com/@chakra-ui/popper/-/popper-3.0.11.tgz#00d412d408d4628d55491bd5d3b58e1e23e6c972" + integrity sha512-fsKwgq3E0S6FqCzTCQ7HQEr2BOHfHZZMiqvFpGyrIPQ/Esv7aE3Ipw4y4RHTztzJ+vUKK3XTbJzX1cU4RR4a8Q== dependencies: - "@chakra-ui/react-types" "2.0.3" - "@chakra-ui/react-use-merge-refs" "2.0.4" + "@chakra-ui/react-types" "2.0.6" + "@chakra-ui/react-use-merge-refs" "2.0.6" "@popperjs/core" "^2.9.3" "@chakra-ui/portal@1.3.10": @@ -2064,13 +2089,13 @@ "@chakra-ui/react-utils" "1.2.3" "@chakra-ui/utils" "1.10.4" -"@chakra-ui/portal@2.0.10": - version "2.0.10" - resolved "https://registry.yarnpkg.com/@chakra-ui/portal/-/portal-2.0.10.tgz#8ac21131cb0666a0bf6565468b3f7e799ef3bc8d" - integrity sha512-VRYvVAggIuqIZ3IQ6XZ1b5ujjjOUgPk9PPdc9jssUngZa7RG+5NXNhgoM8a5TsXv6aPEolBOlDNWuxzRQ4RSSg== +"@chakra-ui/portal@2.0.13": + version "2.0.13" + resolved "https://registry.yarnpkg.com/@chakra-ui/portal/-/portal-2.0.13.tgz#ce556c1750bacf157f9f96755577dc9d59266ef6" + integrity sha512-EuzaYJuIXM5elqy0MmXe+nc2bHm72JpxkM/PX+LnRTlkA44Kj/iQP5gnx5KHLVG4RPbcG5p61W4KzIBPSRY0+g== dependencies: - "@chakra-ui/react-context" "2.0.4" - "@chakra-ui/react-use-safe-layout-effect" "2.0.2" + "@chakra-ui/react-context" "2.0.6" + "@chakra-ui/react-use-safe-layout-effect" "2.0.4" "@chakra-ui/progress@1.2.6": version "1.2.6" @@ -2080,12 +2105,12 @@ "@chakra-ui/theme-tools" "1.3.6" "@chakra-ui/utils" "1.10.4" -"@chakra-ui/progress@2.0.12": - version "2.0.12" - resolved "https://registry.yarnpkg.com/@chakra-ui/progress/-/progress-2.0.12.tgz#7ce57fe2822d1741c26e82960ca02c667a265a05" - integrity sha512-9qtZimZosTliI7siAZkLeCVdCpXCTxmSETCudHcCUsC+FtcFacmA65+We8qij1nOIqmsbm+NYU6PP89TU2n4Hg== +"@chakra-ui/progress@2.1.3": + version "2.1.3" + resolved "https://registry.yarnpkg.com/@chakra-ui/progress/-/progress-2.1.3.tgz#742ab674323dd504ba67e69ae379cbdabdadd421" + integrity sha512-RnVFvdWXrj06oVG0R0m/OunXJ9oxMrcI/UHGgTw74FbjZDSSv7+8j9397iu2Mop7v6iJi0Rhm8Nyi/wEqlO9lw== dependencies: - "@chakra-ui/react-context" "2.0.4" + "@chakra-ui/react-context" "2.0.6" "@chakra-ui/provider@1.7.14": version "1.7.14" @@ -2099,16 +2124,16 @@ "@chakra-ui/system" "1.12.1" "@chakra-ui/utils" "1.10.4" -"@chakra-ui/provider@2.0.20": - version "2.0.20" - resolved "https://registry.yarnpkg.com/@chakra-ui/provider/-/provider-2.0.20.tgz#2f3f73f6142f4d2b2a5a8ad6dbd777a3fc4390ce" - integrity sha512-mNNfsgm05G4x1VzvHVR9+PNEiuxNnn9xUKDuEwoaO7+IHCMzCRMtPbSJjwmv0xvHUGB9+JChjPpZI5RuHQziJQ== +"@chakra-ui/provider@2.0.28": + version "2.0.28" + resolved "https://registry.yarnpkg.com/@chakra-ui/provider/-/provider-2.0.28.tgz#822b2680ccee7d574954917ca006e515c5ba6ce3" + integrity sha512-9Q6UTweW0Fbgqd1ifBeVJke0QLp6duZqiju+Ng9C16B31FcNCz8nFPWQLx5yhDnA4XoQ3vNREkrETfae4CfH1Q== dependencies: - "@chakra-ui/css-reset" "2.0.8" - "@chakra-ui/portal" "2.0.10" - "@chakra-ui/react-env" "2.0.10" - "@chakra-ui/system" "2.3.0" - "@chakra-ui/utils" "2.0.11" + "@chakra-ui/css-reset" "2.0.11" + "@chakra-ui/portal" "2.0.13" + "@chakra-ui/react-env" "2.0.12" + "@chakra-ui/system" "2.3.7" + "@chakra-ui/utils" "2.0.14" "@chakra-ui/radio@1.5.1": version "1.5.1" @@ -2121,26 +2146,27 @@ "@chakra-ui/utils" "1.10.4" "@chakra-ui/visually-hidden" "1.1.6" -"@chakra-ui/radio@2.0.12": - version "2.0.12" - resolved "https://registry.yarnpkg.com/@chakra-ui/radio/-/radio-2.0.12.tgz#d89eb463df0247a0e634cff1fb9ca755bcbab825" - integrity sha512-871hqAGQaufxyUzPP3aautPBIRZQmpi3fw5XPZ6SbY62dV61M4sjcttd46HfCf5SrAonoOADFQLMGQafznjhaA== +"@chakra-ui/radio@2.0.16": + version "2.0.16" + resolved "https://registry.yarnpkg.com/@chakra-ui/radio/-/radio-2.0.16.tgz#d6bc26c635393077612055c65d70333244ca2e63" + integrity sha512-TQyHi88Jo6BNCNKXMpWxkoKufEOM2va+3ykuFK8RSqaAhRbHXBdnbS23Bq2HR7z7jrsnsOQOkZ9VA64XDDn1fw== dependencies: - "@chakra-ui/form-control" "2.0.11" - "@chakra-ui/react-context" "2.0.4" - "@chakra-ui/react-types" "2.0.3" - "@chakra-ui/react-use-merge-refs" "2.0.4" - "@zag-js/focus-visible" "0.1.0" + "@chakra-ui/form-control" "2.0.14" + "@chakra-ui/react-context" "2.0.6" + "@chakra-ui/react-types" "2.0.6" + "@chakra-ui/react-use-merge-refs" "2.0.6" + "@chakra-ui/shared-utils" "2.0.4" + "@zag-js/focus-visible" "0.2.1" -"@chakra-ui/react-children-utils@2.0.3": - version "2.0.3" - resolved "https://registry.yarnpkg.com/@chakra-ui/react-children-utils/-/react-children-utils-2.0.3.tgz#406b984c653befd6c99636fcefb55bd01d436a7d" - integrity sha512-tPQjLEEuAw/DYLRw0cNs/g8tcdhZ3r21Sr9dTAzoyvfk0vbZ24gCXRElltW2GZLiFA63mAidzhPmc+yQF3Wtgg== +"@chakra-ui/react-children-utils@2.0.5": + version "2.0.5" + resolved "https://registry.yarnpkg.com/@chakra-ui/react-children-utils/-/react-children-utils-2.0.5.tgz#300efb99130e8423333f7bddbbac23cdff624b5e" + integrity sha512-rP/1HFR9J6wohIzLe/gU+vpey27uey9pVa46VTZfApI6VdzDWiQT1pmrGQeMkba07KdU2MJS/60dhGM4NfvcQA== -"@chakra-ui/react-context@2.0.4": - version "2.0.4" - resolved "https://registry.yarnpkg.com/@chakra-ui/react-context/-/react-context-2.0.4.tgz#1b6ab260d44d9073c95b975b7d1643f011e65e02" - integrity sha512-eBITFkf7fLSiMZrSdhweK4fYr41WUNMEeIEOP2dCWolE7WgKxNYaYleC+iRGY0GeXkFM2KYywUtixjJe29NuVA== +"@chakra-ui/react-context@2.0.6": + version "2.0.6" + resolved "https://registry.yarnpkg.com/@chakra-ui/react-context/-/react-context-2.0.6.tgz#77d61e4a2654e83a8cc5c6d6f0140ceedab87963" + integrity sha512-+Bk/lDBirj6KE3vbyyUVCqFGqAe+MOso+1NRHQ0m66/sXWFFnoL/lvuq4osdNp80DOVQ4EYYnHI0olSZZvuKEg== "@chakra-ui/react-env@1.1.6": version "1.1.6" @@ -2149,127 +2175,128 @@ dependencies: "@chakra-ui/utils" "1.10.4" -"@chakra-ui/react-env@2.0.10": - version "2.0.10" - resolved "https://registry.yarnpkg.com/@chakra-ui/react-env/-/react-env-2.0.10.tgz#2eaa4ba64a14ecd2d279c32d5edfef7a6b5de3e8" - integrity sha512-3Yab5EbFcCGYzEsoijy4eA3354Z/JoXyk9chYIuW7Uwd+K6g/R8C0mUSAHeTmfp6Fix9kzDgerO5MWNM87b8cA== +"@chakra-ui/react-env@2.0.12": + version "2.0.12" + resolved "https://registry.yarnpkg.com/@chakra-ui/react-env/-/react-env-2.0.12.tgz#f5f9fef0bd6fa9983457cb06413cf209acad48e8" + integrity sha512-BPTz2cxNKhNc1y5J9cCOYndbGiNulpMwihZLkybLRJ1qzZic4KuD3iGOkagJ81STKoPkKEZWfcjnrQTCJTq1fg== -"@chakra-ui/react-types@2.0.3": - version "2.0.3" - resolved "https://registry.yarnpkg.com/@chakra-ui/react-types/-/react-types-2.0.3.tgz#dc454c4703b4de585e6461fd607304ede06fe595" - integrity sha512-1mJYOQldFTALE0Wr3j6tk/MYvgQIp6CKkJulNzZrI8QN+ox/bJOh8OVP4vhwqvfigdLTui0g0k8M9h+j2ub/Mw== +"@chakra-ui/react-types@2.0.6": + version "2.0.6" + resolved "https://registry.yarnpkg.com/@chakra-ui/react-types/-/react-types-2.0.6.tgz#96b4f8a082ab5244fe6b574e953b1b64ece9605a" + integrity sha512-aAq/nl//PneEfeaDb94zwfXor4OP/d5kc6dEXOZB2HJgCt3hu2+F/1u1QpPLPPTys5xexkQojuZQLnnD9lmQFw== -"@chakra-ui/react-use-animation-state@2.0.5": - version "2.0.5" - resolved "https://registry.yarnpkg.com/@chakra-ui/react-use-animation-state/-/react-use-animation-state-2.0.5.tgz#f022baf0103c35aa494227b041422e7d2401b0d4" - integrity sha512-8gZIqZpMS5yTGlC+IqYoSrV13joiAYoeI0YR2t68WuDagcZ459OrjE57+gF04NLxfdV7eUgwqnpuv7IOLbJX/A== +"@chakra-ui/react-use-animation-state@2.0.7": + version "2.0.7" + resolved "https://registry.yarnpkg.com/@chakra-ui/react-use-animation-state/-/react-use-animation-state-2.0.7.tgz#5f7f6327130c7bc345477a46b31b30b81fa1e45a" + integrity sha512-v4p5jTopFvYah3vrRU7m6W+m1IEIqxfDco6ASeoEWEcKab4WBdQ1OQr1Oxgip+UIgmvLUnl+3BS+jPUuuKkdgg== dependencies: - "@chakra-ui/dom-utils" "2.0.3" - "@chakra-ui/react-use-event-listener" "2.0.4" + "@chakra-ui/dom-utils" "2.0.5" + "@chakra-ui/react-use-event-listener" "2.0.6" -"@chakra-ui/react-use-callback-ref@2.0.4": - version "2.0.4" - resolved "https://registry.yarnpkg.com/@chakra-ui/react-use-callback-ref/-/react-use-callback-ref-2.0.4.tgz#5099ef1df4413af42e434945f541de99394ec96f" - integrity sha512-he7EQfwMA4mwiDDKvX7cHIJaboCqf7UD3KYHGUcIjsF4dSc2Y8X5Ze4w+hmVZoJWIe4DWUzb3ili2SUm8eTgPg== +"@chakra-ui/react-use-callback-ref@2.0.6": + version "2.0.6" + resolved "https://registry.yarnpkg.com/@chakra-ui/react-use-callback-ref/-/react-use-callback-ref-2.0.6.tgz#e382cfa198a376804946f57fa564f17ea6efdccc" + integrity sha512-JKh0GJQvLonjSVQJjsBs2gE+Zix/DXfAo8kzNE+DzNf49CNomX59TkcJNXDjtzSktn6GfqDF8IOObJlGlbtG7g== -"@chakra-ui/react-use-controllable-state@2.0.5": - version "2.0.5" - resolved "https://registry.yarnpkg.com/@chakra-ui/react-use-controllable-state/-/react-use-controllable-state-2.0.5.tgz#5ef9f600ae134a2a37fe080fd6231bbed83544bb" - integrity sha512-JrZZpMX24CUyfDuyqDczw9Z9IMvjH8ujETHK0Zu4M0SIsX/q4EqOwwngUFL03I2gx/O38HfSdeX8hMu4zbTAGA== +"@chakra-ui/react-use-controllable-state@2.0.7": + version "2.0.7" + resolved "https://registry.yarnpkg.com/@chakra-ui/react-use-controllable-state/-/react-use-controllable-state-2.0.7.tgz#1f61659a42cc73227770201e6c631dc9c606f15f" + integrity sha512-vKGgMtZb/06KnIF0XUFjWvwfKs3x35M6FEc4FU/wgM5FDU9T6Vd1TG7kDHFMoYdcvRf2/fgzkOxgTN052+sMkw== dependencies: - "@chakra-ui/react-use-callback-ref" "2.0.4" + "@chakra-ui/react-use-callback-ref" "2.0.6" -"@chakra-ui/react-use-disclosure@2.0.5": - version "2.0.5" - resolved "https://registry.yarnpkg.com/@chakra-ui/react-use-disclosure/-/react-use-disclosure-2.0.5.tgz#bb52340f0e7d614cc95819bd21cffd050783f96c" - integrity sha512-kPLB9oxImASRhAbKfvfc03/lbAJbsXndEVRzd+nvvL+QZm2RRfnel3k6OIkWvGFOXXYOPE2+slLe8ZPwbTGg9g== +"@chakra-ui/react-use-disclosure@2.0.7": + version "2.0.7" + resolved "https://registry.yarnpkg.com/@chakra-ui/react-use-disclosure/-/react-use-disclosure-2.0.7.tgz#217ea956a1c2455c9b2647d59d1bbbe0e577d190" + integrity sha512-vQG8AxYq+BkaurCHdMA9pxJAfQDmErMzn9hn2elP0dVfKe2a0O7aCFzX2Ff9PeeBKWOFlUfKf79gRBnhXRa5xw== dependencies: - "@chakra-ui/react-use-callback-ref" "2.0.4" + "@chakra-ui/react-use-callback-ref" "2.0.6" -"@chakra-ui/react-use-event-listener@2.0.4": - version "2.0.4" - resolved "https://registry.yarnpkg.com/@chakra-ui/react-use-event-listener/-/react-use-event-listener-2.0.4.tgz#3f893def57a7b10db6c355740dd1e82cd3216259" - integrity sha512-VqmalfKWMO8D21XuZO19WUtcP5xhbHXKzkggApTChZUN02UC5TC4pe0pYbDygoeUuNBhY+9lJKHeS08vYsljRg== +"@chakra-ui/react-use-event-listener@2.0.6": + version "2.0.6" + resolved "https://registry.yarnpkg.com/@chakra-ui/react-use-event-listener/-/react-use-event-listener-2.0.6.tgz#15faf5873f6ee6a973d74d174fe2905a81647ccf" + integrity sha512-lDtccra2B/1ap6Z7NESS4QfZajfOLd/jafmVdiO0xc4YSs6VDhenipMCv9O47U5EXapG6jfTXs2nbFkc3jRKiA== dependencies: - "@chakra-ui/react-use-callback-ref" "2.0.4" + "@chakra-ui/react-use-callback-ref" "2.0.6" -"@chakra-ui/react-use-focus-effect@2.0.5": - version "2.0.5" - resolved "https://registry.yarnpkg.com/@chakra-ui/react-use-focus-effect/-/react-use-focus-effect-2.0.5.tgz#b554277c38e84468b019e08a73579e9700e1003a" - integrity sha512-sbe1QnsXXfjukM+laxbKnT0UnMpHe/7kTzEPG/BYM6/ZDUUmrC1Nz+8l+3H/52iWIaruikDBdif/Xd37Yvu3Kg== +"@chakra-ui/react-use-focus-effect@2.0.8": + version "2.0.8" + resolved "https://registry.yarnpkg.com/@chakra-ui/react-use-focus-effect/-/react-use-focus-effect-2.0.8.tgz#fdf43e129148c82ebad66ef970dd3f8b2394f251" + integrity sha512-Et6/97A/6ndPygj6CF8+T7RQH0gsW5fkWNi64R7OjuQSjWxGq1kcmyBGm4E2u2Hbmtf4Hm1dcjzilnYbG7M7IA== dependencies: - "@chakra-ui/dom-utils" "2.0.3" - "@chakra-ui/react-use-event-listener" "2.0.4" - "@chakra-ui/react-use-update-effect" "2.0.4" + "@chakra-ui/dom-utils" "2.0.5" + "@chakra-ui/react-use-event-listener" "2.0.6" + "@chakra-ui/react-use-safe-layout-effect" "2.0.4" + "@chakra-ui/react-use-update-effect" "2.0.6" -"@chakra-ui/react-use-focus-on-pointer-down@2.0.3": - version "2.0.3" - resolved "https://registry.yarnpkg.com/@chakra-ui/react-use-focus-on-pointer-down/-/react-use-focus-on-pointer-down-2.0.3.tgz#8b605063c9e707a18b021fbcaed8919c8660d1ed" - integrity sha512-8cKmpv26JnblexNaekWxEDI7M+MZnJcp1PJUz6lByjfQ1m4YjFr1cdbdhG4moaqzzYs7vTmO/qL8KVq8ZLUwyQ== +"@chakra-ui/react-use-focus-on-pointer-down@2.0.5": + version "2.0.5" + resolved "https://registry.yarnpkg.com/@chakra-ui/react-use-focus-on-pointer-down/-/react-use-focus-on-pointer-down-2.0.5.tgz#81bf94ada866f3ddf3d72e50b6e4281a29e88196" + integrity sha512-xDQUp8s+a+0DgqOWdvKXgIZcyXH5RXKkC+qa0mbUJf54b9qLbrD6yw3o2jAvDEGa7vLBjaVY4jfOAdzt7+Na2g== dependencies: - "@chakra-ui/react-use-event-listener" "2.0.4" + "@chakra-ui/react-use-event-listener" "2.0.6" -"@chakra-ui/react-use-interval@2.0.2": - version "2.0.2" - resolved "https://registry.yarnpkg.com/@chakra-ui/react-use-interval/-/react-use-interval-2.0.2.tgz#6d1d5d5b5c5604ee2ea47f1e140e6eaf6e885df5" - integrity sha512-5U1c0pEB5n0Yri0E4RdFXWx2RVBZBBhD8Uu49dM33jkIguCbIPmZ+YgVry5DDzCHyz4RgDg4yZKOPK0PI8lEUg== +"@chakra-ui/react-use-interval@2.0.4": + version "2.0.4" + resolved "https://registry.yarnpkg.com/@chakra-ui/react-use-interval/-/react-use-interval-2.0.4.tgz#c4358e5e631e18872bda061b8cde48b3385aa641" + integrity sha512-LCS0CijCBEJW1dz2WQThGn+wPSaA6YWPEWeS2WmobbQhkjLbzEy2z8CIG5MeUopX8v6kDDnCMmIpocmrIyGGbA== dependencies: - "@chakra-ui/react-use-callback-ref" "2.0.4" + "@chakra-ui/react-use-callback-ref" "2.0.6" -"@chakra-ui/react-use-latest-ref@2.0.2": - version "2.0.2" - resolved "https://registry.yarnpkg.com/@chakra-ui/react-use-latest-ref/-/react-use-latest-ref-2.0.2.tgz#4895d3ae2dc93a660ed86aaec7021b729830d3d2" - integrity sha512-Ra/NMV+DSQ3n0AdKsyIqdgnFzls5UntabtIRfDXLrqmJ4tI0a1tDdop2qop0Ue87AcqD9P1KtQue4KPx7wCElw== - -"@chakra-ui/react-use-merge-refs@2.0.4": +"@chakra-ui/react-use-latest-ref@2.0.4": version "2.0.4" - resolved "https://registry.yarnpkg.com/@chakra-ui/react-use-merge-refs/-/react-use-merge-refs-2.0.4.tgz#c23f10fda1d3a6327a48708a8a7ad4b62ba918d3" - integrity sha512-aoWvtE5tDQNaLCiNUI6WV+MA2zVcCLR5mHSCISmowlTXyXOqOU5Fo9ZoUftzrmgCJpDu5x1jfUOivxuHUueb0g== + resolved "https://registry.yarnpkg.com/@chakra-ui/react-use-latest-ref/-/react-use-latest-ref-2.0.4.tgz#c35a3741f1ac2f9468bb3ea1333adce445e6068f" + integrity sha512-7xxQeu7PtFUEXbd+BZ+UMX9ASpJET02z9EgtqSfnMgB1ccgo/1i8CYI2/BcolwRf05EUD7kOUA+7eHyP4EI3Uw== -"@chakra-ui/react-use-outside-click@2.0.4": - version "2.0.4" - resolved "https://registry.yarnpkg.com/@chakra-ui/react-use-outside-click/-/react-use-outside-click-2.0.4.tgz#977d873cfedec615c8e3acd48fca7b094b464b6e" - integrity sha512-uerJKS8dqg2kHs1xozA5vcCqW0UInuwrfCPb+rDWBTpu7aEqxABMw9W3e4gfOABrAjhKz2I0a/bu2i8zbVwdLw== - dependencies: - "@chakra-ui/react-use-callback-ref" "2.0.4" +"@chakra-ui/react-use-merge-refs@2.0.6": + version "2.0.6" + resolved "https://registry.yarnpkg.com/@chakra-ui/react-use-merge-refs/-/react-use-merge-refs-2.0.6.tgz#be0279ee6070480d5b2699c732a7cfa9690c589b" + integrity sha512-m4fQtm5cn3F39nLj5MhmKsAzdFaYMldR8a4VMtfC2Pnd+bqX8jx2q2yPCjpam9x/Wnh8ZRBMJ2KAjAiGnF3XXw== -"@chakra-ui/react-use-pan-event@2.0.5": - version "2.0.5" - resolved "https://registry.yarnpkg.com/@chakra-ui/react-use-pan-event/-/react-use-pan-event-2.0.5.tgz#9269d4b798d1447e18b00ee0b28fa52c5c8efb26" - integrity sha512-nhE3b85++EEmBD2v6m46TLoA4LehSCZ349P8kvEjw/RC0K6XDOZndaBucIeAlnpEENSSUpczFfMSOLxSHdu0oA== +"@chakra-ui/react-use-outside-click@2.0.6": + version "2.0.6" + resolved "https://registry.yarnpkg.com/@chakra-ui/react-use-outside-click/-/react-use-outside-click-2.0.6.tgz#55f4d5dacc80c3c39fd7755fe7e142a841d99105" + integrity sha512-wbZI4zDwSiQ3jCZ++PKmv7uIU6oyEbaap8s6e3O9/JFAlPXxAG48DcSHmQZ8scyEu/wwd8A+/3go49T4VIvc7w== dependencies: - "@chakra-ui/event-utils" "2.0.5" - "@chakra-ui/react-use-latest-ref" "2.0.2" - framesync "5.3.0" + "@chakra-ui/react-use-callback-ref" "2.0.6" -"@chakra-ui/react-use-previous@2.0.2": - version "2.0.2" - resolved "https://registry.yarnpkg.com/@chakra-ui/react-use-previous/-/react-use-previous-2.0.2.tgz#1091ae8abc2082ab504e3742f8b1d75409ae7b27" - integrity sha512-ap/teLRPKopaHYD80fnf0TR/NpTWHJO5VdKg6sPyF1y5ediYLAzPT1G2OqMCj4QfJsYDctioT142URDYe0Nn7w== +"@chakra-ui/react-use-pan-event@2.0.8": + version "2.0.8" + resolved "https://registry.yarnpkg.com/@chakra-ui/react-use-pan-event/-/react-use-pan-event-2.0.8.tgz#88bd69d55c71be7d261ad3a8abe15d31a6b11380" + integrity sha512-HUn7WR9IagtC3KdjmBlHibnFYisQ055IoWReIEWuDz/5KWSPeC2p2QcMc33vhN/ucS1XbWCt6uelHHBeCWWvfA== + dependencies: + "@chakra-ui/event-utils" "2.0.7" + "@chakra-ui/react-use-latest-ref" "2.0.4" + framesync "6.1.2" -"@chakra-ui/react-use-safe-layout-effect@2.0.2": - version "2.0.2" - resolved "https://registry.yarnpkg.com/@chakra-ui/react-use-safe-layout-effect/-/react-use-safe-layout-effect-2.0.2.tgz#31088eeb4b2a6910251683ddb15fb855d6127adf" - integrity sha512-gl5HDq9RVeDJiT8udtpx12KRV8JPLJHDIUX8f/yZcKpXow0C7FFGg5Yy5I9397NQog5ZjKMuOg+AUq9TLJxsyQ== +"@chakra-ui/react-use-previous@2.0.4": + version "2.0.4" + resolved "https://registry.yarnpkg.com/@chakra-ui/react-use-previous/-/react-use-previous-2.0.4.tgz#9b73efce8ab82060ca31c26bc6128f896ec3a9a8" + integrity sha512-ZzILmNAoRVPDRFhKUceksQGETQyne4ST7W7Y5NPkr/OAJuzc2njodY0GjGiJTF2YpOSelRn6KB8MDhwp4XR2mw== -"@chakra-ui/react-use-size@2.0.4": +"@chakra-ui/react-use-safe-layout-effect@2.0.4": version "2.0.4" - resolved "https://registry.yarnpkg.com/@chakra-ui/react-use-size/-/react-use-size-2.0.4.tgz#3634782f8dab6aa2a37699188afa89251cbae8f3" - integrity sha512-W6rgTLuoSC4ovZtqYco8cG+yBadH3bhlg92T5lgpKDakSDr0mXcZdbGx6g0AOkgxXm0V1jWNGO1743wudtF7ew== - dependencies: - "@zag-js/element-size" "0.1.0" + resolved "https://registry.yarnpkg.com/@chakra-ui/react-use-safe-layout-effect/-/react-use-safe-layout-effect-2.0.4.tgz#5924c94dbaa3765a5f80931a6cf2cf3af094cc39" + integrity sha512-GbQIdhiesXZ8DV+JxiERz3/zki6PELhYPz/7JxyFUk8xInJnUcuEz2L4bV7rXIm9/bd2kjf4gfV+lHOGfpJdLw== -"@chakra-ui/react-use-timeout@2.0.2": - version "2.0.2" - resolved "https://registry.yarnpkg.com/@chakra-ui/react-use-timeout/-/react-use-timeout-2.0.2.tgz#f1378de0d5e01f7aee60d5b9ec3205e1fc7d2fc4" - integrity sha512-n6zb3OmxtDmRMxYkDgILqKh15aDOa8jNLHBlqHzmlL6mEGNKmMFPW9j/KvpAqSgKjUTDRnnXcpneprTMKy/yrw== +"@chakra-ui/react-use-size@2.0.7": + version "2.0.7" + resolved "https://registry.yarnpkg.com/@chakra-ui/react-use-size/-/react-use-size-2.0.7.tgz#52929bd292ff6c55471872eb0f32186d7cfe31d8" + integrity sha512-ggj8W0rer9oJ03xXrH4CUBNe6RZ/qtuU/32pMougeVWwZ3COGTODBtFlooIiy3iCvxrpHIgIDXy/hyrBWyvQSw== dependencies: - "@chakra-ui/react-use-callback-ref" "2.0.4" + "@zag-js/element-size" "0.3.0" -"@chakra-ui/react-use-update-effect@2.0.4": +"@chakra-ui/react-use-timeout@2.0.4": version "2.0.4" - resolved "https://registry.yarnpkg.com/@chakra-ui/react-use-update-effect/-/react-use-update-effect-2.0.4.tgz#522bc58b943fffe540a91f7a096d42e4a91b9748" - integrity sha512-F/I9LVnGAQyvww+x7tQb47wCwjhMYjpxtM1dTg1U3oCEXY0yF1Ts3NJLUAlsr3nAW6epJIwWx61niC7KWpam1w== + resolved "https://registry.yarnpkg.com/@chakra-ui/react-use-timeout/-/react-use-timeout-2.0.4.tgz#65e6e07f42f9c1c4165e5e8d6784215117f6b73a" + integrity sha512-7EqjJVRv61DmWb9UE4R9LPf3l1SDfawQ2/ax/e0lYpDBjaeV013wUH1uurRq8jn/vR1DhNzfRB5VtimE2f2Vsw== + dependencies: + "@chakra-ui/react-use-callback-ref" "2.0.6" + +"@chakra-ui/react-use-update-effect@2.0.6": + version "2.0.6" + resolved "https://registry.yarnpkg.com/@chakra-ui/react-use-update-effect/-/react-use-update-effect-2.0.6.tgz#8aacaab25fd181a52569336ca5ef797e8ae1026a" + integrity sha512-P6+0hocnasjl8xOrFH9BklyCNNzCBu/XAl5y7kZ82uVnS99SaC6cppO9/qWRZI9cYYheWfJ4lyLGeLOcNmI8/Q== "@chakra-ui/react-utils@1.2.3", "@chakra-ui/react-utils@^1.2.3": version "1.2.3" @@ -2278,12 +2305,12 @@ dependencies: "@chakra-ui/utils" "^1.10.4" -"@chakra-ui/react-utils@2.0.8": - version "2.0.8" - resolved "https://registry.yarnpkg.com/@chakra-ui/react-utils/-/react-utils-2.0.8.tgz#1db4e920386f4afbf44fe9dd8aaaf6f22eefb371" - integrity sha512-OSHHBKZlJWTi2NZcPnBx1PyZvLQY+n5RPBtcri7/89EDdAwz2NdEhp2Dz1yQRctOSCF1kB/rnCYDP1U0oRk9RQ== +"@chakra-ui/react-utils@2.0.11": + version "2.0.11" + resolved "https://registry.yarnpkg.com/@chakra-ui/react-utils/-/react-utils-2.0.11.tgz#5e99b21759eadc9276709268cca94c502afeda56" + integrity sha512-LdE0Ay5Em2ew7fuux9MJAwaxoaU/QwVoH/t6uiUw/JCWpmiMGY6tw6t3eZTvZSRZNfyPWY0MmvOHR1UvIS9JIw== dependencies: - "@chakra-ui/utils" "2.0.11" + "@chakra-ui/utils" "2.0.14" "@chakra-ui/react@^1.7.3": version "1.8.9" @@ -2338,60 +2365,61 @@ "@chakra-ui/utils" "1.10.4" "@chakra-ui/visually-hidden" "1.1.6" -"@chakra-ui/react@^2.2.1": - version "2.3.6" - resolved "https://registry.yarnpkg.com/@chakra-ui/react/-/react-2.3.6.tgz#a6d3e092cab433fcd9cf8e9876756818c4261df6" - integrity sha512-xo43UU+yMqRGHZLU4fSgzojeRl5stlIfT+GLbT9CUVEm0HMJCt2m8RsNPBvGOMzANdC+bzwSiOm+MNzQBi9IBQ== - dependencies: - "@chakra-ui/accordion" "2.1.2" - "@chakra-ui/alert" "2.0.11" - "@chakra-ui/avatar" "2.2.0" - "@chakra-ui/breadcrumb" "2.1.0" - "@chakra-ui/button" "2.0.11" - "@chakra-ui/checkbox" "2.2.2" - "@chakra-ui/close-button" "2.0.11" - "@chakra-ui/control-box" "2.0.10" - "@chakra-ui/counter" "2.0.10" - "@chakra-ui/css-reset" "2.0.8" - "@chakra-ui/editable" "2.0.13" - "@chakra-ui/form-control" "2.0.11" - "@chakra-ui/hooks" "2.1.0" - "@chakra-ui/icon" "3.0.11" - "@chakra-ui/image" "2.0.11" - "@chakra-ui/input" "2.0.12" - "@chakra-ui/layout" "2.1.9" - "@chakra-ui/live-region" "2.0.10" - "@chakra-ui/media-query" "3.2.7" - "@chakra-ui/menu" "2.1.2" - "@chakra-ui/modal" "2.2.2" - "@chakra-ui/number-input" "2.0.12" - "@chakra-ui/pin-input" "2.0.15" - "@chakra-ui/popover" "2.1.1" - "@chakra-ui/popper" "3.0.8" - "@chakra-ui/portal" "2.0.10" - "@chakra-ui/progress" "2.0.12" - "@chakra-ui/provider" "2.0.20" - "@chakra-ui/radio" "2.0.12" - "@chakra-ui/react-env" "2.0.10" - "@chakra-ui/select" "2.0.12" - "@chakra-ui/skeleton" "2.0.17" - "@chakra-ui/slider" "2.0.12" - "@chakra-ui/spinner" "2.0.10" - "@chakra-ui/stat" "2.0.11" - "@chakra-ui/styled-system" "2.3.4" - "@chakra-ui/switch" "2.0.14" - "@chakra-ui/system" "2.3.0" - "@chakra-ui/table" "2.0.11" - "@chakra-ui/tabs" "2.1.4" - "@chakra-ui/tag" "2.0.11" - "@chakra-ui/textarea" "2.0.12" - "@chakra-ui/theme" "2.1.14" - "@chakra-ui/theme-utils" "2.0.1" - "@chakra-ui/toast" "4.0.0" - "@chakra-ui/tooltip" "2.2.0" - "@chakra-ui/transition" "2.0.11" - "@chakra-ui/utils" "2.0.11" - "@chakra-ui/visually-hidden" "2.0.11" +"@chakra-ui/react@^2.4.4": + version "2.4.6" + resolved "https://registry.yarnpkg.com/@chakra-ui/react/-/react-2.4.6.tgz#c3baf75cd1e1c29cd42ae9f732251521df299a66" + integrity sha512-uz9QjjxJgf81fXcOWDiVo2rU/lWfThCDKW5UMlYX2OrrHko7OnwZ3r9oMlZFU/vAS71LWhKbjXicJmOwwls42g== + dependencies: + "@chakra-ui/accordion" "2.1.5" + "@chakra-ui/alert" "2.0.14" + "@chakra-ui/avatar" "2.2.2" + "@chakra-ui/breadcrumb" "2.1.2" + "@chakra-ui/button" "2.0.14" + "@chakra-ui/card" "2.1.4" + "@chakra-ui/checkbox" "2.2.7" + "@chakra-ui/close-button" "2.0.14" + "@chakra-ui/control-box" "2.0.12" + "@chakra-ui/counter" "2.0.12" + "@chakra-ui/css-reset" "2.0.11" + "@chakra-ui/editable" "2.0.17" + "@chakra-ui/form-control" "2.0.14" + "@chakra-ui/hooks" "2.1.4" + "@chakra-ui/icon" "3.0.14" + "@chakra-ui/image" "2.0.13" + "@chakra-ui/input" "2.0.16" + "@chakra-ui/layout" "2.1.12" + "@chakra-ui/live-region" "2.0.12" + "@chakra-ui/media-query" "3.2.9" + "@chakra-ui/menu" "2.1.6" + "@chakra-ui/modal" "2.2.6" + "@chakra-ui/number-input" "2.0.15" + "@chakra-ui/pin-input" "2.0.17" + "@chakra-ui/popover" "2.1.5" + "@chakra-ui/popper" "3.0.11" + "@chakra-ui/portal" "2.0.13" + "@chakra-ui/progress" "2.1.3" + "@chakra-ui/provider" "2.0.28" + "@chakra-ui/radio" "2.0.16" + "@chakra-ui/react-env" "2.0.12" + "@chakra-ui/select" "2.0.15" + "@chakra-ui/skeleton" "2.0.21" + "@chakra-ui/slider" "2.0.18" + "@chakra-ui/spinner" "2.0.12" + "@chakra-ui/stat" "2.0.14" + "@chakra-ui/styled-system" "2.5.1" + "@chakra-ui/switch" "2.0.19" + "@chakra-ui/system" "2.3.7" + "@chakra-ui/table" "2.0.14" + "@chakra-ui/tabs" "2.1.6" + "@chakra-ui/tag" "2.0.14" + "@chakra-ui/textarea" "2.0.15" + "@chakra-ui/theme" "2.2.4" + "@chakra-ui/theme-utils" "2.0.8" + "@chakra-ui/toast" "4.0.8" + "@chakra-ui/tooltip" "2.2.4" + "@chakra-ui/transition" "2.0.13" + "@chakra-ui/utils" "2.0.14" + "@chakra-ui/visually-hidden" "2.0.14" "@chakra-ui/select@1.2.11": version "1.2.11" @@ -2401,17 +2429,18 @@ "@chakra-ui/form-control" "1.6.0" "@chakra-ui/utils" "1.10.4" -"@chakra-ui/select@2.0.12": - version "2.0.12" - resolved "https://registry.yarnpkg.com/@chakra-ui/select/-/select-2.0.12.tgz#9b485e6a28c9aa468bc1c0d8a78aabd985b0c370" - integrity sha512-NCDMb0w48GYCHmazVSQ7/ysEpbnri+Up6n+v7yytf6g43TPRkikvK5CsVgLnAEj0lIdCJhWXTcZer5wG5KOEgA== +"@chakra-ui/select@2.0.15": + version "2.0.15" + resolved "https://registry.yarnpkg.com/@chakra-ui/select/-/select-2.0.15.tgz#30b8035540843b325d172ddd4cf6343e52f1c3c1" + integrity sha512-TdrkZNMyyZu1H/J/hn4Rqz7WES6cTLZfTqSIi0FtnmFMCiOmfLT317A0d783uwU/YnDGogjfTQ4aAAY2PEsgGw== dependencies: - "@chakra-ui/form-control" "2.0.11" + "@chakra-ui/form-control" "2.0.14" + "@chakra-ui/shared-utils" "2.0.4" -"@chakra-ui/shared-utils@2.0.2": - version "2.0.2" - resolved "https://registry.yarnpkg.com/@chakra-ui/shared-utils/-/shared-utils-2.0.2.tgz#1df08133194c12ac4df9302604ec37784c2bb026" - integrity sha512-wC58Fh6wCnFFQyiebVZ0NI7PFW9+Vch0QE6qN7iR+bLseOzQY9miYuzPJ1kMYiFd6QTOmPJkI39M3wHqrPYiOg== +"@chakra-ui/shared-utils@2.0.4": + version "2.0.4" + resolved "https://registry.yarnpkg.com/@chakra-ui/shared-utils/-/shared-utils-2.0.4.tgz#8661f2b48dd93d04151b10a894a4290c9d9a080c" + integrity sha512-JGWr+BBj3PXGZQ2gxbKSD1wYjESbYsZjkCeE2nevyVk4rN3amV1wQzCnBAhsuJktMaZD6KC/lteo9ou9QUDzpA== "@chakra-ui/skeleton@1.2.14": version "1.2.14" @@ -2423,13 +2452,14 @@ "@chakra-ui/system" "1.12.1" "@chakra-ui/utils" "1.10.4" -"@chakra-ui/skeleton@2.0.17": - version "2.0.17" - resolved "https://registry.yarnpkg.com/@chakra-ui/skeleton/-/skeleton-2.0.17.tgz#737e08f771980f5b73060dc6c940691e7759d044" - integrity sha512-dL7viXEKDEzmAJGbHMj+QbGl9PAd0VWztEcWcz5wOGfmAcJllA0lVh6NmG/yqLb6iXPCX4Y1Y0Yurm459TEYWg== +"@chakra-ui/skeleton@2.0.21": + version "2.0.21" + resolved "https://registry.yarnpkg.com/@chakra-ui/skeleton/-/skeleton-2.0.21.tgz#697bb66b9e7362f9f252717babc50c916903cc7b" + integrity sha512-ztHfV/6Mwl1Wl8H8fkAszMHnyobNZ4SjVD/rImBlKfqSh2VW8jzSwzqN77Oi6iZ7fsqdPN7w2QWS5EAtsUxTVw== dependencies: - "@chakra-ui/media-query" "3.2.7" - "@chakra-ui/react-use-previous" "2.0.2" + "@chakra-ui/media-query" "3.2.9" + "@chakra-ui/react-use-previous" "2.0.4" + "@chakra-ui/shared-utils" "2.0.4" "@chakra-ui/slider@1.5.11": version "1.5.11" @@ -2440,21 +2470,21 @@ "@chakra-ui/react-utils" "1.2.3" "@chakra-ui/utils" "1.10.4" -"@chakra-ui/slider@2.0.12": - version "2.0.12" - resolved "https://registry.yarnpkg.com/@chakra-ui/slider/-/slider-2.0.12.tgz#42fc5fe385c507276da29f4aa49a6408ee853978" - integrity sha512-Cna04J7e4+F3tJNb7tRNfPP+koicbDsKJBp+f1NpR32JbRzIfrf2Vdr4hfD5/uOfC4RGxnVInNZzZLGBelLtLw== - dependencies: - "@chakra-ui/number-utils" "2.0.4" - "@chakra-ui/react-context" "2.0.4" - "@chakra-ui/react-types" "2.0.3" - "@chakra-ui/react-use-callback-ref" "2.0.4" - "@chakra-ui/react-use-controllable-state" "2.0.5" - "@chakra-ui/react-use-latest-ref" "2.0.2" - "@chakra-ui/react-use-merge-refs" "2.0.4" - "@chakra-ui/react-use-pan-event" "2.0.5" - "@chakra-ui/react-use-size" "2.0.4" - "@chakra-ui/react-use-update-effect" "2.0.4" +"@chakra-ui/slider@2.0.18": + version "2.0.18" + resolved "https://registry.yarnpkg.com/@chakra-ui/slider/-/slider-2.0.18.tgz#0f4847298698bb0c5888add7f1bacec1d831e486" + integrity sha512-wfkW9Xe3WVK1yUY0ELAPVLghknxqzPjqidQgbiMSNlKxTs70sFuACsbbwMV+LMcE+2aUYOGOaqTFI8nPfVdbOw== + dependencies: + "@chakra-ui/number-utils" "2.0.6" + "@chakra-ui/react-context" "2.0.6" + "@chakra-ui/react-types" "2.0.6" + "@chakra-ui/react-use-callback-ref" "2.0.6" + "@chakra-ui/react-use-controllable-state" "2.0.7" + "@chakra-ui/react-use-latest-ref" "2.0.4" + "@chakra-ui/react-use-merge-refs" "2.0.6" + "@chakra-ui/react-use-pan-event" "2.0.8" + "@chakra-ui/react-use-size" "2.0.7" + "@chakra-ui/react-use-update-effect" "2.0.6" "@chakra-ui/spinner@1.2.6": version "1.2.6" @@ -2464,10 +2494,12 @@ "@chakra-ui/utils" "1.10.4" "@chakra-ui/visually-hidden" "1.1.6" -"@chakra-ui/spinner@2.0.10": - version "2.0.10" - resolved "https://registry.yarnpkg.com/@chakra-ui/spinner/-/spinner-2.0.10.tgz#f8b1b6f1c8f45e3aeab44d5ab1f1debc71e52573" - integrity sha512-SwId1xPaaFAaEYrR9eHkQHAuB66CbxwjWaQonEjeEUSh9ecxkd5WbXlsQSyf2hVRIqXJg0m3HIYblcKUsQt9Rw== +"@chakra-ui/spinner@2.0.12": + version "2.0.12" + resolved "https://registry.yarnpkg.com/@chakra-ui/spinner/-/spinner-2.0.12.tgz#275ba21dd2b4be29ecf31c64581167ac75f3b943" + integrity sha512-c9R0k7RUgff5g79Q5kX1mE4lsXqLKIskIbPksL7Qm3Zw/ZbDHyNILFFltPLt7350rC9mGzqzEZbizAFlksbdLw== + dependencies: + "@chakra-ui/shared-utils" "2.0.4" "@chakra-ui/stat@1.2.7": version "1.2.7" @@ -2478,13 +2510,14 @@ "@chakra-ui/utils" "1.10.4" "@chakra-ui/visually-hidden" "1.1.6" -"@chakra-ui/stat@2.0.11": - version "2.0.11" - resolved "https://registry.yarnpkg.com/@chakra-ui/stat/-/stat-2.0.11.tgz#0c052aee68486a892e09e802bb569dc984e31eae" - integrity sha512-ZPFK2fKufDSHD8bp/KhO3jLgW/b3PzdG4zV+7iTO7OYjxm5pkBfBAeMqfXGx4cl51rtWUKzsY0HV4vLLjcSjHw== +"@chakra-ui/stat@2.0.14": + version "2.0.14" + resolved "https://registry.yarnpkg.com/@chakra-ui/stat/-/stat-2.0.14.tgz#b20b78d345fbadb679cab218b5c75b7b56d4706e" + integrity sha512-VW92QvrRZDZAtUhPHWLhS0SzxVmElb6dRevVokzTm2sBQbkE1pkZnzoYuEkBx3t0QjxZj5YhqXR+CEkZFpM1rw== dependencies: - "@chakra-ui/icon" "3.0.11" - "@chakra-ui/react-context" "2.0.4" + "@chakra-ui/icon" "3.0.14" + "@chakra-ui/react-context" "2.0.6" + "@chakra-ui/shared-utils" "2.0.4" "@chakra-ui/styled-system@1.19.0": version "1.19.0" @@ -2494,11 +2527,12 @@ "@chakra-ui/utils" "1.10.4" csstype "3.0.9" -"@chakra-ui/styled-system@2.3.4": - version "2.3.4" - resolved "https://registry.yarnpkg.com/@chakra-ui/styled-system/-/styled-system-2.3.4.tgz#6022c5a675b54a69b1d3c2d3e60258901dc7b82a" - integrity sha512-Lozbedu+GBj4EbHB/eGv475SFDLApsIEN9gNKiZJBJAE1HIhHn3Seh1iZQSrHC/Beq+D5cQq3Z+yPn3bXtFU7w== +"@chakra-ui/styled-system@2.5.1": + version "2.5.1" + resolved "https://registry.yarnpkg.com/@chakra-ui/styled-system/-/styled-system-2.5.1.tgz#d76f0898d5036353947bc83afb2e1c3cad3d374a" + integrity sha512-HhaXR/r5eGlC7vkoOWQ31yZEj+Aq+kFee7ZZb0fBRGKQichn06S9Ugr8CsFyzb+jNexHdtBlIcTBm0ufJ8HsFA== dependencies: + "@chakra-ui/shared-utils" "2.0.4" csstype "^3.0.11" lodash.mergewith "4.6.2" @@ -2510,12 +2544,13 @@ "@chakra-ui/checkbox" "1.7.1" "@chakra-ui/utils" "1.10.4" -"@chakra-ui/switch@2.0.14": - version "2.0.14" - resolved "https://registry.yarnpkg.com/@chakra-ui/switch/-/switch-2.0.14.tgz#62372355bf73c19896b39fb7e75c132333c5a882" - integrity sha512-6lzhCkJq7vbD3yGaorGLp0ZZU4ewdKwAu0e62qR8TfYZwbcbpkXbBKloIHbA2XKOduISzS2WYqjmoP6jSKIxrA== +"@chakra-ui/switch@2.0.19": + version "2.0.19" + resolved "https://registry.yarnpkg.com/@chakra-ui/switch/-/switch-2.0.19.tgz#dd587b818d4adf2f2845532f3bd10f485ca5882a" + integrity sha512-mXEXrTQAfGnmgAeRcVvcgC98ZaB9/WBSpfVgVKLRVuLhv5XYwhffxxZb9Zqaa3eWb9iilxi3qQUtN0g/wu2G7w== dependencies: - "@chakra-ui/checkbox" "2.2.2" + "@chakra-ui/checkbox" "2.2.7" + "@chakra-ui/shared-utils" "2.0.4" "@chakra-ui/system@1.12.1": version "1.12.1" @@ -2528,16 +2563,16 @@ "@chakra-ui/utils" "1.10.4" react-fast-compare "3.2.0" -"@chakra-ui/system@2.3.0": - version "2.3.0" - resolved "https://registry.yarnpkg.com/@chakra-ui/system/-/system-2.3.0.tgz#b7ba122872d4d48806fbf994f1187680ae2296a6" - integrity sha512-BxikahglBI0uU8FE3anEorDTU5oKTUuBIEKVcQrEVnrbNuRJEy1OVYyCNXfqW3MpruRO9ypYV2bWt02AZZWEaQ== - dependencies: - "@chakra-ui/color-mode" "2.1.9" - "@chakra-ui/react-utils" "2.0.8" - "@chakra-ui/styled-system" "2.3.4" - "@chakra-ui/theme-utils" "2.0.1" - "@chakra-ui/utils" "2.0.11" +"@chakra-ui/system@2.3.7": + version "2.3.7" + resolved "https://registry.yarnpkg.com/@chakra-ui/system/-/system-2.3.7.tgz#31e8aade0ff43288c7dfe63dfce6be72cc049779" + integrity sha512-sUmLyo+zjv+Im56slRaQA5fw04y7JuVGKgGW8xcQan+jVtMI2gGBvnecOUeNNiEWglpW/pZ/AE9rgJX9dKkrkA== + dependencies: + "@chakra-ui/color-mode" "2.1.11" + "@chakra-ui/react-utils" "2.0.11" + "@chakra-ui/styled-system" "2.5.1" + "@chakra-ui/theme-utils" "2.0.8" + "@chakra-ui/utils" "2.0.14" react-fast-compare "3.2.0" "@chakra-ui/table@1.3.6": @@ -2547,12 +2582,13 @@ dependencies: "@chakra-ui/utils" "1.10.4" -"@chakra-ui/table@2.0.11": - version "2.0.11" - resolved "https://registry.yarnpkg.com/@chakra-ui/table/-/table-2.0.11.tgz#9bd25d5383c94982b89e792675bc1d1f667f81f3" - integrity sha512-zQTiqPKEgjdeO/PG0FByn0fH4sPF7dLJF+YszrIzDc6wvpD96iY6MYLeV+CSelbH1g0/uibcJ10PSaFStfGUZg== +"@chakra-ui/table@2.0.14": + version "2.0.14" + resolved "https://registry.yarnpkg.com/@chakra-ui/table/-/table-2.0.14.tgz#f2d6a4e66e1c07ffa850050bc7ff15e7ea114bbd" + integrity sha512-tiRr//5GfFnpCz4PyVgEIWBMsePAM1SWfvAJJYG2wBXNULYB/5nYmch+cJzPqZtdgL2/RuKIJINAmqVZQVddrw== dependencies: - "@chakra-ui/react-context" "2.0.4" + "@chakra-ui/react-context" "2.0.6" + "@chakra-ui/shared-utils" "2.0.4" "@chakra-ui/tabs@1.6.11": version "1.6.11" @@ -2565,19 +2601,20 @@ "@chakra-ui/react-utils" "1.2.3" "@chakra-ui/utils" "1.10.4" -"@chakra-ui/tabs@2.1.4": - version "2.1.4" - resolved "https://registry.yarnpkg.com/@chakra-ui/tabs/-/tabs-2.1.4.tgz#38d9748ce2cfa583a123c0f695ea1cbce1a6bd42" - integrity sha512-/CQGj1lC9lvruT5BCYZH6Ok64W4CDSysDXuR2XPZXIih9kVOdXQEMXxG8+3vc63WqTBjHuURtZI0g8ouOy84ew== - dependencies: - "@chakra-ui/clickable" "2.0.10" - "@chakra-ui/descendant" "3.0.10" - "@chakra-ui/lazy-utils" "2.0.2" - "@chakra-ui/react-children-utils" "2.0.3" - "@chakra-ui/react-context" "2.0.4" - "@chakra-ui/react-use-controllable-state" "2.0.5" - "@chakra-ui/react-use-merge-refs" "2.0.4" - "@chakra-ui/react-use-safe-layout-effect" "2.0.2" +"@chakra-ui/tabs@2.1.6": + version "2.1.6" + resolved "https://registry.yarnpkg.com/@chakra-ui/tabs/-/tabs-2.1.6.tgz#f812b4f25c1a3a193e73c51da822b501d0b6e32f" + integrity sha512-9y+ZBRSBFOvsMY8R+nmlWXqMNwokttA1cwcnjp9djsXuN+vabN8nzPcdKsoBbYUhZJp01k2Qgg3jZ46KiD9n7w== + dependencies: + "@chakra-ui/clickable" "2.0.12" + "@chakra-ui/descendant" "3.0.12" + "@chakra-ui/lazy-utils" "2.0.4" + "@chakra-ui/react-children-utils" "2.0.5" + "@chakra-ui/react-context" "2.0.6" + "@chakra-ui/react-use-controllable-state" "2.0.7" + "@chakra-ui/react-use-merge-refs" "2.0.6" + "@chakra-ui/react-use-safe-layout-effect" "2.0.4" + "@chakra-ui/shared-utils" "2.0.4" "@chakra-ui/tag@1.2.7": version "1.2.7" @@ -2587,13 +2624,13 @@ "@chakra-ui/icon" "2.0.5" "@chakra-ui/utils" "1.10.4" -"@chakra-ui/tag@2.0.11": - version "2.0.11" - resolved "https://registry.yarnpkg.com/@chakra-ui/tag/-/tag-2.0.11.tgz#14702adf5d1456dbbb84ea7a4b314953b92c323f" - integrity sha512-iJJcX+4hl+6Se/8eCRzG+xxDwZfiYgc4Ly/8s93M0uW2GLb+ybbfSE2DjeKSyk3mQVeGzuxGkBfDHH2c2v26ew== +"@chakra-ui/tag@2.0.14": + version "2.0.14" + resolved "https://registry.yarnpkg.com/@chakra-ui/tag/-/tag-2.0.14.tgz#39962486af69e2bb548a5678095762e67e41369d" + integrity sha512-f6XU7GwTJkPDXU66Qbq8sS2i4dNb1pmeW2T1AFnzDZLI3kNLjw5B6tgW1HGr26/oq9Xu8aGNqAp0yGy9bAfeAA== dependencies: - "@chakra-ui/icon" "3.0.11" - "@chakra-ui/react-context" "2.0.4" + "@chakra-ui/icon" "3.0.14" + "@chakra-ui/react-context" "2.0.6" "@chakra-ui/textarea@1.2.11": version "1.2.11" @@ -2603,12 +2640,13 @@ "@chakra-ui/form-control" "1.6.0" "@chakra-ui/utils" "1.10.4" -"@chakra-ui/textarea@2.0.12": - version "2.0.12" - resolved "https://registry.yarnpkg.com/@chakra-ui/textarea/-/textarea-2.0.12.tgz#469c1d64cb855b3b534dcd7fcc1d927e60da8da1" - integrity sha512-msR9YMynRXwZIqR6DgjQ2MogA/cW1syBx/R0v3es+9Zx8zlbuKdoLhYqajHteCup8dUzTeIH2Vs2vAwgq4wu5A== +"@chakra-ui/textarea@2.0.15": + version "2.0.15" + resolved "https://registry.yarnpkg.com/@chakra-ui/textarea/-/textarea-2.0.15.tgz#f63e17aaca54cac19148b219c33ec91d2133c60c" + integrity sha512-qARh+MgeP1HSOV4oEZK5JwvQIq3gMC3kU1giMGasjsLTDjNPZiVMGpj91Z+mYB0C3IdbJhIuQCo1eM5QAL/QHg== dependencies: - "@chakra-ui/form-control" "2.0.11" + "@chakra-ui/form-control" "2.0.14" + "@chakra-ui/shared-utils" "2.0.4" "@chakra-ui/theme-tools@1.3.6", "@chakra-ui/theme-tools@^1.3.6": version "1.3.6" @@ -2618,21 +2656,23 @@ "@chakra-ui/utils" "1.10.4" "@ctrl/tinycolor" "^3.4.0" -"@chakra-ui/theme-tools@2.0.12": - version "2.0.12" - resolved "https://registry.yarnpkg.com/@chakra-ui/theme-tools/-/theme-tools-2.0.12.tgz#b29d9fb626d35e3b00f532c64f95ea261d8f6997" - integrity sha512-mnMlKSmXkCjHUJsKWmJbgBTGF2vnLaMLv1ihkBn5eQcCubMQrBLTiMAEFl5pZdzuHItU6QdnLGA10smcXbNl0g== +"@chakra-ui/theme-tools@2.0.16": + version "2.0.16" + resolved "https://registry.yarnpkg.com/@chakra-ui/theme-tools/-/theme-tools-2.0.16.tgz#17caae14a61f93759f072b16c7346489eb8be643" + integrity sha512-B/LD+2LNDeHYd/LVCHIJqckVZfhrycTUpNbhRVAiDRaS0AAcsPxKas7liTFkkMkM076YjiHlcla3KpVX+E9tzg== dependencies: - "@chakra-ui/anatomy" "2.0.7" - "@ctrl/tinycolor" "^3.4.0" + "@chakra-ui/anatomy" "2.1.1" + "@chakra-ui/shared-utils" "2.0.4" + color2k "^2.0.0" -"@chakra-ui/theme-utils@2.0.1": - version "2.0.1" - resolved "https://registry.yarnpkg.com/@chakra-ui/theme-utils/-/theme-utils-2.0.1.tgz#a3dc99331ba943e155dd683fe25ce302e3084db0" - integrity sha512-NDwzgTPxm+v3PAJlSSU1MORHLMqO9vsRJ+ObELD5wpvE9aEyRziN/AZSoK2oLwCQMPEiU7R99K5ij1E6ptMt7w== +"@chakra-ui/theme-utils@2.0.8": + version "2.0.8" + resolved "https://registry.yarnpkg.com/@chakra-ui/theme-utils/-/theme-utils-2.0.8.tgz#e0eb3f2fb888f11e060ad42a4b14f0ecea3f2f4d" + integrity sha512-E4GT1tT5JTwsxRCgopdkLWx6oxd1lrI7DBLiwW0WxvtPmHfy5I9CB4CVnYBNHQZNXiJZyUQpCwKyGg2npGxv5Q== dependencies: - "@chakra-ui/styled-system" "2.3.4" - "@chakra-ui/theme" "2.1.14" + "@chakra-ui/shared-utils" "2.0.4" + "@chakra-ui/styled-system" "2.5.1" + "@chakra-ui/theme" "2.2.4" lodash.mergewith "4.6.2" "@chakra-ui/theme@1.14.1": @@ -2644,13 +2684,14 @@ "@chakra-ui/theme-tools" "1.3.6" "@chakra-ui/utils" "1.10.4" -"@chakra-ui/theme@2.1.14": - version "2.1.14" - resolved "https://registry.yarnpkg.com/@chakra-ui/theme/-/theme-2.1.14.tgz#4726d65a65515f8ee96b5f2a725d0d17804ddfc9" - integrity sha512-6EYJCQlrjSjNAJvZmw1un50F8+sQDFsdwu/7UzWe+TeANpKlz4ZcHbh0gkl3PD62lGis+ehITUwqRm8htvDOjw== +"@chakra-ui/theme@2.2.4": + version "2.2.4" + resolved "https://registry.yarnpkg.com/@chakra-ui/theme/-/theme-2.2.4.tgz#69948ebf19ae1387b9e5022aca1e58c881658b77" + integrity sha512-zo1FBfkJBsvpOGGByRB4aEvekdeT/9BB7Lz3rAluKkC+Wo8yce1tTSlvPMpf2f4lsEI8zVid5ATQ6u3+kIFg4w== dependencies: - "@chakra-ui/anatomy" "2.0.7" - "@chakra-ui/theme-tools" "2.0.12" + "@chakra-ui/anatomy" "2.1.1" + "@chakra-ui/shared-utils" "2.0.4" + "@chakra-ui/theme-tools" "2.0.16" "@chakra-ui/toast@1.5.9": version "1.5.9" @@ -2665,18 +2706,19 @@ "@chakra-ui/utils" "1.10.4" "@reach/alert" "0.13.2" -"@chakra-ui/toast@4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@chakra-ui/toast/-/toast-4.0.0.tgz#797c34c4ecfcad7c6899c1cda221af0ff04d5d0b" - integrity sha512-abeeloJac5T9WK2IN76fEM5FSRH+erNXln2HqDf5wLBn33avSBXWyTiUL8riVSUqto0lrIn6FuK/MmKo0DH4og== - dependencies: - "@chakra-ui/alert" "2.0.11" - "@chakra-ui/close-button" "2.0.11" - "@chakra-ui/portal" "2.0.10" - "@chakra-ui/react-use-timeout" "2.0.2" - "@chakra-ui/react-use-update-effect" "2.0.4" - "@chakra-ui/styled-system" "2.3.4" - "@chakra-ui/theme" "2.1.14" +"@chakra-ui/toast@4.0.8": + version "4.0.8" + resolved "https://registry.yarnpkg.com/@chakra-ui/toast/-/toast-4.0.8.tgz#578b34a0916afa891ddde9317e4c2d83d1a4832d" + integrity sha512-g50kEZvrApkcNdm9ssccE9YYFsPMwTWz5IwUEFBJ2iSrEaTz5rikq/F2CP+oRu2vq22RPvczoOUnSaXE8GRzww== + dependencies: + "@chakra-ui/alert" "2.0.14" + "@chakra-ui/close-button" "2.0.14" + "@chakra-ui/portal" "2.0.13" + "@chakra-ui/react-use-timeout" "2.0.4" + "@chakra-ui/react-use-update-effect" "2.0.6" + "@chakra-ui/shared-utils" "2.0.4" + "@chakra-ui/styled-system" "2.5.1" + "@chakra-ui/theme" "2.2.4" "@chakra-ui/tooltip@1.5.1": version "1.5.1" @@ -2690,17 +2732,18 @@ "@chakra-ui/utils" "1.10.4" "@chakra-ui/visually-hidden" "1.1.6" -"@chakra-ui/tooltip@2.2.0": - version "2.2.0" - resolved "https://registry.yarnpkg.com/@chakra-ui/tooltip/-/tooltip-2.2.0.tgz#24e005f831cddf1c0e41dd246ed2771a97b8637c" - integrity sha512-oB97aQJBW+U3rRIt1ct7NaDRMnbW16JQ5ZBCl3BzN1VJWO3djiNuscpjVdZSceb+FdGSFo+GoDozp1ZwqdfFeQ== +"@chakra-ui/tooltip@2.2.4": + version "2.2.4" + resolved "https://registry.yarnpkg.com/@chakra-ui/tooltip/-/tooltip-2.2.4.tgz#41ac464d99da49c4a6217c02793f063c6d24152d" + integrity sha512-KUEsSjIwTyFvdixWg3jVUcpaiAfMddRxiuxnsKcFVv8H5dZF75tstaq8iAHY+pueh6CRmIvO2Oh7XWiAYA/LJA== dependencies: - "@chakra-ui/popper" "3.0.8" - "@chakra-ui/portal" "2.0.10" - "@chakra-ui/react-types" "2.0.3" - "@chakra-ui/react-use-disclosure" "2.0.5" - "@chakra-ui/react-use-event-listener" "2.0.4" - "@chakra-ui/react-use-merge-refs" "2.0.4" + "@chakra-ui/popper" "3.0.11" + "@chakra-ui/portal" "2.0.13" + "@chakra-ui/react-types" "2.0.6" + "@chakra-ui/react-use-disclosure" "2.0.7" + "@chakra-ui/react-use-event-listener" "2.0.6" + "@chakra-ui/react-use-merge-refs" "2.0.6" + "@chakra-ui/shared-utils" "2.0.4" "@chakra-ui/transition@1.4.8": version "1.4.8" @@ -2709,10 +2752,12 @@ dependencies: "@chakra-ui/utils" "1.10.4" -"@chakra-ui/transition@2.0.11": - version "2.0.11" - resolved "https://registry.yarnpkg.com/@chakra-ui/transition/-/transition-2.0.11.tgz#b2cfeb2150871c635cb9d03d9b525481dbe56f56" - integrity sha512-O0grc162LARPurjz1R+J+zr4AAKsVwN5+gaqLfZLMWg6TpvczJhwEA2fLCNAdkC/gomere390bJsy52xfUacUw== +"@chakra-ui/transition@2.0.13": + version "2.0.13" + resolved "https://registry.yarnpkg.com/@chakra-ui/transition/-/transition-2.0.13.tgz#54da88debdd528c2d41f04809e3b9448106e274f" + integrity sha512-vpzK5HN91eDLkBEdaO6GTCJOYgJYHlmxCAym/tScBuWM2ALZ4mWu57qWgPptgGv+IpMfuvL1t+IVqPgyWwEQFw== + dependencies: + "@chakra-ui/shared-utils" "2.0.4" "@chakra-ui/utils@1.10.4", "@chakra-ui/utils@^1.10.4": version "1.10.4" @@ -2724,14 +2769,14 @@ framesync "5.3.0" lodash.mergewith "4.6.2" -"@chakra-ui/utils@2.0.11": - version "2.0.11" - resolved "https://registry.yarnpkg.com/@chakra-ui/utils/-/utils-2.0.11.tgz#8e773f900a8356bd10c48b59151a781dba1c7b70" - integrity sha512-4ZQdK6tbOuTrUCsAQBHWo7tw5/Q6pBV93ZbVpats61cSWMFGv32AIQw9/hA4un2zDeSWN9ZMVLNjAY2Dq/KQOA== +"@chakra-ui/utils@2.0.14": + version "2.0.14" + resolved "https://registry.yarnpkg.com/@chakra-ui/utils/-/utils-2.0.14.tgz#b6776c7a020ea46ed88a8048dfa2b512a1fe95f7" + integrity sha512-vYxtAUPY09Ex2Ae2ZvQKA1d2+lMKq/wUaRiqpwmeLfutEQuPQZc3qzQcAIMRQx3wLgXr9BUFDtHgBoOz0XKtZw== dependencies: "@types/lodash.mergewith" "4.6.6" css-box-model "1.2.1" - framesync "5.3.0" + framesync "6.1.2" lodash.mergewith "4.6.2" "@chakra-ui/visually-hidden@1.1.6": @@ -2741,10 +2786,10 @@ dependencies: "@chakra-ui/utils" "1.10.4" -"@chakra-ui/visually-hidden@2.0.11": - version "2.0.11" - resolved "https://registry.yarnpkg.com/@chakra-ui/visually-hidden/-/visually-hidden-2.0.11.tgz#b2eb236e803451b39cdfcce3c5ab52e773c066a3" - integrity sha512-e+5amYvnsmEQdiWH4XMyvrtGTdwz//+48vwj5CsNWWcselzkwqodmciy5rIrT71/SCQDOtmgnL7ZWAUOffxfsQ== +"@chakra-ui/visually-hidden@2.0.14": + version "2.0.14" + resolved "https://registry.yarnpkg.com/@chakra-ui/visually-hidden/-/visually-hidden-2.0.14.tgz#c54feca28e8110a1d92ba2c718272931d0e181e2" + integrity sha512-/evqTuCeN3laukL1BPZO8HTzgs+dzq0v6gu/MJFgiSAKGLfInn0/IStKGK2vIluuCtJIgaHVdKcJzr+7sJhd0Q== "@cspotcode/source-map-support@^0.8.0": version "0.8.1" @@ -3434,6 +3479,59 @@ package-json-validator "^0.6.3" requireindex "^1.2.0" +"@motionone/animation@^10.12.0": + version "10.15.1" + resolved "https://registry.yarnpkg.com/@motionone/animation/-/animation-10.15.1.tgz#4a85596c31cbc5100ae8eb8b34c459fb0ccf6807" + integrity sha512-mZcJxLjHor+bhcPuIFErMDNyrdb2vJur8lSfMCsuCB4UyV8ILZLvK+t+pg56erv8ud9xQGK/1OGPt10agPrCyQ== + dependencies: + "@motionone/easing" "^10.15.1" + "@motionone/types" "^10.15.1" + "@motionone/utils" "^10.15.1" + tslib "^2.3.1" + +"@motionone/dom@10.12.0": + version "10.12.0" + resolved "https://registry.yarnpkg.com/@motionone/dom/-/dom-10.12.0.tgz#ae30827fd53219efca4e1150a5ff2165c28351ed" + integrity sha512-UdPTtLMAktHiqV0atOczNYyDd/d8Cf5fFsd1tua03PqTwwCe/6lwhLSQ8a7TbnQ5SN0gm44N1slBfj+ORIhrqw== + dependencies: + "@motionone/animation" "^10.12.0" + "@motionone/generators" "^10.12.0" + "@motionone/types" "^10.12.0" + "@motionone/utils" "^10.12.0" + hey-listen "^1.0.8" + tslib "^2.3.1" + +"@motionone/easing@^10.15.1": + version "10.15.1" + resolved "https://registry.yarnpkg.com/@motionone/easing/-/easing-10.15.1.tgz#95cf3adaef34da6deebb83940d8143ede3deb693" + integrity sha512-6hIHBSV+ZVehf9dcKZLT7p5PEKHGhDwky2k8RKkmOvUoYP3S+dXsKupyZpqx5apjd9f+php4vXk4LuS+ADsrWw== + dependencies: + "@motionone/utils" "^10.15.1" + tslib "^2.3.1" + +"@motionone/generators@^10.12.0": + version "10.15.1" + resolved "https://registry.yarnpkg.com/@motionone/generators/-/generators-10.15.1.tgz#dc6abb11139d1bafe758a41c134d4c753a9b871c" + integrity sha512-67HLsvHJbw6cIbLA/o+gsm7h+6D4Sn7AUrB/GPxvujse1cGZ38F5H7DzoH7PhX+sjvtDnt2IhFYF2Zp1QTMKWQ== + dependencies: + "@motionone/types" "^10.15.1" + "@motionone/utils" "^10.15.1" + tslib "^2.3.1" + +"@motionone/types@^10.12.0", "@motionone/types@^10.15.1": + version "10.15.1" + resolved "https://registry.yarnpkg.com/@motionone/types/-/types-10.15.1.tgz#89441b54285012795cbba8612cbaa0fa420db3eb" + integrity sha512-iIUd/EgUsRZGrvW0jqdst8st7zKTzS9EsKkP+6c6n4MPZoQHwiHuVtTQLD6Kp0bsBLhNzKIBlHXponn/SDT4hA== + +"@motionone/utils@^10.12.0", "@motionone/utils@^10.15.1": + version "10.15.1" + resolved "https://registry.yarnpkg.com/@motionone/utils/-/utils-10.15.1.tgz#6b5f51bde75be88b5411e084310299050368a438" + integrity sha512-p0YncgU+iklvYr/Dq4NobTRdAPv9PveRDUXabPEeOjBLSO/1FNB2phNTZxOxpi1/GZwYpAoECEa0Wam+nsmhSw== + dependencies: + "@motionone/types" "^10.15.1" + hey-listen "^1.0.8" + tslib "^2.3.1" + "@next/env@12.3.1": version "12.3.1" resolved "https://registry.yarnpkg.com/@next/env/-/env-12.3.1.tgz#18266bd92de3b4aa4037b1927aa59e6f11879260" @@ -5460,15 +5558,15 @@ resolved "https://registry.yarnpkg.com/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz#e77a97fbd345b76d83245edcd17d393b1b41fb31" integrity sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ== -"@zag-js/element-size@0.1.0": - version "0.1.0" - resolved "https://registry.yarnpkg.com/@zag-js/element-size/-/element-size-0.1.0.tgz#dfdb3f66a70328d0c3149aae29b8f99c10590c22" - integrity sha512-QF8wp0+V8++z+FHXiIw93+zudtubYszOtYbNgK39fg3pi+nCZtuSm4L1jC5QZMatNZ83MfOzyNCfgUubapagJQ== +"@zag-js/element-size@0.3.0": + version "0.3.0" + resolved "https://registry.yarnpkg.com/@zag-js/element-size/-/element-size-0.3.0.tgz#1c0ab23c9ada453f5778c4baf1eed46218dc9e85" + integrity sha512-5/hEI+0c6ZNCx6KHlOS5/WeHsd6+I7gk7Y/b/zATp4Rp3tHirs/tu1frq+iy5BmfaG9hbQtfHfUJTjOcI5jnoQ== -"@zag-js/focus-visible@0.1.0": - version "0.1.0" - resolved "https://registry.yarnpkg.com/@zag-js/focus-visible/-/focus-visible-0.1.0.tgz#9777bbaff8316d0b3a14a9095631e1494f69dbc7" - integrity sha512-PeaBcTmdZWcFf7n1aM+oiOdZc+sy14qi0emPIeUuGMTjbP0xLGrZu43kdpHnWSXy7/r4Ubp/vlg50MCV8+9Isg== +"@zag-js/focus-visible@0.2.1": + version "0.2.1" + resolved "https://registry.yarnpkg.com/@zag-js/focus-visible/-/focus-visible-0.2.1.tgz#bf4f1009f4fd35a9728dfaa9214d8cb318fe8b1e" + integrity sha512-19uTjoZGP4/Ax7kSNhhay9JA83BirKzpqLkeEAilrpdI1hE5xuq6q+tzJOsrMOOqJrm7LkmZp5lbsTQzvK2pYg== JSONStream@^1.2.1, JSONStream@^1.3.5: version "1.3.5" @@ -7123,6 +7221,11 @@ color-support@^1.1.2, color-support@^1.1.3: resolved "https://registry.yarnpkg.com/color-support/-/color-support-1.1.3.tgz#93834379a1cc9a0c61f82f52f0d04322251bd5a2" integrity sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg== +color2k@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/color2k/-/color2k-2.0.0.tgz#86992c82e248c29f524023ed0822bc152c4fa670" + integrity sha512-DWX9eXOC4fbJNiuvdH4QSHvvfLWyFo9TuFp7V9OzdsbPAdrWAuYc8qvFP2bIQ/LKh4LrAVnJ6vhiQYPvAHdtTg== + colord@^2.9.1: version "2.9.3" resolved "https://registry.yarnpkg.com/colord/-/colord-2.9.3.tgz#4f8ce919de456f1d5c1c368c307fe20f3e59fb43" @@ -9566,15 +9669,16 @@ fragment-cache@^0.2.1: dependencies: map-cache "^0.2.2" -framer-motion@^4: - version "4.1.17" - resolved "https://registry.yarnpkg.com/framer-motion/-/framer-motion-4.1.17.tgz#4029469252a62ea599902e5a92b537120cc89721" - integrity sha512-thx1wvKzblzbs0XaK2X0G1JuwIdARcoNOW7VVwjO8BUltzXPyONGAElLu6CiCScsOQRI7FIk/45YTFtJw5Yozw== +framer-motion@^6: + version "6.5.1" + resolved "https://registry.yarnpkg.com/framer-motion/-/framer-motion-6.5.1.tgz#802448a16a6eb764124bf36d8cbdfa6dd6b931a7" + integrity sha512-o1BGqqposwi7cgDrtg0dNONhkmPsUFDaLcKXigzuTFC5x58mE8iyTazxSudFzmT6MEyJKfjjU8ItoMe3W+3fiw== dependencies: - framesync "5.3.0" + "@motionone/dom" "10.12.0" + framesync "6.0.1" hey-listen "^1.0.8" - popmotion "9.3.6" - style-value-types "4.1.4" + popmotion "11.0.3" + style-value-types "5.0.0" tslib "^2.1.0" optionalDependencies: "@emotion/is-prop-valid" "^0.8.2" @@ -9586,6 +9690,20 @@ framesync@5.3.0: dependencies: tslib "^2.1.0" +framesync@6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/framesync/-/framesync-6.0.1.tgz#5e32fc01f1c42b39c654c35b16440e07a25d6f20" + integrity sha512-fUY88kXvGiIItgNC7wcTOl0SNRCVXMKSWW2Yzfmn7EKNc+MpCzcz9DhdHcdjbrtN3c6R4H5dTY2jiCpPdysEjA== + dependencies: + tslib "^2.1.0" + +framesync@6.1.2: + version "6.1.2" + resolved "https://registry.yarnpkg.com/framesync/-/framesync-6.1.2.tgz#755eff2fb5b8f3b4d2b266dd18121b300aefea27" + integrity sha512-jBTqhX6KaQVDyus8muwZbBeGGP0XgujBRbQ7gM7BRdS3CadCZIHiawyzYLnafYcvZIh5j8WE7cxZKFn7dXhu9g== + dependencies: + tslib "2.4.0" + from2@^2.1.0: version "2.3.0" resolved "https://registry.yarnpkg.com/from2/-/from2-2.3.0.tgz#8bfb5502bde4a4d36cfdeea007fcca21d7e382af" @@ -14052,14 +14170,14 @@ please-upgrade-node@^3.2.0: dependencies: semver-compare "^1.0.0" -popmotion@9.3.6: - version "9.3.6" - resolved "https://registry.yarnpkg.com/popmotion/-/popmotion-9.3.6.tgz#b5236fa28f242aff3871b9e23721f093133248d1" - integrity sha512-ZTbXiu6zIggXzIliMi8LGxXBF5ST+wkpXGEjeTUDUOCdSQ356hij/xjeUdv0F8zCQNeqB1+PR5/BB+gC+QLAPw== +popmotion@11.0.3: + version "11.0.3" + resolved "https://registry.yarnpkg.com/popmotion/-/popmotion-11.0.3.tgz#565c5f6590bbcddab7a33a074bb2ba97e24b0cc9" + integrity sha512-Y55FLdj3UxkR7Vl3s7Qr4e9m0onSnP8W7d/xQLsoJM40vs6UKHFdygs6SWryasTZYqugMjm3BepCF4CWXDiHgA== dependencies: - framesync "5.3.0" + framesync "6.0.1" hey-listen "^1.0.8" - style-value-types "4.1.4" + style-value-types "5.0.0" tslib "^2.1.0" posix-character-classes@^0.1.0: @@ -16347,10 +16465,10 @@ style-loader@^1.3.0: loader-utils "^2.0.0" schema-utils "^2.7.0" -style-value-types@4.1.4: - version "4.1.4" - resolved "https://registry.yarnpkg.com/style-value-types/-/style-value-types-4.1.4.tgz#80f37cb4fb024d6394087403dfb275e8bb627e75" - integrity sha512-LCJL6tB+vPSUoxgUBt9juXIlNJHtBMy8jkXzUJSBzeHWdBu6lhzHqCvLVkXFGsFIlNa2ln1sQHya/gzaFmB2Lg== +style-value-types@5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/style-value-types/-/style-value-types-5.0.0.tgz#76c35f0e579843d523187989da866729411fc8ad" + integrity sha512-08yq36Ikn4kx4YU6RD7jWEv27v4V+PUsOGa4n/as8Et3CuODMJQ00ENeAVXAeydX4Z2j1XHZF1K2sX4mGl18fA== dependencies: hey-listen "^1.0.8" tslib "^2.1.0" @@ -16853,16 +16971,16 @@ tslib@2.1.0: resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.1.0.tgz#da60860f1c2ecaa5703ab7d39bc05b6bf988b97a" integrity sha512-hcVC3wYEziELGGmEEXue7D75zbwIIVUMWAVbHItGPx0ziyXxrOMQx4rQEVEV45Ut/1IotuEvwqPopzIOkDMf0A== +tslib@2.4.0, tslib@^2, tslib@^2.0.0, tslib@^2.0.3, tslib@^2.1.0, tslib@^2.3.1, tslib@^2.4.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.0.tgz#7cecaa7f073ce680a05847aa77be941098f36dc3" + integrity sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ== + tslib@^1, tslib@^1.0.0, tslib@^1.14.1, tslib@^1.8.1, tslib@^1.9.0, tslib@^1.9.3: version "1.14.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== -tslib@^2, tslib@^2.0.0, tslib@^2.0.3, tslib@^2.1.0, tslib@^2.3.1, tslib@^2.4.0: - version "2.4.0" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.0.tgz#7cecaa7f073ce680a05847aa77be941098f36dc3" - integrity sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ== - tsutils@3.21.0, tsutils@^3.17.1, tsutils@^3.21.0: version "3.21.0" resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.21.0.tgz#b48717d394cea6c1e096983eed58e9d61715b623" From 46f5c66a7529c7ed94e7fae4e0d2c3aa788feed5 Mon Sep 17 00:00:00 2001 From: Ketan Reddy Date: Thu, 5 Jan 2023 14:22:44 -0800 Subject: [PATCH 05/52] WIP: scaffold for filling in required properties on assets --- drag-and-drop/app/pages/index.tsx | 7 ++ drag-and-drop/library/src/controller.tsx | 75 ++++++++++--------- .../library/src/utils/player-dnd-plugin.ts | 14 ++-- .../library/src/utils/runtime-flow-state.ts | 48 ++++++++++-- 4 files changed, 99 insertions(+), 45 deletions(-) diff --git a/drag-and-drop/app/pages/index.tsx b/drag-and-drop/app/pages/index.tsx index d2de3a4d..e23fe0fa 100644 --- a/drag-and-drop/app/pages/index.tsx +++ b/drag-and-drop/app/pages/index.tsx @@ -106,6 +106,13 @@ const config: DragAndDropControllerOptions = { manifest: pluginManifest as TSManifest, }, ], + async resolveRequiredProperties( + asset: AssetType, + type: ObjectType + ): Promise> { + console.log('Asset has required properties'); + return asset; + }, }; const controller = new DragAndDropController(config); diff --git a/drag-and-drop/library/src/controller.tsx b/drag-and-drop/library/src/controller.tsx index e8adfb1b..369f0da7 100644 --- a/drag-and-drop/library/src/controller.tsx +++ b/drag-and-drop/library/src/controller.tsx @@ -3,7 +3,7 @@ import type { Asset, AssetWrapper, View } from '@player-ui/react'; import { ConsoleLogger, WebPlayer } from '@player-ui/react'; import { DndProvider } from 'react-dnd'; import { HTML5Backend } from 'react-dnd-html5-backend'; -import type { NamedType, ObjectNode, TSManifest } from '@player-tools/xlr'; +import type { NamedType, ObjectType, TSManifest } from '@player-tools/xlr'; import { XLRService } from '@player-tools/language-service'; import type { TypeMetadata } from '@player-tools/xlr-sdk'; import { PlayerDndPlugin } from './utils'; @@ -32,6 +32,11 @@ export interface DragAndDropControllerOptions { * */ Component?: React.ComponentType; + + /** + * Function to call when a placed asset has required properties that need to be resolved before actually placing it. + */ + resolveRequiredProperties: (asset: Asset, type: ObjectType) => Promise; } /** @@ -45,44 +50,18 @@ export class DragAndDropController { private readonly runtimeState: RuntimeFlowState; private readonly PlayerXLRService: XLRService; + public Context: React.ComponentType>; + public get Canvas() { return this.webPlayer.Component; } - public getAvailableAssets(): Array { - const assets = this.PlayerXLRService.XLRSDK.listTypes({ - capabilityFilter: 'Types', - typeFilter: 'Transformed', - }); - return assets.map((asset) => { - const assetName = asset.name; - const typeInfo = this.PlayerXLRService.XLRSDK.getTypeInfo( - assetName - ) as TypeMetadata; - return { - pluginName: typeInfo.plugin, - name: assetName, - capability: typeInfo.capability, - }; - }); - } - - public getAssetDetails(assetName: string): NamedType { - return this.PlayerXLRService.XLRSDK.getType( - assetName - ) as NamedType; - } - - public getAsset(assetID: string) { - return this.runtimeState.get(assetID); - } - - public Context: React.ComponentType>; - constructor(options: DragAndDropControllerOptions) { this.options = options ?? {}; - this.runtimeState = new RuntimeFlowState(); + this.runtimeState = new RuntimeFlowState({ + resolveRequiredProperties: options.resolveRequiredProperties, + }); this.PlayerXLRService = new XLRService(); this.PlayerXLRService.XLRSDK.loadDefinitionsFromModule(options.types); @@ -97,10 +76,10 @@ export class DragAndDropController { Target: { Component: this.options.Component ?? DropComponent, }, - getXLRTypeForAsset: (identifier): ObjectNode => { + getXLRTypeForAsset: (identifier): ObjectType => { return this.PlayerXLRService.XLRSDK.getType( identifier.name - ) as NamedType; + ) as NamedType; }, }); @@ -121,6 +100,34 @@ export class DragAndDropController { this.webPlayer.start(this.runtimeState.flow); } + public getAvailableAssets(): Array { + const assets = this.PlayerXLRService.XLRSDK.listTypes({ + capabilityFilter: 'Types', + typeFilter: 'Transformed', + }); + return assets.map((asset) => { + const assetName = asset.name; + const typeInfo = this.PlayerXLRService.XLRSDK.getTypeInfo( + assetName + ) as TypeMetadata; + return { + pluginName: typeInfo.plugin, + name: assetName, + capability: typeInfo.capability, + }; + }); + } + + public getAssetDetails(assetName: string): NamedType { + return this.PlayerXLRService.XLRSDK.getType( + assetName + ) as NamedType; + } + + public getAsset(assetID: string) { + return this.runtimeState.get(assetID); + } + updateAsset(id: string, newObject: Asset) { this.runtimeState.updateAsset(id, newObject); this.dndWebPlayerPlugin.refresh(this.webPlayer.player); diff --git a/drag-and-drop/library/src/utils/player-dnd-plugin.ts b/drag-and-drop/library/src/utils/player-dnd-plugin.ts index 6903bb22..726b0233 100644 --- a/drag-and-drop/library/src/utils/player-dnd-plugin.ts +++ b/drag-and-drop/library/src/utils/player-dnd-plugin.ts @@ -28,6 +28,9 @@ export interface PlayerDndPluginOptions< /** An optional override for the transition name when refreshing a flow */ refreshTransition?: string; + /** + * + */ getXLRTypeForAsset: ( identifier: ExtensionProviderAssetIdentifier ) => ObjectNode; @@ -71,11 +74,12 @@ export class PlayerDndPlugin implements WebPlayerPlugin { replaceAsset: (identifier: ExtensionProviderAssetIdentifier) => { console.log(`Replacing asset at: ${asset.id}`); - this.options.state.replace(asset.id, { - identifier, - type: this.options.getXLRTypeForAsset(identifier), - }); - this.refresh(player); + this.options.state + .replace(asset.id, { + identifier, + type: this.options.getXLRTypeForAsset(identifier), + }) + .then(() => this.refresh(player)); }, appendAsset: (identifier: ExtensionProviderAssetIdentifier) => { console.log(`Appending to asset at: ${asset.id}`); diff --git a/drag-and-drop/library/src/utils/runtime-flow-state.ts b/drag-and-drop/library/src/utils/runtime-flow-state.ts index 0396d7e9..d9997131 100644 --- a/drag-and-drop/library/src/utils/runtime-flow-state.ts +++ b/drag-and-drop/library/src/utils/runtime-flow-state.ts @@ -9,26 +9,49 @@ import { DragAndDropAssetType } from '../types'; /** The type for exporting and restoring the flow state */ export interface ExportedRuntimeFlowState { + /** + * + */ root: DropTargetAssetType; } export interface RuntimeFlowStateOptions { + /** + * + */ restoreFrom?: { + /** + * + */ state: ExportedRuntimeFlowState; }; + + /** + * Function to call when a placed asset has required properties that need to be resolved before actually placing it. + */ + resolveRequiredProperties: (asset: Asset, type: ObjectType) => Promise; } +/** + * + */ export class RuntimeFlowState { private ROOT: DropTargetAssetType; private assetMappings: Record = {}; + private resolveRequiredProperties: ( + asset: Asset, + type: ObjectType + ) => Promise; - constructor(options?: RuntimeFlowStateOptions) { + constructor(options: RuntimeFlowStateOptions) { this.ROOT = { __type: DragAndDropAssetType, id: 'drag-and-drop-view', type: 'drop-target', }; this.assetMappings[this.ROOT.id] = this.ROOT; + + this.resolveRequiredProperties = options?.resolveRequiredProperties; } export(): ExportedRuntimeFlowState { @@ -50,7 +73,10 @@ export class RuntimeFlowState { asset.value.asset = newAsset; } - private createNewAsset(idPrefix: string, type: ObjectType): Asset { + private async createNewAsset( + idPrefix: string, + type: ObjectType + ): Promise { const typeProp = type.properties.type.node.type === 'string' ? type.properties.type.node.const @@ -60,16 +86,22 @@ export class RuntimeFlowState { throw new Error('type property must be a constant'); } - const asset: Asset = { + let asset: Asset = { id: `${idPrefix}-test-1`, type: typeProp, }; + let hasRequiredProperties = false; + Object.entries(type.properties).forEach(([key, prop]) => { if (prop.node.type === 'string' && prop.node.const !== undefined) { asset[key] = prop.node.const; } + if (prop.required === true) { + hasRequiredProperties = true; + } + if ( prop.node.type === 'ref' && prop.node.ref.startsWith('AssetWrapper') @@ -92,10 +124,14 @@ export class RuntimeFlowState { } }); + if (hasRequiredProperties) { + asset = await this.resolveRequiredProperties(asset, type); + } + return asset; } - replace( + async replace( id: string, replacement: { /** The identifier for where the populated asset is from */ @@ -104,13 +140,13 @@ export class RuntimeFlowState { /** The current descriptor for the value stored at this asset */ type: ObjectType; } - ) { + ): Promise { const asset = this.assetMappings[id]; if (!asset) { throw new Error(`Cannot set asset value for unknown id: ${id}`); } - const newAsset = this.createNewAsset(id, replacement.type); + const newAsset = await this.createNewAsset(id, replacement.type); asset.value = { ...replacement, From 4a8c4fc568d75ddf0657bb1b56153b81df53094b Mon Sep 17 00:00:00 2001 From: Adam Dierkens Date: Thu, 5 Jan 2023 15:48:07 -0800 Subject: [PATCH 06/52] Add sample property panel --- drag-and-drop/app/pages/index.tsx | 201 +++++++++++++++++++++++------- 1 file changed, 158 insertions(+), 43 deletions(-) diff --git a/drag-and-drop/app/pages/index.tsx b/drag-and-drop/app/pages/index.tsx index e23fe0fa..e05ac016 100644 --- a/drag-and-drop/app/pages/index.tsx +++ b/drag-and-drop/app/pages/index.tsx @@ -16,6 +16,13 @@ import { AccordionIcon, AccordionPanel, VStack, + Modal, + ModalBody, + ModalHeader, + ModalContent, + ModalOverlay, + ModalCloseButton, + Input, } from '@chakra-ui/react'; import { setIn } from 'timm'; import type { @@ -49,6 +56,17 @@ const PropertiesContext = React.createContext<{ setDisplayedAssetID: () => {}, }); +const ControllerContext = React.createContext< + | { + controller: DragAndDropController; + } + | undefined +>(undefined); + +function useController() { + return React.useContext(ControllerContext); +} + /** * Component that indicates that an Asset can be placed at this location */ @@ -97,26 +115,6 @@ const AssetDropTarget = (props: TransformedDropTargetAssetType) => { ); }; -const config: DragAndDropControllerOptions = { - Component: AssetDropTarget, - types: typesManifest as TSManifest, - extensions: [ - { - plugin: ReferenceAssetsPlugin, - manifest: pluginManifest as TSManifest, - }, - ], - async resolveRequiredProperties( - asset: AssetType, - type: ObjectType - ): Promise> { - console.log('Asset has required properties'); - return asset; - }, -}; - -const controller = new DragAndDropController(config); - /** * Component that can be dropped onto the canvas to add an Asst/View */ @@ -172,7 +170,8 @@ export const CapabilityPanel = (props: CapabilityPanelProps) => { * Left panel for selecting Assets/Views */ const AssetSelectorPanel = () => { - const availableComponents = controller.getAvailableAssets(); + const { controller } = useController() ?? {}; + const availableComponents = controller?.getAvailableAssets() ?? []; const assets = availableComponents.filter((c) => c.capability === 'Assets'); const views = availableComponents.filter((c) => c.capability === 'Views'); @@ -195,11 +194,16 @@ const AssetSelectorPanel = () => { * Right panel for editing a dropped Asset/View */ const AssetDetailsPanel = () => { + const { controller } = useController() ?? {}; const propContext = React.useContext(PropertiesContext); const [modifiedAsset, setModifiedAsset] = React.useState< AssetType | undefined >(undefined); + if (!controller) { + return null; + } + if (!propContext.displayedAssetID) { return ( @@ -245,35 +249,146 @@ const AssetDetailsPanel = () => { ); }; +const Canvas = () => { + const { controller } = useController() ?? {}; + const [render, setRender] = React.useState(false); + + React.useEffect(() => { + if (controller) { + setRender(true); + } + }, [controller]); + + if (!render) { + return null; + } + + return ; +}; + +interface PendingPropertyResolution { + asset: AssetType; + type: ObjectType; + + onComplete: (asset: AssetType) => void; +} + +const PropertyResolver = (props: PendingPropertyResolution) => { + const [value, setValue] = React.useState(props.asset.value ?? ''); + + return ( + {}}> + + + Resolve Required Properties + + + + { + setValue(e.target.value); + }} + /> + + + + + + ); +}; + /** * Main Page */ const App = () => { const [displayedAssetID, setDisplayedAssetID] = React.useState(); + const [pendingPropertyResolutions, setPendingPropertyResolutions] = + React.useState(undefined); + + const controllerState = React.useMemo(() => { + const config: DragAndDropControllerOptions = { + Component: AssetDropTarget, + types: typesManifest as TSManifest, + extensions: [ + { + plugin: ReferenceAssetsPlugin, + manifest: pluginManifest as TSManifest, + }, + ], + async resolveRequiredProperties( + asset: AssetType, + type: ObjectType + ): Promise> { + const pending: PendingPropertyResolution = { + asset, + type, + onComplete: () => asset, + }; + + const prom = new Promise>((resolve) => { + pending.onComplete = resolve; + }); + + setPendingPropertyResolutions(pending); + return prom; + }, + }; + + return { + controller: new DragAndDropController(config), + }; + }, [setPendingPropertyResolutions]); + + const { controller } = controllerState; return ( - - - - - - - - - - - - - - - - - + + ({ + displayedAssetID, + setDisplayedAssetID, + }), + [] + )} + > + + + + + + + + + + + + + + {pendingPropertyResolutions && ( + { + setPendingPropertyResolutions(undefined); + return pendingPropertyResolutions.onComplete(asset); + }} + /> + )} + + + + ); }; From 6677c558a33cb2faedfad7c0c3ad55d3ef7b392a Mon Sep 17 00:00:00 2001 From: Ketan Reddy Date: Fri, 6 Jan 2023 13:23:58 -0800 Subject: [PATCH 07/52] Cleanup modal for required props --- drag-and-drop/app/pages/index.tsx | 119 +++++++++++++----- drag-and-drop/library/src/controller.tsx | 9 +- .../library/src/utils/runtime-flow-state.ts | 2 +- 3 files changed, 93 insertions(+), 37 deletions(-) diff --git a/drag-and-drop/app/pages/index.tsx b/drag-and-drop/app/pages/index.tsx index e05ac016..b99afbc1 100644 --- a/drag-and-drop/app/pages/index.tsx +++ b/drag-and-drop/app/pages/index.tsx @@ -21,8 +21,9 @@ import { ModalHeader, ModalContent, ModalOverlay, - ModalCloseButton, - Input, + ButtonGroup, + ModalFooter, + useColorMode, } from '@chakra-ui/react'; import { setIn } from 'timm'; import type { @@ -58,11 +59,15 @@ const PropertiesContext = React.createContext<{ const ControllerContext = React.createContext< | { + /** */ controller: DragAndDropController; } | undefined >(undefined); +/** + * + */ function useController() { return React.useContext(ControllerContext); } @@ -181,9 +186,28 @@ const AssetSelectorPanel = () => { Available Components - + + + + + Options + + + + + + + @@ -235,20 +259,36 @@ const AssetDetailsPanel = () => { /> - + + + + ); }; +/** + * + */ const Canvas = () => { const { controller } = useController() ?? {}; const [render, setRender] = React.useState(false); @@ -267,42 +307,53 @@ const Canvas = () => { }; interface PendingPropertyResolution { + /** */ asset: AssetType; + /** */ type: ObjectType; + /** */ onComplete: (asset: AssetType) => void; } +/** */ const PropertyResolver = (props: PendingPropertyResolution) => { - const [value, setValue] = React.useState(props.asset.value ?? ''); + const { colorMode } = useColorMode(); + const [modifiedAsset, setModifiedAsset] = React.useState( + props.asset + ); + + /** */ + const updateObject = (path: Array, value: any) => { + setModifiedAsset(setIn(modifiedAsset, path, value) as AssetType); + }; return ( - {}}> + {}}> - Resolve Required Properties - - - - { - setValue(e.target.value); - }} + + + Resolve Required Properties + + + + + - - + + ); @@ -360,7 +411,7 @@ const App = () => { displayedAssetID, setDisplayedAssetID, }), - [] + [displayedAssetID] )} > diff --git a/drag-and-drop/library/src/controller.tsx b/drag-and-drop/library/src/controller.tsx index 369f0da7..1d535537 100644 --- a/drag-and-drop/library/src/controller.tsx +++ b/drag-and-drop/library/src/controller.tsx @@ -128,12 +128,17 @@ export class DragAndDropController { return this.runtimeState.get(assetID); } - updateAsset(id: string, newObject: Asset) { + public updateAsset(id: string, newObject: Asset) { this.runtimeState.updateAsset(id, newObject); this.dndWebPlayerPlugin.refresh(this.webPlayer.player); } - exportView(): View { + public removeAsset(id: string){ + this.runtimeState.clear(id); + this.dndWebPlayerPlugin.refresh(this.webPlayer.player); + } + + public exportView(): View { const baseView = this.runtimeState.view; /** diff --git a/drag-and-drop/library/src/utils/runtime-flow-state.ts b/drag-and-drop/library/src/utils/runtime-flow-state.ts index d9997131..cc88a9d7 100644 --- a/drag-and-drop/library/src/utils/runtime-flow-state.ts +++ b/drag-and-drop/library/src/utils/runtime-flow-state.ts @@ -98,7 +98,7 @@ export class RuntimeFlowState { asset[key] = prop.node.const; } - if (prop.required === true) { + if (prop.required === true && !['type', 'id'].includes(key)) { hasRequiredProperties = true; } From 495cb804bceff8a6096ad3a49805927a6dcb47bb Mon Sep 17 00:00:00 2001 From: Ketan Reddy Date: Fri, 6 Jan 2023 14:38:54 -0800 Subject: [PATCH 08/52] Modal for showing generated view --- drag-and-drop/app/BUILD | 1 + drag-and-drop/app/pages/index.tsx | 75 ++++++++++++++++++++++++++----- 2 files changed, 66 insertions(+), 10 deletions(-) diff --git a/drag-and-drop/app/BUILD b/drag-and-drop/app/BUILD index 29ba808a..117110a4 100644 --- a/drag-and-drop/app/BUILD +++ b/drag-and-drop/app/BUILD @@ -26,6 +26,7 @@ data = [ "@npm//@types/react", "@npm//@types/node", "@npm//timm", + "@npm//react-syntax-highlighter" ] next_export( diff --git a/drag-and-drop/app/pages/index.tsx b/drag-and-drop/app/pages/index.tsx index b99afbc1..14370ee3 100644 --- a/drag-and-drop/app/pages/index.tsx +++ b/drag-and-drop/app/pages/index.tsx @@ -17,14 +17,11 @@ import { AccordionPanel, VStack, Modal, - ModalBody, - ModalHeader, ModalContent, ModalOverlay, ButtonGroup, - ModalFooter, - useColorMode, } from '@chakra-ui/react'; +import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter'; import { setIn } from 'timm'; import type { DragAndDropControllerOptions, @@ -53,8 +50,26 @@ const PropertiesContext = React.createContext<{ * Sets `displayedAssetID` */ setDisplayedAssetID: (id: string) => void; + + /** + * If the export modal is open + */ + exportOpen: boolean; + + /** Sets `exportOpen` */ + setExportOpen: (state: boolean) => void; + + /** If the right panel is docs or edit */ + rightPanelState: 'docs' | 'edit'; + + /** Sets `rightPanelState` */ + setRightPanelState: (state: 'docs' | 'edit') => void; }>({ setDisplayedAssetID: () => {}, + setExportOpen: () => {}, + setRightPanelState: () => {}, + exportOpen: false, + rightPanelState: 'edit', }); const ControllerContext = React.createContext< @@ -175,6 +190,7 @@ export const CapabilityPanel = (props: CapabilityPanelProps) => { * Left panel for selecting Assets/Views */ const AssetSelectorPanel = () => { + const context = React.useContext(PropertiesContext); const { controller } = useController() ?? {}; const availableComponents = controller?.getAvailableAssets() ?? []; const assets = availableComponents.filter((c) => c.capability === 'Assets'); @@ -200,8 +216,7 @@ const AssetSelectorPanel = () => { + + + + + ); +}; + /** * Main Page */ const App = () => { const [displayedAssetID, setDisplayedAssetID] = React.useState(); + const [exportOpen, setExportOpen] = React.useState(false); + const [rightPanelState, setRightPanelState] = React.useState<'docs' | 'edit'>( + 'edit' + ); const [pendingPropertyResolutions, setPendingPropertyResolutions] = React.useState(undefined); @@ -410,8 +460,12 @@ const App = () => { () => ({ displayedAssetID, setDisplayedAssetID, + exportOpen, + setExportOpen, + rightPanelState, + setRightPanelState, }), - [displayedAssetID] + [displayedAssetID, exportOpen, rightPanelState] )} > @@ -436,6 +490,7 @@ const App = () => { }} /> )} + {exportOpen && } From c8769ac5543912f548b96c52d341ca7e67453572 Mon Sep 17 00:00:00 2001 From: Ketan Reddy Date: Fri, 6 Jan 2023 15:34:28 -0800 Subject: [PATCH 09/52] Sidebar docs for assets --- drag-and-drop/app/BUILD | 3 +- .../app/pages/components/AssetEditorPanel.tsx | 2 - drag-and-drop/app/pages/index.tsx | 108 ++++++++++++++++-- drag-and-drop/app/pages/utils/converters.ts | 102 +++++++++++++++++ 4 files changed, 200 insertions(+), 15 deletions(-) create mode 100644 drag-and-drop/app/pages/utils/converters.ts diff --git a/drag-and-drop/app/BUILD b/drag-and-drop/app/BUILD index 117110a4..3626bb03 100644 --- a/drag-and-drop/app/BUILD +++ b/drag-and-drop/app/BUILD @@ -26,7 +26,8 @@ data = [ "@npm//@types/react", "@npm//@types/node", "@npm//timm", - "@npm//react-syntax-highlighter" + "@npm//react-syntax-highlighter", + "@npm//react-docgen-typescript" ] next_export( diff --git a/drag-and-drop/app/pages/components/AssetEditorPanel.tsx b/drag-and-drop/app/pages/components/AssetEditorPanel.tsx index 1ba5ecee..0f4f19f2 100644 --- a/drag-and-drop/app/pages/components/AssetEditorPanel.tsx +++ b/drag-and-drop/app/pages/components/AssetEditorPanel.tsx @@ -158,8 +158,6 @@ const PropertyBox = (props: PropertyBoxProps) => { })} ); - } else { - renderedComponent = {JSON.stringify(node)}; } // Catch unimplemented form controls during development diff --git a/drag-and-drop/app/pages/index.tsx b/drag-and-drop/app/pages/index.tsx index 14370ee3..909aa4f6 100644 --- a/drag-and-drop/app/pages/index.tsx +++ b/drag-and-drop/app/pages/index.tsx @@ -20,6 +20,14 @@ import { ModalContent, ModalOverlay, ButtonGroup, + Table, + TableCaption, + TableContainer, + Tbody, + Td, + Th, + Thead, + Tr, } from '@chakra-ui/react'; import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter'; import { setIn } from 'timm'; @@ -40,10 +48,12 @@ import type { ObjectType, TSManifest } from '@player-tools/xlr'; import pluginManifest from '@player-tools/static-xlrs/static_xlrs/plugin/xlr/manifest'; import typesManifest from '@player-tools/static-xlrs/static_xlrs/core/xlr/manifest'; import { AssetEditorPanel } from './components/AssetEditorPanel'; +import { covertXLRtoAssetDoc } from './utils/converters'; const PropertiesContext = React.createContext<{ /** - * Current Asset thats selected + * Current Asset thats selected in the right panel + * will be either an asset ID or a XLR type */ displayedAssetID?: string; /** @@ -120,6 +130,7 @@ const AssetDropTarget = (props: TransformedDropTargetAssetType) => { onClick={(e) => { if (props.value) { propContext.setDisplayedAssetID(props.id); + propContext.setRightPanelState('edit'); e.stopPropagation(); } }} @@ -139,10 +150,20 @@ const AssetDropTarget = (props: TransformedDropTargetAssetType) => { * Component that can be dropped onto the canvas to add an Asst/View */ const DroppableAsset = (props: ExtensionProviderAssetIdentifier) => { + const { setRightPanelState, setDisplayedAssetID } = + React.useContext(PropertiesContext); const [, ref] = useDraggableAsset(props) ?? []; return ( - + ); }; @@ -243,15 +264,6 @@ const AssetDetailsPanel = () => { return null; } - if (!propContext.displayedAssetID) { - return ( - - Properties - Select an asset to begin editing - - ); - } - const { asset, type } = controller.getAsset(propContext.displayedAssetID); /** @@ -405,6 +417,78 @@ const ContentExportModal = () => { ); }; +/** + * Panel to show the full docs for the selected asset + */ +const AssetDocsPanel = () => { + const { displayedAssetID } = React.useContext(PropertiesContext); + const { controller } = useController() ?? {}; + const type = controller.getAssetDetails(displayedAssetID); + const docs = covertXLRtoAssetDoc(type); + return ( + + + Docs for {type.name} + {docs.description} + + + + + + + + + + + + + + {Object.keys(docs.props).map((prop) => { + const propDetails = docs.props[prop]; + return ( + + + + + + + ); + })} + +
NameRequiredDescriptionType
{prop}{propDetails.required ? 'Yes' : 'No'}{propDetails.description} + {propDetails.type.value + ? `"${propDetails.type.value}` + : propDetails.type.name} +
+
+
+
+ ); +}; + +/** + * Asset to switch what is shown on the right panel + */ +const RightPanel = () => { + const { rightPanelState, displayedAssetID } = + React.useContext(PropertiesContext); + + if (rightPanelState === 'edit') { + if (displayedAssetID) { + return ; + } + + return ( + + Properties + Select an asset to begin editing + + ); + } + + return ; +}; + /** * Main Page */ @@ -478,7 +562,7 @@ const App = () => { - + {pendingPropertyResolutions && ( diff --git a/drag-and-drop/app/pages/utils/converters.ts b/drag-and-drop/app/pages/utils/converters.ts new file mode 100644 index 00000000..4f10d57e --- /dev/null +++ b/drag-and-drop/app/pages/utils/converters.ts @@ -0,0 +1,102 @@ +import type { PropItem, PropItemType } from 'react-docgen-typescript'; +import type { NamedType, NodeType, ObjectType } from '@player-tools/xlr'; +import { isPrimitiveTypeNode } from '@player-tools/xlr-utils'; + +export type Props = Record>; + +export interface AssetDoc { + /** name of the asset */ + name: string; + + /** description of the asset */ + description: string; + + /** prop info for the asset */ + props: Props; +} + +/** + * Converts a `NodeType` object to a descriptive `PropItemType` object + */ +function determinePropertyType(node: NodeType): PropItemType { + if (node.type === 'ref') { + return { name: node.ref }; + } + + if (node.type === 'or') { + return { + name: node.or + .map((subnode) => determinePropertyType(subnode).name) + .join(' | '), + }; + } + + if (node.type === 'and') { + return { + name: node.and + .map((subnode) => determinePropertyType(subnode).name) + .join(' & '), + }; + } + + if (node.type === 'array') { + return { name: `Array<${determinePropertyType(node.elementType).name}>` }; + } + + if (node.type === 'record') { + return { + name: `Record<${determinePropertyType(node.keyType).name}, ${ + determinePropertyType(node.valueType).name + }>`, + }; + } + + if (isPrimitiveTypeNode(node) && node.type !== 'null') { + return { name: node.type, value: node.const }; + } + + if (node.type === 'object' && node.name) { + return { name: node.name }; + } + + return { name: node.type }; +} + +/** processes an object to get the property docs */ +function processObject(object: ObjectType, path: string[] = []): Props { + let properties: Props = {}; + + Object.getOwnPropertyNames(object.properties).forEach((propertyName) => { + const propertyPath = [...path, propertyName].join('.'); + const propertyObject = object.properties[propertyName]; + properties[propertyPath] = { + name: propertyName, + required: propertyObject.required, + type: determinePropertyType(propertyObject.node), + description: propertyObject.node.description ?? '', + }; + + if (propertyObject.node.type === 'object') { + const subObjectProperties = processObject(propertyObject.node, [ + ...path, + propertyName, + ]); + properties = { ...properties, ...subObjectProperties }; + } + }); + + return properties; +} + +/** + * Coverts a XLR to a set of props + * + * - @param type the XLR to convert + */ +export function covertXLRtoAssetDoc(type: NamedType): AssetDoc { + return { + name: type.title ?? type.name, + description: type.description ?? type.comment ?? '', + props: processObject(type), + }; +} From 6452bb03e332a54b64303b532078aaeb110e1adf Mon Sep 17 00:00:00 2001 From: Ketan Reddy Date: Thu, 12 Jan 2023 15:06:58 -0800 Subject: [PATCH 10/52] reorg so production build passes --- drag-and-drop/app/BUILD | 2 +- .../app/{pages => }/components/AssetEditorPanel.tsx | 2 +- drag-and-drop/app/pages/index.tsx | 12 +++++++----- drag-and-drop/app/{pages => }/utils/converters.ts | 0 4 files changed, 9 insertions(+), 7 deletions(-) rename drag-and-drop/app/{pages => }/components/AssetEditorPanel.tsx (99%) rename drag-and-drop/app/{pages => }/utils/converters.ts (100%) diff --git a/drag-and-drop/app/BUILD b/drag-and-drop/app/BUILD index 3626bb03..046a2ac4 100644 --- a/drag-and-drop/app/BUILD +++ b/drag-and-drop/app/BUILD @@ -31,7 +31,7 @@ data = [ ] next_export( - name = "app", + name = "site", data = data, srcs = srcs, env = { diff --git a/drag-and-drop/app/pages/components/AssetEditorPanel.tsx b/drag-and-drop/app/components/AssetEditorPanel.tsx similarity index 99% rename from drag-and-drop/app/pages/components/AssetEditorPanel.tsx rename to drag-and-drop/app/components/AssetEditorPanel.tsx index 0f4f19f2..65ec0ffd 100644 --- a/drag-and-drop/app/pages/components/AssetEditorPanel.tsx +++ b/drag-and-drop/app/components/AssetEditorPanel.tsx @@ -182,4 +182,4 @@ export const AssetEditorPanel = (props: AssetEditorPanelProps) => { onUpdate={props.onUpdate} /> ); -}; +}; \ No newline at end of file diff --git a/drag-and-drop/app/pages/index.tsx b/drag-and-drop/app/pages/index.tsx index 909aa4f6..f92ca41a 100644 --- a/drag-and-drop/app/pages/index.tsx +++ b/drag-and-drop/app/pages/index.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import React, { Suspense } from 'react'; import { ChakraProvider, Box, @@ -21,13 +21,13 @@ import { ModalOverlay, ButtonGroup, Table, - TableCaption, TableContainer, Tbody, Td, Th, Thead, Tr, + Spinner, } from '@chakra-ui/react'; import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter'; import { setIn } from 'timm'; @@ -47,8 +47,8 @@ import { ReferenceAssetsPlugin } from '@player-ui/reference-assets-plugin-react' import type { ObjectType, TSManifest } from '@player-tools/xlr'; import pluginManifest from '@player-tools/static-xlrs/static_xlrs/plugin/xlr/manifest'; import typesManifest from '@player-tools/static-xlrs/static_xlrs/core/xlr/manifest'; -import { AssetEditorPanel } from './components/AssetEditorPanel'; -import { covertXLRtoAssetDoc } from './utils/converters'; +import { AssetEditorPanel } from '../components/AssetEditorPanel'; +import { covertXLRtoAssetDoc } from '../utils/converters'; const PropertiesContext = React.createContext<{ /** @@ -559,7 +559,9 @@ const App = () => { - + }> + + diff --git a/drag-and-drop/app/pages/utils/converters.ts b/drag-and-drop/app/utils/converters.ts similarity index 100% rename from drag-and-drop/app/pages/utils/converters.ts rename to drag-and-drop/app/utils/converters.ts From 5df2d9bec1f859c9b89c905332ebb13c0430b05b Mon Sep 17 00:00:00 2001 From: Ketan Reddy Date: Tue, 17 Jan 2023 12:55:41 -0500 Subject: [PATCH 11/52] Undo removing workflows --- .github/workflows/release.yml | 39 +++++++++++++++++++++++++++++++++++ .github/workflows/tag.yml | 19 +++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 .github/workflows/release.yml create mode 100644 .github/workflows/tag.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..764592fa --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,39 @@ +name: Release + +on: + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + trigger-release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Branch name + run: echo running on branch ${GITHUB_REF##*/} + + - name: Create and checkout release branch + run: | + git config --global user.email "opensource-svc@intuit.com" + git config --global user.name "intuit-svc" + git checkout -b release-${GITHUB_REF##*/} + git commit --allow-empty -m "Release ${GITHUB_REF##*/}" + echo "SOURCE_RELEASE_BRANCH=release-${GITHUB_REF##*/}" >> $GITHUB_ENV + git push origin release-${GITHUB_REF##*/} + + - name: create-pr + id: open-pr + uses: repo-sync/pull-request@v2 + with: + source_branch: ${{ env.SOURCE_RELEASE_BRANCH }} + destination_branch: "main" + pr_allow_empty: true + pr_title: "Release ${GITHUB_REF##*/}" + pr_label: "release" + github_token: ${{ secrets.GH_TOKEN }} + + - name: Merge release PR + uses: sudo-bot/action-pull-request-merge@v1.1.1 + with: + github-token: ${{ secrets.GH_TOKEN }} + number: ${{ steps.open-pr.outputs.pr_number }} \ No newline at end of file diff --git a/.github/workflows/tag.yml b/.github/workflows/tag.yml new file mode 100644 index 00000000..8f7aa77d --- /dev/null +++ b/.github/workflows/tag.yml @@ -0,0 +1,19 @@ +name: Tag + +on: + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + inputs: + version: + description: 'Define env name' + required: true + default: 'v0.0.0' +jobs: + create-tag: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: rickstaa/action-create-tag@v1 + with: + tag: "${{ github.event.inputs.version }}" + message: "Latest release" From c15841df5ea43863af738da0c17523eb93cffedb Mon Sep 17 00:00:00 2001 From: Jeremiah Zucker Date: Tue, 17 Jan 2023 14:25:29 -0500 Subject: [PATCH 12/52] fix build - prevent webpack from default .mjs handling --- webpack.config.js | 1 + 1 file changed, 1 insertion(+) diff --git a/webpack.config.js b/webpack.config.js index 13947075..3009803d 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -30,6 +30,7 @@ module.exports = (env, argv) => ({ }, { test: /\.m?js$/, + type: 'javascript/auto', use: { loader: 'babel-loader', options: { From aecfd3743e3b206365f4acde2a3d5661c351229e Mon Sep 17 00:00:00 2001 From: Ketan Reddy Date: Wed, 18 Jan 2023 09:10:00 -0500 Subject: [PATCH 13/52] fix failing tests --- .../library/src/__tests__/controller.test.tsx | 12 +++++++++++- drag-and-drop/library/src/controller.tsx | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/drag-and-drop/library/src/__tests__/controller.test.tsx b/drag-and-drop/library/src/__tests__/controller.test.tsx index f2ec2d08..ee80dc9a 100644 --- a/drag-and-drop/library/src/__tests__/controller.test.tsx +++ b/drag-and-drop/library/src/__tests__/controller.test.tsx @@ -1,7 +1,8 @@ import { waitFor } from '@testing-library/react'; -import type { InProgressState } from '@player-ui/react'; +import type { Asset, InProgressState } from '@player-ui/react'; import pluginManifest from '@player-tools/static-xlrs/static_xlrs/plugin/xlr/manifest'; import typesManifest from '@player-tools/static-xlrs/static_xlrs/core/xlr/manifest'; +import type { ObjectType } from '@player-tools/xlr'; import { DragAndDropController } from '../controller'; import type { ExtensionProvider } from '../types'; @@ -17,9 +18,18 @@ describe('drag-and-drop', () => { const dndController = new DragAndDropController({ types: typesManifest, extensions: [referenceAssetExtension], + resolveRequiredProperties: async ( + asset: Asset, + type: ObjectType + ) => { + return asset; + }, }); const { player } = dndController.webPlayer; + /** + * + */ const getView = () => (player.getState() as InProgressState).controllers?.view.currentView ?.lastUpdate; diff --git a/drag-and-drop/library/src/controller.tsx b/drag-and-drop/library/src/controller.tsx index 1d535537..a19bcd07 100644 --- a/drag-and-drop/library/src/controller.tsx +++ b/drag-and-drop/library/src/controller.tsx @@ -133,7 +133,7 @@ export class DragAndDropController { this.dndWebPlayerPlugin.refresh(this.webPlayer.player); } - public removeAsset(id: string){ + public removeAsset(id: string) { this.runtimeState.clear(id); this.dndWebPlayerPlugin.refresh(this.webPlayer.player); } From 42ac53302a0250ef3514115953eb50905f94c3ec Mon Sep 17 00:00:00 2001 From: Adam Dierkens Date: Fri, 20 Jan 2023 15:37:54 -0500 Subject: [PATCH 14/52] Update to latest player version --- devtools/common/BUILD | 2 +- devtools/common/src/types/index.ts | 2 +- drag-and-drop/app/pages/index.tsx | 30 +- drag-and-drop/library/src/controller.tsx | 4 +- drag-and-drop/library/src/types.ts | 4 +- .../library/src/utils/drop-component.tsx | 4 +- .../library/src/utils/player-dnd-plugin.ts | 8 +- package.json | 8 +- yarn.lock | 322 ++++-------------- 9 files changed, 102 insertions(+), 282 deletions(-) diff --git a/devtools/common/BUILD b/devtools/common/BUILD index b8d92bda..3bf495d4 100644 --- a/devtools/common/BUILD +++ b/devtools/common/BUILD @@ -3,7 +3,7 @@ load("//:index.bzl", "javascript_pipeline") javascript_pipeline( name = "@player-tools/devtools-common", dependencies = [ - "@npm//@player-ui/logger", + "@npm//@player-ui/player", "@npm//@player-ui/types", "@npm//@reduxjs/toolkit", "@npm//@types/uuid", diff --git a/devtools/common/src/types/index.ts b/devtools/common/src/types/index.ts index 2a2ce3e9..156d36bf 100644 --- a/devtools/common/src/types/index.ts +++ b/devtools/common/src/types/index.ts @@ -1,4 +1,4 @@ -import type { Severity } from '@player-ui/logger'; +import type { Severity } from '@player-ui/player'; import type { Binding, Flow, Schema, View } from '@player-ui/types'; import type { RUNTIME_SOURCE } from '../constants'; import type { ProfilerNode } from './state'; diff --git a/drag-and-drop/app/pages/index.tsx b/drag-and-drop/app/pages/index.tsx index f92ca41a..7c1d4b3c 100644 --- a/drag-and-drop/app/pages/index.tsx +++ b/drag-and-drop/app/pages/index.tsx @@ -36,8 +36,8 @@ import type { ExtensionProviderAssetIdentifier, TransformedDropTargetAssetType, } from '@player-tools/dnd-lib'; -import { Asset } from '@player-ui/react-asset'; -import type { Asset as AssetType } from '@player-ui/types'; +import { ReactAsset } from '@player-ui/react'; +import type { Asset } from '@player-ui/types'; import { DragAndDropController, useDroppableAsset, @@ -136,7 +136,7 @@ const AssetDropTarget = (props: TransformedDropTargetAssetType) => { }} > {props.value ? ( - + ) : ( {props.context?.parent.name} - {props.context?.propertyName} @@ -256,9 +256,9 @@ const AssetSelectorPanel = () => { const AssetDetailsPanel = () => { const { controller } = useController() ?? {}; const propContext = React.useContext(PropertiesContext); - const [modifiedAsset, setModifiedAsset] = React.useState< - AssetType | undefined - >(undefined); + const [modifiedAsset, setModifiedAsset] = React.useState( + undefined + ); if (!controller) { return null; @@ -270,7 +270,7 @@ const AssetDetailsPanel = () => { * Updates the selected asset thats stored as a temporary value */ const updateObject = (path: Array, value: any) => { - setModifiedAsset(setIn(modifiedAsset ?? asset, path, value) as AssetType); + setModifiedAsset(setIn(modifiedAsset ?? asset, path, value) as Asset); }; return ( @@ -335,23 +335,21 @@ const Canvas = () => { interface PendingPropertyResolution { /** */ - asset: AssetType; + asset: Asset; /** */ type: ObjectType; /** */ - onComplete: (asset: AssetType) => void; + onComplete: (asset: Asset) => void; } /** Modal for filling in required properties on a dropped Asset */ const PropertyResolver = (props: PendingPropertyResolution) => { - const [modifiedAsset, setModifiedAsset] = React.useState( - props.asset - ); + const [modifiedAsset, setModifiedAsset] = React.useState(props.asset); /** */ const updateObject = (path: Array, value: any) => { - setModifiedAsset(setIn(modifiedAsset, path, value) as AssetType); + setModifiedAsset(setIn(modifiedAsset, path, value) as Asset); }; return ( @@ -512,16 +510,16 @@ const App = () => { }, ], async resolveRequiredProperties( - asset: AssetType, + asset: Asset, type: ObjectType - ): Promise> { + ): Promise> { const pending: PendingPropertyResolution = { asset, type, onComplete: () => asset, }; - const prom = new Promise>((resolve) => { + const prom = new Promise>((resolve) => { pending.onComplete = resolve; }); diff --git a/drag-and-drop/library/src/controller.tsx b/drag-and-drop/library/src/controller.tsx index a19bcd07..b33cb9f4 100644 --- a/drag-and-drop/library/src/controller.tsx +++ b/drag-and-drop/library/src/controller.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import type { Asset, AssetWrapper, View } from '@player-ui/react'; +import type { Asset, AssetWrapper, ReactPlayer, View } from '@player-ui/react'; import { ConsoleLogger, WebPlayer } from '@player-ui/react'; import { DndProvider } from 'react-dnd'; import { HTML5Backend } from 'react-dnd-html5-backend'; @@ -44,7 +44,7 @@ export interface DragAndDropControllerOptions { */ export class DragAndDropController { private readonly options: DragAndDropControllerOptions; - public readonly webPlayer: WebPlayer; + public readonly webPlayer: ReactPlayer; private readonly dndWebPlayerPlugin: PlayerDndPlugin; private readonly runtimeState: RuntimeFlowState; diff --git a/drag-and-drop/library/src/types.ts b/drag-and-drop/library/src/types.ts index e7bbd4ec..b093f3e7 100644 --- a/drag-and-drop/library/src/types.ts +++ b/drag-and-drop/library/src/types.ts @@ -1,5 +1,5 @@ import type { ObjectType, TSManifest } from '@player-tools/xlr'; -import type { Asset, WebPlayerPlugin, Flow, View } from '@player-ui/react'; +import type { Asset, ReactPlayerPlugin, Flow, View } from '@player-ui/react'; export const DroppedItemTypes = { ASSET: 'ASSET', @@ -19,7 +19,7 @@ export interface DroppedAsset { export interface ExtensionProvider { /** A constructor to create an instance of the plugin */ plugin: { - new (): WebPlayerPlugin; + new (): ReactPlayerPlugin; }; /** A manifest describing the plugins capabilities */ diff --git a/drag-and-drop/library/src/utils/drop-component.tsx b/drag-and-drop/library/src/utils/drop-component.tsx index be3e0e3e..637a533f 100644 --- a/drag-and-drop/library/src/utils/drop-component.tsx +++ b/drag-and-drop/library/src/utils/drop-component.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { Asset } from '@player-ui/react-asset'; +import { ReactAsset } from '@player-ui/react'; import type { TransformedDropTargetAssetType } from '../types'; import { useDroppableAsset } from '../hooks/useDroppableAsset'; @@ -17,7 +17,7 @@ export const DropComponent = (props: TransformedDropTargetAssetType) => { return (
{props.value ? ( - + ) : ( {props.context?.parent.name} - {props.context?.propertyName} diff --git a/drag-and-drop/library/src/utils/player-dnd-plugin.ts b/drag-and-drop/library/src/utils/player-dnd-plugin.ts index 726b0233..8c8d9272 100644 --- a/drag-and-drop/library/src/utils/player-dnd-plugin.ts +++ b/drag-and-drop/library/src/utils/player-dnd-plugin.ts @@ -1,7 +1,7 @@ import type { ObjectNode } from '@player-tools/xlr'; import type { - WebPlayer, - WebPlayerPlugin, + ReactPlayer, + ReactPlayerPlugin, Asset, ViewController, Player, @@ -47,7 +47,7 @@ interface PlayerDndPluginState { /** * A plugin that handles drag and drop integration */ -export class PlayerDndPlugin implements WebPlayerPlugin { +export class PlayerDndPlugin implements ReactPlayerPlugin { name = 'player-dnd-plugin'; private state: WeakMap = new WeakMap(); @@ -126,7 +126,7 @@ export class PlayerDndPlugin implements WebPlayerPlugin { this.state.set(player, state); } - applyWeb(webPlayer: WebPlayer) { + applyWeb(webPlayer: ReactPlayer) { const match = { type: this.options.Target.type ?? 'drop-target' }; webPlayer.assetRegistry.set(match, this.options.Target.Component); } diff --git a/package.json b/package.json index ec0f1381..800361f8 100644 --- a/package.json +++ b/package.json @@ -44,12 +44,12 @@ "@kendallgassner/eslint-plugin-package-json": "^0.2.1", "@oclif/core": "1.9.0", "@oclif/plugin-legacy": "^1.2.7", - "@player-ui/logger": "^0.2.0", - "@player-ui/types": "^0.2.0", + "@player-ui/types": "0.3.0", + "@player-ui/player": "0.3.0", "@reduxjs/toolkit": "^1.6.1", "@rollup/plugin-image": "^2.1.1", - "@player-ui/react": "^0.2.0", - "@player-ui/reference-assets-plugin-react": "^0.2.0", + "@player-ui/react": "0.3.0", + "@player-ui/reference-assets-plugin-react": "0.3.0", "@rollup/plugin-json": "^4.1.0", "@rollup/plugin-node-resolve": "^13.0.6", "@testing-library/dom": "^8.10.1", diff --git a/yarn.lock b/yarn.lock index f7704ac9..f37109a3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4185,291 +4185,128 @@ dependencies: "@octokit/openapi-types" "^12.11.0" -"@player-ui/asset-provider-plugin-react@0.2.0": - version "0.2.0" - resolved "https://registry.yarnpkg.com/@player-ui/asset-provider-plugin-react/-/asset-provider-plugin-react-0.2.0.tgz#6cff232d7e9ce70cf963f996ba6845d49e51ffb9" - integrity sha512-THMru7jpDeGYlRbGpj0tYFNGMLHF1WFkfHHn5zD3LaiKrDsWrZbH2shxz4TmvuEfivTSNWXEPzBInKnasDIr5Q== - dependencies: - "@babel/runtime" "7.15.4" - "@player-ui/react-asset" "0.2.0" - "@player-ui/react-subscribe" "0.2.0" - -"@player-ui/asset-transform-plugin@0.2.0": - version "0.2.0" - resolved "https://registry.yarnpkg.com/@player-ui/asset-transform-plugin/-/asset-transform-plugin-0.2.0.tgz#3e1473229d1189f1d5bc7005cc8c27a144ba96dd" - integrity sha512-MFzdlgukCtnpjnfYcXdTSxkbMHTgBCBqOj6Dv113rfo55W13Npu563t2UkDhpHQkBSsWXTSaFbb6T9I7vqE7PQ== - dependencies: - "@babel/runtime" "7.15.4" - "@player-ui/partial-match-registry" "0.2.0" - -"@player-ui/beacon-plugin-react@0.2.0": - version "0.2.0" - resolved "https://registry.yarnpkg.com/@player-ui/beacon-plugin-react/-/beacon-plugin-react-0.2.0.tgz#5da5fae1bad282a4f3c7043c9bd95cc65931d386" - integrity sha512-3X/t+BgclCDWMb+TMcOvYm6e8wrHHR8MKnGfkIWb7rmC6fnR+0KzBlNsRjP5UQp3n5JCLRFhYrzcxXqyNdTG4w== - dependencies: - "@babel/runtime" "7.15.4" - "@player-ui/beacon-plugin" "0.2.0" - "@player-ui/react-utils" "0.2.0" - -"@player-ui/beacon-plugin@0.2.0": - version "0.2.0" - resolved "https://registry.yarnpkg.com/@player-ui/beacon-plugin/-/beacon-plugin-0.2.0.tgz#597925021b08fd95207e72de73eb5b49faa0b101" - integrity sha512-nhrFAZslLjG5qB4ysq60PzYlf+huCV9iH/LesRT3VYGf7ubmO2YGLVQIFLyqrV7YIX9pEN5zJgyaigsCoSrWhw== - dependencies: - "@babel/runtime" "7.15.4" - tapable-ts "^0.1.0" - timm "^1.6.2" - -"@player-ui/binding-grammar@0.2.0": - version "0.2.0" - resolved "https://registry.yarnpkg.com/@player-ui/binding-grammar/-/binding-grammar-0.2.0.tgz#36e772943f82255602c1c2cd80e5e371f0a22fd4" - integrity sha512-C17FjmMPYW74GYi6PRxgKRcH2bZTPjEgn+5DPKVexmnrq1jvXRhivs4xmOjNbdaxBsMTWV11DPvuABVnwm9xcA== +"@player-ui/asset-provider-plugin-react@0.3.0": + version "0.3.0" + resolved "https://registry.yarnpkg.com/@player-ui/asset-provider-plugin-react/-/asset-provider-plugin-react-0.3.0.tgz#f285adce23f125fbb75ee20bc00735cf1a6ab363" + integrity sha512-Ys7N5HQp4g6WoL6XmOcRq+zxC+Gbf5M9JDRYGn1WuicxfZ5RCF1V24vd3DGslRGxzbgXQ+4d2Cy7mn2PDi1P4A== dependencies: "@babel/runtime" "7.15.4" - "@types/parsimmon" "^1.10.0" - arr-flatten "^1.1.0" - ebnf "^1.9.0" - parsimmon "^1.12.0" + "@player-ui/react-subscribe" "0.3.0" -"@player-ui/binding@0.2.0": - version "0.2.0" - resolved "https://registry.yarnpkg.com/@player-ui/binding/-/binding-0.2.0.tgz#b13032a704c588bac116c669c3a269d56b5ff36d" - integrity sha512-f1548zZoHVGjCRQjAG4XUZFqJVu+8MkNAq12DvasZIwlUsrT/m+A8n2Zj6TjoBRIzNJLE8UB7Apy4+1fqczxeQ== +"@player-ui/asset-transform-plugin@0.3.0": + version "0.3.0" + resolved "https://registry.yarnpkg.com/@player-ui/asset-transform-plugin/-/asset-transform-plugin-0.3.0.tgz#a4301266e28f0e9baa90336710b49a88ade4adff" + integrity sha512-uk2E33G87URTREXW5BhmI/PMeJoj81ztWkqevjYHvU/TmdoC1zPPrTQwcjcnO+PwjvkpZjbvENaSjai6V4q6ng== dependencies: "@babel/runtime" "7.15.4" - "@player-ui/binding-grammar" "0.2.0" - "@types/nested-error-stacks" "^2.1.0" - nested-error-stacks "^2.1.1" - tapable-ts "^0.1.0" + "@player-ui/partial-match-registry" "0.3.0" -"@player-ui/constants@0.2.0": - version "0.2.0" - resolved "https://registry.yarnpkg.com/@player-ui/constants/-/constants-0.2.0.tgz#7c60739b7c6064b26041fb0389b3fd7314e38c54" - integrity sha512-bHnoUQEtvzD2r5aVDdpYmyJtZ6PIvvJogQp03l2fgvq96Mct9Rp3VelzhKJtakj7scMr5wt2yblD2n13aR8IWQ== +"@player-ui/beacon-plugin-react@0.3.0": + version "0.3.0" + resolved "https://registry.yarnpkg.com/@player-ui/beacon-plugin-react/-/beacon-plugin-react-0.3.0.tgz#9ca522a4a7ebb5db29d9af6b3d7783fff871fb7c" + integrity sha512-gr6DB1AUoztsJhACJ7N37iyuz7cQsl7e+GcSWdnlwx3MQ0UWm4hqDitM+3slgBUA7BSux31GPTTr2+0WTcZKBw== dependencies: "@babel/runtime" "7.15.4" + "@player-ui/beacon-plugin" "0.3.0" -"@player-ui/data@0.2.0": - version "0.2.0" - resolved "https://registry.yarnpkg.com/@player-ui/data/-/data-0.2.0.tgz#a2408102b45818b7fab627768393022d02f308f1" - integrity sha512-0MSDpeQXLWD010uCj/zjCsbGwDE3cvoKGj5Nt75/1cSzQYSNwzxwGtjTs7Kjb0kay7exZA4BeiX4UqyTlqv5mQ== +"@player-ui/beacon-plugin@0.3.0": + version "0.3.0" + resolved "https://registry.yarnpkg.com/@player-ui/beacon-plugin/-/beacon-plugin-0.3.0.tgz#91e677243e95583b3874a12bef771032da6d31df" + integrity sha512-2l/IZNw/j6Z3AZ6SeRIAPMr3JND+M9Oko/nQaMT5FcknzSpz37+iAtHtKpDYyy2ZpXtTAvyVP8mN0uaP3Xbf6Q== dependencies: "@babel/runtime" "7.15.4" - "@player-ui/binding" "0.2.0" - "@types/dlv" "^1.1.2" - dlv "^1.1.3" tapable-ts "^0.1.0" timm "^1.6.2" -"@player-ui/expressions@0.2.0": - version "0.2.0" - resolved "https://registry.yarnpkg.com/@player-ui/expressions/-/expressions-0.2.0.tgz#2fce99572fe187974b939272a3de062fb7f2675a" - integrity sha512-V/FF5WX2Im/ekzAL5zjE4goCya6NeVN/LGosjAW5GoWNCnRNi4z1PXzE/zo3dOjle6bM58JgiIIdTlefj+OE8g== - dependencies: - "@babel/runtime" "7.15.4" - "@player-ui/binding" "0.2.0" - "@player-ui/data" "0.2.0" - "@player-ui/logger" "0.2.0" - "@player-ui/string-resolver" "0.2.0" - "@player-ui/types" "0.2.0" - tapable-ts "^0.1.0" - -"@player-ui/flow@0.2.0": - version "0.2.0" - resolved "https://registry.yarnpkg.com/@player-ui/flow/-/flow-0.2.0.tgz#4834f2d3c23807c54b49a462749531d4269cb643" - integrity sha512-gsfNkRTTKS7c2x8kOQUboUXI+OkLb8SVF4ANtmFnVh4yY7i9fdlw1zWkrdBiSUaU78qBUggM5asN1JRmpXt1ow== - dependencies: - "@babel/runtime" "7.15.4" - "@player-ui/logger" "0.2.0" - "@player-ui/types" "0.2.0" - p-defer "^3.0.0" - tapable-ts "^0.1.0" - -"@player-ui/logger@0.2.0", "@player-ui/logger@^0.2.0": - version "0.2.0" - resolved "https://registry.yarnpkg.com/@player-ui/logger/-/logger-0.2.0.tgz#8cda9d07922a2f1a4090cb849a42f7e9499fbda9" - integrity sha512-rwWOuWDRCEsLv8SpHJgpVei18PcXLzr/F6ZS8SPR2UIlZ4y6T1TxPd/qjIdPMs6CeP5pzOVeZVIevhDQNHO+lQ== - dependencies: - "@babel/runtime" "7.15.4" - tapable-ts "^0.1.0" - -"@player-ui/metrics-plugin@0.2.0": - version "0.2.0" - resolved "https://registry.yarnpkg.com/@player-ui/metrics-plugin/-/metrics-plugin-0.2.0.tgz#714dac415f9360abef1d3f324212f15ec9dd49b6" - integrity sha512-Llg5skUncdtTiQf0pSEC0X+kYVUxoIHVOh8l5gyRoiklRMOfoYGiKt70A3vsC1oUt1WacTrD+uug6+Nm4KO1Zw== +"@player-ui/metrics-plugin@0.3.0": + version "0.3.0" + resolved "https://registry.yarnpkg.com/@player-ui/metrics-plugin/-/metrics-plugin-0.3.0.tgz#dd5fd59e2cea5abcde48d941ad726b5c6d9ba3b6" + integrity sha512-0bIan24i6PCJV9QLQ/4ERSdoU6wOErg7ikPh8BUAxRuwYFhe3ijgoBMad6jO1m3CHo/IaQQYXyKqbTVo9a1cRQ== dependencies: "@babel/runtime" "7.15.4" - "@player-ui/beacon-plugin" "0.2.0" + "@player-ui/beacon-plugin" "0.3.0" tapable-ts "^0.1.0" -"@player-ui/partial-match-registry@0.2.0": - version "0.2.0" - resolved "https://registry.yarnpkg.com/@player-ui/partial-match-registry/-/partial-match-registry-0.2.0.tgz#ed1a0b52ea96f06e53f500a092bd83d37b73d74b" - integrity sha512-jikqr0ZBSSfsEUPSbE21ZYsI7vyQlan4oxBHMZdYfnDs3QVaILNQbiqD/EiEj2i6dnCQmO/fMVGF8EjQCoqLoQ== +"@player-ui/partial-match-registry@0.3.0": + version "0.3.0" + resolved "https://registry.yarnpkg.com/@player-ui/partial-match-registry/-/partial-match-registry-0.3.0.tgz#cd102b947ccba754e390a1a022d8ccd8698053c4" + integrity sha512-jssryLQrPMz/A7KmtDH4M3/i2aWSVF4K6WCLZWFCxWhXKF0DXV/kdCH+8TIWMZ2mBjPwh3DZ3H6yFEhfU7DGCg== dependencies: "@babel/runtime" "7.15.4" "@types/dlv" "^1.1.2" dlv "^1.1.3" sorted-array "^2.0.4" -"@player-ui/player@0.2.0": - version "0.2.0" - resolved "https://registry.yarnpkg.com/@player-ui/player/-/player-0.2.0.tgz#080252ec597d5b97163a8b8316013e3d4816e93c" - integrity sha512-CV4BaEzIfPBO7usuyYtq/tRRH1lX6Yi9clgC2iW6yEUFwyLvM2JXq4TKlXgbW1cVot+y57Ippd62Xdf71egRSg== +"@player-ui/player@0.3.0": + version "0.3.0" + resolved "https://registry.yarnpkg.com/@player-ui/player/-/player-0.3.0.tgz#6cfbed27577e86c94ff0281be2c908081fe760a2" + integrity sha512-Tdd/g0yTLlCC/egXXt/DRypH/STtQYb4ZQGVvMPmonWCGo/f86DzygHUwsDEVeJCceme0nxw8gTaTlBYpAw/vQ== dependencies: "@babel/runtime" "7.15.4" - "@player-ui/binding" "0.2.0" - "@player-ui/constants" "0.2.0" - "@player-ui/data" "0.2.0" - "@player-ui/expressions" "0.2.0" - "@player-ui/flow" "0.2.0" - "@player-ui/logger" "0.2.0" - "@player-ui/partial-match-registry" "0.2.0" - "@player-ui/schema" "0.2.0" - "@player-ui/string-resolver" "0.2.0" - "@player-ui/types" "0.2.0" - "@player-ui/utils" "0.2.0" - "@player-ui/validator" "0.2.0" - "@player-ui/view" "0.2.0" - babel-plugin-preval "^5.0.0" + "@player-ui/partial-match-registry" "0.3.0" + "@player-ui/types" "0.3.0" + "@types/nested-error-stacks" "^2.1.0" + "@types/parsimmon" "^1.10.0" + arr-flatten "^1.1.0" dequal "^2.0.2" + ebnf "^1.9.0" + nested-error-stacks "^2.1.1" p-defer "^3.0.0" + parsimmon "^1.12.0" queue-microtask "^1.2.3" tapable-ts "^0.1.0" timm "^1.6.2" -"@player-ui/react-asset@0.2.0": - version "0.2.0" - resolved "https://registry.yarnpkg.com/@player-ui/react-asset/-/react-asset-0.2.0.tgz#7a14e8e768bf7653a8f8784721f1ffef0e3ec643" - integrity sha512-feH55Y0ymoxzHjN95D4LaD7p4P7XO1Affk4K/Z8hulLYRR5Wq95txhLAHSQyYMvEVbpM4LtV2b3HLOcZn+9Z3A== - dependencies: - "@babel/runtime" "7.15.4" - -"@player-ui/react-subscribe@0.2.0": - version "0.2.0" - resolved "https://registry.yarnpkg.com/@player-ui/react-subscribe/-/react-subscribe-0.2.0.tgz#c2f2653f24ab5c80b71a785fbce19ca2db13420b" - integrity sha512-vDkWMorGcl2XQVEFknnUjtXT5/gBmiO/NrZ3JucYuFhSK0+GfHRKZhNzi8GnH5o1Q1M01HBK0WbiaSUvwfWlwg== +"@player-ui/react-subscribe@0.3.0": + version "0.3.0" + resolved "https://registry.yarnpkg.com/@player-ui/react-subscribe/-/react-subscribe-0.3.0.tgz#3b8191e299be799aa706664c578da8d5cf45cff7" + integrity sha512-WZ+uKQaFUaHUs1dqOStgW0fgTyklIgt2/QDiNT3inxcN4GPnNiuj8siuwRZq7cZOskxWRf+LlR6yHW15CPUS6A== dependencies: "@babel/runtime" "7.15.4" p-defer "^3.0.0" -"@player-ui/react-utils@0.2.0": - version "0.2.0" - resolved "https://registry.yarnpkg.com/@player-ui/react-utils/-/react-utils-0.2.0.tgz#7145965af38b50385aa87b0f9e4b918742f7c997" - integrity sha512-SpGE7VOwcz5IWDdN9jgvcs95Nig3X6mpsvLV/YsRU44y6FGSYcMq0MJY4rR+nb0PXpZreuxvpCyAMTt/akjbWA== - dependencies: - "@babel/runtime" "7.15.4" - -"@player-ui/react@^0.2.0": - version "0.2.0" - resolved "https://registry.yarnpkg.com/@player-ui/react/-/react-0.2.0.tgz#6b76ec60571f4891521628402683c033073e1a2e" - integrity sha512-XNLHpO9n1bgFeDC/4OB/yTQn7TJJAMPobYpo7qplXnz3vr0BnnWWOIsN0++N6w6QCTnOk8WyDzHiasSBdqeI2w== +"@player-ui/react@0.3.0": + version "0.3.0" + resolved "https://registry.yarnpkg.com/@player-ui/react/-/react-0.3.0.tgz#ead658a6f32342629c4a5de8c6ce194c5157d111" + integrity sha512-0SeLfHF0//WoskTBAvTucdodR4uWMlYHoh/hRvBHytlvBLckpdepEdWs/DlaCxYz/C5PFIgROI2V9dWoOxfrQQ== dependencies: "@babel/runtime" "7.15.4" - "@player-ui/metrics-plugin" "0.2.0" - "@player-ui/partial-match-registry" "0.2.0" - "@player-ui/player" "0.2.0" - "@player-ui/react-asset" "0.2.0" - "@player-ui/react-subscribe" "0.2.0" - "@player-ui/react-utils" "0.2.0" + "@player-ui/metrics-plugin" "0.3.0" + "@player-ui/partial-match-registry" "0.3.0" + "@player-ui/player" "0.3.0" + "@player-ui/react-subscribe" "0.3.0" react-error-boundary "^3.1.3" tapable-ts "^0.1.0" -"@player-ui/reference-assets-plugin-react@^0.2.0": - version "0.2.0" - resolved "https://registry.yarnpkg.com/@player-ui/reference-assets-plugin-react/-/reference-assets-plugin-react-0.2.0.tgz#6f296a40982f7d733472b4f64114576dac6ffcc8" - integrity sha512-OavS1QNOChoFv0r2qeJ7CKOoWfHH7jhaflXA7UXAumtQVZl8T9R1X+v/EJXpZ2elLKUcV0JW/b8U311K+/xExA== +"@player-ui/reference-assets-plugin-react@0.3.0": + version "0.3.0" + resolved "https://registry.yarnpkg.com/@player-ui/reference-assets-plugin-react/-/reference-assets-plugin-react-0.3.0.tgz#d3eca60f10f865f6cf1fa02466501f288c7b2dad" + integrity sha512-gDEoHPvPEhSWlxXJ/t+Vj1tmtRV3iq+VeKiXNjXedgZfA0JkbdarsKRauUelIEI53OraBkxYI0Y+iYDivJ+R5Q== dependencies: "@babel/runtime" "7.15.4" "@chakra-ui/icons" "^1.1.1" "@chakra-ui/react" "^1.7.3" - "@player-ui/asset-provider-plugin-react" "0.2.0" - "@player-ui/beacon-plugin-react" "0.2.0" - "@player-ui/partial-match-registry" "0.2.0" - "@player-ui/reference-assets-plugin" "0.2.0" + "@player-ui/asset-provider-plugin-react" "0.3.0" + "@player-ui/beacon-plugin-react" "0.3.0" + "@player-ui/partial-match-registry" "0.3.0" + "@player-ui/reference-assets-plugin" "0.3.0" clsx "^1.1.1" -"@player-ui/reference-assets-plugin@0.2.0": - version "0.2.0" - resolved "https://registry.yarnpkg.com/@player-ui/reference-assets-plugin/-/reference-assets-plugin-0.2.0.tgz#ccdfc0242be74a99f02dbd6fb37498919db5cb80" - integrity sha512-qmAgUtbxJ2UdsplwJLB7Lb5pfbyNQniTFSOUnLcz3L5vXUF63Qm/7DzjNvqWPeJ2s3KL/XlI0+ILeLe3NFR+7w== - dependencies: - "@babel/runtime" "7.15.4" - "@player-ui/asset-transform-plugin" "0.2.0" - "@player-ui/beacon-plugin" "0.2.0" - -"@player-ui/schema@0.2.0": - version "0.2.0" - resolved "https://registry.yarnpkg.com/@player-ui/schema/-/schema-0.2.0.tgz#0107779cf3789622a81a1e82bfdf3f6408f99030" - integrity sha512-O8RYnrNhBPblh/NgO/pAVjBiKPpHzAUlf1JZPjxYiZ6hN4BxC6Pf47A+IWLdsbhWP7unBfqDD6V1fYaX0hm7AA== - dependencies: - "@babel/runtime" "7.15.4" - "@player-ui/binding" "0.2.0" - "@player-ui/data" "0.2.0" - "@player-ui/types" "0.2.0" - "@player-ui/validator" "0.2.0" - tapable-ts "^0.1.0" - -"@player-ui/string-resolver@0.2.0": - version "0.2.0" - resolved "https://registry.yarnpkg.com/@player-ui/string-resolver/-/string-resolver-0.2.0.tgz#16136a14c3761c500e83d3cb500de588fa4cc8a1" - integrity sha512-5hN7u4BG2O3Dk6NGTKcpArNI+E6patHnYDS4Yxa1mnh5Zi7R0EpAd1wSa5LENtuDKo9ueVvKSWDjtBB9svV7lw== - dependencies: - "@babel/runtime" "7.15.4" - "@player-ui/binding" "0.2.0" - "@player-ui/data" "0.2.0" - "@player-ui/types" "0.2.0" - timm "^1.6.2" - -"@player-ui/types@0.2.0", "@player-ui/types@^0.2.0": - version "0.2.0" - resolved "https://registry.yarnpkg.com/@player-ui/types/-/types-0.2.0.tgz#72990b70621d65ceebf02da9f813481e8eb17692" - integrity sha512-Lj7XNWQ9bHeVQbPJQwObXhYJddvr5iEhFCivCdbREuqiuF7RhG6Sodn3nT88L8EQPr78n88I7oxD6G8fQ/iEjw== - dependencies: - "@babel/runtime" "7.15.4" - -"@player-ui/utils@0.2.0": - version "0.2.0" - resolved "https://registry.yarnpkg.com/@player-ui/utils/-/utils-0.2.0.tgz#a0f8d9b0d3ff365ffbb5e8d1faa08737ab8a3b26" - integrity sha512-4Jt7eKwnuNQT/6rJkJTInO1XrL1P4L//ndRfDPnQq0M2//VD4KVhfKFzmkodQnlHddcUx3KwapJ+F5b+cjrvpw== - dependencies: - "@babel/runtime" "7.15.4" - -"@player-ui/validator@0.2.0": - version "0.2.0" - resolved "https://registry.yarnpkg.com/@player-ui/validator/-/validator-0.2.0.tgz#6e955b30894a692313ce6b35ad69fb60f7f24eb1" - integrity sha512-ETpZXpHtgLn868kkXOAipsn4GBWzko7LLUTCN8a2kb6qNpmI5OtwirHYNLWM07bnpjKEXZ9amdHkKD56iHmiSA== +"@player-ui/reference-assets-plugin@0.3.0": + version "0.3.0" + resolved "https://registry.yarnpkg.com/@player-ui/reference-assets-plugin/-/reference-assets-plugin-0.3.0.tgz#bda8c8817e0516d20a89d80a130baf49640b6625" + integrity sha512-9umL/lUUbvOcbPsh24Ss0RQ0k4Mp8FQesFWzV85DyIxGufv3gBLLinZK6CIZOrHft2vI1TXhwDrZhf99dhlbZA== dependencies: "@babel/runtime" "7.15.4" - "@player-ui/binding" "0.2.0" - "@player-ui/constants" "0.2.0" - "@player-ui/data" "0.2.0" - "@player-ui/expressions" "0.2.0" - "@player-ui/logger" "0.2.0" - "@player-ui/types" "0.2.0" - tapable-ts "^0.1.0" - timm "^1.6.2" + "@player-ui/asset-transform-plugin" "0.3.0" + "@player-ui/beacon-plugin" "0.3.0" -"@player-ui/view@0.2.0": - version "0.2.0" - resolved "https://registry.yarnpkg.com/@player-ui/view/-/view-0.2.0.tgz#e118e1d759728251d39a5e21a30e8043943e7b86" - integrity sha512-KaYTGdabtL0wUsINiSNFpEDTgvFnqrc9a4aqhQwDhXq0s+TbaOesYzOMZwQ8KCs4GTnbg9ArOzviitGVBemv9g== +"@player-ui/types@0.3.0": + version "0.3.0" + resolved "https://registry.yarnpkg.com/@player-ui/types/-/types-0.3.0.tgz#821a78b59363bcd81f283f7d2882d5446937f000" + integrity sha512-feq7R8Pdm5yhSJmR7LHK+69IZQ1s0XAEN1HEiSyqqKP4x4IjROH9iRZ2x9lXjC6vh1Qi8uK5JSOht8ZxRYcm2Q== dependencies: "@babel/runtime" "7.15.4" - "@player-ui/binding" "0.2.0" - "@player-ui/constants" "0.2.0" - "@player-ui/data" "0.2.0" - "@player-ui/expressions" "0.2.0" - "@player-ui/flow" "0.2.0" - "@player-ui/logger" "0.2.0" - "@player-ui/schema" "0.2.0" - "@player-ui/string-resolver" "0.2.0" - "@player-ui/types" "0.2.0" - "@player-ui/validator" "0.2.0" - dequal "^2.0.2" - dlv "^1.1.3" - tapable-ts "^0.1.0" - timm "^1.6.2" "@popperjs/core@^2.9.3": version "2.11.6" @@ -4788,7 +4625,7 @@ resolved "https://registry.yarnpkg.com/@types/aria-query/-/aria-query-4.2.2.tgz#ed4e0ad92306a704f9fb132a0cfcf77486dbe2bc" integrity sha512-HnYpAE1Y6kRyKM/XkEuiRQhTHvkzMBurTHnpFLYLBGPIylZNPs9jJcuOOYWxPLJCSEtmZT0Y8rHDokKN7rRTig== -"@types/babel__core@*", "@types/babel__core@^7.0.0", "@types/babel__core@^7.1.12", "@types/babel__core@^7.1.14": +"@types/babel__core@*", "@types/babel__core@^7.0.0", "@types/babel__core@^7.1.14": version "7.1.19" resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.19.tgz#7b497495b7d1b4812bdb9d02804d0576f43ee460" integrity sha512-WEOTgRsbYkvA/KCsDwVEGkd7WAr1e3g31VHQ8zy5gul/V1qKullU/BU5I68X5v7V3GnB9eotmom4v5a5gjxorw== @@ -6165,7 +6002,7 @@ babel-plugin-jest-hoist@^27.5.1: "@types/babel__core" "^7.0.0" "@types/babel__traverse" "^7.0.6" -babel-plugin-macros@^3.0.1, babel-plugin-macros@^3.1.0: +babel-plugin-macros@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/babel-plugin-macros/-/babel-plugin-macros-3.1.0.tgz#9ef6dc74deb934b4db344dc973ee851d148c50c1" integrity sha512-Cg7TFGpIr01vOQNODXOOaGz2NpCU5gl8x1qJFbb6hbZxR7XrcE2vtbAsTAbJ7/xwJtUuJEw8K8Zr/AE0LHlesg== @@ -6198,16 +6035,6 @@ babel-plugin-polyfill-regenerator@^0.4.1: dependencies: "@babel/helper-define-polyfill-provider" "^0.3.3" -babel-plugin-preval@^5.0.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/babel-plugin-preval/-/babel-plugin-preval-5.1.0.tgz#6efb89bf6b97af592cd1400c6df49c0e9e6ab027" - integrity sha512-G5R+xmo5LS41A4UyZjOjV0mp9AvkuCyUOAJ6TOv/jTZS+VKh7L7HUDRcCSOb0YCM/u0fFarh7Diz0wjY8rFNFg== - dependencies: - "@babel/runtime" "^7.12.5" - "@types/babel__core" "^7.1.12" - babel-plugin-macros "^3.0.1" - require-from-string "^2.0.2" - babel-plugin-syntax-trailing-function-commas@^7.0.0-beta.0: version "7.0.0-beta.0" resolved "https://registry.yarnpkg.com/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-7.0.0-beta.0.tgz#aa213c1435e2bffeb6fca842287ef534ad05d5cf" @@ -15366,11 +15193,6 @@ require-directory@^2.1.1: resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q== -require-from-string@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" - integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw== - require-main-filename@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b" From d858b800cacf59c4e3b3590468046cbe7960fb40 Mon Sep 17 00:00:00 2001 From: Adam Dierkens Date: Sat, 21 Jan 2023 06:04:06 -0500 Subject: [PATCH 15/52] Use applyReact instead of applyWeb --- drag-and-drop/library/src/utils/player-dnd-plugin.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drag-and-drop/library/src/utils/player-dnd-plugin.ts b/drag-and-drop/library/src/utils/player-dnd-plugin.ts index 8c8d9272..e4f519bc 100644 --- a/drag-and-drop/library/src/utils/player-dnd-plugin.ts +++ b/drag-and-drop/library/src/utils/player-dnd-plugin.ts @@ -126,7 +126,7 @@ export class PlayerDndPlugin implements ReactPlayerPlugin { this.state.set(player, state); } - applyWeb(webPlayer: ReactPlayer) { + applyReact(webPlayer: ReactPlayer) { const match = { type: this.options.Target.type ?? 'drop-target' }; webPlayer.assetRegistry.set(match, this.options.Target.Component); } From 364981f61452673ec6e4a329953752a134bae816 Mon Sep 17 00:00:00 2001 From: sandrews06 Date: Wed, 25 Jan 2023 12:31:04 -0500 Subject: [PATCH 16/52] Move Test Helpers out of `@player-tools/xlr-utils` Moving the typescript filesystem mock for tests out of the utils package and into test helpers for the converters. Co-authored-by: Shawn Andrews --- xlr/converters/BUILD | 3 ++- .../src => converters/src/__tests__/helpers}/test-helpers.ts | 4 ++-- xlr/converters/src/__tests__/player.test.ts | 2 +- xlr/converters/src/__tests__/ts-to-common.test.ts | 2 +- xlr/utils/BUILD | 3 +-- xlr/utils/src/index.ts | 1 - 6 files changed, 7 insertions(+), 8 deletions(-) rename xlr/{utils/src => converters/src/__tests__/helpers}/test-helpers.ts (91%) diff --git a/xlr/converters/BUILD b/xlr/converters/BUILD index f885e127..163328f5 100644 --- a/xlr/converters/BUILD +++ b/xlr/converters/BUILD @@ -5,7 +5,8 @@ javascript_pipeline( name = "@player-tools/xlr-converters", dependencies = [ "//xlr/types:@player-tools/xlr", - "//xlr/utils:@player-tools/xlr-utils" + "//xlr/utils:@player-tools/xlr-utils", + "@npm//@typescript/vfs", ], peer_dependencies = [ "@npm//typescript" diff --git a/xlr/utils/src/test-helpers.ts b/xlr/converters/src/__tests__/helpers/test-helpers.ts similarity index 91% rename from xlr/utils/src/test-helpers.ts rename to xlr/converters/src/__tests__/helpers/test-helpers.ts index 831ea036..d131766a 100644 --- a/xlr/utils/src/test-helpers.ts +++ b/xlr/converters/src/__tests__/helpers/test-helpers.ts @@ -1,5 +1,5 @@ -import ts from 'typescript'; -import tsvfs from '@typescript/vfs'; +import * as ts from 'typescript'; +import * as tsvfs from '@typescript/vfs'; export interface SetupReturnType { /** diff --git a/xlr/converters/src/__tests__/player.test.ts b/xlr/converters/src/__tests__/player.test.ts index 79f8f8b6..bde989a3 100644 --- a/xlr/converters/src/__tests__/player.test.ts +++ b/xlr/converters/src/__tests__/player.test.ts @@ -1,4 +1,4 @@ -import { setupTestEnv } from '@player-tools/xlr-utils'; +import { setupTestEnv } from './helpers/test-helpers'; import { TsConverter } from '..'; it('Player Types Export', () => { diff --git a/xlr/converters/src/__tests__/ts-to-common.test.ts b/xlr/converters/src/__tests__/ts-to-common.test.ts index 54f62b99..a92b2f71 100644 --- a/xlr/converters/src/__tests__/ts-to-common.test.ts +++ b/xlr/converters/src/__tests__/ts-to-common.test.ts @@ -1,5 +1,5 @@ /* eslint-disable no-template-curly-in-string */ -import { setupTestEnv } from '@player-tools/xlr-utils'; +import { setupTestEnv } from './helpers/test-helpers'; import { TsConverter } from '..'; describe('Type Exports', () => { diff --git a/xlr/utils/BUILD b/xlr/utils/BUILD index 403d1829..d0e7d301 100644 --- a/xlr/utils/BUILD +++ b/xlr/utils/BUILD @@ -4,8 +4,7 @@ load("//:index.bzl", "javascript_pipeline") javascript_pipeline( name = "@player-tools/xlr-utils", dependencies = [ - "//xlr/types:@player-tools/xlr", - "@npm//@typescript/vfs" + "//xlr/types:@player-tools/xlr" ], peer_dependencies = [ "@npm//typescript", diff --git a/xlr/utils/src/index.ts b/xlr/utils/src/index.ts index ae9e776c..86c5c816 100644 --- a/xlr/utils/src/index.ts +++ b/xlr/utils/src/index.ts @@ -2,4 +2,3 @@ export * from './annotations'; export * from './ts-helpers'; export * from './type-checks'; export * from './validation-helpers'; -export * from './test-helpers'; From aa8508abf0775620a9ba669b10f3cc20cedc4198 Mon Sep 17 00:00:00 2001 From: Chengli Wang Date: Wed, 1 Feb 2023 10:48:44 -0500 Subject: [PATCH 17/52] fix: Import existing content into drag and drop --- drag-and-drop/app/BUILD | 3 +- drag-and-drop/app/pages/index.tsx | 22 ++++ drag-and-drop/library/BUILD | 2 + .../library/src/__tests__/controller.test.tsx | 112 ++++++++++++++++++ drag-and-drop/library/src/controller.tsx | 5 + .../library/src/utils/runtime-flow-state.ts | 104 +++++++++++++++- package.json | 1 + yarn.lock | 5 + 8 files changed, 252 insertions(+), 2 deletions(-) diff --git a/drag-and-drop/app/BUILD b/drag-and-drop/app/BUILD index 046a2ac4..e5b972ff 100644 --- a/drag-and-drop/app/BUILD +++ b/drag-and-drop/app/BUILD @@ -27,7 +27,8 @@ data = [ "@npm//@types/node", "@npm//timm", "@npm//react-syntax-highlighter", - "@npm//react-docgen-typescript" + "@npm//react-docgen-typescript", + "@npm//react-files" ] next_export( diff --git a/drag-and-drop/app/pages/index.tsx b/drag-and-drop/app/pages/index.tsx index 7c1d4b3c..e700cadc 100644 --- a/drag-and-drop/app/pages/index.tsx +++ b/drag-and-drop/app/pages/index.tsx @@ -49,6 +49,7 @@ import pluginManifest from '@player-tools/static-xlrs/static_xlrs/plugin/xlr/man import typesManifest from '@player-tools/static-xlrs/static_xlrs/core/xlr/manifest'; import { AssetEditorPanel } from '../components/AssetEditorPanel'; import { covertXLRtoAssetDoc } from '../utils/converters'; +import Files from "react-files"; const PropertiesContext = React.createContext<{ /** @@ -243,6 +244,26 @@ const AssetSelectorPanel = () => { Export View + + { + const fileReader = new FileReader(); + fileReader.onload = () => { + controller.importView(JSON.parse(fileReader.result as string).views[0]); + }; + fileReader.readAsText(file[0]); + }} + accepts={[".json"]} + clickable + > + + + + @@ -422,6 +443,7 @@ const AssetDocsPanel = () => { const { displayedAssetID } = React.useContext(PropertiesContext); const { controller } = useController() ?? {}; const type = controller.getAssetDetails(displayedAssetID); + const docs = covertXLRtoAssetDoc(type); return ( diff --git a/drag-and-drop/library/BUILD b/drag-and-drop/library/BUILD index 74a92801..10f1484f 100644 --- a/drag-and-drop/library/BUILD +++ b/drag-and-drop/library/BUILD @@ -8,6 +8,8 @@ javascript_pipeline( "@npm//@player-ui/react", "@npm//react-dnd", "@npm//react-dnd-html5-backend", + "@npm//uuid", + "@npm//@types/uuid", ], peer_dependencies = [ "@npm//react", diff --git a/drag-and-drop/library/src/__tests__/controller.test.tsx b/drag-and-drop/library/src/__tests__/controller.test.tsx index ee80dc9a..1e111f70 100644 --- a/drag-and-drop/library/src/__tests__/controller.test.tsx +++ b/drag-and-drop/library/src/__tests__/controller.test.tsx @@ -65,4 +65,116 @@ describe('drag-and-drop', () => { }, }); }); + + it('Import existing FRF into drag and drop', async () => { + // arrange + const frf = { + id: 'drag-and-drop-view-collection-1', + type: 'collection', + label: { + asset: { + id: 'drag-and-drop-view-label-info-1', + type: 'info', + title: { + asset: { + id: 'drag-and-drop-view-label-title-test-1', + type: 'text', + value: 'title', + }, + }, + subTitle: { + asset: { + id: 'drag-and-drop-view-label-subTitle-test-1', + type: 'text', + value: 'subtitle', + }, + }, + primaryInfo: { + asset: { + id: 'drag-and-drop-view-label-primaryInfo-test-1', + type: 'text', + value: 'info', + }, + }, + }, + }, + values: [ + { + asset: { + id: 'drag-and-drop-view-collection-text-1', + type: 'text', + value: 'text 1', + }, + }, + { + asset: { + id: 'drag-and-drop-view-field-1', + type: 'input', + binding: 'field1', + note: { + asset: { + id: 'drag-and-drop-view-input-note-test-1', + type: 'text', + value: 'input note', + }, + }, + }, + }, + { + asset: { + id: 'drag-and-drop-view-action-1', + type: 'action', + exp: 'a > b', + }, + }, + ], + }; + const dndController = new DragAndDropController({ + types: typesManifest, + extensions: [referenceAssetExtension], + resolveRequiredProperties: async ( + asset: Asset, + type: ObjectType + ) => { + return asset; + }, + }); + const { player } = dndController.webPlayer; + + // act + dndController.importView(frf, 'TestPlugin'); + /** + * + */ + const getView = () => + (player.getState() as InProgressState).controllers?.view.currentView + ?.lastUpdate; + + // assert + const dndView = getView() || {}; + expect(dndView.type).toStrictEqual('drop-target'); + expect(dndView.value.identifier.pluginName).toStrictEqual('TestPlugin'); + expect(dndView.value.identifier.name).toStrictEqual('CollectionAsset'); + expect(dndView.value.identifier.capability).toStrictEqual('Views'); + expect(dndView.value.type.name).toStrictEqual('CollectionAsset'); + expect(dndView.value.asset.id).toStrictEqual( + 'drag-and-drop-view-collection-1' + ); + expect(dndView.value.asset.type).toStrictEqual('collection'); + expect(dndView.value.asset.label.asset.type).toStrictEqual('drop-target'); + expect(dndView.value.asset.label.asset.context.parent.name).toStrictEqual( + 'collection' + ); + expect(dndView.value.asset.label.asset.context.propertyName).toStrictEqual( + 'label' + ); + const { primaryInfo } = dndView.value.asset.label.asset.value.asset; + expect(primaryInfo.asset.type).toStrictEqual('drop-target'); + expect(primaryInfo.asset.value.asset.value).toStrictEqual('info'); + const { values } = dndView.value.asset; + expect(values).toHaveLength(3); + const { note } = values[1].asset.value.asset; + expect(note.asset.type).toStrictEqual('drop-target'); + expect(note.asset.value.asset.value).toStrictEqual('input note'); + }); }); diff --git a/drag-and-drop/library/src/controller.tsx b/drag-and-drop/library/src/controller.tsx index b33cb9f4..42941bd9 100644 --- a/drag-and-drop/library/src/controller.tsx +++ b/drag-and-drop/library/src/controller.tsx @@ -189,4 +189,9 @@ export class DragAndDropController { // we only want JSON compliant values return JSON.parse(JSON.stringify(removeDndStateFromView(baseView))); } + + public importView(view: View, pluginName = '') { + this.runtimeState.importView(view, this.PlayerXLRService, pluginName); + this.dndWebPlayerPlugin.refresh(this.webPlayer.player); + } } diff --git a/drag-and-drop/library/src/utils/runtime-flow-state.ts b/drag-and-drop/library/src/utils/runtime-flow-state.ts index cc88a9d7..dd4c9a7e 100644 --- a/drag-and-drop/library/src/utils/runtime-flow-state.ts +++ b/drag-and-drop/library/src/utils/runtime-flow-state.ts @@ -1,5 +1,7 @@ import type { ObjectType } from '@player-tools/xlr'; -import type { Asset, View } from '@player-ui/types'; +import type { XLRService } from '@player-tools/language-service'; +import { v4 as uuidv4 } from 'uuid'; +import type { Asset, AssetWrapper, View } from '@player-ui/types'; import type { ExtensionProviderAssetIdentifier, FlowWithOneView, @@ -161,6 +163,7 @@ export class RuntimeFlowState { type: ObjectType; } { const asset = this.assetMappings[id]; + if (!asset || !asset.value) { throw new Error(`Cannot get asset value for unknown id: ${id}`); } @@ -188,6 +191,105 @@ export class RuntimeFlowState { asset.value = undefined; } + createDropTarget( + pluginName: string, + targetAssetType: ObjectType, + targetAsset: Asset, + propName = '', + parentAssetType = '' + ): DropTargetAssetType { + const dropTarget: DropTargetAssetType = { + id: uuidv4(), + __type: DragAndDropAssetType, + type: 'drop-target', + value: { + identifier: { + pluginName, + name: targetAssetType.name || '', + capability: parentAssetType.length === 0 ? 'Views' : 'Assets', + }, + type: targetAssetType, + asset: targetAsset, + }, + }; + + if (parentAssetType.length > 0 && propName.length > 0) { + dropTarget.context = { + propertyName: propName, + parent: { + pluginName, + name: parentAssetType, + }, + }; + } + + this.assetMappings[dropTarget.id] = dropTarget; + return dropTarget; + } + + addDropTarget( + assetWrapper: AssetWrapper, + xlrService: XLRService, + pluginName: string, + propName: string, + parentAssetType: string + ) { + const targetAsset = assetWrapper.asset; + const targetAssetType = xlrService.XLRSDK.getType( + targetAsset.type + ) as ObjectType; + /* eslint-disable-next-line no-param-reassign */ + assetWrapper.asset = this.createDropTarget( + pluginName, + targetAssetType, + targetAsset, + propName, + parentAssetType + ); + this.addDndStateToAsset(targetAsset, xlrService, pluginName); + } + + addDndStateToAsset(asset: Asset, xlrService: XLRService, pluginName: string) { + const assetType = xlrService.XLRSDK.getType(asset.type) as ObjectType; + if (assetType === undefined || assetType.name === undefined) { + throw new Error(`cannot find asset type: ${asset.type}`); + } + + Object.entries(asset).forEach(([key]) => { + if (key in assetType.properties) { + const { node } = assetType.properties[key]; + if (node.type === 'ref' && node.ref.startsWith('AssetWrapper')) { + this.addDropTarget( + asset[key] as AssetWrapper, + xlrService, + pluginName, + key, + asset.type + ); + } else if ( + node.type === 'array' && + node.elementType.type === 'ref' && + node.elementType.ref.startsWith('AssetWrapper') + ) { + (asset[key] as Array).forEach((value: AssetWrapper) => { + this.addDropTarget(value, xlrService, pluginName, key, asset.type); + }); + } + } + }); + } + + importView(view: View, xlrService: XLRService, pluginName: string) { + const viewType = xlrService.XLRSDK.getType(view.type) as ObjectType; + if (viewType === undefined || viewType.name === undefined) { + throw new Error(`cannot find view type: ${view.type}`); + } + + this.assetMappings = {}; + this.addDndStateToAsset(view, xlrService, pluginName); + this.ROOT = this.createDropTarget(pluginName, viewType, view); + } + get view(): View { return this.ROOT; } diff --git a/package.json b/package.json index 800361f8..b9184f10 100644 --- a/package.json +++ b/package.json @@ -131,6 +131,7 @@ "react-docgen-typescript": "^2.1.1", "react-dom": "^18.2.0", "react-error-boundary": "^3.1.3", + "react-files": "^3.0.0-alpha.3", "react-flame-graph": "^1.4.0", "react-flatten-children": "^1.1.2", "react-icons": "^4.3.1", diff --git a/yarn.lock b/yarn.lock index f37109a3..d251b5a9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -14705,6 +14705,11 @@ react-fast-compare@3.2.0: resolved "https://registry.yarnpkg.com/react-fast-compare/-/react-fast-compare-3.2.0.tgz#641a9da81b6a6320f270e89724fb45a0b39e43bb" integrity sha512-rtGImPZ0YyLrscKI9xTpV8psd6I8VAtjKCzQDlzyDvqJA8XOW78TXYQwNRNd8g8JZnDu8q9Fu/1v4HPAVwVdHA== +react-files@^3.0.0-alpha.3: + version "3.0.0-alpha.3" + resolved "https://registry.yarnpkg.com/react-files/-/react-files-3.0.0-alpha.3.tgz#252cf1bc5809f21fd0f436d6d0cb423a9db12bcd" + integrity sha512-o5px0uPlktbgQlBXVP8cjOQIQI2N6mnhzlFosElb+J7ENI0hWbj+8R8c9siay1XRtRqIdN0UCvObdTkzkl8LKA== + react-flame-graph@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/react-flame-graph/-/react-flame-graph-1.4.0.tgz#52d118cc94348f630a812fc0ec530a5b73c30cdb" From 263236b93f591bf9ca31319d063ac4b0f14462f8 Mon Sep 17 00:00:00 2001 From: Chengli Wang Date: Thu, 2 Feb 2023 11:09:02 -0500 Subject: [PATCH 18/52] fix: change addDndStateToAsset to return a new view --- drag-and-drop/library/BUILD | 2 - .../library/src/__tests__/controller.test.tsx | 10 +- drag-and-drop/library/src/controller.tsx | 4 +- .../library/src/utils/runtime-flow-state.ts | 148 ++++++++++-------- 4 files changed, 93 insertions(+), 71 deletions(-) diff --git a/drag-and-drop/library/BUILD b/drag-and-drop/library/BUILD index 10f1484f..74a92801 100644 --- a/drag-and-drop/library/BUILD +++ b/drag-and-drop/library/BUILD @@ -8,8 +8,6 @@ javascript_pipeline( "@npm//@player-ui/react", "@npm//react-dnd", "@npm//react-dnd-html5-backend", - "@npm//uuid", - "@npm//@types/uuid", ], peer_dependencies = [ "@npm//react", diff --git a/drag-and-drop/library/src/__tests__/controller.test.tsx b/drag-and-drop/library/src/__tests__/controller.test.tsx index 1e111f70..6a32857c 100644 --- a/drag-and-drop/library/src/__tests__/controller.test.tsx +++ b/drag-and-drop/library/src/__tests__/controller.test.tsx @@ -66,9 +66,9 @@ describe('drag-and-drop', () => { }); }); - it('Import existing FRF into drag and drop', async () => { + it('Import existing content into drag and drop', async () => { // arrange - const frf = { + const content = { id: 'drag-and-drop-view-collection-1', type: 'collection', label: { @@ -142,7 +142,7 @@ describe('drag-and-drop', () => { const { player } = dndController.webPlayer; // act - dndController.importView(frf, 'TestPlugin'); + dndController.importView(content); /** * */ @@ -153,7 +153,9 @@ describe('drag-and-drop', () => { // assert const dndView = getView() || {}; expect(dndView.type).toStrictEqual('drop-target'); - expect(dndView.value.identifier.pluginName).toStrictEqual('TestPlugin'); + expect(dndView.value.identifier.pluginName).toStrictEqual( + 'BaseAssetsPlugin' + ); expect(dndView.value.identifier.name).toStrictEqual('CollectionAsset'); expect(dndView.value.identifier.capability).toStrictEqual('Views'); expect(dndView.value.type.name).toStrictEqual('CollectionAsset'); diff --git a/drag-and-drop/library/src/controller.tsx b/drag-and-drop/library/src/controller.tsx index 42941bd9..f2131bc1 100644 --- a/drag-and-drop/library/src/controller.tsx +++ b/drag-and-drop/library/src/controller.tsx @@ -190,8 +190,8 @@ export class DragAndDropController { return JSON.parse(JSON.stringify(removeDndStateFromView(baseView))); } - public importView(view: View, pluginName = '') { - this.runtimeState.importView(view, this.PlayerXLRService, pluginName); + public importView(view: View) { + this.runtimeState.importView(view, this.PlayerXLRService); this.dndWebPlayerPlugin.refresh(this.webPlayer.player); } } diff --git a/drag-and-drop/library/src/utils/runtime-flow-state.ts b/drag-and-drop/library/src/utils/runtime-flow-state.ts index dd4c9a7e..82be93f1 100644 --- a/drag-and-drop/library/src/utils/runtime-flow-state.ts +++ b/drag-and-drop/library/src/utils/runtime-flow-state.ts @@ -1,7 +1,7 @@ import type { ObjectType } from '@player-tools/xlr'; import type { XLRService } from '@player-tools/language-service'; -import { v4 as uuidv4 } from 'uuid'; -import type { Asset, AssetWrapper, View } from '@player-ui/types'; +import type { TypeMetadata } from '@player-tools/xlr-sdk'; +import type { Asset, View } from '@player-ui/types'; import type { ExtensionProviderAssetIdentifier, FlowWithOneView, @@ -34,6 +34,15 @@ export interface RuntimeFlowStateOptions { resolveRequiredProperties: (asset: Asset, type: ObjectType) => Promise; } +/** The context for the drop target */ +interface DropTargetContextType { + /** The name of the property that this asset fulfills */ + propName: string; + + /** The parent asset type */ + parentAssetType: string; +} + /** * */ @@ -192,33 +201,41 @@ export class RuntimeFlowState { } createDropTarget( - pluginName: string, - targetAssetType: ObjectType, + xlrService: XLRService, targetAsset: Asset, - propName = '', - parentAssetType = '' + dropTargetContext: DropTargetContextType ): DropTargetAssetType { + const targetAssetType = xlrService.XLRSDK.getType( + targetAsset.type + ) as ObjectType; + const { plugin } = xlrService.XLRSDK.getTypeInfo( + targetAsset.type + ) as TypeMetadata; const dropTarget: DropTargetAssetType = { - id: uuidv4(), + id: `${targetAsset.id}-dropTarget`, __type: DragAndDropAssetType, type: 'drop-target', value: { identifier: { - pluginName, - name: targetAssetType.name || '', - capability: parentAssetType.length === 0 ? 'Views' : 'Assets', + pluginName: plugin, + name: targetAssetType.name ?? '', + capability: + dropTargetContext.parentAssetType.length === 0 ? 'Views' : 'Assets', }, type: targetAssetType, asset: targetAsset, }, }; - if (parentAssetType.length > 0 && propName.length > 0) { + if ( + dropTargetContext.parentAssetType.length > 0 && + dropTargetContext.propName.length > 0 + ) { dropTarget.context = { - propertyName: propName, + propertyName: dropTargetContext.propName, parent: { - pluginName, - name: parentAssetType, + pluginName: plugin, + name: dropTargetContext.parentAssetType, }, }; } @@ -227,67 +244,72 @@ export class RuntimeFlowState { return dropTarget; } - addDropTarget( - assetWrapper: AssetWrapper, + addDndStateToAsset( + obj: any, xlrService: XLRService, - pluginName: string, - propName: string, - parentAssetType: string + dropTargetContext: DropTargetContextType ) { - const targetAsset = assetWrapper.asset; - const targetAssetType = xlrService.XLRSDK.getType( - targetAsset.type - ) as ObjectType; - /* eslint-disable-next-line no-param-reassign */ - assetWrapper.asset = this.createDropTarget( - pluginName, - targetAssetType, - targetAsset, - propName, - parentAssetType - ); - this.addDndStateToAsset(targetAsset, xlrService, pluginName); - } - - addDndStateToAsset(asset: Asset, xlrService: XLRService, pluginName: string) { - const assetType = xlrService.XLRSDK.getType(asset.type) as ObjectType; - if (assetType === undefined || assetType.name === undefined) { - throw new Error(`cannot find asset type: ${asset.type}`); + if (obj === null) { + return obj; } - Object.entries(asset).forEach(([key]) => { - if (key in assetType.properties) { + const newObj = { ...obj }; + const assetType = xlrService.XLRSDK.getType(obj.type) as ObjectType; + Object.keys(newObj).forEach((key) => { + let isAssetWrapper = false; + if (assetType && key in assetType.properties) { const { node } = assetType.properties[key]; - if (node.type === 'ref' && node.ref.startsWith('AssetWrapper')) { - this.addDropTarget( - asset[key] as AssetWrapper, - xlrService, - pluginName, - key, - asset.type - ); - } else if ( - node.type === 'array' && - node.elementType.type === 'ref' && - node.elementType.ref.startsWith('AssetWrapper') + if ( + (node.type === 'ref' && node.ref.startsWith('AssetWrapper')) || + (node.type === 'array' && + node.elementType.type === 'ref' && + node.elementType.ref.startsWith('AssetWrapper')) ) { - (asset[key] as Array).forEach((value: AssetWrapper) => { - this.addDropTarget(value, xlrService, pluginName, key, asset.type); - }); + isAssetWrapper = true; } } - }); - } - importView(view: View, xlrService: XLRService, pluginName: string) { - const viewType = xlrService.XLRSDK.getType(view.type) as ObjectType; - if (viewType === undefined || viewType.name === undefined) { - throw new Error(`cannot find view type: ${view.type}`); + if ( + key === 'asset' && + dropTargetContext.propName.length > 0 && + dropTargetContext.parentAssetType.length > 0 + ) { + newObj[key] = this.createDropTarget( + xlrService, + this.addDndStateToAsset(obj[key], xlrService, dropTargetContext), + dropTargetContext + ); + } else if (typeof obj[key] === 'object') { + newObj[key] = this.addDndStateToAsset( + obj[key], + xlrService, + isAssetWrapper + ? { propName: key, parentAssetType: obj.type } + : dropTargetContext + ); + } else { + newObj[key] = obj[key]; + } + }); + if (Array.isArray(obj)) { + newObj.length = obj.length; + return Array.from(newObj); } + return newObj; + } + + importView(view: View, xlrService: XLRService) { + const dropTargetContext: DropTargetContextType = { + propName: '', + parentAssetType: '', + }; this.assetMappings = {}; - this.addDndStateToAsset(view, xlrService, pluginName); - this.ROOT = this.createDropTarget(pluginName, viewType, view); + this.ROOT = this.createDropTarget( + xlrService, + this.addDndStateToAsset(view, xlrService, dropTargetContext), + dropTargetContext + ); } get view(): View { From 8656b6d251a023998fd5e00f163a2f7d12c3bb8d Mon Sep 17 00:00:00 2001 From: Ketan Reddy Date: Wed, 1 Feb 2023 13:38:02 -0800 Subject: [PATCH 19/52] Bump player and react types version. Fix new type errors --- language/dsl/BUILD | 6 +- language/dsl/src/compiler/schema.ts | 2 +- language/dsl/src/switch.tsx | 4 +- language/dsl/src/template.tsx | 39 +++--- language/dsl/src/utils.tsx | 4 +- package.json | 13 +- yarn.lock | 185 ++++++++++++++++------------ 7 files changed, 140 insertions(+), 113 deletions(-) diff --git a/language/dsl/BUILD b/language/dsl/BUILD index d349976e..16a61b8c 100644 --- a/language/dsl/BUILD +++ b/language/dsl/BUILD @@ -23,9 +23,7 @@ javascript_pipeline( "@npm//dequal" ], peer_dependencies = [ - "@npm//react" - ], - test_data = [ + "@npm//react", "@npm//@types/react" - ], + ], ) diff --git a/language/dsl/src/compiler/schema.ts b/language/dsl/src/compiler/schema.ts index 925b9373..a2c8116b 100644 --- a/language/dsl/src/compiler/schema.ts +++ b/language/dsl/src/compiler/schema.ts @@ -2,7 +2,7 @@ import type { Schema, Language } from '@player-ui/types'; import signale from 'signale'; import { dequal } from 'dequal'; import { SyncWaterfallHook } from 'tapable-ts'; -import { binding as b } from '..'; +import { binding as b } from '../string-templates'; import type { BindingTemplateInstance } from '../string-templates'; const bindingSymbol = Symbol('binding'); diff --git a/language/dsl/src/switch.tsx b/language/dsl/src/switch.tsx index 522f41c7..b895e691 100644 --- a/language/dsl/src/switch.tsx +++ b/language/dsl/src/switch.tsx @@ -1,8 +1,8 @@ import type { PropsWithChildren } from 'react'; import React from 'react'; import type { ArrayNode, JsonNode, ObjectNode } from 'react-json-reconciler'; -import { flattenNodes, PropertyNode } from 'react-json-reconciler'; -import { SlotContext } from '.'; +import { flattenNodes } from 'react-json-reconciler'; +import { SlotContext } from './components'; import { IDSuffixProvider, OptionalIDSuffixProvider } from './auto-id'; import type { BindingTemplateInstance, diff --git a/language/dsl/src/template.tsx b/language/dsl/src/template.tsx index 793c6f26..d66d6ec3 100644 --- a/language/dsl/src/template.tsx +++ b/language/dsl/src/template.tsx @@ -1,3 +1,4 @@ +/* eslint-disable react/jsx-no-useless-fragment */ import React from 'react'; import type { ObjectNode, JsonNode } from 'react-json-reconciler'; import { @@ -163,24 +164,26 @@ export const Template = (props: TemplateProps) => { return ( - {createPortal( - - - - {props.data.toValue()} - {outputProp} - {props.children} - - - , - outputElement - )} - + <> + {createPortal( + + + + {props.data.toValue()} + {outputProp} + {props.children} + + + , + outputElement + )} + + ); }; diff --git a/language/dsl/src/utils.tsx b/language/dsl/src/utils.tsx index effc1b34..0962053e 100644 --- a/language/dsl/src/utils.tsx +++ b/language/dsl/src/utils.tsx @@ -56,7 +56,7 @@ export function normalizeText(options: { node: React.ReactNode; /** A component to render a text asset */ - TextComp?: React.ComponentType; + TextComp?: React.ComponentType; }): React.ReactNode { const { node, TextComp } = options; @@ -88,7 +88,7 @@ export function normalizeToCollection(options: { TextComp?: React.ComponentType; /** A collection asset */ - CollectionComp?: React.ComponentType; + CollectionComp?: React.ComponentType; }) { const { node, CollectionComp } = options; diff --git a/package.json b/package.json index b9184f10..4373770f 100644 --- a/package.json +++ b/package.json @@ -44,12 +44,12 @@ "@kendallgassner/eslint-plugin-package-json": "^0.2.1", "@oclif/core": "1.9.0", "@oclif/plugin-legacy": "^1.2.7", - "@player-ui/types": "0.3.0", - "@player-ui/player": "0.3.0", + "@player-ui/types": "0.4.0-next.6", + "@player-ui/player": "0.4.0-next.6", "@reduxjs/toolkit": "^1.6.1", "@rollup/plugin-image": "^2.1.1", - "@player-ui/react": "0.3.0", - "@player-ui/reference-assets-plugin-react": "0.3.0", + "@player-ui/react": "0.4.0-next.6", + "@player-ui/reference-assets-plugin-react": "0.4.0-next.6", "@rollup/plugin-json": "^4.1.0", "@rollup/plugin-node-resolve": "^13.0.6", "@testing-library/dom": "^8.10.1", @@ -62,7 +62,7 @@ "@types/micromatch": "^4.0.2", "@types/mkdirp": "^1.0.2", "@types/node": "^16.11.12", - "@types/react": "^17.0.25", + "@types/react": "^18.0.27", "@types/signale": "^1.4.2", "@types/std-mocks": "^1.0.1", "@types/uuid": "^8.3.4", @@ -162,6 +162,9 @@ "webpack-cli": "^3.3.0", "zip-folder": "^1.0.0" }, + "resolutions": { + "@types/react": "^18.0.27" + }, "volta": { "node": "16.14.0" } diff --git a/yarn.lock b/yarn.lock index d251b5a9..533db91b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4185,126 +4185,127 @@ dependencies: "@octokit/openapi-types" "^12.11.0" -"@player-ui/asset-provider-plugin-react@0.3.0": - version "0.3.0" - resolved "https://registry.yarnpkg.com/@player-ui/asset-provider-plugin-react/-/asset-provider-plugin-react-0.3.0.tgz#f285adce23f125fbb75ee20bc00735cf1a6ab363" - integrity sha512-Ys7N5HQp4g6WoL6XmOcRq+zxC+Gbf5M9JDRYGn1WuicxfZ5RCF1V24vd3DGslRGxzbgXQ+4d2Cy7mn2PDi1P4A== +"@player-ui/asset-provider-plugin-react@0.4.0-next.6": + version "0.4.0-next.6" + resolved "https://registry.yarnpkg.com/@player-ui/asset-provider-plugin-react/-/asset-provider-plugin-react-0.4.0-next.6.tgz#d72eda09bced1f0e6c70e481a81efd861ddb9788" + integrity sha512-ljV8LvDj/CFbV7DDq8vFs8bucdWCyYeqhql12PnfZ0fQ4yQxo4bBoBn5sSWNDM5MHTeoU/hkcC8Bkxwftbza+A== dependencies: "@babel/runtime" "7.15.4" - "@player-ui/react-subscribe" "0.3.0" + "@player-ui/react-subscribe" "0.4.0-next.6" -"@player-ui/asset-transform-plugin@0.3.0": - version "0.3.0" - resolved "https://registry.yarnpkg.com/@player-ui/asset-transform-plugin/-/asset-transform-plugin-0.3.0.tgz#a4301266e28f0e9baa90336710b49a88ade4adff" - integrity sha512-uk2E33G87URTREXW5BhmI/PMeJoj81ztWkqevjYHvU/TmdoC1zPPrTQwcjcnO+PwjvkpZjbvENaSjai6V4q6ng== +"@player-ui/asset-transform-plugin@0.4.0-next.6": + version "0.4.0-next.6" + resolved "https://registry.yarnpkg.com/@player-ui/asset-transform-plugin/-/asset-transform-plugin-0.4.0-next.6.tgz#1c91f8d3123b3351e3772255a0868b6aa186b485" + integrity sha512-ffL+BelPEgpaPJ/atHR5kVvxWv8ZFab21x7MAD+zMfQdwkSOB58MtuBvvGUn39pTl6h2NbUV+jGcQuhNpFZAkw== dependencies: "@babel/runtime" "7.15.4" - "@player-ui/partial-match-registry" "0.3.0" + "@player-ui/partial-match-registry" "0.4.0-next.6" -"@player-ui/beacon-plugin-react@0.3.0": - version "0.3.0" - resolved "https://registry.yarnpkg.com/@player-ui/beacon-plugin-react/-/beacon-plugin-react-0.3.0.tgz#9ca522a4a7ebb5db29d9af6b3d7783fff871fb7c" - integrity sha512-gr6DB1AUoztsJhACJ7N37iyuz7cQsl7e+GcSWdnlwx3MQ0UWm4hqDitM+3slgBUA7BSux31GPTTr2+0WTcZKBw== +"@player-ui/beacon-plugin-react@0.4.0-next.6": + version "0.4.0-next.6" + resolved "https://registry.yarnpkg.com/@player-ui/beacon-plugin-react/-/beacon-plugin-react-0.4.0-next.6.tgz#171aecb05ce6572dbece53964b126b6e3fcc0934" + integrity sha512-ZHr7OtsFqRmucMjMyR9YBo/NVt3FCtimSM9dGj0hf4ZPWmz6uKoWwwEl65nudUTkL/9hJCSL5QUbhoJd/C81Tw== dependencies: "@babel/runtime" "7.15.4" - "@player-ui/beacon-plugin" "0.3.0" + "@player-ui/beacon-plugin" "0.4.0-next.6" -"@player-ui/beacon-plugin@0.3.0": - version "0.3.0" - resolved "https://registry.yarnpkg.com/@player-ui/beacon-plugin/-/beacon-plugin-0.3.0.tgz#91e677243e95583b3874a12bef771032da6d31df" - integrity sha512-2l/IZNw/j6Z3AZ6SeRIAPMr3JND+M9Oko/nQaMT5FcknzSpz37+iAtHtKpDYyy2ZpXtTAvyVP8mN0uaP3Xbf6Q== +"@player-ui/beacon-plugin@0.4.0-next.6": + version "0.4.0-next.6" + resolved "https://registry.yarnpkg.com/@player-ui/beacon-plugin/-/beacon-plugin-0.4.0-next.6.tgz#bc744246c65ca603ffc68f23b8114d5392ee76b3" + integrity sha512-tGbHpkqYl47ZnIVO+FCBDvzbFxEUt23KIwcjMiqsaebaiWiUAc9h+mAm3uPyBVZPiVtyOm9JXYoIAyd0wlFE/Q== dependencies: "@babel/runtime" "7.15.4" - tapable-ts "^0.1.0" + tapable-ts "^0.2.3" timm "^1.6.2" -"@player-ui/metrics-plugin@0.3.0": - version "0.3.0" - resolved "https://registry.yarnpkg.com/@player-ui/metrics-plugin/-/metrics-plugin-0.3.0.tgz#dd5fd59e2cea5abcde48d941ad726b5c6d9ba3b6" - integrity sha512-0bIan24i6PCJV9QLQ/4ERSdoU6wOErg7ikPh8BUAxRuwYFhe3ijgoBMad6jO1m3CHo/IaQQYXyKqbTVo9a1cRQ== +"@player-ui/metrics-plugin@0.4.0-next.6": + version "0.4.0-next.6" + resolved "https://registry.yarnpkg.com/@player-ui/metrics-plugin/-/metrics-plugin-0.4.0-next.6.tgz#f7fbbfbadf98a4cd4534a4028b3193e8f5b06785" + integrity sha512-/QPlpAJ/AKkb+syKeLgw7UFL7NSKQXCR34JGa+JtvVbSb67UtCtHnR4N63JHEoSLnHTi6hJBZoXYPK8oaZ7SOw== dependencies: "@babel/runtime" "7.15.4" - "@player-ui/beacon-plugin" "0.3.0" - tapable-ts "^0.1.0" + "@player-ui/beacon-plugin" "0.4.0-next.6" + tapable-ts "^0.2.3" -"@player-ui/partial-match-registry@0.3.0": - version "0.3.0" - resolved "https://registry.yarnpkg.com/@player-ui/partial-match-registry/-/partial-match-registry-0.3.0.tgz#cd102b947ccba754e390a1a022d8ccd8698053c4" - integrity sha512-jssryLQrPMz/A7KmtDH4M3/i2aWSVF4K6WCLZWFCxWhXKF0DXV/kdCH+8TIWMZ2mBjPwh3DZ3H6yFEhfU7DGCg== +"@player-ui/partial-match-registry@0.4.0-next.6": + version "0.4.0-next.6" + resolved "https://registry.yarnpkg.com/@player-ui/partial-match-registry/-/partial-match-registry-0.4.0-next.6.tgz#9bb98f411e08327359035eb06c6aa818f19ad97a" + integrity sha512-G0TxlcWoq54N4VnP4MW84eb2Kia1WWyAG6Dace6HVMuQ1tmZxOmOEF9p5uJkO8i5luNWfXowAAToxtJc/2TB5Q== dependencies: "@babel/runtime" "7.15.4" "@types/dlv" "^1.1.2" dlv "^1.1.3" sorted-array "^2.0.4" -"@player-ui/player@0.3.0": - version "0.3.0" - resolved "https://registry.yarnpkg.com/@player-ui/player/-/player-0.3.0.tgz#6cfbed27577e86c94ff0281be2c908081fe760a2" - integrity sha512-Tdd/g0yTLlCC/egXXt/DRypH/STtQYb4ZQGVvMPmonWCGo/f86DzygHUwsDEVeJCceme0nxw8gTaTlBYpAw/vQ== +"@player-ui/player@0.4.0-next.6": + version "0.4.0-next.6" + resolved "https://registry.yarnpkg.com/@player-ui/player/-/player-0.4.0-next.6.tgz#77efdac06e338f20632266ce1cbcf2d9b169a4e7" + integrity sha512-6yp72ePWdXY+S6jVpQUWhoolV2fuL8OfTbde5oabkvKtGXEPl8vnvSgc5guYvQsj+qKzLAtw0YP7s/9bvvDQQQ== dependencies: "@babel/runtime" "7.15.4" - "@player-ui/partial-match-registry" "0.3.0" - "@player-ui/types" "0.3.0" + "@player-ui/partial-match-registry" "0.4.0-next.6" + "@player-ui/types" "0.4.0-next.6" "@types/nested-error-stacks" "^2.1.0" "@types/parsimmon" "^1.10.0" arr-flatten "^1.1.0" dequal "^2.0.2" ebnf "^1.9.0" + error-polyfill "^0.1.3" nested-error-stacks "^2.1.1" p-defer "^3.0.0" parsimmon "^1.12.0" queue-microtask "^1.2.3" - tapable-ts "^0.1.0" + tapable-ts "^0.2.3" timm "^1.6.2" -"@player-ui/react-subscribe@0.3.0": - version "0.3.0" - resolved "https://registry.yarnpkg.com/@player-ui/react-subscribe/-/react-subscribe-0.3.0.tgz#3b8191e299be799aa706664c578da8d5cf45cff7" - integrity sha512-WZ+uKQaFUaHUs1dqOStgW0fgTyklIgt2/QDiNT3inxcN4GPnNiuj8siuwRZq7cZOskxWRf+LlR6yHW15CPUS6A== +"@player-ui/react-subscribe@0.4.0-next.6": + version "0.4.0-next.6" + resolved "https://registry.yarnpkg.com/@player-ui/react-subscribe/-/react-subscribe-0.4.0-next.6.tgz#d52deaa5e0ba055ce4b0fe2190aae44735354a7e" + integrity sha512-wsTeNDS3oRxPzhVCDAODss/sYAjlxgWvMjqX1VLd1Y0t/vdGhrUgLcAcelg7icN9927RwYNM05uAvyqIgK6Ssw== dependencies: "@babel/runtime" "7.15.4" p-defer "^3.0.0" -"@player-ui/react@0.3.0": - version "0.3.0" - resolved "https://registry.yarnpkg.com/@player-ui/react/-/react-0.3.0.tgz#ead658a6f32342629c4a5de8c6ce194c5157d111" - integrity sha512-0SeLfHF0//WoskTBAvTucdodR4uWMlYHoh/hRvBHytlvBLckpdepEdWs/DlaCxYz/C5PFIgROI2V9dWoOxfrQQ== +"@player-ui/react@0.4.0-next.6": + version "0.4.0-next.6" + resolved "https://registry.yarnpkg.com/@player-ui/react/-/react-0.4.0-next.6.tgz#613cbe0360b7dcb0fcee61d78ca5777a665f03c0" + integrity sha512-PoUZ4bBdK86JJ4JR8IlsOAxcQ5ek6jgvuCOkyTrMdYe1ieVF3hXHZXPsEZOzkGo0czZsXHiBQXUVpZf7FIPEZQ== dependencies: "@babel/runtime" "7.15.4" - "@player-ui/metrics-plugin" "0.3.0" - "@player-ui/partial-match-registry" "0.3.0" - "@player-ui/player" "0.3.0" - "@player-ui/react-subscribe" "0.3.0" + "@player-ui/metrics-plugin" "0.4.0-next.6" + "@player-ui/partial-match-registry" "0.4.0-next.6" + "@player-ui/player" "0.4.0-next.6" + "@player-ui/react-subscribe" "0.4.0-next.6" react-error-boundary "^3.1.3" - tapable-ts "^0.1.0" + tapable-ts "^0.2.3" -"@player-ui/reference-assets-plugin-react@0.3.0": - version "0.3.0" - resolved "https://registry.yarnpkg.com/@player-ui/reference-assets-plugin-react/-/reference-assets-plugin-react-0.3.0.tgz#d3eca60f10f865f6cf1fa02466501f288c7b2dad" - integrity sha512-gDEoHPvPEhSWlxXJ/t+Vj1tmtRV3iq+VeKiXNjXedgZfA0JkbdarsKRauUelIEI53OraBkxYI0Y+iYDivJ+R5Q== +"@player-ui/reference-assets-plugin-react@0.4.0-next.6": + version "0.4.0-next.6" + resolved "https://registry.yarnpkg.com/@player-ui/reference-assets-plugin-react/-/reference-assets-plugin-react-0.4.0-next.6.tgz#bed07aee8ee51741c5185ca3f496d26357fc4ffc" + integrity sha512-7FVeC8zSHe/sI2+P/kf37wTfPI9CCLBfk9ZtdFq2pTyAfAX8DT9cpba7s3xPylc2J4IPAUkC/ff7D2qTPoPx6g== dependencies: "@babel/runtime" "7.15.4" "@chakra-ui/icons" "^1.1.1" "@chakra-ui/react" "^1.7.3" - "@player-ui/asset-provider-plugin-react" "0.3.0" - "@player-ui/beacon-plugin-react" "0.3.0" - "@player-ui/partial-match-registry" "0.3.0" - "@player-ui/reference-assets-plugin" "0.3.0" + "@player-ui/asset-provider-plugin-react" "0.4.0-next.6" + "@player-ui/beacon-plugin-react" "0.4.0-next.6" + "@player-ui/partial-match-registry" "0.4.0-next.6" + "@player-ui/reference-assets-plugin" "0.4.0-next.6" clsx "^1.1.1" -"@player-ui/reference-assets-plugin@0.3.0": - version "0.3.0" - resolved "https://registry.yarnpkg.com/@player-ui/reference-assets-plugin/-/reference-assets-plugin-0.3.0.tgz#bda8c8817e0516d20a89d80a130baf49640b6625" - integrity sha512-9umL/lUUbvOcbPsh24Ss0RQ0k4Mp8FQesFWzV85DyIxGufv3gBLLinZK6CIZOrHft2vI1TXhwDrZhf99dhlbZA== +"@player-ui/reference-assets-plugin@0.4.0-next.6": + version "0.4.0-next.6" + resolved "https://registry.yarnpkg.com/@player-ui/reference-assets-plugin/-/reference-assets-plugin-0.4.0-next.6.tgz#c0022ebd607a79ad280a06e8d244dd51fcebbcb4" + integrity sha512-G49qH2uZVBNR8Y8ulrkmub61NWU6YNFmbiK3GDfaeaRTjawf8BJfOoW8BD24HAldq0DEv2/6No0SGxSmO63xiw== dependencies: "@babel/runtime" "7.15.4" - "@player-ui/asset-transform-plugin" "0.3.0" - "@player-ui/beacon-plugin" "0.3.0" + "@player-ui/asset-transform-plugin" "0.4.0-next.6" + "@player-ui/beacon-plugin" "0.4.0-next.6" -"@player-ui/types@0.3.0": - version "0.3.0" - resolved "https://registry.yarnpkg.com/@player-ui/types/-/types-0.3.0.tgz#821a78b59363bcd81f283f7d2882d5446937f000" - integrity sha512-feq7R8Pdm5yhSJmR7LHK+69IZQ1s0XAEN1HEiSyqqKP4x4IjROH9iRZ2x9lXjC6vh1Qi8uK5JSOht8ZxRYcm2Q== +"@player-ui/types@0.4.0-next.6": + version "0.4.0-next.6" + resolved "https://registry.yarnpkg.com/@player-ui/types/-/types-0.4.0-next.6.tgz#3a9ef9d6e684adfdf93a8afe77c0459ae5b608b7" + integrity sha512-denZHQ67HCuKbxMCWRAJp8kRsp21mXHNGN+/GK99Vlb4Ol5yezjrhdhrN+BtWRASrtzAk0vOOBqvs3r43CNrQw== dependencies: "@babel/runtime" "7.15.4" @@ -4945,19 +4946,10 @@ dependencies: "@types/react" "*" -"@types/react@*", "@types/react@>=16.9.0", "@types/react@^17", "@types/react@^17.0.15", "@types/react@^17.0.25": - version "17.0.50" - resolved "https://registry.yarnpkg.com/@types/react/-/react-17.0.50.tgz#39abb4f7098f546cfcd6b51207c90c4295ee81fc" - integrity sha512-ZCBHzpDb5skMnc1zFXAXnL3l1FAdi+xZvwxK+PkglMmBrwjpp9nKaWuEvrGnSifCJmBFGxZOOFuwC6KH/s0NuA== - dependencies: - "@types/prop-types" "*" - "@types/scheduler" "*" - csstype "^3.0.2" - -"@types/react@17.0.39": - version "17.0.39" - resolved "https://registry.yarnpkg.com/@types/react/-/react-17.0.39.tgz#d0f4cde092502a6db00a1cded6e6bf2abb7633ce" - integrity sha512-UVavlfAxDd/AgAacMa60Azl7ygyQNRwC/DsHZmKgNvPmRR5p70AJ5Q9EAmL2NWOJmeV+vVUI4IAP7GZrN8h8Ug== +"@types/react@*", "@types/react@17.0.39", "@types/react@>=16.9.0", "@types/react@^17", "@types/react@^17.0.15", "@types/react@^18.0.27": + version "18.0.27" + resolved "https://registry.yarnpkg.com/@types/react/-/react-18.0.27.tgz#d9425abe187a00f8a5ec182b010d4fd9da703b71" + integrity sha512-3vtRKHgVxu3Jp9t718R9BuzoD4NcQ8YJ5XRzsSKxNDiDonD2MXIT1TmSkenxuCycZJoQT5d2vE8LwWJxBC1gmA== dependencies: "@types/prop-types" "*" "@types/scheduler" "*" @@ -6583,6 +6575,11 @@ caniuse-lite@^1.0.30001406: resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001418.tgz#5f459215192a024c99e3e3a53aac310fc7cf24e6" integrity sha512-oIs7+JL3K9JRQ3jPZjlH6qyYDp+nBTCais7hjh0s+fuBwufc7uZ7hPYMXrDOJhV360KGMTcczMRObk0/iMqZRg== +capability@^0.2.5: + version "0.2.5" + resolved "https://registry.yarnpkg.com/capability/-/capability-0.2.5.tgz#51ad87353f1936ffd77f2f21c74633a4dea88801" + integrity sha512-rsJZYVCgXd08sPqwmaIqjAd5SUTfonV0z/gDJ8D6cN8wQphky1kkAYEqQ+hmDxTw7UihvBfjUVUSY+DBEe44jg== + capital-case@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/capital-case/-/capital-case-1.0.4.tgz#9d130292353c9249f6b00fa5852bee38a717e669" @@ -8219,6 +8216,15 @@ error-ex@^1.3.1: dependencies: is-arrayish "^0.2.1" +error-polyfill@^0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/error-polyfill/-/error-polyfill-0.1.3.tgz#df848b61ad8834f7a5db69a70b9913df86721d15" + integrity sha512-XHJk60ufE+TG/ydwp4lilOog549iiQF2OAPhkk9DdiYWMrltz5yhDz/xnKuenNwP7gy3dsibssO5QpVhkrSzzg== + dependencies: + capability "^0.2.5" + o3 "^1.0.3" + u3 "^0.1.1" + error-stack-parser@^2.0.6: version "2.1.4" resolved "https://registry.yarnpkg.com/error-stack-parser/-/error-stack-parser-2.1.4.tgz#229cb01cdbfa84440bfa91876285b94680188286" @@ -13267,6 +13273,13 @@ nwsapi@^2.2.0: resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.2.2.tgz#e5418863e7905df67d51ec95938d67bf801f0bb0" integrity sha512-90yv+6538zuvUMnN+zCr8LuV6bPFdq50304114vJYJ8RDyK8D5O9Phpbd6SZWgI7PwzmmfN1upeOJlvybDSgCw== +o3@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/o3/-/o3-1.0.3.tgz#192ce877a882dfa6751f0412a865fafb2da1dac0" + integrity sha512-f+4n+vC6s4ysy7YO7O2gslWZBUu8Qj2i2OUJOvjRxQva7jVjYjB29jrr9NCjmxZQR0gzrOcv1RnqoYOeMs5VRQ== + dependencies: + capability "^0.2.5" + ob1@0.70.3: version "0.70.3" resolved "https://registry.yarnpkg.com/ob1/-/ob1-0.70.3.tgz#f48cd5a5abf54b0c423b1b06b6d4ff4d049816cb" @@ -16418,6 +16431,11 @@ tapable-ts@^0.1.0: resolved "https://registry.yarnpkg.com/tapable-ts/-/tapable-ts-0.1.0.tgz#9ea393d3f5ed9c998ac1d5cff81a2293569ac47e" integrity sha512-pLNOGWrzcm+cc4UnyqEFK+k+thwJtJiuugKnsTrj7WPah4oZTnwDxKVNx9jhP6+RVfDOghaDIc14B5aXfV8wfQ== +tapable-ts@^0.2.3: + version "0.2.4" + resolved "https://registry.yarnpkg.com/tapable-ts/-/tapable-ts-0.2.4.tgz#51d0c46baa8355754e2796dfcd5586ebce742d68" + integrity sha512-CKej5YdHXHZtpzJ3MHF1ADeMNVF+qiiL3xGRo0cXWqfd8BbZmjV/8KYSoXHiAhsFWYcPyxoabS61p6VxkrwBRA== + tapable@^1.0.0, tapable@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/tapable/-/tapable-1.1.3.tgz#a1fccc06b58db61fd7a45da2da44f5f3a3e67ba2" @@ -16912,6 +16930,11 @@ typical@^5.2.0: resolved "https://registry.yarnpkg.com/typical/-/typical-5.2.0.tgz#4daaac4f2b5315460804f0acf6cb69c52bb93066" integrity sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg== +u3@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/u3/-/u3-0.1.1.tgz#5f52044f42ee76cd8de33148829e14528494b73b" + integrity sha512-+J5D5ir763y+Am/QY6hXNRlwljIeRMZMGs0cT6qqZVVzzT3X3nFPXVyPOFRMOR4kupB0T8JnCdpWdp6Q/iXn3w== + uc.micro@^1.0.1, uc.micro@^1.0.5: version "1.0.6" resolved "https://registry.yarnpkg.com/uc.micro/-/uc.micro-1.0.6.tgz#9c411a802a409a91fc6cf74081baba34b24499ac" From 432826c80bc58fc6899ba999a9244e062190a537 Mon Sep 17 00:00:00 2001 From: Harris Borawski Date: Wed, 18 Jan 2023 13:27:17 -0800 Subject: [PATCH 20/52] forward parameters to synthetic node for arrow functions with parameters --- .../__snapshots__/ts-to-common.test.ts.snap | 44 +++++++++++++++++++ .../src/__tests__/ts-to-common.test.ts | 22 ++++++++++ xlr/converters/src/ts-to-xlr.ts | 12 ++++- 3 files changed, 77 insertions(+), 1 deletion(-) diff --git a/xlr/converters/src/__tests__/__snapshots__/ts-to-common.test.ts.snap b/xlr/converters/src/__tests__/__snapshots__/ts-to-common.test.ts.snap index feed971d..24e80215 100644 --- a/xlr/converters/src/__tests__/__snapshots__/ts-to-common.test.ts.snap +++ b/xlr/converters/src/__tests__/__snapshots__/ts-to-common.test.ts.snap @@ -826,6 +826,50 @@ Array [ ] `; +exports[`Variable Exports Aliased function 1`] = ` +Array [ + Object { + "name": "foo", + "parameters": Array [ + Object { + "default": undefined, + "name": "input", + "optional": undefined, + "type": Object { + "type": "number", + }, + }, + ], + "returnType": Object { + "additionalProperties": false, + "genericTokens": undefined, + "name": "Bar", + "properties": Object { + "foo": Object { + "node": Object { + "title": "Bar.foo", + "type": "string", + }, + "required": true, + }, + "fuz": Object { + "node": Object { + "title": "Bar.fuz", + "type": "number", + }, + "required": true, + }, + }, + "source": "filename.ts", + "title": "Bar", + "type": "object", + }, + "source": "filename.ts", + "type": "function", + }, +] +`; + exports[`Variable Exports Aliased variable 1`] = ` Array [ Object { diff --git a/xlr/converters/src/__tests__/ts-to-common.test.ts b/xlr/converters/src/__tests__/ts-to-common.test.ts index a92b2f71..bca5e203 100644 --- a/xlr/converters/src/__tests__/ts-to-common.test.ts +++ b/xlr/converters/src/__tests__/ts-to-common.test.ts @@ -634,4 +634,26 @@ describe('Variable Exports', () => { expect(XLR).toMatchSnapshot(); }); + + it('Aliased function', () => { + const sc = ` + interface Bar { + foo: string + fuz: number + } + + export const foo = (input: number): Bar => { + return { + foo: '1', + fuz: 1, + }; + }; + `; + + const { sf, tc } = setupTestEnv(sc); + const converter = new TsConverter(tc); + const XLR = converter.convertSourceFile(sf).data.types; + + expect(XLR).toMatchSnapshot(); + }); }); diff --git a/xlr/converters/src/ts-to-xlr.ts b/xlr/converters/src/ts-to-xlr.ts index 1da85aeb..a3553706 100644 --- a/xlr/converters/src/ts-to-xlr.ts +++ b/xlr/converters/src/ts-to-xlr.ts @@ -629,12 +629,22 @@ export class TsConverter { const functionReturnType = this.context.typeChecker.getTypeAtLocation(functionCall); - const syntheticNode = this.context.typeChecker.typeToTypeNode( + let syntheticNode = this.context.typeChecker.typeToTypeNode( functionReturnType, document, undefined ); + // Synthetic node loses parameter location information, and text making it unable + // to get the parameter name in tsNodeToType + if (ts.isArrowFunction(functionCall)) { + const syntheticWithParameters = { + ...syntheticNode, + parameters: functionCall.parameters, + }; + syntheticNode = syntheticWithParameters as unknown as ts.TypeNode; + } + if (syntheticNode) { if ( ts.isTypeReferenceNode(syntheticNode) && From 038ffd653eb3ecc6b9544deb067b40775e9e1822 Mon Sep 17 00:00:00 2001 From: Harris Borawski Date: Wed, 18 Jan 2023 13:31:05 -0800 Subject: [PATCH 21/52] rename test --- .../__snapshots__/ts-to-common.test.ts.snap | 88 +++++++++---------- .../src/__tests__/ts-to-common.test.ts | 2 +- 2 files changed, 45 insertions(+), 45 deletions(-) diff --git a/xlr/converters/src/__tests__/__snapshots__/ts-to-common.test.ts.snap b/xlr/converters/src/__tests__/__snapshots__/ts-to-common.test.ts.snap index 24e80215..dd3937bb 100644 --- a/xlr/converters/src/__tests__/__snapshots__/ts-to-common.test.ts.snap +++ b/xlr/converters/src/__tests__/__snapshots__/ts-to-common.test.ts.snap @@ -826,50 +826,6 @@ Array [ ] `; -exports[`Variable Exports Aliased function 1`] = ` -Array [ - Object { - "name": "foo", - "parameters": Array [ - Object { - "default": undefined, - "name": "input", - "optional": undefined, - "type": Object { - "type": "number", - }, - }, - ], - "returnType": Object { - "additionalProperties": false, - "genericTokens": undefined, - "name": "Bar", - "properties": Object { - "foo": Object { - "node": Object { - "title": "Bar.foo", - "type": "string", - }, - "required": true, - }, - "fuz": Object { - "node": Object { - "title": "Bar.fuz", - "type": "number", - }, - "required": true, - }, - }, - "source": "filename.ts", - "title": "Bar", - "type": "object", - }, - "source": "filename.ts", - "type": "function", - }, -] -`; - exports[`Variable Exports Aliased variable 1`] = ` Array [ Object { @@ -992,6 +948,50 @@ Array [ ] `; +exports[`Variable Exports Arrow function with parameters 1`] = ` +Array [ + Object { + "name": "foo", + "parameters": Array [ + Object { + "default": undefined, + "name": "input", + "optional": undefined, + "type": Object { + "type": "number", + }, + }, + ], + "returnType": Object { + "additionalProperties": false, + "genericTokens": undefined, + "name": "Bar", + "properties": Object { + "foo": Object { + "node": Object { + "title": "Bar.foo", + "type": "string", + }, + "required": true, + }, + "fuz": Object { + "node": Object { + "title": "Bar.fuz", + "type": "number", + }, + "required": true, + }, + }, + "source": "filename.ts", + "title": "Bar", + "type": "object", + }, + "source": "filename.ts", + "type": "function", + }, +] +`; + exports[`Variable Exports Function with object return type 1`] = ` Array [ Object { diff --git a/xlr/converters/src/__tests__/ts-to-common.test.ts b/xlr/converters/src/__tests__/ts-to-common.test.ts index bca5e203..c1c7c391 100644 --- a/xlr/converters/src/__tests__/ts-to-common.test.ts +++ b/xlr/converters/src/__tests__/ts-to-common.test.ts @@ -635,7 +635,7 @@ describe('Variable Exports', () => { expect(XLR).toMatchSnapshot(); }); - it('Aliased function', () => { + it('Arrow function with parameters', () => { const sc = ` interface Bar { foo: string From 76d4e20f07976a13650e90e7dc228547ffab9f89 Mon Sep 17 00:00:00 2001 From: Harris Borawski Date: Wed, 18 Jan 2023 14:52:41 -0800 Subject: [PATCH 22/52] run yarn before bazel test to link deps for flipper --- .circleci/config.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1c070b28..7edf6a37 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -82,6 +82,8 @@ jobs: - attach_workspace: at: ~/tools + - run: yarn + - run: bazel test --remote_header=x-buildbuddy-api-key=${BUILDBUDDY_API_KEY} --config=ci -- //... - run: From f4f11ccf8e24e3ad7a8e0d0ae25dc73bc42e26be Mon Sep 17 00:00:00 2001 From: Harris Borawski Date: Thu, 19 Jan 2023 15:50:52 -0800 Subject: [PATCH 23/52] fix function aliasing exporting wrong name --- .../__snapshots__/ts-to-common.test.ts.snap | 83 +++++++++++++++++++ .../src/__tests__/ts-to-common.test.ts | 24 ++++++ xlr/converters/src/ts-to-xlr.ts | 18 ++++ 3 files changed, 125 insertions(+) diff --git a/xlr/converters/src/__tests__/__snapshots__/ts-to-common.test.ts.snap b/xlr/converters/src/__tests__/__snapshots__/ts-to-common.test.ts.snap index dd3937bb..ecea19ae 100644 --- a/xlr/converters/src/__tests__/__snapshots__/ts-to-common.test.ts.snap +++ b/xlr/converters/src/__tests__/__snapshots__/ts-to-common.test.ts.snap @@ -826,6 +826,89 @@ Array [ ] `; +exports[`Variable Exports Aliased Arrow function with parameters 1`] = ` +Array [ + Object { + "name": "foo", + "parameters": Array [ + Object { + "default": undefined, + "name": "input", + "optional": undefined, + "type": Object { + "type": "number", + }, + }, + ], + "returnType": Object { + "additionalProperties": false, + "genericTokens": undefined, + "name": "Bar", + "properties": Object { + "foo": Object { + "node": Object { + "title": "Bar.foo", + "type": "string", + }, + "required": true, + }, + "fuz": Object { + "node": Object { + "title": "Bar.fuz", + "type": "number", + }, + "required": true, + }, + }, + "source": "filename.ts", + "title": "Bar", + "type": "object", + }, + "source": "filename.ts", + "type": "function", + }, + Object { + "name": "baz", + "parameters": Array [ + Object { + "default": undefined, + "name": "input", + "optional": undefined, + "type": Object { + "type": "number", + }, + }, + ], + "returnType": Object { + "additionalProperties": false, + "genericTokens": undefined, + "name": "Bar", + "properties": Object { + "foo": Object { + "node": Object { + "title": "Bar.foo", + "type": "string", + }, + "required": true, + }, + "fuz": Object { + "node": Object { + "title": "Bar.fuz", + "type": "number", + }, + "required": true, + }, + }, + "source": "filename.ts", + "title": "Bar", + "type": "object", + }, + "source": "filename.ts", + "type": "function", + }, +] +`; + exports[`Variable Exports Aliased variable 1`] = ` Array [ Object { diff --git a/xlr/converters/src/__tests__/ts-to-common.test.ts b/xlr/converters/src/__tests__/ts-to-common.test.ts index c1c7c391..40b4c0a7 100644 --- a/xlr/converters/src/__tests__/ts-to-common.test.ts +++ b/xlr/converters/src/__tests__/ts-to-common.test.ts @@ -656,4 +656,28 @@ describe('Variable Exports', () => { expect(XLR).toMatchSnapshot(); }); + + it('Aliased Arrow function exports its own name', () => { + const sc = ` + interface Bar { + foo: string + fuz: number + } + + export const foo = (input: number): Bar => { + return { + foo: '1', + fuz: 1, + }; + }; + + export const baz = foo + `; + + const { sf, tc } = setupTestEnv(sc); + const converter = new TsConverter(tc); + const XLR = converter.convertSourceFile(sf).data.types; + + expect(XLR).toMatchSnapshot(); + }); }); diff --git a/xlr/converters/src/ts-to-xlr.ts b/xlr/converters/src/ts-to-xlr.ts index a3553706..6e25d872 100644 --- a/xlr/converters/src/ts-to-xlr.ts +++ b/xlr/converters/src/ts-to-xlr.ts @@ -177,7 +177,18 @@ export class TsConverter { const variableDeclarations = node.declarationList.declarations; if (variableDeclarations.length === 1) { const variable = variableDeclarations[0]; + if (variable.initializer) { + const type = this.context.typeChecker.getTypeAtLocation( + variable.initializer + ); + + const typeNode = this.context.typeChecker.typeToTypeNode( + type, + variable.initializer, + ts.NodeBuilderFlags.None + ); + let resultingNode; if ( ts.isCallExpression(variable.initializer) || @@ -191,6 +202,13 @@ export class TsConverter { resultingNode = this.tsLiteralToType(variable.initializer); } + // If initializer type is a reference to a function and not a concrete value + // we need to update the name to be the name of the exporting variable + // not the name of the identifier its aliasing + if (ts.isFunctionLike(typeNode)) { + resultingNode = { ...resultingNode, name: variable.name.getText() }; + } + return { name: variable.name.getText(), ...resultingNode, From ba30ca20485c869f0acae35e11aba0399ce53d75 Mon Sep 17 00:00:00 2001 From: Harris Borawski Date: Thu, 19 Jan 2023 16:17:50 -0800 Subject: [PATCH 24/52] update snapshot name --- .../src/__tests__/__snapshots__/ts-to-common.test.ts.snap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xlr/converters/src/__tests__/__snapshots__/ts-to-common.test.ts.snap b/xlr/converters/src/__tests__/__snapshots__/ts-to-common.test.ts.snap index ecea19ae..7cd4e314 100644 --- a/xlr/converters/src/__tests__/__snapshots__/ts-to-common.test.ts.snap +++ b/xlr/converters/src/__tests__/__snapshots__/ts-to-common.test.ts.snap @@ -826,7 +826,7 @@ Array [ ] `; -exports[`Variable Exports Aliased Arrow function with parameters 1`] = ` +exports[`Variable Exports Aliased Arrow function exports its own name 1`] = ` Array [ Object { "name": "foo", From 6a59fd83464e05ce9802c3240f8ad11a3aa2ebbb Mon Sep 17 00:00:00 2001 From: Harris Borawski Date: Fri, 20 Jan 2023 12:56:17 -0800 Subject: [PATCH 25/52] compare against XLR node instead of TS Type --- xlr/converters/src/ts-to-xlr.ts | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/xlr/converters/src/ts-to-xlr.ts b/xlr/converters/src/ts-to-xlr.ts index 6e25d872..99f3f0f9 100644 --- a/xlr/converters/src/ts-to-xlr.ts +++ b/xlr/converters/src/ts-to-xlr.ts @@ -1,5 +1,5 @@ import ts from 'typescript'; -import type { +import { NodeType, FunctionTypeParameters, TupleType, @@ -179,16 +179,6 @@ export class TsConverter { const variable = variableDeclarations[0]; if (variable.initializer) { - const type = this.context.typeChecker.getTypeAtLocation( - variable.initializer - ); - - const typeNode = this.context.typeChecker.typeToTypeNode( - type, - variable.initializer, - ts.NodeBuilderFlags.None - ); - let resultingNode; if ( ts.isCallExpression(variable.initializer) || @@ -202,10 +192,10 @@ export class TsConverter { resultingNode = this.tsLiteralToType(variable.initializer); } - // If initializer type is a reference to a function and not a concrete value + // If resultingNode is a reference to a function and not a concrete value // we need to update the name to be the name of the exporting variable // not the name of the identifier its aliasing - if (ts.isFunctionLike(typeNode)) { + if (resultingNode.type === 'function') { resultingNode = { ...resultingNode, name: variable.name.getText() }; } From 1a9e098d5f5f910de57f0245e53b9aaed80678e6 Mon Sep 17 00:00:00 2001 From: Harris Borawski Date: Fri, 20 Jan 2023 13:00:51 -0800 Subject: [PATCH 26/52] fix import that was changed by vscode --- xlr/converters/src/ts-to-xlr.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xlr/converters/src/ts-to-xlr.ts b/xlr/converters/src/ts-to-xlr.ts index 99f3f0f9..4a68c0c4 100644 --- a/xlr/converters/src/ts-to-xlr.ts +++ b/xlr/converters/src/ts-to-xlr.ts @@ -1,5 +1,5 @@ import ts from 'typescript'; -import { +import type { NodeType, FunctionTypeParameters, TupleType, From 9522752ace5df67767d428c311ecdd0c173de104 Mon Sep 17 00:00:00 2001 From: Ketan Reddy Date: Thu, 26 Jan 2023 13:59:13 -0800 Subject: [PATCH 27/52] Reorg xlr compile target, support player specific post processing (#29) --- cli/src/commands/xlr/compile.ts | 194 ++++------------------- cli/src/utils/xlr/consts.ts | 14 ++ cli/src/utils/xlr/visitors/file.ts | 30 ++++ cli/src/utils/xlr/visitors/index.ts | 3 + cli/src/utils/xlr/visitors/plugin.ts | 226 +++++++++++++++++++++++++++ cli/src/utils/xlr/visitors/types.ts | 16 ++ xlr/converters/src/ts-to-xlr.ts | 4 +- 7 files changed, 322 insertions(+), 165 deletions(-) create mode 100644 cli/src/utils/xlr/consts.ts create mode 100644 cli/src/utils/xlr/visitors/file.ts create mode 100644 cli/src/utils/xlr/visitors/index.ts create mode 100644 cli/src/utils/xlr/visitors/plugin.ts create mode 100644 cli/src/utils/xlr/visitors/types.ts diff --git a/cli/src/commands/xlr/compile.ts b/cli/src/commands/xlr/compile.ts index 942c3181..7ede6883 100644 --- a/cli/src/commands/xlr/compile.ts +++ b/cli/src/commands/xlr/compile.ts @@ -6,24 +6,10 @@ import globby from 'globby'; import logSymbols from 'log-symbols'; import { TsConverter } from '@player-tools/xlr-converters'; import type { Manifest } from '@player-tools/xlr'; -import { isNodeExported, isTopLevelNode } from '@player-tools/xlr-utils'; import chalk from 'chalk'; import { BaseCommand } from '../../utils/base-command'; - -const PLAYER_PLUGIN_INTERFACE_NAME = 'ExtendedPlayerPlugin'; -const customPrimitives = [ - 'Expression', - 'Asset', - 'Binding', - 'AssetWrapper', - 'Schema.DataType', - 'ExpressionHandler', -]; - -enum Mode { - PLUGIN = 'plugin', - TYPES = 'types', -} +import { pluginVisitor, fileVisitor } from '../../utils/xlr/visitors'; +import { Mode, customPrimitives } from '../../utils/xlr/consts'; /** * Exports TS Interfaces/Types to XLR format @@ -76,7 +62,7 @@ export default class XLRCompile extends BaseCommand { `${inputPath}/**/*.tsx`, ]); try { - this.processPlugin(inputFiles, outputDir, {}, mode); + this.processTypes(inputFiles, outputDir, {}, mode); } catch (e: any) { console.log(''); console.log( @@ -101,180 +87,62 @@ export default class XLRCompile extends BaseCommand { } /** Generate extension manifest/description files from an Enhanced Player Plugin */ - private processPlugin( + private processTypes( fileNames: string[], - outputDir: string, + outputDirectory: string, options: ts.CompilerOptions, mode: Mode = Mode.PLUGIN ): void { // Build a program using the set of root file names in fileNames const program = ts.createProgram(fileNames, options); - fs.mkdirSync(outputDir, { recursive: true }); + fs.mkdirSync(outputDirectory, { recursive: true }); // Get the checker, we will use it to find more about classes const checker = program.getTypeChecker(); - const capabilities: Manifest = { - pluginName: 'Unknown Plugin', - }; const converter = new TsConverter(checker, customPrimitives); - /** visit nodes finding exported classes */ - function pluginVisitor(node: ts.Node) { - // Only consider exported nodes - if (!isNodeExported(node)) { - return; - } - - // Plugins are classes so filter those - if (ts.isClassDeclaration(node) && node.name) { - const symbol = checker.getSymbolAtLocation(node.name); - if (symbol) { - // look at what they implement - node.heritageClauses?.forEach((heritage) => { - heritage.types.forEach((hInterface) => { - // check if heritage is right one - if ( - hInterface.expression.getText() !== PLAYER_PLUGIN_INTERFACE_NAME - ) { - return; - } - - // Get registration name of plugin - const nameProperty = node.members.find( - (member) => - ts.isPropertyDeclaration(member) && - member.name?.getText() === 'name' - ) as ts.PropertyDeclaration | undefined; - if (nameProperty && nameProperty.initializer) { - capabilities.pluginName = nameProperty.initializer - ?.getText() - .replace(/['"]+/g, ''); - } - - const provides: Map> = new Map(); - const typeArgs = hInterface.typeArguments; - - const pluginDec = checker.getTypeAtLocation(hInterface).symbol - ?.declarations?.[0] as ts.InterfaceDeclaration | undefined; - // process type parameters to figure out what capabilities are provided - pluginDec?.typeParameters?.forEach((param, index) => { - const capabilityType = param.name.getText(); - if (index < (typeArgs?.length ?? 0)) { - const exportedCapabilities = typeArgs?.[index] as ts.TypeNode; - // if its an array process each type - if (ts.isTupleTypeNode(exportedCapabilities)) { - const capabilityNames = exportedCapabilities.elements.map( - (element) => { - if ( - ts.isTypeReferenceNode(element) || - ts.isTypeQueryNode(element) - ) { - let referencedSymbol; - if (ts.isTypeReferenceNode(element)) { - referencedSymbol = checker.getSymbolAtLocation( - element.typeName - ); - } else { - referencedSymbol = checker.getSymbolAtLocation( - element.exprName - ); - } - - const alias = referencedSymbol - ? checker.getAliasedSymbol(referencedSymbol) - : undefined; - let varDecl; - /** - * The TypeChecker will return the interface/type declaration or the variable statement - * so if we are getting a variable, we need to grab the variable declaration - */ - if (ts.isTypeReferenceNode(element)) { - varDecl = alias?.declarations?.[0]; - } else { - varDecl = alias?.declarations?.[0].parent.parent; - } - - if (varDecl && isTopLevelNode(varDecl)) { - const capabilityDescription = - converter.convertTopLevelNode(varDecl); - const capabilityName = - capabilityDescription?.name ?? 'error'; - fs.writeFileSync( - path.join(outputDir, `${capabilityName}.json`), - JSON.stringify( - capabilityDescription, - undefined, - 4 - ) - ); - return capabilityName; - } - } - - throw new Error( - `Can't export non reference type ${element.getText()}` - ); - } - ); - - provides.set(capabilityType, capabilityNames); - } else if (ts.isTypeReferenceNode(exportedCapabilities)) { - const capabilityName = - exportedCapabilities.typeName.getText(); - const capabilityDescription = - converter.convertTsTypeNode(exportedCapabilities); - fs.writeFileSync( - path.join(outputDir, `${capabilityName}.json`), - JSON.stringify(capabilityDescription, undefined, 4) - ); - provides.set(capabilityType, [capabilityName]); - } else { - throw new Error(`Can't figure out type ${capabilityType}`); - } - } - }); - capabilities.capabilities = provides; - }); - }); - } - } - } - - /** export all exported types in the file */ - function fileVisitor(file: ts.SourceFile) { - const convertedTypes = converter.convertSourceFile(file); - convertedTypes.data.types.forEach((type) => { - fs.writeFileSync( - path.join(outputDir, `${type.name}.json`), - JSON.stringify(type, undefined, 4) - ); - }); - capabilities.capabilities = new Map([ - ['Types', convertedTypes.convertedTypes], - ]); - } + let capabilities: Manifest | undefined; // Visit every sourceFile in the program program.getSourceFiles().forEach((sourceFile) => { if (!sourceFile.isDeclarationFile) { // Walk the tree to search for classes + let generatedCapabilites; + if (mode === Mode.PLUGIN) { - ts.forEachChild(sourceFile, pluginVisitor); + generatedCapabilites = pluginVisitor({ + sourceFile, + converter, + checker, + outputDirectory, + }); } else if (mode === Mode.TYPES) { - capabilities.pluginName = 'Types'; - fileVisitor(sourceFile); + generatedCapabilites = fileVisitor({ + sourceFile, + converter, + checker, + outputDirectory, + }); } else { throw new Error( `Error: Option ${mode} not recognized. Valid options are: plugin or type` ); } + + if (generatedCapabilites) { + capabilities = generatedCapabilites; + } } }); + if (!capabilities) { + throw new Error('Error: Unable to parse any XLRs in package'); + } + // print out the manifest files const jsonManifest = JSON.stringify(capabilities, this.replacer, 4); - fs.writeFileSync(path.join(outputDir, 'manifest.json'), jsonManifest); + fs.writeFileSync(path.join(outputDirectory, 'manifest.json'), jsonManifest); const tsManifestFile = `${[...(capabilities.capabilities?.values() ?? [])] .flat(2) @@ -295,6 +163,6 @@ module.exports = { } `; - fs.writeFileSync(path.join(outputDir, 'manifest.js'), tsManifestFile); + fs.writeFileSync(path.join(outputDirectory, 'manifest.js'), tsManifestFile); } } diff --git a/cli/src/utils/xlr/consts.ts b/cli/src/utils/xlr/consts.ts new file mode 100644 index 00000000..b31a5fae --- /dev/null +++ b/cli/src/utils/xlr/consts.ts @@ -0,0 +1,14 @@ +export const PLAYER_PLUGIN_INTERFACE_NAME = 'ExtendedPlayerPlugin'; +export const customPrimitives = [ + 'Expression', + 'Asset', + 'Binding', + 'AssetWrapper', + 'Schema.DataType', + 'ExpressionHandler', +]; + +export enum Mode { + PLUGIN = 'plugin', + TYPES = 'types', +} diff --git a/cli/src/utils/xlr/visitors/file.ts b/cli/src/utils/xlr/visitors/file.ts new file mode 100644 index 00000000..2768799b --- /dev/null +++ b/cli/src/utils/xlr/visitors/file.ts @@ -0,0 +1,30 @@ +import type { Manifest } from '@player-tools/xlr'; +import path from 'path'; +import fs from 'fs'; +import type { VisitorProps } from './types'; + +/** export all exported types in the file */ +export function fileVisitor(args: VisitorProps): Manifest | undefined { + const { sourceFile, converter, outputDirectory } = args; + const convertedTypes = converter.convertSourceFile(sourceFile); + + if (convertedTypes.data.types.length === 0) { + return undefined; + } + + const capabilities: Manifest = { + pluginName: 'Types', + }; + + convertedTypes.data.types.forEach((type) => { + fs.writeFileSync( + path.join(outputDirectory, `${type.name}.json`), + JSON.stringify(type, undefined, 4) + ); + }); + capabilities.capabilities = new Map([ + ['Types', convertedTypes.convertedTypes], + ]); + + return capabilities; +} diff --git a/cli/src/utils/xlr/visitors/index.ts b/cli/src/utils/xlr/visitors/index.ts new file mode 100644 index 00000000..6613c13e --- /dev/null +++ b/cli/src/utils/xlr/visitors/index.ts @@ -0,0 +1,3 @@ +export * from './file'; +export * from './plugin'; +export * from './types'; diff --git a/cli/src/utils/xlr/visitors/plugin.ts b/cli/src/utils/xlr/visitors/plugin.ts new file mode 100644 index 00000000..53a0b3b5 --- /dev/null +++ b/cli/src/utils/xlr/visitors/plugin.ts @@ -0,0 +1,226 @@ +import type { TopLevelNode } from '@player-tools/xlr-utils'; +import { isNodeExported, isTopLevelNode } from '@player-tools/xlr-utils'; +import path from 'path'; +import ts from 'typescript'; +import fs from 'fs'; +import type { Manifest, NamedType, RefNode } from '@player-tools/xlr'; +import type { TsConverter } from '@player-tools/xlr-converters'; +import type { VisitorProps } from './types'; +import { PLAYER_PLUGIN_INTERFACE_NAME } from '../consts'; + +/** + * Follows references to get the actual underlying declaration + */ +function getUnderlyingNode( + element: ts.TypeQueryNode | ts.TypeReferenceNode, + checker: ts.TypeChecker +): TopLevelNode | undefined { + let referencedSymbol; + if (ts.isTypeReferenceNode(element)) { + referencedSymbol = checker.getSymbolAtLocation(element.typeName); + } else { + referencedSymbol = checker.getSymbolAtLocation(element.exprName); + } + + const alias = referencedSymbol + ? checker.getAliasedSymbol(referencedSymbol) + : undefined; + let varDecl; + /** + * The TypeChecker will return the interface/type declaration or the variable statement + * so if we are getting a variable, we need to grab the variable declaration + */ + if (ts.isTypeReferenceNode(element)) { + varDecl = alias?.declarations?.[0]; + } else { + varDecl = alias?.declarations?.[0].parent.parent; + } + + if (varDecl && isTopLevelNode(varDecl)) { + return varDecl; + } +} + +/** + * Fixes ExpressionHandler ref nodes that don't have argument names because some way of writing ExpressionHandler prevent the ts compiler from inferring them + */ +function fixExpressionArgNames( + sourceNode: ts.VariableStatement, + generatedTypeRef: NamedType, + checker: ts.TypeChecker +): NamedType { + const typeRefCopy = { ...generatedTypeRef }; + const { initializer } = sourceNode.declarationList.declarations[0]; + let offset: number; + let arrowFunction: ts.ArrowFunction; + + if ( + initializer && + ts.isCallExpression(initializer) && + ts.isArrowFunction(initializer.arguments[0]) + ) { + // handles the case of `withoutContext` expression where the types are provided by the generic + offset = 0; + arrowFunction = initializer.arguments[0] as ts.ArrowFunction; + } else { + // handles the case of a direct `ExpressionHandler` where the types are provided by the generic + offset = 1; + arrowFunction = initializer as ts.ArrowFunction; + } + + const paramsNode = typeRefCopy.genericArguments?.[0]; + + if (paramsNode && paramsNode.type === 'array') { + const functionArg = arrowFunction.parameters?.[offset]; + if (!paramsNode.name && functionArg) { + paramsNode.name = functionArg.name.getText(); + } + } else if (paramsNode && paramsNode.type === 'tuple') { + paramsNode.elementTypes?.forEach((gArg, index) => { + const functionArg = arrowFunction.parameters?.[index + offset]; + if (!gArg.name && functionArg) { + // eslint-disable-next-line no-param-reassign + gArg.name = functionArg.name.getText(); + } + }); + } + + return typeRefCopy; +} + +/** + * Player specific modifications that we need to do to massage generic XLR conversion because of our weird types + * Most of this is _definitely not_ best practice. + */ +function runPlayerPostProcessing( + node: TopLevelNode, + xlr: NamedType, + checker: ts.TypeChecker +): NamedType { + if ( + xlr.type === 'ref' && + xlr.ref.includes('ExpressionHandler') && + ts.isVariableStatement(node) + ) { + return fixExpressionArgNames(node, xlr, checker); + } + + return xlr; +} + +/** + * Generated the XLR for a Capability, writes it to the specified path, and returns the name + */ +function generateXLR( + node: ts.Node, + checker: ts.TypeChecker, + converter: TsConverter, + outputDirectory: string +): string { + if (ts.isTypeReferenceNode(node) || ts.isTypeQueryNode(node)) { + const varDecl = getUnderlyingNode(node, checker); + + if (varDecl) { + let capabilityDescription = converter.convertTopLevelNode(varDecl); + capabilityDescription = runPlayerPostProcessing( + varDecl, + capabilityDescription, + checker + ); + const capabilityName = capabilityDescription?.name ?? 'error'; + fs.writeFileSync( + path.join(outputDirectory, `${capabilityName}.json`), + JSON.stringify(capabilityDescription, undefined, 4) + ); + return capabilityName; + } + } + + throw new Error(`Can't export non reference type ${node.getText()}`); +} + +/** visit nodes finding exported classes */ +export function pluginVisitor(args: VisitorProps): Manifest | undefined { + const { sourceFile, checker, converter, outputDirectory } = args; + + let capabilities: Manifest | undefined; + + ts.forEachChild(sourceFile, (node) => { + // Only consider exported nodes + if (!isNodeExported(node)) { + return; + } + + // Plugins are classes so filter those + if (ts.isClassDeclaration(node) && node.name) { + const symbol = checker.getSymbolAtLocation(node.name); + if (symbol) { + // look at what they implement + node.heritageClauses?.forEach((heritage) => { + heritage.types.forEach((hInterface) => { + // check if heritage is right one + if ( + hInterface.expression.getText() !== PLAYER_PLUGIN_INTERFACE_NAME + ) { + return; + } + + capabilities = { + pluginName: 'Unknown Plugin', + }; + + // Get registration name of plugin + const nameProperty = node.members.find( + (member) => + ts.isPropertyDeclaration(member) && + member.name?.getText() === 'name' + ) as ts.PropertyDeclaration | undefined; + if (nameProperty && nameProperty.initializer) { + capabilities.pluginName = nameProperty.initializer + ?.getText() + .replace(/['"]+/g, ''); + } + + const provides: Map> = new Map(); + const typeArgs = hInterface.typeArguments; + + const pluginDec = checker.getTypeAtLocation(hInterface).symbol + ?.declarations?.[0] as ts.InterfaceDeclaration | undefined; + // process type parameters to figure out what capabilities are provided + pluginDec?.typeParameters?.forEach((param, index) => { + const capabilityType = param.name.getText(); + if (index < (typeArgs?.length ?? 0)) { + const exportedCapabilities = typeArgs?.[index] as ts.TypeNode; + // if its an array process each type + if (ts.isTupleTypeNode(exportedCapabilities)) { + const capabilityNames = exportedCapabilities.elements.map( + (element) => + generateXLR(element, checker, converter, outputDirectory) + ); + + provides.set(capabilityType, capabilityNames); + } else if ( + ts.isTypeReferenceNode(exportedCapabilities) || + ts.isTypeQueryNode(exportedCapabilities) + ) { + const capabilityName = generateXLR( + exportedCapabilities, + checker, + converter, + outputDirectory + ); + provides.set(capabilityType, [capabilityName]); + } else { + throw new Error(`Can't figure out type ${capabilityType}`); + } + } + }); + capabilities.capabilities = provides; + }); + }); + } + } + }); + + return capabilities; +} diff --git a/cli/src/utils/xlr/visitors/types.ts b/cli/src/utils/xlr/visitors/types.ts new file mode 100644 index 00000000..f9da0c29 --- /dev/null +++ b/cli/src/utils/xlr/visitors/types.ts @@ -0,0 +1,16 @@ +import type { TsConverter } from '@player-tools/xlr-converters'; +import type ts from 'typescript'; + +export interface VisitorProps { + /** The source file to process */ + sourceFile: ts.SourceFile; + + /** An instance of a typescript type checker */ + checker: ts.TypeChecker; + + /** An instance of a XLR converter */ + converter: TsConverter; + + /** Where to write converted XLRs to */ + outputDirectory: string; +} diff --git a/xlr/converters/src/ts-to-xlr.ts b/xlr/converters/src/ts-to-xlr.ts index 4a68c0c4..b5ec3316 100644 --- a/xlr/converters/src/ts-to-xlr.ts +++ b/xlr/converters/src/ts-to-xlr.ts @@ -192,10 +192,10 @@ export class TsConverter { resultingNode = this.tsLiteralToType(variable.initializer); } - // If resultingNode is a reference to a function and not a concrete value + // If resultingNode is a reference to a function or custom primitive and not a concrete value // we need to update the name to be the name of the exporting variable // not the name of the identifier its aliasing - if (resultingNode.type === 'function') { + if (resultingNode.type === 'function' || resultingNode.type === 'ref') { resultingNode = { ...resultingNode, name: variable.name.getText() }; } From b8a49758d9218a19b1a8f00a3b7e171d8af8906d Mon Sep 17 00:00:00 2001 From: Ketan Reddy Date: Thu, 26 Jan 2023 15:39:36 -0800 Subject: [PATCH 28/52] Try and fix release stage --- .circleci/config.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7edf6a37..d8eb8d53 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -35,6 +35,8 @@ commands: - v1-bazel-cache-core-{{ .Branch }} - v1-bazel-cache-core-main + - run: yarn + - run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc - run: echo -e $GPG_KEY | gpg --import --batch - run: | From 780252d5f9a2adc601dd7286f56aa1f398a225ff Mon Sep 17 00:00:00 2001 From: intuit-svc Date: Fri, 27 Jan 2023 00:03:03 +0000 Subject: [PATCH 29/52] Release main From cc0665323f8e320db60f2ab1d1beec6312332959 Mon Sep 17 00:00:00 2001 From: intuit-svc Date: Thu, 26 Jan 2023 16:12:28 -0800 Subject: [PATCH 30/52] Update CHANGELOG.md [skip ci] --- CHANGELOG.md | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4185fd44..2fbb8257 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,46 @@ +# 0.3.0 (Thu Jan 26 2023) + +### Release Notes + +#### Reorg xlr compile target, support player specific post processing ([#29](https://github.com/player-ui/tools/pull/29)) + +Player CLI - Fixes some Expressions that don't export with variable names. + +#### Pin typescript version in cli now that we're using new features. ([#19](https://github.com/player-ui/tools/pull/19)) + +Fixes errors in projects using typescript < 4.8 + +#### Feature/xlr variable export ([#18](https://github.com/player-ui/tools/pull/18)) + +XLR export for static and dynamic `const` exports + +--- + +#### 🚀 Enhancement + +- Feature/xlr variable export [#18](https://github.com/player-ui/tools/pull/18) ([@KetanReddy](https://github.com/KetanReddy)) + +#### 🐛 Bug Fix + +- Release ${GITHUB_REF##*/} [#34](https://github.com/player-ui/tools/pull/34) ([@intuit-svc](https://github.com/intuit-svc)) +- Reorg xlr compile target, support player specific post processing [#29](https://github.com/player-ui/tools/pull/29) ([@KetanReddy](https://github.com/KetanReddy)) +- fix function aliasing exporting wrong name [#28](https://github.com/player-ui/tools/pull/28) ([@hborawski](https://github.com/hborawski)) +- forward parameters to synthetic node for arrow functions with parameters [#26](https://github.com/player-ui/tools/pull/26) ([@hborawski](https://github.com/hborawski) [@sugarmanz](https://github.com/sugarmanz)) +- Pin typescript version in cli now that we're using new features. [#19](https://github.com/player-ui/tools/pull/19) ([@KetanReddy](https://github.com/KetanReddy)) + +#### ⚠️ Pushed to `main` + +- Try and fix release stage ([@KetanReddy](https://github.com/KetanReddy)) + +#### Authors: 4 + +- [@intuit-svc](https://github.com/intuit-svc) +- Harris Borawski ([@hborawski](https://github.com/hborawski)) +- Jeremiah Zucker ([@sugarmanz](https://github.com/sugarmanz)) +- Ketan Reddy ([@KetanReddy](https://github.com/KetanReddy)) + +--- + # 0.2.1 (Wed Dec 14 2022) ### Release Notes From 3c9fe64a7fd0d043c475018a9370def5d25c2cb3 Mon Sep 17 00:00:00 2001 From: intuit-svc Date: Thu, 26 Jan 2023 16:12:28 -0800 Subject: [PATCH 31/52] Bump version to: v0.3.0 [skip ci] --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 7dff5b89..9325c3cc 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.2.1 \ No newline at end of file +0.3.0 \ No newline at end of file From 545d24d45345be2122bb9058a9cf15000601f388 Mon Sep 17 00:00:00 2001 From: Ketan Reddy Date: Wed, 1 Feb 2023 11:44:29 -0800 Subject: [PATCH 32/52] add forked pr workflow --- .circleci/config.yml | 51 ++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 47 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d8eb8d53..d095f28d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -57,6 +57,20 @@ jobs: root: . paths: - . + + bazelrc: + executor: base + steps: + - attach_workspace: + at: ~/player + - run: | + echo "build --remote_header=x-buildbuddy-api-key=${BUILDBUDDY_API_KEY}" >> .bazelrc.local + echo "test --remote_header=x-buildbuddy-api-key=${BUILDBUDDY_API_KEY}" >> .bazelrc.local + echo "coverage --remote_header=x-buildbuddy-api-key=${BUILDBUDDY_API_KEY}" >> .bazelrc.local + - persist_to_workspace: + root: . + paths: + - . build: executor: base @@ -66,7 +80,7 @@ jobs: - run: yarn - - run: bazel build --remote_header=x-buildbuddy-api-key=${BUILDBUDDY_API_KEY} --config=ci -- //... + - run: bazel build --config=ci -- //... - save_cache: paths: @@ -86,7 +100,7 @@ jobs: - run: yarn - - run: bazel test --remote_header=x-buildbuddy-api-key=${BUILDBUDDY_API_KEY} --config=ci -- //... + - run: bazel test --config=ci -- //... - run: when: always @@ -115,7 +129,7 @@ jobs: - run: | BUNDLE_TARGETS=$(bazel query "kind(nodejs_test, //...)" --output label 2>/dev/null | tr '\n' ' ') - bazel coverage --remote_header=x-buildbuddy-api-key=${BUILDBUDDY_API_KEY} --config=ci -- $BUNDLE_TARGETS + bazel coverage --config=ci -- $BUNDLE_TARGETS - codecov/upload: file: ./bazel-out/_coverage/_coverage_report.dat @@ -143,13 +157,20 @@ workflows: ignore: - main - /version-.*/ + - /pull\/.*/ tags: ignore: /.*/ - - build: + - bazelrc: + context: + - BuildTools requires: - setup + - build: + requires: + - bazelrc + - maybe_release: context: - Publish @@ -164,6 +185,28 @@ workflows: requires: - build + build_and_test_pr_fork: + jobs: + - setup: + filters: + branches: + only: + - /pull\/.*/ + tags: + ignore: /.*/ + + - build: + requires: + - setup + + - test: + requires: + - build + + - coverage: + requires: + - build + build_and_test_main: when: equal: [ "", << pipeline.parameters.GHA_Action >> ] From 449d4ec473ed491d124c6be8f10a5ed7efd78006 Mon Sep 17 00:00:00 2001 From: Ketan Reddy Date: Wed, 1 Feb 2023 17:01:55 -0800 Subject: [PATCH 33/52] Support for Arrays and Collections --- drag-and-drop/app/BUILD | 2 +- drag-and-drop/app/pages/index.tsx | 113 ++++- .../library/src/__tests__/controller.test.tsx | 80 ++- drag-and-drop/library/src/controller.tsx | 146 ++++-- .../library/src/hooks/useDroppableAsset.tsx | 7 +- drag-and-drop/library/src/types.ts | 98 ++-- .../library/src/utils/drop-component.tsx | 42 +- drag-and-drop/library/src/utils/helpers.ts | 24 + .../library/src/utils/player-dnd-plugin.ts | 62 ++- .../library/src/utils/runtime-flow-state.ts | 470 ++++++++++++++---- 10 files changed, 809 insertions(+), 235 deletions(-) create mode 100644 drag-and-drop/library/src/utils/helpers.ts diff --git a/drag-and-drop/app/BUILD b/drag-and-drop/app/BUILD index e5b972ff..763f41d1 100644 --- a/drag-and-drop/app/BUILD +++ b/drag-and-drop/app/BUILD @@ -19,7 +19,7 @@ srcs = glob([ data = [ "//drag-and-drop/library:@player-tools/dnd-lib", - "//common:@player-tools/static-xlrs", + "@npm//@player-ui/types", "@npm//typescript", "@npm//@chakra-ui/react", "@npm//@player-ui/reference-assets-plugin-react", diff --git a/drag-and-drop/app/pages/index.tsx b/drag-and-drop/app/pages/index.tsx index e700cadc..8eaf5326 100644 --- a/drag-and-drop/app/pages/index.tsx +++ b/drag-and-drop/app/pages/index.tsx @@ -44,23 +44,33 @@ import { useDraggableAsset, } from '@player-tools/dnd-lib'; import { ReferenceAssetsPlugin } from '@player-ui/reference-assets-plugin-react'; -import type { ObjectType, TSManifest } from '@player-tools/xlr'; -import pluginManifest from '@player-tools/static-xlrs/static_xlrs/plugin/xlr/manifest'; -import typesManifest from '@player-tools/static-xlrs/static_xlrs/core/xlr/manifest'; +import type { NamedType, ObjectType, TSManifest } from '@player-tools/xlr'; +// eslint-disable-next-line import/extensions, import/no-unresolved +import pluginManifest from '@player-ui/reference-assets-plugin-react/dist/xlr/manifest'; +// eslint-disable-next-line import/extensions, import/no-unresolved +import typesManifest from '@player-ui/types/dist/xlr/manifest'; import { AssetEditorPanel } from '../components/AssetEditorPanel'; import { covertXLRtoAssetDoc } from '../utils/converters'; import Files from "react-files"; const PropertiesContext = React.createContext<{ /** - * Current Asset thats selected in the right panel - * will be either an asset ID or a XLR type + * Current Asset thats selected in the edit panel on the right */ - displayedAssetID?: string; + displayedAssetID?: symbol; /** * Sets `displayedAssetID` */ - setDisplayedAssetID: (id: string) => void; + setDisplayedAssetID: (id: symbol) => void; + + /** + * Current XLR Type thats selected in the docs panel on the right + */ + displayedXLRDocType?: string; + /** + * Sets `displayedAssetID` + */ + setDisplayedXLRDocType: (id: string) => void; /** * If the export modal is open @@ -81,6 +91,7 @@ const PropertiesContext = React.createContext<{ setRightPanelState: () => {}, exportOpen: false, rightPanelState: 'edit', + setDisplayedXLRDocType: () => {}, }); const ControllerContext = React.createContext< @@ -98,11 +109,34 @@ function useController() { return React.useContext(ControllerContext); } +/** + * + */ +const AssetSlotExtension = ( + props: TransformedDropTargetAssetType & { + /** + * + */ + action: 'prepend' | 'append'; + } +) => { + const { action } = props; + const [{ isOver }, drop] = useDroppableAsset(props, action); + + return ( +
+ + {action} to {props.context?.propertyName ?? 'root'} + +
+ ); +}; + /** * Component that indicates that an Asset can be placed at this location */ const AssetDropTarget = (props: TransformedDropTargetAssetType) => { - const [{ isOver }, drop] = useDroppableAsset(props); + const [{ isOver }, drop] = useDroppableAsset(props, 'replace'); const propContext = React.useContext(PropertiesContext); if (!props.value && !props.context) { @@ -130,17 +164,30 @@ const AssetDropTarget = (props: TransformedDropTargetAssetType) => { }} onClick={(e) => { if (props.value) { - propContext.setDisplayedAssetID(props.id); + propContext.setDisplayedAssetID(props.assetSymbol); propContext.setRightPanelState('edit'); e.stopPropagation(); } }} > - {props.value ? ( - - ) : ( + {props.value && ( + <> + {isOver && } + + {isOver && } + + )} + + {!props.value && !props.context?.isArrayElement && ( + + {props.context?.parent.assetName} - {props.context?.propertyName} + + )} + + {!props.value && props.context?.isArrayElement && ( - {props.context?.parent.name} - {props.context?.propertyName} + Insert into {props.context?.parent.assetName} -{' '} + {props.context?.propertyName} List )} @@ -151,7 +198,7 @@ const AssetDropTarget = (props: TransformedDropTargetAssetType) => { * Component that can be dropped onto the canvas to add an Asst/View */ const DroppableAsset = (props: ExtensionProviderAssetIdentifier) => { - const { setRightPanelState, setDisplayedAssetID } = + const { setRightPanelState, setDisplayedXLRDocType } = React.useContext(PropertiesContext); const [, ref] = useDraggableAsset(props) ?? []; return ( @@ -160,10 +207,10 @@ const DroppableAsset = (props: ExtensionProviderAssetIdentifier) => { colorScheme="blue" onClick={(event) => { setRightPanelState('docs'); - setDisplayedAssetID(props.name); + setDisplayedXLRDocType(props.assetName); }} > - {props.name} + {props.assetName} ); @@ -194,7 +241,7 @@ export const CapabilityPanel = (props: CapabilityPanelProps) => { {props.capabilities.length > 0 ? ( props.capabilities.map((asset) => { return ( - + ); @@ -408,7 +455,7 @@ const PropertyResolver = (props: PendingPropertyResolution) => { const ContentExportModal = () => { const context = React.useContext(PropertiesContext); const { controller } = useController() ?? {}; - const content = JSON.stringify(controller.exportView()); + const content = JSON.stringify(controller.exportContent()); return ( {}}> @@ -440,10 +487,9 @@ const ContentExportModal = () => { * Panel to show the full docs for the selected asset */ const AssetDocsPanel = () => { - const { displayedAssetID } = React.useContext(PropertiesContext); + const { displayedXLRDocType } = React.useContext(PropertiesContext); const { controller } = useController() ?? {}; - const type = controller.getAssetDetails(displayedAssetID); - + const type = controller.getAssetDetails(displayedXLRDocType); const docs = covertXLRtoAssetDoc(type); return ( @@ -513,7 +559,9 @@ const RightPanel = () => { * Main Page */ const App = () => { - const [displayedAssetID, setDisplayedAssetID] = React.useState(); + const [displayedAssetID, setDisplayedAssetID] = React.useState(); + const [displayedXLRDocType, setDisplayedXLRDocType] = + React.useState(); const [exportOpen, setExportOpen] = React.useState(false); const [rightPanelState, setRightPanelState] = React.useState<'docs' | 'edit'>( 'edit' @@ -524,7 +572,7 @@ const App = () => { const controllerState = React.useMemo(() => { const config: DragAndDropControllerOptions = { Component: AssetDropTarget, - types: typesManifest as TSManifest, + playerTypes: typesManifest as TSManifest, extensions: [ { plugin: ReferenceAssetsPlugin, @@ -548,10 +596,21 @@ const App = () => { setPendingPropertyResolutions(pending); return prom; }, + resolveCollectionConversion(assets, XLRSDK) { + const collectionType = XLRSDK.XLRSDK.getType('collection'); + return { + asset: { + id: `autogen-collection`, + type: 'collection', + values: assets, + } as Asset, + type: collectionType as NamedType, + }; + }, }; - + const controller = new DragAndDropController(config); return { - controller: new DragAndDropController(config), + controller, }; }, [setPendingPropertyResolutions]); @@ -564,12 +623,14 @@ const App = () => { () => ({ displayedAssetID, setDisplayedAssetID, + displayedXLRDocType, + setDisplayedXLRDocType, exportOpen, setExportOpen, rightPanelState, setRightPanelState, }), - [displayedAssetID, exportOpen, rightPanelState] + [displayedAssetID, displayedXLRDocType, exportOpen, rightPanelState] )} > diff --git a/drag-and-drop/library/src/__tests__/controller.test.tsx b/drag-and-drop/library/src/__tests__/controller.test.tsx index 6a32857c..c3863d88 100644 --- a/drag-and-drop/library/src/__tests__/controller.test.tsx +++ b/drag-and-drop/library/src/__tests__/controller.test.tsx @@ -16,7 +16,7 @@ const referenceAssetExtension: ExtensionProvider = { describe('drag-and-drop', () => { it('Fills in placeholder assets when dropped', async () => { const dndController = new DragAndDropController({ - types: typesManifest, + playerTypes: typesManifest, extensions: [referenceAssetExtension], resolveRequiredProperties: async ( asset: Asset, @@ -24,6 +24,55 @@ describe('drag-and-drop', () => { ) => { return asset; }, + resolveCollectionConversion: (assets, XLRSDK) => { + return { + asset: { + id: 'generated-collection', + type: 'collection', + values: assets.map((asset) => asset.asset), + }, + type: { + name: 'CollectionAsset', + type: 'object', + source: '', + properties: { + label: { + required: false, + node: { + type: 'ref', + ref: 'AssetWrapper', + title: 'CollectionAsset.label', + description: 'An optional label to title the collection', + }, + }, + values: { + required: false, + node: { + type: 'array', + elementType: { + type: 'ref', + ref: 'AssetWrapper', + }, + title: 'CollectionAsset.values', + description: 'The string value to show', + }, + }, + }, + additionalProperties: false, + title: 'CollectionAsset', + extends: { + type: 'ref', + ref: "Asset<'collection'>", + genericArguments: [ + { + type: 'string', + const: 'collection', + }, + ], + }, + }, + }; + }, }); const { player } = dndController.webPlayer; @@ -36,34 +85,37 @@ describe('drag-and-drop', () => { expect(getView()?.id).toBe('drag-and-drop-view'); - getView()?.replaceAsset({ + getView()?.placeAsset({ pluginName: 'BaseAssetsPlugin', - name: 'InfoAsset', + assetName: 'InfoAsset', }); await waitFor(() => { expect(getView()?.value?.asset.type).toBe('info'); }); - getView()?.value.asset.title.asset.replaceAsset({ + getView()?.value.asset.title.asset.placeAsset({ pluginName: 'BaseAssetsPlugin', - name: 'TextAsset', + assetName: 'TextAsset', }); await waitFor(() => { expect(getView()?.value?.asset.title.asset.value.asset.type).toBe('text'); }); - expect(dndController.exportView()).toStrictEqual({ - id: 'drag-and-drop-view-test-1', - type: 'info', - title: { - asset: { - id: 'drag-and-drop-view-title-test-1', - type: 'text', + expect(dndController.exportContent()).toMatchInlineSnapshot(` + Object { + "actions": Array [], + "id": "drag-and-drop-view-info", + "title": Object { + "asset": Object { + "id": "drag-and-drop-view-title-text", + "type": "text", + }, }, - }, - }); + "type": "info", + } + `); }); it('Import existing content into drag and drop', async () => { diff --git a/drag-and-drop/library/src/controller.tsx b/drag-and-drop/library/src/controller.tsx index f2131bc1..5ed79c89 100644 --- a/drag-and-drop/library/src/controller.tsx +++ b/drag-and-drop/library/src/controller.tsx @@ -8,7 +8,7 @@ import { XLRService } from '@player-tools/language-service'; import type { TypeMetadata } from '@player-tools/xlr-sdk'; import { PlayerDndPlugin } from './utils'; import type { - DropTargetAssetType, + DropTargetAsset, ExtensionProvider, ExtensionProviderAssetIdentifier, TransformedDropTargetAssetType, @@ -18,25 +18,39 @@ import { RuntimeFlowState } from './utils/runtime-flow-state'; import { DropComponent } from './utils/drop-component'; export interface DragAndDropControllerOptions { - /** - * - */ + /** The list of XLR enabled extensions to load as available resources */ extensions?: Array; - /** - * - */ - types: TSManifest; + /** Manifest for the base Player types package to use */ + playerTypes: TSManifest; /** - * + * Function to call when a placed asset has required properties that need to be resolved before actually placing it. */ - Component?: React.ComponentType; + resolveRequiredProperties: ( + /** The basic Asset that could be generated */ + asset: Asset, + /** The XLR Type for the Asset being generated */ + type: NamedType + ) => Promise; /** - * Function to call when a placed asset has required properties that need to be resolved before actually placing it. + * Function that will be called when multiple assets are dropped onto the same target and a collection needs to be created */ - resolveRequiredProperties: (asset: Asset, type: ObjectType) => Promise; + resolveCollectionConversion: ( + /** The Assets to include in the collection */ + assets: Array, + /** An instance of the XLRSDK to perform any required type lookups */ + XLRSDK: XLRService + ) => { + /** The generated collection asset with the provided `assets` array as children */ + asset: Asset; + /** The corresponding type for the generated collection asset */ + type: NamedType; + }; + + /** A custom component to use for rendering droppable Assets */ + Component?: React.ComponentType; } /** @@ -59,27 +73,46 @@ export class DragAndDropController { constructor(options: DragAndDropControllerOptions) { this.options = options ?? {}; - this.runtimeState = new RuntimeFlowState({ - resolveRequiredProperties: options.resolveRequiredProperties, - }); - this.PlayerXLRService = new XLRService(); - this.PlayerXLRService.XLRSDK.loadDefinitionsFromModule(options.types); + this.PlayerXLRService.XLRSDK.loadDefinitionsFromModule(options.playerTypes); options?.extensions?.forEach((extension) => { this.PlayerXLRService.XLRSDK.loadDefinitionsFromModule( extension.manifest ); }); + this.runtimeState = new RuntimeFlowState({ + resolveRequiredProperties: options.resolveRequiredProperties, + resolveCollectionConversion: (assets: Array) => { + return options.resolveCollectionConversion( + assets, + this.PlayerXLRService + ); + }, + }); + this.dndWebPlayerPlugin = new PlayerDndPlugin({ state: this.runtimeState, Target: { Component: this.options.Component ?? DropComponent, }, - getXLRTypeForAsset: (identifier): ObjectType => { - return this.PlayerXLRService.XLRSDK.getType( - identifier.name - ) as NamedType; + getXLRTypeForAsset: (identifier) => { + const asset = this.PlayerXLRService.XLRSDK.getType( + identifier.assetName + ); + if (!asset) { + throw new Error( + `SDK Error: Unable to get asset ${identifier.assetName}` + ); + } + + if (asset.type !== 'object') { + throw new Error( + `SDK Error: Type ${identifier.assetName} doesn't appear to be an Asset` + ); + } + + return asset; }, }); @@ -100,6 +133,10 @@ export class DragAndDropController { this.webPlayer.start(this.runtimeState.flow); } + /** + * Gets info on all XLRs that have been registered to the SDK + * This won't return anything that is registered as a Type or has "Transformed" in its named + */ public getAvailableAssets(): Array { const assets = this.PlayerXLRService.XLRSDK.listTypes({ capabilityFilter: 'Types', @@ -112,38 +149,67 @@ export class DragAndDropController { ) as TypeMetadata; return { pluginName: typeInfo.plugin, - name: assetName, + assetName, capability: typeInfo.capability, }; }); } + /** + * Returns the XLR for an Asset/View + * + * @param assetName - Player 'type' string for the Asset/View to retrieve + */ public getAssetDetails(assetName: string): NamedType { return this.PlayerXLRService.XLRSDK.getType( assetName ) as NamedType; } - public getAsset(assetID: string) { - return this.runtimeState.get(assetID); + /** + * Returns the underlying Asset and XLR type for a dropped Asset in the tree + * + * @param assetSymbol - UUID Symbol attached to the Asset + */ + public getAsset(assetSymbol: symbol): { + /** The Asset that correlates to the given ID */ + asset: Asset; + /** The underlying XLR type for the Asset */ + type: ObjectType; + } { + return this.runtimeState.getAsset(assetSymbol); } - public updateAsset(id: string, newObject: Asset) { - this.runtimeState.updateAsset(id, newObject); + /** + * Updates a dropped asset with the provided properties + * **It is not recommended to update any AssetWrapper or Array properties** + * + * @param assetSymbol - UUID Symbol attached to the Asset + * @param newObject - The updates to apply to the dropped asset + */ + public updateAsset(assetSymbol: symbol, newObject: Asset) { + this.runtimeState.updateAsset(assetSymbol, newObject); this.dndWebPlayerPlugin.refresh(this.webPlayer.player); } - public removeAsset(id: string) { - this.runtimeState.clear(id); + /** + * Removes an Asset from the View + * + * @param assetSymbol - UUID Symbol attached to the Asset + */ + public removeAsset(assetSymbol: symbol) { + this.runtimeState.clearAsset(assetSymbol); this.dndWebPlayerPlugin.refresh(this.webPlayer.player); } - public exportView(): View { + /** + * Exports the content that was built in the editor without any drag and drop specific assets. + * This content will be able to run in a player configured with the same plugins loaded into the editor + * */ + public exportContent(): View { const baseView = this.runtimeState.view; - /** - * - */ + /** Walks the drag and drop state to remove any drop target assets */ const removeDndStateFromView = (obj: unknown): any => { if (obj === baseView && isDropTargetAsset(obj)) { if (obj.value?.asset) { @@ -153,9 +219,15 @@ export class DragAndDropController { return undefined; } + if (Array.isArray(obj)) { + return obj + .map((objectMember) => removeDndStateFromView(objectMember)) + .filter((n) => n !== null && n !== undefined); + } + if (typeof obj === 'object' && obj !== null) { if ('asset' in obj) { - const asWrapper: AssetWrapper = obj as any; + const asWrapper: AssetWrapper = obj as any; if ('asset' in obj && isDropTargetAsset(asWrapper.asset)) { if (asWrapper.asset.value) { const nestedValue = removeDndStateFromView( @@ -190,8 +262,10 @@ export class DragAndDropController { return JSON.parse(JSON.stringify(removeDndStateFromView(baseView))); } - public importView(view: View) { - this.runtimeState.importView(view, this.PlayerXLRService); - this.dndWebPlayerPlugin.refresh(this.webPlayer.player); + /** + * Exports the full state of the drag and drop editor that can be used to resume editing later + */ + public exportState(): View { + return this.runtimeState.view; } } diff --git a/drag-and-drop/library/src/hooks/useDroppableAsset.tsx b/drag-and-drop/library/src/hooks/useDroppableAsset.tsx index a3436f39..ef4830ed 100644 --- a/drag-and-drop/library/src/hooks/useDroppableAsset.tsx +++ b/drag-and-drop/library/src/hooks/useDroppableAsset.tsx @@ -5,7 +5,10 @@ import type { } from '../types'; import { DroppedItemTypes } from '../types'; -export const useDroppableAsset = (props: TransformedDropTargetAssetType) => { +export const useDroppableAsset = ( + props: TransformedDropTargetAssetType, + action: 'replace' | 'append' | 'prepend' +) => { const [p, ref] = useDrop({ accept: DroppedItemTypes.ASSET, drop: (item: ExtensionProviderAssetIdentifier, monitor) => { @@ -13,7 +16,7 @@ export const useDroppableAsset = (props: TransformedDropTargetAssetType) => { return; } - props.replaceAsset(item); + props.placeAsset(item, action); }, collect: (monitor) => ({ isOver: monitor.isOver(), diff --git a/drag-and-drop/library/src/types.ts b/drag-and-drop/library/src/types.ts index b093f3e7..bccb3735 100644 --- a/drag-and-drop/library/src/types.ts +++ b/drag-and-drop/library/src/types.ts @@ -1,21 +1,18 @@ -import type { ObjectType, TSManifest } from '@player-tools/xlr'; +import type { NamedType, ObjectType, TSManifest } from '@player-tools/xlr'; import type { Asset, ReactPlayerPlugin, Flow, View } from '@player-ui/react'; +export const DragAndDropAssetType = Symbol('drop-target'); +export const UUIDSymbol = Symbol('drag-and-drop-uuid'); + export const DroppedItemTypes = { ASSET: 'ASSET', }; -export const DragAndDropAssetType = 'test'; - export type FlowWithOneView = Flow & { + /** Single flow to render */ views: [View]; }; -export interface DroppedAsset { - type: typeof DroppedItemTypes.ASSET; - identifier: ExtensionProviderAssetIdentifier; -} - export interface ExtensionProvider { /** A constructor to create an instance of the plugin */ plugin: { @@ -31,67 +28,88 @@ export interface ExtensionProviderAssetIdentifier { pluginName: string; /** The asset type in the plugin */ - name: string; + assetName: string; /** The capability the type belongs to */ capability: string; } -export const isDropTargetAsset = (obj: unknown): obj is DropTargetAssetType => { +export const isDropTargetAsset = (obj: unknown): obj is DropTargetAsset => { return ( typeof obj === 'object' && obj !== null && - (obj as DropTargetAssetType).__type === DragAndDropAssetType + (obj as DropTargetAsset).__type === DragAndDropAssetType ); }; -export interface DropTargetAssetType extends Asset<'drop-target'> { +export interface PlacedAsset { + /** The identifier for where the populated asset is from */ + identifier: ExtensionProviderAssetIdentifier; + + /** The current descriptor for the value stored at this asset */ + type: NamedType; + + /** A mapping of asset slot name to drop target handlers */ + asset: Asset; +} + +/** The `context` property of a DropTargetAsset */ +export interface DropTargetAssetContext { + /** The identifier for the parent asset type */ + parent: Omit; + + /** The name of the property that this asset fulfills */ + propertyName?: string; + + /** If the drop target is an element in an array */ + isArrayElement?: boolean; + + /** If the drop target is generated on the fly from a collection */ + isMockTarget?: boolean; +} + +export interface DropTargetAsset extends Asset<'drop-target'> { /** An opaque identifier for the placeholder */ __type: typeof DragAndDropAssetType; + /** Shadow ID of drop target */ + [UUIDSymbol]: symbol; + /** * The context for what this value is in * Used for determining if a value is allowed to be dropped in this slot or not */ - context?: { - /** The identifier for the parent asset type */ - parent: Omit; - - /** The name of the property that this asset fulfills */ - propertyName?: string; - }; + context?: DropTargetAssetContext; - /** - * An asset that's currently populating this slot - * if not set, then this slot is empty and a placeholder will be shown instead - */ + /** The effective value that should be rendered. Generated from `.values` */ value?: { - /** The identifier for where the populated asset is from */ - identifier: ExtensionProviderAssetIdentifier; - /** The current descriptor for the value stored at this asset */ - type: ObjectType; + type: NamedType; - /** - * A mapping of asset slot name to drop target handlers - */ + /** A mapping of asset slot name to drop target handlers */ asset: Asset; }; + + /** + * The raw list of assets that currently populate this slot + * if not set, then this slot is empty and a placeholder will be shown instead + * if multiple assets are in the slot, they will be converted to a collection on the fly + */ + values?: Array; } -export interface TransformedDropTargetAssetType extends DropTargetAssetType { +export interface TransformedDropTargetAssetType extends DropTargetAsset { /** Context relative to the parent's position */ - context?: DropTargetAssetType['context'] & { - /** - * If the slot should accept being appended to - * Set if the parent asset supports an array (and this is the last item) - * or if the parent slot is a single item and we can convert to a collection - */ - allowArrayAppend: boolean; - }; + context?: DropTargetAsset['context']; + + /** Unique identifier to reference the asset within the drop target */ + assetSymbol?: symbol; /** Set the value of this slot to the replacement value */ - replaceAsset: (identifier: ExtensionProviderAssetIdentifier) => void; + placeAsset: ( + identifier: ExtensionProviderAssetIdentifier, + action: 'replace' | 'append' | 'prepend' + ) => void; /** Append the asset to the slot */ appendAsset: (identifier: ExtensionProviderAssetIdentifier) => void; diff --git a/drag-and-drop/library/src/utils/drop-component.tsx b/drag-and-drop/library/src/utils/drop-component.tsx index 637a533f..f3d66185 100644 --- a/drag-and-drop/library/src/utils/drop-component.tsx +++ b/drag-and-drop/library/src/utils/drop-component.tsx @@ -3,8 +3,27 @@ import { ReactAsset } from '@player-ui/react'; import type { TransformedDropTargetAssetType } from '../types'; import { useDroppableAsset } from '../hooks/useDroppableAsset'; +export const DropPrependComponent = ( + props: TransformedDropTargetAssetType & { + action: 'prepend' | 'append'; + } +) => { + const { action } = props; + const [{ isOver }, drop] = useDroppableAsset(props, action); + + return ( +
+ + {action} - {props.context?.parent.assetName} -{' '} + {props.context?.propertyName} + +
+ ); +}; + export const DropComponent = (props: TransformedDropTargetAssetType) => { - const [{ isOver }, drop] = useDroppableAsset(props); + const [{ isOver }, drop] = useDroppableAsset(props, 'replace'); + const isArrayInsertion = props.context?.isArrayElement ?? false; if (!props.value && !props.context) { return ( @@ -16,11 +35,24 @@ export const DropComponent = (props: TransformedDropTargetAssetType) => { return (
- {props.value ? ( - - ) : ( + {props.value && ( + <> + {isOver && } + + {isOver && } + + )} + + {!props.value && !isArrayInsertion && ( + + {props.context?.parent.assetName} - {props.context?.propertyName} + + )} + + {!props.value && isArrayInsertion && ( - {props.context?.parent.name} - {props.context?.propertyName} + Insert into {props.context?.parent.assetName} -{' '} + {props.context?.propertyName} List )}
diff --git a/drag-and-drop/library/src/utils/helpers.ts b/drag-and-drop/library/src/utils/helpers.ts new file mode 100644 index 00000000..084ec13f --- /dev/null +++ b/drag-and-drop/library/src/utils/helpers.ts @@ -0,0 +1,24 @@ +import type { Asset } from '@player-ui/types'; +import type { DropTargetAsset, DropTargetAssetContext } from '../types'; +import { DragAndDropAssetType, UUIDSymbol } from '../types'; + +/** Creates a drop target asset */ +export const makeDropTarget = ( + id: string, + context?: DropTargetAssetContext +): DropTargetAsset => { + const symbol = Symbol(`${id}-drop-target`); + return { + __type: DragAndDropAssetType, + id, + type: 'drop-target', + [UUIDSymbol]: symbol, + context, + values: [], + }; +}; + +/** Returns the shadow ID for any given asset */ +export const getAssetSymbol = (asset: Asset): symbol => { + return (asset as any)[UUIDSymbol]; +}; diff --git a/drag-and-drop/library/src/utils/player-dnd-plugin.ts b/drag-and-drop/library/src/utils/player-dnd-plugin.ts index e4f519bc..8645df5e 100644 --- a/drag-and-drop/library/src/utils/player-dnd-plugin.ts +++ b/drag-and-drop/library/src/utils/player-dnd-plugin.ts @@ -1,4 +1,4 @@ -import type { ObjectNode } from '@player-tools/xlr'; +import type { NamedType, ObjectType } from '@player-tools/xlr'; import type { ReactPlayer, ReactPlayerPlugin, @@ -6,10 +6,13 @@ import type { ViewController, Player, } from '@player-ui/react'; +import type { DropTargetAsset } from '../types'; +import { getAssetSymbol } from './helpers'; import type { ExtensionProviderAssetIdentifier, TransformedDropTargetAssetType, } from '../types'; +import { UUIDSymbol } from '../types'; import type { RuntimeFlowState } from './runtime-flow-state'; /** Options for controlling the drag-and-drop functionality */ @@ -33,7 +36,7 @@ export interface PlayerDndPluginOptions< */ getXLRTypeForAsset: ( identifier: ExtensionProviderAssetIdentifier - ) => ObjectNode; + ) => NamedType; /** A manager for the current flow state */ state: RuntimeFlowState; @@ -63,37 +66,52 @@ export class PlayerDndPlugin implements ReactPlayerPlugin { apply(player: Player) { const match = { type: this.options.Target.type ?? 'drop-target' }; + const assetIDToSymbolMap: Map = new Map(); player.hooks.viewController.tap(this.name, (vc) => { + vc.hooks.view.tap(this.name, (vi) => { + vi.hooks.parser.tap(this.name, (pa) => { + pa.hooks.onParseObject.tap(this.name, (o: any) => { + if (o.id) { + assetIDToSymbolMap.set(o.id, o[UUIDSymbol]); + } + + return o; + }); + }); + }); vc.transformRegistry.set(match, { - resolve: (asset) => { + resolve: (asset: DropTargetAsset) => { return { ...asset, - + assetSymbol: asset.value?.asset + ? getAssetSymbol(asset.value.asset) + : undefined, // Send back up to the runtime-state handler to compute the new view - replaceAsset: (identifier: ExtensionProviderAssetIdentifier) => { - console.log(`Replacing asset at: ${asset.id}`); - + placeAsset: ( + identifier: ExtensionProviderAssetIdentifier, + action: 'replace' | 'append' | 'prepend' = 'replace' + ) => { + console.log(`Placing asset at: ${asset.id}`); + const targetSymbol = getAssetSymbol(asset); this.options.state - .replace(asset.id, { - identifier, - type: this.options.getXLRTypeForAsset(identifier), - }) + .placeAsset( + targetSymbol, + { + identifier, + type: this.options.getXLRTypeForAsset(identifier), + }, + action, + asset.context?.isMockTarget && asset.value?.asset + ? getAssetSymbol(asset.value?.asset) + : undefined + ) .then(() => this.refresh(player)); }, - appendAsset: (identifier: ExtensionProviderAssetIdentifier) => { - console.log(`Appending to asset at: ${asset.id}`); - - this.options.state.append(asset.id, { - identifier, - type: this.options.getXLRTypeForAsset(identifier), - }); - this.refresh(player); - }, - clearAsset: () => { + clearAsset: (assetSymbol: symbol) => { console.log(`Clearing asset at: ${asset.id}`); - this.options.state.clear(asset.id); + this.options.state.clearAsset(assetSymbol); this.refresh(player); }, }; diff --git a/drag-and-drop/library/src/utils/runtime-flow-state.ts b/drag-and-drop/library/src/utils/runtime-flow-state.ts index 82be93f1..69506a38 100644 --- a/drag-and-drop/library/src/utils/runtime-flow-state.ts +++ b/drag-and-drop/library/src/utils/runtime-flow-state.ts @@ -1,37 +1,69 @@ -import type { ObjectType } from '@player-tools/xlr'; -import type { XLRService } from '@player-tools/language-service'; -import type { TypeMetadata } from '@player-tools/xlr-sdk'; -import type { Asset, View } from '@player-ui/types'; +import type { NamedType, ObjectType } from '@player-tools/xlr'; +import type { Asset, AssetWrapper, Flow, View } from '@player-ui/types'; import type { ExtensionProviderAssetIdentifier, FlowWithOneView, - DropTargetAssetType, + DropTargetAsset, + PlacedAsset, } from '../types'; -import { DragAndDropAssetType } from '../types'; +import { UUIDSymbol } from '../types'; +import { makeDropTarget, getAssetSymbol } from './helpers'; +import { isDropTargetAsset } from '../types'; /** The type for exporting and restoring the flow state */ export interface ExportedRuntimeFlowState { /** - * + * The root node of the drag and drop view */ - root: DropTargetAssetType; + root: DropTargetAsset; } export interface RuntimeFlowStateOptions { /** - * + * Function to call when a placed asset has required properties that need to be resolved before actually placing it. + */ + resolveRequiredProperties: ( + /** The basic Asset that could be generated */ + asset: Asset, + /** The XLR Type for the Asset being generated */ + type: NamedType + ) => Promise; + + /** + * Function that will be called when multiple assets are dropped onto the same target and a collection needs to be created */ - restoreFrom?: { - /** - * - */ - state: ExportedRuntimeFlowState; + resolveCollectionConversion: (assets: Array) => { + /** The generated collection asset with the provided `assets` array as children */ + asset: Asset; + /** The corresponding type for the generated collection asset */ + type: NamedType; }; /** - * Function to call when a placed asset has required properties that need to be resolved before actually placing it. + * The content to initialize the editing experience with */ - resolveRequiredProperties: (asset: Asset, type: ObjectType) => Promise; + restoreFrom?: + | { + /** + * The editor state to resume from + */ + state: ExportedRuntimeFlowState; + + /** + * The full Player flow to initialize with + */ + flow: never; + } + | { + /** + * The editor state to resume from + */ + flow: Flow; + /** + * The full Player flow to initialize with + */ + state: never; + }; } /** The context for the drop target */ @@ -44,67 +76,246 @@ interface DropTargetContextType { } /** - * + * Manages the translation between Drag and Drop state to Player state */ export class RuntimeFlowState { - private ROOT: DropTargetAssetType; - private assetMappings: Record = {}; + private ROOT: DropTargetAsset; + /** Symbol to Real Asset */ + private realAssetMappings: Map = new Map(); + /** Symbol to Drop Target Asset */ + private dropTargetAssets: Map = new Map(); + /** Asset Symbol to Drop Target Symbol */ + private assetsToTargets: Map = new Map(); + /** Drop Target Symbol to Asset Symbol */ + private targetsToAssets: Map = new Map(); + private resolveRequiredProperties: ( asset: Asset, - type: ObjectType + type: NamedType ) => Promise; - constructor(options: RuntimeFlowStateOptions) { - this.ROOT = { - __type: DragAndDropAssetType, - id: 'drag-and-drop-view', - type: 'drop-target', - }; - this.assetMappings[this.ROOT.id] = this.ROOT; + private resolveCollectionConversion: (assets: Array) => { + /** The generated collection asset with the provided `assets` array as children */ + asset: Asset; + /** The corresponding type for the generated collection asset */ + type: NamedType; + }; - this.resolveRequiredProperties = options?.resolveRequiredProperties; + constructor(options: RuntimeFlowStateOptions) { + this.ROOT = makeDropTarget('drag-and-drop-view'); + this.dropTargetAssets.set(getAssetSymbol(this.ROOT), this.ROOT); + this.resolveRequiredProperties = options.resolveRequiredProperties; + this.resolveCollectionConversion = options.resolveCollectionConversion; } - export(): ExportedRuntimeFlowState { + exportState(): ExportedRuntimeFlowState { return { root: this.ROOT, }; } - updateAsset(id: string, newAsset: Asset) { - const asset = this.assetMappings[id]; - if (!asset) { - throw new Error(`Cannot set asset value for unknown id: ${id}`); + private getContainingDropTarget(assetSymbol: symbol): DropTargetAsset { + const containingDropTargetSymbol = this.assetsToTargets.get(assetSymbol); + if (!containingDropTargetSymbol) { + throw new Error( + `Cannot get parent drop target symbol of ${assetSymbol.toString()}` + ); + } + + const containingDropTarget = this.dropTargetAssets.get( + containingDropTargetSymbol + ); + + if (!containingDropTarget) { + throw new Error( + `Cannot get drop target for symbol ${containingDropTargetSymbol.toString()}` + ); } - if (!asset.value) { - throw new Error(`Cannot set properties on asset without a value`); + return containingDropTarget; + } + + private findAssetInDropTarget( + assetSymbol: symbol, + dropTarget: DropTargetAsset + ): number { + const index = dropTarget.values?.findIndex((value) => { + return getAssetSymbol(value.asset) === assetSymbol; + }); + + if (index === undefined || index === -1) { + throw new Error( + `Unable to find asset ${assetSymbol.toString()} in drop target ${ + dropTarget.id + }` + ); } - asset.value.asset = newAsset; + return index; + } + + private computeViewForDropTarget( + dropTarget: DropTargetAsset + ): DropTargetAsset['value'] | undefined { + if (!dropTarget.values || dropTarget.values.length === 0) { + return undefined; + } + + if (dropTarget.values.length === 1) { + return dropTarget.values[0]; + } + + const realDropTargetSymbol = getAssetSymbol(dropTarget); + const assetsWithPlaceholders = dropTarget.values.reduce( + (coll, placedAsset, index) => { + const prefixAsset = makeDropTarget( + `${dropTarget.id}-${index * 2 - 1}`, + dropTarget.context + ? { + ...dropTarget.context, + isArrayElement: true, + } + : undefined + ); + + if (index > 0) { + this.dropTargetAssets.set(getAssetSymbol(prefixAsset), prefixAsset); + } + + const mockDropTarget = makeDropTarget( + `${dropTarget.id}-${index * 2}`, + dropTarget.context + ? { + ...dropTarget.context, + isArrayElement: true, + isMockTarget: true, + } + : undefined + ); + + mockDropTarget[UUIDSymbol] = realDropTargetSymbol; + + mockDropTarget.value = { + ...placedAsset, + asset: { + ...placedAsset.asset, + id: `${dropTarget.id}-${index * 2}`, + }, + }; + + return [ + ...coll, + ...(index > 0 ? [{ asset: prefixAsset }] : []), + { asset: mockDropTarget }, + ]; + }, + [] + ); + + return this.resolveCollectionConversion(assetsWithPlaceholders); + } + + private updateArrayInParent( + containingDropTarget: DropTargetAsset, + dropTargetSymbol: symbol + ) { + if ( + containingDropTarget.context?.isArrayElement && + containingDropTarget.context.propertyName + ) { + const containingAssetSymbol = this.targetsToAssets.get(dropTargetSymbol); + if (!containingAssetSymbol) { + throw new Error( + `Error: can't get parent asset mapping of drop target ${dropTargetSymbol.toString()}` + ); + } + + const containingAsset = this.realAssetMappings.get(containingAssetSymbol); + + if (!containingAsset) { + throw new Error( + `Error: can't get asset for symbol ${containingAssetSymbol.toString()}` + ); + } + + const arrayProperty = containingAsset.asset[ + containingDropTarget.context.propertyName + ] as Array>; + const dropTargetIndex = arrayProperty.find((element) => { + return getAssetSymbol(element.asset) === dropTargetSymbol; + }); + + if (!dropTargetIndex) { + throw new Error('cant calculate array insertion'); + } + + const insertionIndex = arrayProperty.indexOf(dropTargetIndex); + // Check if drop targets around placed asset need to be updated + const leftNeighbor = arrayProperty[insertionIndex - 1]; + if (!leftNeighbor || leftNeighbor.asset.values?.length !== 0) { + const newLeftAsset = makeDropTarget(`${containingDropTarget.id}-left`, { + ...containingDropTarget.context, + }); + this.dropTargetAssets.set(getAssetSymbol(newLeftAsset), newLeftAsset); + this.targetsToAssets.set( + getAssetSymbol(newLeftAsset), + containingAssetSymbol + ); + arrayProperty.splice(insertionIndex, 0, { + asset: { + ...newLeftAsset, + }, + }); + } + + arrayProperty[insertionIndex + 1] = { asset: containingDropTarget }; + + const rightNeighbor = arrayProperty[insertionIndex + 2]; + if (!rightNeighbor || rightNeighbor.asset.values?.length !== 0) { + const newRightAsset = makeDropTarget( + `${containingDropTarget.id}-right`, + { + ...containingDropTarget.context, + } + ); + this.dropTargetAssets.set(getAssetSymbol(newRightAsset), newRightAsset); + this.targetsToAssets.set( + getAssetSymbol(newRightAsset), + containingAssetSymbol + ); + arrayProperty.splice(insertionIndex + 2, 0, { + asset: { + ...newRightAsset, + }, + }); + } + } } private async createNewAsset( idPrefix: string, - type: ObjectType + xlrType: NamedType ): Promise { const typeProp = - type.properties.type.node.type === 'string' - ? type.properties.type.node.const + xlrType.properties.type.node.type === 'string' + ? xlrType.properties.type.node.const : undefined; if (typeProp === undefined) { - throw new Error('type property must be a constant'); + throw new Error( + `'type' property of type ${xlrType.name} is not a constant. Are you sure this is a valid Asset?` + ); } let asset: Asset = { - id: `${idPrefix}-test-1`, + id: `${idPrefix}-${typeProp}`, type: typeProp, + [UUIDSymbol]: Symbol(`${idPrefix}-${typeProp}`), }; let hasRequiredProperties = false; - Object.entries(type.properties).forEach(([key, prop]) => { + Object.entries(xlrType.properties).forEach(([key, prop]) => { if (prop.node.type === 'string' && prop.node.const !== undefined) { asset[key] = prop.node.const; } @@ -114,90 +325,171 @@ export class RuntimeFlowState { } if ( - prop.node.type === 'ref' && - prop.node.ref.startsWith('AssetWrapper') + (prop.node.type === 'ref' && + prop.node.ref.startsWith('AssetWrapper')) || + (prop.node.type === 'array' && + prop.node.elementType.type === 'ref' && + prop.node.elementType.ref.startsWith('AssetWrapper')) ) { - const generatedAsset: DropTargetAssetType = { - __type: DragAndDropAssetType, - id: `${idPrefix}-${key}`, - type: 'drop-target', - context: { - propertyName: key, - parent: { - pluginName: 'test', - name: typeProp, - }, + const isArray = prop.node.type === 'array'; + const context = { + propertyName: key, + parent: { + pluginName: 'player-dnd-plugin', + assetName: typeProp, }, + isArrayElement: isArray, }; + const id = isArray ? `${idPrefix}-${key}-0` : `${idPrefix}-${key}`; + const assetSlot = makeDropTarget(id, context); - this.assetMappings[generatedAsset.id] = generatedAsset; - asset[key] = { asset: generatedAsset }; + this.dropTargetAssets.set(getAssetSymbol(assetSlot), assetSlot); + this.targetsToAssets.set( + getAssetSymbol(assetSlot), + getAssetSymbol(asset) + ); + if (isArray) { + asset[key] = [{ asset: assetSlot }]; + } else { + asset[key] = { asset: assetSlot }; + } } }); if (hasRequiredProperties) { - asset = await this.resolveRequiredProperties(asset, type); + asset = await this.resolveRequiredProperties(asset, xlrType); } return asset; } - async replace( - id: string, + public updateAsset(assetSymbol: symbol, newAsset: Asset) { + let placedAsset = this.realAssetMappings.get(assetSymbol); + + if (!placedAsset) { + throw new Error( + `Cannot set asset value for unknown id: ${assetSymbol.toString()}` + ); + } + + if (!placedAsset.asset) { + throw new Error( + `Cannot update an asset that doesn't have an existing asset` + ); + } + + placedAsset = { + ...placedAsset, + asset: { + ...placedAsset.asset, + ...newAsset, + }, + }; + + const containingDropTarget = this.getContainingDropTarget(assetSymbol); + + if (!containingDropTarget.values) { + throw new Error( + `Mapped drop target ${containingDropTarget.id} as no assets` + ); + } + + this.realAssetMappings.set(assetSymbol, placedAsset); + + const updateIndex = this.findAssetInDropTarget( + assetSymbol, + containingDropTarget + ); + + containingDropTarget.values[updateIndex] = placedAsset; + + containingDropTarget.value = + this.computeViewForDropTarget(containingDropTarget); + } + + public async placeAsset( + /** The symbol for the drop target to place the asset in */ + dropTargetSymbol: symbol, + /** XLR Info about the asset being placed */ replacement: { /** The identifier for where the populated asset is from */ identifier: ExtensionProviderAssetIdentifier; /** The current descriptor for the value stored at this asset */ - type: ObjectType; - } + type: NamedType; + }, + action: 'replace' | 'append' | 'prepend', + /** The symbol for the asset to replace if the new asset is being dropped into a generated collection */ + assetSymbol?: symbol ): Promise { - const asset = this.assetMappings[id]; - if (!asset) { - throw new Error(`Cannot set asset value for unknown id: ${id}`); + const dropTarget = this.dropTargetAssets.get(dropTargetSymbol); + if (!dropTarget) { + throw new Error( + `Cannot set asset value for unknown drop target: ${dropTargetSymbol.toString()}` + ); + } + + if (!isDropTargetAsset(dropTarget)) { + throw new Error(`Cannot drop asset onto non drop target asset`); } - const newAsset = await this.createNewAsset(id, replacement.type); + const newAsset = await this.createNewAsset(dropTarget.id, replacement.type); - asset.value = { - ...replacement, + const newWrappedAsset = { asset: newAsset, + ...replacement, }; + + this.realAssetMappings.set(getAssetSymbol(newAsset), newWrappedAsset); + + if (action === 'replace') { + if (assetSymbol && dropTarget.values) { + const updateIndex = this.findAssetInDropTarget(assetSymbol, dropTarget); + + dropTarget.values[updateIndex] = newWrappedAsset; + } else { + dropTarget.values = [newWrappedAsset]; + } + } else if (action === 'append') { + dropTarget.values = [...(dropTarget.values ?? []), newWrappedAsset]; + } else if (action === 'prepend') { + dropTarget.values = [newWrappedAsset, ...(dropTarget.values ?? [])]; + } + + dropTarget.value = this.computeViewForDropTarget(dropTarget); + + const newAssetSymbol = getAssetSymbol(newAsset); + this.assetsToTargets.set(newAssetSymbol, dropTargetSymbol); + + // Resolve Arrays in parent + this.updateArrayInParent(dropTarget, dropTargetSymbol); } - get(id: string): { + public getAsset(assetSymbol: symbol): { /** The Asset that correlates to the given ID */ asset: Asset; /** The underlying XLR type for the Asset */ type: ObjectType; } { - const asset = this.assetMappings[id]; - - if (!asset || !asset.value) { - throw new Error(`Cannot get asset value for unknown id: ${id}`); + const placedAsset = this.realAssetMappings.get(assetSymbol); + if (!placedAsset) { + throw new Error( + `Cannot get asset value for unknown id: ${assetSymbol.toString()}` + ); } - return { asset: asset.value.asset, type: asset.value.type }; + return { ...placedAsset }; } - append( - id: string, - replacement: { - /** The identifier for where the populated asset is from */ - identifier: ExtensionProviderAssetIdentifier; - - /** The current descriptor for the value stored at this asset */ - type: ObjectType; - } - ) {} + public clearAsset(assetSymbol: symbol) { + const parentDropTarget = this.getContainingDropTarget(assetSymbol); - clear(id: string) { - const asset = this.assetMappings[id]; - if (!asset) { - throw new Error(`Cannot clear asset. Not found: ${id}`); - } + parentDropTarget.values = parentDropTarget.values?.filter( + (pa) => getAssetSymbol(pa.asset) !== assetSymbol + ); - asset.value = undefined; + this.realAssetMappings.delete(assetSymbol); + parentDropTarget.value = this.computeViewForDropTarget(parentDropTarget); } createDropTarget( From 46ac22177a24c9f6f349b8930e58721fde692ed6 Mon Sep 17 00:00:00 2001 From: Ketan Reddy Date: Wed, 1 Feb 2023 17:14:40 -0800 Subject: [PATCH 34/52] Update CODEOWNERS --- .github/CODEOWNERS | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index a002b790..19a26432 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,5 +1,13 @@ # Fallback -* @adierkens +* @KetanReddy # Language language/ @KetanReddy @adierkens +cli/ @KetanReddy @adierkens + +# XLR +xlr/ @KetanReddy +drag-and-drop/ @KetanReddy @adierkens + +# DevTools +devtools/ @sugarmanz \ No newline at end of file From dd662e245b098182f01a2221617b3af71311ce89 Mon Sep 17 00:00:00 2001 From: Chengli Wang Date: Mon, 6 Feb 2023 10:58:04 -0500 Subject: [PATCH 35/52] support for arrays --- .../library/src/__tests__/controller.test.tsx | 40 ++++-- drag-and-drop/library/src/controller.tsx | 9 ++ .../library/src/utils/runtime-flow-state.ts | 130 ++++++++++-------- 3 files changed, 112 insertions(+), 67 deletions(-) diff --git a/drag-and-drop/library/src/__tests__/controller.test.tsx b/drag-and-drop/library/src/__tests__/controller.test.tsx index c3863d88..9ec6a444 100644 --- a/drag-and-drop/library/src/__tests__/controller.test.tsx +++ b/drag-and-drop/library/src/__tests__/controller.test.tsx @@ -1,10 +1,15 @@ import { waitFor } from '@testing-library/react'; -import type { Asset, InProgressState } from '@player-ui/react'; +import type { Asset, AssetWrapper, InProgressState } from '@player-ui/react'; import pluginManifest from '@player-tools/static-xlrs/static_xlrs/plugin/xlr/manifest'; import typesManifest from '@player-tools/static-xlrs/static_xlrs/core/xlr/manifest'; import type { ObjectType } from '@player-tools/xlr'; import { DragAndDropController } from '../controller'; -import type { ExtensionProvider } from '../types'; +import type { + DropTargetAsset, + DropTargetAssetContext, + ExtensionProvider, +} from '../types'; +import { getAssetSymbol } from '../utils/helpers'; const referenceAssetExtension: ExtensionProvider = { plugin: class test { @@ -182,14 +187,10 @@ describe('drag-and-drop', () => { ], }; const dndController = new DragAndDropController({ - types: typesManifest, + playerTypes: typesManifest, extensions: [referenceAssetExtension], - resolveRequiredProperties: async ( - asset: Asset, - type: ObjectType - ) => { - return asset; - }, + resolveRequiredProperties: jest.fn(), + resolveCollectionConversion: jest.fn(), }); const { player } = dndController.webPlayer; @@ -208,7 +209,7 @@ describe('drag-and-drop', () => { expect(dndView.value.identifier.pluginName).toStrictEqual( 'BaseAssetsPlugin' ); - expect(dndView.value.identifier.name).toStrictEqual('CollectionAsset'); + expect(dndView.value.identifier.assetName).toStrictEqual('CollectionAsset'); expect(dndView.value.identifier.capability).toStrictEqual('Views'); expect(dndView.value.type.name).toStrictEqual('CollectionAsset'); expect(dndView.value.asset.id).toStrictEqual( @@ -216,9 +217,9 @@ describe('drag-and-drop', () => { ); expect(dndView.value.asset.type).toStrictEqual('collection'); expect(dndView.value.asset.label.asset.type).toStrictEqual('drop-target'); - expect(dndView.value.asset.label.asset.context.parent.name).toStrictEqual( - 'collection' - ); + expect( + dndView.value.asset.label.asset.context.parent.assetName + ).toStrictEqual('collection'); expect(dndView.value.asset.label.asset.context.propertyName).toStrictEqual( 'label' ); @@ -230,5 +231,18 @@ describe('drag-and-drop', () => { const { note } = values[1].asset.value.asset; expect(note.asset.type).toStrictEqual('drop-target'); expect(note.asset.value.asset.value).toStrictEqual('input note'); + const state = dndController.exportState() as DropTargetAsset; + const label = state.value?.asset.label as AssetWrapper; + expect(label.asset.type).toStrictEqual('drop-target'); + const labelContext = label.asset.context as DropTargetAssetContext; + expect(labelContext.isArrayElement).toStrictEqual(false); + expect(labelContext.propertyName).toStrictEqual('label'); + expect(labelContext.parent.assetName).toStrictEqual('collection'); + const collectionAssetWrapper = state.value as AssetWrapper; + const collection = dndController.getAsset( + getAssetSymbol(collectionAssetWrapper.asset) + ); + expect(collection).not.toBeNull(); + expect(collection.type.name).toStrictEqual('CollectionAsset'); }); }); diff --git a/drag-and-drop/library/src/controller.tsx b/drag-and-drop/library/src/controller.tsx index 5ed79c89..f3697e5e 100644 --- a/drag-and-drop/library/src/controller.tsx +++ b/drag-and-drop/library/src/controller.tsx @@ -262,6 +262,15 @@ export class DragAndDropController { return JSON.parse(JSON.stringify(removeDndStateFromView(baseView))); } + /** + * Imports existing content and populates the state of drag and drop + * @param view - player content + */ + public importView(view: View) { + this.runtimeState.importView(view, this.PlayerXLRService); + this.dndWebPlayerPlugin.refresh(this.webPlayer.player); + } + /** * Exports the full state of the drag and drop editor that can be used to resume editing later */ diff --git a/drag-and-drop/library/src/utils/runtime-flow-state.ts b/drag-and-drop/library/src/utils/runtime-flow-state.ts index 69506a38..649f5131 100644 --- a/drag-and-drop/library/src/utils/runtime-flow-state.ts +++ b/drag-and-drop/library/src/utils/runtime-flow-state.ts @@ -5,6 +5,7 @@ import type { FlowWithOneView, DropTargetAsset, PlacedAsset, + DropTargetAssetContext, } from '../types'; import { UUIDSymbol } from '../types'; import { makeDropTarget, getAssetSymbol } from './helpers'; @@ -66,15 +67,6 @@ export interface RuntimeFlowStateOptions { }; } -/** The context for the drop target */ -interface DropTargetContextType { - /** The name of the property that this asset fulfills */ - propName: string; - - /** The parent asset type */ - parentAssetType: string; -} - /** * Manages the translation between Drag and Drop state to Player state */ @@ -231,7 +223,6 @@ export class RuntimeFlowState { } const containingAsset = this.realAssetMappings.get(containingAssetSymbol); - if (!containingAsset) { throw new Error( `Error: can't get asset for symbol ${containingAssetSymbol.toString()}` @@ -241,6 +232,7 @@ export class RuntimeFlowState { const arrayProperty = containingAsset.asset[ containingDropTarget.context.propertyName ] as Array>; + const dropTargetIndex = arrayProperty.find((element) => { return getAssetSymbol(element.asset) === dropTargetSymbol; }); @@ -492,54 +484,68 @@ export class RuntimeFlowState { parentDropTarget.value = this.computeViewForDropTarget(parentDropTarget); } + makeDropTargetContext( + xlrService: XLRService, + parent: Asset, + propertyName: string, + isArrayElement?: boolean + ): DropTargetAssetContext { + const { plugin: pluginName } = xlrService.XLRSDK.getTypeInfo( + parent.type + ) as TypeMetadata; + return { + parent: { + pluginName, + assetName: parent.type, + }, + propertyName, + isArrayElement, + }; + } + createDropTarget( xlrService: XLRService, targetAsset: Asset, - dropTargetContext: DropTargetContextType - ): DropTargetAssetType { + dropTargetContext?: DropTargetAssetContext, + parentAsset?: Asset + ): DropTargetAsset { const targetAssetType = xlrService.XLRSDK.getType( targetAsset.type - ) as ObjectType; - const { plugin } = xlrService.XLRSDK.getTypeInfo( + ) as NamedType; + const { plugin: pluginName } = xlrService.XLRSDK.getTypeInfo( targetAsset.type ) as TypeMetadata; - const dropTarget: DropTargetAssetType = { - id: `${targetAsset.id}-dropTarget`, - __type: DragAndDropAssetType, - type: 'drop-target', - value: { - identifier: { - pluginName: plugin, - name: targetAssetType.name ?? '', - capability: - dropTargetContext.parentAssetType.length === 0 ? 'Views' : 'Assets', - }, - type: targetAssetType, - asset: targetAsset, + const dropTarget = makeDropTarget(`${targetAsset.id}-dropTarget`); + dropTarget.context = dropTargetContext; + const wrappedTargetAsset: PlacedAsset = { + identifier: { + pluginName, + assetName: targetAssetType.name ?? '', + capability: dropTargetContext ? 'Assets' : 'Views', }, + type: targetAssetType, + asset: targetAsset, }; - - if ( - dropTargetContext.parentAssetType.length > 0 && - dropTargetContext.propName.length > 0 - ) { - dropTarget.context = { - propertyName: dropTargetContext.propName, - parent: { - pluginName: plugin, - name: dropTargetContext.parentAssetType, - }, - }; + dropTarget.values?.push(wrappedTargetAsset); + const dropTargetSymbol = getAssetSymbol(dropTarget); + const targetAssetSymbol = getAssetSymbol(targetAsset); + this.dropTargetAssets.set(dropTargetSymbol, dropTarget); + this.realAssetMappings.set(targetAssetSymbol, wrappedTargetAsset); + this.assetsToTargets.set(targetAssetSymbol, dropTargetSymbol); + if (parentAsset) { + this.targetsToAssets.set(dropTargetSymbol, getAssetSymbol(parentAsset)); } - this.assetMappings[dropTarget.id] = dropTarget; + dropTarget.value = this.computeViewForDropTarget(dropTarget); + return dropTarget; } addDndStateToAsset( obj: any, xlrService: XLRService, - dropTargetContext: DropTargetContextType + dropTargetContext?: DropTargetAssetContext, + parentAsset?: Asset ) { if (obj === null) { return obj; @@ -547,8 +553,13 @@ export class RuntimeFlowState { const newObj = { ...obj }; const assetType = xlrService.XLRSDK.getType(obj.type) as ObjectType; + if (assetType) { + newObj[UUIDSymbol] = Symbol(`${newObj.id}-${newObj.type}`); + } + Object.keys(newObj).forEach((key) => { let isAssetWrapper = false; + let isArrayElement = false; if (assetType && key in assetType.properties) { const { node } = assetType.properties[key]; if ( @@ -558,26 +569,39 @@ export class RuntimeFlowState { node.elementType.ref.startsWith('AssetWrapper')) ) { isAssetWrapper = true; + isArrayElement = node.type === 'array'; } } if ( key === 'asset' && - dropTargetContext.propName.length > 0 && - dropTargetContext.parentAssetType.length > 0 + dropTargetContext && + dropTargetContext?.parent.assetName.length > 0 ) { newObj[key] = this.createDropTarget( xlrService, - this.addDndStateToAsset(obj[key], xlrService, dropTargetContext), - dropTargetContext + this.addDndStateToAsset( + obj[key], + xlrService, + dropTargetContext, + parentAsset + ), + dropTargetContext, + parentAsset ); } else if (typeof obj[key] === 'object') { newObj[key] = this.addDndStateToAsset( obj[key], xlrService, isAssetWrapper - ? { propName: key, parentAssetType: obj.type } - : dropTargetContext + ? this.makeDropTargetContext( + xlrService, + newObj, + key, + isArrayElement + ) + : dropTargetContext, + isAssetWrapper ? newObj : parentAsset ); } else { newObj[key] = obj[key]; @@ -592,15 +616,13 @@ export class RuntimeFlowState { } importView(view: View, xlrService: XLRService) { - const dropTargetContext: DropTargetContextType = { - propName: '', - parentAssetType: '', - }; - this.assetMappings = {}; + this.realAssetMappings.clear(); + this.dropTargetAssets.clear(); + this.assetsToTargets.clear(); + this.targetsToAssets.clear(); this.ROOT = this.createDropTarget( xlrService, - this.addDndStateToAsset(view, xlrService, dropTargetContext), - dropTargetContext + this.addDndStateToAsset(view, xlrService) ); } From b6972ff3345b350c4292eebf5e70109d3e349c79 Mon Sep 17 00:00:00 2001 From: Ketan Reddy Date: Mon, 6 Feb 2023 12:46:50 -0800 Subject: [PATCH 36/52] Fix dropped imports --- drag-and-drop/library/src/utils/runtime-flow-state.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drag-and-drop/library/src/utils/runtime-flow-state.ts b/drag-and-drop/library/src/utils/runtime-flow-state.ts index 649f5131..839f7da5 100644 --- a/drag-and-drop/library/src/utils/runtime-flow-state.ts +++ b/drag-and-drop/library/src/utils/runtime-flow-state.ts @@ -1,4 +1,6 @@ import type { NamedType, ObjectType } from '@player-tools/xlr'; +import type { XLRService } from '@player-tools/language-service'; +import type { TypeMetadata } from '@player-tools/xlr-sdk'; import type { Asset, AssetWrapper, Flow, View } from '@player-ui/types'; import type { ExtensionProviderAssetIdentifier, From c544e2e3bf906d1e6e2cd64c23c958acae9d7e74 Mon Sep 17 00:00:00 2001 From: Ketan Reddy Date: Mon, 6 Feb 2023 13:54:11 -0800 Subject: [PATCH 37/52] Transform `values` key out to prevent Player from parsing it --- drag-and-drop/library/src/types.ts | 3 +++ .../library/src/utils/player-dnd-plugin.ts | 25 ++++++++----------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/drag-and-drop/library/src/types.ts b/drag-and-drop/library/src/types.ts index bccb3735..3b833a1a 100644 --- a/drag-and-drop/library/src/types.ts +++ b/drag-and-drop/library/src/types.ts @@ -105,6 +105,9 @@ export interface TransformedDropTargetAssetType extends DropTargetAsset { /** Unique identifier to reference the asset within the drop target */ assetSymbol?: symbol; + /** The raw Drag and Drag state should not be made available to Player's runtime */ + values: never; + /** Set the value of this slot to the replacement value */ placeAsset: ( identifier: ExtensionProviderAssetIdentifier, diff --git a/drag-and-drop/library/src/utils/player-dnd-plugin.ts b/drag-and-drop/library/src/utils/player-dnd-plugin.ts index 8645df5e..8626b0fd 100644 --- a/drag-and-drop/library/src/utils/player-dnd-plugin.ts +++ b/drag-and-drop/library/src/utils/player-dnd-plugin.ts @@ -12,7 +12,6 @@ import type { ExtensionProviderAssetIdentifier, TransformedDropTargetAssetType, } from '../types'; -import { UUIDSymbol } from '../types'; import type { RuntimeFlowState } from './runtime-flow-state'; /** Options for controlling the drag-and-drop functionality */ @@ -65,22 +64,20 @@ export class PlayerDndPlugin implements ReactPlayerPlugin { } apply(player: Player) { - const match = { type: this.options.Target.type ?? 'drop-target' }; - const assetIDToSymbolMap: Map = new Map(); + const match = { + type: this.options.Target.type ?? 'drop-target', + }; player.hooks.viewController.tap(this.name, (vc) => { - vc.hooks.view.tap(this.name, (vi) => { - vi.hooks.parser.tap(this.name, (pa) => { - pa.hooks.onParseObject.tap(this.name, (o: any) => { - if (o.id) { - assetIDToSymbolMap.set(o.id, o[UUIDSymbol]); - } - - return o; - }); - }); - }); vc.transformRegistry.set(match, { + beforeResolve: (asset) => { + return { + ...asset, + children: asset.children?.filter((child) => { + return child.path[0] !== 'values'; + }), + }; + }, resolve: (asset: DropTargetAsset) => { return { ...asset, From 1a61a36b69688e967c353f9c523212b916a4a66e Mon Sep 17 00:00:00 2001 From: Shawn Andrews Date: Tue, 7 Feb 2023 14:06:18 -0500 Subject: [PATCH 38/52] test: added test-helpers for xlr/utils --- xlr/utils/BUILD | 3 +- xlr/utils/src/__tests__/annotations.test.ts | 2 +- .../src/__tests__/helpers/test-helpers.ts | 38 +++++++++++++++++++ 3 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 xlr/utils/src/__tests__/helpers/test-helpers.ts diff --git a/xlr/utils/BUILD b/xlr/utils/BUILD index d0e7d301..dbf1d4a5 100644 --- a/xlr/utils/BUILD +++ b/xlr/utils/BUILD @@ -4,7 +4,8 @@ load("//:index.bzl", "javascript_pipeline") javascript_pipeline( name = "@player-tools/xlr-utils", dependencies = [ - "//xlr/types:@player-tools/xlr" + "//xlr/types:@player-tools/xlr", + "@npm//@typescript/vfs", ], peer_dependencies = [ "@npm//typescript", diff --git a/xlr/utils/src/__tests__/annotations.test.ts b/xlr/utils/src/__tests__/annotations.test.ts index 5b3d1a94..881b7b7b 100644 --- a/xlr/utils/src/__tests__/annotations.test.ts +++ b/xlr/utils/src/__tests__/annotations.test.ts @@ -1,4 +1,4 @@ -import { setupTestEnv } from '../test-helpers'; +import { setupTestEnv } from './helpers/test-helpers'; import { decorateNode } from '../annotations'; describe('Annotations', () => { diff --git a/xlr/utils/src/__tests__/helpers/test-helpers.ts b/xlr/utils/src/__tests__/helpers/test-helpers.ts new file mode 100644 index 00000000..d131766a --- /dev/null +++ b/xlr/utils/src/__tests__/helpers/test-helpers.ts @@ -0,0 +1,38 @@ +import * as ts from 'typescript'; +import * as tsvfs from '@typescript/vfs'; + +export interface SetupReturnType { + /** + * Virtual source file containing the passed in text + */ + sf: ts.SourceFile; + /** + * Type checker for the virtual program + */ + tc: ts.TypeChecker; +} + +/** + * Setups a virtual TS environment for tests + */ +export function setupTestEnv(sourceCode: string, mockFileName = 'filename.ts') { + const fsMap = tsvfs.createDefaultMapFromNodeModules({}, ts); + fsMap.set(mockFileName, sourceCode); + + const system = tsvfs.createSystem(fsMap); + const host = tsvfs.createVirtualCompilerHost(system, {}, ts); + + const program = ts.createProgram({ + rootNames: [...fsMap.keys()], + options: {}, + host: host.compilerHost, + }); + + return { + sf: host.compilerHost.getSourceFile( + mockFileName, + ts.ScriptTarget.ES5 + ) as ts.SourceFile, + tc: program.getTypeChecker(), + }; +} From 94ed219f33783e5ce966f734bed028fc47ec3d68 Mon Sep 17 00:00:00 2001 From: Ketan Reddy Date: Wed, 8 Feb 2023 09:29:34 -0800 Subject: [PATCH 39/52] Also take out any XLR info during the beforeResolve phase for drop-target assets --- drag-and-drop/library/src/utils/player-dnd-plugin.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drag-and-drop/library/src/utils/player-dnd-plugin.ts b/drag-and-drop/library/src/utils/player-dnd-plugin.ts index 8626b0fd..3712219c 100644 --- a/drag-and-drop/library/src/utils/player-dnd-plugin.ts +++ b/drag-and-drop/library/src/utils/player-dnd-plugin.ts @@ -74,7 +74,15 @@ export class PlayerDndPlugin implements ReactPlayerPlugin { return { ...asset, children: asset.children?.filter((child) => { - return child.path[0] !== 'values'; + if (child.path[0] === 'values') { + return false; + } + + if (child.path[0] === 'value' && child.path[1] === 'type') { + return false; + } + + return true; }), }; }, From 3dcda7b3c4fb444f6e4285667d6b496c060dc1c8 Mon Sep 17 00:00:00 2001 From: Chengli Wang Date: Fri, 17 Feb 2023 09:08:22 -0500 Subject: [PATCH 40/52] pass a callback to handle Drag and Drop state changes --- drag-and-drop/app/pages/index.tsx | 3 + .../library/src/__tests__/controller.test.tsx | 15 ++++ drag-and-drop/library/src/controller.tsx | 63 +++------------ .../library/src/utils/runtime-flow-state.ts | 76 +++++++++++++++++++ 4 files changed, 104 insertions(+), 53 deletions(-) diff --git a/drag-and-drop/app/pages/index.tsx b/drag-and-drop/app/pages/index.tsx index 8eaf5326..5f16cb8f 100644 --- a/drag-and-drop/app/pages/index.tsx +++ b/drag-and-drop/app/pages/index.tsx @@ -607,6 +607,9 @@ const App = () => { type: collectionType as NamedType, }; }, + handleDndStateChange(content) { + console.log('handle state changes here'); + } }; const controller = new DragAndDropController(config); return { diff --git a/drag-and-drop/library/src/__tests__/controller.test.tsx b/drag-and-drop/library/src/__tests__/controller.test.tsx index 9ec6a444..faf23282 100644 --- a/drag-and-drop/library/src/__tests__/controller.test.tsx +++ b/drag-and-drop/library/src/__tests__/controller.test.tsx @@ -20,6 +20,7 @@ const referenceAssetExtension: ExtensionProvider = { describe('drag-and-drop', () => { it('Fills in placeholder assets when dropped', async () => { + const mockHandleStateChange = jest.fn(); const dndController = new DragAndDropController({ playerTypes: typesManifest, extensions: [referenceAssetExtension], @@ -78,6 +79,7 @@ describe('drag-and-drop', () => { }, }; }, + handleDndStateChange: mockHandleStateChange, }); const { player } = dndController.webPlayer; @@ -121,6 +123,18 @@ describe('drag-and-drop', () => { "type": "info", } `); + + expect(mockHandleStateChange).toBeCalledWith({ + actions: [], + id: 'drag-and-drop-view-info', + title: { + asset: { + id: 'drag-and-drop-view-title-text', + type: 'text', + }, + }, + type: 'info', + }); }); it('Import existing content into drag and drop', async () => { @@ -191,6 +205,7 @@ describe('drag-and-drop', () => { extensions: [referenceAssetExtension], resolveRequiredProperties: jest.fn(), resolveCollectionConversion: jest.fn(), + handleDndStateChange: jest.fn(), }); const { player } = dndController.webPlayer; diff --git a/drag-and-drop/library/src/controller.tsx b/drag-and-drop/library/src/controller.tsx index f3697e5e..36954f0a 100644 --- a/drag-and-drop/library/src/controller.tsx +++ b/drag-and-drop/library/src/controller.tsx @@ -49,6 +49,14 @@ export interface DragAndDropControllerOptions { type: NamedType; }; + /** + * Function that will be called when Drag and Drop state changes + */ + handleDndStateChange: ( + /** The player content without any drag and drop specific assets */ + content: View + ) => void; + /** A custom component to use for rendering droppable Assets */ Component?: React.ComponentType; } @@ -89,6 +97,7 @@ export class DragAndDropController { this.PlayerXLRService ); }, + handleDndStateChange: options.handleDndStateChange, }); this.dndWebPlayerPlugin = new PlayerDndPlugin({ @@ -207,59 +216,7 @@ export class DragAndDropController { * This content will be able to run in a player configured with the same plugins loaded into the editor * */ public exportContent(): View { - const baseView = this.runtimeState.view; - - /** Walks the drag and drop state to remove any drop target assets */ - const removeDndStateFromView = (obj: unknown): any => { - if (obj === baseView && isDropTargetAsset(obj)) { - if (obj.value?.asset) { - return removeDndStateFromView(obj.value.asset); - } - - return undefined; - } - - if (Array.isArray(obj)) { - return obj - .map((objectMember) => removeDndStateFromView(objectMember)) - .filter((n) => n !== null && n !== undefined); - } - - if (typeof obj === 'object' && obj !== null) { - if ('asset' in obj) { - const asWrapper: AssetWrapper = obj as any; - if ('asset' in obj && isDropTargetAsset(asWrapper.asset)) { - if (asWrapper.asset.value) { - const nestedValue = removeDndStateFromView( - asWrapper.asset.value.asset - ); - - // eslint-disable-next-line max-depth - if (nestedValue) { - return { - asset: nestedValue, - }; - } - } - - return undefined; - } - } - - return Object.fromEntries( - Object.entries(obj).map(([key, value]) => [ - key, - removeDndStateFromView(value), - ]) - ); - } - - return obj; - }; - - // remove any undefined values from the view - // we only want JSON compliant values - return JSON.parse(JSON.stringify(removeDndStateFromView(baseView))); + return this.runtimeState.exportContent(); } /** diff --git a/drag-and-drop/library/src/utils/runtime-flow-state.ts b/drag-and-drop/library/src/utils/runtime-flow-state.ts index 839f7da5..16956ce6 100644 --- a/drag-and-drop/library/src/utils/runtime-flow-state.ts +++ b/drag-and-drop/library/src/utils/runtime-flow-state.ts @@ -42,6 +42,14 @@ export interface RuntimeFlowStateOptions { type: NamedType; }; + /** + * Function that will be called when Drag and Drop state changes + */ + handleDndStateChange: ( + /** The player content without any drag and drop specific assets */ + content: View + ) => void; + /** * The content to initialize the editing experience with */ @@ -95,11 +103,17 @@ export class RuntimeFlowState { type: NamedType; }; + private handleDndStateChange: ( + /** The player content without any drag and drop specific assets */ + content: View + ) => void; + constructor(options: RuntimeFlowStateOptions) { this.ROOT = makeDropTarget('drag-and-drop-view'); this.dropTargetAssets.set(getAssetSymbol(this.ROOT), this.ROOT); this.resolveRequiredProperties = options.resolveRequiredProperties; this.resolveCollectionConversion = options.resolveCollectionConversion; + this.handleDndStateChange = options.handleDndStateChange; } exportState(): ExportedRuntimeFlowState { @@ -399,6 +413,8 @@ export class RuntimeFlowState { containingDropTarget.value = this.computeViewForDropTarget(containingDropTarget); + + this.handleDndStateChange(this.exportContent()); } public async placeAsset( @@ -457,6 +473,8 @@ export class RuntimeFlowState { // Resolve Arrays in parent this.updateArrayInParent(dropTarget, dropTargetSymbol); + + this.handleDndStateChange(this.exportContent()); } public getAsset(assetSymbol: symbol): { @@ -484,6 +502,8 @@ export class RuntimeFlowState { this.realAssetMappings.delete(assetSymbol); parentDropTarget.value = this.computeViewForDropTarget(parentDropTarget); + + this.handleDndStateChange(this.exportContent()); } makeDropTargetContext( @@ -628,6 +648,62 @@ export class RuntimeFlowState { ); } + exportContent(): View { + const baseView = this.view; + + /** Walks the drag and drop state to remove any drop target assets */ + const removeDndStateFromView = (obj: unknown): any => { + if (obj === baseView && isDropTargetAsset(obj)) { + if (obj.value?.asset) { + return removeDndStateFromView(obj.value.asset); + } + + return undefined; + } + + if (Array.isArray(obj)) { + return obj + .map((objectMember) => removeDndStateFromView(objectMember)) + .filter((n) => n !== null && n !== undefined); + } + + if (typeof obj === 'object' && obj !== null) { + if ('asset' in obj) { + const asWrapper: AssetWrapper = obj as any; + if ('asset' in obj && isDropTargetAsset(asWrapper.asset)) { + if (asWrapper.asset.value) { + const nestedValue = removeDndStateFromView( + asWrapper.asset.value.asset + ); + + // eslint-disable-next-line max-depth + if (nestedValue) { + return { + asset: nestedValue, + }; + } + } + + return undefined; + } + } + + return Object.fromEntries( + Object.entries(obj).map(([key, value]) => [ + key, + removeDndStateFromView(value), + ]) + ); + } + + return obj; + }; + + // remove any undefined values from the view + // we only want JSON compliant values + return JSON.parse(JSON.stringify(removeDndStateFromView(baseView))); + } + get view(): View { return this.ROOT; } From fda15414e5f4c70801c61a3ff6381fff3c838c90 Mon Sep 17 00:00:00 2001 From: Chengli Wang Date: Wed, 22 Feb 2023 11:32:29 -0500 Subject: [PATCH 41/52] fix: Populates placeholder targets when importing existing content --- .../library/src/__tests__/controller.test.tsx | 37 ++++++++ .../library/src/utils/runtime-flow-state.ts | 93 ++++++++++++++----- 2 files changed, 107 insertions(+), 23 deletions(-) diff --git a/drag-and-drop/library/src/__tests__/controller.test.tsx b/drag-and-drop/library/src/__tests__/controller.test.tsx index faf23282..20a1be01 100644 --- a/drag-and-drop/library/src/__tests__/controller.test.tsx +++ b/drag-and-drop/library/src/__tests__/controller.test.tsx @@ -260,4 +260,41 @@ describe('drag-and-drop', () => { expect(collection).not.toBeNull(); expect(collection.type.name).toStrictEqual('CollectionAsset'); }); + + it('Populates placeholder targets when importing existing content', async () => { + // arrange + const content = { + id: 'drag-and-drop-view-collection-1', + type: 'collection', + }; + const dndController = new DragAndDropController({ + playerTypes: typesManifest, + extensions: [referenceAssetExtension], + resolveRequiredProperties: jest.fn(), + resolveCollectionConversion: jest.fn(), + handleDndStateChange: jest.fn(), + }); + const { player } = dndController.webPlayer; + + // act + dndController.importView(content); + /** + * + */ + const getView = () => + (player.getState() as InProgressState).controllers?.view.currentView + ?.lastUpdate; + + // assert + const dndView = getView() || {}; + console.log(dndView); + const { label } = dndView.value.asset; + const { values } = dndView.value.asset; + expect(label.asset.type).toStrictEqual('drop-target'); + expect(label.asset.context.propertyName).toStrictEqual('label'); + expect(label.asset.context.isArrayElement).toStrictEqual(false); + expect(values[0].asset.type).toStrictEqual('drop-target'); + expect(values[0].asset.context.propertyName).toStrictEqual('values'); + expect(values[0].asset.context.isArrayElement).toStrictEqual(true); + }); }); diff --git a/drag-and-drop/library/src/utils/runtime-flow-state.ts b/drag-and-drop/library/src/utils/runtime-flow-state.ts index 16956ce6..02b730ed 100644 --- a/drag-and-drop/library/src/utils/runtime-flow-state.ts +++ b/drag-and-drop/library/src/utils/runtime-flow-state.ts @@ -527,33 +527,38 @@ export class RuntimeFlowState { createDropTarget( xlrService: XLRService, - targetAsset: Asset, + targetAsset?: Asset, dropTargetContext?: DropTargetAssetContext, parentAsset?: Asset ): DropTargetAsset { - const targetAssetType = xlrService.XLRSDK.getType( - targetAsset.type - ) as NamedType; - const { plugin: pluginName } = xlrService.XLRSDK.getTypeInfo( - targetAsset.type - ) as TypeMetadata; - const dropTarget = makeDropTarget(`${targetAsset.id}-dropTarget`); - dropTarget.context = dropTargetContext; - const wrappedTargetAsset: PlacedAsset = { - identifier: { - pluginName, - assetName: targetAssetType.name ?? '', - capability: dropTargetContext ? 'Assets' : 'Views', - }, - type: targetAssetType, - asset: targetAsset, - }; - dropTarget.values?.push(wrappedTargetAsset); + const id = targetAsset + ? `${targetAsset.id}-dropTarget` + : `${parentAsset?.id}-dropTarget`; + const dropTarget = makeDropTarget(id, dropTargetContext); const dropTargetSymbol = getAssetSymbol(dropTarget); - const targetAssetSymbol = getAssetSymbol(targetAsset); this.dropTargetAssets.set(dropTargetSymbol, dropTarget); - this.realAssetMappings.set(targetAssetSymbol, wrappedTargetAsset); - this.assetsToTargets.set(targetAssetSymbol, dropTargetSymbol); + if (targetAsset) { + const targetAssetType = xlrService.XLRSDK.getType( + targetAsset.type + ) as NamedType; + const { plugin: pluginName } = xlrService.XLRSDK.getTypeInfo( + targetAsset.type + ) as TypeMetadata; + const wrappedTargetAsset: PlacedAsset = { + identifier: { + pluginName, + assetName: targetAssetType.name ?? '', + capability: dropTargetContext ? 'Assets' : 'Views', + }, + type: targetAssetType, + asset: targetAsset, + }; + const targetAssetSymbol = getAssetSymbol(targetAsset); + dropTarget.values?.push(wrappedTargetAsset); + this.realAssetMappings.set(targetAssetSymbol, wrappedTargetAsset); + this.assetsToTargets.set(targetAssetSymbol, dropTargetSymbol); + } + if (parentAsset) { this.targetsToAssets.set(dropTargetSymbol, getAssetSymbol(parentAsset)); } @@ -579,6 +584,8 @@ export class RuntimeFlowState { newObj[UUIDSymbol] = Symbol(`${newObj.id}-${newObj.type}`); } + const propsList = Object.keys(newObj); + Object.keys(newObj).forEach((key) => { let isAssetWrapper = false; let isArrayElement = false; @@ -612,7 +619,7 @@ export class RuntimeFlowState { parentAsset ); } else if (typeof obj[key] === 'object') { - newObj[key] = this.addDndStateToAsset( + const targetAsset = this.addDndStateToAsset( obj[key], xlrService, isAssetWrapper @@ -625,10 +632,50 @@ export class RuntimeFlowState { : dropTargetContext, isAssetWrapper ? newObj : parentAsset ); + + if ( + targetAsset && + Array.isArray(targetAsset) && + targetAsset.length === 0 + ) { + propsList.splice(propsList.indexOf(key), 1); + } + + newObj[key] = targetAsset; } else { newObj[key] = obj[key]; } }); + + if (assetType) { + Object.keys(assetType.properties) + .filter((x) => !propsList.includes(x)) + .forEach((key) => { + const { node } = assetType.properties[key]; + if ( + (node.type === 'ref' && node.ref.startsWith('AssetWrapper')) || + (node.type === 'array' && + node.elementType.type === 'ref' && + node.elementType.ref.startsWith('AssetWrapper')) + ) { + const targetAsset = { + asset: this.createDropTarget( + xlrService, + undefined, + this.makeDropTargetContext( + xlrService, + newObj, + key, + node.type === 'array' + ), + newObj + ), + }; + newObj[key] = node.type === 'array' ? [targetAsset] : targetAsset; + } + }); + } + if (Array.isArray(obj)) { newObj.length = obj.length; return Array.from(newObj); From bbdf3fb22bba41c1c574f5cf9cd6ba95670c4399 Mon Sep 17 00:00:00 2001 From: Chengli Wang Date: Thu, 23 Feb 2023 11:29:37 -0500 Subject: [PATCH 42/52] fix: moved removeDndStateFromView to a helper function --- drag-and-drop/library/src/controller.tsx | 6 +- drag-and-drop/library/src/utils/helpers.ts | 54 ++++++++++++- .../library/src/utils/runtime-flow-state.ts | 76 +++---------------- 3 files changed, 67 insertions(+), 69 deletions(-) diff --git a/drag-and-drop/library/src/controller.tsx b/drag-and-drop/library/src/controller.tsx index 36954f0a..b4d93200 100644 --- a/drag-and-drop/library/src/controller.tsx +++ b/drag-and-drop/library/src/controller.tsx @@ -8,14 +8,13 @@ import { XLRService } from '@player-tools/language-service'; import type { TypeMetadata } from '@player-tools/xlr-sdk'; import { PlayerDndPlugin } from './utils'; import type { - DropTargetAsset, ExtensionProvider, ExtensionProviderAssetIdentifier, TransformedDropTargetAssetType, } from './types'; -import { isDropTargetAsset } from './types'; import { RuntimeFlowState } from './utils/runtime-flow-state'; import { DropComponent } from './utils/drop-component'; +import { removeDndStateFromView } from './utils/helpers'; export interface DragAndDropControllerOptions { /** The list of XLR enabled extensions to load as available resources */ @@ -216,11 +215,12 @@ export class DragAndDropController { * This content will be able to run in a player configured with the same plugins loaded into the editor * */ public exportContent(): View { - return this.runtimeState.exportContent(); + return removeDndStateFromView(this.runtimeState.view); } /** * Imports existing content and populates the state of drag and drop + * * @param view - player content */ public importView(view: View) { diff --git a/drag-and-drop/library/src/utils/helpers.ts b/drag-and-drop/library/src/utils/helpers.ts index 084ec13f..84b9c468 100644 --- a/drag-and-drop/library/src/utils/helpers.ts +++ b/drag-and-drop/library/src/utils/helpers.ts @@ -1,6 +1,6 @@ -import type { Asset } from '@player-ui/types'; +import type { Asset, AssetWrapper, View } from '@player-ui/types'; import type { DropTargetAsset, DropTargetAssetContext } from '../types'; -import { DragAndDropAssetType, UUIDSymbol } from '../types'; +import { UUIDSymbol, DragAndDropAssetType, isDropTargetAsset } from '../types'; /** Creates a drop target asset */ export const makeDropTarget = ( @@ -22,3 +22,53 @@ export const makeDropTarget = ( export const getAssetSymbol = (asset: Asset): symbol => { return (asset as any)[UUIDSymbol]; }; + +/** remove the drag and drop state from the view */ +export const removeDndStateFromView = (baseView: View): View => { + /** Walks the drag and drop state to remove any drop target assets */ + const removeDndState = (obj: unknown): any => { + if (obj === baseView && isDropTargetAsset(obj)) { + if (obj.value?.asset) { + return removeDndState(obj.value.asset); + } + + return undefined; + } + + if (Array.isArray(obj)) { + return obj + .map((objectMember) => removeDndState(objectMember)) + .filter((n) => n !== null && n !== undefined); + } + + if (typeof obj === 'object' && obj !== null) { + if ('asset' in obj) { + const asWrapper: AssetWrapper = obj as any; + if ('asset' in obj && isDropTargetAsset(asWrapper.asset)) { + if (asWrapper.asset.value) { + const nestedValue = removeDndState(asWrapper.asset.value.asset); + + // eslint-disable-next-line max-depth + if (nestedValue) { + return { + asset: nestedValue, + }; + } + } + + return undefined; + } + } + + return Object.fromEntries( + Object.entries(obj).map(([key, value]) => [key, removeDndState(value)]) + ); + } + + return obj; + }; + + // remove any undefined values from the view + // we only want JSON compliant values + return JSON.parse(JSON.stringify(removeDndState(baseView))); +}; diff --git a/drag-and-drop/library/src/utils/runtime-flow-state.ts b/drag-and-drop/library/src/utils/runtime-flow-state.ts index 02b730ed..377cde16 100644 --- a/drag-and-drop/library/src/utils/runtime-flow-state.ts +++ b/drag-and-drop/library/src/utils/runtime-flow-state.ts @@ -10,7 +10,11 @@ import type { DropTargetAssetContext, } from '../types'; import { UUIDSymbol } from '../types'; -import { makeDropTarget, getAssetSymbol } from './helpers'; +import { + makeDropTarget, + getAssetSymbol, + removeDndStateFromView, +} from './helpers'; import { isDropTargetAsset } from '../types'; /** The type for exporting and restoring the flow state */ @@ -414,7 +418,7 @@ export class RuntimeFlowState { containingDropTarget.value = this.computeViewForDropTarget(containingDropTarget); - this.handleDndStateChange(this.exportContent()); + this.handleDndStateChange(removeDndStateFromView(this.view)); } public async placeAsset( @@ -474,7 +478,7 @@ export class RuntimeFlowState { // Resolve Arrays in parent this.updateArrayInParent(dropTarget, dropTargetSymbol); - this.handleDndStateChange(this.exportContent()); + this.handleDndStateChange(removeDndStateFromView(this.view)); } public getAsset(assetSymbol: symbol): { @@ -503,10 +507,10 @@ export class RuntimeFlowState { this.realAssetMappings.delete(assetSymbol); parentDropTarget.value = this.computeViewForDropTarget(parentDropTarget); - this.handleDndStateChange(this.exportContent()); + this.handleDndStateChange(removeDndStateFromView(this.view)); } - makeDropTargetContext( + private makeDropTargetContext( xlrService: XLRService, parent: Asset, propertyName: string, @@ -525,7 +529,7 @@ export class RuntimeFlowState { }; } - createDropTarget( + private createDropTarget( xlrService: XLRService, targetAsset?: Asset, dropTargetContext?: DropTargetAssetContext, @@ -568,7 +572,7 @@ export class RuntimeFlowState { return dropTarget; } - addDndStateToAsset( + private addDndStateToAsset( obj: any, xlrService: XLRService, dropTargetContext?: DropTargetAssetContext, @@ -684,7 +688,7 @@ export class RuntimeFlowState { return newObj; } - importView(view: View, xlrService: XLRService) { + public importView(view: View, xlrService: XLRService) { this.realAssetMappings.clear(); this.dropTargetAssets.clear(); this.assetsToTargets.clear(); @@ -695,62 +699,6 @@ export class RuntimeFlowState { ); } - exportContent(): View { - const baseView = this.view; - - /** Walks the drag and drop state to remove any drop target assets */ - const removeDndStateFromView = (obj: unknown): any => { - if (obj === baseView && isDropTargetAsset(obj)) { - if (obj.value?.asset) { - return removeDndStateFromView(obj.value.asset); - } - - return undefined; - } - - if (Array.isArray(obj)) { - return obj - .map((objectMember) => removeDndStateFromView(objectMember)) - .filter((n) => n !== null && n !== undefined); - } - - if (typeof obj === 'object' && obj !== null) { - if ('asset' in obj) { - const asWrapper: AssetWrapper = obj as any; - if ('asset' in obj && isDropTargetAsset(asWrapper.asset)) { - if (asWrapper.asset.value) { - const nestedValue = removeDndStateFromView( - asWrapper.asset.value.asset - ); - - // eslint-disable-next-line max-depth - if (nestedValue) { - return { - asset: nestedValue, - }; - } - } - - return undefined; - } - } - - return Object.fromEntries( - Object.entries(obj).map(([key, value]) => [ - key, - removeDndStateFromView(value), - ]) - ); - } - - return obj; - }; - - // remove any undefined values from the view - // we only want JSON compliant values - return JSON.parse(JSON.stringify(removeDndStateFromView(baseView))); - } - get view(): View { return this.ROOT; } From 50b36f1250157d58b127b4d9458cbf5384f65fc7 Mon Sep 17 00:00:00 2001 From: sandrews06 Date: Mon, 27 Feb 2023 14:17:40 -0500 Subject: [PATCH 43/52] feat: added ability to add player plugins that don't have a manifest in dnd library (#47) * feat: added ability to add player plugins that don't have a manifest in dnd library --------- Co-authored-by: Shawn Andrews --- drag-and-drop/app/pages/index.tsx | 8 ++------ .../library/src/__tests__/controller.test.tsx | 17 ++++++++--------- drag-and-drop/library/src/controller.tsx | 17 +++++++++-------- drag-and-drop/library/src/types.ts | 9 ++------- 4 files changed, 21 insertions(+), 30 deletions(-) diff --git a/drag-and-drop/app/pages/index.tsx b/drag-and-drop/app/pages/index.tsx index 5f16cb8f..b0300f9a 100644 --- a/drag-and-drop/app/pages/index.tsx +++ b/drag-and-drop/app/pages/index.tsx @@ -573,12 +573,8 @@ const App = () => { const config: DragAndDropControllerOptions = { Component: AssetDropTarget, playerTypes: typesManifest as TSManifest, - extensions: [ - { - plugin: ReferenceAssetsPlugin, - manifest: pluginManifest as TSManifest, - }, - ], + manifests: [pluginManifest as TSManifest], + plugins: [ReferenceAssetsPlugin], async resolveRequiredProperties( asset: Asset, type: ObjectType diff --git a/drag-and-drop/library/src/__tests__/controller.test.tsx b/drag-and-drop/library/src/__tests__/controller.test.tsx index 20a1be01..0d054772 100644 --- a/drag-and-drop/library/src/__tests__/controller.test.tsx +++ b/drag-and-drop/library/src/__tests__/controller.test.tsx @@ -4,14 +4,10 @@ import pluginManifest from '@player-tools/static-xlrs/static_xlrs/plugin/xlr/man import typesManifest from '@player-tools/static-xlrs/static_xlrs/core/xlr/manifest'; import type { ObjectType } from '@player-tools/xlr'; import { DragAndDropController } from '../controller'; -import type { - DropTargetAsset, - DropTargetAssetContext, - ExtensionProvider, -} from '../types'; +import type { DropTargetAsset, DropTargetAssetContext } from '../types'; import { getAssetSymbol } from '../utils/helpers'; -const referenceAssetExtension: ExtensionProvider = { +const referenceAssetExtension = { plugin: class test { name = 'test'; }, @@ -23,7 +19,8 @@ describe('drag-and-drop', () => { const mockHandleStateChange = jest.fn(); const dndController = new DragAndDropController({ playerTypes: typesManifest, - extensions: [referenceAssetExtension], + manifests: [referenceAssetExtension.manifest], + plugins: [referenceAssetExtension.plugin], resolveRequiredProperties: async ( asset: Asset, type: ObjectType @@ -202,7 +199,8 @@ describe('drag-and-drop', () => { }; const dndController = new DragAndDropController({ playerTypes: typesManifest, - extensions: [referenceAssetExtension], + manifests: [referenceAssetExtension.manifest], + plugins: [referenceAssetExtension.plugin], resolveRequiredProperties: jest.fn(), resolveCollectionConversion: jest.fn(), handleDndStateChange: jest.fn(), @@ -269,7 +267,8 @@ describe('drag-and-drop', () => { }; const dndController = new DragAndDropController({ playerTypes: typesManifest, - extensions: [referenceAssetExtension], + manifests: [referenceAssetExtension.manifest], + plugins: [referenceAssetExtension.plugin], resolveRequiredProperties: jest.fn(), resolveCollectionConversion: jest.fn(), handleDndStateChange: jest.fn(), diff --git a/drag-and-drop/library/src/controller.tsx b/drag-and-drop/library/src/controller.tsx index b4d93200..62481041 100644 --- a/drag-and-drop/library/src/controller.tsx +++ b/drag-and-drop/library/src/controller.tsx @@ -8,8 +8,8 @@ import { XLRService } from '@player-tools/language-service'; import type { TypeMetadata } from '@player-tools/xlr-sdk'; import { PlayerDndPlugin } from './utils'; import type { - ExtensionProvider, ExtensionProviderAssetIdentifier, + PluginProvider, TransformedDropTargetAssetType, } from './types'; import { RuntimeFlowState } from './utils/runtime-flow-state'; @@ -17,8 +17,11 @@ import { DropComponent } from './utils/drop-component'; import { removeDndStateFromView } from './utils/helpers'; export interface DragAndDropControllerOptions { - /** The list of XLR enabled extensions to load as available resources */ - extensions?: Array; + /** Player plugins for adding assets and functionality */ + plugins?: Array; + + /** Manifest for extensions that have drag and drop assets */ + manifests?: Array; /** Manifest for the base Player types package to use */ playerTypes: TSManifest; @@ -82,10 +85,8 @@ export class DragAndDropController { this.PlayerXLRService = new XLRService(); this.PlayerXLRService.XLRSDK.loadDefinitionsFromModule(options.playerTypes); - options?.extensions?.forEach((extension) => { - this.PlayerXLRService.XLRSDK.loadDefinitionsFromModule( - extension.manifest - ); + options?.manifests?.forEach((manifest) => { + this.PlayerXLRService.XLRSDK.loadDefinitionsFromModule(manifest); }); this.runtimeState = new RuntimeFlowState({ @@ -128,7 +129,7 @@ export class DragAndDropController { plugins: [ this.dndWebPlayerPlugin, // eslint-disable-next-line new-cap - ...(options?.extensions ?? []).map((e) => new e.plugin()), + ...(options?.plugins ?? []).map((e) => new e()), ], }); diff --git a/drag-and-drop/library/src/types.ts b/drag-and-drop/library/src/types.ts index 3b833a1a..12faa0f4 100644 --- a/drag-and-drop/library/src/types.ts +++ b/drag-and-drop/library/src/types.ts @@ -13,14 +13,9 @@ export type FlowWithOneView = Flow & { views: [View]; }; -export interface ExtensionProvider { +export interface PluginProvider { /** A constructor to create an instance of the plugin */ - plugin: { - new (): ReactPlayerPlugin; - }; - - /** A manifest describing the plugins capabilities */ - manifest: TSManifest; + new (): ReactPlayerPlugin; } export interface ExtensionProviderAssetIdentifier { From e12d2c6151194df919fb0863ddccb90273e2a589 Mon Sep 17 00:00:00 2001 From: Ketan Reddy Date: Mon, 27 Feb 2023 16:36:17 -0600 Subject: [PATCH 44/52] maintenance: move testing helpers into shared local package --- drag-and-drop/library/BUILD | 2 +- .../library/src/__tests__/controller.test.tsx | 2 +- drag-and-drop/library/src/controller.tsx | 2 +- .../library/src/utils/runtime-flow-state.ts | 2 +- xlr/converters/BUILD | 4 +- xlr/converters/src/__tests__/player.test.ts | 2 +- .../src/__tests__/ts-to-common.test.ts | 2 +- xlr/testing-utils/BUILD | 13 +++++++ xlr/testing-utils/src/index.ts | 1 + .../src}/test-helpers.ts | 0 xlr/utils/BUILD | 3 ++ xlr/utils/src/__tests__/annotations.test.ts | 2 +- .../src/__tests__/helpers/test-helpers.ts | 38 ------------------- 13 files changed, 27 insertions(+), 46 deletions(-) create mode 100644 xlr/testing-utils/BUILD create mode 100644 xlr/testing-utils/src/index.ts rename xlr/{converters/src/__tests__/helpers => testing-utils/src}/test-helpers.ts (100%) delete mode 100644 xlr/utils/src/__tests__/helpers/test-helpers.ts diff --git a/drag-and-drop/library/BUILD b/drag-and-drop/library/BUILD index 74a92801..27f6a6f0 100644 --- a/drag-and-drop/library/BUILD +++ b/drag-and-drop/library/BUILD @@ -4,7 +4,7 @@ javascript_pipeline( name = "@player-tools/dnd-lib", dependencies = [ "//xlr/types:@player-tools/xlr", - "//language/service:@player-tools/language-service", + "//language/json-language-service:@player-tools/json-language-service", "@npm//@player-ui/react", "@npm//react-dnd", "@npm//react-dnd-html5-backend", diff --git a/drag-and-drop/library/src/__tests__/controller.test.tsx b/drag-and-drop/library/src/__tests__/controller.test.tsx index 0d054772..31becb5b 100644 --- a/drag-and-drop/library/src/__tests__/controller.test.tsx +++ b/drag-and-drop/library/src/__tests__/controller.test.tsx @@ -220,7 +220,7 @@ describe('drag-and-drop', () => { const dndView = getView() || {}; expect(dndView.type).toStrictEqual('drop-target'); expect(dndView.value.identifier.pluginName).toStrictEqual( - 'BaseAssetsPlugin' + 'reference-assets-web-plugin' ); expect(dndView.value.identifier.assetName).toStrictEqual('CollectionAsset'); expect(dndView.value.identifier.capability).toStrictEqual('Views'); diff --git a/drag-and-drop/library/src/controller.tsx b/drag-and-drop/library/src/controller.tsx index 62481041..71ec1d6b 100644 --- a/drag-and-drop/library/src/controller.tsx +++ b/drag-and-drop/library/src/controller.tsx @@ -4,7 +4,7 @@ import { ConsoleLogger, WebPlayer } from '@player-ui/react'; import { DndProvider } from 'react-dnd'; import { HTML5Backend } from 'react-dnd-html5-backend'; import type { NamedType, ObjectType, TSManifest } from '@player-tools/xlr'; -import { XLRService } from '@player-tools/language-service'; +import { XLRService } from '@player-tools/json-language-service'; import type { TypeMetadata } from '@player-tools/xlr-sdk'; import { PlayerDndPlugin } from './utils'; import type { diff --git a/drag-and-drop/library/src/utils/runtime-flow-state.ts b/drag-and-drop/library/src/utils/runtime-flow-state.ts index 377cde16..deb2381f 100644 --- a/drag-and-drop/library/src/utils/runtime-flow-state.ts +++ b/drag-and-drop/library/src/utils/runtime-flow-state.ts @@ -1,5 +1,5 @@ import type { NamedType, ObjectType } from '@player-tools/xlr'; -import type { XLRService } from '@player-tools/language-service'; +import type { XLRService } from '@player-tools/json-language-service'; import type { TypeMetadata } from '@player-tools/xlr-sdk'; import type { Asset, AssetWrapper, Flow, View } from '@player-ui/types'; import type { diff --git a/xlr/converters/BUILD b/xlr/converters/BUILD index 163328f5..714a72c7 100644 --- a/xlr/converters/BUILD +++ b/xlr/converters/BUILD @@ -6,9 +6,11 @@ javascript_pipeline( dependencies = [ "//xlr/types:@player-tools/xlr", "//xlr/utils:@player-tools/xlr-utils", - "@npm//@typescript/vfs", ], peer_dependencies = [ "@npm//typescript" + ], + test_data = [ + "//xlr/testing-utils:@player-tools/xlr-testing-utils" ] ) \ No newline at end of file diff --git a/xlr/converters/src/__tests__/player.test.ts b/xlr/converters/src/__tests__/player.test.ts index 43484a4f..59fb3c9e 100644 --- a/xlr/converters/src/__tests__/player.test.ts +++ b/xlr/converters/src/__tests__/player.test.ts @@ -1,4 +1,4 @@ -import { setupTestEnv } from './helpers/test-helpers'; +import { setupTestEnv } from '@player-tools/xlr-testing-utils'; import { TsConverter } from '..'; it('Player Types Export', () => { diff --git a/xlr/converters/src/__tests__/ts-to-common.test.ts b/xlr/converters/src/__tests__/ts-to-common.test.ts index d0f47e85..00353533 100644 --- a/xlr/converters/src/__tests__/ts-to-common.test.ts +++ b/xlr/converters/src/__tests__/ts-to-common.test.ts @@ -1,5 +1,5 @@ /* eslint-disable no-template-curly-in-string */ -import { setupTestEnv } from './helpers/test-helpers'; +import { setupTestEnv } from '@player-tools/xlr-testing-utils'; import { TsConverter } from '..'; describe('Type Exports', () => { diff --git a/xlr/testing-utils/BUILD b/xlr/testing-utils/BUILD new file mode 100644 index 00000000..f77f0422 --- /dev/null +++ b/xlr/testing-utils/BUILD @@ -0,0 +1,13 @@ + +load("//:index.bzl", "javascript_pipeline") + +javascript_pipeline( + name = "@player-tools/xlr-testing-utils", + dependencies = [ + ], + peer_dependencies = [ + "@npm//typescript", + "@npm//@typescript/vfs" + ], + private = True +) \ No newline at end of file diff --git a/xlr/testing-utils/src/index.ts b/xlr/testing-utils/src/index.ts new file mode 100644 index 00000000..accd3a28 --- /dev/null +++ b/xlr/testing-utils/src/index.ts @@ -0,0 +1 @@ +export * from './test-helpers'; diff --git a/xlr/converters/src/__tests__/helpers/test-helpers.ts b/xlr/testing-utils/src/test-helpers.ts similarity index 100% rename from xlr/converters/src/__tests__/helpers/test-helpers.ts rename to xlr/testing-utils/src/test-helpers.ts diff --git a/xlr/utils/BUILD b/xlr/utils/BUILD index dbf1d4a5..e664d26c 100644 --- a/xlr/utils/BUILD +++ b/xlr/utils/BUILD @@ -10,5 +10,8 @@ javascript_pipeline( peer_dependencies = [ "@npm//typescript", "@npm//jsonc-parser" + ], + test_data = [ + "//xlr/testing-utils:@player-tools/xlr-testing-utils" ] ) \ No newline at end of file diff --git a/xlr/utils/src/__tests__/annotations.test.ts b/xlr/utils/src/__tests__/annotations.test.ts index 881b7b7b..d4c8af01 100644 --- a/xlr/utils/src/__tests__/annotations.test.ts +++ b/xlr/utils/src/__tests__/annotations.test.ts @@ -1,4 +1,4 @@ -import { setupTestEnv } from './helpers/test-helpers'; +import { setupTestEnv } from '@player-tools/xlr-testing-utils'; import { decorateNode } from '../annotations'; describe('Annotations', () => { diff --git a/xlr/utils/src/__tests__/helpers/test-helpers.ts b/xlr/utils/src/__tests__/helpers/test-helpers.ts deleted file mode 100644 index d131766a..00000000 --- a/xlr/utils/src/__tests__/helpers/test-helpers.ts +++ /dev/null @@ -1,38 +0,0 @@ -import * as ts from 'typescript'; -import * as tsvfs from '@typescript/vfs'; - -export interface SetupReturnType { - /** - * Virtual source file containing the passed in text - */ - sf: ts.SourceFile; - /** - * Type checker for the virtual program - */ - tc: ts.TypeChecker; -} - -/** - * Setups a virtual TS environment for tests - */ -export function setupTestEnv(sourceCode: string, mockFileName = 'filename.ts') { - const fsMap = tsvfs.createDefaultMapFromNodeModules({}, ts); - fsMap.set(mockFileName, sourceCode); - - const system = tsvfs.createSystem(fsMap); - const host = tsvfs.createVirtualCompilerHost(system, {}, ts); - - const program = ts.createProgram({ - rootNames: [...fsMap.keys()], - options: {}, - host: host.compilerHost, - }); - - return { - sf: host.compilerHost.getSourceFile( - mockFileName, - ts.ScriptTarget.ES5 - ) as ts.SourceFile, - tc: program.getTypeChecker(), - }; -} From 9d63cb366dddc5f99d8236f374254790a56ca54d Mon Sep 17 00:00:00 2001 From: Ketan Reddy Date: Mon, 27 Feb 2023 16:52:24 -0600 Subject: [PATCH 45/52] move xlr deserialization out of sdk and in to cli --- cli/src/commands/xlr/convert.ts | 85 +++++++++++++++++++++++++++++++-- xlr/sdk/BUILD | 3 -- xlr/sdk/src/sdk.ts | 81 +------------------------------ 3 files changed, 84 insertions(+), 85 deletions(-) diff --git a/cli/src/commands/xlr/convert.ts b/cli/src/commands/xlr/convert.ts index 52b40c4d..eebe4903 100644 --- a/cli/src/commands/xlr/convert.ts +++ b/cli/src/commands/xlr/convert.ts @@ -1,11 +1,15 @@ import { Flags } from '@oclif/core'; import path from 'path'; import fs from 'fs'; +import ts from 'typescript'; import chalk from 'chalk'; import type { ExportTypes } from '@player-tools/xlr-sdk'; import { XLRSDK } from '@player-tools/xlr-sdk'; import logSymbols from 'log-symbols'; +import type { NamedType } from '@player-tools/xlr'; import { BaseCommand } from '../../utils/base-command'; +import { TopLevelDeclaration } from '@player-tools/xlr-utils'; +import { TSWriter } from '@player-tools/xlr-converters'; const PlayerImportMap = new Map([ [ @@ -39,6 +43,8 @@ export default class XLRConvert extends BaseCommand { }), }; + private tsWriter = new TSWriter(); + private async getOptions() { const { flags } = await this.parse(XLRConvert); @@ -51,7 +57,7 @@ export default class XLRConvert extends BaseCommand { const language = flags.lang as ExportTypes; if (!language) { - throw new Error(`Need to specifiy lanauge to export to`); + throw new Error(`Need to specify language to export to`); } return { @@ -61,6 +67,71 @@ export default class XLRConvert extends BaseCommand { }; } + private exportToTypeScript( + typesToExport: NamedType[], + importMap: Map + ): string { + const referencedImports: Set = new Set(); + const exportedTypes: Map = new Map(); + const printer = ts.createPrinter({ newLine: ts.NewLineKind.LineFeed }); + + let resultFile = ts.createSourceFile( + 'output.d.ts', + '', + ts.ScriptTarget.ES2017, + false, // setParentNodes + ts.ScriptKind.TS + ); + + typesToExport.forEach((typeNode) => { + const { type, referencedTypes, additionalTypes } = + this.tsWriter.convertNamedType(typeNode); + exportedTypes.set(typeNode.name, type); + additionalTypes?.forEach((additionalType, name) => + exportedTypes.set(name, additionalType) + ); + referencedTypes?.forEach((referencedType) => + referencedImports.add(referencedType) + ); + }); + + const typesToPrint: Array = []; + + exportedTypes.forEach((type) => + typesToPrint.push( + printer.printNode(ts.EmitHint.Unspecified, type, resultFile) + ) + ); + + importMap.forEach((imports, packageName) => { + const applicableImports = imports.filter((i) => referencedImports.has(i)); + resultFile = ts.factory.updateSourceFile(resultFile, [ + ts.factory.createImportDeclaration( + /* modifiers */ undefined, + ts.factory.createImportClause( + false, + undefined, + ts.factory.createNamedImports( + applicableImports.map((i) => + ts.factory.createImportSpecifier( + false, + undefined, + ts.factory.createIdentifier(i) + ) + ) + ) + ), + ts.factory.createStringLiteral(packageName) + ), + ...resultFile.statements, + ]); + }); + + const headerText = printer.printFile(resultFile); + const nodeText = typesToPrint.join('\n'); + return `${headerText}\n${nodeText}`; + } + async run(): Promise<{ /** the status code */ exitCode: number; @@ -73,8 +144,16 @@ export default class XLRConvert extends BaseCommand { const sdk = new XLRSDK(); sdk.loadDefinitionsFromDisk(inputPath); - const files = sdk.exportRegistry(language, PlayerImportMap); - files.forEach(([filename, fileContents]) => { + const types = sdk.exportRegistry(); + let writtenFiles; + if (language === 'TypeScript') { + const outputString = this.exportToTypeScript(types, PlayerImportMap); + writtenFiles = [['out.d.ts', outputString]]; + } else { + throw new Error(`Unknown export format ${language}`); + } + + writtenFiles.forEach(([filename, fileContents]) => { fs.writeFileSync(path.join(outputDir, filename), fileContents, {}); }); } catch (e: any) { diff --git a/xlr/sdk/BUILD b/xlr/sdk/BUILD index cce24a1b..8bba791a 100644 --- a/xlr/sdk/BUILD +++ b/xlr/sdk/BUILD @@ -12,9 +12,6 @@ javascript_pipeline( "@npm//@types/fs-extra", "@npm//fs-extra", ], - peer_dependencies = [ - "@npm//typescript" - ], test_data = [ "//common:@player-tools/static-xlrs", ] diff --git a/xlr/sdk/src/sdk.ts b/xlr/sdk/src/sdk.ts index 0a36659c..16880902 100644 --- a/xlr/sdk/src/sdk.ts +++ b/xlr/sdk/src/sdk.ts @@ -6,7 +6,6 @@ import type { TransformFunction, TSManifest, } from '@player-tools/xlr'; -import type { TopLevelDeclaration } from '@player-tools/xlr-utils'; import { computeEffectiveObject, resolveReferenceNode, @@ -35,12 +34,10 @@ export interface GetTypeOptions { export class XLRSDK { private registry: XLRRegistry; private validator: XLRValidator; - private tsWriter: TSWriter; constructor(customRegistry?: XLRRegistry) { this.registry = customRegistry ?? new BasicXLRRegistry(); this.validator = new XLRValidator(this.getType.bind(this)); - this.tsWriter = new TSWriter(); } /** @@ -223,18 +220,14 @@ export class XLRSDK { /** * Exports the types loaded into the registry to the specified format * - * @param exportType - what format to export as - * @param importMap - a map of primitive packages to types exported from that package to add import statements * @param filters - filter out plugins/capabilities/types you don't want to export * @param transforms - transforms to apply to types before exporting them * @returns [filename, content][] - Tuples of filenames and content to write */ public exportRegistry( - exportType: ExportTypes, - importMap: Map, filters?: Filters, transforms?: Array - ): [string, string][] { + ): Array> { const typesToExport = this.registry.list(filters).map((type) => { const resolvedType = this.resolveType(type); const effectiveType = @@ -250,12 +243,7 @@ export class XLRSDK { return effectiveType; }); - if (exportType === 'TypeScript') { - const outputString = this.exportToTypeScript(typesToExport, importMap); - return [['out.d.ts', outputString]]; - } - - throw new Error(`Unknown export format ${exportType}`); + return typesToExport; } private resolveType(type: NodeType) { @@ -287,69 +275,4 @@ export class XLRSDK { return objectNode; })(type, 'any') as NamedType; } - - private exportToTypeScript( - typesToExport: NamedType[], - importMap: Map - ): string { - const referencedImports: Set = new Set(); - const exportedTypes: Map = new Map(); - const printer = ts.createPrinter({ newLine: ts.NewLineKind.LineFeed }); - - let resultFile = ts.createSourceFile( - 'output.d.ts', - '', - ts.ScriptTarget.ES2017, - false, // setParentNodes - ts.ScriptKind.TS - ); - - typesToExport.forEach((typeNode) => { - const { type, referencedTypes, additionalTypes } = - this.tsWriter.convertNamedType(typeNode); - exportedTypes.set(typeNode.name, type); - additionalTypes?.forEach((additionalType, name) => - exportedTypes.set(name, additionalType) - ); - referencedTypes?.forEach((referencedType) => - referencedImports.add(referencedType) - ); - }); - - const typesToPrint: Array = []; - - exportedTypes.forEach((type) => - typesToPrint.push( - printer.printNode(ts.EmitHint.Unspecified, type, resultFile) - ) - ); - - importMap.forEach((imports, packageName) => { - const applicableImports = imports.filter((i) => referencedImports.has(i)); - resultFile = ts.factory.updateSourceFile(resultFile, [ - ts.factory.createImportDeclaration( - /* modifiers */ undefined, - ts.factory.createImportClause( - false, - undefined, - ts.factory.createNamedImports( - applicableImports.map((i) => - ts.factory.createImportSpecifier( - false, - undefined, - ts.factory.createIdentifier(i) - ) - ) - ) - ), - ts.factory.createStringLiteral(packageName) - ), - ...resultFile.statements, - ]); - }); - - const headerText = printer.printFile(resultFile); - const nodeText = typesToPrint.join('\n'); - return `${headerText}\n${nodeText}`; - } } From 642c295b3afcf6ba300d21c8bdcefe99dada4902 Mon Sep 17 00:00:00 2001 From: Ketan Reddy Date: Fri, 3 Mar 2023 14:51:24 -0600 Subject: [PATCH 46/52] Run standard player transforms on XLR import --- drag-and-drop/library/src/controller.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drag-and-drop/library/src/controller.tsx b/drag-and-drop/library/src/controller.tsx index 71ec1d6b..456e0768 100644 --- a/drag-and-drop/library/src/controller.tsx +++ b/drag-and-drop/library/src/controller.tsx @@ -4,7 +4,7 @@ import { ConsoleLogger, WebPlayer } from '@player-ui/react'; import { DndProvider } from 'react-dnd'; import { HTML5Backend } from 'react-dnd-html5-backend'; import type { NamedType, ObjectType, TSManifest } from '@player-tools/xlr'; -import { XLRService } from '@player-tools/json-language-service'; +import { TRANSFORM_FUNCTIONS, XLRService } from '@player-tools/json-language-service'; import type { TypeMetadata } from '@player-tools/xlr-sdk'; import { PlayerDndPlugin } from './utils'; import type { @@ -86,7 +86,11 @@ export class DragAndDropController { this.PlayerXLRService = new XLRService(); this.PlayerXLRService.XLRSDK.loadDefinitionsFromModule(options.playerTypes); options?.manifests?.forEach((manifest) => { - this.PlayerXLRService.XLRSDK.loadDefinitionsFromModule(manifest); + this.PlayerXLRService.XLRSDK.loadDefinitionsFromModule( + manifest, + {}, + TRANSFORM_FUNCTIONS + ); }); this.runtimeState = new RuntimeFlowState({ From 4ee940e55b0a997e8f5d4928f3b6e6f7c96a72cd Mon Sep 17 00:00:00 2001 From: Ketan Reddy Date: Wed, 8 Mar 2023 21:16:02 -0800 Subject: [PATCH 47/52] Add APIs for more operations, expose subscribe function --- cli/src/commands/xlr/convert.ts | 4 +- drag-and-drop/app/pages/index.tsx | 2 +- drag-and-drop/library/BUILD | 1 + .../library/src/__tests__/controller.test.tsx | 29 +- drag-and-drop/library/src/controller.tsx | 102 +- .../library/src/utils/runtime-flow-state.ts | 110 +- package.json | 1 + .../__tests__/__snapshots__/sdk.test.ts.snap | 15656 ++++++++++++++-- xlr/sdk/src/__tests__/sdk.test.ts | 45 +- 9 files changed, 14470 insertions(+), 1480 deletions(-) diff --git a/cli/src/commands/xlr/convert.ts b/cli/src/commands/xlr/convert.ts index eebe4903..357285d9 100644 --- a/cli/src/commands/xlr/convert.ts +++ b/cli/src/commands/xlr/convert.ts @@ -7,9 +7,9 @@ import type { ExportTypes } from '@player-tools/xlr-sdk'; import { XLRSDK } from '@player-tools/xlr-sdk'; import logSymbols from 'log-symbols'; import type { NamedType } from '@player-tools/xlr'; -import { BaseCommand } from '../../utils/base-command'; -import { TopLevelDeclaration } from '@player-tools/xlr-utils'; +import type { TopLevelDeclaration } from '@player-tools/xlr-utils'; import { TSWriter } from '@player-tools/xlr-converters'; +import { BaseCommand } from '../../utils/base-command'; const PlayerImportMap = new Map([ [ diff --git a/drag-and-drop/app/pages/index.tsx b/drag-and-drop/app/pages/index.tsx index b0300f9a..869a36a8 100644 --- a/drag-and-drop/app/pages/index.tsx +++ b/drag-and-drop/app/pages/index.tsx @@ -593,7 +593,7 @@ const App = () => { return prom; }, resolveCollectionConversion(assets, XLRSDK) { - const collectionType = XLRSDK.XLRSDK.getType('collection'); + const collectionType = XLRSDK.getType('collection'); return { asset: { id: `autogen-collection`, diff --git a/drag-and-drop/library/BUILD b/drag-and-drop/library/BUILD index 27f6a6f0..75ef3f2c 100644 --- a/drag-and-drop/library/BUILD +++ b/drag-and-drop/library/BUILD @@ -6,6 +6,7 @@ javascript_pipeline( "//xlr/types:@player-tools/xlr", "//language/json-language-service:@player-tools/json-language-service", "@npm//@player-ui/react", + "@npm//@player-ui/react-subscribe", "@npm//react-dnd", "@npm//react-dnd-html5-backend", ], diff --git a/drag-and-drop/library/src/__tests__/controller.test.tsx b/drag-and-drop/library/src/__tests__/controller.test.tsx index 31becb5b..1e8d2914 100644 --- a/drag-and-drop/library/src/__tests__/controller.test.tsx +++ b/drag-and-drop/library/src/__tests__/controller.test.tsx @@ -7,20 +7,12 @@ import { DragAndDropController } from '../controller'; import type { DropTargetAsset, DropTargetAssetContext } from '../types'; import { getAssetSymbol } from '../utils/helpers'; -const referenceAssetExtension = { - plugin: class test { - name = 'test'; - }, - manifest: pluginManifest as any, -}; - describe('drag-and-drop', () => { it('Fills in placeholder assets when dropped', async () => { const mockHandleStateChange = jest.fn(); const dndController = new DragAndDropController({ playerTypes: typesManifest, - manifests: [referenceAssetExtension.manifest], - plugins: [referenceAssetExtension.plugin], + manifests: [pluginManifest], resolveRequiredProperties: async ( asset: Asset, type: ObjectType @@ -121,17 +113,7 @@ describe('drag-and-drop', () => { } `); - expect(mockHandleStateChange).toBeCalledWith({ - actions: [], - id: 'drag-and-drop-view-info', - title: { - asset: { - id: 'drag-and-drop-view-title-text', - type: 'text', - }, - }, - type: 'info', - }); + expect(mockHandleStateChange).toBeCalled(); }); it('Import existing content into drag and drop', async () => { @@ -199,8 +181,7 @@ describe('drag-and-drop', () => { }; const dndController = new DragAndDropController({ playerTypes: typesManifest, - manifests: [referenceAssetExtension.manifest], - plugins: [referenceAssetExtension.plugin], + manifests: [pluginManifest], resolveRequiredProperties: jest.fn(), resolveCollectionConversion: jest.fn(), handleDndStateChange: jest.fn(), @@ -267,8 +248,8 @@ describe('drag-and-drop', () => { }; const dndController = new DragAndDropController({ playerTypes: typesManifest, - manifests: [referenceAssetExtension.manifest], - plugins: [referenceAssetExtension.plugin], + manifests: [pluginManifest], + plugins: [pluginManifest], resolveRequiredProperties: jest.fn(), resolveCollectionConversion: jest.fn(), handleDndStateChange: jest.fn(), diff --git a/drag-and-drop/library/src/controller.tsx b/drag-and-drop/library/src/controller.tsx index 456e0768..35575476 100644 --- a/drag-and-drop/library/src/controller.tsx +++ b/drag-and-drop/library/src/controller.tsx @@ -1,15 +1,21 @@ import React from 'react'; import type { Asset, AssetWrapper, ReactPlayer, View } from '@player-ui/react'; +import type { DataModel, Navigation, Schema } from '@player-ui/player'; import { ConsoleLogger, WebPlayer } from '@player-ui/react'; +import { Subscribe } from '@player-ui/react-subscribe'; import { DndProvider } from 'react-dnd'; import { HTML5Backend } from 'react-dnd-html5-backend'; import type { NamedType, ObjectType, TSManifest } from '@player-tools/xlr'; -import { TRANSFORM_FUNCTIONS, XLRService } from '@player-tools/json-language-service'; +import { + TRANSFORM_FUNCTIONS, + XLRService, +} from '@player-tools/json-language-service'; import type { TypeMetadata } from '@player-tools/xlr-sdk'; +import type { XLRSDK } from '@player-tools/xlr-sdk'; import { PlayerDndPlugin } from './utils'; import type { - ExtensionProviderAssetIdentifier, PluginProvider, + ExtensionProviderAssetIdentifier, TransformedDropTargetAssetType, } from './types'; import { RuntimeFlowState } from './utils/runtime-flow-state'; @@ -43,7 +49,7 @@ export interface DragAndDropControllerOptions { /** The Assets to include in the collection */ assets: Array, /** An instance of the XLRSDK to perform any required type lookups */ - XLRSDK: XLRService + XLRSDK: XLRSDK ) => { /** The generated collection asset with the provided `assets` array as children */ asset: Asset; @@ -53,10 +59,12 @@ export interface DragAndDropControllerOptions { /** * Function that will be called when Drag and Drop state changes + * + * @deprecated Will be removed soon */ handleDndStateChange: ( - /** The player content without any drag and drop specific assets */ - content: View + /** An instance of the controller object to access any new information that you may need */ + controller: DragAndDropController ) => void; /** A custom component to use for rendering droppable Assets */ @@ -69,10 +77,12 @@ export interface DragAndDropControllerOptions { export class DragAndDropController { private readonly options: DragAndDropControllerOptions; public readonly webPlayer: ReactPlayer; + public readonly stateUpdateSubscription = + new Subscribe(); private readonly dndWebPlayerPlugin: PlayerDndPlugin; private readonly runtimeState: RuntimeFlowState; - private readonly PlayerXLRService: XLRService; + private readonly XLRSDK: XLRSDK; public Context: React.ComponentType>; @@ -80,28 +90,48 @@ export class DragAndDropController { return this.webPlayer.Component; } + public getPlayerNavigationSection(): Navigation { + return this.runtimeState.navigation; + } + + public setPlayerNavigationSection(navigation: Navigation) { + this.runtimeState.navigation = navigation; + } + + public getPlayerSchemaSection() { + return this.runtimeState.schema; + } + + public setPlayerSchemaSection(schema: Schema.Schema) { + this.runtimeState.schema = schema; + } + + public getPlayerDataSection() { + return this.runtimeState.data; + } + + public setPlayerDataSection(data: DataModel) { + this.runtimeState.data = data; + } + constructor(options: DragAndDropControllerOptions) { this.options = options ?? {}; - this.PlayerXLRService = new XLRService(); - this.PlayerXLRService.XLRSDK.loadDefinitionsFromModule(options.playerTypes); + this.XLRSDK = new XLRService().XLRSDK; + this.XLRSDK.loadDefinitionsFromModule(options.playerTypes); options?.manifests?.forEach((manifest) => { - this.PlayerXLRService.XLRSDK.loadDefinitionsFromModule( - manifest, - {}, - TRANSFORM_FUNCTIONS - ); + this.XLRSDK.loadDefinitionsFromModule(manifest, {}, TRANSFORM_FUNCTIONS); }); this.runtimeState = new RuntimeFlowState({ resolveRequiredProperties: options.resolveRequiredProperties, resolveCollectionConversion: (assets: Array) => { - return options.resolveCollectionConversion( - assets, - this.PlayerXLRService - ); + return options.resolveCollectionConversion(assets, this.XLRSDK); + }, + handleDndStateChange: () => { + this.stateUpdateSubscription.publish(this); + options.handleDndStateChange(this); }, - handleDndStateChange: options.handleDndStateChange, }); this.dndWebPlayerPlugin = new PlayerDndPlugin({ @@ -110,9 +140,7 @@ export class DragAndDropController { Component: this.options.Component ?? DropComponent, }, getXLRTypeForAsset: (identifier) => { - const asset = this.PlayerXLRService.XLRSDK.getType( - identifier.assetName - ); + const asset = this.XLRSDK.getType(identifier.assetName); if (!asset) { throw new Error( `SDK Error: Unable to get asset ${identifier.assetName}` @@ -132,8 +160,7 @@ export class DragAndDropController { this.webPlayer = new WebPlayer({ plugins: [ this.dndWebPlayerPlugin, - // eslint-disable-next-line new-cap - ...(options?.plugins ?? []).map((e) => new e()), + ...(options?.plugins?.map((Plugin) => new Plugin()) ?? []), ], }); @@ -151,15 +178,13 @@ export class DragAndDropController { * This won't return anything that is registered as a Type or has "Transformed" in its named */ public getAvailableAssets(): Array { - const assets = this.PlayerXLRService.XLRSDK.listTypes({ + const assets = this.XLRSDK.listTypes({ capabilityFilter: 'Types', typeFilter: 'Transformed', }); return assets.map((asset) => { const assetName = asset.name; - const typeInfo = this.PlayerXLRService.XLRSDK.getTypeInfo( - assetName - ) as TypeMetadata; + const typeInfo = this.XLRSDK.getTypeInfo(assetName) as TypeMetadata; return { pluginName: typeInfo.plugin, assetName, @@ -174,9 +199,7 @@ export class DragAndDropController { * @param assetName - Player 'type' string for the Asset/View to retrieve */ public getAssetDetails(assetName: string): NamedType { - return this.PlayerXLRService.XLRSDK.getType( - assetName - ) as NamedType; + return this.XLRSDK.getType(assetName) as NamedType; } /** @@ -203,6 +226,22 @@ export class DragAndDropController { public updateAsset(assetSymbol: symbol, newObject: Asset) { this.runtimeState.updateAsset(assetSymbol, newObject); this.dndWebPlayerPlugin.refresh(this.webPlayer.player); + this.stateUpdateSubscription.publish(this); + } + + public async placeAsset( + dropTargetSymbol: symbol, + identifier: ExtensionProviderAssetIdentifier, + type: NamedType, + action: 'replace' | 'append' | 'prepend' = 'replace' + ) { + await this.runtimeState.placeAsset( + dropTargetSymbol, + { identifier, type }, + action + ); + this.dndWebPlayerPlugin.refresh(this.webPlayer.player); + this.stateUpdateSubscription.publish(this); } /** @@ -213,6 +252,7 @@ export class DragAndDropController { public removeAsset(assetSymbol: symbol) { this.runtimeState.clearAsset(assetSymbol); this.dndWebPlayerPlugin.refresh(this.webPlayer.player); + this.stateUpdateSubscription.publish(this); } /** @@ -229,7 +269,7 @@ export class DragAndDropController { * @param view - player content */ public importView(view: View) { - this.runtimeState.importView(view, this.PlayerXLRService); + this.runtimeState.importView(view, this.XLRSDK); this.dndWebPlayerPlugin.refresh(this.webPlayer.player); } diff --git a/drag-and-drop/library/src/utils/runtime-flow-state.ts b/drag-and-drop/library/src/utils/runtime-flow-state.ts index deb2381f..05265f05 100644 --- a/drag-and-drop/library/src/utils/runtime-flow-state.ts +++ b/drag-and-drop/library/src/utils/runtime-flow-state.ts @@ -1,7 +1,14 @@ import type { NamedType, ObjectType } from '@player-tools/xlr'; -import type { XLRService } from '@player-tools/json-language-service'; -import type { TypeMetadata } from '@player-tools/xlr-sdk'; -import type { Asset, AssetWrapper, Flow, View } from '@player-ui/types'; +import type { TypeMetadata, XLRSDK } from '@player-tools/xlr-sdk'; +import type { + Asset, + AssetWrapper, + DataModel, + Flow, + View, + Schema, + Navigation, +} from '@player-ui/types'; import type { ExtensionProviderAssetIdentifier, FlowWithOneView, @@ -10,11 +17,7 @@ import type { DropTargetAssetContext, } from '../types'; import { UUIDSymbol } from '../types'; -import { - makeDropTarget, - getAssetSymbol, - removeDndStateFromView, -} from './helpers'; +import { makeDropTarget, getAssetSymbol } from './helpers'; import { isDropTargetAsset } from '../types'; /** The type for exporting and restoring the flow state */ @@ -49,10 +52,7 @@ export interface RuntimeFlowStateOptions { /** * Function that will be called when Drag and Drop state changes */ - handleDndStateChange: ( - /** The player content without any drag and drop specific assets */ - content: View - ) => void; + handleDndStateChange: () => void; /** * The content to initialize the editing experience with @@ -85,7 +85,14 @@ export interface RuntimeFlowStateOptions { * Manages the translation between Drag and Drop state to Player state */ export class RuntimeFlowState { + /** The root drag and drop asset */ private ROOT: DropTargetAsset; + /** The schema section of the content */ + public schema?: Schema.Schema; + /** The data section of the content */ + public data?: DataModel; + /** The navigation section of the content */ + public navigation: Navigation; /** Symbol to Real Asset */ private realAssetMappings: Map = new Map(); /** Symbol to Drop Target Asset */ @@ -107,20 +114,32 @@ export class RuntimeFlowState { type: NamedType; }; - private handleDndStateChange: ( - /** The player content without any drag and drop specific assets */ - content: View - ) => void; + /** Called whenever drag and drop state changes */ + private handleDndStateChange: () => void; constructor(options: RuntimeFlowStateOptions) { this.ROOT = makeDropTarget('drag-and-drop-view'); + this.navigation = { + BEGIN: 'FLOW_1', + FLOW_1: { + startState: 'VIEW_1', + VIEW_1: { + state_type: 'VIEW', + ref: this.view.id, + transitions: { + '*': 'VIEW_1', + }, + }, + }, + }; + this.dropTargetAssets.set(getAssetSymbol(this.ROOT), this.ROOT); this.resolveRequiredProperties = options.resolveRequiredProperties; this.resolveCollectionConversion = options.resolveCollectionConversion; this.handleDndStateChange = options.handleDndStateChange; } - exportState(): ExportedRuntimeFlowState { + public exportState(): ExportedRuntimeFlowState { return { root: this.ROOT, }; @@ -418,7 +437,7 @@ export class RuntimeFlowState { containingDropTarget.value = this.computeViewForDropTarget(containingDropTarget); - this.handleDndStateChange(removeDndStateFromView(this.view)); + this.handleDndStateChange(); } public async placeAsset( @@ -478,7 +497,7 @@ export class RuntimeFlowState { // Resolve Arrays in parent this.updateArrayInParent(dropTarget, dropTargetSymbol); - this.handleDndStateChange(removeDndStateFromView(this.view)); + this.handleDndStateChange(); } public getAsset(assetSymbol: symbol): { @@ -507,18 +526,16 @@ export class RuntimeFlowState { this.realAssetMappings.delete(assetSymbol); parentDropTarget.value = this.computeViewForDropTarget(parentDropTarget); - this.handleDndStateChange(removeDndStateFromView(this.view)); + this.handleDndStateChange(); } private makeDropTargetContext( - xlrService: XLRService, + sdk: XLRSDK, parent: Asset, propertyName: string, isArrayElement?: boolean ): DropTargetAssetContext { - const { plugin: pluginName } = xlrService.XLRSDK.getTypeInfo( - parent.type - ) as TypeMetadata; + const { plugin: pluginName } = sdk.getTypeInfo(parent.type) as TypeMetadata; return { parent: { pluginName, @@ -530,7 +547,7 @@ export class RuntimeFlowState { } private createDropTarget( - xlrService: XLRService, + sdk: XLRSDK, targetAsset?: Asset, dropTargetContext?: DropTargetAssetContext, parentAsset?: Asset @@ -542,10 +559,10 @@ export class RuntimeFlowState { const dropTargetSymbol = getAssetSymbol(dropTarget); this.dropTargetAssets.set(dropTargetSymbol, dropTarget); if (targetAsset) { - const targetAssetType = xlrService.XLRSDK.getType( + const targetAssetType = sdk.getType( targetAsset.type ) as NamedType; - const { plugin: pluginName } = xlrService.XLRSDK.getTypeInfo( + const { plugin: pluginName } = sdk.getTypeInfo( targetAsset.type ) as TypeMetadata; const wrappedTargetAsset: PlacedAsset = { @@ -574,7 +591,7 @@ export class RuntimeFlowState { private addDndStateToAsset( obj: any, - xlrService: XLRService, + sdk: XLRSDK, dropTargetContext?: DropTargetAssetContext, parentAsset?: Asset ) { @@ -583,7 +600,7 @@ export class RuntimeFlowState { } const newObj = { ...obj }; - const assetType = xlrService.XLRSDK.getType(obj.type) as ObjectType; + const assetType = sdk.getType(obj.type) as ObjectType; if (assetType) { newObj[UUIDSymbol] = Symbol(`${newObj.id}-${newObj.type}`); } @@ -612,10 +629,10 @@ export class RuntimeFlowState { dropTargetContext?.parent.assetName.length > 0 ) { newObj[key] = this.createDropTarget( - xlrService, + sdk, this.addDndStateToAsset( obj[key], - xlrService, + sdk, dropTargetContext, parentAsset ), @@ -625,14 +642,9 @@ export class RuntimeFlowState { } else if (typeof obj[key] === 'object') { const targetAsset = this.addDndStateToAsset( obj[key], - xlrService, + sdk, isAssetWrapper - ? this.makeDropTargetContext( - xlrService, - newObj, - key, - isArrayElement - ) + ? this.makeDropTargetContext(sdk, newObj, key, isArrayElement) : dropTargetContext, isAssetWrapper ? newObj : parentAsset ); @@ -664,10 +676,10 @@ export class RuntimeFlowState { ) { const targetAsset = { asset: this.createDropTarget( - xlrService, + sdk, undefined, this.makeDropTargetContext( - xlrService, + sdk, newObj, key, node.type === 'array' @@ -688,7 +700,7 @@ export class RuntimeFlowState { return newObj; } - public importView(view: View, xlrService: XLRService) { + public importView(view: View, xlrService: XLRSDK) { this.realAssetMappings.clear(); this.dropTargetAssets.clear(); this.assetsToTargets.clear(); @@ -709,19 +721,9 @@ export class RuntimeFlowState { return { id: 'dnd-controller', views: [view], - navigation: { - BEGIN: 'FLOW_1', - FLOW_1: { - startState: 'VIEW_1', - VIEW_1: { - state_type: 'VIEW', - ref: view.id, - transitions: { - '*': 'VIEW_1', - }, - }, - }, - }, + schema: this.schema, + data: this.data, + navigation: this.navigation, }; } } diff --git a/package.json b/package.json index dbed4af0..850a6ca7 100644 --- a/package.json +++ b/package.json @@ -45,6 +45,7 @@ "@reduxjs/toolkit": "^1.6.1", "@rollup/plugin-image": "^2.1.1", "@player-ui/react": "0.4.0-next.7", + "@player-ui/react-subscribe": "0.4.0-next.7", "@player-ui/reference-assets-plugin-react": "0.4.0-next.7", "@rollup/plugin-json": "^4.1.0", "@rollup/plugin-node-resolve": "^13.0.6", diff --git a/xlr/sdk/src/__tests__/__snapshots__/sdk.test.ts.snap b/xlr/sdk/src/__tests__/__snapshots__/sdk.test.ts.snap index f5c34310..bfa11247 100644 --- a/xlr/sdk/src/__tests__/__snapshots__/sdk.test.ts.snap +++ b/xlr/sdk/src/__tests__/__snapshots__/sdk.test.ts.snap @@ -917,1339 +917,14335 @@ Array [ `; exports[`Export Test Exports Typescript Types With Filters 1`] = ` -"import { Expression, Asset, Binding, AssetWrapper } from \\"@player-ui/types\\"; - -/** - * This is the most generic way of gathering data. The input is bound to a data model using the 'binding' property. - * Players can get field type information from the 'schema' definition, thus to decide the input controls for visual rendering. -*/ -export interface InputAsset { - /** Each asset requires a unique id per view */ - id: string; - /** The asset type determines the semantics of how a user interacts with a page */ - type: 'input'; - /** Asset container for a field label. */ - label?: AssetWrapper; - /** Asset container for a note. */ - note?: AssetWrapper; - /** The location in the data-model to store the data */ - binding: Binding; - /** Optional additional data */ - metaData?: { - /** Additional data to beacon when this input changes */ - beacon?: string | Record; - }; - [key: string]: unknown; -} -export interface TextAsset { - /** Each asset requires a unique id per view */ - id: string; - /** The asset type determines the semantics of how a user interacts with a page */ - type: 'text'; - /** The text to display */ - value: string; - /** Any modifiers on the text */ - modifiers?: Array<{ - /** The modifier type */ - type: string; - /** Modifiers can be named when used in strings */ - name?: string; - [key: string]: unknown; - } | { - /** The link type denotes this as a link */ - type: 'link'; - /** An optional expression to run before the link is opened */ - exp?: Expression; - /** metaData about the link's target */ - metaData: { - /** The location of the link to load */ - ref: string; - /** Used to indicate an application specific resolver to use */ - 'mime-type'?: string; - }; - }>; - [key: string]: unknown; -} -/** - * User actions can be represented in several places. - * Each view typically has one or more actions that allow the user to navigate away from that view. - * In addition, several asset types can have actions that apply to that asset only. -*/ -export interface ActionAsset { - /** Each asset requires a unique id per view */ - id: string; - /** The asset type determines the semantics of how a user interacts with a page */ - type: 'action'; - /** The transition value of the action in the state machine */ - value?: string; - /** A text-like asset for the action's label */ - label?: AssetWrapper; - /** An optional expression to execute before transitioning */ - exp?: Expression; - /** An optional string that describes the action for screen-readers */ - accessibility?: string; - /** Additional optional data to assist with the action interactions on the page */ - metaData?: { - /** Additional data to beacon */ - beacon?: string | Record; - /** Force transition to the next view without checking for validation */ - skipValidation?: boolean; - }; - [key: string]: unknown; -} -export interface InfoAsset { - /** Each asset requires a unique id per view */ - id: string; - /** The asset type determines the semantics of how a user interacts with a page */ - type: 'info'; - /** The string value to show */ - title?: AssetWrapper; - /** subtitle */ - subTitle?: AssetWrapper; - /** Primary place for info */ - primaryInfo?: AssetWrapper; - /** List of actions to show at the bottom of the page */ - actions?: Array; - [key: string]: unknown; -} -export interface CollectionAsset { - /** Each asset requires a unique id per view */ - id: string; - /** The asset type determines the semantics of how a user interacts with a page */ - type: 'collection'; - /** An optional label to title the collection */ - label?: AssetWrapper; - /** The string value to show */ - values?: Array; - [key: string]: unknown; -}" +Array [ + Object { + "additionalProperties": Object { + "type": "unknown", + }, + "description": "This is the most generic way of gathering data. The input is bound to a data model using the 'binding' property. +Players can get field type information from the 'schema' definition, thus to decide the input controls for visual rendering.", + "extends": undefined, + "genericTokens": Array [ + Object { + "constraints": Object { + "ref": "Asset", + "type": "ref", + }, + "default": Object { + "ref": "Asset", + "type": "ref", + }, + "symbol": "AnyTextAsset", + }, + ], + "name": "InputAsset", + "properties": Object { + "binding": Object { + "node": Object { + "description": "The location in the data-model to store the data", + "genericArguments": undefined, + "ref": "Binding", + "title": "InputAsset.binding", + "type": "ref", + }, + "required": true, + }, + "id": Object { + "node": Object { + "description": "Each asset requires a unique id per view", + "title": "Asset.id", + "type": "string", + }, + "required": true, + }, + "label": Object { + "node": Object { + "description": "Asset container for a field label.", + "genericArguments": Array [ + Object { + "genericArguments": undefined, + "ref": "AnyTextAsset", + "type": "ref", + }, + ], + "ref": "AssetWrapper", + "title": "InputAsset.label", + "type": "ref", + }, + "required": false, + }, + "metaData": Object { + "node": Object { + "additionalProperties": false, + "description": "Optional additional data", + "extends": undefined, + "properties": Object { + "beacon": Object { + "node": Object { + "description": "Additional data to beacon when this input changes", + "name": "BeaconDataType", + "or": Array [ + Object { + "title": "BeaconDataType", + "type": "string", + }, + Object { + "keyType": Object { + "type": "string", + }, + "title": "BeaconDataType", + "type": "record", + "valueType": Object { + "type": "any", + }, + }, + ], + "source": "/private/var/tmp/_bazel_kreddy8/6fc13ccb395252816f0c23d8394e8532/sandbox/darwin-sandbox/134/execroot/player/node_modules/@player-ui/beacon-plugin/dist/index.d.ts", + "title": "InputAsset.metaData.beacon", + "type": "or", + }, + "required": false, + }, + }, + "title": "InputAsset.metaData", + "type": "object", + }, + "required": false, + }, + "note": Object { + "node": Object { + "description": "Asset container for a note.", + "genericArguments": Array [ + Object { + "genericArguments": undefined, + "ref": "AnyTextAsset", + "type": "ref", + }, + ], + "ref": "AssetWrapper", + "title": "InputAsset.note", + "type": "ref", + }, + "required": false, + }, + "type": Object { + "node": Object { + "const": "input", + "description": "The asset type determines the semantics of how a user interacts with a page", + "title": "Asset.type", + "type": "string", + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "Asset", + "type": "object", + }, + Object { + "additionalProperties": Object { + "type": "unknown", + }, + "description": undefined, + "extends": undefined, + "genericTokens": Array [], + "name": "TextAsset", + "properties": Object { + "id": Object { + "node": Object { + "description": "Each asset requires a unique id per view", + "title": "Asset.id", + "type": "string", + }, + "required": true, + }, + "modifiers": Object { + "node": Object { + "description": "Any modifiers on the text", + "elementType": Object { + "name": "TextModifier", + "or": Array [ + Object { + "additionalProperties": Object { + "type": "unknown", + }, + "extends": undefined, + "name": "BasicTextModifier", + "properties": Object { + "name": Object { + "node": Object { + "description": "Modifiers can be named when used in strings", + "title": "BasicTextModifier.name", + "type": "string", + }, + "required": false, + }, + "type": Object { + "node": Object { + "description": "The modifier type", + "title": "BasicTextModifier.type", + "type": "string", + }, + "required": true, + }, + }, + "source": "/private/var/tmp/_bazel_kreddy8/6fc13ccb395252816f0c23d8394e8532/sandbox/darwin-sandbox/134/execroot/player/node_modules/@player-ui/reference-assets-plugin/dist/index.d.ts", + "title": "BasicTextModifier", + "type": "object", + }, + Object { + "additionalProperties": false, + "description": "A modifier to turn the text into a link", + "extends": undefined, + "name": "LinkModifier", + "properties": Object { + "exp": Object { + "node": Object { + "description": "An optional expression to run before the link is opened", + "genericArguments": undefined, + "ref": "Expression", + "title": "LinkModifier.exp", + "type": "ref", + }, + "required": false, + }, + "metaData": Object { + "node": Object { + "additionalProperties": false, + "description": "metaData about the link's target", + "extends": undefined, + "properties": Object { + "'mime-type'": Object { + "node": Object { + "description": "Used to indicate an application specific resolver to use", + "title": "LinkModifier.metaData.'mime-type'", + "type": "string", + }, + "required": false, + }, + "ref": Object { + "node": Object { + "description": "The location of the link to load", + "title": "LinkModifier.metaData.ref", + "type": "string", + }, + "required": true, + }, + }, + "title": "LinkModifier.metaData", + "type": "object", + }, + "required": true, + }, + "type": Object { + "node": Object { + "const": "link", + "description": "The link type denotes this as a link", + "title": "LinkModifier.type", + "type": "string", + }, + "required": true, + }, + }, + "source": "/private/var/tmp/_bazel_kreddy8/6fc13ccb395252816f0c23d8394e8532/sandbox/darwin-sandbox/134/execroot/player/node_modules/@player-ui/reference-assets-plugin/dist/index.d.ts", + "title": "LinkModifier", + "type": "object", + }, + ], + "source": "/private/var/tmp/_bazel_kreddy8/6fc13ccb395252816f0c23d8394e8532/sandbox/darwin-sandbox/134/execroot/player/node_modules/@player-ui/reference-assets-plugin/dist/index.d.ts", + "title": "TextModifier", + "type": "or", + }, + "title": "TextAsset.modifiers", + "type": "array", + }, + "required": false, + }, + "type": Object { + "node": Object { + "const": "text", + "description": "The asset type determines the semantics of how a user interacts with a page", + "title": "Asset.type", + "type": "string", + }, + "required": true, + }, + "value": Object { + "node": Object { + "description": "The text to display", + "title": "TextAsset.value", + "type": "string", + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "Asset", + "type": "object", + }, + Object { + "additionalProperties": Object { + "type": "unknown", + }, + "description": "User actions can be represented in several places. +Each view typically has one or more actions that allow the user to navigate away from that view. +In addition, several asset types can have actions that apply to that asset only.", + "extends": undefined, + "genericTokens": Array [ + Object { + "constraints": Object { + "ref": "Asset", + "type": "ref", + }, + "default": Object { + "ref": "Asset", + "type": "ref", + }, + "symbol": "AnyTextAsset", + }, + ], + "name": "ActionAsset", + "properties": Object { + "accessibility": Object { + "node": Object { + "description": "An optional string that describes the action for screen-readers", + "title": "ActionAsset.accessibility", + "type": "string", + }, + "required": false, + }, + "exp": Object { + "node": Object { + "description": "An optional expression to execute before transitioning", + "genericArguments": undefined, + "ref": "Expression", + "title": "ActionAsset.exp", + "type": "ref", + }, + "required": false, + }, + "id": Object { + "node": Object { + "description": "Each asset requires a unique id per view", + "title": "Asset.id", + "type": "string", + }, + "required": true, + }, + "label": Object { + "node": Object { + "description": "A text-like asset for the action's label", + "genericArguments": Array [ + Object { + "genericArguments": undefined, + "ref": "AnyTextAsset", + "type": "ref", + }, + ], + "ref": "AssetWrapper", + "title": "ActionAsset.label", + "type": "ref", + }, + "required": false, + }, + "metaData": Object { + "node": Object { + "additionalProperties": false, + "description": "Additional optional data to assist with the action interactions on the page", + "extends": undefined, + "properties": Object { + "beacon": Object { + "node": Object { + "description": "Additional data to beacon", + "name": "BeaconDataType", + "or": Array [ + Object { + "title": "BeaconDataType", + "type": "string", + }, + Object { + "keyType": Object { + "type": "string", + }, + "title": "BeaconDataType", + "type": "record", + "valueType": Object { + "type": "any", + }, + }, + ], + "source": "/private/var/tmp/_bazel_kreddy8/6fc13ccb395252816f0c23d8394e8532/sandbox/darwin-sandbox/134/execroot/player/node_modules/@player-ui/beacon-plugin/dist/index.d.ts", + "title": "ActionAsset.metaData.beacon", + "type": "or", + }, + "required": false, + }, + "skipValidation": Object { + "node": Object { + "description": "Force transition to the next view without checking for validation", + "title": "ActionAsset.metaData.skipValidation", + "type": "boolean", + }, + "required": false, + }, + }, + "title": "ActionAsset.metaData", + "type": "object", + }, + "required": false, + }, + "type": Object { + "node": Object { + "const": "action", + "description": "The asset type determines the semantics of how a user interacts with a page", + "title": "Asset.type", + "type": "string", + }, + "required": true, + }, + "value": Object { + "node": Object { + "description": "The transition value of the action in the state machine", + "title": "ActionAsset.value", + "type": "string", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "Asset", + "type": "object", + }, + Object { + "additionalProperties": Object { + "type": "unknown", + }, + "description": undefined, + "extends": undefined, + "genericTokens": Array [], + "name": "InfoAsset", + "properties": Object { + "actions": Object { + "node": Object { + "description": "List of actions to show at the bottom of the page", + "elementType": Object { + "genericArguments": undefined, + "ref": "AssetWrapper", + "type": "ref", + }, + "title": "InfoAsset.actions", + "type": "array", + }, + "required": false, + }, + "id": Object { + "node": Object { + "description": "Each asset requires a unique id per view", + "title": "Asset.id", + "type": "string", + }, + "required": true, + }, + "primaryInfo": Object { + "node": Object { + "description": "Primary place for info", + "genericArguments": undefined, + "ref": "AssetWrapper", + "title": "InfoAsset.primaryInfo", + "type": "ref", + }, + "required": false, + }, + "subTitle": Object { + "node": Object { + "description": "subtitle", + "genericArguments": undefined, + "ref": "AssetWrapper", + "title": "InfoAsset.subTitle", + "type": "ref", + }, + "required": false, + }, + "title": Object { + "node": Object { + "description": "The string value to show", + "genericArguments": undefined, + "ref": "AssetWrapper", + "title": "InfoAsset.title", + "type": "ref", + }, + "required": false, + }, + "type": Object { + "node": Object { + "const": "info", + "description": "The asset type determines the semantics of how a user interacts with a page", + "title": "Asset.type", + "type": "string", + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "Asset", + "type": "object", + }, + Object { + "additionalProperties": Object { + "type": "unknown", + }, + "description": undefined, + "extends": undefined, + "genericTokens": Array [], + "name": "CollectionAsset", + "properties": Object { + "id": Object { + "node": Object { + "description": "Each asset requires a unique id per view", + "title": "Asset.id", + "type": "string", + }, + "required": true, + }, + "label": Object { + "node": Object { + "description": "An optional label to title the collection", + "genericArguments": undefined, + "ref": "AssetWrapper", + "title": "CollectionAsset.label", + "type": "ref", + }, + "required": false, + }, + "type": Object { + "node": Object { + "const": "collection", + "description": "The asset type determines the semantics of how a user interacts with a page", + "title": "Asset.type", + "type": "string", + }, + "required": true, + }, + "values": Object { + "node": Object { + "description": "The string value to show", + "elementType": Object { + "genericArguments": undefined, + "ref": "AssetWrapper", + "type": "ref", + }, + "title": "CollectionAsset.values", + "type": "array", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "Asset", + "type": "object", + }, +] `; exports[`Export Test Exports Typescript Types With Transforms 1`] = ` -"import { Expression, Asset, Binding, AssetWrapper } from \\"@player-ui/types\\"; - -/** - * This is the most generic way of gathering data. The input is bound to a data model using the 'binding' property. - * Players can get field type information from the 'schema' definition, thus to decide the input controls for visual rendering. -*/ -export interface InputAsset { - /** Each asset requires a unique id per view */ - id: string; - /** The asset type determines the semantics of how a user interacts with a page */ - type: 'input'; - /** Asset container for a field label. */ - label?: AssetWrapper; - /** Asset container for a note. */ - note?: AssetWrapper; - /** The location in the data-model to store the data */ - binding: Binding; - /** Optional additional data */ - metaData?: { - /** Additional data to beacon when this input changes */ - beacon?: string | Record; - }; - transformed?: true; - [key: string]: unknown; -} -export interface TextAsset { - /** Each asset requires a unique id per view */ - id: string; - /** The asset type determines the semantics of how a user interacts with a page */ - type: 'text'; - /** The text to display */ - value: string; - /** Any modifiers on the text */ - modifiers?: Array<{ - /** The modifier type */ - type: string; - /** Modifiers can be named when used in strings */ - name?: string; - [key: string]: unknown; - } | { - /** The link type denotes this as a link */ - type: 'link'; - /** An optional expression to run before the link is opened */ - exp?: Expression; - /** metaData about the link's target */ - metaData: { - /** The location of the link to load */ - ref: string; - /** Used to indicate an application specific resolver to use */ - 'mime-type'?: string; - }; - }>; - transformed?: true; - [key: string]: unknown; -} -/** - * User actions can be represented in several places. - * Each view typically has one or more actions that allow the user to navigate away from that view. - * In addition, several asset types can have actions that apply to that asset only. -*/ -export interface ActionAsset { - /** Each asset requires a unique id per view */ - id: string; - /** The asset type determines the semantics of how a user interacts with a page */ - type: 'action'; - /** The transition value of the action in the state machine */ - value?: string; - /** A text-like asset for the action's label */ - label?: AssetWrapper; - /** An optional expression to execute before transitioning */ - exp?: Expression; - /** An optional string that describes the action for screen-readers */ - accessibility?: string; - /** Additional optional data to assist with the action interactions on the page */ - metaData?: { - /** Additional data to beacon */ - beacon?: string | Record; - /** Force transition to the next view without checking for validation */ - skipValidation?: boolean; - }; - transformed?: true; - [key: string]: unknown; -} -export interface InfoAsset { - /** Each asset requires a unique id per view */ - id: string; - /** The asset type determines the semantics of how a user interacts with a page */ - type: 'info'; - /** The string value to show */ - title?: AssetWrapper; - /** subtitle */ - subTitle?: AssetWrapper; - /** Primary place for info */ - primaryInfo?: AssetWrapper; - /** List of actions to show at the bottom of the page */ - actions?: Array; - transformed?: true; - [key: string]: unknown; -} -export interface CollectionAsset { - /** Each asset requires a unique id per view */ - id: string; - /** The asset type determines the semantics of how a user interacts with a page */ - type: 'collection'; - /** An optional label to title the collection */ - label?: AssetWrapper; - /** The string value to show */ - values?: Array; - transformed?: true; - [key: string]: unknown; -}" -`; - -exports[`Export Test Exports Typescript types 1`] = ` -"import { Expression, Asset, Binding, AssetWrapper } from \\"@player-ui/types\\"; - -/** - * This is the most generic way of gathering data. The input is bound to a data model using the 'binding' property. - * Players can get field type information from the 'schema' definition, thus to decide the input controls for visual rendering. -*/ -export interface InputAsset { - /** Each asset requires a unique id per view */ - id: string; - /** The asset type determines the semantics of how a user interacts with a page */ - type: 'input'; - /** Asset container for a field label. */ - label?: AssetWrapper; - /** Asset container for a note. */ - note?: AssetWrapper; - /** The location in the data-model to store the data */ - binding: Binding; - /** Optional additional data */ - metaData?: { - /** Additional data to beacon when this input changes */ - beacon?: string | Record; - }; - [key: string]: unknown; -} -export interface TextAsset { - /** Each asset requires a unique id per view */ - id: string; - /** The asset type determines the semantics of how a user interacts with a page */ - type: 'text'; - /** The text to display */ - value: string; - /** Any modifiers on the text */ - modifiers?: Array<{ - /** The modifier type */ - type: string; - /** Modifiers can be named when used in strings */ - name?: string; - [key: string]: unknown; - } | { - /** The link type denotes this as a link */ - type: 'link'; - /** An optional expression to run before the link is opened */ - exp?: Expression; - /** metaData about the link's target */ - metaData: { - /** The location of the link to load */ - ref: string; - /** Used to indicate an application specific resolver to use */ - 'mime-type'?: string; - }; - }>; - [key: string]: unknown; -} -/** - * User actions can be represented in several places. - * Each view typically has one or more actions that allow the user to navigate away from that view. - * In addition, several asset types can have actions that apply to that asset only. -*/ -export interface ActionAsset { - /** Each asset requires a unique id per view */ - id: string; - /** The asset type determines the semantics of how a user interacts with a page */ - type: 'action'; - /** The transition value of the action in the state machine */ - value?: string; - /** A text-like asset for the action's label */ - label?: AssetWrapper; - /** An optional expression to execute before transitioning */ - exp?: Expression; - /** An optional string that describes the action for screen-readers */ - accessibility?: string; - /** Additional optional data to assist with the action interactions on the page */ - metaData?: { - /** Additional data to beacon */ - beacon?: string | Record; - /** Force transition to the next view without checking for validation */ - skipValidation?: boolean; - }; - [key: string]: unknown; -} -export interface InfoAsset { - /** Each asset requires a unique id per view */ - id: string; - /** The asset type determines the semantics of how a user interacts with a page */ - type: 'info'; - /** The string value to show */ - title?: AssetWrapper; - /** subtitle */ - subTitle?: AssetWrapper; - /** Primary place for info */ - primaryInfo?: AssetWrapper; - /** List of actions to show at the bottom of the page */ - actions?: Array; - [key: string]: unknown; -} -export interface CollectionAsset { - /** Each asset requires a unique id per view */ - id: string; - /** The asset type determines the semantics of how a user interacts with a page */ - type: 'collection'; - /** An optional label to title the collection */ - label?: AssetWrapper; - /** The string value to show */ - values?: Array; - [key: string]: unknown; -} -/** An asset is the smallest unit of user interaction in a player view */ -export interface Asset { - /** Each asset requires a unique id per view */ - id: string; - /** The asset type determines the semantics of how a user interacts with a page */ - type: T; - [key: string]: unknown; -} -/** An asset that contains a Binding. */ -export interface AssetBinding { - /** Each asset requires a unique id per view */ - id: string; - /** The asset type determines the semantics of how a user interacts with a page */ - type: T; - /** A binding that points to somewhere in the data model */ - binding: Binding; - [key: string]: unknown; -} -/** A single case statement to use in a switch */ -export interface SwitchCase { - /** The Asset to use if this case is applicable */ - asset: T; - /** An expression to execute to determine if this case applies */ - case: Expression | true; -} -/** A switch can replace an asset with the applicable case on first render */ -export type Switch = Array<{ - /** The Asset to use if this case is applicable */ - asset: T; - /** An expression to execute to determine if this case applies */ - case: Expression | true; -}>; -/** An object that contains an asset */ -export interface AssetWrapper { - /** An asset instance */ - asset: T; - [key: string]: unknown; -} -export type AssetWrapperOrSwitch = (AssetWrapper & { - /** The dynamicSwitch property can't exist at the same time as 'asset' */ - dynamicSwitch?: never; - /** The staticSwitch property can't exist at the same time as 'asset' */ - staticSwitch?: never; -}) | ({ - /** A static switch only evaluates the applicable base on first render of the view */ - staticSwitch: Array<{ - /** The Asset to use if this case is applicable */ - asset: T; - /** An expression to execute to determine if this case applies */ - case: Expression | true; - }>; -} & { - /** The staticSwitch property can't exist at the same time as 'asset' */ - asset?: never; - /** The staticSwitch property can't exist at the same time as 'dynamicSwitch' */ - dynamicSwitch?: never; -}) | ({ - /** A dynamic switch re-evaluates the applicable case as data changes */ - dynamicSwitch: Array<{ - /** The Asset to use if this case is applicable */ - asset: T; - /** An expression to execute to determine if this case applies */ - case: Expression | true; - }>; -} & { - /** The dynamicSwitch property can't exist at the same time as 'asset' */ - asset?: never; - /** The dynamicSwitch property can't exist at the same time as 'staticSwitch' */ - staticSwitch?: never; -}); -export type AssetSwitch = { - /** A static switch only evaluates the applicable base on first render of the view */ - staticSwitch: Array<{ - /** The Asset to use if this case is applicable */ - asset: T; - /** An expression to execute to determine if this case applies */ - case: Expression | true; - }>; -} | { - /** A dynamic switch re-evaluates the applicable case as data changes */ - dynamicSwitch: Array<{ - /** The Asset to use if this case is applicable */ - asset: T; - /** An expression to execute to determine if this case applies */ - case: Expression | true; - }>; -}; -export interface StaticSwitch { - /** A static switch only evaluates the applicable base on first render of the view */ - staticSwitch: Array<{ - /** The Asset to use if this case is applicable */ - asset: T; - /** An expression to execute to determine if this case applies */ - case: Expression | true; - }>; -} -export interface DynamicSwitch { - /** A dynamic switch re-evaluates the applicable case as data changes */ - dynamicSwitch: Array<{ - /** The Asset to use if this case is applicable */ - asset: T; - /** An expression to execute to determine if this case applies */ - case: Expression | true; - }>; -} -/** - * Expressions are a specialized way of executing code. - * If the expression is a composite, the last expression executed is the return value -*/ -export type Expression = string | Array; -export type ExpressionRef = \`@[\${string}]@\`; -/** Bindings describe locations in the data model. */ -export type Binding = string; -export type BindingRef = \`{{\${string}}}\`; -/** The data-model is the location that all user data is stored */ -export type DataModel = Record; -/** The navigation section of the flow describes a State Machine for the user. */ -export type Navigation = { - /** The name of the Flow to begin on */ - BEGIN: string; -} & Record; - /** An id corresponding to a view from the 'views' array */ - ref: string; - /** View meta-properties */ - attributes?: { - [key: string]: any; - }; - } | { - /** Add comments that will not be processing, but are useful for code explanation */ - _comment?: string; - /** A property to determine the type of state this is */ - state_type: 'END'; - /** An optional expression to run when this view renders */ - onStart?: Expression | { - /** The expression to run */ - exp?: Expression; - }; - /** An optional expression to run before view transition */ - onEnd?: Expression | { - /** The expression to run */ - exp?: Expression; - }; - exp?: never; - /** - * A description of _how_ the flow ended. - * If this is a flow started from another flow, the outcome determines the flow transition - */ - outcome: string; - } | { - /** Add comments that will not be processing, but are useful for code explanation */ - _comment?: string; - /** A property to determine the type of state this is */ - state_type: 'FLOW'; - /** An optional expression to run when this view renders */ - onStart?: Expression | { - /** The expression to run */ - exp?: Expression; - }; - /** An optional expression to run before view transition */ - onEnd?: Expression | { - /** The expression to run */ - exp?: Expression; - }; - exp?: never; - /** A mapping of transition-name to FlowState name */ - transitions: Record; - /** A reference to a FLOW id state to run */ - ref: string; - } | { - /** Add comments that will not be processing, but are useful for code explanation */ - _comment?: string; - /** A property to determine the type of state this is */ - state_type: 'ACTION'; - /** An optional expression to run when this view renders */ - onStart?: Expression | { - /** The expression to run */ - exp?: Expression; - }; - /** An optional expression to run before view transition */ - onEnd?: Expression | { - /** The expression to run */ - exp?: Expression; - }; - /** - * An expression to execute. - * The return value determines the transition to take - */ - exp: Expression; - /** A mapping of transition-name to FlowState name */ - transitions: Record; - } | { - /** Add comments that will not be processing, but are useful for code explanation */ - _comment?: string; - /** A property to determine the type of state this is */ - state_type: 'EXTERNAL'; - /** An optional expression to run when this view renders */ - onStart?: Expression | { - /** The expression to run */ - exp?: Expression; - }; - /** An optional expression to run before view transition */ - onEnd?: Expression | { - /** The expression to run */ - exp?: Expression; - }; - exp?: never; - /** A mapping of transition-name to FlowState name */ - transitions: Record; - /** A reference for this external state */ - ref: string; - }); -}>; -/** An object with an expression in it */ -export interface ExpressionObject { - /** The expression to run */ - exp?: Expression; -} -/** A state machine in the navigation */ -export interface NavigationFlow { - /** The first state to kick off the state machine */ - startState: string; - /** An optional expression to run when this Flow starts */ - onStart?: Expression | { - /** The expression to run */ - exp?: Expression; - }; - /** An optional expression to run when this Flow ends */ - onEnd?: Expression | { - /** The expression to run */ - exp?: Expression; - }; - [key: string]: undefined | string | Expression | { - /** The expression to run */ - exp?: Expression; - } | ({ - /** Add comments that will not be processing, but are useful for code explanation */ - _comment?: string; - /** A property to determine the type of state this is */ - state_type: 'VIEW'; - /** An optional expression to run when this view renders */ - onStart?: Expression | { - /** The expression to run */ - exp?: Expression; - }; - /** An optional expression to run before view transition */ - onEnd?: Expression | { - /** The expression to run */ - exp?: Expression; - }; - exp?: never; - /** A mapping of transition-name to FlowState name */ - transitions: Record; - /** An id corresponding to a view from the 'views' array */ - ref: string; - /** View meta-properties */ - attributes?: { - [key: string]: any; - }; - } | { - /** Add comments that will not be processing, but are useful for code explanation */ - _comment?: string; - /** A property to determine the type of state this is */ - state_type: 'END'; - /** An optional expression to run when this view renders */ - onStart?: Expression | { - /** The expression to run */ - exp?: Expression; - }; - /** An optional expression to run before view transition */ - onEnd?: Expression | { - /** The expression to run */ - exp?: Expression; - }; - exp?: never; - /** - * A description of _how_ the flow ended. - * If this is a flow started from another flow, the outcome determines the flow transition - */ - outcome: string; - } | { - /** Add comments that will not be processing, but are useful for code explanation */ - _comment?: string; - /** A property to determine the type of state this is */ - state_type: 'FLOW'; - /** An optional expression to run when this view renders */ - onStart?: Expression | { - /** The expression to run */ - exp?: Expression; - }; - /** An optional expression to run before view transition */ - onEnd?: Expression | { - /** The expression to run */ - exp?: Expression; - }; - exp?: never; - /** A mapping of transition-name to FlowState name */ - transitions: Record; - /** A reference to a FLOW id state to run */ - ref: string; - } | { - /** Add comments that will not be processing, but are useful for code explanation */ - _comment?: string; - /** A property to determine the type of state this is */ - state_type: 'ACTION'; - /** An optional expression to run when this view renders */ - onStart?: Expression | { - /** The expression to run */ - exp?: Expression; - }; - /** An optional expression to run before view transition */ - onEnd?: Expression | { - /** The expression to run */ - exp?: Expression; - }; - /** - * An expression to execute. - * The return value determines the transition to take - */ - exp: Expression; - /** A mapping of transition-name to FlowState name */ - transitions: Record; - } | { - /** Add comments that will not be processing, but are useful for code explanation */ - _comment?: string; - /** A property to determine the type of state this is */ - state_type: 'EXTERNAL'; - /** An optional expression to run when this view renders */ - onStart?: Expression | { - /** The expression to run */ - exp?: Expression; - }; - /** An optional expression to run before view transition */ - onEnd?: Expression | { - /** The expression to run */ - exp?: Expression; - }; - exp?: never; - /** A mapping of transition-name to FlowState name */ - transitions: Record; - /** A reference for this external state */ - ref: string; - }); -} -export type NavigationFlowTransition = Record; -/** The base representation of a state within a Flow */ -export interface NavigationBaseState { - /** Add comments that will not be processing, but are useful for code explanation */ - _comment?: string; - /** A property to determine the type of state this is */ - state_type: T; - /** An optional expression to run when this view renders */ - onStart?: Expression | { - /** The expression to run */ - exp?: Expression; - }; - /** An optional expression to run before view transition */ - onEnd?: Expression | { - /** The expression to run */ - exp?: Expression; - }; - /** - * TS gets really confused with both the ActionState and the onStart state both declaring the \`exp\` property - * So this explicity says there should never be an exp prop on a state node that's not of type 'ACTION' - */ - exp?: T extends T ? Expression : never; -} -/** A generic state that can transition to another state */ -export interface NavigationFlowTransitionableState { - /** Add comments that will not be processing, but are useful for code explanation */ - _comment?: string; - /** A property to determine the type of state this is */ - state_type: T; - /** An optional expression to run when this view renders */ - onStart?: Expression | { - /** The expression to run */ - exp?: Expression; - }; - /** An optional expression to run before view transition */ - onEnd?: Expression | { - /** The expression to run */ - exp?: Expression; - }; - /** - * TS gets really confused with both the ActionState and the onStart state both declaring the \`exp\` property - * So this explicity says there should never be an exp prop on a state node that's not of type 'ACTION' - */ - exp?: T extends T ? Expression : never; - /** A mapping of transition-name to FlowState name */ - transitions: Record; -} -/** A state representing a view */ -export interface NavigationFlowViewState { - /** Add comments that will not be processing, but are useful for code explanation */ - _comment?: string; - /** A property to determine the type of state this is */ - state_type: 'VIEW'; - /** An optional expression to run when this view renders */ - onStart?: Expression | { - /** The expression to run */ - exp?: Expression; - }; - /** An optional expression to run before view transition */ - onEnd?: Expression | { - /** The expression to run */ - exp?: Expression; - }; - exp?: never; - /** A mapping of transition-name to FlowState name */ - transitions: Record; - /** An id corresponding to a view from the 'views' array */ - ref: string; - /** View meta-properties */ - attributes?: { - [key: string]: any; - }; -} -/** An END state of the flow. */ -export interface NavigationFlowEndState { - /** Add comments that will not be processing, but are useful for code explanation */ - _comment?: string; - /** A property to determine the type of state this is */ - state_type: 'END'; - /** An optional expression to run when this view renders */ - onStart?: Expression | { - /** The expression to run */ - exp?: Expression; - }; - /** An optional expression to run before view transition */ - onEnd?: Expression | { - /** The expression to run */ - exp?: Expression; - }; - exp?: never; - /** - * A description of _how_ the flow ended. - * If this is a flow started from another flow, the outcome determines the flow transition - */ - outcome: string; -} -/** Action states execute an expression to determine the next state to transition to */ -export interface NavigationFlowActionState { - /** Add comments that will not be processing, but are useful for code explanation */ - _comment?: string; - /** A property to determine the type of state this is */ - state_type: 'ACTION'; - /** An optional expression to run when this view renders */ - onStart?: Expression | { - /** The expression to run */ - exp?: Expression; - }; - /** An optional expression to run before view transition */ - onEnd?: Expression | { - /** The expression to run */ - exp?: Expression; - }; - /** - * An expression to execute. - * The return value determines the transition to take - */ - exp: Expression; - /** A mapping of transition-name to FlowState name */ - transitions: Record; -} -/** - * External Flow states represent states in the FSM that can't be resolved internally in Player. - * The flow will wait for the embedded application to manage moving to the next state via a transition -*/ -export interface NavigationFlowExternalState { - /** Add comments that will not be processing, but are useful for code explanation */ - _comment?: string; - /** A property to determine the type of state this is */ - state_type: 'EXTERNAL'; - /** An optional expression to run when this view renders */ - onStart?: Expression | { - /** The expression to run */ - exp?: Expression; - }; - /** An optional expression to run before view transition */ - onEnd?: Expression | { - /** The expression to run */ - exp?: Expression; - }; - exp?: never; - /** A mapping of transition-name to FlowState name */ - transitions: Record; - /** A reference for this external state */ - ref: string; -} -export interface NavigationFlowFlowState { - /** Add comments that will not be processing, but are useful for code explanation */ - _comment?: string; - /** A property to determine the type of state this is */ - state_type: 'FLOW'; - /** An optional expression to run when this view renders */ - onStart?: Expression | { - /** The expression to run */ - exp?: Expression; - }; - /** An optional expression to run before view transition */ - onEnd?: Expression | { - /** The expression to run */ - exp?: Expression; - }; - exp?: never; - /** A mapping of transition-name to FlowState name */ - transitions: Record; - /** A reference to a FLOW id state to run */ - ref: string; -} -export type NavigationFlowState = { - /** Add comments that will not be processing, but are useful for code explanation */ - _comment?: string; - /** A property to determine the type of state this is */ - state_type: 'VIEW'; - /** An optional expression to run when this view renders */ - onStart?: Expression | { - /** The expression to run */ - exp?: Expression; - }; - /** An optional expression to run before view transition */ - onEnd?: Expression | { - /** The expression to run */ - exp?: Expression; - }; - exp?: never; - /** A mapping of transition-name to FlowState name */ - transitions: Record; - /** An id corresponding to a view from the 'views' array */ - ref: string; - /** View meta-properties */ - attributes?: { - [key: string]: any; - }; -} | { - /** Add comments that will not be processing, but are useful for code explanation */ - _comment?: string; - /** A property to determine the type of state this is */ - state_type: 'END'; - /** An optional expression to run when this view renders */ - onStart?: Expression | { - /** The expression to run */ - exp?: Expression; - }; - /** An optional expression to run before view transition */ - onEnd?: Expression | { - /** The expression to run */ - exp?: Expression; - }; - exp?: never; - /** - * A description of _how_ the flow ended. - * If this is a flow started from another flow, the outcome determines the flow transition - */ - outcome: string; -} | { - /** Add comments that will not be processing, but are useful for code explanation */ - _comment?: string; - /** A property to determine the type of state this is */ - state_type: 'FLOW'; - /** An optional expression to run when this view renders */ - onStart?: Expression | { - /** The expression to run */ - exp?: Expression; - }; - /** An optional expression to run before view transition */ - onEnd?: Expression | { - /** The expression to run */ - exp?: Expression; - }; - exp?: never; - /** A mapping of transition-name to FlowState name */ - transitions: Record; - /** A reference to a FLOW id state to run */ - ref: string; -} | { - /** Add comments that will not be processing, but are useful for code explanation */ - _comment?: string; - /** A property to determine the type of state this is */ - state_type: 'ACTION'; - /** An optional expression to run when this view renders */ - onStart?: Expression | { - /** The expression to run */ - exp?: Expression; - }; - /** An optional expression to run before view transition */ - onEnd?: Expression | { - /** The expression to run */ - exp?: Expression; - }; - /** - * An expression to execute. - * The return value determines the transition to take - */ - exp: Expression; - /** A mapping of transition-name to FlowState name */ - transitions: Record; -} | { - /** Add comments that will not be processing, but are useful for code explanation */ - _comment?: string; - /** A property to determine the type of state this is */ - state_type: 'EXTERNAL'; - /** An optional expression to run when this view renders */ - onStart?: Expression | { - /** The expression to run */ - exp?: Expression; - }; - /** An optional expression to run before view transition */ - onEnd?: Expression | { - /** The expression to run */ - exp?: Expression; - }; - exp?: never; - /** A mapping of transition-name to FlowState name */ - transitions: Record; - /** A reference for this external state */ - ref: string; -}; -/** The data at the end of a flow */ -export interface FlowResult { - /** The outcome describes _how_ the flow ended (forwards, backwards, etc) */ - endState: { - /** Add comments that will not be processing, but are useful for code explanation */ - _comment?: string; - /** A property to determine the type of state this is */ - state_type: 'END'; - /** An optional expression to run when this view renders */ - onStart?: Expression | { - /** The expression to run */ - exp?: Expression; - }; - /** An optional expression to run before view transition */ - onEnd?: Expression | { - /** The expression to run */ - exp?: Expression; - }; - exp?: never; - /** - * A description of _how_ the flow ended. - * If this is a flow started from another flow, the outcome determines the flow transition - */ - outcome: string; - }; - /** The serialized data-model */ - data?: any; -} -/** Any object that contains 1 or more templates */ -export interface Templatable { - /** A list of templates to process for this node */ - template?: Array<{ - /** A pointer to the data-model containing an array of elements to map over */ - data: Binding; - /** - * The template to iterate over using each value in the supplied template data. - * Any reference to _index_ is replaced with the current iteration index. - */ - value: ValueType; - /** should the template be recomputed when data changes */ - dynamic?: boolean; - /** - * A property on the parent object to store the new map under. - * If it already exists, values are appended to the end. - */ - output: Key; - }>; -} -/** A template describes a mapping from a data array -> array of objects */ -export interface Template { - /** A pointer to the data-model containing an array of elements to map over */ - data: Binding; - /** - * The template to iterate over using each value in the supplied template data. - * Any reference to _index_ is replaced with the current iteration index. - */ - value: ValueType; - /** should the template be recomputed when data changes */ - dynamic?: boolean; - /** - * A property on the parent object to store the new map under. - * If it already exists, values are appended to the end. - */ - output: Key; -} -export type View = unknown extends unknown ? T & { - /** Each view can optionally supply a list of validations to run against a particular view */ - validation?: Array<{ - /** - * The name of the referenced validation type - * This will be used to lookup the proper handler - */ - type: string; - /** An optional means of overriding the default message if the validation is triggered */ - message?: string; - /** An optional means of overriding the default severity of the validation if triggered */ - severity?: 'error' | 'warning'; - /** When to run this particular validation */ - trigger?: 'navigation' | 'change' | 'load'; - /** Cross-field references and validation must run against the default (deformatted) value */ - dataTarget?: never; - /** Where the error should be displayed */ - displayTarget?: 'page' | 'section' | 'field'; - /** The binding to associate this validation with */ - ref?: Binding; - [key: string]: unknown; - }>; -} : T; -/** The JSON payload for running Player */ -export interface Flow { - /** A unique identifier for the flow */ - id: string; - /** A list of views (each with an ID) that can be shown to a user */ - views?: Array; - } : T>; - /** - * The schema for the supplied (or referenced data). - * This is used for validation, formatting, etc - */ - schema?: { - /** The ROOT object is the top level object to use */ - ROOT: { - [key: string]: { - /** The reference of the base type to use */ - type: string; - /** The referenced object represents an array rather than an object */ - isArray?: boolean; - /** - * Any additional validations that are associated with this property - * These will add to any base validations associated with the \\"type\\" - */ - validation?: Array<{ - /** - * The name of the referenced validation type - * This will be used to lookup the proper handler - */ - type: string; - /** An optional means of overriding the default message if the validation is triggered */ - message?: string; - /** An optional means of overriding the default severity of the validation if triggered */ - severity?: 'error' | 'warning'; - /** When to run this particular validation */ - trigger?: 'navigation' | 'change' | 'load'; - /** - * Each validation is passed the value of the data to run it's validation against. - * By default, this is the value stored in the data-model (deformatted). - * In the off chance you'd like this validator to run against the formatted value (the one the user sees), set this option - */ - dataTarget?: 'formatted' | 'deformatted'; - /** Where the error should be displayed */ - displayTarget?: 'page' | 'section' | 'field'; - [key: string]: unknown; - }>; - /** - * A reference to a specific data format to use. - * If none is specified, will fallback to that of the base type - */ - format?: { - /** The name of the formatter (and de-formatter) to use */ - type: string; - [key: string]: unknown; - }; - /** - * A default value for this property. - * Any reads for this property will result in this default value being written to the model. - */ - default?: T; - [key: string]: unknown; - }; - }; - [key: string]: { - [key: string]: { - /** The reference of the base type to use */ - type: string; - /** The referenced object represents an array rather than an object */ - isArray?: boolean; - /** - * Any additional validations that are associated with this property - * These will add to any base validations associated with the \\"type\\" - */ - validation?: Array<{ - /** - * The name of the referenced validation type - * This will be used to lookup the proper handler - */ - type: string; - /** An optional means of overriding the default message if the validation is triggered */ - message?: string; - /** An optional means of overriding the default severity of the validation if triggered */ - severity?: 'error' | 'warning'; - /** When to run this particular validation */ - trigger?: 'navigation' | 'change' | 'load'; - /** - * Each validation is passed the value of the data to run it's validation against. - * By default, this is the value stored in the data-model (deformatted). - * In the off chance you'd like this validator to run against the formatted value (the one the user sees), set this option - */ - dataTarget?: 'formatted' | 'deformatted'; - /** Where the error should be displayed */ - displayTarget?: 'page' | 'section' | 'field'; - [key: string]: unknown; - }>; - /** - * A reference to a specific data format to use. - * If none is specified, will fallback to that of the base type - */ - format?: { - /** The name of the formatter (and de-formatter) to use */ - type: string; - [key: string]: unknown; - }; - /** - * A default value for this property. - * Any reads for this property will result in this default value being written to the model. - */ - default?: T; - [key: string]: unknown; - }; - }; - }; - /** Any initial data that the flow can use */ - data?: Record; - /** A state machine to drive a user through the experience */ - navigation: { - /** The name of the Flow to begin on */ - BEGIN: string; - } & Record; - /** An id corresponding to a view from the 'views' array */ - ref: string; - /** View meta-properties */ - attributes?: { - [key: string]: any; - }; - } | { - /** Add comments that will not be processing, but are useful for code explanation */ - _comment?: string; - /** A property to determine the type of state this is */ - state_type: 'END'; - /** An optional expression to run when this view renders */ - onStart?: Expression | { - /** The expression to run */ - exp?: Expression; - }; - /** An optional expression to run before view transition */ - onEnd?: Expression | { - /** The expression to run */ - exp?: Expression; - }; - exp?: never; - /** - * A description of _how_ the flow ended. - * If this is a flow started from another flow, the outcome determines the flow transition - */ - outcome: string; - } | { - /** Add comments that will not be processing, but are useful for code explanation */ - _comment?: string; - /** A property to determine the type of state this is */ - state_type: 'FLOW'; - /** An optional expression to run when this view renders */ - onStart?: Expression | { - /** The expression to run */ - exp?: Expression; - }; - /** An optional expression to run before view transition */ - onEnd?: Expression | { - /** The expression to run */ - exp?: Expression; - }; - exp?: never; - /** A mapping of transition-name to FlowState name */ - transitions: Record; - /** A reference to a FLOW id state to run */ - ref: string; - } | { - /** Add comments that will not be processing, but are useful for code explanation */ - _comment?: string; - /** A property to determine the type of state this is */ - state_type: 'ACTION'; - /** An optional expression to run when this view renders */ - onStart?: Expression | { - /** The expression to run */ - exp?: Expression; - }; - /** An optional expression to run before view transition */ - onEnd?: Expression | { - /** The expression to run */ - exp?: Expression; - }; - /** - * An expression to execute. - * The return value determines the transition to take - */ - exp: Expression; - /** A mapping of transition-name to FlowState name */ - transitions: Record; - } | { - /** Add comments that will not be processing, but are useful for code explanation */ - _comment?: string; - /** A property to determine the type of state this is */ - state_type: 'EXTERNAL'; - /** An optional expression to run when this view renders */ - onStart?: Expression | { - /** The expression to run */ - exp?: Expression; - }; - /** An optional expression to run before view transition */ - onEnd?: Expression | { - /** The expression to run */ - exp?: Expression; - }; - exp?: never; - /** A mapping of transition-name to FlowState name */ - transitions: Record; - /** A reference for this external state */ - ref: string; - }); - }>; - [key: string]: unknown; -}" +Array [ + Object { + "additionalProperties": Object { + "type": "unknown", + }, + "description": "This is the most generic way of gathering data. The input is bound to a data model using the 'binding' property. +Players can get field type information from the 'schema' definition, thus to decide the input controls for visual rendering.", + "extends": undefined, + "genericTokens": Array [ + Object { + "constraints": Object { + "ref": "Asset", + "type": "ref", + }, + "default": Object { + "ref": "Asset", + "type": "ref", + }, + "symbol": "AnyTextAsset", + }, + ], + "name": "InputAsset", + "properties": Object { + "binding": Object { + "node": Object { + "description": "The location in the data-model to store the data", + "genericArguments": undefined, + "ref": "Binding", + "title": "InputAsset.binding", + "type": "ref", + }, + "required": true, + }, + "id": Object { + "node": Object { + "description": "Each asset requires a unique id per view", + "title": "Asset.id", + "type": "string", + }, + "required": true, + }, + "label": Object { + "node": Object { + "description": "Asset container for a field label.", + "genericArguments": Array [ + Object { + "genericArguments": undefined, + "ref": "AnyTextAsset", + "type": "ref", + }, + ], + "ref": "AssetWrapper", + "title": "InputAsset.label", + "type": "ref", + }, + "required": false, + }, + "metaData": Object { + "node": Object { + "additionalProperties": false, + "description": "Optional additional data", + "extends": undefined, + "properties": Object { + "beacon": Object { + "node": Object { + "description": "Additional data to beacon when this input changes", + "name": "BeaconDataType", + "or": Array [ + Object { + "title": "BeaconDataType", + "type": "string", + }, + Object { + "keyType": Object { + "type": "string", + }, + "title": "BeaconDataType", + "type": "record", + "valueType": Object { + "type": "any", + }, + }, + ], + "source": "/private/var/tmp/_bazel_kreddy8/6fc13ccb395252816f0c23d8394e8532/sandbox/darwin-sandbox/134/execroot/player/node_modules/@player-ui/beacon-plugin/dist/index.d.ts", + "title": "InputAsset.metaData.beacon", + "type": "or", + }, + "required": false, + }, + }, + "title": "InputAsset.metaData", + "type": "object", + }, + "required": false, + }, + "note": Object { + "node": Object { + "description": "Asset container for a note.", + "genericArguments": Array [ + Object { + "genericArguments": undefined, + "ref": "AnyTextAsset", + "type": "ref", + }, + ], + "ref": "AssetWrapper", + "title": "InputAsset.note", + "type": "ref", + }, + "required": false, + }, + "transformed": Object { + "node": Object { + "const": true, + "type": "boolean", + }, + "required": false, + }, + "type": Object { + "node": Object { + "const": "input", + "description": "The asset type determines the semantics of how a user interacts with a page", + "title": "Asset.type", + "type": "string", + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "Asset", + "type": "object", + }, + Object { + "additionalProperties": Object { + "type": "unknown", + }, + "description": undefined, + "extends": undefined, + "genericTokens": Array [], + "name": "TextAsset", + "properties": Object { + "id": Object { + "node": Object { + "description": "Each asset requires a unique id per view", + "title": "Asset.id", + "type": "string", + }, + "required": true, + }, + "modifiers": Object { + "node": Object { + "description": "Any modifiers on the text", + "elementType": Object { + "name": "TextModifier", + "or": Array [ + Object { + "additionalProperties": Object { + "type": "unknown", + }, + "extends": undefined, + "name": "BasicTextModifier", + "properties": Object { + "name": Object { + "node": Object { + "description": "Modifiers can be named when used in strings", + "title": "BasicTextModifier.name", + "type": "string", + }, + "required": false, + }, + "type": Object { + "node": Object { + "description": "The modifier type", + "title": "BasicTextModifier.type", + "type": "string", + }, + "required": true, + }, + }, + "source": "/private/var/tmp/_bazel_kreddy8/6fc13ccb395252816f0c23d8394e8532/sandbox/darwin-sandbox/134/execroot/player/node_modules/@player-ui/reference-assets-plugin/dist/index.d.ts", + "title": "BasicTextModifier", + "type": "object", + }, + Object { + "additionalProperties": false, + "description": "A modifier to turn the text into a link", + "extends": undefined, + "name": "LinkModifier", + "properties": Object { + "exp": Object { + "node": Object { + "description": "An optional expression to run before the link is opened", + "genericArguments": undefined, + "ref": "Expression", + "title": "LinkModifier.exp", + "type": "ref", + }, + "required": false, + }, + "metaData": Object { + "node": Object { + "additionalProperties": false, + "description": "metaData about the link's target", + "extends": undefined, + "properties": Object { + "'mime-type'": Object { + "node": Object { + "description": "Used to indicate an application specific resolver to use", + "title": "LinkModifier.metaData.'mime-type'", + "type": "string", + }, + "required": false, + }, + "ref": Object { + "node": Object { + "description": "The location of the link to load", + "title": "LinkModifier.metaData.ref", + "type": "string", + }, + "required": true, + }, + }, + "title": "LinkModifier.metaData", + "type": "object", + }, + "required": true, + }, + "type": Object { + "node": Object { + "const": "link", + "description": "The link type denotes this as a link", + "title": "LinkModifier.type", + "type": "string", + }, + "required": true, + }, + }, + "source": "/private/var/tmp/_bazel_kreddy8/6fc13ccb395252816f0c23d8394e8532/sandbox/darwin-sandbox/134/execroot/player/node_modules/@player-ui/reference-assets-plugin/dist/index.d.ts", + "title": "LinkModifier", + "type": "object", + }, + ], + "source": "/private/var/tmp/_bazel_kreddy8/6fc13ccb395252816f0c23d8394e8532/sandbox/darwin-sandbox/134/execroot/player/node_modules/@player-ui/reference-assets-plugin/dist/index.d.ts", + "title": "TextModifier", + "type": "or", + }, + "title": "TextAsset.modifiers", + "type": "array", + }, + "required": false, + }, + "transformed": Object { + "node": Object { + "const": true, + "type": "boolean", + }, + "required": false, + }, + "type": Object { + "node": Object { + "const": "text", + "description": "The asset type determines the semantics of how a user interacts with a page", + "title": "Asset.type", + "type": "string", + }, + "required": true, + }, + "value": Object { + "node": Object { + "description": "The text to display", + "title": "TextAsset.value", + "type": "string", + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "Asset", + "type": "object", + }, + Object { + "additionalProperties": Object { + "type": "unknown", + }, + "description": "User actions can be represented in several places. +Each view typically has one or more actions that allow the user to navigate away from that view. +In addition, several asset types can have actions that apply to that asset only.", + "extends": undefined, + "genericTokens": Array [ + Object { + "constraints": Object { + "ref": "Asset", + "type": "ref", + }, + "default": Object { + "ref": "Asset", + "type": "ref", + }, + "symbol": "AnyTextAsset", + }, + ], + "name": "ActionAsset", + "properties": Object { + "accessibility": Object { + "node": Object { + "description": "An optional string that describes the action for screen-readers", + "title": "ActionAsset.accessibility", + "type": "string", + }, + "required": false, + }, + "exp": Object { + "node": Object { + "description": "An optional expression to execute before transitioning", + "genericArguments": undefined, + "ref": "Expression", + "title": "ActionAsset.exp", + "type": "ref", + }, + "required": false, + }, + "id": Object { + "node": Object { + "description": "Each asset requires a unique id per view", + "title": "Asset.id", + "type": "string", + }, + "required": true, + }, + "label": Object { + "node": Object { + "description": "A text-like asset for the action's label", + "genericArguments": Array [ + Object { + "genericArguments": undefined, + "ref": "AnyTextAsset", + "type": "ref", + }, + ], + "ref": "AssetWrapper", + "title": "ActionAsset.label", + "type": "ref", + }, + "required": false, + }, + "metaData": Object { + "node": Object { + "additionalProperties": false, + "description": "Additional optional data to assist with the action interactions on the page", + "extends": undefined, + "properties": Object { + "beacon": Object { + "node": Object { + "description": "Additional data to beacon", + "name": "BeaconDataType", + "or": Array [ + Object { + "title": "BeaconDataType", + "type": "string", + }, + Object { + "keyType": Object { + "type": "string", + }, + "title": "BeaconDataType", + "type": "record", + "valueType": Object { + "type": "any", + }, + }, + ], + "source": "/private/var/tmp/_bazel_kreddy8/6fc13ccb395252816f0c23d8394e8532/sandbox/darwin-sandbox/134/execroot/player/node_modules/@player-ui/beacon-plugin/dist/index.d.ts", + "title": "ActionAsset.metaData.beacon", + "type": "or", + }, + "required": false, + }, + "skipValidation": Object { + "node": Object { + "description": "Force transition to the next view without checking for validation", + "title": "ActionAsset.metaData.skipValidation", + "type": "boolean", + }, + "required": false, + }, + }, + "title": "ActionAsset.metaData", + "type": "object", + }, + "required": false, + }, + "transformed": Object { + "node": Object { + "const": true, + "type": "boolean", + }, + "required": false, + }, + "type": Object { + "node": Object { + "const": "action", + "description": "The asset type determines the semantics of how a user interacts with a page", + "title": "Asset.type", + "type": "string", + }, + "required": true, + }, + "value": Object { + "node": Object { + "description": "The transition value of the action in the state machine", + "title": "ActionAsset.value", + "type": "string", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "Asset", + "type": "object", + }, + Object { + "additionalProperties": Object { + "type": "unknown", + }, + "description": undefined, + "extends": undefined, + "genericTokens": Array [], + "name": "InfoAsset", + "properties": Object { + "actions": Object { + "node": Object { + "description": "List of actions to show at the bottom of the page", + "elementType": Object { + "genericArguments": undefined, + "ref": "AssetWrapper", + "type": "ref", + }, + "title": "InfoAsset.actions", + "type": "array", + }, + "required": false, + }, + "id": Object { + "node": Object { + "description": "Each asset requires a unique id per view", + "title": "Asset.id", + "type": "string", + }, + "required": true, + }, + "primaryInfo": Object { + "node": Object { + "description": "Primary place for info", + "genericArguments": undefined, + "ref": "AssetWrapper", + "title": "InfoAsset.primaryInfo", + "type": "ref", + }, + "required": false, + }, + "subTitle": Object { + "node": Object { + "description": "subtitle", + "genericArguments": undefined, + "ref": "AssetWrapper", + "title": "InfoAsset.subTitle", + "type": "ref", + }, + "required": false, + }, + "title": Object { + "node": Object { + "description": "The string value to show", + "genericArguments": undefined, + "ref": "AssetWrapper", + "title": "InfoAsset.title", + "type": "ref", + }, + "required": false, + }, + "transformed": Object { + "node": Object { + "const": true, + "type": "boolean", + }, + "required": false, + }, + "type": Object { + "node": Object { + "const": "info", + "description": "The asset type determines the semantics of how a user interacts with a page", + "title": "Asset.type", + "type": "string", + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "Asset", + "type": "object", + }, + Object { + "additionalProperties": Object { + "type": "unknown", + }, + "description": undefined, + "extends": undefined, + "genericTokens": Array [], + "name": "CollectionAsset", + "properties": Object { + "id": Object { + "node": Object { + "description": "Each asset requires a unique id per view", + "title": "Asset.id", + "type": "string", + }, + "required": true, + }, + "label": Object { + "node": Object { + "description": "An optional label to title the collection", + "genericArguments": undefined, + "ref": "AssetWrapper", + "title": "CollectionAsset.label", + "type": "ref", + }, + "required": false, + }, + "transformed": Object { + "node": Object { + "const": true, + "type": "boolean", + }, + "required": false, + }, + "type": Object { + "node": Object { + "const": "collection", + "description": "The asset type determines the semantics of how a user interacts with a page", + "title": "Asset.type", + "type": "string", + }, + "required": true, + }, + "values": Object { + "node": Object { + "description": "The string value to show", + "elementType": Object { + "genericArguments": undefined, + "ref": "AssetWrapper", + "type": "ref", + }, + "title": "CollectionAsset.values", + "type": "array", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "Asset", + "type": "object", + }, + Object { + "additionalProperties": Object { + "type": "unknown", + }, + "description": "An asset is the smallest unit of user interaction in a player view", + "extends": undefined, + "genericTokens": Array [ + Object { + "constraints": Object { + "type": "string", + }, + "default": Object { + "type": "string", + }, + "symbol": "T", + }, + ], + "name": "Asset", + "properties": Object { + "id": Object { + "node": Object { + "description": "Each asset requires a unique id per view", + "title": "Asset.id", + "type": "string", + }, + "required": true, + }, + "type": Object { + "node": Object { + "description": "The asset type determines the semantics of how a user interacts with a page", + "genericArguments": undefined, + "ref": "T", + "title": "Asset.type", + "type": "ref", + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "Asset", + "type": "object", + }, + Object { + "additionalProperties": Object { + "type": "unknown", + }, + "description": "An asset that contains a Binding.", + "extends": undefined, + "genericTokens": Array [ + Object { + "constraints": Object { + "type": "string", + }, + "default": Object { + "type": "string", + }, + "symbol": "T", + }, + ], + "name": "AssetBinding", + "properties": Object { + "binding": Object { + "node": Object { + "description": "A binding that points to somewhere in the data model", + "genericArguments": undefined, + "ref": "Binding", + "title": "AssetBinding.binding", + "type": "ref", + }, + "required": true, + }, + "id": Object { + "node": Object { + "description": "Each asset requires a unique id per view", + "title": "Asset.id", + "type": "string", + }, + "required": true, + }, + "type": Object { + "node": Object { + "description": "The asset type determines the semantics of how a user interacts with a page", + "genericArguments": undefined, + "ref": "T", + "title": "Asset.type", + "type": "ref", + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "Asset", + "type": "object", + }, + Object { + "additionalProperties": false, + "description": "A single case statement to use in a switch", + "extends": undefined, + "genericTokens": Array [ + Object { + "constraints": Object { + "ref": "Asset", + "type": "ref", + }, + "default": Object { + "ref": "Asset", + "type": "ref", + }, + "symbol": "T", + }, + ], + "name": "SwitchCase", + "properties": Object { + "asset": Object { + "node": Object { + "description": "The Asset to use if this case is applicable", + "genericArguments": undefined, + "ref": "T", + "title": "SwitchCase.asset", + "type": "ref", + }, + "required": true, + }, + "case": Object { + "node": Object { + "description": "An expression to execute to determine if this case applies", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "SwitchCase.case", + "type": "ref", + }, + Object { + "const": true, + "title": "SwitchCase.case", + "type": "boolean", + }, + ], + "title": "SwitchCase.case", + "type": "or", + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "SwitchCase", + "type": "object", + }, + Object { + "description": "A switch can replace an asset with the applicable case on first render", + "elementType": Object { + "additionalProperties": false, + "description": "A single case statement to use in a switch", + "extends": undefined, + "genericTokens": Array [ + Object { + "constraints": Object { + "ref": "Asset", + "type": "ref", + }, + "default": Object { + "ref": "Asset", + "type": "ref", + }, + "symbol": "T", + }, + ], + "name": "SwitchCase", + "properties": Object { + "asset": Object { + "node": Object { + "description": "The Asset to use if this case is applicable", + "genericArguments": undefined, + "ref": "T", + "title": "SwitchCase.asset", + "type": "ref", + }, + "required": true, + }, + "case": Object { + "node": Object { + "description": "An expression to execute to determine if this case applies", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "SwitchCase.case", + "type": "ref", + }, + Object { + "const": true, + "title": "SwitchCase.case", + "type": "boolean", + }, + ], + "title": "SwitchCase.case", + "type": "or", + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "SwitchCase", + "type": "object", + }, + "genericTokens": Array [ + Object { + "constraints": Object { + "ref": "Asset", + "type": "ref", + }, + "default": Object { + "ref": "Asset", + "type": "ref", + }, + "symbol": "T", + }, + ], + "name": "Switch", + "source": "src/index.ts", + "title": "Switch", + "type": "array", + }, + Object { + "additionalProperties": Object { + "type": "unknown", + }, + "description": "An object that contains an asset", + "extends": undefined, + "genericTokens": Array [ + Object { + "constraints": Object { + "ref": "Asset", + "type": "ref", + }, + "default": Object { + "ref": "Asset", + "type": "ref", + }, + "symbol": "T", + }, + ], + "name": "AssetWrapper", + "properties": Object { + "asset": Object { + "node": Object { + "description": "An asset instance", + "genericArguments": undefined, + "ref": "T", + "title": "AssetWrapper.asset", + "type": "ref", + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "AssetWrapper", + "type": "object", + }, + Object { + "genericTokens": Array [ + Object { + "constraints": Object { + "ref": "Asset", + "type": "ref", + }, + "default": Object { + "ref": "Asset", + "type": "ref", + }, + "symbol": "T", + }, + ], + "name": "AssetWrapperOrSwitch", + "or": Array [ + Object { + "and": Array [ + Object { + "genericArguments": Array [ + Object { + "genericArguments": undefined, + "ref": "T", + "type": "ref", + }, + ], + "ref": "AssetWrapper", + "type": "ref", + }, + Object { + "additionalProperties": false, + "extends": undefined, + "properties": Object { + "dynamicSwitch": Object { + "node": Object { + "description": "The dynamicSwitch property can't exist at the same time as 'asset'", + "title": "dynamicSwitch", + "type": "never", + }, + "required": false, + }, + "staticSwitch": Object { + "node": Object { + "description": "The staticSwitch property can't exist at the same time as 'asset'", + "title": "staticSwitch", + "type": "never", + }, + "required": false, + }, + }, + "type": "object", + }, + ], + "type": "and", + }, + Object { + "and": Array [ + Object { + "additionalProperties": false, + "extends": undefined, + "genericTokens": Array [ + Object { + "constraints": Object { + "ref": "Asset", + "type": "ref", + }, + "default": Object { + "ref": "Asset", + "type": "ref", + }, + "symbol": "T", + }, + ], + "name": "StaticSwitch", + "properties": Object { + "staticSwitch": Object { + "node": Object { + "description": "A static switch only evaluates the applicable base on first render of the view", + "elementType": Object { + "additionalProperties": false, + "description": "A single case statement to use in a switch", + "extends": undefined, + "genericTokens": Array [ + Object { + "constraints": Object { + "ref": "Asset", + "type": "ref", + }, + "default": Object { + "ref": "Asset", + "type": "ref", + }, + "symbol": "T", + }, + ], + "name": "SwitchCase", + "properties": Object { + "asset": Object { + "node": Object { + "description": "The Asset to use if this case is applicable", + "genericArguments": undefined, + "ref": "T", + "title": "SwitchCase.asset", + "type": "ref", + }, + "required": true, + }, + "case": Object { + "node": Object { + "description": "An expression to execute to determine if this case applies", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "SwitchCase.case", + "type": "ref", + }, + Object { + "const": true, + "title": "SwitchCase.case", + "type": "boolean", + }, + ], + "title": "SwitchCase.case", + "type": "or", + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "SwitchCase", + "type": "object", + }, + "genericTokens": Array [ + Object { + "constraints": Object { + "ref": "Asset", + "type": "ref", + }, + "default": Object { + "ref": "Asset", + "type": "ref", + }, + "symbol": "T", + }, + ], + "name": "Switch", + "source": "src/index.ts", + "title": "StaticSwitch.staticSwitch", + "type": "array", + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "StaticSwitch", + "type": "object", + }, + Object { + "additionalProperties": false, + "extends": undefined, + "properties": Object { + "asset": Object { + "node": Object { + "description": "The staticSwitch property can't exist at the same time as 'asset'", + "title": "asset", + "type": "never", + }, + "required": false, + }, + "dynamicSwitch": Object { + "node": Object { + "description": "The staticSwitch property can't exist at the same time as 'dynamicSwitch'", + "title": "dynamicSwitch", + "type": "never", + }, + "required": false, + }, + }, + "type": "object", + }, + ], + "type": "and", + }, + Object { + "and": Array [ + Object { + "additionalProperties": false, + "extends": undefined, + "genericTokens": Array [ + Object { + "constraints": Object { + "ref": "Asset", + "type": "ref", + }, + "default": Object { + "ref": "Asset", + "type": "ref", + }, + "symbol": "T", + }, + ], + "name": "DynamicSwitch", + "properties": Object { + "dynamicSwitch": Object { + "node": Object { + "description": "A dynamic switch re-evaluates the applicable case as data changes", + "elementType": Object { + "additionalProperties": false, + "description": "A single case statement to use in a switch", + "extends": undefined, + "genericTokens": Array [ + Object { + "constraints": Object { + "ref": "Asset", + "type": "ref", + }, + "default": Object { + "ref": "Asset", + "type": "ref", + }, + "symbol": "T", + }, + ], + "name": "SwitchCase", + "properties": Object { + "asset": Object { + "node": Object { + "description": "The Asset to use if this case is applicable", + "genericArguments": undefined, + "ref": "T", + "title": "SwitchCase.asset", + "type": "ref", + }, + "required": true, + }, + "case": Object { + "node": Object { + "description": "An expression to execute to determine if this case applies", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "SwitchCase.case", + "type": "ref", + }, + Object { + "const": true, + "title": "SwitchCase.case", + "type": "boolean", + }, + ], + "title": "SwitchCase.case", + "type": "or", + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "SwitchCase", + "type": "object", + }, + "genericTokens": Array [ + Object { + "constraints": Object { + "ref": "Asset", + "type": "ref", + }, + "default": Object { + "ref": "Asset", + "type": "ref", + }, + "symbol": "T", + }, + ], + "name": "Switch", + "source": "src/index.ts", + "title": "DynamicSwitch.dynamicSwitch", + "type": "array", + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "DynamicSwitch", + "type": "object", + }, + Object { + "additionalProperties": false, + "extends": undefined, + "properties": Object { + "asset": Object { + "node": Object { + "description": "The dynamicSwitch property can't exist at the same time as 'asset'", + "title": "asset", + "type": "never", + }, + "required": false, + }, + "staticSwitch": Object { + "node": Object { + "description": "The dynamicSwitch property can't exist at the same time as 'staticSwitch'", + "title": "staticSwitch", + "type": "never", + }, + "required": false, + }, + }, + "type": "object", + }, + ], + "type": "and", + }, + ], + "source": "src/index.ts", + "title": "AssetWrapperOrSwitch", + "type": "or", + }, + Object { + "genericTokens": Array [ + Object { + "constraints": Object { + "ref": "Asset", + "type": "ref", + }, + "default": Object { + "ref": "Asset", + "type": "ref", + }, + "symbol": "T", + }, + ], + "name": "AssetSwitch", + "or": Array [ + Object { + "additionalProperties": false, + "extends": undefined, + "genericTokens": Array [ + Object { + "constraints": Object { + "ref": "Asset", + "type": "ref", + }, + "default": Object { + "ref": "Asset", + "type": "ref", + }, + "symbol": "T", + }, + ], + "name": "StaticSwitch", + "properties": Object { + "staticSwitch": Object { + "node": Object { + "description": "A static switch only evaluates the applicable base on first render of the view", + "elementType": Object { + "additionalProperties": false, + "description": "A single case statement to use in a switch", + "extends": undefined, + "genericTokens": Array [ + Object { + "constraints": Object { + "ref": "Asset", + "type": "ref", + }, + "default": Object { + "ref": "Asset", + "type": "ref", + }, + "symbol": "T", + }, + ], + "name": "SwitchCase", + "properties": Object { + "asset": Object { + "node": Object { + "description": "The Asset to use if this case is applicable", + "genericArguments": undefined, + "ref": "T", + "title": "SwitchCase.asset", + "type": "ref", + }, + "required": true, + }, + "case": Object { + "node": Object { + "description": "An expression to execute to determine if this case applies", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "SwitchCase.case", + "type": "ref", + }, + Object { + "const": true, + "title": "SwitchCase.case", + "type": "boolean", + }, + ], + "title": "SwitchCase.case", + "type": "or", + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "SwitchCase", + "type": "object", + }, + "genericTokens": Array [ + Object { + "constraints": Object { + "ref": "Asset", + "type": "ref", + }, + "default": Object { + "ref": "Asset", + "type": "ref", + }, + "symbol": "T", + }, + ], + "name": "Switch", + "source": "src/index.ts", + "title": "StaticSwitch.staticSwitch", + "type": "array", + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "StaticSwitch", + "type": "object", + }, + Object { + "additionalProperties": false, + "extends": undefined, + "genericTokens": Array [ + Object { + "constraints": Object { + "ref": "Asset", + "type": "ref", + }, + "default": Object { + "ref": "Asset", + "type": "ref", + }, + "symbol": "T", + }, + ], + "name": "DynamicSwitch", + "properties": Object { + "dynamicSwitch": Object { + "node": Object { + "description": "A dynamic switch re-evaluates the applicable case as data changes", + "elementType": Object { + "additionalProperties": false, + "description": "A single case statement to use in a switch", + "extends": undefined, + "genericTokens": Array [ + Object { + "constraints": Object { + "ref": "Asset", + "type": "ref", + }, + "default": Object { + "ref": "Asset", + "type": "ref", + }, + "symbol": "T", + }, + ], + "name": "SwitchCase", + "properties": Object { + "asset": Object { + "node": Object { + "description": "The Asset to use if this case is applicable", + "genericArguments": undefined, + "ref": "T", + "title": "SwitchCase.asset", + "type": "ref", + }, + "required": true, + }, + "case": Object { + "node": Object { + "description": "An expression to execute to determine if this case applies", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "SwitchCase.case", + "type": "ref", + }, + Object { + "const": true, + "title": "SwitchCase.case", + "type": "boolean", + }, + ], + "title": "SwitchCase.case", + "type": "or", + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "SwitchCase", + "type": "object", + }, + "genericTokens": Array [ + Object { + "constraints": Object { + "ref": "Asset", + "type": "ref", + }, + "default": Object { + "ref": "Asset", + "type": "ref", + }, + "symbol": "T", + }, + ], + "name": "Switch", + "source": "src/index.ts", + "title": "DynamicSwitch.dynamicSwitch", + "type": "array", + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "DynamicSwitch", + "type": "object", + }, + ], + "source": "src/index.ts", + "title": "AssetSwitch", + "type": "or", + }, + Object { + "additionalProperties": false, + "extends": undefined, + "genericTokens": Array [ + Object { + "constraints": Object { + "ref": "Asset", + "type": "ref", + }, + "default": Object { + "ref": "Asset", + "type": "ref", + }, + "symbol": "T", + }, + ], + "name": "StaticSwitch", + "properties": Object { + "staticSwitch": Object { + "node": Object { + "description": "A static switch only evaluates the applicable base on first render of the view", + "elementType": Object { + "additionalProperties": false, + "description": "A single case statement to use in a switch", + "extends": undefined, + "genericTokens": Array [ + Object { + "constraints": Object { + "ref": "Asset", + "type": "ref", + }, + "default": Object { + "ref": "Asset", + "type": "ref", + }, + "symbol": "T", + }, + ], + "name": "SwitchCase", + "properties": Object { + "asset": Object { + "node": Object { + "description": "The Asset to use if this case is applicable", + "genericArguments": undefined, + "ref": "T", + "title": "SwitchCase.asset", + "type": "ref", + }, + "required": true, + }, + "case": Object { + "node": Object { + "description": "An expression to execute to determine if this case applies", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "SwitchCase.case", + "type": "ref", + }, + Object { + "const": true, + "title": "SwitchCase.case", + "type": "boolean", + }, + ], + "title": "SwitchCase.case", + "type": "or", + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "SwitchCase", + "type": "object", + }, + "genericTokens": Array [ + Object { + "constraints": Object { + "ref": "Asset", + "type": "ref", + }, + "default": Object { + "ref": "Asset", + "type": "ref", + }, + "symbol": "T", + }, + ], + "name": "Switch", + "source": "src/index.ts", + "title": "StaticSwitch.staticSwitch", + "type": "array", + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "StaticSwitch", + "type": "object", + }, + Object { + "additionalProperties": false, + "extends": undefined, + "genericTokens": Array [ + Object { + "constraints": Object { + "ref": "Asset", + "type": "ref", + }, + "default": Object { + "ref": "Asset", + "type": "ref", + }, + "symbol": "T", + }, + ], + "name": "DynamicSwitch", + "properties": Object { + "dynamicSwitch": Object { + "node": Object { + "description": "A dynamic switch re-evaluates the applicable case as data changes", + "elementType": Object { + "additionalProperties": false, + "description": "A single case statement to use in a switch", + "extends": undefined, + "genericTokens": Array [ + Object { + "constraints": Object { + "ref": "Asset", + "type": "ref", + }, + "default": Object { + "ref": "Asset", + "type": "ref", + }, + "symbol": "T", + }, + ], + "name": "SwitchCase", + "properties": Object { + "asset": Object { + "node": Object { + "description": "The Asset to use if this case is applicable", + "genericArguments": undefined, + "ref": "T", + "title": "SwitchCase.asset", + "type": "ref", + }, + "required": true, + }, + "case": Object { + "node": Object { + "description": "An expression to execute to determine if this case applies", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "SwitchCase.case", + "type": "ref", + }, + Object { + "const": true, + "title": "SwitchCase.case", + "type": "boolean", + }, + ], + "title": "SwitchCase.case", + "type": "or", + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "SwitchCase", + "type": "object", + }, + "genericTokens": Array [ + Object { + "constraints": Object { + "ref": "Asset", + "type": "ref", + }, + "default": Object { + "ref": "Asset", + "type": "ref", + }, + "symbol": "T", + }, + ], + "name": "Switch", + "source": "src/index.ts", + "title": "DynamicSwitch.dynamicSwitch", + "type": "array", + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "DynamicSwitch", + "type": "object", + }, + Object { + "description": "Expressions are a specialized way of executing code. +If the expression is a composite, the last expression executed is the return value", + "name": "Expression", + "or": Array [ + Object { + "title": "Expression", + "type": "string", + }, + Object { + "elementType": Object { + "title": "Expression.[]", + "type": "string", + }, + "title": "Expression.[]", + "type": "array", + }, + ], + "source": "src/index.ts", + "title": "Expression", + "type": "or", + }, + Object { + "format": "@[.*]@", + "name": "ExpressionRef", + "source": "src/index.ts", + "title": "ExpressionRef", + "type": "template", + }, + Object { + "description": "Bindings describe locations in the data model.", + "name": "Binding", + "source": "src/index.ts", + "title": "Binding", + "type": "string", + }, + Object { + "format": "{{.*}}", + "name": "BindingRef", + "source": "src/index.ts", + "title": "BindingRef", + "type": "template", + }, + Object { + "description": "The data-model is the location that all user data is stored", + "keyType": Object { + "type": "any", + }, + "name": "DataModel", + "source": "src/index.ts", + "title": "DataModel", + "type": "record", + "valueType": Object { + "type": "unknown", + }, + }, + Object { + "and": Array [ + Object { + "additionalProperties": false, + "extends": undefined, + "properties": Object { + "BEGIN": Object { + "node": Object { + "description": "The name of the Flow to begin on", + "title": "BEGIN", + "type": "string", + }, + "required": true, + }, + }, + "type": "object", + }, + Object { + "keyType": Object { + "type": "string", + }, + "type": "record", + "valueType": Object { + "or": Array [ + Object { + "type": "string", + }, + Object { + "additionalProperties": Object { + "or": Array [ + Object { + "type": "undefined", + }, + Object { + "type": "string", + }, + Object { + "genericArguments": undefined, + "ref": "Expression", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + Object { + "name": "NavigationFlowState", + "or": Array [ + Object { + "additionalProperties": false, + "description": "A state representing a view", + "extends": undefined, + "name": "NavigationFlowViewState", + "properties": Object { + "_comment": Object { + "node": Object { + "description": "Add comments that will not be processing, but are useful for code explanation", + "title": "CommentBase._comment", + "type": "string", + }, + "required": false, + }, + "attributes": Object { + "node": Object { + "additionalProperties": Object { + "type": "any", + }, + "description": "View meta-properties", + "extends": undefined, + "properties": Object {}, + "title": "NavigationFlowViewState.attributes", + "type": "object", + }, + "required": false, + }, + "exp": Object { + "node": Object { + "title": "NavigationBaseState.exp", + "type": "never", + }, + "required": false, + }, + "onEnd": Object { + "node": Object { + "description": "An optional expression to run before view transition", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onEnd", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onEnd", + "type": "or", + }, + "required": false, + }, + "onStart": Object { + "node": Object { + "description": "An optional expression to run when this view renders", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onStart", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onStart", + "type": "or", + }, + "required": false, + }, + "ref": Object { + "node": Object { + "description": "An id corresponding to a view from the 'views' array", + "title": "NavigationFlowViewState.ref", + "type": "string", + }, + "required": true, + }, + "state_type": Object { + "node": Object { + "const": "VIEW", + "description": "A property to determine the type of state this is", + "title": "NavigationBaseState.state_type", + "type": "string", + }, + "required": true, + }, + "transitions": Object { + "node": Object { + "description": "A mapping of transition-name to FlowState name", + "keyType": Object { + "type": "string", + }, + "name": "NavigationFlowTransition", + "source": "src/index.ts", + "title": "NavigationFlowTransitionableState.transitions", + "type": "record", + "valueType": Object { + "type": "string", + }, + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "NavigationFlowViewState", + "type": "object", + }, + Object { + "additionalProperties": false, + "description": "An END state of the flow.", + "extends": undefined, + "name": "NavigationFlowEndState", + "properties": Object { + "_comment": Object { + "node": Object { + "description": "Add comments that will not be processing, but are useful for code explanation", + "title": "CommentBase._comment", + "type": "string", + }, + "required": false, + }, + "exp": Object { + "node": Object { + "title": "NavigationBaseState.exp", + "type": "never", + }, + "required": false, + }, + "onEnd": Object { + "node": Object { + "description": "An optional expression to run before view transition", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onEnd", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onEnd", + "type": "or", + }, + "required": false, + }, + "onStart": Object { + "node": Object { + "description": "An optional expression to run when this view renders", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onStart", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onStart", + "type": "or", + }, + "required": false, + }, + "outcome": Object { + "node": Object { + "description": "A description of _how_ the flow ended. +If this is a flow started from another flow, the outcome determines the flow transition", + "title": "NavigationFlowEndState.outcome", + "type": "string", + }, + "required": true, + }, + "state_type": Object { + "node": Object { + "const": "END", + "description": "A property to determine the type of state this is", + "title": "NavigationBaseState.state_type", + "type": "string", + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "NavigationFlowEndState", + "type": "object", + }, + Object { + "additionalProperties": false, + "extends": undefined, + "name": "NavigationFlowFlowState", + "properties": Object { + "_comment": Object { + "node": Object { + "description": "Add comments that will not be processing, but are useful for code explanation", + "title": "CommentBase._comment", + "type": "string", + }, + "required": false, + }, + "exp": Object { + "node": Object { + "title": "NavigationBaseState.exp", + "type": "never", + }, + "required": false, + }, + "onEnd": Object { + "node": Object { + "description": "An optional expression to run before view transition", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onEnd", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onEnd", + "type": "or", + }, + "required": false, + }, + "onStart": Object { + "node": Object { + "description": "An optional expression to run when this view renders", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onStart", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onStart", + "type": "or", + }, + "required": false, + }, + "ref": Object { + "node": Object { + "description": "A reference to a FLOW id state to run", + "title": "NavigationFlowFlowState.ref", + "type": "string", + }, + "required": true, + }, + "state_type": Object { + "node": Object { + "const": "FLOW", + "description": "A property to determine the type of state this is", + "title": "NavigationBaseState.state_type", + "type": "string", + }, + "required": true, + }, + "transitions": Object { + "node": Object { + "description": "A mapping of transition-name to FlowState name", + "keyType": Object { + "type": "string", + }, + "name": "NavigationFlowTransition", + "source": "src/index.ts", + "title": "NavigationFlowTransitionableState.transitions", + "type": "record", + "valueType": Object { + "type": "string", + }, + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "NavigationFlowFlowState", + "type": "object", + }, + Object { + "additionalProperties": false, + "description": "Action states execute an expression to determine the next state to transition to", + "extends": undefined, + "name": "NavigationFlowActionState", + "properties": Object { + "_comment": Object { + "node": Object { + "description": "Add comments that will not be processing, but are useful for code explanation", + "title": "CommentBase._comment", + "type": "string", + }, + "required": false, + }, + "exp": Object { + "node": Object { + "description": "An expression to execute. +The return value determines the transition to take", + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationFlowActionState.exp", + "type": "ref", + }, + "required": true, + }, + "onEnd": Object { + "node": Object { + "description": "An optional expression to run before view transition", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onEnd", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onEnd", + "type": "or", + }, + "required": false, + }, + "onStart": Object { + "node": Object { + "description": "An optional expression to run when this view renders", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onStart", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onStart", + "type": "or", + }, + "required": false, + }, + "state_type": Object { + "node": Object { + "const": "ACTION", + "description": "A property to determine the type of state this is", + "title": "NavigationBaseState.state_type", + "type": "string", + }, + "required": true, + }, + "transitions": Object { + "node": Object { + "description": "A mapping of transition-name to FlowState name", + "keyType": Object { + "type": "string", + }, + "name": "NavigationFlowTransition", + "source": "src/index.ts", + "title": "NavigationFlowTransitionableState.transitions", + "type": "record", + "valueType": Object { + "type": "string", + }, + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "NavigationFlowActionState", + "type": "object", + }, + Object { + "additionalProperties": false, + "description": "External Flow states represent states in the FSM that can't be resolved internally in Player. +The flow will wait for the embedded application to manage moving to the next state via a transition", + "extends": undefined, + "name": "NavigationFlowExternalState", + "properties": Object { + "_comment": Object { + "node": Object { + "description": "Add comments that will not be processing, but are useful for code explanation", + "title": "CommentBase._comment", + "type": "string", + }, + "required": false, + }, + "exp": Object { + "node": Object { + "title": "NavigationBaseState.exp", + "type": "never", + }, + "required": false, + }, + "onEnd": Object { + "node": Object { + "description": "An optional expression to run before view transition", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onEnd", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onEnd", + "type": "or", + }, + "required": false, + }, + "onStart": Object { + "node": Object { + "description": "An optional expression to run when this view renders", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onStart", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onStart", + "type": "or", + }, + "required": false, + }, + "ref": Object { + "node": Object { + "description": "A reference for this external state", + "title": "NavigationFlowExternalState.ref", + "type": "string", + }, + "required": true, + }, + "state_type": Object { + "node": Object { + "const": "EXTERNAL", + "description": "A property to determine the type of state this is", + "title": "NavigationBaseState.state_type", + "type": "string", + }, + "required": true, + }, + "transitions": Object { + "node": Object { + "description": "A mapping of transition-name to FlowState name", + "keyType": Object { + "type": "string", + }, + "name": "NavigationFlowTransition", + "source": "src/index.ts", + "title": "NavigationFlowTransitionableState.transitions", + "type": "record", + "valueType": Object { + "type": "string", + }, + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "NavigationFlowExternalState", + "type": "object", + }, + ], + "source": "src/index.ts", + "title": "NavigationFlowState", + "type": "or", + }, + ], + "type": "or", + }, + "description": "A state machine in the navigation", + "extends": undefined, + "name": "NavigationFlow", + "properties": Object { + "onEnd": Object { + "node": Object { + "description": "An optional expression to run when this Flow ends", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationFlow.onEnd", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationFlow.onEnd", + "type": "or", + }, + "required": false, + }, + "onStart": Object { + "node": Object { + "description": "An optional expression to run when this Flow starts", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationFlow.onStart", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationFlow.onStart", + "type": "or", + }, + "required": false, + }, + "startState": Object { + "node": Object { + "description": "The first state to kick off the state machine", + "title": "NavigationFlow.startState", + "type": "string", + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "NavigationFlow", + "type": "object", + }, + ], + "type": "or", + }, + }, + ], + "description": "The navigation section of the flow describes a State Machine for the user.", + "name": "Navigation", + "source": "src/index.ts", + "title": "Navigation", + "type": "and", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + Object { + "additionalProperties": Object { + "or": Array [ + Object { + "type": "undefined", + }, + Object { + "type": "string", + }, + Object { + "genericArguments": undefined, + "ref": "Expression", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + Object { + "name": "NavigationFlowState", + "or": Array [ + Object { + "additionalProperties": false, + "description": "A state representing a view", + "extends": undefined, + "name": "NavigationFlowViewState", + "properties": Object { + "_comment": Object { + "node": Object { + "description": "Add comments that will not be processing, but are useful for code explanation", + "title": "CommentBase._comment", + "type": "string", + }, + "required": false, + }, + "attributes": Object { + "node": Object { + "additionalProperties": Object { + "type": "any", + }, + "description": "View meta-properties", + "extends": undefined, + "properties": Object {}, + "title": "NavigationFlowViewState.attributes", + "type": "object", + }, + "required": false, + }, + "exp": Object { + "node": Object { + "title": "NavigationBaseState.exp", + "type": "never", + }, + "required": false, + }, + "onEnd": Object { + "node": Object { + "description": "An optional expression to run before view transition", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onEnd", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onEnd", + "type": "or", + }, + "required": false, + }, + "onStart": Object { + "node": Object { + "description": "An optional expression to run when this view renders", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onStart", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onStart", + "type": "or", + }, + "required": false, + }, + "ref": Object { + "node": Object { + "description": "An id corresponding to a view from the 'views' array", + "title": "NavigationFlowViewState.ref", + "type": "string", + }, + "required": true, + }, + "state_type": Object { + "node": Object { + "const": "VIEW", + "description": "A property to determine the type of state this is", + "title": "NavigationBaseState.state_type", + "type": "string", + }, + "required": true, + }, + "transitions": Object { + "node": Object { + "description": "A mapping of transition-name to FlowState name", + "keyType": Object { + "type": "string", + }, + "name": "NavigationFlowTransition", + "source": "src/index.ts", + "title": "NavigationFlowTransitionableState.transitions", + "type": "record", + "valueType": Object { + "type": "string", + }, + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "NavigationFlowViewState", + "type": "object", + }, + Object { + "additionalProperties": false, + "description": "An END state of the flow.", + "extends": undefined, + "name": "NavigationFlowEndState", + "properties": Object { + "_comment": Object { + "node": Object { + "description": "Add comments that will not be processing, but are useful for code explanation", + "title": "CommentBase._comment", + "type": "string", + }, + "required": false, + }, + "exp": Object { + "node": Object { + "title": "NavigationBaseState.exp", + "type": "never", + }, + "required": false, + }, + "onEnd": Object { + "node": Object { + "description": "An optional expression to run before view transition", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onEnd", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onEnd", + "type": "or", + }, + "required": false, + }, + "onStart": Object { + "node": Object { + "description": "An optional expression to run when this view renders", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onStart", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onStart", + "type": "or", + }, + "required": false, + }, + "outcome": Object { + "node": Object { + "description": "A description of _how_ the flow ended. +If this is a flow started from another flow, the outcome determines the flow transition", + "title": "NavigationFlowEndState.outcome", + "type": "string", + }, + "required": true, + }, + "state_type": Object { + "node": Object { + "const": "END", + "description": "A property to determine the type of state this is", + "title": "NavigationBaseState.state_type", + "type": "string", + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "NavigationFlowEndState", + "type": "object", + }, + Object { + "additionalProperties": false, + "extends": undefined, + "name": "NavigationFlowFlowState", + "properties": Object { + "_comment": Object { + "node": Object { + "description": "Add comments that will not be processing, but are useful for code explanation", + "title": "CommentBase._comment", + "type": "string", + }, + "required": false, + }, + "exp": Object { + "node": Object { + "title": "NavigationBaseState.exp", + "type": "never", + }, + "required": false, + }, + "onEnd": Object { + "node": Object { + "description": "An optional expression to run before view transition", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onEnd", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onEnd", + "type": "or", + }, + "required": false, + }, + "onStart": Object { + "node": Object { + "description": "An optional expression to run when this view renders", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onStart", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onStart", + "type": "or", + }, + "required": false, + }, + "ref": Object { + "node": Object { + "description": "A reference to a FLOW id state to run", + "title": "NavigationFlowFlowState.ref", + "type": "string", + }, + "required": true, + }, + "state_type": Object { + "node": Object { + "const": "FLOW", + "description": "A property to determine the type of state this is", + "title": "NavigationBaseState.state_type", + "type": "string", + }, + "required": true, + }, + "transitions": Object { + "node": Object { + "description": "A mapping of transition-name to FlowState name", + "keyType": Object { + "type": "string", + }, + "name": "NavigationFlowTransition", + "source": "src/index.ts", + "title": "NavigationFlowTransitionableState.transitions", + "type": "record", + "valueType": Object { + "type": "string", + }, + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "NavigationFlowFlowState", + "type": "object", + }, + Object { + "additionalProperties": false, + "description": "Action states execute an expression to determine the next state to transition to", + "extends": undefined, + "name": "NavigationFlowActionState", + "properties": Object { + "_comment": Object { + "node": Object { + "description": "Add comments that will not be processing, but are useful for code explanation", + "title": "CommentBase._comment", + "type": "string", + }, + "required": false, + }, + "exp": Object { + "node": Object { + "description": "An expression to execute. +The return value determines the transition to take", + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationFlowActionState.exp", + "type": "ref", + }, + "required": true, + }, + "onEnd": Object { + "node": Object { + "description": "An optional expression to run before view transition", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onEnd", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onEnd", + "type": "or", + }, + "required": false, + }, + "onStart": Object { + "node": Object { + "description": "An optional expression to run when this view renders", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onStart", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onStart", + "type": "or", + }, + "required": false, + }, + "state_type": Object { + "node": Object { + "const": "ACTION", + "description": "A property to determine the type of state this is", + "title": "NavigationBaseState.state_type", + "type": "string", + }, + "required": true, + }, + "transitions": Object { + "node": Object { + "description": "A mapping of transition-name to FlowState name", + "keyType": Object { + "type": "string", + }, + "name": "NavigationFlowTransition", + "source": "src/index.ts", + "title": "NavigationFlowTransitionableState.transitions", + "type": "record", + "valueType": Object { + "type": "string", + }, + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "NavigationFlowActionState", + "type": "object", + }, + Object { + "additionalProperties": false, + "description": "External Flow states represent states in the FSM that can't be resolved internally in Player. +The flow will wait for the embedded application to manage moving to the next state via a transition", + "extends": undefined, + "name": "NavigationFlowExternalState", + "properties": Object { + "_comment": Object { + "node": Object { + "description": "Add comments that will not be processing, but are useful for code explanation", + "title": "CommentBase._comment", + "type": "string", + }, + "required": false, + }, + "exp": Object { + "node": Object { + "title": "NavigationBaseState.exp", + "type": "never", + }, + "required": false, + }, + "onEnd": Object { + "node": Object { + "description": "An optional expression to run before view transition", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onEnd", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onEnd", + "type": "or", + }, + "required": false, + }, + "onStart": Object { + "node": Object { + "description": "An optional expression to run when this view renders", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onStart", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onStart", + "type": "or", + }, + "required": false, + }, + "ref": Object { + "node": Object { + "description": "A reference for this external state", + "title": "NavigationFlowExternalState.ref", + "type": "string", + }, + "required": true, + }, + "state_type": Object { + "node": Object { + "const": "EXTERNAL", + "description": "A property to determine the type of state this is", + "title": "NavigationBaseState.state_type", + "type": "string", + }, + "required": true, + }, + "transitions": Object { + "node": Object { + "description": "A mapping of transition-name to FlowState name", + "keyType": Object { + "type": "string", + }, + "name": "NavigationFlowTransition", + "source": "src/index.ts", + "title": "NavigationFlowTransitionableState.transitions", + "type": "record", + "valueType": Object { + "type": "string", + }, + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "NavigationFlowExternalState", + "type": "object", + }, + ], + "source": "src/index.ts", + "title": "NavigationFlowState", + "type": "or", + }, + ], + "type": "or", + }, + "description": "A state machine in the navigation", + "extends": undefined, + "name": "NavigationFlow", + "properties": Object { + "onEnd": Object { + "node": Object { + "description": "An optional expression to run when this Flow ends", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationFlow.onEnd", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationFlow.onEnd", + "type": "or", + }, + "required": false, + }, + "onStart": Object { + "node": Object { + "description": "An optional expression to run when this Flow starts", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationFlow.onStart", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationFlow.onStart", + "type": "or", + }, + "required": false, + }, + "startState": Object { + "node": Object { + "description": "The first state to kick off the state machine", + "title": "NavigationFlow.startState", + "type": "string", + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "NavigationFlow", + "type": "object", + }, + Object { + "keyType": Object { + "type": "string", + }, + "name": "NavigationFlowTransition", + "source": "src/index.ts", + "title": "NavigationFlowTransition", + "type": "record", + "valueType": Object { + "type": "string", + }, + }, + Object { + "additionalProperties": false, + "description": "The base representation of a state within a Flow", + "extends": undefined, + "genericTokens": Array [ + Object { + "constraints": Object { + "type": "string", + }, + "default": Object { + "type": "any", + }, + "symbol": "T", + }, + ], + "name": "NavigationBaseState", + "properties": Object { + "_comment": Object { + "node": Object { + "description": "Add comments that will not be processing, but are useful for code explanation", + "title": "CommentBase._comment", + "type": "string", + }, + "required": false, + }, + "exp": Object { + "node": Object { + "check": Object { + "left": Object { + "genericArguments": undefined, + "ref": "T", + "type": "ref", + }, + "right": Object { + "genericArguments": undefined, + "ref": "T", + "type": "ref", + }, + }, + "description": "TS gets really confused with both the ActionState and the onStart state both declaring the \`exp\` property +So this explicity says there should never be an exp prop on a state node that's not of type 'ACTION'", + "title": "NavigationBaseState.exp", + "type": "conditional", + "value": Object { + "false": Object { + "type": "never", + }, + "true": Object { + "genericArguments": undefined, + "ref": "Expression", + "type": "ref", + }, + }, + }, + "required": false, + }, + "onEnd": Object { + "node": Object { + "description": "An optional expression to run before view transition", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onEnd", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onEnd", + "type": "or", + }, + "required": false, + }, + "onStart": Object { + "node": Object { + "description": "An optional expression to run when this view renders", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onStart", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onStart", + "type": "or", + }, + "required": false, + }, + "state_type": Object { + "node": Object { + "description": "A property to determine the type of state this is", + "genericArguments": undefined, + "ref": "T", + "title": "NavigationBaseState.state_type", + "type": "ref", + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "NavigationBaseState", + "type": "object", + }, + Object { + "additionalProperties": false, + "description": "A generic state that can transition to another state", + "extends": undefined, + "genericTokens": Array [ + Object { + "constraints": Object { + "type": "string", + }, + "default": Object { + "type": "any", + }, + "symbol": "T", + }, + ], + "name": "NavigationFlowTransitionableState", + "properties": Object { + "_comment": Object { + "node": Object { + "description": "Add comments that will not be processing, but are useful for code explanation", + "title": "CommentBase._comment", + "type": "string", + }, + "required": false, + }, + "exp": Object { + "node": Object { + "check": Object { + "left": Object { + "genericArguments": undefined, + "ref": "T", + "type": "ref", + }, + "right": Object { + "genericArguments": undefined, + "ref": "T", + "type": "ref", + }, + }, + "description": "TS gets really confused with both the ActionState and the onStart state both declaring the \`exp\` property +So this explicity says there should never be an exp prop on a state node that's not of type 'ACTION'", + "title": "NavigationBaseState.exp", + "type": "conditional", + "value": Object { + "false": Object { + "type": "never", + }, + "true": Object { + "genericArguments": undefined, + "ref": "Expression", + "type": "ref", + }, + }, + }, + "required": false, + }, + "onEnd": Object { + "node": Object { + "description": "An optional expression to run before view transition", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onEnd", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onEnd", + "type": "or", + }, + "required": false, + }, + "onStart": Object { + "node": Object { + "description": "An optional expression to run when this view renders", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onStart", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onStart", + "type": "or", + }, + "required": false, + }, + "state_type": Object { + "node": Object { + "description": "A property to determine the type of state this is", + "genericArguments": undefined, + "ref": "T", + "title": "NavigationBaseState.state_type", + "type": "ref", + }, + "required": true, + }, + "transitions": Object { + "node": Object { + "description": "A mapping of transition-name to FlowState name", + "keyType": Object { + "type": "string", + }, + "name": "NavigationFlowTransition", + "source": "src/index.ts", + "title": "NavigationFlowTransitionableState.transitions", + "type": "record", + "valueType": Object { + "type": "string", + }, + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "NavigationFlowTransitionableState", + "type": "object", + }, + Object { + "additionalProperties": false, + "description": "A state representing a view", + "extends": undefined, + "name": "NavigationFlowViewState", + "properties": Object { + "_comment": Object { + "node": Object { + "description": "Add comments that will not be processing, but are useful for code explanation", + "title": "CommentBase._comment", + "type": "string", + }, + "required": false, + }, + "attributes": Object { + "node": Object { + "additionalProperties": Object { + "type": "any", + }, + "description": "View meta-properties", + "extends": undefined, + "properties": Object {}, + "title": "NavigationFlowViewState.attributes", + "type": "object", + }, + "required": false, + }, + "exp": Object { + "node": Object { + "title": "NavigationBaseState.exp", + "type": "never", + }, + "required": false, + }, + "onEnd": Object { + "node": Object { + "description": "An optional expression to run before view transition", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onEnd", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onEnd", + "type": "or", + }, + "required": false, + }, + "onStart": Object { + "node": Object { + "description": "An optional expression to run when this view renders", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onStart", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onStart", + "type": "or", + }, + "required": false, + }, + "ref": Object { + "node": Object { + "description": "An id corresponding to a view from the 'views' array", + "title": "NavigationFlowViewState.ref", + "type": "string", + }, + "required": true, + }, + "state_type": Object { + "node": Object { + "const": "VIEW", + "description": "A property to determine the type of state this is", + "title": "NavigationBaseState.state_type", + "type": "string", + }, + "required": true, + }, + "transitions": Object { + "node": Object { + "description": "A mapping of transition-name to FlowState name", + "keyType": Object { + "type": "string", + }, + "name": "NavigationFlowTransition", + "source": "src/index.ts", + "title": "NavigationFlowTransitionableState.transitions", + "type": "record", + "valueType": Object { + "type": "string", + }, + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "NavigationFlowViewState", + "type": "object", + }, + Object { + "additionalProperties": false, + "description": "An END state of the flow.", + "extends": undefined, + "name": "NavigationFlowEndState", + "properties": Object { + "_comment": Object { + "node": Object { + "description": "Add comments that will not be processing, but are useful for code explanation", + "title": "CommentBase._comment", + "type": "string", + }, + "required": false, + }, + "exp": Object { + "node": Object { + "title": "NavigationBaseState.exp", + "type": "never", + }, + "required": false, + }, + "onEnd": Object { + "node": Object { + "description": "An optional expression to run before view transition", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onEnd", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onEnd", + "type": "or", + }, + "required": false, + }, + "onStart": Object { + "node": Object { + "description": "An optional expression to run when this view renders", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onStart", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onStart", + "type": "or", + }, + "required": false, + }, + "outcome": Object { + "node": Object { + "description": "A description of _how_ the flow ended. +If this is a flow started from another flow, the outcome determines the flow transition", + "title": "NavigationFlowEndState.outcome", + "type": "string", + }, + "required": true, + }, + "state_type": Object { + "node": Object { + "const": "END", + "description": "A property to determine the type of state this is", + "title": "NavigationBaseState.state_type", + "type": "string", + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "NavigationFlowEndState", + "type": "object", + }, + Object { + "additionalProperties": false, + "description": "Action states execute an expression to determine the next state to transition to", + "extends": undefined, + "name": "NavigationFlowActionState", + "properties": Object { + "_comment": Object { + "node": Object { + "description": "Add comments that will not be processing, but are useful for code explanation", + "title": "CommentBase._comment", + "type": "string", + }, + "required": false, + }, + "exp": Object { + "node": Object { + "description": "An expression to execute. +The return value determines the transition to take", + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationFlowActionState.exp", + "type": "ref", + }, + "required": true, + }, + "onEnd": Object { + "node": Object { + "description": "An optional expression to run before view transition", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onEnd", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onEnd", + "type": "or", + }, + "required": false, + }, + "onStart": Object { + "node": Object { + "description": "An optional expression to run when this view renders", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onStart", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onStart", + "type": "or", + }, + "required": false, + }, + "state_type": Object { + "node": Object { + "const": "ACTION", + "description": "A property to determine the type of state this is", + "title": "NavigationBaseState.state_type", + "type": "string", + }, + "required": true, + }, + "transitions": Object { + "node": Object { + "description": "A mapping of transition-name to FlowState name", + "keyType": Object { + "type": "string", + }, + "name": "NavigationFlowTransition", + "source": "src/index.ts", + "title": "NavigationFlowTransitionableState.transitions", + "type": "record", + "valueType": Object { + "type": "string", + }, + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "NavigationFlowActionState", + "type": "object", + }, + Object { + "additionalProperties": false, + "description": "External Flow states represent states in the FSM that can't be resolved internally in Player. +The flow will wait for the embedded application to manage moving to the next state via a transition", + "extends": undefined, + "name": "NavigationFlowExternalState", + "properties": Object { + "_comment": Object { + "node": Object { + "description": "Add comments that will not be processing, but are useful for code explanation", + "title": "CommentBase._comment", + "type": "string", + }, + "required": false, + }, + "exp": Object { + "node": Object { + "title": "NavigationBaseState.exp", + "type": "never", + }, + "required": false, + }, + "onEnd": Object { + "node": Object { + "description": "An optional expression to run before view transition", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onEnd", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onEnd", + "type": "or", + }, + "required": false, + }, + "onStart": Object { + "node": Object { + "description": "An optional expression to run when this view renders", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onStart", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onStart", + "type": "or", + }, + "required": false, + }, + "ref": Object { + "node": Object { + "description": "A reference for this external state", + "title": "NavigationFlowExternalState.ref", + "type": "string", + }, + "required": true, + }, + "state_type": Object { + "node": Object { + "const": "EXTERNAL", + "description": "A property to determine the type of state this is", + "title": "NavigationBaseState.state_type", + "type": "string", + }, + "required": true, + }, + "transitions": Object { + "node": Object { + "description": "A mapping of transition-name to FlowState name", + "keyType": Object { + "type": "string", + }, + "name": "NavigationFlowTransition", + "source": "src/index.ts", + "title": "NavigationFlowTransitionableState.transitions", + "type": "record", + "valueType": Object { + "type": "string", + }, + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "NavigationFlowExternalState", + "type": "object", + }, + Object { + "additionalProperties": false, + "extends": undefined, + "name": "NavigationFlowFlowState", + "properties": Object { + "_comment": Object { + "node": Object { + "description": "Add comments that will not be processing, but are useful for code explanation", + "title": "CommentBase._comment", + "type": "string", + }, + "required": false, + }, + "exp": Object { + "node": Object { + "title": "NavigationBaseState.exp", + "type": "never", + }, + "required": false, + }, + "onEnd": Object { + "node": Object { + "description": "An optional expression to run before view transition", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onEnd", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onEnd", + "type": "or", + }, + "required": false, + }, + "onStart": Object { + "node": Object { + "description": "An optional expression to run when this view renders", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onStart", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onStart", + "type": "or", + }, + "required": false, + }, + "ref": Object { + "node": Object { + "description": "A reference to a FLOW id state to run", + "title": "NavigationFlowFlowState.ref", + "type": "string", + }, + "required": true, + }, + "state_type": Object { + "node": Object { + "const": "FLOW", + "description": "A property to determine the type of state this is", + "title": "NavigationBaseState.state_type", + "type": "string", + }, + "required": true, + }, + "transitions": Object { + "node": Object { + "description": "A mapping of transition-name to FlowState name", + "keyType": Object { + "type": "string", + }, + "name": "NavigationFlowTransition", + "source": "src/index.ts", + "title": "NavigationFlowTransitionableState.transitions", + "type": "record", + "valueType": Object { + "type": "string", + }, + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "NavigationFlowFlowState", + "type": "object", + }, + Object { + "name": "NavigationFlowState", + "or": Array [ + Object { + "additionalProperties": false, + "description": "A state representing a view", + "extends": undefined, + "name": "NavigationFlowViewState", + "properties": Object { + "_comment": Object { + "node": Object { + "description": "Add comments that will not be processing, but are useful for code explanation", + "title": "CommentBase._comment", + "type": "string", + }, + "required": false, + }, + "attributes": Object { + "node": Object { + "additionalProperties": Object { + "type": "any", + }, + "description": "View meta-properties", + "extends": undefined, + "properties": Object {}, + "title": "NavigationFlowViewState.attributes", + "type": "object", + }, + "required": false, + }, + "exp": Object { + "node": Object { + "title": "NavigationBaseState.exp", + "type": "never", + }, + "required": false, + }, + "onEnd": Object { + "node": Object { + "description": "An optional expression to run before view transition", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onEnd", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onEnd", + "type": "or", + }, + "required": false, + }, + "onStart": Object { + "node": Object { + "description": "An optional expression to run when this view renders", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onStart", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onStart", + "type": "or", + }, + "required": false, + }, + "ref": Object { + "node": Object { + "description": "An id corresponding to a view from the 'views' array", + "title": "NavigationFlowViewState.ref", + "type": "string", + }, + "required": true, + }, + "state_type": Object { + "node": Object { + "const": "VIEW", + "description": "A property to determine the type of state this is", + "title": "NavigationBaseState.state_type", + "type": "string", + }, + "required": true, + }, + "transitions": Object { + "node": Object { + "description": "A mapping of transition-name to FlowState name", + "keyType": Object { + "type": "string", + }, + "name": "NavigationFlowTransition", + "source": "src/index.ts", + "title": "NavigationFlowTransitionableState.transitions", + "type": "record", + "valueType": Object { + "type": "string", + }, + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "NavigationFlowViewState", + "type": "object", + }, + Object { + "additionalProperties": false, + "description": "An END state of the flow.", + "extends": undefined, + "name": "NavigationFlowEndState", + "properties": Object { + "_comment": Object { + "node": Object { + "description": "Add comments that will not be processing, but are useful for code explanation", + "title": "CommentBase._comment", + "type": "string", + }, + "required": false, + }, + "exp": Object { + "node": Object { + "title": "NavigationBaseState.exp", + "type": "never", + }, + "required": false, + }, + "onEnd": Object { + "node": Object { + "description": "An optional expression to run before view transition", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onEnd", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onEnd", + "type": "or", + }, + "required": false, + }, + "onStart": Object { + "node": Object { + "description": "An optional expression to run when this view renders", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onStart", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onStart", + "type": "or", + }, + "required": false, + }, + "outcome": Object { + "node": Object { + "description": "A description of _how_ the flow ended. +If this is a flow started from another flow, the outcome determines the flow transition", + "title": "NavigationFlowEndState.outcome", + "type": "string", + }, + "required": true, + }, + "state_type": Object { + "node": Object { + "const": "END", + "description": "A property to determine the type of state this is", + "title": "NavigationBaseState.state_type", + "type": "string", + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "NavigationFlowEndState", + "type": "object", + }, + Object { + "additionalProperties": false, + "extends": undefined, + "name": "NavigationFlowFlowState", + "properties": Object { + "_comment": Object { + "node": Object { + "description": "Add comments that will not be processing, but are useful for code explanation", + "title": "CommentBase._comment", + "type": "string", + }, + "required": false, + }, + "exp": Object { + "node": Object { + "title": "NavigationBaseState.exp", + "type": "never", + }, + "required": false, + }, + "onEnd": Object { + "node": Object { + "description": "An optional expression to run before view transition", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onEnd", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onEnd", + "type": "or", + }, + "required": false, + }, + "onStart": Object { + "node": Object { + "description": "An optional expression to run when this view renders", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onStart", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onStart", + "type": "or", + }, + "required": false, + }, + "ref": Object { + "node": Object { + "description": "A reference to a FLOW id state to run", + "title": "NavigationFlowFlowState.ref", + "type": "string", + }, + "required": true, + }, + "state_type": Object { + "node": Object { + "const": "FLOW", + "description": "A property to determine the type of state this is", + "title": "NavigationBaseState.state_type", + "type": "string", + }, + "required": true, + }, + "transitions": Object { + "node": Object { + "description": "A mapping of transition-name to FlowState name", + "keyType": Object { + "type": "string", + }, + "name": "NavigationFlowTransition", + "source": "src/index.ts", + "title": "NavigationFlowTransitionableState.transitions", + "type": "record", + "valueType": Object { + "type": "string", + }, + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "NavigationFlowFlowState", + "type": "object", + }, + Object { + "additionalProperties": false, + "description": "Action states execute an expression to determine the next state to transition to", + "extends": undefined, + "name": "NavigationFlowActionState", + "properties": Object { + "_comment": Object { + "node": Object { + "description": "Add comments that will not be processing, but are useful for code explanation", + "title": "CommentBase._comment", + "type": "string", + }, + "required": false, + }, + "exp": Object { + "node": Object { + "description": "An expression to execute. +The return value determines the transition to take", + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationFlowActionState.exp", + "type": "ref", + }, + "required": true, + }, + "onEnd": Object { + "node": Object { + "description": "An optional expression to run before view transition", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onEnd", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onEnd", + "type": "or", + }, + "required": false, + }, + "onStart": Object { + "node": Object { + "description": "An optional expression to run when this view renders", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onStart", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onStart", + "type": "or", + }, + "required": false, + }, + "state_type": Object { + "node": Object { + "const": "ACTION", + "description": "A property to determine the type of state this is", + "title": "NavigationBaseState.state_type", + "type": "string", + }, + "required": true, + }, + "transitions": Object { + "node": Object { + "description": "A mapping of transition-name to FlowState name", + "keyType": Object { + "type": "string", + }, + "name": "NavigationFlowTransition", + "source": "src/index.ts", + "title": "NavigationFlowTransitionableState.transitions", + "type": "record", + "valueType": Object { + "type": "string", + }, + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "NavigationFlowActionState", + "type": "object", + }, + Object { + "additionalProperties": false, + "description": "External Flow states represent states in the FSM that can't be resolved internally in Player. +The flow will wait for the embedded application to manage moving to the next state via a transition", + "extends": undefined, + "name": "NavigationFlowExternalState", + "properties": Object { + "_comment": Object { + "node": Object { + "description": "Add comments that will not be processing, but are useful for code explanation", + "title": "CommentBase._comment", + "type": "string", + }, + "required": false, + }, + "exp": Object { + "node": Object { + "title": "NavigationBaseState.exp", + "type": "never", + }, + "required": false, + }, + "onEnd": Object { + "node": Object { + "description": "An optional expression to run before view transition", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onEnd", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onEnd", + "type": "or", + }, + "required": false, + }, + "onStart": Object { + "node": Object { + "description": "An optional expression to run when this view renders", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onStart", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onStart", + "type": "or", + }, + "required": false, + }, + "ref": Object { + "node": Object { + "description": "A reference for this external state", + "title": "NavigationFlowExternalState.ref", + "type": "string", + }, + "required": true, + }, + "state_type": Object { + "node": Object { + "const": "EXTERNAL", + "description": "A property to determine the type of state this is", + "title": "NavigationBaseState.state_type", + "type": "string", + }, + "required": true, + }, + "transitions": Object { + "node": Object { + "description": "A mapping of transition-name to FlowState name", + "keyType": Object { + "type": "string", + }, + "name": "NavigationFlowTransition", + "source": "src/index.ts", + "title": "NavigationFlowTransitionableState.transitions", + "type": "record", + "valueType": Object { + "type": "string", + }, + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "NavigationFlowExternalState", + "type": "object", + }, + ], + "source": "src/index.ts", + "title": "NavigationFlowState", + "type": "or", + }, + Object { + "additionalProperties": false, + "description": "The data at the end of a flow", + "extends": undefined, + "name": "FlowResult", + "properties": Object { + "data": Object { + "node": Object { + "description": "The serialized data-model", + "title": "FlowResult.data", + "type": "any", + }, + "required": false, + }, + "endState": Object { + "node": Object { + "additionalProperties": false, + "description": "The outcome describes _how_ the flow ended (forwards, backwards, etc)", + "extends": undefined, + "name": "NavigationFlowEndState", + "properties": Object { + "_comment": Object { + "node": Object { + "description": "Add comments that will not be processing, but are useful for code explanation", + "title": "CommentBase._comment", + "type": "string", + }, + "required": false, + }, + "exp": Object { + "node": Object { + "title": "NavigationBaseState.exp", + "type": "never", + }, + "required": false, + }, + "onEnd": Object { + "node": Object { + "description": "An optional expression to run before view transition", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onEnd", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onEnd", + "type": "or", + }, + "required": false, + }, + "onStart": Object { + "node": Object { + "description": "An optional expression to run when this view renders", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onStart", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onStart", + "type": "or", + }, + "required": false, + }, + "outcome": Object { + "node": Object { + "description": "A description of _how_ the flow ended. +If this is a flow started from another flow, the outcome determines the flow transition", + "title": "NavigationFlowEndState.outcome", + "type": "string", + }, + "required": true, + }, + "state_type": Object { + "node": Object { + "const": "END", + "description": "A property to determine the type of state this is", + "title": "NavigationBaseState.state_type", + "type": "string", + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "FlowResult.endState", + "type": "object", + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "FlowResult", + "type": "object", + }, + Object { + "additionalProperties": false, + "description": "Any object that contains 1 or more templates", + "extends": undefined, + "name": "Templatable", + "properties": Object { + "template": Object { + "node": Object { + "description": "A list of templates to process for this node", + "elementType": Object { + "additionalProperties": false, + "description": "A template describes a mapping from a data array -> array of objects", + "extends": undefined, + "genericTokens": Array [ + Object { + "constraints": Object { + "type": "any", + }, + "default": Object { + "type": "unknown", + }, + "symbol": "ValueType", + }, + Object { + "constraints": Object { + "type": "string", + }, + "default": Object { + "type": "string", + }, + "symbol": "Key", + }, + ], + "name": "Template", + "properties": Object { + "data": Object { + "node": Object { + "description": "A pointer to the data-model containing an array of elements to map over", + "genericArguments": undefined, + "ref": "Binding", + "title": "Template.data", + "type": "ref", + }, + "required": true, + }, + "dynamic": Object { + "node": Object { + "description": "should the template be recomputed when data changes", + "title": "Template.dynamic", + "type": "boolean", + }, + "required": false, + }, + "output": Object { + "node": Object { + "description": "A property on the parent object to store the new map under. +If it already exists, values are appended to the end.", + "genericArguments": undefined, + "ref": "Key", + "title": "Template.output", + "type": "ref", + }, + "required": true, + }, + "value": Object { + "node": Object { + "description": "The template to iterate over using each value in the supplied template data. +Any reference to _index_ is replaced with the current iteration index.", + "genericArguments": undefined, + "ref": "ValueType", + "title": "Template.value", + "type": "ref", + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "Template", + "type": "object", + }, + "title": "Templatable.template", + "type": "array", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "Templatable", + "type": "object", + }, + Object { + "additionalProperties": false, + "description": "A template describes a mapping from a data array -> array of objects", + "extends": undefined, + "genericTokens": Array [ + Object { + "constraints": Object { + "type": "any", + }, + "default": Object { + "type": "unknown", + }, + "symbol": "ValueType", + }, + Object { + "constraints": Object { + "type": "string", + }, + "default": Object { + "type": "string", + }, + "symbol": "Key", + }, + ], + "name": "Template", + "properties": Object { + "data": Object { + "node": Object { + "description": "A pointer to the data-model containing an array of elements to map over", + "genericArguments": undefined, + "ref": "Binding", + "title": "Template.data", + "type": "ref", + }, + "required": true, + }, + "dynamic": Object { + "node": Object { + "description": "should the template be recomputed when data changes", + "title": "Template.dynamic", + "type": "boolean", + }, + "required": false, + }, + "output": Object { + "node": Object { + "description": "A property on the parent object to store the new map under. +If it already exists, values are appended to the end.", + "genericArguments": undefined, + "ref": "Key", + "title": "Template.output", + "type": "ref", + }, + "required": true, + }, + "value": Object { + "node": Object { + "description": "The template to iterate over using each value in the supplied template data. +Any reference to _index_ is replaced with the current iteration index.", + "genericArguments": undefined, + "ref": "ValueType", + "title": "Template.value", + "type": "ref", + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "Template", + "type": "object", + }, + Object { + "check": Object { + "left": Object { + "type": "unknown", + }, + "right": Object { + "type": "unknown", + }, + }, + "genericTokens": Array [ + Object { + "constraints": Object { + "ref": "Asset", + "type": "ref", + }, + "default": Object { + "ref": "Asset", + "type": "ref", + }, + "symbol": "T", + }, + ], + "name": "View", + "source": "src/index.ts", + "title": "View", + "type": "conditional", + "value": Object { + "false": Object { + "genericArguments": undefined, + "ref": "T", + "type": "ref", + }, + "true": Object { + "and": Array [ + Object { + "genericArguments": undefined, + "ref": "T", + "type": "ref", + }, + Object { + "additionalProperties": false, + "extends": undefined, + "properties": Object { + "validation": Object { + "node": Object { + "description": "Each view can optionally supply a list of validations to run against a particular view", + "elementType": Object { + "additionalProperties": Object { + "type": "unknown", + }, + "extends": undefined, + "name": "CrossfieldReference", + "properties": Object { + "dataTarget": Object { + "node": Object { + "description": "Cross-field references and validation must run against the default (deformatted) value", + "title": "CrossfieldReference.dataTarget", + "type": "never", + }, + "required": false, + }, + "displayTarget": Object { + "node": Object { + "description": "Where the error should be displayed", + "name": "DisplayTarget", + "or": Array [ + Object { + "const": "page", + "title": "DisplayTarget", + "type": "string", + }, + Object { + "const": "section", + "title": "DisplayTarget", + "type": "string", + }, + Object { + "const": "field", + "title": "DisplayTarget", + "type": "string", + }, + ], + "title": "Reference.displayTarget", + "type": "or", + }, + "required": false, + }, + "message": Object { + "node": Object { + "description": "An optional means of overriding the default message if the validation is triggered", + "title": "Reference.message", + "type": "string", + }, + "required": false, + }, + "ref": Object { + "node": Object { + "description": "The binding to associate this validation with", + "genericArguments": undefined, + "ref": "Binding", + "title": "CrossfieldReference.ref", + "type": "ref", + }, + "required": false, + }, + "severity": Object { + "node": Object { + "description": "An optional means of overriding the default severity of the validation if triggered", + "name": "Severity", + "or": Array [ + Object { + "const": "error", + "title": "Severity", + "type": "string", + }, + Object { + "const": "warning", + "title": "Severity", + "type": "string", + }, + ], + "title": "Reference.severity", + "type": "or", + }, + "required": false, + }, + "trigger": Object { + "node": Object { + "description": "When to run this particular validation", + "name": "Trigger", + "or": Array [ + Object { + "const": "navigation", + "title": "Trigger", + "type": "string", + }, + Object { + "const": "change", + "title": "Trigger", + "type": "string", + }, + Object { + "const": "load", + "title": "Trigger", + "type": "string", + }, + ], + "title": "Reference.trigger", + "type": "or", + }, + "required": false, + }, + "type": Object { + "node": Object { + "description": "The name of the referenced validation type +This will be used to lookup the proper handler", + "title": "Reference.type", + "type": "string", + }, + "required": true, + }, + }, + "title": "CrossfieldReference", + "type": "object", + }, + "title": "validation", + "type": "array", + }, + "required": false, + }, + }, + "type": "object", + }, + ], + "type": "and", + }, + }, + }, + Object { + "additionalProperties": Object { + "type": "unknown", + }, + "description": "The JSON payload for running Player", + "extends": undefined, + "genericTokens": Array [ + Object { + "constraints": Object { + "ref": "Asset", + "type": "ref", + }, + "default": Object { + "ref": "Asset", + "type": "ref", + }, + "symbol": "T", + }, + ], + "name": "Flow", + "properties": Object { + "data": Object { + "node": Object { + "description": "Any initial data that the flow can use", + "keyType": Object { + "type": "any", + }, + "name": "DataModel", + "source": "src/index.ts", + "title": "Flow.data", + "type": "record", + "valueType": Object { + "type": "unknown", + }, + }, + "required": false, + }, + "id": Object { + "node": Object { + "description": "A unique identifier for the flow", + "title": "Flow.id", + "type": "string", + }, + "required": true, + }, + "navigation": Object { + "node": Object { + "and": Array [ + Object { + "additionalProperties": false, + "extends": undefined, + "properties": Object { + "BEGIN": Object { + "node": Object { + "description": "The name of the Flow to begin on", + "title": "BEGIN", + "type": "string", + }, + "required": true, + }, + }, + "type": "object", + }, + Object { + "keyType": Object { + "type": "string", + }, + "type": "record", + "valueType": Object { + "or": Array [ + Object { + "type": "string", + }, + Object { + "additionalProperties": Object { + "or": Array [ + Object { + "type": "undefined", + }, + Object { + "type": "string", + }, + Object { + "genericArguments": undefined, + "ref": "Expression", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + Object { + "name": "NavigationFlowState", + "or": Array [ + Object { + "additionalProperties": false, + "description": "A state representing a view", + "extends": undefined, + "name": "NavigationFlowViewState", + "properties": Object { + "_comment": Object { + "node": Object { + "description": "Add comments that will not be processing, but are useful for code explanation", + "title": "CommentBase._comment", + "type": "string", + }, + "required": false, + }, + "attributes": Object { + "node": Object { + "additionalProperties": Object { + "type": "any", + }, + "description": "View meta-properties", + "extends": undefined, + "properties": Object {}, + "title": "NavigationFlowViewState.attributes", + "type": "object", + }, + "required": false, + }, + "exp": Object { + "node": Object { + "title": "NavigationBaseState.exp", + "type": "never", + }, + "required": false, + }, + "onEnd": Object { + "node": Object { + "description": "An optional expression to run before view transition", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onEnd", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onEnd", + "type": "or", + }, + "required": false, + }, + "onStart": Object { + "node": Object { + "description": "An optional expression to run when this view renders", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onStart", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onStart", + "type": "or", + }, + "required": false, + }, + "ref": Object { + "node": Object { + "description": "An id corresponding to a view from the 'views' array", + "title": "NavigationFlowViewState.ref", + "type": "string", + }, + "required": true, + }, + "state_type": Object { + "node": Object { + "const": "VIEW", + "description": "A property to determine the type of state this is", + "title": "NavigationBaseState.state_type", + "type": "string", + }, + "required": true, + }, + "transitions": Object { + "node": Object { + "description": "A mapping of transition-name to FlowState name", + "keyType": Object { + "type": "string", + }, + "name": "NavigationFlowTransition", + "source": "src/index.ts", + "title": "NavigationFlowTransitionableState.transitions", + "type": "record", + "valueType": Object { + "type": "string", + }, + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "NavigationFlowViewState", + "type": "object", + }, + Object { + "additionalProperties": false, + "description": "An END state of the flow.", + "extends": undefined, + "name": "NavigationFlowEndState", + "properties": Object { + "_comment": Object { + "node": Object { + "description": "Add comments that will not be processing, but are useful for code explanation", + "title": "CommentBase._comment", + "type": "string", + }, + "required": false, + }, + "exp": Object { + "node": Object { + "title": "NavigationBaseState.exp", + "type": "never", + }, + "required": false, + }, + "onEnd": Object { + "node": Object { + "description": "An optional expression to run before view transition", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onEnd", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onEnd", + "type": "or", + }, + "required": false, + }, + "onStart": Object { + "node": Object { + "description": "An optional expression to run when this view renders", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onStart", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onStart", + "type": "or", + }, + "required": false, + }, + "outcome": Object { + "node": Object { + "description": "A description of _how_ the flow ended. +If this is a flow started from another flow, the outcome determines the flow transition", + "title": "NavigationFlowEndState.outcome", + "type": "string", + }, + "required": true, + }, + "state_type": Object { + "node": Object { + "const": "END", + "description": "A property to determine the type of state this is", + "title": "NavigationBaseState.state_type", + "type": "string", + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "NavigationFlowEndState", + "type": "object", + }, + Object { + "additionalProperties": false, + "extends": undefined, + "name": "NavigationFlowFlowState", + "properties": Object { + "_comment": Object { + "node": Object { + "description": "Add comments that will not be processing, but are useful for code explanation", + "title": "CommentBase._comment", + "type": "string", + }, + "required": false, + }, + "exp": Object { + "node": Object { + "title": "NavigationBaseState.exp", + "type": "never", + }, + "required": false, + }, + "onEnd": Object { + "node": Object { + "description": "An optional expression to run before view transition", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onEnd", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onEnd", + "type": "or", + }, + "required": false, + }, + "onStart": Object { + "node": Object { + "description": "An optional expression to run when this view renders", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onStart", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onStart", + "type": "or", + }, + "required": false, + }, + "ref": Object { + "node": Object { + "description": "A reference to a FLOW id state to run", + "title": "NavigationFlowFlowState.ref", + "type": "string", + }, + "required": true, + }, + "state_type": Object { + "node": Object { + "const": "FLOW", + "description": "A property to determine the type of state this is", + "title": "NavigationBaseState.state_type", + "type": "string", + }, + "required": true, + }, + "transitions": Object { + "node": Object { + "description": "A mapping of transition-name to FlowState name", + "keyType": Object { + "type": "string", + }, + "name": "NavigationFlowTransition", + "source": "src/index.ts", + "title": "NavigationFlowTransitionableState.transitions", + "type": "record", + "valueType": Object { + "type": "string", + }, + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "NavigationFlowFlowState", + "type": "object", + }, + Object { + "additionalProperties": false, + "description": "Action states execute an expression to determine the next state to transition to", + "extends": undefined, + "name": "NavigationFlowActionState", + "properties": Object { + "_comment": Object { + "node": Object { + "description": "Add comments that will not be processing, but are useful for code explanation", + "title": "CommentBase._comment", + "type": "string", + }, + "required": false, + }, + "exp": Object { + "node": Object { + "description": "An expression to execute. +The return value determines the transition to take", + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationFlowActionState.exp", + "type": "ref", + }, + "required": true, + }, + "onEnd": Object { + "node": Object { + "description": "An optional expression to run before view transition", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onEnd", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onEnd", + "type": "or", + }, + "required": false, + }, + "onStart": Object { + "node": Object { + "description": "An optional expression to run when this view renders", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onStart", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onStart", + "type": "or", + }, + "required": false, + }, + "state_type": Object { + "node": Object { + "const": "ACTION", + "description": "A property to determine the type of state this is", + "title": "NavigationBaseState.state_type", + "type": "string", + }, + "required": true, + }, + "transitions": Object { + "node": Object { + "description": "A mapping of transition-name to FlowState name", + "keyType": Object { + "type": "string", + }, + "name": "NavigationFlowTransition", + "source": "src/index.ts", + "title": "NavigationFlowTransitionableState.transitions", + "type": "record", + "valueType": Object { + "type": "string", + }, + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "NavigationFlowActionState", + "type": "object", + }, + Object { + "additionalProperties": false, + "description": "External Flow states represent states in the FSM that can't be resolved internally in Player. +The flow will wait for the embedded application to manage moving to the next state via a transition", + "extends": undefined, + "name": "NavigationFlowExternalState", + "properties": Object { + "_comment": Object { + "node": Object { + "description": "Add comments that will not be processing, but are useful for code explanation", + "title": "CommentBase._comment", + "type": "string", + }, + "required": false, + }, + "exp": Object { + "node": Object { + "title": "NavigationBaseState.exp", + "type": "never", + }, + "required": false, + }, + "onEnd": Object { + "node": Object { + "description": "An optional expression to run before view transition", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onEnd", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onEnd", + "type": "or", + }, + "required": false, + }, + "onStart": Object { + "node": Object { + "description": "An optional expression to run when this view renders", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onStart", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onStart", + "type": "or", + }, + "required": false, + }, + "ref": Object { + "node": Object { + "description": "A reference for this external state", + "title": "NavigationFlowExternalState.ref", + "type": "string", + }, + "required": true, + }, + "state_type": Object { + "node": Object { + "const": "EXTERNAL", + "description": "A property to determine the type of state this is", + "title": "NavigationBaseState.state_type", + "type": "string", + }, + "required": true, + }, + "transitions": Object { + "node": Object { + "description": "A mapping of transition-name to FlowState name", + "keyType": Object { + "type": "string", + }, + "name": "NavigationFlowTransition", + "source": "src/index.ts", + "title": "NavigationFlowTransitionableState.transitions", + "type": "record", + "valueType": Object { + "type": "string", + }, + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "NavigationFlowExternalState", + "type": "object", + }, + ], + "source": "src/index.ts", + "title": "NavigationFlowState", + "type": "or", + }, + ], + "type": "or", + }, + "description": "A state machine in the navigation", + "extends": undefined, + "name": "NavigationFlow", + "properties": Object { + "onEnd": Object { + "node": Object { + "description": "An optional expression to run when this Flow ends", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationFlow.onEnd", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationFlow.onEnd", + "type": "or", + }, + "required": false, + }, + "onStart": Object { + "node": Object { + "description": "An optional expression to run when this Flow starts", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationFlow.onStart", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationFlow.onStart", + "type": "or", + }, + "required": false, + }, + "startState": Object { + "node": Object { + "description": "The first state to kick off the state machine", + "title": "NavigationFlow.startState", + "type": "string", + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "NavigationFlow", + "type": "object", + }, + ], + "type": "or", + }, + }, + ], + "description": "A state machine to drive a user through the experience", + "name": "Navigation", + "source": "src/index.ts", + "title": "Flow.navigation", + "type": "and", + }, + "required": true, + }, + "schema": Object { + "node": Object { + "additionalProperties": Object { + "additionalProperties": Object { + "additionalProperties": Object { + "type": "unknown", + }, + "description": "Each prop in the object can have a specific DataType", + "extends": undefined, + "genericTokens": Array [ + Object { + "constraints": Object { + "type": "any", + }, + "default": Object { + "type": "unknown", + }, + "symbol": "T", + }, + ], + "name": "DataType", + "properties": Object { + "default": Object { + "node": Object { + "description": "A default value for this property. +Any reads for this property will result in this default value being written to the model.", + "genericArguments": undefined, + "ref": "T", + "title": "DataType.default", + "type": "ref", + }, + "required": false, + }, + "format": Object { + "node": Object { + "additionalProperties": Object { + "type": "unknown", + }, + "description": "A reference to a specific data format to use. +If none is specified, will fallback to that of the base type", + "extends": undefined, + "name": "Reference", + "properties": Object { + "type": Object { + "node": Object { + "description": "The name of the formatter (and de-formatter) to use", + "title": "Reference.type", + "type": "string", + }, + "required": true, + }, + }, + "title": "DataType.format", + "type": "object", + }, + "required": false, + }, + "isArray": Object { + "node": Object { + "description": "The referenced object represents an array rather than an object", + "title": "DataType.isArray", + "type": "boolean", + }, + "required": false, + }, + "type": Object { + "node": Object { + "description": "The reference of the base type to use", + "title": "DataType.type", + "type": "string", + }, + "required": true, + }, + "validation": Object { + "node": Object { + "description": "Any additional validations that are associated with this property +These will add to any base validations associated with the \\"type\\"", + "elementType": Object { + "additionalProperties": Object { + "type": "unknown", + }, + "description": "A reference to a validation object", + "extends": undefined, + "name": "Reference", + "properties": Object { + "dataTarget": Object { + "node": Object { + "description": "Each validation is passed the value of the data to run it's validation against. +By default, this is the value stored in the data-model (deformatted). +In the off chance you'd like this validator to run against the formatted value (the one the user sees), set this option", + "or": Array [ + Object { + "const": "formatted", + "title": "Reference.dataTarget", + "type": "string", + }, + Object { + "const": "deformatted", + "title": "Reference.dataTarget", + "type": "string", + }, + ], + "title": "Reference.dataTarget", + "type": "or", + }, + "required": false, + }, + "displayTarget": Object { + "node": Object { + "description": "Where the error should be displayed", + "name": "DisplayTarget", + "or": Array [ + Object { + "const": "page", + "title": "DisplayTarget", + "type": "string", + }, + Object { + "const": "section", + "title": "DisplayTarget", + "type": "string", + }, + Object { + "const": "field", + "title": "DisplayTarget", + "type": "string", + }, + ], + "title": "Reference.displayTarget", + "type": "or", + }, + "required": false, + }, + "message": Object { + "node": Object { + "description": "An optional means of overriding the default message if the validation is triggered", + "title": "Reference.message", + "type": "string", + }, + "required": false, + }, + "severity": Object { + "node": Object { + "description": "An optional means of overriding the default severity of the validation if triggered", + "name": "Severity", + "or": Array [ + Object { + "const": "error", + "title": "Severity", + "type": "string", + }, + Object { + "const": "warning", + "title": "Severity", + "type": "string", + }, + ], + "title": "Reference.severity", + "type": "or", + }, + "required": false, + }, + "trigger": Object { + "node": Object { + "description": "When to run this particular validation", + "name": "Trigger", + "or": Array [ + Object { + "const": "navigation", + "title": "Trigger", + "type": "string", + }, + Object { + "const": "change", + "title": "Trigger", + "type": "string", + }, + Object { + "const": "load", + "title": "Trigger", + "type": "string", + }, + ], + "title": "Reference.trigger", + "type": "or", + }, + "required": false, + }, + "type": Object { + "node": Object { + "description": "The name of the referenced validation type +This will be used to lookup the proper handler", + "title": "Reference.type", + "type": "string", + }, + "required": true, + }, + }, + "title": "Reference", + "type": "object", + }, + "title": "DataType.validation", + "type": "array", + }, + "required": false, + }, + }, + "title": "DataType", + "type": "object", + }, + "description": "A Node describes a specific object in the tree", + "extends": undefined, + "name": "Node", + "properties": Object {}, + "title": "Node", + "type": "object", + }, + "description": "The schema for the supplied (or referenced data). +This is used for validation, formatting, etc", + "extends": undefined, + "name": "Schema", + "properties": Object { + "ROOT": Object { + "node": Object { + "additionalProperties": Object { + "additionalProperties": Object { + "type": "unknown", + }, + "description": "Each prop in the object can have a specific DataType", + "extends": undefined, + "genericTokens": Array [ + Object { + "constraints": Object { + "type": "any", + }, + "default": Object { + "type": "unknown", + }, + "symbol": "T", + }, + ], + "name": "DataType", + "properties": Object { + "default": Object { + "node": Object { + "description": "A default value for this property. +Any reads for this property will result in this default value being written to the model.", + "genericArguments": undefined, + "ref": "T", + "title": "DataType.default", + "type": "ref", + }, + "required": false, + }, + "format": Object { + "node": Object { + "additionalProperties": Object { + "type": "unknown", + }, + "description": "A reference to a specific data format to use. +If none is specified, will fallback to that of the base type", + "extends": undefined, + "name": "Reference", + "properties": Object { + "type": Object { + "node": Object { + "description": "The name of the formatter (and de-formatter) to use", + "title": "Reference.type", + "type": "string", + }, + "required": true, + }, + }, + "title": "DataType.format", + "type": "object", + }, + "required": false, + }, + "isArray": Object { + "node": Object { + "description": "The referenced object represents an array rather than an object", + "title": "DataType.isArray", + "type": "boolean", + }, + "required": false, + }, + "type": Object { + "node": Object { + "description": "The reference of the base type to use", + "title": "DataType.type", + "type": "string", + }, + "required": true, + }, + "validation": Object { + "node": Object { + "description": "Any additional validations that are associated with this property +These will add to any base validations associated with the \\"type\\"", + "elementType": Object { + "additionalProperties": Object { + "type": "unknown", + }, + "description": "A reference to a validation object", + "extends": undefined, + "name": "Reference", + "properties": Object { + "dataTarget": Object { + "node": Object { + "description": "Each validation is passed the value of the data to run it's validation against. +By default, this is the value stored in the data-model (deformatted). +In the off chance you'd like this validator to run against the formatted value (the one the user sees), set this option", + "or": Array [ + Object { + "const": "formatted", + "title": "Reference.dataTarget", + "type": "string", + }, + Object { + "const": "deformatted", + "title": "Reference.dataTarget", + "type": "string", + }, + ], + "title": "Reference.dataTarget", + "type": "or", + }, + "required": false, + }, + "displayTarget": Object { + "node": Object { + "description": "Where the error should be displayed", + "name": "DisplayTarget", + "or": Array [ + Object { + "const": "page", + "title": "DisplayTarget", + "type": "string", + }, + Object { + "const": "section", + "title": "DisplayTarget", + "type": "string", + }, + Object { + "const": "field", + "title": "DisplayTarget", + "type": "string", + }, + ], + "title": "Reference.displayTarget", + "type": "or", + }, + "required": false, + }, + "message": Object { + "node": Object { + "description": "An optional means of overriding the default message if the validation is triggered", + "title": "Reference.message", + "type": "string", + }, + "required": false, + }, + "severity": Object { + "node": Object { + "description": "An optional means of overriding the default severity of the validation if triggered", + "name": "Severity", + "or": Array [ + Object { + "const": "error", + "title": "Severity", + "type": "string", + }, + Object { + "const": "warning", + "title": "Severity", + "type": "string", + }, + ], + "title": "Reference.severity", + "type": "or", + }, + "required": false, + }, + "trigger": Object { + "node": Object { + "description": "When to run this particular validation", + "name": "Trigger", + "or": Array [ + Object { + "const": "navigation", + "title": "Trigger", + "type": "string", + }, + Object { + "const": "change", + "title": "Trigger", + "type": "string", + }, + Object { + "const": "load", + "title": "Trigger", + "type": "string", + }, + ], + "title": "Reference.trigger", + "type": "or", + }, + "required": false, + }, + "type": Object { + "node": Object { + "description": "The name of the referenced validation type +This will be used to lookup the proper handler", + "title": "Reference.type", + "type": "string", + }, + "required": true, + }, + }, + "title": "Reference", + "type": "object", + }, + "title": "DataType.validation", + "type": "array", + }, + "required": false, + }, + }, + "title": "DataType", + "type": "object", + }, + "description": "The ROOT object is the top level object to use", + "extends": undefined, + "name": "Node", + "properties": Object {}, + "title": "Schema.ROOT", + "type": "object", + }, + "required": true, + }, + }, + "title": "Flow.schema", + "type": "object", + }, + "required": false, + }, + "views": Object { + "node": Object { + "description": "A list of views (each with an ID) that can be shown to a user", + "elementType": Object { + "check": Object { + "left": Object { + "type": "unknown", + }, + "right": Object { + "type": "unknown", + }, + }, + "genericTokens": Array [ + Object { + "constraints": Object { + "ref": "Asset", + "type": "ref", + }, + "default": Object { + "ref": "Asset", + "type": "ref", + }, + "symbol": "T", + }, + ], + "name": "View", + "source": "src/index.ts", + "title": "View", + "type": "conditional", + "value": Object { + "false": Object { + "genericArguments": undefined, + "ref": "T", + "type": "ref", + }, + "true": Object { + "and": Array [ + Object { + "genericArguments": undefined, + "ref": "T", + "type": "ref", + }, + Object { + "additionalProperties": false, + "extends": undefined, + "properties": Object { + "validation": Object { + "node": Object { + "description": "Each view can optionally supply a list of validations to run against a particular view", + "elementType": Object { + "additionalProperties": Object { + "type": "unknown", + }, + "extends": undefined, + "name": "CrossfieldReference", + "properties": Object { + "dataTarget": Object { + "node": Object { + "description": "Cross-field references and validation must run against the default (deformatted) value", + "title": "CrossfieldReference.dataTarget", + "type": "never", + }, + "required": false, + }, + "displayTarget": Object { + "node": Object { + "description": "Where the error should be displayed", + "name": "DisplayTarget", + "or": Array [ + Object { + "const": "page", + "title": "DisplayTarget", + "type": "string", + }, + Object { + "const": "section", + "title": "DisplayTarget", + "type": "string", + }, + Object { + "const": "field", + "title": "DisplayTarget", + "type": "string", + }, + ], + "title": "Reference.displayTarget", + "type": "or", + }, + "required": false, + }, + "message": Object { + "node": Object { + "description": "An optional means of overriding the default message if the validation is triggered", + "title": "Reference.message", + "type": "string", + }, + "required": false, + }, + "ref": Object { + "node": Object { + "description": "The binding to associate this validation with", + "genericArguments": undefined, + "ref": "Binding", + "title": "CrossfieldReference.ref", + "type": "ref", + }, + "required": false, + }, + "severity": Object { + "node": Object { + "description": "An optional means of overriding the default severity of the validation if triggered", + "name": "Severity", + "or": Array [ + Object { + "const": "error", + "title": "Severity", + "type": "string", + }, + Object { + "const": "warning", + "title": "Severity", + "type": "string", + }, + ], + "title": "Reference.severity", + "type": "or", + }, + "required": false, + }, + "trigger": Object { + "node": Object { + "description": "When to run this particular validation", + "name": "Trigger", + "or": Array [ + Object { + "const": "navigation", + "title": "Trigger", + "type": "string", + }, + Object { + "const": "change", + "title": "Trigger", + "type": "string", + }, + Object { + "const": "load", + "title": "Trigger", + "type": "string", + }, + ], + "title": "Reference.trigger", + "type": "or", + }, + "required": false, + }, + "type": Object { + "node": Object { + "description": "The name of the referenced validation type +This will be used to lookup the proper handler", + "title": "Reference.type", + "type": "string", + }, + "required": true, + }, + }, + "title": "CrossfieldReference", + "type": "object", + }, + "title": "validation", + "type": "array", + }, + "required": false, + }, + }, + "type": "object", + }, + ], + "type": "and", + }, + }, + }, + "title": "Flow.views", + "type": "array", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "Flow", + "type": "object", + }, +] +`; + +exports[`Export Test Exports Typescript types 1`] = ` +Array [ + Object { + "additionalProperties": Object { + "type": "unknown", + }, + "description": "This is the most generic way of gathering data. The input is bound to a data model using the 'binding' property. +Players can get field type information from the 'schema' definition, thus to decide the input controls for visual rendering.", + "extends": undefined, + "genericTokens": Array [ + Object { + "constraints": Object { + "ref": "Asset", + "type": "ref", + }, + "default": Object { + "ref": "Asset", + "type": "ref", + }, + "symbol": "AnyTextAsset", + }, + ], + "name": "InputAsset", + "properties": Object { + "binding": Object { + "node": Object { + "description": "The location in the data-model to store the data", + "genericArguments": undefined, + "ref": "Binding", + "title": "InputAsset.binding", + "type": "ref", + }, + "required": true, + }, + "id": Object { + "node": Object { + "description": "Each asset requires a unique id per view", + "title": "Asset.id", + "type": "string", + }, + "required": true, + }, + "label": Object { + "node": Object { + "description": "Asset container for a field label.", + "genericArguments": Array [ + Object { + "genericArguments": undefined, + "ref": "AnyTextAsset", + "type": "ref", + }, + ], + "ref": "AssetWrapper", + "title": "InputAsset.label", + "type": "ref", + }, + "required": false, + }, + "metaData": Object { + "node": Object { + "additionalProperties": false, + "description": "Optional additional data", + "extends": undefined, + "properties": Object { + "beacon": Object { + "node": Object { + "description": "Additional data to beacon when this input changes", + "name": "BeaconDataType", + "or": Array [ + Object { + "title": "BeaconDataType", + "type": "string", + }, + Object { + "keyType": Object { + "type": "string", + }, + "title": "BeaconDataType", + "type": "record", + "valueType": Object { + "type": "any", + }, + }, + ], + "source": "/private/var/tmp/_bazel_kreddy8/6fc13ccb395252816f0c23d8394e8532/sandbox/darwin-sandbox/134/execroot/player/node_modules/@player-ui/beacon-plugin/dist/index.d.ts", + "title": "InputAsset.metaData.beacon", + "type": "or", + }, + "required": false, + }, + }, + "title": "InputAsset.metaData", + "type": "object", + }, + "required": false, + }, + "note": Object { + "node": Object { + "description": "Asset container for a note.", + "genericArguments": Array [ + Object { + "genericArguments": undefined, + "ref": "AnyTextAsset", + "type": "ref", + }, + ], + "ref": "AssetWrapper", + "title": "InputAsset.note", + "type": "ref", + }, + "required": false, + }, + "type": Object { + "node": Object { + "const": "input", + "description": "The asset type determines the semantics of how a user interacts with a page", + "title": "Asset.type", + "type": "string", + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "Asset", + "type": "object", + }, + Object { + "additionalProperties": Object { + "type": "unknown", + }, + "description": undefined, + "extends": undefined, + "genericTokens": Array [], + "name": "TextAsset", + "properties": Object { + "id": Object { + "node": Object { + "description": "Each asset requires a unique id per view", + "title": "Asset.id", + "type": "string", + }, + "required": true, + }, + "modifiers": Object { + "node": Object { + "description": "Any modifiers on the text", + "elementType": Object { + "name": "TextModifier", + "or": Array [ + Object { + "additionalProperties": Object { + "type": "unknown", + }, + "extends": undefined, + "name": "BasicTextModifier", + "properties": Object { + "name": Object { + "node": Object { + "description": "Modifiers can be named when used in strings", + "title": "BasicTextModifier.name", + "type": "string", + }, + "required": false, + }, + "type": Object { + "node": Object { + "description": "The modifier type", + "title": "BasicTextModifier.type", + "type": "string", + }, + "required": true, + }, + }, + "source": "/private/var/tmp/_bazel_kreddy8/6fc13ccb395252816f0c23d8394e8532/sandbox/darwin-sandbox/134/execroot/player/node_modules/@player-ui/reference-assets-plugin/dist/index.d.ts", + "title": "BasicTextModifier", + "type": "object", + }, + Object { + "additionalProperties": false, + "description": "A modifier to turn the text into a link", + "extends": undefined, + "name": "LinkModifier", + "properties": Object { + "exp": Object { + "node": Object { + "description": "An optional expression to run before the link is opened", + "genericArguments": undefined, + "ref": "Expression", + "title": "LinkModifier.exp", + "type": "ref", + }, + "required": false, + }, + "metaData": Object { + "node": Object { + "additionalProperties": false, + "description": "metaData about the link's target", + "extends": undefined, + "properties": Object { + "'mime-type'": Object { + "node": Object { + "description": "Used to indicate an application specific resolver to use", + "title": "LinkModifier.metaData.'mime-type'", + "type": "string", + }, + "required": false, + }, + "ref": Object { + "node": Object { + "description": "The location of the link to load", + "title": "LinkModifier.metaData.ref", + "type": "string", + }, + "required": true, + }, + }, + "title": "LinkModifier.metaData", + "type": "object", + }, + "required": true, + }, + "type": Object { + "node": Object { + "const": "link", + "description": "The link type denotes this as a link", + "title": "LinkModifier.type", + "type": "string", + }, + "required": true, + }, + }, + "source": "/private/var/tmp/_bazel_kreddy8/6fc13ccb395252816f0c23d8394e8532/sandbox/darwin-sandbox/134/execroot/player/node_modules/@player-ui/reference-assets-plugin/dist/index.d.ts", + "title": "LinkModifier", + "type": "object", + }, + ], + "source": "/private/var/tmp/_bazel_kreddy8/6fc13ccb395252816f0c23d8394e8532/sandbox/darwin-sandbox/134/execroot/player/node_modules/@player-ui/reference-assets-plugin/dist/index.d.ts", + "title": "TextModifier", + "type": "or", + }, + "title": "TextAsset.modifiers", + "type": "array", + }, + "required": false, + }, + "type": Object { + "node": Object { + "const": "text", + "description": "The asset type determines the semantics of how a user interacts with a page", + "title": "Asset.type", + "type": "string", + }, + "required": true, + }, + "value": Object { + "node": Object { + "description": "The text to display", + "title": "TextAsset.value", + "type": "string", + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "Asset", + "type": "object", + }, + Object { + "additionalProperties": Object { + "type": "unknown", + }, + "description": "User actions can be represented in several places. +Each view typically has one or more actions that allow the user to navigate away from that view. +In addition, several asset types can have actions that apply to that asset only.", + "extends": undefined, + "genericTokens": Array [ + Object { + "constraints": Object { + "ref": "Asset", + "type": "ref", + }, + "default": Object { + "ref": "Asset", + "type": "ref", + }, + "symbol": "AnyTextAsset", + }, + ], + "name": "ActionAsset", + "properties": Object { + "accessibility": Object { + "node": Object { + "description": "An optional string that describes the action for screen-readers", + "title": "ActionAsset.accessibility", + "type": "string", + }, + "required": false, + }, + "exp": Object { + "node": Object { + "description": "An optional expression to execute before transitioning", + "genericArguments": undefined, + "ref": "Expression", + "title": "ActionAsset.exp", + "type": "ref", + }, + "required": false, + }, + "id": Object { + "node": Object { + "description": "Each asset requires a unique id per view", + "title": "Asset.id", + "type": "string", + }, + "required": true, + }, + "label": Object { + "node": Object { + "description": "A text-like asset for the action's label", + "genericArguments": Array [ + Object { + "genericArguments": undefined, + "ref": "AnyTextAsset", + "type": "ref", + }, + ], + "ref": "AssetWrapper", + "title": "ActionAsset.label", + "type": "ref", + }, + "required": false, + }, + "metaData": Object { + "node": Object { + "additionalProperties": false, + "description": "Additional optional data to assist with the action interactions on the page", + "extends": undefined, + "properties": Object { + "beacon": Object { + "node": Object { + "description": "Additional data to beacon", + "name": "BeaconDataType", + "or": Array [ + Object { + "title": "BeaconDataType", + "type": "string", + }, + Object { + "keyType": Object { + "type": "string", + }, + "title": "BeaconDataType", + "type": "record", + "valueType": Object { + "type": "any", + }, + }, + ], + "source": "/private/var/tmp/_bazel_kreddy8/6fc13ccb395252816f0c23d8394e8532/sandbox/darwin-sandbox/134/execroot/player/node_modules/@player-ui/beacon-plugin/dist/index.d.ts", + "title": "ActionAsset.metaData.beacon", + "type": "or", + }, + "required": false, + }, + "skipValidation": Object { + "node": Object { + "description": "Force transition to the next view without checking for validation", + "title": "ActionAsset.metaData.skipValidation", + "type": "boolean", + }, + "required": false, + }, + }, + "title": "ActionAsset.metaData", + "type": "object", + }, + "required": false, + }, + "type": Object { + "node": Object { + "const": "action", + "description": "The asset type determines the semantics of how a user interacts with a page", + "title": "Asset.type", + "type": "string", + }, + "required": true, + }, + "value": Object { + "node": Object { + "description": "The transition value of the action in the state machine", + "title": "ActionAsset.value", + "type": "string", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "Asset", + "type": "object", + }, + Object { + "additionalProperties": Object { + "type": "unknown", + }, + "description": undefined, + "extends": undefined, + "genericTokens": Array [], + "name": "InfoAsset", + "properties": Object { + "actions": Object { + "node": Object { + "description": "List of actions to show at the bottom of the page", + "elementType": Object { + "genericArguments": undefined, + "ref": "AssetWrapper", + "type": "ref", + }, + "title": "InfoAsset.actions", + "type": "array", + }, + "required": false, + }, + "id": Object { + "node": Object { + "description": "Each asset requires a unique id per view", + "title": "Asset.id", + "type": "string", + }, + "required": true, + }, + "primaryInfo": Object { + "node": Object { + "description": "Primary place for info", + "genericArguments": undefined, + "ref": "AssetWrapper", + "title": "InfoAsset.primaryInfo", + "type": "ref", + }, + "required": false, + }, + "subTitle": Object { + "node": Object { + "description": "subtitle", + "genericArguments": undefined, + "ref": "AssetWrapper", + "title": "InfoAsset.subTitle", + "type": "ref", + }, + "required": false, + }, + "title": Object { + "node": Object { + "description": "The string value to show", + "genericArguments": undefined, + "ref": "AssetWrapper", + "title": "InfoAsset.title", + "type": "ref", + }, + "required": false, + }, + "type": Object { + "node": Object { + "const": "info", + "description": "The asset type determines the semantics of how a user interacts with a page", + "title": "Asset.type", + "type": "string", + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "Asset", + "type": "object", + }, + Object { + "additionalProperties": Object { + "type": "unknown", + }, + "description": undefined, + "extends": undefined, + "genericTokens": Array [], + "name": "CollectionAsset", + "properties": Object { + "id": Object { + "node": Object { + "description": "Each asset requires a unique id per view", + "title": "Asset.id", + "type": "string", + }, + "required": true, + }, + "label": Object { + "node": Object { + "description": "An optional label to title the collection", + "genericArguments": undefined, + "ref": "AssetWrapper", + "title": "CollectionAsset.label", + "type": "ref", + }, + "required": false, + }, + "type": Object { + "node": Object { + "const": "collection", + "description": "The asset type determines the semantics of how a user interacts with a page", + "title": "Asset.type", + "type": "string", + }, + "required": true, + }, + "values": Object { + "node": Object { + "description": "The string value to show", + "elementType": Object { + "genericArguments": undefined, + "ref": "AssetWrapper", + "type": "ref", + }, + "title": "CollectionAsset.values", + "type": "array", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "Asset", + "type": "object", + }, + Object { + "additionalProperties": Object { + "type": "unknown", + }, + "description": "An asset is the smallest unit of user interaction in a player view", + "extends": undefined, + "genericTokens": Array [ + Object { + "constraints": Object { + "type": "string", + }, + "default": Object { + "type": "string", + }, + "symbol": "T", + }, + ], + "name": "Asset", + "properties": Object { + "id": Object { + "node": Object { + "description": "Each asset requires a unique id per view", + "title": "Asset.id", + "type": "string", + }, + "required": true, + }, + "type": Object { + "node": Object { + "description": "The asset type determines the semantics of how a user interacts with a page", + "genericArguments": undefined, + "ref": "T", + "title": "Asset.type", + "type": "ref", + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "Asset", + "type": "object", + }, + Object { + "additionalProperties": Object { + "type": "unknown", + }, + "description": "An asset that contains a Binding.", + "extends": undefined, + "genericTokens": Array [ + Object { + "constraints": Object { + "type": "string", + }, + "default": Object { + "type": "string", + }, + "symbol": "T", + }, + ], + "name": "AssetBinding", + "properties": Object { + "binding": Object { + "node": Object { + "description": "A binding that points to somewhere in the data model", + "genericArguments": undefined, + "ref": "Binding", + "title": "AssetBinding.binding", + "type": "ref", + }, + "required": true, + }, + "id": Object { + "node": Object { + "description": "Each asset requires a unique id per view", + "title": "Asset.id", + "type": "string", + }, + "required": true, + }, + "type": Object { + "node": Object { + "description": "The asset type determines the semantics of how a user interacts with a page", + "genericArguments": undefined, + "ref": "T", + "title": "Asset.type", + "type": "ref", + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "Asset", + "type": "object", + }, + Object { + "additionalProperties": false, + "description": "A single case statement to use in a switch", + "extends": undefined, + "genericTokens": Array [ + Object { + "constraints": Object { + "ref": "Asset", + "type": "ref", + }, + "default": Object { + "ref": "Asset", + "type": "ref", + }, + "symbol": "T", + }, + ], + "name": "SwitchCase", + "properties": Object { + "asset": Object { + "node": Object { + "description": "The Asset to use if this case is applicable", + "genericArguments": undefined, + "ref": "T", + "title": "SwitchCase.asset", + "type": "ref", + }, + "required": true, + }, + "case": Object { + "node": Object { + "description": "An expression to execute to determine if this case applies", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "SwitchCase.case", + "type": "ref", + }, + Object { + "const": true, + "title": "SwitchCase.case", + "type": "boolean", + }, + ], + "title": "SwitchCase.case", + "type": "or", + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "SwitchCase", + "type": "object", + }, + Object { + "description": "A switch can replace an asset with the applicable case on first render", + "elementType": Object { + "additionalProperties": false, + "description": "A single case statement to use in a switch", + "extends": undefined, + "genericTokens": Array [ + Object { + "constraints": Object { + "ref": "Asset", + "type": "ref", + }, + "default": Object { + "ref": "Asset", + "type": "ref", + }, + "symbol": "T", + }, + ], + "name": "SwitchCase", + "properties": Object { + "asset": Object { + "node": Object { + "description": "The Asset to use if this case is applicable", + "genericArguments": undefined, + "ref": "T", + "title": "SwitchCase.asset", + "type": "ref", + }, + "required": true, + }, + "case": Object { + "node": Object { + "description": "An expression to execute to determine if this case applies", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "SwitchCase.case", + "type": "ref", + }, + Object { + "const": true, + "title": "SwitchCase.case", + "type": "boolean", + }, + ], + "title": "SwitchCase.case", + "type": "or", + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "SwitchCase", + "type": "object", + }, + "genericTokens": Array [ + Object { + "constraints": Object { + "ref": "Asset", + "type": "ref", + }, + "default": Object { + "ref": "Asset", + "type": "ref", + }, + "symbol": "T", + }, + ], + "name": "Switch", + "source": "src/index.ts", + "title": "Switch", + "type": "array", + }, + Object { + "additionalProperties": Object { + "type": "unknown", + }, + "description": "An object that contains an asset", + "extends": undefined, + "genericTokens": Array [ + Object { + "constraints": Object { + "ref": "Asset", + "type": "ref", + }, + "default": Object { + "ref": "Asset", + "type": "ref", + }, + "symbol": "T", + }, + ], + "name": "AssetWrapper", + "properties": Object { + "asset": Object { + "node": Object { + "description": "An asset instance", + "genericArguments": undefined, + "ref": "T", + "title": "AssetWrapper.asset", + "type": "ref", + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "AssetWrapper", + "type": "object", + }, + Object { + "genericTokens": Array [ + Object { + "constraints": Object { + "ref": "Asset", + "type": "ref", + }, + "default": Object { + "ref": "Asset", + "type": "ref", + }, + "symbol": "T", + }, + ], + "name": "AssetWrapperOrSwitch", + "or": Array [ + Object { + "and": Array [ + Object { + "genericArguments": Array [ + Object { + "genericArguments": undefined, + "ref": "T", + "type": "ref", + }, + ], + "ref": "AssetWrapper", + "type": "ref", + }, + Object { + "additionalProperties": false, + "extends": undefined, + "properties": Object { + "dynamicSwitch": Object { + "node": Object { + "description": "The dynamicSwitch property can't exist at the same time as 'asset'", + "title": "dynamicSwitch", + "type": "never", + }, + "required": false, + }, + "staticSwitch": Object { + "node": Object { + "description": "The staticSwitch property can't exist at the same time as 'asset'", + "title": "staticSwitch", + "type": "never", + }, + "required": false, + }, + }, + "type": "object", + }, + ], + "type": "and", + }, + Object { + "and": Array [ + Object { + "additionalProperties": false, + "extends": undefined, + "genericTokens": Array [ + Object { + "constraints": Object { + "ref": "Asset", + "type": "ref", + }, + "default": Object { + "ref": "Asset", + "type": "ref", + }, + "symbol": "T", + }, + ], + "name": "StaticSwitch", + "properties": Object { + "staticSwitch": Object { + "node": Object { + "description": "A static switch only evaluates the applicable base on first render of the view", + "elementType": Object { + "additionalProperties": false, + "description": "A single case statement to use in a switch", + "extends": undefined, + "genericTokens": Array [ + Object { + "constraints": Object { + "ref": "Asset", + "type": "ref", + }, + "default": Object { + "ref": "Asset", + "type": "ref", + }, + "symbol": "T", + }, + ], + "name": "SwitchCase", + "properties": Object { + "asset": Object { + "node": Object { + "description": "The Asset to use if this case is applicable", + "genericArguments": undefined, + "ref": "T", + "title": "SwitchCase.asset", + "type": "ref", + }, + "required": true, + }, + "case": Object { + "node": Object { + "description": "An expression to execute to determine if this case applies", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "SwitchCase.case", + "type": "ref", + }, + Object { + "const": true, + "title": "SwitchCase.case", + "type": "boolean", + }, + ], + "title": "SwitchCase.case", + "type": "or", + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "SwitchCase", + "type": "object", + }, + "genericTokens": Array [ + Object { + "constraints": Object { + "ref": "Asset", + "type": "ref", + }, + "default": Object { + "ref": "Asset", + "type": "ref", + }, + "symbol": "T", + }, + ], + "name": "Switch", + "source": "src/index.ts", + "title": "StaticSwitch.staticSwitch", + "type": "array", + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "StaticSwitch", + "type": "object", + }, + Object { + "additionalProperties": false, + "extends": undefined, + "properties": Object { + "asset": Object { + "node": Object { + "description": "The staticSwitch property can't exist at the same time as 'asset'", + "title": "asset", + "type": "never", + }, + "required": false, + }, + "dynamicSwitch": Object { + "node": Object { + "description": "The staticSwitch property can't exist at the same time as 'dynamicSwitch'", + "title": "dynamicSwitch", + "type": "never", + }, + "required": false, + }, + }, + "type": "object", + }, + ], + "type": "and", + }, + Object { + "and": Array [ + Object { + "additionalProperties": false, + "extends": undefined, + "genericTokens": Array [ + Object { + "constraints": Object { + "ref": "Asset", + "type": "ref", + }, + "default": Object { + "ref": "Asset", + "type": "ref", + }, + "symbol": "T", + }, + ], + "name": "DynamicSwitch", + "properties": Object { + "dynamicSwitch": Object { + "node": Object { + "description": "A dynamic switch re-evaluates the applicable case as data changes", + "elementType": Object { + "additionalProperties": false, + "description": "A single case statement to use in a switch", + "extends": undefined, + "genericTokens": Array [ + Object { + "constraints": Object { + "ref": "Asset", + "type": "ref", + }, + "default": Object { + "ref": "Asset", + "type": "ref", + }, + "symbol": "T", + }, + ], + "name": "SwitchCase", + "properties": Object { + "asset": Object { + "node": Object { + "description": "The Asset to use if this case is applicable", + "genericArguments": undefined, + "ref": "T", + "title": "SwitchCase.asset", + "type": "ref", + }, + "required": true, + }, + "case": Object { + "node": Object { + "description": "An expression to execute to determine if this case applies", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "SwitchCase.case", + "type": "ref", + }, + Object { + "const": true, + "title": "SwitchCase.case", + "type": "boolean", + }, + ], + "title": "SwitchCase.case", + "type": "or", + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "SwitchCase", + "type": "object", + }, + "genericTokens": Array [ + Object { + "constraints": Object { + "ref": "Asset", + "type": "ref", + }, + "default": Object { + "ref": "Asset", + "type": "ref", + }, + "symbol": "T", + }, + ], + "name": "Switch", + "source": "src/index.ts", + "title": "DynamicSwitch.dynamicSwitch", + "type": "array", + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "DynamicSwitch", + "type": "object", + }, + Object { + "additionalProperties": false, + "extends": undefined, + "properties": Object { + "asset": Object { + "node": Object { + "description": "The dynamicSwitch property can't exist at the same time as 'asset'", + "title": "asset", + "type": "never", + }, + "required": false, + }, + "staticSwitch": Object { + "node": Object { + "description": "The dynamicSwitch property can't exist at the same time as 'staticSwitch'", + "title": "staticSwitch", + "type": "never", + }, + "required": false, + }, + }, + "type": "object", + }, + ], + "type": "and", + }, + ], + "source": "src/index.ts", + "title": "AssetWrapperOrSwitch", + "type": "or", + }, + Object { + "genericTokens": Array [ + Object { + "constraints": Object { + "ref": "Asset", + "type": "ref", + }, + "default": Object { + "ref": "Asset", + "type": "ref", + }, + "symbol": "T", + }, + ], + "name": "AssetSwitch", + "or": Array [ + Object { + "additionalProperties": false, + "extends": undefined, + "genericTokens": Array [ + Object { + "constraints": Object { + "ref": "Asset", + "type": "ref", + }, + "default": Object { + "ref": "Asset", + "type": "ref", + }, + "symbol": "T", + }, + ], + "name": "StaticSwitch", + "properties": Object { + "staticSwitch": Object { + "node": Object { + "description": "A static switch only evaluates the applicable base on first render of the view", + "elementType": Object { + "additionalProperties": false, + "description": "A single case statement to use in a switch", + "extends": undefined, + "genericTokens": Array [ + Object { + "constraints": Object { + "ref": "Asset", + "type": "ref", + }, + "default": Object { + "ref": "Asset", + "type": "ref", + }, + "symbol": "T", + }, + ], + "name": "SwitchCase", + "properties": Object { + "asset": Object { + "node": Object { + "description": "The Asset to use if this case is applicable", + "genericArguments": undefined, + "ref": "T", + "title": "SwitchCase.asset", + "type": "ref", + }, + "required": true, + }, + "case": Object { + "node": Object { + "description": "An expression to execute to determine if this case applies", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "SwitchCase.case", + "type": "ref", + }, + Object { + "const": true, + "title": "SwitchCase.case", + "type": "boolean", + }, + ], + "title": "SwitchCase.case", + "type": "or", + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "SwitchCase", + "type": "object", + }, + "genericTokens": Array [ + Object { + "constraints": Object { + "ref": "Asset", + "type": "ref", + }, + "default": Object { + "ref": "Asset", + "type": "ref", + }, + "symbol": "T", + }, + ], + "name": "Switch", + "source": "src/index.ts", + "title": "StaticSwitch.staticSwitch", + "type": "array", + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "StaticSwitch", + "type": "object", + }, + Object { + "additionalProperties": false, + "extends": undefined, + "genericTokens": Array [ + Object { + "constraints": Object { + "ref": "Asset", + "type": "ref", + }, + "default": Object { + "ref": "Asset", + "type": "ref", + }, + "symbol": "T", + }, + ], + "name": "DynamicSwitch", + "properties": Object { + "dynamicSwitch": Object { + "node": Object { + "description": "A dynamic switch re-evaluates the applicable case as data changes", + "elementType": Object { + "additionalProperties": false, + "description": "A single case statement to use in a switch", + "extends": undefined, + "genericTokens": Array [ + Object { + "constraints": Object { + "ref": "Asset", + "type": "ref", + }, + "default": Object { + "ref": "Asset", + "type": "ref", + }, + "symbol": "T", + }, + ], + "name": "SwitchCase", + "properties": Object { + "asset": Object { + "node": Object { + "description": "The Asset to use if this case is applicable", + "genericArguments": undefined, + "ref": "T", + "title": "SwitchCase.asset", + "type": "ref", + }, + "required": true, + }, + "case": Object { + "node": Object { + "description": "An expression to execute to determine if this case applies", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "SwitchCase.case", + "type": "ref", + }, + Object { + "const": true, + "title": "SwitchCase.case", + "type": "boolean", + }, + ], + "title": "SwitchCase.case", + "type": "or", + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "SwitchCase", + "type": "object", + }, + "genericTokens": Array [ + Object { + "constraints": Object { + "ref": "Asset", + "type": "ref", + }, + "default": Object { + "ref": "Asset", + "type": "ref", + }, + "symbol": "T", + }, + ], + "name": "Switch", + "source": "src/index.ts", + "title": "DynamicSwitch.dynamicSwitch", + "type": "array", + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "DynamicSwitch", + "type": "object", + }, + ], + "source": "src/index.ts", + "title": "AssetSwitch", + "type": "or", + }, + Object { + "additionalProperties": false, + "extends": undefined, + "genericTokens": Array [ + Object { + "constraints": Object { + "ref": "Asset", + "type": "ref", + }, + "default": Object { + "ref": "Asset", + "type": "ref", + }, + "symbol": "T", + }, + ], + "name": "StaticSwitch", + "properties": Object { + "staticSwitch": Object { + "node": Object { + "description": "A static switch only evaluates the applicable base on first render of the view", + "elementType": Object { + "additionalProperties": false, + "description": "A single case statement to use in a switch", + "extends": undefined, + "genericTokens": Array [ + Object { + "constraints": Object { + "ref": "Asset", + "type": "ref", + }, + "default": Object { + "ref": "Asset", + "type": "ref", + }, + "symbol": "T", + }, + ], + "name": "SwitchCase", + "properties": Object { + "asset": Object { + "node": Object { + "description": "The Asset to use if this case is applicable", + "genericArguments": undefined, + "ref": "T", + "title": "SwitchCase.asset", + "type": "ref", + }, + "required": true, + }, + "case": Object { + "node": Object { + "description": "An expression to execute to determine if this case applies", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "SwitchCase.case", + "type": "ref", + }, + Object { + "const": true, + "title": "SwitchCase.case", + "type": "boolean", + }, + ], + "title": "SwitchCase.case", + "type": "or", + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "SwitchCase", + "type": "object", + }, + "genericTokens": Array [ + Object { + "constraints": Object { + "ref": "Asset", + "type": "ref", + }, + "default": Object { + "ref": "Asset", + "type": "ref", + }, + "symbol": "T", + }, + ], + "name": "Switch", + "source": "src/index.ts", + "title": "StaticSwitch.staticSwitch", + "type": "array", + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "StaticSwitch", + "type": "object", + }, + Object { + "additionalProperties": false, + "extends": undefined, + "genericTokens": Array [ + Object { + "constraints": Object { + "ref": "Asset", + "type": "ref", + }, + "default": Object { + "ref": "Asset", + "type": "ref", + }, + "symbol": "T", + }, + ], + "name": "DynamicSwitch", + "properties": Object { + "dynamicSwitch": Object { + "node": Object { + "description": "A dynamic switch re-evaluates the applicable case as data changes", + "elementType": Object { + "additionalProperties": false, + "description": "A single case statement to use in a switch", + "extends": undefined, + "genericTokens": Array [ + Object { + "constraints": Object { + "ref": "Asset", + "type": "ref", + }, + "default": Object { + "ref": "Asset", + "type": "ref", + }, + "symbol": "T", + }, + ], + "name": "SwitchCase", + "properties": Object { + "asset": Object { + "node": Object { + "description": "The Asset to use if this case is applicable", + "genericArguments": undefined, + "ref": "T", + "title": "SwitchCase.asset", + "type": "ref", + }, + "required": true, + }, + "case": Object { + "node": Object { + "description": "An expression to execute to determine if this case applies", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "SwitchCase.case", + "type": "ref", + }, + Object { + "const": true, + "title": "SwitchCase.case", + "type": "boolean", + }, + ], + "title": "SwitchCase.case", + "type": "or", + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "SwitchCase", + "type": "object", + }, + "genericTokens": Array [ + Object { + "constraints": Object { + "ref": "Asset", + "type": "ref", + }, + "default": Object { + "ref": "Asset", + "type": "ref", + }, + "symbol": "T", + }, + ], + "name": "Switch", + "source": "src/index.ts", + "title": "DynamicSwitch.dynamicSwitch", + "type": "array", + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "DynamicSwitch", + "type": "object", + }, + Object { + "description": "Expressions are a specialized way of executing code. +If the expression is a composite, the last expression executed is the return value", + "name": "Expression", + "or": Array [ + Object { + "title": "Expression", + "type": "string", + }, + Object { + "elementType": Object { + "title": "Expression.[]", + "type": "string", + }, + "title": "Expression.[]", + "type": "array", + }, + ], + "source": "src/index.ts", + "title": "Expression", + "type": "or", + }, + Object { + "format": "@[.*]@", + "name": "ExpressionRef", + "source": "src/index.ts", + "title": "ExpressionRef", + "type": "template", + }, + Object { + "description": "Bindings describe locations in the data model.", + "name": "Binding", + "source": "src/index.ts", + "title": "Binding", + "type": "string", + }, + Object { + "format": "{{.*}}", + "name": "BindingRef", + "source": "src/index.ts", + "title": "BindingRef", + "type": "template", + }, + Object { + "description": "The data-model is the location that all user data is stored", + "keyType": Object { + "type": "any", + }, + "name": "DataModel", + "source": "src/index.ts", + "title": "DataModel", + "type": "record", + "valueType": Object { + "type": "unknown", + }, + }, + Object { + "and": Array [ + Object { + "additionalProperties": false, + "extends": undefined, + "properties": Object { + "BEGIN": Object { + "node": Object { + "description": "The name of the Flow to begin on", + "title": "BEGIN", + "type": "string", + }, + "required": true, + }, + }, + "type": "object", + }, + Object { + "keyType": Object { + "type": "string", + }, + "type": "record", + "valueType": Object { + "or": Array [ + Object { + "type": "string", + }, + Object { + "additionalProperties": Object { + "or": Array [ + Object { + "type": "undefined", + }, + Object { + "type": "string", + }, + Object { + "genericArguments": undefined, + "ref": "Expression", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + Object { + "name": "NavigationFlowState", + "or": Array [ + Object { + "additionalProperties": false, + "description": "A state representing a view", + "extends": undefined, + "name": "NavigationFlowViewState", + "properties": Object { + "_comment": Object { + "node": Object { + "description": "Add comments that will not be processing, but are useful for code explanation", + "title": "CommentBase._comment", + "type": "string", + }, + "required": false, + }, + "attributes": Object { + "node": Object { + "additionalProperties": Object { + "type": "any", + }, + "description": "View meta-properties", + "extends": undefined, + "properties": Object {}, + "title": "NavigationFlowViewState.attributes", + "type": "object", + }, + "required": false, + }, + "exp": Object { + "node": Object { + "title": "NavigationBaseState.exp", + "type": "never", + }, + "required": false, + }, + "onEnd": Object { + "node": Object { + "description": "An optional expression to run before view transition", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onEnd", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onEnd", + "type": "or", + }, + "required": false, + }, + "onStart": Object { + "node": Object { + "description": "An optional expression to run when this view renders", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onStart", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onStart", + "type": "or", + }, + "required": false, + }, + "ref": Object { + "node": Object { + "description": "An id corresponding to a view from the 'views' array", + "title": "NavigationFlowViewState.ref", + "type": "string", + }, + "required": true, + }, + "state_type": Object { + "node": Object { + "const": "VIEW", + "description": "A property to determine the type of state this is", + "title": "NavigationBaseState.state_type", + "type": "string", + }, + "required": true, + }, + "transitions": Object { + "node": Object { + "description": "A mapping of transition-name to FlowState name", + "keyType": Object { + "type": "string", + }, + "name": "NavigationFlowTransition", + "source": "src/index.ts", + "title": "NavigationFlowTransitionableState.transitions", + "type": "record", + "valueType": Object { + "type": "string", + }, + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "NavigationFlowViewState", + "type": "object", + }, + Object { + "additionalProperties": false, + "description": "An END state of the flow.", + "extends": undefined, + "name": "NavigationFlowEndState", + "properties": Object { + "_comment": Object { + "node": Object { + "description": "Add comments that will not be processing, but are useful for code explanation", + "title": "CommentBase._comment", + "type": "string", + }, + "required": false, + }, + "exp": Object { + "node": Object { + "title": "NavigationBaseState.exp", + "type": "never", + }, + "required": false, + }, + "onEnd": Object { + "node": Object { + "description": "An optional expression to run before view transition", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onEnd", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onEnd", + "type": "or", + }, + "required": false, + }, + "onStart": Object { + "node": Object { + "description": "An optional expression to run when this view renders", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onStart", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onStart", + "type": "or", + }, + "required": false, + }, + "outcome": Object { + "node": Object { + "description": "A description of _how_ the flow ended. +If this is a flow started from another flow, the outcome determines the flow transition", + "title": "NavigationFlowEndState.outcome", + "type": "string", + }, + "required": true, + }, + "state_type": Object { + "node": Object { + "const": "END", + "description": "A property to determine the type of state this is", + "title": "NavigationBaseState.state_type", + "type": "string", + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "NavigationFlowEndState", + "type": "object", + }, + Object { + "additionalProperties": false, + "extends": undefined, + "name": "NavigationFlowFlowState", + "properties": Object { + "_comment": Object { + "node": Object { + "description": "Add comments that will not be processing, but are useful for code explanation", + "title": "CommentBase._comment", + "type": "string", + }, + "required": false, + }, + "exp": Object { + "node": Object { + "title": "NavigationBaseState.exp", + "type": "never", + }, + "required": false, + }, + "onEnd": Object { + "node": Object { + "description": "An optional expression to run before view transition", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onEnd", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onEnd", + "type": "or", + }, + "required": false, + }, + "onStart": Object { + "node": Object { + "description": "An optional expression to run when this view renders", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onStart", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onStart", + "type": "or", + }, + "required": false, + }, + "ref": Object { + "node": Object { + "description": "A reference to a FLOW id state to run", + "title": "NavigationFlowFlowState.ref", + "type": "string", + }, + "required": true, + }, + "state_type": Object { + "node": Object { + "const": "FLOW", + "description": "A property to determine the type of state this is", + "title": "NavigationBaseState.state_type", + "type": "string", + }, + "required": true, + }, + "transitions": Object { + "node": Object { + "description": "A mapping of transition-name to FlowState name", + "keyType": Object { + "type": "string", + }, + "name": "NavigationFlowTransition", + "source": "src/index.ts", + "title": "NavigationFlowTransitionableState.transitions", + "type": "record", + "valueType": Object { + "type": "string", + }, + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "NavigationFlowFlowState", + "type": "object", + }, + Object { + "additionalProperties": false, + "description": "Action states execute an expression to determine the next state to transition to", + "extends": undefined, + "name": "NavigationFlowActionState", + "properties": Object { + "_comment": Object { + "node": Object { + "description": "Add comments that will not be processing, but are useful for code explanation", + "title": "CommentBase._comment", + "type": "string", + }, + "required": false, + }, + "exp": Object { + "node": Object { + "description": "An expression to execute. +The return value determines the transition to take", + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationFlowActionState.exp", + "type": "ref", + }, + "required": true, + }, + "onEnd": Object { + "node": Object { + "description": "An optional expression to run before view transition", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onEnd", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onEnd", + "type": "or", + }, + "required": false, + }, + "onStart": Object { + "node": Object { + "description": "An optional expression to run when this view renders", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onStart", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onStart", + "type": "or", + }, + "required": false, + }, + "state_type": Object { + "node": Object { + "const": "ACTION", + "description": "A property to determine the type of state this is", + "title": "NavigationBaseState.state_type", + "type": "string", + }, + "required": true, + }, + "transitions": Object { + "node": Object { + "description": "A mapping of transition-name to FlowState name", + "keyType": Object { + "type": "string", + }, + "name": "NavigationFlowTransition", + "source": "src/index.ts", + "title": "NavigationFlowTransitionableState.transitions", + "type": "record", + "valueType": Object { + "type": "string", + }, + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "NavigationFlowActionState", + "type": "object", + }, + Object { + "additionalProperties": false, + "description": "External Flow states represent states in the FSM that can't be resolved internally in Player. +The flow will wait for the embedded application to manage moving to the next state via a transition", + "extends": undefined, + "name": "NavigationFlowExternalState", + "properties": Object { + "_comment": Object { + "node": Object { + "description": "Add comments that will not be processing, but are useful for code explanation", + "title": "CommentBase._comment", + "type": "string", + }, + "required": false, + }, + "exp": Object { + "node": Object { + "title": "NavigationBaseState.exp", + "type": "never", + }, + "required": false, + }, + "onEnd": Object { + "node": Object { + "description": "An optional expression to run before view transition", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onEnd", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onEnd", + "type": "or", + }, + "required": false, + }, + "onStart": Object { + "node": Object { + "description": "An optional expression to run when this view renders", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onStart", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onStart", + "type": "or", + }, + "required": false, + }, + "ref": Object { + "node": Object { + "description": "A reference for this external state", + "title": "NavigationFlowExternalState.ref", + "type": "string", + }, + "required": true, + }, + "state_type": Object { + "node": Object { + "const": "EXTERNAL", + "description": "A property to determine the type of state this is", + "title": "NavigationBaseState.state_type", + "type": "string", + }, + "required": true, + }, + "transitions": Object { + "node": Object { + "description": "A mapping of transition-name to FlowState name", + "keyType": Object { + "type": "string", + }, + "name": "NavigationFlowTransition", + "source": "src/index.ts", + "title": "NavigationFlowTransitionableState.transitions", + "type": "record", + "valueType": Object { + "type": "string", + }, + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "NavigationFlowExternalState", + "type": "object", + }, + ], + "source": "src/index.ts", + "title": "NavigationFlowState", + "type": "or", + }, + ], + "type": "or", + }, + "description": "A state machine in the navigation", + "extends": undefined, + "name": "NavigationFlow", + "properties": Object { + "onEnd": Object { + "node": Object { + "description": "An optional expression to run when this Flow ends", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationFlow.onEnd", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationFlow.onEnd", + "type": "or", + }, + "required": false, + }, + "onStart": Object { + "node": Object { + "description": "An optional expression to run when this Flow starts", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationFlow.onStart", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationFlow.onStart", + "type": "or", + }, + "required": false, + }, + "startState": Object { + "node": Object { + "description": "The first state to kick off the state machine", + "title": "NavigationFlow.startState", + "type": "string", + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "NavigationFlow", + "type": "object", + }, + ], + "type": "or", + }, + }, + ], + "description": "The navigation section of the flow describes a State Machine for the user.", + "name": "Navigation", + "source": "src/index.ts", + "title": "Navigation", + "type": "and", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + Object { + "additionalProperties": Object { + "or": Array [ + Object { + "type": "undefined", + }, + Object { + "type": "string", + }, + Object { + "genericArguments": undefined, + "ref": "Expression", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + Object { + "name": "NavigationFlowState", + "or": Array [ + Object { + "additionalProperties": false, + "description": "A state representing a view", + "extends": undefined, + "name": "NavigationFlowViewState", + "properties": Object { + "_comment": Object { + "node": Object { + "description": "Add comments that will not be processing, but are useful for code explanation", + "title": "CommentBase._comment", + "type": "string", + }, + "required": false, + }, + "attributes": Object { + "node": Object { + "additionalProperties": Object { + "type": "any", + }, + "description": "View meta-properties", + "extends": undefined, + "properties": Object {}, + "title": "NavigationFlowViewState.attributes", + "type": "object", + }, + "required": false, + }, + "exp": Object { + "node": Object { + "title": "NavigationBaseState.exp", + "type": "never", + }, + "required": false, + }, + "onEnd": Object { + "node": Object { + "description": "An optional expression to run before view transition", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onEnd", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onEnd", + "type": "or", + }, + "required": false, + }, + "onStart": Object { + "node": Object { + "description": "An optional expression to run when this view renders", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onStart", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onStart", + "type": "or", + }, + "required": false, + }, + "ref": Object { + "node": Object { + "description": "An id corresponding to a view from the 'views' array", + "title": "NavigationFlowViewState.ref", + "type": "string", + }, + "required": true, + }, + "state_type": Object { + "node": Object { + "const": "VIEW", + "description": "A property to determine the type of state this is", + "title": "NavigationBaseState.state_type", + "type": "string", + }, + "required": true, + }, + "transitions": Object { + "node": Object { + "description": "A mapping of transition-name to FlowState name", + "keyType": Object { + "type": "string", + }, + "name": "NavigationFlowTransition", + "source": "src/index.ts", + "title": "NavigationFlowTransitionableState.transitions", + "type": "record", + "valueType": Object { + "type": "string", + }, + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "NavigationFlowViewState", + "type": "object", + }, + Object { + "additionalProperties": false, + "description": "An END state of the flow.", + "extends": undefined, + "name": "NavigationFlowEndState", + "properties": Object { + "_comment": Object { + "node": Object { + "description": "Add comments that will not be processing, but are useful for code explanation", + "title": "CommentBase._comment", + "type": "string", + }, + "required": false, + }, + "exp": Object { + "node": Object { + "title": "NavigationBaseState.exp", + "type": "never", + }, + "required": false, + }, + "onEnd": Object { + "node": Object { + "description": "An optional expression to run before view transition", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onEnd", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onEnd", + "type": "or", + }, + "required": false, + }, + "onStart": Object { + "node": Object { + "description": "An optional expression to run when this view renders", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onStart", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onStart", + "type": "or", + }, + "required": false, + }, + "outcome": Object { + "node": Object { + "description": "A description of _how_ the flow ended. +If this is a flow started from another flow, the outcome determines the flow transition", + "title": "NavigationFlowEndState.outcome", + "type": "string", + }, + "required": true, + }, + "state_type": Object { + "node": Object { + "const": "END", + "description": "A property to determine the type of state this is", + "title": "NavigationBaseState.state_type", + "type": "string", + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "NavigationFlowEndState", + "type": "object", + }, + Object { + "additionalProperties": false, + "extends": undefined, + "name": "NavigationFlowFlowState", + "properties": Object { + "_comment": Object { + "node": Object { + "description": "Add comments that will not be processing, but are useful for code explanation", + "title": "CommentBase._comment", + "type": "string", + }, + "required": false, + }, + "exp": Object { + "node": Object { + "title": "NavigationBaseState.exp", + "type": "never", + }, + "required": false, + }, + "onEnd": Object { + "node": Object { + "description": "An optional expression to run before view transition", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onEnd", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onEnd", + "type": "or", + }, + "required": false, + }, + "onStart": Object { + "node": Object { + "description": "An optional expression to run when this view renders", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onStart", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onStart", + "type": "or", + }, + "required": false, + }, + "ref": Object { + "node": Object { + "description": "A reference to a FLOW id state to run", + "title": "NavigationFlowFlowState.ref", + "type": "string", + }, + "required": true, + }, + "state_type": Object { + "node": Object { + "const": "FLOW", + "description": "A property to determine the type of state this is", + "title": "NavigationBaseState.state_type", + "type": "string", + }, + "required": true, + }, + "transitions": Object { + "node": Object { + "description": "A mapping of transition-name to FlowState name", + "keyType": Object { + "type": "string", + }, + "name": "NavigationFlowTransition", + "source": "src/index.ts", + "title": "NavigationFlowTransitionableState.transitions", + "type": "record", + "valueType": Object { + "type": "string", + }, + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "NavigationFlowFlowState", + "type": "object", + }, + Object { + "additionalProperties": false, + "description": "Action states execute an expression to determine the next state to transition to", + "extends": undefined, + "name": "NavigationFlowActionState", + "properties": Object { + "_comment": Object { + "node": Object { + "description": "Add comments that will not be processing, but are useful for code explanation", + "title": "CommentBase._comment", + "type": "string", + }, + "required": false, + }, + "exp": Object { + "node": Object { + "description": "An expression to execute. +The return value determines the transition to take", + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationFlowActionState.exp", + "type": "ref", + }, + "required": true, + }, + "onEnd": Object { + "node": Object { + "description": "An optional expression to run before view transition", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onEnd", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onEnd", + "type": "or", + }, + "required": false, + }, + "onStart": Object { + "node": Object { + "description": "An optional expression to run when this view renders", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onStart", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onStart", + "type": "or", + }, + "required": false, + }, + "state_type": Object { + "node": Object { + "const": "ACTION", + "description": "A property to determine the type of state this is", + "title": "NavigationBaseState.state_type", + "type": "string", + }, + "required": true, + }, + "transitions": Object { + "node": Object { + "description": "A mapping of transition-name to FlowState name", + "keyType": Object { + "type": "string", + }, + "name": "NavigationFlowTransition", + "source": "src/index.ts", + "title": "NavigationFlowTransitionableState.transitions", + "type": "record", + "valueType": Object { + "type": "string", + }, + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "NavigationFlowActionState", + "type": "object", + }, + Object { + "additionalProperties": false, + "description": "External Flow states represent states in the FSM that can't be resolved internally in Player. +The flow will wait for the embedded application to manage moving to the next state via a transition", + "extends": undefined, + "name": "NavigationFlowExternalState", + "properties": Object { + "_comment": Object { + "node": Object { + "description": "Add comments that will not be processing, but are useful for code explanation", + "title": "CommentBase._comment", + "type": "string", + }, + "required": false, + }, + "exp": Object { + "node": Object { + "title": "NavigationBaseState.exp", + "type": "never", + }, + "required": false, + }, + "onEnd": Object { + "node": Object { + "description": "An optional expression to run before view transition", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onEnd", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onEnd", + "type": "or", + }, + "required": false, + }, + "onStart": Object { + "node": Object { + "description": "An optional expression to run when this view renders", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onStart", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onStart", + "type": "or", + }, + "required": false, + }, + "ref": Object { + "node": Object { + "description": "A reference for this external state", + "title": "NavigationFlowExternalState.ref", + "type": "string", + }, + "required": true, + }, + "state_type": Object { + "node": Object { + "const": "EXTERNAL", + "description": "A property to determine the type of state this is", + "title": "NavigationBaseState.state_type", + "type": "string", + }, + "required": true, + }, + "transitions": Object { + "node": Object { + "description": "A mapping of transition-name to FlowState name", + "keyType": Object { + "type": "string", + }, + "name": "NavigationFlowTransition", + "source": "src/index.ts", + "title": "NavigationFlowTransitionableState.transitions", + "type": "record", + "valueType": Object { + "type": "string", + }, + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "NavigationFlowExternalState", + "type": "object", + }, + ], + "source": "src/index.ts", + "title": "NavigationFlowState", + "type": "or", + }, + ], + "type": "or", + }, + "description": "A state machine in the navigation", + "extends": undefined, + "name": "NavigationFlow", + "properties": Object { + "onEnd": Object { + "node": Object { + "description": "An optional expression to run when this Flow ends", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationFlow.onEnd", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationFlow.onEnd", + "type": "or", + }, + "required": false, + }, + "onStart": Object { + "node": Object { + "description": "An optional expression to run when this Flow starts", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationFlow.onStart", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationFlow.onStart", + "type": "or", + }, + "required": false, + }, + "startState": Object { + "node": Object { + "description": "The first state to kick off the state machine", + "title": "NavigationFlow.startState", + "type": "string", + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "NavigationFlow", + "type": "object", + }, + Object { + "keyType": Object { + "type": "string", + }, + "name": "NavigationFlowTransition", + "source": "src/index.ts", + "title": "NavigationFlowTransition", + "type": "record", + "valueType": Object { + "type": "string", + }, + }, + Object { + "additionalProperties": false, + "description": "The base representation of a state within a Flow", + "extends": undefined, + "genericTokens": Array [ + Object { + "constraints": Object { + "type": "string", + }, + "default": Object { + "type": "any", + }, + "symbol": "T", + }, + ], + "name": "NavigationBaseState", + "properties": Object { + "_comment": Object { + "node": Object { + "description": "Add comments that will not be processing, but are useful for code explanation", + "title": "CommentBase._comment", + "type": "string", + }, + "required": false, + }, + "exp": Object { + "node": Object { + "check": Object { + "left": Object { + "genericArguments": undefined, + "ref": "T", + "type": "ref", + }, + "right": Object { + "genericArguments": undefined, + "ref": "T", + "type": "ref", + }, + }, + "description": "TS gets really confused with both the ActionState and the onStart state both declaring the \`exp\` property +So this explicity says there should never be an exp prop on a state node that's not of type 'ACTION'", + "title": "NavigationBaseState.exp", + "type": "conditional", + "value": Object { + "false": Object { + "type": "never", + }, + "true": Object { + "genericArguments": undefined, + "ref": "Expression", + "type": "ref", + }, + }, + }, + "required": false, + }, + "onEnd": Object { + "node": Object { + "description": "An optional expression to run before view transition", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onEnd", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onEnd", + "type": "or", + }, + "required": false, + }, + "onStart": Object { + "node": Object { + "description": "An optional expression to run when this view renders", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onStart", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onStart", + "type": "or", + }, + "required": false, + }, + "state_type": Object { + "node": Object { + "description": "A property to determine the type of state this is", + "genericArguments": undefined, + "ref": "T", + "title": "NavigationBaseState.state_type", + "type": "ref", + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "NavigationBaseState", + "type": "object", + }, + Object { + "additionalProperties": false, + "description": "A generic state that can transition to another state", + "extends": undefined, + "genericTokens": Array [ + Object { + "constraints": Object { + "type": "string", + }, + "default": Object { + "type": "any", + }, + "symbol": "T", + }, + ], + "name": "NavigationFlowTransitionableState", + "properties": Object { + "_comment": Object { + "node": Object { + "description": "Add comments that will not be processing, but are useful for code explanation", + "title": "CommentBase._comment", + "type": "string", + }, + "required": false, + }, + "exp": Object { + "node": Object { + "check": Object { + "left": Object { + "genericArguments": undefined, + "ref": "T", + "type": "ref", + }, + "right": Object { + "genericArguments": undefined, + "ref": "T", + "type": "ref", + }, + }, + "description": "TS gets really confused with both the ActionState and the onStart state both declaring the \`exp\` property +So this explicity says there should never be an exp prop on a state node that's not of type 'ACTION'", + "title": "NavigationBaseState.exp", + "type": "conditional", + "value": Object { + "false": Object { + "type": "never", + }, + "true": Object { + "genericArguments": undefined, + "ref": "Expression", + "type": "ref", + }, + }, + }, + "required": false, + }, + "onEnd": Object { + "node": Object { + "description": "An optional expression to run before view transition", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onEnd", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onEnd", + "type": "or", + }, + "required": false, + }, + "onStart": Object { + "node": Object { + "description": "An optional expression to run when this view renders", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onStart", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onStart", + "type": "or", + }, + "required": false, + }, + "state_type": Object { + "node": Object { + "description": "A property to determine the type of state this is", + "genericArguments": undefined, + "ref": "T", + "title": "NavigationBaseState.state_type", + "type": "ref", + }, + "required": true, + }, + "transitions": Object { + "node": Object { + "description": "A mapping of transition-name to FlowState name", + "keyType": Object { + "type": "string", + }, + "name": "NavigationFlowTransition", + "source": "src/index.ts", + "title": "NavigationFlowTransitionableState.transitions", + "type": "record", + "valueType": Object { + "type": "string", + }, + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "NavigationFlowTransitionableState", + "type": "object", + }, + Object { + "additionalProperties": false, + "description": "A state representing a view", + "extends": undefined, + "name": "NavigationFlowViewState", + "properties": Object { + "_comment": Object { + "node": Object { + "description": "Add comments that will not be processing, but are useful for code explanation", + "title": "CommentBase._comment", + "type": "string", + }, + "required": false, + }, + "attributes": Object { + "node": Object { + "additionalProperties": Object { + "type": "any", + }, + "description": "View meta-properties", + "extends": undefined, + "properties": Object {}, + "title": "NavigationFlowViewState.attributes", + "type": "object", + }, + "required": false, + }, + "exp": Object { + "node": Object { + "title": "NavigationBaseState.exp", + "type": "never", + }, + "required": false, + }, + "onEnd": Object { + "node": Object { + "description": "An optional expression to run before view transition", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onEnd", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onEnd", + "type": "or", + }, + "required": false, + }, + "onStart": Object { + "node": Object { + "description": "An optional expression to run when this view renders", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onStart", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onStart", + "type": "or", + }, + "required": false, + }, + "ref": Object { + "node": Object { + "description": "An id corresponding to a view from the 'views' array", + "title": "NavigationFlowViewState.ref", + "type": "string", + }, + "required": true, + }, + "state_type": Object { + "node": Object { + "const": "VIEW", + "description": "A property to determine the type of state this is", + "title": "NavigationBaseState.state_type", + "type": "string", + }, + "required": true, + }, + "transitions": Object { + "node": Object { + "description": "A mapping of transition-name to FlowState name", + "keyType": Object { + "type": "string", + }, + "name": "NavigationFlowTransition", + "source": "src/index.ts", + "title": "NavigationFlowTransitionableState.transitions", + "type": "record", + "valueType": Object { + "type": "string", + }, + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "NavigationFlowViewState", + "type": "object", + }, + Object { + "additionalProperties": false, + "description": "An END state of the flow.", + "extends": undefined, + "name": "NavigationFlowEndState", + "properties": Object { + "_comment": Object { + "node": Object { + "description": "Add comments that will not be processing, but are useful for code explanation", + "title": "CommentBase._comment", + "type": "string", + }, + "required": false, + }, + "exp": Object { + "node": Object { + "title": "NavigationBaseState.exp", + "type": "never", + }, + "required": false, + }, + "onEnd": Object { + "node": Object { + "description": "An optional expression to run before view transition", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onEnd", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onEnd", + "type": "or", + }, + "required": false, + }, + "onStart": Object { + "node": Object { + "description": "An optional expression to run when this view renders", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onStart", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onStart", + "type": "or", + }, + "required": false, + }, + "outcome": Object { + "node": Object { + "description": "A description of _how_ the flow ended. +If this is a flow started from another flow, the outcome determines the flow transition", + "title": "NavigationFlowEndState.outcome", + "type": "string", + }, + "required": true, + }, + "state_type": Object { + "node": Object { + "const": "END", + "description": "A property to determine the type of state this is", + "title": "NavigationBaseState.state_type", + "type": "string", + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "NavigationFlowEndState", + "type": "object", + }, + Object { + "additionalProperties": false, + "description": "Action states execute an expression to determine the next state to transition to", + "extends": undefined, + "name": "NavigationFlowActionState", + "properties": Object { + "_comment": Object { + "node": Object { + "description": "Add comments that will not be processing, but are useful for code explanation", + "title": "CommentBase._comment", + "type": "string", + }, + "required": false, + }, + "exp": Object { + "node": Object { + "description": "An expression to execute. +The return value determines the transition to take", + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationFlowActionState.exp", + "type": "ref", + }, + "required": true, + }, + "onEnd": Object { + "node": Object { + "description": "An optional expression to run before view transition", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onEnd", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onEnd", + "type": "or", + }, + "required": false, + }, + "onStart": Object { + "node": Object { + "description": "An optional expression to run when this view renders", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onStart", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onStart", + "type": "or", + }, + "required": false, + }, + "state_type": Object { + "node": Object { + "const": "ACTION", + "description": "A property to determine the type of state this is", + "title": "NavigationBaseState.state_type", + "type": "string", + }, + "required": true, + }, + "transitions": Object { + "node": Object { + "description": "A mapping of transition-name to FlowState name", + "keyType": Object { + "type": "string", + }, + "name": "NavigationFlowTransition", + "source": "src/index.ts", + "title": "NavigationFlowTransitionableState.transitions", + "type": "record", + "valueType": Object { + "type": "string", + }, + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "NavigationFlowActionState", + "type": "object", + }, + Object { + "additionalProperties": false, + "description": "External Flow states represent states in the FSM that can't be resolved internally in Player. +The flow will wait for the embedded application to manage moving to the next state via a transition", + "extends": undefined, + "name": "NavigationFlowExternalState", + "properties": Object { + "_comment": Object { + "node": Object { + "description": "Add comments that will not be processing, but are useful for code explanation", + "title": "CommentBase._comment", + "type": "string", + }, + "required": false, + }, + "exp": Object { + "node": Object { + "title": "NavigationBaseState.exp", + "type": "never", + }, + "required": false, + }, + "onEnd": Object { + "node": Object { + "description": "An optional expression to run before view transition", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onEnd", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onEnd", + "type": "or", + }, + "required": false, + }, + "onStart": Object { + "node": Object { + "description": "An optional expression to run when this view renders", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onStart", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onStart", + "type": "or", + }, + "required": false, + }, + "ref": Object { + "node": Object { + "description": "A reference for this external state", + "title": "NavigationFlowExternalState.ref", + "type": "string", + }, + "required": true, + }, + "state_type": Object { + "node": Object { + "const": "EXTERNAL", + "description": "A property to determine the type of state this is", + "title": "NavigationBaseState.state_type", + "type": "string", + }, + "required": true, + }, + "transitions": Object { + "node": Object { + "description": "A mapping of transition-name to FlowState name", + "keyType": Object { + "type": "string", + }, + "name": "NavigationFlowTransition", + "source": "src/index.ts", + "title": "NavigationFlowTransitionableState.transitions", + "type": "record", + "valueType": Object { + "type": "string", + }, + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "NavigationFlowExternalState", + "type": "object", + }, + Object { + "additionalProperties": false, + "extends": undefined, + "name": "NavigationFlowFlowState", + "properties": Object { + "_comment": Object { + "node": Object { + "description": "Add comments that will not be processing, but are useful for code explanation", + "title": "CommentBase._comment", + "type": "string", + }, + "required": false, + }, + "exp": Object { + "node": Object { + "title": "NavigationBaseState.exp", + "type": "never", + }, + "required": false, + }, + "onEnd": Object { + "node": Object { + "description": "An optional expression to run before view transition", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onEnd", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onEnd", + "type": "or", + }, + "required": false, + }, + "onStart": Object { + "node": Object { + "description": "An optional expression to run when this view renders", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onStart", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onStart", + "type": "or", + }, + "required": false, + }, + "ref": Object { + "node": Object { + "description": "A reference to a FLOW id state to run", + "title": "NavigationFlowFlowState.ref", + "type": "string", + }, + "required": true, + }, + "state_type": Object { + "node": Object { + "const": "FLOW", + "description": "A property to determine the type of state this is", + "title": "NavigationBaseState.state_type", + "type": "string", + }, + "required": true, + }, + "transitions": Object { + "node": Object { + "description": "A mapping of transition-name to FlowState name", + "keyType": Object { + "type": "string", + }, + "name": "NavigationFlowTransition", + "source": "src/index.ts", + "title": "NavigationFlowTransitionableState.transitions", + "type": "record", + "valueType": Object { + "type": "string", + }, + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "NavigationFlowFlowState", + "type": "object", + }, + Object { + "name": "NavigationFlowState", + "or": Array [ + Object { + "additionalProperties": false, + "description": "A state representing a view", + "extends": undefined, + "name": "NavigationFlowViewState", + "properties": Object { + "_comment": Object { + "node": Object { + "description": "Add comments that will not be processing, but are useful for code explanation", + "title": "CommentBase._comment", + "type": "string", + }, + "required": false, + }, + "attributes": Object { + "node": Object { + "additionalProperties": Object { + "type": "any", + }, + "description": "View meta-properties", + "extends": undefined, + "properties": Object {}, + "title": "NavigationFlowViewState.attributes", + "type": "object", + }, + "required": false, + }, + "exp": Object { + "node": Object { + "title": "NavigationBaseState.exp", + "type": "never", + }, + "required": false, + }, + "onEnd": Object { + "node": Object { + "description": "An optional expression to run before view transition", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onEnd", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onEnd", + "type": "or", + }, + "required": false, + }, + "onStart": Object { + "node": Object { + "description": "An optional expression to run when this view renders", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onStart", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onStart", + "type": "or", + }, + "required": false, + }, + "ref": Object { + "node": Object { + "description": "An id corresponding to a view from the 'views' array", + "title": "NavigationFlowViewState.ref", + "type": "string", + }, + "required": true, + }, + "state_type": Object { + "node": Object { + "const": "VIEW", + "description": "A property to determine the type of state this is", + "title": "NavigationBaseState.state_type", + "type": "string", + }, + "required": true, + }, + "transitions": Object { + "node": Object { + "description": "A mapping of transition-name to FlowState name", + "keyType": Object { + "type": "string", + }, + "name": "NavigationFlowTransition", + "source": "src/index.ts", + "title": "NavigationFlowTransitionableState.transitions", + "type": "record", + "valueType": Object { + "type": "string", + }, + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "NavigationFlowViewState", + "type": "object", + }, + Object { + "additionalProperties": false, + "description": "An END state of the flow.", + "extends": undefined, + "name": "NavigationFlowEndState", + "properties": Object { + "_comment": Object { + "node": Object { + "description": "Add comments that will not be processing, but are useful for code explanation", + "title": "CommentBase._comment", + "type": "string", + }, + "required": false, + }, + "exp": Object { + "node": Object { + "title": "NavigationBaseState.exp", + "type": "never", + }, + "required": false, + }, + "onEnd": Object { + "node": Object { + "description": "An optional expression to run before view transition", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onEnd", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onEnd", + "type": "or", + }, + "required": false, + }, + "onStart": Object { + "node": Object { + "description": "An optional expression to run when this view renders", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onStart", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onStart", + "type": "or", + }, + "required": false, + }, + "outcome": Object { + "node": Object { + "description": "A description of _how_ the flow ended. +If this is a flow started from another flow, the outcome determines the flow transition", + "title": "NavigationFlowEndState.outcome", + "type": "string", + }, + "required": true, + }, + "state_type": Object { + "node": Object { + "const": "END", + "description": "A property to determine the type of state this is", + "title": "NavigationBaseState.state_type", + "type": "string", + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "NavigationFlowEndState", + "type": "object", + }, + Object { + "additionalProperties": false, + "extends": undefined, + "name": "NavigationFlowFlowState", + "properties": Object { + "_comment": Object { + "node": Object { + "description": "Add comments that will not be processing, but are useful for code explanation", + "title": "CommentBase._comment", + "type": "string", + }, + "required": false, + }, + "exp": Object { + "node": Object { + "title": "NavigationBaseState.exp", + "type": "never", + }, + "required": false, + }, + "onEnd": Object { + "node": Object { + "description": "An optional expression to run before view transition", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onEnd", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onEnd", + "type": "or", + }, + "required": false, + }, + "onStart": Object { + "node": Object { + "description": "An optional expression to run when this view renders", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onStart", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onStart", + "type": "or", + }, + "required": false, + }, + "ref": Object { + "node": Object { + "description": "A reference to a FLOW id state to run", + "title": "NavigationFlowFlowState.ref", + "type": "string", + }, + "required": true, + }, + "state_type": Object { + "node": Object { + "const": "FLOW", + "description": "A property to determine the type of state this is", + "title": "NavigationBaseState.state_type", + "type": "string", + }, + "required": true, + }, + "transitions": Object { + "node": Object { + "description": "A mapping of transition-name to FlowState name", + "keyType": Object { + "type": "string", + }, + "name": "NavigationFlowTransition", + "source": "src/index.ts", + "title": "NavigationFlowTransitionableState.transitions", + "type": "record", + "valueType": Object { + "type": "string", + }, + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "NavigationFlowFlowState", + "type": "object", + }, + Object { + "additionalProperties": false, + "description": "Action states execute an expression to determine the next state to transition to", + "extends": undefined, + "name": "NavigationFlowActionState", + "properties": Object { + "_comment": Object { + "node": Object { + "description": "Add comments that will not be processing, but are useful for code explanation", + "title": "CommentBase._comment", + "type": "string", + }, + "required": false, + }, + "exp": Object { + "node": Object { + "description": "An expression to execute. +The return value determines the transition to take", + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationFlowActionState.exp", + "type": "ref", + }, + "required": true, + }, + "onEnd": Object { + "node": Object { + "description": "An optional expression to run before view transition", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onEnd", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onEnd", + "type": "or", + }, + "required": false, + }, + "onStart": Object { + "node": Object { + "description": "An optional expression to run when this view renders", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onStart", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onStart", + "type": "or", + }, + "required": false, + }, + "state_type": Object { + "node": Object { + "const": "ACTION", + "description": "A property to determine the type of state this is", + "title": "NavigationBaseState.state_type", + "type": "string", + }, + "required": true, + }, + "transitions": Object { + "node": Object { + "description": "A mapping of transition-name to FlowState name", + "keyType": Object { + "type": "string", + }, + "name": "NavigationFlowTransition", + "source": "src/index.ts", + "title": "NavigationFlowTransitionableState.transitions", + "type": "record", + "valueType": Object { + "type": "string", + }, + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "NavigationFlowActionState", + "type": "object", + }, + Object { + "additionalProperties": false, + "description": "External Flow states represent states in the FSM that can't be resolved internally in Player. +The flow will wait for the embedded application to manage moving to the next state via a transition", + "extends": undefined, + "name": "NavigationFlowExternalState", + "properties": Object { + "_comment": Object { + "node": Object { + "description": "Add comments that will not be processing, but are useful for code explanation", + "title": "CommentBase._comment", + "type": "string", + }, + "required": false, + }, + "exp": Object { + "node": Object { + "title": "NavigationBaseState.exp", + "type": "never", + }, + "required": false, + }, + "onEnd": Object { + "node": Object { + "description": "An optional expression to run before view transition", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onEnd", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onEnd", + "type": "or", + }, + "required": false, + }, + "onStart": Object { + "node": Object { + "description": "An optional expression to run when this view renders", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onStart", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onStart", + "type": "or", + }, + "required": false, + }, + "ref": Object { + "node": Object { + "description": "A reference for this external state", + "title": "NavigationFlowExternalState.ref", + "type": "string", + }, + "required": true, + }, + "state_type": Object { + "node": Object { + "const": "EXTERNAL", + "description": "A property to determine the type of state this is", + "title": "NavigationBaseState.state_type", + "type": "string", + }, + "required": true, + }, + "transitions": Object { + "node": Object { + "description": "A mapping of transition-name to FlowState name", + "keyType": Object { + "type": "string", + }, + "name": "NavigationFlowTransition", + "source": "src/index.ts", + "title": "NavigationFlowTransitionableState.transitions", + "type": "record", + "valueType": Object { + "type": "string", + }, + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "NavigationFlowExternalState", + "type": "object", + }, + ], + "source": "src/index.ts", + "title": "NavigationFlowState", + "type": "or", + }, + Object { + "additionalProperties": false, + "description": "The data at the end of a flow", + "extends": undefined, + "name": "FlowResult", + "properties": Object { + "data": Object { + "node": Object { + "description": "The serialized data-model", + "title": "FlowResult.data", + "type": "any", + }, + "required": false, + }, + "endState": Object { + "node": Object { + "additionalProperties": false, + "description": "The outcome describes _how_ the flow ended (forwards, backwards, etc)", + "extends": undefined, + "name": "NavigationFlowEndState", + "properties": Object { + "_comment": Object { + "node": Object { + "description": "Add comments that will not be processing, but are useful for code explanation", + "title": "CommentBase._comment", + "type": "string", + }, + "required": false, + }, + "exp": Object { + "node": Object { + "title": "NavigationBaseState.exp", + "type": "never", + }, + "required": false, + }, + "onEnd": Object { + "node": Object { + "description": "An optional expression to run before view transition", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onEnd", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onEnd", + "type": "or", + }, + "required": false, + }, + "onStart": Object { + "node": Object { + "description": "An optional expression to run when this view renders", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onStart", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onStart", + "type": "or", + }, + "required": false, + }, + "outcome": Object { + "node": Object { + "description": "A description of _how_ the flow ended. +If this is a flow started from another flow, the outcome determines the flow transition", + "title": "NavigationFlowEndState.outcome", + "type": "string", + }, + "required": true, + }, + "state_type": Object { + "node": Object { + "const": "END", + "description": "A property to determine the type of state this is", + "title": "NavigationBaseState.state_type", + "type": "string", + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "FlowResult.endState", + "type": "object", + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "FlowResult", + "type": "object", + }, + Object { + "additionalProperties": false, + "description": "Any object that contains 1 or more templates", + "extends": undefined, + "name": "Templatable", + "properties": Object { + "template": Object { + "node": Object { + "description": "A list of templates to process for this node", + "elementType": Object { + "additionalProperties": false, + "description": "A template describes a mapping from a data array -> array of objects", + "extends": undefined, + "genericTokens": Array [ + Object { + "constraints": Object { + "type": "any", + }, + "default": Object { + "type": "unknown", + }, + "symbol": "ValueType", + }, + Object { + "constraints": Object { + "type": "string", + }, + "default": Object { + "type": "string", + }, + "symbol": "Key", + }, + ], + "name": "Template", + "properties": Object { + "data": Object { + "node": Object { + "description": "A pointer to the data-model containing an array of elements to map over", + "genericArguments": undefined, + "ref": "Binding", + "title": "Template.data", + "type": "ref", + }, + "required": true, + }, + "dynamic": Object { + "node": Object { + "description": "should the template be recomputed when data changes", + "title": "Template.dynamic", + "type": "boolean", + }, + "required": false, + }, + "output": Object { + "node": Object { + "description": "A property on the parent object to store the new map under. +If it already exists, values are appended to the end.", + "genericArguments": undefined, + "ref": "Key", + "title": "Template.output", + "type": "ref", + }, + "required": true, + }, + "value": Object { + "node": Object { + "description": "The template to iterate over using each value in the supplied template data. +Any reference to _index_ is replaced with the current iteration index.", + "genericArguments": undefined, + "ref": "ValueType", + "title": "Template.value", + "type": "ref", + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "Template", + "type": "object", + }, + "title": "Templatable.template", + "type": "array", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "Templatable", + "type": "object", + }, + Object { + "additionalProperties": false, + "description": "A template describes a mapping from a data array -> array of objects", + "extends": undefined, + "genericTokens": Array [ + Object { + "constraints": Object { + "type": "any", + }, + "default": Object { + "type": "unknown", + }, + "symbol": "ValueType", + }, + Object { + "constraints": Object { + "type": "string", + }, + "default": Object { + "type": "string", + }, + "symbol": "Key", + }, + ], + "name": "Template", + "properties": Object { + "data": Object { + "node": Object { + "description": "A pointer to the data-model containing an array of elements to map over", + "genericArguments": undefined, + "ref": "Binding", + "title": "Template.data", + "type": "ref", + }, + "required": true, + }, + "dynamic": Object { + "node": Object { + "description": "should the template be recomputed when data changes", + "title": "Template.dynamic", + "type": "boolean", + }, + "required": false, + }, + "output": Object { + "node": Object { + "description": "A property on the parent object to store the new map under. +If it already exists, values are appended to the end.", + "genericArguments": undefined, + "ref": "Key", + "title": "Template.output", + "type": "ref", + }, + "required": true, + }, + "value": Object { + "node": Object { + "description": "The template to iterate over using each value in the supplied template data. +Any reference to _index_ is replaced with the current iteration index.", + "genericArguments": undefined, + "ref": "ValueType", + "title": "Template.value", + "type": "ref", + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "Template", + "type": "object", + }, + Object { + "check": Object { + "left": Object { + "type": "unknown", + }, + "right": Object { + "type": "unknown", + }, + }, + "genericTokens": Array [ + Object { + "constraints": Object { + "ref": "Asset", + "type": "ref", + }, + "default": Object { + "ref": "Asset", + "type": "ref", + }, + "symbol": "T", + }, + ], + "name": "View", + "source": "src/index.ts", + "title": "View", + "type": "conditional", + "value": Object { + "false": Object { + "genericArguments": undefined, + "ref": "T", + "type": "ref", + }, + "true": Object { + "and": Array [ + Object { + "genericArguments": undefined, + "ref": "T", + "type": "ref", + }, + Object { + "additionalProperties": false, + "extends": undefined, + "properties": Object { + "validation": Object { + "node": Object { + "description": "Each view can optionally supply a list of validations to run against a particular view", + "elementType": Object { + "additionalProperties": Object { + "type": "unknown", + }, + "extends": undefined, + "name": "CrossfieldReference", + "properties": Object { + "dataTarget": Object { + "node": Object { + "description": "Cross-field references and validation must run against the default (deformatted) value", + "title": "CrossfieldReference.dataTarget", + "type": "never", + }, + "required": false, + }, + "displayTarget": Object { + "node": Object { + "description": "Where the error should be displayed", + "name": "DisplayTarget", + "or": Array [ + Object { + "const": "page", + "title": "DisplayTarget", + "type": "string", + }, + Object { + "const": "section", + "title": "DisplayTarget", + "type": "string", + }, + Object { + "const": "field", + "title": "DisplayTarget", + "type": "string", + }, + ], + "title": "Reference.displayTarget", + "type": "or", + }, + "required": false, + }, + "message": Object { + "node": Object { + "description": "An optional means of overriding the default message if the validation is triggered", + "title": "Reference.message", + "type": "string", + }, + "required": false, + }, + "ref": Object { + "node": Object { + "description": "The binding to associate this validation with", + "genericArguments": undefined, + "ref": "Binding", + "title": "CrossfieldReference.ref", + "type": "ref", + }, + "required": false, + }, + "severity": Object { + "node": Object { + "description": "An optional means of overriding the default severity of the validation if triggered", + "name": "Severity", + "or": Array [ + Object { + "const": "error", + "title": "Severity", + "type": "string", + }, + Object { + "const": "warning", + "title": "Severity", + "type": "string", + }, + ], + "title": "Reference.severity", + "type": "or", + }, + "required": false, + }, + "trigger": Object { + "node": Object { + "description": "When to run this particular validation", + "name": "Trigger", + "or": Array [ + Object { + "const": "navigation", + "title": "Trigger", + "type": "string", + }, + Object { + "const": "change", + "title": "Trigger", + "type": "string", + }, + Object { + "const": "load", + "title": "Trigger", + "type": "string", + }, + ], + "title": "Reference.trigger", + "type": "or", + }, + "required": false, + }, + "type": Object { + "node": Object { + "description": "The name of the referenced validation type +This will be used to lookup the proper handler", + "title": "Reference.type", + "type": "string", + }, + "required": true, + }, + }, + "title": "CrossfieldReference", + "type": "object", + }, + "title": "validation", + "type": "array", + }, + "required": false, + }, + }, + "type": "object", + }, + ], + "type": "and", + }, + }, + }, + Object { + "additionalProperties": Object { + "type": "unknown", + }, + "description": "The JSON payload for running Player", + "extends": undefined, + "genericTokens": Array [ + Object { + "constraints": Object { + "ref": "Asset", + "type": "ref", + }, + "default": Object { + "ref": "Asset", + "type": "ref", + }, + "symbol": "T", + }, + ], + "name": "Flow", + "properties": Object { + "data": Object { + "node": Object { + "description": "Any initial data that the flow can use", + "keyType": Object { + "type": "any", + }, + "name": "DataModel", + "source": "src/index.ts", + "title": "Flow.data", + "type": "record", + "valueType": Object { + "type": "unknown", + }, + }, + "required": false, + }, + "id": Object { + "node": Object { + "description": "A unique identifier for the flow", + "title": "Flow.id", + "type": "string", + }, + "required": true, + }, + "navigation": Object { + "node": Object { + "and": Array [ + Object { + "additionalProperties": false, + "extends": undefined, + "properties": Object { + "BEGIN": Object { + "node": Object { + "description": "The name of the Flow to begin on", + "title": "BEGIN", + "type": "string", + }, + "required": true, + }, + }, + "type": "object", + }, + Object { + "keyType": Object { + "type": "string", + }, + "type": "record", + "valueType": Object { + "or": Array [ + Object { + "type": "string", + }, + Object { + "additionalProperties": Object { + "or": Array [ + Object { + "type": "undefined", + }, + Object { + "type": "string", + }, + Object { + "genericArguments": undefined, + "ref": "Expression", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + Object { + "name": "NavigationFlowState", + "or": Array [ + Object { + "additionalProperties": false, + "description": "A state representing a view", + "extends": undefined, + "name": "NavigationFlowViewState", + "properties": Object { + "_comment": Object { + "node": Object { + "description": "Add comments that will not be processing, but are useful for code explanation", + "title": "CommentBase._comment", + "type": "string", + }, + "required": false, + }, + "attributes": Object { + "node": Object { + "additionalProperties": Object { + "type": "any", + }, + "description": "View meta-properties", + "extends": undefined, + "properties": Object {}, + "title": "NavigationFlowViewState.attributes", + "type": "object", + }, + "required": false, + }, + "exp": Object { + "node": Object { + "title": "NavigationBaseState.exp", + "type": "never", + }, + "required": false, + }, + "onEnd": Object { + "node": Object { + "description": "An optional expression to run before view transition", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onEnd", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onEnd", + "type": "or", + }, + "required": false, + }, + "onStart": Object { + "node": Object { + "description": "An optional expression to run when this view renders", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onStart", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onStart", + "type": "or", + }, + "required": false, + }, + "ref": Object { + "node": Object { + "description": "An id corresponding to a view from the 'views' array", + "title": "NavigationFlowViewState.ref", + "type": "string", + }, + "required": true, + }, + "state_type": Object { + "node": Object { + "const": "VIEW", + "description": "A property to determine the type of state this is", + "title": "NavigationBaseState.state_type", + "type": "string", + }, + "required": true, + }, + "transitions": Object { + "node": Object { + "description": "A mapping of transition-name to FlowState name", + "keyType": Object { + "type": "string", + }, + "name": "NavigationFlowTransition", + "source": "src/index.ts", + "title": "NavigationFlowTransitionableState.transitions", + "type": "record", + "valueType": Object { + "type": "string", + }, + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "NavigationFlowViewState", + "type": "object", + }, + Object { + "additionalProperties": false, + "description": "An END state of the flow.", + "extends": undefined, + "name": "NavigationFlowEndState", + "properties": Object { + "_comment": Object { + "node": Object { + "description": "Add comments that will not be processing, but are useful for code explanation", + "title": "CommentBase._comment", + "type": "string", + }, + "required": false, + }, + "exp": Object { + "node": Object { + "title": "NavigationBaseState.exp", + "type": "never", + }, + "required": false, + }, + "onEnd": Object { + "node": Object { + "description": "An optional expression to run before view transition", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onEnd", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onEnd", + "type": "or", + }, + "required": false, + }, + "onStart": Object { + "node": Object { + "description": "An optional expression to run when this view renders", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onStart", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onStart", + "type": "or", + }, + "required": false, + }, + "outcome": Object { + "node": Object { + "description": "A description of _how_ the flow ended. +If this is a flow started from another flow, the outcome determines the flow transition", + "title": "NavigationFlowEndState.outcome", + "type": "string", + }, + "required": true, + }, + "state_type": Object { + "node": Object { + "const": "END", + "description": "A property to determine the type of state this is", + "title": "NavigationBaseState.state_type", + "type": "string", + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "NavigationFlowEndState", + "type": "object", + }, + Object { + "additionalProperties": false, + "extends": undefined, + "name": "NavigationFlowFlowState", + "properties": Object { + "_comment": Object { + "node": Object { + "description": "Add comments that will not be processing, but are useful for code explanation", + "title": "CommentBase._comment", + "type": "string", + }, + "required": false, + }, + "exp": Object { + "node": Object { + "title": "NavigationBaseState.exp", + "type": "never", + }, + "required": false, + }, + "onEnd": Object { + "node": Object { + "description": "An optional expression to run before view transition", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onEnd", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onEnd", + "type": "or", + }, + "required": false, + }, + "onStart": Object { + "node": Object { + "description": "An optional expression to run when this view renders", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onStart", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onStart", + "type": "or", + }, + "required": false, + }, + "ref": Object { + "node": Object { + "description": "A reference to a FLOW id state to run", + "title": "NavigationFlowFlowState.ref", + "type": "string", + }, + "required": true, + }, + "state_type": Object { + "node": Object { + "const": "FLOW", + "description": "A property to determine the type of state this is", + "title": "NavigationBaseState.state_type", + "type": "string", + }, + "required": true, + }, + "transitions": Object { + "node": Object { + "description": "A mapping of transition-name to FlowState name", + "keyType": Object { + "type": "string", + }, + "name": "NavigationFlowTransition", + "source": "src/index.ts", + "title": "NavigationFlowTransitionableState.transitions", + "type": "record", + "valueType": Object { + "type": "string", + }, + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "NavigationFlowFlowState", + "type": "object", + }, + Object { + "additionalProperties": false, + "description": "Action states execute an expression to determine the next state to transition to", + "extends": undefined, + "name": "NavigationFlowActionState", + "properties": Object { + "_comment": Object { + "node": Object { + "description": "Add comments that will not be processing, but are useful for code explanation", + "title": "CommentBase._comment", + "type": "string", + }, + "required": false, + }, + "exp": Object { + "node": Object { + "description": "An expression to execute. +The return value determines the transition to take", + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationFlowActionState.exp", + "type": "ref", + }, + "required": true, + }, + "onEnd": Object { + "node": Object { + "description": "An optional expression to run before view transition", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onEnd", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onEnd", + "type": "or", + }, + "required": false, + }, + "onStart": Object { + "node": Object { + "description": "An optional expression to run when this view renders", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onStart", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onStart", + "type": "or", + }, + "required": false, + }, + "state_type": Object { + "node": Object { + "const": "ACTION", + "description": "A property to determine the type of state this is", + "title": "NavigationBaseState.state_type", + "type": "string", + }, + "required": true, + }, + "transitions": Object { + "node": Object { + "description": "A mapping of transition-name to FlowState name", + "keyType": Object { + "type": "string", + }, + "name": "NavigationFlowTransition", + "source": "src/index.ts", + "title": "NavigationFlowTransitionableState.transitions", + "type": "record", + "valueType": Object { + "type": "string", + }, + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "NavigationFlowActionState", + "type": "object", + }, + Object { + "additionalProperties": false, + "description": "External Flow states represent states in the FSM that can't be resolved internally in Player. +The flow will wait for the embedded application to manage moving to the next state via a transition", + "extends": undefined, + "name": "NavigationFlowExternalState", + "properties": Object { + "_comment": Object { + "node": Object { + "description": "Add comments that will not be processing, but are useful for code explanation", + "title": "CommentBase._comment", + "type": "string", + }, + "required": false, + }, + "exp": Object { + "node": Object { + "title": "NavigationBaseState.exp", + "type": "never", + }, + "required": false, + }, + "onEnd": Object { + "node": Object { + "description": "An optional expression to run before view transition", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onEnd", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onEnd", + "type": "or", + }, + "required": false, + }, + "onStart": Object { + "node": Object { + "description": "An optional expression to run when this view renders", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationBaseState.onStart", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationBaseState.onStart", + "type": "or", + }, + "required": false, + }, + "ref": Object { + "node": Object { + "description": "A reference for this external state", + "title": "NavigationFlowExternalState.ref", + "type": "string", + }, + "required": true, + }, + "state_type": Object { + "node": Object { + "const": "EXTERNAL", + "description": "A property to determine the type of state this is", + "title": "NavigationBaseState.state_type", + "type": "string", + }, + "required": true, + }, + "transitions": Object { + "node": Object { + "description": "A mapping of transition-name to FlowState name", + "keyType": Object { + "type": "string", + }, + "name": "NavigationFlowTransition", + "source": "src/index.ts", + "title": "NavigationFlowTransitionableState.transitions", + "type": "record", + "valueType": Object { + "type": "string", + }, + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "NavigationFlowExternalState", + "type": "object", + }, + ], + "source": "src/index.ts", + "title": "NavigationFlowState", + "type": "or", + }, + ], + "type": "or", + }, + "description": "A state machine in the navigation", + "extends": undefined, + "name": "NavigationFlow", + "properties": Object { + "onEnd": Object { + "node": Object { + "description": "An optional expression to run when this Flow ends", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationFlow.onEnd", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationFlow.onEnd", + "type": "or", + }, + "required": false, + }, + "onStart": Object { + "node": Object { + "description": "An optional expression to run when this Flow starts", + "or": Array [ + Object { + "genericArguments": undefined, + "ref": "Expression", + "title": "NavigationFlow.onStart", + "type": "ref", + }, + Object { + "additionalProperties": false, + "description": "An object with an expression in it", + "extends": undefined, + "name": "ExpressionObject", + "properties": Object { + "exp": Object { + "node": Object { + "description": "The expression to run", + "genericArguments": undefined, + "ref": "Expression", + "title": "ExpressionObject.exp", + "type": "ref", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "ExpressionObject", + "type": "object", + }, + ], + "title": "NavigationFlow.onStart", + "type": "or", + }, + "required": false, + }, + "startState": Object { + "node": Object { + "description": "The first state to kick off the state machine", + "title": "NavigationFlow.startState", + "type": "string", + }, + "required": true, + }, + }, + "source": "src/index.ts", + "title": "NavigationFlow", + "type": "object", + }, + ], + "type": "or", + }, + }, + ], + "description": "A state machine to drive a user through the experience", + "name": "Navigation", + "source": "src/index.ts", + "title": "Flow.navigation", + "type": "and", + }, + "required": true, + }, + "schema": Object { + "node": Object { + "additionalProperties": Object { + "additionalProperties": Object { + "additionalProperties": Object { + "type": "unknown", + }, + "description": "Each prop in the object can have a specific DataType", + "extends": undefined, + "genericTokens": Array [ + Object { + "constraints": Object { + "type": "any", + }, + "default": Object { + "type": "unknown", + }, + "symbol": "T", + }, + ], + "name": "DataType", + "properties": Object { + "default": Object { + "node": Object { + "description": "A default value for this property. +Any reads for this property will result in this default value being written to the model.", + "genericArguments": undefined, + "ref": "T", + "title": "DataType.default", + "type": "ref", + }, + "required": false, + }, + "format": Object { + "node": Object { + "additionalProperties": Object { + "type": "unknown", + }, + "description": "A reference to a specific data format to use. +If none is specified, will fallback to that of the base type", + "extends": undefined, + "name": "Reference", + "properties": Object { + "type": Object { + "node": Object { + "description": "The name of the formatter (and de-formatter) to use", + "title": "Reference.type", + "type": "string", + }, + "required": true, + }, + }, + "title": "DataType.format", + "type": "object", + }, + "required": false, + }, + "isArray": Object { + "node": Object { + "description": "The referenced object represents an array rather than an object", + "title": "DataType.isArray", + "type": "boolean", + }, + "required": false, + }, + "type": Object { + "node": Object { + "description": "The reference of the base type to use", + "title": "DataType.type", + "type": "string", + }, + "required": true, + }, + "validation": Object { + "node": Object { + "description": "Any additional validations that are associated with this property +These will add to any base validations associated with the \\"type\\"", + "elementType": Object { + "additionalProperties": Object { + "type": "unknown", + }, + "description": "A reference to a validation object", + "extends": undefined, + "name": "Reference", + "properties": Object { + "dataTarget": Object { + "node": Object { + "description": "Each validation is passed the value of the data to run it's validation against. +By default, this is the value stored in the data-model (deformatted). +In the off chance you'd like this validator to run against the formatted value (the one the user sees), set this option", + "or": Array [ + Object { + "const": "formatted", + "title": "Reference.dataTarget", + "type": "string", + }, + Object { + "const": "deformatted", + "title": "Reference.dataTarget", + "type": "string", + }, + ], + "title": "Reference.dataTarget", + "type": "or", + }, + "required": false, + }, + "displayTarget": Object { + "node": Object { + "description": "Where the error should be displayed", + "name": "DisplayTarget", + "or": Array [ + Object { + "const": "page", + "title": "DisplayTarget", + "type": "string", + }, + Object { + "const": "section", + "title": "DisplayTarget", + "type": "string", + }, + Object { + "const": "field", + "title": "DisplayTarget", + "type": "string", + }, + ], + "title": "Reference.displayTarget", + "type": "or", + }, + "required": false, + }, + "message": Object { + "node": Object { + "description": "An optional means of overriding the default message if the validation is triggered", + "title": "Reference.message", + "type": "string", + }, + "required": false, + }, + "severity": Object { + "node": Object { + "description": "An optional means of overriding the default severity of the validation if triggered", + "name": "Severity", + "or": Array [ + Object { + "const": "error", + "title": "Severity", + "type": "string", + }, + Object { + "const": "warning", + "title": "Severity", + "type": "string", + }, + ], + "title": "Reference.severity", + "type": "or", + }, + "required": false, + }, + "trigger": Object { + "node": Object { + "description": "When to run this particular validation", + "name": "Trigger", + "or": Array [ + Object { + "const": "navigation", + "title": "Trigger", + "type": "string", + }, + Object { + "const": "change", + "title": "Trigger", + "type": "string", + }, + Object { + "const": "load", + "title": "Trigger", + "type": "string", + }, + ], + "title": "Reference.trigger", + "type": "or", + }, + "required": false, + }, + "type": Object { + "node": Object { + "description": "The name of the referenced validation type +This will be used to lookup the proper handler", + "title": "Reference.type", + "type": "string", + }, + "required": true, + }, + }, + "title": "Reference", + "type": "object", + }, + "title": "DataType.validation", + "type": "array", + }, + "required": false, + }, + }, + "title": "DataType", + "type": "object", + }, + "description": "A Node describes a specific object in the tree", + "extends": undefined, + "name": "Node", + "properties": Object {}, + "title": "Node", + "type": "object", + }, + "description": "The schema for the supplied (or referenced data). +This is used for validation, formatting, etc", + "extends": undefined, + "name": "Schema", + "properties": Object { + "ROOT": Object { + "node": Object { + "additionalProperties": Object { + "additionalProperties": Object { + "type": "unknown", + }, + "description": "Each prop in the object can have a specific DataType", + "extends": undefined, + "genericTokens": Array [ + Object { + "constraints": Object { + "type": "any", + }, + "default": Object { + "type": "unknown", + }, + "symbol": "T", + }, + ], + "name": "DataType", + "properties": Object { + "default": Object { + "node": Object { + "description": "A default value for this property. +Any reads for this property will result in this default value being written to the model.", + "genericArguments": undefined, + "ref": "T", + "title": "DataType.default", + "type": "ref", + }, + "required": false, + }, + "format": Object { + "node": Object { + "additionalProperties": Object { + "type": "unknown", + }, + "description": "A reference to a specific data format to use. +If none is specified, will fallback to that of the base type", + "extends": undefined, + "name": "Reference", + "properties": Object { + "type": Object { + "node": Object { + "description": "The name of the formatter (and de-formatter) to use", + "title": "Reference.type", + "type": "string", + }, + "required": true, + }, + }, + "title": "DataType.format", + "type": "object", + }, + "required": false, + }, + "isArray": Object { + "node": Object { + "description": "The referenced object represents an array rather than an object", + "title": "DataType.isArray", + "type": "boolean", + }, + "required": false, + }, + "type": Object { + "node": Object { + "description": "The reference of the base type to use", + "title": "DataType.type", + "type": "string", + }, + "required": true, + }, + "validation": Object { + "node": Object { + "description": "Any additional validations that are associated with this property +These will add to any base validations associated with the \\"type\\"", + "elementType": Object { + "additionalProperties": Object { + "type": "unknown", + }, + "description": "A reference to a validation object", + "extends": undefined, + "name": "Reference", + "properties": Object { + "dataTarget": Object { + "node": Object { + "description": "Each validation is passed the value of the data to run it's validation against. +By default, this is the value stored in the data-model (deformatted). +In the off chance you'd like this validator to run against the formatted value (the one the user sees), set this option", + "or": Array [ + Object { + "const": "formatted", + "title": "Reference.dataTarget", + "type": "string", + }, + Object { + "const": "deformatted", + "title": "Reference.dataTarget", + "type": "string", + }, + ], + "title": "Reference.dataTarget", + "type": "or", + }, + "required": false, + }, + "displayTarget": Object { + "node": Object { + "description": "Where the error should be displayed", + "name": "DisplayTarget", + "or": Array [ + Object { + "const": "page", + "title": "DisplayTarget", + "type": "string", + }, + Object { + "const": "section", + "title": "DisplayTarget", + "type": "string", + }, + Object { + "const": "field", + "title": "DisplayTarget", + "type": "string", + }, + ], + "title": "Reference.displayTarget", + "type": "or", + }, + "required": false, + }, + "message": Object { + "node": Object { + "description": "An optional means of overriding the default message if the validation is triggered", + "title": "Reference.message", + "type": "string", + }, + "required": false, + }, + "severity": Object { + "node": Object { + "description": "An optional means of overriding the default severity of the validation if triggered", + "name": "Severity", + "or": Array [ + Object { + "const": "error", + "title": "Severity", + "type": "string", + }, + Object { + "const": "warning", + "title": "Severity", + "type": "string", + }, + ], + "title": "Reference.severity", + "type": "or", + }, + "required": false, + }, + "trigger": Object { + "node": Object { + "description": "When to run this particular validation", + "name": "Trigger", + "or": Array [ + Object { + "const": "navigation", + "title": "Trigger", + "type": "string", + }, + Object { + "const": "change", + "title": "Trigger", + "type": "string", + }, + Object { + "const": "load", + "title": "Trigger", + "type": "string", + }, + ], + "title": "Reference.trigger", + "type": "or", + }, + "required": false, + }, + "type": Object { + "node": Object { + "description": "The name of the referenced validation type +This will be used to lookup the proper handler", + "title": "Reference.type", + "type": "string", + }, + "required": true, + }, + }, + "title": "Reference", + "type": "object", + }, + "title": "DataType.validation", + "type": "array", + }, + "required": false, + }, + }, + "title": "DataType", + "type": "object", + }, + "description": "The ROOT object is the top level object to use", + "extends": undefined, + "name": "Node", + "properties": Object {}, + "title": "Schema.ROOT", + "type": "object", + }, + "required": true, + }, + }, + "title": "Flow.schema", + "type": "object", + }, + "required": false, + }, + "views": Object { + "node": Object { + "description": "A list of views (each with an ID) that can be shown to a user", + "elementType": Object { + "check": Object { + "left": Object { + "type": "unknown", + }, + "right": Object { + "type": "unknown", + }, + }, + "genericTokens": Array [ + Object { + "constraints": Object { + "ref": "Asset", + "type": "ref", + }, + "default": Object { + "ref": "Asset", + "type": "ref", + }, + "symbol": "T", + }, + ], + "name": "View", + "source": "src/index.ts", + "title": "View", + "type": "conditional", + "value": Object { + "false": Object { + "genericArguments": undefined, + "ref": "T", + "type": "ref", + }, + "true": Object { + "and": Array [ + Object { + "genericArguments": undefined, + "ref": "T", + "type": "ref", + }, + Object { + "additionalProperties": false, + "extends": undefined, + "properties": Object { + "validation": Object { + "node": Object { + "description": "Each view can optionally supply a list of validations to run against a particular view", + "elementType": Object { + "additionalProperties": Object { + "type": "unknown", + }, + "extends": undefined, + "name": "CrossfieldReference", + "properties": Object { + "dataTarget": Object { + "node": Object { + "description": "Cross-field references and validation must run against the default (deformatted) value", + "title": "CrossfieldReference.dataTarget", + "type": "never", + }, + "required": false, + }, + "displayTarget": Object { + "node": Object { + "description": "Where the error should be displayed", + "name": "DisplayTarget", + "or": Array [ + Object { + "const": "page", + "title": "DisplayTarget", + "type": "string", + }, + Object { + "const": "section", + "title": "DisplayTarget", + "type": "string", + }, + Object { + "const": "field", + "title": "DisplayTarget", + "type": "string", + }, + ], + "title": "Reference.displayTarget", + "type": "or", + }, + "required": false, + }, + "message": Object { + "node": Object { + "description": "An optional means of overriding the default message if the validation is triggered", + "title": "Reference.message", + "type": "string", + }, + "required": false, + }, + "ref": Object { + "node": Object { + "description": "The binding to associate this validation with", + "genericArguments": undefined, + "ref": "Binding", + "title": "CrossfieldReference.ref", + "type": "ref", + }, + "required": false, + }, + "severity": Object { + "node": Object { + "description": "An optional means of overriding the default severity of the validation if triggered", + "name": "Severity", + "or": Array [ + Object { + "const": "error", + "title": "Severity", + "type": "string", + }, + Object { + "const": "warning", + "title": "Severity", + "type": "string", + }, + ], + "title": "Reference.severity", + "type": "or", + }, + "required": false, + }, + "trigger": Object { + "node": Object { + "description": "When to run this particular validation", + "name": "Trigger", + "or": Array [ + Object { + "const": "navigation", + "title": "Trigger", + "type": "string", + }, + Object { + "const": "change", + "title": "Trigger", + "type": "string", + }, + Object { + "const": "load", + "title": "Trigger", + "type": "string", + }, + ], + "title": "Reference.trigger", + "type": "or", + }, + "required": false, + }, + "type": Object { + "node": Object { + "description": "The name of the referenced validation type +This will be used to lookup the proper handler", + "title": "Reference.type", + "type": "string", + }, + "required": true, + }, + }, + "title": "CrossfieldReference", + "type": "object", + }, + "title": "validation", + "type": "array", + }, + "required": false, + }, + }, + "type": "object", + }, + ], + "type": "and", + }, + }, + }, + "title": "Flow.views", + "type": "array", + }, + "required": false, + }, + }, + "source": "src/index.ts", + "title": "Flow", + "type": "object", + }, +] `; exports[`Object Recall Processed 1`] = ` diff --git a/xlr/sdk/src/__tests__/sdk.test.ts b/xlr/sdk/src/__tests__/sdk.test.ts index 37bee409..3f138dba 100644 --- a/xlr/sdk/src/__tests__/sdk.test.ts +++ b/xlr/sdk/src/__tests__/sdk.test.ts @@ -106,50 +106,27 @@ describe('Basic Validation', () => { describe('Export Test', () => { it('Exports Typescript types', () => { - const importMap = new Map([ - [ - '@player-ui/types', - ['Expression', 'Asset', 'Binding', 'AssetWrapper', 'Schema.DataType'], - ], - ]); - const sdk = new XLRSDK(); sdk.loadDefinitionsFromDisk('./common/static_xlrs/plugin', EXCLUDE); sdk.loadDefinitionsFromDisk('./common/static_xlrs/core', EXCLUDE); - const results = sdk.exportRegistry('TypeScript', importMap); - expect(results[0][0]).toBe('out.d.ts'); - expect(results[0][1]).toMatchSnapshot(); + const results = sdk.exportRegistry(); + expect(results).toMatchSnapshot(); }); it('Exports Typescript Types With Filters', () => { - const importMap = new Map([ - [ - '@player-ui/types', - ['Expression', 'Asset', 'Binding', 'AssetWrapper', 'Schema.DataType'], - ], - ]); - const sdk = new XLRSDK(); sdk.loadDefinitionsFromDisk('./common/static_xlrs/plugin'); sdk.loadDefinitionsFromDisk('./common/static_xlrs/core', EXCLUDE); - const results = sdk.exportRegistry('TypeScript', importMap, { + const results = sdk.exportRegistry({ typeFilter: 'Transformed', pluginFilter: 'Types', }); - expect(results[0][0]).toBe('out.d.ts'); - expect(results[0][1]).toMatchSnapshot(); + expect(results).toMatchSnapshot(); }); it('Exports Typescript Types With Transforms', () => { - const importMap = new Map([ - [ - '@player-ui/types', - ['Expression', 'Asset', 'Binding', 'AssetWrapper', 'Schema.DataType'], - ], - ]); - /** - * + * Sample transform */ const transformFunction: TransformFunction = (input, capability) => { if (capability === 'Assets') { @@ -170,15 +147,7 @@ describe('Export Test', () => { const sdk = new XLRSDK(); sdk.loadDefinitionsFromDisk('./common/static_xlrs/plugin', EXCLUDE); sdk.loadDefinitionsFromDisk('./common/static_xlrs/core', EXCLUDE); - const results = sdk.exportRegistry( - 'TypeScript', - importMap, - { - pluginFilter: 'Types', - }, - [transformFunction] - ); - expect(results[0][0]).toBe('out.d.ts'); - expect(results[0][1]).toMatchSnapshot(); + const results = sdk.exportRegistry({}, [transformFunction]); + expect(results).toMatchSnapshot(); }); }); From 8fd249385088c6c55c528326eca2ecc5c9c2d18d Mon Sep 17 00:00:00 2001 From: Ketan Reddy Date: Tue, 16 May 2023 14:32:45 -0700 Subject: [PATCH 48/52] defer adding XLR info to transform --- drag-and-drop/app/pages/index.tsx | 41 +++++++--------- drag-and-drop/library/src/controller.tsx | 47 +++++++++++++------ drag-and-drop/library/src/types.ts | 16 +++---- .../library/src/utils/player-dnd-plugin.ts | 11 +++++ .../library/src/utils/runtime-flow-state.ts | 18 +++---- 5 files changed, 76 insertions(+), 57 deletions(-) diff --git a/drag-and-drop/app/pages/index.tsx b/drag-and-drop/app/pages/index.tsx index 869a36a8..0008b84d 100644 --- a/drag-and-drop/app/pages/index.tsx +++ b/drag-and-drop/app/pages/index.tsx @@ -45,13 +45,13 @@ import { } from '@player-tools/dnd-lib'; import { ReferenceAssetsPlugin } from '@player-ui/reference-assets-plugin-react'; import type { NamedType, ObjectType, TSManifest } from '@player-tools/xlr'; -// eslint-disable-next-line import/extensions, import/no-unresolved + import pluginManifest from '@player-ui/reference-assets-plugin-react/dist/xlr/manifest'; -// eslint-disable-next-line import/extensions, import/no-unresolved + import typesManifest from '@player-ui/types/dist/xlr/manifest'; +import Files from 'react-files'; import { AssetEditorPanel } from '../components/AssetEditorPanel'; import { covertXLRtoAssetDoc } from '../utils/converters'; -import Files from "react-files"; const PropertiesContext = React.createContext<{ /** @@ -292,24 +292,22 @@ const AssetSelectorPanel = () => { - { - const fileReader = new FileReader(); - fileReader.onload = () => { - controller.importView(JSON.parse(fileReader.result as string).views[0]); - }; - fileReader.readAsText(file[0]); - }} - accepts={[".json"]} - clickable - > - - - + + @@ -603,9 +601,6 @@ const App = () => { type: collectionType as NamedType, }; }, - handleDndStateChange(content) { - console.log('handle state changes here'); - } }; const controller = new DragAndDropController(config); return { diff --git a/drag-and-drop/library/src/controller.tsx b/drag-and-drop/library/src/controller.tsx index 35575476..37283529 100644 --- a/drag-and-drop/library/src/controller.tsx +++ b/drag-and-drop/library/src/controller.tsx @@ -57,22 +57,12 @@ export interface DragAndDropControllerOptions { type: NamedType; }; - /** - * Function that will be called when Drag and Drop state changes - * - * @deprecated Will be removed soon - */ - handleDndStateChange: ( - /** An instance of the controller object to access any new information that you may need */ - controller: DragAndDropController - ) => void; - /** A custom component to use for rendering droppable Assets */ Component?: React.ComponentType; } /** - * + * The DragAndDropController is the main entry point for the Drag and Drop library. */ export class DragAndDropController { private readonly options: DragAndDropControllerOptions; @@ -126,11 +116,29 @@ export class DragAndDropController { this.runtimeState = new RuntimeFlowState({ resolveRequiredProperties: options.resolveRequiredProperties, resolveCollectionConversion: (assets: Array) => { - return options.resolveCollectionConversion(assets, this.XLRSDK); + const { asset, type } = options.resolveCollectionConversion( + assets, + this.XLRSDK + ); + + const typeInfo = this.XLRSDK.getTypeInfo(type.name); + if (!typeInfo) { + throw new Error( + `SDK Error: Unable to get type info for collection type ${type.name}` + ); + } + + return { + asset, + identifier: { + assetName: type.name, + pluginName: typeInfo.plugin, + capability: typeInfo.capability, + }, + }; }, handleDndStateChange: () => { this.stateUpdateSubscription.publish(this); - options.handleDndStateChange(this); }, }); @@ -213,7 +221,18 @@ export class DragAndDropController { /** The underlying XLR type for the Asset */ type: ObjectType; } { - return this.runtimeState.getAsset(assetSymbol); + const placedAsset = this.runtimeState.getAsset(assetSymbol); + const type = this.XLRSDK.getType(placedAsset?.identifier.assetName); + if (!type) { + throw new Error( + `Unable to find type for asset ${placedAsset?.identifier.assetName}` + ); + } + + return { + asset: placedAsset.asset, + type: type as ObjectType, + }; } /** diff --git a/drag-and-drop/library/src/types.ts b/drag-and-drop/library/src/types.ts index 12faa0f4..6a20ea2f 100644 --- a/drag-and-drop/library/src/types.ts +++ b/drag-and-drop/library/src/types.ts @@ -41,9 +41,6 @@ export interface PlacedAsset { /** The identifier for where the populated asset is from */ identifier: ExtensionProviderAssetIdentifier; - /** The current descriptor for the value stored at this asset */ - type: NamedType; - /** A mapping of asset slot name to drop target handlers */ asset: Asset; } @@ -78,11 +75,11 @@ export interface DropTargetAsset extends Asset<'drop-target'> { /** The effective value that should be rendered. Generated from `.values` */ value?: { - /** The current descriptor for the value stored at this asset */ - type: NamedType; - /** A mapping of asset slot name to drop target handlers */ asset: Asset; + + /** The current descriptor for the value stored at this asset */ + identifier: ExtensionProviderAssetIdentifier; }; /** @@ -94,8 +91,11 @@ export interface DropTargetAsset extends Asset<'drop-target'> { } export interface TransformedDropTargetAssetType extends DropTargetAsset { - /** Context relative to the parent's position */ - context?: DropTargetAsset['context']; + /** The effective value that should be rendered with XLR information. Generated from `.values` */ + value?: DropTargetAsset['value'] & { + /** The current descriptor for the value stored at this asset */ + type: NamedType; + }; /** Unique identifier to reference the asset within the drop target */ assetSymbol?: symbol; diff --git a/drag-and-drop/library/src/utils/player-dnd-plugin.ts b/drag-and-drop/library/src/utils/player-dnd-plugin.ts index 3712219c..cf696c0d 100644 --- a/drag-and-drop/library/src/utils/player-dnd-plugin.ts +++ b/drag-and-drop/library/src/utils/player-dnd-plugin.ts @@ -89,6 +89,17 @@ export class PlayerDndPlugin implements ReactPlayerPlugin { resolve: (asset: DropTargetAsset) => { return { ...asset, + values: [], + ...(asset.value + ? { + value: { + ...asset.value, + type: this.options.getXLRTypeForAsset( + asset.value.identifier as ExtensionProviderAssetIdentifier + ), + }, + } + : {}), assetSymbol: asset.value?.asset ? getAssetSymbol(asset.value.asset) : undefined, diff --git a/drag-and-drop/library/src/utils/runtime-flow-state.ts b/drag-and-drop/library/src/utils/runtime-flow-state.ts index 05265f05..0a335185 100644 --- a/drag-and-drop/library/src/utils/runtime-flow-state.ts +++ b/drag-and-drop/library/src/utils/runtime-flow-state.ts @@ -46,7 +46,7 @@ export interface RuntimeFlowStateOptions { /** The generated collection asset with the provided `assets` array as children */ asset: Asset; /** The corresponding type for the generated collection asset */ - type: NamedType; + identifier: ExtensionProviderAssetIdentifier; }; /** @@ -111,7 +111,7 @@ export class RuntimeFlowState { /** The generated collection asset with the provided `assets` array as children */ asset: Asset; /** The corresponding type for the generated collection asset */ - type: NamedType; + identifier: ExtensionProviderAssetIdentifier; }; /** Called whenever drag and drop state changes */ @@ -468,9 +468,9 @@ export class RuntimeFlowState { const newAsset = await this.createNewAsset(dropTarget.id, replacement.type); - const newWrappedAsset = { + const newWrappedAsset: PlacedAsset = { asset: newAsset, - ...replacement, + identifier: replacement.identifier, }; this.realAssetMappings.set(getAssetSymbol(newAsset), newWrappedAsset); @@ -500,12 +500,7 @@ export class RuntimeFlowState { this.handleDndStateChange(); } - public getAsset(assetSymbol: symbol): { - /** The Asset that correlates to the given ID */ - asset: Asset; - /** The underlying XLR type for the Asset */ - type: ObjectType; - } { + public getAsset(assetSymbol: symbol): PlacedAsset { const placedAsset = this.realAssetMappings.get(assetSymbol); if (!placedAsset) { throw new Error( @@ -513,7 +508,7 @@ export class RuntimeFlowState { ); } - return { ...placedAsset }; + return placedAsset; } public clearAsset(assetSymbol: symbol) { @@ -571,7 +566,6 @@ export class RuntimeFlowState { assetName: targetAssetType.name ?? '', capability: dropTargetContext ? 'Assets' : 'Views', }, - type: targetAssetType, asset: targetAsset, }; const targetAssetSymbol = getAssetSymbol(targetAsset); From aa7f9c7d967bbb122dab4de549fc20d8e9c2d677 Mon Sep 17 00:00:00 2001 From: Ketan Reddy Date: Tue, 16 May 2023 15:07:01 -0700 Subject: [PATCH 49/52] Fix bug preventing changing the asset being edited after updating an asset --- drag-and-drop/app/pages/index.tsx | 42 +++++++++++++++++++++---------- 1 file changed, 29 insertions(+), 13 deletions(-) diff --git a/drag-and-drop/app/pages/index.tsx b/drag-and-drop/app/pages/index.tsx index 0008b84d..c1efcecd 100644 --- a/drag-and-drop/app/pages/index.tsx +++ b/drag-and-drop/app/pages/index.tsx @@ -1,4 +1,4 @@ -import React, { Suspense } from 'react'; +import React, { Suspense, useEffect } from 'react'; import { ChakraProvider, Box, @@ -322,32 +322,51 @@ const AssetSelectorPanel = () => { const AssetDetailsPanel = () => { const { controller } = useController() ?? {}; const propContext = React.useContext(PropertiesContext); - const [modifiedAsset, setModifiedAsset] = React.useState( - undefined + const [sourceAssetID, setSourceAssetID] = React.useState( + propContext.displayedAssetID ); + const { asset, type } = controller.getAsset(sourceAssetID); + + const [localAsset, setLocalAsset] = React.useState(asset); + + const [localType, setLocalType] = React.useState( + type + ); + + useEffect(() => { + if (propContext.displayedAssetID !== sourceAssetID) { + setSourceAssetID(propContext.displayedAssetID); + } + }, [propContext.displayedAssetID, sourceAssetID]); + + useEffect(() => { + const { asset: newAsset, type: newType } = + controller.getAsset(sourceAssetID); + setLocalAsset(newAsset); + setLocalType(newType); + }, [sourceAssetID, controller]); + if (!controller) { return null; } - const { asset, type } = controller.getAsset(propContext.displayedAssetID); - /** * Updates the selected asset thats stored as a temporary value */ const updateObject = (path: Array, value: any) => { - setModifiedAsset(setIn(modifiedAsset ?? asset, path, value) as Asset); + setLocalAsset(setIn(localAsset, path, value) as Asset); }; return ( - Properties for {type.name} + Properties for {localType.name} @@ -356,10 +375,7 @@ const AssetDetailsPanel = () => { + ); +}; + /** * */ -const PropertyBox = (props: PropertyBoxProps) => { - const { asset, path, type: node, title = true } = props; - const required = props.required ?? false; +export const PropertyBox = (props: PropertyBoxProps) => { + const { + asset, + path = [], + type: node, + title = true, + required = false, + } = props; let renderedComponent; + if (node.type === 'ref' && node.ref.includes('AssetWrapper')) { + console.log(`switch for ${path} is ${(asset as any)?.asset.value} `); + if ((asset as any)?.asset.value) { + renderedComponent = ( + + ); + } else { + renderedComponent = ( + + ); + } + } + if ( - (node.type === 'ref' && node.ref.includes('AssetWrapper')) || - (node.type === 'array' && - node.elementType.type === 'ref' && - node.elementType.ref.includes('AssetWrapper')) + node.type === 'array' && + node.elementType.type === 'ref' && + node.elementType.ref.includes('AssetWrapper') ) { return null; } @@ -169,17 +240,3 @@ const PropertyBox = (props: PropertyBoxProps) => {
); }; - -/** - * A top level panel for editing an Asset - */ -export const AssetEditorPanel = (props: AssetEditorPanelProps) => { - return ( - - ); -}; \ No newline at end of file diff --git a/drag-and-drop/app/pages/index.tsx b/drag-and-drop/app/pages/index.tsx index c1efcecd..2bccbca7 100644 --- a/drag-and-drop/app/pages/index.tsx +++ b/drag-and-drop/app/pages/index.tsx @@ -50,64 +50,14 @@ import pluginManifest from '@player-ui/reference-assets-plugin-react/dist/xlr/ma import typesManifest from '@player-ui/types/dist/xlr/manifest'; import Files from 'react-files'; -import { AssetEditorPanel } from '../components/AssetEditorPanel'; +import { PropertyBox } from '../components/AssetEditorPanel'; import { covertXLRtoAssetDoc } from '../utils/converters'; - -const PropertiesContext = React.createContext<{ - /** - * Current Asset thats selected in the edit panel on the right - */ - displayedAssetID?: symbol; - /** - * Sets `displayedAssetID` - */ - setDisplayedAssetID: (id: symbol) => void; - - /** - * Current XLR Type thats selected in the docs panel on the right - */ - displayedXLRDocType?: string; - /** - * Sets `displayedAssetID` - */ - setDisplayedXLRDocType: (id: string) => void; - - /** - * If the export modal is open - */ - exportOpen: boolean; - - /** Sets `exportOpen` */ - setExportOpen: (state: boolean) => void; - - /** If the right panel is docs or edit */ - rightPanelState: 'docs' | 'edit'; - - /** Sets `rightPanelState` */ - setRightPanelState: (state: 'docs' | 'edit') => void; -}>({ - setDisplayedAssetID: () => {}, - setExportOpen: () => {}, - setRightPanelState: () => {}, - exportOpen: false, - rightPanelState: 'edit', - setDisplayedXLRDocType: () => {}, -}); - -const ControllerContext = React.createContext< - | { - /** */ - controller: DragAndDropController; - } - | undefined ->(undefined); - -/** - * - */ -function useController() { - return React.useContext(ControllerContext); -} +import { + ControllerContext, + PropertiesContext, + useController, + useProperties, +} from '../utils/context'; /** * @@ -321,7 +271,7 @@ const AssetSelectorPanel = () => { */ const AssetDetailsPanel = () => { const { controller } = useController() ?? {}; - const propContext = React.useContext(PropertiesContext); + const propContext = useProperties(); const [sourceAssetID, setSourceAssetID] = React.useState( propContext.displayedAssetID ); @@ -364,7 +314,7 @@ const AssetDetailsPanel = () => { Properties for {localType.name} - { Resolve Required Properties - { /** Modal for showing the JSON version of the created flow */ const ContentExportModal = () => { - const context = React.useContext(PropertiesContext); + const context = useProperties(); const { controller } = useController() ?? {}; const content = JSON.stringify(controller.exportContent()); return ( diff --git a/drag-and-drop/app/utils/context.ts b/drag-and-drop/app/utils/context.ts new file mode 100644 index 00000000..abe7895e --- /dev/null +++ b/drag-and-drop/app/utils/context.ts @@ -0,0 +1,62 @@ +import React from 'react'; +import type { DragAndDropController } from '@player-tools/dnd-lib'; + +export const PropertiesContext = React.createContext<{ + /** + * Current Asset thats selected in the edit panel on the right + */ + displayedAssetID?: symbol; + /** + * Sets `displayedAssetID` + */ + setDisplayedAssetID: (id: symbol) => void; + + /** + * Current XLR Type thats selected in the docs panel on the right + */ + displayedXLRDocType?: string; + /** + * Sets `displayedAssetID` + */ + setDisplayedXLRDocType: (id: string) => void; + + /** + * If the export modal is open + */ + exportOpen: boolean; + + /** Sets `exportOpen` */ + setExportOpen: (state: boolean) => void; + + /** If the right panel is docs or edit */ + rightPanelState: 'docs' | 'edit'; + + /** Sets `rightPanelState` */ + setRightPanelState: (state: 'docs' | 'edit') => void; +}>({ + setDisplayedAssetID: () => {}, + setExportOpen: () => {}, + setRightPanelState: () => {}, + exportOpen: false, + rightPanelState: 'edit', + setDisplayedXLRDocType: () => {}, +}); + +export const ControllerContext = React.createContext< + | { + /** */ + controller: DragAndDropController; + } + | undefined +>(undefined); + +/** + * + */ +export function useController() { + return React.useContext(ControllerContext); +} + +export function useProperties() { + return React.useContext(PropertiesContext); +} From 922c2238b525b034d7ae54fe4eab833493738613 Mon Sep 17 00:00:00 2001 From: Adam Dierkens Date: Tue, 23 May 2023 14:41:54 -0700 Subject: [PATCH 51/52] Fix sidebar updates --- drag-and-drop/app/pages/index.tsx | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/drag-and-drop/app/pages/index.tsx b/drag-and-drop/app/pages/index.tsx index 2bccbca7..947ff854 100644 --- a/drag-and-drop/app/pages/index.tsx +++ b/drag-and-drop/app/pages/index.tsx @@ -291,10 +291,17 @@ const AssetDetailsPanel = () => { }, [propContext.displayedAssetID, sourceAssetID]); useEffect(() => { - const { asset: newAsset, type: newType } = - controller.getAsset(sourceAssetID); - setLocalAsset(newAsset); - setLocalType(newType); + const id = controller.stateUpdateSubscription.add(() => { + const { asset: newAsset, type: newType } = + controller.getAsset(sourceAssetID); + + setLocalAsset(newAsset); + setLocalType(newType); + }); + + return () => { + controller.stateUpdateSubscription.remove(id); + }; }, [sourceAssetID, controller]); if (!controller) { From a4bda887f9559e885e0fdb848d31ff22c974cd65 Mon Sep 17 00:00:00 2001 From: Ketan Reddy Date: Tue, 23 May 2023 15:55:50 -0700 Subject: [PATCH 52/52] Fix asset selecting not working --- .../app/components/AssetEditorPanel.tsx | 59 +++++++++++-------- drag-and-drop/app/pages/index.tsx | 8 ++- 2 files changed, 40 insertions(+), 27 deletions(-) diff --git a/drag-and-drop/app/components/AssetEditorPanel.tsx b/drag-and-drop/app/components/AssetEditorPanel.tsx index 2a40ccfc..1d549672 100644 --- a/drag-and-drop/app/components/AssetEditorPanel.tsx +++ b/drag-and-drop/app/components/AssetEditorPanel.tsx @@ -1,3 +1,4 @@ +/* eslint-disable react/no-array-index-key */ import React from 'react'; import { Box, @@ -15,6 +16,8 @@ import { Stack, Text, Select, + StackDivider, + VStack, } from '@chakra-ui/react'; import type { NodeType, ObjectType } from '@player-tools/xlr'; import type { Asset } from '@player-ui/types'; @@ -57,6 +60,9 @@ const ConstantPropertyBox = (props) => { return ; }; +/** + * + */ const AvailableAssetsDropDown = (props) => { const { controller } = useController(); const availableAssets = @@ -87,6 +93,9 @@ const AvailableAssetsDropDown = (props) => { ); }; +/** + * + */ const AssetLink = (props) => { const properties = useProperties(); @@ -117,7 +126,6 @@ export const PropertyBox = (props: PropertyBoxProps) => { let renderedComponent; if (node.type === 'ref' && node.ref.includes('AssetWrapper')) { - console.log(`switch for ${path} is ${(asset as any)?.asset.value} `); if ((asset as any)?.asset.value) { renderedComponent = ( { /> ); } - } - - if ( - node.type === 'array' && - node.elementType.type === 'ref' && - node.elementType.ref.includes('AssetWrapper') - ) { - return null; - } - - if ( + } else if ( (node.type === 'string' || node.type === 'number' || node.type === 'boolean') && @@ -160,6 +158,7 @@ export const PropertyBox = (props: PropertyBoxProps) => { { props.onUpdate(path, event.target.value); }} @@ -207,36 +206,44 @@ export const PropertyBox = (props: PropertyBoxProps) => { renderedComponent = ( - {filteredChildren} + } + > + {filteredChildren} + ); } else if (node.type === 'or') { renderedComponent = ( - + {node.or.map((element, index) => { return ( - + + {index !== 0 && or} + + ); })} - + ); } // Catch unimplemented form controls during development const parentProperty = path[path.length - 1]; return ( -
+ {title && {parentProperty}} {renderedComponent} -
+ ); }; diff --git a/drag-and-drop/app/pages/index.tsx b/drag-and-drop/app/pages/index.tsx index 947ff854..8e7c5328 100644 --- a/drag-and-drop/app/pages/index.tsx +++ b/drag-and-drop/app/pages/index.tsx @@ -287,8 +287,14 @@ const AssetDetailsPanel = () => { useEffect(() => { if (propContext.displayedAssetID !== sourceAssetID) { setSourceAssetID(propContext.displayedAssetID); + const { asset: newAsset, type: newType } = controller.getAsset( + propContext.displayedAssetID + ); + + setLocalAsset(newAsset); + setLocalType(newType); } - }, [propContext.displayedAssetID, sourceAssetID]); + }, [controller, propContext.displayedAssetID, sourceAssetID]); useEffect(() => { const id = controller.stateUpdateSubscription.add(() => {