Skip to content

Commit

Permalink
fix: minor things + release concept
Browse files Browse the repository at this point in the history
  • Loading branch information
moritzjacobs committed Apr 23, 2024
1 parent d98bbf7 commit e16ee49
Show file tree
Hide file tree
Showing 11 changed files with 20 additions and 17 deletions.
1 change: 1 addition & 0 deletions apps/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "2.0.0",
"sideEffects": false,
"type": "module",
"private": true,
"scripts": {
"build": "remix build",
"dev": "remix dev --manual",
Expand Down
1 change: 1 addition & 0 deletions packages/eslint-config/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "@uberschrift/eslint-config",
"version": "2.0.0",
"private": true,
"files": [
"library.js"
],
Expand Down
4 changes: 2 additions & 2 deletions packages/react/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# uberschrift

## 1.0.0—1.1.11
## 1.0.0—1.1.12

Changelog is lost :(
Changelog is lost in time…

## 1.0.0

Expand Down
2 changes: 1 addition & 1 deletion packages/react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "uberschrift",
"version": "1.1.11",
"version": "1.1.12",
"type": "module",
"sideEffects": false,
"main": "./dist/index.js",
Expand Down
1 change: 1 addition & 0 deletions packages/tsconfig/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "@uberschrift/tsconfig",
"version": "2.0.0",
"private": true,
"license": "MIT",
"publishConfig": {
"access": "public"
Expand Down
4 changes: 2 additions & 2 deletions packages/vue/src/Hx.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script setup lang="ts">
import { inject } from "vue";
import { uberschriftLevel } from "./uberschriftSymbol.ts";
import { vueberschriftLevel } from "./vueberschriftSymbol.ts";
const props = withDefaults(
defineProps<{
Expand All @@ -11,7 +11,7 @@ const props = withDefaults(
},
);
const currentLevel = inject(uberschriftLevel, 1);
const currentLevel = inject(vueberschriftLevel, 1);
const level = currentLevel + props.increment;
</script>

Expand Down
6 changes: 3 additions & 3 deletions packages/vue/src/HxBoundary.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<script setup lang="ts">
import { inject, provide } from "vue";
import { uberschriftLevel } from "./uberschriftSymbol";
import { vueberschriftLevel } from "./vueberschriftSymbol";
const currentLevel = inject(uberschriftLevel, 1);
provide(uberschriftLevel, currentLevel + 1); // provide next level
const currentLevel = inject(vueberschriftLevel, 1);
provide(vueberschriftLevel, currentLevel + 1); // provide next level
</script>

<template>
Expand Down
5 changes: 0 additions & 5 deletions packages/vue/src/uberschriftSymbol.ts

This file was deleted.

4 changes: 2 additions & 2 deletions packages/vue/src/useHx.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { inject } from "vue";
import { uberschriftLevel } from "./uberschriftSymbol";
import { vueberschriftLevel } from "./vueberschriftSymbol";

type HeadingTagName = "h1" | "h2" | "h3" | "h4" | "h5" | "h6";

export const useHx = () => {
const level = inject(uberschriftLevel) ?? 1; // default does not work here
const level = inject(vueberschriftLevel) ?? 1; // default does not work here
const headingTagName = level > 6 ? "h6" : (`h${level}` as HeadingTagName);

return { headingTagName, level };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { defineComponent } from "vue";
import { mount } from "@vue/test-utils";
import TestCase from "./TestCase.vue";
import { useHx } from "./useHx";
import { uberschriftSymbol } from "./uberschriftSymbol";
import { vueberschriftSymbol } from "./vueberschriftSymbol";

const elements = ["h1", "h2", "h3", "h4", "h5", "h6"];

Expand Down Expand Up @@ -45,7 +45,7 @@ describe("useHx()", () => {
const wrapper = mount(TestComponent, {
global: {
provide: {
[uberschriftSymbol]: i,
[vueberschriftSymbol]: i,
},
},
});
Expand Down
5 changes: 5 additions & 0 deletions packages/vue/src/vueberschriftSymbol.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { InjectionKey } from "vue";

export const vueberschriftSymbol = Symbol("vueberschriftLevel");

export const vueberschriftLevel = vueberschriftSymbol as InjectionKey<number>;

0 comments on commit e16ee49

Please sign in to comment.