@seamly/web-ui 21.0.9 → 22.0.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/build/dist/lib/components.js +9228 -7777
- package/build/dist/lib/components.js.map +1 -0
- package/build/dist/lib/components.min.js +2 -1
- package/build/dist/lib/components.min.js.LICENSE.txt +2 -2
- package/build/dist/lib/components.min.js.map +1 -0
- package/build/dist/lib/config.js +2 -1
- package/build/dist/lib/config.js.map +1 -0
- package/build/dist/lib/config.min.js +2 -1
- package/build/dist/lib/config.min.js.map +1 -0
- package/build/dist/lib/contexts.js +2 -1
- package/build/dist/lib/contexts.js.map +1 -0
- package/build/dist/lib/contexts.min.js +2 -1
- package/build/dist/lib/contexts.min.js.map +1 -0
- package/build/dist/lib/deprecated-view.css +1 -1
- package/build/dist/lib/deprecated-view.js +1 -1
- package/build/dist/lib/hooks.js +6999 -5996
- package/build/dist/lib/hooks.js.map +1 -0
- package/build/dist/lib/hooks.min.js +2 -1
- package/build/dist/lib/hooks.min.js.map +1 -0
- package/build/dist/lib/index.debug.js +940 -370
- package/build/dist/lib/index.debug.js.map +1 -0
- package/build/dist/lib/index.debug.min.js +2 -1
- package/build/dist/lib/index.debug.min.js.LICENSE.txt +334 -110
- package/build/dist/lib/index.debug.min.js.map +1 -0
- package/build/dist/lib/index.js +2810 -5472
- package/build/dist/lib/index.js.map +1 -0
- package/build/dist/lib/index.min.js +2 -1
- package/build/dist/lib/index.min.js.LICENSE.txt +2 -2
- package/build/dist/lib/index.min.js.map +1 -0
- package/build/dist/lib/sounds/beep.mp3 +0 -0
- package/build/dist/lib/standalone.js +10575 -13540
- package/build/dist/lib/standalone.js.map +1 -0
- package/build/dist/lib/standalone.min.js +2 -1
- package/build/dist/lib/standalone.min.js.LICENSE.txt +1 -1
- package/build/dist/lib/standalone.min.js.map +1 -0
- package/build/dist/lib/storage.js +2 -1
- package/build/dist/lib/storage.js.map +1 -0
- package/build/dist/lib/storage.min.js +2 -1
- package/build/dist/lib/storage.min.js.map +1 -0
- package/build/dist/lib/style-guide.js +1701 -5859
- package/build/dist/lib/style-guide.js.map +1 -0
- package/build/dist/lib/style-guide.min.js +2 -1
- package/build/dist/lib/style-guide.min.js.LICENSE.txt +2 -2
- package/build/dist/lib/style-guide.min.js.map +1 -0
- package/build/dist/lib/styles-default-implementation.css +1 -1
- package/build/dist/lib/styles-default-implementation.js +1 -1
- package/build/dist/lib/styles.css +1 -1
- package/build/dist/lib/styles.js +1 -1
- package/build/dist/lib/utils.js +11536 -14530
- package/build/dist/lib/utils.js.map +1 -0
- package/build/dist/lib/utils.min.js +2 -1
- package/build/dist/lib/utils.min.js.LICENSE.txt +1 -6
- package/build/dist/lib/utils.min.js.map +1 -0
- package/package.json +58 -48
- package/src/javascripts/api/conversation-connector.ts +2 -0
- package/src/javascripts/api/errors/seamly-api-error.ts +15 -0
- package/src/javascripts/api/index.ts +168 -94
- package/src/javascripts/config.ts +1 -1
- package/src/javascripts/config.types.ts +18 -11
- package/src/javascripts/domains/config/selectors.ts +1 -1
- package/src/javascripts/domains/config/slice.ts +12 -0
- package/src/javascripts/domains/forms/forms.types.ts +1 -0
- package/src/javascripts/domains/forms/hooks.ts +10 -2
- package/src/javascripts/domains/store/selectors.ts +23 -10
- package/src/javascripts/domains/store/slice.ts +63 -11
- package/src/javascripts/domains/store/store.types.ts +41 -1
- package/src/javascripts/domains/translations/components/options-button.tsx +1 -4
- package/src/javascripts/domains/translations/hooks.ts +11 -4
- package/src/javascripts/index.ts +2 -0
- package/src/javascripts/lib/url-helpers.ts +24 -0
- package/src/javascripts/schema.ts +10 -0
- package/src/javascripts/style-guide/states.js +109 -0
- package/src/javascripts/ui/components/conversation/conversation.tsx +2 -0
- package/src/javascripts/ui/components/conversation/event/chat-scroll/chat-scroll-provider.tsx +2 -0
- package/src/javascripts/ui/components/conversation/event/choice-prompt.js +1 -1
- package/src/javascripts/ui/components/conversation/event/text.js +1 -1
- package/src/javascripts/ui/components/conversation/event/upload.js +50 -9
- package/src/javascripts/ui/components/conversation/use-chat-scroll.ts +3 -2
- package/src/javascripts/ui/components/core/seamly-event-subscriber.ts +7 -1
- package/src/javascripts/ui/components/core/seamly-file-upload.tsx +156 -0
- package/src/javascripts/ui/components/entry/abort-transaction-button/abort-transaction-button.tsx +45 -0
- package/src/javascripts/ui/components/entry/text-entry/hooks.ts +108 -0
- package/src/javascripts/ui/components/entry/text-entry/index.js +7 -4
- package/src/javascripts/ui/components/entry/text-entry/{text-entry-form.js → text-entry-form.tsx} +8 -22
- package/src/javascripts/ui/components/form-controls/{input.js → input.tsx} +13 -2
- package/src/javascripts/ui/components/form-controls/{wrapper.js → wrapper.tsx} +8 -4
- package/src/javascripts/ui/components/view/{index.js → index.tsx} +53 -4
- package/src/javascripts/ui/components/view/window-view/{index.js → index.tsx} +14 -2
- package/src/javascripts/ui/components/widgets/{in-out-transition.js → in-out-transition.tsx} +67 -28
- package/src/javascripts/ui/hooks/{seamly-api-hooks.js → seamly-api-hooks.ts} +1 -1
- package/src/javascripts/ui/hooks/sounds/beep.mp3 +0 -0
- package/src/javascripts/ui/hooks/use-click-outside.ts +5 -3
- package/src/javascripts/ui/hooks/use-notifications.ts +114 -0
- package/src/javascripts/ui/hooks/use-timeout.ts +20 -0
- package/src/stylesheets/3-chat/_chat.scss +3 -5
- package/src/stylesheets/4-base/_formelements.scss +0 -36
- package/src/stylesheets/5-components/_abort-transaction.scss +10 -0
- package/src/stylesheets/5-components/_buttons.scss +18 -3
- package/src/stylesheets/5-components/_character-limit.scss +2 -2
- package/src/stylesheets/5-components/_chat-status.scss +26 -37
- package/src/stylesheets/5-components/_choice-prompt.scss +9 -10
- package/src/stylesheets/5-components/_conversation.scss +9 -62
- package/src/stylesheets/5-components/_disclaimer.scss +11 -3
- package/src/stylesheets/5-components/_error.scss +3 -2
- package/src/stylesheets/5-components/_idle.scss +3 -8
- package/src/stylesheets/5-components/_input.scss +34 -13
- package/src/stylesheets/5-components/_interrupt.scss +3 -10
- package/src/stylesheets/5-components/_loader.scss +1 -2
- package/src/stylesheets/5-components/_message-author.scss +2 -4
- package/src/stylesheets/5-components/_message-body.scss +33 -10
- package/src/stylesheets/5-components/_message-card.scss +2 -10
- package/src/stylesheets/5-components/_message-carousel.scss +4 -4
- package/src/stylesheets/5-components/_message-cta.scss +0 -6
- package/src/stylesheets/5-components/_message.scss +1 -0
- package/src/stylesheets/5-components/_modal.scss +2 -5
- package/src/stylesheets/5-components/_options.scss +17 -22
- package/src/stylesheets/5-components/_pre-chat-messages.scss +3 -1
- package/src/stylesheets/5-components/_prompt.scss +3 -7
- package/src/stylesheets/5-components/_skip-link.scss +2 -1
- package/src/stylesheets/5-components/_suggestions.scss +2 -2
- package/src/stylesheets/5-components/_translation-options.scss +5 -2
- package/src/stylesheets/5-components/_unread-messages.scss +33 -0
- package/src/stylesheets/5-components/_upload.scss +20 -27
- package/src/stylesheets/6-default-implementation/_hover.scss +14 -17
- package/src/stylesheets/7-deprecated/1-settings/_config.scss +17 -0
- package/src/stylesheets/7-deprecated/3-app/_app.scss +2 -1
- package/src/stylesheets/7-deprecated/5-components/_card.scss +1 -0
- package/src/stylesheets/7-deprecated/5-components/_chat-status.scss +66 -20
- package/src/stylesheets/7-deprecated/5-components/_conversation.scss +1 -4
- package/src/stylesheets/7-deprecated/5-components/_input.scss +6 -1
- package/src/stylesheets/7-deprecated/5-components/_interrupt.scss +1 -4
- package/src/stylesheets/7-deprecated/5-components/_message.scss +49 -12
- package/src/stylesheets/7-deprecated/5-components/_translation-options.scss +30 -37
- package/src/stylesheets/7-deprecated/5-components/_unread-messages.scss +38 -0
- package/src/stylesheets/deprecated-view.scss +1 -0
- package/src/stylesheets/styles.scss +2 -0
- package/webpack/config.common.js +6 -1
- package/webpack/config.package.js +18 -0
- package/webpack/defaults.js +1 -1
- package/src/javascripts/ui/components/core/seamly-file-upload.js +0 -86
- package/src/javascripts/ui/components/entry/text-entry/hooks.js +0 -46
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storage.js","mappings":";;UAAA;UACA;;;;;WCDA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;;;;;;;;;;;;ACNe,SAASA,QAAQA,CAAA,EAAG;EACjC,OAAO;IACLC,GAAG,EAAEA,CAAA,KAAM;MACT;MACA;MACA,IAAIC,MAAM,CAACC,cAAc,CAAC,cAAc,CAAC,EAAE;QACzC,IAAI;UACF;UACA,OAAOC,IAAI,CAACC,KAAK,CAACC,YAAY,CAACC,OAAO,EAAE,CAAC;QAC3C,CAAC,CAAC,OAAOC,CAAC,EAAE;UACVC,OAAO,CAACC,KAAK,CAAC,oDAAoD,EAAEF,CAAC,CAAC;UACtE;UACA;UACA,OAAO,CAAC,CAAC;QACX;MACF;MACA,OAAON,MAAM,CAACS,gBAAgB;IAChC,CAAC;IACDC,GAAG,EAAGC,OAAO,IAAK;MAChB;MACA,IACEX,MAAM,CAACY,MAAM,IACbZ,MAAM,CAACY,MAAM,CAACC,eAAe,IAC7Bb,MAAM,CAACY,MAAM,CAACC,eAAe,CAACC,YAAY,EAC1C;QACAd,MAAM,CAACY,MAAM,CAACC,eAAe,CAACC,YAAY,CAACC,WAAW,CACpDb,IAAI,CAACc,SAAS,CAACL,OAAO,CAAC,CACxB;MACH;;MAEA;MACA,IAAIX,MAAM,CAACC,cAAc,CAAC,cAAc,CAAC,EAAE;QACzC;QACAG,YAAY,CAACa,OAAO,CAACf,IAAI,CAACc,SAAS,CAACL,OAAO,CAAC,CAAC;MAC/C;;MAEA;MACA,IAAIX,MAAM,CAACkB,kBAAkB,EAAE;QAC7BlB,MAAM,CAACkB,kBAAkB,CAACH,WAAW,CAACb,IAAI,CAACc,SAAS,CAACL,OAAO,CAAC,CAAC;MAChE;IACF;EACF,CAAC;AACH;;AC1CA;AACA;AACA,SAAS,gBAAM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AAE;QACT,IAAI,CAACA,KAAK,EAAE;UACV;QACF;QACAN,aAAW,CAACI,GAAG,EAAErB,IAAI,CAACc,SAAS,CAACS,KAAK,CAAC,EAAEJ,UAAU,CAAC;MACrD;IACF,CAAC;EACH,CAAC;AACH;;ACpBe,SAASK,KAAKA,CAACJ,GAAG,EAAE;EACjC,MAAMC,GAAG,GAAI,QAAOD,GAAI,EAAC;EAEzB,OAAO;IACLvB,GAAGA,CAAA,EAAG;MACJ,MAAM4B,UAAU,GAAG,CAACJ,GAAG,EAAEA,GAAG,CAACK,KAAK,CAAC,GAAG,CAAC,CAACC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAACC,IAAI,CAAC,GAAG,CAAC,CAAC;MAC/D,IAAIC,GAAG;MACP,GAAG;QACDA,GAAG,GAAGC,cAAc,CAACC,OAAO,CAACN,UAAU,CAAC,CAAC,CAAC,CAAC;MAC7C,CAAC,QAAQA,UAAU,CAACO,KAAK,EAAE,IAAI,CAACH,GAAG;MACnC,OAAO7B,IAAI,CAACC,KAAK,CAAC4B,GAAG,CAAC;IACxB,CAAC;IAEDrB,GAAGA,CAACe,KAAK,EAAE;MACT,IAAI,CAACA,KAAK,EAAE;QACV;MACF;MACAO,cAAc,CAACG,OAAO,CAACZ,GAAG,EAAErB,IAAI,CAACc,SAAS,CAACS,KAAK,CAAC,CAAC;IACpD;EACF,CAAC;AACH;;ACpBkF;AACM","sources":["webpack:///webpack/bootstrap","webpack:///webpack/runtime/define property getters","webpack:///webpack/runtime/hasOwnProperty shorthand","webpack:///webpack/runtime/make namespace object","webpack:///./src/javascripts/lib/store/providers/app-storage.js","webpack:///./node_modules/js-cookie/dist/js.cookie.mjs","webpack:///./src/javascripts/lib/store/providers/cookie-storage.js","webpack:///./src/javascripts/lib/store/providers/session-storage.js","webpack:///./src/javascripts/package/storage.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","export default function appStore() {\n return {\n get: () => {\n // For Android we can retrieve data directly over the bridge\n // iOS and ReactNative will write the data on the window.seamlyBridgeData object on init\n if (window.hasOwnProperty('SeamlyBridge')) {\n try {\n // eslint-disable-next-line no-undef\n return JSON.parse(SeamlyBridge.getData())\n } catch (e) {\n console.error('Unexpected or malformed data retrieved from bridge', e)\n // Android should always return unchanged JSON data.\n // If something went wrong parsing the response, it's best to start from scratch\n return {}\n }\n }\n return window.seamlyBridgeData\n },\n set: (newData) => {\n // iOS\n if (\n window.webkit &&\n window.webkit.messageHandlers &&\n window.webkit.messageHandlers.seamlyBridge\n ) {\n window.webkit.messageHandlers.seamlyBridge.postMessage(\n JSON.stringify(newData),\n )\n }\n\n // Android\n if (window.hasOwnProperty('SeamlyBridge')) {\n // eslint-disable-next-line no-undef\n SeamlyBridge.setData(JSON.stringify(newData))\n }\n\n // React Native\n if (window.ReactNativeWebView) {\n window.ReactNativeWebView.postMessage(JSON.stringify(newData))\n }\n },\n }\n}\n","/*! js-cookie v3.0.1 | MIT */\n/* eslint-disable no-var */\nfunction assign (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n target[key] = source[key];\n }\n }\n return target\n}\n/* eslint-enable no-var */\n\n/* eslint-disable no-var */\nvar defaultConverter = {\n read: function (value) {\n if (value[0] === '\"') {\n value = value.slice(1, -1);\n }\n return value.replace(/(%[\\dA-F]{2})+/gi, decodeURIComponent)\n },\n write: function (value) {\n return encodeURIComponent(value).replace(\n /%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,\n decodeURIComponent\n )\n }\n};\n/* eslint-enable no-var */\n\n/* eslint-disable no-var */\n\nfunction init (converter, defaultAttributes) {\n function set (key, value, attributes) {\n if (typeof document === 'undefined') {\n return\n }\n\n attributes = assign({}, defaultAttributes, attributes);\n\n if (typeof attributes.expires === 'number') {\n attributes.expires = new Date(Date.now() + attributes.expires * 864e5);\n }\n if (attributes.expires) {\n attributes.expires = attributes.expires.toUTCString();\n }\n\n key = encodeURIComponent(key)\n .replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent)\n .replace(/[()]/g, escape);\n\n var stringifiedAttributes = '';\n for (var attributeName in attributes) {\n if (!attributes[attributeName]) {\n continue\n }\n\n stringifiedAttributes += '; ' + attributeName;\n\n if (attributes[attributeName] === true) {\n continue\n }\n\n // Considers RFC 6265 section 5.2:\n // ...\n // 3. If the remaining unparsed-attributes contains a %x3B (\";\")\n // character:\n // Consume the characters of the unparsed-attributes up to,\n // not including, the first %x3B (\";\") character.\n // ...\n stringifiedAttributes += '=' + attributes[attributeName].split(';')[0];\n }\n\n return (document.cookie =\n key + '=' + converter.write(value, key) + stringifiedAttributes)\n }\n\n function get (key) {\n if (typeof document === 'undefined' || (arguments.length && !key)) {\n return\n }\n\n // To prevent the for loop in the first place assign an empty array\n // in case there are no cookies at all.\n var cookies = document.cookie ? document.cookie.split('; ') : [];\n var jar = {};\n for (var i = 0; i < cookies.length; i++) {\n var parts = cookies[i].split('=');\n var value = parts.slice(1).join('=');\n\n try {\n var foundKey = decodeURIComponent(parts[0]);\n jar[foundKey] = converter.read(value, foundKey);\n\n if (key === foundKey) {\n break\n }\n } catch (e) {}\n }\n\n return key ? jar[key] : jar\n }\n\n return Object.create(\n {\n set: set,\n get: get,\n remove: function (key, attributes) {\n set(\n key,\n '',\n assign({}, attributes, {\n expires: -1\n })\n );\n },\n withAttributes: function (attributes) {\n return init(this.converter, assign({}, this.attributes, attributes))\n },\n withConverter: function (converter) {\n return init(assign({}, this.converter, converter), this.attributes)\n }\n },\n {\n attributes: { value: Object.freeze(defaultAttributes) },\n converter: { value: Object.freeze(converter) }\n }\n )\n}\n\nvar api = init(defaultConverter, { path: '/' });\n/* eslint-enable no-var */\n\nexport default api;\n","import cookies from 'js-cookie'\n\nexport default function cookieStore(attributes = {}) {\n return function (key) {\n const KEY = `cvco.${key}`\n\n return {\n get() {\n const jsonStr = cookies.get(KEY)\n return jsonStr ? JSON.parse(jsonStr) : null\n },\n\n set(value) {\n if (!value) {\n return\n }\n cookies.set(KEY, JSON.stringify(value), attributes)\n },\n }\n }\n}\n","export default function store(key) {\n const KEY = `cvco.${key}`\n\n return {\n get() {\n const candidates = [KEY, KEY.split('.').slice(0, -1).join('.')]\n let val\n do {\n val = sessionStorage.getItem(candidates[0])\n } while (candidates.shift() && !val)\n return JSON.parse(val)\n },\n\n set(value) {\n if (!value) {\n return\n }\n sessionStorage.setItem(KEY, JSON.stringify(value))\n },\n }\n}\n","export { default as appStorageProvider } from '../lib/store/providers/app-storage'\nexport { default as cookieStorageProvider } from '../lib/store/providers/cookie-storage'\nexport { default as sessionStorageProvider } from '../lib/store/providers/session-storage'\n"],"names":["appStore","get","window","hasOwnProperty","JSON","parse","SeamlyBridge","getData","e","console","error","seamlyBridgeData","set","newData","webkit","messageHandlers","seamlyBridge","postMessage","stringify","setData","ReactNativeWebView","cookies","cookieStore","attributes","key","KEY","jsonStr","value","store","candidates","split","slice","join","val","sessionStorage","getItem","shift","setItem","default","appStorageProvider","cookieStorageProvider","sessionStorageProvider"],"sourceRoot":""}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
/*! For license information please see storage.min.js.LICENSE.txt */
|
|
2
|
-
(()=>{"use strict";var e={d:(t,r)=>{for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};function r(){return{get:()=>{if(window.hasOwnProperty("SeamlyBridge"))try{return JSON.parse(SeamlyBridge.getData())}catch(e){return console.error("Unexpected or malformed data retrieved from bridge",e),{}}return window.seamlyBridgeData},set:e=>{window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.seamlyBridge&&window.webkit.messageHandlers.seamlyBridge.postMessage(JSON.stringify(e)),window.hasOwnProperty("SeamlyBridge")&&SeamlyBridge.setData(JSON.stringify(e)),window.ReactNativeWebView&&window.ReactNativeWebView.postMessage(JSON.stringify(e))}}}function n(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)e[n]=r[n]}return e}e.r(t),e.d(t,{appStorageProvider:()=>r,cookieStorageProvider:()=>i,sessionStorageProvider:()=>s});const o=function e(t,r){function o(e,o,i){if("undefined"!=typeof document){"number"==typeof(i=n({},r,i)).expires&&(i.expires=new Date(Date.now()+864e5*i.expires)),i.expires&&(i.expires=i.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var s="";for(var a in i)i[a]&&(s+="; "+a,!0!==i[a]&&(s+="="+i[a].split(";")[0]));return document.cookie=e+"="+t.write(o,e)+s}}return Object.create({set:o,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var r=document.cookie?document.cookie.split("; "):[],n={},o=0;o<r.length;o++){var i=r[o].split("="),s=i.slice(1).join("=");try{var a=decodeURIComponent(i[0]);if(n[a]=t.read(s,a),e===a)break}catch(e){}}return e?n[e]:n}},remove:function(e,t){o(e,"",n({},t,{expires:-1}))},withAttributes:function(t){return e(this.converter,n({},this.attributes,t))},withConverter:function(t){return e(n({},this.converter,t),this.attributes)}},{attributes:{value:Object.freeze(r)},converter:{value:Object.freeze(t)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"});function i(e={}){return function(t){const r=`cvco.${t}`;return{get(){const e=o.get(r);return e?JSON.parse(e):null},set(t){t&&o.set(r,JSON.stringify(t),e)}}}}function s(e){const t=`cvco.${e}`;return{get(){const e=[t,t.split(".").slice(0,-1).join(".")];let r;do{r=sessionStorage.getItem(e[0])}while(e.shift()&&!r);return JSON.parse(r)},set(e){e&&sessionStorage.setItem(t,JSON.stringify(e))}}}module.exports=t})();
|
|
2
|
+
(()=>{"use strict";var e={d:(t,r)=>{for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};function r(){return{get:()=>{if(window.hasOwnProperty("SeamlyBridge"))try{return JSON.parse(SeamlyBridge.getData())}catch(e){return console.error("Unexpected or malformed data retrieved from bridge",e),{}}return window.seamlyBridgeData},set:e=>{window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.seamlyBridge&&window.webkit.messageHandlers.seamlyBridge.postMessage(JSON.stringify(e)),window.hasOwnProperty("SeamlyBridge")&&SeamlyBridge.setData(JSON.stringify(e)),window.ReactNativeWebView&&window.ReactNativeWebView.postMessage(JSON.stringify(e))}}}function n(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)e[n]=r[n]}return e}e.r(t),e.d(t,{appStorageProvider:()=>r,cookieStorageProvider:()=>i,sessionStorageProvider:()=>s});const o=function e(t,r){function o(e,o,i){if("undefined"!=typeof document){"number"==typeof(i=n({},r,i)).expires&&(i.expires=new Date(Date.now()+864e5*i.expires)),i.expires&&(i.expires=i.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var s="";for(var a in i)i[a]&&(s+="; "+a,!0!==i[a]&&(s+="="+i[a].split(";")[0]));return document.cookie=e+"="+t.write(o,e)+s}}return Object.create({set:o,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var r=document.cookie?document.cookie.split("; "):[],n={},o=0;o<r.length;o++){var i=r[o].split("="),s=i.slice(1).join("=");try{var a=decodeURIComponent(i[0]);if(n[a]=t.read(s,a),e===a)break}catch(e){}}return e?n[e]:n}},remove:function(e,t){o(e,"",n({},t,{expires:-1}))},withAttributes:function(t){return e(this.converter,n({},this.attributes,t))},withConverter:function(t){return e(n({},this.converter,t),this.attributes)}},{attributes:{value:Object.freeze(r)},converter:{value:Object.freeze(t)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"});function i(e={}){return function(t){const r=`cvco.${t}`;return{get(){const e=o.get(r);return e?JSON.parse(e):null},set(t){t&&o.set(r,JSON.stringify(t),e)}}}}function s(e){const t=`cvco.${e}`;return{get(){const e=[t,t.split(".").slice(0,-1).join(".")];let r;do{r=sessionStorage.getItem(e[0])}while(e.shift()&&!r);return JSON.parse(r)},set(e){e&&sessionStorage.setItem(t,JSON.stringify(e))}}}module.exports=t})();
|
|
3
|
+
//# sourceMappingURL=~/storage.min.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storage.min.js","mappings":";mBACA,IAAIA,EAAsB,CCA1BA,EAAwB,CAACC,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXF,EAAoBI,EAAEF,EAAYC,KAASH,EAAoBI,EAAEH,EAASE,IAC5EE,OAAOC,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kE,OAAO5B,IACnCD,UAAW,CAAE1B,MAAOX,OAAOkE,OAAO7B,KAGxC,CAEUD,CApHa,CACrByB,KAAM,SAAUlD,GAId,MAHiB,MAAbA,EAAM,KACRA,EAAQA,EAAM+C,MAAM,GAAI,IAEnB/C,EAAMmC,QAAQ,mBAAoBC,mBAC3C,EACAM,MAAO,SAAU1C,GACf,OAAOkC,mBAAmBlC,GAAOmC,QAC/B,2CACAC,mBAEJ,GAwG+B,CAAEoB,KAAM,MChI1B,SAASC,EAAY7B,EAAa,CAAC,GAChD,OAAO,SAAUzC,GACf,MAAMuE,EAAO,QAAOvE,IAEpB,MAAO,CACLK,MACE,MAAMmE,EAAUf,EAAAA,IAAYc,GAC5B,OAAOC,EAAUxD,KAAKC,MAAMuD,GAAW,IACzC,EAEAhD,IAAIX,GACGA,GAGL4C,EAAAA,IAAYc,EAAKvD,KAAKc,UAAUjB,GAAQ4B,EAC1C,EAEJ,CACF,CCpBe,SAASgC,EAAMzE,GAC5B,MAAMuE,EAAO,QAAOvE,IAEpB,MAAO,CACLK,MACE,MAAMqE,EAAa,CAACH,EAAKA,EAAIlB,MAAM,KAAKO,MAAM,GAAI,GAAGC,KAAK,MAC1D,IAAIc,EACJ,GACEA,EAAMC,eAAeC,QAAQH,EAAW,UACjCA,EAAWI,UAAYH,GAChC,OAAO3D,KAAKC,MAAM0D,EACpB,EAEAnD,IAAIX,GACGA,GAGL+D,eAAeG,QAAQR,EAAKvD,KAAKc,UAAUjB,GAC7C,EAEJ","sources":["webpack:///webpack/bootstrap","webpack:///webpack/runtime/define property getters","webpack:///webpack/runtime/hasOwnProperty shorthand","webpack:///webpack/runtime/make namespace object","webpack:///./src/javascripts/lib/store/providers/app-storage.js","webpack:///./node_modules/js-cookie/dist/js.cookie.mjs","webpack:///./src/javascripts/lib/store/providers/cookie-storage.js","webpack:///./src/javascripts/lib/store/providers/session-storage.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","export default function appStore() {\n return {\n get: () => {\n // For Android we can retrieve data directly over the bridge\n // iOS and ReactNative will write the data on the window.seamlyBridgeData object on init\n if (window.hasOwnProperty('SeamlyBridge')) {\n try {\n // eslint-disable-next-line no-undef\n return JSON.parse(SeamlyBridge.getData())\n } catch (e) {\n console.error('Unexpected or malformed data retrieved from bridge', e)\n // Android should always return unchanged JSON data.\n // If something went wrong parsing the response, it's best to start from scratch\n return {}\n }\n }\n return window.seamlyBridgeData\n },\n set: (newData) => {\n // iOS\n if (\n window.webkit &&\n window.webkit.messageHandlers &&\n window.webkit.messageHandlers.seamlyBridge\n ) {\n window.webkit.messageHandlers.seamlyBridge.postMessage(\n JSON.stringify(newData),\n )\n }\n\n // Android\n if (window.hasOwnProperty('SeamlyBridge')) {\n // eslint-disable-next-line no-undef\n SeamlyBridge.setData(JSON.stringify(newData))\n }\n\n // React Native\n if (window.ReactNativeWebView) {\n window.ReactNativeWebView.postMessage(JSON.stringify(newData))\n }\n },\n }\n}\n","/*! js-cookie v3.0.1 | MIT */\n/* eslint-disable no-var */\nfunction assign (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n target[key] = source[key];\n }\n }\n return target\n}\n/* eslint-enable no-var */\n\n/* eslint-disable no-var */\nvar defaultConverter = {\n read: function (value) {\n if (value[0] === '\"') {\n value = value.slice(1, -1);\n }\n return value.replace(/(%[\\dA-F]{2})+/gi, decodeURIComponent)\n },\n write: function (value) {\n return encodeURIComponent(value).replace(\n /%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,\n decodeURIComponent\n )\n }\n};\n/* eslint-enable no-var */\n\n/* eslint-disable no-var */\n\nfunction init (converter, defaultAttributes) {\n function set (key, value, attributes) {\n if (typeof document === 'undefined') {\n return\n }\n\n attributes = assign({}, defaultAttributes, attributes);\n\n if (typeof attributes.expires === 'number') {\n attributes.expires = new Date(Date.now() + attributes.expires * 864e5);\n }\n if (attributes.expires) {\n attributes.expires = attributes.expires.toUTCString();\n }\n\n key = encodeURIComponent(key)\n .replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent)\n .replace(/[()]/g, escape);\n\n var stringifiedAttributes = '';\n for (var attributeName in attributes) {\n if (!attributes[attributeName]) {\n continue\n }\n\n stringifiedAttributes += '; ' + attributeName;\n\n if (attributes[attributeName] === true) {\n continue\n }\n\n // Considers RFC 6265 section 5.2:\n // ...\n // 3. If the remaining unparsed-attributes contains a %x3B (\";\")\n // character:\n // Consume the characters of the unparsed-attributes up to,\n // not including, the first %x3B (\";\") character.\n // ...\n stringifiedAttributes += '=' + attributes[attributeName].split(';')[0];\n }\n\n return (document.cookie =\n key + '=' + converter.write(value, key) + stringifiedAttributes)\n }\n\n function get (key) {\n if (typeof document === 'undefined' || (arguments.length && !key)) {\n return\n }\n\n // To prevent the for loop in the first place assign an empty array\n // in case there are no cookies at all.\n var cookies = document.cookie ? document.cookie.split('; ') : [];\n var jar = {};\n for (var i = 0; i < cookies.length; i++) {\n var parts = cookies[i].split('=');\n var value = parts.slice(1).join('=');\n\n try {\n var foundKey = decodeURIComponent(parts[0]);\n jar[foundKey] = converter.read(value, foundKey);\n\n if (key === foundKey) {\n break\n }\n } catch (e) {}\n }\n\n return key ? jar[key] : jar\n }\n\n return Object.create(\n {\n set: set,\n get: get,\n remove: function (key, attributes) {\n set(\n key,\n '',\n assign({}, attributes, {\n expires: -1\n })\n );\n },\n withAttributes: function (attributes) {\n return init(this.converter, assign({}, this.attributes, attributes))\n },\n withConverter: function (converter) {\n return init(assign({}, this.converter, converter), this.attributes)\n }\n },\n {\n attributes: { value: Object.freeze(defaultAttributes) },\n converter: { value: Object.freeze(converter) }\n }\n )\n}\n\nvar api = init(defaultConverter, { path: '/' });\n/* eslint-enable no-var */\n\nexport default api;\n","import cookies from 'js-cookie'\n\nexport default function cookieStore(attributes = {}) {\n return function (key) {\n const KEY = `cvco.${key}`\n\n return {\n get() {\n const jsonStr = cookies.get(KEY)\n return jsonStr ? JSON.parse(jsonStr) : null\n },\n\n set(value) {\n if (!value) {\n return\n }\n cookies.set(KEY, JSON.stringify(value), attributes)\n },\n }\n }\n}\n","export default function store(key) {\n const KEY = `cvco.${key}`\n\n return {\n get() {\n const candidates = [KEY, KEY.split('.').slice(0, -1).join('.')]\n let val\n do {\n val = sessionStorage.getItem(candidates[0])\n } while (candidates.shift() && !val)\n return JSON.parse(val)\n },\n\n set(value) {\n if (!value) {\n return\n }\n sessionStorage.setItem(KEY, JSON.stringify(value))\n },\n }\n}\n"],"names":["__webpack_require__","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","appStore","window","JSON","parse","SeamlyBridge","getData","e","console","error","seamlyBridgeData","set","newData","webkit","messageHandlers","seamlyBridge","postMessage","stringify","setData","ReactNativeWebView","target","i","arguments","length","source","init","converter","defaultAttributes","attributes","document","expires","Date","now","toUTCString","encodeURIComponent","replace","decodeURIComponent","escape","stringifiedAttributes","attributeName","split","cookie","write","create","cookies","jar","parts","slice","join","foundKey","read","remove","withAttributes","this","withConverter","freeze","path","cookieStore","KEY","jsonStr","store","candidates","val","sessionStorage","getItem","shift","setItem"],"sourceRoot":""}
|