@searchcraft/javascript-sdk 0.2.2 → 0.2.4
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.cjs.js +2 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/searchcraft-auto-search-form_17.cjs.entry.js +46 -61
- package/dist/cjs/searchcraft-auto-search-form_17.cjs.entry.js.map +1 -1
- package/dist/cjs/searchcraft-base-search-form.cjs.entry.js +3 -3
- package/dist/cjs/searchcraft-base-search-form.cjs.entry.js.map +1 -1
- package/dist/cjs/searchcraft-javascript-sdk.cjs.js +1 -1
- package/dist/cjs/{store-ccdd30e6.js → store-b0a26894.js} +3 -4
- package/dist/cjs/{store-ccdd30e6.js.map → store-b0a26894.js.map} +1 -1
- package/dist/cjs/{utils-bd99e8b0.js → utils-15f85bca.js} +23 -4
- package/dist/cjs/utils-15f85bca.js.map +1 -0
- package/dist/collection/components/searchcraft-auto-search-form/searchcraft-auto-search-form.js +10 -10
- 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 +2 -0
- package/dist/collection/components/searchcraft-base-search-form/searchcraft-base-search-form.js +1 -1
- package/dist/collection/components/searchcraft-base-search-form/searchcraft-base-search-form.js.map +1 -1
- package/dist/collection/components/searchcraft-base-search-form/searchcraft-base-search-form.module.css +6 -2
- package/dist/collection/components/searchcraft-base-search-result/searchcraft-base-search-result.js +37 -37
- 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 +7 -7
- package/dist/collection/components/searchcraft-base-search-results/searchcraft-base-search-results.js +53 -73
- 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 +1 -1
- package/dist/collection/components/searchcraft-clear-input-button/searchcraft-clear-input-button.js +2 -3
- package/dist/collection/components/searchcraft-clear-input-button/searchcraft-clear-input-button.js.map +1 -1
- package/dist/collection/components/searchcraft-filters-list/searchcraft-filters-list.js +8 -8
- package/dist/collection/components/searchcraft-filters-list/searchcraft-filters-list.js.map +1 -1
- package/dist/collection/components/searchcraft-input-icon/searchcraft-input-icon.js +15 -15
- package/dist/collection/components/searchcraft-input-icon/searchcraft-input-icon.js.map +1 -1
- package/dist/collection/components/searchcraft-input-label/searchcraft-input-label.js +0 -1
- package/dist/collection/components/searchcraft-input-label/searchcraft-input-label.js.map +1 -1
- package/dist/collection/components/searchcraft-results-info/searchcraft-results-info.module.css +0 -1
- package/dist/collection/components/searchcraft-slider/searchcraft-slider.js +20 -13
- package/dist/collection/components/searchcraft-slider/searchcraft-slider.js.map +1 -1
- package/dist/collection/components/searchcraft-slider/searchcraft-slider.module.css +26 -35
- package/dist/collection/components/searchcraft-spinner-dark/searchcraft-spinner-dark.module.css +6 -6
- package/dist/collection/components/searchcraft-spinner-light/searchcraft-spinner-light.module.css +3 -3
- package/dist/collection/components/searchcraft-toggle-button/searchcraft-toggle-button.module.css +9 -9
- package/dist/collection/index.js +0 -2
- package/dist/collection/index.js.map +1 -1
- package/dist/collection/provider/store.js +2 -4
- package/dist/collection/provider/store.js.map +1 -1
- package/dist/collection/utils/utils.js +21 -3
- package/dist/collection/utils/utils.js.map +1 -1
- package/dist/components/index.js +2 -2
- package/dist/components/{p-2350c0ab.js → p-1204b43a.js} +6 -6
- package/dist/components/{p-2350c0ab.js.map → p-1204b43a.js.map} +1 -1
- package/dist/components/{p-c70cd874.js → p-1c377190.js} +5 -6
- package/dist/components/p-1c377190.js.map +1 -0
- package/dist/components/{p-c815eb98.js → p-25f18f2e.js} +2 -2
- package/dist/components/{p-c815eb98.js.map → p-25f18f2e.js.map} +1 -1
- package/dist/components/{p-99971aa9.js → p-33bb5c45.js} +3 -4
- package/dist/components/{p-99971aa9.js.map → p-33bb5c45.js.map} +1 -1
- package/dist/components/{p-15dd4fe4.js → p-3fece4e2.js} +2 -2
- package/dist/components/{p-15dd4fe4.js.map → p-3fece4e2.js.map} +1 -1
- package/dist/components/{p-85693c64.js → p-576f0d2b.js} +2 -2
- package/dist/components/{p-85693c64.js.map → p-576f0d2b.js.map} +1 -1
- package/dist/components/{p-1101288c.js → p-8c38185e.js} +3 -3
- package/dist/components/p-8c38185e.js.map +1 -0
- package/dist/components/{p-bd90d9b4.js → p-8c70054a.js} +10 -10
- package/dist/components/p-8c70054a.js.map +1 -0
- package/dist/components/{p-8fe6289d.js → p-ae84b899.js} +1 -2
- package/dist/components/p-ae84b899.js.map +1 -0
- package/dist/components/{p-aff5cd24.js → p-ff6c3650.js} +23 -5
- package/dist/components/p-ff6c3650.js.map +1 -0
- package/dist/components/searchcraft-auto-search-form.js +11 -11
- package/dist/components/searchcraft-auto-search-form.js.map +1 -1
- package/dist/components/searchcraft-base-search-form.js +10 -10
- package/dist/components/searchcraft-base-search-form.js.map +1 -1
- package/dist/components/searchcraft-base-search-result.js +1 -1
- package/dist/components/searchcraft-base-search-results.js +21 -41
- package/dist/components/searchcraft-base-search-results.js.map +1 -1
- package/dist/components/searchcraft-button.js +1 -1
- package/dist/components/searchcraft-clear-input-button.js +1 -1
- package/dist/components/searchcraft-filters-list.js +9 -9
- package/dist/components/searchcraft-filters-list.js.map +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.js +2 -2
- package/dist/components/searchcraft-results-info.js.map +1 -1
- package/dist/components/searchcraft-slider.js +17 -10
- 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 +2 -2
- package/dist/components/searchcraft-toggle-button.js.map +1 -1
- package/dist/esm/index.js +2 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/searchcraft-auto-search-form_17.entry.js +46 -61
- package/dist/esm/searchcraft-auto-search-form_17.entry.js.map +1 -1
- package/dist/esm/searchcraft-base-search-form.entry.js +3 -3
- package/dist/esm/searchcraft-base-search-form.entry.js.map +1 -1
- package/dist/esm/searchcraft-javascript-sdk.js +1 -1
- package/dist/esm/{store-311de204.js → store-97358312.js} +3 -4
- package/dist/esm/{store-311de204.js.map → store-97358312.js.map} +1 -1
- package/dist/esm/{utils-e2076797.js → utils-dbb6302b.js} +23 -5
- package/dist/esm/utils-dbb6302b.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/index.esm.js +1 -1
- package/dist/searchcraft-javascript-sdk/p-1a0e85ee.entry.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-1a0e85ee.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-acca6173.entry.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-acca6173.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/{p-80ea9602.js → p-cd489e98.js} +1 -1
- package/dist/searchcraft-javascript-sdk/p-cd489e98.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/p-ff6c3650.js +2 -0
- package/dist/searchcraft-javascript-sdk/p-ff6c3650.js.map +1 -0
- 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 +1 -1
- package/dist/types/components/searchcraft-base-search-result/searchcraft-base-search-result.d.ts +3 -3
- package/dist/types/components/searchcraft-base-search-results/searchcraft-base-search-results.d.ts +8 -9
- package/dist/types/components/searchcraft-filters-list/searchcraft-filters-list.d.ts +1 -1
- package/dist/types/components/searchcraft-input-icon/searchcraft-input-icon.d.ts +1 -7
- package/dist/types/components/searchcraft-slider/searchcraft-slider.d.ts +4 -4
- package/dist/types/components.d.ts +1 -13
- package/dist/types/provider/store.d.ts +8 -8
- package/dist/types/utils/utils.d.ts +1 -0
- package/package.json +1 -1
- package/dist/cjs/utils-bd99e8b0.js.map +0 -1
- package/dist/components/p-1101288c.js.map +0 -1
- package/dist/components/p-8fe6289d.js.map +0 -1
- package/dist/components/p-aff5cd24.js.map +0 -1
- package/dist/components/p-bd90d9b4.js.map +0 -1
- package/dist/components/p-c70cd874.js.map +0 -1
- package/dist/esm/utils-e2076797.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-6108dd80.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-6108dd80.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-80ea9602.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-a9bac3ca.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-a9bac3ca.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-aff5cd24.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-aff5cd24.js.map +0 -1
package/dist/cjs/index.cjs.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const utils = require('./utils-
|
|
6
|
-
const store = require('./store-
|
|
5
|
+
const utils = require('./utils-15f85bca.js');
|
|
6
|
+
const store = require('./store-b0a26894.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -8,7 +8,7 @@ const appGlobals = require('./app-globals-3a1e7e63.js');
|
|
|
8
8
|
const defineCustomElements = async (win, options) => {
|
|
9
9
|
if (typeof window === 'undefined') return undefined;
|
|
10
10
|
await appGlobals.globalScripts();
|
|
11
|
-
return index.bootstrapLazy([["searchcraft-auto-search-form_17.cjs",[[1,"searchcraft-auto-search-form",{"autoSearchFormClass":[1,"auto-search-form-class"],"clearInput":[16],"config":[16],"customStylesForInput":[1,"custom-styles-for-input"],"inputCaptionValue":[1,"input-caption-value"],"inputIconHeight":[2,"input-icon-height"],"inputIconWidth":[2,"input-icon-width"],"labelForInput":[1,"label-for-input"],"placeholderValue":[1,"placeholder-value"],"rightToLeftOrientation":[4,"right-to-left-orientation"],"searchContainerClass":[1,"search-container-class"],"error":[32],"isRequesting":[32],"query":[32],"searchResults":[32]}],[1,"searchcraft-base-search-results",{"
|
|
11
|
+
return index.bootstrapLazy([["searchcraft-auto-search-form_17.cjs",[[1,"searchcraft-auto-search-form",{"autoSearchFormClass":[1,"auto-search-form-class"],"clearInput":[16],"config":[16],"customStylesForInput":[1,"custom-styles-for-input"],"inputCaptionValue":[1,"input-caption-value"],"inputIconHeight":[2,"input-icon-height"],"inputIconWidth":[2,"input-icon-width"],"labelForInput":[1,"label-for-input"],"placeholderValue":[1,"placeholder-value"],"rightToLeftOrientation":[4,"right-to-left-orientation"],"searchContainerClass":[1,"search-container-class"],"error":[32],"isRequesting":[32],"query":[32],"searchResults":[32]}],[1,"searchcraft-base-search-results",{"adInterval":[2,"ad-interval"],"customStylesForResults":[1,"custom-styles-for-results"],"documentAttributesForDisplay":[1,"document-attributes-for-display"],"fallbackElement":[16],"formatTime":[4,"format-time"],"placeAdAtEnd":[4,"place-ad-at-end"],"placeAdAtStart":[4,"place-ad-at-start"],"hasSearched":[32],"query":[32],"searchResults":[32]}],[1,"searchcraft-filters-list",{"filters":[16],"dynamicFilters":[32],"initialFilters":[32],"isRequesting":[32],"originalFilterCounts":[32],"query":[32],"resultsCount":[32],"selectedFilters":[32]}],[1,"searchcraft-results-info",{"isRequesting":[32],"resultsCount":[32],"responseTime":[32],"query":[32]}],[1,"searchcraft-slider",{"maxYear":[2,"max-year"],"minYear":[2,"min-year"],"endYear":[32],"hasSearched":[32],"query":[32],"resultsCount":[32],"startYear":[32]}],[1,"searchcraft-toggle-button",{"type":[1],"isActive":[32],"query":[32],"resultsCount":[32]}],[1,"searchcraft-base-search-result",{"buttonText":[1,"button-text"],"customStyles":[1,"custom-styles"],"headingText":[1,"heading-text"],"imageDescription":[1,"image-description"],"imageSource":[1,"image-source"],"isInteractive":[4,"is-interactive"],"primaryContent":[1,"primary-content"],"secondaryContent":[1,"secondary-content"],"subheadingText":[1,"subheading-text"],"tertiaryContent":[1,"tertiary-content"],"themeMode":[1,"theme-mode"]}],[1,"searchcraft-input",{"customStyles":[1,"custom-styles"],"error":[4],"formClassName":[1,"form-class-name"],"inputCaptionClassName":[1,"input-caption-class-name"],"inputCaptionValue":[1,"input-caption-value"],"inputClassName":[1,"input-class-name"],"inputIconHeight":[2,"input-icon-height"],"inputIconWidth":[2,"input-icon-width"],"isRequesting":[4,"is-requesting"],"placeholderValue":[1,"placeholder-value"],"rightToLeftOrientation":[4,"right-to-left-orientation"],"query":[1],"theme":[32]}],[1,"searchcraft-input-label",{"inputLabelClassName":[1,"input-label-class-name"],"label":[1],"theme":[32]}],[1,"searchcraft-clear-input-button",{"isRequesting":[4,"is-requesting"],"rightToLeftOrientation":[4,"right-to-left-orientation"],"theme":[32]}],[1,"searchcraft-input-icon",{"error":[4],"height":[2],"rightToLeftOrientation":[4,"right-to-left-orientation"],"width":[2],"theme":[32]}],[1,"searchcraft-error-message",{"errorMessage":[1,"error-message"],"theme":[1]}],[1,"searchcraft-input-caption",{"error":[4],"inputCaptionClassName":[1,"input-caption-class-name"],"inputCaptionValue":[1,"input-caption-value"],"rightToLeftOrientation":[4,"right-to-left-orientation"],"theme":[32]}],[1,"searchcraft-clear-icon-set",{"type":[1]}],[1,"searchcraft-search-icon-set",{"type":[1],"width":[2],"height":[2]}],[1,"searchcraft-spinner-light"],[1,"searchcraft-spinner-dark"]]],["searchcraft-base-search-form.cjs",[[1,"searchcraft-base-search-form",{"config":[16],"errorMessage":[1,"error-message"],"labelForInput":[1,"label-for-input"],"rightToLeftOrientation":[4,"right-to-left-orientation"],"error":[32],"query":[32],"searchResults":[32]}]]],["searchcraft-button-icon.cjs",[[1,"searchcraft-button-icon"]]],["searchcraft-button.cjs",[[1,"searchcraft-button",{"iconElement":[16],"iconOnly":[4,"icon-only"],"iconPosition":[1,"icon-position"],"label":[1],"isRequesting":[32],"theme":[32]}]]]], options);
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
exports.setNonce = index.setNonce;
|
|
@@ -3,18 +3,18 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-6c5282a0.js');
|
|
6
|
-
const store = require('./store-
|
|
7
|
-
const utils = require('./utils-
|
|
6
|
+
const store = require('./store-b0a26894.js');
|
|
7
|
+
const utils = require('./utils-15f85bca.js');
|
|
8
8
|
const index$1 = require('./index-5b0b9d4c.js');
|
|
9
9
|
|
|
10
|
-
const searchcraftAutoSearchFormModuleCss = ":root{--font-stack:Helvetica, Arial, sans-serif}.formLTR{text-align:left;width:100%}.formRTL{text-align:right;width:100%}";
|
|
10
|
+
const searchcraftAutoSearchFormModuleCss = ":root{--font-stack:Helvetica, Arial, sans-serif}.formLTR{font-family:var(--font-stack);text-align:left;width:100%}.formRTL{font-family:var(--font-stack);text-align:right;width:100%}";
|
|
11
11
|
const SearchcraftAutoSearchFormStyle0 = searchcraftAutoSearchFormModuleCss;
|
|
12
12
|
|
|
13
13
|
const SearchcraftAutoSearchForm = class {
|
|
14
14
|
constructor(hostRef) {
|
|
15
15
|
index.registerInstance(this, hostRef);
|
|
16
|
-
this.querySubmit = index.createEvent(this, "querySubmit", 7);
|
|
17
16
|
this.inputClearedOrNoResults = index.createEvent(this, "inputClearedOrNoResults", 7);
|
|
17
|
+
this.querySubmit = index.createEvent(this, "querySubmit", 7);
|
|
18
18
|
this.debounceTimeout = null;
|
|
19
19
|
this.debounceDelay = 0;
|
|
20
20
|
this.searchStore = store.useSearchcraftStore.getState();
|
|
@@ -108,12 +108,12 @@ const SearchcraftAutoSearchForm = class {
|
|
|
108
108
|
if (this.query.length > 0 && ((_c = (_b = (_a = this.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) {
|
|
109
109
|
this.inputClearedOrNoResults.emit();
|
|
110
110
|
}
|
|
111
|
-
return (index.h("form", { key: '
|
|
111
|
+
return (index.h("form", { key: '1ecc90be4b39c7fbfff4a3c89c319343f6478a1e', class: `${formClass}`, onSubmit: this.handleFormSubmit }, index.h("searchcraft-input-label", { key: '82ee01912536de6a11e20f7df533856a41ebc343', label: this.labelForInput }), index.h("searchcraft-input", { key: 'ad00322933a20db2865cd79241056f7b0ee84a15', customStyles: parsedCustomStyles, "input-caption-value": this.inputCaptionValue, "input-icon-height": this.inputIconHeight, "input-icon-width": this.inputIconWidth, "is-requesting": this.isRequesting, onClearInput: this.handleClearInput, onInputKeyUp: this.handleInputKeyUp, onSearchInputChange: this.handleInputChange, "placeholder-value": this.placeholderValue, query: this.query, "right-to-left-orientation": this.rightToLeftOrientation }), this.error && (index.h("searchcraft-error-message", { key: '588a134a1130d3c4e4fc921b09450268057b8217', errorMessage: 'Please enter a search query.' }))));
|
|
112
112
|
}
|
|
113
113
|
};
|
|
114
114
|
SearchcraftAutoSearchForm.style = SearchcraftAutoSearchFormStyle0;
|
|
115
115
|
|
|
116
|
-
const searchcraftBaseSearchResultModuleCss = "@charset \"UTF-8\";:root{--font-stack:Helvetica, Arial, sans-serif}.interactiveResultContainerLight{
|
|
116
|
+
const searchcraftBaseSearchResultModuleCss = "@charset \"UTF-8\";:root{--font-stack:Helvetica, Arial, sans-serif}.interactiveResultContainerLight{align-items:flex-start;border-radius:16px;display:flex;flex-direction:column;gap:16px;padding:8px;position:relative;background-color:#FAFAFA}@media (min-width: 600px){.interactiveResultContainerLight{flex-direction:row}}.interactiveResultContainerDark{align-items:flex-start;border-radius:16px;display:flex;flex-direction:column;gap:16px;padding:8px;position:relative;background-color:#2E2E2E}@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{display:inline-block;position:absolute;right:5px;top:-2px}@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:0;position:relative;color:#292929}.headingDark{font-family:var(--font-stack);font-size:16px;font-weight:700;line-height:20px;margin-bottom:4px;margin-top:0;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}";
|
|
117
117
|
const SearchcraftBaseSearchResultStyle0 = searchcraftBaseSearchResultModuleCss;
|
|
118
118
|
|
|
119
119
|
const SearchcraftBaseSearchResult = class {
|
|
@@ -134,16 +134,16 @@ const SearchcraftBaseSearchResult = class {
|
|
|
134
134
|
}
|
|
135
135
|
};
|
|
136
136
|
this.buttonText = '';
|
|
137
|
+
this.customStyles = '{}';
|
|
138
|
+
this.headingText = '';
|
|
137
139
|
this.imageDescription = '';
|
|
138
140
|
this.imageSource = '';
|
|
139
141
|
this.isInteractive = false;
|
|
140
142
|
this.primaryContent = '';
|
|
141
143
|
this.secondaryContent = '';
|
|
142
|
-
this.tertiaryContent = '';
|
|
143
|
-
this.headingText = '';
|
|
144
144
|
this.subheadingText = '';
|
|
145
|
+
this.tertiaryContent = '';
|
|
145
146
|
this.themeMode = 'light';
|
|
146
|
-
this.customStyles = '{}';
|
|
147
147
|
}
|
|
148
148
|
parseStyles() {
|
|
149
149
|
try {
|
|
@@ -161,27 +161,27 @@ const SearchcraftBaseSearchResult = class {
|
|
|
161
161
|
? isLightTheme
|
|
162
162
|
? 'interactiveResultContainerLight'
|
|
163
163
|
: 'interactiveResultContainerDark'
|
|
164
|
-
: 'resultContainer', style: styles.container || {}, tabindex: '0'
|
|
164
|
+
: 'resultContainer', onKeyDown: this.keyDownCallback, onClick: this.handleContainerClick, style: styles.container || {}, tabindex: '0' }, index.h("div", { key: 'ccda236ef60aee285472155889c5490c69a86415', class: 'imageContainer' }, index.h("img", { key: 'e55d743952e2997d91f6486436e3a7955ffc1dcc', alt: this.imageDescription, class: isLightTheme ? 'imageLight' : 'imageDark', src: this.imageSource, style: styles.image || {} })), index.h("div", { key: 'b0e831c0c7bfef46b8b6da4e84536adf3ebd7158', class: 'contentContainer' }, index.h("h2", { key: '54137612623a39d711f4e3c888bf2015b6fb9500', class: isLightTheme ? 'headingLight' : 'headingDark', style: styles.heading || {} }, this.headingText), index.h("h3", { key: 'de46df990be3d0b5d2134d272e1766e911ab094a', class: isLightTheme ? 'subheadingLight' : 'subheadingDark', style: styles.subheading || {} }, this.subheadingText), index.h("p", { key: 'd9e7656bc739b0dd2267f86ac51b17d9ca16da6a', class: isLightTheme ? 'primaryContentLight' : 'primaryContentDark', style: styles.primaryContent || {} }, this.primaryContent), index.h("div", { key: 'd05813b3da29b8b21c2e370db9c0cbc7b48b9556', class: 'secondaryContentContainer' }, index.h("p", { key: 'e8d2ede937705a5bd88927779ee24e35ba2efbd8', class: isLightTheme ? 'secondaryContentLight' : 'secondaryContentDark', style: styles.secondaryContent || {} }, this.secondaryContent), index.h("p", { key: '2f9b9f603d55bcefe8347675cb31f705b1f7a0e8', class: isLightTheme ? 'tertiaryContentLight' : 'tertiaryContentDark', style: styles.tertiaryContent || {} }, this.tertiaryContent)), this.buttonText && (index.h("button", { key: '58724046c9704974cb3ae1c34335ebb7131b91ab', onClick: this.handleButtonClick, style: styles.button || {}, type: 'button' }, this.buttonText)))));
|
|
165
165
|
}
|
|
166
166
|
};
|
|
167
167
|
SearchcraftBaseSearchResult.style = SearchcraftBaseSearchResultStyle0;
|
|
168
168
|
|
|
169
|
-
const searchcraftBaseSearchResultsModuleCss = ":root{--font-stack:Helvetica, Arial, sans-serif}.resultsContainer{display:flex;flex-direction:column;justify-content:center;margin:16px 0}.resultsContainer>p{align-self:center}.resultsContainer>div{margin-bottom:20px}.resultsContainer>div img{height:300px;width:200px}.adSection{align-items:center;background-color:#F1F1F1;border:1px solid #DCDDDE;border-radius:16px;display:flex;flex-direction:column;font-size:16px;justify-content:center;margin:auto;min-height:150px;text-align:center;width:100%}.adSection p{margin-top:5px}.emptyState{
|
|
169
|
+
const searchcraftBaseSearchResultsModuleCss = ":root{--font-stack:Helvetica, Arial, sans-serif}.resultsContainer{display:flex;flex-direction:column;justify-content:center;margin:16px 0}.resultsContainer>p{align-self:center}.resultsContainer>div{margin-bottom:20px}.resultsContainer>div img{height:300px;width:200px}.adSection{align-items:center;background-color:#F1F1F1;border:1px solid #DCDDDE;border-radius:16px;display:flex;flex-direction:column;font-size:16px;justify-content:center;margin:auto;min-height:150px;text-align:center;width:100%}.adSection p{margin-top:5px}.emptyState{text-align:center;width:100%}.errorMessageContainer{text-align:center}";
|
|
170
170
|
const SearchcraftBaseSearchResultsStyle0 = searchcraftBaseSearchResultsModuleCss;
|
|
171
171
|
|
|
172
172
|
const SearchcraftBaseSearchResults = class {
|
|
173
173
|
constructor(hostRef) {
|
|
174
174
|
index.registerInstance(this, hostRef);
|
|
175
|
-
this.query = '';
|
|
176
|
-
this.searchResults = null;
|
|
177
|
-
this.hasSearched = false;
|
|
178
|
-
this.documentAttributesForDisplay = '';
|
|
179
|
-
this.customStylesForResults = {};
|
|
180
|
-
this.placeAdAtStart = true;
|
|
181
|
-
this.placeAdAtEnd = false;
|
|
182
175
|
this.adInterval = 4;
|
|
183
|
-
this.
|
|
176
|
+
this.customStylesForResults = {};
|
|
177
|
+
this.documentAttributesForDisplay = '';
|
|
184
178
|
this.fallbackElement = null;
|
|
179
|
+
this.formatTime = true;
|
|
180
|
+
this.placeAdAtEnd = false;
|
|
181
|
+
this.placeAdAtStart = true;
|
|
182
|
+
this.hasSearched = false;
|
|
183
|
+
this.query = '';
|
|
184
|
+
this.searchResults = null;
|
|
185
185
|
}
|
|
186
186
|
componentDidLoad() {
|
|
187
187
|
if (!this.documentAttributesForDisplay ||
|
|
@@ -208,25 +208,6 @@ const SearchcraftBaseSearchResults = class {
|
|
|
208
208
|
this.unsubscribe();
|
|
209
209
|
}
|
|
210
210
|
}
|
|
211
|
-
timeAgo(timestamp) {
|
|
212
|
-
const now = new Date();
|
|
213
|
-
const inputTime = new Date(timestamp);
|
|
214
|
-
const diffInSeconds = Math.floor((now.getTime() - inputTime.getTime()) / 1000);
|
|
215
|
-
const minutes = Math.floor(diffInSeconds / 60);
|
|
216
|
-
const hours = Math.floor(minutes / 60);
|
|
217
|
-
const days = Math.floor(hours / 24);
|
|
218
|
-
const years = Math.floor(days / 365);
|
|
219
|
-
if (minutes < 60) {
|
|
220
|
-
return `${minutes}m ago`;
|
|
221
|
-
}
|
|
222
|
-
if (hours < 24) {
|
|
223
|
-
return `${hours}h ago`;
|
|
224
|
-
}
|
|
225
|
-
if (days < 365) {
|
|
226
|
-
return `${days}d ago`;
|
|
227
|
-
}
|
|
228
|
-
return `${years}y ago`;
|
|
229
|
-
}
|
|
230
211
|
render() {
|
|
231
212
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
232
213
|
if (!this.hasSearched) {
|
|
@@ -243,7 +224,6 @@ const SearchcraftBaseSearchResults = class {
|
|
|
243
224
|
const resultsComponents = (_d = (_c = (_b = this.searchResults) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c.hits) === null || _d === void 0 ? void 0 : _d.map((document, index$1) => {
|
|
244
225
|
const { doc: result } = document;
|
|
245
226
|
const dynamicProperties = utils.extractDynamicProperties(result, parsedSearchKeys);
|
|
246
|
-
// Apply timeAgo formatting if formatTime is true
|
|
247
227
|
if (this.formatTime) {
|
|
248
228
|
for (const key of parsedSearchKeys) {
|
|
249
229
|
if (dynamicProperties[key]) {
|
|
@@ -251,12 +231,12 @@ const SearchcraftBaseSearchResults = class {
|
|
|
251
231
|
// Check if the value is a valid ISO timestamp
|
|
252
232
|
if (typeof value === 'string' &&
|
|
253
233
|
!Number.isNaN(Date.parse(value))) {
|
|
254
|
-
dynamicProperties[key] =
|
|
234
|
+
dynamicProperties[key] = utils.getFormattedTimeFromNow(value);
|
|
255
235
|
}
|
|
256
236
|
}
|
|
257
237
|
}
|
|
258
238
|
}
|
|
259
|
-
return (index.h("searchcraft-base-search-result", {
|
|
239
|
+
return (index.h("searchcraft-base-search-result", { "button-callback": () => console.log('button callback'), "custom-styles": serializedStyles, "image-source": dynamicProperties[parsedSearchKeys[parsedSearchKeys.length - 1]], "is-interactive": true, key: `${document.document_id}-${index$1}`, "keydown-callback": () => console.log('keydown'), "heading-text": dynamicProperties[parsedSearchKeys[0]], "primary-content": dynamicProperties[parsedSearchKeys[2]], "result-callback": () => console.log('interactive element'), "secondary-content": dynamicProperties[parsedSearchKeys[3]], "subheading-text": dynamicProperties[parsedSearchKeys[1]], "tertiary-content": dynamicProperties[parsedSearchKeys[4]] }));
|
|
260
240
|
});
|
|
261
241
|
const finalComponents = [];
|
|
262
242
|
if (this.placeAdAtStart) {
|
|
@@ -310,10 +290,9 @@ const SearchcraftClearInputButton = class {
|
|
|
310
290
|
constructor(hostRef) {
|
|
311
291
|
index.registerInstance(this, hostRef);
|
|
312
292
|
this.clearInput = index.createEvent(this, "clearInput", 7);
|
|
313
|
-
// Added a click handler to emit the event
|
|
314
293
|
this.handleClearClick = (event) => {
|
|
315
|
-
event.preventDefault();
|
|
316
|
-
this.clearInput.emit();
|
|
294
|
+
event.preventDefault();
|
|
295
|
+
this.clearInput.emit();
|
|
317
296
|
};
|
|
318
297
|
this.isRequesting = false;
|
|
319
298
|
this.rightToLeftOrientation = false;
|
|
@@ -368,10 +347,10 @@ const SearchcraftFiltersList = class {
|
|
|
368
347
|
this.dynamicFilters = [];
|
|
369
348
|
this.initialFilters = [];
|
|
370
349
|
this.isRequesting = false;
|
|
371
|
-
this.selectedFilters = new Set();
|
|
372
350
|
this.originalFilterCounts = {};
|
|
373
351
|
this.query = '';
|
|
374
352
|
this.resultsCount = 0;
|
|
353
|
+
this.selectedFilters = new Set();
|
|
375
354
|
}
|
|
376
355
|
connectedCallback() {
|
|
377
356
|
this.unsubscribe = store.useSearchcraftStore.subscribe((state) => {
|
|
@@ -413,10 +392,10 @@ const SearchcraftFiltersList = class {
|
|
|
413
392
|
}
|
|
414
393
|
formatLabel(label) {
|
|
415
394
|
return label
|
|
416
|
-
.replace(/-/g, ' ')
|
|
417
|
-
.split(' ')
|
|
418
|
-
.map((word) => word.charAt(0).toUpperCase() + word.slice(1))
|
|
419
|
-
.join(' ');
|
|
395
|
+
.replace(/-/g, ' ')
|
|
396
|
+
.split(' ')
|
|
397
|
+
.map((word) => word.charAt(0).toUpperCase() + word.slice(1))
|
|
398
|
+
.join(' ');
|
|
420
399
|
}
|
|
421
400
|
render() {
|
|
422
401
|
if (!this.query || this.resultsCount === 0) {
|
|
@@ -430,7 +409,7 @@ const SearchcraftFiltersList = class {
|
|
|
430
409
|
});
|
|
431
410
|
return (index.h("div", { class: 'filtersList' }, filtersToRender.map((filter) => (index.h("div", { key: filter.value }, index.h("label", { class: 'checkboxLabel' }, index.h("input", { class: 'filterCheckbox', checked: filter.isChecked, onChange: (event) => this.handleFilterChange(filter.value, event.target.checked), type: 'checkbox', value: filter.value }), this.formatLabel(filter.label)), filter.isChecked &&
|
|
432
411
|
filter.children.map((childFilter) => {
|
|
433
|
-
const childLabel = childFilter.label.split('/').pop();
|
|
412
|
+
const childLabel = childFilter.label.split('/').pop();
|
|
434
413
|
return (index.h("label", { class: 'childCheckboxLabel', key: childFilter.value, style: { marginLeft: '20px' } }, index.h("input", { class: 'childFilterCheckbox', checked: this.selectedFilters.has(childFilter.value), onChange: (event) => this.handleFilterChange(childFilter.value, event.target.checked), type: 'checkbox', value: childFilter.value }), this.formatLabel(childLabel || '')));
|
|
435
414
|
}))))));
|
|
436
415
|
}
|
|
@@ -544,8 +523,8 @@ const SearchcraftInputIcon = class {
|
|
|
544
523
|
constructor(hostRef) {
|
|
545
524
|
index.registerInstance(this, hostRef);
|
|
546
525
|
this.error = undefined;
|
|
547
|
-
this.rightToLeftOrientation = false;
|
|
548
526
|
this.height = 20;
|
|
527
|
+
this.rightToLeftOrientation = false;
|
|
549
528
|
this.width = 20;
|
|
550
529
|
this.theme = 'light';
|
|
551
530
|
}
|
|
@@ -572,7 +551,6 @@ const SearchcraftInputLabel = class {
|
|
|
572
551
|
return this.theme === 'light';
|
|
573
552
|
}
|
|
574
553
|
render() {
|
|
575
|
-
// Render nothing if no label prop is provided
|
|
576
554
|
if (!this.label) {
|
|
577
555
|
return null;
|
|
578
556
|
}
|
|
@@ -582,7 +560,7 @@ const SearchcraftInputLabel = class {
|
|
|
582
560
|
};
|
|
583
561
|
SearchcraftInputLabel.style = SearchcraftInputLabelStyle0;
|
|
584
562
|
|
|
585
|
-
const searchcraftResultsInfoModuleCss = ".container{border-bottom:1px solid #D9D9D9;display:flex;justify-content:flex-start;width:100%}.resultsInfo{color:#292929;font-
|
|
563
|
+
const searchcraftResultsInfoModuleCss = ".container{border-bottom:1px solid #D9D9D9;display:flex;justify-content:flex-start;width:100%}.resultsInfo{color:#292929;font-size:18px;font-weight:600;line-height:20px;margin:0;margin-bottom:8px}";
|
|
586
564
|
const SearchcraftResultsInfoStyle0 = searchcraftResultsInfoModuleCss;
|
|
587
565
|
|
|
588
566
|
const SearchcraftResultsInfo = class {
|
|
@@ -640,7 +618,7 @@ const SearchcraftSearchIconSet = class {
|
|
|
640
618
|
}
|
|
641
619
|
};
|
|
642
620
|
|
|
643
|
-
const searchcraftSliderModuleCss = ".
|
|
621
|
+
const searchcraftSliderModuleCss = ".sliderContainer{display:flex;flex-direction:column;gap:10px;font-family:Arial, sans-serif;align-items:center;width:100%}.rangeContainer{display:flex;position:relative;width:100%;align-items:center}.rangeContainer .activeRange{position:absolute;top:50%;transform:translateY(-50%);height:4px;background:#007DB3;z-index:0;border-radius:2px}.rangeContainer .rangeSlider{width:100%;height:4px;background:transparent;border-radius:2px;outline:none;-webkit-appearance:none;appearance:none;position:absolute;margin:0}.rangeContainer .rangeSlider::-webkit-slider-thumb{-webkit-appearance:none;width:20px;height:20px;background-color:#FFF;border-radius:50%;border:2px solid #e6e6e6;cursor:pointer}.rangeContainer .rangeSlider::-moz-range-thumb{width:20px;height:20px;background-color:#FFF;border-radius:50%;border:2px solid #e6e6e6;cursor:pointer}.yearLabels{display:flex;justify-content:space-between;width:100%;margin-top:10px;font-size:15px;font-weight:600;font-family:\"Source Sans Pro\", sans-serif;color:#666}.yearLabel{min-width:30px;text-align:center}";
|
|
644
622
|
const SearchcraftSliderStyle0 = searchcraftSliderModuleCss;
|
|
645
623
|
|
|
646
624
|
const SearchcraftSlider = class {
|
|
@@ -671,13 +649,13 @@ const SearchcraftSlider = class {
|
|
|
671
649
|
this.endYear = Math.max(value, this.startYear);
|
|
672
650
|
this.updateYears();
|
|
673
651
|
};
|
|
674
|
-
this.minYear = 2000;
|
|
675
652
|
this.maxYear = new Date().getFullYear();
|
|
653
|
+
this.minYear = 2014;
|
|
676
654
|
this.endYear = this.maxYear;
|
|
677
|
-
this.query = '';
|
|
678
|
-
this.startYear = this.minYear;
|
|
679
655
|
this.hasSearched = false;
|
|
656
|
+
this.query = '';
|
|
680
657
|
this.resultsCount = 0;
|
|
658
|
+
this.startYear = this.minYear;
|
|
681
659
|
}
|
|
682
660
|
componentDidLoad() {
|
|
683
661
|
this.unsubscribe = store.useSearchcraftStore.subscribe((state) => {
|
|
@@ -698,12 +676,19 @@ const SearchcraftSlider = class {
|
|
|
698
676
|
if (!this.query || this.resultsCount === 0) {
|
|
699
677
|
return null;
|
|
700
678
|
}
|
|
701
|
-
|
|
679
|
+
const rangeMin = this.minYear;
|
|
680
|
+
const rangeMax = this.maxYear;
|
|
681
|
+
const startPercent = ((this.startYear - rangeMin) / (rangeMax - rangeMin)) * 100;
|
|
682
|
+
const endPercent = ((this.endYear - rangeMin) / (rangeMax - rangeMin)) * 100;
|
|
683
|
+
return (index.h("div", { class: 'sliderContainer' }, index.h("div", { class: 'rangeContainer' }, index.h("div", { class: 'activeRange', style: {
|
|
684
|
+
left: `${startPercent}%`,
|
|
685
|
+
width: `${endPercent - startPercent}%`,
|
|
686
|
+
} }), index.h("input", { class: 'rangeSlider', max: this.maxYear, min: this.minYear, onInput: this.handleStartYearChange, step: '1', type: 'range', value: this.startYear }), index.h("input", { class: 'rangeSlider', max: this.maxYear, min: this.minYear, onInput: this.handleEndYearChange, step: '1', type: 'range', value: this.endYear })), index.h("div", { class: 'yearLabels' }, index.h("span", { class: 'yearLabel' }, this.startYear), index.h("span", { class: 'yearLabel' }, this.endYear))));
|
|
702
687
|
}
|
|
703
688
|
};
|
|
704
689
|
SearchcraftSlider.style = SearchcraftSliderStyle0;
|
|
705
690
|
|
|
706
|
-
const searchcraftSpinnerDarkModuleCss = ".spinnerContainer{background-color:transparent;height:20px;width:20px}.spinnerDark{
|
|
691
|
+
const searchcraftSpinnerDarkModuleCss = ".spinnerContainer{background-color:transparent;height:20px;width:20px}.spinnerDark{animation:spinning 1s linear infinite;background:conic-gradient(#000 50%, #FFFFFF);clip-path:circle(50%);height:100%;mask-image:radial-gradient(circle at center, rgba(0, 0, 0, 0) 6.6666666667px, rgb(0, 0, 0) 6.6666666667px);width:100%}.spinnerLight{animation:spinning 1s linear infinite;background:conic-gradient(#737373 50%, #FFFFFF);clip-path:circle(50%);height:100%;mask-image:radial-gradient(circle at center, rgba(0, 0, 0, 0) 6.6666666667px, rgb(0, 0, 0) 6.6666666667px);width:100%}@keyframes spinning{0%{transform:rotate(0deg)}50%{transform:rotate(180deg)}100%{transform:rotate(360deg)}}";
|
|
707
692
|
const SearchcraftSpinnerDarkStyle0 = searchcraftSpinnerDarkModuleCss;
|
|
708
693
|
|
|
709
694
|
const SearchcraftSpinnerDark = class {
|
|
@@ -716,7 +701,7 @@ const SearchcraftSpinnerDark = class {
|
|
|
716
701
|
};
|
|
717
702
|
SearchcraftSpinnerDark.style = SearchcraftSpinnerDarkStyle0;
|
|
718
703
|
|
|
719
|
-
const searchcraftSpinnerLightModuleCss = ".spinnerContainer{background-color:transparent;height:20px;width:20px}.spinnerLight{
|
|
704
|
+
const searchcraftSpinnerLightModuleCss = ".spinnerContainer{background-color:transparent;height:20px;width:20px}.spinnerLight{animation:spinning 1s linear infinite;background:conic-gradient(#737373 50%, #FFFFFF);clip-path:circle(50%);height:100%;mask-image:radial-gradient(circle at center, rgba(0, 0, 0, 0) 6.6666666667px, rgb(0, 0, 0) 6.6666666667px);width:100%}@keyframes spinning{0%{transform:rotate(0deg)}50%{transform:rotate(180deg)}100%{transform:rotate(360deg)}}";
|
|
720
705
|
const SearchcraftSpinnerLightStyle0 = searchcraftSpinnerLightModuleCss;
|
|
721
706
|
|
|
722
707
|
const SearchcraftSpinnerLight = class {
|
|
@@ -729,7 +714,7 @@ const SearchcraftSpinnerLight = class {
|
|
|
729
714
|
};
|
|
730
715
|
SearchcraftSpinnerLight.style = SearchcraftSpinnerLightStyle0;
|
|
731
716
|
|
|
732
|
-
const searchcraftToggleButtonModuleCss = ".toggle-wrapper{box-shadow:0px 0px 0px 1px rgba(0, 0, 0, 0.05);
|
|
717
|
+
const searchcraftToggleButtonModuleCss = ".toggle-wrapper{background:#ddd;border:none;border-radius:16px;box-shadow:0px 0px 0px 1px rgba(0, 0, 0, 0.05);cursor:pointer;height:26px;margin-left:10px;position:relative;width:44px}.toggle-wrapper.active{background:#007DB3;box-shadow:0px 0px 0px 1px rgba(0, 0, 0, 0.05)}.toggle-wrapper .toggle-switch{background:#fff;border-radius:50%;height:18px;left:4px;position:absolute;top:calc(50% - 9px);transition:transform 0.3s ease;width:18px}.toggle-wrapper .toggle-switch.active{transform:translateX(16px)}";
|
|
733
718
|
const SearchcraftToggleButtonStyle0 = searchcraftToggleButtonModuleCss;
|
|
734
719
|
|
|
735
720
|
const SearchcraftToggleButton = class {
|