From 065a3f6d8c5d501d8757fc7f0ea1f35606306ee2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Vassbotn=20R=C3=B8yne-Helgesen?= Date: Wed, 28 Aug 2024 11:43:16 +0200 Subject: [PATCH] =?UTF-8?q?docs:=20=E2=9C=8F=EF=B8=8F=20Regenerate=20API?= =?UTF-8?q?=20documentation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/README.md | 5 +- api/config/browser.md | 2 +- api/features/a11y.md | 46 ++--------- api/features/a11y/constants.md | 2 +- .../a11y/utils/create-a11y-element.md | 65 ++++++++++++++++ api/features/a11y/utils/styles.md | 2 +- api/features/grid.md | 18 ++--- api/features/mark.md | 6 +- api/features/measure.md | 18 ++--- api/features/pin.md | 4 +- api/features/pin/utils/create-pin-element.md | 20 ++--- .../pin/utils/get-character-to-use.md | 2 +- api/features/pin/utils/get-content-for-pin.md | 68 +++++++++++++++++ api/features/pin/utils/pin-element.md | 26 ++++--- api/features/pin/utils/styles.md | 22 +++--- api/features/spacing.md | 2 +- api/features/spacing/utils/position.md | 2 +- api/features/typography.md | 14 ++-- api/features/typography/utils/position.md | 24 +++--- api/features/typography/utils/template.md | 2 +- api/main.md | 16 ++-- api/types/bezier.md | 52 +++++-------- api/types/css.md | 2 +- api/types/debounce.md | 2 +- api/types/enums/area.md | 55 +++++++------- api/types/interfaces/attributes.md | 2 +- api/types/interfaces/classnames.md | 2 +- api/types/interfaces/global.md | 2 +- api/types/interfaces/position.md | 2 +- api/types/position.md | 2 +- api/types/speccer.md | 69 ++++++++++++++++- api/types/styles.md | 2 +- api/types/xy.md | 2 +- api/utils/angle.md | 2 +- api/utils/area.md | 76 ++++++++++++++++--- api/utils/attributes.md | 2 +- api/utils/bezier.md | 18 ++--- api/utils/camel-case.md | 2 +- api/utils/cardinal.md | 2 +- api/utils/classes/DrawCircle.md | 28 +++---- api/utils/classes/DrawSVGCurlyBracket.md | 2 +- api/utils/classes/DrawSVGLine.md | 29 ++++--- api/utils/classnames.md | 2 +- api/utils/constants.md | 2 +- api/utils/coords.md | 2 +- api/utils/css.md | 2 +- api/utils/debounce.md | 2 +- api/utils/direction-of-element.md | 2 +- api/utils/get-coords-pair-from-objects.md | 2 +- api/utils/get-options.md | 67 ++++++++++++++++ api/utils/id.md | 2 +- api/utils/intrinsic-coords.md | 2 +- api/utils/node.md | 2 +- api/utils/number.md | 2 +- api/utils/position.md | 2 +- api/utils/resize.md | 2 +- api/utils/style-property.md | 2 +- api/utils/styles.md | 2 +- api/utils/typeof.md | 2 +- api/utils/wait.md | 2 +- api/utils/xy.md | 2 +- 61 files changed, 550 insertions(+), 274 deletions(-) create mode 100644 api/features/a11y/utils/create-a11y-element.md create mode 100644 api/features/pin/utils/get-content-for-pin.md create mode 100644 api/utils/get-options.md diff --git a/api/README.md b/api/README.md index 7b49c27..94cfc73 100644 --- a/api/README.md +++ b/api/README.md @@ -8,13 +8,14 @@ --- -> Last updated 2024-08-23T11:58:26.652Z +> Last updated 2024-08-28T09:42:51.066Z ## Modules - [config/browser](config/browser.md) - [features/a11y](features/a11y.md) - [features/a11y/constants](features/a11y/constants.md) +- [features/a11y/utils/create-a11y-element](features/a11y/utils/create-a11y-element.md) - [features/a11y/utils/styles](features/a11y/utils/styles.md) - [features/grid](features/grid.md) - [features/mark](features/mark.md) @@ -22,6 +23,7 @@ - [features/pin](features/pin.md) - [features/pin/utils/create-pin-element](features/pin/utils/create-pin-element.md) - [features/pin/utils/get-character-to-use](features/pin/utils/get-character-to-use.md) +- [features/pin/utils/get-content-for-pin](features/pin/utils/get-content-for-pin.md) - [features/pin/utils/pin-element](features/pin/utils/pin-element.md) - [features/pin/utils/styles](features/pin/utils/styles.md) - [features/spacing](features/spacing.md) @@ -58,6 +60,7 @@ - [utils/debounce](utils/debounce.md) - [utils/direction-of-element](utils/direction-of-element.md) - [utils/get-coords-pair-from-objects](utils/get-coords-pair-from-objects.md) +- [utils/get-options](utils/get-options.md) - [utils/id](utils/id.md) - [utils/intrinsic-coords](utils/intrinsic-coords.md) - [utils/node](utils/node.md) diff --git a/api/config/browser.md b/api/config/browser.md index 3b037fe..2dcb2f1 100644 --- a/api/config/browser.md +++ b/api/config/browser.md @@ -6,7 +6,7 @@ # config/browser -> Last updated 2024-08-23T11:58:26.653Z +> Last updated 2024-08-28T09:42:51.067Z Contains the helper functions to activate SPECCER via a script tag, based on attributes: diff --git a/api/features/a11y.md b/api/features/a11y.md index 2e27dd7..be5acb1 100644 --- a/api/features/a11y.md +++ b/api/features/a11y.md @@ -6,46 +6,10 @@ # features/a11y -> Last updated 2024-08-23T11:58:26.655Z +> Last updated 2024-08-28T09:42:51.069Z ## Functions -### create() - -```ts -function create(type?, content?, n?): HTMLElement; -``` - -Creates an HTML element based on the specified type. \* - -#### Parameters - -| Parameter | Type | Default value | Description | -| ---------- | --------- | ------------- | --------------------------------------------------- | -| `type`? | `string` | `'tabstops'` | Type of element ('tabstops', 'landmark', 'region'). | -| `content`? | `unknown` | `undefined` | Content to be added to the element. | -| `n`? | `string` | `'span'` | HTML tag name (default is 'span'). | - -#### Returns - -[`HTMLElement`](https://developer.mozilla.org/docs/Web/API/HTMLElement) - -The created HTML element. - -#### Example - -```ts -const tabElement = create('tabstops', null, 'div'); -const landmarkElement = create('landmark', 1, 'div'); -const regionElement = create('region', null, 'div'); -``` - -#### Defined in - -[features/a11y/index.ts:30](https://github.com/phun-ky/speccer/blob/main/src/features/a11y/index.ts#L30) - ---- - ### element() ```ts @@ -54,7 +18,7 @@ function element(targetEl, content?, type?): Promise; Adds an accessibility element to the document body based on the target element and type. -![Screenshot of speccer a11y tab stops in use](https://github.com/phun-ky/speccer/blob/main/public/a11y-tabstop.png?raw=true) +![Screenshot of speccer a11y tab stops in use](https://github.com/phun-ky/speccer/blob/main/public/speccer-a11y-tabstops-light.png?raw=true) ![Screenshot of speccer a11y landmark in use](https://github.com/phun-ky/speccer/blob/main/public/a11y-landmark.png?raw=true) #### Parameters @@ -83,7 +47,7 @@ if (targetElement) { #### Defined in -[features/a11y/index.ts:73](https://github.com/phun-ky/speccer/blob/main/src/features/a11y/index.ts#L73) +[features/a11y/index.ts:34](https://github.com/phun-ky/speccer/blob/main/src/features/a11y/index.ts#L34) --- @@ -107,7 +71,7 @@ init(); #### Defined in -[features/a11y/index.ts:168](https://github.com/phun-ky/speccer/blob/main/src/features/a11y/index.ts#L168) +[features/a11y/index.ts:129](https://github.com/phun-ky/speccer/blob/main/src/features/a11y/index.ts#L129) --- @@ -145,7 +109,7 @@ if (shortcutElement) { #### Defined in -[features/a11y/index.ts:116](https://github.com/phun-ky/speccer/blob/main/src/features/a11y/index.ts#L116) +[features/a11y/index.ts:77](https://github.com/phun-ky/speccer/blob/main/src/features/a11y/index.ts#L77) --- diff --git a/api/features/a11y/constants.md b/api/features/a11y/constants.md index 5881128..7e65e11 100644 --- a/api/features/a11y/constants.md +++ b/api/features/a11y/constants.md @@ -6,7 +6,7 @@ # features/a11y/constants -> Last updated 2024-08-23T11:58:26.656Z +> Last updated 2024-08-28T09:42:51.070Z ## Variables diff --git a/api/features/a11y/utils/create-a11y-element.md b/api/features/a11y/utils/create-a11y-element.md new file mode 100644 index 0000000..1e3455c --- /dev/null +++ b/api/features/a11y/utils/create-a11y-element.md @@ -0,0 +1,65 @@ +
+ SPECCER logo +
+ +[@phun-ky/speccer](../../../README.md) / features/a11y/utils/create-a11y-element + +# features/a11y/utils/create-a11y-element + +> Last updated 2024-08-28T09:42:51.071Z + +## Functions + +### createA11yElement() + +```ts +function createA11yElement(type?, content?, n?): HTMLElement; +``` + +Creates an HTML element based on the specified type. \* + +#### Parameters + +| Parameter | Type | Default value | Description | +| ---------- | --------- | ------------- | --------------------------------------------------- | +| `type`? | `string` | `'tabstops'` | Type of element ('tabstops', 'landmark', 'region'). | +| `content`? | `unknown` | `undefined` | Content to be added to the element. | +| `n`? | `string` | `'span'` | HTML tag name (default is 'span'). | + +#### Returns + +[`HTMLElement`](https://developer.mozilla.org/docs/Web/API/HTMLElement) + +The created HTML element. + +#### Example + +```ts +const tabElement = create('tabstops', null, 'div'); +const landmarkElement = create('landmark', 1, 'div'); +const regionElement = create('region', null, 'div'); +``` + +#### Defined in + +[features/a11y/utils/create-a11y-element.ts:18](https://github.com/phun-ky/speccer/blob/main/src/features/a11y/utils/create-a11y-element.ts#L18) + +--- + +**Contributing** + +Want to contribute? Please read the [CONTRIBUTING.md](https://github.com/phun-ky/speccer/blob/main/CONTRIBUTING.md) and [CODE_OF_CONDUCT.md](https://github.com/phun-ky/speccer/blob/main/CODE_OF_CONDUCT.md) + +**Sponsor me** + +I'm an Open Source evangelist, creating stuff that does not exist yet to help get rid of secondary activities and to enhance systems already in place, be it documentation or web sites. + +The sponsorship is an unique opportunity to alleviate more hours for me to maintain my projects, create new ones and contribute to the large community we're all part of :) + +[Support me on GitHub Sponsors](https://github.com/sponsors/phun-ky). + +![Speccer banner, with logo and slogan: A zero dependency package to highlight elements](https://github.com/phun-ky/speccer/blob/main/public/speccer-banner.png?raw=true) + +--- + +This project created by [Alexander Vassbotn Røyne-Helgesen](http://phun-ky.net) is licensed under a [MIT License](https://choosealicense.com/licenses/mit/). diff --git a/api/features/a11y/utils/styles.md b/api/features/a11y/utils/styles.md index 8f986a2..dc57040 100644 --- a/api/features/a11y/utils/styles.md +++ b/api/features/a11y/utils/styles.md @@ -6,7 +6,7 @@ # features/a11y/utils/styles -> Last updated 2024-08-23T11:58:26.657Z +> Last updated 2024-08-28T09:42:51.071Z ## Functions diff --git a/api/features/grid.md b/api/features/grid.md index 321291e..1d4d973 100644 --- a/api/features/grid.md +++ b/api/features/grid.md @@ -6,7 +6,7 @@ # features/grid -> Last updated 2024-08-23T11:58:26.658Z +> Last updated 2024-08-28T09:42:51.072Z ## Functions @@ -20,11 +20,11 @@ Creates a visual grid overlay for a given target element. #### Parameters -| Parameter | Type | Description | -| --------------- | ---------------------------------------------------------------------------------------------------------------- | -------------------------------------------------- | -| `targetElement` | [`HTMLElement`](https://developer.mozilla.org/docs/Web/API/HTMLElement) | The target element to create the grid overlay for. | -| `styles` | [`CSSStyleDeclaration`](https://developer.mozilla.org/docs/Web/API/CSSStyleDeclaration) | The computed styles of the target element. | -| `options` | [`Record`](https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type)\<`string`, `string`> | Options to determine what to draw | +| Parameter | Type | Description | +| --------------- | --------------------------------------------------------------------------------------- | -------------------------------------------------- | +| `targetElement` | [`HTMLElement`](https://developer.mozilla.org/docs/Web/API/HTMLElement) | The target element to create the grid overlay for. | +| `styles` | [`CSSStyleDeclaration`](https://developer.mozilla.org/docs/Web/API/CSSStyleDeclaration) | The computed styles of the target element. | +| `options` | [`SpeccerOptionsInterface`](../types/speccer.md#specceroptionsinterface) | Options to determine what to draw | #### Returns @@ -42,7 +42,7 @@ if (targetElement) { #### Defined in -[features/grid/index.ts:26](https://github.com/phun-ky/speccer/blob/main/src/features/grid/index.ts#L26) +[features/grid/index.ts:27](https://github.com/phun-ky/speccer/blob/main/src/features/grid/index.ts#L27) --- @@ -56,7 +56,7 @@ Create a visual overlay to present the column gaps for a grid container Adds a visual grid overlay to the target element if it has the appropriate data attribute and is a grid. -![grid](https://github.com/phun-ky/speccer/blob/main/public/grid.png?raw=true) +![grid](https://github.com/phun-ky/speccer/blob/main/public/speccer-grid-full-dark.png?raw=true) #### Parameters @@ -83,7 +83,7 @@ if (targetElement) { #### Defined in -[features/grid/index.ts:137](https://github.com/phun-ky/speccer/blob/main/src/features/grid/index.ts#L137) +[features/grid/index.ts:142](https://github.com/phun-ky/speccer/blob/main/src/features/grid/index.ts#L142) --- diff --git a/api/features/mark.md b/api/features/mark.md index da32f1f..7e520ff 100644 --- a/api/features/mark.md +++ b/api/features/mark.md @@ -6,7 +6,7 @@ # features/mark -> Last updated 2024-08-23T11:58:26.658Z +> Last updated 2024-08-28T09:42:51.072Z ## Functions @@ -39,7 +39,7 @@ document.body.appendChild(marker); #### Defined in -[features/mark/index.ts:21](https://github.com/phun-ky/speccer/blob/main/src/features/mark/index.ts#L21) +[features/mark/index.ts:22](https://github.com/phun-ky/speccer/blob/main/src/features/mark/index.ts#L22) --- @@ -74,7 +74,7 @@ element(targetElement); #### Defined in -[features/mark/index.ts:44](https://github.com/phun-ky/speccer/blob/main/src/features/mark/index.ts#L44) +[features/mark/index.ts:45](https://github.com/phun-ky/speccer/blob/main/src/features/mark/index.ts#L45) --- diff --git a/api/features/measure.md b/api/features/measure.md index fc9f572..9e158bd 100644 --- a/api/features/measure.md +++ b/api/features/measure.md @@ -6,25 +6,25 @@ # features/measure -> Last updated 2024-08-23T11:58:26.659Z +> Last updated 2024-08-28T09:42:51.073Z ## Functions ### create() ```ts -function create(text, area, tag): HTMLElement; +function create(text, options, tag): HTMLElement; ``` Create a measurement element with optional text, area, and element type. #### Parameters -| Parameter | Type | Default value | Description | -| --------- | -------------------- | ------------- | ----------------------------------- | -| `text` | `string` \| `number` | `''` | The text to display on the element. | -| `area` | `null` \| `string` | `''` | The area to specify with CSS class. | -| `tag` | `string` | `'span'` | The element type. | +| Parameter | Type | Default value | Description | +| --------- | ------------------------------------------------------------------------ | ------------- | ----------------------------------- | +| `text` | `string` \| `number` | `''` | The text to display on the element. | +| `options` | [`SpeccerOptionsInterface`](../types/speccer.md#specceroptionsinterface) | `undefined` | The options. | +| `tag` | `string` | `'span'` | The element type. | #### Returns @@ -41,7 +41,7 @@ document.body.appendChild(measurement); #### Defined in -[features/measure/index.ts:30](https://github.com/phun-ky/speccer/blob/main/src/features/measure/index.ts#L30) +[features/measure/index.ts:25](https://github.com/phun-ky/speccer/blob/main/src/features/measure/index.ts#L25) --- @@ -76,7 +76,7 @@ element(targetElement); #### Defined in -[features/measure/index.ts:59](https://github.com/phun-ky/speccer/blob/main/src/features/measure/index.ts#L59) +[features/measure/index.ts:62](https://github.com/phun-ky/speccer/blob/main/src/features/measure/index.ts#L62) --- diff --git a/api/features/pin.md b/api/features/pin.md index e68e8b1..a4d7dd0 100644 --- a/api/features/pin.md +++ b/api/features/pin.md @@ -6,7 +6,7 @@ # features/pin -> Last updated 2024-08-23T11:58:26.659Z +> Last updated 2024-08-28T09:42:51.073Z This feature highlights the anatomy of an element. @@ -75,7 +75,7 @@ pinElements(sectionElement); #### Defined in -[features/pin/index.ts:44](https://github.com/phun-ky/speccer/blob/main/src/features/pin/index.ts#L44) +[features/pin/index.ts:47](https://github.com/phun-ky/speccer/blob/main/src/features/pin/index.ts#L47) --- diff --git a/api/features/pin/utils/create-pin-element.md b/api/features/pin/utils/create-pin-element.md index 871c5e4..ed87b92 100644 --- a/api/features/pin/utils/create-pin-element.md +++ b/api/features/pin/utils/create-pin-element.md @@ -6,26 +6,26 @@ # features/pin/utils/create-pin-element -> Last updated 2024-08-23T11:58:26.660Z +> Last updated 2024-08-28T09:42:51.074Z ## Functions ### createPinElement() ```ts -function createPinElement(textContent, area, id, n): HTMLElement; +function createPinElement(content, options, id, n): HTMLElement; ``` -Create a pin element with optional text content, area description, and element type. +Create a pin element with optional content, area description, and element type. #### Parameters -| Parameter | Type | Default value | Description | -| ------------- | -------- | ------------- | --------------------------------------- | -| `textContent` | `string` | `''` | The text content to add to the element. | -| `area` | `string` | `undefined` | The area description for styling. | -| `id` | `string` | `''` | The id of the pinned element | -| `n` | `string` | `'span'` | The element type. | +| Parameter | Type | Default value | Description | +| --------- | ------------------------------------------------------------------------------ | ------------- | ---------------------------------- | +| `content` | `string` | `''` | The content to add to the element. | +| `options` | [`SpeccerOptionsInterface`](../../../types/speccer.md#specceroptionsinterface) | `undefined` | The option for styling. | +| `id` | `string` | `''` | The id of the pinned element | +| `n` | `string` | `'span'` | The element type. | #### Returns @@ -42,7 +42,7 @@ document.body.appendChild(pinElement); #### Defined in -[features/pin/utils/create-pin-element.ts:25](https://github.com/phun-ky/speccer/blob/main/src/features/pin/utils/create-pin-element.ts#L25) +[features/pin/utils/create-pin-element.ts:19](https://github.com/phun-ky/speccer/blob/main/src/features/pin/utils/create-pin-element.ts#L19) --- diff --git a/api/features/pin/utils/get-character-to-use.md b/api/features/pin/utils/get-character-to-use.md index 4af570a..7fa4843 100644 --- a/api/features/pin/utils/get-character-to-use.md +++ b/api/features/pin/utils/get-character-to-use.md @@ -6,7 +6,7 @@ # features/pin/utils/get-character-to-use -> Last updated 2024-08-23T11:58:26.660Z +> Last updated 2024-08-28T09:42:51.074Z ## Functions diff --git a/api/features/pin/utils/get-content-for-pin.md b/api/features/pin/utils/get-content-for-pin.md new file mode 100644 index 0000000..403fcbe --- /dev/null +++ b/api/features/pin/utils/get-content-for-pin.md @@ -0,0 +1,68 @@ +
+ SPECCER logo +
+ +[@phun-ky/speccer](../../../README.md) / features/pin/utils/get-content-for-pin + +# features/pin/utils/get-content-for-pin + +> Last updated 2024-08-28T09:42:51.074Z + +## Functions + +### getContentForPin() + +```ts +function getContentForPin(symbol, targetElement, options): string; +``` + +Generates the content for a pin element based on the provided symbol, target element, and options. + +#### Parameters + +| Parameter | Type | Description | +| --------------- | ------------------------------------------------------------------------------ | ---------------------------------------------------------------- | +| `symbol` | `string` | The default symbol to use if no text or description is provided. | +| `targetElement` | [`HTMLElement`](https://developer.mozilla.org/docs/Web/API/HTMLElement) | The HTML element for which the content is being generated. | +| `options` | [`SpeccerOptionsInterface`](../../../types/speccer.md#specceroptionsinterface) | The options that define how the content should be generated. | + +#### Returns + +`string` + +The generated content for the pin element. + +#### Example + +```ts +const symbol = '★'; +const targetElement = document.getElementById('myElement'); +const options = { pin: { text: true } }; +const content = getContentForPin(symbol, targetElement, options); +console.log(content); +// Output: 'Title Text' +``` + +#### Defined in + +[features/pin/utils/get-content-for-pin.ts:21](https://github.com/phun-ky/speccer/blob/main/src/features/pin/utils/get-content-for-pin.ts#L21) + +--- + +**Contributing** + +Want to contribute? Please read the [CONTRIBUTING.md](https://github.com/phun-ky/speccer/blob/main/CONTRIBUTING.md) and [CODE_OF_CONDUCT.md](https://github.com/phun-ky/speccer/blob/main/CODE_OF_CONDUCT.md) + +**Sponsor me** + +I'm an Open Source evangelist, creating stuff that does not exist yet to help get rid of secondary activities and to enhance systems already in place, be it documentation or web sites. + +The sponsorship is an unique opportunity to alleviate more hours for me to maintain my projects, create new ones and contribute to the large community we're all part of :) + +[Support me on GitHub Sponsors](https://github.com/sponsors/phun-ky). + +![Speccer banner, with logo and slogan: A zero dependency package to highlight elements](https://github.com/phun-ky/speccer/blob/main/public/speccer-banner.png?raw=true) + +--- + +This project created by [Alexander Vassbotn Røyne-Helgesen](http://phun-ky.net) is licensed under a [MIT License](https://choosealicense.com/licenses/mit/). diff --git a/api/features/pin/utils/pin-element.md b/api/features/pin/utils/pin-element.md index 1ec6e96..94b0fd4 100644 --- a/api/features/pin/utils/pin-element.md +++ b/api/features/pin/utils/pin-element.md @@ -6,7 +6,7 @@ # features/pin/utils/pin-element -> Last updated 2024-08-23T11:58:26.660Z +> Last updated 2024-08-28T09:42:51.074Z ## Functions @@ -15,9 +15,9 @@ ```ts function pinElement( targetElement, - symbol, parentElement, - areas? + content, + options ): Promise; ``` @@ -28,12 +28,12 @@ of the target element. It handles different styles, such as curly brackets or li #### Parameters -| Parameter | Type | Default value | Description | -| --------------- | ----------------------------------------------------------------------- | ------------- | ---------------------------------------------------------------------------------- | -| `targetElement` | [`HTMLElement`](https://developer.mozilla.org/docs/Web/API/HTMLElement) | `undefined` | The target element that contains the pin data. | -| `symbol` | `string` | `undefined` | The symbol to use. | -| `parentElement` | [`HTMLElement`](https://developer.mozilla.org/docs/Web/API/HTMLElement) | `undefined` | The parent element | -| `areas`? | `string` | `''` | Optional areas to use if not \[data-speccer] is set as an attribute on the element | +| Parameter | Type | Description | +| --------------- | ------------------------------------------------------------------------------ | ---------------------------------------------- | +| `targetElement` | [`HTMLElement`](https://developer.mozilla.org/docs/Web/API/HTMLElement) | The target element that contains the pin data. | +| `parentElement` | [`HTMLElement`](https://developer.mozilla.org/docs/Web/API/HTMLElement) | The parent element | +| `content` | `string` | The content to use. | +| `options` | [`SpeccerOptionsInterface`](../../../types/speccer.md#specceroptionsinterface) | options | #### Returns @@ -45,15 +45,17 @@ A promise that resolves to the id of the pin element when the process is complet ```ts const targetElement = document.getElementById('target'); -const symbol = 0; -pinElement(targetElement, symbol).then(() => { +const parentElement = document.getElementById('parent'); +const content = 0; +const options = { … }; +pinElement(targetElement, parentElement, content, options).then(() => { console.log('process completed'); }); ``` #### Defined in -[features/pin/utils/pin-element.ts:41](https://github.com/phun-ky/speccer/blob/main/src/features/pin/utils/pin-element.ts#L41) +[features/pin/utils/pin-element.ts:34](https://github.com/phun-ky/speccer/blob/main/src/features/pin/utils/pin-element.ts#L34) --- diff --git a/api/features/pin/utils/styles.md b/api/features/pin/utils/styles.md index aee7fdc..2fff6a6 100644 --- a/api/features/pin/utils/styles.md +++ b/api/features/pin/utils/styles.md @@ -6,7 +6,7 @@ # features/pin/utils/styles -> Last updated 2024-08-23T11:58:26.660Z +> Last updated 2024-08-28T09:42:51.075Z ## Functions @@ -14,11 +14,10 @@ ```ts function styles( - area, targetElement, pinElement, parentElement, - options? + options ): Promise; ``` @@ -26,13 +25,12 @@ Get styles for pin elements based on the specified area and options. #### Parameters -| Parameter | Type | Description | -| --------------- | ----------------------------------------------------------------------- | ------------------------ | -| `area` | `string` | The area description. | -| `targetElement` | [`HTMLElement`](https://developer.mozilla.org/docs/Web/API/HTMLElement) | The target element. | -| `pinElement` | [`HTMLElement`](https://developer.mozilla.org/docs/Web/API/HTMLElement) | The pin element. | -| `parentElement` | [`HTMLElement`](https://developer.mozilla.org/docs/Web/API/HTMLElement) | The parent element. | -| `options`? | [`PinStylesOptionsType`](../../../types/bezier.md#pinstylesoptionstype) | Optional styles options. | +| Parameter | Type | Description | +| --------------- | ------------------------------------------------------------------------------ | ------------------- | +| `targetElement` | [`HTMLElement`](https://developer.mozilla.org/docs/Web/API/HTMLElement) | The target element. | +| `pinElement` | [`HTMLElement`](https://developer.mozilla.org/docs/Web/API/HTMLElement) | The pin element. | +| `parentElement` | [`HTMLElement`](https://developer.mozilla.org/docs/Web/API/HTMLElement) | The parent element. | +| `options` | [`SpeccerOptionsInterface`](../../../types/speccer.md#specceroptionsinterface) | The options. | #### Returns @@ -47,7 +45,7 @@ const area = 'top-left'; const targetElement = document.getElementById('target'); const parentElement = document.getElementById('parent'); const pinElement = document.getElementById('pin'); -const options = { isCurly: true }; +const options = { useCurlyBrackets: true }; const styles = await styles( area, targetElement, @@ -60,7 +58,7 @@ console.log(styles); #### Defined in -[features/pin/utils/styles.ts:37](https://github.com/phun-ky/speccer/blob/main/src/features/pin/utils/styles.ts#L37) +[features/pin/utils/styles.ts:28](https://github.com/phun-ky/speccer/blob/main/src/features/pin/utils/styles.ts#L28) --- diff --git a/api/features/spacing.md b/api/features/spacing.md index d7a63fe..2e1f7c3 100644 --- a/api/features/spacing.md +++ b/api/features/spacing.md @@ -6,7 +6,7 @@ # features/spacing -> Last updated 2024-08-23T11:58:26.661Z +> Last updated 2024-08-28T09:42:51.075Z ## Functions diff --git a/api/features/spacing/utils/position.md b/api/features/spacing/utils/position.md index 3fc9b47..a459d94 100644 --- a/api/features/spacing/utils/position.md +++ b/api/features/spacing/utils/position.md @@ -6,7 +6,7 @@ # features/spacing/utils/position -> Last updated 2024-08-23T11:58:26.661Z +> Last updated 2024-08-28T09:42:51.075Z ## Functions diff --git a/api/features/typography.md b/api/features/typography.md index c9348a4..1747cb1 100644 --- a/api/features/typography.md +++ b/api/features/typography.md @@ -6,24 +6,24 @@ # features/typography -> Last updated 2024-08-23T11:58:26.661Z +> Last updated 2024-08-28T09:42:51.075Z ## Functions ### create() ```ts -function create(html, area): HTMLElement; +function create(html, options): HTMLElement; ``` Create a DOM element with provided HTML and optional CSS class names. #### Parameters -| Parameter | Type | Description | -| --------- | ------------------ | -------------------------------------------------- | -| `html` | `string` | The HTML content to be set in the created element. | -| `area` | `null` \| `string` | The optional CSS class names to add. | +| Parameter | Type | Description | +| --------- | ------------------------------------------------------------------------ | -------------------------------------------------- | +| `html` | `string` | The HTML content to be set in the created element. | +| `options` | [`SpeccerOptionsInterface`](../types/speccer.md#specceroptionsinterface) | Options. | #### Returns @@ -79,7 +79,7 @@ if (targetElement) { #### Defined in -[features/typography/index.ts:63](https://github.com/phun-ky/speccer/blob/main/src/features/typography/index.ts#L63) +[features/typography/index.ts:62](https://github.com/phun-ky/speccer/blob/main/src/features/typography/index.ts#L62) --- diff --git a/api/features/typography/utils/position.md b/api/features/typography/utils/position.md index 7a29935..339d921 100644 --- a/api/features/typography/utils/position.md +++ b/api/features/typography/utils/position.md @@ -6,7 +6,7 @@ # features/typography/utils/position -> Last updated 2024-08-23T11:58:26.661Z +> Last updated 2024-08-28T09:42:51.076Z ## Functions @@ -14,7 +14,7 @@ ```ts function position( - area, + options, targetElement, speccerElement ): Promise<{ @@ -27,11 +27,11 @@ Calculate the position for the speccer element relative to the target element. #### Parameters -| Parameter | Type | Description | -| ---------------- | ----------------------------------------------------------------------- | ------------------------------------- | -| `area` | `null` \| `string` | The area information for positioning. | -| `targetElement` | [`HTMLElement`](https://developer.mozilla.org/docs/Web/API/HTMLElement) | The target element. | -| `speccerElement` | [`HTMLElement`](https://developer.mozilla.org/docs/Web/API/HTMLElement) | The speccer element to position. | +| Parameter | Type | Description | +| ---------------- | ------------------------------------------------------------------------------ | -------------------------------- | +| `options` | [`SpeccerOptionsInterface`](../../../types/speccer.md#specceroptionsinterface) | Options. | +| `targetElement` | [`HTMLElement`](https://developer.mozilla.org/docs/Web/API/HTMLElement) | The target element. | +| `speccerElement` | [`HTMLElement`](https://developer.mozilla.org/docs/Web/API/HTMLElement) | The speccer element to position. | #### Returns @@ -44,22 +44,22 @@ Calculate the position for the speccer element relative to the target element. | Name | Type | Defined in | | ------ | -------- | -------------------------------------------------------------------------------------------------------------------------------------- | -| `left` | `string` | [features/typography/utils/position.ts:31](https://github.com/phun-ky/speccer/blob/main/src/features/typography/utils/position.ts#L31) | -| `top` | `string` | [features/typography/utils/position.ts:31](https://github.com/phun-ky/speccer/blob/main/src/features/typography/utils/position.ts#L31) | +| `left` | `string` | [features/typography/utils/position.ts:32](https://github.com/phun-ky/speccer/blob/main/src/features/typography/utils/position.ts#L32) | +| `top` | `string` | [features/typography/utils/position.ts:32](https://github.com/phun-ky/speccer/blob/main/src/features/typography/utils/position.ts#L32) | #### Example ```ts const targetElement = document.getElementById('target'); const speccerElement = document.getElementById('speccer'); -const area = 'top'; -const position = await position(area, targetElement, speccerElement); +const options = {…}; +const position = await position(options, targetElement, speccerElement); console.log(position); // { left: '10px', top: '20px' } ``` #### Defined in -[features/typography/utils/position.ts:27](https://github.com/phun-ky/speccer/blob/main/src/features/typography/utils/position.ts#L27) +[features/typography/utils/position.ts:28](https://github.com/phun-ky/speccer/blob/main/src/features/typography/utils/position.ts#L28) --- diff --git a/api/features/typography/utils/template.md b/api/features/typography/utils/template.md index d8711dc..3917ad4 100644 --- a/api/features/typography/utils/template.md +++ b/api/features/typography/utils/template.md @@ -6,7 +6,7 @@ # features/typography/utils/template -> Last updated 2024-08-23T11:58:26.662Z +> Last updated 2024-08-28T09:42:51.076Z ## Functions diff --git a/api/main.md b/api/main.md index e73234a..2d17424 100644 --- a/api/main.md +++ b/api/main.md @@ -6,7 +6,7 @@ # main -> Last updated 2024-08-23T11:58:26.663Z +> Last updated 2024-08-28T09:42:51.076Z ## Table of Contents @@ -205,7 +205,7 @@ const measure: { -(`text`, `area`, `tag`) => [`HTMLElement`](https://developer.mozilla.org/docs/Web/API/HTMLElement) +(`text`, `options`, `tag`) => [`HTMLElement`](https://developer.mozilla.org/docs/Web/API/HTMLElement) @@ -348,12 +348,12 @@ const modes: { ```ts const pin: { - createPinElement: (textContent, area, id, n) => HTMLElement; + createPinElement: (content, options, id, n) => HTMLElement; pinElement: ( targetElement, - symbol, parentElement, - areas? + content, + options ) => Promise; pinElements: (sectionElement) => Promise; }; @@ -375,7 +375,7 @@ const pin: { -(`textContent`, `area`, `id`, `n`) => [`HTMLElement`](https://developer.mozilla.org/docs/Web/API/HTMLElement) +(`content`, `options`, `id`, `n`) => [`HTMLElement`](https://developer.mozilla.org/docs/Web/API/HTMLElement) @@ -392,7 +392,7 @@ const pin: { -(`targetElement`, `symbol`, `parentElement`, `areas`?) => [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`string` | `void`> +(`targetElement`, `parentElement`, `content`, `options`) => [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`string` | `void`> @@ -522,7 +522,7 @@ const typography: { -(`html`, `area`) => [`HTMLElement`](https://developer.mozilla.org/docs/Web/API/HTMLElement) +(`html`, `options`) => [`HTMLElement`](https://developer.mozilla.org/docs/Web/API/HTMLElement) diff --git a/api/types/bezier.md b/api/types/bezier.md index 16d99e8..87bb928 100644 --- a/api/types/bezier.md +++ b/api/types/bezier.md @@ -6,7 +6,7 @@ # types/bezier -> Last updated 2024-08-23T11:58:26.664Z +> Last updated 2024-08-28T09:42:51.078Z ## Type Aliases @@ -48,7 +48,7 @@ The first position. -[types/bezier.ts:46](https://github.com/phun-ky/speccer/blob/main/src/types/bezier.ts#L46) +[types/bezier.ts:33](https://github.com/phun-ky/speccer/blob/main/src/types/bezier.ts#L33) @@ -70,7 +70,7 @@ The second position. -[types/bezier.ts:51](https://github.com/phun-ky/speccer/blob/main/src/types/bezier.ts#L51) +[types/bezier.ts:38](https://github.com/phun-ky/speccer/blob/main/src/types/bezier.ts#L38) @@ -78,7 +78,7 @@ The second position. #### Defined in -[types/bezier.ts:42](https://github.com/phun-ky/speccer/blob/main/src/types/bezier.ts#L42) +[types/bezier.ts:29](https://github.com/phun-ky/speccer/blob/main/src/types/bezier.ts#L29) --- @@ -122,7 +122,7 @@ The x-coordinate of the first point. -[types/bezier.ts:61](https://github.com/phun-ky/speccer/blob/main/src/types/bezier.ts#L61) +[types/bezier.ts:48](https://github.com/phun-ky/speccer/blob/main/src/types/bezier.ts#L48) @@ -144,7 +144,7 @@ The x-coordinate of the second point. -[types/bezier.ts:66](https://github.com/phun-ky/speccer/blob/main/src/types/bezier.ts#L66) +[types/bezier.ts:53](https://github.com/phun-ky/speccer/blob/main/src/types/bezier.ts#L53) @@ -166,7 +166,7 @@ The y-coordinate of the first point. -[types/bezier.ts:71](https://github.com/phun-ky/speccer/blob/main/src/types/bezier.ts#L71) +[types/bezier.ts:58](https://github.com/phun-ky/speccer/blob/main/src/types/bezier.ts#L58) @@ -188,7 +188,7 @@ The y-coordinate of the second point. -[types/bezier.ts:76](https://github.com/phun-ky/speccer/blob/main/src/types/bezier.ts#L76) +[types/bezier.ts:63](https://github.com/phun-ky/speccer/blob/main/src/types/bezier.ts#L63) @@ -196,7 +196,7 @@ The y-coordinate of the second point. #### Defined in -[types/bezier.ts:57](https://github.com/phun-ky/speccer/blob/main/src/types/bezier.ts#L57) +[types/bezier.ts:44](https://github.com/phun-ky/speccer/blob/main/src/types/bezier.ts#L44) --- @@ -239,7 +239,7 @@ Indicates whether the curve is direct. -[types/bezier.ts:86](https://github.com/phun-ky/speccer/blob/main/src/types/bezier.ts#L86) +[types/bezier.ts:73](https://github.com/phun-ky/speccer/blob/main/src/types/bezier.ts#L73) @@ -261,7 +261,7 @@ The direction of the curve. -[types/bezier.ts:96](https://github.com/phun-ky/speccer/blob/main/src/types/bezier.ts#L96) +[types/bezier.ts:83](https://github.com/phun-ky/speccer/blob/main/src/types/bezier.ts#L83) @@ -283,7 +283,7 @@ Indicates if this is the first set of coordinates. -[types/bezier.ts:91](https://github.com/phun-ky/speccer/blob/main/src/types/bezier.ts#L91) +[types/bezier.ts:78](https://github.com/phun-ky/speccer/blob/main/src/types/bezier.ts#L78) @@ -291,7 +291,7 @@ Indicates if this is the first set of coordinates. #### Defined in -[types/bezier.ts:82](https://github.com/phun-ky/speccer/blob/main/src/types/bezier.ts#L82) +[types/bezier.ts:69](https://github.com/phun-ky/speccer/blob/main/src/types/bezier.ts#L69) --- @@ -335,7 +335,7 @@ The direction of the path. -[types/bezier.ts:36](https://github.com/phun-ky/speccer/blob/main/src/types/bezier.ts#L36) +[types/bezier.ts:23](https://github.com/phun-ky/speccer/blob/main/src/types/bezier.ts#L23) @@ -357,7 +357,7 @@ Indicates if this is the first part of the curly bracket or not. -[types/bezier.ts:31](https://github.com/phun-ky/speccer/blob/main/src/types/bezier.ts#L31) +[types/bezier.ts:18](https://github.com/phun-ky/speccer/blob/main/src/types/bezier.ts#L18) @@ -379,7 +379,7 @@ The first position. -[types/bezier.ts:21](https://github.com/phun-ky/speccer/blob/main/src/types/bezier.ts#L21) +[types/bezier.ts:8](https://github.com/phun-ky/speccer/blob/main/src/types/bezier.ts#L8) @@ -401,7 +401,7 @@ The second position. -[types/bezier.ts:26](https://github.com/phun-ky/speccer/blob/main/src/types/bezier.ts#L26) +[types/bezier.ts:13](https://github.com/phun-ky/speccer/blob/main/src/types/bezier.ts#L13) @@ -409,23 +409,7 @@ The second position. #### Defined in -[types/bezier.ts:17](https://github.com/phun-ky/speccer/blob/main/src/types/bezier.ts#L17) - ---- - -### PinStylesOptionsType - -```ts -type PinStylesOptionsType: Record | { - isCurly: boolean; -}; -``` - -Options for pin styles. - -#### Defined in - -[types/bezier.ts:5](https://github.com/phun-ky/speccer/blob/main/src/types/bezier.ts#L5) +[types/bezier.ts:4](https://github.com/phun-ky/speccer/blob/main/src/types/bezier.ts#L4) --- diff --git a/api/types/css.md b/api/types/css.md index 09632dd..a956806 100644 --- a/api/types/css.md +++ b/api/types/css.md @@ -6,7 +6,7 @@ # types/css -> Last updated 2024-08-23T11:58:26.664Z +> Last updated 2024-08-28T09:42:51.078Z ## Type Aliases diff --git a/api/types/debounce.md b/api/types/debounce.md index 6eaf1b2..de2f2a0 100644 --- a/api/types/debounce.md +++ b/api/types/debounce.md @@ -6,7 +6,7 @@ # types/debounce -> Last updated 2024-08-23T11:58:26.665Z +> Last updated 2024-08-28T09:42:51.079Z ## Type Aliases diff --git a/api/types/enums/area.md b/api/types/enums/area.md index 57001eb..04940a7 100644 --- a/api/types/enums/area.md +++ b/api/types/enums/area.md @@ -6,7 +6,7 @@ # types/enums/area -> Last updated 2024-08-23T11:58:26.665Z +> Last updated 2024-08-28T09:42:51.079Z ## Enumerations @@ -18,7 +18,7 @@ Enum representing different grid areas. | Enumeration Member | Value | Defined in | | ------------------ | -------- | -------------------------------------------------------------------------------------------------- | -| `Grid` | `"grid"` | [types/enums/area.ts:75](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L75) | +| `Grid` | `"grid"` | [types/enums/area.ts:76](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L76) | --- @@ -30,7 +30,7 @@ Enum representing different mark areas. | Enumeration Member | Value | Defined in | | ------------------ | -------- | -------------------------------------------------------------------------------------------------- | -| `Mark` | `"mark"` | [types/enums/area.ts:68](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L68) | +| `Mark` | `"mark"` | [types/enums/area.ts:69](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L69) | --- @@ -42,14 +42,14 @@ Enum representing different measurement areas. | Enumeration Member | Value | Defined in | | ------------------ | ----------- | -------------------------------------------------------------------------------------------------- | -| `Bottom` | `"bottom"` | [types/enums/area.ts:41](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L41) | -| `Height` | `"height"` | [types/enums/area.ts:38](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L38) | -| `Left` | `"left"` | [types/enums/area.ts:39](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L39) | -| `Measure` | `"measure"` | [types/enums/area.ts:35](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L35) | -| `Right` | `"right"` | [types/enums/area.ts:40](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L40) | -| `Slim` | `"slim"` | [types/enums/area.ts:36](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L36) | -| `Top` | `"top"` | [types/enums/area.ts:42](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L42) | -| `Width` | `"width"` | [types/enums/area.ts:37](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L37) | +| `Bottom` | `"bottom"` | [types/enums/area.ts:42](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L42) | +| `Height` | `"height"` | [types/enums/area.ts:39](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L39) | +| `Left` | `"left"` | [types/enums/area.ts:40](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L40) | +| `Measure` | `"measure"` | [types/enums/area.ts:36](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L36) | +| `Right` | `"right"` | [types/enums/area.ts:41](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L41) | +| `Slim` | `"slim"` | [types/enums/area.ts:37](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L37) | +| `Top` | `"top"` | [types/enums/area.ts:43](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L43) | +| `Width` | `"width"` | [types/enums/area.ts:38](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L38) | --- @@ -61,17 +61,18 @@ Enum representing different areas for the pin feature. | Enumeration Member | Value | Defined in | | ------------------ | ----------- | -------------------------------------------------------------------------------------------------- | -| `Bottom` | `"bottom"` | [types/enums/area.ts:25](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L25) | -| `Bracket` | `"bracket"` | [types/enums/area.ts:22](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L22) | -| `Curly` | `"curly"` | [types/enums/area.ts:28](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L28) | -| `Enclose` | `"enclose"` | [types/enums/area.ts:20](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L20) | -| `Left` | `"left"` | [types/enums/area.ts:23](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L23) | +| `Bottom` | `"bottom"` | [types/enums/area.ts:26](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L26) | +| `Bracket` | `"bracket"` | [types/enums/area.ts:23](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L23) | +| `Curly` | `"curly"` | [types/enums/area.ts:29](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L29) | +| `Enclose` | `"enclose"` | [types/enums/area.ts:21](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L21) | +| `Left` | `"left"` | [types/enums/area.ts:24](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L24) | | `Parent` | `"parent"` | [types/enums/area.ts:19](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L19) | | `Pin` | `"pin"` | [types/enums/area.ts:18](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L18) | -| `Right` | `"right"` | [types/enums/area.ts:24](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L24) | -| `SVG` | `"svg"` | [types/enums/area.ts:27](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L27) | -| `Subtle` | `"subtle"` | [types/enums/area.ts:21](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L21) | -| `Top` | `"top"` | [types/enums/area.ts:26](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L26) | +| `Right` | `"right"` | [types/enums/area.ts:25](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L25) | +| `SVG` | `"svg"` | [types/enums/area.ts:28](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L28) | +| `Subtle` | `"subtle"` | [types/enums/area.ts:22](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L22) | +| `Text` | `"text"` | [types/enums/area.ts:20](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L20) | +| `Top` | `"top"` | [types/enums/area.ts:27](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L27) | --- @@ -83,7 +84,7 @@ Enum representing different spacing areas. | Enumeration Member | Value | Defined in | | ------------------ | ----------- | -------------------------------------------------------------------------------------------------- | -| `Spacing` | `"spacing"` | [types/enums/area.ts:61](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L61) | +| `Spacing` | `"spacing"` | [types/enums/area.ts:62](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L62) | --- @@ -111,12 +112,12 @@ Enum representing different typography areas. | Enumeration Member | Value | Defined in | | ------------------ | -------------- | -------------------------------------------------------------------------------------------------- | -| `Bottom` | `"bottom"` | [types/enums/area.ts:53](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L53) | -| `Left` | `"left"` | [types/enums/area.ts:51](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L51) | -| `Right` | `"right"` | [types/enums/area.ts:52](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L52) | -| `Syntax` | `"syntax"` | [types/enums/area.ts:50](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L50) | -| `Top` | `"top"` | [types/enums/area.ts:54](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L54) | -| `Typography` | `"typography"` | [types/enums/area.ts:49](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L49) | +| `Bottom` | `"bottom"` | [types/enums/area.ts:54](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L54) | +| `Left` | `"left"` | [types/enums/area.ts:52](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L52) | +| `Right` | `"right"` | [types/enums/area.ts:53](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L53) | +| `Syntax` | `"syntax"` | [types/enums/area.ts:51](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L51) | +| `Top` | `"top"` | [types/enums/area.ts:55](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L55) | +| `Typography` | `"typography"` | [types/enums/area.ts:50](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L50) | --- diff --git a/api/types/interfaces/attributes.md b/api/types/interfaces/attributes.md index 7c8924f..93ef0c9 100644 --- a/api/types/interfaces/attributes.md +++ b/api/types/interfaces/attributes.md @@ -6,7 +6,7 @@ # types/interfaces/attributes -> Last updated 2024-08-23T11:58:26.666Z +> Last updated 2024-08-28T09:42:51.080Z ## Interfaces diff --git a/api/types/interfaces/classnames.md b/api/types/interfaces/classnames.md index 177a101..2145819 100644 --- a/api/types/interfaces/classnames.md +++ b/api/types/interfaces/classnames.md @@ -6,7 +6,7 @@ # types/interfaces/classnames -> Last updated 2024-08-23T11:58:26.666Z +> Last updated 2024-08-28T09:42:51.080Z ## Type Aliases diff --git a/api/types/interfaces/global.md b/api/types/interfaces/global.md index e39e0d6..641ac1e 100644 --- a/api/types/interfaces/global.md +++ b/api/types/interfaces/global.md @@ -6,7 +6,7 @@ # types/interfaces/global -> Last updated 2024-08-23T11:58:26.666Z +> Last updated 2024-08-28T09:42:51.080Z ## Interfaces diff --git a/api/types/interfaces/position.md b/api/types/interfaces/position.md index e2b7a87..fe279f1 100644 --- a/api/types/interfaces/position.md +++ b/api/types/interfaces/position.md @@ -6,7 +6,7 @@ # types/interfaces/position -> Last updated 2024-08-23T11:58:26.667Z +> Last updated 2024-08-28T09:42:51.080Z ## Interfaces diff --git a/api/types/position.md b/api/types/position.md index 75e279c..6b9d96f 100644 --- a/api/types/position.md +++ b/api/types/position.md @@ -6,7 +6,7 @@ # types/position -> Last updated 2024-08-23T11:58:26.667Z +> Last updated 2024-08-28T09:42:51.081Z ## Type Aliases diff --git a/api/types/speccer.md b/api/types/speccer.md index c5a2e2e..27129bf 100644 --- a/api/types/speccer.md +++ b/api/types/speccer.md @@ -6,10 +6,65 @@ # types/speccer -> Last updated 2024-08-23T11:58:26.667Z +> Last updated 2024-08-28T09:42:51.081Z + +## Table of Contents + +- [Interfaces](#interfaces) + - [SpeccerOptionsInterface](#specceroptionsinterface) +- [Type Aliases](#type-aliases) + - [SpeccerFeatureType](#speccerfeaturetype) + - [SpeccerFunctionType()](#speccerfunctiontype) + - [SpeccerPositionType](#speccerpositiontype) + +## Interfaces + +### SpeccerOptionsInterface + +#### Properties + +| Property | Type | Defined in | +| ---------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `grid?` | \{ `toggle`: `string`; } | [types/speccer.ts:34](https://github.com/phun-ky/speccer/blob/main/src/types/speccer.ts#L34) | +| `grid.toggle` | `string` | [types/speccer.ts:35](https://github.com/phun-ky/speccer/blob/main/src/types/speccer.ts#L35) | +| `measure?` | \{ `height`: `boolean`; `slim`: `boolean`; `width`: `boolean`; } | [types/speccer.ts:26](https://github.com/phun-ky/speccer/blob/main/src/types/speccer.ts#L26) | +| `measure.height` | `boolean` | [types/speccer.ts:28](https://github.com/phun-ky/speccer/blob/main/src/types/speccer.ts#L28) | +| `measure.slim` | `boolean` | [types/speccer.ts:27](https://github.com/phun-ky/speccer/blob/main/src/types/speccer.ts#L27) | +| `measure.width` | `boolean` | [types/speccer.ts:29](https://github.com/phun-ky/speccer/blob/main/src/types/speccer.ts#L29) | +| `pin?` | \{ `bracket`: `boolean`; `enclose`: `boolean`; `parent`: `boolean`; `subtle`: `boolean`; `text`: `boolean`; `useCurlyBrackets`: `boolean`; `useSVGLine`: `boolean`; } | [types/speccer.ts:17](https://github.com/phun-ky/speccer/blob/main/src/types/speccer.ts#L17) | +| `pin.bracket` | `boolean` | [types/speccer.ts:18](https://github.com/phun-ky/speccer/blob/main/src/types/speccer.ts#L18) | +| `pin.enclose` | `boolean` | [types/speccer.ts:19](https://github.com/phun-ky/speccer/blob/main/src/types/speccer.ts#L19) | +| `pin.parent` | `boolean` | [types/speccer.ts:21](https://github.com/phun-ky/speccer/blob/main/src/types/speccer.ts#L21) | +| `pin.subtle` | `boolean` | [types/speccer.ts:20](https://github.com/phun-ky/speccer/blob/main/src/types/speccer.ts#L20) | +| `pin.text` | `boolean` | [types/speccer.ts:22](https://github.com/phun-ky/speccer/blob/main/src/types/speccer.ts#L22) | +| `pin.useCurlyBrackets` | `boolean` | [types/speccer.ts:24](https://github.com/phun-ky/speccer/blob/main/src/types/speccer.ts#L24) | +| `pin.useSVGLine` | `boolean` | [types/speccer.ts:23](https://github.com/phun-ky/speccer/blob/main/src/types/speccer.ts#L23) | +| `position` | [`SpeccerPositionType`](speccer.md#speccerpositiontype) | [types/speccer.ts:15](https://github.com/phun-ky/speccer/blob/main/src/types/speccer.ts#L15) | +| `slug` | `string` | [types/speccer.ts:14](https://github.com/phun-ky/speccer/blob/main/src/types/speccer.ts#L14) | +| `type` | [`SpeccerFeatureType`](speccer.md#speccerfeaturetype) | [types/speccer.ts:16](https://github.com/phun-ky/speccer/blob/main/src/types/speccer.ts#L16) | +| `typography?` | \{ `useSyntaxHighlighting`: `boolean`; } | [types/speccer.ts:31](https://github.com/phun-ky/speccer/blob/main/src/types/speccer.ts#L31) | +| `typography.useSyntaxHighlighting` | `boolean` | [types/speccer.ts:32](https://github.com/phun-ky/speccer/blob/main/src/types/speccer.ts#L32) | ## Type Aliases +### SpeccerFeatureType + +```ts +type SpeccerFeatureType: + | "pin" + | "grid" + | "mark" + | "typography" + | "measure" + | "spacing"; +``` + +#### Defined in + +[types/speccer.ts:3](https://github.com/phun-ky/speccer/blob/main/src/types/speccer.ts#L3) + +--- + ### SpeccerFunctionType() ```ts @@ -26,6 +81,18 @@ type SpeccerFunctionType: () => void; --- +### SpeccerPositionType + +```ts +type SpeccerPositionType: "top" | "left" | "right" | "bottom"; +``` + +#### Defined in + +[types/speccer.ts:11](https://github.com/phun-ky/speccer/blob/main/src/types/speccer.ts#L11) + +--- + **Contributing** Want to contribute? Please read the [CONTRIBUTING.md](https://github.com/phun-ky/speccer/blob/main/CONTRIBUTING.md) and [CODE_OF_CONDUCT.md](https://github.com/phun-ky/speccer/blob/main/CODE_OF_CONDUCT.md) diff --git a/api/types/styles.md b/api/types/styles.md index 531cc3e..2d22b6d 100644 --- a/api/types/styles.md +++ b/api/types/styles.md @@ -6,7 +6,7 @@ # types/styles -> Last updated 2024-08-23T11:58:26.667Z +> Last updated 2024-08-28T09:42:51.082Z ## Type Aliases diff --git a/api/types/xy.md b/api/types/xy.md index 1f64426..1f9f64d 100644 --- a/api/types/xy.md +++ b/api/types/xy.md @@ -6,7 +6,7 @@ # types/xy -> Last updated 2024-08-23T11:58:26.667Z +> Last updated 2024-08-28T09:42:51.082Z ## Interfaces diff --git a/api/utils/angle.md b/api/utils/angle.md index fc16ccc..14dfb0d 100644 --- a/api/utils/angle.md +++ b/api/utils/angle.md @@ -6,7 +6,7 @@ # utils/angle -> Last updated 2024-08-23T11:58:26.668Z +> Last updated 2024-08-28T09:42:51.082Z ## Functions diff --git a/api/utils/area.md b/api/utils/area.md index b9f2533..f7d9386 100644 --- a/api/utils/area.md +++ b/api/utils/area.md @@ -6,7 +6,7 @@ # utils/area -> Last updated 2024-08-23T11:58:26.668Z +> Last updated 2024-08-28T09:42:51.082Z ## Functions @@ -117,7 +117,7 @@ boolean `true` if both 'curly' and 'bracket' are present, otherwise `false`. #### Defined in -[utils/area.ts:185](https://github.com/phun-ky/speccer/blob/main/src/utils/area.ts#L185) +[utils/area.ts:220](https://github.com/phun-ky/speccer/blob/main/src/utils/area.ts#L220) --- @@ -169,7 +169,7 @@ boolean `true` if 'height' is present, otherwise `false`. #### Defined in -[utils/area.ts:143](https://github.com/phun-ky/speccer/blob/main/src/utils/area.ts#L143) +[utils/area.ts:157](https://github.com/phun-ky/speccer/blob/main/src/utils/area.ts#L157) --- @@ -251,6 +251,32 @@ boolean `true` if 'right' is present, otherwise `false`. --- +### isSlimArea() + +```ts +function isSlimArea(areaString): boolean; +``` + +Checks if 'slim' area is present in the provided areaString. + +#### Parameters + +| Parameter | Type | Description | +| ------------ | ------------------ | ---------------------------- | +| `areaString` | `null` \| `string` | The string containing areas. | + +#### Returns + +`boolean` + +boolean `true` if 'slim' is present, otherwise `false`. + +#### Defined in + +[utils/area.ts:171](https://github.com/phun-ky/speccer/blob/main/src/utils/area.ts#L171) + +--- + ### isSubtle() ```ts @@ -277,6 +303,32 @@ boolean `true` if 'subtle' is present, otherwise `false`. --- +### isTextArea() + +```ts +function isTextArea(areaString): boolean; +``` + +Checks if 'text' area is present in the provided areaString. + +#### Parameters + +| Parameter | Type | Description | +| ------------ | ------------------ | ---------------------------- | +| `areaString` | `null` \| `string` | The string containing areas. | + +#### Returns + +`boolean` + +boolean `true` if 'text' is present, otherwise `false`. + +#### Defined in + +[utils/area.ts:143](https://github.com/phun-ky/speccer/blob/main/src/utils/area.ts#L143) + +--- + ### isTopArea() ```ts @@ -326,7 +378,7 @@ boolean `true` if 'grid' are present, otherwise `false`. #### Defined in -[utils/area.ts:250](https://github.com/phun-ky/speccer/blob/main/src/utils/area.ts#L250) +[utils/area.ts:285](https://github.com/phun-ky/speccer/blob/main/src/utils/area.ts#L285) --- @@ -352,7 +404,7 @@ boolean `true` if 'mark' are present, otherwise `false`. #### Defined in -[utils/area.ts:240](https://github.com/phun-ky/speccer/blob/main/src/utils/area.ts#L240) +[utils/area.ts:275](https://github.com/phun-ky/speccer/blob/main/src/utils/area.ts#L275) --- @@ -378,7 +430,7 @@ boolean `true` if 'measure' are present, otherwise `false`. #### Defined in -[utils/area.ts:221](https://github.com/phun-ky/speccer/blob/main/src/utils/area.ts#L221) +[utils/area.ts:256](https://github.com/phun-ky/speccer/blob/main/src/utils/area.ts#L256) --- @@ -404,7 +456,7 @@ boolean `true` if 'pin' are present, otherwise `false`. #### Defined in -[utils/area.ts:231](https://github.com/phun-ky/speccer/blob/main/src/utils/area.ts#L231) +[utils/area.ts:266](https://github.com/phun-ky/speccer/blob/main/src/utils/area.ts#L266) --- @@ -430,7 +482,7 @@ boolean `true` if 'spacing' are present, otherwise `false`. #### Defined in -[utils/area.ts:211](https://github.com/phun-ky/speccer/blob/main/src/utils/area.ts#L211) +[utils/area.ts:246](https://github.com/phun-ky/speccer/blob/main/src/utils/area.ts#L246) --- @@ -456,7 +508,7 @@ boolean `true` if 'typography' are present, otherwise `false`. #### Defined in -[utils/area.ts:201](https://github.com/phun-ky/speccer/blob/main/src/utils/area.ts#L201) +[utils/area.ts:236](https://github.com/phun-ky/speccer/blob/main/src/utils/area.ts#L236) --- @@ -482,7 +534,7 @@ boolean `true` if 'width' is present, otherwise `false`. #### Defined in -[utils/area.ts:157](https://github.com/phun-ky/speccer/blob/main/src/utils/area.ts#L157) +[utils/area.ts:185](https://github.com/phun-ky/speccer/blob/main/src/utils/area.ts#L185) --- @@ -508,7 +560,7 @@ boolean `true` if any SVG-related area is present, otherwise `false`. #### Defined in -[utils/area.ts:171](https://github.com/phun-ky/speccer/blob/main/src/utils/area.ts#L171) +[utils/area.ts:199](https://github.com/phun-ky/speccer/blob/main/src/utils/area.ts#L199) --- @@ -534,7 +586,7 @@ boolean `true` if both 'syntax' are present, otherwise `false`. #### Defined in -[utils/area.ts:264](https://github.com/phun-ky/speccer/blob/main/src/utils/area.ts#L264) +[utils/area.ts:299](https://github.com/phun-ky/speccer/blob/main/src/utils/area.ts#L299) --- diff --git a/api/utils/attributes.md b/api/utils/attributes.md index 27f1c8d..78d1836 100644 --- a/api/utils/attributes.md +++ b/api/utils/attributes.md @@ -6,7 +6,7 @@ # utils/attributes -> Last updated 2024-08-23T11:58:26.670Z +> Last updated 2024-08-28T09:42:51.083Z ## Functions diff --git a/api/utils/bezier.md b/api/utils/bezier.md index 20d4421..ecac135 100644 --- a/api/utils/bezier.md +++ b/api/utils/bezier.md @@ -6,7 +6,7 @@ # utils/bezier -> Last updated 2024-08-23T11:58:26.670Z +> Last updated 2024-08-28T09:42:51.083Z ## Functions @@ -173,10 +173,10 @@ Positions for creating an SVG path for a curved line. | Name | Type | Defined in | | ----------- | -------- | -------------------------------------------------------------------------------------------- | -| `path1pos1` | `string` | [utils/bezier.ts:261](https://github.com/phun-ky/speccer/blob/main/src/utils/bezier.ts#L261) | -| `path1pos2` | `string` | [utils/bezier.ts:262](https://github.com/phun-ky/speccer/blob/main/src/utils/bezier.ts#L262) | -| `path2pos1` | `string` | [utils/bezier.ts:263](https://github.com/phun-ky/speccer/blob/main/src/utils/bezier.ts#L263) | -| `path2pos2` | `string` | [utils/bezier.ts:264](https://github.com/phun-ky/speccer/blob/main/src/utils/bezier.ts#L264) | +| `path1pos1` | `string` | [utils/bezier.ts:269](https://github.com/phun-ky/speccer/blob/main/src/utils/bezier.ts#L269) | +| `path1pos2` | `string` | [utils/bezier.ts:270](https://github.com/phun-ky/speccer/blob/main/src/utils/bezier.ts#L270) | +| `path2pos1` | `string` | [utils/bezier.ts:271](https://github.com/phun-ky/speccer/blob/main/src/utils/bezier.ts#L271) | +| `path2pos2` | `string` | [utils/bezier.ts:272](https://github.com/phun-ky/speccer/blob/main/src/utils/bezier.ts#L272) | #### Example @@ -186,7 +186,7 @@ const positions = getPositionsForCurlySVGPath('west'); #### Defined in -[utils/bezier.ts:226](https://github.com/phun-ky/speccer/blob/main/src/utils/bezier.ts#L226) +[utils/bezier.ts:234](https://github.com/phun-ky/speccer/blob/main/src/utils/bezier.ts#L234) --- @@ -220,8 +220,8 @@ Positions for creating an SVG path. | Name | Type | Defined in | | ------ | -------- | -------------------------------------------------------------------------------------------- | -| `pos1` | `string` | [utils/bezier.ts:212](https://github.com/phun-ky/speccer/blob/main/src/utils/bezier.ts#L212) | -| `pos2` | `string` | [utils/bezier.ts:212](https://github.com/phun-ky/speccer/blob/main/src/utils/bezier.ts#L212) | +| `pos1` | `string` | [utils/bezier.ts:220](https://github.com/phun-ky/speccer/blob/main/src/utils/bezier.ts#L220) | +| `pos2` | `string` | [utils/bezier.ts:220](https://github.com/phun-ky/speccer/blob/main/src/utils/bezier.ts#L220) | #### Example @@ -231,7 +231,7 @@ const positions = getPositionsForSVGPath('east'); #### Defined in -[utils/bezier.ts:188](https://github.com/phun-ky/speccer/blob/main/src/utils/bezier.ts#L188) +[utils/bezier.ts:196](https://github.com/phun-ky/speccer/blob/main/src/utils/bezier.ts#L196) --- diff --git a/api/utils/camel-case.md b/api/utils/camel-case.md index f368fb2..8a81632 100644 --- a/api/utils/camel-case.md +++ b/api/utils/camel-case.md @@ -6,7 +6,7 @@ # utils/camel-case -> Last updated 2024-08-23T11:58:26.671Z +> Last updated 2024-08-28T09:42:51.084Z ## Functions diff --git a/api/utils/cardinal.md b/api/utils/cardinal.md index 0f0c3c7..0d1ba21 100644 --- a/api/utils/cardinal.md +++ b/api/utils/cardinal.md @@ -6,7 +6,7 @@ # utils/cardinal -> Last updated 2024-08-23T11:58:26.671Z +> Last updated 2024-08-28T09:42:51.084Z ## Functions diff --git a/api/utils/classes/DrawCircle.md b/api/utils/classes/DrawCircle.md index cbdc554..4583a94 100644 --- a/api/utils/classes/DrawCircle.md +++ b/api/utils/classes/DrawCircle.md @@ -6,7 +6,7 @@ # utils/classes/DrawCircle -> Last updated 2024-08-23T11:58:26.671Z +> Last updated 2024-08-28T09:42:51.084Z ## Classes @@ -22,18 +22,18 @@ Class representing a DrawCircle instance. new DrawCircle( el, radius, - areas): DrawCircle + options): DrawCircle ``` Creates a new DrawCircle instance. ###### Parameters -| Parameter | Type | Description | -| --------- | ----------------------------------------------------------------------- | ---------------------------------------- | -| `el` | [`HTMLElement`](https://developer.mozilla.org/docs/Web/API/HTMLElement) | The element used to position the circle. | -| `radius` | `number` | The radius of the circle | -| `areas` | `string` | The areas used to identify position | +| Parameter | Type | Description | +| --------- | --------------------------------------------------------------------------- | ---------------------------------------- | +| `el` | [`HTMLElement`](https://developer.mozilla.org/docs/Web/API/HTMLElement) | The element used to position the circle. | +| `radius` | `number` | The radius of the circle | +| `options` | [`SpeccerOptionsInterface`](../../types/speccer.md#specceroptionsinterface) | The options used to identify position | ###### Returns @@ -45,12 +45,12 @@ Creates a new DrawCircle instance. #### Properties -| Property | Type | Defined in | -| -------- | --------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ | -| `areas` | `string` | [utils/classes/DrawCircle.ts:14](https://github.com/phun-ky/speccer/blob/main/src/utils/classes/DrawCircle.ts#L14) | -| `circle` | [`SVGCircleElement`](https://developer.mozilla.org/docs/Web/API/SVGCircleElement) | [utils/classes/DrawCircle.ts:12](https://github.com/phun-ky/speccer/blob/main/src/utils/classes/DrawCircle.ts#L12) | -| `el` | [`HTMLElement`](https://developer.mozilla.org/docs/Web/API/HTMLElement) | [utils/classes/DrawCircle.ts:11](https://github.com/phun-ky/speccer/blob/main/src/utils/classes/DrawCircle.ts#L11) | -| `radius` | `number` | [utils/classes/DrawCircle.ts:13](https://github.com/phun-ky/speccer/blob/main/src/utils/classes/DrawCircle.ts#L13) | +| Property | Type | Defined in | +| --------- | --------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ | +| `circle` | [`SVGCircleElement`](https://developer.mozilla.org/docs/Web/API/SVGCircleElement) | [utils/classes/DrawCircle.ts:12](https://github.com/phun-ky/speccer/blob/main/src/utils/classes/DrawCircle.ts#L12) | +| `el` | [`HTMLElement`](https://developer.mozilla.org/docs/Web/API/HTMLElement) | [utils/classes/DrawCircle.ts:11](https://github.com/phun-ky/speccer/blob/main/src/utils/classes/DrawCircle.ts#L11) | +| `options` | [`SpeccerOptionsInterface`](../../types/speccer.md#specceroptionsinterface) | [utils/classes/DrawCircle.ts:14](https://github.com/phun-ky/speccer/blob/main/src/utils/classes/DrawCircle.ts#L14) | +| `radius` | `number` | [utils/classes/DrawCircle.ts:13](https://github.com/phun-ky/speccer/blob/main/src/utils/classes/DrawCircle.ts#L13) | #### Methods @@ -68,7 +68,7 @@ Draws the circle based on the provided el and radius. ###### Defined in -[utils/classes/DrawCircle.ts:74](https://github.com/phun-ky/speccer/blob/main/src/utils/classes/DrawCircle.ts#L74) +[utils/classes/DrawCircle.ts:78](https://github.com/phun-ky/speccer/blob/main/src/utils/classes/DrawCircle.ts#L78) --- diff --git a/api/utils/classes/DrawSVGCurlyBracket.md b/api/utils/classes/DrawSVGCurlyBracket.md index 9f07825..227e0a4 100644 --- a/api/utils/classes/DrawSVGCurlyBracket.md +++ b/api/utils/classes/DrawSVGCurlyBracket.md @@ -6,7 +6,7 @@ # utils/classes/DrawSVGCurlyBracket -> Last updated 2024-08-23T11:58:26.671Z +> Last updated 2024-08-28T09:42:51.085Z ## Classes diff --git a/api/utils/classes/DrawSVGLine.md b/api/utils/classes/DrawSVGLine.md index 52b3f03..328637e 100644 --- a/api/utils/classes/DrawSVGLine.md +++ b/api/utils/classes/DrawSVGLine.md @@ -6,7 +6,7 @@ # utils/classes/DrawSVGLine -> Last updated 2024-08-23T11:58:26.672Z +> Last updated 2024-08-28T09:42:51.085Z ## Classes @@ -19,17 +19,21 @@ Class representing a DrawSVGLine instance. ##### new DrawSVGLine() ```ts -new DrawSVGLine(startElement, stopElement): DrawSVGLine +new DrawSVGLine( + startElement, + stopElement, + options?): DrawSVGLine ``` Creates a new DrawSVGLine instance. ###### Parameters -| Parameter | Type | Description | -| -------------- | ----------------------------------------------------------------------- | ---------------------------------- | -| `startElement` | [`HTMLElement`](https://developer.mozilla.org/docs/Web/API/HTMLElement) | The starting element for the line. | -| `stopElement` | [`HTMLElement`](https://developer.mozilla.org/docs/Web/API/HTMLElement) | The ending element for the line. | +| Parameter | Type | Description | +| -------------- | --------------------------------------------------------------------------- | ---------------------------------- | +| `startElement` | [`HTMLElement`](https://developer.mozilla.org/docs/Web/API/HTMLElement) | The starting element for the line. | +| `stopElement` | [`HTMLElement`](https://developer.mozilla.org/docs/Web/API/HTMLElement) | The ending element for the line. | +| `options`? | [`SpeccerOptionsInterface`](../../types/speccer.md#specceroptionsinterface) | The ending element for the line. | ###### Returns @@ -37,15 +41,16 @@ Creates a new DrawSVGLine instance. ###### Defined in -[utils/classes/DrawSVGLine.ts:21](https://github.com/phun-ky/speccer/blob/main/src/utils/classes/DrawSVGLine.ts#L21) +[utils/classes/DrawSVGLine.ts:24](https://github.com/phun-ky/speccer/blob/main/src/utils/classes/DrawSVGLine.ts#L24) #### Properties | Property | Type | Defined in | | -------------- | ----------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -| `line` | [`SVGPathElement`](https://developer.mozilla.org/docs/Web/API/SVGPathElement) | [utils/classes/DrawSVGLine.ts:14](https://github.com/phun-ky/speccer/blob/main/src/utils/classes/DrawSVGLine.ts#L14) | -| `startElement` | [`HTMLElement`](https://developer.mozilla.org/docs/Web/API/HTMLElement) | [utils/classes/DrawSVGLine.ts:12](https://github.com/phun-ky/speccer/blob/main/src/utils/classes/DrawSVGLine.ts#L12) | -| `stopElement` | [`HTMLElement`](https://developer.mozilla.org/docs/Web/API/HTMLElement) | [utils/classes/DrawSVGLine.ts:13](https://github.com/phun-ky/speccer/blob/main/src/utils/classes/DrawSVGLine.ts#L13) | +| `line` | [`SVGPathElement`](https://developer.mozilla.org/docs/Web/API/SVGPathElement) | [utils/classes/DrawSVGLine.ts:16](https://github.com/phun-ky/speccer/blob/main/src/utils/classes/DrawSVGLine.ts#L16) | +| `options` | [`SpeccerOptionsInterface`](../../types/speccer.md#specceroptionsinterface) | [utils/classes/DrawSVGLine.ts:15](https://github.com/phun-ky/speccer/blob/main/src/utils/classes/DrawSVGLine.ts#L15) | +| `startElement` | [`HTMLElement`](https://developer.mozilla.org/docs/Web/API/HTMLElement) | [utils/classes/DrawSVGLine.ts:13](https://github.com/phun-ky/speccer/blob/main/src/utils/classes/DrawSVGLine.ts#L13) | +| `stopElement` | [`HTMLElement`](https://developer.mozilla.org/docs/Web/API/HTMLElement) | [utils/classes/DrawSVGLine.ts:14](https://github.com/phun-ky/speccer/blob/main/src/utils/classes/DrawSVGLine.ts#L14) | #### Methods @@ -63,7 +68,7 @@ Connects and draws the line. ###### Defined in -[utils/classes/DrawSVGLine.ts:76](https://github.com/phun-ky/speccer/blob/main/src/utils/classes/DrawSVGLine.ts#L76) +[utils/classes/DrawSVGLine.ts:89](https://github.com/phun-ky/speccer/blob/main/src/utils/classes/DrawSVGLine.ts#L89) ##### draw() @@ -89,7 +94,7 @@ Will throw an error if no path is provided. ###### Defined in -[utils/classes/DrawSVGLine.ts:85](https://github.com/phun-ky/speccer/blob/main/src/utils/classes/DrawSVGLine.ts#L85) +[utils/classes/DrawSVGLine.ts:98](https://github.com/phun-ky/speccer/blob/main/src/utils/classes/DrawSVGLine.ts#L98) --- diff --git a/api/utils/classnames.md b/api/utils/classnames.md index 0e11155..f7a79d5 100644 --- a/api/utils/classnames.md +++ b/api/utils/classnames.md @@ -6,7 +6,7 @@ # utils/classnames -> Last updated 2024-08-23T11:58:26.672Z +> Last updated 2024-08-28T09:42:51.085Z ## Functions diff --git a/api/utils/constants.md b/api/utils/constants.md index 7f924f9..72e40bd 100644 --- a/api/utils/constants.md +++ b/api/utils/constants.md @@ -6,7 +6,7 @@ # utils/constants -> Last updated 2024-08-23T11:58:26.672Z +> Last updated 2024-08-28T09:42:51.086Z ## Variables diff --git a/api/utils/coords.md b/api/utils/coords.md index 86249bf..028b8c4 100644 --- a/api/utils/coords.md +++ b/api/utils/coords.md @@ -6,7 +6,7 @@ # utils/coords -> Last updated 2024-08-23T11:58:26.673Z +> Last updated 2024-08-28T09:42:51.086Z ## Variables diff --git a/api/utils/css.md b/api/utils/css.md index 640c78b..6a93552 100644 --- a/api/utils/css.md +++ b/api/utils/css.md @@ -6,7 +6,7 @@ # utils/css -> Last updated 2024-08-23T11:58:26.673Z +> Last updated 2024-08-28T09:42:51.086Z ## Functions diff --git a/api/utils/debounce.md b/api/utils/debounce.md index 6d4d6f3..5508b88 100644 --- a/api/utils/debounce.md +++ b/api/utils/debounce.md @@ -6,7 +6,7 @@ # utils/debounce -> Last updated 2024-08-23T11:58:26.673Z +> Last updated 2024-08-28T09:42:51.088Z ## Functions diff --git a/api/utils/direction-of-element.md b/api/utils/direction-of-element.md index 99bfd76..6b1d132 100644 --- a/api/utils/direction-of-element.md +++ b/api/utils/direction-of-element.md @@ -6,7 +6,7 @@ # utils/direction-of-element -> Last updated 2024-08-23T11:58:26.673Z +> Last updated 2024-08-28T09:42:51.088Z ## Functions diff --git a/api/utils/get-coords-pair-from-objects.md b/api/utils/get-coords-pair-from-objects.md index 8b32c5e..a4cf152 100644 --- a/api/utils/get-coords-pair-from-objects.md +++ b/api/utils/get-coords-pair-from-objects.md @@ -6,7 +6,7 @@ # utils/get-coords-pair-from-objects -> Last updated 2024-08-23T11:58:26.674Z +> Last updated 2024-08-28T09:42:51.088Z ## Functions diff --git a/api/utils/get-options.md b/api/utils/get-options.md new file mode 100644 index 0000000..e03d118 --- /dev/null +++ b/api/utils/get-options.md @@ -0,0 +1,67 @@ +
+ SPECCER logo +
+ +[@phun-ky/speccer](../README.md) / utils/get-options + +# utils/get-options + +> Last updated 2024-08-28T09:42:51.088Z + +## Functions + +### getOptions() + +```ts +function getOptions(areaString, targetStyle): SpeccerOptionsInterface; +``` + +Generates Speccer options based on the target element and the specified area string. + +#### Parameters + +| Parameter | Type | Description | +| ------------- | --------------------------------------------------------------------------------------- | --------------------------------------------- | +| `areaString` | `string` | The string representing different area types. | +| `targetStyle` | [`CSSStyleDeclaration`](https://developer.mozilla.org/docs/Web/API/CSSStyleDeclaration) | - | + +#### Returns + +[`SpeccerOptionsInterface`](../types/speccer.md#specceroptionsinterface) + +The generated Speccer options. + +#### Example + +```ts +const options = getOptions( + document.getElementById('myElement'), + 'left right pin' +); +console.log(options); +// Output: { position: { left: true, right: true, top: false, bottom: false }, type: 'pin', pin: { bracket: false, enclose: false, subtle: false, parent: false, text: false, useSVGLine: false, useCurlyBrackets: false } } +``` + +#### Defined in + +[utils/get-options.ts:86](https://github.com/phun-ky/speccer/blob/main/src/utils/get-options.ts#L86) + +--- + +**Contributing** + +Want to contribute? Please read the [CONTRIBUTING.md](https://github.com/phun-ky/speccer/blob/main/CONTRIBUTING.md) and [CODE_OF_CONDUCT.md](https://github.com/phun-ky/speccer/blob/main/CODE_OF_CONDUCT.md) + +**Sponsor me** + +I'm an Open Source evangelist, creating stuff that does not exist yet to help get rid of secondary activities and to enhance systems already in place, be it documentation or web sites. + +The sponsorship is an unique opportunity to alleviate more hours for me to maintain my projects, create new ones and contribute to the large community we're all part of :) + +[Support me on GitHub Sponsors](https://github.com/sponsors/phun-ky). + +![Speccer banner, with logo and slogan: A zero dependency package to highlight elements](https://github.com/phun-ky/speccer/blob/main/public/speccer-banner.png?raw=true) + +--- + +This project created by [Alexander Vassbotn Røyne-Helgesen](http://phun-ky.net) is licensed under a [MIT License](https://choosealicense.com/licenses/mit/). diff --git a/api/utils/id.md b/api/utils/id.md index 080267c..502fc92 100644 --- a/api/utils/id.md +++ b/api/utils/id.md @@ -6,7 +6,7 @@ # utils/id -> Last updated 2024-08-23T11:58:26.674Z +> Last updated 2024-08-28T09:42:51.089Z ## Functions diff --git a/api/utils/intrinsic-coords.md b/api/utils/intrinsic-coords.md index 3e38ce9..e763e77 100644 --- a/api/utils/intrinsic-coords.md +++ b/api/utils/intrinsic-coords.md @@ -6,7 +6,7 @@ # utils/intrinsic-coords -> Last updated 2024-08-23T11:58:26.674Z +> Last updated 2024-08-28T09:42:51.089Z ## Functions diff --git a/api/utils/node.md b/api/utils/node.md index a8a26df..a79b546 100644 --- a/api/utils/node.md +++ b/api/utils/node.md @@ -6,7 +6,7 @@ # utils/node -> Last updated 2024-08-23T11:58:26.674Z +> Last updated 2024-08-28T09:42:51.089Z ## Functions diff --git a/api/utils/number.md b/api/utils/number.md index 95d668e..2174a65 100644 --- a/api/utils/number.md +++ b/api/utils/number.md @@ -6,7 +6,7 @@ # utils/number -> Last updated 2024-08-23T11:58:26.674Z +> Last updated 2024-08-28T09:42:51.089Z ## Functions diff --git a/api/utils/position.md b/api/utils/position.md index d0f2723..2a02b88 100644 --- a/api/utils/position.md +++ b/api/utils/position.md @@ -6,7 +6,7 @@ # utils/position -> Last updated 2024-08-23T11:58:26.674Z +> Last updated 2024-08-28T09:42:51.089Z ## Functions diff --git a/api/utils/resize.md b/api/utils/resize.md index b42474f..e382622 100644 --- a/api/utils/resize.md +++ b/api/utils/resize.md @@ -6,7 +6,7 @@ # utils/resize -> Last updated 2024-08-23T11:58:26.675Z +> Last updated 2024-08-28T09:42:51.090Z ## Functions diff --git a/api/utils/style-property.md b/api/utils/style-property.md index 7b13c10..f9520ad 100644 --- a/api/utils/style-property.md +++ b/api/utils/style-property.md @@ -6,7 +6,7 @@ # utils/style-property -> Last updated 2024-08-23T11:58:26.675Z +> Last updated 2024-08-28T09:42:51.090Z ## Functions diff --git a/api/utils/styles.md b/api/utils/styles.md index 69f497a..103df12 100644 --- a/api/utils/styles.md +++ b/api/utils/styles.md @@ -6,7 +6,7 @@ # utils/styles -> Last updated 2024-08-23T11:58:26.675Z +> Last updated 2024-08-28T09:42:51.090Z ## Functions diff --git a/api/utils/typeof.md b/api/utils/typeof.md index aaaaf59..735be33 100644 --- a/api/utils/typeof.md +++ b/api/utils/typeof.md @@ -6,7 +6,7 @@ # utils/typeof -> Last updated 2024-08-23T11:58:26.675Z +> Last updated 2024-08-28T09:42:51.090Z ## Functions diff --git a/api/utils/wait.md b/api/utils/wait.md index e6e5952..b3ae61f 100644 --- a/api/utils/wait.md +++ b/api/utils/wait.md @@ -6,7 +6,7 @@ # utils/wait -> Last updated 2024-08-23T11:58:26.676Z +> Last updated 2024-08-28T09:42:51.091Z ## Functions diff --git a/api/utils/xy.md b/api/utils/xy.md index 9fa75c2..ec6ac7c 100644 --- a/api/utils/xy.md +++ b/api/utils/xy.md @@ -6,7 +6,7 @@ # utils/xy -> Last updated 2024-08-23T11:58:26.676Z +> Last updated 2024-08-28T09:42:51.091Z ## Variables