@openshop/vue 0.5.0 → 0.5.1
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.
- package/LICENSE.md +21 -21
- package/README.md +40 -0
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/package.json +24 -3
package/LICENSE.md
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 OpenShop contributors
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 OpenShop contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# @openshop/vue
|
|
2
|
+
|
|
3
|
+
> Vue 3 composables for [OpenShop](https://github.com/Aquafr198/OpenShop)'s
|
|
4
|
+
> framework-agnostic commerce core.
|
|
5
|
+
|
|
6
|
+
Thin Vue 3 composables over [`@openshop/core`](https://www.npmjs.com/package/@openshop/core),
|
|
7
|
+
backed by `computed` refs so components track only the state they read.
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install @openshop/vue @openshop/core vue
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Cart
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
import { provideCart, useCartCount, useCartActions } from "@openshop/vue";
|
|
19
|
+
|
|
20
|
+
// In a parent setup():
|
|
21
|
+
provideCart(cartStore);
|
|
22
|
+
|
|
23
|
+
// In any descendant:
|
|
24
|
+
const count = useCartCount(); // ComputedRef<number>
|
|
25
|
+
const { addLine, setNote } = useCartActions();
|
|
26
|
+
addLine({ merchandiseId: "gid://shopify/ProductVariant/123" });
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
`useCartActions()` exposes `addLine`, `addLines`, `updateLine`, `removeLine`,
|
|
30
|
+
`setDiscountCodes`, `setGiftCardCodes`, `setBuyerIdentity`, `setAttributes`,
|
|
31
|
+
`setNote` and `refresh`.
|
|
32
|
+
|
|
33
|
+
Also includes `useStore`, `useVariantSelection`, `usePredictiveSearch`,
|
|
34
|
+
`useLocale` and `useMoney`.
|
|
35
|
+
|
|
36
|
+
Full documentation: [monorepo README](https://github.com/Aquafr198/OpenShop#readme).
|
|
37
|
+
|
|
38
|
+
## License
|
|
39
|
+
|
|
40
|
+
[MIT](https://github.com/Aquafr198/OpenShop/blob/main/LICENSE.md)
|
package/dist/index.js
CHANGED
|
@@ -63,7 +63,11 @@ function useVariantSelection(product, initial) {
|
|
|
63
63
|
const options = computed(
|
|
64
64
|
() => productRef.value.options.map((option) => ({
|
|
65
65
|
name: option.name,
|
|
66
|
-
values: getOptionValueStates(
|
|
66
|
+
values: getOptionValueStates(
|
|
67
|
+
productRef.value,
|
|
68
|
+
option.name,
|
|
69
|
+
selection.value
|
|
70
|
+
)
|
|
67
71
|
}))
|
|
68
72
|
);
|
|
69
73
|
function setOption(optionName, value) {
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/use-store.ts","../src/cart.ts","../src/money.ts","../src/product.ts","../src/search.ts","../src/i18n.ts"],"names":["refEquals","computed","toValue","ref","provide","inject"],"mappings":";;;;AAeO,SAAS,QAAA,CACd,KAAA,EACA,QAAA,EACA,MAAA,GAAwB,SAAA,EACR;AAChB,EAAA,MAAM,QAAQ,U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EAAmC;AAC7D,EAAAC,QAAQ,OAAA,EAAS;AAAA,IACf,MAAM,OAAA,CAAQ,IAAA;AAAA,IACd,QAAQ,OAAA,CAAQ,MAAA;AAAA,IAChB,GAAI,QAAQ,MAAA,GAAS,EAAE,QAAQ,OAAA,CAAQ,MAAA,KAAW;AAAC,GACpD,CAAA;AACH;AAEA,SAAS,cAAA,GAA8B;AACrC,EAAA,MAAM,GAAA,GAAMC,OAAO,OAAO,CAAA;AAC1B,EAAA,IAAI,CAAC,GAAA,EAAK;AACR,IAAA,MAAM,IAAI,MAAM,qDAAqD,CAAA;AAAA,EACvE;AACA,EAAA,OAAO,GAAA;AACT;AAEO,SAAS,OAAA,GAAgB;AAC9B,EAAA,OAAO,gBAAe,CAAE,IAAA;AAC1B;AAEO,SAAS,SAAA,GAAoB;AAClC,EAAA,OAAO,gBAAe,CAAE,MAAA;AAC1B;AAGO,SAAS,gBAAA,GAA8D;AAC5E,EAAA,MAAM,EAAE,IAAA,EAAM,MAAA,EAAQ,MAAA,KAAW,cAAA,EAAe;AAChD,EAAA,OAAO,CAAC,MAAc,MAAA,GAAiB,MAAA,KACrC,KAAK,YAAA,CAAa,IAAA,EAAM,QAAQ,MAAM,CAAA;AAC1C","file":"index.js","sourcesContent":["import { computed, onScopeDispose, shallowRef, type ComputedRef } from \"vue\";\r\nimport {\r\n refEquals,\r\n type EqualityFn,\r\n type ReadableStore,\r\n type Selector,\r\n} from \"@openshop/core\";\r\n\r\n/**\r\n * Bridge an OpenShop reactive store into Vue's reactivity.\r\n *\r\n * Returns a read-only `ComputedRef` of the selected slice. The component (or\r\n * effect scope) re-renders only when the selected value changes according to\r\n * `equals`. The subscription is torn down automatically via `onScopeDispose`.\r\n */\r\nexport function useStore<T, R>(\r\n store: ReadableStore<T>,\r\n selector: Selector<T, R>,\r\n equals: EqualityFn<R> = refEquals,\r\n): ComputedRef<R> {\r\n const state = shallowRef(selector(store.get())) as { value: R };\r\n\r\n const unsubscribe = store.subscribeRaw(() => {\r\n const next = selector(store.get());\r\n if (!equals(state.value, next)) state.value = next;\r\n });\r\n\r\n onScopeDispose(unsubscribe);\r\n\r\n return computed(() => state.value);\r\n}\r\n","import { inject, provide, type ComputedRef, type InjectionKey } from \"vue\";\r\nimport {\r\n refEquals,\r\n type CartState,\r\n type CartStore,\r\n type EqualityFn,\r\n} from \"@openshop/core\";\r\nimport { useStore } from \"./use-store.js\";\r\n\r\nconst CartKey: InjectionKey<CartStore> = Symbol(\"openshop-cart\");\r\n\r\n/** Provide a `CartStore` to descendant components. Call in a parent `setup`. */\r\nexport function provideCart(store: CartStore): void {\r\n provide(CartKey, store);\r\n}\r\n\r\n/** Access the raw cart store. Throws if no `provideCart` ancestor exists. */\r\nexport function useCartStore(): CartStore {\r\n const store = inject(CartKey);\r\n if (!store) {\r\n throw new Error(\"useCartStore requires a provideCart() ancestor.\");\r\n }\r\n return store;\r\n}\r\n\r\n/** Reactive selector over cart state. */\r\nexport function useCart<R>(\r\n selector: (state: CartState) => R,\r\n equals: EqualityFn<R> = refEquals,\r\n): ComputedRef<R> {\r\n return useStore(useCartStore(), selector, equals);\r\n}\r\n\r\n/** The cart mutation actions. */\r\nexport function useCartActions() {\r\n const store = useCartStore();\r\n return {\r\n addLine: store.addLine.bind(store),\r\n addLines: store.addLines.bind(store),\r\n updateLine: store.updateLine.bind(store),\r\n removeLine: store.removeLine.bind(store),\r\n setDiscountCodes: store.setDiscountCodes.bind(store),\r\n setGiftCardCodes: store.setGiftCardCodes.bind(store),\r\n setBuyerIdentity: store.setBuyerIdentity.bind(store),\r\n setAttributes: store.setAttributes.bind(store),\r\n setNote: store.setNote.bind(store),\r\n refresh: store.refresh.bind(store),\r\n };\r\n}\r\n\r\n/** Convenience: total item count. */\r\nexport function useCartCount(): ComputedRef<number> {\r\n return useCart((s) => s.cart?.totalQuantity ?? 0);\r\n}\r\n\r\n/** Convenience: whether a cart operation is in flight. */\r\nexport function useCartIsUpdating(): ComputedRef<boolean> {\r\n return useCart((s) => s.status === \"updating\");\r\n}\r\n","import { computed, toValue, type ComputedRef, type MaybeRefOrGetter } from \"vue\";\r\nimport {\r\n formatMoney,\r\n type FormatMoneyOptions,\r\n type MoneyV2,\r\n} from \"@openshop/core\";\r\n\r\n/** Reactive money formatting. Accepts a ref, getter or plain value. */\r\nexport function useMoney(\r\n money: MaybeRefOrGetter<MoneyV2 | null | undefined>,\r\n options?: FormatMoneyOptions,\r\n): ComputedRef<string> {\r\n return computed(() => {\r\n const value = toValue(money);\r\n return value ? formatMoney(value, options) : \"\";\r\n });\r\n}\r\n","import {\r\n computed,\r\n ref,\r\n toValue,\r\n type ComputedRef,\r\n type MaybeRefOrGetter,\r\n type Ref,\r\n} from \"vue\";\r\nimport {\r\n findVariantBySelection,\r\n getInitialSelection,\r\n getOptionValueStates,\r\n type OptionSelection,\r\n type OptionValueState,\r\n type Product,\r\n type ProductVariant,\r\n} from \"@openshop/core\";\r\n\r\nexport interface UseVariantSelection {\r\n selection: Ref<OptionSelection>;\r\n selectedVariant: ComputedRef<ProductVariant | undefined>;\r\n options: ComputedRef<{ name: string; values: OptionValueState[] }[]>;\r\n setOption: (optionName: string, value: string) => void;\r\n}\r\n\r\n/**\r\n * Reactive variant selection for a product page. `product` may be a ref/getter\r\n * so the selection re-derives when the product changes.\r\n */\r\nexport function useVariantSelection(\r\n product: MaybeRefOrGetter<Product>,\r\n initial?: OptionSelection,\r\n): UseVariantSelection {\r\n const productRef = computed(() => toValue(product));\r\n const selection = ref<OptionSelection>(\r\n initial ?? getInitialSelection(productRef.value),\r\n );\r\n\r\n const selectedVariant = computed(() =>\r\n findVariantBySelection(productRef.value, selection.value),\r\n );\r\n\r\n const options = computed(() =>\r\n productRef.value.options.map((option) => ({\r\n name: option.name,\r\n values: getOptionValueStates(productRef.value, option.name, selection.value),\r\n })),\r\n );\r\n\r\n function setOption(optionName: string, value: string): void {\r\n selection.value = { ...selection.value, [optionName]: value };\r\n }\r\n\r\n return { selection, selectedVariant, options, setOption };\r\n}\r\n","import { ref, watch, type Ref } from \"vue\";\r\nimport type { PredictiveSearchResult } from \"@openshop/core\";\r\n\r\nconst EMPTY: PredictiveSearchResult = {\r\n products: [],\r\n collections: [],\r\n pages: [],\r\n articles: [],\r\n queries: [],\r\n};\r\n\r\nexport interface UsePredictiveSearchOptions {\r\n debounceMs?: number;\r\n minLength?: number;\r\n}\r\n\r\nexport interface UsePredictiveSearch {\r\n term: Ref<string>;\r\n results: Ref<PredictiveSearchResult>;\r\n loading: Ref<boolean>;\r\n error: Ref<unknown>;\r\n clear: () => void;\r\n}\r\n\r\n/**\r\n * Debounced predictive search with stale-response protection. Watches `term`\r\n * and discards late responses for outdated terms.\r\n */\r\nexport function usePredictiveSearch(\r\n search: (term: string) => Promise<PredictiveSearchResult>,\r\n options: UsePredictiveSearchOptions = {},\r\n): UsePredictiveSearch {\r\n const { debounceMs = 200, minLength = 2 } = options;\r\n const term = ref(\"\");\r\n const results = ref<PredictiveSearchResult>(EMPTY);\r\n const loading = ref(false);\r\n const error = ref<unknown>(null);\r\n\r\n let requestId = 0;\r\n let timer: ReturnType<typeof setTimeout> | undefined;\r\n\r\n function clear(): void {\r\n requestId += 1;\r\n if (timer) clearTimeout(timer);\r\n term.value = \"\";\r\n results.value = EMPTY;\r\n loading.value = false;\r\n error.value = null;\r\n }\r\n\r\n watch(term, (value) => {\r\n if (timer) clearTimeout(timer);\r\n const trimmed = value.trim();\r\n if (trimmed.length < minLength) {\r\n results.value = EMPTY;\r\n loading.value = false;\r\n return;\r\n }\r\n const id = ++requestId;\r\n loading.value = true;\r\n timer = setTimeout(async () => {\r\n try {\r\n const next = await search(trimmed);\r\n if (id === requestId) {\r\n results.value = next;\r\n error.value = null;\r\n }\r\n } catch (err) {\r\n if (id === requestId) error.value = err;\r\n } finally {\r\n if (id === requestId) loading.value = false;\r\n }\r\n }, debounceMs);\r\n });\r\n\r\n return { term, results, loading, error, clear };\r\n}\r\n","import { inject, provide, type InjectionKey } from \"vue\";\r\nimport type { I18n, Locale } from \"@openshop/core\";\r\n\r\ninterface I18nContext {\r\n i18n: I18n;\r\n locale: Locale;\r\n origin?: string;\r\n}\r\n\r\nconst I18nKey: InjectionKey<I18nContext> = Symbol(\"openshop-i18n\");\r\n\r\nexport interface ProvideI18nOptions {\r\n i18n: I18n;\r\n /** Active locale, typically resolved server-side via `i18n.match`. */\r\n locale: Locale;\r\n origin?: string;\r\n}\r\n\r\nexport function provideI18n(options: ProvideI18nOptions): void {\r\n provide(I18nKey, {\r\n i18n: options.i18n,\r\n locale: options.locale,\r\n ...(options.origin ? { origin: options.origin } : {}),\r\n });\r\n}\r\n\r\nfunction useI18nContext(): I18nContext {\r\n const ctx = inject(I18nKey);\r\n if (!ctx) {\r\n throw new Error(\"useLocale/useI18n require a provideI18n() ancestor.\");\r\n }\r\n return ctx;\r\n}\r\n\r\nexport function useI18n(): I18n {\r\n return useI18nContext().i18n;\r\n}\r\n\r\nexport function useLocale(): Locale {\r\n return useI18nContext().locale;\r\n}\r\n\r\n/** Returns a path localizer bound to the active locale (override per call). */\r\nexport function useLocalizedPath(): (path: string, locale?: Locale) => string {\r\n const { i18n, locale, origin } = useI18nContext();\r\n return (path: string, target: Locale = locale) =>\r\n i18n.localizePath(path, target, origin);\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/use-store.ts","../src/cart.ts","../src/money.ts","../src/product.ts","../src/search.ts","../src/i18n.ts"],"names":["refEquals","computed","toValue","ref","provide","inject"],"mappings":";;;;AAeO,SAAS,QAAA,CACd,KAAA,EACA,QAAA,EACA,MAAA,GAAwB,SAAA,EACR;AAChB,EAAA,MAAM,QAAQ,UAAA,CAAW,QAAA,CAAS,KAAA,CAAM,GAAA,EAAK,CAAC,CAAA;AAE9C,EAAA,MAAM,WAAA,GAAc,KAAA,CAAM,YAAA,CAAa,MAAM;AAC3C,IAAA,MAAM,IAAA,GAAO,QAAA,CAAS,KAAA,CAAM,GAAA,EAAK,CAAA;AACjC,IAAA,IAAI,CAAC,MAAA,CA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GACpD,CAAA;AACH;AAEA,SAAS,cAAA,GAA8B;AACrC,EAAA,MAAM,GAAA,GAAMC,OAAO,OAAO,CAAA;AAC1B,EAAA,IAAI,CAAC,GAAA,EAAK;AACR,IAAA,MAAM,IAAI,MAAM,qDAAqD,CAAA;AAAA,EACvE;AACA,EAAA,OAAO,GAAA;AACT;AAEO,SAAS,OAAA,GAAgB;AAC9B,EAAA,OAAO,gBAAe,CAAE,IAAA;AAC1B;AAEO,SAAS,SAAA,GAAoB;AAClC,EAAA,OAAO,gBAAe,CAAE,MAAA;AAC1B;AAGO,SAAS,gBAAA,GAA8D;AAC5E,EAAA,MAAM,EAAE,IAAA,EAAM,MAAA,EAAQ,MAAA,KAAW,cAAA,EAAe;AAChD,EAAA,OAAO,CAAC,MAAc,MAAA,GAAiB,MAAA,KACrC,KAAK,YAAA,CAAa,IAAA,EAAM,QAAQ,MAAM,CAAA;AAC1C","file":"index.js","sourcesContent":["import { computed, onScopeDispose, shallowRef, type ComputedRef } from \"vue\";\nimport {\n refEquals,\n type EqualityFn,\n type ReadableStore,\n type Selector,\n} from \"@openshop/core\";\n\n/**\n * Bridge an OpenShop reactive store into Vue's reactivity.\n *\n * Returns a read-only `ComputedRef` of the selected slice. The component (or\n * effect scope) re-renders only when the selected value changes according to\n * `equals`. The subscription is torn down automatically via `onScopeDispose`.\n */\nexport function useStore<T, R>(\n store: ReadableStore<T>,\n selector: Selector<T, R>,\n equals: EqualityFn<R> = refEquals,\n): ComputedRef<R> {\n const state = shallowRef(selector(store.get())) as { value: R };\n\n const unsubscribe = store.subscribeRaw(() => {\n const next = selector(store.get());\n if (!equals(state.value, next)) state.value = next;\n });\n\n onScopeDispose(unsubscribe);\n\n return computed(() => state.value);\n}\n","import { inject, provide, type ComputedRef, type InjectionKey } from \"vue\";\nimport {\n refEquals,\n type CartState,\n type CartStore,\n type EqualityFn,\n} from \"@openshop/core\";\nimport { useStore } from \"./use-store.js\";\n\nconst CartKey: InjectionKey<CartStore> = Symbol(\"openshop-cart\");\n\n/** Provide a `CartStore` to descendant components. Call in a parent `setup`. */\nexport function provideCart(store: CartStore): void {\n provide(CartKey, store);\n}\n\n/** Access the raw cart store. Throws if no `provideCart` ancestor exists. */\nexport function useCartStore(): CartStore {\n const store = inject(CartKey);\n if (!store) {\n throw new Error(\"useCartStore requires a provideCart() ancestor.\");\n }\n return store;\n}\n\n/** Reactive selector over cart state. */\nexport function useCart<R>(\n selector: (state: CartState) => R,\n equals: EqualityFn<R> = refEquals,\n): ComputedRef<R> {\n return useStore(useCartStore(), selector, equals);\n}\n\n/** The cart mutation actions. */\nexport function useCartActions() {\n const store = useCartStore();\n return {\n addLine: store.addLine.bind(store),\n addLines: store.addLines.bind(store),\n updateLine: store.updateLine.bind(store),\n removeLine: store.removeLine.bind(store),\n setDiscountCodes: store.setDiscountCodes.bind(store),\n setGiftCardCodes: store.setGiftCardCodes.bind(store),\n setBuyerIdentity: store.setBuyerIdentity.bind(store),\n setAttributes: store.setAttributes.bind(store),\n setNote: store.setNote.bind(store),\n refresh: store.refresh.bind(store),\n };\n}\n\n/** Convenience: total item count. */\nexport function useCartCount(): ComputedRef<number> {\n return useCart((s) => s.cart?.totalQuantity ?? 0);\n}\n\n/** Convenience: whether a cart operation is in flight. */\nexport function useCartIsUpdating(): ComputedRef<boolean> {\n return useCart((s) => s.status === \"updating\");\n}\n","import {\n computed,\n toValue,\n type ComputedRef,\n type MaybeRefOrGetter,\n} from \"vue\";\nimport {\n formatMoney,\n type FormatMoneyOptions,\n type MoneyV2,\n} from \"@openshop/core\";\n\n/** Reactive money formatting. Accepts a ref, getter or plain value. */\nexport function useMoney(\n money: MaybeRefOrGetter<MoneyV2 | null | undefined>,\n options?: FormatMoneyOptions,\n): ComputedRef<string> {\n return computed(() => {\n const value = toValue(money);\n return value ? formatMoney(value, options) : \"\";\n });\n}\n","import {\n computed,\n ref,\n toValue,\n type ComputedRef,\n type MaybeRefOrGetter,\n type Ref,\n} from \"vue\";\nimport {\n findVariantBySelection,\n getInitialSelection,\n getOptionValueStates,\n type OptionSelection,\n type OptionValueState,\n type Product,\n type ProductVariant,\n} from \"@openshop/core\";\n\nexport interface UseVariantSelection {\n selection: Ref<OptionSelection>;\n selectedVariant: ComputedRef<ProductVariant | undefined>;\n options: ComputedRef<{ name: string; values: OptionValueState[] }[]>;\n setOption: (optionName: string, value: string) => void;\n}\n\n/**\n * Reactive variant selection for a product page. `product` may be a ref/getter\n * so the selection re-derives when the product changes.\n */\nexport function useVariantSelection(\n product: MaybeRefOrGetter<Product>,\n initial?: OptionSelection,\n): UseVariantSelection {\n const productRef = computed(() => toValue(product));\n const selection = ref<OptionSelection>(\n initial ?? getInitialSelection(productRef.value),\n );\n\n const selectedVariant = computed(() =>\n findVariantBySelection(productRef.value, selection.value),\n );\n\n const options = computed(() =>\n productRef.value.options.map((option) => ({\n name: option.name,\n values: getOptionValueStates(\n productRef.value,\n option.name,\n selection.value,\n ),\n })),\n );\n\n function setOption(optionName: string, value: string): void {\n selection.value = { ...selection.value, [optionName]: value };\n }\n\n return { selection, selectedVariant, options, setOption };\n}\n","import { ref, watch, type Ref } from \"vue\";\nimport type { PredictiveSearchResult } from \"@openshop/core\";\n\nconst EMPTY: PredictiveSearchResult = {\n products: [],\n collections: [],\n pages: [],\n articles: [],\n queries: [],\n};\n\nexport interface UsePredictiveSearchOptions {\n debounceMs?: number;\n minLength?: number;\n}\n\nexport interface UsePredictiveSearch {\n term: Ref<string>;\n results: Ref<PredictiveSearchResult>;\n loading: Ref<boolean>;\n error: Ref<unknown>;\n clear: () => void;\n}\n\n/**\n * Debounced predictive search with stale-response protection. Watches `term`\n * and discards late responses for outdated terms.\n */\nexport function usePredictiveSearch(\n search: (term: string) => Promise<PredictiveSearchResult>,\n options: UsePredictiveSearchOptions = {},\n): UsePredictiveSearch {\n const { debounceMs = 200, minLength = 2 } = options;\n const term = ref(\"\");\n const results = ref<PredictiveSearchResult>(EMPTY);\n const loading = ref(false);\n const error = ref<unknown>(null);\n\n let requestId = 0;\n let timer: ReturnType<typeof setTimeout> | undefined;\n\n function clear(): void {\n requestId += 1;\n if (timer) clearTimeout(timer);\n term.value = \"\";\n results.value = EMPTY;\n loading.value = false;\n error.value = null;\n }\n\n watch(term, (value) => {\n if (timer) clearTimeout(timer);\n const trimmed = value.trim();\n if (trimmed.length < minLength) {\n results.value = EMPTY;\n loading.value = false;\n return;\n }\n const id = ++requestId;\n loading.value = true;\n timer = setTimeout(async () => {\n try {\n const next = await search(trimmed);\n if (id === requestId) {\n results.value = next;\n error.value = null;\n }\n } catch (err) {\n if (id === requestId) error.value = err;\n } finally {\n if (id === requestId) loading.value = false;\n }\n }, debounceMs);\n });\n\n return { term, results, loading, error, clear };\n}\n","import { inject, provide, type InjectionKey } from \"vue\";\nimport type { I18n, Locale } from \"@openshop/core\";\n\ninterface I18nContext {\n i18n: I18n;\n locale: Locale;\n origin?: string;\n}\n\nconst I18nKey: InjectionKey<I18nContext> = Symbol(\"openshop-i18n\");\n\nexport interface ProvideI18nOptions {\n i18n: I18n;\n /** Active locale, typically resolved server-side via `i18n.match`. */\n locale: Locale;\n origin?: string;\n}\n\nexport function provideI18n(options: ProvideI18nOptions): void {\n provide(I18nKey, {\n i18n: options.i18n,\n locale: options.locale,\n ...(options.origin ? { origin: options.origin } : {}),\n });\n}\n\nfunction useI18nContext(): I18nContext {\n const ctx = inject(I18nKey);\n if (!ctx) {\n throw new Error(\"useLocale/useI18n require a provideI18n() ancestor.\");\n }\n return ctx;\n}\n\nexport function useI18n(): I18n {\n return useI18nContext().i18n;\n}\n\nexport function useLocale(): Locale {\n return useI18nContext().locale;\n}\n\n/** Returns a path localizer bound to the active locale (override per call). */\nexport function useLocalizedPath(): (path: string, locale?: Locale) => string {\n const { i18n, locale, origin } = useI18nContext();\n return (path: string, target: Locale = locale) =>\n i18n.localizePath(path, target, origin);\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,12 +1,33 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openshop/vue",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"description": "Vue 3 bindings for OpenShop's framework-agnostic commerce core.",
|
|
5
5
|
"license": "MIT",
|
|
6
|
+
"author": "Aquafr198",
|
|
7
|
+
"homepage": "https://github.com/Aquafr198/OpenShop#readme",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/Aquafr198/OpenShop.git",
|
|
11
|
+
"directory": "packages/vue"
|
|
12
|
+
},
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/Aquafr198/OpenShop/issues"
|
|
15
|
+
},
|
|
16
|
+
"keywords": [
|
|
17
|
+
"shopify",
|
|
18
|
+
"headless",
|
|
19
|
+
"commerce",
|
|
20
|
+
"storefront",
|
|
21
|
+
"vue",
|
|
22
|
+
"ecommerce",
|
|
23
|
+
"hydrogen",
|
|
24
|
+
"cart"
|
|
25
|
+
],
|
|
6
26
|
"type": "module",
|
|
7
27
|
"sideEffects": false,
|
|
8
28
|
"files": [
|
|
9
|
-
"dist"
|
|
29
|
+
"dist",
|
|
30
|
+
"README.md"
|
|
10
31
|
],
|
|
11
32
|
"exports": {
|
|
12
33
|
".": {
|
|
@@ -18,7 +39,7 @@
|
|
|
18
39
|
"vue": ">=3.4.0"
|
|
19
40
|
},
|
|
20
41
|
"dependencies": {
|
|
21
|
-
"@openshop/core": "0.5.
|
|
42
|
+
"@openshop/core": "0.5.1"
|
|
22
43
|
},
|
|
23
44
|
"devDependencies": {
|
|
24
45
|
"@vue/test-utils": "^2.4.6",
|