@searchcraft/javascript-sdk 0.1.9 → 0.2.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/dist/cjs/{index-d0e71432.js → index-6c5282a0.js} +3 -3
- package/dist/cjs/index-6c5282a0.js.map +1 -0
- package/dist/cjs/index.cjs.js +2 -2
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{searchcraft-auto-search-form_16.cjs.entry.js → searchcraft-auto-search-form_17.cjs.entry.js} +177 -68
- package/dist/cjs/searchcraft-auto-search-form_17.cjs.entry.js.map +1 -0
- package/dist/cjs/searchcraft-base-search-form.cjs.entry.js +4 -4
- package/dist/cjs/searchcraft-button-icon.cjs.entry.js +1 -1
- package/dist/cjs/searchcraft-button.cjs.entry.js +2 -2
- package/dist/cjs/searchcraft-javascript-sdk.cjs.js +2 -2
- package/dist/cjs/{store-3f6eab7d.js → store-ccdd30e6.js} +35 -40
- package/dist/cjs/store-ccdd30e6.js.map +1 -0
- package/dist/cjs/{utils-39791159.js → utils-bd99e8b0.js} +3 -3
- package/dist/cjs/utils-bd99e8b0.js.map +1 -0
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/searchcraft-auto-search-form/searchcraft-auto-search-form.js +29 -6
- package/dist/collection/components/searchcraft-auto-search-form/searchcraft-auto-search-form.js.map +1 -1
- package/dist/collection/components/searchcraft-auto-search-form/searchcraft-auto-search-form.module.css +0 -6
- package/dist/collection/components/searchcraft-base-search-form/searchcraft-base-search-form.js +1 -1
- package/dist/collection/components/searchcraft-base-search-result/searchcraft-base-search-result.js +2 -2
- package/dist/collection/components/searchcraft-base-search-result/searchcraft-base-search-result.js.map +1 -1
- package/dist/collection/components/searchcraft-base-search-result/searchcraft-base-search-result.module.css +13 -6
- package/dist/collection/components/searchcraft-base-search-results/searchcraft-base-search-results.js +43 -9
- package/dist/collection/components/searchcraft-base-search-results/searchcraft-base-search-results.js.map +1 -1
- package/dist/collection/components/searchcraft-base-search-results/searchcraft-base-search-results.module.css +8 -1
- package/dist/collection/components/searchcraft-button/searchcraft-button.js +1 -1
- package/dist/collection/components/searchcraft-clear-input-button/searchcraft-clear-input-button.module.css +2 -2
- package/dist/collection/components/searchcraft-error-message/searchcraft-error-message.js +1 -1
- package/dist/collection/components/searchcraft-filters-list/searchcraft-filters-list.js +47 -23
- package/dist/collection/components/searchcraft-filters-list/searchcraft-filters-list.js.map +1 -1
- package/dist/collection/components/searchcraft-filters-list/searchcraft-filters-list.module.css +37 -2
- package/dist/collection/components/searchcraft-input/searchcraft-input.js +2 -2
- package/dist/collection/components/searchcraft-input/searchcraft-input.js.map +1 -1
- package/dist/collection/components/searchcraft-results-info/searchcraft-results-info.js +51 -0
- package/dist/collection/components/searchcraft-results-info/searchcraft-results-info.js.map +1 -0
- package/dist/collection/components/searchcraft-results-info/searchcraft-results-info.module.css +16 -0
- package/dist/collection/components/searchcraft-slider/searchcraft-slider.js +32 -8
- package/dist/collection/components/searchcraft-slider/searchcraft-slider.js.map +1 -1
- package/dist/collection/components/searchcraft-slider/searchcraft-slider.module.css +9 -7
- package/dist/collection/components/searchcraft-spinner-dark/searchcraft-spinner-dark.js +1 -1
- package/dist/collection/components/searchcraft-spinner-light/searchcraft-spinner-light.js +1 -1
- package/dist/collection/components/searchcraft-toggle-button/searchcraft-toggle-button.js +22 -9
- package/dist/collection/components/searchcraft-toggle-button/searchcraft-toggle-button.js.map +1 -1
- package/dist/collection/components/searchcraft-toggle-button/searchcraft-toggle-button.module.css +0 -7
- package/dist/collection/provider/store.js +3 -7
- package/dist/collection/provider/store.js.map +1 -1
- package/dist/collection/utils/utils.js +2 -2
- package/dist/collection/utils/utils.js.map +1 -1
- package/dist/components/index.js +3 -3
- package/dist/components/{p-25bd714c.js → p-01c5864b.js} +2 -2
- package/dist/components/{p-25bd714c.js.map → p-01c5864b.js.map} +1 -1
- package/dist/components/{p-f2e41d24.js → p-0ef8f141.js} +3 -3
- package/dist/components/{p-f2e41d24.js.map → p-0ef8f141.js.map} +1 -1
- package/dist/components/{p-c9629cc3.js → p-162887a4.js} +3 -3
- package/dist/components/{p-c9629cc3.js.map → p-162887a4.js.map} +1 -1
- package/dist/components/{p-574e8e3c.js → p-2bff6d1e.js} +4 -4
- package/dist/components/{p-574e8e3c.js.map → p-2bff6d1e.js.map} +1 -1
- package/dist/components/{p-50ca3fe4.js → p-2f5acc0e.js} +3 -3
- package/dist/components/{p-50ca3fe4.js.map → p-2f5acc0e.js.map} +1 -1
- package/dist/components/{p-e0e0fc94.js → p-42f8a605.js} +3 -3
- package/dist/components/{p-e0e0fc94.js.map → p-42f8a605.js.map} +1 -1
- package/dist/components/p-544b2de1.js +86 -0
- package/dist/components/p-544b2de1.js.map +1 -0
- package/dist/components/{p-9bb9d6f0.js → p-68ad42b5.js} +2 -2
- package/dist/components/{p-9bb9d6f0.js.map → p-68ad42b5.js.map} +1 -1
- package/dist/components/{p-c9cd5533.js → p-7498e493.js} +3 -3
- package/dist/components/p-7498e493.js.map +1 -0
- package/dist/components/{p-5aa6335f.js → p-80ea9602.js} +35 -40
- package/dist/components/p-80ea9602.js.map +1 -0
- package/dist/components/{p-17c94ac1.js → p-aff5cd24.js} +3 -3
- package/dist/components/p-aff5cd24.js.map +1 -0
- package/dist/components/{p-37df2122.js → p-d11d9b1f.js} +12 -12
- package/dist/components/p-d11d9b1f.js.map +1 -0
- package/dist/components/{p-71dff048.js → p-ee5e7a8c.js} +2 -2
- package/dist/components/{p-71dff048.js.map → p-ee5e7a8c.js.map} +1 -1
- package/dist/components/{p-05cd002d.js → p-fc0540e5.js} +2 -2
- package/dist/components/{p-05cd002d.js.map → p-fc0540e5.js.map} +1 -1
- package/dist/components/{p-403f6115.js → p-fd1f6c2f.js} +6 -6
- package/dist/components/p-fd1f6c2f.js.map +1 -0
- package/dist/components/searchcraft-auto-search-form.js +30 -21
- package/dist/components/searchcraft-auto-search-form.js.map +1 -1
- package/dist/components/searchcraft-base-search-form.js +15 -15
- package/dist/components/searchcraft-base-search-result.js +1 -1
- package/dist/components/searchcraft-base-search-results.js +28 -14
- package/dist/components/searchcraft-base-search-results.js.map +1 -1
- package/dist/components/searchcraft-button-icon.js +1 -1
- package/dist/components/searchcraft-button.js +1 -1
- package/dist/components/searchcraft-clear-icon-set.js +1 -1
- package/dist/components/searchcraft-clear-input-button.js +1 -1
- package/dist/components/searchcraft-error-message.js +1 -1
- package/dist/components/searchcraft-filters-list.js +50 -26
- package/dist/components/searchcraft-filters-list.js.map +1 -1
- package/dist/components/searchcraft-input-caption.js +1 -1
- package/dist/components/searchcraft-input-icon.js +1 -1
- package/dist/components/searchcraft-input-label.js +1 -1
- package/dist/components/searchcraft-input.js +1 -1
- package/dist/components/searchcraft-results-info.d.ts +11 -0
- package/dist/components/searchcraft-results-info.js +64 -0
- package/dist/components/searchcraft-results-info.js.map +1 -0
- package/dist/components/searchcraft-search-icon-set.js +1 -1
- package/dist/components/searchcraft-slider.js +35 -11
- package/dist/components/searchcraft-slider.js.map +1 -1
- package/dist/components/searchcraft-spinner-dark.js +1 -1
- package/dist/components/searchcraft-spinner-light.js +1 -1
- package/dist/components/searchcraft-toggle-button.js +25 -12
- package/dist/components/searchcraft-toggle-button.js.map +1 -1
- package/dist/esm/{index-92040c37.js → index-0ac5bb53.js} +3 -3
- package/dist/esm/index-0ac5bb53.js.map +1 -0
- package/dist/esm/index.js +2 -2
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{searchcraft-auto-search-form_16.entry.js → searchcraft-auto-search-form_17.entry.js} +177 -69
- package/dist/esm/searchcraft-auto-search-form_17.entry.js.map +1 -0
- package/dist/esm/searchcraft-base-search-form.entry.js +4 -4
- package/dist/esm/searchcraft-button-icon.entry.js +1 -1
- package/dist/esm/searchcraft-button.entry.js +2 -2
- package/dist/esm/searchcraft-javascript-sdk.js +3 -3
- package/dist/esm/{store-5f6f8445.js → store-311de204.js} +35 -40
- package/dist/esm/store-311de204.js.map +1 -0
- package/dist/esm/{utils-7bff0c78.js → utils-e2076797.js} +3 -3
- package/dist/esm/utils-e2076797.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/index.esm.js +1 -1
- package/dist/searchcraft-javascript-sdk/p-0880cfbb.js +3 -0
- package/dist/searchcraft-javascript-sdk/p-0880cfbb.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/{p-81eaebdc.entry.js → p-5ec960bd.entry.js} +2 -2
- package/dist/searchcraft-javascript-sdk/p-6108dd80.entry.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-6108dd80.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/{p-5aa6335f.js → p-80ea9602.js} +2 -2
- package/dist/searchcraft-javascript-sdk/p-80ea9602.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-a9bac3ca.entry.js +2 -0
- package/dist/searchcraft-javascript-sdk/{p-639d019b.entry.js.map → p-a9bac3ca.entry.js.map} +1 -1
- package/dist/searchcraft-javascript-sdk/{p-17c94ac1.js → p-aff5cd24.js} +1 -1
- package/dist/searchcraft-javascript-sdk/p-aff5cd24.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/{p-02f632b6.entry.js → p-cc454542.entry.js} +2 -2
- package/dist/searchcraft-javascript-sdk/searchcraft-javascript-sdk.esm.js +1 -1
- package/dist/searchcraft-javascript-sdk/searchcraft-javascript-sdk.esm.js.map +1 -1
- package/dist/types/components/searchcraft-auto-search-form/searchcraft-auto-search-form.d.ts +3 -2
- package/dist/types/components/searchcraft-base-search-results/searchcraft-base-search-results.d.ts +3 -1
- package/dist/types/components/searchcraft-filters-list/searchcraft-filters-list.d.ts +7 -0
- package/dist/types/components/searchcraft-results-info/searchcraft-results-info.d.ts +10 -0
- package/dist/types/components/searchcraft-slider/searchcraft-slider.d.ts +7 -1
- package/dist/types/components/searchcraft-toggle-button/searchcraft-toggle-button.d.ts +5 -0
- package/dist/types/components.d.ts +19 -2
- package/dist/types/utils/utils.d.ts +1 -1
- package/package.json +1 -1
- package/dist/cjs/index-d0e71432.js.map +0 -1
- package/dist/cjs/searchcraft-auto-search-form_16.cjs.entry.js.map +0 -1
- package/dist/cjs/store-3f6eab7d.js.map +0 -1
- package/dist/cjs/utils-39791159.js.map +0 -1
- package/dist/components/p-17c94ac1.js.map +0 -1
- package/dist/components/p-37df2122.js.map +0 -1
- package/dist/components/p-3cbac2bb.js +0 -86
- package/dist/components/p-3cbac2bb.js.map +0 -1
- package/dist/components/p-403f6115.js.map +0 -1
- package/dist/components/p-5aa6335f.js.map +0 -1
- package/dist/components/p-c9cd5533.js.map +0 -1
- package/dist/esm/index-92040c37.js.map +0 -1
- package/dist/esm/searchcraft-auto-search-form_16.entry.js.map +0 -1
- package/dist/esm/store-5f6f8445.js.map +0 -1
- package/dist/esm/utils-7bff0c78.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-05369654.js +0 -3
- package/dist/searchcraft-javascript-sdk/p-05369654.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-17c94ac1.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-5aa6335f.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-639d019b.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-73265750.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-73265750.entry.js.map +0 -1
- /package/dist/searchcraft-javascript-sdk/{p-81eaebdc.entry.js.map → p-5ec960bd.entry.js.map} +0 -0
- /package/dist/searchcraft-javascript-sdk/{p-02f632b6.entry.js.map → p-cc454542.entry.js.map} +0 -0
|
@@ -2,7 +2,6 @@ import { h } from "@stencil/core";
|
|
|
2
2
|
import { useSearchcraftStore } from "../../provider/store";
|
|
3
3
|
export class SearchcraftToggleButton {
|
|
4
4
|
constructor() {
|
|
5
|
-
// Zustand store hook
|
|
6
5
|
this.searchStore = useSearchcraftStore.getState();
|
|
7
6
|
this.handleToggle = async () => {
|
|
8
7
|
this.isActive = !this.isActive;
|
|
@@ -13,7 +12,7 @@ export class SearchcraftToggleButton {
|
|
|
13
12
|
});
|
|
14
13
|
}
|
|
15
14
|
else if (this.type === 'sort') {
|
|
16
|
-
const sort = this.isActive ? '
|
|
15
|
+
const sort = this.isActive ? 'desc' : 'asc';
|
|
17
16
|
this.searchStore.setSearchParams({
|
|
18
17
|
sort,
|
|
19
18
|
});
|
|
@@ -27,14 +26,26 @@ export class SearchcraftToggleButton {
|
|
|
27
26
|
};
|
|
28
27
|
this.type = 'mode';
|
|
29
28
|
this.isActive = false;
|
|
29
|
+
this.query = '';
|
|
30
|
+
this.resultsCount = 0;
|
|
31
|
+
}
|
|
32
|
+
componentDidLoad() {
|
|
33
|
+
this.unsubscribe = useSearchcraftStore.subscribe((state) => {
|
|
34
|
+
var _a, _b, _c;
|
|
35
|
+
this.query = state.query || '';
|
|
36
|
+
this.resultsCount = ((_c = (_b = (_a = state.searchResults) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.hits) === null || _c === void 0 ? void 0 : _c.length) || 0;
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
disconnectedCallback() {
|
|
40
|
+
if (this.unsubscribe) {
|
|
41
|
+
this.unsubscribe();
|
|
42
|
+
}
|
|
30
43
|
}
|
|
31
44
|
render() {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
: '';
|
|
37
|
-
return (h("div", { key: '8bfbd9cf161d3dc285d7309ada79e9fb68624a45', class: 'toggle-container' }, h("span", { key: '99b5f67e53e45ebf97fef2bb2a52e50c804dec4d' }, label), h("button", { key: 'c6444cfcd24ef3558d0d93ebe0d4dcd4ceb8b29e', class: `toggle-wrapper ${this.isActive ? 'active' : ''}`, onClick: this.handleToggle, type: 'button' }, h("div", { key: '801f2e99c695449e161699fc874aa05ee1cf1e07', class: `toggle-switch ${this.isActive ? 'active' : ''}` }))));
|
|
45
|
+
if (!this.query || this.resultsCount === 0) {
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
return (h("button", { class: `toggle-wrapper ${this.isActive ? 'active' : ''}`, onClick: this.handleToggle, type: 'button' }, h("div", { class: `toggle-switch ${this.isActive ? 'active' : ''}` })));
|
|
38
49
|
}
|
|
39
50
|
static get is() { return "searchcraft-toggle-button"; }
|
|
40
51
|
static get encapsulation() { return "shadow"; }
|
|
@@ -72,7 +83,9 @@ export class SearchcraftToggleButton {
|
|
|
72
83
|
}
|
|
73
84
|
static get states() {
|
|
74
85
|
return {
|
|
75
|
-
"isActive": {}
|
|
86
|
+
"isActive": {},
|
|
87
|
+
"query": {},
|
|
88
|
+
"resultsCount": {}
|
|
76
89
|
};
|
|
77
90
|
}
|
|
78
91
|
}
|
package/dist/collection/components/searchcraft-toggle-button/searchcraft-toggle-button.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"searchcraft-toggle-button.js","sourceRoot":"","sources":["../../../src/components/searchcraft-toggle-button/searchcraft-toggle-button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAOtD,MAAM,OAAO,uBAAuB;;
|
|
1
|
+
{"version":3,"file":"searchcraft-toggle-button.js","sourceRoot":"","sources":["../../../src/components/searchcraft-toggle-button/searchcraft-toggle-button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAOtD,MAAM,OAAO,uBAAuB;;QAa1B,gBAAW,GAAG,mBAAmB,CAAC,QAAQ,EAAE,CAAC;QAe7C,iBAAY,GAAG,KAAK,IAAI,EAAE;YAChC,IAAI,CAAC,QAAQ,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC;YAE/B,IAAI,IAAI,CAAC,IAAI,KAAK,MAAM,EAAE,CA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AC3C,OAAO,IAAI,CAAC;QACd,CAAC;QAED,OAAO,CACL,cACE,KAAK,EAAE,kBAAkB,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,EAAE,EACxD,OAAO,EAAE,IAAI,CAAC,YAAY,EAC1B,IAAI,EAAC,QAAQ;YAEb,WAAK,KAAK,EAAE,iBAAiB,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,EAAE,GAAI,CACzD,CACV,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, h, Prop, State } from '@stencil/core';\nimport { useSearchcraftStore } from '@provider/store';\n\n@Component({\n tag: 'searchcraft-toggle-button',\n styleUrl: 'searchcraft-toggle-button.module.scss',\n shadow: true,\n})\nexport class SearchcraftToggleButton {\n /**\n * Type of the toggle - determines what it controls\n * 'mode': toggles between 'fuzzy' and 'normal'\n * 'sort': toggles between 'asc' and 'desc'\n */\n @Prop() type: 'mode' | 'sort' = 'mode';\n\n @State() isActive = false;\n @State() query = ''; // Track the query\n @State() resultsCount = 0; // Track the count of search results\n\n private unsubscribe: () => void;\n private searchStore = useSearchcraftStore.getState();\n\n componentDidLoad() {\n this.unsubscribe = useSearchcraftStore.subscribe((state) => {\n this.query = state.query || '';\n this.resultsCount = state.searchResults?.data?.hits?.length || 0;\n });\n }\n\n disconnectedCallback() {\n if (this.unsubscribe) {\n this.unsubscribe();\n }\n }\n\n private handleToggle = async () => {\n this.isActive = !this.isActive;\n\n if (this.type === 'mode') {\n const mode = this.isActive ? 'normal' : 'fuzzy';\n this.searchStore.setSearchParams({\n mode,\n });\n } else if (this.type === 'sort') {\n const sort = this.isActive ? 'desc' : 'asc';\n this.searchStore.setSearchParams({\n sort,\n });\n }\n\n try {\n await this.searchStore.search();\n } catch (error) {\n console.error('Search failed:', error);\n }\n };\n\n render() {\n if (!this.query || this.resultsCount === 0) {\n return null;\n }\n\n return (\n <button\n class={`toggle-wrapper ${this.isActive ? 'active' : ''}`}\n onClick={this.handleToggle}\n type='button'\n >\n <div class={`toggle-switch ${this.isActive ? 'active' : ''}`} />\n </button>\n );\n }\n}\n"]}
|
|
@@ -30,7 +30,7 @@ const useSearchcraftStore = create((set, get) => {
|
|
|
30
30
|
selectedFilters: [], // Initialize selected filters as an empty array
|
|
31
31
|
searchParams: {
|
|
32
32
|
mode: 'fuzzy',
|
|
33
|
-
sort: '
|
|
33
|
+
sort: 'asc',
|
|
34
34
|
},
|
|
35
35
|
setQuery: (query) => set({ query }),
|
|
36
36
|
setSearchResults: (results) => set({ searchResults: results }),
|
|
@@ -52,11 +52,10 @@ const useSearchcraftStore = create((set, get) => {
|
|
|
52
52
|
log(LogLevel.INFO, `Starting search with query: "${query}"`);
|
|
53
53
|
try {
|
|
54
54
|
const counts = selectedFilters.reduce((acc, filter) => {
|
|
55
|
-
const cleanedFilter = filter.replace(/^section:/, '');
|
|
56
|
-
acc[cleanedFilter] = 1;
|
|
55
|
+
const cleanedFilter = filter.replace(/^section:/, '');
|
|
56
|
+
acc[cleanedFilter] = 1;
|
|
57
57
|
return acc;
|
|
58
58
|
}, {});
|
|
59
|
-
console.log(counts);
|
|
60
59
|
const searchRequest = {
|
|
61
60
|
query,
|
|
62
61
|
mode: searchParams.mode,
|
|
@@ -64,11 +63,8 @@ const useSearchcraftStore = create((set, get) => {
|
|
|
64
63
|
facets: selectedFilters.length > 0 ? { section: { counts } } : null,
|
|
65
64
|
yearsRange: searchParams.yearsRange,
|
|
66
65
|
};
|
|
67
|
-
console.log('Search Request:', searchRequest);
|
|
68
66
|
const results = await searchcraft.search(searchRequest);
|
|
69
67
|
setSearchResults(results);
|
|
70
|
-
console.log(results.data.facets);
|
|
71
|
-
// Extract facets from the results and update the state
|
|
72
68
|
const updatedFacets = results.data.facets || null;
|
|
73
69
|
setFacets(updatedFacets);
|
|
74
70
|
log(LogLevel.DEBUG, `Search results: ${JSON.stringify(results)}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.js","sourceRoot":"","sources":["../../src/provider/store.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAEL,WAAW,EACX,QAAQ,GAGT,MAAM,mBAAmB,CAAC;AA+B3B,sCAAsC;AACtC,MAAM,mBAAmB,GAAG,MAAM,CAAmB,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;IAChE,IAAI,WAAW,GAA2B,IAAI,CAAC;IAC/C,IAAI,gBAAgB,GAAuB,IAAI,CAAC;IAEhD,MAAM,GAAG,GAAG,CAAC,KAAe,EAAE,OAAe,EAAE,EAAE;QAC/C,IAAI,gBAAgB,EAAE,CAAC;YACrB,QAAQ,KAAK,EAAE,CAAC;gBACd,KAAK,QAAQ,CAAC,KAAK;oBACjB,gBAAgB,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;oBAChC,MAAM;gBACR,KAAK,QAAQ,CAAC,IAAI;oBAChB,gBAAgB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;oBAC/B,MAAM;gBACR,KAAK,QAAQ,CAAC,IAAI;oBAChB,gBAAgB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;oBAC/B,MAAM;gBACR,KAAK,QAAQ,CAAC,KAAK;oBACjB,gBAAgB,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;oBAChC,MAAM;YACV,CAAC;QACH,CAAC;IACH,CAAC,CAAC;IAEF,OAAO;QACL,KAAK,EAAE,EAAE;QACT,YAAY,EAAE,KAAK;QACnB,aAAa,EAAE,IAAI;QACnB,MAAM,EAAE,IAAI;QACZ,eAAe,EAAE,EAAE,EAAE,gDAAgD;QACrE,YAAY,EAAE;YACZ,IAAI,EAAE,OAAO;YACb,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"store.js","sourceRoot":"","sources":["../../src/provider/store.tsx"],"names":[],"mappings":"AAAA,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AAE,QAAQ,CAAC,KAAK,EAAE,CAAC;gBAC/C,CAAC,CAAC,IAAI,CAAC;YAET,GAAG,CAAC,QAAQ,CAAC,IAAI,EAAE,gCAAgC,CAAC,CAAC;QACvD,CAAC;KACF,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,gCAAgC;AAChC,MAAM,aAAa,GAAG,MAAM,CAAa,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;IACjD,KAAK,EAAE,OAAO;IACd,WAAW,EAAE,GAAG,EAAE,CAChB,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,KAAK,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;CAC1E,CAAC,CAAC,CAAC;AAEJ,0DAA0D;AAC1D,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,CAAC","sourcesContent":["import { create } from 'zustand';\nimport {\n type CoreSDK as SearchcraftCore,\n SDKDebugger,\n LogLevel,\n type SearchcraftResponse,\n type Facets,\n} from '@searchcraft/core';\n\ninterface ThemeState {\n theme: 'light' | 'dark';\n toggleTheme: () => void;\n}\n\ninterface SearchParams {\n mode: 'fuzzy' | 'normal';\n sort: 'asc' | 'desc';\n yearsRange?: [number, number];\n}\n\ninterface SearchcraftState {\n query: string;\n isRequesting: boolean;\n searchResults: SearchcraftResponse | null;\n facets: Facets | null;\n selectedFilters: string[]; // Add this to store selected filters\n searchParams: SearchParams;\n setQuery: (query: string) => void;\n setSearchResults: (results: SearchcraftResponse | null) => void;\n setFacets: (facets: Facets) => void;\n setSelectedFilters: (filters: string[]) => void; // Update selected filters\n setIsRequesting: (isRequesting: boolean) => void;\n setSearchParams: (params: Partial<SearchParams>) => void;\n setYearsRange: (yearsRange: [number, number]) => void;\n search: () => Promise<void>;\n initialize: (searchcraft: SearchcraftCore, debug?: boolean) => void;\n}\n\n// Zustand store for Searchcraft state\nconst useSearchcraftStore = create<SearchcraftState>((set, get) => {\n let searchcraft: SearchcraftCore | null = null;\n let debuggerInstance: SDKDebugger | null = null;\n\n const log = (level: LogLevel, message: string) => {\n if (debuggerInstance) {\n switch (level) {\n case LogLevel.DEBUG:\n debuggerInstance.debug(message);\n break;\n case LogLevel.INFO:\n debuggerInstance.info(message);\n break;\n case LogLevel.WARN:\n debuggerInstance.warn(message);\n break;\n case LogLevel.ERROR:\n debuggerInstance.error(message);\n break;\n }\n }\n };\n\n return {\n query: '',\n isRequesting: false,\n searchResults: null,\n facets: null,\n selectedFilters: [], // Initialize selected filters as an empty array\n searchParams: {\n mode: 'fuzzy',\n sort: 'asc',\n },\n setQuery: (query) => set({ query }),\n setSearchResults: (results) => set({ searchResults: results }),\n setFacets: (facets) => set({ facets }),\n setSelectedFilters: (filters) => set({ selectedFilters: filters }), // Update the selected filters\n setIsRequesting: (isRequesting) => set({ isRequesting }),\n setSearchParams: (params) =>\n set((state) => ({\n searchParams: {\n ...state.searchParams,\n ...params,\n },\n })),\n setYearsRange: (yearsRange) =>\n set((state) => ({\n searchParams: {\n ...state.searchParams,\n yearsRange,\n },\n })),\n search: async () => {\n const {\n query,\n selectedFilters,\n setIsRequesting,\n setSearchResults,\n setFacets,\n searchParams,\n } = get();\n if (!searchcraft) {\n throw new Error('Searchcraft instance is not initialized.');\n }\n setIsRequesting(true);\n log(LogLevel.INFO, `Starting search with query: \"${query}\"`);\n\n try {\n const counts: Record<string, number> = selectedFilters.reduce(\n (acc, filter) => {\n const cleanedFilter = filter.replace(/^section:/, '');\n acc[cleanedFilter] = 1;\n return acc;\n },\n {} as Record<string, number>,\n );\n\n const searchRequest = {\n query,\n mode: searchParams.mode,\n sort: searchParams.sort,\n facets: selectedFilters.length > 0 ? { section: { counts } } : null,\n yearsRange: searchParams.yearsRange,\n };\n\n const results = await searchcraft.search(searchRequest);\n setSearchResults(results);\n const updatedFacets = results.data.facets || null;\n setFacets(updatedFacets);\n\n log(LogLevel.DEBUG, `Search results: ${JSON.stringify(results)}`);\n log(LogLevel.DEBUG, `Updated facets: ${JSON.stringify(updatedFacets)}`);\n } catch (error) {\n console.error(`Search failed: ${(error as Error).message}`);\n log(\n LogLevel.ERROR,\n `Search failed with error: ${(error as Error).message}`,\n );\n } finally {\n setIsRequesting(false);\n }\n },\n initialize: (searchcraftInstance, debug = false) => {\n searchcraft = searchcraftInstance;\n debuggerInstance = debug\n ? new SDKDebugger({ logLevel: LogLevel.DEBUG })\n : null;\n\n log(LogLevel.INFO, 'Searchcraft store initialized.');\n },\n };\n});\n\n// Zustand store for Theme state\nconst useThemeStore = create<ThemeState>((set) => ({\n theme: 'light',\n toggleTheme: () =>\n set((state) => ({ theme: state.theme === 'light' ? 'dark' : 'light' })),\n}));\n\n// Export the Zustand stores for use in Stencil components\nexport { useSearchcraftStore, useThemeStore };\n"]}
|
|
@@ -10,10 +10,10 @@ export function parseCustomStyles(styles) {
|
|
|
10
10
|
}
|
|
11
11
|
return styles || {};
|
|
12
12
|
}
|
|
13
|
-
export function parseSearchKeys(
|
|
13
|
+
export function parseSearchKeys(documentAttributesForDisplay) {
|
|
14
14
|
try {
|
|
15
15
|
// Attempt to parse the string as JSON
|
|
16
|
-
const parsedKeys = JSON.parse(
|
|
16
|
+
const parsedKeys = JSON.parse(documentAttributesForDisplay);
|
|
17
17
|
if (Array.isArray(parsedKeys) &&
|
|
18
18
|
parsedKeys.every((key) => typeof key === 'string')) {
|
|
19
19
|
return parsedKeys; // Return the array if it's valid
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils/utils.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,iBAAiB,CAC/B,MAAuC;IAEvC,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;QAC/B,IAAI,CAAC;YACH,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAC5B,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OA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IAAc;IAEd,MAAM,mBAAmB,GAAoC,EAAE,CAAC;IAChE,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;QACnB,mBAAmB,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;IACjD,CAAC,CAAC,CAAC;IACH,OAAO,mBAAmB,CAAC;AAC7B,CAAC;AAED,MAAM,UAAU,eAAe,CAC7B,MAA8C;IAE9C,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IAChC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,2BAA2B,EAAE,KAAK,CAAC,CAAC;QAClD,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC","sourcesContent":["export function parseCustomStyles(\n styles: string | Record<string, string>,\n): Record<string, string> {\n if (typeof styles === 'string') {\n try {\n return JSON.parse(styles);\n } catch (error) {\n console.error('Invalid customStyles format:', styles);\n return {};\n }\n }\n return styles || {};\n}\n\nexport function parseSearchKeys(\n documentAttributesForDisplay: string,\n): string[] {\n try {\n // Attempt to parse the string as JSON\n const parsedKeys = JSON.parse(documentAttributesForDisplay);\n if (\n Array.isArray(parsedKeys) &&\n parsedKeys.every((key) => typeof key === 'string')\n ) {\n return parsedKeys; // Return the array if it's valid\n }\n console.warn(\n 'searchKeys must be a JSON array of strings. Defaulting to an empty array.',\n );\n return [];\n } catch (error) {\n console.error('Failed to parse searchKeys:', error);\n return []; // Return an empty array in case of a parsing error\n }\n}\n\nexport function extractDynamicProperties(\n document: Record<string, string | number>,\n keys: string[],\n) {\n const extractedProperties: Record<string, string | number> = {};\n keys.forEach((key) => {\n extractedProperties[key] = document[key] || '';\n });\n return extractedProperties;\n}\n\nexport function serializeStyles(\n styles: Record<string, Record<string, string>>,\n): string {\n try {\n return JSON.stringify(styles);\n } catch (error) {\n console.error('Error serializing styles:', error);\n return '{}';\n }\n}\n"]}
|
package/dist/components/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { g as getAssetPath, s as setAssetPath, a as setNonce, b as setPlatformOptions } from './p-
|
|
2
|
-
export { e as extractDynamicProperties, p as parseCustomStyles, a as parseSearchKeys, s as serializeStyles } from './p-
|
|
3
|
-
export { u as useSearchcraftStore, a as useThemeStore } from './p-
|
|
1
|
+
export { g as getAssetPath, s as setAssetPath, a as setNonce, b as setPlatformOptions } from './p-7498e493.js';
|
|
2
|
+
export { e as extractDynamicProperties, p as parseCustomStyles, a as parseSearchKeys, s as serializeStyles } from './p-aff5cd24.js';
|
|
3
|
+
export { u as useSearchcraftStore, a as useThemeStore } from './p-80ea9602.js';
|
|
4
4
|
|
|
5
5
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as proxyCustomElement, H, h } from './p-
|
|
1
|
+
import { p as proxyCustomElement, H, h } from './p-7498e493.js';
|
|
2
2
|
import { c as classNames } from './p-5cdc6210.js';
|
|
3
3
|
|
|
4
4
|
const searchcraftInputCaptionModuleCss = ":root{--font-stack:Helvetica, Arial, sans-serif}.inputCaptionLightLTR{font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-top:4px;color:#404040}.inputCaptionDarkLTR{font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-top:4px;color:#E6E6E6}.inputCaptionErrorLightLTR{font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-top:4px;color:#990000}.inputCaptionErrorDarkLTR{font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-top:4px;color:#FFB3B3}.inputCaptionLightRTL{font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-top:4px;color:#404040;text-align:right}.inputCaptionDarkRTL{font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-top:4px;color:#E6E6E6;text-align:right}.inputCaptionErrorLightRTL{font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-top:4px;color:#990000;text-align:right}.inputCaptionErrorDarkRTL{font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-top:4px;color:#FFB3B3;text-align:right}";
|
|
@@ -58,4 +58,4 @@ defineCustomElement();
|
|
|
58
58
|
|
|
59
59
|
export { SearchcraftInputCaption as S, defineCustomElement as d };
|
|
60
60
|
|
|
61
|
-
//# sourceMappingURL=p-
|
|
61
|
+
//# sourceMappingURL=p-01c5864b.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"p-
|
|
1
|
+
{"file":"p-01c5864b.js","mappings":";;;AAAA,MAAM,gCAAgC,GAAG,8oCAA8oC,CAAC;AACxrC,sCAAe,gCAAgC;;MCOlC,uBAAuB;;;;;;qCAED,EAAE;iCACP,cAAc;sCACT,KAAK;qBACrB,OAAO;;IAEhB,YAAY;QAClB,OAAO,IAAI,CAAC,KAAK,KAAK,OAAO,CAAC;KAC/B;IAED,MAAM;QACJ,OAAO,IAAI,CAAC,sBAAsB,IAChC,SACE,KAAK,EAAE,UAAU,CACf,IAAI,CAAC,KAAK;kBACN,IAAI,CAAC,YAAY;sBACf,2BAA2B;sBAC3B,0BAA0B;kBAC5B,IAAI,CAAC,YAAY;sBACf,sBAAsB;sBACtB,qBAAqB,EAC3B,IAAI,CAAC,qBAAqB,EAC1B,4BAA4B,CAC7B,IAEA,IAAI,CAAC,iBAAiB,CACrB,KAEJ,SACE,KAAK,EAAE,UAAU,CACf,IAAI,CAAC,KAAK;kBACN,IAAI,CAAC,YAAY;sBACf,2BAA2B;sBAC3B,0BAA0B;kBAC5B,IAAI,CAAC,YAAY;sBACf,sBAAsB;sBACtB,qBAAqB,EAC3B,IAAI,CAAC,qBAAqB,EAC1B,4BAA4B,CAC7B,IAEA,IAAI,CAAC,iBAAiB,CACrB,CACL,CAAC;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/searchcraft-input-caption/searchcraft-input-caption.module.scss?tag=searchcraft-input-caption&encapsulation=shadow","src/components/searchcraft-input-caption/searchcraft-input-caption.tsx"],"sourcesContent":["@import '../../utils/theme';\n\n:root {\n --font-stack: Helvetica, Arial, sans-serif;\n}\n\n@mixin input-caption-base {\n font-family: var(--font-stack);\n font-size: 12px;\n font-weight: 400;\n line-height: 16px;\n margin-top: 4px;\n}\n\n@mixin input-caption-base-light {\n @include input-caption-base;\n color: $light-input-caption-color;\n}\n\n@mixin input-caption-base-dark {\n @include input-caption-base;\n color: $dark-input-caption-color;\n}\n\n.inputCaptionLightLTR {\n @include input-caption-base-light;\n}\n\n.inputCaptionDarkLTR {\n @include input-caption-base-dark;\n}\n\n.inputCaptionErrorLightLTR {\n @include input-caption-base;\n color: $light-input-caption-color-error;\n}\n\n.inputCaptionErrorDarkLTR {\n @include input-caption-base;\n color: $dark-input-caption-color-error;\n}\n\n.inputCaptionLightRTL {\n @include input-caption-base-light;\n text-align: right;\n}\n\n.inputCaptionDarkRTL {\n @include input-caption-base-dark;\n text-align: right;\n}\n\n.inputCaptionErrorLightRTL {\n @include input-caption-base;\n color: $light-input-caption-color-error;\n text-align: right;\n}\n\n.inputCaptionErrorDarkRTL {\n @include input-caption-base;\n color: $dark-input-caption-color-error;\n text-align: right;\n}","import { Component, Prop, h, State } from '@stencil/core';\nimport classNames from 'classnames';\n\n@Component({\n tag: 'searchcraft-input-caption',\n styleUrl: 'searchcraft-input-caption.module.scss',\n shadow: true,\n})\nexport class SearchcraftInputCaption {\n @Prop() error?: boolean;\n @Prop() inputCaptionClassName? = '';\n @Prop() inputCaptionValue = 'Enter Search';\n @Prop() rightToLeftOrientation = false;\n @State() theme = 'light';\n\n private isLightTheme() {\n return this.theme === 'light';\n }\n\n render() {\n return this.rightToLeftOrientation ? (\n <p\n class={classNames(\n this.error\n ? this.isLightTheme\n ? 'inputCaptionErrorLightRTL'\n : 'inputCaptionErrorDarkRTL'\n : this.isLightTheme\n ? 'inputCaptionLightRTL'\n : 'inputCaptionDarkRTL',\n this.inputCaptionClassName,\n '.searchcraft-input-caption',\n )}\n >\n {this.inputCaptionValue}\n </p>\n ) : (\n <p\n class={classNames(\n this.error\n ? this.isLightTheme\n ? 'inputCaptionErrorLightLTR'\n : 'inputCaptionErrorDarkLTR'\n : this.isLightTheme\n ? 'inputCaptionLightLTR'\n : 'inputCaptionDarkLTR',\n this.inputCaptionClassName,\n '.searchcraft-input-caption',\n )}\n >\n {this.inputCaptionValue}\n </p>\n );\n }\n}\n"],"version":3}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { p as proxyCustomElement, H, h } from './p-
|
|
2
|
-
import { d as defineCustomElement$1 } from './p-
|
|
1
|
+
import { p as proxyCustomElement, H, h } from './p-7498e493.js';
|
|
2
|
+
import { d as defineCustomElement$1 } from './p-ee5e7a8c.js';
|
|
3
3
|
|
|
4
4
|
const searchcraftInputIconModuleCss = ":root{--font-stack:Helvetica, Arial, sans-serif}.inputIconLTR{left:15px;position:absolute;top:50%;transform:translateY(-50%)}.inputIconRTL{position:absolute;right:15px;top:50%;transform:translateY(-50%)}";
|
|
5
5
|
const SearchcraftInputIconStyle0 = searchcraftInputIconModuleCss;
|
|
@@ -51,4 +51,4 @@ defineCustomElement();
|
|
|
51
51
|
|
|
52
52
|
export { SearchcraftInputIcon as S, defineCustomElement as d };
|
|
53
53
|
|
|
54
|
-
//# sourceMappingURL=p-
|
|
54
|
+
//# sourceMappingURL=p-0ef8f141.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"p-
|
|
1
|
+
{"file":"p-0ef8f141.js","mappings":";;;AAAA,MAAM,6BAA6B,GAAG,6MAA6M,CAAC;AACpP,mCAAe,6BAA6B;;MCM/B,oBAAoB;;;;;;sCASE,KAAK;sBACrB,EAAE;qBACH,EAAE;qBAED,OAAO;;IAEhB,YAAY;QAClB,OAAO,IAAI,CAAC,KAAK,KAAK,OAAO,CAAC;KAC/B;IAED,MAAM;QACJ,OAAO,IAAI,CAAC,KAAK,IACf,WACE,KAAK,EAAE,IAAI,CAAC,sBAAsB,GAAG,cAAc,GAAG,cAAc,IAEnE,IAAI,CAAC,YAAY,EAAE,IAClB,mCACE,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,IAAI,EAAC,aAAa,EAClB,KAAK,EAAE,IAAI,CAAC,KAAK,GACjB,KAEF,mCACE,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,IAAI,EAAC,YAAY,EACjB,KAAK,EAAE,IAAI,CAAC,KAAK,GACjB,CACH,CACG,KAEN,WACE,KAAK,EAAE,IAAI,CAAC,sBAAsB,GAAG,cAAc,GAAG,cAAc,IAEnE,IAAI,CAAC,YAAY,EAAE,IAClB,mCACE,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,IAAI,EAAC,cAAc,EACnB,KAAK,EAAE,IAAI,CAAC,KAAK,GACjB,KAEF,mCACE,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,IAAI,EAAC,aAAa,EAClB,KAAK,EAAE,IAAI,CAAC,KAAK,GACjB,CACH,CACG,CACP,CAAC;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/searchcraft-input-icon/searchcraft-input-icon.module.scss?tag=searchcraft-input-icon&encapsulation=shadow","src/components/searchcraft-input-icon/searchcraft-input-icon.tsx"],"sourcesContent":[":root {\n --font-stack: Helvetica, Arial, sans-serif;\n}\n\n.inputIconLTR {\n left: 15px;\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n}\n\n.inputIconRTL {\n position: absolute;\n right: 15px;\n top: 50%;\n transform: translateY(-50%);\n}","import { Component, Prop, h, State } from '@stencil/core';\n\n@Component({\n tag: 'searchcraft-input-icon',\n styleUrl: 'searchcraft-input-icon.module.scss',\n shadow: true,\n})\nexport class SearchcraftInputIcon {\n /**\n * Determines if an error icon should be displayed.\n */\n @Prop() error?: boolean;\n\n /**\n * Determines if the layout should be right-to-left.\n */\n @Prop() rightToLeftOrientation = false;\n @Prop() height = 20;\n @Prop() width = 20;\n\n @State() theme = 'light';\n\n private isLightTheme() {\n return this.theme === 'light';\n }\n\n render() {\n return this.error ? (\n <div\n class={this.rightToLeftOrientation ? 'inputIconRTL' : 'inputIconLTR'}\n >\n {this.isLightTheme() ? (\n <searchcraft-search-icon-set\n height={this.height}\n type='error-light'\n width={this.width}\n />\n ) : (\n <searchcraft-search-icon-set\n height={this.height}\n type='error-dark'\n width={this.width}\n />\n )}\n </div>\n ) : (\n <div\n class={this.rightToLeftOrientation ? 'inputIconRTL' : 'inputIconLTR'}\n >\n {this.isLightTheme() ? (\n <searchcraft-search-icon-set\n height={this.height}\n type='search-light'\n width={this.width}\n />\n ) : (\n <searchcraft-search-icon-set\n height={this.height}\n type='search-dark'\n width={this.width}\n />\n )}\n </div>\n );\n }\n}\n"],"version":3}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as proxyCustomElement, H, h } from './p-
|
|
1
|
+
import { p as proxyCustomElement, H, h } from './p-7498e493.js';
|
|
2
2
|
import { c as classNames } from './p-5cdc6210.js';
|
|
3
3
|
|
|
4
4
|
const searchcraftErrorMessageModuleCss = ":root{--font-stack:Helvetica, Arial, sans-serif}.errorMessageLight{font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-top:4px;color:#990000}.errorMessageDark{font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-top:4px;color:#FFB3B3}";
|
|
@@ -14,7 +14,7 @@ const SearchcraftErrorMessage = /*@__PURE__*/ proxyCustomElement(class Searchcra
|
|
|
14
14
|
}
|
|
15
15
|
render() {
|
|
16
16
|
const errorMessageStyle = this.theme === 'light' ? 'errorMessageLight' : 'errorMessageDark';
|
|
17
|
-
return (h("p", { key: '
|
|
17
|
+
return (h("p", { key: '544903d700810ed5d6efdefedab646cafed2376d', class: classNames(errorMessageStyle) }, this.errorMessage || 'Search term is required.'));
|
|
18
18
|
}
|
|
19
19
|
static get style() { return SearchcraftErrorMessageStyle0; }
|
|
20
20
|
}, [1, "searchcraft-error-message", {
|
|
@@ -38,4 +38,4 @@ defineCustomElement();
|
|
|
38
38
|
|
|
39
39
|
export { SearchcraftErrorMessage as S, defineCustomElement as d };
|
|
40
40
|
|
|
41
|
-
//# sourceMappingURL=p-
|
|
41
|
+
//# sourceMappingURL=p-162887a4.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"p-
|
|
1
|
+
{"file":"p-162887a4.js","mappings":";;;AAAA,MAAM,gCAAgC,GAAG,6SAA6S,CAAC;AACvV,sCAAe,gCAAgC;;MCOlC,uBAAuB;;;;;;qBASA,OAAO;;IAEzC,MAAM;QACJ,MAAM,iBAAiB,GACrB,IAAI,CAAC,KAAK,KAAK,OAAO,GAAG,mBAAmB,GAAG,kBAAkB,CAAC;QAEpE,QACE,0DAAG,KAAK,EAAE,UAAU,CAAC,iBAAiB,CAAC,IACpC,IAAI,CAAC,YAAY,IAAI,0BAA0B,CAC9C,EACJ;KACH;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/searchcraft-error-message/searchcraft-error-message.module.scss?tag=searchcraft-error-message&encapsulation=shadow","src/components/searchcraft-error-message/searchcraft-error-message.tsx"],"sourcesContent":["@import '../../utils/theme';\n\n:root {\n --font-stack: Helvetica, Arial, sans-serif;\n}\n\n@mixin error-message-base {\n font-family: var(--font-stack);\n font-size: 12px;\n font-weight: 400;\n line-height: 16px;\n margin-top: 4px;\n}\n\n.errorMessageLight {\n @include error-message-base;\n color: $light-input-caption-color-error;\n}\n\n.errorMessageDark {\n @include error-message-base;\n color: $dark-input-caption-color-error;\n}","import { Component, Prop, h } from '@stencil/core';\nimport classNames from 'classnames';\n\n@Component({\n tag: 'searchcraft-error-message',\n styleUrl: 'searchcraft-error-message.module.scss',\n shadow: true,\n})\nexport class SearchcraftErrorMessage {\n /**\n * The error message to display. Defaults to a standard message if not provided.\n */\n @Prop() errorMessage?: string;\n\n /**\n * The theme, which determines the style (light or dark).\n */\n @Prop() theme: 'light' | 'dark' = 'light';\n\n render() {\n const errorMessageStyle =\n this.theme === 'light' ? 'errorMessageLight' : 'errorMessageDark';\n\n return (\n <p class={classNames(errorMessageStyle)}>\n {this.errorMessage || 'Search term is required.'}\n </p>\n );\n }\n}\n"],"version":3}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { p as proxyCustomElement, H, c as createEvent, h, F as Fragment } from './p-
|
|
1
|
+
import { p as proxyCustomElement, H, c as createEvent, h, F as Fragment } from './p-7498e493.js';
|
|
2
2
|
import { c as classNames } from './p-5cdc6210.js';
|
|
3
|
-
import { d as defineCustomElement$1 } from './p-
|
|
3
|
+
import { d as defineCustomElement$1 } from './p-2f5acc0e.js';
|
|
4
4
|
|
|
5
5
|
const searchcraftButtonModuleCss = ":root{--font-stack:Helvetica, Arial, sans-serif}.buttonLight{border-radius:8px;display:flex;font-family:var(--font-stack);font-size:16px;font-weight:700;line-height:20px;padding:11px 20px;position:relative;background-color:#000;border:1px solid #E6E6E6;color:#FFF}.buttonLight:hover{cursor:pointer}.buttonLight:hover{background-color:#2E2E2E}.buttonLight:focus{outline:2px solid #000000}.buttonDark{border-radius:8px;display:flex;font-family:var(--font-stack);font-size:16px;font-weight:700;line-height:20px;padding:11px 20px;position:relative;background-color:#FFF;border:1px solid #404040;color:#292929}.buttonDark:hover{cursor:pointer}.buttonDark:hover{background-color:#FAFAFA}.buttonDark:focus{outline:2px solid #404040}.spinnerMarginRight{left:4px;margin-right:4px;position:absolute}.spinnerMarginLeft{left:4px;margin-left:4px;position:absolute}.buttonLabel{animation:right-and-back 0.2s;margin-left:4px;position:relative}@keyframes right-and-back{0%{right:-6px}50%{right:-12px}75%{right:-6px}100%{right:0px}}";
|
|
6
6
|
const SearchcraftButtonStyle0 = searchcraftButtonModuleCss;
|
|
@@ -26,7 +26,7 @@ const SearchcraftButton = /*@__PURE__*/ proxyCustomElement(class SearchcraftButt
|
|
|
26
26
|
}
|
|
27
27
|
render() {
|
|
28
28
|
const buttonStyle = this.getButtonStyle();
|
|
29
|
-
return (h(Fragment, { key: '
|
|
29
|
+
return (h(Fragment, { key: 'f10a9faa6357ef626c4e5414a5c8bdc1fe0b63a1' }, this.iconOnly ? (h("button", { class: classNames(buttonStyle, 'searchcraft-button'), onClick: this.handleClick, type: 'submit' }, this.isRequesting ? (h("searchcraft-spinner-dark", null)) : (this.iconElement))) : (h("button", { class: classNames(buttonStyle, 'searchcraft-button'), onClick: this.handleClick, type: 'submit' }, this.iconPosition === 'left' && this.isRequesting ? (h("div", { class: 'spinner-margin-right' }, h("searchcraft-spinner-dark", null))) : (this.iconElement), h("span", { class: classNames(this.isRequesting && 'button-label', 'searchcraft-button-label') }, this.label)))));
|
|
30
30
|
}
|
|
31
31
|
static get style() { return SearchcraftButtonStyle0; }
|
|
32
32
|
}, [1, "searchcraft-button", {
|
|
@@ -59,4 +59,4 @@ defineCustomElement();
|
|
|
59
59
|
|
|
60
60
|
export { SearchcraftButton as S, defineCustomElement as d };
|
|
61
61
|
|
|
62
|
-
//# sourceMappingURL=p-
|
|
62
|
+
//# sourceMappingURL=p-2bff6d1e.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"p-
|
|
1
|
+
{"file":"p-2bff6d1e.js","mappings":";;;;AAAA,MAAM,0BAA0B,GAAG,y/BAAy/B,CAAC;AAC7hC,gCAAe,0BAA0B;;MCe5B,iBAAiB;;;;;;QAepB,gBAAW,GAAG;YACpB,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC;SACzB,CAAC;;wBAfiB,KAAK;4BACD,MAAM;qBACb,QAAQ;4BAIA,KAAK;qBACZ,OAAO;;IAEhB,cAAc;QACpB,OAAO,IAAI,CAAC,KAAK,KAAK,OAAO,GAAG,aAAa,GAAG,YAAY,CAAC;KAC9D;IAMD,MAAM;QACJ,MAAM,WAAW,GAAG,IAAI,CAAC,cAAc,EAAE,CAAC;QAE1C,QACE,EAAC,QAAQ,uDACN,IAAI,CAAC,QAAQ,IACZ,cACE,KAAK,EAAE,UAAU,CAAC,WAAW,EAAE,oBAAoB,CAAC,EACpD,OAAO,EAAE,IAAI,CAAC,WAAW,EACzB,IAAI,EAAC,QAAQ,IAEZ,IAAI,CAAC,YAAY,IAChB,mCAA4B,KAE5B,IAAI,CAAC,WAAW,CACjB,CACM,KAET,cACE,KAAK,EAAE,UAAU,CAAC,WAAW,EAAE,oBAAoB,CAAC,EACpD,OAAO,EAAE,IAAI,CAAC,WAAW,EACzB,IAAI,EAAC,QAAQ,IAEZ,IAAI,CAAC,YAAY,KAAK,MAAM,IAAI,IAAI,CAAC,YAAY,IAChD,WAAK,KAAK,EAAC,sBAAsB,IAC/B,mCAA4B,CACxB,KAEN,IAAI,CAAC,WAAW,CACjB,EACD,YACE,KAAK,EAAE,UAAU,CACf,IAAI,CAAC,YAAY,IAAI,cAAc,EACnC,0BAA0B,CAC3B,IAEA,IAAI,CAAC,KAAK,CACN,CACA,CACV,CACQ,EACX;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/searchcraft-button/searchcraft-button.module.scss?tag=searchcraft-button&encapsulation=shadow","src/components/searchcraft-button/searchcraft-button.tsx"],"sourcesContent":["@import '../../utils/theme';\n\n:root {\n --font-stack: Helvetica, Arial, sans-serif;\n}\n\n@mixin button-base {\n border-radius: 8px;\n display: flex;\n font-family: var(--font-stack);\n font-size: 16px;\n font-weight: 700;\n line-height: 20px;\n padding: 11px 20px;\n position: relative;\n\n &:hover {\n cursor: pointer;\n }\n}\n\n.buttonLight {\n @include button-base;\n background-color: $light-background;\n border: 1px solid $light-button-border;\n color: $light-button-color;\n\n &:hover {\n background-color: $light-button-hover;\n }\n\n &:focus {\n outline: 2px solid $light-button-outline-focus;\n }\n}\n\n.buttonDark {\n @include button-base;\n background-color: $dark-background;\n border: 1px solid $dark-button-border;\n color: $dark-button-color;\n\n &:hover {\n background-color: $dark-button-hover;\n }\n\n &:focus {\n outline: 2px solid $dark-button-outline-focus;\n }\n}\n\n.spinnerMarginRight {\n left: 4px;\n margin-right: 4px;\n position: absolute;\n}\n\n.spinnerMarginLeft {\n left: 4px;\n margin-left: 4px;\n position: absolute;\n}\n\n.buttonLabel {\n animation: right-and-back .2s;\n margin-left: 4px;\n position: relative;\n}\n\n@keyframes right-and-back {\n 0% { right: -6px; }\n 50% { right: -12px; }\n 75% { right: -6px; }\n 100% {right: 0px; }\n}","import {\n Component,\n Event,\n type EventEmitter,\n Prop,\n h,\n State,\n Fragment,\n} from '@stencil/core';\nimport classNames from 'classnames';\n\n@Component({\n tag: 'searchcraft-button',\n styleUrl: 'searchcraft-button.module.scss',\n shadow: true,\n})\nexport class SearchcraftButton {\n @Prop() iconElement?: Element;\n @Prop() iconOnly = false;\n @Prop() iconPosition = 'left';\n @Prop() label = 'Search';\n\n @Event() buttonClick!: EventEmitter<void>;\n\n @State() isRequesting = false;\n @State() theme = 'light';\n\n private getButtonStyle() {\n return this.theme === 'light' ? 'buttonLight' : 'buttonDark';\n }\n\n private handleClick = () => {\n this.buttonClick.emit(); // Emit the event instead of calling a function\n };\n\n render() {\n const buttonStyle = this.getButtonStyle();\n\n return (\n <Fragment>\n {this.iconOnly ? (\n <button\n class={classNames(buttonStyle, 'searchcraft-button')}\n onClick={this.handleClick}\n type='submit'\n >\n {this.isRequesting ? (\n <searchcraft-spinner-dark />\n ) : (\n this.iconElement\n )}\n </button>\n ) : (\n <button\n class={classNames(buttonStyle, 'searchcraft-button')}\n onClick={this.handleClick}\n type='submit'\n >\n {this.iconPosition === 'left' && this.isRequesting ? (\n <div class='spinner-margin-right'>\n <searchcraft-spinner-dark />\n </div>\n ) : (\n this.iconElement\n )}\n <span\n class={classNames(\n this.isRequesting && 'button-label',\n 'searchcraft-button-label',\n )}\n >\n {this.label}\n </span>\n </button>\n )}\n </Fragment>\n );\n }\n}\n"],"version":3}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as proxyCustomElement, H, h } from './p-
|
|
1
|
+
import { p as proxyCustomElement, H, h } from './p-7498e493.js';
|
|
2
2
|
|
|
3
3
|
const searchcraftSpinnerDarkModuleCss = ".spinnerContainer{background-color:transparent;height:20px;width:20px}.spinnerDark{height:100%;width:100%;background:conic-gradient(#000 50%, #FFFFFF);clip-path:circle(50%);mask-image:radial-gradient(circle at center, rgba(0, 0, 0, 0) 6.6666666667px, rgb(0, 0, 0) 6.6666666667px);animation:spinning 1s linear infinite}.spinnerLight{height:100%;width:100%;background:conic-gradient(#737373 50%, #FFFFFF);clip-path:circle(50%);mask-image:radial-gradient(circle at center, rgba(0, 0, 0, 0) 6.6666666667px, rgb(0, 0, 0) 6.6666666667px);animation:spinning 1s linear infinite}@keyframes spinning{0%{transform:rotate(0deg)}50%{transform:rotate(180deg)}100%{transform:rotate(360deg)}}";
|
|
4
4
|
const SearchcraftSpinnerDarkStyle0 = searchcraftSpinnerDarkModuleCss;
|
|
@@ -10,7 +10,7 @@ const SearchcraftSpinnerDark = /*@__PURE__*/ proxyCustomElement(class Searchcraf
|
|
|
10
10
|
this.__attachShadow();
|
|
11
11
|
}
|
|
12
12
|
render() {
|
|
13
|
-
return (h("div", { key: '
|
|
13
|
+
return (h("div", { key: '60b629930c2e2795236f6768b40c95ce9390e882', class: 'spinnerContainer' }, h("div", { key: 'bfef3329f2e81ecf6538738ac0213da6259dd1c3', class: 'spinnerDark' })));
|
|
14
14
|
}
|
|
15
15
|
static get style() { return SearchcraftSpinnerDarkStyle0; }
|
|
16
16
|
}, [1, "searchcraft-spinner-dark"]);
|
|
@@ -31,4 +31,4 @@ defineCustomElement();
|
|
|
31
31
|
|
|
32
32
|
export { SearchcraftSpinnerDark as S, defineCustomElement as d };
|
|
33
33
|
|
|
34
|
-
//# sourceMappingURL=p-
|
|
34
|
+
//# sourceMappingURL=p-2f5acc0e.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"p-
|
|
1
|
+
{"file":"p-2f5acc0e.js","mappings":";;AAAA,MAAM,+BAA+B,GAAG,sqBAAsqB,CAAC;AAC/sB,qCAAe,+BAA+B;;MCMjC,sBAAsB;;;;;;IACjC,MAAM;QACJ,QACE,4DAAK,KAAK,EAAC,kBAAkB,IAC3B,4DAAK,KAAK,EAAC,aAAa,GAAG,CACvB,EACN;KACH;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/searchcraft-spinner-dark/searchcraft-spinner-dark.module.scss?tag=searchcraft-spinner-dark&encapsulation=shadow","src/components/searchcraft-spinner-dark/searchcraft-spinner-dark.tsx"],"sourcesContent":["$spinner-size: 20px;\n\n.spinnerContainer {\n background-color: transparent;\n height: $spinner-size;\n width: $spinner-size;\n}\n\n.spinnerDark {\n height: 100%;\n width: 100%;\n background: conic-gradient(#000 50%, #FFFFFF);\n clip-path: circle(50%);\n mask-image: radial-gradient(circle at center, rgba(0,0,0,0) calc($spinner-size/3), rgba(0,0,0,1) calc($spinner-size/3));\n animation: spinning 1s linear infinite;\n}\n\n.spinnerLight {\n height: 100%;\n width: 100%;\n background: conic-gradient(#737373 50%, #FFFFFF);\n clip-path: circle(50%);\n mask-image: radial-gradient(circle at center, rgba(0,0,0,0) calc($spinner-size/3), rgba(0,0,0,1) calc($spinner-size/3));\n animation: spinning 1s linear infinite;\n}\n\n@keyframes spinning {\n 0% { transform: rotate(0deg); }\n 50% {transform: rotate(180deg);}\n 100% { transform: rotate(360deg); }\n}","import { Component, h } from '@stencil/core';\n\n@Component({\n tag: 'searchcraft-spinner-dark',\n styleUrl: 'searchcraft-spinner-dark.module.scss',\n shadow: true,\n})\nexport class SearchcraftSpinnerDark {\n render() {\n return (\n <div class='spinnerContainer'>\n <div class='spinnerDark' />\n </div>\n );\n }\n}\n"],"version":3}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as proxyCustomElement, H, h } from './p-
|
|
1
|
+
import { p as proxyCustomElement, H, h } from './p-7498e493.js';
|
|
2
2
|
|
|
3
3
|
const searchcraftSpinnerLightModuleCss = ".spinnerContainer{background-color:transparent;height:20px;width:20px}.spinnerLight{height:100%;width:100%;background:conic-gradient(#737373 50%, #FFFFFF);clip-path:circle(50%);mask-image:radial-gradient(circle at center, rgba(0, 0, 0, 0) 6.6666666667px, rgb(0, 0, 0) 6.6666666667px);animation:spinning 1s linear infinite}@keyframes spinning{0%{transform:rotate(0deg)}50%{transform:rotate(180deg)}100%{transform:rotate(360deg)}}";
|
|
4
4
|
const SearchcraftSpinnerLightStyle0 = searchcraftSpinnerLightModuleCss;
|
|
@@ -10,7 +10,7 @@ const SearchcraftSpinnerLight = /*@__PURE__*/ proxyCustomElement(class Searchcra
|
|
|
10
10
|
this.__attachShadow();
|
|
11
11
|
}
|
|
12
12
|
render() {
|
|
13
|
-
return (h("div", { key: '
|
|
13
|
+
return (h("div", { key: 'ad5224c97faf7e329d2a8904488c17dfd7414b9e', class: 'spinnerContainer' }, h("div", { key: '6336ce7737af65eedac46ee290b20291ce5b6096', class: 'spinnerLight' })));
|
|
14
14
|
}
|
|
15
15
|
static get style() { return SearchcraftSpinnerLightStyle0; }
|
|
16
16
|
}, [1, "searchcraft-spinner-light"]);
|
|
@@ -31,4 +31,4 @@ defineCustomElement();
|
|
|
31
31
|
|
|
32
32
|
export { SearchcraftSpinnerLight as S, defineCustomElement as d };
|
|
33
33
|
|
|
34
|
-
//# sourceMappingURL=p-
|
|
34
|
+
//# sourceMappingURL=p-42f8a605.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"p-
|
|
1
|
+
{"file":"p-42f8a605.js","mappings":";;AAAA,MAAM,gCAAgC,GAAG,8aAA8a,CAAC;AACxd,sCAAe,gCAAgC;;MCMlC,uBAAuB;;;;;;IAClC,MAAM;QACJ,QACE,4DAAK,KAAK,EAAC,kBAAkB,IAC3B,4DAAK,KAAK,EAAC,cAAc,GAAG,CACxB,EACN;KACH;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/searchcraft-spinner-light/searchcraft-spinner-light.module.scss?tag=searchcraft-spinner-light&encapsulation=shadow","src/components/searchcraft-spinner-light/searchcraft-spinner-light.tsx"],"sourcesContent":["$spinner-size: 20px;\n\n.spinnerContainer {\n background-color: transparent;\n height: $spinner-size;\n width: $spinner-size;\n}\n\n.spinnerLight {\n height: 100%;\n width: 100%;\n background: conic-gradient(#737373 50%, #FFFFFF);\n clip-path: circle(50%);\n mask-image: radial-gradient(circle at center, rgba(0,0,0,0) calc($spinner-size/3), rgba(0,0,0,1) calc($spinner-size/3));\n animation: spinning 1s linear infinite;\n}\n\n@keyframes spinning {\n 0% { transform: rotate(0deg); }\n 50% {transform: rotate(180deg);}\n 100% { transform: rotate(360deg); }\n}","import { Component, h } from '@stencil/core';\n\n@Component({\n tag: 'searchcraft-spinner-light',\n styleUrl: 'searchcraft-spinner-light.module.scss',\n shadow: true,\n})\nexport class SearchcraftSpinnerLight {\n render() {\n return (\n <div class='spinnerContainer'>\n <div class='spinnerLight' />\n </div>\n );\n }\n}\n"],"version":3}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { p as proxyCustomElement, H, c as createEvent, h } from './p-7498e493.js';
|
|
2
|
+
|
|
3
|
+
const searchcraftBaseSearchResultModuleCss = "@charset \"UTF-8\";:root{--font-stack:Helvetica, Arial, sans-serif}.interactiveResultContainerLight{background-color:#FAFAFA;align-items:flex-start;border-radius:16px;display:flex;position:relative;flex-direction:column;gap:16px;padding:8px}@media (min-width: 600px){.interactiveResultContainerLight{flex-direction:row}}.interactiveResultContainerDark{background-color:#2E2E2E;align-items:flex-start;border-radius:16px;display:flex;position:relative;flex-direction:column;gap:16px;padding:8px}@media (min-width: 600px){.interactiveResultContainerDark{flex-direction:row}}.resultContainer{align-items:flex-start;display:flex;flex-direction:column;gap:16px}@media (min-width: 600px){.resultContainer{flex-direction:row}}.interactiveIconLarge{display:inline-block;position:absolute;right:5px;top:8px}@media (max-width: 600px){.interactiveIconLarge{display:none}}.interactiveIconSmall{position:absolute;right:5px;top:-2px;display:inline-block}@media (min-width: 600px){.interactiveIconSmall{display:none}}.imageContainer{max-width:100%}.contentContainer{max-height:100%;max-width:100%}@media (min-width: 600px){.contentContainer{max-width:50%}}.secondaryContentContainer{display:flex}.imageLight{aspect-ratio:2/1;border-radius:8px;max-height:100%;max-width:100%;border:1px solid #D9D9D9}.imageDark{aspect-ratio:2/1;border-radius:8px;max-height:100%;max-width:100%;border:1px solid #333}.headingLight{font-family:var(--font-stack);font-size:16px;font-weight:700;line-height:20px;margin-bottom:4px;margin-top:0px;position:relative;color:#292929}.headingDark{font-family:var(--font-stack);font-size:16px;font-weight:700;line-height:20px;margin-bottom:4px;margin-top:0px;position:relative;color:#FFF}.subheadingLight{font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-bottom:4px;margin-top:0px;color:#737373}.subheadingDark{font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-bottom:4px;margin-top:0px;color:#BFBFBF}.primaryContentLight{font-family:var(--font-stack);font-size:16px;font-weight:400;line-height:20px;margin-bottom:4px;margin-top:0px;color:#404040}.primaryContentDark{font-family:var(--font-stack);font-size:16px;font-weight:400;line-height:20px;margin-bottom:4px;margin-top:0px;color:#E6E6E6}.secondaryContentLight{font-family:var(--font-stack);font-size:16px;font-weight:400;line-height:20px;margin-bottom:4px;margin-top:0px;color:#404040}.secondaryContentLight::after{content:\"•\";color:#404040;font-size:1em;margin-left:5px;margin-right:5px}.secondaryContentDark{font-family:var(--font-stack);font-size:16px;font-weight:400;line-height:20px;margin-bottom:4px;margin-top:0px;color:#E6E6E6}.tertiaryContentLight{font-family:var(--font-stack);font-size:16px;font-weight:400;line-height:20px;margin-bottom:4px;margin-top:0px;color:#404040}.tertiaryContentDark{font-family:var(--font-stack);font-size:16px;font-weight:400;line-height:20px;margin-bottom:4px;margin-top:0px;color:#E6E6E6}";
|
|
4
|
+
const SearchcraftBaseSearchResultStyle0 = searchcraftBaseSearchResultModuleCss;
|
|
5
|
+
|
|
6
|
+
const SearchcraftBaseSearchResult = /*@__PURE__*/ proxyCustomElement(class SearchcraftBaseSearchResult extends H {
|
|
7
|
+
constructor() {
|
|
8
|
+
super();
|
|
9
|
+
this.__registerHost();
|
|
10
|
+
this.__attachShadow();
|
|
11
|
+
this.buttonCallback = createEvent(this, "buttonCallback", 7);
|
|
12
|
+
this.keyDownCallback = createEvent(this, "keyDownCallback", 7);
|
|
13
|
+
this.resultCallback = createEvent(this, "resultCallback", 7);
|
|
14
|
+
this.buttonCallback = () => { }; // Callback for button click
|
|
15
|
+
this.keyDownCallback = () => { }; // Callback for key down event
|
|
16
|
+
this.resultCallback = () => { }; // Callback for result container click
|
|
17
|
+
this.handleButtonClick = () => {
|
|
18
|
+
this.buttonCallback();
|
|
19
|
+
};
|
|
20
|
+
this.handleContainerClick = () => {
|
|
21
|
+
if (this.isInteractive) {
|
|
22
|
+
this.resultCallback();
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
this.buttonText = '';
|
|
26
|
+
this.imageDescription = '';
|
|
27
|
+
this.imageSource = '';
|
|
28
|
+
this.isInteractive = false;
|
|
29
|
+
this.primaryContent = '';
|
|
30
|
+
this.secondaryContent = '';
|
|
31
|
+
this.tertiaryContent = '';
|
|
32
|
+
this.headingText = '';
|
|
33
|
+
this.subheadingText = '';
|
|
34
|
+
this.themeMode = 'light';
|
|
35
|
+
this.customStyles = '{}';
|
|
36
|
+
}
|
|
37
|
+
parseStyles() {
|
|
38
|
+
try {
|
|
39
|
+
return JSON.parse(this.customStyles);
|
|
40
|
+
}
|
|
41
|
+
catch (error) {
|
|
42
|
+
console.error('Error parsing custom styles:', error);
|
|
43
|
+
return {};
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
render() {
|
|
47
|
+
const isLightTheme = this.themeMode === 'light';
|
|
48
|
+
const styles = this.parseStyles();
|
|
49
|
+
return (h("div", { key: '91cfc671b0b99082915df3eaafa053a9a7f77929', class: this.isInteractive
|
|
50
|
+
? isLightTheme
|
|
51
|
+
? 'interactiveResultContainerLight'
|
|
52
|
+
: 'interactiveResultContainerDark'
|
|
53
|
+
: 'resultContainer', style: styles.container || {}, tabindex: '0', onClick: this.handleContainerClick, onKeyDown: this.keyDownCallback }, h("div", { key: 'ccda236ef60aee285472155889c5490c69a86415', class: 'imageContainer' }, h("img", { key: 'e55d743952e2997d91f6486436e3a7955ffc1dcc', alt: this.imageDescription, src: this.imageSource, style: styles.image || {}, class: isLightTheme ? 'imageLight' : 'imageDark' })), h("div", { key: 'b0e831c0c7bfef46b8b6da4e84536adf3ebd7158', class: 'contentContainer' }, h("h2", { key: '54137612623a39d711f4e3c888bf2015b6fb9500', style: styles.heading || {}, class: isLightTheme ? 'headingLight' : 'headingDark' }, this.headingText), h("h3", { key: 'de46df990be3d0b5d2134d272e1766e911ab094a', style: styles.subheading || {}, class: isLightTheme ? 'subheadingLight' : 'subheadingDark' }, this.subheadingText), h("p", { key: 'd9e7656bc739b0dd2267f86ac51b17d9ca16da6a', style: styles.primaryContent || {}, class: isLightTheme ? 'primaryContentLight' : 'primaryContentDark' }, this.primaryContent), h("div", { key: 'd05813b3da29b8b21c2e370db9c0cbc7b48b9556', class: 'secondaryContentContainer' }, h("p", { key: 'e8d2ede937705a5bd88927779ee24e35ba2efbd8', style: styles.secondaryContent || {}, class: isLightTheme ? 'secondaryContentLight' : 'secondaryContentDark' }, this.secondaryContent), h("p", { key: '2f9b9f603d55bcefe8347675cb31f705b1f7a0e8', style: styles.tertiaryContent || {}, class: isLightTheme ? 'tertiaryContentLight' : 'tertiaryContentDark' }, this.tertiaryContent)), this.buttonText && (h("button", { key: '58724046c9704974cb3ae1c34335ebb7131b91ab', onClick: this.handleButtonClick, style: styles.button || {}, type: 'button' }, this.buttonText)))));
|
|
54
|
+
}
|
|
55
|
+
static get style() { return SearchcraftBaseSearchResultStyle0; }
|
|
56
|
+
}, [1, "searchcraft-base-search-result", {
|
|
57
|
+
"buttonText": [1, "button-text"],
|
|
58
|
+
"imageDescription": [1, "image-description"],
|
|
59
|
+
"imageSource": [1, "image-source"],
|
|
60
|
+
"isInteractive": [4, "is-interactive"],
|
|
61
|
+
"primaryContent": [1, "primary-content"],
|
|
62
|
+
"secondaryContent": [1, "secondary-content"],
|
|
63
|
+
"tertiaryContent": [1, "tertiary-content"],
|
|
64
|
+
"headingText": [1, "heading-text"],
|
|
65
|
+
"subheadingText": [1, "subheading-text"],
|
|
66
|
+
"themeMode": [1, "theme-mode"],
|
|
67
|
+
"customStyles": [1, "custom-styles"]
|
|
68
|
+
}]);
|
|
69
|
+
function defineCustomElement() {
|
|
70
|
+
if (typeof customElements === "undefined") {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
const components = ["searchcraft-base-search-result"];
|
|
74
|
+
components.forEach(tagName => { switch (tagName) {
|
|
75
|
+
case "searchcraft-base-search-result":
|
|
76
|
+
if (!customElements.get(tagName)) {
|
|
77
|
+
customElements.define(tagName, SearchcraftBaseSearchResult);
|
|
78
|
+
}
|
|
79
|
+
break;
|
|
80
|
+
} });
|
|
81
|
+
}
|
|
82
|
+
defineCustomElement();
|
|
83
|
+
|
|
84
|
+
export { SearchcraftBaseSearchResult as S, defineCustomElement as d };
|
|
85
|
+
|
|
86
|
+
//# sourceMappingURL=p-544b2de1.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"p-544b2de1.js","mappings":";;AAAA,MAAM,oCAAoC,GAAG,i5FAAi5F,CAAC;AAC/7F,0CAAe,oCAAoC;;MCMtC,2BAA2B;;;;;;;;QAa7B,mBAAc,GAAe,SAAQ,CAAC;QACtC,oBAAe,GAAe,SAAQ,CAAC;QACvC,mBAAc,GAAe,SAAQ,CAAC;QAEvC,sBAAiB,GAAG;YAC1B,IAAI,CAAC,cAAc,EAAE,CAAC;SACvB,CAAC;QAEM,yBAAoB,GAAG;YAC7B,IAAI,IAAI,CAAC,aAAa,EAAE;gBACtB,IAAI,CAAC,cAAc,EAAE,CAAC;aACvB;SACF,CAAC;0BAxBmB,EAAE;gCACI,EAAE;2BACP,EAAE;6BACA,KAAK;8BACJ,EAAE;gCACA,EAAE;+BACH,EAAE;2BACN,E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,EAAE,YAAY,GAAG,qBAAqB,GAAG,oBAAoB,IAEjE,IAAI,CAAC,cAAc,CAClB,EACJ,4DAAK,KAAK,EAAC,2BAA2B,IACpC,0DACE,KAAK,EAAE,MAAM,CAAC,gBAAgB,IAAI,EAAE,EACpC,KAAK,EACH,YAAY,GAAG,uBAAuB,GAAG,sBAAsB,IAGhE,IAAI,CAAC,gBAAgB,CACpB,EACJ,0DACE,KAAK,EAAE,MAAM,CAAC,eAAe,IAAI,EAAE,EACnC,KAAK,EACH,YAAY,GAAG,sBAAsB,GAAG,qBAAqB,IAG9D,IAAI,CAAC,eAAe,CACnB,CACA,EACL,IAAI,CAAC,UAAU,KACd,+DACE,OAAO,EAAE,IAAI,CAAC,iBAAiB,EAC/B,KAAK,EAAE,MAAM,CAAC,MAAM,IAAI,EAAE,EAC1B,IAAI,EAAC,QAAQ,IAEZ,IAAI,CAAC,UAAU,CACT,CACV,CACG,CACF,EACN;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/searchcraft-base-search-result/searchcraft-base-search-result.module.scss?tag=searchcraft-base-search-result&encapsulation=shadow","src/components/searchcraft-base-search-result/searchcraft-base-search-result.tsx"],"sourcesContent":["@import '../../utils/theme';\n\n:root {\n --font-stack: Helvetica, Arial, sans-serif;\n}\n\n@mixin interactive-result-container-base {\n align-items: flex-start;\n border-radius: 16px;\n display: flex;\n position: relative;\n flex-direction: column;\n gap: 16px;\n padding: 8px;\n\n @media (min-width: 600px) {\n flex-direction: row;\n }\n}\n\n.interactiveResultContainerLight {\n background-color: $light-search-result-container-background;\n @include interactive-result-container-base;\n}\n\n.interactiveResultContainerDark {\n background-color: $dark-search-result-container-background;\n @include interactive-result-container-base;\n}\n\n.resultContainer {\n align-items: flex-start;\n display: flex;\n flex-direction: column;\n gap: 16px;\n\n @media (min-width: 600px) {\n flex-direction: row;\n }\n}\n\n.interactiveIconLarge {\n display: inline-block;\n position: absolute;\n right: 5px;\n top: 8px;\n\n\n @media (max-width: 600px) {\n display: none;\n }\n}\n\n.interactiveIconSmall {\n position: absolute;\n right: 5px;\n top: -2px;\n display: inline-block;\n\n\n @media (min-width: 600px) {\n display: none;\n }\n}\n\n.imageContainer {\n max-width: 100%;\n}\n\n.contentContainer {\n max-height: 100%;\n max-width: 100%;\n\n @media (min-width: 600px) {\n max-width: 50%;\n }\n}\n\n.secondaryContentContainer {\n display: flex;\n\n}\n\n@mixin image-base {\n aspect-ratio: 2 / 1;\n border-radius: 8px;\n max-height: 100%;\n max-width: 100%;\n}\n\n.imageLight {\n @include image-base;\n border: 1px solid $light-search-result-image-border;\n}\n\n.imageDark {\n @include image-base;\n border: 1px solid $dark-search-result-image-border;\n}\n\n@mixin heading-base {\n font-family: var(--font-stack);\n font-size: 16px;\n font-weight: 700;\n line-height: 20px;\n margin-bottom: 4px;\n margin-top: 0px;\n position: relative;\n}\n\n.headingLight {\n @include heading-base;\n color: $light-search-result-heading-color;\n}\n\n.headingDark {\n @include heading-base;\n color: $dark-search-result-heading-color;\n}\n\n@mixin subheading-base {\n font-family: var(--font-stack);\n font-size: 12px;\n font-weight: 400;\n line-height: 16px;\n margin-bottom: 4px;\n margin-top: 0px;\n}\n\n.subheadingLight {\n @include subheading-base;\n color: $light-search-result-subheading-color;\n}\n\n.subheadingDark {\n @include subheading-base;\n color: $dark-search-result-subheading-color\n}\n\n@mixin body-content-base {\n font-family: var(--font-stack);\n font-size: 16px;\n font-weight: 400;\n line-height: 20px;\n margin-bottom: 4px;\n margin-top: 0px;\n}\n\n.primaryContentLight {\n @include body-content-base;\n color: $light-search-result-body-content-color;\n}\n\n.primaryContentDark {\n @include body-content-base;\n color: $dark-search-result-body-content-color;\n}\n\n.secondaryContentLight {\n @include body-content-base;\n color: $light-search-result-body-content-color;\n}\n\n.secondaryContentLight::after {\n content: \"•\";\n color: $light-search-result-body-content-color;\n font-size: 1em;\n margin-left: 5px;\n margin-right: 5px;\n}\n\n.secondaryContentDark {\n @include body-content-base;\n color: $dark-search-result-body-content-color;\n}\n\n.tertiaryContentLight {\n @include body-content-base;\n color: $light-search-result-body-content-color;\n}\n\n.tertiaryContentDark {\n @include body-content-base;\n color: $dark-search-result-body-content-color;\n}","import { Component, Event, h, Prop } from '@stencil/core';\n\n@Component({\n tag: 'searchcraft-base-search-result',\n styleUrl: 'searchcraft-base-search-result.module.scss',\n shadow: true,\n})\nexport class SearchcraftBaseSearchResult {\n @Prop() buttonText = ''; // Label for the button\n @Prop() imageDescription = ''; // Alternative text for the image\n @Prop() imageSource = ''; // Source URL for the image\n @Prop() isInteractive = false; // Determines if the result is interactive\n @Prop() primaryContent = ''; // Primary body content\n @Prop() secondaryContent = ''; // Secondary body content\n @Prop() tertiaryContent = ''; // Tertiary body content\n @Prop() headingText = ''; // Text for the heading\n @Prop() subheadingText = ''; // Text for the subheading\n @Prop() themeMode: 'light' | 'dark' = 'light'; // Light or dark theme context\n @Prop() customStyles = '{}'; // New string prop for serialized styles.\n\n @Event() buttonCallback: () => void = () => {}; // Callback for button click\n @Event() keyDownCallback: () => void = () => {}; // Callback for key down event\n @Event() resultCallback: () => void = () => {}; // Callback for result container click\n\n private handleButtonClick = () => {\n this.buttonCallback();\n };\n\n private handleContainerClick = () => {\n if (this.isInteractive) {\n this.resultCallback();\n }\n };\n\n private parseStyles(): Record<string, { [key: string]: string }> {\n try {\n return JSON.parse(this.customStyles);\n } catch (error) {\n console.error('Error parsing custom styles:', error);\n return {};\n }\n }\n\n render() {\n const isLightTheme = this.themeMode === 'light';\n const styles = this.parseStyles();\n\n return (\n <div\n class={\n this.isInteractive\n ? isLightTheme\n ? 'interactiveResultContainerLight'\n : 'interactiveResultContainerDark'\n : 'resultContainer'\n }\n style={styles.container || {}}\n tabindex='0'\n onClick={this.handleContainerClick}\n onKeyDown={this.keyDownCallback}\n >\n <div class='imageContainer'>\n <img\n alt={this.imageDescription}\n src={this.imageSource}\n style={styles.image || {}}\n class={isLightTheme ? 'imageLight' : 'imageDark'}\n />\n </div>\n <div class='contentContainer'>\n <h2\n style={styles.heading || {}}\n class={isLightTheme ? 'headingLight' : 'headingDark'}\n >\n {this.headingText}\n </h2>\n <h3\n style={styles.subheading || {}}\n class={isLightTheme ? 'subheadingLight' : 'subheadingDark'}\n >\n {this.subheadingText}\n </h3>\n <p\n style={styles.primaryContent || {}}\n class={isLightTheme ? 'primaryContentLight' : 'primaryContentDark'}\n >\n {this.primaryContent}\n </p>\n <div class='secondaryContentContainer'>\n <p\n style={styles.secondaryContent || {}}\n class={\n isLightTheme ? 'secondaryContentLight' : 'secondaryContentDark'\n }\n >\n {this.secondaryContent}\n </p>\n <p\n style={styles.tertiaryContent || {}}\n class={\n isLightTheme ? 'tertiaryContentLight' : 'tertiaryContentDark'\n }\n >\n {this.tertiaryContent}\n </p>\n </div>\n {this.buttonText && (\n <button\n onClick={this.handleButtonClick}\n style={styles.button || {}}\n type='button'\n >\n {this.buttonText}\n </button>\n )}\n </div>\n </div>\n );\n }\n}\n"],"version":3}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as proxyCustomElement, H, h } from './p-
|
|
1
|
+
import { p as proxyCustomElement, H, h } from './p-7498e493.js';
|
|
2
2
|
import { c as classNames } from './p-5cdc6210.js';
|
|
3
3
|
|
|
4
4
|
const searchcraftInputLabelModuleCss = ":root{--font-stack:Helvetica, Arial, sans-serif}.labelLight{font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-top:4px;color:#292929}.labelDark{font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-top:4px;color:#FFF}";
|
|
@@ -47,4 +47,4 @@ defineCustomElement();
|
|
|
47
47
|
|
|
48
48
|
export { SearchcraftInputLabel as S, defineCustomElement as d };
|
|
49
49
|
|
|
50
|
-
//# sourceMappingURL=p-
|
|
50
|
+
//# sourceMappingURL=p-68ad42b5.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"p-
|
|
1
|
+
{"file":"p-68ad42b5.js","mappings":";;;AAAA,MAAM,8BAA8B,GAAG,4RAA4R,CAAC;AACpU,oCAAe,8BAA8B;;MCOhC,qBAAqB;;;;;mCACD,EAAE;;qBAEhB,OAAO;;IAEhB,YAAY;QAClB,OAAO,IAAI,CAAC,KAAK,KAAK,OAAO,CAAC;KAC/B;IAED,MAAM;;QAEJ,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE;YACf,OAAO,IAAI,CAAC;SACb;QAED,MAAM,UAAU,GAAG,IAAI,CAAC,YAAY,EAAE,GAAG,YAAY,GAAG,WAAW,CAAC;QAEpE,QACE,aACE,KAAK,EAAE,UAAU,CAAC,UAAU,EAAE,IAAI,CAAC,mBAAmB,CAAC,EACvD,OAAO,EAAC,sBAAsB,IAE7B,IAAI,CAAC,KAAK,CACL,EACR;KACH;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/searchcraft-input-label/searchcraft-input-label.module.scss?tag=searchcraft-input-label&encapsulation=shadow","src/components/searchcraft-input-label/searchcraft-input-label.tsx"],"sourcesContent":["@import '../../utils/theme';\n\n:root {\n --font-stack: Helvetica, Arial, sans-serif;\n}\n\n@mixin input-label-base {\n font-family: var(--font-stack);\n font-size: 12px;\n font-weight: 400;\n line-height: 16px;\n margin-top: 4px;\n}\n\n.labelLight {\n @include input-label-base;\n color: $light-input-label-color;\n}\n\n.labelDark {\n @include input-label-base;\n color: $dark-input-label-color;\n}","import { Component, Prop, h, State } from '@stencil/core';\nimport classNames from 'classnames';\n\n@Component({\n tag: 'searchcraft-input-label',\n styleUrl: 'searchcraft-input-label.module.scss',\n shadow: true,\n})\nexport class SearchcraftInputLabel {\n @Prop() inputLabelClassName? = '';\n @Prop() label?: string; // Make label optional\n @State() theme = 'light';\n\n private isLightTheme() {\n return this.theme === 'light';\n }\n\n render() {\n // Render nothing if no label prop is provided\n if (!this.label) {\n return null;\n }\n\n const labelStyle = this.isLightTheme() ? 'labelLight' : 'labelDark';\n\n return (\n <label\n class={classNames(labelStyle, this.inputLabelClassName)}\n htmlFor='searchcraft-input-id'\n >\n {this.label}\n </label>\n );\n }\n}\n"],"version":3}
|