From 0a1174cc59edee0efdd45cfcde0ae9d41681e460 Mon Sep 17 00:00:00 2001 From: Rene Haas Date: Wed, 14 Sep 2022 13:07:40 +0200 Subject: [PATCH] improve readme and exports --- README.md | 54 ++++++++++++++----- packages/overlayscrollbars/README.md | 54 ++++++++++++++----- packages/overlayscrollbars/src/index.ts | 2 +- .../clickScrollPlugin/clickScrollPlugin.ts | 2 +- .../optionsValidationPlugin.ts | 2 +- .../scrollbarsHidingPlugin.ts | 2 +- .../sizeObserverPlugin/sizeObserverPlugin.ts | 2 +- .../tests/jest-jsdom/environment.test.ts | 6 +-- .../jest-jsdom/observers/sizeObserver.test.ts | 4 +- .../jest-jsdom/overlayscrollbars.test.ts | 4 +- .../optionsValidation.test.ts | 6 +-- .../structureSetup.elements.test.ts | 4 +- .../observers/sizeObserver/index.browser.ts | 4 +- .../trinsicObserver/index.browser.ts | 4 +- .../structureSetup/nesting/index.browser.ts | 6 +-- .../structureSetup/update/index.browser.ts | 8 +-- 16 files changed, 112 insertions(+), 52 deletions(-) diff --git a/README.md b/README.md index 906fc49..a53f99e 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,7 @@ Embedd OverlayScrollbars manually in your HTML: ## Initialization -> __Note__ During initialization its expected that the CSS file is loaded and parsed by the browser. +> __Note__: During initialization its expected that the CSS file is loaded and parsed by the browser. You can initialize either directly with an `Element` or with an `Object` where you have more control over the initialization process. @@ -75,7 +75,7 @@ const osInstance = OverlayScrollbars(document.querySelector('#myElement'), {});
Initialization with an Object
-> __Note__ For now please refer to the TypeScript definitions for a more detailed description of all possibilities. +> __Note__: For now please refer to the TypeScript definitions for a more detailed description of all possibilities. The only required field is the `target` field. This is the field to which the plugin is applied to. If you use the object initialization only with the `target` field, the outcome is equivalent to the element initialization: @@ -200,7 +200,7 @@ An array of tuples. The first value in the tuple is an `selector` and the second | :--- | :--- | | `[number, number] \| number \| null` | `[0, 33]` | -> __Note__ If 0 is used for the timeout, `requestAnimationFrame` instead of `setTimeout` is used for the debounce. +> __Note__: If 0 is used for the timeout, `requestAnimationFrame` instead of `setTimeout` is used for the debounce. Debounces the `MutationObserver` which tracks changes to the content. If a **tuple** is passed, the first value is the timeout and second is the max wait. If only a **number** is passed you specify only the timeout and there is no max wait. With **null** there is no debounce. **Usefull to fine-tune performance.** @@ -210,7 +210,7 @@ Debounces the `MutationObserver` which tracks changes to the content. If a **tup | :--- | :--- | | `string[] \| null` | `null` | -> __Note__ There is a base array of attributes that the `MutationObserver` always observes, even if this option is `null`. +> __Note__: There is a base array of attributes that the `MutationObserver` always observes, even if this option is `null`. An array of additional attributes that the `MutationObserver` should observe for the content. @@ -228,7 +228,7 @@ A function which receives a [`MutationRecord`](https://developer.mozilla.org/en- | :--- | :--- | | `string` | `'scroll'` | -> __Note__ Valid values are: `'hidden'`, `'scroll'`, `'visible'`, `'visible-hidden'` and `'visible-scroll'`. +> __Note__: Valid values are: `'hidden'`, `'scroll'`, `'visible'`, `'visible-hidden'` and `'visible-scroll'`. The overflow behavior for the horizontal (x) axis. @@ -238,7 +238,7 @@ The overflow behavior for the horizontal (x) axis. | :--- | :--- | | `string` | `'scroll'` | -> __Note__ Valid values are: `'hidden'`, `'scroll'`, `'visible'`, `'visible-hidden'` and `'visible-scroll'`. +> __Note__: Valid values are: `'hidden'`, `'scroll'`, `'visible'`, `'visible-hidden'` and `'visible-scroll'`. The overflow behavior for the vertical (y) axis. @@ -256,7 +256,7 @@ Applies the specified theme (classname) to the scrollbars. | :--- | :--- | | `string` | `'auto'` | -> __Note__ Valid values are: `'visible'`, `'hidden'`, and `'auto'`. +> __Note__: Valid values are: `'visible'`, `'hidden'`, and `'auto'`. The base visibility of the scrollbars. @@ -266,7 +266,7 @@ The base visibility of the scrollbars. | :--- | :--- | | `string` | `'never'` | -> __Note__ Valid values are: `'never'`, `'scroll'`, `'leave'` and `'move'`. +> __Note__: Valid values are: `'never'`, `'scroll'`, `'leave'` and `'move'`. The possibility to hide visible scrollbars automatically after a certain user action. @@ -317,7 +317,7 @@ OverlayScrollbars(document.querySelector('#myElement'), {}, {
Events in depth
-> __Note__ Every event receives the `instance` from which it was fired as the first argument. Always. +> __Note__: Every event receives the `instance` from which it was fired as the first argument. Always. ### `initialized` @@ -334,7 +334,7 @@ Is fired after all generated elements, observers and events were appended to the | `instance` | The instance which fired the event. | | `onUpdatedArgs` | An `object` which describes the update in detail. | -> __Note__ If an update was triggered but nothing changed, the event won't be fired. +> __Note__: If an update was triggered but nothing changed, the event won't be fired. Is fired after the instace was updated. @@ -351,7 +351,7 @@ Is fired after all generated elements, observers and events were removed from th ## Instance Methods -> __Note__ For now please refer to the TypeScript definitions for a more detailed description. +> __Note__: For now please refer to the TypeScript definitions for a more detailed description. ```ts interface OverlayScrollbars { @@ -376,7 +376,7 @@ interface OverlayScrollbars { ## Static Methods -> __Note__ For now please refer to the TypeScript definitions for a more detailed description. +> __Note__: For now please refer to the TypeScript definitions for a more detailed description. ```ts interface OverlayScrollbarsStatic { @@ -393,6 +393,36 @@ interface OverlayScrollbarsStatic { } ``` +## Plugins + +Everything thats considered not core functionality or old browser compatibility is exposed via a plugin. This is done because all unused plugins are treeshaken and thus won't end up in your final bundle. OverlayScrollbars comes with the following plugins: + +- **ScrollbarsHidingPlugin**: Is needed for old browsers which aren't supporting nativ scrollbar styling features. [You can find the list of browsers where you need this plugin here](https://caniuse.com/?search=scrollbar%20styling) (note that even though `iOS Safari >= 14` is marked as unsupported you only need this plugin for `iOS < 7.1`). +- **SizeObserverPlugin**: Is needed for old browsers which aren't supporting the `ResizeObserver` api. [You can find the list of browsers where you need this plugin here](https://caniuse.com/?search=ResizeObserver) +- **ClickScrollPlugin**: If you want to use the option `scrollbars: { clickScroll: true }`. + +#### Consuming Plugins + +You can consume plugins like: +```ts +import { + OverlayScrollbars, + ScrollbarsHidingPlugin, + SizeObserverPlugin, + ClickScrollPlugin +} from 'overlayscrollbars'; + +// single plugin +OverlayScrollbars.plugin(ScrollbarsHidingPlugin); + +// multiple plugins +OverlayScrollbars.plugin([SizeObserverPlugin, ClickScrollPlugin]); +``` + +#### Writing Plugins + +You can write and publish your own Plugins. This section is a work in progress. + ## Sponsors diff --git a/packages/overlayscrollbars/README.md b/packages/overlayscrollbars/README.md index 906fc49..a53f99e 100644 --- a/packages/overlayscrollbars/README.md +++ b/packages/overlayscrollbars/README.md @@ -64,7 +64,7 @@ Embedd OverlayScrollbars manually in your HTML: ## Initialization -> __Note__ During initialization its expected that the CSS file is loaded and parsed by the browser. +> __Note__: During initialization its expected that the CSS file is loaded and parsed by the browser. You can initialize either directly with an `Element` or with an `Object` where you have more control over the initialization process. @@ -75,7 +75,7 @@ const osInstance = OverlayScrollbars(document.querySelector('#myElement'), {});
Initialization with an Object
-> __Note__ For now please refer to the TypeScript definitions for a more detailed description of all possibilities. +> __Note__: For now please refer to the TypeScript definitions for a more detailed description of all possibilities. The only required field is the `target` field. This is the field to which the plugin is applied to. If you use the object initialization only with the `target` field, the outcome is equivalent to the element initialization: @@ -200,7 +200,7 @@ An array of tuples. The first value in the tuple is an `selector` and the second | :--- | :--- | | `[number, number] \| number \| null` | `[0, 33]` | -> __Note__ If 0 is used for the timeout, `requestAnimationFrame` instead of `setTimeout` is used for the debounce. +> __Note__: If 0 is used for the timeout, `requestAnimationFrame` instead of `setTimeout` is used for the debounce. Debounces the `MutationObserver` which tracks changes to the content. If a **tuple** is passed, the first value is the timeout and second is the max wait. If only a **number** is passed you specify only the timeout and there is no max wait. With **null** there is no debounce. **Usefull to fine-tune performance.** @@ -210,7 +210,7 @@ Debounces the `MutationObserver` which tracks changes to the content. If a **tup | :--- | :--- | | `string[] \| null` | `null` | -> __Note__ There is a base array of attributes that the `MutationObserver` always observes, even if this option is `null`. +> __Note__: There is a base array of attributes that the `MutationObserver` always observes, even if this option is `null`. An array of additional attributes that the `MutationObserver` should observe for the content. @@ -228,7 +228,7 @@ A function which receives a [`MutationRecord`](https://developer.mozilla.org/en- | :--- | :--- | | `string` | `'scroll'` | -> __Note__ Valid values are: `'hidden'`, `'scroll'`, `'visible'`, `'visible-hidden'` and `'visible-scroll'`. +> __Note__: Valid values are: `'hidden'`, `'scroll'`, `'visible'`, `'visible-hidden'` and `'visible-scroll'`. The overflow behavior for the horizontal (x) axis. @@ -238,7 +238,7 @@ The overflow behavior for the horizontal (x) axis. | :--- | :--- | | `string` | `'scroll'` | -> __Note__ Valid values are: `'hidden'`, `'scroll'`, `'visible'`, `'visible-hidden'` and `'visible-scroll'`. +> __Note__: Valid values are: `'hidden'`, `'scroll'`, `'visible'`, `'visible-hidden'` and `'visible-scroll'`. The overflow behavior for the vertical (y) axis. @@ -256,7 +256,7 @@ Applies the specified theme (classname) to the scrollbars. | :--- | :--- | | `string` | `'auto'` | -> __Note__ Valid values are: `'visible'`, `'hidden'`, and `'auto'`. +> __Note__: Valid values are: `'visible'`, `'hidden'`, and `'auto'`. The base visibility of the scrollbars. @@ -266,7 +266,7 @@ The base visibility of the scrollbars. | :--- | :--- | | `string` | `'never'` | -> __Note__ Valid values are: `'never'`, `'scroll'`, `'leave'` and `'move'`. +> __Note__: Valid values are: `'never'`, `'scroll'`, `'leave'` and `'move'`. The possibility to hide visible scrollbars automatically after a certain user action. @@ -317,7 +317,7 @@ OverlayScrollbars(document.querySelector('#myElement'), {}, {
Events in depth
-> __Note__ Every event receives the `instance` from which it was fired as the first argument. Always. +> __Note__: Every event receives the `instance` from which it was fired as the first argument. Always. ### `initialized` @@ -334,7 +334,7 @@ Is fired after all generated elements, observers and events were appended to the | `instance` | The instance which fired the event. | | `onUpdatedArgs` | An `object` which describes the update in detail. | -> __Note__ If an update was triggered but nothing changed, the event won't be fired. +> __Note__: If an update was triggered but nothing changed, the event won't be fired. Is fired after the instace was updated. @@ -351,7 +351,7 @@ Is fired after all generated elements, observers and events were removed from th ## Instance Methods -> __Note__ For now please refer to the TypeScript definitions for a more detailed description. +> __Note__: For now please refer to the TypeScript definitions for a more detailed description. ```ts interface OverlayScrollbars { @@ -376,7 +376,7 @@ interface OverlayScrollbars { ## Static Methods -> __Note__ For now please refer to the TypeScript definitions for a more detailed description. +> __Note__: For now please refer to the TypeScript definitions for a more detailed description. ```ts interface OverlayScrollbarsStatic { @@ -393,6 +393,36 @@ interface OverlayScrollbarsStatic { } ``` +## Plugins + +Everything thats considered not core functionality or old browser compatibility is exposed via a plugin. This is done because all unused plugins are treeshaken and thus won't end up in your final bundle. OverlayScrollbars comes with the following plugins: + +- **ScrollbarsHidingPlugin**: Is needed for old browsers which aren't supporting nativ scrollbar styling features. [You can find the list of browsers where you need this plugin here](https://caniuse.com/?search=scrollbar%20styling) (note that even though `iOS Safari >= 14` is marked as unsupported you only need this plugin for `iOS < 7.1`). +- **SizeObserverPlugin**: Is needed for old browsers which aren't supporting the `ResizeObserver` api. [You can find the list of browsers where you need this plugin here](https://caniuse.com/?search=ResizeObserver) +- **ClickScrollPlugin**: If you want to use the option `scrollbars: { clickScroll: true }`. + +#### Consuming Plugins + +You can consume plugins like: +```ts +import { + OverlayScrollbars, + ScrollbarsHidingPlugin, + SizeObserverPlugin, + ClickScrollPlugin +} from 'overlayscrollbars'; + +// single plugin +OverlayScrollbars.plugin(ScrollbarsHidingPlugin); + +// multiple plugins +OverlayScrollbars.plugin([SizeObserverPlugin, ClickScrollPlugin]); +``` + +#### Writing Plugins + +You can write and publish your own Plugins. This section is a work in progress. + ## Sponsors
diff --git a/packages/overlayscrollbars/src/index.ts b/packages/overlayscrollbars/src/index.ts index ae86d36..f725a95 100644 --- a/packages/overlayscrollbars/src/index.ts +++ b/packages/overlayscrollbars/src/index.ts @@ -1,7 +1,7 @@ import 'index.scss'; export { OverlayScrollbars } from 'overlayscrollbars'; -export { scrollbarsHidingPlugin, sizeObserverPlugin } from 'plugins'; +export { ScrollbarsHidingPlugin, SizeObserverPlugin, ClickScrollPlugin } from 'plugins'; export type { Options, diff --git a/packages/overlayscrollbars/src/plugins/clickScrollPlugin/clickScrollPlugin.ts b/packages/overlayscrollbars/src/plugins/clickScrollPlugin/clickScrollPlugin.ts index 8bae03f..9fb7aa4 100644 --- a/packages/overlayscrollbars/src/plugins/clickScrollPlugin/clickScrollPlugin.ts +++ b/packages/overlayscrollbars/src/plugins/clickScrollPlugin/clickScrollPlugin.ts @@ -13,7 +13,7 @@ export type ClickScrollPluginInstance = { export const clickScrollPluginName = '__osClickScrollPlugin'; -export const clickScrollPlugin: Plugin = /* @__PURE__ */ (() => ({ +export const ClickScrollPlugin: Plugin = /* @__PURE__ */ (() => ({ [clickScrollPluginName]: { _: ( moveHandleRelative, diff --git a/packages/overlayscrollbars/src/plugins/optionsValidationPlugin/optionsValidationPlugin.ts b/packages/overlayscrollbars/src/plugins/optionsValidationPlugin/optionsValidationPlugin.ts index 2ea764d..2a3f714 100644 --- a/packages/overlayscrollbars/src/plugins/optionsValidationPlugin/optionsValidationPlugin.ts +++ b/packages/overlayscrollbars/src/plugins/optionsValidationPlugin/optionsValidationPlugin.ts @@ -61,7 +61,7 @@ export type OptionsValidationPluginInstance = { export const optionsValidationPluginName = '__osOptionsValidationPlugin'; -export const optionsValidationPlugin: Plugin = +export const OptionsValidationPlugin: Plugin = /* @__PURE__ */ (() => ({ [optionsValidationPluginName]: { _: (options: DeepPartial, doWriteErrors?: boolean) => { diff --git a/packages/overlayscrollbars/src/plugins/scrollbarsHidingPlugin/scrollbarsHidingPlugin.ts b/packages/overlayscrollbars/src/plugins/scrollbarsHidingPlugin/scrollbarsHidingPlugin.ts index 4558f08..f13a407 100644 --- a/packages/overlayscrollbars/src/plugins/scrollbarsHidingPlugin/scrollbarsHidingPlugin.ts +++ b/packages/overlayscrollbars/src/plugins/scrollbarsHidingPlugin/scrollbarsHidingPlugin.ts @@ -79,7 +79,7 @@ const diffBiggerThanOne = (valOne: number, valTwo: number): boolean => { export const scrollbarsHidingPluginName = '__osScrollbarsHidingPlugin'; -export const scrollbarsHidingPlugin: Plugin = +export const ScrollbarsHidingPlugin: Plugin = /* @__PURE__ */ (() => ({ [scrollbarsHidingPluginName]: { _createUniqueViewportArrangeElement: (env: InternalEnvironment) => { diff --git a/packages/overlayscrollbars/src/plugins/sizeObserverPlugin/sizeObserverPlugin.ts b/packages/overlayscrollbars/src/plugins/sizeObserverPlugin/sizeObserverPlugin.ts index bff3226..f37c79c 100644 --- a/packages/overlayscrollbars/src/plugins/sizeObserverPlugin/sizeObserverPlugin.ts +++ b/packages/overlayscrollbars/src/plugins/sizeObserverPlugin/sizeObserverPlugin.ts @@ -32,7 +32,7 @@ const scrollAmount = 3333333; const scrollEventName = 'scroll'; export const sizeObserverPluginName = '__osSizeObserverPlugin'; -export const sizeObserverPlugin: Plugin = /* @__PURE__ */ (() => ({ +export const SizeObserverPlugin: Plugin = /* @__PURE__ */ (() => ({ [sizeObserverPluginName]: { _: (listenerElement, onSizeChangedCallback, observeAppearChange) => { const observerElementChildren = createDOM( diff --git a/packages/overlayscrollbars/tests/jest-jsdom/environment.test.ts b/packages/overlayscrollbars/tests/jest-jsdom/environment.test.ts index c7e1d9f..8c6d3cd 100644 --- a/packages/overlayscrollbars/tests/jest-jsdom/environment.test.ts +++ b/packages/overlayscrollbars/tests/jest-jsdom/environment.test.ts @@ -2,7 +2,7 @@ import { DeepPartial } from 'typings'; import { defaultOptions, Options } from 'options'; import { Initialization } from 'initialization'; import { getEnvironment } from 'environment'; -import { scrollbarsHidingPlugin, scrollbarsHidingPluginName } from 'plugins'; +import { ScrollbarsHidingPlugin, scrollbarsHidingPluginName } from 'plugins'; const defaultInitialization = { elements: { @@ -145,7 +145,7 @@ describe('environment', () => { test('with scrollbarsHidingPlugin registered before environment was created', async () => { const { getPlugins } = await import('plugins'); (getPlugins as jest.Mock).mockImplementation(() => ({ - [scrollbarsHidingPluginName]: scrollbarsHidingPlugin[scrollbarsHidingPluginName], + [scrollbarsHidingPluginName]: ScrollbarsHidingPlugin[scrollbarsHidingPluginName], })); const { _addListener } = getEnv(); @@ -165,7 +165,7 @@ describe('environment', () => { const { getPlugins } = await import('plugins'); (getPlugins as jest.Mock).mockImplementation(() => ({ - [scrollbarsHidingPluginName]: scrollbarsHidingPlugin[scrollbarsHidingPluginName], + [scrollbarsHidingPluginName]: ScrollbarsHidingPlugin[scrollbarsHidingPluginName], })); window.dispatchEvent(new Event('resize')); diff --git a/packages/overlayscrollbars/tests/jest-jsdom/observers/sizeObserver.test.ts b/packages/overlayscrollbars/tests/jest-jsdom/observers/sizeObserver.test.ts index b2e3dff..9ce0e69 100644 --- a/packages/overlayscrollbars/tests/jest-jsdom/observers/sizeObserver.test.ts +++ b/packages/overlayscrollbars/tests/jest-jsdom/observers/sizeObserver.test.ts @@ -1,5 +1,5 @@ import { createSizeObserver as originalCreateSizeObserver } from 'observers'; -import { sizeObserverPlugin, sizeObserverPluginName } from 'plugins'; +import { SizeObserverPlugin, sizeObserverPluginName } from 'plugins'; let createSizeObserver = originalCreateSizeObserver; @@ -59,7 +59,7 @@ describe('createSizeObserver', () => { describe('with sizeObserverPlugin', () => { const mockSizeObserverPlugin = jest.fn((...a) => [ // @ts-ignore - sizeObserverPlugin[sizeObserverPluginName]._(...a), + SizeObserverPlugin[sizeObserverPluginName]._(...a), ]); beforeEach(() => { diff --git a/packages/overlayscrollbars/tests/jest-jsdom/overlayscrollbars.test.ts b/packages/overlayscrollbars/tests/jest-jsdom/overlayscrollbars.test.ts index 37a7566..f1fbd0e 100644 --- a/packages/overlayscrollbars/tests/jest-jsdom/overlayscrollbars.test.ts +++ b/packages/overlayscrollbars/tests/jest-jsdom/overlayscrollbars.test.ts @@ -1,7 +1,7 @@ import { DeepPartial } from 'typings'; import { defaultOptions, Options } from 'options'; import { assignDeep } from 'support'; -import { optionsValidationPlugin } from 'plugins'; +import { OptionsValidationPlugin } from 'plugins'; import { OverlayScrollbars as originalOverlayScrollbars } from '../../src/overlayscrollbars'; const bodyElm = document.body; @@ -242,7 +242,7 @@ describe('overlayscrollbars', () => { describe(`${withValidationPlugin ? 'with' : 'without'} optionsValidationPlugin`, () => { beforeEach(() => { if (withValidationPlugin) { - OverlayScrollbars.plugin(optionsValidationPlugin); + OverlayScrollbars.plugin(OptionsValidationPlugin); } }); diff --git a/packages/overlayscrollbars/tests/jest-jsdom/plugins/optionsValidation/optionsValidation.test.ts b/packages/overlayscrollbars/tests/jest-jsdom/plugins/optionsValidation/optionsValidation.test.ts index 3f76071..82b2aec 100644 --- a/packages/overlayscrollbars/tests/jest-jsdom/plugins/optionsValidation/optionsValidation.test.ts +++ b/packages/overlayscrollbars/tests/jest-jsdom/plugins/optionsValidation/optionsValidation.test.ts @@ -1,12 +1,12 @@ import { defaultOptions } from 'options'; import { - optionsValidationPlugin, + OptionsValidationPlugin, optionsValidationPluginName, } from 'plugins/optionsValidationPlugin'; const getValidationFn = () => { - const name = Object.keys(optionsValidationPlugin)[0]; - const instance = optionsValidationPlugin[name]; + const name = Object.keys(OptionsValidationPlugin)[0]; + const instance = OptionsValidationPlugin[name]; const validationFn = instance._; expect(name).toBe(optionsValidationPluginName); diff --git a/packages/overlayscrollbars/tests/jest-jsdom/setups/structureSetup/structureSetup.elements.test.ts b/packages/overlayscrollbars/tests/jest-jsdom/setups/structureSetup/structureSetup.elements.test.ts index 558f75f..c1a2c7d 100644 --- a/packages/overlayscrollbars/tests/jest-jsdom/setups/structureSetup/structureSetup.elements.test.ts +++ b/packages/overlayscrollbars/tests/jest-jsdom/setups/structureSetup/structureSetup.elements.test.ts @@ -10,7 +10,7 @@ import { createStructureSetupElements, StructureSetupElementsObj, } from 'setups/structureSetup/structureSetup.elements'; -import { addPlugin, scrollbarsHidingPlugin } from 'plugins'; +import { addPlugin, ScrollbarsHidingPlugin } from 'plugins'; import type { Initialization, InitializationTarget, @@ -21,7 +21,7 @@ jest.mock('environment', () => ({ getEnvironment: jest.fn(), })); -addPlugin(scrollbarsHidingPlugin); +addPlugin(ScrollbarsHidingPlugin); interface StructureSetupElementsProxy { input: InitializationTarget; diff --git a/packages/overlayscrollbars/tests/playwright/observers/sizeObserver/index.browser.ts b/packages/overlayscrollbars/tests/playwright/observers/sizeObserver/index.browser.ts index 9dc6273..f172283 100644 --- a/packages/overlayscrollbars/tests/playwright/observers/sizeObserver/index.browser.ts +++ b/packages/overlayscrollbars/tests/playwright/observers/sizeObserver/index.browser.ts @@ -11,11 +11,11 @@ import { waitForOrFailTest, } from '@~local/browser-testing'; import { hasDimensions, offsetSize, WH, style } from 'support'; -import { addPlugin, sizeObserverPlugin } from 'plugins'; +import { addPlugin, SizeObserverPlugin } from 'plugins'; import { createSizeObserver } from 'observers'; if (!window.ResizeObserver) { - addPlugin(sizeObserverPlugin); + addPlugin(SizeObserverPlugin); } let sizeIterations = 0; diff --git a/packages/overlayscrollbars/tests/playwright/observers/trinsicObserver/index.browser.ts b/packages/overlayscrollbars/tests/playwright/observers/trinsicObserver/index.browser.ts index 94aa641..93838f0 100644 --- a/packages/overlayscrollbars/tests/playwright/observers/trinsicObserver/index.browser.ts +++ b/packages/overlayscrollbars/tests/playwright/observers/trinsicObserver/index.browser.ts @@ -12,10 +12,10 @@ import { } from '@~local/browser-testing'; import { offsetSize } from 'support'; import { createTrinsicObserver } from 'observers'; -import { addPlugin, sizeObserverPlugin } from 'plugins'; +import { addPlugin, SizeObserverPlugin } from 'plugins'; if (!window.ResizeObserver) { - addPlugin(sizeObserverPlugin); + addPlugin(SizeObserverPlugin); } let heightIntrinsic: boolean | undefined; diff --git a/packages/overlayscrollbars/tests/playwright/setups/structureSetup/nesting/index.browser.ts b/packages/overlayscrollbars/tests/playwright/setups/structureSetup/nesting/index.browser.ts index 8577963..2f61b4f 100644 --- a/packages/overlayscrollbars/tests/playwright/setups/structureSetup/nesting/index.browser.ts +++ b/packages/overlayscrollbars/tests/playwright/setups/structureSetup/nesting/index.browser.ts @@ -4,13 +4,13 @@ import should from 'should'; import { timeout, setTestResult, waitForOrFailTest, resize } from '@~local/browser-testing'; import { OverlayScrollbars } from 'overlayscrollbars'; import { addClass, each, isArray, removeAttr, style } from 'support'; -import { addPlugin, scrollbarsHidingPlugin, sizeObserverPlugin } from 'plugins'; +import { addPlugin, ScrollbarsHidingPlugin, SizeObserverPlugin } from 'plugins'; if (!window.ResizeObserver) { - addPlugin(sizeObserverPlugin); + addPlugin(SizeObserverPlugin); } if (!OverlayScrollbars.env().scrollbarsHiding) { - addPlugin(scrollbarsHidingPlugin); + addPlugin(ScrollbarsHidingPlugin); } // @ts-ignore diff --git a/packages/overlayscrollbars/tests/playwright/setups/structureSetup/update/index.browser.ts b/packages/overlayscrollbars/tests/playwright/setups/structureSetup/update/index.browser.ts index e8cd394..2355aa7 100644 --- a/packages/overlayscrollbars/tests/playwright/setups/structureSetup/update/index.browser.ts +++ b/packages/overlayscrollbars/tests/playwright/setups/structureSetup/update/index.browser.ts @@ -32,15 +32,15 @@ import { } from 'support'; import { Options } from 'options'; import { DeepPartial } from 'typings'; -import { addPlugin, scrollbarsHidingPlugin, sizeObserverPlugin, clickScrollPlugin } from 'plugins'; +import { addPlugin, ScrollbarsHidingPlugin, SizeObserverPlugin, ClickScrollPlugin } from 'plugins'; -addPlugin(clickScrollPlugin); +addPlugin(ClickScrollPlugin); if (!window.ResizeObserver) { - addPlugin(sizeObserverPlugin); + addPlugin(SizeObserverPlugin); } if (!OverlayScrollbars.env().scrollbarsHiding) { - addPlugin(scrollbarsHidingPlugin); + addPlugin(ScrollbarsHidingPlugin); } // @ts-ignore