Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
5 changes: 4 additions & 1 deletion WHATSNEW.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
## V4.3.1
## V4.3.2
- Issue [#1335](https://github.com/microsoft/fluentui-blazor/issues/1335): Consider removing the PageScript component from the public API (renamed to FluentPageScript)

## V4.3.1
- Issue [#1282](https://github.com/microsoft/fluentui-blazor/issues/1282): Looping behaviour after update to 4.3.0 / FluentDesignTheme
- Issue [#1283](https://github.com/microsoft/fluentui-blazor/issues/1283): Fix Combobox and Select width property
- Issue [#1294](https://github.com/microsoft/fluentui-blazor/issues/1294): Issue upgrading from 4.2.1 to 4.3.0; better fix for #1205 en #1225
Expand Down
5 changes: 4 additions & 1 deletion examples/Demo/Shared/wwwroot/docs/WhatsNew.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
## V4.3.1
## V4.3.2
- - Issue [#1335](https://github.com/microsoft/fluentui-blazor/issues/1335): Consider removing the PageScript component from the public API (renamed to FluentPageScript)

## V4.3.1
- Issue [#1282](https://github.com/microsoft/fluentui-blazor/issues/1282): Looping behaviour after update to 4.3.0 / FluentDesignTheme
- Issue [#1283](https://github.com/microsoft/fluentui-blazor/issues/1283): Fix Combobox and Select width property
- Issue [#1294](https://github.com/microsoft/fluentui-blazor/issues/1294): Issue upgrading from 4.2.1 to 4.3.0; better fix for #1205 en #1225
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const pageScriptInfoBySrc = new Map();
class PageScript extends HTMLElement {
class FluentPageScript extends HTMLElement {
static observedAttributes = ['src'];
src: string | null = null;

Expand Down Expand Up @@ -49,7 +49,7 @@ class PageScript extends HTMLElement {

async initializePageScriptModule(src: string, pageScriptInfo: any) {
if (src.startsWith("./")) {
src = new URL(src.substr(2), document.baseURI).toString();
src = new URL(src.substring(2), document.baseURI).toString();
}

const module = await import(src);
Expand Down Expand Up @@ -77,4 +77,4 @@ export function onEnhancedLoad() {
}
}

export { PageScript };
export { FluentPageScript };
4 changes: 2 additions & 2 deletions src/Core.Assets/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export * from '@fluentui/web-components/dist/web-components'
import { SplitPanels } from './SplitPanels'
import { DesignTheme } from './DesignTheme'
import { PageScript, onEnhancedLoad } from './PageScript'
import { FluentPageScript, onEnhancedLoad } from './FluentPageScript'

interface Blazor {
registerCustomEventType: (
Expand Down Expand Up @@ -299,7 +299,7 @@ export function afterStarted(blazor: Blazor) {
export function beforeStart(options: any) {
customElements.define("fluent-design-theme", DesignTheme);
customElements.define("split-panels", SplitPanels);
customElements.define('page-script', PageScript);
customElements.define('fluent-page-script', FluentPageScript);

beforeStartCalled = true;
}
9 changes: 9 additions & 0 deletions src/Core/Components/FluentPageScript.razor
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
@namespace Microsoft.FluentUI.AspNetCore.Components
@* based on code from https://learn.microsoft.com/en-us/aspnet/core/blazor/javascript-interoperability/static-server-rendering?view=aspnetcore-8.0 *@
<fluent-page-script src="@Src"></fluent-page-script>

@code {
[Parameter]
[EditorRequired]
public string Src { get; set; } = default!;
}
2 changes: 1 addition & 1 deletion src/Core/Components/NavMenu/FluentNavMenu.razor
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
@inherits FluentComponentBase
@if (Data is null)
{
<PageScript Src="./_content/Microsoft.FluentUI.AspNetCore.Components/Components/NavMenu/FluentNavMenu.razor.js"></PageScript>
<FluentPageScript Src="./_content/Microsoft.FluentUI.AspNetCore.Components/Components/NavMenu/FluentNavMenu.razor.js"></FluentPageScript>
}
<div id="@Id" @ref="@Element" @attributes="AdditionalAttributes" class="@ClassValue" style="@StyleValue" aria-label="@(Collapsible ? null : @Title)" role="menu" aria-expanded="@Expanded">
<CascadingValue Value="this" IsFixed="true">
Expand Down
9 changes: 0 additions & 9 deletions src/Core/Components/PageScript.razor

This file was deleted.