@cratis/event-models 0.112.0 → 0.114.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +67 -0
- package/dist/Collections/suppliesBoardEditing.d.ts +2 -0
- package/dist/index.js +1347 -1347
- package/dist/index.js.map +1 -1
- package/dist/screen-editor/BlueprintPreview/blueprintPreviewCatalog.d.ts +57 -0
- package/dist/screen-editor/BlueprintPreview/initialPackageSelection.d.ts +18 -0
- package/dist/screen-editor/IconLibraries/Lucide/index.d.ts +4 -0
- package/dist/screen-editor/IconLibraries/Lucide/lucideAdapter.d.ts +2 -0
- package/dist/screen-editor/IconLibraries/Lucide/lucideCatalog.d.ts +2 -0
- package/dist/screen-editor/IconLibraries/Lucide/lucideManifest.d.ts +3 -0
- package/dist/screen-editor/IconLibraries/Lucide/lucidePackage.d.ts +2 -0
- package/dist/screen-editor/Icons/IconPickerCatalogState.d.ts +5 -0
- package/dist/screen-editor/Icons/IconPropertyField.d.ts +25 -0
- package/dist/screen-editor/Icons/IconPropertyFieldStrings.d.ts +8 -0
- package/dist/screen-editor/Icons/IconValueProblem.d.ts +7 -0
- package/dist/screen-editor/Icons/UseIconPickerCatalogResult.d.ts +7 -0
- package/dist/screen-editor/Icons/describeIconValueProblem.d.ts +3 -0
- package/dist/screen-editor/Icons/diagnoseIconValue.d.ts +5 -0
- package/dist/screen-editor/Icons/effectiveIconCatalogOf.d.ts +3 -0
- package/dist/screen-editor/Icons/iconCatalogSourcesOf.d.ts +3 -0
- package/dist/screen-editor/Icons/toIconPickerCatalog.d.ts +5 -0
- package/dist/screen-editor/Icons/useIconPickerCatalog.d.ts +4 -0
- package/dist/screen-editor/ScreenEditor/Actions/ActionModel.d.ts +7 -0
- package/dist/screen-editor/ScreenEditor/Actions/ActionPresentation.d.ts +5 -0
- package/dist/screen-editor/ScreenEditor/Actions/StateChangeSlice.d.ts +10 -0
- package/dist/screen-editor/ScreenEditor/Actions/actionBehavior.d.ts +8 -0
- package/dist/screen-editor/ScreenEditor/Actions/diagnoseAction.d.ts +14 -0
- package/dist/screen-editor/ScreenEditor/Binding/availableSourcesFor.d.ts +2 -0
- package/dist/screen-editor/ScreenEditor/Binding/bindingScopeTypes.d.ts +2 -0
- package/dist/screen-editor/ScreenEditor/Binding/previewState.d.ts +17 -0
- package/dist/screen-editor/ScreenEditor/Binding/queryBindingModel.d.ts +8 -0
- package/dist/screen-editor/ScreenEditor/Binding/settleBinding.d.ts +7 -0
- package/dist/screen-editor/ScreenEditor/Binding/toSceneCandidates.d.ts +22 -0
- package/dist/screen-editor/ScreenEditor/Collections/orderedItems.d.ts +11 -0
- package/dist/screen-editor/ScreenEditor/Defaults/defaultComponentIcons.d.ts +3 -0
- package/dist/screen-editor/ScreenEditor/Defaults/defaultLayoutIcons.d.ts +2 -0
- package/dist/screen-editor/ScreenEditor/Defaults/defaultLayoutLabels.d.ts +2 -0
- package/dist/screen-editor/ScreenEditor/Defaults/defaultPackageIcons.d.ts +6 -0
- package/dist/screen-editor/ScreenEditor/Defaults/defaultPaletteIcons.d.ts +2 -0
- package/dist/screen-editor/ScreenEditor/Defaults/defaultPaletteSources.d.ts +2 -0
- package/dist/screen-editor/ScreenEditor/Defaults/defaultScreenEditorStrings.d.ts +2 -0
- package/dist/screen-editor/ScreenEditor/Document/canvasMoveEdits.d.ts +4 -0
- package/dist/screen-editor/ScreenEditor/Document/createExternalComponent.d.ts +2 -0
- package/dist/screen-editor/ScreenEditor/Document/createPanel.d.ts +6 -0
- package/dist/screen-editor/ScreenEditor/Document/frameworkElement.d.ts +21 -0
- package/dist/screen-editor/ScreenEditor/Document/placeOnCanvas.d.ts +10 -0
- package/dist/screen-editor/ScreenEditor/Document/readSceneDocument.d.ts +15 -0
- package/dist/screen-editor/ScreenEditor/Document/studioScreen.d.ts +10 -0
- package/dist/screen-editor/ScreenEditor/DropRegions/DropRegion.d.ts +12 -0
- package/dist/screen-editor/ScreenEditor/DropRegions/DropRegionKind.d.ts +4 -0
- package/dist/screen-editor/ScreenEditor/DropRegions/InsertionAxis.d.ts +5 -0
- package/dist/screen-editor/ScreenEditor/DropRegions/computeDropRegions.d.ts +6 -0
- package/dist/screen-editor/ScreenEditor/Exposure/exposureEdits.d.ts +10 -0
- package/dist/screen-editor/ScreenEditor/Host/DefaultPaletteHost.d.ts +6 -0
- package/dist/screen-editor/ScreenEditor/Host/ScreenEditorBoundary.d.ts +8 -0
- package/dist/screen-editor/ScreenEditor/Host/ScreenEditorControlProviders.d.ts +7 -0
- package/dist/screen-editor/ScreenEditor/Host/ScreenEditorController.d.ts +44 -0
- package/dist/screen-editor/ScreenEditor/Host/ScreenEditorFileUpload.d.ts +5 -0
- package/dist/screen-editor/ScreenEditor/Host/ScreenEditorHost.d.ts +36 -0
- package/dist/screen-editor/ScreenEditor/Host/ScreenEditorOverlay.d.ts +24 -0
- package/dist/screen-editor/ScreenEditor/Host/ScreenEditorPrimeReactProvider.d.ts +3 -0
- package/dist/screen-editor/ScreenEditor/Host/ScreenEditorWindow.d.ts +28 -0
- package/dist/screen-editor/ScreenEditor/Host/ScreenEditorWorkspace.d.ts +21 -0
- package/dist/screen-editor/ScreenEditor/Host/UnreadableScreen.d.ts +8 -0
- package/dist/screen-editor/ScreenEditor/Host/WindowTitleBar.d.ts +5 -0
- package/dist/screen-editor/ScreenEditor/Host/createScreenEditorEnvironment.d.ts +16 -0
- package/dist/screen-editor/ScreenEditor/Host/mergeComponentDefaults.d.ts +3 -0
- package/dist/screen-editor/ScreenEditor/Host/nextElementId.d.ts +1 -0
- package/dist/screen-editor/ScreenEditor/Host/openSubject.d.ts +14 -0
- package/dist/screen-editor/ScreenEditor/Host/screenEditorPrimeReactDefaults.d.ts +2 -0
- package/dist/screen-editor/ScreenEditor/Host/useScreenEditor.d.ts +4 -0
- package/dist/screen-editor/ScreenEditor/Inspector/ActionEditor.d.ts +13 -0
- package/dist/screen-editor/ScreenEditor/Inspector/DiagnosticList.d.ts +6 -0
- package/dist/screen-editor/ScreenEditor/Inspector/ExposureSection.d.ts +11 -0
- package/dist/screen-editor/ScreenEditor/Inspector/IconProperties.d.ts +14 -0
- package/dist/screen-editor/ScreenEditor/Inspector/InspectorTab.d.ts +4 -0
- package/dist/screen-editor/ScreenEditor/Inspector/LayoutTypeSection.d.ts +10 -0
- package/dist/screen-editor/ScreenEditor/Inspector/OwnershipBadge.d.ts +6 -0
- package/dist/screen-editor/ScreenEditor/Inspector/PropertiesPanel.d.ts +17 -0
- package/dist/screen-editor/ScreenEditor/Inspector/QueryBindingEditor.d.ts +12 -0
- package/dist/screen-editor/ScreenEditor/Inspector/ScreenEditorStrings.d.ts +109 -0
- package/dist/screen-editor/ScreenEditor/Inspector/ScreenInspector.d.ts +13 -0
- package/dist/screen-editor/ScreenEditor/Inspector/StructureTree.d.ts +14 -0
- package/dist/screen-editor/ScreenEditor/Inspector/StructureTreeRow.d.ts +21 -0
- package/dist/screen-editor/ScreenEditor/Inspector/ViewportControls.d.ts +9 -0
- package/dist/screen-editor/ScreenEditor/Inspector/pointerDropZone.d.ts +2 -0
- package/dist/screen-editor/ScreenEditor/Layouts/LayoutCatalogEntry.d.ts +11 -0
- package/dist/screen-editor/ScreenEditor/Layouts/LayoutItem.d.ts +8 -0
- package/dist/screen-editor/ScreenEditor/Layouts/PanelConstruct.d.ts +7 -0
- package/dist/screen-editor/ScreenEditor/Layouts/layoutCatalog.d.ts +2 -0
- package/dist/screen-editor/ScreenEditor/Layouts/layoutChange.d.ts +13 -0
- package/dist/screen-editor/ScreenEditor/Layouts/toLayoutContainerDescriptors.d.ts +9 -0
- package/dist/screen-editor/ScreenEditor/Palette/PaletteEntry.d.ts +10 -0
- package/dist/screen-editor/ScreenEditor/Palette/PaletteFolders.d.ts +7 -0
- package/dist/screen-editor/ScreenEditor/Palette/buildPalette.d.ts +23 -0
- package/dist/screen-editor/ScreenEditor/Palette/insertedComponentName.d.ts +2 -0
- package/dist/screen-editor/ScreenEditor/Properties/allowedIconChoices.d.ts +3 -0
- package/dist/screen-editor/ScreenEditor/Properties/choiceKeys.d.ts +6 -0
- package/dist/screen-editor/ScreenEditor/Properties/iconDiagnostics.d.ts +7 -0
- package/dist/screen-editor/ScreenEditor/Properties/propertyEdits.d.ts +3 -0
- package/dist/screen-editor/ScreenEditor/Properties/toPropertyGroups.d.ts +9 -0
- package/dist/screen-editor/ScreenEditor/Properties/visibleProperties.d.ts +2 -0
- package/dist/screen-editor/ScreenEditor/PropertyEditors/Json/JsonDraftKind.d.ts +6 -0
- package/dist/screen-editor/ScreenEditor/PropertyEditors/Json/JsonDraftOutcome.d.ts +13 -0
- package/dist/screen-editor/ScreenEditor/PropertyEditors/Json/JsonDraftState.d.ts +4 -0
- package/dist/screen-editor/ScreenEditor/PropertyEditors/Json/JsonProblem.d.ts +5 -0
- package/dist/screen-editor/ScreenEditor/PropertyEditors/Json/JsonProblemKind.d.ts +6 -0
- package/dist/screen-editor/ScreenEditor/PropertyEditors/Json/JsonProperties.d.ts +9 -0
- package/dist/screen-editor/ScreenEditor/PropertyEditors/Json/JsonPropertyField.d.ts +13 -0
- package/dist/screen-editor/ScreenEditor/PropertyEditors/Json/JsonPropertyFieldStrings.d.ts +9 -0
- package/dist/screen-editor/ScreenEditor/PropertyEditors/Json/JsonReading.d.ts +8 -0
- package/dist/screen-editor/ScreenEditor/PropertyEditors/Json/defaultJsonPropertyFieldStrings.d.ts +2 -0
- package/dist/screen-editor/ScreenEditor/PropertyEditors/Json/describeJsonProblem.d.ts +3 -0
- package/dist/screen-editor/ScreenEditor/PropertyEditors/Json/formatJson.d.ts +1 -0
- package/dist/screen-editor/ScreenEditor/PropertyEditors/Json/isJsonValueType.d.ts +4 -0
- package/dist/screen-editor/ScreenEditor/PropertyEditors/Json/jsonDraft.d.ts +11 -0
- package/dist/screen-editor/ScreenEditor/PropertyEditors/Json/numberLiteralsOf.d.ts +1 -0
- package/dist/screen-editor/ScreenEditor/PropertyEditors/Json/readJson.d.ts +2 -0
- package/dist/screen-editor/ScreenEditor/PropertyEditors/Json/sameJson.d.ts +1 -0
- package/dist/screen-editor/ScreenEditor/PropertyEditors/Json/useJsonDraft.d.ts +9 -0
- package/dist/screen-editor/ScreenEditor/PrototypeProjection/LegacyExtras.d.ts +11 -0
- package/dist/screen-editor/ScreenEditor/PrototypeProjection/applyLegacyState.d.ts +3 -0
- package/dist/screen-editor/ScreenEditor/PrototypeProjection/layoutContainerItems.d.ts +4 -0
- package/dist/screen-editor/ScreenEditor/PrototypeProjection/legacyPlacement.d.ts +5 -0
- package/dist/screen-editor/ScreenEditor/PrototypeProjection/projectToLegacyElements.d.ts +3 -0
- package/dist/screen-editor/ScreenEditor/PrototypeProjection/sceneComponentName.d.ts +3 -0
- package/dist/screen-editor/ScreenEditor/PrototypeProjection/withoutNulls.d.ts +1 -0
- package/dist/screen-editor/ScreenEditor/Runtime/profileColorScheme.d.ts +2 -0
- package/dist/screen-editor/ScreenEditor/Runtime/profileTheme.d.ts +3 -0
- package/dist/screen-editor/ScreenEditor/Runtime/screenEditorRuntime.d.ts +17 -0
- package/dist/screen-editor/ScreenEditor/Runtime/screenEditorRuntimeForProfile.d.ts +4 -0
- package/dist/screen-editor/ScreenEditor/Runtime/serverPrototypeTypes.d.ts +3 -0
- package/dist/screen-editor/ScreenEditor/Runtime/useLoadedIconCatalog.d.ts +2 -0
- package/dist/screen-editor/ScreenEditor/Runtime/withActionPresentation.d.ts +2 -0
- package/dist/screen-editor/ScreenEditor/Runtime/withPlacementProperties.d.ts +3 -0
- package/dist/screen-editor/ScreenEditor/Runtime/withSampleContentProperties.d.ts +3 -0
- package/dist/screen-editor/ScreenEditor/Selection/panelLayoutItem.d.ts +3 -0
- package/dist/screen-editor/ScreenEditor/Selection/sceneStructureAdapter.d.ts +4 -0
- package/dist/screen-editor/ScreenEditor/Selection/sceneTree.d.ts +6 -0
- package/dist/screen-editor/ScreenEditor/Selection/surfaceArrangementOfRoot.d.ts +3 -0
- package/dist/screen-editor/ScreenEditor/Selection/surfaceLayoutOfRoot.d.ts +3 -0
- package/dist/screen-editor/ScreenEditor/Selection/toSceneEdits.d.ts +5 -0
- package/dist/screen-editor/ScreenEditor/Session/EditSession.d.ts +25 -0
- package/dist/screen-editor/ScreenEditor/Session/SessionCell.d.ts +8 -0
- package/dist/screen-editor/ScreenEditor/Structure/DropZone.d.ts +5 -0
- package/dist/screen-editor/ScreenEditor/Structure/MoveIntent.d.ts +6 -0
- package/dist/screen-editor/ScreenEditor/Structure/Ownership.d.ts +5 -0
- package/dist/screen-editor/ScreenEditor/Structure/OwnershipResolver.d.ts +2 -0
- package/dist/screen-editor/ScreenEditor/Structure/StructureEdit.d.ts +5 -0
- package/dist/screen-editor/ScreenEditor/Structure/StructureEditRejection.d.ts +9 -0
- package/dist/screen-editor/ScreenEditor/Structure/StructureLocation.d.ts +6 -0
- package/dist/screen-editor/ScreenEditor/Structure/StructureOperation.d.ts +9 -0
- package/dist/screen-editor/ScreenEditor/Structure/StructureRow.d.ts +8 -0
- package/dist/screen-editor/ScreenEditor/Structure/StructureTreeAdapter.d.ts +11 -0
- package/dist/screen-editor/ScreenEditor/Structure/findStructureNode.d.ts +4 -0
- package/dist/screen-editor/ScreenEditor/Structure/flattenStructure.d.ts +3 -0
- package/dist/screen-editor/ScreenEditor/Structure/isDeleteKey.d.ts +15 -0
- package/dist/screen-editor/ScreenEditor/Structure/isOperationPermitted.d.ts +3 -0
- package/dist/screen-editor/ScreenEditor/Structure/removal.d.ts +3 -0
- package/dist/screen-editor/ScreenEditor/Structure/resolveMoveIntentEdit.d.ts +4 -0
- package/dist/screen-editor/ScreenEditor/Structure/resolveTreeDrop.d.ts +4 -0
- package/dist/screen-editor/ScreenEditor/Structure/surfaceMoveEdit.d.ts +3 -0
- package/dist/screen-editor/ScreenEditor/Structure/validateStructureEdit.d.ts +4 -0
- package/dist/screen-editor/ScreenEditor/Surface/DesignTime/DesignTimeComponent.d.ts +4 -0
- package/dist/screen-editor/ScreenEditor/Surface/DesignTime/DesignTimePlaceholder.d.ts +7 -0
- package/dist/screen-editor/ScreenEditor/Surface/DesignTime/DesignTimePlaceholderTone.d.ts +5 -0
- package/dist/screen-editor/ScreenEditor/Surface/DesignTime/OverlayPreview.d.ts +12 -0
- package/dist/screen-editor/ScreenEditor/Surface/DesignTime/SurfaceStrings.d.ts +12 -0
- package/dist/screen-editor/ScreenEditor/Surface/DesignTime/designTimeRegistry.d.ts +3 -0
- package/dist/screen-editor/ScreenEditor/Surface/DesignTime/designTimeSamples.d.ts +7 -0
- package/dist/screen-editor/ScreenEditor/Surface/DesignTime/overlayKinds.d.ts +8 -0
- package/dist/screen-editor/ScreenEditor/Surface/DesignTime/useRendersVisibleContent.d.ts +3 -0
- package/dist/screen-editor/ScreenEditor/Surface/DropIndicator.d.ts +6 -0
- package/dist/screen-editor/ScreenEditor/Surface/ScreenSurface.d.ts +14 -0
- package/dist/screen-editor/ScreenEditor/Surface/dragPayload.d.ts +12 -0
- package/dist/screen-editor/ScreenEditor/Surface/dropRegionRects.d.ts +13 -0
- package/dist/screen-editor/ScreenEditor/Surface/elementRect.d.ts +2 -0
- package/dist/screen-editor/ScreenEditor/Surface/resolveDropTarget.d.ts +6 -0
- package/dist/screen-editor/ScreenEditor/Surface/sameMeasurement.d.ts +5 -0
- package/dist/screen-editor/ScreenEditor/Surface/useSurfaceDrop.d.ts +22 -0
- package/dist/screen-editor/ScreenEditor/Surface/useSurfaceMeasurement.d.ts +9 -0
- package/dist/screen-editor/ScreenEditor/Templates/composeEditorScreen.d.ts +8 -0
- package/dist/screen-editor/ScreenEditor/Templates/templateProvenance.d.ts +6 -0
- package/dist/screen-editor/ScreenEditor/Viewport/ViewportPreset.d.ts +4 -0
- package/dist/screen-editor/ScreenEditor/Viewport/ViewportSize.d.ts +4 -0
- package/dist/screen-editor/ScreenEditor/Viewport/detectViewportPreset.d.ts +3 -0
- package/dist/screen-editor/ScreenEditor/Viewport/resolveViewportSizeClass.d.ts +3 -0
- package/dist/screen-editor/ScreenEditor/Viewport/toWindowSize.d.ts +3 -0
- package/dist/screen-editor/ScreenEditor/Viewport/viewportPresets.d.ts +4 -0
- package/dist/screen-editor/ScreenEditor/index.d.ts +32 -0
- package/dist/screen-editor/UiProfile/PackageInclusion.d.ts +9 -0
- package/dist/screen-editor/UiProfile/PersistedUiProfile.d.ts +19 -0
- package/dist/screen-editor/UiProfile/ResolvedPackageEntry.d.ts +19 -0
- package/dist/screen-editor/UiProfile/ResolvedUiProfile.d.ts +20 -0
- package/dist/screen-editor/UiProfile/UiProfileSettings.d.ts +29 -0
- package/dist/screen-editor/UiProfile/defaultUiProfileSettings.d.ts +13 -0
- package/dist/screen-editor/UiProfile/explicitPackageNames.d.ts +10 -0
- package/dist/screen-editor/UiProfile/formatMessage.d.ts +11 -0
- package/dist/screen-editor/UiProfile/resolveUiProfile.d.ts +18 -0
- package/dist/screen-editor/UiProfile/shellLayoutOf.d.ts +10 -0
- package/dist/screen-editor/UiProfile/toSceneUiProfile.d.ts +12 -0
- package/dist/screen-editor/UiProfileDesigner/filterCompatibleThemes.d.ts +12 -0
- package/dist/screen-editor/UiProfileDesigner/findComponentCollisions.d.ts +15 -0
- package/dist/screen-editor/catalog-CZx3FR-E.js +4 -0
- package/dist/screen-editor/index.js +4705 -0
- package/dist/screen-editor/screen-editor.css +2 -0
- package/package.json +105 -13
|
@@ -0,0 +1,4705 @@
|
|
|
1
|
+
import { createElement as Ve, useCallback as z, useEffect as Ne, useId as Gr, useLayoutEffect as We, useMemo as _, useRef as H, useState as M } from "react";
|
|
2
|
+
import { LayoutArrangement as L, PrototypeOverlayFrame as Mn } from "@cratis/scene/ScreenEditor";
|
|
3
|
+
import { CollectionOperation as te, DiagnosticCode as ee, DiagnosticSeverity as Hr, EditTarget as Kr, EditingScopeKind as vt, FlowContainerKind as et, GridUnitType as Jr, HorizontalAlignment as Lt, Orientation as we, PackageKind as qe, PropertyValueType as A, ProvenanceKind as Zt, QueryOriginKind as Qr, QueryResultShape as Yr, SceneEditKind as U, SceneNodeKind as Zr, VerticalAlignment as Mt, Visibility as Et, isIconReference as Xr, parseIconReference as eo } from "@cratis/scene.model";
|
|
4
|
+
import { EffectiveIconCatalog as to, applyEdit as En, baseComponentLibraries as no, computeSizeClass as ro, corePackage as At, createDescriptorCatalog as oo, elementNodeId as Q, findLayoutTypeDescriptor as Xt, inspect as An, isCanvas as ce, isDockPanel as io, isExternalComponent as Ge, isGrid as $t, isPackageSelectionValid as ao, isPanel as Re, isStackPanel as _t, isThemeCompatible as so, isWrapPanel as lo, packagesOfKind as en, resolveComponentName as Bt, resolveIconLibraries as co, resolvePackageDependencies as uo, resolveTemplateChain as po, toComponentCatalog as zt, validateBinding as mo } from "@cratis/scene.engine";
|
|
5
|
+
import { Fragment as Ie, jsx as s, jsxs as b } from "react/jsx-runtime";
|
|
6
|
+
import { ErrorBoundary as $n, IconButton as Pe, Tabs as fo, TextArea as ho } from "@cratis/components/Common";
|
|
7
|
+
import { OrderedItemEditor as go, PropertyControls as vo } from "@cratis/components/ConfigurationEditor";
|
|
8
|
+
import { IconPicker as yo, isIconPickerAllowed as bo, isSameIconPickerValue as wo } from "@cratis/components/IconPicker";
|
|
9
|
+
import { IconAdapterProvider as Co, SceneElementView as So, SceneIcon as ko, SceneThemeProvider as Io, componentRegistryKey as _n, corePackage as Bn, mergeIconAdapters as Po, mergePackageRegistries as zn } from "@cratis/scene.react";
|
|
10
|
+
import { Toolbar as To, ToolbarFolder as Ro } from "@cratis/components/Toolbar";
|
|
11
|
+
import { PrototypeLayout as pe } from "@cratis/scene";
|
|
12
|
+
import { FileUploadHandlerProvider as xo, QuillLoaderProvider as No, primeReactPackage as Un, primeReactThemes as tn, usePrimeReactTheme as Fo } from "@cratis/scene.primereact";
|
|
13
|
+
import { FaAlignJustify as nn, FaAlignLeft as Do, FaAngleDoubleRight as tt, FaArrowsAltH as Oo, FaBars as be, FaBell as Lo, FaBolt as Mo, FaBookmark as Eo, FaBorderAll as Ao, FaCalendarAlt as rn, FaCaretSquareDown as on, FaChartBar as jn, FaCheckSquare as an, FaClock as $o, FaClone as _o, FaCode as Bo, FaCog as sn, FaColumns as nt, FaCommentAlt as zo, FaCommentDots as Vn, FaCompass as Uo, FaCreditCard as jo, FaCube as Vo, FaDatabase as Wo, FaDesktop as yt, FaEdit as rt, FaEllipsisH as qo, FaExclamationCircle as ot, FaExpandArrowsAlt as Go, FaFileAlt as bt, FaFileUpload as Ho, FaFilter as ln, FaFolderOpen as cn, FaFont as dn, FaGripLines as ae, FaGripLinesVertical as Ko, FaGripVertical as Jo, FaHashtag as un, FaHeading as Be, FaHistory as Qo, FaHourglassHalf as Yo, FaIdBadge as Zo, FaImage as Wn, FaImages as pn, FaInfoCircle as Xo, FaKeyboard as qn, FaLayerGroup as ei, FaLink as ti, FaList as Gn, FaListAlt as it, FaListOl as at, FaLock as ni, FaMask as mn, FaMobileAlt as ri, FaMousePointer as ze, FaObjectGroup as oi, FaPaintBrush as ii, FaPalette as st, FaPen as ai, FaPercent as si, FaProjectDiagram as li, FaPuzzlePiece as Hn, FaRedo as ci, FaRegCheckCircle as di, FaRegCircle as lt, FaRegSquare as Ut, FaSearch as fn, FaShapes as Kn, FaSitemap as ct, FaSlidersH as wt, FaSpinner as hn, FaSquare as ui, FaStar as pi, FaStepForward as dt, FaStickyNote as mi, FaStream as fi, FaTable as Te, FaTag as Le, FaTerminal as hi, FaTh as gn, FaThLarge as Jn, FaThList as jt, FaToggleOn as Qn, FaTools as gi, FaTrash as vi, FaTree as Ct, FaUndo as yi, FaUser as bi, FaUserCircle as wi, FaVectorSquare as Ci, FaWindowMaximize as Ue, FaWindowRestore as Si } from "react-icons/fa";
|
|
14
|
+
import "@cratis/scene.primereact/primeReactTheme.css";
|
|
15
|
+
import { ColorScheme as ki, LayoutMode as Ii, defaultBlueprint as Yn, resolveElementComponentNames as Pi } from "@cratis/scene.blueprint.default";
|
|
16
|
+
import { PrimeReactProvider as Ti } from "@primereact/core/config";
|
|
17
|
+
import { styles as Ri } from "@primereact/styles/accordion";
|
|
18
|
+
import { styles as xi } from "@primereact/styles/autocomplete";
|
|
19
|
+
import { styles as Ni } from "@primereact/styles/avatar";
|
|
20
|
+
import { styles as Fi } from "@primereact/styles/avatargroup";
|
|
21
|
+
import { styles as Di } from "@primereact/styles/badge";
|
|
22
|
+
import { styles as Oi } from "@primereact/styles/breadcrumb";
|
|
23
|
+
import { styles as Li } from "@primereact/styles/button";
|
|
24
|
+
import { styles as Mi } from "@primereact/styles/buttongroup";
|
|
25
|
+
import { styles as Ei } from "@primereact/styles/card";
|
|
26
|
+
import { styles as Ai } from "@primereact/styles/carousel";
|
|
27
|
+
import { styles as $i } from "@primereact/styles/checkbox";
|
|
28
|
+
import { styles as _i } from "@primereact/styles/checkboxgroup";
|
|
29
|
+
import { styles as Bi } from "@primereact/styles/chip";
|
|
30
|
+
import { styles as zi } from "@primereact/styles/compare";
|
|
31
|
+
import { styles as Ui } from "@primereact/styles/contextmenu";
|
|
32
|
+
import { styles as ji } from "@primereact/styles/datatable";
|
|
33
|
+
import { styles as Vi } from "@primereact/styles/dataview";
|
|
34
|
+
import { styles as Wi } from "@primereact/styles/datepicker";
|
|
35
|
+
import { styles as qi } from "@primereact/styles/dialog";
|
|
36
|
+
import { styles as Gi } from "@primereact/styles/divider";
|
|
37
|
+
import { styles as Hi } from "@primereact/styles/drawer";
|
|
38
|
+
import { styles as Ki } from "@primereact/styles/fieldset";
|
|
39
|
+
import { styles as Ji } from "@primereact/styles/fileupload";
|
|
40
|
+
import { styles as Qi } from "@primereact/styles/floatlabel";
|
|
41
|
+
import { styles as Yi } from "@primereact/styles/fluid";
|
|
42
|
+
import { styles as Zi } from "@primereact/styles/gallery";
|
|
43
|
+
import { styles as Xi } from "@primereact/styles/iconfield";
|
|
44
|
+
import { styles as ea } from "@primereact/styles/iftalabel";
|
|
45
|
+
import { styles as ta } from "@primereact/styles/inplace";
|
|
46
|
+
import { styles as na } from "@primereact/styles/inputcolor";
|
|
47
|
+
import { styles as ra } from "@primereact/styles/inputgroup";
|
|
48
|
+
import { styles as oa } from "@primereact/styles/inputnumber";
|
|
49
|
+
import { styles as ia } from "@primereact/styles/inputotp";
|
|
50
|
+
import { styles as aa } from "@primereact/styles/inputtags";
|
|
51
|
+
import { styles as sa } from "@primereact/styles/inputtext";
|
|
52
|
+
import { styles as la } from "@primereact/styles/knob";
|
|
53
|
+
import { styles as ca } from "@primereact/styles/label";
|
|
54
|
+
import { styles as da } from "@primereact/styles/listbox";
|
|
55
|
+
import { styles as ua } from "@primereact/styles/menu";
|
|
56
|
+
import { styles as pa } from "@primereact/styles/message";
|
|
57
|
+
import { styles as ma } from "@primereact/styles/metergroup";
|
|
58
|
+
import { styles as fa } from "@primereact/styles/navigationmenu";
|
|
59
|
+
import { styles as ha } from "@primereact/styles/organizationchart";
|
|
60
|
+
import { styles as ga } from "@primereact/styles/overlaybadge";
|
|
61
|
+
import { styles as va } from "@primereact/styles/paginator";
|
|
62
|
+
import { styles as ya } from "@primereact/styles/panel";
|
|
63
|
+
import { styles as ba } from "@primereact/styles/inputpassword";
|
|
64
|
+
import { styles as wa } from "@primereact/styles/popover";
|
|
65
|
+
import { styles as Ca } from "@primereact/styles/progressbar";
|
|
66
|
+
import { styles as Sa } from "@primereact/styles/progressspinner";
|
|
67
|
+
import { styles as ka } from "@primereact/styles/radiobutton";
|
|
68
|
+
import { styles as Ia } from "@primereact/styles/radiobuttongroup";
|
|
69
|
+
import { styles as Pa } from "@primereact/styles/rating";
|
|
70
|
+
import { styles as Ta } from "@primereact/styles/scrollarea";
|
|
71
|
+
import { styles as Ra } from "@primereact/styles/select";
|
|
72
|
+
import { layoutStyles as xa, styles as Na } from "@primereact/styles/sidebar";
|
|
73
|
+
import { styles as Fa } from "@primereact/styles/skeleton";
|
|
74
|
+
import { styles as Da } from "@primereact/styles/slider";
|
|
75
|
+
import { styles as Oa } from "@primereact/styles/speeddial";
|
|
76
|
+
import { styles as La } from "@primereact/styles/splitter";
|
|
77
|
+
import { styles as Ma } from "@primereact/styles/stepper";
|
|
78
|
+
import { styles as Ea } from "@primereact/styles/tabs";
|
|
79
|
+
import { styles as Aa } from "@primereact/styles/tag";
|
|
80
|
+
import { styles as $a } from "@primereact/styles/terminal";
|
|
81
|
+
import { styles as _a } from "@primereact/styles/textarea";
|
|
82
|
+
import { styles as Ba } from "@primereact/styles/timeline";
|
|
83
|
+
import { styles as za } from "@primereact/styles/toast";
|
|
84
|
+
import { styles as Ua } from "@primereact/styles/toaster";
|
|
85
|
+
import { styles as ja } from "@primereact/styles/togglebutton";
|
|
86
|
+
import { styles as Va } from "@primereact/styles/togglebuttongroup";
|
|
87
|
+
import { styles as Wa } from "@primereact/styles/toggleswitch";
|
|
88
|
+
import { styles as qa } from "@primereact/styles/toolbar";
|
|
89
|
+
import { styles as Ga } from "@primereact/styles/tooltip";
|
|
90
|
+
import { styles as Ha } from "@primereact/styles/tree";
|
|
91
|
+
import { loadQuill as Ka } from "@cratis/scene.primereact/quill";
|
|
92
|
+
import { cratisComponentsPackage as Zn } from "@cratis/scene.components";
|
|
93
|
+
import { tailwindPackage as Xn } from "@cratis/scene.tailwind";
|
|
94
|
+
import { componentsBlueprint as er } from "@cratis/scene.blueprint.components";
|
|
95
|
+
import { dynamicIconImports as Ja } from "lucide-react/dynamic";
|
|
96
|
+
var Vt = {
|
|
97
|
+
name: "StudioScreen",
|
|
98
|
+
slots: [{ name: "content" }]
|
|
99
|
+
}, He = "content", Ye = "Screen", Qa = "template-root", Ya = "screen-root", tr = () => ({
|
|
100
|
+
layouts: [Vt],
|
|
101
|
+
screenTemplates: [],
|
|
102
|
+
dialogTemplates: [],
|
|
103
|
+
screens: [],
|
|
104
|
+
exposures: [],
|
|
105
|
+
instanceContributions: []
|
|
106
|
+
});
|
|
107
|
+
function Za(e, t) {
|
|
108
|
+
return {
|
|
109
|
+
...tr(),
|
|
110
|
+
screens: [{
|
|
111
|
+
name: Ye,
|
|
112
|
+
layout: Vt.name,
|
|
113
|
+
slotContent: { [He]: [e] },
|
|
114
|
+
forms: [],
|
|
115
|
+
contributions: [],
|
|
116
|
+
...t ? { screenTemplate: t } : {}
|
|
117
|
+
}]
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
function Xa(e, t, n) {
|
|
121
|
+
return {
|
|
122
|
+
...tr(),
|
|
123
|
+
screenTemplates: [{
|
|
124
|
+
name: e,
|
|
125
|
+
slots: [{ name: He }],
|
|
126
|
+
content: { [He]: [t] },
|
|
127
|
+
...n ? { fitsSlot: n } : {}
|
|
128
|
+
}]
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
function Ke(e, t) {
|
|
132
|
+
return (t === void 0 ? e.screens.find((n) => n.name === Ye)?.slotContent : e.screenTemplates.find((n) => n.name === t)?.content)?.[He]?.[0];
|
|
133
|
+
}
|
|
134
|
+
function St(e, t = !1) {
|
|
135
|
+
return t && e !== void 0 ? {
|
|
136
|
+
kind: vt.ScreenTemplate,
|
|
137
|
+
name: e,
|
|
138
|
+
layout: Vt.name
|
|
139
|
+
} : {
|
|
140
|
+
kind: vt.Screen,
|
|
141
|
+
name: Ye
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
var ut = (e, t) => typeof t == "string" ? Object.values(e).find((n) => n === t) : void 0, es = (e) => {
|
|
145
|
+
const t = e;
|
|
146
|
+
return !!t && typeof t == "object" && [
|
|
147
|
+
"left",
|
|
148
|
+
"top",
|
|
149
|
+
"right",
|
|
150
|
+
"bottom"
|
|
151
|
+
].every((n) => typeof t[n] == "number");
|
|
152
|
+
};
|
|
153
|
+
function ts(e, t, n) {
|
|
154
|
+
const r = e;
|
|
155
|
+
r.zIndex = n;
|
|
156
|
+
const o = ut(Et, t.visibility);
|
|
157
|
+
o !== void 0 && (r.visibility = o), typeof t.isEnabled == "boolean" && (r.isEnabled = t.isEnabled), typeof t.opacity == "number" && (r.opacity = t.opacity), es(t.margin) && (r.margin = { ...t.margin });
|
|
158
|
+
const i = ut(Lt, t.horizontalAlignment);
|
|
159
|
+
i !== void 0 && (r.horizontalAlignment = i);
|
|
160
|
+
const a = ut(Mt, t.verticalAlignment);
|
|
161
|
+
a !== void 0 && (r.verticalAlignment = a);
|
|
162
|
+
}
|
|
163
|
+
var kt = {
|
|
164
|
+
visibility: Et.Visible,
|
|
165
|
+
isEnabled: !0,
|
|
166
|
+
opacity: 1,
|
|
167
|
+
margin: {
|
|
168
|
+
left: 0,
|
|
169
|
+
top: 0,
|
|
170
|
+
right: 0,
|
|
171
|
+
bottom: 0
|
|
172
|
+
},
|
|
173
|
+
horizontalAlignment: Lt.Stretch,
|
|
174
|
+
verticalAlignment: Mt.Stretch
|
|
175
|
+
};
|
|
176
|
+
function ns(e) {
|
|
177
|
+
const t = {
|
|
178
|
+
...kt,
|
|
179
|
+
margin: { ...kt.margin }
|
|
180
|
+
};
|
|
181
|
+
return ts(t, e, 0), delete t.zIndex, t;
|
|
182
|
+
}
|
|
183
|
+
var rs = Object.keys(kt), S = /* @__PURE__ */ (function(e) {
|
|
184
|
+
return e.Stack = "stack", e.Row = "row", e.Grid = "grid", e.Container = "container", e.Wrap = "wrap", e.Canvas = "canvas", e;
|
|
185
|
+
})({}), os = "StudioLayout", is = {
|
|
186
|
+
Stack: S.Stack,
|
|
187
|
+
Row: S.Row,
|
|
188
|
+
Grid: S.Grid,
|
|
189
|
+
Container: S.Container,
|
|
190
|
+
Wrap: S.Wrap,
|
|
191
|
+
Canvas: S.Canvas
|
|
192
|
+
};
|
|
193
|
+
function as(e) {
|
|
194
|
+
const t = Object.entries(is).find(([, n]) => n === e)?.[0] ?? "Container";
|
|
195
|
+
return `${os}.${t}`;
|
|
196
|
+
}
|
|
197
|
+
var de = "Canvas.Left", ue = "Canvas.Top", vn = "legacyType", ss = "legacy", yn = "legacyExtras", ls = {
|
|
198
|
+
DatePicker: "calendar",
|
|
199
|
+
OrgChart: "organizationChart",
|
|
200
|
+
Chips: "chips",
|
|
201
|
+
ToggleButton: "toggleSwitch"
|
|
202
|
+
}, cs = Object.fromEntries(Object.entries(ls).map(([e, t]) => [t, e]));
|
|
203
|
+
function nr(e) {
|
|
204
|
+
const t = e.includes(":") ? e.slice(e.lastIndexOf(":") + 1) : e;
|
|
205
|
+
return cs[t] ?? t.charAt(0).toUpperCase() + t.slice(1);
|
|
206
|
+
}
|
|
207
|
+
function It(e) {
|
|
208
|
+
return Array.isArray(e) ? e.filter((t) => t !== null).map(It) : e !== null && typeof e == "object" ? Object.fromEntries(Object.entries(e).filter(([, t]) => t !== null).map(([t, n]) => [t, It(n)])) : e;
|
|
209
|
+
}
|
|
210
|
+
function Se(e) {
|
|
211
|
+
return Re(e) ? e.children : Ge(e) ? Object.values(e.slots).flat() : [];
|
|
212
|
+
}
|
|
213
|
+
function rr(e) {
|
|
214
|
+
return e.flatMap((t) => [t.id, ...rr(Se(t))]);
|
|
215
|
+
}
|
|
216
|
+
function Ce(e, t) {
|
|
217
|
+
for (const n of e) {
|
|
218
|
+
if (n.id === t) return n;
|
|
219
|
+
const r = Ce(Se(n), t);
|
|
220
|
+
if (r) return r;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
function Ze(e, t) {
|
|
224
|
+
for (const n of e) {
|
|
225
|
+
if (Se(n).some((o) => o.id === t)) return n;
|
|
226
|
+
const r = Ze(Se(n), t);
|
|
227
|
+
if (r) return r;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
function ds(e, t) {
|
|
231
|
+
const n = Ze(e, t);
|
|
232
|
+
return n !== void 0 && ce(n);
|
|
233
|
+
}
|
|
234
|
+
function or(e) {
|
|
235
|
+
if (ce(e)) return S.Canvas;
|
|
236
|
+
if ($t(e)) return S.Grid;
|
|
237
|
+
if (!io(e))
|
|
238
|
+
return _t(e) ? e.orientation === we.Horizontal ? S.Row : S.Stack : lo(e) ? S.Wrap : S.Container;
|
|
239
|
+
}
|
|
240
|
+
function Pt(e, t = () => {
|
|
241
|
+
}) {
|
|
242
|
+
return It((e?.children ?? []).map((n) => ir(n, t)));
|
|
243
|
+
}
|
|
244
|
+
var K = (e, t) => typeof e == "number" ? e : t;
|
|
245
|
+
function ir(e, t) {
|
|
246
|
+
const n = e, r = { ...n.properties ?? {} }, o = Se(e).map((E) => ir(E, t)), i = r[ss];
|
|
247
|
+
if (i != null && typeof i == "object") return ps(i, n, r, o);
|
|
248
|
+
const a = r[yn], c = typeof r.legacyType == "string" && r.legacyType !== "" ? r[vn] : void 0, d = c ?? (Re(e) ? as(or(e)) : t(Ge(e) ? e.componentName : "")), u = Ge(e) ? e.componentName : "", { [vn]: l, [yn]: p, [de]: w, [ue]: g, ...k } = r, x = {};
|
|
249
|
+
for (const E of a?.topKeys ?? []) E in k && (x[E] = k[E], delete k[E]);
|
|
250
|
+
const C = K(w, a?.position.x ?? 0), I = K(g, a?.position.y ?? 0), F = n.name ?? "", N = a?.emptyName === !0 && F === (c ?? "");
|
|
251
|
+
return {
|
|
252
|
+
...us(n, a),
|
|
253
|
+
...x,
|
|
254
|
+
_derivedTypeId: d ?? "externalComponent",
|
|
255
|
+
id: n.id,
|
|
256
|
+
...N ? {} : { name: F },
|
|
257
|
+
componentName: d ? d.slice(d.lastIndexOf(".") + 1) : nr(u),
|
|
258
|
+
properties: {
|
|
259
|
+
...k,
|
|
260
|
+
canvas: {
|
|
261
|
+
...a?.canvas ?? {},
|
|
262
|
+
x: C,
|
|
263
|
+
y: I
|
|
264
|
+
}
|
|
265
|
+
},
|
|
266
|
+
slots: {
|
|
267
|
+
...a?.slots ?? {},
|
|
268
|
+
...o.length > 0 ? { children: o } : {}
|
|
269
|
+
},
|
|
270
|
+
width: n.size?.width,
|
|
271
|
+
height: n.size?.height,
|
|
272
|
+
ZIndex: n.zIndex ?? 0
|
|
273
|
+
};
|
|
274
|
+
}
|
|
275
|
+
function us(e, t) {
|
|
276
|
+
const n = t?.top ?? {}, r = ns(n), o = e, i = { ...n };
|
|
277
|
+
for (const a of rs) JSON.stringify(o[a]) !== JSON.stringify(r[a]) && (i[a] = o[a]);
|
|
278
|
+
return i;
|
|
279
|
+
}
|
|
280
|
+
function ps(e, t, n, r) {
|
|
281
|
+
const o = { ...e }, i = e.properties ?? {}, a = i.canvas ?? {}, c = n[de], d = n[ue];
|
|
282
|
+
(typeof c == "number" || typeof d == "number") && (e.position && typeof e.position == "object" ? o.position = {
|
|
283
|
+
...e.position,
|
|
284
|
+
x: K(c, K(a.x, 0)),
|
|
285
|
+
y: K(d, K(a.y, 0))
|
|
286
|
+
} : o.properties = {
|
|
287
|
+
...i,
|
|
288
|
+
canvas: {
|
|
289
|
+
...a,
|
|
290
|
+
x: K(c, K(a.x, 0)),
|
|
291
|
+
y: K(d, K(a.y, 0))
|
|
292
|
+
}
|
|
293
|
+
}), t.size?.width !== void 0 && (o.width = t.size.width), t.size?.height !== void 0 && (o.height = t.size.height), t.name !== void 0 && t.name !== "" && t.name !== e.componentName && t.name !== e._derivedTypeId && (o.name = t.name), t.zIndex !== void 0 && "ZIndex" in e && (o.ZIndex = t.zIndex);
|
|
294
|
+
const u = e.slots ?? {};
|
|
295
|
+
return (r.length > 0 || "children" in u) && (o.slots = {
|
|
296
|
+
...u,
|
|
297
|
+
children: r
|
|
298
|
+
}), o;
|
|
299
|
+
}
|
|
300
|
+
var ms = [
|
|
301
|
+
"input",
|
|
302
|
+
"textarea",
|
|
303
|
+
"select",
|
|
304
|
+
'[contenteditable=""]',
|
|
305
|
+
'[contenteditable="true"]',
|
|
306
|
+
'[contenteditable="plaintext-only"]',
|
|
307
|
+
'[role="textbox"]',
|
|
308
|
+
'[role="combobox"]',
|
|
309
|
+
'[role="searchbox"]',
|
|
310
|
+
'[role="spinbutton"]',
|
|
311
|
+
'[role="listbox"]',
|
|
312
|
+
'[role="slider"]',
|
|
313
|
+
".ql-editor",
|
|
314
|
+
".cm-editor",
|
|
315
|
+
".monaco-editor",
|
|
316
|
+
"[data-studio-typing]"
|
|
317
|
+
].join(","), ar = (e) => {
|
|
318
|
+
const t = e;
|
|
319
|
+
return !!t && typeof t.closest == "function" && (t.closest(ms) !== null || t.isContentEditable === !0);
|
|
320
|
+
}, sr = (e) => (e.key === "Delete" || e.key === "Backspace") && !e.ctrlKey && !e.metaKey && !e.altKey && !e.shiftKey && !e.defaultPrevented && !e.repeat && !e.nativeEvent?.isComposing && !ar(e.target);
|
|
321
|
+
function Z(e, t, n, r = null) {
|
|
322
|
+
for (const [o, i] of e.entries()) {
|
|
323
|
+
if (n.idOf(i) === t) return {
|
|
324
|
+
node: i,
|
|
325
|
+
parent: r,
|
|
326
|
+
index: o,
|
|
327
|
+
siblings: e
|
|
328
|
+
};
|
|
329
|
+
const a = Z(n.childrenOf(i), t, n, i);
|
|
330
|
+
if (a) return a;
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
function lr(e, t, n) {
|
|
334
|
+
return n.idOf(e) === t ? !0 : n.childrenOf(e).some((r) => lr(r, t, n));
|
|
335
|
+
}
|
|
336
|
+
var B = /* @__PURE__ */ (function(e) {
|
|
337
|
+
return e.Local = "local", e.Inherited = "inherited", e.ConfigurableInherited = "configurableInherited", e;
|
|
338
|
+
})({}), ie = /* @__PURE__ */ (function(e) {
|
|
339
|
+
return e.Select = "select", e.Configure = "configure", e.Move = "move", e.Resize = "resize", e.Restyle = "restyle", e.Insert = "insert", e.Delete = "delete", e;
|
|
340
|
+
})({});
|
|
341
|
+
function Fe(e, t) {
|
|
342
|
+
switch (e) {
|
|
343
|
+
case B.Local:
|
|
344
|
+
return !0;
|
|
345
|
+
case B.ConfigurableInherited:
|
|
346
|
+
return t === ie.Select || t === ie.Configure;
|
|
347
|
+
case B.Inherited:
|
|
348
|
+
return t === ie.Select;
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
function Tt(e, t, n) {
|
|
352
|
+
const r = Z(e, t, n);
|
|
353
|
+
return !!r && r.parent !== null && Fe(n.ownershipOf(r.node), ie.Delete);
|
|
354
|
+
}
|
|
355
|
+
function cr(e, t, n) {
|
|
356
|
+
const r = Z(e, t, n);
|
|
357
|
+
if (!r) return;
|
|
358
|
+
const o = r.siblings[r.index + 1] ?? r.siblings[r.index - 1];
|
|
359
|
+
return o ? n.idOf(o) : r.parent ? n.idOf(r.parent) : void 0;
|
|
360
|
+
}
|
|
361
|
+
function dr(e, t, n, r = 0, o = null) {
|
|
362
|
+
return e.flatMap((i) => {
|
|
363
|
+
const a = n.idOf(i), c = n.childrenOf(i), d = c.length > 0 && t.has(a), u = {
|
|
364
|
+
node: i,
|
|
365
|
+
id: a,
|
|
366
|
+
depth: r,
|
|
367
|
+
parentId: o,
|
|
368
|
+
hasChildren: c.length > 0,
|
|
369
|
+
isExpanded: d
|
|
370
|
+
};
|
|
371
|
+
return d ? [u, ...dr(c, t, n, r + 1, a)] : [u];
|
|
372
|
+
});
|
|
373
|
+
}
|
|
374
|
+
var ne = /* @__PURE__ */ (function(e) {
|
|
375
|
+
return e.MoveUp = "moveUp", e.MoveDown = "moveDown", e.Outdent = "outdent", e.Indent = "indent", e;
|
|
376
|
+
})({});
|
|
377
|
+
function fs(e, t, n, r) {
|
|
378
|
+
const o = Z(e, t, r);
|
|
379
|
+
if (!o) return;
|
|
380
|
+
const i = o.parent === null ? null : r.idOf(o.parent);
|
|
381
|
+
switch (n) {
|
|
382
|
+
case ne.MoveUp:
|
|
383
|
+
return o.index > 0 ? {
|
|
384
|
+
nodeId: t,
|
|
385
|
+
targetParentId: i,
|
|
386
|
+
index: o.index - 1
|
|
387
|
+
} : void 0;
|
|
388
|
+
case ne.MoveDown:
|
|
389
|
+
return o.index < o.siblings.length - 1 ? {
|
|
390
|
+
nodeId: t,
|
|
391
|
+
targetParentId: i,
|
|
392
|
+
index: o.index + 1
|
|
393
|
+
} : void 0;
|
|
394
|
+
case ne.Outdent: {
|
|
395
|
+
if (o.parent === null) return;
|
|
396
|
+
const a = Z(e, r.idOf(o.parent), r);
|
|
397
|
+
return {
|
|
398
|
+
nodeId: t,
|
|
399
|
+
targetParentId: a.parent === null ? null : r.idOf(a.parent),
|
|
400
|
+
index: a.index + 1
|
|
401
|
+
};
|
|
402
|
+
}
|
|
403
|
+
case ne.Indent: {
|
|
404
|
+
const a = o.index > 0 ? o.siblings[o.index - 1] : void 0;
|
|
405
|
+
return !a || !r.acceptsChildren(a) ? void 0 : {
|
|
406
|
+
nodeId: t,
|
|
407
|
+
targetParentId: r.idOf(a),
|
|
408
|
+
index: r.childrenOf(a).length
|
|
409
|
+
};
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
var se = /* @__PURE__ */ (function(e) {
|
|
414
|
+
return e.Before = "before", e.Inside = "inside", e.After = "after", e;
|
|
415
|
+
})({});
|
|
416
|
+
function hs(e, t, n, r, o) {
|
|
417
|
+
const i = Z(e, n, o);
|
|
418
|
+
if (!i) return;
|
|
419
|
+
if (r === se.Inside) return {
|
|
420
|
+
nodeId: t,
|
|
421
|
+
targetParentId: n,
|
|
422
|
+
index: o.childrenOf(i.node).filter((c) => o.idOf(c) !== t).length
|
|
423
|
+
};
|
|
424
|
+
const a = i.siblings.filter((c) => o.idOf(c) !== t).findIndex((c) => o.idOf(c) === n);
|
|
425
|
+
return {
|
|
426
|
+
nodeId: t,
|
|
427
|
+
targetParentId: i.parent === null ? null : o.idOf(i.parent),
|
|
428
|
+
index: r === se.Before ? a : a + 1
|
|
429
|
+
};
|
|
430
|
+
}
|
|
431
|
+
function gs(e, t, n) {
|
|
432
|
+
if (t <= 0) return se.After;
|
|
433
|
+
const r = e / t;
|
|
434
|
+
return r < 0.25 ? se.Before : r > 0.75 || !n ? r < 0.5 ? se.Before : se.After : se.Inside;
|
|
435
|
+
}
|
|
436
|
+
var ur = ({ ownership: e, label: t }) => e === B.Local ? null : /* @__PURE__ */ s("span", {
|
|
437
|
+
className: "studio-editor-ownership-badge",
|
|
438
|
+
"data-ownership": e,
|
|
439
|
+
children: t
|
|
440
|
+
});
|
|
441
|
+
function vs({ row: e, adapter: t, strings: n, isSelected: r, isFocusable: o, dropZone: i, onSelect: a, onToggle: c, onKeyDown: d, onDragStart: u, onDragOver: l, onDrop: p, onDragEnd: w }) {
|
|
442
|
+
const g = t.ownershipOf(e.node), k = Fe(g, ie.Move);
|
|
443
|
+
return /* @__PURE__ */ b("li", {
|
|
444
|
+
role: "treeitem",
|
|
445
|
+
"aria-level": e.depth + 1,
|
|
446
|
+
"aria-selected": r,
|
|
447
|
+
"aria-expanded": e.hasChildren ? e.isExpanded : void 0,
|
|
448
|
+
tabIndex: o ? 0 : -1,
|
|
449
|
+
"data-row-id": e.id,
|
|
450
|
+
"data-ownership": g,
|
|
451
|
+
"data-drop-zone": i,
|
|
452
|
+
className: "studio-editor-structure-row",
|
|
453
|
+
style: { paddingInlineStart: `${e.depth * 16 + 8}px` },
|
|
454
|
+
draggable: k,
|
|
455
|
+
onClick: () => a(e.id),
|
|
456
|
+
onKeyDown: (x) => d(x, e.id),
|
|
457
|
+
onDragStart: () => u(e.id),
|
|
458
|
+
onDragOver: (x) => l(x, e.id),
|
|
459
|
+
onDrop: (x) => p(x, e.id),
|
|
460
|
+
onDragEnd: w,
|
|
461
|
+
children: [
|
|
462
|
+
/* @__PURE__ */ s("button", {
|
|
463
|
+
type: "button",
|
|
464
|
+
tabIndex: -1,
|
|
465
|
+
className: "studio-editor-structure-row__toggle",
|
|
466
|
+
"aria-hidden": !e.hasChildren,
|
|
467
|
+
disabled: !e.hasChildren,
|
|
468
|
+
onClick: (x) => {
|
|
469
|
+
x.stopPropagation(), c(e.id);
|
|
470
|
+
},
|
|
471
|
+
children: e.hasChildren ? e.isExpanded ? "▾" : "▸" : ""
|
|
472
|
+
}),
|
|
473
|
+
/* @__PURE__ */ s("span", {
|
|
474
|
+
className: "studio-editor-structure-row__name",
|
|
475
|
+
children: t.nameOf(e.node)
|
|
476
|
+
}),
|
|
477
|
+
/* @__PURE__ */ s(ur, {
|
|
478
|
+
ownership: g,
|
|
479
|
+
label: n.ownership[g]
|
|
480
|
+
})
|
|
481
|
+
]
|
|
482
|
+
});
|
|
483
|
+
}
|
|
484
|
+
var bn = {
|
|
485
|
+
ArrowUp: ne.MoveUp,
|
|
486
|
+
ArrowDown: ne.MoveDown,
|
|
487
|
+
ArrowLeft: ne.Outdent,
|
|
488
|
+
ArrowRight: ne.Indent
|
|
489
|
+
};
|
|
490
|
+
function pr({ roots: e, adapter: t, strings: n, selectedId: r, onSelect: o, onEdit: i, onRemove: a }) {
|
|
491
|
+
const [c, d] = M(() => new Set(e.flatMap((f) => [t.idOf(f), ...t.childrenOf(f).map((y) => t.idOf(y))]))), [u, l] = M(r), [p, w] = M(), [g, k] = M(), [x, C] = M(""), I = _(() => dr(e, c, t), [
|
|
492
|
+
e,
|
|
493
|
+
c,
|
|
494
|
+
t
|
|
495
|
+
]), F = I.some((f) => f.id === u) ? u : I[0]?.id, N = z((f) => d((y) => {
|
|
496
|
+
const P = new Set(y);
|
|
497
|
+
return P.delete(f) || P.add(f), P;
|
|
498
|
+
}), []), E = z((f) => {
|
|
499
|
+
if (!f) return;
|
|
500
|
+
const y = i(f);
|
|
501
|
+
C(y ? n.rejection[y] : n.moved), !y && f.targetParentId && d((P) => new Set(P).add(f.targetParentId));
|
|
502
|
+
}, [i, n]), v = (f) => {
|
|
503
|
+
f && (l(f), requestAnimationFrame(() => document.querySelector(`[data-row-id="${CSS.escape(f)}"]`)?.focus()));
|
|
504
|
+
}, T = (f, y) => {
|
|
505
|
+
const P = I.findIndex((D) => D.id === y), O = I[P];
|
|
506
|
+
if (f.altKey && bn[f.key]) {
|
|
507
|
+
f.preventDefault(), E(fs(e, y, bn[f.key], t)), v(y);
|
|
508
|
+
return;
|
|
509
|
+
}
|
|
510
|
+
if (sr(f) && a && Tt(e, y, t)) {
|
|
511
|
+
f.preventDefault();
|
|
512
|
+
const D = cr(e, y, t);
|
|
513
|
+
a(y), v(D);
|
|
514
|
+
return;
|
|
515
|
+
}
|
|
516
|
+
switch (f.key) {
|
|
517
|
+
case "ArrowDown":
|
|
518
|
+
f.preventDefault(), v(I[P + 1]?.id);
|
|
519
|
+
break;
|
|
520
|
+
case "ArrowUp":
|
|
521
|
+
f.preventDefault(), v(I[P - 1]?.id);
|
|
522
|
+
break;
|
|
523
|
+
case "Home":
|
|
524
|
+
f.preventDefault(), v(I[0]?.id);
|
|
525
|
+
break;
|
|
526
|
+
case "End":
|
|
527
|
+
f.preventDefault(), v(I[I.length - 1]?.id);
|
|
528
|
+
break;
|
|
529
|
+
case "ArrowRight":
|
|
530
|
+
f.preventDefault(), O.hasChildren && !O.isExpanded ? N(y) : v(I[P + 1]?.parentId === y ? I[P + 1].id : void 0);
|
|
531
|
+
break;
|
|
532
|
+
case "ArrowLeft":
|
|
533
|
+
f.preventDefault(), O.isExpanded ? N(y) : v(O.parentId ?? void 0);
|
|
534
|
+
break;
|
|
535
|
+
case "Enter":
|
|
536
|
+
case " ":
|
|
537
|
+
f.preventDefault(), o(y);
|
|
538
|
+
}
|
|
539
|
+
}, R = (f, y) => {
|
|
540
|
+
if (!p) return;
|
|
541
|
+
f.preventDefault();
|
|
542
|
+
const P = f.currentTarget.getBoundingClientRect(), O = I.find((D) => D.id === y);
|
|
543
|
+
k({
|
|
544
|
+
id: y,
|
|
545
|
+
zone: gs(f.clientY - P.top, P.height, !!O && t.acceptsChildren(O.node))
|
|
546
|
+
});
|
|
547
|
+
}, m = (f, y) => {
|
|
548
|
+
f.preventDefault(), p && g?.id === y && E(hs(e, p, y, g.zone, t)), w(void 0), k(void 0);
|
|
549
|
+
};
|
|
550
|
+
return I.length === 0 ? /* @__PURE__ */ s("p", {
|
|
551
|
+
className: "studio-editor-structure-empty",
|
|
552
|
+
children: n.structureEmpty
|
|
553
|
+
}) : /* @__PURE__ */ b(Ie, { children: [/* @__PURE__ */ s("ul", {
|
|
554
|
+
role: "tree",
|
|
555
|
+
"aria-label": n.structureLabel,
|
|
556
|
+
className: "studio-editor-structure-tree",
|
|
557
|
+
children: I.map((f) => /* @__PURE__ */ s(vs, {
|
|
558
|
+
row: f,
|
|
559
|
+
adapter: t,
|
|
560
|
+
strings: n,
|
|
561
|
+
isSelected: f.id === r,
|
|
562
|
+
isFocusable: f.id === F,
|
|
563
|
+
dropZone: g?.id === f.id ? g.zone : void 0,
|
|
564
|
+
onSelect: (y) => {
|
|
565
|
+
l(y), o(y);
|
|
566
|
+
},
|
|
567
|
+
onToggle: N,
|
|
568
|
+
onKeyDown: T,
|
|
569
|
+
onDragStart: w,
|
|
570
|
+
onDragOver: R,
|
|
571
|
+
onDrop: m,
|
|
572
|
+
onDragEnd: () => {
|
|
573
|
+
w(void 0), k(void 0);
|
|
574
|
+
}
|
|
575
|
+
}, f.id))
|
|
576
|
+
}), /* @__PURE__ */ s("p", {
|
|
577
|
+
className: "studio-editor-structure-announcement",
|
|
578
|
+
role: "status",
|
|
579
|
+
"aria-live": "polite",
|
|
580
|
+
children: x
|
|
581
|
+
})] });
|
|
582
|
+
}
|
|
583
|
+
var pt = /* @__PURE__ */ (function(e) {
|
|
584
|
+
return e.Properties = "properties", e.Structure = "structure", e;
|
|
585
|
+
})({}), ys = /* @__PURE__ */ new Set([de, ue]);
|
|
586
|
+
function bs(e, t, n) {
|
|
587
|
+
return t ? e : e.filter((r) => !ys.has(r.descriptor.path) || n?.[r.descriptor.path] !== void 0);
|
|
588
|
+
}
|
|
589
|
+
function ws(e, t) {
|
|
590
|
+
return e.replace(/\{(\w+)\}/g, (n, r) => t[r] ?? n);
|
|
591
|
+
}
|
|
592
|
+
function Cs(e, t) {
|
|
593
|
+
const n = e.diagnostic ? t.diagnostics[e.diagnostic.kind] : t.notAllowed;
|
|
594
|
+
return ws(n, {
|
|
595
|
+
library: e.reference.library,
|
|
596
|
+
key: e.reference.key,
|
|
597
|
+
variant: e.reference.variant
|
|
598
|
+
});
|
|
599
|
+
}
|
|
600
|
+
function Ss(e, t, n, r) {
|
|
601
|
+
if (!n) return;
|
|
602
|
+
const o = e.lookup(n);
|
|
603
|
+
if (!o) return;
|
|
604
|
+
if (!o.isResolved) return {
|
|
605
|
+
reference: n,
|
|
606
|
+
diagnostic: o.diagnostic,
|
|
607
|
+
isNotAllowed: !1
|
|
608
|
+
};
|
|
609
|
+
const i = t.icons.find((a) => wo(a, n));
|
|
610
|
+
return i && r && !bo(i, r) ? {
|
|
611
|
+
reference: n,
|
|
612
|
+
isNotAllowed: !0
|
|
613
|
+
} : void 0;
|
|
614
|
+
}
|
|
615
|
+
var ks = 24;
|
|
616
|
+
function Is(e) {
|
|
617
|
+
return e.libraries.map((t) => ({
|
|
618
|
+
id: t.library,
|
|
619
|
+
name: t.package.displayName ?? t.package.name,
|
|
620
|
+
version: t.package.version,
|
|
621
|
+
attribution: t.package.iconLibrary?.attribution
|
|
622
|
+
}));
|
|
623
|
+
}
|
|
624
|
+
function Ps(e, t) {
|
|
625
|
+
return e.flatMap((n) => n.references.map((r) => ({
|
|
626
|
+
library: r.library,
|
|
627
|
+
key: r.key,
|
|
628
|
+
...r.variant === void 0 ? {} : { variant: r.variant },
|
|
629
|
+
name: n.entry.name,
|
|
630
|
+
categories: n.entry.categories,
|
|
631
|
+
tags: n.entry.tags,
|
|
632
|
+
aliases: n.entry.aliases,
|
|
633
|
+
renderPreview: () => /* @__PURE__ */ s(ko, {
|
|
634
|
+
reference: r,
|
|
635
|
+
adapters: t,
|
|
636
|
+
size: ks
|
|
637
|
+
})
|
|
638
|
+
})));
|
|
639
|
+
}
|
|
640
|
+
function Ts(e, t, n, r = { status: "ready" }) {
|
|
641
|
+
return {
|
|
642
|
+
libraries: Is(e),
|
|
643
|
+
icons: Ps(t, n),
|
|
644
|
+
status: r.status,
|
|
645
|
+
error: r.error
|
|
646
|
+
};
|
|
647
|
+
}
|
|
648
|
+
function Rs(e) {
|
|
649
|
+
return e.error ? {
|
|
650
|
+
status: "error",
|
|
651
|
+
error: e.error
|
|
652
|
+
} : e.diagnostics.some((t) => t.kind === "catalog-unavailable") ? { status: "error" } : { status: "ready" };
|
|
653
|
+
}
|
|
654
|
+
function xs(e, t) {
|
|
655
|
+
const [n, r] = M(), [o, i] = M(0);
|
|
656
|
+
return Ne(() => {
|
|
657
|
+
let a = !0;
|
|
658
|
+
return e.search().then((c) => {
|
|
659
|
+
a && (r({
|
|
660
|
+
source: e,
|
|
661
|
+
entries: c.entries,
|
|
662
|
+
diagnostics: [...e.diagnostics, ...c.diagnostics]
|
|
663
|
+
}), i((d) => d + 1));
|
|
664
|
+
}).catch((c) => {
|
|
665
|
+
a && (r({
|
|
666
|
+
source: e,
|
|
667
|
+
entries: [],
|
|
668
|
+
diagnostics: e.diagnostics,
|
|
669
|
+
error: c instanceof Error ? c.message : String(c)
|
|
670
|
+
}), i((d) => d + 1));
|
|
671
|
+
}), () => {
|
|
672
|
+
a = !1;
|
|
673
|
+
};
|
|
674
|
+
}, [e]), _(() => {
|
|
675
|
+
const a = n?.source === e ? n : void 0, c = a ? Rs(a) : { status: "loading" };
|
|
676
|
+
return {
|
|
677
|
+
catalog: Ts(e, a?.entries ?? [], t, c),
|
|
678
|
+
diagnostics: a?.diagnostics ?? e.diagnostics,
|
|
679
|
+
loadedVersion: o
|
|
680
|
+
};
|
|
681
|
+
}, [
|
|
682
|
+
e,
|
|
683
|
+
t,
|
|
684
|
+
n,
|
|
685
|
+
o
|
|
686
|
+
]);
|
|
687
|
+
}
|
|
688
|
+
function mr({ value: e, onChange: t, catalog: n, adapters: r, allowed: o, readOnly: i, disabled: a, validationMessage: c, showMessage: d = !0, invalid: u, strings: l, pickerLabels: p, placement: w, id: g, ...k }) {
|
|
689
|
+
const { catalog: x, loadedVersion: C } = xs(n, r), I = C > 0 ? Ss(n, x, e, o) : void 0, F = c ?? (I ? Cs(I, l) : void 0);
|
|
690
|
+
return /* @__PURE__ */ s(yo, {
|
|
691
|
+
id: g,
|
|
692
|
+
value: e,
|
|
693
|
+
onChange: (N) => t({
|
|
694
|
+
library: N.library,
|
|
695
|
+
key: N.key,
|
|
696
|
+
...N.variant === void 0 ? {} : { variant: N.variant }
|
|
697
|
+
}),
|
|
698
|
+
catalog: x,
|
|
699
|
+
allowed: o,
|
|
700
|
+
readOnly: i,
|
|
701
|
+
disabled: a,
|
|
702
|
+
invalid: F !== void 0 || u === !0,
|
|
703
|
+
validationMessage: d ? F : void 0,
|
|
704
|
+
placement: w,
|
|
705
|
+
labels: {
|
|
706
|
+
...l.picker,
|
|
707
|
+
...p
|
|
708
|
+
},
|
|
709
|
+
"aria-label": k["aria-label"] ?? (k["aria-labelledby"] ? void 0 : l.ariaLabel),
|
|
710
|
+
"aria-labelledby": k["aria-labelledby"],
|
|
711
|
+
"aria-describedby": k["aria-describedby"]
|
|
712
|
+
});
|
|
713
|
+
}
|
|
714
|
+
var Ns = (e) => typeof e == "string" ? e : "";
|
|
715
|
+
function Fs(e) {
|
|
716
|
+
const t = (e.items ?? []).map((n) => ({
|
|
717
|
+
id: n.id,
|
|
718
|
+
label: Ns(n.values.label),
|
|
719
|
+
...n.values.icon ? { icon: n.values.icon } : {},
|
|
720
|
+
...n.values.destination ? { destination: n.values.destination.screen } : {},
|
|
721
|
+
values: n.values,
|
|
722
|
+
editable: n.editable
|
|
723
|
+
}));
|
|
724
|
+
return {
|
|
725
|
+
fixed: t.filter((n) => !n.editable),
|
|
726
|
+
items: t.filter((n) => n.editable)
|
|
727
|
+
};
|
|
728
|
+
}
|
|
729
|
+
function Ds(e) {
|
|
730
|
+
const t = new Set(e.operations ?? []), n = t.has(te.EditFields), r = e.descriptor.constraints?.maximumItems;
|
|
731
|
+
return {
|
|
732
|
+
add: t.has(te.Add),
|
|
733
|
+
remove: t.has(te.Remove),
|
|
734
|
+
reorder: t.has(te.Reorder),
|
|
735
|
+
fields: {
|
|
736
|
+
label: n ? "editable" : "readonly",
|
|
737
|
+
icon: n ? "editable" : "readonly",
|
|
738
|
+
destination: n ? "editable" : "readonly"
|
|
739
|
+
},
|
|
740
|
+
...r !== void 0 ? { maxItems: r } : {},
|
|
741
|
+
...e.reason ? { reasons: {
|
|
742
|
+
add: e.reason,
|
|
743
|
+
remove: e.reason,
|
|
744
|
+
reorder: e.reason
|
|
745
|
+
} } : {}
|
|
746
|
+
};
|
|
747
|
+
}
|
|
748
|
+
function Os(e, t, n) {
|
|
749
|
+
const r = {
|
|
750
|
+
component: e,
|
|
751
|
+
path: t.descriptor.path
|
|
752
|
+
};
|
|
753
|
+
switch (n.kind) {
|
|
754
|
+
case "add":
|
|
755
|
+
return [{
|
|
756
|
+
kind: U.AddCollectionItem,
|
|
757
|
+
...r,
|
|
758
|
+
item: {
|
|
759
|
+
id: n.item.id,
|
|
760
|
+
values: Ms(n.item)
|
|
761
|
+
},
|
|
762
|
+
index: n.index
|
|
763
|
+
}];
|
|
764
|
+
case "remove":
|
|
765
|
+
return [{
|
|
766
|
+
kind: U.RemoveCollectionItem,
|
|
767
|
+
...r,
|
|
768
|
+
itemId: n.item.id
|
|
769
|
+
}];
|
|
770
|
+
case "move":
|
|
771
|
+
return [{
|
|
772
|
+
kind: U.ReorderCollectionItem,
|
|
773
|
+
...r,
|
|
774
|
+
itemId: n.item.id,
|
|
775
|
+
index: n.toIndex
|
|
776
|
+
}];
|
|
777
|
+
case "update":
|
|
778
|
+
return [{
|
|
779
|
+
kind: U.EditCollectionItem,
|
|
780
|
+
...r,
|
|
781
|
+
itemId: n.item.id,
|
|
782
|
+
field: n.field,
|
|
783
|
+
value: Ls(n.item, n.field)
|
|
784
|
+
}];
|
|
785
|
+
}
|
|
786
|
+
}
|
|
787
|
+
var Ls = (e, t) => t === "destination" ? e.destination ? { screen: e.destination } : void 0 : e[t], Ms = (e) => ({
|
|
788
|
+
...e.values,
|
|
789
|
+
label: e.label,
|
|
790
|
+
...e.icon ? { icon: e.icon } : {},
|
|
791
|
+
...e.destination ? { destination: { screen: e.destination } } : {}
|
|
792
|
+
});
|
|
793
|
+
function Es(e) {
|
|
794
|
+
return { types: e };
|
|
795
|
+
}
|
|
796
|
+
var xe = (e) => `${typeof e}:${String(e)}`, As = (e) => e == null ? "" : xe(e);
|
|
797
|
+
function $s(e, t) {
|
|
798
|
+
if (t == null || t === "") return { value: void 0 };
|
|
799
|
+
const n = (e.descriptor.choices ?? []).find((r) => xe(r.value) === t);
|
|
800
|
+
return n ? { value: n.value } : void 0;
|
|
801
|
+
}
|
|
802
|
+
var _s = /* @__PURE__ */ new Set([
|
|
803
|
+
A.String,
|
|
804
|
+
A.Number,
|
|
805
|
+
A.Boolean,
|
|
806
|
+
A.Enum
|
|
807
|
+
]), Bs = (e) => _s.has(e.descriptor.valueType) && e.descriptor.editorKind === void 0, zs = { action: /* @__PURE__ */ new Set([
|
|
808
|
+
"command",
|
|
809
|
+
"arguments",
|
|
810
|
+
"presentation"
|
|
811
|
+
]) }, Us = (e, t) => zs[e.slice(e.lastIndexOf(":") + 1)]?.has(t) ?? !1;
|
|
812
|
+
function js(e) {
|
|
813
|
+
const { descriptor: t } = e, n = {
|
|
814
|
+
name: t.path,
|
|
815
|
+
label: t.label,
|
|
816
|
+
...t.description ? { description: t.description } : {},
|
|
817
|
+
editable: e.editable,
|
|
818
|
+
...e.reason ? { unavailableReason: e.reason } : {}
|
|
819
|
+
};
|
|
820
|
+
switch (t.valueType) {
|
|
821
|
+
case A.Number:
|
|
822
|
+
return {
|
|
823
|
+
...n,
|
|
824
|
+
kind: "number",
|
|
825
|
+
...t.constraints?.minimum !== void 0 ? { min: t.constraints.minimum } : {},
|
|
826
|
+
...t.constraints?.maximum !== void 0 ? { max: t.constraints.maximum } : {},
|
|
827
|
+
...t.constraints?.integer ? { step: 1 } : {},
|
|
828
|
+
required: t.constraints?.required ?? !1
|
|
829
|
+
};
|
|
830
|
+
case A.Boolean:
|
|
831
|
+
return {
|
|
832
|
+
...n,
|
|
833
|
+
kind: "boolean"
|
|
834
|
+
};
|
|
835
|
+
case A.Enum: {
|
|
836
|
+
const r = (t.choices ?? []).map((a) => ({
|
|
837
|
+
value: xe(a.value),
|
|
838
|
+
label: a.label
|
|
839
|
+
})), o = e.effectiveValue, i = o == null || r.some((a) => a.value === xe(o));
|
|
840
|
+
return {
|
|
841
|
+
...n,
|
|
842
|
+
kind: "choice",
|
|
843
|
+
options: i ? r : [...r, {
|
|
844
|
+
value: xe(o),
|
|
845
|
+
label: String(o)
|
|
846
|
+
}]
|
|
847
|
+
};
|
|
848
|
+
}
|
|
849
|
+
default:
|
|
850
|
+
return {
|
|
851
|
+
...n,
|
|
852
|
+
kind: "text"
|
|
853
|
+
};
|
|
854
|
+
}
|
|
855
|
+
}
|
|
856
|
+
function Vs(e, t = "") {
|
|
857
|
+
const n = /* @__PURE__ */ new Map(), r = {};
|
|
858
|
+
for (const o of e.filter((i) => Bs(i) && !Us(t, i.descriptor.path))) {
|
|
859
|
+
const i = o.descriptor.group;
|
|
860
|
+
n.set(i, [...n.get(i) ?? [], js(o)]), r[o.descriptor.path] = o.descriptor.valueType === A.Enum ? As(o.effectiveValue) : o.effectiveValue ?? "";
|
|
861
|
+
}
|
|
862
|
+
return {
|
|
863
|
+
groups: [...n.entries()].map(([o, i]) => ({
|
|
864
|
+
id: o,
|
|
865
|
+
title: o,
|
|
866
|
+
properties: i
|
|
867
|
+
})),
|
|
868
|
+
values: r
|
|
869
|
+
};
|
|
870
|
+
}
|
|
871
|
+
var Ws = (e, t) => e.descriptor.valueType === "number" && typeof t == "string" ? t.trim() === "" ? void 0 : Number(t) : t;
|
|
872
|
+
function fr(e, t, n) {
|
|
873
|
+
const r = Ws(t, n);
|
|
874
|
+
return t.editTarget === Kr.Instance ? r === void 0 ? {
|
|
875
|
+
kind: U.ResetInstanceValue,
|
|
876
|
+
component: e,
|
|
877
|
+
path: t.descriptor.path
|
|
878
|
+
} : {
|
|
879
|
+
kind: U.SetInstanceValue,
|
|
880
|
+
component: e,
|
|
881
|
+
path: t.descriptor.path,
|
|
882
|
+
value: r
|
|
883
|
+
} : r === void 0 ? {
|
|
884
|
+
kind: U.ResetProperty,
|
|
885
|
+
nodeId: Q(e),
|
|
886
|
+
path: t.descriptor.path
|
|
887
|
+
} : {
|
|
888
|
+
kind: U.SetProperty,
|
|
889
|
+
nodeId: Q(e),
|
|
890
|
+
path: t.descriptor.path,
|
|
891
|
+
value: r
|
|
892
|
+
};
|
|
893
|
+
}
|
|
894
|
+
var hr = ({ diagnostics: e, label: t }) => {
|
|
895
|
+
if (e.length === 0) return null;
|
|
896
|
+
const n = [...e].sort((r, o) => +(o.severity === "error") - +(r.severity === "error"));
|
|
897
|
+
return /* @__PURE__ */ s("ul", {
|
|
898
|
+
className: "studio-editor-diagnostics",
|
|
899
|
+
role: "alert",
|
|
900
|
+
"aria-label": t,
|
|
901
|
+
children: n.map((r, o) => /* @__PURE__ */ s("li", {
|
|
902
|
+
"data-severity": r.severity,
|
|
903
|
+
children: r.message
|
|
904
|
+
}, `${r.code}:${r.path ?? ""}:${o}`))
|
|
905
|
+
});
|
|
906
|
+
}, J = /* @__PURE__ */ (function(e) {
|
|
907
|
+
return e.None = "none", e.Modal = "modal", e.Drawer = "drawer", e;
|
|
908
|
+
})({}), re = /* @__PURE__ */ (function(e) {
|
|
909
|
+
return e.MissingSlice = "missingSlice", e.UnmappedInput = "unmappedInput", e.UnknownInput = "unknownInput", e.UnknownSource = "unknownSource", e;
|
|
910
|
+
})({});
|
|
911
|
+
function qs(e, t, n) {
|
|
912
|
+
const r = t.find((i) => i.id === e.sliceId);
|
|
913
|
+
if (!r) return [{ kind: re.MissingSlice }];
|
|
914
|
+
const o = [];
|
|
915
|
+
for (const i of r.inputs) {
|
|
916
|
+
const a = e.inputs[i.name]?.trim();
|
|
917
|
+
a ? n.has(a) || o.push({
|
|
918
|
+
kind: re.UnknownSource,
|
|
919
|
+
input: i.name
|
|
920
|
+
}) : i.required && o.push({
|
|
921
|
+
kind: re.UnmappedInput,
|
|
922
|
+
input: i.name
|
|
923
|
+
});
|
|
924
|
+
}
|
|
925
|
+
for (const i of Object.keys(e.inputs)) r.inputs.some((a) => a.name === i) || o.push({
|
|
926
|
+
kind: re.UnknownInput,
|
|
927
|
+
input: i
|
|
928
|
+
});
|
|
929
|
+
return o;
|
|
930
|
+
}
|
|
931
|
+
function Gs(e, t) {
|
|
932
|
+
return Object.fromEntries(e.inputs.flatMap((n) => {
|
|
933
|
+
const r = t(n.name);
|
|
934
|
+
return r === void 0 ? [] : [[n.name, r]];
|
|
935
|
+
}));
|
|
936
|
+
}
|
|
937
|
+
var Hs = (e, t) => {
|
|
938
|
+
const n = e.input ?? "";
|
|
939
|
+
switch (e.kind) {
|
|
940
|
+
case re.MissingSlice:
|
|
941
|
+
return t.missingSlice;
|
|
942
|
+
case re.UnmappedInput:
|
|
943
|
+
return t.unmappedInput(n);
|
|
944
|
+
case re.UnknownInput:
|
|
945
|
+
return t.unknownInput(n);
|
|
946
|
+
case re.UnknownSource:
|
|
947
|
+
return t.unknownSource(n);
|
|
948
|
+
}
|
|
949
|
+
}, Ks = ({ action: e, slices: t, sources: n, strings: r, disabled: o, suggestSource: i, onChange: a }) => {
|
|
950
|
+
const c = r.properties.action, d = e ? t.find((l) => l.id === e.sliceId) : void 0, u = e ? qs(e, t, new Set(n)) : [];
|
|
951
|
+
return /* @__PURE__ */ b("fieldset", {
|
|
952
|
+
className: "studio-editor-query",
|
|
953
|
+
disabled: o,
|
|
954
|
+
children: [
|
|
955
|
+
/* @__PURE__ */ s("legend", { children: c.label }),
|
|
956
|
+
/* @__PURE__ */ b("label", { children: [/* @__PURE__ */ s("span", { children: c.slice }), /* @__PURE__ */ b("select", {
|
|
957
|
+
value: e?.sliceId ?? "",
|
|
958
|
+
onChange: (l) => {
|
|
959
|
+
const p = t.find((w) => w.id === l.target.value);
|
|
960
|
+
a(p ? {
|
|
961
|
+
sliceId: p.id,
|
|
962
|
+
sliceName: p.name,
|
|
963
|
+
inputs: Gs(p, i),
|
|
964
|
+
presentation: e?.presentation ?? J.None
|
|
965
|
+
} : void 0);
|
|
966
|
+
},
|
|
967
|
+
children: [
|
|
968
|
+
/* @__PURE__ */ s("option", {
|
|
969
|
+
value: "",
|
|
970
|
+
children: c.none
|
|
971
|
+
}),
|
|
972
|
+
e && !d && /* @__PURE__ */ s("option", {
|
|
973
|
+
value: e.sliceId,
|
|
974
|
+
children: e.sliceName
|
|
975
|
+
}),
|
|
976
|
+
t.map((l) => /* @__PURE__ */ b("option", {
|
|
977
|
+
value: l.id,
|
|
978
|
+
children: [l.name, l.origin.length > 0 ? ` - ${l.origin.join(" / ")}` : ""]
|
|
979
|
+
}, l.id))
|
|
980
|
+
]
|
|
981
|
+
})] }),
|
|
982
|
+
e && d && /* @__PURE__ */ b(Ie, { children: [/* @__PURE__ */ b("div", {
|
|
983
|
+
className: "studio-editor-query__group",
|
|
984
|
+
children: [/* @__PURE__ */ s("strong", { children: c.inputs }), d.inputs.map((l) => /* @__PURE__ */ b("label", { children: [/* @__PURE__ */ b("span", { children: [c.sourceFor(l.name), l.required ? " *" : ""] }), /* @__PURE__ */ b("select", {
|
|
985
|
+
value: e.inputs[l.name] ?? "",
|
|
986
|
+
onChange: (p) => a({
|
|
987
|
+
...e,
|
|
988
|
+
inputs: {
|
|
989
|
+
...e.inputs,
|
|
990
|
+
[l.name]: p.target.value
|
|
991
|
+
}
|
|
992
|
+
}),
|
|
993
|
+
children: [/* @__PURE__ */ s("option", {
|
|
994
|
+
value: "",
|
|
995
|
+
children: r.properties.query.noSource
|
|
996
|
+
}), n.map((p) => /* @__PURE__ */ s("option", {
|
|
997
|
+
value: p,
|
|
998
|
+
children: p
|
|
999
|
+
}, p))]
|
|
1000
|
+
})] }, l.name))]
|
|
1001
|
+
}), /* @__PURE__ */ b("label", { children: [/* @__PURE__ */ s("span", { children: c.presentation }), /* @__PURE__ */ b("select", {
|
|
1002
|
+
value: e.presentation,
|
|
1003
|
+
onChange: (l) => a({
|
|
1004
|
+
...e,
|
|
1005
|
+
presentation: l.target.value
|
|
1006
|
+
}),
|
|
1007
|
+
children: [
|
|
1008
|
+
/* @__PURE__ */ s("option", {
|
|
1009
|
+
value: J.None,
|
|
1010
|
+
children: c.presentations.none
|
|
1011
|
+
}),
|
|
1012
|
+
/* @__PURE__ */ s("option", {
|
|
1013
|
+
value: J.Modal,
|
|
1014
|
+
children: c.presentations.modal
|
|
1015
|
+
}),
|
|
1016
|
+
/* @__PURE__ */ s("option", {
|
|
1017
|
+
value: J.Drawer,
|
|
1018
|
+
children: c.presentations.drawer
|
|
1019
|
+
})
|
|
1020
|
+
]
|
|
1021
|
+
})] })] }),
|
|
1022
|
+
u.length > 0 && /* @__PURE__ */ s("ul", {
|
|
1023
|
+
className: "studio-editor-diagnostics",
|
|
1024
|
+
role: "alert",
|
|
1025
|
+
"aria-label": r.properties.diagnostics,
|
|
1026
|
+
children: u.map((l, p) => /* @__PURE__ */ s("li", {
|
|
1027
|
+
"data-severity": "error",
|
|
1028
|
+
children: Hs(l, c.problems)
|
|
1029
|
+
}, p))
|
|
1030
|
+
})
|
|
1031
|
+
]
|
|
1032
|
+
});
|
|
1033
|
+
};
|
|
1034
|
+
function Js(e) {
|
|
1035
|
+
return {
|
|
1036
|
+
queryId: e.id,
|
|
1037
|
+
query: e.name,
|
|
1038
|
+
arguments: [],
|
|
1039
|
+
results: []
|
|
1040
|
+
};
|
|
1041
|
+
}
|
|
1042
|
+
function Qs(e) {
|
|
1043
|
+
const t = e;
|
|
1044
|
+
return !!t && typeof t == "object" && typeof t.queryId == "string" && Array.isArray(t.arguments) && Array.isArray(t.results);
|
|
1045
|
+
}
|
|
1046
|
+
function Ys(e, t, n) {
|
|
1047
|
+
const r = e.arguments.filter((o) => o.parameter !== t);
|
|
1048
|
+
return {
|
|
1049
|
+
...e,
|
|
1050
|
+
arguments: n.trim() === "" ? r : [...r, {
|
|
1051
|
+
parameter: t,
|
|
1052
|
+
source: { path: n.trim() }
|
|
1053
|
+
}]
|
|
1054
|
+
};
|
|
1055
|
+
}
|
|
1056
|
+
function Zs(e, t, n = t) {
|
|
1057
|
+
return e.results.some((r) => r.field === t) ? e : {
|
|
1058
|
+
...e,
|
|
1059
|
+
results: [...e.results, {
|
|
1060
|
+
target: n,
|
|
1061
|
+
field: t
|
|
1062
|
+
}]
|
|
1063
|
+
};
|
|
1064
|
+
}
|
|
1065
|
+
function Xs(e, t) {
|
|
1066
|
+
return {
|
|
1067
|
+
...e,
|
|
1068
|
+
results: e.results.filter((n) => n.field !== t)
|
|
1069
|
+
};
|
|
1070
|
+
}
|
|
1071
|
+
var el = (e, t) => e.arguments.find((n) => n.parameter === t.name)?.source.path ?? "", tl = (e, t) => e.results.some((n) => n.field === t.name), G = /* @__PURE__ */ (function(e) {
|
|
1072
|
+
return e.NoQuery = "noQuery", e.MissingQuery = "missingQuery", e.Loading = "loading", e.Empty = "empty", e.Error = "error", e.Ready = "ready", e;
|
|
1073
|
+
})({});
|
|
1074
|
+
function nl({ binding: e, candidate: t, isLoading: n, error: r, rowCount: o }) {
|
|
1075
|
+
return e ? t ? r != null ? G.Error : n ? G.Loading : o === 0 ? G.Empty : G.Ready : G.MissingQuery : G.NoQuery;
|
|
1076
|
+
}
|
|
1077
|
+
function wn(e, t, n, r) {
|
|
1078
|
+
const o = mo(e, t, n, r);
|
|
1079
|
+
return {
|
|
1080
|
+
diagnostics: o,
|
|
1081
|
+
isStorable: o.every((i) => i.severity !== "error")
|
|
1082
|
+
};
|
|
1083
|
+
}
|
|
1084
|
+
var rl = (e) => e.origin.map((t) => t.name).join(" / "), ol = ({ property: e, candidates: t, scope: n, strings: r, disabled: o, onChange: i }) => {
|
|
1085
|
+
const a = r.properties.query, [c, d] = M(), u = Qs(e.effectiveValue) ? e.effectiveValue : void 0, l = c ?? u, p = l ? t.find((C) => C.id === l.queryId) : void 0, w = l ? wn(e.descriptor, p, l, n).diagnostics : [], g = (C) => {
|
|
1086
|
+
if (!C) {
|
|
1087
|
+
d(void 0), i(void 0);
|
|
1088
|
+
return;
|
|
1089
|
+
}
|
|
1090
|
+
const I = wn(e.descriptor, t.find((F) => F.id === C.queryId), C, n);
|
|
1091
|
+
d(I.isStorable ? void 0 : C), I.isStorable && i(C);
|
|
1092
|
+
}, k = nl({
|
|
1093
|
+
binding: l,
|
|
1094
|
+
candidate: p,
|
|
1095
|
+
isLoading: !1
|
|
1096
|
+
}), x = Object.keys(n.types);
|
|
1097
|
+
return /* @__PURE__ */ b("fieldset", {
|
|
1098
|
+
className: "studio-editor-query",
|
|
1099
|
+
disabled: o,
|
|
1100
|
+
children: [
|
|
1101
|
+
/* @__PURE__ */ s("legend", { children: e.descriptor.label }),
|
|
1102
|
+
/* @__PURE__ */ b("label", { children: [/* @__PURE__ */ s("span", { children: a.label }), /* @__PURE__ */ b("select", {
|
|
1103
|
+
value: l?.queryId ?? "",
|
|
1104
|
+
onChange: (C) => {
|
|
1105
|
+
const I = t.find((F) => F.id === C.target.value);
|
|
1106
|
+
g(I ? Js(I) : void 0);
|
|
1107
|
+
},
|
|
1108
|
+
children: [
|
|
1109
|
+
/* @__PURE__ */ s("option", {
|
|
1110
|
+
value: "",
|
|
1111
|
+
children: a.none
|
|
1112
|
+
}),
|
|
1113
|
+
l && !p && /* @__PURE__ */ s("option", {
|
|
1114
|
+
value: l.queryId,
|
|
1115
|
+
children: l.query
|
|
1116
|
+
}),
|
|
1117
|
+
t.map((C) => /* @__PURE__ */ b("option", {
|
|
1118
|
+
value: C.id,
|
|
1119
|
+
children: [
|
|
1120
|
+
C.name,
|
|
1121
|
+
" - ",
|
|
1122
|
+
rl(C)
|
|
1123
|
+
]
|
|
1124
|
+
}, C.id))
|
|
1125
|
+
]
|
|
1126
|
+
})] }),
|
|
1127
|
+
l && !p && /* @__PURE__ */ s("p", {
|
|
1128
|
+
className: "studio-editor-query__missing",
|
|
1129
|
+
role: "alert",
|
|
1130
|
+
children: a.missing
|
|
1131
|
+
}),
|
|
1132
|
+
l && p && /* @__PURE__ */ b(Ie, { children: [p.parameters.length > 0 && /* @__PURE__ */ b("div", {
|
|
1133
|
+
className: "studio-editor-query__group",
|
|
1134
|
+
children: [/* @__PURE__ */ s("strong", { children: a.parameters }), p.parameters.map((C) => /* @__PURE__ */ b("label", { children: [/* @__PURE__ */ b("span", { children: [a.sourceFor(C.name), C.required ? " *" : ""] }), /* @__PURE__ */ b("select", {
|
|
1135
|
+
value: el(l, C),
|
|
1136
|
+
onChange: (I) => g(Ys(l, C.name, I.target.value)),
|
|
1137
|
+
children: [/* @__PURE__ */ s("option", {
|
|
1138
|
+
value: "",
|
|
1139
|
+
children: a.noSource
|
|
1140
|
+
}), x.map((I) => /* @__PURE__ */ s("option", {
|
|
1141
|
+
value: I,
|
|
1142
|
+
children: I
|
|
1143
|
+
}, I))]
|
|
1144
|
+
})] }, C.name))]
|
|
1145
|
+
}), /* @__PURE__ */ b("div", {
|
|
1146
|
+
className: "studio-editor-query__group",
|
|
1147
|
+
children: [/* @__PURE__ */ s("strong", { children: a.columns }), p.resultFields.map((C) => /* @__PURE__ */ b("label", {
|
|
1148
|
+
className: "studio-editor-query__column",
|
|
1149
|
+
children: [/* @__PURE__ */ s("input", {
|
|
1150
|
+
type: "checkbox",
|
|
1151
|
+
checked: tl(l, C),
|
|
1152
|
+
onChange: (I) => g(I.target.checked ? Zs(l, C.name) : Xs(l, C.name))
|
|
1153
|
+
}), /* @__PURE__ */ s("span", { children: a.showColumn(C.name) })]
|
|
1154
|
+
}, C.name))]
|
|
1155
|
+
})] }),
|
|
1156
|
+
/* @__PURE__ */ s("p", {
|
|
1157
|
+
className: "studio-editor-query__preview",
|
|
1158
|
+
role: "status",
|
|
1159
|
+
"data-state": k,
|
|
1160
|
+
children: il(k, a.preview)
|
|
1161
|
+
}),
|
|
1162
|
+
/* @__PURE__ */ s(hr, {
|
|
1163
|
+
diagnostics: w,
|
|
1164
|
+
label: r.properties.diagnostics
|
|
1165
|
+
})
|
|
1166
|
+
]
|
|
1167
|
+
});
|
|
1168
|
+
};
|
|
1169
|
+
function il(e, t) {
|
|
1170
|
+
switch (e) {
|
|
1171
|
+
case G.NoQuery:
|
|
1172
|
+
return t.noQuery;
|
|
1173
|
+
case G.MissingQuery:
|
|
1174
|
+
return t.missingQuery;
|
|
1175
|
+
case G.Loading:
|
|
1176
|
+
return t.loading;
|
|
1177
|
+
case G.Empty:
|
|
1178
|
+
return t.empty;
|
|
1179
|
+
case G.Error:
|
|
1180
|
+
return t.error;
|
|
1181
|
+
case G.Ready:
|
|
1182
|
+
return "";
|
|
1183
|
+
}
|
|
1184
|
+
}
|
|
1185
|
+
var al = (e, t, n = !1) => ({
|
|
1186
|
+
kind: U.ChangeLayoutType,
|
|
1187
|
+
nodeId: e,
|
|
1188
|
+
to: t,
|
|
1189
|
+
...n ? { acceptLoss: !0 } : {}
|
|
1190
|
+
});
|
|
1191
|
+
function sl(e, t, n) {
|
|
1192
|
+
if (t) return { kind: "applied" };
|
|
1193
|
+
const r = n.find((o) => o.code === ee.LossyConversionNotAccepted);
|
|
1194
|
+
return r ? {
|
|
1195
|
+
kind: "confirm",
|
|
1196
|
+
lost: r.message,
|
|
1197
|
+
edit: {
|
|
1198
|
+
...e,
|
|
1199
|
+
acceptLoss: !0
|
|
1200
|
+
}
|
|
1201
|
+
} : {
|
|
1202
|
+
kind: "refused",
|
|
1203
|
+
diagnostics: [...n]
|
|
1204
|
+
};
|
|
1205
|
+
}
|
|
1206
|
+
var ll = ({ inspection: e, controller: t, strings: n, disabled: r }) => {
|
|
1207
|
+
const o = n.properties, [i, a] = M(), c = Xt(t.context.catalog, e.typeId), d = c?.capabilities.convertibleTo ?? [];
|
|
1208
|
+
if (!c || d.length === 0) return null;
|
|
1209
|
+
const u = (l) => {
|
|
1210
|
+
const p = t.tryApply(l, o.changeLayout), w = sl(l, p.applied, p.diagnostics);
|
|
1211
|
+
a(w.kind === "confirm" ? {
|
|
1212
|
+
lost: w.lost,
|
|
1213
|
+
edit: w.edit
|
|
1214
|
+
} : void 0);
|
|
1215
|
+
};
|
|
1216
|
+
return /* @__PURE__ */ b("section", {
|
|
1217
|
+
className: "studio-editor-properties__layout",
|
|
1218
|
+
children: [/* @__PURE__ */ b("label", { children: [/* @__PURE__ */ s("span", { children: o.layoutType }), /* @__PURE__ */ b("select", {
|
|
1219
|
+
value: e.typeId,
|
|
1220
|
+
disabled: r,
|
|
1221
|
+
onChange: (l) => u(al(e.nodeId, l.target.value)),
|
|
1222
|
+
children: [/* @__PURE__ */ s("option", {
|
|
1223
|
+
value: e.typeId,
|
|
1224
|
+
children: c.label
|
|
1225
|
+
}), d.map((l) => /* @__PURE__ */ s("option", {
|
|
1226
|
+
value: l,
|
|
1227
|
+
children: Xt(t.context.catalog, l)?.label ?? l
|
|
1228
|
+
}, l))]
|
|
1229
|
+
})] }), i && /* @__PURE__ */ b("div", {
|
|
1230
|
+
className: "studio-editor-properties__confirm",
|
|
1231
|
+
role: "alertdialog",
|
|
1232
|
+
"aria-label": o.confirmLayoutTitle,
|
|
1233
|
+
children: [
|
|
1234
|
+
/* @__PURE__ */ s("strong", { children: o.confirmLayoutTitle }),
|
|
1235
|
+
/* @__PURE__ */ s("p", { children: i.lost }),
|
|
1236
|
+
/* @__PURE__ */ s("button", {
|
|
1237
|
+
type: "button",
|
|
1238
|
+
onClick: () => {
|
|
1239
|
+
t.apply(i.edit, o.changeLayout), a(void 0);
|
|
1240
|
+
},
|
|
1241
|
+
children: o.confirmLayoutAccept
|
|
1242
|
+
}),
|
|
1243
|
+
/* @__PURE__ */ s("button", {
|
|
1244
|
+
type: "button",
|
|
1245
|
+
onClick: () => a(void 0),
|
|
1246
|
+
children: o.confirmLayoutCancel
|
|
1247
|
+
})
|
|
1248
|
+
]
|
|
1249
|
+
})]
|
|
1250
|
+
});
|
|
1251
|
+
};
|
|
1252
|
+
function cl(e, t, n, r = {}) {
|
|
1253
|
+
const o = {
|
|
1254
|
+
component: t,
|
|
1255
|
+
path: n,
|
|
1256
|
+
...r.label ? { label: r.label } : {},
|
|
1257
|
+
...r.operations && r.operations.length > 0 ? { operations: r.operations } : {},
|
|
1258
|
+
...r.editableFields && r.editableFields.length > 0 ? { editableFields: r.editableFields } : {}
|
|
1259
|
+
};
|
|
1260
|
+
return {
|
|
1261
|
+
kind: U.ExposeProperty,
|
|
1262
|
+
owner: e,
|
|
1263
|
+
property: o
|
|
1264
|
+
};
|
|
1265
|
+
}
|
|
1266
|
+
function dl(e, t, n) {
|
|
1267
|
+
return {
|
|
1268
|
+
kind: U.UnexposeProperty,
|
|
1269
|
+
owner: e,
|
|
1270
|
+
component: t,
|
|
1271
|
+
path: n
|
|
1272
|
+
};
|
|
1273
|
+
}
|
|
1274
|
+
var ul = (e, t, n, r) => e.exposures.some((o) => o.owner === t && o.properties.some((i) => i.component === n && i.path === r)), pl = [
|
|
1275
|
+
te.Add,
|
|
1276
|
+
te.Remove,
|
|
1277
|
+
te.Reorder,
|
|
1278
|
+
te.EditFields
|
|
1279
|
+
], ml = ({ inspection: e, componentId: t, controller: n, strings: r, authoringTemplate: o }) => {
|
|
1280
|
+
const i = r.properties;
|
|
1281
|
+
if (o === void 0) return null;
|
|
1282
|
+
const a = e.properties.filter((c) => c.descriptor.valueType !== A.Object && c.descriptor.group !== "Placement");
|
|
1283
|
+
return a.length === 0 ? null : /* @__PURE__ */ b("section", {
|
|
1284
|
+
className: "studio-editor-properties__exposure",
|
|
1285
|
+
children: [/* @__PURE__ */ s("strong", { children: i.exposure }), /* @__PURE__ */ s("ul", { children: a.map((c) => {
|
|
1286
|
+
const d = c.descriptor.path, u = ul(n.document, o, t, d), l = c.descriptor.valueType === A.Collection;
|
|
1287
|
+
return /* @__PURE__ */ s("li", { children: /* @__PURE__ */ b("label", { children: [
|
|
1288
|
+
/* @__PURE__ */ s("input", {
|
|
1289
|
+
type: "checkbox",
|
|
1290
|
+
checked: u,
|
|
1291
|
+
onChange: (p) => n.apply(p.target.checked ? cl(o, t, d, l ? { operations: pl } : {}) : dl(o, t, d), u ? i.unexposeProperty : i.exposeProperty)
|
|
1292
|
+
}),
|
|
1293
|
+
/* @__PURE__ */ s("span", { children: c.descriptor.label }),
|
|
1294
|
+
u && /* @__PURE__ */ s("em", { children: i.exposedToScopes })
|
|
1295
|
+
] }) }, d);
|
|
1296
|
+
}) })]
|
|
1297
|
+
});
|
|
1298
|
+
};
|
|
1299
|
+
function gr(e) {
|
|
1300
|
+
if (e !== void 0)
|
|
1301
|
+
return e.filter((t) => typeof t.value == "string").map((t) => eo(t.value)).filter((t) => t !== void 0);
|
|
1302
|
+
}
|
|
1303
|
+
var fl = /* @__PURE__ */ new Set([
|
|
1304
|
+
ee.MissingIconLibrary,
|
|
1305
|
+
ee.MissingIcon,
|
|
1306
|
+
ee.MissingIconVariant,
|
|
1307
|
+
ee.IncompatibleIconLibrary,
|
|
1308
|
+
ee.IconCatalogUnavailable,
|
|
1309
|
+
ee.IconNotVerified
|
|
1310
|
+
]), vr = (e) => fl.has(e.code), hl = (e) => e.code === ee.IconNotVerified;
|
|
1311
|
+
function yr(e, t, n) {
|
|
1312
|
+
const r = e.filter((o) => vr(o) && !hl(o) && o.path === t && o.itemId === n);
|
|
1313
|
+
return (r.find((o) => o.severity === Hr.Error) ?? r[0])?.message;
|
|
1314
|
+
}
|
|
1315
|
+
var gl = (e) => e.filter((t) => !vr(t));
|
|
1316
|
+
function vl(e, t) {
|
|
1317
|
+
const n = {};
|
|
1318
|
+
for (const r of e) {
|
|
1319
|
+
if (r.itemId === void 0) continue;
|
|
1320
|
+
const o = yr(e, t, r.itemId);
|
|
1321
|
+
o && (n[r.itemId] = { icon: o });
|
|
1322
|
+
}
|
|
1323
|
+
return n;
|
|
1324
|
+
}
|
|
1325
|
+
var yl = ({ properties: e, controller: t, catalog: n, adapters: r, diagnostics: o, strings: i }) => {
|
|
1326
|
+
if (e.length === 0) return null;
|
|
1327
|
+
const a = i.properties;
|
|
1328
|
+
return /* @__PURE__ */ s("section", {
|
|
1329
|
+
className: "studio-editor-properties__icons",
|
|
1330
|
+
children: e.map((c) => {
|
|
1331
|
+
const { path: d, label: u } = c.descriptor, l = Xr(c.effectiveValue) ? c.effectiveValue : void 0, p = `studio-editor-icon-${d}`;
|
|
1332
|
+
return /* @__PURE__ */ b("div", {
|
|
1333
|
+
className: "studio-editor-properties__icon",
|
|
1334
|
+
children: [
|
|
1335
|
+
/* @__PURE__ */ s("span", {
|
|
1336
|
+
id: p,
|
|
1337
|
+
className: "studio-editor-properties__icon-label",
|
|
1338
|
+
children: u
|
|
1339
|
+
}),
|
|
1340
|
+
/* @__PURE__ */ s(mr, {
|
|
1341
|
+
value: l,
|
|
1342
|
+
onChange: (w) => t.setProperty(c, w),
|
|
1343
|
+
catalog: n,
|
|
1344
|
+
adapters: r,
|
|
1345
|
+
allowed: gr(c.descriptor.choices),
|
|
1346
|
+
readOnly: !c.editable,
|
|
1347
|
+
validationMessage: yr(o, d),
|
|
1348
|
+
strings: a.icon,
|
|
1349
|
+
pickerLabels: a.iconPickerLabels,
|
|
1350
|
+
"aria-labelledby": p
|
|
1351
|
+
}),
|
|
1352
|
+
!c.editable && c.reason && /* @__PURE__ */ s("p", {
|
|
1353
|
+
className: "studio-editor-properties__hint",
|
|
1354
|
+
children: c.reason
|
|
1355
|
+
})
|
|
1356
|
+
]
|
|
1357
|
+
}, d);
|
|
1358
|
+
})
|
|
1359
|
+
});
|
|
1360
|
+
}, br = {
|
|
1361
|
+
placeholder: 'Empty means not set. Type JSON, such as {"a": 1}, [1, 2] or null.',
|
|
1362
|
+
problems: {
|
|
1363
|
+
required: "This setting needs a value.",
|
|
1364
|
+
syntax: (e) => `This is not valid JSON: ${e}`,
|
|
1365
|
+
unsafeInteger: (e) => `${e} is too large to be kept exactly as a number.`,
|
|
1366
|
+
outOfRange: (e) => `${e} is too large to be a number.`
|
|
1367
|
+
}
|
|
1368
|
+
}, q = /* @__PURE__ */ (function(e) {
|
|
1369
|
+
return e.Unchanged = "unchanged", e.Unset = "unset", e.Set = "set", e.Invalid = "invalid", e;
|
|
1370
|
+
})({}), Y = /* @__PURE__ */ (function(e) {
|
|
1371
|
+
return e.Required = "required", e.Syntax = "syntax", e.UnsafeInteger = "unsafeInteger", e.OutOfRange = "outOfRange", e;
|
|
1372
|
+
})({});
|
|
1373
|
+
function bl(e, t) {
|
|
1374
|
+
switch (e.kind) {
|
|
1375
|
+
case Y.Required:
|
|
1376
|
+
return t.problems.required;
|
|
1377
|
+
case Y.Syntax:
|
|
1378
|
+
return t.problems.syntax(e.detail);
|
|
1379
|
+
case Y.UnsafeInteger:
|
|
1380
|
+
return t.problems.unsafeInteger(e.detail);
|
|
1381
|
+
case Y.OutOfRange:
|
|
1382
|
+
return t.problems.outOfRange(e.detail);
|
|
1383
|
+
}
|
|
1384
|
+
}
|
|
1385
|
+
var wr = (e) => e === void 0 ? "" : JSON.stringify(e, null, 2) ?? "", Cn = /-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?/y;
|
|
1386
|
+
function wl(e) {
|
|
1387
|
+
const t = [];
|
|
1388
|
+
let n = 0;
|
|
1389
|
+
for (; n < e.length; ) {
|
|
1390
|
+
const r = e[n];
|
|
1391
|
+
if (r === '"') {
|
|
1392
|
+
for (n++; n < e.length && e[n] !== '"'; ) n += e[n] === "\\" ? 2 : 1;
|
|
1393
|
+
n++;
|
|
1394
|
+
continue;
|
|
1395
|
+
}
|
|
1396
|
+
if (r === "-" || r >= "0" && r <= "9") {
|
|
1397
|
+
Cn.lastIndex = n;
|
|
1398
|
+
const o = Cn.exec(e);
|
|
1399
|
+
if (o) {
|
|
1400
|
+
t.push(o[0]), n += o[0].length;
|
|
1401
|
+
continue;
|
|
1402
|
+
}
|
|
1403
|
+
}
|
|
1404
|
+
n++;
|
|
1405
|
+
}
|
|
1406
|
+
return t;
|
|
1407
|
+
}
|
|
1408
|
+
var Cl = (e) => {
|
|
1409
|
+
const [t] = e.replace("-", "").split(/[eE]/);
|
|
1410
|
+
return t.replace(".", "").replace(/^0+/, "").replace(/0+$/, "").length;
|
|
1411
|
+
}, Sl = (e, t) => Number.isSafeInteger(t) ? !1 : /[.eE]/.test(e) ? Number.isInteger(t) && Cl(e) > 15 : !0, kl = (e) => {
|
|
1412
|
+
for (const t of wl(e)) {
|
|
1413
|
+
const n = Number(t);
|
|
1414
|
+
if (!Number.isFinite(n)) return {
|
|
1415
|
+
kind: Y.OutOfRange,
|
|
1416
|
+
detail: t
|
|
1417
|
+
};
|
|
1418
|
+
if (Sl(t, n)) return {
|
|
1419
|
+
kind: Y.UnsafeInteger,
|
|
1420
|
+
detail: t
|
|
1421
|
+
};
|
|
1422
|
+
}
|
|
1423
|
+
};
|
|
1424
|
+
function Il(e) {
|
|
1425
|
+
let t;
|
|
1426
|
+
try {
|
|
1427
|
+
t = JSON.parse(e);
|
|
1428
|
+
} catch (r) {
|
|
1429
|
+
return { problem: {
|
|
1430
|
+
kind: Y.Syntax,
|
|
1431
|
+
detail: r instanceof Error ? r.message : String(r)
|
|
1432
|
+
} };
|
|
1433
|
+
}
|
|
1434
|
+
const n = kl(e);
|
|
1435
|
+
return n ? { problem: n } : { value: t };
|
|
1436
|
+
}
|
|
1437
|
+
function Je(e, t) {
|
|
1438
|
+
if (typeof e == "number" || typeof t == "number") return Object.is(e, t);
|
|
1439
|
+
if (e === null || t === null || typeof e != "object" || typeof t != "object") return e === t;
|
|
1440
|
+
if (Array.isArray(e) !== Array.isArray(t)) return !1;
|
|
1441
|
+
if (Array.isArray(e) && Array.isArray(t)) return e.length === t.length && e.every((o, i) => Je(o, t[i]));
|
|
1442
|
+
const n = Object.keys(e), r = Object.keys(t);
|
|
1443
|
+
return n.length === r.length && n.every((o, i) => o === r[i] && Je(e[o], t[o]));
|
|
1444
|
+
}
|
|
1445
|
+
var Wt = (e) => ({
|
|
1446
|
+
text: wr(e),
|
|
1447
|
+
base: e
|
|
1448
|
+
}), Pl = (e, t) => ({
|
|
1449
|
+
...e,
|
|
1450
|
+
text: t
|
|
1451
|
+
}), Tl = (e, t) => Je(e.base, t) ? e : Wt(t), Cr = (e) => Wt(e.base);
|
|
1452
|
+
function Sr(e, t) {
|
|
1453
|
+
if (e.text.trim() === "")
|
|
1454
|
+
return t ? {
|
|
1455
|
+
kind: q.Invalid,
|
|
1456
|
+
problem: {
|
|
1457
|
+
kind: Y.Required,
|
|
1458
|
+
detail: ""
|
|
1459
|
+
}
|
|
1460
|
+
} : e.base === void 0 ? { kind: q.Unchanged } : { kind: q.Unset };
|
|
1461
|
+
if (e.text === wr(e.base)) return { kind: q.Unchanged };
|
|
1462
|
+
const n = Il(e.text);
|
|
1463
|
+
return n.problem ? {
|
|
1464
|
+
kind: q.Invalid,
|
|
1465
|
+
problem: n.problem
|
|
1466
|
+
} : t && n.value === null ? {
|
|
1467
|
+
kind: q.Invalid,
|
|
1468
|
+
problem: {
|
|
1469
|
+
kind: Y.Required,
|
|
1470
|
+
detail: ""
|
|
1471
|
+
}
|
|
1472
|
+
} : Je(n.value, e.base) ? { kind: q.Unchanged } : {
|
|
1473
|
+
kind: q.Set,
|
|
1474
|
+
value: n.value
|
|
1475
|
+
};
|
|
1476
|
+
}
|
|
1477
|
+
function Rl(e, t) {
|
|
1478
|
+
const n = Sr(e, t);
|
|
1479
|
+
return {
|
|
1480
|
+
state: n.kind === q.Unchanged ? Cr(e) : e,
|
|
1481
|
+
outcome: n
|
|
1482
|
+
};
|
|
1483
|
+
}
|
|
1484
|
+
function xl(e, t, n) {
|
|
1485
|
+
const [r, o] = M(() => Wt(e)), i = Tl(r, e);
|
|
1486
|
+
return i !== r && o(i), {
|
|
1487
|
+
text: i.text,
|
|
1488
|
+
outcome: Sr(i, t),
|
|
1489
|
+
edit: (a) => o(Pl(i, a)),
|
|
1490
|
+
revert: () => o(Cr(i)),
|
|
1491
|
+
commit: () => {
|
|
1492
|
+
const a = Rl(i, t);
|
|
1493
|
+
o(a.state), a.outcome.kind === q.Set && n(a.outcome.value), a.outcome.kind === q.Unset && n(void 0);
|
|
1494
|
+
}
|
|
1495
|
+
};
|
|
1496
|
+
}
|
|
1497
|
+
var Nl = (e) => e.key === "Enter" && (e.ctrlKey || e.metaKey), Fl = ({ label: e, description: t, value: n, onApply: r, readOnly: o = !1, reason: i, required: a = !1, strings: c, rows: d = 6 }) => {
|
|
1498
|
+
const u = xl(n, a, r), l = Gr(), p = u.outcome.kind === q.Invalid ? bl(u.outcome.problem, c) : void 0, w = [
|
|
1499
|
+
t && `${l}-description`,
|
|
1500
|
+
p && `${l}-problem`,
|
|
1501
|
+
i && `${l}-reason`
|
|
1502
|
+
].filter(Boolean).join(" ") || void 0;
|
|
1503
|
+
return /* @__PURE__ */ b("div", {
|
|
1504
|
+
className: "studio-editor-json",
|
|
1505
|
+
children: [
|
|
1506
|
+
/* @__PURE__ */ s("label", {
|
|
1507
|
+
htmlFor: l,
|
|
1508
|
+
className: "studio-editor-json__label",
|
|
1509
|
+
children: e
|
|
1510
|
+
}),
|
|
1511
|
+
t && /* @__PURE__ */ s("p", {
|
|
1512
|
+
id: `${l}-description`,
|
|
1513
|
+
className: "studio-editor-json__description",
|
|
1514
|
+
children: t
|
|
1515
|
+
}),
|
|
1516
|
+
/* @__PURE__ */ s(ho, {
|
|
1517
|
+
id: l,
|
|
1518
|
+
className: "studio-editor-json__text",
|
|
1519
|
+
value: u.text,
|
|
1520
|
+
rows: d,
|
|
1521
|
+
readOnly: o,
|
|
1522
|
+
invalid: p !== void 0,
|
|
1523
|
+
placeholder: o ? void 0 : c.placeholder,
|
|
1524
|
+
spellCheck: !1,
|
|
1525
|
+
"aria-describedby": w,
|
|
1526
|
+
onChange: u.edit,
|
|
1527
|
+
onBlur: o ? void 0 : u.commit,
|
|
1528
|
+
onKeyDown: (g) => {
|
|
1529
|
+
o || (Nl(g) && u.commit(), g.key === "Escape" && u.revert());
|
|
1530
|
+
}
|
|
1531
|
+
}),
|
|
1532
|
+
p && /* @__PURE__ */ s("p", {
|
|
1533
|
+
id: `${l}-problem`,
|
|
1534
|
+
role: "alert",
|
|
1535
|
+
className: "studio-editor-json__problem",
|
|
1536
|
+
children: p
|
|
1537
|
+
}),
|
|
1538
|
+
o && i && /* @__PURE__ */ s("p", {
|
|
1539
|
+
id: `${l}-reason`,
|
|
1540
|
+
className: "studio-editor-json__reason",
|
|
1541
|
+
children: i
|
|
1542
|
+
})
|
|
1543
|
+
]
|
|
1544
|
+
});
|
|
1545
|
+
}, Dl = ({ properties: e, componentId: t, setProperty: n, strings: r = br }) => e.length === 0 ? null : /* @__PURE__ */ s("section", {
|
|
1546
|
+
className: "studio-editor-json-properties",
|
|
1547
|
+
children: e.map((o) => /* @__PURE__ */ s(Fl, {
|
|
1548
|
+
label: o.descriptor.label,
|
|
1549
|
+
description: o.descriptor.description,
|
|
1550
|
+
value: o.effectiveValue,
|
|
1551
|
+
readOnly: !o.editable || o.descriptor.readOnly === !0,
|
|
1552
|
+
reason: o.reason,
|
|
1553
|
+
required: o.descriptor.constraints?.required === !0,
|
|
1554
|
+
strings: r,
|
|
1555
|
+
onApply: (i) => n(o, i)
|
|
1556
|
+
}, `${t}:${o.descriptor.path}`))
|
|
1557
|
+
}), Ol = A.Json, Ll = (e) => e === Ol, Ml = (e) => Ll(e.descriptor.valueType), El = "action", qt = "presentation", Gt = "arguments", Me = (e) => typeof e == "string" ? e : "";
|
|
1558
|
+
function Al(e, t = "") {
|
|
1559
|
+
const n = Me(e?.command);
|
|
1560
|
+
if (n === "") return;
|
|
1561
|
+
const r = Array.isArray(e?.arguments) ? e[Gt] : [], o = Object.fromEntries(r.map((a) => [Me(a.name), Me(a.source)]).filter(([a]) => a !== "")), i = Me(e?.[qt]);
|
|
1562
|
+
return {
|
|
1563
|
+
sliceId: n,
|
|
1564
|
+
sliceName: t,
|
|
1565
|
+
inputs: o,
|
|
1566
|
+
presentation: Object.values(J).includes(i) ? i : J.None
|
|
1567
|
+
};
|
|
1568
|
+
}
|
|
1569
|
+
function $l(e) {
|
|
1570
|
+
return {
|
|
1571
|
+
command: e.sliceId,
|
|
1572
|
+
[qt]: e.presentation,
|
|
1573
|
+
[Gt]: Object.entries(e.inputs).filter(([, t]) => t.trim() !== "").map(([t, n]) => ({
|
|
1574
|
+
id: t,
|
|
1575
|
+
name: t,
|
|
1576
|
+
source: n.trim()
|
|
1577
|
+
}))
|
|
1578
|
+
};
|
|
1579
|
+
}
|
|
1580
|
+
function _l(e, t) {
|
|
1581
|
+
const n = Q(e);
|
|
1582
|
+
return Object.entries($l(t)).map(([r, o]) => ({
|
|
1583
|
+
kind: U.SetProperty,
|
|
1584
|
+
nodeId: n,
|
|
1585
|
+
path: r,
|
|
1586
|
+
value: o
|
|
1587
|
+
}));
|
|
1588
|
+
}
|
|
1589
|
+
var Bl = (e) => e.descriptor.valueType === A.QueryReference, zl = /* @__PURE__ */ new Set([Gt]), Ul = (e) => e.descriptor.valueType === A.Collection && !!e.descriptor.item && !zl.has(e.descriptor.path), jl = ({ controller: e, environment: t, strings: n, ownership: r, authoringTemplate: o }) => {
|
|
1590
|
+
const { inspection: i, selectedId: a, selection: c } = e, d = n.properties, u = _(() => Es(t.availableSources), [t.availableSources]);
|
|
1591
|
+
if (!a || !c || !i) return /* @__PURE__ */ s("p", {
|
|
1592
|
+
className: "studio-editor-properties-empty",
|
|
1593
|
+
children: n.noSelection
|
|
1594
|
+
});
|
|
1595
|
+
const l = ds(e.composition.roots, a), p = bs(i.properties, l, c.properties), w = Vs(p, i.typeId), g = new Map(i.properties.map((m) => [m.descriptor.path, m])), k = i.properties.filter(Bl), x = i.properties.filter(Ul), C = i.properties.filter((m) => m.descriptor.valueType === A.Icon), I = i.properties.filter(Ml), F = [...i.diagnostics, ...e.diagnostics], { runtime: N } = t, E = i.typeId.endsWith("action"), v = c.properties, T = (m) => {
|
|
1596
|
+
const f = g.get(m.name);
|
|
1597
|
+
if (!f) return;
|
|
1598
|
+
if (f.descriptor.valueType !== A.Enum) return e.setProperty(f, m.value);
|
|
1599
|
+
const y = $s(f, m.value);
|
|
1600
|
+
y && e.setProperty(f, y.value);
|
|
1601
|
+
}, R = (m, f) => e.apply(fr(a, m, f), "Bind query");
|
|
1602
|
+
return /* @__PURE__ */ b("div", {
|
|
1603
|
+
className: "studio-editor-properties",
|
|
1604
|
+
children: [
|
|
1605
|
+
/* @__PURE__ */ b("header", {
|
|
1606
|
+
className: "studio-editor-properties__header",
|
|
1607
|
+
children: [
|
|
1608
|
+
/* @__PURE__ */ s("strong", { children: i.label }),
|
|
1609
|
+
/* @__PURE__ */ s("span", { children: i.typeId }),
|
|
1610
|
+
r && /* @__PURE__ */ s(ur, {
|
|
1611
|
+
ownership: r,
|
|
1612
|
+
label: n.ownership[r]
|
|
1613
|
+
})
|
|
1614
|
+
]
|
|
1615
|
+
}),
|
|
1616
|
+
r && /* @__PURE__ */ s("p", {
|
|
1617
|
+
className: "studio-editor-properties__hint",
|
|
1618
|
+
children: n.ownershipHint[r]
|
|
1619
|
+
}),
|
|
1620
|
+
/* @__PURE__ */ s(hr, {
|
|
1621
|
+
diagnostics: gl(F),
|
|
1622
|
+
label: d.diagnostics
|
|
1623
|
+
}),
|
|
1624
|
+
/* @__PURE__ */ s(ll, {
|
|
1625
|
+
inspection: i,
|
|
1626
|
+
controller: e,
|
|
1627
|
+
strings: n,
|
|
1628
|
+
disabled: r !== void 0 && r !== "local"
|
|
1629
|
+
}),
|
|
1630
|
+
w.groups.length > 0 ? /* @__PURE__ */ s(vo, {
|
|
1631
|
+
groups: w.groups,
|
|
1632
|
+
values: w.values,
|
|
1633
|
+
onChange: T,
|
|
1634
|
+
"aria-label": n.propertiesTab
|
|
1635
|
+
}) : i.properties.length === 0 && /* @__PURE__ */ s("p", {
|
|
1636
|
+
className: "studio-editor-properties-empty",
|
|
1637
|
+
children: d.noProperties
|
|
1638
|
+
}),
|
|
1639
|
+
/* @__PURE__ */ s(yl, {
|
|
1640
|
+
properties: C,
|
|
1641
|
+
controller: e,
|
|
1642
|
+
catalog: N.icons,
|
|
1643
|
+
adapters: N.iconAdapters,
|
|
1644
|
+
diagnostics: F,
|
|
1645
|
+
strings: n
|
|
1646
|
+
}),
|
|
1647
|
+
/* @__PURE__ */ s(Dl, {
|
|
1648
|
+
properties: I,
|
|
1649
|
+
componentId: a,
|
|
1650
|
+
setProperty: e.setProperty,
|
|
1651
|
+
strings: d.json
|
|
1652
|
+
}),
|
|
1653
|
+
x.map((m) => /* @__PURE__ */ s(Vl, {
|
|
1654
|
+
property: m,
|
|
1655
|
+
componentId: a,
|
|
1656
|
+
controller: e,
|
|
1657
|
+
strings: n,
|
|
1658
|
+
destinations: t.destinations,
|
|
1659
|
+
icons: {
|
|
1660
|
+
catalog: N.icons,
|
|
1661
|
+
adapters: N.iconAdapters,
|
|
1662
|
+
diagnostics: F
|
|
1663
|
+
}
|
|
1664
|
+
}, m.descriptor.path)),
|
|
1665
|
+
k.map((m) => /* @__PURE__ */ s(ol, {
|
|
1666
|
+
property: m,
|
|
1667
|
+
candidates: t.queryCandidates,
|
|
1668
|
+
scope: u,
|
|
1669
|
+
strings: n,
|
|
1670
|
+
disabled: !m.editable,
|
|
1671
|
+
onChange: (f) => R(m, f)
|
|
1672
|
+
}, `${a}:${m.descriptor.path}`)),
|
|
1673
|
+
E && /* @__PURE__ */ s(Ks, {
|
|
1674
|
+
action: Al(v, t.stateChangeSlices.find((m) => m.id === v?.command)?.name ?? ""),
|
|
1675
|
+
slices: t.stateChangeSlices,
|
|
1676
|
+
sources: Object.keys(t.availableSources),
|
|
1677
|
+
strings: n,
|
|
1678
|
+
disabled: r !== void 0 && r !== "local",
|
|
1679
|
+
suggestSource: (m) => m === "id" || m.endsWith("Id") ? "row.id" : void 0,
|
|
1680
|
+
onChange: (m) => m && e.applyAll(_l(a, m), n.properties.action.label)
|
|
1681
|
+
}),
|
|
1682
|
+
/* @__PURE__ */ s(ml, {
|
|
1683
|
+
inspection: i,
|
|
1684
|
+
componentId: a,
|
|
1685
|
+
controller: e,
|
|
1686
|
+
strings: n,
|
|
1687
|
+
authoringTemplate: o
|
|
1688
|
+
})
|
|
1689
|
+
]
|
|
1690
|
+
});
|
|
1691
|
+
}, Vl = ({ property: e, componentId: t, controller: n, strings: r, destinations: o, icons: i }) => {
|
|
1692
|
+
const { items: a, fixed: c } = Fs(e), d = vl(i.diagnostics, e.descriptor.path);
|
|
1693
|
+
return /* @__PURE__ */ s("section", {
|
|
1694
|
+
className: "studio-editor-properties__collection",
|
|
1695
|
+
children: /* @__PURE__ */ s(go, {
|
|
1696
|
+
items: a,
|
|
1697
|
+
fixedItems: c,
|
|
1698
|
+
capabilities: Ds(e),
|
|
1699
|
+
destinations: o,
|
|
1700
|
+
validation: d,
|
|
1701
|
+
renderIconField: (u) => /* @__PURE__ */ s(mr, {
|
|
1702
|
+
value: u.value,
|
|
1703
|
+
onChange: u.onChange,
|
|
1704
|
+
allowed: gr(e.descriptor.item?.properties.find((l) => l.path === "icon")?.choices),
|
|
1705
|
+
catalog: i.catalog,
|
|
1706
|
+
adapters: i.adapters,
|
|
1707
|
+
readOnly: u.readOnly,
|
|
1708
|
+
showMessage: !1,
|
|
1709
|
+
invalid: u.invalid,
|
|
1710
|
+
strings: r.properties.icon,
|
|
1711
|
+
pickerLabels: r.properties.iconPickerLabels,
|
|
1712
|
+
"aria-label": u["aria-label"],
|
|
1713
|
+
"aria-describedby": u["aria-describedby"]
|
|
1714
|
+
}),
|
|
1715
|
+
"aria-label": e.descriptor.label,
|
|
1716
|
+
createItem: () => ({
|
|
1717
|
+
id: globalThis.crypto.randomUUID(),
|
|
1718
|
+
label: "",
|
|
1719
|
+
values: {}
|
|
1720
|
+
}),
|
|
1721
|
+
onChange: (u) => n.applyAll(Os(t, e, u), r.properties.itemsLabel)
|
|
1722
|
+
})
|
|
1723
|
+
});
|
|
1724
|
+
}, kr = ({ strings: e, controller: t, environment: n, authoringTemplate: r, structure: o, onClose: i }) => {
|
|
1725
|
+
const [a, c] = M(pt.Properties), d = t.selectedId ? t.ownershipOf(t.selectedId) : void 0;
|
|
1726
|
+
return /* @__PURE__ */ b("section", {
|
|
1727
|
+
className: "studio-editor-inspector",
|
|
1728
|
+
"aria-label": e.inspectorTitle,
|
|
1729
|
+
children: [/* @__PURE__ */ b("header", {
|
|
1730
|
+
className: "studio-editor-inspector__header",
|
|
1731
|
+
children: [/* @__PURE__ */ s("h2", {
|
|
1732
|
+
className: "studio-editor-inspector__title",
|
|
1733
|
+
children: e.inspectorTitle
|
|
1734
|
+
}), /* @__PURE__ */ s("button", {
|
|
1735
|
+
type: "button",
|
|
1736
|
+
className: "studio-editor-inspector__close",
|
|
1737
|
+
"aria-label": e.closeInspector,
|
|
1738
|
+
title: e.closeInspector,
|
|
1739
|
+
onClick: i,
|
|
1740
|
+
children: "×"
|
|
1741
|
+
})]
|
|
1742
|
+
}), /* @__PURE__ */ s(fo, {
|
|
1743
|
+
className: "studio-editor-inspector__tabs",
|
|
1744
|
+
"aria-label": e.inspectorTitle,
|
|
1745
|
+
value: a,
|
|
1746
|
+
onChange: c,
|
|
1747
|
+
tabs: [{
|
|
1748
|
+
id: pt.Properties,
|
|
1749
|
+
label: e.propertiesTab,
|
|
1750
|
+
content: /* @__PURE__ */ s(jl, {
|
|
1751
|
+
controller: t,
|
|
1752
|
+
environment: n,
|
|
1753
|
+
strings: e,
|
|
1754
|
+
ownership: d,
|
|
1755
|
+
authoringTemplate: r
|
|
1756
|
+
})
|
|
1757
|
+
}, {
|
|
1758
|
+
id: pt.Structure,
|
|
1759
|
+
label: e.structureTab,
|
|
1760
|
+
content: o
|
|
1761
|
+
}]
|
|
1762
|
+
})]
|
|
1763
|
+
});
|
|
1764
|
+
}, Xe = (e) => {
|
|
1765
|
+
const t = e;
|
|
1766
|
+
return !!t && (t.kind === "layout" && typeof t.item == "string" || t.kind === "component" && typeof t.componentName == "string" && typeof t.package == "string");
|
|
1767
|
+
}, Ht = "application/x-studio-palette-item", Ir = "application/x-studio-element";
|
|
1768
|
+
function Pr(e, t, n) {
|
|
1769
|
+
const r = document.createElement("div");
|
|
1770
|
+
r.className = "studio-drag-preview", n && r.append(n.cloneNode(!0)), r.append(Object.assign(document.createElement("span"), { textContent: t })), document.body.append(r), e.dataTransfer.setDragImage(r, 14, 14), setTimeout(() => r.remove(), 0);
|
|
1771
|
+
}
|
|
1772
|
+
var Wl = (e, t, n) => {
|
|
1773
|
+
e.dataTransfer.setData(Ht, JSON.stringify(t)), e.dataTransfer.effectAllowed = "copyMove", n && Pr(e, n, e.currentTarget instanceof Element ? e.currentTarget.querySelector("svg") : null);
|
|
1774
|
+
}, ql = (e, t, n) => {
|
|
1775
|
+
e.dataTransfer.setData(Ir, t), e.dataTransfer.effectAllowed = "move", Pr(e, n);
|
|
1776
|
+
}, Gl = (e) => e.dataTransfer.getData("application/x-studio-element") || void 0, Rt = (e) => e.dataTransfer.types.includes(Ir), Ee = (e) => Kl(e) || Rt(e);
|
|
1777
|
+
function Hl(e) {
|
|
1778
|
+
try {
|
|
1779
|
+
const t = JSON.parse(e.dataTransfer.getData(Ht));
|
|
1780
|
+
return Xe(t) ? t : void 0;
|
|
1781
|
+
} catch {
|
|
1782
|
+
return;
|
|
1783
|
+
}
|
|
1784
|
+
}
|
|
1785
|
+
var Kl = (e) => e.dataTransfer.types.includes(Ht), Tr = ({ drawers: e, closeLabel: t, onActivate: n }) => /* @__PURE__ */ s(Ie, { children: e.map((r) => /* @__PURE__ */ s(Ro, {
|
|
1786
|
+
className: "studio-palette-folder",
|
|
1787
|
+
icon: r.icon,
|
|
1788
|
+
title: r.title,
|
|
1789
|
+
heading: r.title,
|
|
1790
|
+
closeLabel: t,
|
|
1791
|
+
presentation: "drawer",
|
|
1792
|
+
items: r.items,
|
|
1793
|
+
draggable: !0,
|
|
1794
|
+
onActivate: (o) => n(o.payload),
|
|
1795
|
+
onItemDragStart: (o, i) => Xe(o.payload) && Wl(i, o.payload, o.title)
|
|
1796
|
+
}, r.id)) }), me = /* @__PURE__ */ (function(e) {
|
|
1797
|
+
return e.Panel = "Panel", e.StackPanel = "StackPanel", e.WrapPanel = "WrapPanel", e.Grid = "Grid", e.Canvas = "Canvas", e;
|
|
1798
|
+
})({}), Jl = [
|
|
1799
|
+
{
|
|
1800
|
+
item: S.Stack,
|
|
1801
|
+
type: "Stack",
|
|
1802
|
+
panel: me.StackPanel,
|
|
1803
|
+
flowKind: et.Column,
|
|
1804
|
+
arrangement: L.Column
|
|
1805
|
+
},
|
|
1806
|
+
{
|
|
1807
|
+
item: S.Row,
|
|
1808
|
+
type: "Row",
|
|
1809
|
+
panel: me.StackPanel,
|
|
1810
|
+
flowKind: et.Row,
|
|
1811
|
+
arrangement: L.Row
|
|
1812
|
+
},
|
|
1813
|
+
{
|
|
1814
|
+
item: S.Grid,
|
|
1815
|
+
type: "Grid",
|
|
1816
|
+
panel: me.Grid,
|
|
1817
|
+
flowKind: et.Grid,
|
|
1818
|
+
arrangement: L.Grid
|
|
1819
|
+
},
|
|
1820
|
+
{
|
|
1821
|
+
item: S.Container,
|
|
1822
|
+
type: "Container",
|
|
1823
|
+
panel: me.Panel,
|
|
1824
|
+
arrangement: L.Grouping
|
|
1825
|
+
},
|
|
1826
|
+
{
|
|
1827
|
+
item: S.Wrap,
|
|
1828
|
+
type: "Wrap",
|
|
1829
|
+
panel: me.WrapPanel,
|
|
1830
|
+
arrangement: L.Wrap
|
|
1831
|
+
},
|
|
1832
|
+
{
|
|
1833
|
+
item: S.Canvas,
|
|
1834
|
+
type: "Canvas",
|
|
1835
|
+
panel: me.Canvas,
|
|
1836
|
+
arrangement: L.Freeform
|
|
1837
|
+
}
|
|
1838
|
+
], Ql = /* @__PURE__ */ new Set([
|
|
1839
|
+
"column",
|
|
1840
|
+
"screenShell",
|
|
1841
|
+
"shell"
|
|
1842
|
+
]), Rr = (e) => e.replace(/([A-Z])/g, " $1").replace(/^./, (t) => t.toUpperCase()).trim(), Yl = (e) => e.split(".").map(Rr).join(" ");
|
|
1843
|
+
function xr(e, t, n, r, o = {}) {
|
|
1844
|
+
return [{
|
|
1845
|
+
id: "layout",
|
|
1846
|
+
title: e,
|
|
1847
|
+
icon: n.drawer.layout,
|
|
1848
|
+
items: Jl.map((i) => ({
|
|
1849
|
+
id: `layout:${i.item}`,
|
|
1850
|
+
title: t[i.item],
|
|
1851
|
+
icon: n.layout(i.item),
|
|
1852
|
+
payload: {
|
|
1853
|
+
kind: "layout",
|
|
1854
|
+
item: i.item
|
|
1855
|
+
}
|
|
1856
|
+
}))
|
|
1857
|
+
}, ...r.map((i) => ({
|
|
1858
|
+
id: `package:${i.package}`,
|
|
1859
|
+
title: o[i.package] ?? Yl(i.package),
|
|
1860
|
+
icon: n.drawer.package(i.package),
|
|
1861
|
+
items: i.components.filter((a) => !Ql.has(a)).map((a) => ({
|
|
1862
|
+
id: `component:${i.package}:${a}`,
|
|
1863
|
+
title: Rr(a),
|
|
1864
|
+
icon: n.component(a),
|
|
1865
|
+
payload: {
|
|
1866
|
+
kind: "component",
|
|
1867
|
+
componentName: a,
|
|
1868
|
+
package: i.package
|
|
1869
|
+
}
|
|
1870
|
+
}))
|
|
1871
|
+
})).filter((i) => i.items.length > 0)];
|
|
1872
|
+
}
|
|
1873
|
+
var Zl = "core", Xl = /* @__PURE__ */ new Set([El]);
|
|
1874
|
+
function Kt(e, t) {
|
|
1875
|
+
return Xl.has(e) && t === "core" ? `${Zl}:${e}` : e;
|
|
1876
|
+
}
|
|
1877
|
+
function xt(e) {
|
|
1878
|
+
return e ? $t(e) ? pe.grid : _t(e) ? e.orientation === we.Horizontal ? pe.flexRow : pe.flexColumn : ce(e) ? pe.absolute : pe.flexColumn : pe.absolute;
|
|
1879
|
+
}
|
|
1880
|
+
function Nr(e, t) {
|
|
1881
|
+
return {
|
|
1882
|
+
id: e,
|
|
1883
|
+
name: t,
|
|
1884
|
+
visibility: Et.Visible,
|
|
1885
|
+
isEnabled: !0,
|
|
1886
|
+
opacity: 1,
|
|
1887
|
+
size: {},
|
|
1888
|
+
zIndex: 0,
|
|
1889
|
+
minimumSize: {},
|
|
1890
|
+
maximumSize: {},
|
|
1891
|
+
margin: {
|
|
1892
|
+
left: 0,
|
|
1893
|
+
top: 0,
|
|
1894
|
+
right: 0,
|
|
1895
|
+
bottom: 0
|
|
1896
|
+
},
|
|
1897
|
+
horizontalAlignment: Lt.Stretch,
|
|
1898
|
+
verticalAlignment: Mt.Stretch,
|
|
1899
|
+
properties: {}
|
|
1900
|
+
};
|
|
1901
|
+
}
|
|
1902
|
+
var Sn = {
|
|
1903
|
+
unitType: Jr.Star,
|
|
1904
|
+
value: 1
|
|
1905
|
+
};
|
|
1906
|
+
function Qe(e, t, n, r = [], o = {}) {
|
|
1907
|
+
const i = ec(e, o);
|
|
1908
|
+
return {
|
|
1909
|
+
...Nr(t, n),
|
|
1910
|
+
children: r,
|
|
1911
|
+
...i
|
|
1912
|
+
};
|
|
1913
|
+
}
|
|
1914
|
+
function ec(e, t) {
|
|
1915
|
+
switch (e) {
|
|
1916
|
+
case S.Stack:
|
|
1917
|
+
return {
|
|
1918
|
+
orientation: we.Vertical,
|
|
1919
|
+
spacing: 8
|
|
1920
|
+
};
|
|
1921
|
+
case S.Row:
|
|
1922
|
+
return {
|
|
1923
|
+
orientation: we.Horizontal,
|
|
1924
|
+
spacing: 8
|
|
1925
|
+
};
|
|
1926
|
+
case S.Grid:
|
|
1927
|
+
return {
|
|
1928
|
+
rows: [],
|
|
1929
|
+
columns: [{
|
|
1930
|
+
width: Sn,
|
|
1931
|
+
minimumWidth: 0,
|
|
1932
|
+
maximumWidth: Number.POSITIVE_INFINITY
|
|
1933
|
+
}, {
|
|
1934
|
+
width: Sn,
|
|
1935
|
+
minimumWidth: 0,
|
|
1936
|
+
maximumWidth: Number.POSITIVE_INFINITY
|
|
1937
|
+
}]
|
|
1938
|
+
};
|
|
1939
|
+
case S.Wrap:
|
|
1940
|
+
return { orientation: we.Horizontal };
|
|
1941
|
+
case S.Canvas:
|
|
1942
|
+
return { extent: t };
|
|
1943
|
+
case S.Container:
|
|
1944
|
+
return {};
|
|
1945
|
+
}
|
|
1946
|
+
}
|
|
1947
|
+
var oe = /* @__PURE__ */ (function(e) {
|
|
1948
|
+
return e.NotJson = "notJson", e.WrongShape = "wrongShape", e.MissingScreen = "missingScreen", e.MissingTemplate = "missingTemplate", e;
|
|
1949
|
+
})({}), tc = [
|
|
1950
|
+
"layouts",
|
|
1951
|
+
"screenTemplates",
|
|
1952
|
+
"dialogTemplates",
|
|
1953
|
+
"screens",
|
|
1954
|
+
"exposures",
|
|
1955
|
+
"instanceContributions"
|
|
1956
|
+
];
|
|
1957
|
+
function nc(e, t) {
|
|
1958
|
+
let n = e;
|
|
1959
|
+
if (typeof e == "string") try {
|
|
1960
|
+
n = JSON.parse(e);
|
|
1961
|
+
} catch {
|
|
1962
|
+
return {
|
|
1963
|
+
readable: !1,
|
|
1964
|
+
problem: oe.NotJson
|
|
1965
|
+
};
|
|
1966
|
+
}
|
|
1967
|
+
const r = n;
|
|
1968
|
+
if (!r || typeof r != "object" || tc.some((i) => !Array.isArray(r[i]))) return {
|
|
1969
|
+
readable: !1,
|
|
1970
|
+
problem: oe.WrongShape
|
|
1971
|
+
};
|
|
1972
|
+
const o = r;
|
|
1973
|
+
return t !== void 0 ? o.screenTemplates.some((i) => i.name === t) ? {
|
|
1974
|
+
readable: !0,
|
|
1975
|
+
document: o
|
|
1976
|
+
} : {
|
|
1977
|
+
readable: !1,
|
|
1978
|
+
problem: oe.MissingTemplate
|
|
1979
|
+
} : o.screens.some((i) => i.name === "Screen") ? {
|
|
1980
|
+
readable: !0,
|
|
1981
|
+
document: o
|
|
1982
|
+
} : {
|
|
1983
|
+
readable: !1,
|
|
1984
|
+
problem: oe.MissingScreen
|
|
1985
|
+
};
|
|
1986
|
+
}
|
|
1987
|
+
function Fr(e) {
|
|
1988
|
+
const t = e.documentText ?? e.document;
|
|
1989
|
+
if (t !== void 0) {
|
|
1990
|
+
const n = nc(t, e.authoringTemplate);
|
|
1991
|
+
return n.readable ? {
|
|
1992
|
+
opened: !0,
|
|
1993
|
+
subject: { document: n.document }
|
|
1994
|
+
} : {
|
|
1995
|
+
opened: !1,
|
|
1996
|
+
problem: n.problem
|
|
1997
|
+
};
|
|
1998
|
+
}
|
|
1999
|
+
return {
|
|
2000
|
+
opened: !0,
|
|
2001
|
+
subject: { document: rc(e) }
|
|
2002
|
+
};
|
|
2003
|
+
}
|
|
2004
|
+
function rc(e) {
|
|
2005
|
+
return e.authoringTemplate !== void 0 ? Xa(e.authoringTemplate, Qe(S.Stack, Qa, "Template")) : Za(Qe(S.Stack, Ya, "Screen"), e.screenTemplate);
|
|
2006
|
+
}
|
|
2007
|
+
var Dr = ({ placement: e, children: t }) => /* @__PURE__ */ s("div", {
|
|
2008
|
+
className: "studio-screen-editor-palette-host",
|
|
2009
|
+
"data-placement": e,
|
|
2010
|
+
"data-cratis-part": "screen-editor-palette",
|
|
2011
|
+
children: /* @__PURE__ */ s(To, { children: t })
|
|
2012
|
+
}), Or = ({ strings: e, onClose: t, children: n }) => /* @__PURE__ */ s($n, {
|
|
2013
|
+
fallback: /* @__PURE__ */ b("div", {
|
|
2014
|
+
className: "studio-screen-editor-unreadable",
|
|
2015
|
+
role: "alertdialog",
|
|
2016
|
+
"aria-label": e.stopped.title,
|
|
2017
|
+
children: [
|
|
2018
|
+
/* @__PURE__ */ s("strong", { children: e.stopped.title }),
|
|
2019
|
+
/* @__PURE__ */ s("p", { children: e.stopped.message }),
|
|
2020
|
+
t && /* @__PURE__ */ s("div", { children: /* @__PURE__ */ s("button", {
|
|
2021
|
+
type: "button",
|
|
2022
|
+
onClick: t,
|
|
2023
|
+
children: e.stopped.close
|
|
2024
|
+
}) })
|
|
2025
|
+
]
|
|
2026
|
+
}),
|
|
2027
|
+
children: n
|
|
2028
|
+
}), Lr = ({ problem: e, strings: t, onClose: n }) => /* @__PURE__ */ b("div", {
|
|
2029
|
+
className: "studio-screen-editor-unreadable",
|
|
2030
|
+
role: "alertdialog",
|
|
2031
|
+
"aria-label": t.unreadable.title,
|
|
2032
|
+
children: [
|
|
2033
|
+
/* @__PURE__ */ s("strong", { children: t.unreadable.title }),
|
|
2034
|
+
/* @__PURE__ */ s("p", { children: t.unreadable.reasons[e] }),
|
|
2035
|
+
/* @__PURE__ */ s("p", { children: t.unreadable.warning }),
|
|
2036
|
+
n && /* @__PURE__ */ s("div", { children: /* @__PURE__ */ s("button", {
|
|
2037
|
+
type: "button",
|
|
2038
|
+
onClick: n,
|
|
2039
|
+
children: t.unreadable.close
|
|
2040
|
+
}) })
|
|
2041
|
+
]
|
|
2042
|
+
}), Mr = ({ environment: e, children: t }) => {
|
|
2043
|
+
const n = /* @__PURE__ */ s(xo, {
|
|
2044
|
+
handler: e.fileUpload?.handler,
|
|
2045
|
+
allowedOrigins: e.fileUpload?.allowedOrigins,
|
|
2046
|
+
children: t
|
|
2047
|
+
});
|
|
2048
|
+
return e.richText ? /* @__PURE__ */ s(No, {
|
|
2049
|
+
loader: e.richText,
|
|
2050
|
+
children: n
|
|
2051
|
+
}) : n;
|
|
2052
|
+
}, oc = ({ controls: e }) => /* @__PURE__ */ s("div", {
|
|
2053
|
+
className: "studio-window-title-bar",
|
|
2054
|
+
role: "toolbar",
|
|
2055
|
+
children: /* @__PURE__ */ s("div", {
|
|
2056
|
+
className: "studio-window-title-bar__controls",
|
|
2057
|
+
children: e
|
|
2058
|
+
})
|
|
2059
|
+
}), ke = /* @__PURE__ */ (function(e) {
|
|
2060
|
+
return e.Desktop = "desktop", e.Mobile = "mobile", e;
|
|
2061
|
+
})({}), Jt = {
|
|
2062
|
+
[ke.Desktop]: {
|
|
2063
|
+
width: 1280,
|
|
2064
|
+
height: 800
|
|
2065
|
+
},
|
|
2066
|
+
[ke.Mobile]: {
|
|
2067
|
+
width: 390,
|
|
2068
|
+
height: 844
|
|
2069
|
+
}
|
|
2070
|
+
};
|
|
2071
|
+
function Er(e, t) {
|
|
2072
|
+
return {
|
|
2073
|
+
width: Math.min(e.width, t.width),
|
|
2074
|
+
height: Math.min(e.height + 40, t.height)
|
|
2075
|
+
};
|
|
2076
|
+
}
|
|
2077
|
+
function Ar(e) {
|
|
2078
|
+
return {
|
|
2079
|
+
width: e.width,
|
|
2080
|
+
height: Math.max(0, e.height - 40)
|
|
2081
|
+
};
|
|
2082
|
+
}
|
|
2083
|
+
function ic(e, t) {
|
|
2084
|
+
return Object.values(ke).find((n) => {
|
|
2085
|
+
const r = Er(Jt[n], t);
|
|
2086
|
+
return r.width === e.width && r.height === e.height;
|
|
2087
|
+
});
|
|
2088
|
+
}
|
|
2089
|
+
function ac(e) {
|
|
2090
|
+
const t = Ar(e);
|
|
2091
|
+
return ro(t.width, t.height);
|
|
2092
|
+
}
|
|
2093
|
+
var sc = ({ windowSize: e, available: t, strings: n, onResize: r }) => {
|
|
2094
|
+
const o = ic(e, t), i = Ar(e), a = ac(e), c = (d, u, l) => /* @__PURE__ */ s(Pe, {
|
|
2095
|
+
icon: u,
|
|
2096
|
+
"aria-label": l,
|
|
2097
|
+
"aria-pressed": o === d,
|
|
2098
|
+
title: l,
|
|
2099
|
+
variant: "ghost",
|
|
2100
|
+
size: "small",
|
|
2101
|
+
onClick: () => r(Er(Jt[d], t))
|
|
2102
|
+
});
|
|
2103
|
+
return /* @__PURE__ */ b("div", {
|
|
2104
|
+
className: "studio-editor-viewport-controls",
|
|
2105
|
+
role: "group",
|
|
2106
|
+
"aria-label": n.sizeClass(a.width, a.height),
|
|
2107
|
+
children: [
|
|
2108
|
+
c(ke.Desktop, /* @__PURE__ */ s(yt, { "aria-hidden": "true" }), n.desktopPreview),
|
|
2109
|
+
c(ke.Mobile, /* @__PURE__ */ s(ri, { "aria-hidden": "true" }), n.mobilePreview),
|
|
2110
|
+
/* @__PURE__ */ b("span", {
|
|
2111
|
+
className: "studio-editor-viewport-controls__size",
|
|
2112
|
+
role: "status",
|
|
2113
|
+
children: [
|
|
2114
|
+
n.viewportSize(i.width, i.height),
|
|
2115
|
+
" · ",
|
|
2116
|
+
n.sizeClass(a.width, a.height)
|
|
2117
|
+
]
|
|
2118
|
+
})
|
|
2119
|
+
]
|
|
2120
|
+
});
|
|
2121
|
+
};
|
|
2122
|
+
function lc(e) {
|
|
2123
|
+
return e === void 0 ? "" : e.isDark ? "cratis-theme cratis-dark" : "cratis-theme cratis-light";
|
|
2124
|
+
}
|
|
2125
|
+
function cc(e) {
|
|
2126
|
+
const t = e.bundles.flatMap((n) => n.themes ?? []);
|
|
2127
|
+
return t.find((n) => n.name === e.profile.theme) ?? t[0];
|
|
2128
|
+
}
|
|
2129
|
+
var Nt = ({ elementId: e, tone: t, text: n }) => /* @__PURE__ */ s("div", {
|
|
2130
|
+
className: "studio-design-placeholder",
|
|
2131
|
+
"data-studio-placeholder-for": e,
|
|
2132
|
+
"data-tone": t,
|
|
2133
|
+
role: "note",
|
|
2134
|
+
children: n
|
|
2135
|
+
}), je = /* @__PURE__ */ (function(e) {
|
|
2136
|
+
return e.Empty = "empty", e.Failed = "failed", e.Declaration = "declaration", e;
|
|
2137
|
+
})({}), j = /* @__PURE__ */ (function(e) {
|
|
2138
|
+
return e.Window = "window", e.Toast = "toast", e.Tooltip = "tooltip", e.Mask = "mask", e.Busy = "busy", e;
|
|
2139
|
+
})({}), dc = {
|
|
2140
|
+
dialog: j.Window,
|
|
2141
|
+
confirmDialog: j.Window,
|
|
2142
|
+
confirmationDialog: j.Window,
|
|
2143
|
+
commandDialog: j.Window,
|
|
2144
|
+
stepperCommandDialog: j.Window,
|
|
2145
|
+
overlayPanel: j.Window,
|
|
2146
|
+
sidebar: j.Window,
|
|
2147
|
+
toast: j.Toast,
|
|
2148
|
+
tooltip: j.Tooltip,
|
|
2149
|
+
blockUI: j.Mask,
|
|
2150
|
+
busyIndicatorDialog: j.Busy
|
|
2151
|
+
}, fe = (e, ...t) => {
|
|
2152
|
+
for (const n of t) {
|
|
2153
|
+
const r = e.properties?.[n];
|
|
2154
|
+
if (typeof r == "string" && r.length > 0) return r;
|
|
2155
|
+
}
|
|
2156
|
+
};
|
|
2157
|
+
function uc({ kind: e, tag: t, element: n, slots: r, message: o }) {
|
|
2158
|
+
const i = r.content ?? [], a = fe(n, "header", "title", "summary") ?? n.name ?? n.componentName, c = fe(n, "message", "detail", "text", "label"), d = () => {
|
|
2159
|
+
switch (e) {
|
|
2160
|
+
case j.Toast:
|
|
2161
|
+
return o ? Ve(o, {
|
|
2162
|
+
element: {
|
|
2163
|
+
...n,
|
|
2164
|
+
componentName: "message",
|
|
2165
|
+
properties: {
|
|
2166
|
+
severity: n.properties?.severity ?? "success",
|
|
2167
|
+
text: [fe(n, "summary"), fe(n, "detail")].filter(Boolean).join(" - ") || a
|
|
2168
|
+
}
|
|
2169
|
+
},
|
|
2170
|
+
slots: {}
|
|
2171
|
+
}) : /* @__PURE__ */ s("div", {
|
|
2172
|
+
className: "studio-overlay-preview__body",
|
|
2173
|
+
children: a
|
|
2174
|
+
});
|
|
2175
|
+
case j.Tooltip:
|
|
2176
|
+
return /* @__PURE__ */ b("div", {
|
|
2177
|
+
className: "studio-overlay-preview__tooltip",
|
|
2178
|
+
children: [/* @__PURE__ */ s("span", {
|
|
2179
|
+
className: "studio-overlay-preview__trigger",
|
|
2180
|
+
children: i.length > 0 ? i : fe(n, "label") ?? a
|
|
2181
|
+
}), /* @__PURE__ */ s("span", {
|
|
2182
|
+
className: "studio-overlay-preview__bubble",
|
|
2183
|
+
role: "tooltip",
|
|
2184
|
+
children: fe(n, "text") ?? a
|
|
2185
|
+
})]
|
|
2186
|
+
});
|
|
2187
|
+
case j.Mask:
|
|
2188
|
+
return /* @__PURE__ */ b("div", {
|
|
2189
|
+
className: "studio-overlay-preview__masked",
|
|
2190
|
+
children: [/* @__PURE__ */ s("div", {
|
|
2191
|
+
className: "studio-overlay-preview__body",
|
|
2192
|
+
children: i.length > 0 ? i : a
|
|
2193
|
+
}), /* @__PURE__ */ s("div", {
|
|
2194
|
+
className: "studio-overlay-preview__mask",
|
|
2195
|
+
children: /* @__PURE__ */ s("i", {
|
|
2196
|
+
className: "pi pi-lock",
|
|
2197
|
+
"aria-hidden": "true"
|
|
2198
|
+
})
|
|
2199
|
+
})]
|
|
2200
|
+
});
|
|
2201
|
+
case j.Busy:
|
|
2202
|
+
return /* @__PURE__ */ b("div", {
|
|
2203
|
+
className: "studio-overlay-preview__busy",
|
|
2204
|
+
children: [/* @__PURE__ */ s("i", {
|
|
2205
|
+
className: "pi pi-spin pi-spinner",
|
|
2206
|
+
"aria-hidden": "true"
|
|
2207
|
+
}), /* @__PURE__ */ s("span", { children: c ?? a })]
|
|
2208
|
+
});
|
|
2209
|
+
default:
|
|
2210
|
+
return /* @__PURE__ */ b("div", {
|
|
2211
|
+
className: "studio-overlay-preview__window",
|
|
2212
|
+
children: [/* @__PURE__ */ b("div", {
|
|
2213
|
+
className: "studio-overlay-preview__header",
|
|
2214
|
+
children: [/* @__PURE__ */ s("strong", { children: a }), /* @__PURE__ */ s("i", {
|
|
2215
|
+
className: "pi pi-times",
|
|
2216
|
+
"aria-hidden": "true"
|
|
2217
|
+
})]
|
|
2218
|
+
}), /* @__PURE__ */ s("div", {
|
|
2219
|
+
className: "studio-overlay-preview__body",
|
|
2220
|
+
children: i.length > 0 ? i : c
|
|
2221
|
+
})]
|
|
2222
|
+
});
|
|
2223
|
+
}
|
|
2224
|
+
};
|
|
2225
|
+
return /* @__PURE__ */ b("div", {
|
|
2226
|
+
className: "studio-overlay-preview",
|
|
2227
|
+
"data-overlay": e,
|
|
2228
|
+
"data-scene-id": n.id,
|
|
2229
|
+
children: [/* @__PURE__ */ s("span", {
|
|
2230
|
+
className: "studio-overlay-preview__tag",
|
|
2231
|
+
children: t
|
|
2232
|
+
}), d()]
|
|
2233
|
+
});
|
|
2234
|
+
}
|
|
2235
|
+
var mt = (e) => `data:image/svg+xml;utf8,${encodeURIComponent(`<svg xmlns="http://www.w3.org/2000/svg" width="320" height="200"><rect width="320" height="200" fill="hsl(${e} 40% 40%)"/></svg>`)}`, kn = [{
|
|
2236
|
+
label: "Documents",
|
|
2237
|
+
children: ["Work", "Home"]
|
|
2238
|
+
}], pc = [
|
|
2239
|
+
"New",
|
|
2240
|
+
"Open",
|
|
2241
|
+
{ separator: !0 },
|
|
2242
|
+
"Exit"
|
|
2243
|
+
], Ae = [{
|
|
2244
|
+
name: "First",
|
|
2245
|
+
description: "Sample row"
|
|
2246
|
+
}, {
|
|
2247
|
+
name: "Second",
|
|
2248
|
+
description: "Sample row"
|
|
2249
|
+
}], he = [
|
|
2250
|
+
"Draft",
|
|
2251
|
+
"In review",
|
|
2252
|
+
"Published"
|
|
2253
|
+
], ft = {
|
|
2254
|
+
text: { text: "Text" },
|
|
2255
|
+
title: {
|
|
2256
|
+
text: "Title",
|
|
2257
|
+
level: 2
|
|
2258
|
+
},
|
|
2259
|
+
button: { label: "Button" },
|
|
2260
|
+
action: { label: "Action" },
|
|
2261
|
+
card: {
|
|
2262
|
+
title: "Card",
|
|
2263
|
+
subtitle: "Subtitle"
|
|
2264
|
+
},
|
|
2265
|
+
section: { title: "Section" },
|
|
2266
|
+
summary: {
|
|
2267
|
+
title: "Summary",
|
|
2268
|
+
items: [{
|
|
2269
|
+
label: "Status",
|
|
2270
|
+
value: "Active"
|
|
2271
|
+
}, {
|
|
2272
|
+
label: "Owner",
|
|
2273
|
+
value: "Name"
|
|
2274
|
+
}]
|
|
2275
|
+
},
|
|
2276
|
+
field: {
|
|
2277
|
+
label: "Field",
|
|
2278
|
+
value: "Value"
|
|
2279
|
+
},
|
|
2280
|
+
code: {
|
|
2281
|
+
code: "const answer = 42;",
|
|
2282
|
+
text: "const answer = 42;"
|
|
2283
|
+
},
|
|
2284
|
+
file: {
|
|
2285
|
+
label: "File",
|
|
2286
|
+
name: "document.pdf"
|
|
2287
|
+
},
|
|
2288
|
+
navigationBar: {
|
|
2289
|
+
title: "Navigation",
|
|
2290
|
+
items: [
|
|
2291
|
+
{
|
|
2292
|
+
id: "home",
|
|
2293
|
+
label: "Home"
|
|
2294
|
+
},
|
|
2295
|
+
{
|
|
2296
|
+
id: "section",
|
|
2297
|
+
label: "Section"
|
|
2298
|
+
},
|
|
2299
|
+
{
|
|
2300
|
+
id: "more",
|
|
2301
|
+
label: "More"
|
|
2302
|
+
}
|
|
2303
|
+
]
|
|
2304
|
+
},
|
|
2305
|
+
column: {
|
|
2306
|
+
field: "name",
|
|
2307
|
+
header: "Column"
|
|
2308
|
+
},
|
|
2309
|
+
table: { rows: Ae },
|
|
2310
|
+
"core:table": { rows: Ae },
|
|
2311
|
+
inputText: { placeholder: "Text" },
|
|
2312
|
+
inputTextarea: {
|
|
2313
|
+
placeholder: "Text",
|
|
2314
|
+
rows: 3
|
|
2315
|
+
},
|
|
2316
|
+
inputNumber: { value: 42 },
|
|
2317
|
+
password: { placeholder: "Password" },
|
|
2318
|
+
floatLabel: { label: "Label" },
|
|
2319
|
+
iconField: {
|
|
2320
|
+
icon: "pi pi-search",
|
|
2321
|
+
placeholder: "Search"
|
|
2322
|
+
},
|
|
2323
|
+
dropdown: {
|
|
2324
|
+
options: he,
|
|
2325
|
+
placeholder: "Select"
|
|
2326
|
+
},
|
|
2327
|
+
multiSelect: {
|
|
2328
|
+
options: he,
|
|
2329
|
+
placeholder: "Select"
|
|
2330
|
+
},
|
|
2331
|
+
listBox: { options: he },
|
|
2332
|
+
selectButton: {
|
|
2333
|
+
options: [
|
|
2334
|
+
"Day",
|
|
2335
|
+
"Week",
|
|
2336
|
+
"Month"
|
|
2337
|
+
],
|
|
2338
|
+
value: "Week"
|
|
2339
|
+
},
|
|
2340
|
+
checkbox: { label: "Checkbox" },
|
|
2341
|
+
multiStateCheckbox: {
|
|
2342
|
+
value: null,
|
|
2343
|
+
options: [{
|
|
2344
|
+
label: "On",
|
|
2345
|
+
value: "on",
|
|
2346
|
+
icon: "pi pi-check"
|
|
2347
|
+
}, {
|
|
2348
|
+
label: "Off",
|
|
2349
|
+
value: "off",
|
|
2350
|
+
icon: "pi pi-times"
|
|
2351
|
+
}],
|
|
2352
|
+
ariaLabel: "State"
|
|
2353
|
+
},
|
|
2354
|
+
radioButton: {
|
|
2355
|
+
options: ["One", "Two"],
|
|
2356
|
+
value: "One"
|
|
2357
|
+
},
|
|
2358
|
+
toggleSwitch: { label: "Switch" },
|
|
2359
|
+
slider: { value: 35 },
|
|
2360
|
+
rating: { value: 4 },
|
|
2361
|
+
knob: { value: 60 },
|
|
2362
|
+
calendar: { value: "2026-01-15" },
|
|
2363
|
+
colorPicker: { value: "#6366f1" },
|
|
2364
|
+
chips: { value: ["one", "two"] },
|
|
2365
|
+
autoComplete: { options: he },
|
|
2366
|
+
treeSelect: { options: kn },
|
|
2367
|
+
editor: { value: "<p>Rich <strong>text</strong></p>" },
|
|
2368
|
+
fileUpload: {},
|
|
2369
|
+
splitButton: {
|
|
2370
|
+
label: "Save",
|
|
2371
|
+
items: ["Save as draft", "Discard"]
|
|
2372
|
+
},
|
|
2373
|
+
speedDial: { items: [{
|
|
2374
|
+
label: "Add",
|
|
2375
|
+
icon: "pi pi-plus"
|
|
2376
|
+
}, {
|
|
2377
|
+
label: "Edit",
|
|
2378
|
+
icon: "pi pi-pencil"
|
|
2379
|
+
}] },
|
|
2380
|
+
buttonGroup: { buttons: [
|
|
2381
|
+
"Left",
|
|
2382
|
+
"Middle",
|
|
2383
|
+
"Right"
|
|
2384
|
+
] },
|
|
2385
|
+
dataTable: { rows: Ae },
|
|
2386
|
+
dataView: { rows: Ae },
|
|
2387
|
+
dataScroller: {
|
|
2388
|
+
items: [
|
|
2389
|
+
"First",
|
|
2390
|
+
"Second",
|
|
2391
|
+
"Third"
|
|
2392
|
+
],
|
|
2393
|
+
rows: 3,
|
|
2394
|
+
inline: !0,
|
|
2395
|
+
scrollHeight: 96
|
|
2396
|
+
},
|
|
2397
|
+
tree: { nodes: kn },
|
|
2398
|
+
treeTable: {
|
|
2399
|
+
columns: [{
|
|
2400
|
+
field: "name",
|
|
2401
|
+
header: "Name"
|
|
2402
|
+
}, {
|
|
2403
|
+
field: "type",
|
|
2404
|
+
header: "Type"
|
|
2405
|
+
}],
|
|
2406
|
+
items: [{
|
|
2407
|
+
label: "Documents",
|
|
2408
|
+
data: {
|
|
2409
|
+
name: "Documents",
|
|
2410
|
+
type: "Folder"
|
|
2411
|
+
},
|
|
2412
|
+
children: [{
|
|
2413
|
+
label: "Work",
|
|
2414
|
+
data: {
|
|
2415
|
+
name: "Work",
|
|
2416
|
+
type: "Folder"
|
|
2417
|
+
}
|
|
2418
|
+
}]
|
|
2419
|
+
}]
|
|
2420
|
+
},
|
|
2421
|
+
timeline: { events: [{
|
|
2422
|
+
title: "Ordered",
|
|
2423
|
+
description: "Order placed",
|
|
2424
|
+
date: "09:00"
|
|
2425
|
+
}, {
|
|
2426
|
+
title: "Shipped",
|
|
2427
|
+
description: "Left the depot",
|
|
2428
|
+
date: "14:20"
|
|
2429
|
+
}] },
|
|
2430
|
+
paginator: {
|
|
2431
|
+
totalRecords: 120,
|
|
2432
|
+
pageSize: 10
|
|
2433
|
+
},
|
|
2434
|
+
orderList: {
|
|
2435
|
+
header: "Items",
|
|
2436
|
+
items: [
|
|
2437
|
+
"First",
|
|
2438
|
+
"Second",
|
|
2439
|
+
"Third"
|
|
2440
|
+
]
|
|
2441
|
+
},
|
|
2442
|
+
pickList: {
|
|
2443
|
+
source: ["Alpha", "Beta"],
|
|
2444
|
+
target: ["Gamma"]
|
|
2445
|
+
},
|
|
2446
|
+
organizationChart: { nodes: [{
|
|
2447
|
+
label: "Lead",
|
|
2448
|
+
children: ["One", "Two"]
|
|
2449
|
+
}] },
|
|
2450
|
+
chart: {
|
|
2451
|
+
type: "bar",
|
|
2452
|
+
data: {
|
|
2453
|
+
labels: [
|
|
2454
|
+
"January",
|
|
2455
|
+
"February",
|
|
2456
|
+
"March"
|
|
2457
|
+
],
|
|
2458
|
+
datasets: [{
|
|
2459
|
+
label: "Series",
|
|
2460
|
+
data: [
|
|
2461
|
+
12,
|
|
2462
|
+
19,
|
|
2463
|
+
8
|
|
2464
|
+
],
|
|
2465
|
+
backgroundColor: "#6366f1"
|
|
2466
|
+
}]
|
|
2467
|
+
}
|
|
2468
|
+
},
|
|
2469
|
+
panel: { header: "Panel" },
|
|
2470
|
+
accordion: { headers: ["First", "Second"] },
|
|
2471
|
+
fieldset: { legend: "Fieldset" },
|
|
2472
|
+
divider: { label: "or" },
|
|
2473
|
+
splitter: { height: 120 },
|
|
2474
|
+
scrollPanel: { height: 120 },
|
|
2475
|
+
tabView: { headers: ["First", "Second"] },
|
|
2476
|
+
toolbar: {},
|
|
2477
|
+
stepper: { headers: ["First", "Second"] },
|
|
2478
|
+
dialog: { header: "Dialog" },
|
|
2479
|
+
confirmDialog: {
|
|
2480
|
+
message: "Are you sure?",
|
|
2481
|
+
triggerLabel: "Confirm"
|
|
2482
|
+
},
|
|
2483
|
+
overlayPanel: { triggerLabel: "Details" },
|
|
2484
|
+
sidebar: {
|
|
2485
|
+
position: "right",
|
|
2486
|
+
triggerLabel: "Open panel"
|
|
2487
|
+
},
|
|
2488
|
+
tooltip: {
|
|
2489
|
+
text: "Tooltip",
|
|
2490
|
+
label: "Hover me"
|
|
2491
|
+
},
|
|
2492
|
+
menu: { items: pc },
|
|
2493
|
+
menubar: { items: [{
|
|
2494
|
+
label: "File",
|
|
2495
|
+
items: ["New", "Open"]
|
|
2496
|
+
}, {
|
|
2497
|
+
label: "Edit",
|
|
2498
|
+
items: ["Undo"]
|
|
2499
|
+
}] },
|
|
2500
|
+
breadcrumb: { items: [
|
|
2501
|
+
"Home",
|
|
2502
|
+
"Section",
|
|
2503
|
+
"Page"
|
|
2504
|
+
] },
|
|
2505
|
+
tabMenu: { items: [{
|
|
2506
|
+
label: "Overview",
|
|
2507
|
+
icon: "pi pi-home"
|
|
2508
|
+
}, {
|
|
2509
|
+
label: "Activity",
|
|
2510
|
+
icon: "pi pi-list"
|
|
2511
|
+
}] },
|
|
2512
|
+
steps: {
|
|
2513
|
+
items: [
|
|
2514
|
+
"First",
|
|
2515
|
+
"Second",
|
|
2516
|
+
"Third"
|
|
2517
|
+
],
|
|
2518
|
+
activeIndex: 1
|
|
2519
|
+
},
|
|
2520
|
+
tieredMenu: { items: [{
|
|
2521
|
+
label: "File",
|
|
2522
|
+
items: [{
|
|
2523
|
+
label: "Export",
|
|
2524
|
+
items: ["PDF", "CSV"]
|
|
2525
|
+
}]
|
|
2526
|
+
}] },
|
|
2527
|
+
panelMenu: { items: [{
|
|
2528
|
+
label: "Reports",
|
|
2529
|
+
items: ["Monthly", "Annual"]
|
|
2530
|
+
}] },
|
|
2531
|
+
contextMenu: {
|
|
2532
|
+
label: "Right-click here",
|
|
2533
|
+
items: ["Copy", "Paste"]
|
|
2534
|
+
},
|
|
2535
|
+
megaMenu: { items: [{
|
|
2536
|
+
label: "Catalog",
|
|
2537
|
+
items: [{
|
|
2538
|
+
label: "Hardware",
|
|
2539
|
+
items: ["Laptops", "Phones"]
|
|
2540
|
+
}]
|
|
2541
|
+
}] },
|
|
2542
|
+
dock: { items: [{
|
|
2543
|
+
label: "Home",
|
|
2544
|
+
icon: "pi pi-home"
|
|
2545
|
+
}, {
|
|
2546
|
+
label: "Search",
|
|
2547
|
+
icon: "pi pi-search"
|
|
2548
|
+
}] },
|
|
2549
|
+
message: { text: "Message" },
|
|
2550
|
+
inlineMessage: {
|
|
2551
|
+
severity: "info",
|
|
2552
|
+
text: "Message"
|
|
2553
|
+
},
|
|
2554
|
+
toast: {
|
|
2555
|
+
severity: "success",
|
|
2556
|
+
summary: "Saved",
|
|
2557
|
+
detail: "The change was saved."
|
|
2558
|
+
},
|
|
2559
|
+
blockUI: { blocked: !0 },
|
|
2560
|
+
image: {
|
|
2561
|
+
src: mt(220),
|
|
2562
|
+
alt: "Image",
|
|
2563
|
+
width: "200"
|
|
2564
|
+
},
|
|
2565
|
+
galleria: {
|
|
2566
|
+
maxWidth: 320,
|
|
2567
|
+
items: [{
|
|
2568
|
+
src: mt(220),
|
|
2569
|
+
alt: "One"
|
|
2570
|
+
}, {
|
|
2571
|
+
src: mt(10),
|
|
2572
|
+
alt: "Two"
|
|
2573
|
+
}]
|
|
2574
|
+
},
|
|
2575
|
+
carousel: {
|
|
2576
|
+
numVisible: 2,
|
|
2577
|
+
items: [
|
|
2578
|
+
{
|
|
2579
|
+
title: "First",
|
|
2580
|
+
description: "Item"
|
|
2581
|
+
},
|
|
2582
|
+
{
|
|
2583
|
+
title: "Second",
|
|
2584
|
+
description: "Item"
|
|
2585
|
+
},
|
|
2586
|
+
{
|
|
2587
|
+
title: "Third",
|
|
2588
|
+
description: "Item"
|
|
2589
|
+
}
|
|
2590
|
+
]
|
|
2591
|
+
},
|
|
2592
|
+
avatar: { label: "AB" },
|
|
2593
|
+
badge: { value: "8" },
|
|
2594
|
+
chip: {
|
|
2595
|
+
label: "Chip",
|
|
2596
|
+
icon: "pi pi-user"
|
|
2597
|
+
},
|
|
2598
|
+
tag: { value: "Tag" },
|
|
2599
|
+
progressBar: { value: 65 },
|
|
2600
|
+
progressSpinner: { size: 40 },
|
|
2601
|
+
skeleton: {
|
|
2602
|
+
width: "12rem",
|
|
2603
|
+
height: "2rem"
|
|
2604
|
+
},
|
|
2605
|
+
scrollTop: { height: 140 },
|
|
2606
|
+
inplace: { label: "Click to edit" },
|
|
2607
|
+
terminal: {
|
|
2608
|
+
welcomeMessage: "Terminal",
|
|
2609
|
+
prompt: "$"
|
|
2610
|
+
},
|
|
2611
|
+
page: {
|
|
2612
|
+
title: "Page",
|
|
2613
|
+
showTitle: !0,
|
|
2614
|
+
panel: !0
|
|
2615
|
+
},
|
|
2616
|
+
dataPage: { title: "Data page" },
|
|
2617
|
+
icon: { icon: "pi pi-check-circle" },
|
|
2618
|
+
toolbarButton: {
|
|
2619
|
+
icon: "pi pi-plus",
|
|
2620
|
+
title: "Button"
|
|
2621
|
+
},
|
|
2622
|
+
toolbarGroup: { orientation: "horizontal" },
|
|
2623
|
+
toolbarSeparator: { orientation: "horizontal" },
|
|
2624
|
+
inputTextField: { title: "Text field" },
|
|
2625
|
+
numberField: { title: "Number field" },
|
|
2626
|
+
checkboxField: { title: "Checkbox field" },
|
|
2627
|
+
textAreaField: { title: "Text area field" },
|
|
2628
|
+
dropdownField: {
|
|
2629
|
+
title: "Dropdown field",
|
|
2630
|
+
options: he
|
|
2631
|
+
},
|
|
2632
|
+
sliderField: { title: "Slider field" },
|
|
2633
|
+
calendarField: { title: "Calendar field" },
|
|
2634
|
+
colorPickerField: { title: "Color field" },
|
|
2635
|
+
multiSelectField: {
|
|
2636
|
+
title: "Multi select field",
|
|
2637
|
+
options: he
|
|
2638
|
+
},
|
|
2639
|
+
chipsField: { title: "Chips field" },
|
|
2640
|
+
radioButtonField: {
|
|
2641
|
+
title: "Radio field",
|
|
2642
|
+
options: ["One", "Two"]
|
|
2643
|
+
},
|
|
2644
|
+
radioGroupField: {
|
|
2645
|
+
title: "Radio group field",
|
|
2646
|
+
options: ["One", "Two"]
|
|
2647
|
+
},
|
|
2648
|
+
objectNavigationalBar: { navigationPath: ["first", "second"] },
|
|
2649
|
+
filterPanel: {
|
|
2650
|
+
label: "Filters",
|
|
2651
|
+
filters: [{
|
|
2652
|
+
key: "status",
|
|
2653
|
+
label: "Status",
|
|
2654
|
+
multi: !0,
|
|
2655
|
+
options: [{
|
|
2656
|
+
key: "draft",
|
|
2657
|
+
label: "Draft",
|
|
2658
|
+
count: 12
|
|
2659
|
+
}, {
|
|
2660
|
+
key: "done",
|
|
2661
|
+
label: "Done",
|
|
2662
|
+
count: 4
|
|
2663
|
+
}]
|
|
2664
|
+
}]
|
|
2665
|
+
},
|
|
2666
|
+
objectContentEditor: {
|
|
2667
|
+
editMode: !1,
|
|
2668
|
+
object: {
|
|
2669
|
+
name: "Sample",
|
|
2670
|
+
amount: 42
|
|
2671
|
+
},
|
|
2672
|
+
schema: {
|
|
2673
|
+
type: "object",
|
|
2674
|
+
properties: {
|
|
2675
|
+
name: { type: "string" },
|
|
2676
|
+
amount: { type: "number" }
|
|
2677
|
+
}
|
|
2678
|
+
}
|
|
2679
|
+
},
|
|
2680
|
+
schemaEditor: {
|
|
2681
|
+
eventTypeName: "SampleEvent",
|
|
2682
|
+
canEdit: !1,
|
|
2683
|
+
schema: {
|
|
2684
|
+
title: "SampleEvent",
|
|
2685
|
+
type: "object",
|
|
2686
|
+
properties: { name: { type: "string" } }
|
|
2687
|
+
}
|
|
2688
|
+
},
|
|
2689
|
+
confirmationDialog: {
|
|
2690
|
+
title: "Confirm",
|
|
2691
|
+
message: "Are you sure?"
|
|
2692
|
+
},
|
|
2693
|
+
busyIndicatorDialog: {
|
|
2694
|
+
title: "Working",
|
|
2695
|
+
message: "Please wait"
|
|
2696
|
+
},
|
|
2697
|
+
"Cratis.Blueprint.Default:breadcrumb": { items: [
|
|
2698
|
+
{ label: "Home" },
|
|
2699
|
+
{ label: "Section" },
|
|
2700
|
+
{ label: "Page" }
|
|
2701
|
+
] },
|
|
2702
|
+
"Cratis.Blueprint.Default:menu": {
|
|
2703
|
+
title: "Menu",
|
|
2704
|
+
label: "Main"
|
|
2705
|
+
},
|
|
2706
|
+
"Cratis.Blueprint.Default:menuItem": {
|
|
2707
|
+
label: "Menu item",
|
|
2708
|
+
icon: "pi pi-home"
|
|
2709
|
+
},
|
|
2710
|
+
"Cratis.Blueprint.Default:rightPanel": { title: "Panel" },
|
|
2711
|
+
"Cratis.Blueprint.Default:sidebar": { title: "Sidebar" },
|
|
2712
|
+
pageHeader: { title: "Page title" },
|
|
2713
|
+
arcPageHeader: { title: "Page title" },
|
|
2714
|
+
logo: { text: "Logo" },
|
|
2715
|
+
footer: { text: "Footer" },
|
|
2716
|
+
topbar: { title: "Application" },
|
|
2717
|
+
userMenu: { name: "User" }
|
|
2718
|
+
}, mc = /* @__PURE__ */ new Set([
|
|
2719
|
+
"data",
|
|
2720
|
+
"navigate",
|
|
2721
|
+
"errorBoundary",
|
|
2722
|
+
"toolbarSeparator"
|
|
2723
|
+
]), Ft = (e) => e.slice(e.lastIndexOf(":") + 1), Qt = (e, t) => ft[e] ?? ft[t] ?? ft[Ft(t)];
|
|
2724
|
+
function fc(e, t, n) {
|
|
2725
|
+
const r = Qt(e, t), o = n ?? {};
|
|
2726
|
+
if (!r) return { ...o };
|
|
2727
|
+
const i = { ...r };
|
|
2728
|
+
for (const [a, c] of Object.entries(o)) c !== void 0 && (i[a] = c);
|
|
2729
|
+
return i;
|
|
2730
|
+
}
|
|
2731
|
+
function hc(e, t, n) {
|
|
2732
|
+
const r = Qt(e, t);
|
|
2733
|
+
return r ? Object.keys(r).filter((o) => n?.[o] === void 0) : [];
|
|
2734
|
+
}
|
|
2735
|
+
var gc = (e) => {
|
|
2736
|
+
const { width: t, height: n } = e.getBoundingClientRect();
|
|
2737
|
+
return t > 0 && n > 0;
|
|
2738
|
+
}, Dt = (e) => Array.from(e.children).filter((t) => !t.hasAttribute("data-studio-placeholder-for")).some((t) => gc(t) || getComputedStyle(t).display === "contents" && Dt(t)), vc = 150;
|
|
2739
|
+
function yc(e, t) {
|
|
2740
|
+
const [n, r] = M(!0);
|
|
2741
|
+
return We(() => {
|
|
2742
|
+
const o = e.current;
|
|
2743
|
+
if (!o) return;
|
|
2744
|
+
let i;
|
|
2745
|
+
const a = () => {
|
|
2746
|
+
clearTimeout(i), Dt(o) ? r(!0) : i = setTimeout(() => r(Dt(o)), vc);
|
|
2747
|
+
}, c = typeof ResizeObserver > "u" ? void 0 : new ResizeObserver(a), d = () => {
|
|
2748
|
+
c?.disconnect(), Array.from(o.children).forEach((l) => c?.observe(l));
|
|
2749
|
+
}, u = new MutationObserver(() => {
|
|
2750
|
+
d(), a();
|
|
2751
|
+
});
|
|
2752
|
+
return a(), d(), u.observe(o, { childList: !0 }), () => {
|
|
2753
|
+
clearTimeout(i), c?.disconnect(), u.disconnect();
|
|
2754
|
+
};
|
|
2755
|
+
}, [e, t]), n;
|
|
2756
|
+
}
|
|
2757
|
+
var bc = ({ element: e }) => e.name || e.componentName, wc = (e) => {
|
|
2758
|
+
const t = H(e), n = H(0);
|
|
2759
|
+
return t.current !== e && (t.current = e, n.current += 1), n.current;
|
|
2760
|
+
};
|
|
2761
|
+
function Cc(e, t, n, r) {
|
|
2762
|
+
const o = (i) => {
|
|
2763
|
+
const a = H(null), c = _(() => ({
|
|
2764
|
+
...i.element,
|
|
2765
|
+
properties: fc(e, i.element.componentName, i.element.properties)
|
|
2766
|
+
}), [i.element]), d = _(() => hc(e, i.element.componentName, i.element.properties), [i.element]), u = mc.has(Ft(i.element.componentName)), l = dc[Ft(i.element.componentName)], [p, w] = M(), g = yc(a, i.element), k = bc(i), x = wc(i.element);
|
|
2767
|
+
return /* @__PURE__ */ b("span", {
|
|
2768
|
+
ref: a,
|
|
2769
|
+
"data-studio-element": i.element.id,
|
|
2770
|
+
style: { display: "contents" },
|
|
2771
|
+
"data-studio-sample": d.length > 0 ? d.join(" ") : void 0,
|
|
2772
|
+
title: d.length > 0 ? n.sampleContent(d) : void 0,
|
|
2773
|
+
children: [/* @__PURE__ */ s($n, {
|
|
2774
|
+
onError: (C) => w(C instanceof Error ? C.message : String(C)),
|
|
2775
|
+
fallback: /* @__PURE__ */ s(Nt, {
|
|
2776
|
+
elementId: i.element.id,
|
|
2777
|
+
tone: je.Failed,
|
|
2778
|
+
text: n.failedToDraw(k, p ?? "")
|
|
2779
|
+
}),
|
|
2780
|
+
children: l ? /* @__PURE__ */ s(uc, {
|
|
2781
|
+
kind: l,
|
|
2782
|
+
tag: n.overlay(k),
|
|
2783
|
+
element: c,
|
|
2784
|
+
slots: i.slots,
|
|
2785
|
+
message: r
|
|
2786
|
+
}) : Ve(t, {
|
|
2787
|
+
...i,
|
|
2788
|
+
element: c
|
|
2789
|
+
})
|
|
2790
|
+
}, x), !g && /* @__PURE__ */ s(Nt, {
|
|
2791
|
+
elementId: i.element.id,
|
|
2792
|
+
tone: u ? je.Declaration : je.Empty,
|
|
2793
|
+
text: u ? n.declaration(k) : n.nothingToShow(k)
|
|
2794
|
+
})]
|
|
2795
|
+
});
|
|
2796
|
+
};
|
|
2797
|
+
return o.displayName = `DesignTime(${t.displayName ?? t.name ?? "Component"})`, o;
|
|
2798
|
+
}
|
|
2799
|
+
function Sc(e, t) {
|
|
2800
|
+
const n = Object.fromEntries(Object.entries(e).map(([o, i]) => [o, Cc(o, i, t, e["PrimeReact:message"])])), r = {};
|
|
2801
|
+
return new Proxy(n, { get: (o, i) => {
|
|
2802
|
+
if (typeof i == "string")
|
|
2803
|
+
return o[i] ?? (r[i] ??= kc(t));
|
|
2804
|
+
} });
|
|
2805
|
+
}
|
|
2806
|
+
var kc = (e) => ({ element: t }) => Ve("span", {
|
|
2807
|
+
"data-studio-element": t.id,
|
|
2808
|
+
style: { display: "contents" }
|
|
2809
|
+
}, Ve(Nt, {
|
|
2810
|
+
elementId: t.id,
|
|
2811
|
+
tone: je.Failed,
|
|
2812
|
+
text: e.unavailable(t.name || t.componentName)
|
|
2813
|
+
})), X = /* @__PURE__ */ (function(e) {
|
|
2814
|
+
return e.Container = "container", e.Between = "between", e;
|
|
2815
|
+
})({}), Ic = ({ feedback: e, deniedText: t }) => {
|
|
2816
|
+
if (e.denied || !e.drop) return /* @__PURE__ */ s("div", {
|
|
2817
|
+
className: "studio-screen-surface__denied",
|
|
2818
|
+
"data-studio-drop-state": "denied",
|
|
2819
|
+
children: t
|
|
2820
|
+
});
|
|
2821
|
+
const { target: n, container: r } = e.drop;
|
|
2822
|
+
return /* @__PURE__ */ b(Ie, { children: [/* @__PURE__ */ s("div", {
|
|
2823
|
+
className: "studio-screen-surface__drop-container",
|
|
2824
|
+
"data-studio-drop-state": "container",
|
|
2825
|
+
style: r
|
|
2826
|
+
}), /* @__PURE__ */ s("div", {
|
|
2827
|
+
className: `studio-screen-surface__target studio-screen-surface__target--${n.region.kind}`,
|
|
2828
|
+
"data-studio-drop-state": n.region.kind === X.Container ? "into" : "between",
|
|
2829
|
+
"data-empty": n.region.isEmptyContainer,
|
|
2830
|
+
style: n.rect
|
|
2831
|
+
})] });
|
|
2832
|
+
}, $ = /* @__PURE__ */ (function(e) {
|
|
2833
|
+
return e.NodeNotFound = "nodeNotFound", e.TargetNotFound = "targetNotFound", e.TargetNotContainer = "targetNotContainer", e.WouldCreateCycle = "wouldCreateCycle", e.NodeLocked = "nodeLocked", e.TargetLocked = "targetLocked", e.NoChange = "noChange", e;
|
|
2834
|
+
})({});
|
|
2835
|
+
function Pc(e, t, n, r, o) {
|
|
2836
|
+
const i = Z(e, n, t);
|
|
2837
|
+
if (i)
|
|
2838
|
+
return {
|
|
2839
|
+
nodeId: n,
|
|
2840
|
+
targetParentId: r,
|
|
2841
|
+
index: i.parent !== null && t.idOf(i.parent) === r && o > i.index ? o - 1 : o
|
|
2842
|
+
};
|
|
2843
|
+
}
|
|
2844
|
+
var le = /* @__PURE__ */ (function(e) {
|
|
2845
|
+
return e.Horizontal = "horizontal", e.Vertical = "vertical", e.None = "none", e;
|
|
2846
|
+
})({}), $e = ({ width: e, height: t }) => e * t, Tc = (e, t, n) => t >= e.left && t <= e.left + e.width && n >= e.top && n <= e.top + e.height, Rc = (e, t, n, r) => {
|
|
2847
|
+
const o = Math.min(r, e.width / 4), i = Math.min(r, e.height / 4);
|
|
2848
|
+
return t - e.left < o || e.left + e.width - t < o || n - e.top < i || e.top + e.height - n < i;
|
|
2849
|
+
}, In = ({ region: e, rect: t }, n, r) => e.axis === le.Vertical ? Math.abs(n - (t.left + t.width / 2)) : Math.abs(r - (t.top + t.height / 2));
|
|
2850
|
+
function xc(e, t, n, r = 6) {
|
|
2851
|
+
const o = e.filter((u) => u.region.kind === X.Container);
|
|
2852
|
+
if (o.length === 0) return;
|
|
2853
|
+
const i = o.map((u, l) => ({
|
|
2854
|
+
placed: u,
|
|
2855
|
+
order: l
|
|
2856
|
+
})).filter(({ placed: u }) => Tc(u.rect, t, n)).sort((u, l) => $e(u.placed.rect) - $e(l.placed.rect) || l.order - u.order).map(({ placed: u }) => u), a = i[0], c = a && i.length > 1 && Rc(a.rect, t, n, r) ? i[1] : a ?? [...o].sort((u, l) => $e(l.rect) - $e(u.rect))[0], d = e.filter((u) => u.region.kind === X.Between && u.region.containerId === c.region.containerId);
|
|
2857
|
+
return c.region.isEmptyContainer || d.length === 0 ? {
|
|
2858
|
+
target: c,
|
|
2859
|
+
container: c.rect
|
|
2860
|
+
} : {
|
|
2861
|
+
target: d.reduce((u, l) => In(l, t, n) < In(u, t, n) ? l : u),
|
|
2862
|
+
container: c.rect
|
|
2863
|
+
};
|
|
2864
|
+
}
|
|
2865
|
+
var Nc = (e, t) => e?.top === t?.top && e?.left === t?.left && e?.width === t?.width && e?.height === t?.height, Fc = (e, t) => !!e && e.denied === t.denied && e.drop?.target.region.id === t.drop?.target.region.id && Nc(e.drop?.target.rect, t.drop?.target.rect);
|
|
2866
|
+
function Dc(e, t, n) {
|
|
2867
|
+
const [r, o] = M(), i = H(void 0);
|
|
2868
|
+
i.current = r;
|
|
2869
|
+
const [a, c] = M(), d = H(0), u = H(void 0), l = z(() => {
|
|
2870
|
+
d.current = 0, u.current = void 0, c(void 0), o(void 0);
|
|
2871
|
+
}, []), p = H(!1);
|
|
2872
|
+
Ne(() => {
|
|
2873
|
+
const v = (T) => {
|
|
2874
|
+
T.key !== "Escape" || !u.current && !d.current && !i.current || (p.current = !0, l());
|
|
2875
|
+
};
|
|
2876
|
+
return window.addEventListener("keydown", v, !0), () => window.removeEventListener("keydown", v, !0);
|
|
2877
|
+
}, [l]), Ne(() => (window.addEventListener("dragend", l), window.addEventListener("drop", l), () => {
|
|
2878
|
+
window.removeEventListener("dragend", l), window.removeEventListener("drop", l);
|
|
2879
|
+
}), [l]);
|
|
2880
|
+
const w = z((v) => {
|
|
2881
|
+
u.current = v, c(v);
|
|
2882
|
+
}, []), g = (v) => {
|
|
2883
|
+
const T = u.current, { region: R } = v.target;
|
|
2884
|
+
if (!T || !R.containerId) return;
|
|
2885
|
+
const m = R.kind === X.Container ? k(R.containerId) : R.index;
|
|
2886
|
+
return Pc(n.composition.roots, n.adapter, T, R.containerId, m);
|
|
2887
|
+
}, k = (v) => {
|
|
2888
|
+
const T = [...n.composition.roots];
|
|
2889
|
+
for (; T.length > 0; ) {
|
|
2890
|
+
const R = T.pop();
|
|
2891
|
+
if (n.adapter.idOf(R) === v) return n.adapter.childrenOf(R).length;
|
|
2892
|
+
T.push(...n.adapter.childrenOf(R));
|
|
2893
|
+
}
|
|
2894
|
+
return 0;
|
|
2895
|
+
}, x = (v) => {
|
|
2896
|
+
const T = e.current.getBoundingClientRect(), R = xc(t(), v.clientX - T.left, v.clientY - T.top), m = v.target.closest("[data-scene-id], [data-studio-element]"), f = m?.dataset.sceneId ?? m?.dataset.studioElement, y = !!f && n.ownershipOf(f) !== B.Local;
|
|
2897
|
+
if (!R || y) return { denied: !0 };
|
|
2898
|
+
if (Rt(v)) {
|
|
2899
|
+
const P = g(R), O = P ? n.validateMove(P) : $.NodeNotFound;
|
|
2900
|
+
if (O && O !== $.NoChange) return { denied: !0 };
|
|
2901
|
+
}
|
|
2902
|
+
return {
|
|
2903
|
+
drop: R,
|
|
2904
|
+
denied: !1
|
|
2905
|
+
};
|
|
2906
|
+
}, C = (v, T) => {
|
|
2907
|
+
const R = e.current.getBoundingClientRect();
|
|
2908
|
+
return {
|
|
2909
|
+
left: v.clientX - R.left - T.container.left,
|
|
2910
|
+
top: v.clientY - R.top - T.container.top
|
|
2911
|
+
};
|
|
2912
|
+
};
|
|
2913
|
+
return {
|
|
2914
|
+
feedback: r,
|
|
2915
|
+
draggedId: a,
|
|
2916
|
+
startMoving: w,
|
|
2917
|
+
endMoving: l,
|
|
2918
|
+
handlers: {
|
|
2919
|
+
onDragEnter: (v) => {
|
|
2920
|
+
Ee(v) && (v.preventDefault(), p.current = !1, d.current += 1);
|
|
2921
|
+
},
|
|
2922
|
+
onDragOver: (v) => {
|
|
2923
|
+
if (!Ee(v) || (v.preventDefault(), p.current)) return;
|
|
2924
|
+
const T = x(v);
|
|
2925
|
+
v.dataTransfer.dropEffect = T.denied ? "none" : Rt(v) ? "move" : "copy", o((R) => Fc(R, T) ? R : T);
|
|
2926
|
+
},
|
|
2927
|
+
onDragLeave: (v) => {
|
|
2928
|
+
Ee(v) && (d.current = Math.max(0, d.current - 1), d.current === 0 && o(void 0));
|
|
2929
|
+
},
|
|
2930
|
+
onDrop: (v) => {
|
|
2931
|
+
if (!Ee(v)) return;
|
|
2932
|
+
const T = Gl(v), R = Hl(v), { drop: m, denied: f } = x(v), y = m && T ? g(m) : void 0, P = p.current;
|
|
2933
|
+
if (v.preventDefault(), l(), p.current = !1, P || f || !m) return;
|
|
2934
|
+
if (T) {
|
|
2935
|
+
y && n.move(y, C(v, m));
|
|
2936
|
+
return;
|
|
2937
|
+
}
|
|
2938
|
+
if (!R) return;
|
|
2939
|
+
const { region: O } = m.target, D = O.containerId ?? void 0, V = O.kind === X.Container ? void 0 : O.index, Oe = C(v, m);
|
|
2940
|
+
R.kind === "layout" ? n.insertLayout(R.item, D, V, Oe) : n.insertComponent(Kt(R.componentName, R.package), D, V, Oe);
|
|
2941
|
+
}
|
|
2942
|
+
}
|
|
2943
|
+
};
|
|
2944
|
+
}
|
|
2945
|
+
var Oc = (e) => e.width > 0 && e.height > 0;
|
|
2946
|
+
function $r(e) {
|
|
2947
|
+
const t = e.getBoundingClientRect();
|
|
2948
|
+
return Oc(t) ? [t] : Array.from(e.children).flatMap($r);
|
|
2949
|
+
}
|
|
2950
|
+
function Pn(e, t, n) {
|
|
2951
|
+
const r = CSS.escape(t), o = [...Array.from(e.querySelectorAll(`[data-studio-element="${r}"]`)), ...Array.from(e.querySelectorAll(`[data-scene-id="${r}"]`))];
|
|
2952
|
+
for (const i of o) {
|
|
2953
|
+
const a = $r(i);
|
|
2954
|
+
if (a.length === 0) continue;
|
|
2955
|
+
const c = Math.min(...a.map((p) => p.left)), d = Math.min(...a.map((p) => p.top)), u = Math.max(...a.map((p) => p.right)), l = Math.max(...a.map((p) => p.bottom));
|
|
2956
|
+
return {
|
|
2957
|
+
left: c - n.left,
|
|
2958
|
+
top: d - n.top,
|
|
2959
|
+
width: u - c,
|
|
2960
|
+
height: l - d
|
|
2961
|
+
};
|
|
2962
|
+
}
|
|
2963
|
+
}
|
|
2964
|
+
var ge = 3;
|
|
2965
|
+
function Lc(e, t, n) {
|
|
2966
|
+
const r = e.containerId === null ? t : n(e.containerId);
|
|
2967
|
+
if (!r) return;
|
|
2968
|
+
if (e.kind === X.Container) return r;
|
|
2969
|
+
const o = e.afterId ? n(e.afterId) : void 0, i = e.beforeId ? n(e.beforeId) : void 0;
|
|
2970
|
+
if (e.axis === le.Horizontal) {
|
|
2971
|
+
const a = o ? o.top + o.height : i ? i.top - ge : r.top;
|
|
2972
|
+
return {
|
|
2973
|
+
left: r.left,
|
|
2974
|
+
top: a - ge / 2,
|
|
2975
|
+
width: r.width,
|
|
2976
|
+
height: ge
|
|
2977
|
+
};
|
|
2978
|
+
}
|
|
2979
|
+
if (e.axis === le.Vertical) return {
|
|
2980
|
+
left: (o ? o.left + o.width : i ? i.left - ge : r.left) - ge / 2,
|
|
2981
|
+
top: r.top,
|
|
2982
|
+
width: ge,
|
|
2983
|
+
height: r.height
|
|
2984
|
+
};
|
|
2985
|
+
}
|
|
2986
|
+
var _r = (e, t) => e === t || !!e && !!t && e.left === t.left && e.top === t.top && e.width === t.width && e.height === t.height, Mc = (e, t) => e.length === t.length && e.every((n, r) => n.region.id === t[r].region.id && _r(n.rect, t[r].rect)), Ec = _r;
|
|
2987
|
+
function Ac(e, t, n) {
|
|
2988
|
+
const [r, o] = M([]), [i, a] = M(), c = H([]), d = z(() => {
|
|
2989
|
+
const l = e.current;
|
|
2990
|
+
if (!l) return [];
|
|
2991
|
+
const p = l.getBoundingClientRect(), w = (k) => Pn(l, k, p), g = {
|
|
2992
|
+
left: 0,
|
|
2993
|
+
top: 0,
|
|
2994
|
+
width: p.width,
|
|
2995
|
+
height: p.height
|
|
2996
|
+
};
|
|
2997
|
+
return t.flatMap((k) => {
|
|
2998
|
+
const x = Lc(k, g, w);
|
|
2999
|
+
return x ? [{
|
|
3000
|
+
region: k,
|
|
3001
|
+
rect: x
|
|
3002
|
+
}] : [];
|
|
3003
|
+
});
|
|
3004
|
+
}, [e, t]), u = z(() => {
|
|
3005
|
+
const l = e.current;
|
|
3006
|
+
if (!l) return;
|
|
3007
|
+
const p = d();
|
|
3008
|
+
c.current = p, o((g) => Mc(g, p) ? g : p);
|
|
3009
|
+
const w = n ? Pn(l, n, l.getBoundingClientRect()) : void 0;
|
|
3010
|
+
a((g) => Ec(g, w) ? g : w);
|
|
3011
|
+
}, [
|
|
3012
|
+
e,
|
|
3013
|
+
d,
|
|
3014
|
+
n
|
|
3015
|
+
]);
|
|
3016
|
+
return We(() => {
|
|
3017
|
+
u();
|
|
3018
|
+
}), We(() => {
|
|
3019
|
+
const l = e.current;
|
|
3020
|
+
if (!l || typeof ResizeObserver > "u") return;
|
|
3021
|
+
const p = new ResizeObserver(u);
|
|
3022
|
+
return p.observe(l), () => p.disconnect();
|
|
3023
|
+
}, [e, u]), {
|
|
3024
|
+
placed: r,
|
|
3025
|
+
selectionRect: i,
|
|
3026
|
+
measureNow: d
|
|
3027
|
+
};
|
|
3028
|
+
}
|
|
3029
|
+
var $c = () => {
|
|
3030
|
+
}, _c = ({ controller: e, environment: t, resolveBinding: n = $c, configuration: r, strings: o, viewportHeight: i }) => {
|
|
3031
|
+
const a = H(null), { composition: c, dropRegions: d, selectedId: u } = e, { selectionRect: l, measureNow: p } = Ac(a, d, u), { feedback: w, draggedId: g, startMoving: k, endMoving: x, handlers: C } = Dc(a, p, e), [I, F] = M();
|
|
3032
|
+
We(() => {
|
|
3033
|
+
const D = a.current?.closest("[data-studio-viewport]") ?? a.current?.parentElement;
|
|
3034
|
+
if (i !== void 0 || !D || typeof ResizeObserver > "u") return;
|
|
3035
|
+
const V = new ResizeObserver(() => F(D.clientHeight));
|
|
3036
|
+
return F(D.clientHeight), V.observe(D), () => V.disconnect();
|
|
3037
|
+
}, [i]);
|
|
3038
|
+
const N = (D) => {
|
|
3039
|
+
!sr(D) || !e.selectedId || !e.canRemove(e.selectedId) || (D.preventDefault(), e.remove(e.selectedId));
|
|
3040
|
+
}, E = !!e.selectedId && e.ownershipOf(e.selectedId) === B.Local && e.canRemove(e.selectedId), v = e.selection && (e.selection.name || e.selection.componentName) || "", T = (D) => {
|
|
3041
|
+
ar(D.target) || a.current?.focus({ preventScroll: !0 });
|
|
3042
|
+
const V = D.target.closest("[data-scene-id], [data-studio-element], [data-studio-placeholder-for]");
|
|
3043
|
+
e.select(V?.dataset.sceneId ?? V?.dataset.studioElement ?? V?.dataset.studioPlaceholderFor);
|
|
3044
|
+
}, R = _(() => Pi(c.element, t.runtime.profile, t.runtime.packages), [
|
|
3045
|
+
c,
|
|
3046
|
+
t.runtime.profile,
|
|
3047
|
+
t.runtime.packages
|
|
3048
|
+
]), m = _(() => Sc(t.runtime.registry, o), [t.runtime.registry, o]), f = _(() => cc(t.runtime), [t.runtime]), y = _(() => /* @__PURE__ */ s(Co, {
|
|
3049
|
+
registry: t.runtime.iconAdapters,
|
|
3050
|
+
children: /* @__PURE__ */ s(So, {
|
|
3051
|
+
element: R,
|
|
3052
|
+
registry: m,
|
|
3053
|
+
resolveBinding: n,
|
|
3054
|
+
configuration: r
|
|
3055
|
+
})
|
|
3056
|
+
}), [
|
|
3057
|
+
R,
|
|
3058
|
+
m,
|
|
3059
|
+
t.runtime.iconAdapters,
|
|
3060
|
+
n,
|
|
3061
|
+
r
|
|
3062
|
+
]), P = i ?? I, O = {
|
|
3063
|
+
...P === void 0 ? {} : { "--studio-surface-viewport-height": `${P}px` },
|
|
3064
|
+
"--studio-empty-container-label": JSON.stringify(o.emptyContainer)
|
|
3065
|
+
};
|
|
3066
|
+
return /* @__PURE__ */ s(Io, {
|
|
3067
|
+
theme: f,
|
|
3068
|
+
className: `studio-profile-theme studio-screen-surface-theme ${lc(f)}`,
|
|
3069
|
+
children: /* @__PURE__ */ b("div", {
|
|
3070
|
+
ref: a,
|
|
3071
|
+
className: "studio-screen-surface",
|
|
3072
|
+
style: O,
|
|
3073
|
+
"data-studio-dragging": w ? "true" : void 0,
|
|
3074
|
+
onClick: T,
|
|
3075
|
+
onKeyDown: N,
|
|
3076
|
+
tabIndex: -1,
|
|
3077
|
+
...C,
|
|
3078
|
+
children: [y, /* @__PURE__ */ b("div", {
|
|
3079
|
+
className: "studio-screen-surface__chrome",
|
|
3080
|
+
children: [
|
|
3081
|
+
l && /* @__PURE__ */ s("div", {
|
|
3082
|
+
className: "studio-screen-surface__selection",
|
|
3083
|
+
"data-moving": g === e.selectedId ? "true" : void 0,
|
|
3084
|
+
style: l
|
|
3085
|
+
}),
|
|
3086
|
+
l && E && /* @__PURE__ */ s("div", {
|
|
3087
|
+
className: "studio-screen-surface__grip",
|
|
3088
|
+
style: {
|
|
3089
|
+
left: l.left,
|
|
3090
|
+
top: Math.max(0, l.top - 22)
|
|
3091
|
+
},
|
|
3092
|
+
draggable: !0,
|
|
3093
|
+
"aria-hidden": "true",
|
|
3094
|
+
title: o.moveHandle(v),
|
|
3095
|
+
onDragStart: (D) => {
|
|
3096
|
+
k(e.selectedId), ql(D, e.selectedId, v);
|
|
3097
|
+
},
|
|
3098
|
+
onDragEnd: x,
|
|
3099
|
+
children: /* @__PURE__ */ s(Jo, { "aria-hidden": "true" })
|
|
3100
|
+
}),
|
|
3101
|
+
w && /* @__PURE__ */ s(Ic, {
|
|
3102
|
+
feedback: w,
|
|
3103
|
+
deniedText: o.dropDenied
|
|
3104
|
+
}),
|
|
3105
|
+
/* @__PURE__ */ s("span", {
|
|
3106
|
+
className: "studio-screen-surface__announcement",
|
|
3107
|
+
role: "status",
|
|
3108
|
+
"aria-live": "polite",
|
|
3109
|
+
children: w ? w.denied || !w.drop ? o.dropDenied : o.dropTarget(w.drop.target.region.kind === X.Container ? "into" : "between") : ""
|
|
3110
|
+
})
|
|
3111
|
+
]
|
|
3112
|
+
})]
|
|
3113
|
+
})
|
|
3114
|
+
});
|
|
3115
|
+
}, Tn = 40, Br = ({ controller: e, environment: t, strings: n, window: r, deviceFrame: o = !1, saveFailure: i }) => {
|
|
3116
|
+
const a = !!e.selectedId && e.canRemove(e.selectedId), c = /* @__PURE__ */ b(Ie, { children: [
|
|
3117
|
+
/* @__PURE__ */ s(sc, {
|
|
3118
|
+
windowSize: r.size,
|
|
3119
|
+
available: r.available,
|
|
3120
|
+
strings: n,
|
|
3121
|
+
onResize: r.setSize
|
|
3122
|
+
}),
|
|
3123
|
+
/* @__PURE__ */ s(Pe, {
|
|
3124
|
+
icon: /* @__PURE__ */ s(yi, { "aria-hidden": "true" }),
|
|
3125
|
+
"aria-label": n.undo,
|
|
3126
|
+
title: n.undo,
|
|
3127
|
+
variant: "ghost",
|
|
3128
|
+
size: "small",
|
|
3129
|
+
disabled: !e.canUndo,
|
|
3130
|
+
onClick: e.undo
|
|
3131
|
+
}),
|
|
3132
|
+
/* @__PURE__ */ s(Pe, {
|
|
3133
|
+
icon: /* @__PURE__ */ s(ci, { "aria-hidden": "true" }),
|
|
3134
|
+
"aria-label": n.redo,
|
|
3135
|
+
title: n.redo,
|
|
3136
|
+
variant: "ghost",
|
|
3137
|
+
size: "small",
|
|
3138
|
+
disabled: !e.canRedo,
|
|
3139
|
+
onClick: e.redo
|
|
3140
|
+
}),
|
|
3141
|
+
/* @__PURE__ */ s(Pe, {
|
|
3142
|
+
icon: /* @__PURE__ */ s(vi, { "aria-hidden": "true" }),
|
|
3143
|
+
"aria-label": n.deleteElement,
|
|
3144
|
+
title: n.deleteElement,
|
|
3145
|
+
variant: "ghost",
|
|
3146
|
+
size: "small",
|
|
3147
|
+
disabled: !a,
|
|
3148
|
+
onClick: () => e.selectedId && e.remove(e.selectedId)
|
|
3149
|
+
}),
|
|
3150
|
+
/* @__PURE__ */ s(Pe, {
|
|
3151
|
+
icon: /* @__PURE__ */ s(wt, { "aria-hidden": "true" }),
|
|
3152
|
+
"aria-label": r.isInspectorOpen ? n.closeInspector : n.openInspector,
|
|
3153
|
+
"aria-pressed": r.isInspectorOpen,
|
|
3154
|
+
title: r.isInspectorOpen ? n.closeInspector : n.openInspector,
|
|
3155
|
+
variant: "ghost",
|
|
3156
|
+
size: "small",
|
|
3157
|
+
onClick: r.toggleInspector
|
|
3158
|
+
})
|
|
3159
|
+
] });
|
|
3160
|
+
return /* @__PURE__ */ b("div", {
|
|
3161
|
+
className: "studio-screen-editor-window",
|
|
3162
|
+
role: "group",
|
|
3163
|
+
"aria-label": n.windowLabel,
|
|
3164
|
+
children: [
|
|
3165
|
+
/* @__PURE__ */ s(oc, { controls: c }),
|
|
3166
|
+
i && /* @__PURE__ */ b("p", {
|
|
3167
|
+
className: "studio-screen-editor-window__notice",
|
|
3168
|
+
role: "alert",
|
|
3169
|
+
children: [
|
|
3170
|
+
/* @__PURE__ */ s("strong", { children: n.saveRefused }),
|
|
3171
|
+
" ",
|
|
3172
|
+
i
|
|
3173
|
+
]
|
|
3174
|
+
}),
|
|
3175
|
+
/* @__PURE__ */ s("div", {
|
|
3176
|
+
className: "studio-screen-editor-window__canvas",
|
|
3177
|
+
"data-studio-viewport": "",
|
|
3178
|
+
children: /* @__PURE__ */ s("div", {
|
|
3179
|
+
className: o ? "studio-screen-editor-window__viewport studio-screen-editor-window__device" : "studio-screen-editor-window__viewport",
|
|
3180
|
+
style: o ? {
|
|
3181
|
+
width: r.size.width,
|
|
3182
|
+
minHeight: r.size.height - Tn
|
|
3183
|
+
} : void 0,
|
|
3184
|
+
children: /* @__PURE__ */ s(_c, {
|
|
3185
|
+
controller: e,
|
|
3186
|
+
environment: t,
|
|
3187
|
+
resolveBinding: () => {
|
|
3188
|
+
},
|
|
3189
|
+
strings: n.surface,
|
|
3190
|
+
viewportHeight: o ? r.size.height - Tn : void 0
|
|
3191
|
+
})
|
|
3192
|
+
})
|
|
3193
|
+
})
|
|
3194
|
+
]
|
|
3195
|
+
});
|
|
3196
|
+
};
|
|
3197
|
+
function Bc(e, t, n, r = {}, o = {}) {
|
|
3198
|
+
return {
|
|
3199
|
+
...Nr(e, t),
|
|
3200
|
+
componentName: n,
|
|
3201
|
+
properties: r,
|
|
3202
|
+
slots: o
|
|
3203
|
+
};
|
|
3204
|
+
}
|
|
3205
|
+
var Rn = 16, zr = (e) => ({
|
|
3206
|
+
left: Rn + e % 8 * 32,
|
|
3207
|
+
top: Rn + e % 8 * 32
|
|
3208
|
+
});
|
|
3209
|
+
function Ur(e, t) {
|
|
3210
|
+
const n = e.properties ?? {};
|
|
3211
|
+
return {
|
|
3212
|
+
...e,
|
|
3213
|
+
properties: {
|
|
3214
|
+
...n,
|
|
3215
|
+
[de]: Math.max(0, Math.round(t.left)),
|
|
3216
|
+
[ue]: Math.max(0, Math.round(t.top))
|
|
3217
|
+
}
|
|
3218
|
+
};
|
|
3219
|
+
}
|
|
3220
|
+
function zc(e) {
|
|
3221
|
+
const t = e.properties ?? {}, n = t[de], r = t[ue];
|
|
3222
|
+
return typeof n == "number" && typeof r == "number" ? {
|
|
3223
|
+
left: n,
|
|
3224
|
+
top: r
|
|
3225
|
+
} : void 0;
|
|
3226
|
+
}
|
|
3227
|
+
function Uc(e) {
|
|
3228
|
+
const { [de]: t, [ue]: n, ...r } = e.properties ?? {};
|
|
3229
|
+
return {
|
|
3230
|
+
...e,
|
|
3231
|
+
properties: r
|
|
3232
|
+
};
|
|
3233
|
+
}
|
|
3234
|
+
function jc(e) {
|
|
3235
|
+
switch (e) {
|
|
3236
|
+
case L.Row:
|
|
3237
|
+
case L.Wrap:
|
|
3238
|
+
case L.Grid:
|
|
3239
|
+
return le.Vertical;
|
|
3240
|
+
case L.Column:
|
|
3241
|
+
case L.Grouping:
|
|
3242
|
+
case void 0:
|
|
3243
|
+
return le.Horizontal;
|
|
3244
|
+
case L.Freeform:
|
|
3245
|
+
return le.None;
|
|
3246
|
+
}
|
|
3247
|
+
}
|
|
3248
|
+
function xn(e, t, n, r) {
|
|
3249
|
+
const o = e ?? "screen", i = jc(n), a = {
|
|
3250
|
+
id: `${o}:container`,
|
|
3251
|
+
kind: X.Container,
|
|
3252
|
+
containerId: e,
|
|
3253
|
+
index: t.length,
|
|
3254
|
+
axis: i,
|
|
3255
|
+
isEmptyContainer: t.length === 0
|
|
3256
|
+
};
|
|
3257
|
+
return i === le.None || t.length === 0 ? [a] : [a, ...Array.from({ length: t.length + 1 }, (c, d) => ({
|
|
3258
|
+
id: `${o}:between:${d}`,
|
|
3259
|
+
kind: X.Between,
|
|
3260
|
+
containerId: e,
|
|
3261
|
+
index: d,
|
|
3262
|
+
axis: i,
|
|
3263
|
+
isEmptyContainer: !1,
|
|
3264
|
+
...d > 0 ? { afterId: r.idOf(t[d - 1]) } : {},
|
|
3265
|
+
...d < t.length ? { beforeId: r.idOf(t[d]) } : {}
|
|
3266
|
+
}))];
|
|
3267
|
+
}
|
|
3268
|
+
function Vc(e, t, n) {
|
|
3269
|
+
const r = (o) => o.flatMap((i) => {
|
|
3270
|
+
if (!n.acceptsChildren(i)) return [];
|
|
3271
|
+
const a = n.childrenOf(i);
|
|
3272
|
+
return [...Fe(n.ownershipOf(i), ie.Insert) ? xn(n.idOf(i), a, n.arrangementOf(i), n) : [], ...r(a)];
|
|
3273
|
+
});
|
|
3274
|
+
return [...xn(null, e, t, n), ...r(e)];
|
|
3275
|
+
}
|
|
3276
|
+
var Wc = class {
|
|
3277
|
+
latest;
|
|
3278
|
+
publish;
|
|
3279
|
+
constructor(e, t) {
|
|
3280
|
+
this.latest = e, this.publish = t;
|
|
3281
|
+
}
|
|
3282
|
+
get current() {
|
|
3283
|
+
return this.latest;
|
|
3284
|
+
}
|
|
3285
|
+
commit(e) {
|
|
3286
|
+
return this.latest = e(this.latest), this.publish(this.latest), this.latest;
|
|
3287
|
+
}
|
|
3288
|
+
};
|
|
3289
|
+
function qc(e) {
|
|
3290
|
+
return {
|
|
3291
|
+
document: e,
|
|
3292
|
+
undoable: [],
|
|
3293
|
+
redoable: [],
|
|
3294
|
+
diagnostics: [],
|
|
3295
|
+
isDirty: !1,
|
|
3296
|
+
savedDocument: e
|
|
3297
|
+
};
|
|
3298
|
+
}
|
|
3299
|
+
function Gc(e, t, n, r) {
|
|
3300
|
+
const o = En(e.document, t, n);
|
|
3301
|
+
return o.applied ? {
|
|
3302
|
+
...e,
|
|
3303
|
+
document: o.model,
|
|
3304
|
+
undoable: [...e.undoable, {
|
|
3305
|
+
before: e.document,
|
|
3306
|
+
label: r
|
|
3307
|
+
}].slice(-100),
|
|
3308
|
+
redoable: [],
|
|
3309
|
+
diagnostics: o.diagnostics,
|
|
3310
|
+
isDirty: o.model !== e.savedDocument
|
|
3311
|
+
} : {
|
|
3312
|
+
...e,
|
|
3313
|
+
diagnostics: o.diagnostics
|
|
3314
|
+
};
|
|
3315
|
+
}
|
|
3316
|
+
function Hc(e, t, n, r) {
|
|
3317
|
+
let o = e.document;
|
|
3318
|
+
const i = [];
|
|
3319
|
+
for (const a of t) {
|
|
3320
|
+
const c = En(o, a, n);
|
|
3321
|
+
if (i.push(...c.diagnostics), !c.applied) return {
|
|
3322
|
+
...e,
|
|
3323
|
+
diagnostics: i
|
|
3324
|
+
};
|
|
3325
|
+
o = c.model;
|
|
3326
|
+
}
|
|
3327
|
+
return {
|
|
3328
|
+
...e,
|
|
3329
|
+
document: o,
|
|
3330
|
+
undoable: [...e.undoable, {
|
|
3331
|
+
before: e.document,
|
|
3332
|
+
label: r
|
|
3333
|
+
}].slice(-100),
|
|
3334
|
+
redoable: [],
|
|
3335
|
+
diagnostics: i,
|
|
3336
|
+
isDirty: o !== e.savedDocument
|
|
3337
|
+
};
|
|
3338
|
+
}
|
|
3339
|
+
var Kc = (e) => e.undoable.length > 0, Jc = (e) => e.redoable.length > 0;
|
|
3340
|
+
function Qc(e) {
|
|
3341
|
+
const t = e.undoable[e.undoable.length - 1];
|
|
3342
|
+
return t ? {
|
|
3343
|
+
...e,
|
|
3344
|
+
document: t.before,
|
|
3345
|
+
undoable: e.undoable.slice(0, -1),
|
|
3346
|
+
redoable: [...e.redoable, {
|
|
3347
|
+
before: e.document,
|
|
3348
|
+
label: t.label
|
|
3349
|
+
}],
|
|
3350
|
+
diagnostics: [],
|
|
3351
|
+
isDirty: t.before !== e.savedDocument
|
|
3352
|
+
} : e;
|
|
3353
|
+
}
|
|
3354
|
+
function Yc(e) {
|
|
3355
|
+
const t = e.redoable[e.redoable.length - 1];
|
|
3356
|
+
return t ? {
|
|
3357
|
+
...e,
|
|
3358
|
+
document: t.before,
|
|
3359
|
+
undoable: [...e.undoable, {
|
|
3360
|
+
before: e.document,
|
|
3361
|
+
label: t.label
|
|
3362
|
+
}],
|
|
3363
|
+
redoable: e.redoable.slice(0, -1),
|
|
3364
|
+
diagnostics: [],
|
|
3365
|
+
isDirty: t.before !== e.savedDocument
|
|
3366
|
+
} : e;
|
|
3367
|
+
}
|
|
3368
|
+
var Ot = (e) => e.id, Zc = (e) => e.name || Ot(e), Xc = (e) => {
|
|
3369
|
+
switch (e) {
|
|
3370
|
+
case S.Stack:
|
|
3371
|
+
return L.Column;
|
|
3372
|
+
case S.Row:
|
|
3373
|
+
return L.Row;
|
|
3374
|
+
case S.Grid:
|
|
3375
|
+
return L.Grid;
|
|
3376
|
+
case S.Wrap:
|
|
3377
|
+
return L.Wrap;
|
|
3378
|
+
case S.Canvas:
|
|
3379
|
+
return L.Freeform;
|
|
3380
|
+
case S.Container:
|
|
3381
|
+
return L.Grouping;
|
|
3382
|
+
case void 0:
|
|
3383
|
+
return;
|
|
3384
|
+
}
|
|
3385
|
+
};
|
|
3386
|
+
function ed(e) {
|
|
3387
|
+
return {
|
|
3388
|
+
idOf: Ot,
|
|
3389
|
+
nameOf: Zc,
|
|
3390
|
+
childrenOf: Se,
|
|
3391
|
+
withChildren: (t, n) => Re(t) ? {
|
|
3392
|
+
...t,
|
|
3393
|
+
children: n
|
|
3394
|
+
} : Ge(t) ? {
|
|
3395
|
+
...t,
|
|
3396
|
+
slots: { children: n }
|
|
3397
|
+
} : t,
|
|
3398
|
+
acceptsChildren: (t) => Re(t),
|
|
3399
|
+
ownershipOf: (t) => e(Ot(t)) ?? B.Local,
|
|
3400
|
+
arrangementOf: (t) => Re(t) ? Xc(or(t)) : void 0
|
|
3401
|
+
};
|
|
3402
|
+
}
|
|
3403
|
+
function td(e) {
|
|
3404
|
+
if (e.targetParentId !== null)
|
|
3405
|
+
return {
|
|
3406
|
+
kind: U.MoveNode,
|
|
3407
|
+
nodeId: Q(e.nodeId),
|
|
3408
|
+
target: Q(e.targetParentId),
|
|
3409
|
+
index: e.index
|
|
3410
|
+
};
|
|
3411
|
+
}
|
|
3412
|
+
function jr(e, t, n) {
|
|
3413
|
+
return {
|
|
3414
|
+
kind: U.InsertNode,
|
|
3415
|
+
target: Q(e),
|
|
3416
|
+
index: t,
|
|
3417
|
+
element: n
|
|
3418
|
+
};
|
|
3419
|
+
}
|
|
3420
|
+
function nd(e) {
|
|
3421
|
+
return {
|
|
3422
|
+
kind: U.RemoveNode,
|
|
3423
|
+
nodeId: Q(e)
|
|
3424
|
+
};
|
|
3425
|
+
}
|
|
3426
|
+
var rd = (e) => (e?.children ?? []).length;
|
|
3427
|
+
function od(e, t, n) {
|
|
3428
|
+
const r = Ce(e, t.nodeId);
|
|
3429
|
+
if (!r || t.targetParentId === null) return;
|
|
3430
|
+
const o = Ze(e, t.nodeId), i = Ce(e, t.targetParentId), a = !!o && ce(o), c = !!i && ce(i);
|
|
3431
|
+
if (!a && !c) return;
|
|
3432
|
+
const d = a && c && o.id === t.targetParentId, u = d ? o.children.findIndex((p) => p.id === t.nodeId) : t.index, l = c ? Ur(r, n ?? (d ? zc(r) : void 0) ?? zr(rd(i))) : Uc(r);
|
|
3433
|
+
return [{
|
|
3434
|
+
kind: U.RemoveNode,
|
|
3435
|
+
nodeId: Q(t.nodeId)
|
|
3436
|
+
}, jr(t.targetParentId, u, l)];
|
|
3437
|
+
}
|
|
3438
|
+
function id(e) {
|
|
3439
|
+
return e ? ce(e) ? L.Freeform : $t(e) ? L.Grid : _t(e) ? e.orientation === we.Horizontal ? L.Row : L.Column : L.Column : L.Column;
|
|
3440
|
+
}
|
|
3441
|
+
var ad = (e, t) => Math.max(0, Math.min(e, t));
|
|
3442
|
+
function Nn(e, t, n) {
|
|
3443
|
+
const r = Z(e, t.nodeId, n);
|
|
3444
|
+
if (!r) return $.NodeNotFound;
|
|
3445
|
+
if (!Fe(n.ownershipOf(r.node), ie.Move)) return $.NodeLocked;
|
|
3446
|
+
let o = e;
|
|
3447
|
+
if (t.targetParentId !== null) {
|
|
3448
|
+
const i = Z(e, t.targetParentId, n);
|
|
3449
|
+
if (!i) return $.TargetNotFound;
|
|
3450
|
+
if (lr(r.node, t.targetParentId, n)) return $.WouldCreateCycle;
|
|
3451
|
+
if (!n.acceptsChildren(i.node)) return $.TargetNotContainer;
|
|
3452
|
+
if (!Fe(n.ownershipOf(i.node), ie.Insert)) return $.TargetLocked;
|
|
3453
|
+
o = n.childrenOf(i.node);
|
|
3454
|
+
}
|
|
3455
|
+
if ((r.parent === null ? null : n.idOf(r.parent)) === t.targetParentId) {
|
|
3456
|
+
const i = o.length - 1;
|
|
3457
|
+
if (ad(t.index, i) === r.index) return $.NoChange;
|
|
3458
|
+
}
|
|
3459
|
+
}
|
|
3460
|
+
var sd = "composition";
|
|
3461
|
+
function ld(e, t) {
|
|
3462
|
+
const n = e.screens.find((a) => a.name === Ye), r = t !== void 0 ? St(t, !0) : St(void 0), o = po(e, r).levels.filter((a) => a.kind === Zr.ScreenTemplate).map((a) => a.owner), i = [];
|
|
3463
|
+
for (const a of o) {
|
|
3464
|
+
const c = e.screenTemplates.find((d) => d.name === a);
|
|
3465
|
+
if (c)
|
|
3466
|
+
for (const d of c.slots) i.push(...c.content?.[d.name] ?? []);
|
|
3467
|
+
}
|
|
3468
|
+
return (t === void 0 || r.kind === vt.Screen) && i.push(...n?.slotContent.content ?? []), {
|
|
3469
|
+
element: Qe(S.Stack, sd, "Composition", i),
|
|
3470
|
+
roots: i,
|
|
3471
|
+
templates: o
|
|
3472
|
+
};
|
|
3473
|
+
}
|
|
3474
|
+
function cd(e) {
|
|
3475
|
+
switch (e) {
|
|
3476
|
+
case Zt.Inherited:
|
|
3477
|
+
return B.Inherited;
|
|
3478
|
+
case Zt.ConfigurableInherited:
|
|
3479
|
+
return B.ConfigurableInherited;
|
|
3480
|
+
default:
|
|
3481
|
+
return B.Local;
|
|
3482
|
+
}
|
|
3483
|
+
}
|
|
3484
|
+
function dd(e, t, n) {
|
|
3485
|
+
const r = /* @__PURE__ */ new Map();
|
|
3486
|
+
for (const o of rr(t)) {
|
|
3487
|
+
const i = An(e, Q(o), n);
|
|
3488
|
+
r.set(o, i ? cd(i.provenance.kind) : B.Inherited);
|
|
3489
|
+
}
|
|
3490
|
+
return (o) => r.get(o) ?? B.Local;
|
|
3491
|
+
}
|
|
3492
|
+
var Fn = () => globalThis.crypto.randomUUID();
|
|
3493
|
+
function ud(e) {
|
|
3494
|
+
const [t, n] = M({
|
|
3495
|
+
catalog: e,
|
|
3496
|
+
times: 0
|
|
3497
|
+
});
|
|
3498
|
+
return Ne(() => {
|
|
3499
|
+
let r = !0;
|
|
3500
|
+
const o = () => {
|
|
3501
|
+
r && n((i) => ({
|
|
3502
|
+
catalog: e,
|
|
3503
|
+
times: i.times + 1
|
|
3504
|
+
}));
|
|
3505
|
+
};
|
|
3506
|
+
return e.load().then(o, o), () => {
|
|
3507
|
+
r = !1;
|
|
3508
|
+
};
|
|
3509
|
+
}, [e]), t.catalog === e ? t.times : 0;
|
|
3510
|
+
}
|
|
3511
|
+
var pd = (e, t) => Ze(e, t)?.id;
|
|
3512
|
+
function Vr(e, t, n) {
|
|
3513
|
+
const [r, o] = M(() => qc(e.document)), i = H(void 0);
|
|
3514
|
+
i.current ??= new Wc(r, o);
|
|
3515
|
+
const a = z((m) => i.current.commit(m), []), [c, d] = M(), u = ud(n.runtime.icons), l = _(() => ({
|
|
3516
|
+
catalog: n.runtime.catalog,
|
|
3517
|
+
scope: St(t, t !== void 0),
|
|
3518
|
+
queryCandidates: [...n.queryCandidates],
|
|
3519
|
+
iconCatalog: n.runtime.icons
|
|
3520
|
+
}), [
|
|
3521
|
+
n,
|
|
3522
|
+
t,
|
|
3523
|
+
u
|
|
3524
|
+
]), p = _(() => ld(r.document, t), [r.document, t]), w = _(() => dd(r.document, p.roots, l), [
|
|
3525
|
+
r.document,
|
|
3526
|
+
p,
|
|
3527
|
+
l
|
|
3528
|
+
]), g = _(() => ed(w), [w]), k = Ke(r.document, t), x = _(() => Vc(p.roots, id(k), g).filter((m) => m.containerId !== null), [
|
|
3529
|
+
p,
|
|
3530
|
+
k,
|
|
3531
|
+
g
|
|
3532
|
+
]), C = c ? Ce(p.roots, c) : void 0, I = _(() => c ? An(r.document, Q(c), l) : void 0, [
|
|
3533
|
+
r.document,
|
|
3534
|
+
c,
|
|
3535
|
+
l
|
|
3536
|
+
]), F = z((m, f) => {
|
|
3537
|
+
const y = i.current.current, P = a((O) => Gc(O, m, l, f));
|
|
3538
|
+
return {
|
|
3539
|
+
applied: P.undoable.length > y.undoable.length || P.document !== y.document,
|
|
3540
|
+
diagnostics: P.diagnostics
|
|
3541
|
+
};
|
|
3542
|
+
}, [a, l]), N = z((m, f) => {
|
|
3543
|
+
F(m, f);
|
|
3544
|
+
}, [F]), E = z((m, f) => {
|
|
3545
|
+
const y = i.current.current, P = a((O) => Hc(O, m, l, f));
|
|
3546
|
+
return {
|
|
3547
|
+
applied: P.document !== y.document,
|
|
3548
|
+
diagnostics: P.diagnostics
|
|
3549
|
+
};
|
|
3550
|
+
}, [a, l]), v = z((m, f) => {
|
|
3551
|
+
const y = m ?? k?.id, P = y ? Ce(p.roots, y)?.children ?? [] : [];
|
|
3552
|
+
return {
|
|
3553
|
+
parent: y,
|
|
3554
|
+
index: f ?? P.length
|
|
3555
|
+
};
|
|
3556
|
+
}, [k, p]), T = z((m, f, y, P, O) => {
|
|
3557
|
+
const D = v(f, y);
|
|
3558
|
+
if (!D.parent) return;
|
|
3559
|
+
const V = Ce(p.roots, D.parent), Oe = V && ce(V) ? Ur(m, O ?? zr((V.children ?? []).length)) : m;
|
|
3560
|
+
F(jr(D.parent, D.index, Oe), P).applied && d(m.id);
|
|
3561
|
+
}, [
|
|
3562
|
+
F,
|
|
3563
|
+
v,
|
|
3564
|
+
p
|
|
3565
|
+
]), R = z((m, f) => {
|
|
3566
|
+
const y = od(p.roots, m, f), P = Nn(p.roots, m, g);
|
|
3567
|
+
if (P && !(P === $.NoChange && y && m.targetParentId === pd(p.roots, m.nodeId))) return P;
|
|
3568
|
+
if (y) return E(y, "Move").applied ? void 0 : $.NodeLocked;
|
|
3569
|
+
const O = td(m);
|
|
3570
|
+
return O ? F(O, "Move").applied ? void 0 : $.NodeLocked : $.TargetNotContainer;
|
|
3571
|
+
}, [
|
|
3572
|
+
p,
|
|
3573
|
+
g,
|
|
3574
|
+
F,
|
|
3575
|
+
E
|
|
3576
|
+
]);
|
|
3577
|
+
return {
|
|
3578
|
+
document: r.document,
|
|
3579
|
+
composition: p,
|
|
3580
|
+
context: l,
|
|
3581
|
+
selectedId: c,
|
|
3582
|
+
selection: C,
|
|
3583
|
+
inspection: I,
|
|
3584
|
+
diagnostics: r.diagnostics,
|
|
3585
|
+
adapter: g,
|
|
3586
|
+
ownershipOf: w,
|
|
3587
|
+
dropRegions: x,
|
|
3588
|
+
select: d,
|
|
3589
|
+
apply: N,
|
|
3590
|
+
tryApply: F,
|
|
3591
|
+
applyAll: E,
|
|
3592
|
+
move: R,
|
|
3593
|
+
validateMove: (m) => Nn(p.roots, m, g),
|
|
3594
|
+
insertComponent: (m, f, y, P) => T(Bc(Fn(), m, m), f, y, "Add", P),
|
|
3595
|
+
insertLayout: (m, f, y, P) => T(Qe(m, Fn(), m), f, y, "Add layout", P),
|
|
3596
|
+
remove: (m) => {
|
|
3597
|
+
if (!Tt(p.roots, m, g)) return;
|
|
3598
|
+
const f = cr(p.roots, m, g);
|
|
3599
|
+
F(nd(m), "Remove").applied && d((y) => y === m || y === void 0 ? f : y);
|
|
3600
|
+
},
|
|
3601
|
+
canRemove: (m) => Tt(p.roots, m, g),
|
|
3602
|
+
setProperty: (m, f) => c && N(fr(c, m, f), "Change"),
|
|
3603
|
+
undo: () => {
|
|
3604
|
+
a(Qc);
|
|
3605
|
+
},
|
|
3606
|
+
redo: () => {
|
|
3607
|
+
a(Yc);
|
|
3608
|
+
},
|
|
3609
|
+
canUndo: Kc(r),
|
|
3610
|
+
canRedo: Jc(r),
|
|
3611
|
+
isDirty: r.isDirty
|
|
3612
|
+
};
|
|
3613
|
+
}
|
|
3614
|
+
var md = () => ({
|
|
3615
|
+
width: window.innerWidth - 64,
|
|
3616
|
+
height: window.innerHeight - 64
|
|
3617
|
+
}), Jp = (e) => /* @__PURE__ */ s(Or, {
|
|
3618
|
+
strings: e.strings,
|
|
3619
|
+
onClose: () => e.onDismiss?.(),
|
|
3620
|
+
children: /* @__PURE__ */ s(fd, { ...e })
|
|
3621
|
+
}), fd = (e) => {
|
|
3622
|
+
const t = _(() => Fr(e.subject), [e.subject]);
|
|
3623
|
+
return t.opened ? /* @__PURE__ */ s(hd, {
|
|
3624
|
+
...e,
|
|
3625
|
+
opened: t.subject
|
|
3626
|
+
}, e.environment.runtime.id) : /* @__PURE__ */ s(Mn, {
|
|
3627
|
+
sourceRect: e.sourceRect,
|
|
3628
|
+
initialSize: e.initialSize,
|
|
3629
|
+
centerOffsetX: e.centerOffsetX,
|
|
3630
|
+
onClosed: () => e.onDismiss?.(),
|
|
3631
|
+
children: (n) => /* @__PURE__ */ s(Lr, {
|
|
3632
|
+
problem: t.problem,
|
|
3633
|
+
strings: e.strings,
|
|
3634
|
+
onClose: () => n.close()
|
|
3635
|
+
})
|
|
3636
|
+
});
|
|
3637
|
+
}, hd = ({ subject: e, environment: t, strings: n, layoutLabels: r, icons: o, paletteSources: i, sourceRect: a, initialSize: c, centerOffsetX: d, renderPaletteHost: u, onClose: l, onBeforeClose: p, opened: w }) => {
|
|
3638
|
+
const g = Vr(w, e.authoringTemplate, t), k = _(() => xr(n.layoutDrawer, r, o, i, n.packageTitles), [
|
|
3639
|
+
n,
|
|
3640
|
+
r,
|
|
3641
|
+
o,
|
|
3642
|
+
i
|
|
3643
|
+
]), x = z((v) => {
|
|
3644
|
+
const T = Ke(g.document, e.authoringTemplate);
|
|
3645
|
+
l({
|
|
3646
|
+
document: g.document,
|
|
3647
|
+
legacyElements: Pt(T, t.runtime.legacyTypeOf),
|
|
3648
|
+
windowSize: v,
|
|
3649
|
+
layout: xt(T),
|
|
3650
|
+
changed: g.isDirty
|
|
3651
|
+
});
|
|
3652
|
+
}, [
|
|
3653
|
+
g,
|
|
3654
|
+
t.runtime.legacyTypeOf,
|
|
3655
|
+
l,
|
|
3656
|
+
e.authoringTemplate
|
|
3657
|
+
]), [C, I] = M(), F = z(async (v) => {
|
|
3658
|
+
const T = Ke(g.document, e.authoringTemplate), R = {
|
|
3659
|
+
document: g.document,
|
|
3660
|
+
legacyElements: Pt(T, t.runtime.legacyTypeOf),
|
|
3661
|
+
windowSize: v,
|
|
3662
|
+
layout: xt(T),
|
|
3663
|
+
changed: g.isDirty
|
|
3664
|
+
}, m = await p?.(R);
|
|
3665
|
+
return I(m), !m;
|
|
3666
|
+
}, [
|
|
3667
|
+
g,
|
|
3668
|
+
t.runtime.legacyTypeOf,
|
|
3669
|
+
p,
|
|
3670
|
+
e.authoringTemplate
|
|
3671
|
+
]), N = /* @__PURE__ */ s(Tr, {
|
|
3672
|
+
drawers: k,
|
|
3673
|
+
closeLabel: n.closeDrawer,
|
|
3674
|
+
onActivate: E
|
|
3675
|
+
});
|
|
3676
|
+
function E(v) {
|
|
3677
|
+
if (!Xe(v)) return;
|
|
3678
|
+
const T = g.selection && gd(g) ? g.selectedId : void 0;
|
|
3679
|
+
v.kind === "layout" ? g.insertLayout(v.item, T, void 0) : g.insertComponent(Kt(v.componentName, v.package), T, void 0);
|
|
3680
|
+
}
|
|
3681
|
+
return /* @__PURE__ */ b(Mr, {
|
|
3682
|
+
environment: t,
|
|
3683
|
+
children: [u ? u(N) : /* @__PURE__ */ s(Dr, {
|
|
3684
|
+
placement: "floating",
|
|
3685
|
+
children: N
|
|
3686
|
+
}), /* @__PURE__ */ s(Mn, {
|
|
3687
|
+
sourceRect: a,
|
|
3688
|
+
initialSize: c,
|
|
3689
|
+
centerOffsetX: d,
|
|
3690
|
+
canClose: F,
|
|
3691
|
+
onClosed: x,
|
|
3692
|
+
renderInspector: (v) => /* @__PURE__ */ s(kr, {
|
|
3693
|
+
strings: n,
|
|
3694
|
+
controller: g,
|
|
3695
|
+
environment: t,
|
|
3696
|
+
authoringTemplate: e.authoringTemplate,
|
|
3697
|
+
onClose: v.toggleInspector,
|
|
3698
|
+
structure: /* @__PURE__ */ s(pr, {
|
|
3699
|
+
roots: g.composition.roots,
|
|
3700
|
+
adapter: g.adapter,
|
|
3701
|
+
strings: n,
|
|
3702
|
+
selectedId: g.selectedId,
|
|
3703
|
+
onSelect: g.select,
|
|
3704
|
+
onEdit: g.move,
|
|
3705
|
+
onRemove: g.remove
|
|
3706
|
+
})
|
|
3707
|
+
}),
|
|
3708
|
+
children: (v) => /* @__PURE__ */ s(Br, {
|
|
3709
|
+
controller: g,
|
|
3710
|
+
environment: t,
|
|
3711
|
+
strings: n,
|
|
3712
|
+
window: {
|
|
3713
|
+
...v,
|
|
3714
|
+
available: md()
|
|
3715
|
+
},
|
|
3716
|
+
saveFailure: C
|
|
3717
|
+
})
|
|
3718
|
+
})]
|
|
3719
|
+
});
|
|
3720
|
+
};
|
|
3721
|
+
function gd(e) {
|
|
3722
|
+
return !!e.selection && "children" in e.selection;
|
|
3723
|
+
}
|
|
3724
|
+
var ve = (e) => typeof e == "object" && e !== null && !Array.isArray(e);
|
|
3725
|
+
function vd(e, t) {
|
|
3726
|
+
if (!t) return e;
|
|
3727
|
+
const n = { ...e };
|
|
3728
|
+
for (const [r, o] of Object.entries(t)) {
|
|
3729
|
+
const i = n[r];
|
|
3730
|
+
n[r] = ve(i) && ve(o) ? {
|
|
3731
|
+
...i,
|
|
3732
|
+
...o,
|
|
3733
|
+
...ve(i.props) || ve(o.props) ? { props: {
|
|
3734
|
+
...ve(i.props) ? i.props : {},
|
|
3735
|
+
...ve(o.props) ? o.props : {}
|
|
3736
|
+
} } : {}
|
|
3737
|
+
} : o;
|
|
3738
|
+
}
|
|
3739
|
+
return n;
|
|
3740
|
+
}
|
|
3741
|
+
var ye = "p-anchored-overlay", _e = "p-collapsible", ht = "p-overlay-mask", h = (e, t) => ({ props: t ? {
|
|
3742
|
+
styles: e,
|
|
3743
|
+
motionProps: { name: t }
|
|
3744
|
+
} : { styles: e } }), W = (e) => ({ props: { motionProps: { name: e } } }), yd = {
|
|
3745
|
+
"Accordion.Root": h(Ri, _e),
|
|
3746
|
+
"AutoComplete.Root": h(xi),
|
|
3747
|
+
"AutoComplete.Popup": W(ye),
|
|
3748
|
+
"Avatar.Root": h(Ni),
|
|
3749
|
+
AvatarGroup: h(Fi),
|
|
3750
|
+
Badge: h(Di),
|
|
3751
|
+
"Breadcrumb.Root": h(Oi),
|
|
3752
|
+
Button: h(Li),
|
|
3753
|
+
ButtonGroup: h(Mi),
|
|
3754
|
+
"Card.Root": h(Ei),
|
|
3755
|
+
"Carousel.Root": h(Ai),
|
|
3756
|
+
"Checkbox.Root": h($i),
|
|
3757
|
+
CheckboxGroup: h(_i),
|
|
3758
|
+
"Chip.Root": h(Bi),
|
|
3759
|
+
"Compare.Root": h(zi),
|
|
3760
|
+
"ContextMenu.Root": h(Ui),
|
|
3761
|
+
"ContextMenu.Popup": W(ye),
|
|
3762
|
+
"DataTable.Root": h(ji),
|
|
3763
|
+
"DataView.Root": h(Vi),
|
|
3764
|
+
"DatePicker.Root": h(Wi),
|
|
3765
|
+
"DatePicker.Popup": W(ye),
|
|
3766
|
+
"Dialog.Root": h(qi),
|
|
3767
|
+
"Dialog.Backdrop": W(ht),
|
|
3768
|
+
"Dialog.Popup": W("p-dialog"),
|
|
3769
|
+
Divider: h(Gi),
|
|
3770
|
+
"Drawer.Root": h(Hi),
|
|
3771
|
+
"Drawer.Backdrop": W(ht),
|
|
3772
|
+
"Drawer.Popup": W("p-drawer"),
|
|
3773
|
+
"Fieldset.Root": h(Ki, _e),
|
|
3774
|
+
"FileUpload.Root": h(Ji),
|
|
3775
|
+
FloatLabel: h(Qi),
|
|
3776
|
+
Fluid: h(Yi),
|
|
3777
|
+
"Gallery.Root": h(Zi),
|
|
3778
|
+
"IconField.Root": h(Xi),
|
|
3779
|
+
IftaLabel: h(ea),
|
|
3780
|
+
"Inplace.Root": h(ta),
|
|
3781
|
+
"InputColor.Root": h(na),
|
|
3782
|
+
"InputGroup.Root": h(ra),
|
|
3783
|
+
"InputNumber.Root": h(oa),
|
|
3784
|
+
"InputOtp.Root": h(ia),
|
|
3785
|
+
InputPassword: h(ba),
|
|
3786
|
+
"InputTags.Root": h(aa),
|
|
3787
|
+
InputText: h(sa),
|
|
3788
|
+
"Knob.Root": h(la),
|
|
3789
|
+
Label: h(ca),
|
|
3790
|
+
"Listbox.Root": h(da),
|
|
3791
|
+
"Menu.Root": h(ua),
|
|
3792
|
+
"Menu.Popup": W(ye),
|
|
3793
|
+
"Message.Root": h(pa),
|
|
3794
|
+
"MeterGroup.Root": h(ma),
|
|
3795
|
+
NavigationMenu: h(fa),
|
|
3796
|
+
"OrganizationChart.Root": h(ha),
|
|
3797
|
+
OverlayBadge: h(ga),
|
|
3798
|
+
"Paginator.Root": h(va),
|
|
3799
|
+
"Panel.Root": h(ya, _e),
|
|
3800
|
+
"Popover.Root": h(wa),
|
|
3801
|
+
"Popover.Popup": W(ye),
|
|
3802
|
+
"ProgressBar.Root": h(Ca),
|
|
3803
|
+
"ProgressSpinner.Root": h(Sa),
|
|
3804
|
+
"RadioButton.Root": h(ka),
|
|
3805
|
+
RadioButtonGroup: h(Ia),
|
|
3806
|
+
"Rating.Root": h(Pa),
|
|
3807
|
+
"ScrollArea.Root": h(Ta),
|
|
3808
|
+
"Select.Root": h(Ra),
|
|
3809
|
+
"Select.Popup": W(ye),
|
|
3810
|
+
"Sidebar.Root": h(Na),
|
|
3811
|
+
"Sidebar.Layout": h(xa),
|
|
3812
|
+
"Sidebar.Backdrop": W(ht),
|
|
3813
|
+
Skeleton: h(Fa),
|
|
3814
|
+
"Slider.Root": h(Da),
|
|
3815
|
+
"SpeedDial.Root": h(Oa),
|
|
3816
|
+
"Splitter.Root": h(La),
|
|
3817
|
+
"Stepper.Root": h(Ma, _e),
|
|
3818
|
+
"Tabs.Root": h(Ea),
|
|
3819
|
+
Tag: h(Aa),
|
|
3820
|
+
"Terminal.Root": h($a),
|
|
3821
|
+
Textarea: h(_a),
|
|
3822
|
+
"Timeline.Root": h(Ba),
|
|
3823
|
+
"Toast.Root": h(za),
|
|
3824
|
+
"Toaster.Root": h(Ua),
|
|
3825
|
+
"ToggleButton.Root": h(ja),
|
|
3826
|
+
ToggleButtonGroup: h(Va),
|
|
3827
|
+
"ToggleSwitch.Root": h(Wa),
|
|
3828
|
+
"Toolbar.Root": h(qa),
|
|
3829
|
+
"Tooltip.Root": h(Ga),
|
|
3830
|
+
"Tooltip.Popup": W("p-tooltip"),
|
|
3831
|
+
"Tree.Root": h(Ha)
|
|
3832
|
+
}, bd = tn.find((e) => e.name === "lara-light-blue") ?? tn[0], Qp = ({ defaults: e, theme: t, ...n }) => {
|
|
3833
|
+
const r = Fo(bd);
|
|
3834
|
+
return /* @__PURE__ */ s(Ti, {
|
|
3835
|
+
...n,
|
|
3836
|
+
theme: t ?? r?.theme,
|
|
3837
|
+
defaults: vd(yd, e)
|
|
3838
|
+
});
|
|
3839
|
+
}, Yp = (e) => /* @__PURE__ */ s(Or, {
|
|
3840
|
+
strings: e.strings,
|
|
3841
|
+
onClose: e.onDismiss,
|
|
3842
|
+
children: /* @__PURE__ */ s(wd, { ...e })
|
|
3843
|
+
}), wd = (e) => {
|
|
3844
|
+
const t = _(() => Fr(e.subject), [e.subject]);
|
|
3845
|
+
return t.opened ? /* @__PURE__ */ s(Cd, {
|
|
3846
|
+
...e,
|
|
3847
|
+
opened: t.subject
|
|
3848
|
+
}, e.environment.runtime.id) : /* @__PURE__ */ s(Lr, {
|
|
3849
|
+
problem: t.problem,
|
|
3850
|
+
strings: e.strings
|
|
3851
|
+
});
|
|
3852
|
+
}, Cd = ({ subject: e, environment: t, strings: n, layoutLabels: r, icons: o, paletteSources: i, initialSize: a, onChange: c, renderPaletteHost: d, opened: u }) => {
|
|
3853
|
+
const l = Vr(u, e.authoringTemplate, t), [p, w] = M(a ?? Jt[ke.Desktop]), [g, k] = M(!0), x = _(() => xr(n.layoutDrawer, r, o, i, n.packageTitles), [
|
|
3854
|
+
n,
|
|
3855
|
+
r,
|
|
3856
|
+
o,
|
|
3857
|
+
i
|
|
3858
|
+
]), C = H(c);
|
|
3859
|
+
C.current = c, Ne(() => {
|
|
3860
|
+
const N = Ke(l.document, e.authoringTemplate);
|
|
3861
|
+
C.current?.({
|
|
3862
|
+
document: l.document,
|
|
3863
|
+
legacyElements: Pt(N, t.runtime.legacyTypeOf),
|
|
3864
|
+
windowSize: p,
|
|
3865
|
+
layout: xt(N),
|
|
3866
|
+
changed: l.isDirty
|
|
3867
|
+
});
|
|
3868
|
+
}, [
|
|
3869
|
+
l.document,
|
|
3870
|
+
l.isDirty,
|
|
3871
|
+
p,
|
|
3872
|
+
e.authoringTemplate,
|
|
3873
|
+
t.runtime.legacyTypeOf
|
|
3874
|
+
]);
|
|
3875
|
+
const I = z((N) => {
|
|
3876
|
+
if (!Xe(N)) return;
|
|
3877
|
+
const E = l.selection, v = E && "children" in E ? l.selectedId : void 0;
|
|
3878
|
+
N.kind === "layout" ? l.insertLayout(N.item, v, void 0) : l.insertComponent(Kt(N.componentName, N.package), v, void 0);
|
|
3879
|
+
}, [l]), F = /* @__PURE__ */ s(Tr, {
|
|
3880
|
+
drawers: x,
|
|
3881
|
+
closeLabel: n.closeDrawer,
|
|
3882
|
+
onActivate: I
|
|
3883
|
+
});
|
|
3884
|
+
return /* @__PURE__ */ s(Mr, {
|
|
3885
|
+
environment: t,
|
|
3886
|
+
children: /* @__PURE__ */ b("div", {
|
|
3887
|
+
className: "studio-screen-editor-workspace",
|
|
3888
|
+
children: [
|
|
3889
|
+
d ? d(F) : /* @__PURE__ */ s(Dr, {
|
|
3890
|
+
placement: "inline",
|
|
3891
|
+
children: F
|
|
3892
|
+
}),
|
|
3893
|
+
/* @__PURE__ */ s("div", {
|
|
3894
|
+
className: "studio-screen-editor-workspace__stage",
|
|
3895
|
+
children: /* @__PURE__ */ s(Br, {
|
|
3896
|
+
controller: l,
|
|
3897
|
+
environment: t,
|
|
3898
|
+
strings: n,
|
|
3899
|
+
window: {
|
|
3900
|
+
size: p,
|
|
3901
|
+
setSize: w,
|
|
3902
|
+
isInspectorOpen: g,
|
|
3903
|
+
toggleInspector: () => k((N) => !N),
|
|
3904
|
+
available: {
|
|
3905
|
+
width: 1600,
|
|
3906
|
+
height: 1e3
|
|
3907
|
+
}
|
|
3908
|
+
},
|
|
3909
|
+
deviceFrame: !0
|
|
3910
|
+
})
|
|
3911
|
+
}),
|
|
3912
|
+
g && /* @__PURE__ */ s("aside", {
|
|
3913
|
+
className: "studio-screen-editor-workspace__inspector",
|
|
3914
|
+
children: /* @__PURE__ */ s(kr, {
|
|
3915
|
+
strings: n,
|
|
3916
|
+
controller: l,
|
|
3917
|
+
environment: t,
|
|
3918
|
+
authoringTemplate: e.authoringTemplate,
|
|
3919
|
+
onClose: () => k(!1),
|
|
3920
|
+
structure: /* @__PURE__ */ s(pr, {
|
|
3921
|
+
roots: l.composition.roots,
|
|
3922
|
+
adapter: l.adapter,
|
|
3923
|
+
strings: n,
|
|
3924
|
+
selectedId: l.selectedId,
|
|
3925
|
+
onSelect: l.select,
|
|
3926
|
+
onEdit: l.move,
|
|
3927
|
+
onRemove: l.remove
|
|
3928
|
+
})
|
|
3929
|
+
})
|
|
3930
|
+
})
|
|
3931
|
+
]
|
|
3932
|
+
})
|
|
3933
|
+
});
|
|
3934
|
+
};
|
|
3935
|
+
function Sd(e) {
|
|
3936
|
+
const t = {
|
|
3937
|
+
"row.id": "Guid",
|
|
3938
|
+
"selection.id": "Guid"
|
|
3939
|
+
};
|
|
3940
|
+
for (const n of e) for (const r of n.parameters) t[`route.${r.name}`] ??= r.type;
|
|
3941
|
+
return t;
|
|
3942
|
+
}
|
|
3943
|
+
var kd = new Set(Object.values(Yr)), Id = new Set(Object.values(Qr));
|
|
3944
|
+
function Pd(e) {
|
|
3945
|
+
return e.filter((t) => kd.has(t.resultShape) && t.origin.every((n) => Id.has(n.kind))).map((t) => t);
|
|
3946
|
+
}
|
|
3947
|
+
function Zp(e) {
|
|
3948
|
+
const t = Pd(e.queryCandidates ?? []);
|
|
3949
|
+
return {
|
|
3950
|
+
runtime: e.runtime,
|
|
3951
|
+
queryCandidates: t,
|
|
3952
|
+
stateChangeSlices: e.stateChangeSlices ?? [],
|
|
3953
|
+
destinations: e.destinations ?? [],
|
|
3954
|
+
availableSources: Sd(t),
|
|
3955
|
+
...e.richText === !1 ? {} : { richText: e.richText ?? Ka },
|
|
3956
|
+
...e.fileUpload ? { fileUpload: e.fileUpload } : {}
|
|
3957
|
+
};
|
|
3958
|
+
}
|
|
3959
|
+
function Td(e) {
|
|
3960
|
+
return e.flatMap((t) => t.iconLibrary ? [t.iconLibrary.catalog] : []);
|
|
3961
|
+
}
|
|
3962
|
+
function Rd(e, t) {
|
|
3963
|
+
const n = co(e, t.map((r) => r.manifest));
|
|
3964
|
+
return new to(n, Td(t));
|
|
3965
|
+
}
|
|
3966
|
+
var xd = [
|
|
3967
|
+
"PrimeReact.Accordion",
|
|
3968
|
+
"PrimeReact.AutoComplete",
|
|
3969
|
+
"PrimeReact.Avatar",
|
|
3970
|
+
"PrimeReact.AvatarGroup",
|
|
3971
|
+
"PrimeReact.Badge",
|
|
3972
|
+
"PrimeReact.BlockUI",
|
|
3973
|
+
"PrimeReact.Breadcrumb",
|
|
3974
|
+
"PrimeReact.Button",
|
|
3975
|
+
"PrimeReact.Card",
|
|
3976
|
+
"PrimeReact.Carousel",
|
|
3977
|
+
"PrimeReact.CascadeSelect",
|
|
3978
|
+
"PrimeReact.Chart",
|
|
3979
|
+
"PrimeReact.Checkbox",
|
|
3980
|
+
"PrimeReact.Chip",
|
|
3981
|
+
"PrimeReact.ColorPicker",
|
|
3982
|
+
"PrimeReact.ConfirmDialog",
|
|
3983
|
+
"PrimeReact.ConfirmPopup",
|
|
3984
|
+
"PrimeReact.ContextMenu",
|
|
3985
|
+
"PrimeReact.DataScroller",
|
|
3986
|
+
"PrimeReact.DataTable",
|
|
3987
|
+
"PrimeReact.DataView",
|
|
3988
|
+
"PrimeReact.DatePicker",
|
|
3989
|
+
"PrimeReact.Deferred",
|
|
3990
|
+
"PrimeReact.Dialog",
|
|
3991
|
+
"PrimeReact.Divider",
|
|
3992
|
+
"PrimeReact.Dock",
|
|
3993
|
+
"PrimeReact.Drawer",
|
|
3994
|
+
"PrimeReact.Editor",
|
|
3995
|
+
"PrimeReact.Fieldset",
|
|
3996
|
+
"PrimeReact.FileUpload",
|
|
3997
|
+
"PrimeReact.FloatLabel",
|
|
3998
|
+
"PrimeReact.Galleria",
|
|
3999
|
+
"PrimeReact.IconField",
|
|
4000
|
+
"PrimeReact.Image",
|
|
4001
|
+
"PrimeReact.Inplace",
|
|
4002
|
+
"PrimeReact.InputMask",
|
|
4003
|
+
"PrimeReact.InputNumber",
|
|
4004
|
+
"PrimeReact.InputOtp",
|
|
4005
|
+
"PrimeReact.InputText",
|
|
4006
|
+
"PrimeReact.Knob",
|
|
4007
|
+
"PrimeReact.ListBox",
|
|
4008
|
+
"PrimeReact.MegaMenu",
|
|
4009
|
+
"PrimeReact.Mention",
|
|
4010
|
+
"PrimeReact.Menu",
|
|
4011
|
+
"PrimeReact.Menubar",
|
|
4012
|
+
"PrimeReact.Message",
|
|
4013
|
+
"PrimeReact.Messages",
|
|
4014
|
+
"PrimeReact.MeterGroup",
|
|
4015
|
+
"PrimeReact.MultiSelect",
|
|
4016
|
+
"PrimeReact.MultiStateCheckbox",
|
|
4017
|
+
"PrimeReact.OrderList",
|
|
4018
|
+
"PrimeReact.OrgChart",
|
|
4019
|
+
"PrimeReact.OverlayBadge",
|
|
4020
|
+
"PrimeReact.Paginator",
|
|
4021
|
+
"PrimeReact.Panel",
|
|
4022
|
+
"PrimeReact.PanelMenu",
|
|
4023
|
+
"PrimeReact.Password",
|
|
4024
|
+
"PrimeReact.PickList",
|
|
4025
|
+
"PrimeReact.Popover",
|
|
4026
|
+
"PrimeReact.RadioButton",
|
|
4027
|
+
"PrimeReact.Rating",
|
|
4028
|
+
"PrimeReact.ScrollPanel",
|
|
4029
|
+
"PrimeReact.ScrollTop",
|
|
4030
|
+
"PrimeReact.Select",
|
|
4031
|
+
"PrimeReact.SelectButton",
|
|
4032
|
+
"PrimeReact.Skeleton",
|
|
4033
|
+
"PrimeReact.Slider",
|
|
4034
|
+
"PrimeReact.SpeedDial",
|
|
4035
|
+
"PrimeReact.SplitButton",
|
|
4036
|
+
"PrimeReact.Splitter",
|
|
4037
|
+
"PrimeReact.Stepper",
|
|
4038
|
+
"PrimeReact.Steps",
|
|
4039
|
+
"PrimeReact.TabMenu",
|
|
4040
|
+
"PrimeReact.TabView",
|
|
4041
|
+
"PrimeReact.Tag",
|
|
4042
|
+
"PrimeReact.Terminal",
|
|
4043
|
+
"PrimeReact.Textarea",
|
|
4044
|
+
"PrimeReact.TieredMenu",
|
|
4045
|
+
"PrimeReact.Timeline",
|
|
4046
|
+
"PrimeReact.Toast",
|
|
4047
|
+
"PrimeReact.ToggleSwitch",
|
|
4048
|
+
"PrimeReact.Toolbar",
|
|
4049
|
+
"PrimeReact.Tooltip",
|
|
4050
|
+
"PrimeReact.Tree",
|
|
4051
|
+
"PrimeReact.TreeSelect",
|
|
4052
|
+
"PrimeReact.TreeTable",
|
|
4053
|
+
"PrimeReact.TriStateCheckbox",
|
|
4054
|
+
"PrimeReact.VirtualScroller",
|
|
4055
|
+
"StudioLayout.Canvas",
|
|
4056
|
+
"StudioLayout.Container",
|
|
4057
|
+
"StudioLayout.Grid",
|
|
4058
|
+
"StudioLayout.Row",
|
|
4059
|
+
"StudioLayout.Stack",
|
|
4060
|
+
"StudioLayout.Wrap",
|
|
4061
|
+
"canvas",
|
|
4062
|
+
"contentControl",
|
|
4063
|
+
"dockPanel",
|
|
4064
|
+
"externalComponent",
|
|
4065
|
+
"grid",
|
|
4066
|
+
"itemsControl",
|
|
4067
|
+
"stackPanel",
|
|
4068
|
+
"wrapPanel"
|
|
4069
|
+
], Nd = ["PrimeReact.Dialog"], Fd = new Set(xd.filter((e) => !Nd.includes(e))), Dd = [
|
|
4070
|
+
{
|
|
4071
|
+
value: J.None,
|
|
4072
|
+
label: "Run directly"
|
|
4073
|
+
},
|
|
4074
|
+
{
|
|
4075
|
+
value: J.Modal,
|
|
4076
|
+
label: "Ask in a dialog"
|
|
4077
|
+
},
|
|
4078
|
+
{
|
|
4079
|
+
value: J.Drawer,
|
|
4080
|
+
label: "Ask in a drawer"
|
|
4081
|
+
}
|
|
4082
|
+
];
|
|
4083
|
+
function Od(e) {
|
|
4084
|
+
return !e.component.endsWith(":action") || e.properties.some((t) => t.path === "presentation") ? e : {
|
|
4085
|
+
...e,
|
|
4086
|
+
properties: [...e.properties, {
|
|
4087
|
+
path: qt,
|
|
4088
|
+
label: "Presentation",
|
|
4089
|
+
group: "Behavior",
|
|
4090
|
+
valueType: A.Enum,
|
|
4091
|
+
default: J.None,
|
|
4092
|
+
choices: Dd,
|
|
4093
|
+
description: "Whether the command runs straight away or first asks for its input in a dialog or a drawer."
|
|
4094
|
+
}]
|
|
4095
|
+
};
|
|
4096
|
+
}
|
|
4097
|
+
var Ld = "Content";
|
|
4098
|
+
function Md(e) {
|
|
4099
|
+
return typeof e == "number" ? A.Number : typeof e == "boolean" ? A.Boolean : typeof e == "object" && e !== null ? A.Json : A.String;
|
|
4100
|
+
}
|
|
4101
|
+
var Ed = (e) => e.replace(/([A-Z])/g, " $1").replace(/^./, (t) => t.toUpperCase());
|
|
4102
|
+
function Ad(e) {
|
|
4103
|
+
const t = Qt(e.component, e.component.slice(e.component.lastIndexOf(":") + 1));
|
|
4104
|
+
if (!t) return e;
|
|
4105
|
+
const n = new Set(e.properties.map((o) => o.path)), r = Object.entries(t).filter(([o]) => !n.has(o)).map(([o, i]) => ({
|
|
4106
|
+
path: o,
|
|
4107
|
+
label: Ed(o),
|
|
4108
|
+
group: Ld,
|
|
4109
|
+
valueType: Md(i),
|
|
4110
|
+
description: "Shown as sample content on the design surface until you set it."
|
|
4111
|
+
}));
|
|
4112
|
+
return r.length === 0 ? e : {
|
|
4113
|
+
...e,
|
|
4114
|
+
properties: [...e.properties, ...r]
|
|
4115
|
+
};
|
|
4116
|
+
}
|
|
4117
|
+
var Dn = "Placement", $d = [{
|
|
4118
|
+
path: de,
|
|
4119
|
+
label: "Left",
|
|
4120
|
+
group: Dn,
|
|
4121
|
+
valueType: A.Number
|
|
4122
|
+
}, {
|
|
4123
|
+
path: ue,
|
|
4124
|
+
label: "Top",
|
|
4125
|
+
group: Dn,
|
|
4126
|
+
valueType: A.Number
|
|
4127
|
+
}];
|
|
4128
|
+
function _d(e) {
|
|
4129
|
+
const t = new Set(e.properties.map((n) => n.path));
|
|
4130
|
+
return {
|
|
4131
|
+
...e,
|
|
4132
|
+
properties: [...e.properties, ...$d.filter((n) => !t.has(n.path))]
|
|
4133
|
+
};
|
|
4134
|
+
}
|
|
4135
|
+
var On = "PrimeReact", Bd = 1;
|
|
4136
|
+
function zd(e, t) {
|
|
4137
|
+
const n = zt(e.map((u) => u.manifest)), r = e.flatMap((u) => u.descriptors ?? []), o = new Set(r.map((u) => u.component)), i = e.flatMap((u) => u.manifest.components.map((l) => ({
|
|
4138
|
+
component: _n(u.manifest.name, l),
|
|
4139
|
+
displayName: l,
|
|
4140
|
+
properties: []
|
|
4141
|
+
}))).filter((u) => !o.has(u.component)), a = [...r, ...i].map(Od).map(Ad).map(_d), c = [...a, ...Ud(a, n, t)], d = new Set(Object.values(n).flat());
|
|
4142
|
+
return {
|
|
4143
|
+
id: Bd++,
|
|
4144
|
+
bundles: e,
|
|
4145
|
+
registry: zn(e),
|
|
4146
|
+
packages: n,
|
|
4147
|
+
descriptors: c,
|
|
4148
|
+
catalog: oo(c),
|
|
4149
|
+
profile: t,
|
|
4150
|
+
icons: Rd(t.packages, e),
|
|
4151
|
+
iconAdapters: Po(e),
|
|
4152
|
+
isKnownComponent: (u) => d.has(u),
|
|
4153
|
+
legacyTypeOf: (u) => {
|
|
4154
|
+
const l = Bt(u, t, n), p = l?.package === On ? `${On}.${nr(l.name)}` : void 0;
|
|
4155
|
+
return p !== void 0 && Fd.has(p) ? p : void 0;
|
|
4156
|
+
}
|
|
4157
|
+
};
|
|
4158
|
+
}
|
|
4159
|
+
function Ud(e, t, n) {
|
|
4160
|
+
const r = [];
|
|
4161
|
+
for (const o of new Set(Object.values(t).flat())) {
|
|
4162
|
+
const i = Bt(o, n, t), a = i && e.find((c) => c.component === _n(i.package, i.name));
|
|
4163
|
+
a && r.push({
|
|
4164
|
+
...a,
|
|
4165
|
+
component: o
|
|
4166
|
+
});
|
|
4167
|
+
}
|
|
4168
|
+
return r;
|
|
4169
|
+
}
|
|
4170
|
+
var Yt = "Cratis.Icons.Lucide", jd = {
|
|
4171
|
+
name: Yt,
|
|
4172
|
+
version: "1.50.0",
|
|
4173
|
+
kind: qe.IconLibrary,
|
|
4174
|
+
dependencies: [],
|
|
4175
|
+
components: [],
|
|
4176
|
+
layouts: [],
|
|
4177
|
+
screenTemplates: [],
|
|
4178
|
+
dialogTemplates: [],
|
|
4179
|
+
themes: [],
|
|
4180
|
+
displayName: "Lucide",
|
|
4181
|
+
description: "Clean, consistent outline icons for navigation, actions and status.",
|
|
4182
|
+
module: "@cratis/studio.editor/IconLibraries/Lucide",
|
|
4183
|
+
license: "ISC",
|
|
4184
|
+
licenseUrl: "https://lucide.dev/license",
|
|
4185
|
+
iconLibrary: {
|
|
4186
|
+
variants: [],
|
|
4187
|
+
renderers: ["react"],
|
|
4188
|
+
attribution: "Icons by Lucide contributors",
|
|
4189
|
+
attributionUrl: "https://lucide.dev",
|
|
4190
|
+
iconCount: 1858
|
|
4191
|
+
}
|
|
4192
|
+
}, Vd = {
|
|
4193
|
+
library: Yt,
|
|
4194
|
+
loadEntries: async () => (await import("./catalog-CZx3FR-E.js")).default
|
|
4195
|
+
}, Wd = Ja, qd = {
|
|
4196
|
+
library: Yt,
|
|
4197
|
+
loadGlyph: async ({ key: e }) => (await Wd[e]?.())?.default
|
|
4198
|
+
}, Gd = {
|
|
4199
|
+
manifest: jd,
|
|
4200
|
+
components: {},
|
|
4201
|
+
iconLibrary: {
|
|
4202
|
+
catalog: Vd,
|
|
4203
|
+
adapter: qd
|
|
4204
|
+
}
|
|
4205
|
+
}, De = [
|
|
4206
|
+
Bn,
|
|
4207
|
+
Xn,
|
|
4208
|
+
Un,
|
|
4209
|
+
Zn,
|
|
4210
|
+
Yn,
|
|
4211
|
+
er,
|
|
4212
|
+
Gd
|
|
4213
|
+
], Hd = De.map((e) => e.manifest), Xp = zn(De), em = zt(Hd), tm = De.flatMap((e) => e.themes ?? []);
|
|
4214
|
+
function Kd(e) {
|
|
4215
|
+
const t = no(e).map((o) => o.name), n = en(e, qe.Styling).map((o) => o.name), r = en(e, qe.Blueprint)[0];
|
|
4216
|
+
return r ? [
|
|
4217
|
+
...t,
|
|
4218
|
+
...n,
|
|
4219
|
+
r.name
|
|
4220
|
+
] : [...t, ...n];
|
|
4221
|
+
}
|
|
4222
|
+
function Jd(e, t) {
|
|
4223
|
+
return t.filter((n) => so(n, e));
|
|
4224
|
+
}
|
|
4225
|
+
function Qd(e, t) {
|
|
4226
|
+
return [...new Set(Object.values(t).flat())].map((n) => Bt(n, e, t)).filter((n) => n !== void 0 && n.shadows.length > 0).sort((n, r) => n.name.localeCompare(r.name));
|
|
4227
|
+
}
|
|
4228
|
+
var gt = /* @__PURE__ */ (function(e) {
|
|
4229
|
+
return e.Fallback = "fallback", e.Explicit = "explicit", e.Automatic = "automatic", e;
|
|
4230
|
+
})({});
|
|
4231
|
+
function Yd(e) {
|
|
4232
|
+
const t = [
|
|
4233
|
+
At,
|
|
4234
|
+
...e.packages,
|
|
4235
|
+
e.shell,
|
|
4236
|
+
...e.templatePacks
|
|
4237
|
+
];
|
|
4238
|
+
return [...new Set(t.filter((n) => n.length > 0))];
|
|
4239
|
+
}
|
|
4240
|
+
function Zd(e, t) {
|
|
4241
|
+
return e.find((n) => n.manifest.name === t)?.manifest.layouts[0] ?? "";
|
|
4242
|
+
}
|
|
4243
|
+
var Wr = "UI Profile";
|
|
4244
|
+
function qr(e, t) {
|
|
4245
|
+
const n = t.map((d) => d.manifest), r = Yd(e), o = uo(r, n), i = Zd(t, e.shell), a = {
|
|
4246
|
+
name: Wr,
|
|
4247
|
+
targetPlatform: "web",
|
|
4248
|
+
packages: o.packages,
|
|
4249
|
+
layout: i.length > 0 ? i : void 0,
|
|
4250
|
+
theme: e.theme.length > 0 ? e.theme : void 0
|
|
4251
|
+
}, c = new Set(r);
|
|
4252
|
+
return {
|
|
4253
|
+
selection: o,
|
|
4254
|
+
profile: a,
|
|
4255
|
+
entries: o.packages.flatMap((d) => {
|
|
4256
|
+
const u = n.find((l) => l.name === d);
|
|
4257
|
+
return u ? [{
|
|
4258
|
+
name: d,
|
|
4259
|
+
displayName: u.displayName ?? u.name,
|
|
4260
|
+
description: u.description,
|
|
4261
|
+
version: u.version,
|
|
4262
|
+
kind: u.kind,
|
|
4263
|
+
inclusion: d === At ? gt.Fallback : c.has(d) ? gt.Explicit : gt.Automatic,
|
|
4264
|
+
requiredBy: n.filter((l) => o.packages.includes(l.name) && l.dependencies.some((p) => p.name === d)).map((l) => l.name)
|
|
4265
|
+
}] : [];
|
|
4266
|
+
}),
|
|
4267
|
+
collisions: Qd(a, zt(n)),
|
|
4268
|
+
compatibleThemes: Jd(a, t.flatMap((d) => d.themes ?? [])),
|
|
4269
|
+
layout: i,
|
|
4270
|
+
isValid: ao(o)
|
|
4271
|
+
};
|
|
4272
|
+
}
|
|
4273
|
+
function Xd(e) {
|
|
4274
|
+
const t = e.map((a) => a.manifest), n = Kd(t), r = n.find((a) => t.find((c) => c.name === a)?.kind === qe.Blueprint) ?? "", o = {
|
|
4275
|
+
packages: n.filter((a) => a !== r && a !== At),
|
|
4276
|
+
shell: r,
|
|
4277
|
+
templatePacks: [],
|
|
4278
|
+
theme: "",
|
|
4279
|
+
colorScheme: ki.Light,
|
|
4280
|
+
navigationMode: Ii.Static,
|
|
4281
|
+
accent: "",
|
|
4282
|
+
defaultScreenTemplate: ""
|
|
4283
|
+
}, i = qr(o, e).compatibleThemes.find((a) => !a.isDark);
|
|
4284
|
+
return {
|
|
4285
|
+
...o,
|
|
4286
|
+
theme: i?.name ?? ""
|
|
4287
|
+
};
|
|
4288
|
+
}
|
|
4289
|
+
function eu(e) {
|
|
4290
|
+
return {
|
|
4291
|
+
name: Wr,
|
|
4292
|
+
targetPlatform: "web",
|
|
4293
|
+
packages: [...e.resolvedPackages],
|
|
4294
|
+
layout: e.layout.length > 0 ? e.layout : void 0,
|
|
4295
|
+
theme: e.theme.length > 0 ? e.theme : void 0
|
|
4296
|
+
};
|
|
4297
|
+
}
|
|
4298
|
+
function nm(e, t = De) {
|
|
4299
|
+
const n = e ? eu(e) : qr(Xd(t), t).profile;
|
|
4300
|
+
return zd(t, n);
|
|
4301
|
+
}
|
|
4302
|
+
var Ln = {
|
|
4303
|
+
Compact: "Compact",
|
|
4304
|
+
Regular: "Regular"
|
|
4305
|
+
}, tu = {
|
|
4306
|
+
ariaLabel: "Icon",
|
|
4307
|
+
picker: {
|
|
4308
|
+
placeholder: "Choose an icon",
|
|
4309
|
+
title: "Choose an icon",
|
|
4310
|
+
search: "Search icons",
|
|
4311
|
+
searchPlaceholder: "Search by name or tag",
|
|
4312
|
+
clearSearch: "Clear search",
|
|
4313
|
+
close: "Close",
|
|
4314
|
+
categories: "Categories",
|
|
4315
|
+
allCategories: "All",
|
|
4316
|
+
uncategorized: "Other",
|
|
4317
|
+
library: "Library",
|
|
4318
|
+
allLibraries: "All libraries",
|
|
4319
|
+
loading: "Loading icons…",
|
|
4320
|
+
empty: "The profile has no icon library to choose from.",
|
|
4321
|
+
clearFilters: "Clear filters",
|
|
4322
|
+
error: "Some icons could not be loaded.",
|
|
4323
|
+
deprecated: "Deprecated",
|
|
4324
|
+
notAllowed: "Not available for this field",
|
|
4325
|
+
trigger: "Icon"
|
|
4326
|
+
},
|
|
4327
|
+
diagnostics: {
|
|
4328
|
+
"missing-library": "{library} is not an icon library of this profile, so its icon {key} cannot be drawn. Add the library to the profile or choose another icon.",
|
|
4329
|
+
"missing-icon": "{library} no longer has an icon named {key}. Choose another icon.",
|
|
4330
|
+
"missing-variant": "{library} has {key}, but not in the {variant} style. Choose another style or icon.",
|
|
4331
|
+
"incompatible-version": "{library} is at a version another package of this profile does not accept. Use a compatible version or remove the package that needs it.",
|
|
4332
|
+
"catalog-unavailable": "The icons of {library} could not be read, so they cannot be checked. Try again in a moment."
|
|
4333
|
+
},
|
|
4334
|
+
notAllowed: "This icon is not available for this field. Choose one of the icons the field offers."
|
|
4335
|
+
}, rm = {
|
|
4336
|
+
inspectorTitle: "Inspector",
|
|
4337
|
+
windowLabel: "Screen editor",
|
|
4338
|
+
stopped: {
|
|
4339
|
+
title: "The screen editor stopped",
|
|
4340
|
+
message: "Something in the editor failed, so it was closed. The screen as it was last saved is untouched; changes made since are lost.",
|
|
4341
|
+
close: "Close"
|
|
4342
|
+
},
|
|
4343
|
+
unreadable: {
|
|
4344
|
+
title: "This screen could not be opened",
|
|
4345
|
+
warning: "The saved screen has not been changed. Close this window to leave it as it is.",
|
|
4346
|
+
close: "Close",
|
|
4347
|
+
reasons: {
|
|
4348
|
+
[oe.NotJson]: "The saved screen is not readable data.",
|
|
4349
|
+
[oe.WrongShape]: "The saved screen is not in a form this editor understands.",
|
|
4350
|
+
[oe.MissingScreen]: "The saved screen does not contain a screen to edit.",
|
|
4351
|
+
[oe.MissingTemplate]: "The saved template does not contain the template you asked to edit."
|
|
4352
|
+
}
|
|
4353
|
+
},
|
|
4354
|
+
propertiesTab: "Properties",
|
|
4355
|
+
structureTab: "Structure",
|
|
4356
|
+
openInspector: "Open inspector",
|
|
4357
|
+
closeInspector: "Close inspector",
|
|
4358
|
+
desktopPreview: "Desktop preview",
|
|
4359
|
+
mobilePreview: "Mobile preview",
|
|
4360
|
+
sizeClass: (e, t) => `${Ln[e] ?? e} width, ${Ln[t] ?? t} height`,
|
|
4361
|
+
viewportSize: (e, t) => `${e} × ${t}`,
|
|
4362
|
+
noSelection: "Select a component on the screen or in Structure to see its details.",
|
|
4363
|
+
nameLabel: "Name",
|
|
4364
|
+
typeLabel: "Type",
|
|
4365
|
+
ownershipLabel: "Source",
|
|
4366
|
+
ownership: {
|
|
4367
|
+
[B.Local]: "This screen",
|
|
4368
|
+
[B.Inherited]: "Inherited",
|
|
4369
|
+
[B.ConfigurableInherited]: "Inherited, configurable"
|
|
4370
|
+
},
|
|
4371
|
+
ownershipHint: {
|
|
4372
|
+
[B.Local]: "Authored on this screen. You can move, resize and change it.",
|
|
4373
|
+
[B.Inherited]: "Inherited from a template. It can be inspected here but not changed; open the template to edit it.",
|
|
4374
|
+
[B.ConfigurableInherited]: "Inherited from a template that exposes some of its settings to this screen. The structure stays locked."
|
|
4375
|
+
},
|
|
4376
|
+
surface: {
|
|
4377
|
+
emptyContainer: "Empty - drop a component here",
|
|
4378
|
+
dropDenied: "This part of the screen cannot be changed here",
|
|
4379
|
+
moveHandle: (e) => e ? `Drag to move ${e}` : "Drag to move",
|
|
4380
|
+
dropTarget: (e) => e === "into" ? "Drop into this container" : "Drop between these elements",
|
|
4381
|
+
sampleContent: (e) => `Sample content – set ${e.join(", ")} in the inspector`,
|
|
4382
|
+
overlay: (e) => `${e} - shown when opened`,
|
|
4383
|
+
declaration: (e) => e,
|
|
4384
|
+
unavailable: (e) => `${e} is not available in this UI profile`,
|
|
4385
|
+
nothingToShow: (e) => `${e} has nothing to show on the screen yet`,
|
|
4386
|
+
failedToDraw: (e, t) => t ? `${e} could not be drawn: ${t}` : `${e} could not be drawn`
|
|
4387
|
+
},
|
|
4388
|
+
undo: "Undo",
|
|
4389
|
+
redo: "Redo",
|
|
4390
|
+
palette: "Components",
|
|
4391
|
+
layoutDrawer: "Layout",
|
|
4392
|
+
packageTitles: {
|
|
4393
|
+
core: "Basic elements",
|
|
4394
|
+
PrimeReact: "PrimeReact components",
|
|
4395
|
+
"Cratis.Components": "Cratis components",
|
|
4396
|
+
"Cratis.Blueprint.Default": "Application shell",
|
|
4397
|
+
"Cratis.Blueprint.Components": "Page building blocks"
|
|
4398
|
+
},
|
|
4399
|
+
closeDrawer: "Close",
|
|
4400
|
+
deleteElement: "Delete selected component",
|
|
4401
|
+
saveRefused: "The screen could not be saved.",
|
|
4402
|
+
properties: {
|
|
4403
|
+
diagnostics: "Problems",
|
|
4404
|
+
noProperties: "This component has no settings to change.",
|
|
4405
|
+
layoutType: "Layout type",
|
|
4406
|
+
changeLayout: "Change layout",
|
|
4407
|
+
confirmLayoutTitle: "This change drops some settings",
|
|
4408
|
+
confirmLayoutAccept: "Change anyway",
|
|
4409
|
+
confirmLayoutCancel: "Keep the current layout",
|
|
4410
|
+
exposure: "Settings screens may change",
|
|
4411
|
+
exposeProperty: "Allow screens to change this",
|
|
4412
|
+
unexposeProperty: "Stop allowing screens to change this",
|
|
4413
|
+
exposedToScopes: "Screens can change this",
|
|
4414
|
+
itemsLabel: "Items",
|
|
4415
|
+
addItem: "Add item",
|
|
4416
|
+
icon: tu,
|
|
4417
|
+
json: br,
|
|
4418
|
+
query: {
|
|
4419
|
+
label: "Query",
|
|
4420
|
+
choose: "Choose a query",
|
|
4421
|
+
none: "No query",
|
|
4422
|
+
missing: "The query this was bound to is not available here any more.",
|
|
4423
|
+
parameters: "Parameters",
|
|
4424
|
+
columns: "Columns",
|
|
4425
|
+
sourceFor: (e) => e,
|
|
4426
|
+
noSource: "Not set",
|
|
4427
|
+
showColumn: (e) => e,
|
|
4428
|
+
preview: {
|
|
4429
|
+
noQuery: "Choose a query to show data.",
|
|
4430
|
+
missingQuery: "The bound query is not available, so there is nothing to show.",
|
|
4431
|
+
loading: "Loading data…",
|
|
4432
|
+
empty: "The query returned no rows.",
|
|
4433
|
+
error: "The query could not be run."
|
|
4434
|
+
}
|
|
4435
|
+
},
|
|
4436
|
+
action: {
|
|
4437
|
+
label: "Action",
|
|
4438
|
+
none: "No action",
|
|
4439
|
+
slice: "Submits",
|
|
4440
|
+
chooseSlice: "Choose a state change",
|
|
4441
|
+
inputs: "Inputs",
|
|
4442
|
+
presentation: "Presentation",
|
|
4443
|
+
presentations: {
|
|
4444
|
+
none: "Run directly",
|
|
4445
|
+
modal: "Ask in a dialog",
|
|
4446
|
+
drawer: "Ask in a drawer"
|
|
4447
|
+
},
|
|
4448
|
+
sourceFor: (e) => e,
|
|
4449
|
+
problems: {
|
|
4450
|
+
missingSlice: "The state change this submits is no longer in the model.",
|
|
4451
|
+
unmappedInput: (e) => `${e} has nothing feeding it.`,
|
|
4452
|
+
unknownInput: (e) => `${e} is not an input of this state change any more.`,
|
|
4453
|
+
unknownSource: (e) => `${e} is fed from a value this screen does not have.`
|
|
4454
|
+
}
|
|
4455
|
+
}
|
|
4456
|
+
},
|
|
4457
|
+
structureLabel: "Screen structure",
|
|
4458
|
+
structureEmpty: "This screen has no components yet.",
|
|
4459
|
+
moveUp: "Move up",
|
|
4460
|
+
moveDown: "Move down",
|
|
4461
|
+
outdent: "Move out of parent",
|
|
4462
|
+
indent: "Move into previous sibling",
|
|
4463
|
+
moved: "Moved.",
|
|
4464
|
+
rejection: {
|
|
4465
|
+
[$.NodeNotFound]: "That component no longer exists.",
|
|
4466
|
+
[$.TargetNotFound]: "That destination no longer exists.",
|
|
4467
|
+
[$.TargetNotContainer]: "That component cannot contain other components.",
|
|
4468
|
+
[$.WouldCreateCycle]: "A component cannot be moved into itself or one of its own children.",
|
|
4469
|
+
[$.NodeLocked]: "Inherited components cannot be moved. Open the template to change it.",
|
|
4470
|
+
[$.TargetLocked]: "Inherited components cannot receive new content. Open the template to change it.",
|
|
4471
|
+
[$.NoChange]: "It is already there."
|
|
4472
|
+
}
|
|
4473
|
+
}, om = {
|
|
4474
|
+
[S.Stack]: "Stack",
|
|
4475
|
+
[S.Row]: "Row",
|
|
4476
|
+
[S.Grid]: "Grid",
|
|
4477
|
+
[S.Container]: "Container",
|
|
4478
|
+
[S.Wrap]: "Wrap",
|
|
4479
|
+
[S.Canvas]: "Canvas"
|
|
4480
|
+
}, nu = {
|
|
4481
|
+
[S.Stack]: be,
|
|
4482
|
+
[S.Row]: Ko,
|
|
4483
|
+
[S.Grid]: Jn,
|
|
4484
|
+
[S.Container]: Ut,
|
|
4485
|
+
[S.Wrap]: jt,
|
|
4486
|
+
[S.Canvas]: Ci
|
|
4487
|
+
}, ru = {
|
|
4488
|
+
text: Do,
|
|
4489
|
+
button: ze,
|
|
4490
|
+
card: jo,
|
|
4491
|
+
data: Wo,
|
|
4492
|
+
action: Mo,
|
|
4493
|
+
section: oi,
|
|
4494
|
+
navigate: Uo,
|
|
4495
|
+
title: Be,
|
|
4496
|
+
table: Te,
|
|
4497
|
+
summary: it,
|
|
4498
|
+
field: qn,
|
|
4499
|
+
code: Bo,
|
|
4500
|
+
file: bt,
|
|
4501
|
+
navigationBar: be,
|
|
4502
|
+
inputText: dn,
|
|
4503
|
+
inputTextarea: nn,
|
|
4504
|
+
inputNumber: un,
|
|
4505
|
+
password: ni,
|
|
4506
|
+
floatLabel: ai,
|
|
4507
|
+
iconField: fn,
|
|
4508
|
+
dropdown: on,
|
|
4509
|
+
multiSelect: at,
|
|
4510
|
+
listBox: Gn,
|
|
4511
|
+
selectButton: ae,
|
|
4512
|
+
checkbox: an,
|
|
4513
|
+
multiStateCheckbox: di,
|
|
4514
|
+
radioButton: lt,
|
|
4515
|
+
toggleSwitch: Qn,
|
|
4516
|
+
slider: wt,
|
|
4517
|
+
rating: pi,
|
|
4518
|
+
knob: si,
|
|
4519
|
+
calendar: rn,
|
|
4520
|
+
colorPicker: st,
|
|
4521
|
+
chips: Le,
|
|
4522
|
+
autoComplete: fn,
|
|
4523
|
+
treeSelect: Ct,
|
|
4524
|
+
editor: rt,
|
|
4525
|
+
fileUpload: Ho,
|
|
4526
|
+
splitButton: tt,
|
|
4527
|
+
speedDial: qo,
|
|
4528
|
+
buttonGroup: ae,
|
|
4529
|
+
dataTable: Te,
|
|
4530
|
+
dataView: gn,
|
|
4531
|
+
dataScroller: fi,
|
|
4532
|
+
tree: Ct,
|
|
4533
|
+
treeTable: ct,
|
|
4534
|
+
timeline: Qo,
|
|
4535
|
+
paginator: Oo,
|
|
4536
|
+
orderList: at,
|
|
4537
|
+
pickList: _o,
|
|
4538
|
+
organizationChart: li,
|
|
4539
|
+
chart: jn,
|
|
4540
|
+
panel: Ut,
|
|
4541
|
+
accordion: ei,
|
|
4542
|
+
fieldset: Ao,
|
|
4543
|
+
divider: ae,
|
|
4544
|
+
splitter: nt,
|
|
4545
|
+
scrollPanel: Go,
|
|
4546
|
+
tabView: cn,
|
|
4547
|
+
toolbar: gi,
|
|
4548
|
+
stepper: dt,
|
|
4549
|
+
dialog: Ue,
|
|
4550
|
+
confirmDialog: ot,
|
|
4551
|
+
overlayPanel: Si,
|
|
4552
|
+
sidebar: nt,
|
|
4553
|
+
tooltip: zo,
|
|
4554
|
+
menu: be,
|
|
4555
|
+
menubar: be,
|
|
4556
|
+
breadcrumb: tt,
|
|
4557
|
+
tabMenu: cn,
|
|
4558
|
+
steps: dt,
|
|
4559
|
+
tieredMenu: ct,
|
|
4560
|
+
panelMenu: jt,
|
|
4561
|
+
contextMenu: ze,
|
|
4562
|
+
megaMenu: gn,
|
|
4563
|
+
dock: ae,
|
|
4564
|
+
message: Vn,
|
|
4565
|
+
inlineMessage: Xo,
|
|
4566
|
+
toast: Lo,
|
|
4567
|
+
image: Wn,
|
|
4568
|
+
galleria: pn,
|
|
4569
|
+
carousel: pn,
|
|
4570
|
+
avatar: wi,
|
|
4571
|
+
badge: Eo,
|
|
4572
|
+
chip: Le,
|
|
4573
|
+
tag: Le,
|
|
4574
|
+
progressBar: Yo,
|
|
4575
|
+
progressSpinner: hn,
|
|
4576
|
+
skeleton: ui,
|
|
4577
|
+
scrollTop: tt,
|
|
4578
|
+
blockUI: mn,
|
|
4579
|
+
inplace: rt,
|
|
4580
|
+
terminal: hi,
|
|
4581
|
+
page: bt,
|
|
4582
|
+
dataPage: Te,
|
|
4583
|
+
formElement: it,
|
|
4584
|
+
singleResult: Zo,
|
|
4585
|
+
queryInputForm: ln,
|
|
4586
|
+
commandForm: it,
|
|
4587
|
+
observableDataTable: Te,
|
|
4588
|
+
inputTextField: dn,
|
|
4589
|
+
numberField: un,
|
|
4590
|
+
checkboxField: an,
|
|
4591
|
+
textAreaField: nn,
|
|
4592
|
+
dropdownField: on,
|
|
4593
|
+
sliderField: wt,
|
|
4594
|
+
calendarField: rn,
|
|
4595
|
+
colorPickerField: st,
|
|
4596
|
+
multiSelectField: at,
|
|
4597
|
+
chipsField: Le,
|
|
4598
|
+
radioButtonField: lt,
|
|
4599
|
+
radioGroupField: lt,
|
|
4600
|
+
confirmationDialog: ot,
|
|
4601
|
+
busyIndicatorDialog: hn,
|
|
4602
|
+
commandDialog: Ue,
|
|
4603
|
+
stepperCommandDialog: dt,
|
|
4604
|
+
icon: Kn,
|
|
4605
|
+
errorBoundary: ot,
|
|
4606
|
+
objectContentEditor: rt,
|
|
4607
|
+
objectNavigationalBar: ct,
|
|
4608
|
+
schemaEditor: sn,
|
|
4609
|
+
timeMachine: $o,
|
|
4610
|
+
filterPanel: ln,
|
|
4611
|
+
toolbarButton: ze,
|
|
4612
|
+
toolbarGroup: ae,
|
|
4613
|
+
toolbarSeparator: ae,
|
|
4614
|
+
appShell: yt,
|
|
4615
|
+
fullPageShell: Ue,
|
|
4616
|
+
topbar: be,
|
|
4617
|
+
menuItem: ti,
|
|
4618
|
+
footer: ae,
|
|
4619
|
+
rightPanel: nt,
|
|
4620
|
+
configPanel: sn,
|
|
4621
|
+
pageHeader: Be,
|
|
4622
|
+
mask: mn,
|
|
4623
|
+
logo: mi,
|
|
4624
|
+
userMenu: bi,
|
|
4625
|
+
themeSwitcher: st,
|
|
4626
|
+
layoutModeSwitcher: yt,
|
|
4627
|
+
arcPageHeader: Be
|
|
4628
|
+
}, ou = [
|
|
4629
|
+
[/dialog/i, Ue],
|
|
4630
|
+
[/table|grid/i, Te],
|
|
4631
|
+
[/menu|bar$/i, be],
|
|
4632
|
+
[/chart/i, jn],
|
|
4633
|
+
[/field|input/i, qn],
|
|
4634
|
+
[/button/i, ze],
|
|
4635
|
+
[/image|media/i, Wn],
|
|
4636
|
+
[/list/i, Gn],
|
|
4637
|
+
[/panel/i, Ut],
|
|
4638
|
+
[/message|toast/i, Vn],
|
|
4639
|
+
[/tree/i, Ct],
|
|
4640
|
+
[/page|screen/i, bt]
|
|
4641
|
+
], iu = (e) => ru[e] ?? ou.find(([t]) => t.test(e))?.[1] ?? Hn, au = {
|
|
4642
|
+
[Bn.manifest.name]: Kn,
|
|
4643
|
+
[Un.manifest.name]: Qn,
|
|
4644
|
+
[Zn.manifest.name]: Hn,
|
|
4645
|
+
[Yn.manifest.name]: jt,
|
|
4646
|
+
[er.manifest.name]: Be,
|
|
4647
|
+
[Xn.manifest.name]: ii
|
|
4648
|
+
}, su = Vo, im = {
|
|
4649
|
+
layout: (e) => {
|
|
4650
|
+
const t = nu[e];
|
|
4651
|
+
return /* @__PURE__ */ s(t, { "aria-hidden": "true" });
|
|
4652
|
+
},
|
|
4653
|
+
component: (e) => {
|
|
4654
|
+
const t = iu(e);
|
|
4655
|
+
return /* @__PURE__ */ s(t, { "aria-hidden": "true" });
|
|
4656
|
+
},
|
|
4657
|
+
drawer: {
|
|
4658
|
+
layout: /* @__PURE__ */ s(Jn, { "aria-hidden": "true" }),
|
|
4659
|
+
package: (e) => {
|
|
4660
|
+
const t = au[e] ?? su;
|
|
4661
|
+
return /* @__PURE__ */ s(t, { "aria-hidden": "true" });
|
|
4662
|
+
}
|
|
4663
|
+
}
|
|
4664
|
+
}, am = De.map((e) => ({
|
|
4665
|
+
package: e.manifest.name,
|
|
4666
|
+
components: e.manifest.components
|
|
4667
|
+
}));
|
|
4668
|
+
function sm(e, t, n) {
|
|
4669
|
+
return e.map((r) => ({
|
|
4670
|
+
type: r.type,
|
|
4671
|
+
name: t[r.item],
|
|
4672
|
+
arrangement: r.arrangement,
|
|
4673
|
+
icon: n?.[r.item]
|
|
4674
|
+
}));
|
|
4675
|
+
}
|
|
4676
|
+
export {
|
|
4677
|
+
Fl as JsonPropertyField,
|
|
4678
|
+
S as LayoutItem,
|
|
4679
|
+
B as Ownership,
|
|
4680
|
+
oe as SceneDocumentProblem,
|
|
4681
|
+
Jp as ScreenEditorOverlay,
|
|
4682
|
+
Qp as ScreenEditorPrimeReactProvider,
|
|
4683
|
+
Br as ScreenEditorWindow,
|
|
4684
|
+
Yp as ScreenEditorWorkspace,
|
|
4685
|
+
$ as StructureEditRejection,
|
|
4686
|
+
xr as buildPalette,
|
|
4687
|
+
Zp as createScreenEditorEnvironment,
|
|
4688
|
+
zd as createScreenEditorRuntime,
|
|
4689
|
+
br as defaultJsonPropertyFieldStrings,
|
|
4690
|
+
nu as defaultLayoutIcons,
|
|
4691
|
+
om as defaultLayoutLabels,
|
|
4692
|
+
im as defaultPaletteIcons,
|
|
4693
|
+
am as defaultPaletteSources,
|
|
4694
|
+
rm as defaultScreenEditorStrings,
|
|
4695
|
+
wr as formatJson,
|
|
4696
|
+
Ml as isJsonProperty,
|
|
4697
|
+
Ll as isJsonValueType,
|
|
4698
|
+
Ol as jsonValueType,
|
|
4699
|
+
Il as readJson,
|
|
4700
|
+
nc as readSceneDocument,
|
|
4701
|
+
yd as screenEditorPrimeReactDefaults,
|
|
4702
|
+
nm as screenEditorRuntimeForProfile,
|
|
4703
|
+
sm as toLayoutContainerDescriptors,
|
|
4704
|
+
Pd as toSceneCandidates
|
|
4705
|
+
};
|