Socket
Socket
Sign inDemoInstall

@ui5/webcomponents-react-base

Package Overview
Dependencies
Maintainers
0
Versions
513
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ui5/webcomponents-react-base - npm Package Compare versions

Comparing version 1.29.10 to 1.29.11

6

dist/hooks/useStylesheet.d.ts
import type { StyleDataCSP } from '@ui5/webcomponents-base/dist/ManagedStyles.js';
export declare function useStylesheet(styles: StyleDataCSP, componentName: string): void;
interface UseStyleSheetOptions {
alwaysInject?: boolean;
}
export declare function useStylesheet(styles: StyleDataCSP, componentName: string, options?: UseStyleSheetOptions): void;
export {};

10

dist/hooks/useStylesheet.js
'use client';
import { createOrUpdateStyle, removeStyle } from '@ui5/webcomponents-base/dist/ManagedStyles.js';
import { getCurrentRuntimeIndex } from '@ui5/webcomponents-base/dist/Runtimes.js';
import { useSyncExternalStore } from 'use-sync-external-store/shim/index.js';
import { StyleStore } from '../stores/StyleStore.js';
import { useIsomorphicLayoutEffect } from './useIsomorphicLayoutEffect.js';
export function useStylesheet(styles, componentName) {
export function useStylesheet(styles, componentName, options) {
const { staticCssInjected, componentsMap } = useSyncExternalStore(StyleStore.subscribe, StyleStore.getSnapshot, StyleStore.getServerSnapshot);
useIsomorphicLayoutEffect(() => {
const shouldInject = !staticCssInjected;
const scopedComponentName = `${componentName}-${getCurrentRuntimeIndex()}`;
const shouldInject = options?.alwaysInject || !staticCssInjected;
if (shouldInject) {
createOrUpdateStyle(styles, 'data-ui5wcr-component', componentName);
createOrUpdateStyle(styles, 'data-ui5wcr-component', scopedComponentName);
StyleStore.mountComponent(componentName);

@@ -19,3 +21,3 @@ }

if (numberOfMountedComponents <= 0) {
removeStyle('data-ui5wcr-component', componentName);
removeStyle('data-ui5wcr-component', scopedComponentName);
}

@@ -22,0 +24,0 @@ }

{
"name": "@ui5/webcomponents-react-base",
"version": "1.29.10",
"version": "1.29.11",
"description": "Base for ui5-webcomponents-react",

@@ -63,3 +63,3 @@ "type": "module",

},
"gitHead": "81f0d40625c92de86314072d8fe7e62371767279"
"gitHead": "28675d0bfeb93233443663199ad3491f3a652688"
}

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc