Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 33 additions & 35 deletions assets/js/src/examples/custom-widgets/components/example-widget.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { Button, Content, Header, Select, Space, type SelectProps } from '@pimcore/studio-ui-bundle/components'
import { useWidgetManager } from '@pimcore/studio-ui-bundle/modules/widget-manager'
import { useWidgetManager, type WidgetManagerTabConfig } from '@pimcore/studio-ui-bundle/modules/widget-manager'
import React from 'react'

export const ExampleWidget = (): React.JSX.Element => {
const widgetManager = useWidgetManager()
const [selectedOption, setSelectedOption] = React.useState<SelectProps['value']>(undefined)
const [selectedWidget, setSelectedWidget] = React.useState<Record<string, any> | undefined>(undefined)
const [selectedWidget, setSelectedWidget] = React.useState<WidgetManagerTabConfig | undefined>(undefined)
const areButtonsDisabled = selectedWidget === undefined

const widgets = [
const widgets: WidgetManagerTabConfig[] = [
{
name: 'Example widget',
component: 'example-widget',
Expand Down Expand Up @@ -70,42 +70,40 @@ export const ExampleWidget = (): React.JSX.Element => {
value={ selectedOption }
/>

<Space
direction='vertical'
size='small'
>
<Button
disabled={ areButtonsDisabled }
/* @ts-expect-error - type WidgetManagerTabConfig missing */
onClick={ () => { widgetManager.openMainWidget(selectedWidget) } }
{ selectedWidget !== undefined && (
<Space
direction='vertical'
size='small'
>
Open main widget
</Button>
<Button
disabled={ areButtonsDisabled }
onClick={ () => { widgetManager.openMainWidget(selectedWidget) } }
>
Open main widget
</Button>

<Button
disabled={ areButtonsDisabled }
/* @ts-expect-error - type WidgetManagerTabConfig missing */
onClick={ () => { widgetManager.openLeftWidget(selectedWidget) } }
>
Open left widget
</Button>
<Button
disabled={ areButtonsDisabled }
onClick={ () => { widgetManager.openLeftWidget(selectedWidget) } }
>
Open left widget
</Button>

<Button
disabled={ areButtonsDisabled }
/* @ts-expect-error - type WidgetManagerTabConfig missing */
onClick={ () => { widgetManager.openRightWidget(selectedWidget) } }
>
Open right widget
</Button>
<Button
disabled={ areButtonsDisabled }
onClick={ () => { widgetManager.openRightWidget(selectedWidget) } }
>
Open right widget
</Button>

<Button
disabled={ areButtonsDisabled }
/* @ts-expect-error - type WidgetManagerTabConfig missing */
onClick={ () => { widgetManager.openBottomWidget(selectedWidget) } }
>
Open bottom widget
</Button>
</Space>
<Button
disabled={ areButtonsDisabled }
onClick={ () => { widgetManager.openBottomWidget(selectedWidget) } }
>
Open bottom widget
</Button>
</Space>
)}
</Content>
)
}

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"entrypoints": {
"main": {
"js": [
"http://localhost:3030/build/main.js"
]
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"build/main.js": "http://localhost:3030/build/main.js"
}
24 changes: 24 additions & 0 deletions public/build/6ac6d84a-dca0-4ef1-8993-79689e771762/entrypoints.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"entrypoints": {
"pimcore_studio_example_bundle": {
"js": [
"/bundles/pimcorestudioexample/build/6ac6d84a-dca0-4ef1-8993-79689e771762/static/js/async/__federation_expose_default_export.efa81aeb.js",
"/bundles/pimcorestudioexample/build/6ac6d84a-dca0-4ef1-8993-79689e771762/static/js/remoteEntry.js"
],
"css": []
},
"main": {
"js": [
"/bundles/pimcorestudioexample/build/6ac6d84a-dca0-4ef1-8993-79689e771762/static/js/643.faa3d456.js",
"/bundles/pimcorestudioexample/build/6ac6d84a-dca0-4ef1-8993-79689e771762/static/js/main.35b1baee.js"
],
"css": []
},
"exposeRemote": {
"js": [
"/bundles/pimcorestudioexample/build/6ac6d84a-dca0-4ef1-8993-79689e771762/exposeRemote.js"
],
"css": []
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

if (window.pluginRemotes === undefined) {
window.pluginRemotes = {}
}

window.pluginRemotes.pimcore_studio_example_bundle = "/bundles/pimcorestudioexample/build/6ac6d84a-dca0-4ef1-8993-79689e771762/static/js/remoteEntry.js"

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!doctype html><html><head><title>Rsbuild App</title><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><script defer src="/bundles/pimcorestudioexample/build/6ac6d84a-dca0-4ef1-8993-79689e771762/static/js/643.faa3d456.js"></script><script defer src="/bundles/pimcorestudioexample/build/6ac6d84a-dca0-4ef1-8993-79689e771762/static/js/main.35b1baee.js"></script></head><body><div id="root"></div></body></html>
36 changes: 36 additions & 0 deletions public/build/6ac6d84a-dca0-4ef1-8993-79689e771762/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"allFiles": [
"/bundles/pimcorestudioexample/build/6ac6d84a-dca0-4ef1-8993-79689e771762/static/js/async/__federation_expose_default_export.efa81aeb.js",
"/bundles/pimcorestudioexample/build/6ac6d84a-dca0-4ef1-8993-79689e771762/static/js/main.35b1baee.js",
"/bundles/pimcorestudioexample/build/6ac6d84a-dca0-4ef1-8993-79689e771762/static/js/remoteEntry.js",
"/bundles/pimcorestudioexample/build/6ac6d84a-dca0-4ef1-8993-79689e771762/static/js/643.faa3d456.js",
"/bundles/pimcorestudioexample/build/6ac6d84a-dca0-4ef1-8993-79689e771762/mf-stats.json",
"/bundles/pimcorestudioexample/build/6ac6d84a-dca0-4ef1-8993-79689e771762/mf-manifest.json",
"/bundles/pimcorestudioexample/build/6ac6d84a-dca0-4ef1-8993-79689e771762/main.html"
],
"entries": {
"pimcore_studio_example_bundle": {
"initial": {
"js": [
"/bundles/pimcorestudioexample/build/6ac6d84a-dca0-4ef1-8993-79689e771762/static/js/remoteEntry.js"
]
},
"async": {
"js": [
"/bundles/pimcorestudioexample/build/6ac6d84a-dca0-4ef1-8993-79689e771762/static/js/async/__federation_expose_default_export.efa81aeb.js"
]
}
},
"main": {
"html": [
"/bundles/pimcorestudioexample/build/6ac6d84a-dca0-4ef1-8993-79689e771762/main.html"
],
"initial": {
"js": [
"/bundles/pimcorestudioexample/build/6ac6d84a-dca0-4ef1-8993-79689e771762/static/js/643.faa3d456.js",
"/bundles/pimcorestudioexample/build/6ac6d84a-dca0-4ef1-8993-79689e771762/static/js/main.35b1baee.js"
]
}
}
}
}
Loading