cloudcommerce 0.37.1 → 0.38.0
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/.github/workflows/test-apps.yml +2 -2
- package/.vscode/settings.json +1 -1
- package/CHANGELOG.md +36 -0
- package/action.yml +2 -2
- package/ecomplus-stores/barra-doce/functions/many/package.json +3 -3
- package/ecomplus-stores/barra-doce/functions/ssr/package.json +6 -6
- package/ecomplus-stores/barra-doce/functions/with-apps/package.json +3 -3
- package/ecomplus-stores/barra-doce/package.json +2 -2
- package/package.json +7 -7
- package/packages/api/lib/api.d.ts +2 -2
- package/packages/api/package.json +1 -1
- package/packages/api/types.d.ts +4 -1
- package/packages/apps/affilate-program/package.json +1 -1
- package/packages/apps/correios/package.json +1 -1
- package/packages/apps/custom-payment/package.json +1 -1
- package/packages/apps/custom-shipping/package.json +1 -1
- package/packages/apps/datafrete/package.json +1 -1
- package/packages/apps/discounts/package.json +1 -1
- package/packages/apps/emails/package.json +1 -1
- package/packages/apps/fb-conversions/package.json +1 -1
- package/packages/apps/flash-courier/package.json +1 -1
- package/packages/apps/frenet/package.json +1 -1
- package/packages/apps/galaxpay/package.json +1 -1
- package/packages/apps/google-analytics/package.json +1 -1
- package/packages/apps/jadlog/package.json +1 -1
- package/packages/apps/loyalty-points/package.json +1 -1
- package/packages/apps/mandae/package.json +1 -1
- package/packages/apps/melhor-envio/package.json +1 -1
- package/packages/apps/mercadopago/package.json +1 -1
- package/packages/apps/pagarme/package.json +1 -1
- package/packages/apps/pagarme-v5/package.json +1 -1
- package/packages/apps/paghiper/package.json +1 -1
- package/packages/apps/pix/package.json +1 -1
- package/packages/apps/tiny-erp/package.json +1 -1
- package/packages/apps/webhooks/package.json +1 -1
- package/packages/cli/config/firestore.rules +4 -1
- package/packages/cli/lib/cli.js +30 -9
- package/packages/cli/package.json +2 -1
- package/packages/cli/src/cli.ts +37 -9
- package/packages/config/package.json +1 -1
- package/packages/emails/package.json +1 -1
- package/packages/eslint/package.json +3 -3
- package/packages/events/package.json +1 -1
- package/packages/feeds/package.json +1 -1
- package/packages/firebase/package.json +1 -1
- package/packages/i18n/package.json +1 -1
- package/packages/modules/package.json +1 -1
- package/packages/passport/package.json +1 -1
- package/packages/ssr/package.json +5 -5
- package/packages/storefront/.auto-imports.d.ts +1 -0
- package/packages/storefront/client.d.ts +1 -0
- package/packages/storefront/config/storefront.tailwind.cjs +21 -20
- package/packages/storefront/config/storefront.unocss.cjs +11 -0
- package/packages/storefront/dist/client/_astro/{AccountPage.700be123.js → AccountPage.j0C5JBLY.js} +1 -1
- package/packages/storefront/dist/client/_astro/{CartSidebar.430b55df.js → CartSidebar.1kUFk9Xn.js} +1 -1
- package/packages/storefront/dist/client/_astro/HeroSlider.tR1dVXyu.js +1 -0
- package/packages/storefront/dist/client/_astro/{PitchBar.06e0f831.js → PitchBar.FelC04wE.js} +1 -1
- package/packages/storefront/dist/client/_astro/{Prices.0e829c31.js → Prices.PuQc6C7F.js} +1 -1
- package/packages/storefront/dist/client/_astro/ProductCard.ephJafAE.js +1 -0
- package/packages/storefront/dist/client/_astro/ProductDetails.B6Ih5MGf.js +7 -0
- package/packages/storefront/dist/client/_astro/ProductShelf.GESxuPZ_.js +1 -0
- package/packages/storefront/dist/client/_astro/{QuantitySelector.ebf60845.js → QuantitySelector.YNmWjN8y.js} +1 -1
- package/packages/storefront/dist/client/_astro/SearchContainer.BzixfU3R.js +1 -0
- package/packages/storefront/dist/client/_astro/SearchModal.F7vbwxIv.js +1 -0
- package/packages/storefront/dist/client/_astro/ShopHeader.5vR1LgSW.js +10 -0
- package/packages/storefront/dist/client/_astro/_plugin-vue_export-helper.sk5AFsEV.js +1 -0
- package/packages/storefront/dist/client/_astro/_slug_.r8QHNfdw.css +1 -0
- package/packages/storefront/dist/client/_astro/client.RF8UxjZd.js +1 -0
- package/packages/storefront/dist/client/_astro/customer-session._VkzXnXT.js +7 -0
- package/packages/storefront/dist/client/_astro/ecom-utils.gJYgRPRz.js +1 -0
- package/packages/storefront/dist/client/_astro/{firebase-app.992a296f.js → firebase-app.cPMfoOsn.js} +1 -1
- package/packages/storefront/dist/client/_astro/{format-money.9cf6b04d.js → format-money.FMQXgKHB.js} +1 -1
- package/packages/storefront/dist/client/_astro/{hoisted.c90fc6ab.js → hoisted.B6fKrLPR.js} +1 -1
- package/packages/storefront/dist/client/_astro/{hoisted.54eaab04.js → hoisted._FbzheVm.js} +1 -1
- package/packages/storefront/dist/client/_astro/{i18n.29216eeb.js → i18n.m7SpISxy.js} +1 -1
- package/packages/storefront/dist/client/_astro/{img.4f23a3dd.js → img.zh-Drf-O.js} +1 -1
- package/packages/storefront/dist/client/_astro/{index-61e5ac61.bdc8d0cd.js → index-dd468b12.D5s8VdAL.js} +92 -107
- package/packages/storefront/dist/client/_astro/{index.570b84fe.js → index.5PN-EYMS.js} +1 -1
- package/packages/storefront/dist/client/_astro/index.XrHFaN2F.js +1 -0
- package/packages/storefront/dist/client/_astro/{modules-info.55780599.js → modules-info.sD0tdb2b.js} +1 -1
- package/packages/storefront/dist/client/_astro/name.HU5l7TJo.js +1 -0
- package/packages/storefront/dist/client/_astro/{photoswipe-lightbox.esm.c157838f.js → photoswipe-lightbox.esm.dZBqKD9u.js} +1 -1
- package/packages/storefront/dist/client/_astro/{photoswipe.01431ec7.js → photoswipe.0V7m2jWu.js} +1 -2
- package/packages/storefront/dist/client/_astro/{photoswipe.esm.92c2d901.js → photoswipe.esm.Ylh9TGkz.js} +1 -1
- package/packages/storefront/dist/client/_astro/sf-utils.5t7r9A2G.js +1 -0
- package/packages/storefront/dist/client/_astro/{shopping-cart.d9f601dd.js → shopping-cart.A-1jhlKi.js} +1 -1
- package/packages/storefront/dist/client/_astro/use-analytics.1EVxbrS7.js +1 -0
- package/packages/storefront/dist/client/_astro/{use-product-card.437911bb.js → use-product-card.erbOV6Fv.js} +1 -1
- package/packages/storefront/dist/client/robots.txt +1 -0
- package/packages/storefront/dist/server/chunks/{CartSidebar_eab28771.mjs → CartSidebar_hAgJQJgm.mjs} +1 -1
- package/packages/storefront/dist/server/chunks/SearchModal_eWb5SdQM.mjs +351 -0
- package/packages/storefront/dist/server/chunks/{_.._5a781fb3.mjs → _.._S7DDBn_b.mjs} +1 -1
- package/packages/storefront/dist/server/chunks/{account_519edb70.mjs → account_3ySmGzMc.mjs} +1 -1
- package/packages/storefront/dist/server/chunks/astro/{assets-service_a9d9ab5f.mjs → assets-service_QlOZG8ov.mjs} +1 -1
- package/packages/storefront/dist/server/chunks/{astro_d98f7186.mjs → astro_zcC1GStV.mjs} +17 -34
- package/packages/storefront/dist/server/chunks/{index_5e3ed8a0.mjs → index_nIwq11oA.mjs} +1 -1
- package/packages/storefront/dist/server/chunks/{index_10e14f85.mjs → index_uAR5ZV4d.mjs} +1 -1
- package/packages/storefront/dist/server/chunks/{node_1119b0d1.mjs → node_2VvC7trl.mjs} +1 -1
- package/packages/storefront/dist/server/chunks/pages/{__93ade2dd.mjs → __MSibDuuV.mjs} +652 -255
- package/packages/storefront/dist/server/chunks/pages/{account_e5d410a7.mjs → account_iG-YqJ5q.mjs} +3 -2
- package/packages/storefront/dist/server/chunks/pages/{index_7e25afc1.mjs → index_BtDyKPh_.mjs} +3 -2
- package/packages/storefront/dist/server/chunks/pages/{node_bd378ac0.mjs → node_bKqL47eZ.mjs} +2 -2
- package/packages/storefront/dist/server/chunks/pages/{~fallback_73578d2f.mjs → ~fallback_73R5VA6j.mjs} +3 -2
- package/packages/storefront/dist/server/chunks/{photoswipe_9528923e.mjs → photoswipe_IcWDJiwc.mjs} +1 -1
- package/packages/storefront/dist/server/chunks/{~fallback_41122b9b.mjs → ~fallback_7q1dqY4e.mjs} +1 -1
- package/packages/storefront/dist/server/entry.mjs +970 -93
- package/packages/storefront/dist/server/manifest_dSwvaOdW.mjs +195 -0
- package/packages/storefront/dist/server/renderers.mjs +2 -2
- package/packages/storefront/package.json +12 -12
- package/packages/storefront/src/helpers/sf-utils.ts +29 -1
- package/packages/storefront/src/lib/composables/use-search-container.ts +48 -0
- package/packages/storefront/src/lib/composables/use-search-modal.ts +1 -1
- package/packages/storefront/src/lib/composables/use-shop-header.ts +14 -5
- package/packages/storefront/src/lib/composables/use-sticky-header.ts +2 -0
- package/packages/storefront/src/lib/layouts/BaseHead.astro +8 -1
- package/packages/storefront/src/lib/layouts/use-page-main.ts +15 -0
- package/packages/storefront/src/lib/scripts/firestore.ts +27 -0
- package/packages/storefront/src/lib/ssr-context.ts +14 -0
- package/packages/storefront/src/lib/state/search-engine.ts +62 -25
- package/packages/storefront/src/lib/state/use-analytics.ts +9 -10
- package/packages/test-base/package.json +1 -1
- package/packages/types/package.json +1 -1
- package/packages/storefront/dist/client/_astro/HeroSlider.bd684ed8.js +0 -1
- package/packages/storefront/dist/client/_astro/ProductDetails.06da998d.js +0 -1
- package/packages/storefront/dist/client/_astro/ProductShelf.3f4f38b5.js +0 -1
- package/packages/storefront/dist/client/_astro/ProductShelf.bf82838b.js +0 -1
- package/packages/storefront/dist/client/_astro/SearchModal.b6aa5ef7.js +0 -1
- package/packages/storefront/dist/client/_astro/ShopHeader.2d6e361a.js +0 -4
- package/packages/storefront/dist/client/_astro/_plugin-vue_export-helper.f75743ee.js +0 -1
- package/packages/storefront/dist/client/_astro/_slug_.e7cac999.css +0 -1
- package/packages/storefront/dist/client/_astro/client.41b42098.js +0 -1
- package/packages/storefront/dist/client/_astro/customer-session.5ab9ab1a.js +0 -1
- package/packages/storefront/dist/client/_astro/ecom-utils.5cbfb95e.js +0 -1
- package/packages/storefront/dist/client/_astro/index.8ac1db99.js +0 -1
- package/packages/storefront/dist/client/_astro/name.01410784.js +0 -1
- package/packages/storefront/dist/client/_astro/sf-utils.b04e1813.js +0 -1
- package/packages/storefront/dist/client/_astro/use-analytics.cc95e346.js +0 -1
- package/packages/storefront/dist/server/chunks/SearchModal_f66549d4.mjs +0 -147
- package/packages/storefront/dist/server/manifest_221d806b.mjs +0 -1069
- /package/packages/storefront/dist/client/_astro/{afetch.f4507208.js → afetch.5c8VmT0-.js} +0 -0
- /package/packages/storefront/dist/client/_astro/{img-sizes.41e0efe4.js → img-sizes.gxAI9JNh.js} +0 -0
- /package/packages/storefront/dist/client/_astro/{price.04ceb6c4.js → price.Easct8WC.js} +0 -0
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
import { ref, shallowReactive, watch, defineComponent, toRef, resolveComponent, withCtx, openBlock, createBlock, Fragment, renderList, toDisplayString, useSSRContext } from 'vue';
|
|
2
|
-
import { useDebounceFn } from '@vueuse/core';
|
|
3
|
-
import api from '@cloudcommerce/api';
|
|
4
|
-
import { h as useStorage, _ as _export_sfc, P as ProductShelf } from './pages/__93ade2dd.mjs';
|
|
5
|
-
import { ssrRenderAttrs, ssrRenderComponent, ssrRenderList, ssrInterpolate } from 'vue/server-renderer';
|
|
6
|
-
|
|
7
|
-
const storageKey = "ecomSeachHistory";
|
|
8
|
-
const searchHistory = useStorage(storageKey, []);
|
|
9
|
-
const search = async ({
|
|
10
|
-
term,
|
|
11
|
-
params,
|
|
12
|
-
fields,
|
|
13
|
-
url = "search/v1"
|
|
14
|
-
}) => {
|
|
15
|
-
term = term.trim();
|
|
16
|
-
if (term.length < 2) {
|
|
17
|
-
return { data: { result: [], meta: null } };
|
|
18
|
-
}
|
|
19
|
-
const response = await api.get(url, {
|
|
20
|
-
fields,
|
|
21
|
-
params: {
|
|
22
|
-
...params,
|
|
23
|
-
term
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
if (response.data.result.length && !searchHistory.includes(term)) {
|
|
27
|
-
const termIndex = searchHistory.findIndex((_term) => term.startsWith(_term));
|
|
28
|
-
if (termIndex > -1) {
|
|
29
|
-
searchHistory[termIndex] = term;
|
|
30
|
-
} else {
|
|
31
|
-
searchHistory.unshift(term);
|
|
32
|
-
}
|
|
33
|
-
while (searchHistory.length > 20) {
|
|
34
|
-
searchHistory.pop();
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
return response;
|
|
38
|
-
};
|
|
39
|
-
class SearchEngine {
|
|
40
|
-
url;
|
|
41
|
-
fields;
|
|
42
|
-
term = ref("");
|
|
43
|
-
params = shallowReactive({});
|
|
44
|
-
pageSize = ref(24);
|
|
45
|
-
pageNumber = ref(1);
|
|
46
|
-
products = shallowReactive([]);
|
|
47
|
-
#search;
|
|
48
|
-
constructor({
|
|
49
|
-
fields,
|
|
50
|
-
url = "search/v1",
|
|
51
|
-
debounce = 150
|
|
52
|
-
} = {}) {
|
|
53
|
-
this.fields = fields;
|
|
54
|
-
this.url = url;
|
|
55
|
-
this.products = shallowReactive([]);
|
|
56
|
-
this.#search = useDebounceFn(search, debounce);
|
|
57
|
-
watch([this.term, this.params], () => {
|
|
58
|
-
this.pageNumber.value = 1;
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
async fetch(term) {
|
|
62
|
-
if (term && term !== this.term.value) {
|
|
63
|
-
this.term.value = term;
|
|
64
|
-
this.pageNumber.value = 1;
|
|
65
|
-
}
|
|
66
|
-
const limit = this.pageSize.value;
|
|
67
|
-
const offset = limit * (this.pageNumber.value - 1);
|
|
68
|
-
const response = await this.#search({
|
|
69
|
-
term: this.term.value,
|
|
70
|
-
params: {
|
|
71
|
-
limit,
|
|
72
|
-
offset,
|
|
73
|
-
...this.params
|
|
74
|
-
},
|
|
75
|
-
url: this.url,
|
|
76
|
-
fields: this.fields
|
|
77
|
-
});
|
|
78
|
-
if (response) {
|
|
79
|
-
const { data } = response;
|
|
80
|
-
if (data.meta) {
|
|
81
|
-
this.products.splice(0);
|
|
82
|
-
}
|
|
83
|
-
data.result.forEach((item) => this.products.push(item));
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
89
|
-
__name: "SearchModal",
|
|
90
|
-
props: {
|
|
91
|
-
term: {}
|
|
92
|
-
},
|
|
93
|
-
setup(__props, { expose: __expose }) {
|
|
94
|
-
__expose();
|
|
95
|
-
const props = __props;
|
|
96
|
-
const searchEngine = new SearchEngine();
|
|
97
|
-
watch(toRef(props, "term"), (term) => searchEngine.fetch(term));
|
|
98
|
-
const __returned__ = { props, searchEngine, get searchHistory() {
|
|
99
|
-
return searchHistory;
|
|
100
|
-
}, ProductShelf };
|
|
101
|
-
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
|
|
102
|
-
return __returned__;
|
|
103
|
-
}
|
|
104
|
-
});
|
|
105
|
-
function _sfc_ssrRender(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
|
|
106
|
-
const _component_Carousel = resolveComponent("Carousel");
|
|
107
|
-
_push(`<article${ssrRenderAttrs(_attrs)}><nav class="bg-base-100/80 p-4 backdrop-blur-md lg:rounded">`);
|
|
108
|
-
_push(ssrRenderComponent(_component_Carousel, {
|
|
109
|
-
class: "gap-2 px-6",
|
|
110
|
-
"wrapper-key": $props.term
|
|
111
|
-
}, {
|
|
112
|
-
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
113
|
-
if (_push2) {
|
|
114
|
-
_push2(`<!--[-->`);
|
|
115
|
-
ssrRenderList($setup.searchHistory, (term, i) => {
|
|
116
|
-
_push2(`<li class="shrink-0"${_scopeId}>${ssrInterpolate(term)}</li>`);
|
|
117
|
-
});
|
|
118
|
-
_push2(`<!--]-->`);
|
|
119
|
-
} else {
|
|
120
|
-
return [
|
|
121
|
-
(openBlock(true), createBlock(Fragment, null, renderList($setup.searchHistory, (term, i) => {
|
|
122
|
-
return openBlock(), createBlock("li", {
|
|
123
|
-
key: i,
|
|
124
|
-
class: "shrink-0"
|
|
125
|
-
}, toDisplayString(term), 1);
|
|
126
|
-
}), 128))
|
|
127
|
-
];
|
|
128
|
-
}
|
|
129
|
-
}),
|
|
130
|
-
_: 1
|
|
131
|
-
}, _parent));
|
|
132
|
-
_push(`</nav>`);
|
|
133
|
-
_push(ssrRenderComponent($setup["ProductShelf"], {
|
|
134
|
-
products: $setup.searchEngine.products,
|
|
135
|
-
class: "rounded bg-white"
|
|
136
|
-
}, null, _parent));
|
|
137
|
-
_push(`</article>`);
|
|
138
|
-
}
|
|
139
|
-
const _sfc_setup = _sfc_main.setup;
|
|
140
|
-
_sfc_main.setup = (props, ctx) => {
|
|
141
|
-
const ssrContext = useSSRContext();
|
|
142
|
-
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/SearchModal.vue");
|
|
143
|
-
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
|
|
144
|
-
};
|
|
145
|
-
const SearchModal = /* @__PURE__ */ _export_sfc(_sfc_main, [["ssrRender", _sfc_ssrRender]]);
|
|
146
|
-
|
|
147
|
-
export { SearchModal as default };
|