@usereactify/search 5.2.0-beta.2 → 5.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/CHANGELOG.md +24 -0
- package/dist/package.json +1 -1
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.js +1 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/utility/liquid.js +2 -2
- package/dist/src/utility/liquid.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,30 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
## [5.2.0](https://bitbucket.org/usereactify/reactify-search-ui/compare/release-v5.1.5...release-v5.2.0) (2022-08-10)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* add getData method to liquid utility ([bf3b75c](https://bitbucket.org/usereactify/reactify-search-ui/commit/bf3b75c0b3a9f6ece11120ff190f0e740021a58f))
|
|
11
|
+
* add utilities for liquid consumers ([e8d738c](https://bitbucket.org/usereactify/reactify-search-ui/commit/e8d738c2a242e4437f05ab0832e86cabed756f75))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
* collection handle was include query string ([cbb2b4f](https://bitbucket.org/usereactify/reactify-search-ui/commit/cbb2b4f772410f9a23ced7b339ab6d12fa350ede))
|
|
17
|
+
* export liquid utility ([8df10b2](https://bitbucket.org/usereactify/reactify-search-ui/commit/8df10b2dd09658abf41d4404102db8eb20e4b63b))
|
|
18
|
+
* improve liquid utilities ([b54a8ca](https://bitbucket.org/usereactify/reactify-search-ui/commit/b54a8caa6c498d3798068fe47527ac5bcde74aca))
|
|
19
|
+
|
|
20
|
+
## [5.2.0-beta.4](https://bitbucket.org/usereactify/reactify-search-ui/compare/beta-v5.2.0-beta.3...beta-v5.2.0-beta.4) (2022-08-10)
|
|
21
|
+
|
|
22
|
+
## [5.2.0-beta.3](https://bitbucket.org/usereactify/reactify-search-ui/compare/beta-v5.2.0-beta.2...beta-v5.2.0-beta.3) (2022-08-10)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Bug Fixes
|
|
26
|
+
|
|
27
|
+
* export liquid utility ([8df10b2](https://bitbucket.org/usereactify/reactify-search-ui/commit/8df10b2dd09658abf41d4404102db8eb20e4b63b))
|
|
28
|
+
|
|
5
29
|
## [5.2.0-beta.2](https://bitbucket.org/usereactify/reactify-search-ui/compare/beta-v5.2.0-beta.1...beta-v5.2.0-beta.2) (2022-08-10)
|
|
6
30
|
|
|
7
31
|
|
package/dist/package.json
CHANGED
package/dist/src/index.d.ts
CHANGED
package/dist/src/index.js
CHANGED
package/dist/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sDAAwC;AACxC,6CAAiD;AAEjD,uCAAkC;AAClC,mEAAkC;AAElC,eAAK,CAAC,GAAG,CAAC,SAAS,EAAE,GAAG,sBAAG,CAAC,IAAI,KAAK,sBAAG,CAAC,OAAO,EAAE,CAAC,CAAC;AAEpD,MAAM,CAAC,IAAI,CAAC;IACV,GAAG,EAAE,4EAA4E;IACjF,YAAY,EAAE,CAAC,IAAI,wBAAc,EAAE,CAAC;IACpC,gBAAgB,EAAE,GAAG;IACrB,OAAO,EAAE,sBAAG,CAAC,OAAO;IACpB,UAAU,EAAE,CAAC,KAAK,EAAE,EAAE;;QACpB,eAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QACxC,kDAAkD;QAClD,MAAM,SAAS,GAAG,MAAA,MAAA,KAAK,CAAC,SAAS,0CAAE,MAAM,0CAAG,CAAC,CAAC,CAAC;QAC/C,KAAK,MAAM,KAAK,IAAI,MAAA,MAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,UAAU,0CAAE,MAAM,mCAAI,EAAE,EAAE;YACvD,IAAI,KAAK,CAAC,QAAQ,EAAE;gBAClB,KAAK,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC,OAAO,CACrC,kCAAkC,EAClC,GAAG,CACJ,CAAC;aACH;SACF;QAED,OAAO,KAAK,CAAC;IACf,CAAC;IACD,gBAAgB,EAAE,CAAC,UAAU,EAAE,EAAE;;QAC/B,IAAI,MAAA,UAAU,CAAC,QAAQ,0CAAE,QAAQ,CAAC,iBAAiB,CAAC,EAAE;YACpD,eAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,YAAY,EAAE,UAAU,CAAC,CAAC;SAC/C;QAED,OAAO,UAAU,CAAC;IACpB,CAAC;CACF,CAAC,CAAC;AAEH,+CAA6B;AAC7B,0CAAwB;AACxB,0CAAwB","sourcesContent":["import * as Sentry from \"@sentry/react\";\nimport { BrowserTracing } from \"@sentry/tracing\";\n\nimport { debug } from \"./utility\";\nimport pkg from \"../package.json\";\n\ndebug.log(\"package\", `${pkg.name} v${pkg.version}`);\n\nSentry.init({\n dsn: \"https://f591e13196ad4d6bbcd8abbeb2e023db@o1280055.ingest.sentry.io/6482743\",\n integrations: [new BrowserTracing()],\n tracesSampleRate: 1.0,\n release: pkg.version,\n beforeSend: (event) => {\n debug.log(\"sentry\", event.level, event);\n // rename stacktrace frames to point to sourcemaps\n const exception = event.exception?.values?.[0];\n for (const frame of exception?.stacktrace?.frames ?? []) {\n if (frame.filename) {\n frame.filename = frame.filename.replace(\n /^(.*?)@usereactify\\/search\\/dist/,\n \"~\"\n );\n }\n }\n\n return event;\n },\n beforeBreadcrumb: (breadcrumb) => {\n if (breadcrumb.category?.includes(\"reactify-search\")) {\n debug.log(\"sentry\", \"breadcrumb\", breadcrumb);\n }\n\n return breadcrumb;\n },\n});\n\nexport * from \"./components\";\nexport * from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AAC;IACpB,CAAC;CACF,CAAC,CAAC;AAEH,+CAA6B;AAC7B,0CAAwB;AACxB,0CAAwB;AACxB,mDAAiC","sourcesContent":["import * as Sentry from \"@sentry/react\";\nimport { BrowserTracing } from \"@sentry/tracing\";\n\nimport { debug } from \"./utility\";\nimport pkg from \"../package.json\";\n\ndebug.log(\"package\", `${pkg.name} v${pkg.version}`);\n\nSentry.init({\n dsn: \"https://f591e13196ad4d6bbcd8abbeb2e023db@o1280055.ingest.sentry.io/6482743\",\n integrations: [new BrowserTracing()],\n tracesSampleRate: 1.0,\n release: pkg.version,\n beforeSend: (event) => {\n debug.log(\"sentry\", event.level, event);\n // rename stacktrace frames to point to sourcemaps\n const exception = event.exception?.values?.[0];\n for (const frame of exception?.stacktrace?.frames ?? []) {\n if (frame.filename) {\n frame.filename = frame.filename.replace(\n /^(.*?)@usereactify\\/search\\/dist/,\n \"~\"\n );\n }\n }\n\n return event;\n },\n beforeBreadcrumb: (breadcrumb) => {\n if (breadcrumb.category?.includes(\"reactify-search\")) {\n debug.log(\"sentry\", \"breadcrumb\", breadcrumb);\n }\n\n return breadcrumb;\n },\n});\n\nexport * from \"./components\";\nexport * from \"./hooks\";\nexport * from \"./types\";\nexport * from \"./utility/liquid\";\n"]}
|
|
@@ -11,12 +11,12 @@ class ReactifySearchLiquidFactory {
|
|
|
11
11
|
this.providerProps = providerProps;
|
|
12
12
|
}
|
|
13
13
|
getProvider() {
|
|
14
|
-
var _a, _b, _c, _d;
|
|
14
|
+
var _a, _b, _c, _d, _e;
|
|
15
15
|
const shopifyPermanentDomain = (_a = this.providerProps.shopifyPermanentDomain) !== null && _a !== void 0 ? _a : (_c = (_b = window) === null || _b === void 0 ? void 0 : _b.Shopify) === null || _c === void 0 ? void 0 : _c.shop;
|
|
16
16
|
if (!shopifyPermanentDomain) {
|
|
17
17
|
throw new Error("Cannot determine shopifyPermanentDomain from window");
|
|
18
18
|
}
|
|
19
|
-
const collectionHandle = (_d = this.providerProps.collectionHandle) !== null && _d !== void 0 ? _d : window.location.
|
|
19
|
+
const collectionHandle = (_d = this.providerProps.collectionHandle) !== null && _d !== void 0 ? _d : (_e = window.location.pathname.split("/")) === null || _e === void 0 ? void 0 : _e[2];
|
|
20
20
|
if (this.providerProps.mode === "collection" && !collectionHandle) {
|
|
21
21
|
throw new Error("Cannot determine collectionHandle from URL");
|
|
22
22
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"liquid.js","sourceRoot":"","sources":["../../../src/utility/liquid.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,8CAGuB;AAEvB,MAAa,2BAA2B;IACtC,YACS,aAMN;QANM,kBAAa,GAAb,aAAa,CAMnB;IACA,CAAC;IAEJ,WAAW;;QACT,MAAM,sBAAsB,GAC1B,MAAA,IAAI,CAAC,aAAa,CAAC,sBAAsB,mCACzC,MAAA,MAAC,MAAc,0CAAE,OAAO,0CAAE,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"liquid.js","sourceRoot":"","sources":["../../../src/utility/liquid.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,8CAGuB;AAEvB,MAAa,2BAA2B;IACtC,YACS,aAMN;QANM,kBAAa,GAAb,aAAa,CAMnB;IACA,CAAC;IAEJ,WAAW;;QACT,MAAM,sBAAsB,GAC1B,MAAA,IAAI,CAAC,aAAa,CAAC,sBAAsB,mCACzC,MAAA,MAAC,MAAc,0CAAE,OAAO,0CAAE,IAAI,CAAC;QAEjC,IAAI,CAAC,sBAAsB,EAAE;YAC3B,MAAM,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAC;SACxE;QAED,MAAM,gBAAgB,GACpB,MAAA,IAAI,CAAC,aAAa,CAAC,gBAAgB,mCACnC,MAAA,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,0CAAG,CAAC,CAAC,CAAC;QAE3C,IAAI,IAAI,CAAC,aAAa,CAAC,IAAI,KAAK,YAAY,IAAI,CAAC,gBAAgB,EAAE;YACjE,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC;SAC/D;QAED,MAAM,QAAQ,GAAa,CAAC,KAAK,EAAE,EAAE,CAAC,CACpC,8BAAC,mCAAsB,oBACjB,IAAI,CAAC,aAAa,IACtB,sBAAsB,EAAE,sBAAsB,EAC9C,gBAAgB,EAAE,gBAAgB,KAEjC,KAAK,CAAC,QAAQ,CACQ,CAC1B,CAAC;QAEF,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,YAAY;QACV,MAAM,SAAS,GAAG,QAAQ,CAAC,cAAc,CACvC,kBAAkB,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE,CAC5C,CAAC;QACF,IAAI,CAAC,SAAS,EAAE;YACd,MAAM,IAAI,KAAK,CACb,kDAAkD,IAAI,CAAC,aAAa,CAAC,IAAI,GAAG,CAC7E,CAAC;SACH;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,OAAO;QACL,MAAM,QAAQ,GAAG,QAAQ,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC;QAC1D,IAAI,CAAC,QAAQ,EAAE;YACb,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAC;SAClE;QAED,IAAI;YACF,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;YAE5C,OAAO,IAAI,CAAC;SACb;QAAC,WAAM;YACN,MAAM,IAAI,KAAK,CACb,kFAAkF,CACnF,CAAC;SACH;IACH,CAAC;CACF;AAtED,kEAsEC","sourcesContent":["import React from \"react\";\n\nimport {\n ReactifySearchProvider,\n ReactifySearchProviderProps,\n} from \"../components\";\n\nexport class ReactifySearchLiquidFactory {\n constructor(\n public providerProps: Omit<\n ReactifySearchProviderProps,\n \"shopifyPermanentDomain\"\n > & {\n shopifyPermanentDomain?: string;\n collectionHandle?: string;\n }\n ) {}\n\n getProvider() {\n const shopifyPermanentDomain =\n this.providerProps.shopifyPermanentDomain ??\n (window as any)?.Shopify?.shop;\n\n if (!shopifyPermanentDomain) {\n throw new Error(\"Cannot determine shopifyPermanentDomain from window\");\n }\n\n const collectionHandle =\n this.providerProps.collectionHandle ??\n window.location.pathname.split(\"/\")?.[2];\n\n if (this.providerProps.mode === \"collection\" && !collectionHandle) {\n throw new Error(\"Cannot determine collectionHandle from URL\");\n }\n\n const provider: React.FC = (props) => (\n <ReactifySearchProvider\n {...this.providerProps}\n shopifyPermanentDomain={shopifyPermanentDomain}\n collectionHandle={collectionHandle}\n >\n {props.children}\n </ReactifySearchProvider>\n );\n\n return provider;\n }\n\n getMountNode() {\n const mountNode = document.getElementById(\n `reactify-mount-${this.providerProps.mode}`\n );\n if (!mountNode) {\n throw new Error(\n `Cannot find mount node with ID \"reactify-mount-${this.providerProps.mode}\"`\n );\n }\n\n return mountNode;\n }\n\n getData() {\n const dataNode = document.getElementById(\"reactify-data\");\n if (!dataNode) {\n throw new Error(`Cannot find data node with ID \"reactify-data\"`);\n }\n\n try {\n const data = JSON.parse(dataNode.innerHTML);\n\n return data;\n } catch {\n throw new Error(\n `Cannot parse the data node with ID \"reactify-data\", check your liquid formatting`\n );\n }\n }\n}\n"]}
|