@jeremyckahn/farmhand 1.20.0 → 1.20.2
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/assets/index-dORrBwcH.js +844 -0
- package/dist/assets/{index-VncPzOlx.js.map → index-dORrBwcH.js.map} +1 -1
- package/dist/assets/{workbox-window.prod.es5-Cch4wiA5.js → workbox-window.prod.es5-Bd17z0YL.js} +2 -2
- package/dist/assets/{workbox-window.prod.es5-Cch4wiA5.js.map → workbox-window.prod.es5-Bd17z0YL.js.map} +1 -1
- package/dist/index.html +1 -1
- package/dist/service-worker.js +1 -1
- package/dist/service-worker.js.map +1 -1
- package/package.json +3 -3
- package/src/components/Cellar/Cellar.tsx +7 -5
- package/src/components/Cellar/Keg.tsx +2 -3
- package/src/components/Farmhand/hooks/useFarmhandDayAdvancement.ts +2 -1
- package/src/components/Farmhand/hooks/useFarmhandNetwork.ts +2 -1
- package/src/components/Farmhand/useFarmhand.ts +103 -31
- package/src/components/NotificationSystem/NotificationSystem.test.tsx +53 -32
- package/src/components/NotificationSystem/NotificationSystem.tsx +20 -9
- package/src/components/Shop/Shop.tsx +8 -3
- package/src/components/Stage/Stage.tsx +9 -2
- package/src/components/Workshop/Workshop.tsx +11 -3
- package/src/data/recipes.ts +30 -0
- package/src/game-logic/reducers/processCellar.test.ts +70 -0
- package/src/game-logic/reducers/processCellar.ts +32 -2
- package/src/handlers/ui-events.tsx +8 -3
- package/src/hooks/useTabQueryParam.test.tsx +86 -0
- package/src/hooks/useTabQueryParam.ts +57 -0
- package/src/img/dishes/apple-juice.piskel +1 -0
- package/src/img/dishes/apple-juice.png +0 -0
- package/src/img/dishes/grape-syrup.piskel +1 -0
- package/src/img/dishes/grape-syrup.png +0 -0
- package/src/img/index.ts +4 -0
- package/src/img/ui/floorboard.piskel +1 -0
- package/src/img/ui/floorboard.png +0 -0
- package/src/setupTests.ts +6 -0
- package/src/shell/hash-view-restoration.test.ts +89 -0
- package/src/shell/navigation.test.ts +4 -4
- package/src/templates.ts +20 -0
- package/src/utils/getGrowingPhase.test.ts +15 -0
- package/src/utils/getGrowingPhase.ts +2 -11
- package/src/utils/getGrowingPhaseForTimeline.ts +1 -1
- package/src/utils/getKegDisplayName.test.ts +17 -0
- package/src/utils/getKegDisplayName.ts +10 -0
- package/src/utils/getValidatedStageFocusFromHash.test.ts +72 -0
- package/src/utils/getValidatedStageFocusFromHash.ts +43 -0
- package/src/utils/getViewList.test.ts +73 -0
- package/src/utils/getViewList.ts +46 -0
- package/src/utils/hashQueryParams.test.ts +153 -0
- package/src/utils/hashQueryParams.ts +72 -0
- package/dist/assets/index-VncPzOlx.js +0 -842
package/dist/assets/{workbox-window.prod.es5-Cch4wiA5.js → workbox-window.prod.es5-Bd17z0YL.js}
RENAMED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
try{self[`workbox:window:7.4.0`]&&_()}catch{}function e(e,t){return new Promise((function(n){var r=new MessageChannel;r.port1.onmessage=function(e){n(e.data)},e.postMessage(t,[r.port2])}))}function t(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function n(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,a(r.key),r)}}(e.prototype,t),Object.defineProperty(e
|
|
1
|
+
try{self[`workbox:window:7.4.0`]&&_()}catch{}function e(e,t){return new Promise((function(n){var r=new MessageChannel;r.port1.onmessage=function(e){n(e.data)},e.postMessage(t,[r.port2])}))}function t(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function n(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,a(r.key),r)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function r(e,n){var r=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=function(e,n){if(e){if(typeof e==`string`)return t(e,n);var r={}.toString.call(e).slice(8,-1);return r===`Object`&&e.constructor&&(r=e.constructor.name),r===`Map`||r===`Set`?Array.from(e):r===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(e,n):void 0}}(e))||n){r&&(e=r);var i=0;return function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
2
2
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function i(e,t){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},i(e,t)}function a(e){var t=function(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return String(e)}(e,`string`);return typeof t==`symbol`?t:t+``}try{self[`workbox:core:7.4.0`]&&_()}catch{}var o=function(){var e=this;this.promise=new Promise((function(t,n){e.resolve=t,e.reject=n}))};function s(e,t){var n=location.href;return new URL(e,n).href===new URL(t,n).href}var c=function(e,t){this.type=e,Object.assign(this,t)};function l(e,t,n){return e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e}function u(){}var d={type:`SKIP_WAITING`};function f(e,t){return e&&e.then?e.then(u):Promise.resolve()}var p=function(t){function r(e,n){var r,i;return n===void 0&&(n={}),(r=t.call(this)||this).nn={},r.tn=0,r.rn=new o,r.en=new o,r.on=new o,r.un=0,r.an=new Set,r.cn=function(){var e=r.fn,t=e.installing;r.tn>0||!s(t.scriptURL,r.sn.toString())||performance.now()>r.un+6e4?(r.vn=t,e.removeEventListener(`updatefound`,r.cn)):(r.hn=t,r.an.add(t),r.rn.resolve(t)),++r.tn,t.addEventListener(`statechange`,r.ln)},r.ln=function(e){var t=r.fn,n=e.target,i=n.state,a=n===r.vn,o={sw:n,isExternal:a,originalEvent:e};!a&&r.mn&&(o.isUpdate=!0),r.dispatchEvent(new c(i,o)),i===`installed`?r.wn=self.setTimeout((function(){i===`installed`&&t.waiting===n&&r.dispatchEvent(new c(`waiting`,o))}),200):i===`activating`&&(clearTimeout(r.wn),a||r.en.resolve(n))},r.yn=function(e){var t=r.hn,n=t!==navigator.serviceWorker.controller;r.dispatchEvent(new c(`controlling`,{isExternal:n,originalEvent:e,sw:t,isUpdate:r.mn})),n||r.on.resolve(t)},r.gn=(i=function(e){var t=e.data,n=e.ports,i=e.source;return l(r.getSW(),(function(){r.an.has(i)&&r.dispatchEvent(new c(`message`,{data:t,originalEvent:e,ports:n,sw:i}))}))},function(){var e=[...arguments];try{return Promise.resolve(i.apply(this,e))}catch(e){return Promise.reject(e)}}),r.sn=e,r.nn=n,navigator.serviceWorker.addEventListener(`message`,r.gn),r}var a,u=t;(a=r).prototype=Object.create(u.prototype),a.prototype.constructor=a,i(a,u);var p=r.prototype;return p.register=function(e){var t=(e===void 0?{}:e).immediate,n=t!==void 0&&t;try{var r=this;return l(function(e,t){var n=e();return n&&n.then?n.then(t):t(n)}((function(){if(!n&&document.readyState!==`complete`)return f(new Promise((function(e){return window.addEventListener(`load`,e)})))}),(function(){return r.mn=!!navigator.serviceWorker.controller,r.dn=r.pn(),l(r.bn(),(function(e){r.fn=e,r.dn&&(r.hn=r.dn,r.en.resolve(r.dn),r.on.resolve(r.dn),r.dn.addEventListener(`statechange`,r.ln,{once:!0}));var t=r.fn.waiting;return t&&s(t.scriptURL,r.sn.toString())&&(r.hn=t,Promise.resolve().then((function(){r.dispatchEvent(new c(`waiting`,{sw:t,wasWaitingBeforeRegister:!0}))})).then((function(){}))),r.hn&&(r.rn.resolve(r.hn),r.an.add(r.hn)),r.fn.addEventListener(`updatefound`,r.cn),navigator.serviceWorker.addEventListener(`controllerchange`,r.yn),r.fn}))})))}catch(e){return Promise.reject(e)}},p.update=function(){try{return this.fn?l(f(this.fn.update())):l()}catch(e){return Promise.reject(e)}},p.getSW=function(){return this.hn===void 0?this.rn.promise:Promise.resolve(this.hn)},p.messageSW=function(t){try{return l(this.getSW(),(function(n){return e(n,t)}))}catch(e){return Promise.reject(e)}},p.messageSkipWaiting=function(){this.fn&&this.fn.waiting&&e(this.fn.waiting,d)},p.pn=function(){var e=navigator.serviceWorker.controller;return e&&s(e.scriptURL,this.sn.toString())?e:void 0},p.bn=function(){try{var e=this;return l(function(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}((function(){return l(navigator.serviceWorker.register(e.sn,e.nn),(function(t){return e.un=performance.now(),t}))}),(function(e){throw e})))}catch(e){return Promise.reject(e)}},n(r,[{key:`active`,get:function(){return this.en.promise}},{key:`controlling`,get:function(){return this.on.promise}}])}(function(){function e(){this.Pn=new Map}var t=e.prototype;return t.addEventListener=function(e,t){this.jn(e).add(t)},t.removeEventListener=function(e,t){this.jn(e).delete(t)},t.dispatchEvent=function(e){e.target=this;for(var t,n=r(this.jn(e.type));!(t=n()).done;)(0,t.value)(e)},t.jn=function(e){return this.Pn.has(e)||this.Pn.set(e,new Set),this.Pn.get(e)},e}());export{p as Workbox};
|
|
3
|
-
//# sourceMappingURL=workbox-window.prod.es5-
|
|
3
|
+
//# sourceMappingURL=workbox-window.prod.es5-Bd17z0YL.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workbox-window.prod.es5-Cch4wiA5.js","names":[],"sources":["../../node_modules/workbox-window/build/workbox-window.prod.es5.mjs"],"sourcesContent":["try{self[\"workbox:window:7.4.0\"]&&_()}catch(n){}function n(n,t){return new Promise((function(r){var e=new MessageChannel;e.port1.onmessage=function(n){r(n.data)},n.postMessage(t,[e.port2])}))}function t(n,t){(null==t||t>n.length)&&(t=n.length);for(var r=0,e=Array(t);r<t;r++)e[r]=n[r];return e}function r(n,t,r){return t&&function(n,t){for(var r=0;r<t.length;r++){var e=t[r];e.enumerable=e.enumerable||!1,e.configurable=!0,\"value\"in e&&(e.writable=!0),Object.defineProperty(n,o(e.key),e)}}(n.prototype,t),Object.defineProperty(n,\"prototype\",{writable:!1}),n}function e(n,r){var e=\"undefined\"!=typeof Symbol&&n[Symbol.iterator]||n[\"@@iterator\"];if(e)return(e=e.call(n)).next.bind(e);if(Array.isArray(n)||(e=function(n,r){if(n){if(\"string\"==typeof n)return t(n,r);var e={}.toString.call(n).slice(8,-1);return\"Object\"===e&&n.constructor&&(e=n.constructor.name),\"Map\"===e||\"Set\"===e?Array.from(n):\"Arguments\"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?t(n,r):void 0}}(n))||r){e&&(n=e);var i=0;return function(){return i>=n.length?{done:!0}:{done:!1,value:n[i++]}}}throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\")}function i(n,t){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,t){return n.__proto__=t,n},i(n,t)}function o(n){var t=function(n,t){if(\"object\"!=typeof n||!n)return n;var r=n[Symbol.toPrimitive];if(void 0!==r){var e=r.call(n,t);if(\"object\"!=typeof e)return e;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return String(n)}(n,\"string\");return\"symbol\"==typeof t?t:t+\"\"}try{self[\"workbox:core:7.4.0\"]&&_()}catch(n){}var u=function(){var n=this;this.promise=new Promise((function(t,r){n.resolve=t,n.reject=r}))};function a(n,t){var r=location.href;return new URL(n,r).href===new URL(t,r).href}var c=function(n,t){this.type=n,Object.assign(this,t)};function f(n,t,r){return n&&n.then||(n=Promise.resolve(n)),t?n.then(t):n}function s(){}var v={type:\"SKIP_WAITING\"};function h(n,t){return n&&n.then?n.then(s):Promise.resolve()}var l=function(t){function e(n,r){var e,i;return void 0===r&&(r={}),(e=t.call(this)||this).nn={},e.tn=0,e.rn=new u,e.en=new u,e.on=new u,e.un=0,e.an=new Set,e.cn=function(){var n=e.fn,t=n.installing;e.tn>0||!a(t.scriptURL,e.sn.toString())||performance.now()>e.un+6e4?(e.vn=t,n.removeEventListener(\"updatefound\",e.cn)):(e.hn=t,e.an.add(t),e.rn.resolve(t)),++e.tn,t.addEventListener(\"statechange\",e.ln)},e.ln=function(n){var t=e.fn,r=n.target,i=r.state,o=r===e.vn,u={sw:r,isExternal:o,originalEvent:n};!o&&e.mn&&(u.isUpdate=!0),e.dispatchEvent(new c(i,u)),\"installed\"===i?e.wn=self.setTimeout((function(){\"installed\"===i&&t.waiting===r&&e.dispatchEvent(new c(\"waiting\",u))}),200):\"activating\"===i&&(clearTimeout(e.wn),o||e.en.resolve(r))},e.yn=function(n){var t=e.hn,r=t!==navigator.serviceWorker.controller;e.dispatchEvent(new c(\"controlling\",{isExternal:r,originalEvent:n,sw:t,isUpdate:e.mn})),r||e.on.resolve(t)},e.gn=(i=function(n){var t=n.data,r=n.ports,i=n.source;return f(e.getSW(),(function(){e.an.has(i)&&e.dispatchEvent(new c(\"message\",{data:t,originalEvent:n,ports:r,sw:i}))}))},function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];try{return Promise.resolve(i.apply(this,n))}catch(n){return Promise.reject(n)}}),e.sn=n,e.nn=r,navigator.serviceWorker.addEventListener(\"message\",e.gn),e}var o,s;s=t,(o=e).prototype=Object.create(s.prototype),o.prototype.constructor=o,i(o,s);var l=e.prototype;return l.register=function(n){var t=(void 0===n?{}:n).immediate,r=void 0!==t&&t;try{var e=this;return f(function(n,t){var r=n();if(r&&r.then)return r.then(t);return t(r)}((function(){if(!r&&\"complete\"!==document.readyState)return h(new Promise((function(n){return window.addEventListener(\"load\",n)})))}),(function(){return e.mn=Boolean(navigator.serviceWorker.controller),e.dn=e.pn(),f(e.bn(),(function(n){e.fn=n,e.dn&&(e.hn=e.dn,e.en.resolve(e.dn),e.on.resolve(e.dn),e.dn.addEventListener(\"statechange\",e.ln,{once:!0}));var t=e.fn.waiting;return t&&a(t.scriptURL,e.sn.toString())&&(e.hn=t,Promise.resolve().then((function(){e.dispatchEvent(new c(\"waiting\",{sw:t,wasWaitingBeforeRegister:!0}))})).then((function(){}))),e.hn&&(e.rn.resolve(e.hn),e.an.add(e.hn)),e.fn.addEventListener(\"updatefound\",e.cn),navigator.serviceWorker.addEventListener(\"controllerchange\",e.yn),e.fn}))})))}catch(n){return Promise.reject(n)}},l.update=function(){try{return this.fn?f(h(this.fn.update())):f()}catch(n){return Promise.reject(n)}},l.getSW=function(){return void 0!==this.hn?Promise.resolve(this.hn):this.rn.promise},l.messageSW=function(t){try{return f(this.getSW(),(function(r){return n(r,t)}))}catch(n){return Promise.reject(n)}},l.messageSkipWaiting=function(){this.fn&&this.fn.waiting&&n(this.fn.waiting,v)},l.pn=function(){var n=navigator.serviceWorker.controller;return n&&a(n.scriptURL,this.sn.toString())?n:void 0},l.bn=function(){try{var n=this;return f(function(n,t){try{var r=n()}catch(n){return t(n)}if(r&&r.then)return r.then(void 0,t);return r}((function(){return f(navigator.serviceWorker.register(n.sn,n.nn),(function(t){return n.un=performance.now(),t}))}),(function(n){throw n})))}catch(n){return Promise.reject(n)}},r(e,[{key:\"active\",get:function(){return this.en.promise}},{key:\"controlling\",get:function(){return this.on.promise}}])}(function(){function n(){this.Pn=new Map}var t=n.prototype;return t.addEventListener=function(n,t){this.jn(n).add(t)},t.removeEventListener=function(n,t){this.jn(n).delete(t)},t.dispatchEvent=function(n){n.target=this;for(var t,r=e(this.jn(n.type));!(t=r()).done;){(0,t.value)(n)}},t.jn=function(n){return this.Pn.has(n)||this.Pn.set(n,new Set),this.Pn.get(n)},n}());export{l as Workbox,c as WorkboxEvent,n as messageSW};\n//# sourceMappingURL=workbox-window.prod.es5.mjs.map\n"],"x_google_ignoreList":[0],"mappings":"AAAA,GAAG,CAAC,KAAK,yBAAyB,EAAE,CAAC,MAAS,CAAC,CAAC,SAAS,EAAE,EAAE,EAAE,CAAC,OAAO,IAAI,SAAS,SAAS,E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CAAC,IAAI,SAAS,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,QAAQ,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,IAAI,SAAS,IAAI,UAAU,CAAC,OAAO,KAAK,GAAG,OAAO,CAAC,EAAE,CAAC,IAAI,cAAc,IAAI,UAAU,CAAC,OAAO,KAAK,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC,SAAS,GAAG,CAAC,KAAK,GAAG,IAAI,GAAG,CAAC,IAAI,EAAE,EAAE,UAAU,MAAO,GAAE,iBAAiB,SAAS,EAAE,EAAE,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,CAAC,CAAC,EAAE,EAAE,oBAAoB,SAAS,EAAE,EAAE,CAAC,KAAK,GAAG,CAAC,EAAE,OAAO,CAAC,CAAC,EAAE,EAAE,cAAc,SAAS,EAAE,CAAC,EAAE,OAAO,KAAK,IAAI,IAAI,EAAE,EAAE,EAAE,KAAK,GAAG,EAAE,IAAI,CAAC,EAAE,EAAE,EAAE,EAAE,GAAG,OAAQ,EAAE,EAAE,OAAO,CAAC,CAAE,EAAE,EAAE,GAAG,SAAS,EAAE,CAAC,OAAO,KAAK,GAAG,IAAI,CAAC,GAAG,KAAK,GAAG,IAAI,EAAE,IAAI,GAAG,EAAE,KAAK,GAAG,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC"}
|
|
1
|
+
{"version":3,"file":"workbox-window.prod.es5-Bd17z0YL.js","names":[],"sources":["../../node_modules/workbox-window/build/workbox-window.prod.es5.mjs"],"sourcesContent":["try{self[\"workbox:window:7.4.0\"]&&_()}catch(n){}function n(n,t){return new Promise((function(r){var e=new MessageChannel;e.port1.onmessage=function(n){r(n.data)},n.postMessage(t,[e.port2])}))}function t(n,t){(null==t||t>n.length)&&(t=n.length);for(var r=0,e=Array(t);r<t;r++)e[r]=n[r];return e}function r(n,t,r){return t&&function(n,t){for(var r=0;r<t.length;r++){var e=t[r];e.enumerable=e.enumerable||!1,e.configurable=!0,\"value\"in e&&(e.writable=!0),Object.defineProperty(n,o(e.key),e)}}(n.prototype,t),Object.defineProperty(n,\"prototype\",{writable:!1}),n}function e(n,r){var e=\"undefined\"!=typeof Symbol&&n[Symbol.iterator]||n[\"@@iterator\"];if(e)return(e=e.call(n)).next.bind(e);if(Array.isArray(n)||(e=function(n,r){if(n){if(\"string\"==typeof n)return t(n,r);var e={}.toString.call(n).slice(8,-1);return\"Object\"===e&&n.constructor&&(e=n.constructor.name),\"Map\"===e||\"Set\"===e?Array.from(n):\"Arguments\"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?t(n,r):void 0}}(n))||r){e&&(n=e);var i=0;return function(){return i>=n.length?{done:!0}:{done:!1,value:n[i++]}}}throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\")}function i(n,t){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,t){return n.__proto__=t,n},i(n,t)}function o(n){var t=function(n,t){if(\"object\"!=typeof n||!n)return n;var r=n[Symbol.toPrimitive];if(void 0!==r){var e=r.call(n,t);if(\"object\"!=typeof e)return e;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return String(n)}(n,\"string\");return\"symbol\"==typeof t?t:t+\"\"}try{self[\"workbox:core:7.4.0\"]&&_()}catch(n){}var u=function(){var n=this;this.promise=new Promise((function(t,r){n.resolve=t,n.reject=r}))};function a(n,t){var r=location.href;return new URL(n,r).href===new URL(t,r).href}var c=function(n,t){this.type=n,Object.assign(this,t)};function f(n,t,r){return n&&n.then||(n=Promise.resolve(n)),t?n.then(t):n}function s(){}var v={type:\"SKIP_WAITING\"};function h(n,t){return n&&n.then?n.then(s):Promise.resolve()}var l=function(t){function e(n,r){var e,i;return void 0===r&&(r={}),(e=t.call(this)||this).nn={},e.tn=0,e.rn=new u,e.en=new u,e.on=new u,e.un=0,e.an=new Set,e.cn=function(){var n=e.fn,t=n.installing;e.tn>0||!a(t.scriptURL,e.sn.toString())||performance.now()>e.un+6e4?(e.vn=t,n.removeEventListener(\"updatefound\",e.cn)):(e.hn=t,e.an.add(t),e.rn.resolve(t)),++e.tn,t.addEventListener(\"statechange\",e.ln)},e.ln=function(n){var t=e.fn,r=n.target,i=r.state,o=r===e.vn,u={sw:r,isExternal:o,originalEvent:n};!o&&e.mn&&(u.isUpdate=!0),e.dispatchEvent(new c(i,u)),\"installed\"===i?e.wn=self.setTimeout((function(){\"installed\"===i&&t.waiting===r&&e.dispatchEvent(new c(\"waiting\",u))}),200):\"activating\"===i&&(clearTimeout(e.wn),o||e.en.resolve(r))},e.yn=function(n){var t=e.hn,r=t!==navigator.serviceWorker.controller;e.dispatchEvent(new c(\"controlling\",{isExternal:r,originalEvent:n,sw:t,isUpdate:e.mn})),r||e.on.resolve(t)},e.gn=(i=function(n){var t=n.data,r=n.ports,i=n.source;return f(e.getSW(),(function(){e.an.has(i)&&e.dispatchEvent(new c(\"message\",{data:t,originalEvent:n,ports:r,sw:i}))}))},function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];try{return Promise.resolve(i.apply(this,n))}catch(n){return Promise.reject(n)}}),e.sn=n,e.nn=r,navigator.serviceWorker.addEventListener(\"message\",e.gn),e}var o,s;s=t,(o=e).prototype=Object.create(s.prototype),o.prototype.constructor=o,i(o,s);var l=e.prototype;return l.register=function(n){var t=(void 0===n?{}:n).immediate,r=void 0!==t&&t;try{var e=this;return f(function(n,t){var r=n();if(r&&r.then)return r.then(t);return t(r)}((function(){if(!r&&\"complete\"!==document.readyState)return h(new Promise((function(n){return window.addEventListener(\"load\",n)})))}),(function(){return e.mn=Boolean(navigator.serviceWorker.controller),e.dn=e.pn(),f(e.bn(),(function(n){e.fn=n,e.dn&&(e.hn=e.dn,e.en.resolve(e.dn),e.on.resolve(e.dn),e.dn.addEventListener(\"statechange\",e.ln,{once:!0}));var t=e.fn.waiting;return t&&a(t.scriptURL,e.sn.toString())&&(e.hn=t,Promise.resolve().then((function(){e.dispatchEvent(new c(\"waiting\",{sw:t,wasWaitingBeforeRegister:!0}))})).then((function(){}))),e.hn&&(e.rn.resolve(e.hn),e.an.add(e.hn)),e.fn.addEventListener(\"updatefound\",e.cn),navigator.serviceWorker.addEventListener(\"controllerchange\",e.yn),e.fn}))})))}catch(n){return Promise.reject(n)}},l.update=function(){try{return this.fn?f(h(this.fn.update())):f()}catch(n){return Promise.reject(n)}},l.getSW=function(){return void 0!==this.hn?Promise.resolve(this.hn):this.rn.promise},l.messageSW=function(t){try{return f(this.getSW(),(function(r){return n(r,t)}))}catch(n){return Promise.reject(n)}},l.messageSkipWaiting=function(){this.fn&&this.fn.waiting&&n(this.fn.waiting,v)},l.pn=function(){var n=navigator.serviceWorker.controller;return n&&a(n.scriptURL,this.sn.toString())?n:void 0},l.bn=function(){try{var n=this;return f(function(n,t){try{var r=n()}catch(n){return t(n)}if(r&&r.then)return r.then(void 0,t);return r}((function(){return f(navigator.serviceWorker.register(n.sn,n.nn),(function(t){return n.un=performance.now(),t}))}),(function(n){throw n})))}catch(n){return Promise.reject(n)}},r(e,[{key:\"active\",get:function(){return this.en.promise}},{key:\"controlling\",get:function(){return this.on.promise}}])}(function(){function n(){this.Pn=new Map}var t=n.prototype;return t.addEventListener=function(n,t){this.jn(n).add(t)},t.removeEventListener=function(n,t){this.jn(n).delete(t)},t.dispatchEvent=function(n){n.target=this;for(var t,r=e(this.jn(n.type));!(t=r()).done;){(0,t.value)(n)}},t.jn=function(n){return this.Pn.has(n)||this.Pn.set(n,new Set),this.Pn.get(n)},n}());export{l as Workbox,c as WorkboxEvent,n as messageSW};\n//# sourceMappingURL=workbox-window.prod.es5.mjs.map\n"],"x_google_ignoreList":[0],"mappings":"AAAA,GAAG,CAAC,KAAK,yBAAyB,EAAE,CAAC,MAAS,CAAC,CAAC,SAAS,EAAE,EAAE,EAAE,CAAC,OAAO,IAAI,S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SAAS,EAAE,CAAC,MAAO,GAAE,GAAG,YAAY,IAAI,EAAE,CAAC,EAAE,CAAC,IAAI,SAAS,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,QAAQ,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,IAAI,SAAS,IAAI,UAAU,CAAC,OAAO,KAAK,GAAG,OAAO,CAAC,EAAE,CAAC,IAAI,cAAc,IAAI,UAAU,CAAC,OAAO,KAAK,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC,SAAS,GAAG,CAAC,KAAK,GAAG,IAAI,GAAG,CAAC,IAAI,EAAE,EAAE,UAAU,MAAO,GAAE,iBAAiB,SAAS,EAAE,EAAE,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,oBAAoB,SAAS,EAAE,EAAE,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,cAAc,SAAS,EAAE,CAAC,EAAE,OAAO,KAAK,IAAI,IAAI,EAAE,EAAE,EAAE,KAAK,GAAG,EAAE,IAAI,CAAC,EAAE,EAAE,EAAE,EAAE,EAAA,CAAG,OAAQ,EAAE,EAAE,MAAA,CAAO,CAAC,CAAE,EAAE,EAAE,GAAG,SAAS,EAAE,CAAC,OAAO,KAAK,GAAG,IAAI,CAAC,GAAG,KAAK,GAAG,IAAI,EAAE,IAAI,GAAG,EAAE,KAAK,GAAG,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC"}
|
package/dist/index.html
CHANGED
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
gtag('config', analyticsID)
|
|
76
76
|
})()
|
|
77
77
|
</script>
|
|
78
|
-
<script type="module" crossorigin src="./assets/index-
|
|
78
|
+
<script type="module" crossorigin src="./assets/index-dORrBwcH.js"></script>
|
|
79
79
|
<link rel="stylesheet" crossorigin href="./assets/index-CNcrTYN-.css">
|
|
80
80
|
<link rel="manifest" href="./manifest.webmanifest"></head>
|
|
81
81
|
<body>
|
package/dist/service-worker.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
if(!self.define){let e,s={};const i=(i,n)=>(i=new URL(i+".js",n).href,s[i]||new Promise(s=>{if("document"in self){const e=document.createElement("script");e.src=i,e.onload=s,document.head.appendChild(e)}else e=i,importScripts(i),s()}).then(()=>{let e=s[i];if(!e)throw new Error(`Module ${i} didn’t register its module`);return e}));self.define=(n,o)=>{const r=e||("document"in self?document.currentScript.src:"")||location.href;if(s[r])return;let d={};const l=e=>i(e,r),t={module:{uri:r},exports:d,require:l};s[r]=Promise.all(n.map(e=>t[e]||l(e))).then(e=>(o(...e),d))}}define(["./workbox-2fbc6a65"],function(e){"use strict";self.addEventListener("message",e=>{e.data&&"SKIP_WAITING"===e.data.type&&self.skipWaiting()}),e.precacheAndRoute([{url:"index.html",revision:"
|
|
1
|
+
if(!self.define){let e,s={};const i=(i,n)=>(i=new URL(i+".js",n).href,s[i]||new Promise(s=>{if("document"in self){const e=document.createElement("script");e.src=i,e.onload=s,document.head.appendChild(e)}else e=i,importScripts(i),s()}).then(()=>{let e=s[i];if(!e)throw new Error(`Module ${i} didn’t register its module`);return e}));self.define=(n,o)=>{const r=e||("document"in self?document.currentScript.src:"")||location.href;if(s[r])return;let d={};const l=e=>i(e,r),t={module:{uri:r},exports:d,require:l};s[r]=Promise.all(n.map(e=>t[e]||l(e))).then(e=>(o(...e),d))}}define(["./workbox-2fbc6a65"],function(e){"use strict";self.addEventListener("message",e=>{e.data&&"SKIP_WAITING"===e.data.type&&self.skipWaiting()}),e.precacheAndRoute([{url:"index.html",revision:"1d9ded7b5561cf1732b221c246cd5037"},{url:"electron.js",revision:"b0456826f47539f6c1957c3add5eb959"},{url:"assets/workbox-window.prod.es5-Bd17z0YL.js",revision:null},{url:"assets/index-dORrBwcH.js",revision:null},{url:"assets/index-CNcrTYN-.css",revision:null},{url:"favicon.ico",revision:"445bb19d4a8fd46eb433dd43cbdce691"},{url:"logo192.png",revision:"70746d790b8990639d1390337d77d81a"},{url:"logo512.png",revision:"b044ab46b3f33f0e2d313d961bf1f654"},{url:"logoMaskable.png",revision:"23be58ccf16df9f43658aad3da30056d"},{url:"manifest.webmanifest",revision:"3ad071a00582451c9cdeb827b37b9ebe"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html")))});
|
|
2
2
|
//# sourceMappingURL=service-worker.js.map
|
|
3
3
|
//# sourceMappingURL=service-worker.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-worker.js","sources":["../../../../../tmp/
|
|
1
|
+
{"version":3,"file":"service-worker.js","sources":["../../../../../tmp/176937f380891cfcd7ad2cbe4558d1d9/service-worker.js"],"sourcesContent":["import {precacheAndRoute as workbox_precaching_precacheAndRoute} from '/home/runner/work/farmhand/farmhand/node_modules/workbox-precaching/precacheAndRoute.mjs';\nimport {cleanupOutdatedCaches as workbox_precaching_cleanupOutdatedCaches} from '/home/runner/work/farmhand/farmhand/node_modules/workbox-precaching/cleanupOutdatedCaches.mjs';\nimport {registerRoute as workbox_routing_registerRoute} from '/home/runner/work/farmhand/farmhand/node_modules/workbox-routing/registerRoute.mjs';\nimport {NavigationRoute as workbox_routing_NavigationRoute} from '/home/runner/work/farmhand/farmhand/node_modules/workbox-routing/NavigationRoute.mjs';\nimport {createHandlerBoundToURL as workbox_precaching_createHandlerBoundToURL} from '/home/runner/work/farmhand/farmhand/node_modules/workbox-precaching/createHandlerBoundToURL.mjs';/**\n * Welcome to your Workbox-powered service worker!\n *\n * You'll need to register this file in your web app.\n * See https://goo.gl/nhQhGp\n *\n * The rest of the code is auto-generated. Please don't update this file\n * directly; instead, make changes to your Workbox build configuration\n * and re-run your build process.\n * See https://goo.gl/2aRDsh\n */\n\n\n\n\nself.addEventListener('message', (event) => {\n if (event.data && event.data.type === 'SKIP_WAITING') {\n self.skipWaiting();\n }\n});\n\n/**\n * The precacheAndRoute() method efficiently caches and responds to\n * requests for URLs in the manifest.\n * See https://goo.gl/S9QRab\n */\nworkbox_precaching_precacheAndRoute([\n {\n \"url\": \"index.html\",\n \"revision\": \"1d9ded7b5561cf1732b221c246cd5037\"\n },\n {\n \"url\": \"electron.js\",\n \"revision\": \"b0456826f47539f6c1957c3add5eb959\"\n },\n {\n \"url\": \"assets/workbox-window.prod.es5-Bd17z0YL.js\",\n \"revision\": null\n },\n {\n \"url\": \"assets/index-dORrBwcH.js\",\n \"revision\": null\n },\n {\n \"url\": \"assets/index-CNcrTYN-.css\",\n \"revision\": null\n },\n {\n \"url\": \"favicon.ico\",\n \"revision\": \"445bb19d4a8fd46eb433dd43cbdce691\"\n },\n {\n \"url\": \"logo192.png\",\n \"revision\": \"70746d790b8990639d1390337d77d81a\"\n },\n {\n \"url\": \"logo512.png\",\n \"revision\": \"b044ab46b3f33f0e2d313d961bf1f654\"\n },\n {\n \"url\": \"logoMaskable.png\",\n \"revision\": \"23be58ccf16df9f43658aad3da30056d\"\n },\n {\n \"url\": \"manifest.webmanifest\",\n \"revision\": \"3ad071a00582451c9cdeb827b37b9ebe\"\n }\n], {});\nworkbox_precaching_cleanupOutdatedCaches();workbox_routing_registerRoute(new workbox_routing_NavigationRoute(workbox_precaching_createHandlerBoundToURL(\"index.html\")));\n\n\n"],"names":["self","addEventListener","event","data","type","skipWaiting","workbox_precaching_precacheAndRoute","url","revision","workbox_precaching_cleanupOutdatedCaches","workbox_routing_registerRoute","workbox_routing_NavigationRoute","workbox_precaching_createHandlerBoundToURL"],"mappings":"inBAmBAA,KAAKC,iBAAiB,UAAYC,IAC5BA,EAAMC,MAA4B,iBAApBD,EAAMC,KAAKC,MAC3BJ,KAAKK,gBASTC,EAAAA,iBAAoC,CAClC,CACEC,IAAO,aACPC,SAAY,oCAEd,CACED,IAAO,cACPC,SAAY,oCAEd,CACED,IAAO,6CACPC,SAAY,MAEd,CACED,IAAO,2BACPC,SAAY,MAEd,CACED,IAAO,4BACPC,SAAY,MAEd,CACED,IAAO,cACPC,SAAY,oCAEd,CACED,IAAO,cACPC,SAAY,oCAEd,CACED,IAAO,cACPC,SAAY,oCAEd,CACED,IAAO,mBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,qCAEb,CAAA,GACHC,EAAAA,wBAA2CC,EAAAA,cAA8B,IAAIC,EAAAA,gBAAgCC,0BAA2C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jeremyckahn/farmhand",
|
|
3
|
-
"version": "1.20.
|
|
3
|
+
"version": "1.20.2",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -91,8 +91,8 @@
|
|
|
91
91
|
"pretty-quick": "^2.0.1",
|
|
92
92
|
"serve": "^14.2.0",
|
|
93
93
|
"typescript": "^6.0.2",
|
|
94
|
-
"vercel": "^
|
|
95
|
-
"vite": "8.
|
|
94
|
+
"vercel": "^56.5.0",
|
|
95
|
+
"vite": "8.1.5",
|
|
96
96
|
"vite-node": "^6.0.0",
|
|
97
97
|
"vite-plugin-pwa": "^1.3.0",
|
|
98
98
|
"vitest": "^4.0.18",
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import Tab from '@mui/material/Tab/index.js'
|
|
2
2
|
import Tabs from '@mui/material/Tabs/index.js'
|
|
3
|
-
import { useState } from 'react'
|
|
4
3
|
|
|
5
4
|
import { centerTabsSx } from '../../styles/sx.js'
|
|
6
5
|
import { Div } from '../Elements/index.js'
|
|
6
|
+
import { useTabQueryParam } from '../../hooks/useTabQueryParam.js'
|
|
7
7
|
|
|
8
8
|
import { CellarInventoryTabPanel } from './CellarInventoryTabPanel.js'
|
|
9
9
|
import { FermentationTabPanel } from './FermentationTabPanel.js'
|
|
10
10
|
import { a11yProps } from './TabPanel/index.js'
|
|
11
11
|
import { WinemakingTabPanel } from './WinemakingTabPanel.js'
|
|
12
12
|
|
|
13
|
+
const CELLAR_TAB_LABELS = ['Cellar Inventory', 'Fermentation', 'Winemaking']
|
|
14
|
+
|
|
13
15
|
export const Cellar = () => {
|
|
14
|
-
const [currentTab, setCurrentTab] =
|
|
16
|
+
const [currentTab, setCurrentTab] = useTabQueryParam(CELLAR_TAB_LABELS)
|
|
15
17
|
|
|
16
18
|
return (
|
|
17
19
|
<Div className="Cellar" sx={centerTabsSx}>
|
|
@@ -20,9 +22,9 @@ export const Cellar = () => {
|
|
|
20
22
|
onChange={(_e, newTab) => setCurrentTab(newTab)}
|
|
21
23
|
aria-label="Cellar tabs"
|
|
22
24
|
>
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
25
|
+
{CELLAR_TAB_LABELS.map((label, index) => (
|
|
26
|
+
<Tab key={label} {...{ label, ...a11yProps(index) }} />
|
|
27
|
+
))}
|
|
26
28
|
</Tabs>
|
|
27
29
|
<CellarInventoryTabPanel index={0} currentTab={currentTab} />
|
|
28
30
|
<FermentationTabPanel index={1} currentTab={currentTab} />
|
|
@@ -9,7 +9,7 @@ import { itemsMap } from '../../data/maps.js'
|
|
|
9
9
|
import { items, wines } from '../../img/index.js'
|
|
10
10
|
import { cellarService } from '../../services/cellar.js'
|
|
11
11
|
import { wineService } from '../../services/wine.js'
|
|
12
|
-
import {
|
|
12
|
+
import { getKegDisplayName } from '../../utils/getKegDisplayName.js'
|
|
13
13
|
import { getKegSpoilageRate } from '../../utils/getKegSpoilageRate.js'
|
|
14
14
|
import { getKegValue } from '../../utils/getKegValue.js'
|
|
15
15
|
import { getSalePriceMultiplier } from '../../utils/getSalePriceMultiplier.js'
|
|
@@ -28,7 +28,7 @@ export function Keg({ keg }: { keg: farmhand.keg }) {
|
|
|
28
28
|
// TODO: Add a defensive check in case item is undefined (e.g. keg.itemId is invalid) to prevent runtime crash when accessing item.id
|
|
29
29
|
let imageSrc = items[item.id as keyof typeof items]
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
const recipeName = getKegDisplayName(item)
|
|
32
32
|
|
|
33
33
|
const handleSellClick = () => {
|
|
34
34
|
handleSellKegClick(keg)
|
|
@@ -44,7 +44,6 @@ export function Keg({ keg }: { keg: farmhand.keg }) {
|
|
|
44
44
|
|
|
45
45
|
if (wineService.isWineRecipe(item)) {
|
|
46
46
|
imageSrc = wines[item.variety]
|
|
47
|
-
recipeName = item.name
|
|
48
47
|
}
|
|
49
48
|
|
|
50
49
|
const spoilageRate = getKegSpoilageRate(keg)
|
|
@@ -6,6 +6,7 @@ import { postData } from '../../../fetch-utils.js'
|
|
|
6
6
|
import { DATA_DELETED, SERVER_ERROR } from '../../../strings.js'
|
|
7
7
|
import { POSITIONS_POSTED_NOTIFICATION } from '../../../templates.js'
|
|
8
8
|
import { computeMarketPositions } from '../../../utils/computeMarketPositions.js'
|
|
9
|
+
import { withCurrentHashQuery } from '../../../utils/hashQueryParams.js'
|
|
9
10
|
import { reduceByPersistedKeys } from '../../../utils/reduceByPersistedKeys.js'
|
|
10
11
|
import { FarmhandProps } from '../FarmhandReducers.js'
|
|
11
12
|
import { FarmhandService } from '../FarmhandService.js'
|
|
@@ -84,7 +85,7 @@ export const useFarmhandDayAdvancement = (
|
|
|
84
85
|
|
|
85
86
|
setState(previous => ({
|
|
86
87
|
...previous,
|
|
87
|
-
redirect: '/',
|
|
88
|
+
redirect: withCurrentHashQuery('/'),
|
|
88
89
|
cowIdOfferedForTrade: '',
|
|
89
90
|
isAwaitingNetworkRequest: false,
|
|
90
91
|
}))
|
|
@@ -23,6 +23,7 @@ import {
|
|
|
23
23
|
SERVER_ERROR,
|
|
24
24
|
} from '../../../strings.js'
|
|
25
25
|
import { CONNECTED_TO_ROOM } from '../../../templates.js'
|
|
26
|
+
import { withCurrentHashQuery } from '../../../utils/hashQueryParams.js'
|
|
26
27
|
import { moneyTotal } from '../../../utils/moneyTotal.js'
|
|
27
28
|
import { FarmhandService } from '../FarmhandService.js'
|
|
28
29
|
|
|
@@ -223,7 +224,7 @@ export const useFarmhandNetwork = (
|
|
|
223
224
|
|
|
224
225
|
setState(previous => ({
|
|
225
226
|
...previous,
|
|
226
|
-
redirect: '/',
|
|
227
|
+
redirect: withCurrentHashQuery('/'),
|
|
227
228
|
cowIdOfferedForTrade: '',
|
|
228
229
|
}))
|
|
229
230
|
}
|
|
@@ -11,7 +11,6 @@ import {
|
|
|
11
11
|
INITIAL_STORAGE_LIMIT,
|
|
12
12
|
STAGE_TITLE_MAP,
|
|
13
13
|
STANDARD_LOAN_AMOUNT,
|
|
14
|
-
STANDARD_VIEW_LIST,
|
|
15
14
|
} from '../../constants.js'
|
|
16
15
|
import { scarecrow } from '../../data/items.js'
|
|
17
16
|
import {
|
|
@@ -31,6 +30,13 @@ import { generateCow } from '../../utils/generateCow.js'
|
|
|
31
30
|
import { getAvailableShopInventory } from '../../utils/getAvailableShopInventory.js'
|
|
32
31
|
import { getLevelEntitlements } from '../../utils/getLevelEntitlements.js'
|
|
33
32
|
import { getPeerMetadata } from '../../utils/getPeerMetadata.js'
|
|
33
|
+
import { getValidatedStageFocusFromHash } from '../../utils/getValidatedStageFocusFromHash.js'
|
|
34
|
+
import { getViewList } from '../../utils/getViewList.js'
|
|
35
|
+
import {
|
|
36
|
+
removeHashQueryParam,
|
|
37
|
+
setHashQueryParam,
|
|
38
|
+
VIEW_QUERY_PARAM_NAME,
|
|
39
|
+
} from '../../utils/hashQueryParams.js'
|
|
34
40
|
import { levelAchieved } from '../../utils/levelAchieved.js'
|
|
35
41
|
import { moneyTotal } from '../../utils/moneyTotal.js'
|
|
36
42
|
import { noop } from '../../utils/noop.js'
|
|
@@ -220,35 +226,21 @@ export const useFarmhand = (props: FarmhandProps) => {
|
|
|
220
226
|
levelEntitlements.stageFocusType[stageFocusType.FOREST]
|
|
221
227
|
const isChatAvailable = state.isOnline && state.room !== DEFAULT_ROOM
|
|
222
228
|
|
|
223
|
-
const viewList = useMemo(
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
list.push(WORKSHOP)
|
|
240
|
-
|
|
241
|
-
if (state.purchasedCellar) {
|
|
242
|
-
list.push(CELLAR)
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
return list
|
|
246
|
-
}, [
|
|
247
|
-
state.showHomeScreen,
|
|
248
|
-
isForestUnlocked,
|
|
249
|
-
state.purchasedCowPen,
|
|
250
|
-
state.purchasedCellar,
|
|
251
|
-
])
|
|
229
|
+
const viewList = useMemo(
|
|
230
|
+
() =>
|
|
231
|
+
getViewList({
|
|
232
|
+
isForestUnlocked,
|
|
233
|
+
purchasedCellar: state.purchasedCellar,
|
|
234
|
+
purchasedCowPen: state.purchasedCowPen,
|
|
235
|
+
showHomeScreen: state.showHomeScreen,
|
|
236
|
+
}),
|
|
237
|
+
[
|
|
238
|
+
state.showHomeScreen,
|
|
239
|
+
isForestUnlocked,
|
|
240
|
+
state.purchasedCowPen,
|
|
241
|
+
state.purchasedCellar,
|
|
242
|
+
]
|
|
243
|
+
)
|
|
252
244
|
|
|
253
245
|
const peerMetadata = useMemo(() => getPeerMetadata(state), [state])
|
|
254
246
|
|
|
@@ -267,6 +259,68 @@ export const useFarmhand = (props: FarmhandProps) => {
|
|
|
267
259
|
focusPreviousView,
|
|
268
260
|
} = useFarmhandNavigation(setState, viewList)
|
|
269
261
|
|
|
262
|
+
// Mirrors the current view into the URL hash's `view` query param, using
|
|
263
|
+
// pushState (not replaceState) so each in-app view change is a real,
|
|
264
|
+
// back/forward-navigable browser history entry - otherwise every
|
|
265
|
+
// navigation just overwrites the one entry the page loaded with, and a
|
|
266
|
+
// single "back" press takes the player out of the app entirely. The
|
|
267
|
+
// `tab` param (a tabbed screen's active tab, see useTabQueryParam) is
|
|
268
|
+
// left alone on the very first run (so a reload can still restore it),
|
|
269
|
+
// but cleared on every subsequent view change, since it belongs to
|
|
270
|
+
// whichever screen was just left.
|
|
271
|
+
const isInitialStageFocusSyncRef = useRef(true)
|
|
272
|
+
// Set by the popstate handler below immediately before it updates
|
|
273
|
+
// stageFocus, so this effect's next run corrects/confirms the hash in
|
|
274
|
+
// place (replace) instead of pushing a new entry for a change that was
|
|
275
|
+
// itself a back/forward navigation.
|
|
276
|
+
const isPopstateStageFocusSyncRef = useRef(false)
|
|
277
|
+
|
|
278
|
+
useEffect(() => {
|
|
279
|
+
// Boot (see the effect below) is responsible for the URL's initial
|
|
280
|
+
// `view` value: it validates it against what's actually unlocked
|
|
281
|
+
// before applying it. Mirroring state.stageFocus here before that
|
|
282
|
+
// finishes would immediately overwrite an as-yet-unread bookmarked/
|
|
283
|
+
// shared URL with the pre-boot default.
|
|
284
|
+
if (!state.hasBooted) return
|
|
285
|
+
|
|
286
|
+
if (isPopstateStageFocusSyncRef.current) {
|
|
287
|
+
isPopstateStageFocusSyncRef.current = false
|
|
288
|
+
setHashQueryParam(VIEW_QUERY_PARAM_NAME, state.stageFocus)
|
|
289
|
+
return
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
if (isInitialStageFocusSyncRef.current) {
|
|
293
|
+
isInitialStageFocusSyncRef.current = false
|
|
294
|
+
setHashQueryParam(VIEW_QUERY_PARAM_NAME, state.stageFocus)
|
|
295
|
+
return
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
setHashQueryParam(VIEW_QUERY_PARAM_NAME, state.stageFocus, 'push')
|
|
299
|
+
removeHashQueryParam('tab')
|
|
300
|
+
}, [state.stageFocus, state.hasBooted])
|
|
301
|
+
|
|
302
|
+
// Reacts to the browser's back/forward buttons, since pushState above
|
|
303
|
+
// now creates real history entries to navigate between. Re-validates
|
|
304
|
+
// the target view against current unlocks (the same guard boot uses)
|
|
305
|
+
// rather than trusting the history entry outright, since it could be
|
|
306
|
+
// stale relative to what's since become unlocked - or not - in this
|
|
307
|
+
// save.
|
|
308
|
+
useEffect(() => {
|
|
309
|
+
const handlePopState = () => {
|
|
310
|
+
const validatedStageFocus =
|
|
311
|
+
getValidatedStageFocusFromHash(stateRef.current) ?? stageFocusType.HOME
|
|
312
|
+
|
|
313
|
+
if (validatedStageFocus === stateRef.current.stageFocus) return
|
|
314
|
+
|
|
315
|
+
isPopstateStageFocusSyncRef.current = true
|
|
316
|
+
setState(previous => ({ ...previous, stageFocus: validatedStageFocus }))
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
window.addEventListener('popstate', handlePopState)
|
|
320
|
+
|
|
321
|
+
return () => window.removeEventListener('popstate', handlePopState)
|
|
322
|
+
}, [])
|
|
323
|
+
|
|
270
324
|
const {
|
|
271
325
|
syncToRoom,
|
|
272
326
|
scheduleHeartbeat,
|
|
@@ -528,10 +582,14 @@ export const useFarmhand = (props: FarmhandProps) => {
|
|
|
528
582
|
...persistedState,
|
|
529
583
|
})
|
|
530
584
|
const { isCombineEnabled, newDayNotifications } = sanitizedState
|
|
585
|
+
const restoredStageFocus = getValidatedStageFocusFromHash(
|
|
586
|
+
sanitizedState
|
|
587
|
+
)
|
|
531
588
|
|
|
532
589
|
setState(previous => ({
|
|
533
590
|
...previous,
|
|
534
591
|
...sanitizedState,
|
|
592
|
+
...(restoredStageFocus && { stageFocus: restoredStageFocus }),
|
|
535
593
|
newDayNotifications: [],
|
|
536
594
|
hasBooted: true,
|
|
537
595
|
}))
|
|
@@ -567,7 +625,21 @@ export const useFarmhand = (props: FarmhandProps) => {
|
|
|
567
625
|
LOAN_INCREASED('', STANDARD_LOAN_AMOUNT),
|
|
568
626
|
'info'
|
|
569
627
|
)
|
|
570
|
-
|
|
628
|
+
|
|
629
|
+
// Reads the unlock-relevant fields off the current (fresh-game)
|
|
630
|
+
// state rather than calling createInitialState() again - that
|
|
631
|
+
// would re-run generateCow()/uuid(), consuming extra draws from
|
|
632
|
+
// the seeded RNG sequence that other code (and e2e fixtures tied
|
|
633
|
+
// to specific seeds) depends on staying stable.
|
|
634
|
+
const restoredStageFocus = getValidatedStageFocusFromHash(
|
|
635
|
+
stateRef.current
|
|
636
|
+
)
|
|
637
|
+
|
|
638
|
+
setState(prev => ({
|
|
639
|
+
...prev,
|
|
640
|
+
...(restoredStageFocus && { stageFocus: restoredStageFocus }),
|
|
641
|
+
hasBooted: true,
|
|
642
|
+
}))
|
|
571
643
|
}
|
|
572
644
|
|
|
573
645
|
syncToRoom()
|
|
@@ -2,10 +2,9 @@ import React from 'react'
|
|
|
2
2
|
import { render } from '@testing-library/react'
|
|
3
3
|
import { SnackbarProvider } from 'notistack'
|
|
4
4
|
|
|
5
|
-
import { NotificationSystem } from './NotificationSystem.js'
|
|
5
|
+
import { NotificationSystem, getNotificationKey } from './NotificationSystem.js'
|
|
6
6
|
|
|
7
7
|
const defaultProps = {
|
|
8
|
-
closeSnackbar: vitest.fn(),
|
|
9
8
|
enqueueSnackbar: vitest.fn(),
|
|
10
9
|
latestNotification: null,
|
|
11
10
|
}
|
|
@@ -19,7 +18,16 @@ test('renders', () => {
|
|
|
19
18
|
// NotificationSystem renders null, so we just verify it doesn't crash
|
|
20
19
|
})
|
|
21
20
|
|
|
22
|
-
test('calls enqueueSnackbar when latestNotification is provided', () => {
|
|
21
|
+
test('calls enqueueSnackbar with a content-derived key when latestNotification is provided', () => {
|
|
22
|
+
// Regression test: notistack's closeSnackbar(key) invokes the matching
|
|
23
|
+
// snack's own `onClose` before removing it from state. An onClose
|
|
24
|
+
// handler here that calls closeSnackbar with its own key recurses
|
|
25
|
+
// infinitely the moment the snack naturally auto-hides (stack overflow
|
|
26
|
+
// after the first "Progress saved!" toast expires). No onClose handler
|
|
27
|
+
// should be passed at all - notistack manages the snack's lifecycle
|
|
28
|
+
// (auto-hide, then removal) on its own once autoHideDuration/key are set.
|
|
29
|
+
// The exact-match assertion below guards against onClose (or any other
|
|
30
|
+
// unexpected option) being reintroduced.
|
|
23
31
|
const enqueueSnackbar = vitest.fn()
|
|
24
32
|
const latestNotification: farmhand.notification = {
|
|
25
33
|
message: 'Test notification',
|
|
@@ -35,8 +43,8 @@ test('calls enqueueSnackbar when latestNotification is provided', () => {
|
|
|
35
43
|
)
|
|
36
44
|
|
|
37
45
|
expect(enqueueSnackbar).toHaveBeenCalledWith(latestNotification, {
|
|
46
|
+
key: 'info:Test notification',
|
|
38
47
|
autoHideDuration: 1, // NOTIFICATION_DURATION in test mode
|
|
39
|
-
onClose: expect.any(Function),
|
|
40
48
|
preventDuplicate: true,
|
|
41
49
|
})
|
|
42
50
|
})
|
|
@@ -55,32 +63,7 @@ test('does not call enqueueSnackbar when latestNotification is null', () => {
|
|
|
55
63
|
expect(enqueueSnackbar).not.toHaveBeenCalled()
|
|
56
64
|
})
|
|
57
65
|
|
|
58
|
-
test('
|
|
59
|
-
const closeSnackbar = vitest.fn()
|
|
60
|
-
const enqueueSnackbar = vitest.fn()
|
|
61
|
-
const latestNotification: farmhand.notification = {
|
|
62
|
-
message: 'Test notification',
|
|
63
|
-
severity: 'info',
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
renderWithSnackbar(
|
|
67
|
-
<NotificationSystem
|
|
68
|
-
{...defaultProps}
|
|
69
|
-
closeSnackbar={closeSnackbar}
|
|
70
|
-
enqueueSnackbar={enqueueSnackbar}
|
|
71
|
-
latestNotification={latestNotification}
|
|
72
|
-
/>
|
|
73
|
-
)
|
|
74
|
-
|
|
75
|
-
// Get the onClose function from the enqueueSnackbar call
|
|
76
|
-
const onCloseCallback = enqueueSnackbar.mock.calls[0][1].onClose
|
|
77
|
-
|
|
78
|
-
onCloseCallback()
|
|
79
|
-
|
|
80
|
-
expect(closeSnackbar).toHaveBeenCalledTimes(1)
|
|
81
|
-
})
|
|
82
|
-
|
|
83
|
-
test('re-enqueues notification when latestNotification changes', () => {
|
|
66
|
+
test('re-enqueues notification when latestNotification changes to a different message', () => {
|
|
84
67
|
const enqueueSnackbar = vitest.fn()
|
|
85
68
|
const initialNotification: farmhand.notification = {
|
|
86
69
|
message: 'First notification',
|
|
@@ -101,8 +84,8 @@ test('re-enqueues notification when latestNotification changes', () => {
|
|
|
101
84
|
|
|
102
85
|
expect(enqueueSnackbar).toHaveBeenCalledTimes(1)
|
|
103
86
|
expect(enqueueSnackbar).toHaveBeenCalledWith(initialNotification, {
|
|
87
|
+
key: getNotificationKey(initialNotification),
|
|
104
88
|
autoHideDuration: 1,
|
|
105
|
-
onClose: expect.any(Function),
|
|
106
89
|
preventDuplicate: true,
|
|
107
90
|
})
|
|
108
91
|
|
|
@@ -119,8 +102,46 @@ test('re-enqueues notification when latestNotification changes', () => {
|
|
|
119
102
|
|
|
120
103
|
expect(enqueueSnackbar).toHaveBeenCalledTimes(2)
|
|
121
104
|
expect(enqueueSnackbar).toHaveBeenLastCalledWith(newNotification, {
|
|
105
|
+
key: getNotificationKey(newNotification),
|
|
122
106
|
autoHideDuration: 1,
|
|
123
|
-
onClose: expect.any(Function),
|
|
124
107
|
preventDuplicate: true,
|
|
125
108
|
})
|
|
126
109
|
})
|
|
110
|
+
|
|
111
|
+
test('uses the same key for repeated notifications with identical message and severity, letting notistack dedupe them', () => {
|
|
112
|
+
const enqueueSnackbar = vitest.fn()
|
|
113
|
+
const firstNotification: farmhand.notification = {
|
|
114
|
+
message: 'Progress saved!',
|
|
115
|
+
severity: 'info',
|
|
116
|
+
}
|
|
117
|
+
const secondNotification: farmhand.notification = {
|
|
118
|
+
message: 'Progress saved!',
|
|
119
|
+
severity: 'info',
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
const { rerender } = renderWithSnackbar(
|
|
123
|
+
<NotificationSystem
|
|
124
|
+
{...defaultProps}
|
|
125
|
+
enqueueSnackbar={enqueueSnackbar}
|
|
126
|
+
latestNotification={firstNotification}
|
|
127
|
+
/>
|
|
128
|
+
)
|
|
129
|
+
|
|
130
|
+
rerender(
|
|
131
|
+
<SnackbarProvider>
|
|
132
|
+
<NotificationSystem
|
|
133
|
+
{...defaultProps}
|
|
134
|
+
enqueueSnackbar={enqueueSnackbar}
|
|
135
|
+
latestNotification={secondNotification}
|
|
136
|
+
/>
|
|
137
|
+
</SnackbarProvider>
|
|
138
|
+
)
|
|
139
|
+
|
|
140
|
+
expect(enqueueSnackbar).toHaveBeenCalledTimes(2)
|
|
141
|
+
|
|
142
|
+
// Identical key is what allows notistack's own preventDuplicate to skip
|
|
143
|
+
// showing a second toast while the first is still visible or queued.
|
|
144
|
+
expect(enqueueSnackbar.mock.calls[0][1].key).toBe(
|
|
145
|
+
enqueueSnackbar.mock.calls[1][1].key
|
|
146
|
+
)
|
|
147
|
+
})
|
|
@@ -7,6 +7,11 @@ import { withSnackbar } from 'notistack'
|
|
|
7
7
|
import { NOTIFICATION_DURATION } from '../../constants.js'
|
|
8
8
|
import FarmhandContext from '../Farmhand/Farmhand.context.js'
|
|
9
9
|
|
|
10
|
+
export const getNotificationKey = ({
|
|
11
|
+
message,
|
|
12
|
+
severity,
|
|
13
|
+
}: farmhand.notification): string => `${severity}:${message}`
|
|
14
|
+
|
|
10
15
|
export const snackbarProviderContentCallback = (
|
|
11
16
|
key: string | number,
|
|
12
17
|
{
|
|
@@ -31,23 +36,29 @@ export const snackbarProviderContentCallback = (
|
|
|
31
36
|
)
|
|
32
37
|
|
|
33
38
|
export const NotificationSystem = ({
|
|
34
|
-
closeSnackbar,
|
|
35
39
|
enqueueSnackbar,
|
|
36
40
|
latestNotification,
|
|
37
41
|
}: {
|
|
38
|
-
closeSnackbar: () => void
|
|
39
42
|
enqueueSnackbar: (notification: farmhand.notification, options: any) => void
|
|
40
43
|
latestNotification: farmhand.notification | null
|
|
41
44
|
}) => {
|
|
42
45
|
useEffect(() => {
|
|
43
|
-
if (latestNotification) {
|
|
44
|
-
|
|
45
|
-
autoHideDuration: NOTIFICATION_DURATION,
|
|
46
|
-
onClose: () => closeSnackbar(),
|
|
47
|
-
preventDuplicate: true,
|
|
48
|
-
})
|
|
46
|
+
if (!latestNotification) {
|
|
47
|
+
return
|
|
49
48
|
}
|
|
50
|
-
|
|
49
|
+
|
|
50
|
+
// A stable, content-derived key (rather than a fresh object identity
|
|
51
|
+
// every call) is what lets preventDuplicate below actually do
|
|
52
|
+
// something - it skips enqueueing when a snack with this key is
|
|
53
|
+
// already shown or queued, instead of stacking a duplicate. notistack
|
|
54
|
+
// handles the rest of the lifecycle itself (auto-hide, then removal)
|
|
55
|
+
// once autoHideDuration and a key are set - no onClose needed here.
|
|
56
|
+
enqueueSnackbar(latestNotification, {
|
|
57
|
+
key: getNotificationKey(latestNotification),
|
|
58
|
+
autoHideDuration: NOTIFICATION_DURATION,
|
|
59
|
+
preventDuplicate: true,
|
|
60
|
+
})
|
|
61
|
+
}, [enqueueSnackbar, latestNotification])
|
|
51
62
|
|
|
52
63
|
return null
|
|
53
64
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react'
|
|
2
2
|
import { array, func, number, object } from 'prop-types'
|
|
3
3
|
import Button from '@mui/material/Button/index.js'
|
|
4
4
|
import Card from '@mui/material/Card/index.js'
|
|
@@ -33,6 +33,7 @@ import Inventory from '../Inventory/index.js'
|
|
|
33
33
|
import TierPurchase from '../TierPurchase/index.js'
|
|
34
34
|
import { Div } from '../Elements/index.js'
|
|
35
35
|
import { centerTabsSx } from '../../styles/sx.js'
|
|
36
|
+
import { useTabQueryParam } from '../../hooks/useTabQueryParam.js'
|
|
36
37
|
|
|
37
38
|
import { TabPanel, a11yProps } from './TabPanel/index.js'
|
|
38
39
|
|
|
@@ -114,8 +115,6 @@ export const Shop = ({
|
|
|
114
115
|
valueAdjustments: Record<string, number>
|
|
115
116
|
storageUpgradeCost?: number
|
|
116
117
|
}) => {
|
|
117
|
-
const [currentTab, setCurrentTab] = useState(0)
|
|
118
|
-
|
|
119
118
|
const { seeds, saplings, fieldTools } = categorizeShopInventory(shopInventory)
|
|
120
119
|
|
|
121
120
|
const isForestUnlocked =
|
|
@@ -126,6 +125,12 @@ export const Shop = ({
|
|
|
126
125
|
const suppliesTabIndex = showSaplings ? 2 : 1
|
|
127
126
|
const upgradesTabIndex = showSaplings ? 3 : 2
|
|
128
127
|
|
|
128
|
+
const [currentTab, setCurrentTab] = useTabQueryParam(
|
|
129
|
+
['Seeds', showSaplings ? 'Saplings' : '', 'Supplies', 'Upgrades'].filter(
|
|
130
|
+
Boolean
|
|
131
|
+
)
|
|
132
|
+
)
|
|
133
|
+
|
|
129
134
|
return (
|
|
130
135
|
<Div className="Shop" sx={centerTabsSx}>
|
|
131
136
|
<Tabs
|