Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Mark teams-prg owned APIs with @internal #23689

Merged
merged 3 commits into from
Jun 23, 2022
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "chore: Mark internal APIs with @internal",
"packageName": "@fluentui/priority-overflow",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "chore: Mark internal APIs with @internal",
"packageName": "@fluentui/react-aria",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "chore: Mark teams-prg owned APIs with @internal",
"packageName": "@fluentui/react-context-selector",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "chore: Mark teams-prg owned APIs with @internal",
"packageName": "@fluentui/react-overflow",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "chore: Mark teams-prg owned APIs with @internal",
"packageName": "@fluentui/react-positioning",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "chore: Mark teams-prg owned APIs with @internal",
"packageName": "@fluentui/react-shared-contexts",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "chore: Mark teams-prg owned APIs with @internal",
"packageName": "@fluentui/react-tabster",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "chore: Mark teams-prg owned APIs with @internal",
"packageName": "@fluentui/react-utilities",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,31 @@
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).

```ts
// @public (undocumented)

// Warning: (ae-internal-missing-underscore) The name "createOverflowManager" should be prefixed with an underscore because the declaration is marked as @internal
//
// @internal (undocumented)
export function createOverflowManager(): OverflowManager;

// @public (undocumented)
export interface ObserveOptions {
minimumVisible?: number;
onUpdateItemVisibility: OnUpdateItemVisibility;
onUpdateOverflow: OnUpdateOverflow;
overflowAxis?: OverflowAxis;
overflowDirection?: OverflowDirection;
padding?: number;
minimumVisible?: number;
onUpdateItemVisibility: OnUpdateItemVisibility;
onUpdateOverflow: OnUpdateOverflow;
overflowAxis?: OverflowAxis;
overflowDirection?: OverflowDirection;
padding?: number;
}

// @public (undocumented)
export type OnUpdateItemVisibility = (data: OnUpdateItemVisibilityPayload) => void;

// @public (undocumented)
export interface OnUpdateItemVisibilityPayload {
// (undocumented)
item: OverflowItemEntry;
// (undocumented)
visible: boolean;
// (undocumented)
item: OverflowItemEntry;
// (undocumented)
visible: boolean;
}

// @public
Expand All @@ -38,35 +41,38 @@ export type OverflowDirection = 'start' | 'end';

// @public
export interface OverflowEventPayload {
// (undocumented)
groupVisibility: Record<string, OverflowGroupState>;
// (undocumented)
invisibleItems: OverflowItemEntry[];
// (undocumented)
visibleItems: OverflowItemEntry[];
// (undocumented)
groupVisibility: Record<string, OverflowGroupState>;
// (undocumented)
invisibleItems: OverflowItemEntry[];
// (undocumented)
visibleItems: OverflowItemEntry[];
}

// @public (undocumented)
export type OverflowGroupState = 'visible' | 'hidden' | 'overflow';

// @public (undocumented)
export interface OverflowItemEntry {
element: HTMLElement;
// (undocumented)
groupId?: string;
id: string;
priority: number;
element: HTMLElement;
// (undocumented)
groupId?: string;
id: string;
priority: number;
}

// @public (undocumented)
// Warning: (ae-internal-missing-underscore) The name "OverflowManager" should be prefixed with an underscore because the declaration is marked as @internal
//
// @internal (undocumented)
export interface OverflowManager {
addItem: (items: OverflowItemEntry) => void;
disconnect: () => void;
forceUpdate: () => void;
observe: (container: HTMLElement, options: ObserveOptions) => void;
removeItem: (itemId: string) => void;
update: () => void;
addItem: (items: OverflowItemEntry) => void;
disconnect: () => void;
forceUpdate: () => void;
observe: (container: HTMLElement, options: ObserveOptions) => void;
removeItem: (itemId: string) => void;
update: () => void;
}

// (No @packageDocumentation comment for this package)

```
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { createPriorityQueue } from './priorityQueue';
import type { OverflowGroupState, OverflowItemEntry, OverflowManager, ObserveOptions } from './types';

