@openmrs/esm-state 4.2.1-pre.621 → 4.3.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/.turbo/turbo-build.log +11 -11
- package/dist/openmrs-esm-state.js.map +1 -1
- package/package.json +2 -2
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
[
|
|
2
|
-
[
|
|
3
|
-
[
|
|
4
|
-
[
|
|
5
|
-
[
|
|
6
|
-
[
|
|
7
|
-
[
|
|
8
|
-
[
|
|
9
|
-
[
|
|
10
|
-
[
|
|
11
|
-
[
|
|
1
|
+
[34m@openmrs/esm-state:build[0m: cache hit, replaying output [2m9524af69bd476112[0m
|
|
2
|
+
[34m@openmrs/esm-state:build: [0masset [1m[32mopenmrs-esm-state.js[39m[22m 2.93 KiB [1m[32m[emitted][39m[22m [1m[32m[minimized][39m[22m (name: main) 1 related asset
|
|
3
|
+
[34m@openmrs/esm-state:build: [0mruntime modules 1.76 KiB 6 modules
|
|
4
|
+
[34m@openmrs/esm-state:build: [0morphan modules 2.79 KiB [1m[33m[orphan][39m[22m 2 modules
|
|
5
|
+
[34m@openmrs/esm-state:build: [0mcacheable modules 6.09 KiB
|
|
6
|
+
[34m@openmrs/esm-state:build: [0m modules by path [1m../../../node_modules/systemjs-webpack-interop/auto-public-path/*.js[39m[22m 935 bytes
|
|
7
|
+
[34m@openmrs/esm-state:build: [0m [1m../../../node_modules/systemjs-webpack-interop/auto-public-path/1.js[39m[22m 89 bytes [1m[33m[built][39m[22m [1m[33m[code generated][39m[22m
|
|
8
|
+
[34m@openmrs/esm-state:build: [0m [1m../../../node_modules/systemjs-webpack-interop/auto-public-path/auto-public-path.js[39m[22m 846 bytes [1m[33m[built][39m[22m [1m[33m[code generated][39m[22m
|
|
9
|
+
[34m@openmrs/esm-state:build: [0m [1m./src/index.ts + 2 modules[39m[22m 2.82 KiB [1m[33m[built][39m[22m [1m[33m[code generated][39m[22m
|
|
10
|
+
[34m@openmrs/esm-state:build: [0m [1m../../../node_modules/systemjs-webpack-interop/public-path.js[39m[22m 2.36 KiB [1m[33m[built][39m[22m [1m[33m[code generated][39m[22m
|
|
11
|
+
[34m@openmrs/esm-state:build: [0mwebpack 5.77.0 compiled [1m[32msuccessfully[39m[22m in 15024 ms
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openmrs-esm-state.js","mappings":"yFAAA,MAAMA,EAAmB,SAEzBC,EAAQ,EAAiB,SAAwBC,GAY7C,GAXGA,IACHA,EAAe,IAUV,IAAmBC,OAAS,IAAmBA,KAAKC,IAEvD,MADAC,QAAQC,MAAM,qBAAsB,KAC9BC,MACJ,uHAIJ,IAA0BP,EACxB,IAAmBG,KAAKC,IACxBF,EAGN,C,gBCoDAD,EAAQ,EAlCR,SAA0BO,EAAWC,GAKnC,IAAIC,EAAIC,SAASC,cAAc,KAC/BF,EAAEG,KAAOL,EAKT,IAHA,IAAIM,EAA6B,MAAlBJ,EAAEI,SAAS,GAAaJ,EAAEI,SAAW,IAAMJ,EAAEI,SACxDC,EAAmB,EACrBC,EAAQF,EAASG,OACZF,IAAqBN,GAAsBO,GAAS,GAE5C,MADFF,IAAWE,IAEpBD,IAIJ,GAAIA,IAAqBN,EACvB,MAAMF,MACJ,iDACEE,EACA,gDACAM,EACA,qBACAP,GAIN,IAAIU,EAAYJ,EAASK,MAAM,EAAGH,EAAQ,GAE1C,OAAON,EAAEU,SAAW,KAAOV,EAAEW,KAAOH,CACtC,EAMEI,OAAOC,S,GCjFLC,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAa1B,QAGrB,IAAI4B,EAASL,EAAyBE,GAAY,CAGjDzB,QAAS,CAAC,GAOX,OAHA6B,EAAoBJ,GAAUG,EAAQA,EAAO5B,QAASwB,GAG/CI,EAAO5B,OACf,CCtBAwB,EAAoBM,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ACtB3B,MAAO+B,EACPD,QAAQ,GAGHC,CAEX,CAUO,SAASE,EACdN,EACAO,GAEA,IAAML,EAAYJ,EAAgBE,GAElC,IAAKE,EAAW,CACd,IAAME,EAAQC,EAAYE,GAK1B,OAJAT,EAAgBE,GAAQ,CACtB3B,MAAO+B,EACPD,QAAQ,GAEHC,CACT,CAEA,OAAOF,EAAU7B,KACnB,CAOO,SAASmC,EAAeP,GAC7B,OAAOF,EAAkB,MAAOE,EAClC,CAKO,SAASQ,IACd,OAAOH,EAAyB,MAAO,CAAC,EAC1C,CAEO,SAASI,EACdN,EACAO,EACAC,GAEA,IAAIC,EAAWF,EAAOP,EAAMP,YAE5B,OAAOO,EAAMT,WAAU,SAACmB,GACtB,IAAMC,EAAUJ,EAAOG,GAEnBC,IAAYF,IACdA,EAAWE,EACXH,EAAOG,GAEX,GACF,C","sources":["webpack://@openmrs/esm-state/../../../node_modules/systemjs-webpack-interop/auto-public-path/auto-public-path.js","webpack://@openmrs/esm-state/../../../node_modules/systemjs-webpack-interop/public-path.js","webpack://@openmrs/esm-state/webpack/bootstrap","webpack://@openmrs/esm-state/webpack/runtime/__system_context__","webpack://@openmrs/esm-state/webpack/runtime/define property getters","webpack://@openmrs/esm-state/webpack/runtime/global","webpack://@openmrs/esm-state/webpack/runtime/hasOwnProperty shorthand","webpack://@openmrs/esm-state/webpack/runtime/make namespace object","webpack://@openmrs/esm-state/webpack/runtime/publicPath","webpack://@openmrs/esm-state/../../../node_modules/systemjs-webpack-interop/auto-public-path/1.js","webpack://@openmrs/esm-state/../../../node_modules/unistore/dist/unistore.es.js","webpack://@openmrs/esm-state/./src/state.ts"],"sourcesContent":["const resolveDirectory = require(\"../public-path\").resolveDirectory;\n\nexports.autoPublicPath = function autoPublicPath(rootDirLevel) {\n if (!rootDirLevel) {\n rootDirLevel = 1;\n }\n\n if (typeof __webpack_public_path__ !== \"undefined\") {\n if (typeof __system_context__ === \"undefined\") {\n throw Error(\n \"systemjs-webpack-interop requires webpack@>=5.0.0-beta.15 and output.libraryTarget set to 'system'\"\n );\n }\n\n if (!__system_context__.meta || !__system_context__.meta.url) {\n console.error(\"__system_context__\", __system_context__);\n throw Error(\n \"systemjs-webpack-interop was provided an unknown SystemJS context. Expected context.meta.url, but none was provided\"\n );\n }\n\n __webpack_public_path__ = resolveDirectory(\n __system_context__.meta.url,\n rootDirLevel\n );\n }\n};\n","exports.setPublicPath = function setPublicPath(\n systemjsModuleName,\n rootDirectoryLevel\n) {\n if (!rootDirectoryLevel) {\n rootDirectoryLevel = 1;\n }\n if (\n typeof systemjsModuleName !== \"string\" ||\n systemjsModuleName.trim().length === 0\n ) {\n throw Error(\n \"systemjs-webpack-interop: setPublicPath(systemjsModuleName) must be called with a non-empty string 'systemjsModuleName'\"\n );\n }\n\n if (\n typeof rootDirectoryLevel !== \"number\" ||\n rootDirectoryLevel <= 0 ||\n isNaN(rootDirectoryLevel) ||\n !isInteger(rootDirectoryLevel)\n ) {\n throw Error(\n \"systemjs-webpack-interop: setPublicPath(systemjsModuleName, rootDirectoryLevel) must be called with a positive integer 'rootDirectoryLevel'\"\n );\n }\n\n var moduleUrl;\n try {\n moduleUrl = window.System.resolve(systemjsModuleName);\n if (!moduleUrl) {\n throw Error();\n }\n } catch (err) {\n throw Error(\n \"systemjs-webpack-interop: There is no such module '\" +\n systemjsModuleName +\n \"' in the SystemJS registry. Did you misspell the name of your module?\"\n );\n }\n\n __webpack_public_path__ = resolveDirectory(moduleUrl, rootDirectoryLevel);\n};\n\nfunction resolveDirectory(urlString, rootDirectoryLevel) {\n // Our friend IE11 doesn't support new URL()\n // https://github.com/single-spa/single-spa/issues/612\n // https://gist.github.com/jlong/2428561\n\n var a = document.createElement(\"a\");\n a.href = urlString;\n\n var pathname = a.pathname[0] === \"/\" ? a.pathname : \"/\" + a.pathname;\n var numDirsProcessed = 0,\n index = pathname.length;\n while (numDirsProcessed !== rootDirectoryLevel && index >= 0) {\n var char = pathname[--index];\n if (char === \"/\") {\n numDirsProcessed++;\n }\n }\n\n if (numDirsProcessed !== rootDirectoryLevel) {\n throw Error(\n \"systemjs-webpack-interop: rootDirectoryLevel (\" +\n rootDirectoryLevel +\n \") is greater than the number of directories (\" +\n numDirsProcessed +\n \") in the URL path \" +\n urlString\n );\n }\n\n var finalPath = pathname.slice(0, index + 1);\n\n return a.protocol + \"//\" + a.host + finalPath;\n}\n\nexports.resolveDirectory = resolveDirectory;\n\n// borrowed from https://github.com/parshap/js-is-integer/blob/master/index.js\nvar isInteger =\n Number.isInteger ||\n function isInteger(val) {\n return typeof val === \"number\" && isFinite(val) && Math.floor(val) === val;\n };\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","__webpack_require__.y = __system_context__;","// 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__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\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};","var scriptUrl;\nif (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \"\";\nvar document = __webpack_require__.g.document;\nif (!scriptUrl && document) {\n\tif (document.currentScript)\n\t\tscriptUrl = document.currentScript.src\n\tif (!scriptUrl) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tif(scripts.length) scriptUrl = scripts[scripts.length - 1].src\n\t}\n}\n// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration\n// or pass an empty string (\"\") and set the __webpack_public_path__ variable from your code to use your own logic.\nif (!scriptUrl) throw new Error(\"Automatic publicPath is not supported in this browser\");\nscriptUrl = scriptUrl.replace(/#.*$/, \"\").replace(/\\?.*$/, \"\").replace(/\\/[^\\/]+$/, \"/\");\n__webpack_require__.p = scriptUrl;","const autoPublicPath = require(\"./auto-public-path\").autoPublicPath;\n\nautoPublicPath(1);\n","function n(n,t){for(var r in t)n[r]=t[r];return n}export default function(t){var r=[];function u(n){for(var t=[],u=0;u<r.length;u++)r[u]===n?n=null:t.push(r[u]);r=t}function e(u,e,f){t=e?u:n(n({},t),u);for(var i=r,o=0;o<i.length;o++)i[o](t,f)}return t=t||{},{action:function(n){function r(t){e(t,!1,n)}return function(){for(var u=arguments,e=[t],f=0;f<arguments.length;f++)e.push(u[f]);var i=n.apply(this,e);if(null!=i)return i.then?i.then(r):r(i)}},setState:e,subscribe:function(n){return r.push(n),function(){u(n)}},unsubscribe:u,getState:function(){return t}}}\n//# sourceMappingURL=unistore.es.js.map\n","/** @module @category Store */\nimport createStore, { Store } from \"unistore\";\n\ninterface StoreEntity {\n value: Store<any>;\n active: boolean;\n}\n\nconst availableStores: Record<string, StoreEntity> = {};\n\n/**\n * Creates a Unistore [store](https://github.com/developit/unistore#store).\n *\n * @param name A name by which the store can be looked up later.\n * Must be unique across the entire application.\n * @param initialState An object which will be the initial state of the store.\n * @returns The newly created store.\n */\nexport function createGlobalStore<TState>(\n name: string,\n initialState: TState\n): Store<TState> {\n const available = availableStores[name];\n\n if (available) {\n if (available.active) {\n console.error(\n \"Cannot override an existing store. Make sure that stores are only created once.\"\n );\n } else {\n available.value.setState(initialState, true);\n }\n\n available.active = true;\n return available.value;\n } else {\n const store = createStore(initialState);\n\n availableStores[name] = {\n value: store,\n active: true,\n };\n\n return store;\n }\n}\n\n/**\n * Returns the existing [store](https://github.com/developit/unistore#store) named `name`,\n * or creates a new store named `name` if none exists.\n *\n * @param name The name of the store to look up.\n * @param fallbackState The initial value of the new store if no store named `name` exists.\n * @returns The found or newly created store.\n */\nexport function getGlobalStore<TState = any>(\n name: string,\n fallbackState?: TState\n): Store<TState> {\n const available = availableStores[name];\n\n if (!available) {\n const store = createStore(fallbackState);\n availableStores[name] = {\n value: store,\n active: false,\n };\n return store;\n }\n\n return available.value;\n}\n\nexport interface AppState {}\n\n/**\n * @internal\n */\nexport function createAppState(initialState: AppState) {\n return createGlobalStore(\"app\", initialState);\n}\n\n/**\n * @returns The [store](https://github.com/developit/unistore#store) named `app`.\n */\nexport function getAppState() {\n return getGlobalStore<AppState>(\"app\", {});\n}\n\nexport function subscribeTo<T, U>(\n store: Store<T>,\n select: (state: T) => U,\n handle: (subState: U) => void\n) {\n let previous = select(store.getState());\n\n return store.subscribe((state) => {\n const current = select(state);\n\n if (current !== previous) {\n previous = current;\n handle(current);\n }\n });\n}\n"],"names":["resolveDirectory","exports","rootDirLevel","meta","url","console","error","Error","urlString","rootDirectoryLevel","a","document","createElement","href","pathname","numDirsProcessed","index","length","finalPath","slice","protocol","host","Number","isInteger","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","module","__webpack_modules__","y","__system_context__","d","definition","key","o","Object","defineProperty","enumerable","get","g","globalThis","this","Function","e","window","obj","prop","prototype","hasOwnProperty","call","r","Symbol","toStringTag","value","scriptUrl","importScripts","location","currentScript","src","scripts","getElementsByTagName","replace","p","autoPublicPath","n","t","u","push","f","i","action","arguments","apply","then","setState","subscribe","unsubscribe","getState","availableStores","createGlobalStore","name","initialState","available","active","store","createStore","getGlobalStore","fallbackState","createAppState","getAppState","subscribeTo","select","handle","previous","state","current"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"openmrs-esm-state.js","mappings":"yFAAA,MAAMA,EAAmB,SAEzBC,EAAQ,EAAiB,SAAwBC,GAY7C,GAXGA,IACHA,EAAe,IAUV,IAAmBC,OAAS,IAAmBA,KAAKC,IAEvD,MADAC,QAAQC,MAAM,qBAAsB,KAC9BC,MACJ,uHAIJ,IAA0BP,EACxB,IAAmBG,KAAKC,IACxBF,EAGN,C,gBCoDAD,EAAQ,EAlCR,SAA0BO,EAAWC,GAKnC,IAAIC,EAAIC,SAASC,cAAc,KAC/BF,EAAEG,KAAOL,EAKT,IAHA,IAAIM,EAA6B,MAAlBJ,EAAEI,SAAS,GAAaJ,EAAEI,SAAW,IAAMJ,EAAEI,SACxDC,EAAmB,EACrBC,EAAQF,EAASG,OACZF,IAAqBN,GAAsBO,GAAS,GAE5C,MADFF,IAAWE,IAEpBD,IAIJ,GAAIA,IAAqBN,EACvB,MAAMF,MACJ,iDACEE,EACA,gDACAM,EACA,qBACAP,GAIN,IAAIU,EAAYJ,EAASK,MAAM,EAAGH,EAAQ,GAE1C,OAAON,EAAEU,SAAW,KAAOV,EAAEW,KAAOH,CACtC,EAMEI,OAAOC,S,GCjFLC,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAa1B,QAGrB,IAAI4B,EAASL,EAAyBE,GAAY,CAGjDzB,QAAS,CAAC,GAOX,OAHA6B,EAAoBJ,GAAUG,EAAQA,EAAO5B,QAASwB,GAG/CI,EAAO5B,OACf,CCtBAwB,EAAoBM,EAAIC,ECCxBP,EAAoBQ,EAAI,CAAChC,EAASiC,KACjC,IAAI,IAAIC,KAAOD,EACXT,EAAoBW,EAAEF,EAAYC,KAASV,EAAo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W,CACd,IAAME,EAAQC,EAAYE,GAK1B,OAJAT,EAAgBE,GAAQ,CACtB3B,MAAO+B,EACPD,QAAQ,GAEHC,CACT,CAEA,OAAOF,EAAU7B,KACnB,CAOO,SAASmC,EAAeP,GAC7B,OAAOF,EAAkB,MAAOE,EAClC,CAKO,SAASQ,IACd,OAAOH,EAAyB,MAAO,CAAC,EAC1C,CAEO,SAASI,EACdN,EACAO,EACAC,GAEA,IAAIC,EAAWF,EAAOP,EAAMP,YAE5B,OAAOO,EAAMT,WAAU,SAACmB,GACtB,IAAMC,EAAUJ,EAAOG,GAEnBC,IAAYF,IACdA,EAAWE,EACXH,EAAOG,GAEX,GACF,C","sources":["webpack://@openmrs/esm-state/../../../node_modules/systemjs-webpack-interop/auto-public-path/auto-public-path.js","webpack://@openmrs/esm-state/../../../node_modules/systemjs-webpack-interop/public-path.js","webpack://@openmrs/esm-state/webpack/bootstrap","webpack://@openmrs/esm-state/webpack/runtime/__system_context__","webpack://@openmrs/esm-state/webpack/runtime/define property getters","webpack://@openmrs/esm-state/webpack/runtime/global","webpack://@openmrs/esm-state/webpack/runtime/hasOwnProperty shorthand","webpack://@openmrs/esm-state/webpack/runtime/make namespace object","webpack://@openmrs/esm-state/webpack/runtime/publicPath","webpack://@openmrs/esm-state/../../../node_modules/systemjs-webpack-interop/auto-public-path/1.js","webpack://@openmrs/esm-state/../../../node_modules/unistore/dist/unistore.es.js","webpack://@openmrs/esm-state/./src/state.ts"],"sourcesContent":["const resolveDirectory = require(\"../public-path\").resolveDirectory;\n\nexports.autoPublicPath = function autoPublicPath(rootDirLevel) {\n if (!rootDirLevel) {\n rootDirLevel = 1;\n }\n\n if (typeof __webpack_public_path__ !== \"undefined\") {\n if (typeof __system_context__ === \"undefined\") {\n throw Error(\n \"systemjs-webpack-interop requires webpack@>=5.0.0-beta.15 and output.libraryTarget set to 'system'\"\n );\n }\n\n if (!__system_context__.meta || !__system_context__.meta.url) {\n console.error(\"__system_context__\", __system_context__);\n throw Error(\n \"systemjs-webpack-interop was provided an unknown SystemJS context. Expected context.meta.url, but none was provided\"\n );\n }\n\n __webpack_public_path__ = resolveDirectory(\n __system_context__.meta.url,\n rootDirLevel\n );\n }\n};\n","exports.setPublicPath = function setPublicPath(\n systemjsModuleName,\n rootDirectoryLevel\n) {\n if (!rootDirectoryLevel) {\n rootDirectoryLevel = 1;\n }\n if (\n typeof systemjsModuleName !== \"string\" ||\n systemjsModuleName.trim().length === 0\n ) {\n throw Error(\n \"systemjs-webpack-interop: setPublicPath(systemjsModuleName) must be called with a non-empty string 'systemjsModuleName'\"\n );\n }\n\n if (\n typeof rootDirectoryLevel !== \"number\" ||\n rootDirectoryLevel <= 0 ||\n isNaN(rootDirectoryLevel) ||\n !isInteger(rootDirectoryLevel)\n ) {\n throw Error(\n \"systemjs-webpack-interop: setPublicPath(systemjsModuleName, rootDirectoryLevel) must be called with a positive integer 'rootDirectoryLevel'\"\n );\n }\n\n var moduleUrl;\n try {\n moduleUrl = window.System.resolve(systemjsModuleName);\n if (!moduleUrl) {\n throw Error();\n }\n } catch (err) {\n throw Error(\n \"systemjs-webpack-interop: There is no such module '\" +\n systemjsModuleName +\n \"' in the SystemJS registry. Did you misspell the name of your module?\"\n );\n }\n\n __webpack_public_path__ = resolveDirectory(moduleUrl, rootDirectoryLevel);\n};\n\nfunction resolveDirectory(urlString, rootDirectoryLevel) {\n // Our friend IE11 doesn't support new URL()\n // https://github.com/single-spa/single-spa/issues/612\n // https://gist.github.com/jlong/2428561\n\n var a = document.createElement(\"a\");\n a.href = urlString;\n\n var pathname = a.pathname[0] === \"/\" ? a.pathname : \"/\" + a.pathname;\n var numDirsProcessed = 0,\n index = pathname.length;\n while (numDirsProcessed !== rootDirectoryLevel && index >= 0) {\n var char = pathname[--index];\n if (char === \"/\") {\n numDirsProcessed++;\n }\n }\n\n if (numDirsProcessed !== rootDirectoryLevel) {\n throw Error(\n \"systemjs-webpack-interop: rootDirectoryLevel (\" +\n rootDirectoryLevel +\n \") is greater than the number of directories (\" +\n numDirsProcessed +\n \") in the URL path \" +\n urlString\n );\n }\n\n var finalPath = pathname.slice(0, index + 1);\n\n return a.protocol + \"//\" + a.host + finalPath;\n}\n\nexports.resolveDirectory = resolveDirectory;\n\n// borrowed from https://github.com/parshap/js-is-integer/blob/master/index.js\nvar isInteger =\n Number.isInteger ||\n function isInteger(val) {\n return typeof val === \"number\" && isFinite(val) && Math.floor(val) === val;\n };\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","__webpack_require__.y = __system_context__;","// 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__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\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};","var scriptUrl;\nif (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \"\";\nvar document = __webpack_require__.g.document;\nif (!scriptUrl && document) {\n\tif (document.currentScript)\n\t\tscriptUrl = document.currentScript.src;\n\tif (!scriptUrl) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tif(scripts.length) scriptUrl = scripts[scripts.length - 1].src\n\t}\n}\n// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration\n// or pass an empty string (\"\") and set the __webpack_public_path__ variable from your code to use your own logic.\nif (!scriptUrl) throw new Error(\"Automatic publicPath is not supported in this browser\");\nscriptUrl = scriptUrl.replace(/#.*$/, \"\").replace(/\\?.*$/, \"\").replace(/\\/[^\\/]+$/, \"/\");\n__webpack_require__.p = scriptUrl;","const autoPublicPath = require(\"./auto-public-path\").autoPublicPath;\n\nautoPublicPath(1);\n","function n(n,t){for(var r in t)n[r]=t[r];return n}export default function(t){var r=[];function u(n){for(var t=[],u=0;u<r.length;u++)r[u]===n?n=null:t.push(r[u]);r=t}function e(u,e,f){t=e?u:n(n({},t),u);for(var i=r,o=0;o<i.length;o++)i[o](t,f)}return t=t||{},{action:function(n){function r(t){e(t,!1,n)}return function(){for(var u=arguments,e=[t],f=0;f<arguments.length;f++)e.push(u[f]);var i=n.apply(this,e);if(null!=i)return i.then?i.then(r):r(i)}},setState:e,subscribe:function(n){return r.push(n),function(){u(n)}},unsubscribe:u,getState:function(){return t}}}\n//# sourceMappingURL=unistore.es.js.map\n","/** @module @category Store */\nimport createStore, { Store } from \"unistore\";\n\ninterface StoreEntity {\n value: Store<any>;\n active: boolean;\n}\n\nconst availableStores: Record<string, StoreEntity> = {};\n\n/**\n * Creates a Unistore [store](https://github.com/developit/unistore#store).\n *\n * @param name A name by which the store can be looked up later.\n * Must be unique across the entire application.\n * @param initialState An object which will be the initial state of the store.\n * @returns The newly created store.\n */\nexport function createGlobalStore<TState>(\n name: string,\n initialState: TState\n): Store<TState> {\n const available = availableStores[name];\n\n if (available) {\n if (available.active) {\n console.error(\n \"Cannot override an existing store. Make sure that stores are only created once.\"\n );\n } else {\n available.value.setState(initialState, true);\n }\n\n available.active = true;\n return available.value;\n } else {\n const store = createStore(initialState);\n\n availableStores[name] = {\n value: store,\n active: true,\n };\n\n return store;\n }\n}\n\n/**\n * Returns the existing [store](https://github.com/developit/unistore#store) named `name`,\n * or creates a new store named `name` if none exists.\n *\n * @param name The name of the store to look up.\n * @param fallbackState The initial value of the new store if no store named `name` exists.\n * @returns The found or newly created store.\n */\nexport function getGlobalStore<TState = any>(\n name: string,\n fallbackState?: TState\n): Store<TState> {\n const available = availableStores[name];\n\n if (!available) {\n const store = createStore(fallbackState);\n availableStores[name] = {\n value: store,\n active: false,\n };\n return store;\n }\n\n return available.value;\n}\n\nexport interface AppState {}\n\n/**\n * @internal\n */\nexport function createAppState(initialState: AppState) {\n return createGlobalStore(\"app\", initialState);\n}\n\n/**\n * @returns The [store](https://github.com/developit/unistore#store) named `app`.\n */\nexport function getAppState() {\n return getGlobalStore<AppState>(\"app\", {});\n}\n\nexport function subscribeTo<T, U>(\n store: Store<T>,\n select: (state: T) => U,\n handle: (subState: U) => void\n) {\n let previous = select(store.getState());\n\n return store.subscribe((state) => {\n const current = select(state);\n\n if (current !== previous) {\n previous = current;\n handle(current);\n }\n });\n}\n"],"names":["resolveDirectory","exports","rootDirLevel","meta","url","console","error","Error","urlString","rootDirectoryLevel","a","document","createElement","href","pathname","numDirsProcessed","index","length","finalPath","slice","protocol","host","Number","isInteger","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","module","__webpack_modules__","y","__system_context__","d","definition","key","o","Object","defineProperty","enumerable","get","g","globalThis","this","Function","e","window","obj","prop","prototype","hasOwnProperty","call","r","Symbol","toStringTag","value","scriptUrl","importScripts","location","currentScript","src","scripts","getElementsByTagName","replace","p","autoPublicPath","n","t","u","push","f","i","action","arguments","apply","then","setState","subscribe","unsubscribe","getState","availableStores","createGlobalStore","name","initialState","available","active","store","createStore","getGlobalStore","fallbackState","createAppState","getAppState","subscribeTo","select","handle","previous","state","current"],"sourceRoot":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openmrs/esm-state",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.3.0",
|
|
4
4
|
"license": "MPL-2.0",
|
|
5
5
|
"description": "Frontend stores & state management for OpenMRS",
|
|
6
6
|
"browser": "dist/openmrs-esm-state.js",
|
|
@@ -38,5 +38,5 @@
|
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"unistore": "^3.5.2"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "839d51d2e28c9965be63d2a671d6e8ceed6ffb9e"
|
|
42
42
|
}
|