diff --git a/CHANGELOG.md b/CHANGELOG.md index f2525290..06309f17 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,51 @@ + + +## [7.0.0](https://github.com/phun-ky/speccer/compare/v6.3.2...v7.0.0) (2023-10-16) + + +### ⚠ BREAKING CHANGES + +* Renamed `src/index.ts` to `src/main.ts` + +### Tasks + +* 🤖 Add correct types of commits to preset ([5fd6e4a](https://github.com/phun-ky/speccer/commit/5fd6e4a1b555e32437300638f2c0c91c171e6cea)) +* 🤖 Add github actions ([1942f8d](https://github.com/phun-ky/speccer/commit/1942f8d49ebf0e4086ed9d30e7d9f162ee8d3eb1)), closes [#30](https://github.com/phun-ky/speccer/issues/30) +* 🤖 Adjust tsconfig ([7d1c89e](https://github.com/phun-ky/speccer/commit/7d1c89e9a689c4cdd2b3eb40702162968aa1ac11)) +* 🤖 build ([28a21f2](https://github.com/phun-ky/speccer/commit/28a21f2d913ee31c4503afcdfa176e8f180b0e15)) +* 🤖 bump rollup-plugin-typescript2 from 0.31.2 to 0.35.0 ([9412bec](https://github.com/phun-ky/speccer/commit/9412beca0b5e2cb45731e989cb8897ff6525c706)) +* 🤖 bump stylus from 0.56.0 to 0.60.0 ([0351289](https://github.com/phun-ky/speccer/commit/03512897870349a1bd707771cf098a2d7100ebf1)) +* 🤖 bump tough-cookie from 4.1.2 to 4.1.3 ([e6438c0](https://github.com/phun-ky/speccer/commit/e6438c001622ec774fd189e3ba9a442455810b92)) +* 🤖 Do not hide chores ([1794e18](https://github.com/phun-ky/speccer/commit/1794e18bc70ca9b27a20d0ef836f761da35b6066)) +* 🤖 Remove old `index.d.ts` file ([b30fa69](https://github.com/phun-ky/speccer/commit/b30fa69a4c9b1659bf109c7a702f25a5323d9f65)) +* 🤖 Use `release-it` instead of `standard-version` ([0e44c3d](https://github.com/phun-ky/speccer/commit/0e44c3d89978987c6eeed9f97bcd661227b9e2c4)), closes [#41](https://github.com/phun-ky/speccer/issues/41) + + +### Documentation + +* ✏️ Add API documentation ([a4598c5](https://github.com/phun-ky/speccer/commit/a4598c5260695b2b48511a5b92e25be42e02d485)) +* ✏️ Update `README.md` ([1b1f48b](https://github.com/phun-ky/speccer/commit/1b1f48b6d5135ac360ed0405de30737dafaeb201)), closes [#39](https://github.com/phun-ky/speccer/issues/39) + + +### Feature + +* 🎸 Add logos ([771812a](https://github.com/phun-ky/speccer/commit/771812a6d27f325341860ab55c0e24b3e5af9c13)) +* 🎸 Add mark feature ([b21435c](https://github.com/phun-ky/speccer/commit/b21435c0c81ba6c139d7dbf3e2b5007e9d23f448)), closes [#22](https://github.com/phun-ky/speccer/issues/22) + + +### Bug + +* 🐛 Fix release ([dc7803a](https://github.com/phun-ky/speccer/commit/dc7803a73b3ce136b5c6dc218bbe7b031f7eb888)) +* 🐛 Make sure we publish to npm ([6a76f76](https://github.com/phun-ky/speccer/commit/6a76f7689cabbf337155bf4dea668fa93ac697f1)), closes [#45](https://github.com/phun-ky/speccer/issues/45) +* 🐛 skipChecks for npm publish ([0c22c31](https://github.com/phun-ky/speccer/commit/0c22c31fe292a1d896e5843e245cbd78bfb2a790)) + + +### Refactoring + +* 💡 Add more inline documentation and updated some ([71d6809](https://github.com/phun-ky/speccer/commit/71d6809d63ce2e32fb15980ca2d8223c538bfa97)) +* 💡 Adjust folder structure to a more meaningful way ([42597fa](https://github.com/phun-ky/speccer/commit/42597fa8a74941d1e40cfd8ab904fbafd1354a81)), closes [#48](https://github.com/phun-ky/speccer/issues/48) +* 💡 Make sure we release on every change ([ce4a627](https://github.com/phun-ky/speccer/commit/ce4a627f93a87ce3888c7b9b48b57207a76bdb0b)), closes [#43](https://github.com/phun-ky/speccer/issues/43) + # Changelog All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. @@ -191,4 +239,4 @@ build files. ### Features -- Add release script ([4cb72cb](https://github.com/phun-ky/speccer/commit/4cb72cbea7dd1d6bcb8f1102384b14eecaa9eef0)) +- Add release script ([4cb72cb](https://github.com/phun-ky/speccer/commit/4cb72cbea7dd1d6bcb8f1102384b14eecaa9eef0)) \ No newline at end of file diff --git a/api/modules/config_browser.md b/api/modules/config_browser.md index 7fce6f9a..2602ce5d 100644 --- a/api/modules/config_browser.md +++ b/api/modules/config_browser.md @@ -8,19 +8,28 @@ ▸ **activate**(`speccer`): `void` +A function to activate speccer based on script attributes. + #### Parameters -| Name | Type | -| :------ | :------ | -| `speccer` | [`SpeccerFunctionType`](types_speccer.md#speccerfunctiontype) | +| Name | Type | Description | +| :------ | :------ | :------ | +| `speccer` | [`SpeccerFunctionType`](types_speccer.md#speccerfunctiontype) | The speccer function to execute. | #### Returns `void` +**`Example`** + +```ts +// Usage example: +// activate(mySpeccer); +``` + #### Defined in -[config/browser.ts:72](https://github.com/phun-ky/speccer/blob/main/src/config/browser.ts#L72) +[config/browser.ts:114](https://github.com/phun-ky/speccer/blob/main/src/config/browser.ts#L114) ___ @@ -28,19 +37,28 @@ ___ ▸ **dom**(`speccer`): `void` +A function to initialize speccer when the DOM is ready. + #### Parameters -| Name | Type | -| :------ | :------ | -| `speccer` | [`SpeccerFunctionType`](types_speccer.md#speccerfunctiontype) | +| Name | Type | Description | +| :------ | :------ | :------ | +| `speccer` | [`SpeccerFunctionType`](types_speccer.md#speccerfunctiontype) | The speccer function to execute. | #### Returns `void` +**`Example`** + +```ts +// Usage example: +// dom(mySpeccer); +``` + #### Defined in -[config/browser.ts:12](https://github.com/phun-ky/speccer/blob/main/src/config/browser.ts#L12) +[config/browser.ts:23](https://github.com/phun-ky/speccer/blob/main/src/config/browser.ts#L23) ___ @@ -48,13 +66,22 @@ ___ ▸ **lazy**(): `void` +A function to initialize lazy speccer functionality. + #### Returns `void` +**`Example`** + +```ts +// Usage example: +// lazy(); +``` + #### Defined in -[config/browser.ts:23](https://github.com/phun-ky/speccer/blob/main/src/config/browser.ts#L23) +[config/browser.ts:43](https://github.com/phun-ky/speccer/blob/main/src/config/browser.ts#L43) ___ @@ -62,16 +89,25 @@ ___ ▸ **manual**(`speccer`): `void` +A function to manually activate speccer. + #### Parameters -| Name | Type | -| :------ | :------ | -| `speccer` | [`SpeccerFunctionType`](types_speccer.md#speccerfunctiontype) | +| Name | Type | Description | +| :------ | :------ | :------ | +| `speccer` | [`SpeccerFunctionType`](types_speccer.md#speccerfunctiontype) | The speccer function to execute. | #### Returns `void` +**`Example`** + +```ts +// Usage example: +// manual(mySpeccer); +``` + #### Defined in -[config/browser.ts:68](https://github.com/phun-ky/speccer/blob/main/src/config/browser.ts#L68) +[config/browser.ts:99](https://github.com/phun-ky/speccer/blob/main/src/config/browser.ts#L99) diff --git a/api/modules/features_dissect.md b/api/modules/features_dissect.md index 5e5d1306..e450c9c8 100644 --- a/api/modules/features_dissect.md +++ b/api/modules/features_dissect.md @@ -8,38 +8,60 @@ ▸ **create**(`textContent?`, `area`, `n?`): `HTMLElement` +Create a dissected element with optional text content, area description, and element type. + #### Parameters -| Name | Type | Default value | -| :------ | :------ | :------ | -| `textContent` | `string` | `''` | -| `area` | `string` | `undefined` | -| `n` | `string` | `'span'` | +| Name | Type | Default value | Description | +| :------ | :------ | :------ | :------ | +| `textContent` | `string` | `''` | The text content to add to the element. | +| `area` | `string` | `undefined` | The area description for styling. | +| `n` | `string` | `'span'` | The element type. | #### Returns `HTMLElement` +- The created dissected element. + +**`Example`** + +```ts +const dissectedElement = create('A', 'outline top', 'div'); +document.body.appendChild(dissectedElement); +``` + #### Defined in -[features/dissect/index.ts:15](https://github.com/phun-ky/speccer/blob/main/src/features/dissect/index.ts#L15) +[features/dissect/index.ts:29](https://github.com/phun-ky/speccer/blob/main/src/features/dissect/index.ts#L29) ___ ### element -▸ **element**(`sectionEl`): `void` +▸ **element**(`sectionEl`): `Promise`<`void`\> + +Create dissected elements based on the section element and its data-anatomy attributes. #### Parameters -| Name | Type | -| :------ | :------ | -| `sectionEl` | `HTMLElement` | +| Name | Type | Description | +| :------ | :------ | :------ | +| `sectionEl` | `HTMLElement` | The section element containing dissected elements. | #### Returns -`void` +`Promise`<`void`\> + +- A promise that resolves after creating dissected elements. + +**`Example`** + +```ts +const sectionElement = document.getElementById('section'); +element(sectionElement); +``` #### Defined in -[features/dissect/index.ts:43](https://github.com/phun-ky/speccer/blob/main/src/features/dissect/index.ts#L43) +[features/dissect/index.ts:70](https://github.com/phun-ky/speccer/blob/main/src/features/dissect/index.ts#L70) diff --git a/api/modules/features_dissect_utils_styles.md b/api/modules/features_dissect_utils_styles.md index cda51508..23f6916c 100644 --- a/api/modules/features_dissect_utils_styles.md +++ b/api/modules/features_dissect_utils_styles.md @@ -6,21 +6,36 @@ ### styles -▸ **styles**(`area`, `targetEl`, `dissectionEl`, `options?`): `Promise`<{ `height`: `string` ; `left`: `string` ; `top`: `string` ; `width`: `string` } \| { `height`: `string` ; `left`: `string` ; `top`: `string` ; `width?`: `undefined` } \| { `height?`: `undefined` ; `left`: `string` ; `top`: `string` ; `width?`: `undefined` } \| { `height?`: `undefined` ; `left`: `string` ; `top`: `string` ; `width`: `string` }\> +▸ **styles**(`area`, `targetEl`, `dissectionEl`, `options?`): `Promise`<{ `height?`: `string` ; `left`: `string` ; `top`: `string` ; `width?`: `string` }\> + +Get styles for dissected elements based on the specified area and options. #### Parameters -| Name | Type | -| :------ | :------ | -| `area` | `string` | -| `targetEl` | `HTMLElement` | -| `dissectionEl` | `HTMLElement` | -| `options?` | [`DissectStylesOptionsType`](types_bezier.md#dissectstylesoptionstype) | +| Name | Type | Description | +| :------ | :------ | :------ | +| `area` | `string` | The area description. | +| `targetEl` | `HTMLElement` | The target element. | +| `dissectionEl` | `HTMLElement` | The dissection element. | +| `options?` | [`DissectStylesOptionsType`](types_bezier.md#dissectstylesoptionstype) | Optional styles options. | #### Returns -`Promise`<{ `height`: `string` ; `left`: `string` ; `top`: `string` ; `width`: `string` } \| { `height`: `string` ; `left`: `string` ; `top`: `string` ; `width?`: `undefined` } \| { `height?`: `undefined` ; `left`: `string` ; `top`: `string` ; `width?`: `undefined` } \| { `height?`: `undefined` ; `left`: `string` ; `top`: `string` ; `width`: `string` }\> +`Promise`<{ `height?`: `string` ; `left`: `string` ; `top`: `string` ; `width?`: `string` }\> + +- The computed styles. + +**`Example`** + +```ts +const area = 'top-left'; +const targetElement = document.getElementById('target'); +const dissectionElement = document.getElementById('dissection'); +const options = { isCurly: true }; +const styles = await styles(area, targetElement, dissectionElement, options); +console.log(styles); +``` #### Defined in -[features/dissect/utils/styles.ts:12](https://github.com/phun-ky/speccer/blob/main/src/features/dissect/utils/styles.ts#L12) +[features/dissect/utils/styles.ts:31](https://github.com/phun-ky/speccer/blob/main/src/features/dissect/utils/styles.ts#L31) diff --git a/api/modules/features_mark.md b/api/modules/features_mark.md index 31a528ef..6d23450d 100644 --- a/api/modules/features_mark.md +++ b/api/modules/features_mark.md @@ -8,19 +8,30 @@ ▸ **create**(`n?`): `HTMLElement` +Create a marker element with an optional element type. + #### Parameters -| Name | Type | Default value | -| :------ | :------ | :------ | -| `n` | `string` | `'span'` | +| Name | Type | Default value | Description | +| :------ | :------ | :------ | :------ | +| `n` | `string` | `'span'` | The element type. | #### Returns `HTMLElement` +- The created marker element. + +**`Example`** + +```typescript +const marker = create('div'); +document.body.appendChild(marker); +``` + #### Defined in -[features/mark/index.ts:8](https://github.com/phun-ky/speccer/blob/main/src/features/mark/index.ts#L8) +[features/mark/index.ts:20](https://github.com/phun-ky/speccer/blob/main/src/features/mark/index.ts#L20) ___ @@ -28,16 +39,27 @@ ___ ▸ **element**(`elementToMark`): `Promise`<`void`\> +Create a marker element and add it to the body with styles matching a specified element. + #### Parameters -| Name | Type | -| :------ | :------ | -| `elementToMark` | `HTMLElement` | +| Name | Type | Description | +| :------ | :------ | :------ | +| `elementToMark` | `HTMLElement` | The target element to match styles with. | #### Returns `Promise`<`void`\> +- A promise that resolves after creating and styling the marker element. + +**`Example`** + +```typescript +const elementToMark = document.getElementById('target'); +element(elementToMark); +``` + #### Defined in -[features/mark/index.ts:17](https://github.com/phun-ky/speccer/blob/main/src/features/mark/index.ts#L17) +[features/mark/index.ts:41](https://github.com/phun-ky/speccer/blob/main/src/features/mark/index.ts#L41) diff --git a/api/modules/features_measure.md b/api/modules/features_measure.md index 00f66210..d57602d0 100644 --- a/api/modules/features_measure.md +++ b/api/modules/features_measure.md @@ -8,21 +8,32 @@ ▸ **create**(`text?`, `area?`, `tag?`): `HTMLElement` +Create a measurement element with optional text, area, and element type. + #### Parameters -| Name | Type | Default value | -| :------ | :------ | :------ | -| `text` | `string` \| `number` | `''` | -| `area` | ``null`` \| `string` | `''` | -| `tag` | `string` | `'span'` | +| Name | 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. | #### Returns `HTMLElement` +- The created measurement element. + +**`Example`** + +```ts +const measurement = create(100, 'width bottom', 'div'); +document.body.appendChild(measurement); +``` + #### Defined in -[features/measure/index.ts:16](https://github.com/phun-ky/speccer/blob/main/src/features/measure/index.ts#L16) +[features/measure/index.ts:30](https://github.com/phun-ky/speccer/blob/main/src/features/measure/index.ts#L30) ___ @@ -30,16 +41,27 @@ ___ ▸ **element**(`targetEl`): `Promise`<`void`\> +Create a measurement element and add it to the body with styles matching a specified target element. + #### Parameters -| Name | Type | -| :------ | :------ | -| `targetEl` | `HTMLElement` | +| Name | Type | Description | +| :------ | :------ | :------ | +| `targetEl` | `HTMLElement` | The target element to match styles with. | #### Returns `Promise`<`void`\> +- A promise that resolves after creating and styling the measurement element. + +**`Example`** + +```ts +const targetElement = document.getElementById('target'); +element(targetElement); +``` + #### Defined in -[features/measure/index.ts:31](https://github.com/phun-ky/speccer/blob/main/src/features/measure/index.ts#L31) +[features/measure/index.ts:57](https://github.com/phun-ky/speccer/blob/main/src/features/measure/index.ts#L57) diff --git a/api/modules/features_spacing.md b/api/modules/features_spacing.md index c9f93c27..3d76b04d 100644 --- a/api/modules/features_spacing.md +++ b/api/modules/features_spacing.md @@ -8,20 +8,31 @@ ▸ **create**(`text?`, `tag?`): `HTMLElement` +Create a spacing element with optional text content. + #### Parameters -| Name | Type | Default value | -| :------ | :------ | :------ | -| `text` | `string` \| `number` | `''` | -| `tag` | `string` | `'span'` | +| Name | Type | Default value | Description | +| :------ | :------ | :------ | :------ | +| `text` | `string` \| `number` | `''` | The optional text content for the spacing element. | +| `tag` | `string` | `'span'` | The HTML tag for the element (default is 'span'). | #### Returns `HTMLElement` +- The created spacing element. + +**`Example`** + +```ts +const spacingElement = create(20, 'div'); +document.body.appendChild(spacingElement); +``` + #### Defined in -[features/spacing/index.ts:9](https://github.com/phun-ky/speccer/blob/main/src/features/spacing/index.ts#L9) +[features/spacing/index.ts:26](https://github.com/phun-ky/speccer/blob/main/src/features/spacing/index.ts#L26) ___ @@ -29,16 +40,27 @@ ___ ▸ **element**(`targetEl`): `Promise`<`void`\> +Create and position spacing elements based on the target element's computed spacing styles. + #### Parameters -| Name | Type | -| :------ | :------ | -| `targetEl` | `HTMLElement` | +| Name | Type | Description | +| :------ | :------ | :------ | +| `targetEl` | `HTMLElement` | The target element to create spacing elements for. | #### Returns `Promise`<`void`\> +- A promise that resolves after creating and positioning the spacing elements. + +**`Example`** + +```ts +const targetElement = document.getElementById('target'); +element(targetElement); +``` + #### Defined in -[features/spacing/index.ts:20](https://github.com/phun-ky/speccer/blob/main/src/features/spacing/index.ts#L20) +[features/spacing/index.ts:52](https://github.com/phun-ky/speccer/blob/main/src/features/spacing/index.ts#L52) diff --git a/api/modules/features_spacing_utils_position.md b/api/modules/features_spacing_utils_position.md index 2c37e79b..eba17d1e 100644 --- a/api/modules/features_spacing_utils_position.md +++ b/api/modules/features_spacing_utils_position.md @@ -8,19 +8,31 @@ ▸ **position**(`property`, `value`, `spacingEl`, `targetEl`): `Promise`<`void`\> +Set the position and dimensions of a spacing element relative to a target element. + #### Parameters -| Name | Type | -| :------ | :------ | -| `property` | `string` | -| `value` | `number` | -| `spacingEl` | `HTMLElement` | -| `targetEl` | `HTMLElement` | +| Name | Type | Description | +| :------ | :------ | :------ | +| `property` | `string` | The CSS property to set (e.g., 'marginTop', 'marginLeft', etc.). | +| `value` | `number` | The value of the CSS property. | +| `spacingEl` | `HTMLElement` | The spacing element. | +| `targetEl` | `HTMLElement` | The target element. | #### Returns `Promise`<`void`\> +- A promise that resolves after setting the position and dimensions. + +**`Example`** + +```ts +const spacingElement = document.getElementById('spacing'); +const targetElement = document.getElementById('target'); +position('marginTop', 20, spacingElement, targetElement); +``` + #### Defined in -[features/spacing/utils/position.ts:5](https://github.com/phun-ky/speccer/blob/main/src/features/spacing/utils/position.ts#L5) +[features/spacing/utils/position.ts:21](https://github.com/phun-ky/speccer/blob/main/src/features/spacing/utils/position.ts#L21) diff --git a/api/modules/features_typography.md b/api/modules/features_typography.md index 6d3f6bfc..dce0e759 100644 --- a/api/modules/features_typography.md +++ b/api/modules/features_typography.md @@ -6,22 +6,35 @@ ### create -▸ **create**(`html`, `area`): `HTMLDivElement` +▸ **create**(`html`, `area`): `HTMLElement` + +Create a DOM element with provided HTML and optional CSS class names. #### Parameters -| Name | Type | -| :------ | :------ | -| `html` | `string` | -| `area` | ``null`` \| `string` | +| Name | Type | Description | +| :------ | :------ | :------ | +| `html` | `string` | The HTML content to be set in the created element. | +| `area` | ``null`` \| `string` | The optional CSS class names to add. | #### Returns -`HTMLDivElement` +`HTMLElement` + +- The created DOM element. + +**`Example`** + +```ts +const htmlContent = '
This is some HTML content.
'; +const cssClass = 'custom-class'; +const createdElement = create(htmlContent, cssClass); +document.body.appendChild(createdElement); +``` #### Defined in -[features/typography/index.ts:9](https://github.com/phun-ky/speccer/blob/main/src/features/typography/index.ts#L9) +[features/typography/index.ts:24](https://github.com/phun-ky/speccer/blob/main/src/features/typography/index.ts#L24) ___ @@ -29,16 +42,29 @@ ___ ▸ **element**(`targetEl`): `Promise`<`void`\> +Create a specced typography element for a given target element. + #### Parameters -| Name | Type | -| :------ | :------ | -| `targetEl` | `HTMLElement` | +| Name | Type | Description | +| :------ | :------ | :------ | +| `targetEl` | `HTMLElement` | The target element to specc typography for. | #### Returns `Promise`<`void`\> +- A promise that resolves once typography element is created and positioned. + +**`Example`** + +```ts +const targetElement = document.querySelector('.target'); +if (targetElement) { + element(targetElement); +} +``` + #### Defined in -[features/typography/index.ts:29](https://github.com/phun-ky/speccer/blob/main/src/features/typography/index.ts#L29) +[features/typography/index.ts:55](https://github.com/phun-ky/speccer/blob/main/src/features/typography/index.ts#L55) diff --git a/api/modules/features_typography_utils_position.md b/api/modules/features_typography_utils_position.md index 6f17fbf4..2b4fe7b5 100644 --- a/api/modules/features_typography_utils_position.md +++ b/api/modules/features_typography_utils_position.md @@ -6,20 +6,34 @@ ### position -▸ **position**(`area`, `targetEl`, `speccerEl`): `Promise`<{ `left`: `string` = \_left\_layout\_position\_left; `top`: `string` = \_left\_layout\_position\_top }\> +▸ **position**(`area`, `targetEl`, `speccerEl`): `Promise`<{ `left`: `string` ; `top`: `string` }\> + +Calculate the position for the speccer element relative to the target element. #### Parameters -| Name | Type | -| :------ | :------ | -| `area` | ``null`` \| `string` | -| `targetEl` | `HTMLElement` | -| `speccerEl` | `HTMLElement` | +| Name | Type | Description | +| :------ | :------ | :------ | +| `area` | ``null`` \| `string` | The area information for positioning. | +| `targetEl` | `HTMLElement` | The target element. | +| `speccerEl` | `HTMLElement` | The speccer element to position. | #### Returns -`Promise`<{ `left`: `string` = \_left\_layout\_position\_left; `top`: `string` = \_left\_layout\_position\_top }\> +`Promise`<{ `left`: `string` ; `top`: `string` }\> + +- A promise that resolves with the calculated position. + +**`Example`** + +```ts +const targetElement = document.getElementById('target'); +const speccerElement = document.getElementById('speccer'); +const area = 'top'; +const position = await position(area, targetElement, speccerElement); +console.log(position); // { left: '10px', top: '20px' } +``` #### Defined in -[features/typography/utils/position.ts:11](https://github.com/phun-ky/speccer/blob/main/src/features/typography/utils/position.ts#L11) +[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/modules/features_typography_utils_template.md b/api/modules/features_typography_utils_template.md index deadc937..42902d54 100644 --- a/api/modules/features_typography_utils_template.md +++ b/api/modules/features_typography_utils_template.md @@ -8,16 +8,28 @@ ▸ **template**(`targetEl`): `Promise`<`string`\> +Generate a HTML string for typography styles of a target element. + #### Parameters -| Name | Type | -| :------ | :------ | -| `targetEl` | `HTMLElement` | +| Name | Type | Description | +| :------ | :------ | :------ | +| `targetEl` | `HTMLElement` | The target element for which to generate typography styles. | #### Returns `Promise`<`string`\> +- A promise that resolves with the HTML string. + +**`Example`** + +```ts +const targetElement = document.getElementById('target'); +const typographyStyles = await template(targetElement); +console.log(typographyStyles); +``` + #### Defined in -[features/typography/utils/template.ts:4](https://github.com/phun-ky/speccer/blob/main/src/features/typography/utils/template.ts#L4) +[features/typography/utils/template.ts:17](https://github.com/phun-ky/speccer/blob/main/src/features/typography/utils/template.ts#L17) diff --git a/api/modules/main.md b/api/modules/main.md index 7fee9550..9cfae688 100644 --- a/api/modules/main.md +++ b/api/modules/main.md @@ -13,7 +13,7 @@ | Name | Type | | :------ | :------ | | `create` | (`textContent`: `string`, `area`: `string`, `n`: `string`) => `HTMLElement` | -| `element` | (`sectionEl`: `HTMLElement`) => `void` | +| `element` | (`sectionEl`: `HTMLElement`) => `Promise`<`void`\> | #### Defined in @@ -99,7 +99,7 @@ ___ | Name | Type | | :------ | :------ | -| `create` | (`html`: `string`, `area`: ``null`` \| `string`) => `HTMLDivElement` | +| `create` | (`html`: `string`, `area`: ``null`` \| `string`) => `HTMLElement` | | `element` | (`targetEl`: `HTMLElement`) => `Promise`<`void`\> | #### Defined in diff --git a/package-lock.json b/package-lock.json index 74ab9e94..cf03a02e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@phun-ky/speccer", - "version": "6.3.2", + "version": "7.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@phun-ky/speccer", - "version": "6.3.2", + "version": "7.0.0", "license": "MIT", "devDependencies": { "@release-it/conventional-changelog": "^7.0.1", diff --git a/package.json b/package.json index 1ce013a9..0a45ff50 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@phun-ky/speccer", - "version": "6.3.2", + "version": "7.0.0", "description": "A script to annotate, show spacing specs and to display typography information in documentation/website on HTML elements", "main": "speccer.js", "publishConfig": {