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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Umbraco.Web.UI.Client/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export default [
'local-rules/enforce-umbraco-external-imports': [
'error',
{
exceptions: ['@umbraco-cms', '@open-wc/testing', '@storybook', 'msw', '.', 'vite', 'uuid'],
exceptions: ['@umbraco-cms', '@open-wc/testing', '@storybook', 'msw', '.', 'vite', 'uuid', 'diff'],
},
],
'local-rules/exported-string-constant-naming': [
Expand Down
1 change: 0 additions & 1 deletion src/Umbraco.Web.UI.Client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@
"./external/marked": "./dist-cms/external/marked/index.js",
"./external/monaco-editor": "./dist-cms/external/monaco-editor/index.js",
"./external/openid": "./dist-cms/external/openid/index.js",
"./external/router-slot": "./dist-cms/external/router-slot/index.js",
"./external/rxjs": "./dist-cms/external/rxjs/index.js",
"./external/tiptap": "./dist-cms/external/tiptap/index.js",
"./external/uui": "./dist-cms/external/uui/index.js"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import { UmbModalToken } from '../token/modal-token.js';
import type { UmbModalConfig, UmbModalType } from '../types.js';
import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';
import type { IRouterSlot } from '@umbraco-cms/backoffice/external/router-slot';
import type { UUIModalElement, UUIModalSidebarSize } from '@umbraco-cms/backoffice/external/uui';
import { UmbId } from '@umbraco-cms/backoffice/id';
import { UmbObjectState, UmbStringState } from '@umbraco-cms/backoffice/observable-api';
import { UmbControllerBase } from '@umbraco-cms/backoffice/class-api';
import { type UmbDeepPartialObject, umbDeepMerge } from '@umbraco-cms/backoffice/utils';
import type { ElementLoaderProperty } from '@umbraco-cms/backoffice/extension-api';
import { UMB_ROUTE_CONTEXT } from '@umbraco-cms/backoffice/router';
import { UMB_ROUTE_CONTEXT, type IRouterSlot } from '@umbraco-cms/backoffice/router';

export interface UmbModalRejectReason {
type: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { umbGenerateRoutePathBuilder } from '../../generate-route-path-builder.function.js';
import type { UmbModalRouteRegistration } from '../../modal-registration/modal-route-registration.interface.js';
import type { UmbRoute } from './route.interface.js';
import type { IRouterSlot } from '@umbraco-cms/backoffice/external/router-slot';
import { UmbContextToken } from '@umbraco-cms/backoffice/context-api';
import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';
import { UmbContextBase } from '@umbraco-cms/backoffice/class-api';
import { UMB_MODAL_MANAGER_CONTEXT } from '@umbraco-cms/backoffice/modal';
import { UmbStringState, mergeObservables } from '@umbraco-cms/backoffice/observable-api';
import type { IRouterSlot } from '../../router-slot/index.js';

const EmptyDiv = document.createElement('div');

Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export type { IRoute as UmbRoute } from '@umbraco-cms/backoffice/external/router-slot';
export type { IRoute as UmbRoute } from '../../router-slot/index.js';
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import '@umbraco-cms/backoffice/external/router-slot';
import { UmbRoutePathAddendumResetContext } from '../../contexts/route-path-addendum-reset.context.js';
import { UmbRouterSlotInitEvent } from './router-slot-init.event.js';
import { UmbRouterSlotChangeEvent } from './router-slot-change.event.js';
import type { UmbRoute } from './route.interface.js';
import { UmbRouteContext } from './route.context.js';
import { css, html, type PropertyValueMap, customElement, property } from '@umbraco-cms/backoffice/external/lit';
import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element';
import type { IRouterSlot } from '@umbraco-cms/backoffice/external/router-slot';
import type { IRouterSlot } from '../../router-slot/index.js';

/**
* @element umb-router-slot
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { type UrlParametersRecord, umbUrlPatternToString } from '../utils/path/url-pattern-to-string.function.js';
import { stripSlash } from '@umbraco-cms/backoffice/external/router-slot'; // This must only include the util to avoid side effects of registering the route element.
import { umbUrlPatternToString, type UrlParametersRecord } from '@umbraco-cms/backoffice/utils';
import { stripSlash } from './router-slot/util.js';

/**
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ export * from './contexts/index.js';
export * from './encode-folder-name.function.js';
export * from './modal-registration/modal-route-registration.controller.js';
export * from './path-pattern.class.js';
export * from '@umbraco-cms/backoffice/external/router-slot';
export * from './router-slot/index.js';
export type * from './modal-registration/modal-route-registration.interface.js';
export type * from './types.js';
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { UMB_ROUTE_CONTEXT, UMB_ROUTE_PATH_ADDENDUM_CONTEXT } from '../index.js';
import type { IRouterSlot, Params } from '../router-slot/index.js';
import { encodeFolderName } from '../encode-folder-name.function.js';
import type { UmbModalRouteRegistration } from './modal-route-registration.interface.js';
import type {
Expand All @@ -12,7 +13,6 @@ import type { UmbControllerAlias, UmbControllerHost } from '@umbraco-cms/backoff
import { UmbControllerBase } from '@umbraco-cms/backoffice/class-api';
import { UmbId } from '@umbraco-cms/backoffice/id';
import type { UmbDeepPartialObject } from '@umbraco-cms/backoffice/utils';
import type { IRouterSlot, Params } from '@umbraco-cms/backoffice/external/router-slot';

export type UmbModalRouteBuilder = (params: { [key: string]: string | number } | null) => string;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { IRouterSlot, Params } from '../router-slot/index.js';
import type { UmbModalRouteBuilder } from './modal-route-registration.controller.js';
import type { IRouterSlot, Params } from '@umbraco-cms/backoffice/external/router-slot';
import type { UmbModalContext, UmbModalManagerContext, UmbModalToken } from '@umbraco-cms/backoffice/modal';

export interface UmbModalRouteRegistration<
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { PathMatch } from './model.js';

/* eslint-disable local-rules/exported-string-constant-naming */
export const CATCH_ALL_WILDCARD: string = '**';
export const TRAVERSE_FLAG: string = '\\.\\.\\/';
export const PARAM_IDENTIFIER: RegExp = /:([^\\/]+)/g;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export type IRoutingInfo<D = any, P = any> = {
match: IRouteMatch<D>;
};

// eslint-disable-next-line @typescript-eslint/no-unused-vars
export type CustomResolver<D = any, P = any> = (
info: IRoutingInfo<D>,
) => boolean | void | Promise<boolean> | Promise<void>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ ensureAnchorHistory();
* @slot - Default content.
* @event changestate - Dispatched when the router slot state changes.
*/
// eslint-disable-next-line local-rules/enforce-element-suffix-on-element-class-name, local-rules/umb-class-prefix
export class RouterSlot<D = any, P = any> extends HTMLElement implements IRouterSlot<D, P> {
/**
* Method to cancel navigation if changed.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { GLOBAL_ROUTER_EVENTS_TARGET } from '../config.js';
import type { EventListenerSubscription, GlobalRouterEvent, IRoute, IRoutingInfo } from '../model.js';
import type { EventListenerSubscription, GlobalRouterEvent, IRoutingInfo } from '../model.js';

/**
* Dispatches a did change route event.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable no-useless-escape */
import { CATCH_ALL_WILDCARD, DEFAULT_PATH_MATCH, PARAM_IDENTIFIER, TRAVERSE_FLAG } from '../config.js';
import type {
IComponentRoute,
Expand Down Expand Up @@ -131,6 +132,7 @@ export async function resolvePageComponent(route: IComponentRoute, info: IRoutin
let cmp = route.component;
if (cmp instanceof Function) {
try {
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
cmp = (cmp as Function)();
} catch (err) {
// The invocation most likely failed because the function is a class.
Expand Down Expand Up @@ -188,7 +190,7 @@ export function isResolverRoute(route: IRoute): route is IResolverRoute {
*/
export function traverseRouterTree(slot: IRouterSlot): { tree: RouterTree; depth: number } {
// Find the nodes from the route up to the root route
let routes: IRouterSlot[] = [slot];
const routes: IRouterSlot[] = [slot];
while (slot.parent != null) {
slot = slot.parent;
routes.push(slot);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { IRoutingInfo, PageComponent } from '@umbraco-cms/backoffice/external/router-slot';
import type { UmbApi } from '@umbraco-cms/backoffice/extension-api';
import type { IRoutingInfo, PageComponent } from './router-slot/index.js';

export interface UmbRouteEntry extends UmbApi {
getPath?(): string;
Expand Down
1 change: 0 additions & 1 deletion src/Umbraco.Web.UI.Client/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ DON'T EDIT THIS FILE DIRECTLY. It is generated by /devops/tsconfig/index.js
"@umbraco-cms/backoffice/external/marked": ["./src/external/marked/index.ts"],
"@umbraco-cms/backoffice/external/monaco-editor": ["./src/external/monaco-editor/index.ts"],
"@umbraco-cms/backoffice/external/openid": ["./src/external/openid/index.ts"],
"@umbraco-cms/backoffice/external/router-slot": ["./src/external/router-slot/index.ts"],
"@umbraco-cms/backoffice/external/rxjs": ["./src/external/rxjs/index.ts"],
"@umbraco-cms/backoffice/external/tiptap": ["./src/external/tiptap/index.ts"],
"@umbraco-cms/backoffice/external/uui": ["./src/external/uui/index.ts"]
Expand Down