@lvble/react 2.0.71 → 2.0.72
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/_bundles/react.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! For license information please see react.js.LICENSE.txt */
|
|
2
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@lvble/core"),require("react")):"function"==typeof define&&define.amd?define("MyLib",["@lvble/core","React"],t):"object"==typeof exports?exports.MyLib=t(require("@lvble/core"),require("react")):e.MyLib=t(e["@lvble/core"],e.React)}(self,((e,t)=>(()=>{"use strict";var r={354:(e,t,r)=>{var o=r(639),n=Symbol.for("react.element"),i=Symbol.for("react.fragment"),l=Object.prototype.hasOwnProperty,u=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function s(e,t,r){var o,i={},s=null,a=null;for(o in void 0!==r&&(s=""+r),void 0!==t.key&&(s=""+t.key),void 0!==t.ref&&(a=t.ref),t)l.call(t,o)&&!c.hasOwnProperty(o)&&(i[o]=t[o]);if(e&&e.defaultProps)for(o in t=e.defaultProps)void 0===i[o]&&(i[o]=t[o]);return{$$typeof:n,type:e,key:s,ref:a,props:i,_owner:u.current}}t.Fragment=i,t.jsx=s,t.jsxs=s},527:(e,t,r)=>{e.exports=r(354)},862:function(e,t,r){var o=this&&this.__createBinding||(Object.create?function(e,t,r,o){void 0===o&&(o=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,o,n)}:function(e,t,r,o){void 0===o&&(o=r),e[o]=t[r]}),n=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||o(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),n(r(93),t)},93:function(e,t,r){var o=this&&this.__rest||function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(e);n<o.length;n++)t.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(e,o[n])&&(r[o[n]]=e[o[n]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.LvbleWidget=void 0;const n=r(527),i=r(639),l=r(291);t.LvbleWidget=(0,i.memo)((e=>{var{token:t}=e,r=o(e,["token"]);const{lvble:u}=(0,l.useLvbleContext)(),c=(0,i.useMemo)((()=>null==u?void 0:u.createWidget({token:t})),[u,t]);return(0,n.jsx)("div",Object.assign({style:{minHeight:"
|
|
2
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@lvble/core"),require("react")):"function"==typeof define&&define.amd?define("MyLib",["@lvble/core","React"],t):"object"==typeof exports?exports.MyLib=t(require("@lvble/core"),require("react")):e.MyLib=t(e["@lvble/core"],e.React)}(self,((e,t)=>(()=>{"use strict";var r={354:(e,t,r)=>{var o=r(639),n=Symbol.for("react.element"),i=Symbol.for("react.fragment"),l=Object.prototype.hasOwnProperty,u=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function s(e,t,r){var o,i={},s=null,a=null;for(o in void 0!==r&&(s=""+r),void 0!==t.key&&(s=""+t.key),void 0!==t.ref&&(a=t.ref),t)l.call(t,o)&&!c.hasOwnProperty(o)&&(i[o]=t[o]);if(e&&e.defaultProps)for(o in t=e.defaultProps)void 0===i[o]&&(i[o]=t[o]);return{$$typeof:n,type:e,key:s,ref:a,props:i,_owner:u.current}}t.Fragment=i,t.jsx=s,t.jsxs=s},527:(e,t,r)=>{e.exports=r(354)},862:function(e,t,r){var o=this&&this.__createBinding||(Object.create?function(e,t,r,o){void 0===o&&(o=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,o,n)}:function(e,t,r,o){void 0===o&&(o=r),e[o]=t[r]}),n=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||o(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),n(r(93),t)},93:function(e,t,r){var o=this&&this.__rest||function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(e);n<o.length;n++)t.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(e,o[n])&&(r[o[n]]=e[o[n]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.LvbleWidget=void 0;const n=r(527),i=r(639),l=r(291);t.LvbleWidget=(0,i.memo)((e=>{var{token:t}=e,r=o(e,["token"]);const{lvble:u}=(0,l.useLvbleContext)(),c=(0,i.useMemo)((()=>null==u?void 0:u.createWidget({token:t})),[u,t]);return(0,n.jsx)("div",Object.assign({style:{minHeight:"250px",width:"100%",height:"100%"},ref:e=>{if(c){for(;null==e?void 0:e.firstChild;)null==e||e.removeChild(null==e?void 0:e.firstChild);null==e||e.appendChild(c)}}},r))}))},291:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.useLvbleContext=t.LvbleProvider=void 0;const o=r(527),n=r(639),i=r(54),l=(0,n.createContext)(null);t.LvbleProvider=({environment:e,onEvent:t,modal:r,customApiUrl:u,children:c})=>{const s=(0,n.useMemo)((()=>{if(e)return(0,i.Lvble)({environment:e,onEvent:t,modal:r,customApiUrl:u})}),[e,t,r,u]);return(0,o.jsx)(l.Provider,{value:{lvble:s},children:c})},t.useLvbleContext=()=>{const e=(0,n.useContext)(l);if(null==e)throw new Error("useLvbleContext must be used within a LvbleProvider");return e}},887:function(e,t,r){var o=this&&this.__createBinding||(Object.create?function(e,t,r,o){void 0===o&&(o=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,o,n)}:function(e,t,r,o){void 0===o&&(o=r),e[o]=t[r]}),n=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||o(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.Environment=void 0;const i=r(54);n(r(862),t),n(r(291),t),t.Environment=i.Environment},54:t=>{t.exports=e},639:e=>{e.exports=t}},o={};return function e(t){var n=o[t];if(void 0!==n)return n.exports;var i=o[t]={exports:{}};return r[t].call(i.exports,i,i.exports,e),i.exports}(887)})()));
|
|
3
3
|
//# sourceMappingURL=react.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react.js","mappings":";CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,EAAQG,QAAQ,eAAgBA,QAAQ,UAChC,mBAAXC,QAAyBA,OAAOC,IAC9CD,OAAO,QAAS,CAAC,cAAe,SAAUJ,GAChB,iBAAZC,QACdA,QAAe,MAAID,EAAQG,QAAQ,eAAgBA,QAAQ,UAE3DJ,EAAY,MAAIC,EAAQD,EAAK,eAAgBA,EAAY,MAC1D,CATD,CASGO,MAAM,CAACC,EAAiCC,4CCA9B,IAAIC,EAAE,EAAQ,KAASC,EAAEC,OAAOC,IAAI,iBAAiBC,EAAEF,OAAOC,IAAI,kBAAkBE,EAAEC,OAAOC,UAAUC,eAAeC,EAAET,EAAEU,mDAAmDC,kBAAkBC,EAAE,CAACC,KAAI,EAAGC,KAAI,EAAGC,QAAO,EAAGC,UAAS,GAChP,SAASC,EAAEC,EAAEC,EAAEC,GAAG,IAAIC,EAAEC,EAAE,CAAC,EAAEC,EAAE,KA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H,EAAaC,EAASC,EAAOC,IAEjC,OACE,SAACN,EAAaS,SAAQ,CAACC,MAAO,CAAEtB,SAAO,SAAGmB,GAC3C,EAGU,EAAAlB,gBAAkB,KAC7B,MAAMsB,GAAU,IAAAC,YAAWZ,GAC3B,GAAIW,QACF,MAAM,IAAIE,MAAM,uDAElB,OAAOF,CAAO,ihBCvDhB,cAEA,YACA,YACa,EAAAG,YAAc,sBCJ3BvE,EAAOD,QAAUM,WCAjBL,EAAOD,QAAUO,ICCbkE,EAA2B,CAAC,SAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAa5E,QAGrB,IAAIC,EAASwE,EAAyBE,GAAY,CAGjD3E,QAAS,CAAC,GAOX,OAHA8E,EAAoBH,GAAU1C,KAAKhC,EAAOD,QAASC,EAAQA,EAAOD,QAAS0E,GAGpEzE,EAAOD,OACf,CCnB0B0E,CAAoB","sources":["webpack://MyLib/webpack/universalModuleDefinition","webpack://MyLib/./node_modules/.pnpm/react@18.2.0/node_modules/react/cjs/react-jsx-runtime.production.min.js","webpack://MyLib/./node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.js","webpack://MyLib/./src/lib/components/index.ts","webpack://MyLib/./src/lib/components/lvble/index.tsx","webpack://MyLib/./src/lib/context.tsx","webpack://MyLib/./src/lib/index.ts","webpack://MyLib/external umd {\"commonjs\":\"@lvble/core\",\"commonjs2\":\"@lvble/core\",\"amd\":\"@lvble/core\",\"root\":\"@lvble/core\"}","webpack://MyLib/external umd {\"commonjs\":\"react\",\"commonjs2\":\"react\",\"amd\":\"React\",\"root\":\"React\"}","webpack://MyLib/webpack/bootstrap","webpack://MyLib/webpack/startup"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"@lvble/core\"), require(\"react\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"MyLib\", [\"@lvble/core\", \"React\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"MyLib\"] = factory(require(\"@lvble/core\"), require(\"react\"));\n\telse\n\t\troot[\"MyLib\"] = factory(root[\"@lvble/core\"], root[\"React\"]);\n})(self, (__WEBPACK_EXTERNAL_MODULE__54__, __WEBPACK_EXTERNAL_MODULE__639__) => {\nreturn ","/**\n * @license React\n * react-jsx-runtime.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var f=require(\"react\"),k=Symbol.for(\"react.element\"),l=Symbol.for(\"react.fragment\"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};\nfunction q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=\"\"+g);void 0!==a.key&&(e=\"\"+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}exports.Fragment=l;exports.jsx=q;exports.jsxs=q;\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.min.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n","export * from \"./lvble\";\n","import React, { memo, useMemo } from \"react\";\nimport { useLvbleContext } from \"../../context\";\n\nexport type LvbleWidgetProps = {\n token: string;\n} & React.HTMLAttributes<HTMLDivElement>;\n\nexport const LvbleWidget = memo(({ token, ...props }: LvbleWidgetProps) => {\n const { lvble } = useLvbleContext();\n const widget = useMemo(() => lvble?.createWidget({ token }), [lvble, token]);\n return (\n <div style={{ minHeight: \"
|
|
1
|
+
{"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,CAAoB","sources":["webpack://MyLib/webpack/universalModuleDefinition","webpack://MyLib/./node_modules/.pnpm/react@18.2.0/node_modules/react/cjs/react-jsx-runtime.production.min.js","webpack://MyLib/./node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.js","webpack://MyLib/./src/lib/components/index.ts","webpack://MyLib/./src/lib/components/lvble/index.tsx","webpack://MyLib/./src/lib/context.tsx","webpack://MyLib/./src/lib/index.ts","webpack://MyLib/external umd {\"commonjs\":\"@lvble/core\",\"commonjs2\":\"@lvble/core\",\"amd\":\"@lvble/core\",\"root\":\"@lvble/core\"}","webpack://MyLib/external umd {\"commonjs\":\"react\",\"commonjs2\":\"react\",\"amd\":\"React\",\"root\":\"React\"}","webpack://MyLib/webpack/bootstrap","webpack://MyLib/webpack/startup"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"@lvble/core\"), require(\"react\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"MyLib\", [\"@lvble/core\", \"React\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"MyLib\"] = factory(require(\"@lvble/core\"), require(\"react\"));\n\telse\n\t\troot[\"MyLib\"] = factory(root[\"@lvble/core\"], root[\"React\"]);\n})(self, (__WEBPACK_EXTERNAL_MODULE__54__, __WEBPACK_EXTERNAL_MODULE__639__) => {\nreturn ","/**\n * @license React\n * react-jsx-runtime.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var f=require(\"react\"),k=Symbol.for(\"react.element\"),l=Symbol.for(\"react.fragment\"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};\nfunction q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=\"\"+g);void 0!==a.key&&(e=\"\"+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}exports.Fragment=l;exports.jsx=q;exports.jsxs=q;\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.min.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n","export * from \"./lvble\";\n","import React, { memo, useMemo } from \"react\";\nimport { useLvbleContext } from \"../../context\";\n\nexport type LvbleWidgetProps = {\n token: string;\n} & React.HTMLAttributes<HTMLDivElement>;\n\nexport const LvbleWidget = memo(({ token, ...props }: LvbleWidgetProps) => {\n const { lvble } = useLvbleContext();\n const widget = useMemo(() => lvble?.createWidget({ token }), [lvble, token]);\n return (\n <div style={{ minHeight: \"250px\", width: \"100%\", height: \"100%\" }}\n ref={(ref) => {\n if (!widget) return;\n while (ref?.firstChild) {\n ref?.removeChild(ref?.firstChild);\n }\n ref?.appendChild(widget);\n }}\n {...props}\n ></div>\n );\n});","import {\n ReactNode,\n useEffect,\n createContext,\n useContext,\n useState,\n useMemo,\n} from \"react\";\nimport {\n type Environment,\n type LvbleType,\n type ModalOptions,\n Lvble,\n} from \"@lvble/core\";\n\ntype LvbleContextType = {\n lvble?: LvbleType;\n};\n\nconst LvbleContext = createContext<LvbleContextType | null | undefined>(null);\n\nexport const LvbleProvider = ({\n environment,\n onEvent,\n modal,\n customApiUrl,\n children,\n}: {\n environment: Environment;\n onEvent: (eventType: string, data: any) => void;\n modal?: ModalOptions;\n customApiUrl?: string | null,\n children: ReactNode;\n}) => {\n const lvble = useMemo(() => {\n if (!environment) return;\n const l = Lvble({\n environment,\n onEvent,\n modal,\n customApiUrl,\n });\n return l;\n }, [environment, onEvent, modal, customApiUrl]);\n\n return (\n <LvbleContext.Provider value={{ lvble }}>{children}</LvbleContext.Provider>\n );\n};\n\nexport const useLvbleContext = () => {\n const context = useContext(LvbleContext);\n if (context === undefined || context === null) {\n throw new Error(\"useLvbleContext must be used within a LvbleProvider\");\n }\n return context;\n};\n","import { Environment as _Environment } from \"@lvble/core\";\n\nexport * from \"./components\";\nexport * from \"./context\";\nexport const Environment = _Environment;\n","module.exports = __WEBPACK_EXTERNAL_MODULE__54__;","module.exports = __WEBPACK_EXTERNAL_MODULE__639__;","// 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].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// startup\n// Load entry module and return exports\n// This entry module is referenced by other modules so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(887);\n"],"names":["root","factory","exports","module","require","define","amd","self","__WEBPACK_EXTERNAL_MODULE__54__","__WEBPACK_EXTERNAL_MODULE__639__","f","k","Symbol","for","l","m","Object","prototype","hasOwnProperty","n","__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED","ReactCurrentOwner","p","key","ref","__self","__source","q","c","a","g","b","d","e","h","call","defaultProps","$$typeof","type","props","_owner","current","Fragment","jsx","jsxs","LvbleWidget","memo","token","lvble","useLvbleContext","widget","useMemo","createWidget","style","minHeight","width","height","firstChild","removeChild","appendChild","LvbleContext","createContext","LvbleProvider","environment","onEvent","modal","customApiUrl","children","Lvble","Provider","value","context","useContext","Error","Environment","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__"],"sourceRoot":""}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! For license information please see react.min.js.LICENSE.txt */
|
|
2
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@lvble/core"),require("react")):"function"==typeof define&&define.amd?define("MyLib",["@lvble/core","React"],t):"object"==typeof exports?exports.MyLib=t(require("@lvble/core"),require("react")):e.MyLib=t(e["@lvble/core"],e.React)}(self,((e,t)=>(()=>{"use strict";var r={354:(e,t,r)=>{var o=r(639),n=Symbol.for("react.element"),i=Symbol.for("react.fragment"),l=Object.prototype.hasOwnProperty,u=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function s(e,t,r){var o,i={},s=null,a=null;for(o in void 0!==r&&(s=""+r),void 0!==t.key&&(s=""+t.key),void 0!==t.ref&&(a=t.ref),t)l.call(t,o)&&!c.hasOwnProperty(o)&&(i[o]=t[o]);if(e&&e.defaultProps)for(o in t=e.defaultProps)void 0===i[o]&&(i[o]=t[o]);return{$$typeof:n,type:e,key:s,ref:a,props:i,_owner:u.current}}t.Fragment=i,t.jsx=s,t.jsxs=s},527:(e,t,r)=>{e.exports=r(354)},862:function(e,t,r){var o=this&&this.__createBinding||(Object.create?function(e,t,r,o){void 0===o&&(o=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,o,n)}:function(e,t,r,o){void 0===o&&(o=r),e[o]=t[r]}),n=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||o(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),n(r(93),t)},93:function(e,t,r){var o=this&&this.__rest||function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(e);n<o.length;n++)t.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(e,o[n])&&(r[o[n]]=e[o[n]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.LvbleWidget=void 0;const n=r(527),i=r(639),l=r(291);t.LvbleWidget=(0,i.memo)((e=>{var{token:t}=e,r=o(e,["token"]);const{lvble:u}=(0,l.useLvbleContext)(),c=(0,i.useMemo)((()=>null==u?void 0:u.createWidget({token:t})),[u,t]);return(0,n.jsx)("div",Object.assign({style:{minHeight:"
|
|
2
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@lvble/core"),require("react")):"function"==typeof define&&define.amd?define("MyLib",["@lvble/core","React"],t):"object"==typeof exports?exports.MyLib=t(require("@lvble/core"),require("react")):e.MyLib=t(e["@lvble/core"],e.React)}(self,((e,t)=>(()=>{"use strict";var r={354:(e,t,r)=>{var o=r(639),n=Symbol.for("react.element"),i=Symbol.for("react.fragment"),l=Object.prototype.hasOwnProperty,u=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function s(e,t,r){var o,i={},s=null,a=null;for(o in void 0!==r&&(s=""+r),void 0!==t.key&&(s=""+t.key),void 0!==t.ref&&(a=t.ref),t)l.call(t,o)&&!c.hasOwnProperty(o)&&(i[o]=t[o]);if(e&&e.defaultProps)for(o in t=e.defaultProps)void 0===i[o]&&(i[o]=t[o]);return{$$typeof:n,type:e,key:s,ref:a,props:i,_owner:u.current}}t.Fragment=i,t.jsx=s,t.jsxs=s},527:(e,t,r)=>{e.exports=r(354)},862:function(e,t,r){var o=this&&this.__createBinding||(Object.create?function(e,t,r,o){void 0===o&&(o=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,o,n)}:function(e,t,r,o){void 0===o&&(o=r),e[o]=t[r]}),n=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||o(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),n(r(93),t)},93:function(e,t,r){var o=this&&this.__rest||function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(e);n<o.length;n++)t.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(e,o[n])&&(r[o[n]]=e[o[n]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.LvbleWidget=void 0;const n=r(527),i=r(639),l=r(291);t.LvbleWidget=(0,i.memo)((e=>{var{token:t}=e,r=o(e,["token"]);const{lvble:u}=(0,l.useLvbleContext)(),c=(0,i.useMemo)((()=>null==u?void 0:u.createWidget({token:t})),[u,t]);return(0,n.jsx)("div",Object.assign({style:{minHeight:"250px",width:"100%",height:"100%"},ref:e=>{if(c){for(;null==e?void 0:e.firstChild;)null==e||e.removeChild(null==e?void 0:e.firstChild);null==e||e.appendChild(c)}}},r))}))},291:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.useLvbleContext=t.LvbleProvider=void 0;const o=r(527),n=r(639),i=r(54),l=(0,n.createContext)(null);t.LvbleProvider=({environment:e,onEvent:t,modal:r,customApiUrl:u,children:c})=>{const s=(0,n.useMemo)((()=>{if(e)return(0,i.Lvble)({environment:e,onEvent:t,modal:r,customApiUrl:u})}),[e,t,r,u]);return(0,o.jsx)(l.Provider,{value:{lvble:s},children:c})},t.useLvbleContext=()=>{const e=(0,n.useContext)(l);if(null==e)throw new Error("useLvbleContext must be used within a LvbleProvider");return e}},887:function(e,t,r){var o=this&&this.__createBinding||(Object.create?function(e,t,r,o){void 0===o&&(o=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,o,n)}:function(e,t,r,o){void 0===o&&(o=r),e[o]=t[r]}),n=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||o(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.Environment=void 0;const i=r(54);n(r(862),t),n(r(291),t),t.Environment=i.Environment},54:t=>{t.exports=e},639:e=>{e.exports=t}},o={};return function e(t){var n=o[t];if(void 0!==n)return n.exports;var i=o[t]={exports:{}};return r[t].call(i.exports,i,i.exports,e),i.exports}(887)})()));
|
|
3
3
|
//# sourceMappingURL=react.min.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react.min.js","mappings":";CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,EAAQG,QAAQ,eAAgBA,QAAQ,UAChC,mBAAXC,QAAyBA,OAAOC,IAC9CD,OAAO,QAAS,CAAC,cAAe,SAAUJ,GAChB,iBAAZC,QACdA,QAAe,MAAID,EAAQG,QAAQ,eAAgBA,QAAQ,UAE3DJ,EAAY,MAAIC,EAAQD,EAAK,eAAgBA,EAAY,MAC1D,CATD,CASGO,MAAM,CAACC,EAAiCC,4CCA9B,IAAIC,EAAE,EAAQ,KAASC,EAAEC,OAAOC,IAAI,iBAAiBC,EAAEF,OAAOC,IAAI,kBAAkBE,EAAEC,OAAOC,UAAUC,eAAeC,EAAET,EAAEU,mDAAmDC,kBAAkBC,EAAE,CAACC,KAAI,EAAGC,KAAI,EAAGC,QAAO,EAAGC,UAAS,GAChP,SAASC,EAAEC,EAAEC,EAAEC,GAAG,IAAIC,EAAEC,EAAE,CAAC,EAAEC,EAAE,KAAKC,EAAE,KAAiF,IAAIH,UAAhF,IAASD,IAAIG,EAAE,GAAGH,QAAG,IAASD,EAAEN,MAAMU,EAAE,GAA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C,EAGU,EAAAlB,gBAAkB,KAC7B,MAAMsB,GAAU,IAAAC,YAAWZ,GAC3B,GAAIW,QACF,MAAM,IAAIE,MAAM,uDAElB,OAAOF,CAAO,ihBCvDhB,cAEA,YACA,YACa,EAAAG,YAAc,sBCJ3BvE,EAAOD,QAAUM,WCAjBL,EAAOD,QAAUO,ICCbkE,EAA2B,CAAC,SAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAa5E,QAGrB,IAAIC,EAASwE,EAAyBE,GAAY,CAGjD3E,QAAS,CAAC,GAOX,OAHA8E,EAAoBH,GAAU1C,KAAKhC,EAAOD,QAASC,EAAQA,EAAOD,QAAS0E,GAGpEzE,EAAOD,OACf,CCnB0B0E,CAAoB","sources":["webpack://MyLib/webpack/universalModuleDefinition","webpack://MyLib/./node_modules/.pnpm/react@18.2.0/node_modules/react/cjs/react-jsx-runtime.production.min.js","webpack://MyLib/./node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.js","webpack://MyLib/./src/lib/components/index.ts","webpack://MyLib/./src/lib/components/lvble/index.tsx","webpack://MyLib/./src/lib/context.tsx","webpack://MyLib/./src/lib/index.ts","webpack://MyLib/external umd {\"commonjs\":\"@lvble/core\",\"commonjs2\":\"@lvble/core\",\"amd\":\"@lvble/core\",\"root\":\"@lvble/core\"}","webpack://MyLib/external umd {\"commonjs\":\"react\",\"commonjs2\":\"react\",\"amd\":\"React\",\"root\":\"React\"}","webpack://MyLib/webpack/bootstrap","webpack://MyLib/webpack/startup"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"@lvble/core\"), require(\"react\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"MyLib\", [\"@lvble/core\", \"React\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"MyLib\"] = factory(require(\"@lvble/core\"), require(\"react\"));\n\telse\n\t\troot[\"MyLib\"] = factory(root[\"@lvble/core\"], root[\"React\"]);\n})(self, (__WEBPACK_EXTERNAL_MODULE__54__, __WEBPACK_EXTERNAL_MODULE__639__) => {\nreturn ","/**\n * @license React\n * react-jsx-runtime.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var f=require(\"react\"),k=Symbol.for(\"react.element\"),l=Symbol.for(\"react.fragment\"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};\nfunction q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=\"\"+g);void 0!==a.key&&(e=\"\"+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}exports.Fragment=l;exports.jsx=q;exports.jsxs=q;\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.min.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n","export * from \"./lvble\";\n","import React, { memo, useMemo } from \"react\";\nimport { useLvbleContext } from \"../../context\";\n\nexport type LvbleWidgetProps = {\n token: string;\n} & React.HTMLAttributes<HTMLDivElement>;\n\nexport const LvbleWidget = memo(({ token, ...props }: LvbleWidgetProps) => {\n const { lvble } = useLvbleContext();\n const widget = useMemo(() => lvble?.createWidget({ token }), [lvble, token]);\n return (\n <div style={{ minHeight: \"
|
|
1
|
+
{"version":3,"file":"react.min.js","mappings":";CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAU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IAAAC,mBACZC,GAAS,IAAAC,UAAQ,IAAMH,aAAK,EAALA,EAAOI,aAAa,CAAEL,WAAU,CAACC,EAAOD,IACrE,OACE,8BAAKM,MAAO,CAAEC,UAAW,QAASC,MAAO,OAAQC,OAAQ,QACvDhC,IAAMA,IACJ,GAAK0B,EAAL,CACA,KAAO1B,aAAG,EAAHA,EAAKiC,YACVjC,SAAAA,EAAKkC,YAAYlC,aAAG,EAAHA,EAAKiC,YAExBjC,SAAAA,EAAKmC,YAAYT,EAJE,CAIK,GAEtBX,GAEP,4HCrBH,SAQA,QAWMqB,GAAe,IAAAC,eAAmD,MAE3D,EAAAC,cAAgB,EAC3BC,cACAC,UACAC,QACAC,eACAC,eAQA,MAAMnB,GAAQ,IAAAG,UAAQ,KACpB,GAAKY,EAOL,OANU,IAAAK,OAAM,CACdL,cACAC,UACAC,QACAC,gBAEM,GACP,CAACH,EAAaC,EAASC,EAAOC,IAEjC,OACE,SAACN,EAAaS,SAAQ,CAACC,MAAO,CAAEtB,SAAO,SAAGmB,GAC3C,EAGU,EAAAlB,gBAAkB,KAC7B,MAAMsB,GAAU,IAAAC,YAAWZ,GAC3B,GAAIW,QACF,MAAM,IAAIE,MAAM,uDAElB,OAAOF,CAAO,ihBCvDhB,cAEA,YACA,YACa,EAAAG,YAAc,sBCJ3BvE,EAAOD,QAAUM,WCAjBL,EAAOD,QAAUO,ICCbkE,EAA2B,CAAC,SAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAa5E,QAGrB,IAAIC,EAASwE,EAAyBE,GAAY,CAGjD3E,QAAS,CAAC,GAOX,OAHA8E,EAAoBH,GAAU1C,KAAKhC,EAAOD,QAASC,EAAQA,EAAOD,QAAS0E,GAGpEzE,EAAOD,OACf,CCnB0B0E,CAAoB","sources":["webpack://MyLib/webpack/universalModuleDefinition","webpack://MyLib/./node_modules/.pnpm/react@18.2.0/node_modules/react/cjs/react-jsx-runtime.production.min.js","webpack://MyLib/./node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.js","webpack://MyLib/./src/lib/components/index.ts","webpack://MyLib/./src/lib/components/lvble/index.tsx","webpack://MyLib/./src/lib/context.tsx","webpack://MyLib/./src/lib/index.ts","webpack://MyLib/external umd {\"commonjs\":\"@lvble/core\",\"commonjs2\":\"@lvble/core\",\"amd\":\"@lvble/core\",\"root\":\"@lvble/core\"}","webpack://MyLib/external umd {\"commonjs\":\"react\",\"commonjs2\":\"react\",\"amd\":\"React\",\"root\":\"React\"}","webpack://MyLib/webpack/bootstrap","webpack://MyLib/webpack/startup"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"@lvble/core\"), require(\"react\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"MyLib\", [\"@lvble/core\", \"React\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"MyLib\"] = factory(require(\"@lvble/core\"), require(\"react\"));\n\telse\n\t\troot[\"MyLib\"] = factory(root[\"@lvble/core\"], root[\"React\"]);\n})(self, (__WEBPACK_EXTERNAL_MODULE__54__, __WEBPACK_EXTERNAL_MODULE__639__) => {\nreturn ","/**\n * @license React\n * react-jsx-runtime.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var f=require(\"react\"),k=Symbol.for(\"react.element\"),l=Symbol.for(\"react.fragment\"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};\nfunction q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=\"\"+g);void 0!==a.key&&(e=\"\"+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}exports.Fragment=l;exports.jsx=q;exports.jsxs=q;\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.min.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n","export * from \"./lvble\";\n","import React, { memo, useMemo } from \"react\";\nimport { useLvbleContext } from \"../../context\";\n\nexport type LvbleWidgetProps = {\n token: string;\n} & React.HTMLAttributes<HTMLDivElement>;\n\nexport const LvbleWidget = memo(({ token, ...props }: LvbleWidgetProps) => {\n const { lvble } = useLvbleContext();\n const widget = useMemo(() => lvble?.createWidget({ token }), [lvble, token]);\n return (\n <div style={{ minHeight: \"250px\", width: \"100%\", height: \"100%\" }}\n ref={(ref) => {\n if (!widget) return;\n while (ref?.firstChild) {\n ref?.removeChild(ref?.firstChild);\n }\n ref?.appendChild(widget);\n }}\n {...props}\n ></div>\n );\n});","import {\n ReactNode,\n useEffect,\n createContext,\n useContext,\n useState,\n useMemo,\n} from \"react\";\nimport {\n type Environment,\n type LvbleType,\n type ModalOptions,\n Lvble,\n} from \"@lvble/core\";\n\ntype LvbleContextType = {\n lvble?: LvbleType;\n};\n\nconst LvbleContext = createContext<LvbleContextType | null | undefined>(null);\n\nexport const LvbleProvider = ({\n environment,\n onEvent,\n modal,\n customApiUrl,\n children,\n}: {\n environment: Environment;\n onEvent: (eventType: string, data: any) => void;\n modal?: ModalOptions;\n customApiUrl?: string | null,\n children: ReactNode;\n}) => {\n const lvble = useMemo(() => {\n if (!environment) return;\n const l = Lvble({\n environment,\n onEvent,\n modal,\n customApiUrl,\n });\n return l;\n }, [environment, onEvent, modal, customApiUrl]);\n\n return (\n <LvbleContext.Provider value={{ lvble }}>{children}</LvbleContext.Provider>\n );\n};\n\nexport const useLvbleContext = () => {\n const context = useContext(LvbleContext);\n if (context === undefined || context === null) {\n throw new Error(\"useLvbleContext must be used within a LvbleProvider\");\n }\n return context;\n};\n","import { Environment as _Environment } from \"@lvble/core\";\n\nexport * from \"./components\";\nexport * from \"./context\";\nexport const Environment = _Environment;\n","module.exports = __WEBPACK_EXTERNAL_MODULE__54__;","module.exports = __WEBPACK_EXTERNAL_MODULE__639__;","// 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].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// startup\n// Load entry module and return exports\n// This entry module is referenced by other modules so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(887);\n"],"names":["root","factory","exports","module","require","define","amd","self","__WEBPACK_EXTERNAL_MODULE__54__","__WEBPACK_EXTERNAL_MODULE__639__","f","k","Symbol","for","l","m","Object","prototype","hasOwnProperty","n","__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED","ReactCurrentOwner","p","key","ref","__self","__source","q","c","a","g","b","d","e","h","call","defaultProps","$$typeof","type","props","_owner","current","Fragment","jsx","jsxs","LvbleWidget","memo","token","lvble","useLvbleContext","widget","useMemo","createWidget","style","minHeight","width","height","firstChild","removeChild","appendChild","LvbleContext","createContext","LvbleProvider","environment","onEvent","modal","customApiUrl","children","Lvble","Provider","value","context","useContext","Error","Environment","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__"],"sourceRoot":""}
|
|
@@ -19,7 +19,7 @@ exports.LvbleWidget = (0, react_1.memo)((_a) => {
|
|
|
19
19
|
var { token } = _a, props = __rest(_a, ["token"]);
|
|
20
20
|
const { lvble } = (0, context_1.useLvbleContext)();
|
|
21
21
|
const widget = (0, react_1.useMemo)(() => lvble === null || lvble === void 0 ? void 0 : lvble.createWidget({ token }), [lvble, token]);
|
|
22
|
-
return ((0, jsx_runtime_1.jsx)("div", Object.assign({ style: { minHeight: "
|
|
22
|
+
return ((0, jsx_runtime_1.jsx)("div", Object.assign({ style: { minHeight: "250px", width: "100%", height: "100%" }, ref: (ref) => {
|
|
23
23
|
if (!widget)
|
|
24
24
|
return;
|
|
25
25
|
while (ref === null || ref === void 0 ? void 0 : ref.firstChild) {
|
|
@@ -16,7 +16,7 @@ export const LvbleWidget = memo((_a) => {
|
|
|
16
16
|
var { token } = _a, props = __rest(_a, ["token"]);
|
|
17
17
|
const { lvble } = useLvbleContext();
|
|
18
18
|
const widget = useMemo(() => lvble === null || lvble === void 0 ? void 0 : lvble.createWidget({ token }), [lvble, token]);
|
|
19
|
-
return (_jsx("div", Object.assign({ style: { minHeight: "
|
|
19
|
+
return (_jsx("div", Object.assign({ style: { minHeight: "250px", width: "100%", height: "100%" }, ref: (ref) => {
|
|
20
20
|
if (!widget)
|
|
21
21
|
return;
|
|
22
22
|
while (ref === null || ref === void 0 ? void 0 : ref.firstChild) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lvble/react",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "2.0.
|
|
4
|
+
"version": "2.0.72",
|
|
5
5
|
"main": "./dist/_bundles/index.js",
|
|
6
6
|
"module": "./dist/lib-esm/index.js",
|
|
7
7
|
"types": "./dist/lib/index.d.ts",
|
|
@@ -53,6 +53,6 @@
|
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"pkg-dir": "^7.0.0",
|
|
56
|
-
"@lvble/core": "^2.0.
|
|
56
|
+
"@lvble/core": "^2.0.72"
|
|
57
57
|
}
|
|
58
58
|
}
|