11import type { UmbBlockGridLayoutModel , UmbBlockGridTypeModel } from '../types.js' ;
22import type { UmbBlockGridWorkspaceOriginData } from '../index.js' ;
33import {
4- UmbArrayState ,
5- UmbBooleanState ,
64 appendToFrozenArray ,
75 pushAtToUniqueArray ,
6+ UmbArrayState ,
7+ UmbBooleanState ,
88} from '@umbraco-cms/backoffice/observable-api' ;
9- import { removeLastSlashFromPath , transformServerPathToClientPath } from '@umbraco-cms/backoffice/utils' ;
10- import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api ' ;
9+ import { transformServerPathToClientPath } from '@umbraco-cms/backoffice/utils' ;
10+ import { UmbBlockManagerContext } from '@umbraco-cms/backoffice/block ' ;
1111import { UMB_APP_CONTEXT } from '@umbraco-cms/backoffice/app' ;
12- import type { UmbPropertyEditorConfigCollection } from '@umbraco-cms/backoffice/property-editor' ;
13- import { type UmbBlockDataModel , UmbBlockManagerContext } from '@umbraco-cms/backoffice/block' ;
12+ import type { UmbBlockDataModel } from '@umbraco-cms/backoffice/block' ;
1413import type { UmbBlockTypeGroup } from '@umbraco-cms/backoffice/block-type' ;
14+ import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api' ;
1515import type { UmbNumberRangeValueType } from '@umbraco-cms/backoffice/models' ;
16+ import type { UmbPropertyEditorConfigCollection } from '@umbraco-cms/backoffice/property-editor' ;
1617
1718export const UMB_BLOCK_GRID_DEFAULT_LAYOUT_STYLESHEET = '/umbraco/backoffice/css/umbraco-blockgridlayout.css' ;
1819
@@ -34,7 +35,9 @@ export class UmbBlockGridManagerContext<
3435 }
3536
3637 #initAppUrl: Promise < void > ;
37- #appUrl?: string ;
38+
39+ #serverUrl?: string ;
40+
3841 #blockGroups = new UmbArrayState ( < Array < UmbBlockTypeGroup > > [ ] , ( x ) => x . key ) ;
3942 public readonly blockGroups = this . #blockGroups. asObservable ( ) ;
4043
@@ -45,7 +48,8 @@ export class UmbBlockGridManagerContext<
4548
4649 if ( layoutStylesheet ) {
4750 // Cause we await initAppUrl in setting the _editorConfiguration, we can trust the appUrl begin here.
48- return removeLastSlashFromPath ( this . #appUrl! ) + transformServerPathToClientPath ( layoutStylesheet ) ;
51+ const url = new URL ( transformServerPathToClientPath ( layoutStylesheet ) , this . #serverUrl) ;
52+ return url . href ;
4953 }
5054 return undefined ;
5155 } ) ;
@@ -85,7 +89,7 @@ export class UmbBlockGridManagerContext<
8589 super ( host ) ;
8690
8791 this . #initAppUrl = this . getContext ( UMB_APP_CONTEXT ) . then ( ( appContext ) => {
88- this . #appUrl = appContext . getServerUrl ( ) + appContext . getBackofficePath ( ) ;
92+ this . #serverUrl = appContext . getServerUrl ( ) ;
8993 } ) ;
9094 }
9195
0 commit comments