@cck-ui/hooks 0.12.0 → 0.12.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,7 +3,7 @@ const require_random_id = require("../utils/random-id/random-id.cjs");
3
3
  let vue = require("vue");
4
4
  //#region packages/@cck-ui/hooks/src/use-id/use-id.ts
5
5
  function useId(staticId) {
6
- if (staticId) return staticId;
6
+ if (staticId) return (0, vue.ref)(staticId);
7
7
  const id = (0, vue.ref)((0, vue.useId)());
8
8
  const initialized = (0, vue.ref)(false);
9
9
  (0, vue.onMounted)(() => {
@@ -1 +1 @@
1
- {"version":3,"file":"use-id.cjs","names":["randomId"],"sources":["../../src/use-id/use-id.ts"],"sourcesContent":["import { useId as vueUseId, ref, onMounted } from 'vue'\nimport { randomId } from '../utils'\n\nexport function useId(staticId?: string) {\n if (staticId) {\n return staticId\n }\n\n const vueId = vueUseId()\n const id = ref(vueId)\n const initialized = ref(false)\n\n onMounted(() => {\n if (!initialized.value) {\n initialized.value = true\n id.value = randomId()\n }\n })\n\n return id\n}\n"],"mappings":";;;;AAGA,SAAgB,MAAM,UAAmB;CACvC,IAAI,UACF,OAAO;CAIT,MAAM,MAAA,GAAA,IAAA,IAAA,EAAA,GAAA,IAAA,MAAA,CAAa,CAAC;CACpB,MAAM,eAAA,GAAA,IAAA,IAAA,CAAkB,KAAK;CAE7B,CAAA,GAAA,IAAA,UAAA,OAAgB;EACd,IAAI,CAAC,YAAY,OAAO;GACtB,YAAY,QAAQ;GACpB,GAAG,QAAQA,kBAAAA,SAAS;EACtB;CACF,CAAC;CAED,OAAO;AACT"}
1
+ {"version":3,"file":"use-id.cjs","names":["randomId"],"sources":["../../src/use-id/use-id.ts"],"sourcesContent":["import { useId as vueUseId, ref, onMounted } from 'vue'\nimport { randomId } from '../utils'\n\nexport function useId(staticId?: string) {\n if (staticId) {\n return ref(staticId)\n }\n\n const vueId = vueUseId()\n const id = ref(vueId)\n const initialized = ref(false)\n\n onMounted(() => {\n if (!initialized.value) {\n initialized.value = true\n id.value = randomId()\n }\n })\n\n return id\n}\n"],"mappings":";;;;AAGA,SAAgB,MAAM,UAAmB;CACvC,IAAI,UACF,QAAA,GAAA,IAAA,IAAA,CAAW,QAAQ;CAIrB,MAAM,MAAA,GAAA,IAAA,IAAA,EAAA,GAAA,IAAA,MAAA,CAAa,CAAC;CACpB,MAAM,eAAA,GAAA,IAAA,IAAA,CAAkB,KAAK;CAE7B,CAAA,GAAA,IAAA,UAAA,OAAgB;EACd,IAAI,CAAC,YAAY,OAAO;GACtB,YAAY,QAAQ;GACpB,GAAG,QAAQA,kBAAAA,SAAS;EACtB;CACF,CAAC;CAED,OAAO;AACT"}
@@ -3,7 +3,7 @@ import { randomId } from "../utils/random-id/random-id.mjs";
3
3
  import { onMounted, ref, useId } from "vue";
4
4
  //#region packages/@cck-ui/hooks/src/use-id/use-id.ts
5
5
  function useId$1(staticId) {
6
- if (staticId) return staticId;
6
+ if (staticId) return ref(staticId);
7
7
  const id = ref(useId());
8
8
  const initialized = ref(false);
9
9
  onMounted(() => {
@@ -1 +1 @@
1
- {"version":3,"file":"use-id.mjs","names":["useId","vueUseId"],"sources":["../../src/use-id/use-id.ts"],"sourcesContent":["import { useId as vueUseId, ref, onMounted } from 'vue'\nimport { randomId } from '../utils'\n\nexport function useId(staticId?: string) {\n if (staticId) {\n return staticId\n }\n\n const vueId = vueUseId()\n const id = ref(vueId)\n const initialized = ref(false)\n\n onMounted(() => {\n if (!initialized.value) {\n initialized.value = true\n id.value = randomId()\n }\n })\n\n return id\n}\n"],"mappings":";;;;AAGA,SAAgBA,QAAM,UAAmB;CACvC,IAAI,UACF,OAAO;CAIT,MAAM,KAAK,IADGC,MACK,CAAC;CACpB,MAAM,cAAc,IAAI,KAAK;CAE7B,gBAAgB;EACd,IAAI,CAAC,YAAY,OAAO;GACtB,YAAY,QAAQ;GACpB,GAAG,QAAQ,SAAS;EACtB;CACF,CAAC;CAED,OAAO;AACT"}
1
+ {"version":3,"file":"use-id.mjs","names":["useId","vueUseId"],"sources":["../../src/use-id/use-id.ts"],"sourcesContent":["import { useId as vueUseId, ref, onMounted } from 'vue'\nimport { randomId } from '../utils'\n\nexport function useId(staticId?: string) {\n if (staticId) {\n return ref(staticId)\n }\n\n const vueId = vueUseId()\n const id = ref(vueId)\n const initialized = ref(false)\n\n onMounted(() => {\n if (!initialized.value) {\n initialized.value = true\n id.value = randomId()\n }\n })\n\n return id\n}\n"],"mappings":";;;;AAGA,SAAgBA,QAAM,UAAmB;CACvC,IAAI,UACF,OAAO,IAAI,QAAQ;CAIrB,MAAM,KAAK,IADGC,MACK,CAAC;CACpB,MAAM,cAAc,IAAI,KAAK;CAE7B,gBAAgB;EACd,IAAI,CAAC,YAAY,OAAO;GACtB,YAAY,QAAQ;GACpB,GAAG,QAAQ,SAAS;EACtB;CACF,CAAC;CAED,OAAO;AACT"}
@@ -1 +1 @@
1
- export declare function useId(staticId?: string): string | import("vue").Ref<string, string>;
1
+ export declare function useId(staticId?: string): import("vue").Ref<string, string>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cck-ui/hooks",
3
- "version": "0.12.0",
3
+ "version": "0.12.2",
4
4
  "description": "A collection of hooks for state and UI management",
5
5
  "homepage": "https://cck-ui.jackatlas.xyz",
6
6
  "license": "ISC",