/**
* @internal
* @returns overflow manager instance
*/
export function createOverflowManager(): OverflowManager {
Expand Down
3 changes: 3 additions & 0 deletions packages/react-components/priority-overflow/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ export interface ObserveOptions {
onUpdateOverflow: OnUpdateOverflow;
}

/**
* @internal
*/
export interface OverflowManager {
/**
* Starts observing the container and managing the overflow state
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ export type ARIAButtonSlotProps = ExtractSlotProps<Slot<'button', 'a'>> & {
disabledFocusable?: boolean;
};

// @public
// Warning: (ae-internal-missing-underscore) The name "mergeARIADisabled" should be prefixed with an underscore because the declaration is marked as @internal
//
// @internal
export function mergeARIADisabled(shorthand: {
'aria-disabled'?: string | boolean;
disabled?: boolean;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/**
* @internal
* Merges disabled declaration with `aria-disabled`
*/
export function mergeARIADisabled(shorthand: { 'aria-disabled'?: string | boolean; disabled?: boolean }) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,37 +6,53 @@

import * as React_2 from 'react';

// @public (undocumented)
// Warning: (ae-internal-missing-underscore) The name "Context" should be prefixed with an underscore because the declaration is marked as @internal
//
// @internal (undocumented)
export type Context<Value> = React_2.Context<Value> & {
Provider: React_2.FC<React_2.ProviderProps<Value>>;
Consumer: never;
};

// @public (undocumented)
// Warning: (ae-internal-missing-underscore) The name "ContextSelector" should be prefixed with an underscore because the declaration is marked as @internal
//
// @internal (undocumented)
export type ContextSelector<Value, SelectedValue> = (value: Value) => SelectedValue;

// @public (undocumented)
// Warning: (ae-internal-missing-underscore) The name "ContextValue" should be prefixed with an underscore because the declaration is marked as @internal
//
// @internal (undocumented)
export type ContextValue<Value> = {
listeners: ((payload: readonly [ContextVersion, Value]) => void)[];
value: React_2.MutableRefObject<Value>;
version: React_2.MutableRefObject<ContextVersion>;
};

// @public (undocumented)
// Warning: (ae-internal-missing-underscore) The name "ContextValues" should be prefixed with an underscore because the declaration is marked as @internal
//
// @internal (undocumented)
export type ContextValues<Value> = ContextValue<Value> & {
listeners: ((payload: readonly [ContextVersion, Record<string, Value>]) => void)[];
};

// @public (undocumented)
// Warning: (ae-internal-missing-underscore) The name "ContextVersion" should be prefixed with an underscore because the declaration is marked as @internal
//
// @internal (undocumented)
export type ContextVersion = number;

// @public (undocumented)
// Warning: (ae-internal-missing-underscore) The name "createContext" should be prefixed with an underscore because the declaration is marked as @internal
//
// @internal (undocumented)
export const createContext: <Value>(defaultValue: Value) => Context<Value>;

// @public
// Warning: (ae-internal-missing-underscore) The name "useContextSelector" should be prefixed with an underscore because the declaration is marked as @internal
//
// @internal
export const useContextSelector: <Value, SelectedValue>(context: Context<Value>, selector: ContextSelector<Value, SelectedValue>) => SelectedValue;

// @public
// Warning: (ae-internal-missing-underscore) The name "useHasParentContext" should be prefixed with an underscore because the declaration is marked as @internal
//
// @internal
export function useHasParentContext<Value>(context: Context<Value>): boolean;

// (No @packageDocumentation comment for this package)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ const createProvider = <Value>(Original: React.Provider<ContextValue<Value>>) =>
return (Provider as unknown) as React.Provider<ContextValue<Value>>;
};

/**
* @internal
*/
export const createContext = <Value>(defaultValue: Value): Context<Value> => {
const context = React.createContext<ContextValue<Value>>({
value: { current: defaultValue },
Expand Down
15 changes: 15 additions & 0 deletions packages/react-components/react-context-selector/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,26 @@
import * as React from 'react';

/**
* @internal
*/
export type Context<Value> = React.Context<Value> & {
Provider: React.FC<React.ProviderProps<Value>>;
Consumer: never;
};

/**
* @internal
*/
export type ContextSelector<Value, SelectedValue> = (value: Value) => SelectedValue;

/**
* @internal
*/
export type ContextVersion = number;

/**
* @internal
*/
export type ContextValue<Value> = {
/** Holds a set of subscribers from components. */
listeners: ((payload: readonly [ContextVersion, Value]) => void)[];
Expand All @@ -20,6 +32,9 @@ export type ContextValue<Value> = {
version: React.MutableRefObject<ContextVersion>;
};

/**
* @internal
*/
export type ContextValues<Value> = ContextValue<Value> & {
/** List of listners to publish changes */
listeners: ((payload: readonly [ContextVersion, Record<string, Value>]) => void)[];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ type ContextReducer<Value, SelectedValue> = React.Reducer<
>;

/**
* @internal
* This hook returns context selected value by selector.
* It will only accept context created by `createContext`.
* It will trigger re-render if only the selected value is referencially changed.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import * as React from 'react';
import { Context, ContextValue } from './types';

/**
* @internal
* Utility hook for contexts created by react-context-selector to determine if a parent context exists
* WARNING: This hook will not work for native React contexts
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
```ts

import type { ObserveOptions } from '@fluentui/priority-overflow';
import type { OnUpdateItemVisibility } from '@fluentui/priority-overflow';
import type { OnUpdateOverflow } from '@fluentui/priority-overflow';
import { OverflowGroupState } from '@fluentui/priority-overflow';
import type { OverflowItemEntry } from '@fluentui/priority-overflow';
Expand Down Expand Up @@ -41,19 +40,20 @@ export type OverflowProps = Partial<Pick<ObserveOptions, 'overflowAxis' | 'overf
children: React_2.ReactElement;
};

// @public (undocumented)
export const updateVisibilityAttribute: OnUpdateItemVisibility;

// @public (undocumented)
export function useIsOverflowGroupVisible(id: string): OverflowGroupState;

// @public (undocumented)
export function useIsOverflowItemVisible(id: string): boolean;

// @public (undocumented)
// Warning: (ae-internal-missing-underscore) The name "useOverflowContainer" should be prefixed with an underscore because the declaration is marked as @internal
//
// @internal (undocumented)
export const useOverflowContainer: <TElement extends HTMLElement>(update: OnUpdateOverflow, options: Omit<ObserveOptions, 'onUpdateOverflow'>) => UseOverflowContainerReturn<TElement>;

// @public (undocumented)
// Warning: (ae-internal-missing-underscore) The name "UseOverflowContainerReturn" should be prefixed with an underscore because the declaration is marked as @internal
//
// @internal (undocumented)
export interface UseOverflowContainerReturn<TElement extends HTMLElement> {
containerRef: React_2.RefObject<TElement>;
registerItem: OverflowContextValue['registerItem'];
Expand All @@ -63,7 +63,9 @@ export interface UseOverflowContainerReturn<TElement extends HTMLElement> {
// @public (undocumented)
export const useOverflowCount: () => number;

// @public
// Warning: (ae-internal-missing-underscore) The name "useOverflowItem" should be prefixed with an underscore because the declaration is marked as @internal
//
// @internal
export function useOverflowItem<TElement extends HTMLElement>(id: string, priority?: number, groupId?: string): React_2.RefObject<TElement>;

// @public (undocumented)
Expand Down
2 changes: 1 addition & 1 deletion packages/react-components/react-overflow/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export { DATA_OVERFLOWING, DATA_OVERFLOW_ITEM, DATA_OVERFLOW_MENU } from './cons
export type { UseOverflowContainerReturn } from './types';
export { useIsOverflowGroupVisible } from './useIsOverflowGroupVisible';
export { useIsOverflowItemVisible } from './useIsOverflowItemVisible';
export { updateVisibilityAttribute, useOverflowContainer } from './useOverflowContainer';
export { useOverflowContainer } from './useOverflowContainer';
export { useOverflowCount } from './useOverflowCount';
export { useOverflowItem } from './useOverflowItem';
export { useOverflowMenu } from './useOverflowMenu';
Expand Down
3 changes: 3 additions & 0 deletions packages/react-components/react-overflow/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import * as React from 'react';
import { OverflowContextValue } from './overflowContext';

/**
* @internal
*/
export interface UseOverflowContainerReturn<TElement extends HTMLElement> {
/**
* Ref to apply to the container that will overflow
Expand Down
Loading