Skip to content

Commit

Permalink
chore: 🤖 release v8.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
phun-ky committed Oct 18, 2023
1 parent 6fbc89f commit 95669a6
Show file tree
Hide file tree
Showing 9 changed files with 83 additions and 30 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# Changelog

## [8.0.4](https://github.com/phun-ky/speccer/compare/v8.0.3...v8.0.4) (2023-10-18)


### Bug

* 🐛 Add back missing methods ([8bf104e](https://github.com/phun-ky/speccer/commit/8bf104ea3b2c58a73270f773dfa8082ab469f172))
* 🐛 Correctly check for undefined values ([b7d7b0b](https://github.com/phun-ky/speccer/commit/b7d7b0bea72dabf036df533295f57c22c5e520c4))
* 🐛 Fix issues with jest/ts ([a4395a8](https://github.com/phun-ky/speccer/commit/a4395a81a56ed1f7c18aaf80677e875fd65a45a3))
* 🐛 Use correct import path ([ad6f717](https://github.com/phun-ky/speccer/commit/ad6f7171891b4df90cb491f635316426e57fae53))


### Refactoring

* 💡 Update `cx` ([5754282](https://github.com/phun-ky/speccer/commit/5754282fbc7cc8f4a16980f82ea795656eea90bb))

## [8.0.3](https://github.com/phun-ky/speccer/compare/v8.0.2...v8.0.3) (2023-10-17)


Expand Down
18 changes: 18 additions & 0 deletions api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,24 @@
- [types/interfaces/position](modules/types_interfaces_position.md)
- [types/position](modules/types_position.md)
- [types/speccer](modules/types_speccer.md)
- [utils/\_\_tests\_\_/angle](modules/utils___tests___angle.md)
- [utils/\_\_tests\_\_/area](modules/utils___tests___area.md)
- [utils/\_\_tests\_\_/attributes](modules/utils___tests___attributes.md)
- [utils/\_\_tests\_\_/bezier](modules/utils___tests___bezier.md)
- [utils/\_\_tests\_\_/cardinal](modules/utils___tests___cardinal.md)
- [utils/\_\_tests\_\_/classnames](modules/utils___tests___classnames.md)
- [utils/\_\_tests\_\_/coords](modules/utils___tests___coords.md)
- [utils/\_\_tests\_\_/css](modules/utils___tests___css.md)
- [utils/\_\_tests\_\_/debounce](modules/utils___tests___debounce.md)
- [utils/\_\_tests\_\_/direction-of-element](modules/utils___tests___direction_of_element.md)
- [utils/\_\_tests\_\_/get-coords-pair-from-objects](modules/utils___tests___get_coords_pair_from_objects.md)
- [utils/\_\_tests\_\_/id](modules/utils___tests___id.md)
- [utils/\_\_tests\_\_/intrinsic-coords](modules/utils___tests___intrinsic_coords.md)
- [utils/\_\_tests\_\_/node](modules/utils___tests___node.md)
- [utils/\_\_tests\_\_/number](modules/utils___tests___number.md)
- [utils/\_\_tests\_\_/position](modules/utils___tests___position.md)
- [utils/\_\_tests\_\_/styles](modules/utils___tests___styles.md)
- [utils/\_\_tests\_\_/wait](modules/utils___tests___wait.md)
- [utils/angle](modules/utils_angle.md)
- [utils/area](modules/utils_area.md)
- [utils/attributes](modules/utils_attributes.md)
Expand Down

This file was deleted.

24 changes: 22 additions & 2 deletions api/modules/types_interfaces_classnames.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,26 @@

# Module: types/interfaces/classnames

## Interfaces
## Type Aliases

- [ClassNamesObjectMapInterface](../interfaces/types_interfaces_classnames.ClassNamesObjectMapInterface.md)
### ClassNamesFirstArgType

Ƭ **ClassNamesFirstArgType**: `string` \| [`ClassNamesSecondArgType`](types_interfaces_classnames.md#classnamessecondargtype)

Type for the first argument of the cx function which can be either a string or `ClassNamesSecondArgType`.

#### Defined in

[types/interfaces/classnames.ts:9](https://github.com/phun-ky/speccer/blob/main/src/types/interfaces/classnames.ts#L9)

___

### ClassNamesSecondArgType

Ƭ **ClassNamesSecondArgType**: `undefined` \| `Record`<`string`, `boolean`\>

Type for the optional properties object with boolean values.

#### Defined in

[types/interfaces/classnames.ts:4](https://github.com/phun-ky/speccer/blob/main/src/types/interfaces/classnames.ts#L4)
21 changes: 13 additions & 8 deletions api/modules/utils_classnames.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,25 @@

**cx**(`cls`, `cls_obj?`): `string`

Generate CSS classes from a string and an object.
Combines class names and optional properties object into a single string of class names.

The `cx` function takes two parameters: `cls` and `cls_obj`.
The `cls` parameter can be either a string representing class names or an object with
properties set to `true` or `false`. The `cls_obj` parameter is an optional object with
properties set to `true` or `false`, allowing for conditional inclusion of class names.

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `cls` | `string` | Additional CSS classes as a string. |
| `cls_obj?` | [`ClassNamesObjectMapInterface`](../interfaces/types_interfaces_classnames.ClassNamesObjectMapInterface.md) | A mapping of class names to boolean values. |
| `cls` | [`ClassNamesFirstArgType`](types_interfaces_classnames.md#classnamesfirstargtype) | The class names as a string or an object with properties set to true or false. |
| `cls_obj?` | [`ClassNamesSecondArgType`](types_interfaces_classnames.md#classnamessecondargtype) | An optional object with properties set to true or false to conditionally include class names. |

#### Returns

`string`

- A space-separated string of CSS class names.
- Returns a single string containing the combined class names.

**`Example`**

Expand All @@ -33,7 +38,7 @@ console.log(classNames); // Example output: 'class1 class2'

#### Defined in

[utils/classnames.ts:97](https://github.com/phun-ky/speccer/blob/main/src/utils/classnames.ts#L97)
[utils/classnames.ts:105](https://github.com/phun-ky/speccer/blob/main/src/utils/classnames.ts#L105)

___

Expand Down Expand Up @@ -65,7 +70,7 @@ remove(element, 'class1 class2');

#### Defined in

[utils/classnames.ts:72](https://github.com/phun-ky/speccer/blob/main/src/utils/classnames.ts#L72)
[utils/classnames.ts:75](https://github.com/phun-ky/speccer/blob/main/src/utils/classnames.ts#L75)

___

Expand Down Expand Up @@ -97,7 +102,7 @@ set(element, 'class1 class2');

#### Defined in

[utils/classnames.ts:20](https://github.com/phun-ky/speccer/blob/main/src/utils/classnames.ts#L20)
[utils/classnames.ts:23](https://github.com/phun-ky/speccer/blob/main/src/utils/classnames.ts#L23)

___

Expand Down Expand Up @@ -129,4 +134,4 @@ toggle(element, 'class1 class2');

#### Defined in

[utils/classnames.ts:46](https://github.com/phun-ky/speccer/blob/main/src/utils/classnames.ts#L46)
[utils/classnames.ts:49](https://github.com/phun-ky/speccer/blob/main/src/utils/classnames.ts#L49)
11 changes: 11 additions & 0 deletions api/modules/utils_xy.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,20 @@ Object containing functions to retrieve specific x and y coordinates from a DOMR
| Name | Type |
| :------ | :------ |
| `bottom` | (`rect`: `DOMRect`) => { `x`: `number` ; `y`: `number` } |
| `bottom-center` | (`rect`: `DOMRect`) => { `x`: `number` ; `y`: `number` } |
| `bottom-left` | (`rect`: `DOMRect`) => { `x`: `number` ; `y`: `number` } |
| `bottom-right` | (`rect`: `DOMRect`) => { `x`: `number` ; `y`: `number` } |
| `center` | (`rect`: `DOMRect`) => { `x`: `number` ; `y`: `number` } |
| `left-bottom` | (`rect`: `DOMRect`) => { `x`: `number` ; `y`: `number` } |
| `left-center` | (`rect`: `DOMRect`) => { `x`: `number` ; `y`: `number` } |
| `left-top` | (`rect`: `DOMRect`) => { `x`: `number` ; `y`: `number` } |
| `right` | (`rect`: `DOMRect`) => { `x`: `number` ; `y`: `number` } |
| `right-bottom` | (`rect`: `DOMRect`) => { `x`: `number` ; `y`: `number` } |
| `right-center` | (`rect`: `DOMRect`) => { `x`: `number` ; `y`: `number` } |
| `top` | (`rect`: `DOMRect`) => { `x`: `number` ; `y`: `number` } |
| `top-center` | (`rect`: `DOMRect`) => { `x`: `number` ; `y`: `number` } |
| `top-left` | (`rect`: `DOMRect`) => { `x`: `number` ; `y`: `number` } |
| `top-right` | (`rect`: `DOMRect`) => { `x`: `number` ; `y`: `number` } |

#### Defined in

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@phun-ky/speccer",
"version": "8.0.3",
"version": "8.0.4",
"description": "A script to annotate, show spacing specs and to display typography information in documentation/website on HTML elements",
"main": "speccer.js",
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion speccer.js.map

Large diffs are not rendered by default.

0 comments on commit 95669a6

Please sign in to comment.