ninchat-embed 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/embed3.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var i in n)("object"==typeof exports?exports:e)[i]=n[i]}}(self,(function(){return function(){var e={435:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.getEnvironment=void 0;var i,o=n(491),r="production",a=null!=(i=o.environments[r])?i:{},s=a.apiHost,c=a.apiVersion;t.getEnvironment=function(){return Object.assign({apiHost:s,apiMode:r,apiVersion:c,devServerIp:""},"",{staticEmbedURL:"
|
|
1
|
+
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var i in n)("object"==typeof exports?exports:e)[i]=n[i]}}(self,(function(){return function(){var e={435:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.getEnvironment=void 0;var i,o=n(491),r="production",a=null!=(i=o.environments[r])?i:{},s=a.apiHost,c=a.apiVersion;t.getEnvironment=function(){return Object.assign({apiHost:s,apiMode:r,apiVersion:c,devServerIp:""},"",{staticEmbedURL:"https://ninchat.com/app",staticLocaleURL:"https://ninchat.com/new",staticSiteURL:"https://ninchat.com/new",target:"embed"})}},546:function(e,t){var n;Object.defineProperty(t,"__esModule",{value:!0}),t.NotificationType=void 0,t.NotificationType=n,function(e){e.AudienceRegistered="audience_registered",e.MessageReceivedChannel="message_received/channel",e.MessageReceivedChannelAudience="message_received/channel/audience",e.MessageReceivedChannelJoin="message_received/channel/join",e.MessageReceivedDialogue="message_received/dialogue",e.QueueUpdatedAudienceAcceptPeer="queue_updated/audience_accept_peer",e.QueueUpdatedAudienceRequest="queue_updated/audience_request"}(n||(t.NotificationType=n={}))},275:function(e,t){var n;Object.defineProperty(t,"__esModule",{value:!0}),t.EmbedErrorType=void 0,t.EmbedErrorType=n,function(e){e.ContainerNotFoundError="container_not_found",e.SiteConfigFetchError="site_config_fetch_error",e.InvalidConfigKeyError="invalid_config_key",e.InvalidSiteConfigError="invalid_site_config"}(n||(t.EmbedErrorType=n={}))},79:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.EmbedEvent=void 0,Object.defineProperty(t,"EmbedNotificationType",{enumerable:!0,get:function(){return o.NotificationType}});var i,o=n(546);t.EmbedEvent=i,function(e){e.ActivityCount="activity_count",e.ContainerInitialized="container_initialized",e.Error="error",e.Notification="notification",e.Route="route"}(i||(t.EmbedEvent=i={}))},582:function(e,t){var n;Object.defineProperty(t,"__esModule",{value:!0}),t.RouteName=void 0,t.RouteName=n,function(e){e.Channel="Channel",e.Else="Else"}(n||(t.RouteName=n={}))},100:function(e){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports},870:function(e,t,n){var i=n(739);function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,i(o.key),o)}}e.exports=function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e},e.exports.__esModule=!0,e.exports.default=e.exports},600:function(e){e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.__esModule=!0,e.exports.default=e.exports},64:function(e,t,n){var i=n(425).default;e.exports=function(e,t){if("object"!==i(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!==i(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports},739:function(e,t,n){var i=n(425).default,o=n(64);e.exports=function(e){var t=o(e,"string");return"symbol"===i(t)?t:String(t)},e.exports.__esModule=!0,e.exports.default=e.exports},425:function(e){function t(n){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},491:function(e){"use strict";e.exports=JSON.parse('{"name":"NinchatApp","displayName":"NinchatApp","environments":{"development":{"apiHost":"api.luupi.net","apiVersion":"v2"},"production":{"apiHost":"api.ninchat.com","apiVersion":"v2"}},"routes":{"public":{"ForgotPassword":"/x/forgot-password","Login":"/x/login","Register":"/x/register","ResetPassword":"/x/reset/:token","SSOBegin":"/x/sso/:name","SSOLogin":"/x/sso/:type/:name/:access_key"},"private":{"Channel":"/c/:channel_id","ChannelInvite":"/c/:channel_id/invite","ChannelSettings":"/c/:channel_id/settings(/:tab)","Dialogue":"/p/:dialogue_id","File":"/x/file/:file_id","Home":"/x/home","Playground":"/playground/:component","Queue":"/q/:queue_id","QueueSettings":"/q/:queue_id/settings(/:tab)","Realm":"/r/:realm_id(/:tab)","ScheduledAppointments":"/x/scheduled-appointments","Settings":"/x/settings(/:tab)","Transcript":"/t/audience/:audience_id"},"modal":{"ChannelInviteModal":"/i/:access_key"}}}')}},t={};function n(i){var o=t[i];if(void 0!==o)return o.exports;var r=t[i]={exports:{}};return e[i](r,r.exports,n),r.exports}var i={};return function(){var e=i,t=n(600);Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.NinchatEmbed=void 0;var o=t(n(100)),r=t(n(870)),a=n(79),s=n(275),c=n(582),u=n(435),l=function(){function e(){var t,n=this;(0,o.default)(this,e),this.ENVIRONMENT=(0,u.getEnvironment)(),this.EMBED_HOST=this.ENVIRONMENT.staticEmbedURL,this.EMBED_ORIGIN=this.EMBED_HOST&&new URL(this.EMBED_HOST).origin,this.ENTRY_POINT=null!=(t=this.EMBED_HOST)&&t.includes("localhost")?"embed3.html":"embed3",this.Event=a.EmbedEvent,this.ErrorType=s.EmbedErrorType,this.NotificationType=a.EmbedNotificationType,this.RouteName=c.RouteName,this.callbacks={},this.onMessage=function(e){e.origin===n.EMBED_ORIGIN&&n.emit(JSON.parse(e.data))},window.addEventListener("message",this.onMessage,!1)}return(0,r.default)(e,[{key:"emit",value:function(e){this.callbacks[e.event]&&this.callbacks[e.event].forEach((function(t){t(e)}))}},{key:"destruct",value:function(){window.removeEventListener("message",this.onMessage),this.callbacks={}}},{key:"off",value:function(e,t){if(this.callbacks[e])for(var n=0;n<this.callbacks[e].length;n+=1)if(this.callbacks[e][n]===t){this.callbacks[e].splice(n,1);break}}},{key:"on",value:function(e,t){this.callbacks[e]||=[],this.callbacks[e].push(t)}},{key:"init",value:function(e){var t=e.audienceMetadata,n=e.config,i=e.configKey,o=e.configUrls,r=e.containerId,c=e.environment,u=e.postConfigUrls,l=window.location.origin,d=document.querySelector("#"+r),f=new URLSearchParams;t&&f.set("audienceMetadata",JSON.stringify(t)),n&&f.set("config",JSON.stringify(n)),i&&f.set("configKey",JSON.stringify(i)),o&&f.set("configUrls",JSON.stringify(o)),c&&f.set("environment",JSON.stringify(c)),u&&f.set("postConfigUrls",JSON.stringify(u));var p=new URL(this.EMBED_HOST+"/"+this.ENTRY_POINT);if(p.searchParams.set("targetOrigin",l),d){var v=document.createElement("iframe");v.name="ninchat?"+f.toString(),v.allow="camera;microphone",v.src=p.toString(),v.style.border="0",v.style.height="100%",v.style.width="100%",d.appendChild(v)}else{var m={container_id:r,error_type:s.EmbedErrorType.ContainerNotFoundError,event:a.EmbedEvent.Error,targetOrigin:l};this.emit(m)}}}]),e}();e.NinchatEmbed=l;var d=l;e.default=d}(),i}()}));
|
|
2
2
|
//# sourceMappingURL=embed3.js.map
|
package/dist/embed3.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"embed3.js","mappings":"CAAA,SAA2CA,EAAMC,GAChD,GAAsB,iBAAZC,SAA0C,iBAAXC,OACx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,GACAK,EAAaE,IAAI,iBAAkBxB,KAAKyB,UAAUR,IAGtD,IAAMS,EAAY,IAAIrC,IAAOF,KAAKD,WAAU,IAAIC,KAAKI,aAKrD,GAFAmC,EAAUJ,aAAaE,IAAI,eAAgBlC,GAEvC6B,EAAW,CACX,IAAMQ,EAASP,SAASQ,cAAc,UACtCD,EAAOE,KAAI,WAAcP,EAAaQ,WACtCH,EAAOI,MAAQ,oBACfJ,EAAOK,IAAMN,EAAUI,WACvBH,EAAOM,MAAMC,OAAS,IACtBP,EAAOM,MAAME,OAAS,OACtBR,EAAOM,MAAMG,MAAQ,OACrBjB,EAAUkB,YAAYV,EAC1B,KAAO,CACH,IAAMW,EAA0C,CAC5CC,aAAcxB,EACdyB,WAAYlG,EAAAA,eAAemG,uBAC3B3C,MAAOvD,EAAAA,WAAWmG,MAClBC,aAAcrD,GAGlBH,KAAKY,KAAKuC,EACd,CACJ,KAAC,EAzHoB,GAyHpB,uBAOUvD,EAAY,W","sources":["webpack://ninchat-embed/webpack/universalModuleDefinition","webpack://ninchat-embed/../../src/appconfig/index.ts","webpack://ninchat-embed/../../src/components/BrowserNotification/types.ts","webpack://ninchat-embed/../../src/embed/types/errorTypes.ts","webpack://ninchat-embed/../../src/embed/types/events.ts","webpack://ninchat-embed/../../src/embed/types/routes.ts","webpack://ninchat-embed/../../node_modules/@babel/runtime/helpers/classCallCheck.js","webpack://ninchat-embed/../../node_modules/@babel/runtime/helpers/createClass.js","webpack://ninchat-embed/../../node_modules/@babel/runtime/helpers/interopRequireDefault.js","webpack://ninchat-embed/../../node_modules/@babel/runtime/helpers/toPrimitive.js","webpack://ninchat-embed/../../node_modules/@babel/runtime/helpers/toPropertyKey.js","webpack://ninchat-embed/../../node_modules/@babel/runtime/helpers/typeof.js","webpack://ninchat-embed/webpack/bootstrap","webpack://ninchat-embed/../../src/embed/index.ts"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse {\n\t\tvar a = factory();\n\t\tfor(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];\n\t}\n})(self, function() {\nreturn ","import {environments} from '../../app.json'\n\ntype Environment = 'development' | 'production'\ntype Target = 'app' | 'embed' | 'sdk'\ntype Variant = 'live' | 'stage'\n\nexport interface AppEnvironment {\n apiHost: string\n apiMode: Environment\n apiVersion: string\n devServerIp?: string\n target: Target\n staticEmbedURL: string | null\n staticLocaleURL: string | null\n staticSiteURL: string | null\n siteSecret?: string\n}\n\nconst mode: Environment = process.env.MODE as Environment\nconst apiMode: Environment = (process.env.API || mode) as Environment\nconst devServerIp: string = process.env.DEV_SERVER_IP as string\nconst siteSecret: string = process.env.SITE_SECRET as string\nconst target: Target = process.env.TARGET as Target\nconst variant: Variant = process.env.VARIANT as Variant\n\nconst isNative = process.env.PLATFORM === 'native'\nconst isProduction = mode === 'production'\nconst isWeb = process.env.PLATFORM === 'web'\n\nconst dir = variant === 'stage' ? 'stage/new' : 'new'\nconst embedDir = variant === 'stage' ? 'stage/app' : 'app'\n\nconst {\n apiHost,\n apiVersion,\n} = environments[apiMode] ?? {}\n\n/* eslint-disable indent */\nconst staticLocaleURL =\n isWeb ?\n isProduction ? `https://ninchat.com/${dir}` : 'http://localhost:8080'\n :\n isNative ?\n isProduction ? `https://ninchat.com/${dir}` : `http://${devServerIp}:8082`\n :\n null\n\nconst staticSiteURL =\n isNative ?\n isProduction ? 'https://ninchat.com' : `http://${devServerIp}:8082`\n :\n isProduction ? `https://ninchat.com/${dir}` : 'http://localhost:8082'\n\nconst staticEmbedURL =\n isNative ?\n isProduction ? 'https://ninchat.com' : `http://${devServerIp}:8082`\n :\n isProduction ? `https://ninchat.com/${embedDir}` : 'http://localhost:8082'\n/* eslint-enable indent */\n\nexport const getEnvironment = (): AppEnvironment => ({\n apiHost,\n apiMode,\n apiVersion,\n devServerIp,\n ...siteSecret && {siteSecret},\n staticEmbedURL,\n staticLocaleURL,\n staticSiteURL,\n target,\n})\n","import {\n AnyAction,\n ListenerEffectAPI,\n UnsubscribeListener,\n} from '@reduxjs/toolkit'\nimport {\n AppDispatch,\n RootState,\n} from '../../store'\nimport {NinchatClientPromiseValue} from '../../api/NinchatClient'\n\nexport type EffectArgs = {\n action: AnyAction\n listenerApi: ListenerEffectAPI<RootState, AppDispatch>\n}\n\nexport type EffectProcessArgs = {\n flushNotificationQueue: () => void\n ignoreIdle?: boolean\n listener?: Listener\n notificationQueue: NotificationQueueEntry[]\n} & EffectArgs\n\nexport type EffectRetval = [NotificationType, NinchatClientPromiseValue]\n\nexport type Listener = {\n effects: Map<NotificationKey, (args: EffectArgs) => EffectRetval>\n unsubscribe: UnsubscribeListener\n}\n\nexport type NotificationEvent = {\n audio?: boolean\n channel_name?: string\n desktop?: boolean\n message?: string\n queue_name?: string\n realm_name?: string\n type: NotificationType\n user_name?: string\n}\n\nexport type NotificationKey =\n 'ignore_idle' | 'require_interaction' |\n 'private' | 'highlight' | 'channel_join' | 'channel' | 'audience_queue' | 'audience_queue_picked' | 'audience' | 'audience_register' |\n 'private_audio' | 'highlight_audio' | 'channel_join_audio' | 'channel_audio' | 'audience_queue_audio' | 'audience_queue_picked_audio' | 'audience_audio' | 'audience_register_audio'\n\nexport type NotificationQueueEntry = {\n audio: boolean\n desktop: boolean\n payload: NinchatClientPromiseValue\n type: NotificationType\n}\n\nexport enum NotificationType {\n AudienceRegistered = 'audience_registered',\n MessageReceivedChannel = 'message_received/channel',\n MessageReceivedChannelAudience = 'message_received/channel/audience',\n MessageReceivedChannelJoin = 'message_received/channel/join',\n MessageReceivedDialogue = 'message_received/dialogue',\n QueueUpdatedAudienceAcceptPeer = 'queue_updated/audience_accept_peer',\n QueueUpdatedAudienceRequest = 'queue_updated/audience_request',\n}\n","export enum EmbedErrorType {\n ContainerNotFoundError = 'container_not_found',\n SiteConfigFetchError = 'site_config_fetch_error',\n InvalidConfigKeyError = 'invalid_config_key',\n InvalidSiteConfigError = 'invalid_site_config'\n}\n","import {\n AudienceRoute,\n ChannelRoute,\n ElseRoute,\n} from './routes'\nimport {\n NotificationEvent as BrowserNotificationEvent,\n NotificationType,\n} from 'components/BrowserNotification/types'\nimport {EmbedErrorEvents} from './errorEvents'\nimport {NinchatEmbedConfig} from './'\n\nexport enum EmbedEvent {\n ActivityCount = 'activity_count',\n ContainerInitialized = 'container_initialized',\n Error = 'error',\n Notification = 'notification',\n Route = 'route'\n}\n\nexport {NotificationType as EmbedNotificationType}\n\nexport type BaseEvent = NinchatEmbedConfig\n\nexport interface ActivityCountEvent extends BaseEvent {\n event: EmbedEvent.ActivityCount\n activity: number\n highlights: number\n}\n\nexport interface ContainerInitializedEvent extends BaseEvent {\n event: EmbedEvent.ContainerInitialized\n}\n\nexport interface NotificationEvent extends BaseEvent, BrowserNotificationEvent {\n event: EmbedEvent.Notification\n}\n\nexport interface RouteEvent extends BaseEvent {\n event: EmbedEvent.Route\n route: AudienceRoute | ChannelRoute | ElseRoute\n}\n\nexport type EmbedEvents =\n ActivityCountEvent |\n ContainerInitializedEvent |\n EmbedErrorEvents |\n NotificationEvent |\n RouteEvent\n","import {\n AudienceID,\n ChannelID,\n} from 'api/types/properties'\n\nexport enum RouteName {\n Channel = 'Channel',\n Else = 'Else',\n}\n\nexport type ChannelRoute = {\n name: RouteName.Channel\n params: {\n channel_id: ChannelID\n }\n}\n\nexport type AudienceRoute = {\n audience_id: AudienceID\n name: RouteName.Channel\n metadata?: Record<string, unknown>[]\n params: {\n channel_id: ChannelID\n }\n}\n\nexport type ElseRoute = {\n name: RouteName.Else\n}\n","function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\nmodule.exports = _classCallCheck, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var toPropertyKey = require(\"./toPropertyKey.js\");\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor);\n }\n}\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}\nmodule.exports = _createClass, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n \"default\": obj\n };\n}\nmodule.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var _typeof = require(\"./typeof.js\")[\"default\"];\nfunction _toPrimitive(input, hint) {\n if (_typeof(input) !== \"object\" || input === null) return input;\n var prim = input[Symbol.toPrimitive];\n if (prim !== undefined) {\n var res = prim.call(input, hint || \"default\");\n if (_typeof(res) !== \"object\") return res;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (hint === \"string\" ? String : Number)(input);\n}\nmodule.exports = _toPrimitive, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var _typeof = require(\"./typeof.js\")[\"default\"];\nvar toPrimitive = require(\"./toPrimitive.js\");\nfunction _toPropertyKey(arg) {\n var key = toPrimitive(arg, \"string\");\n return _typeof(key) === \"symbol\" ? key : String(key);\n}\nmodule.exports = _toPropertyKey, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return (module.exports = _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) {\n return typeof obj;\n } : function (obj) {\n return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports), _typeof(obj);\n}\nmodule.exports = _typeof, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","// 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","import {\n EmbedEvent,\n EmbedEvents,\n EmbedNotificationType,\n} from './types/events'\nimport {\n NinchatCallbacks,\n NinchatEventCallback,\n NinchatOptions,\n} from './types'\nimport {ContainerNotFoundErrorEvent} from './types/errorEvents'\nimport {EmbedErrorType} from './types/errorTypes'\nimport {RouteName} from './types/routes'\nimport {getEnvironment} from 'appconfig'\n\nexport class NinchatEmbed {\n readonly ENVIRONMENT = getEnvironment()\n\n readonly EMBED_HOST = this.ENVIRONMENT.staticEmbedURL\n\n readonly EMBED_ORIGIN = this.EMBED_HOST && new URL(this.EMBED_HOST).origin\n\n readonly ENTRY_POINT = this.EMBED_HOST?.includes('localhost') ? 'embed3.html' : 'embed3'\n\n public readonly Event = EmbedEvent\n\n public readonly ErrorType = EmbedErrorType\n\n public readonly NotificationType = EmbedNotificationType\n\n public readonly RouteName = RouteName\n\n private callbacks = <NinchatCallbacks>{}\n\n private emit(event: EmbedEvents) {\n if (this.callbacks[event.event]) {\n this.callbacks[event.event].forEach((callback) => {\n callback(event)\n })\n }\n }\n\n private onMessage = (event: MessageEvent) => {\n if (event.origin === this.EMBED_ORIGIN) {\n this.emit(JSON.parse(event.data))\n }\n }\n\n public destruct() {\n window.removeEventListener('message', this.onMessage)\n this.callbacks = <NinchatCallbacks>{}\n }\n\n public off(event: EmbedEvent, callback: NinchatEventCallback) {\n if (this.callbacks[event]) {\n for (let i = 0; i < this.callbacks[event].length; i += 1) {\n if (this.callbacks[event][i] === callback) {\n this.callbacks[event].splice(i, 1)\n break\n }\n }\n }\n }\n\n public on(event: EmbedEvent, callback: NinchatEventCallback) {\n this.callbacks[event] ||= []\n this.callbacks[event].push(callback)\n }\n\n public init(options: NinchatOptions) {\n const {\n audienceMetadata,\n config,\n configKey,\n configUrls,\n containerId,\n environment,\n postConfigUrls,\n } = options\n\n const {origin} = window.location\n\n const container = document.querySelector(`#${containerId}`)\n\n // Params that are NOT sent to server via query (placed after #)\n // TODO: validate via Zod\n const searchParams = new URLSearchParams()\n\n if (audienceMetadata) {\n searchParams.set('audienceMetadata', JSON.stringify(audienceMetadata))\n }\n\n if (config) {\n searchParams.set('config', JSON.stringify(config))\n }\n\n if (configKey) {\n searchParams.set('configKey', JSON.stringify(configKey))\n }\n\n if (configUrls) {\n searchParams.set('configUrls', JSON.stringify(configUrls))\n }\n\n if (environment) {\n searchParams.set('environment', JSON.stringify(environment))\n }\n\n if (postConfigUrls) {\n searchParams.set('postConfigUrls', JSON.stringify(postConfigUrls))\n }\n\n const iframeUrl = new URL(`${this.EMBED_HOST}/${this.ENTRY_POINT}`)\n\n // Params that ARE sent to server via query\n iframeUrl.searchParams.set('targetOrigin', origin)\n\n if (container) {\n const iframe = document.createElement('iframe')\n iframe.name = `ninchat?${searchParams.toString()}`\n iframe.allow = 'camera;microphone'\n iframe.src = iframeUrl.toString()\n iframe.style.border = '0'\n iframe.style.height = '100%'\n iframe.style.width = '100%'\n container.appendChild(iframe)\n } else {\n const errorEvent: ContainerNotFoundErrorEvent = {\n container_id: containerId,\n error_type: EmbedErrorType.ContainerNotFoundError,\n event: EmbedEvent.Error,\n targetOrigin: origin,\n }\n\n this.emit(errorEvent)\n }\n }\n\n constructor() {\n window.addEventListener('message', this.onMessage, false)\n }\n}\n\nexport default NinchatEmbed\n\n"],"names":["root","factory","exports","module","define","amd","a","i","self","apiMode","process","environments","apiHost","apiVersion","devServerIp","staticEmbedURL","staticLocaleURL","staticSiteURL","target","NotificationType","EmbedErrorType","EmbedEvent","RouteName","instance","Constructor","TypeError","__esModule","toPropertyKey","_defineProperties","props","length","descriptor","enumerable","configurable","writable","Object","defineProperty","key","protoProps","staticProps","prototype","obj","_typeof","input","hint","prim","Symbol","toPrimitive","undefined","res","call","String","Number","arg","iterator","constructor","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","NinchatEmbed","ENVIRONMENT","getEnvironment","EMBED_HOST","this","EMBED_ORIGIN","URL","origin","ENTRY_POINT","includes","Event","ErrorType","EmbedNotificationType","callbacks","onMessage","event","emit","JSON","parse","data","window","addEventListener","forEach","callback","removeEventListener","splice","push","options","audienceMetadata","config","configKey","configUrls","containerId","environment","postConfigUrls","location","container","document","querySelector","searchParams","URLSearchParams","set","stringify","iframeUrl","iframe","createElement","name","toString","allow","src","style","border","height","width","appendChild","errorEvent","container_id","error_type","ContainerNotFoundError","Error","targetOrigin"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"embed3.js","mappings":"CAAA,SAA2CA,EAAMC,GAChD,GAAsB,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,SACb,GAAqB,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,OACP,CACJ,IAAIK,EAAIL,IACR,IAAI,IAAIM,KAAKD,GAAuB,iBAAZJ,QAAuBA,QAAUF,GAAMO,GAAKD,EAAEC,EACvE,CACA,CATD,CASGC,MAAM,WACT,O,+GCVA,IAA2C,EAA3C,SAmBMC,EAAwBC,aAa9B,EAGyB,OAHzB,EAGIC,EAAAA,aAAaF,IAAQ,EAAI,CAAC,EAF1BG,EAAO,EAAPA,QACAC,EAAU,EAAVA,WAoCF,iBAV4B,WAAH,sBACvBD,QAAAA,EACAH,QAAAA,EACAI,WAAAA,EACAC,YA5CwBJ,IACDA,GA4CO,CAC9BK,eATgB,0BAUhBC,gBA3BgB,0BA4BhBC,cAjBgB,0BAkBhBC,OA/Cm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C,aAAcrD,GAGlBH,KAAKY,KAAKuC,EACd,CACJ,KAAC,EAzHoB,GAyHpB,uBAOUvD,EAAY,W","sources":["webpack://ninchat-embed/webpack/universalModuleDefinition","webpack://ninchat-embed/../../src/appconfig/index.ts","webpack://ninchat-embed/../../src/components/BrowserNotification/types.ts","webpack://ninchat-embed/../../src/embed/types/errorTypes.ts","webpack://ninchat-embed/../../src/embed/types/events.ts","webpack://ninchat-embed/../../src/embed/types/routes.ts","webpack://ninchat-embed/../../node_modules/@babel/runtime/helpers/classCallCheck.js","webpack://ninchat-embed/../../node_modules/@babel/runtime/helpers/createClass.js","webpack://ninchat-embed/../../node_modules/@babel/runtime/helpers/interopRequireDefault.js","webpack://ninchat-embed/../../node_modules/@babel/runtime/helpers/toPrimitive.js","webpack://ninchat-embed/../../node_modules/@babel/runtime/helpers/toPropertyKey.js","webpack://ninchat-embed/../../node_modules/@babel/runtime/helpers/typeof.js","webpack://ninchat-embed/webpack/bootstrap","webpack://ninchat-embed/../../src/embed/index.ts"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse {\n\t\tvar a = factory();\n\t\tfor(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];\n\t}\n})(self, function() {\nreturn ","import {environments} from '../../app.json'\n\ntype Environment = 'development' | 'production'\ntype Target = 'app' | 'embed' | 'sdk'\ntype Variant = 'live' | 'stage'\n\nexport interface AppEnvironment {\n apiHost: string\n apiMode: Environment\n apiVersion: string\n devServerIp?: string\n target: Target\n staticEmbedURL: string | null\n staticLocaleURL: string | null\n staticSiteURL: string | null\n siteSecret?: string\n}\n\nconst mode: Environment = process.env.MODE as Environment\nconst apiMode: Environment = (process.env.API || mode) as Environment\nconst devServerIp: string = process.env.DEV_SERVER_IP as string\nconst siteSecret: string = process.env.SITE_SECRET as string\nconst target: Target = process.env.TARGET as Target\nconst variant: Variant = process.env.VARIANT as Variant\n\nconst isNative = process.env.PLATFORM === 'native'\nconst isProduction = mode === 'production'\nconst isWeb = process.env.PLATFORM === 'web'\n\nconst dir = variant === 'stage' ? 'stage/new' : 'new'\nconst embedDir = variant === 'stage' ? 'stage/app' : 'app'\n\nconst {\n apiHost,\n apiVersion,\n} = environments[apiMode] ?? {}\n\n/* eslint-disable indent */\nconst staticLocaleURL =\n isWeb ?\n isProduction ? `https://ninchat.com/${dir}` : 'http://localhost:8080'\n :\n isNative ?\n isProduction ? `https://ninchat.com/${dir}` : `http://${devServerIp}:8082`\n :\n null\n\nconst staticSiteURL =\n isNative ?\n isProduction ? 'https://ninchat.com' : `http://${devServerIp}:8082`\n :\n isProduction ? `https://ninchat.com/${dir}` : 'http://localhost:8082'\n\nconst staticEmbedURL =\n isNative ?\n isProduction ? 'https://ninchat.com' : `http://${devServerIp}:8082`\n :\n isProduction ? `https://ninchat.com/${embedDir}` : 'http://localhost:8082'\n/* eslint-enable indent */\n\nexport const getEnvironment = (): AppEnvironment => ({\n apiHost,\n apiMode,\n apiVersion,\n devServerIp,\n ...siteSecret && {siteSecret},\n staticEmbedURL,\n staticLocaleURL,\n staticSiteURL,\n target,\n})\n","import {\n AnyAction,\n ListenerEffectAPI,\n UnsubscribeListener,\n} from '@reduxjs/toolkit'\nimport {\n AppDispatch,\n RootState,\n} from '../../store'\nimport {NinchatClientPromiseValue} from '../../api/NinchatClient'\n\nexport type EffectArgs = {\n action: AnyAction\n listenerApi: ListenerEffectAPI<RootState, AppDispatch>\n}\n\nexport type EffectProcessArgs = {\n flushNotificationQueue: () => void\n ignoreIdle?: boolean\n listener?: Listener\n notificationQueue: NotificationQueueEntry[]\n} & EffectArgs\n\nexport type EffectRetval = [NotificationType, NinchatClientPromiseValue]\n\nexport type Listener = {\n effects: Map<NotificationKey, (args: EffectArgs) => EffectRetval>\n unsubscribe: UnsubscribeListener\n}\n\nexport type NotificationEvent = {\n audio?: boolean\n channel_name?: string\n desktop?: boolean\n message?: string\n queue_name?: string\n realm_name?: string\n type: NotificationType\n user_name?: string\n}\n\nexport type NotificationKey =\n 'ignore_idle' | 'require_interaction' |\n 'private' | 'highlight' | 'channel_join' | 'channel' | 'audience_queue' | 'audience_queue_picked' | 'audience' | 'audience_register' |\n 'private_audio' | 'highlight_audio' | 'channel_join_audio' | 'channel_audio' | 'audience_queue_audio' | 'audience_queue_picked_audio' | 'audience_audio' | 'audience_register_audio'\n\nexport type NotificationQueueEntry = {\n audio: boolean\n desktop: boolean\n payload: NinchatClientPromiseValue\n type: NotificationType\n}\n\nexport enum NotificationType {\n AudienceRegistered = 'audience_registered',\n MessageReceivedChannel = 'message_received/channel',\n MessageReceivedChannelAudience = 'message_received/channel/audience',\n MessageReceivedChannelJoin = 'message_received/channel/join',\n MessageReceivedDialogue = 'message_received/dialogue',\n QueueUpdatedAudienceAcceptPeer = 'queue_updated/audience_accept_peer',\n QueueUpdatedAudienceRequest = 'queue_updated/audience_request',\n}\n","export enum EmbedErrorType {\n ContainerNotFoundError = 'container_not_found',\n SiteConfigFetchError = 'site_config_fetch_error',\n InvalidConfigKeyError = 'invalid_config_key',\n InvalidSiteConfigError = 'invalid_site_config'\n}\n","import {\n AudienceRoute,\n ChannelRoute,\n ElseRoute,\n} from './routes'\nimport {\n NotificationEvent as BrowserNotificationEvent,\n NotificationType,\n} from 'components/BrowserNotification/types'\nimport {EmbedErrorEvents} from './errorEvents'\nimport {NinchatEmbedConfig} from './'\n\nexport enum EmbedEvent {\n ActivityCount = 'activity_count',\n ContainerInitialized = 'container_initialized',\n Error = 'error',\n Notification = 'notification',\n Route = 'route'\n}\n\nexport {NotificationType as EmbedNotificationType}\n\nexport type BaseEvent = NinchatEmbedConfig\n\nexport interface ActivityCountEvent extends BaseEvent {\n event: EmbedEvent.ActivityCount\n activity: number\n highlights: number\n}\n\nexport interface ContainerInitializedEvent extends BaseEvent {\n event: EmbedEvent.ContainerInitialized\n}\n\nexport interface NotificationEvent extends BaseEvent, BrowserNotificationEvent {\n event: EmbedEvent.Notification\n}\n\nexport interface RouteEvent extends BaseEvent {\n event: EmbedEvent.Route\n route: AudienceRoute | ChannelRoute | ElseRoute\n}\n\nexport type EmbedEvents =\n ActivityCountEvent |\n ContainerInitializedEvent |\n EmbedErrorEvents |\n NotificationEvent |\n RouteEvent\n","import {\n AudienceID,\n ChannelID,\n} from 'api/types/properties'\n\nexport enum RouteName {\n Channel = 'Channel',\n Else = 'Else',\n}\n\nexport type ChannelRoute = {\n name: RouteName.Channel\n params: {\n channel_id: ChannelID\n }\n}\n\nexport type AudienceRoute = {\n audience_id: AudienceID\n name: RouteName.Channel\n metadata?: Record<string, unknown>[]\n params: {\n channel_id: ChannelID\n }\n}\n\nexport type ElseRoute = {\n name: RouteName.Else\n}\n","function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\nmodule.exports = _classCallCheck, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var toPropertyKey = require(\"./toPropertyKey.js\");\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor);\n }\n}\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}\nmodule.exports = _createClass, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n \"default\": obj\n };\n}\nmodule.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var _typeof = require(\"./typeof.js\")[\"default\"];\nfunction _toPrimitive(input, hint) {\n if (_typeof(input) !== \"object\" || input === null) return input;\n var prim = input[Symbol.toPrimitive];\n if (prim !== undefined) {\n var res = prim.call(input, hint || \"default\");\n if (_typeof(res) !== \"object\") return res;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (hint === \"string\" ? String : Number)(input);\n}\nmodule.exports = _toPrimitive, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var _typeof = require(\"./typeof.js\")[\"default\"];\nvar toPrimitive = require(\"./toPrimitive.js\");\nfunction _toPropertyKey(arg) {\n var key = toPrimitive(arg, \"string\");\n return _typeof(key) === \"symbol\" ? key : String(key);\n}\nmodule.exports = _toPropertyKey, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return (module.exports = _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) {\n return typeof obj;\n } : function (obj) {\n return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports), _typeof(obj);\n}\nmodule.exports = _typeof, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","// 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","import {\n EmbedEvent,\n EmbedEvents,\n EmbedNotificationType,\n} from './types/events'\nimport {\n NinchatCallbacks,\n NinchatEventCallback,\n NinchatOptions,\n} from './types'\nimport {ContainerNotFoundErrorEvent} from './types/errorEvents'\nimport {EmbedErrorType} from './types/errorTypes'\nimport {RouteName} from './types/routes'\nimport {getEnvironment} from 'appconfig'\n\nexport class NinchatEmbed {\n readonly ENVIRONMENT = getEnvironment()\n\n readonly EMBED_HOST = this.ENVIRONMENT.staticEmbedURL\n\n readonly EMBED_ORIGIN = this.EMBED_HOST && new URL(this.EMBED_HOST).origin\n\n readonly ENTRY_POINT = this.EMBED_HOST?.includes('localhost') ? 'embed3.html' : 'embed3'\n\n public readonly Event = EmbedEvent\n\n public readonly ErrorType = EmbedErrorType\n\n public readonly NotificationType = EmbedNotificationType\n\n public readonly RouteName = RouteName\n\n private callbacks = <NinchatCallbacks>{}\n\n private emit(event: EmbedEvents) {\n if (this.callbacks[event.event]) {\n this.callbacks[event.event].forEach((callback) => {\n callback(event)\n })\n }\n }\n\n private onMessage = (event: MessageEvent) => {\n if (event.origin === this.EMBED_ORIGIN) {\n this.emit(JSON.parse(event.data))\n }\n }\n\n public destruct() {\n window.removeEventListener('message', this.onMessage)\n this.callbacks = <NinchatCallbacks>{}\n }\n\n public off(event: EmbedEvent, callback: NinchatEventCallback) {\n if (this.callbacks[event]) {\n for (let i = 0; i < this.callbacks[event].length; i += 1) {\n if (this.callbacks[event][i] === callback) {\n this.callbacks[event].splice(i, 1)\n break\n }\n }\n }\n }\n\n public on(event: EmbedEvent, callback: NinchatEventCallback) {\n this.callbacks[event] ||= []\n this.callbacks[event].push(callback)\n }\n\n public init(options: NinchatOptions) {\n const {\n audienceMetadata,\n config,\n configKey,\n configUrls,\n containerId,\n environment,\n postConfigUrls,\n } = options\n\n const {origin} = window.location\n\n const container = document.querySelector(`#${containerId}`)\n\n // Params that are NOT sent to server via query (placed after #)\n // TODO: validate via Zod\n const searchParams = new URLSearchParams()\n\n if (audienceMetadata) {\n searchParams.set('audienceMetadata', JSON.stringify(audienceMetadata))\n }\n\n if (config) {\n searchParams.set('config', JSON.stringify(config))\n }\n\n if (configKey) {\n searchParams.set('configKey', JSON.stringify(configKey))\n }\n\n if (configUrls) {\n searchParams.set('configUrls', JSON.stringify(configUrls))\n }\n\n if (environment) {\n searchParams.set('environment', JSON.stringify(environment))\n }\n\n if (postConfigUrls) {\n searchParams.set('postConfigUrls', JSON.stringify(postConfigUrls))\n }\n\n const iframeUrl = new URL(`${this.EMBED_HOST}/${this.ENTRY_POINT}`)\n\n // Params that ARE sent to server via query\n iframeUrl.searchParams.set('targetOrigin', origin)\n\n if (container) {\n const iframe = document.createElement('iframe')\n iframe.name = `ninchat?${searchParams.toString()}`\n iframe.allow = 'camera;microphone'\n iframe.src = iframeUrl.toString()\n iframe.style.border = '0'\n iframe.style.height = '100%'\n iframe.style.width = '100%'\n container.appendChild(iframe)\n } else {\n const errorEvent: ContainerNotFoundErrorEvent = {\n container_id: containerId,\n error_type: EmbedErrorType.ContainerNotFoundError,\n event: EmbedEvent.Error,\n targetOrigin: origin,\n }\n\n this.emit(errorEvent)\n }\n }\n\n constructor() {\n window.addEventListener('message', this.onMessage, false)\n }\n}\n\nexport default NinchatEmbed\n\n"],"names":["root","factory","exports","module","define","amd","a","i","self","apiMode","process","environments","apiHost","apiVersion","devServerIp","staticEmbedURL","staticLocaleURL","staticSiteURL","target","NotificationType","EmbedErrorType","EmbedEvent","RouteName","instance","Constructor","TypeError","__esModule","toPropertyKey","_defineProperties","props","length","descriptor","enumerable","configurable","writable","Object","defineProperty","key","protoProps","staticProps","prototype","obj","_typeof","input","hint","prim","Symbol","toPrimitive","undefined","res","call","String","Number","arg","iterator","constructor","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","NinchatEmbed","ENVIRONMENT","getEnvironment","EMBED_HOST","this","EMBED_ORIGIN","URL","origin","ENTRY_POINT","includes","Event","ErrorType","EmbedNotificationType","callbacks","onMessage","event","emit","JSON","parse","data","window","addEventListener","forEach","callback","removeEventListener","splice","push","options","audienceMetadata","config","configKey","configUrls","containerId","environment","postConfigUrls","location","container","document","querySelector","searchParams","URLSearchParams","set","stringify","iframeUrl","iframe","createElement","name","toString","allow","src","style","border","height","width","appendChild","errorEvent","container_id","error_type","ContainerNotFoundError","Error","targetOrigin"],"sourceRoot":""}
|
|
@@ -7,7 +7,7 @@ export type NinchatEmbedConfig = {
|
|
|
7
7
|
};
|
|
8
8
|
export type NinchatEventData = object;
|
|
9
9
|
export interface NinchatEventCallback {
|
|
10
|
-
(data: NinchatEventData):
|
|
10
|
+
(data: NinchatEventData): void;
|
|
11
11
|
}
|
|
12
12
|
export type NinchatCallbacks = Record<EmbedEvent, NinchatEventCallback[]>;
|
|
13
13
|
export type NinchatConfigKey = z.infer<typeof ConfigKeySchema>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/embed/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,eAAe,EACf,uBAAuB,EACvB,iBAAiB,EACjB,gBAAgB,EACnB,MAAM,eAAe,CAAA;AACtB,OAAO,EAAC,UAAU,EAAC,MAAM,UAAU,CAAA;AACnC,OAAO,EAAC,uBAAuB,EAAC,MAAM,sBAAsB,CAAA;AAC5D,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAA;AAErB,MAAM,MAAM,kBAAkB,GAAG;IAC7B,YAAY,EAAE,MAAM,CAAA;CACvB,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAA;AAErC,MAAM,WAAW,oBAAoB;IACjC,CAAC,IAAI,EAAE,gBAAgB,GAAG,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/embed/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,eAAe,EACf,uBAAuB,EACvB,iBAAiB,EACjB,gBAAgB,EACnB,MAAM,eAAe,CAAA;AACtB,OAAO,EAAC,UAAU,EAAC,MAAM,UAAU,CAAA;AACnC,OAAO,EAAC,uBAAuB,EAAC,MAAM,sBAAsB,CAAA;AAC5D,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK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iBAAiB,CAAC,UAAU,CAAA;KAC5C,CAAA;CACJ,CAAA;AAED,MAAM,WAAW,MAAM;IACnB,MAAM,EAAE,MAAM,CAAC,eAAe,EAAE,OAAO,CAAC,CAAA;IACxC,OAAO,EAAE,MAAM,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAA;IAC1C,KAAK,EAAE,MAAM,CAAC,cAAc,EAAE,OAAO,CAAC,CAAA;CACzC;AAED,MAAM,MAAM,GAAG,GAAG,MAAM,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ninchat-embed",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Ninchat Embed",
|
|
5
5
|
"main": "dist/embed3.js",
|
|
6
6
|
"typings": "dist/src/embed/index.d.ts",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"embed:dev": "PLATFORM=web API=development TARGET=embed webpack build --config webpack.embed.library.config.js --progress && npm run embed:declarations",
|
|
9
9
|
"embed:prod": "PLATFORM=web API=production TARGET=embed webpack build --config webpack.embed.library.config.js --progress && npm run embed:declarations",
|
|
10
|
+
"embed:prod:build": "NODE_ENV=production MODE=production PLATFORM=web API=production TARGET=embed webpack build --config webpack.embed.library.config.js --progress && npm run embed:declarations",
|
|
10
11
|
"embed:declarations": "tsc",
|
|
11
12
|
"publishtonpm": "npm publish --no-workspaces"
|
|
12
13
|
},
|