@typespec/html-program-viewer 0.70.0-dev.2 → 0.70.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.
@@ -584,7 +584,7 @@ function getStyleSheetForBucket(bucketName, targetDocument, insertionPoint, rend
584
584
  media
585
585
  }));
586
586
  renderer.stylesheets[stylesheetKey] = stylesheet;
587
- if (targetDocument && tag) {
587
+ if ((targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.head) && tag) {
588
588
  targetDocument.head.insertBefore(tag, findInsertionPoint(targetDocument, insertionPoint, bucketName, renderer, metadata));
589
589
  }
590
590
  }
@@ -863,7 +863,7 @@ function __styles(classesMapBySlot, cssRules, factory = insertionFactory) {
863
863
  /**
864
864
  * @private
865
865
  */
866
- const RendererContext = /*#__PURE__*/React.createContext( /*#__PURE__*/createDOMRenderer());
866
+ const RendererContext = /*#__PURE__*/React.createContext(/*#__PURE__*/createDOMRenderer());
867
867
  /**
868
868
  * Returns an instance of current makeStyles() renderer.
869
869
  *
@@ -911,6 +911,10 @@ const TextDirectionProvider = ({
911
911
  * @internal
912
912
  * Internal reference for the render function
913
913
  */ const SLOT_ELEMENT_TYPE_SYMBOL = Symbol.for('fui.slotElementType');
914
+ /**
915
+ * @internal
916
+ * Internal cache of the original className prop for the slot, before being modified by the useStyles hook.
917
+ */ const SLOT_CLASS_NAME_PROP_SYMBOL = Symbol.for('fui.slotClassNameProp');
914
918
 
915
919
  /**
916
920
  * Creates a slot from a slot shorthand or properties (`props.SLOT_NAME` or `props` itself)
@@ -930,7 +934,8 @@ const TextDirectionProvider = ({
930
934
  */ const propsWithMetadata = {
931
935
  ...defaultProps,
932
936
  ...props,
933
- [SLOT_ELEMENT_TYPE_SYMBOL]: elementType
937
+ [SLOT_ELEMENT_TYPE_SYMBOL]: elementType,
938
+ [SLOT_CLASS_NAME_PROP_SYMBOL]: props === null || props === void 0 ? void 0 : props.className
934
939
  };
935
940
  if (props && typeof props.children === 'function') {
936
941
  propsWithMetadata[SLOT_RENDER_FUNCTION_SYMBOL] = props.children;
@@ -1982,7 +1987,7 @@ function createJSX(runtime, slotRuntime) {
1982
1987
  /**
1983
1988
  * @internal
1984
1989
  */ function getMetadataFromSlotComponent(type) {
1985
- const { as, [SLOT_ELEMENT_TYPE_SYMBOL]: baseElementType, [SLOT_RENDER_FUNCTION_SYMBOL]: renderFunction, ...propsWithoutMetadata } = type;
1990
+ const { as, [SLOT_CLASS_NAME_PROP_SYMBOL]: _classNameProp, [SLOT_ELEMENT_TYPE_SYMBOL]: baseElementType, [SLOT_RENDER_FUNCTION_SYMBOL]: renderFunction, ...propsWithoutMetadata } = type;
1986
1991
  const props = propsWithoutMetadata;
1987
1992
  const elementType = typeof baseElementType === 'string' ? as !== null && as !== void 0 ? as : baseElementType : baseElementType;
1988
1993
  if (typeof elementType !== 'string' && as) {
@@ -5052,7 +5057,9 @@ const useFluentProviderStyles_unstable = state => {
5052
5057
  // String concatenation is used to prevent bundlers to complain with older versions of React
5053
5058
  const useInsertionEffect = React['useInsertion' + 'Effect'] ? React['useInsertion' + 'Effect'] : useIsomorphicLayoutEffect;
5054
5059
  const createStyleTag = (target, elementAttributes)=>{
5055
- if (!target) {
5060
+ // Document might exist but not be ready yet (e.g. during SSR)
5061
+ // In that case, we should not create a style tag
5062
+ if (!(target === null || target === void 0 ? void 0 : target.head)) {
5056
5063
  return undefined;
5057
5064
  }
5058
5065
  const tag = target.createElement('style');
@@ -0,0 +1,6 @@
1
+ const manifest = {
2
+ "version": "1.0.0",
3
+ "commit": "b7a5b19167edd6e1d5fc9b1b031a408f52cefd35"
4
+ };
5
+
6
+ export { manifest as default };