@n8n/chat 1.10.1 → 1.11.1

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/chat.es.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! Package version @n8n/chat@1.10.1 */
1
+ /*! Package version @n8n/chat@1.11.1 */
2
2
  import * as Vue from "vue";
3
3
  import { Comment, Fragment, Teleport, Text, Transition, camelize, cloneVNode, computed, createApp, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createStaticVNode, createTextVNode, createVNode, customRef, defineComponent, getCurrentInstance, getCurrentScope, guardReactiveProps, h, inject, isRef, mergeDefaults, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onBeforeMount, onBeforeUnmount, onDeactivated, onMounted, onScopeDispose, onUnmounted, onUpdated, openBlock, popScopeId, provide, pushScopeId, reactive, readonly, ref, renderList, renderSlot, resolveComponent, resolveDirective, resolveDynamicComponent, shallowRef, toDisplayString, toHandlerKey, toHandlers, toRaw, toRef, toRefs, toValue, triggerRef, unref, useAttrs, useCssModule, useSlots, vModelText, vShow, warn, watch, watchEffect, watchPostEffect, withCtx, withDirectives, withKeys, withModifiers } from "vue";
4
4
  var __create = Object.create, __defProp$1 = Object.defineProperty, __getOwnPropDesc = Object.getOwnPropertyDescriptor, __getOwnPropNames = Object.getOwnPropertyNames, __getProtoOf = Object.getPrototypeOf, __hasOwnProp$1 = Object.prototype.hasOwnProperty, __esmMin = (e, t) => () => (e && (t = e(e = 0)), t), __commonJSMin = (e, t) => () => (t || e((t = { exports: {} }).exports, t), t.exports), __export = (e, t) => {
@@ -19,7 +19,28 @@ var __create = Object.create, __defProp$1 = Object.defineProperty, __getOwnPropD
19
19
  }, __toESM = (e, t, n) => (n = e == null ? {} : __create(__getProtoOf(e)), __copyProps(t || !e || !e.__esModule ? __defProp$1(n, "default", {
20
20
  value: e,
21
21
  enumerable: !0
22
- }) : n, e)), __toCommonJS = (e) => __hasOwnProp$1.call(e, "module.exports") ? e["module.exports"] : __copyProps(__defProp$1({}, "__esModule", { value: !0 }), e), Button_default$1 = /* @__PURE__ */ defineComponent({
22
+ }) : n, e)), __toCommonJS = (e) => __hasOwnProp$1.call(e, "module.exports") ? e["module.exports"] : __copyProps(__defProp$1({}, "__esModule", { value: !0 }), e);
23
+ function useChat() {
24
+ return inject(ChatSymbol);
25
+ }
26
+ function useOptions() {
27
+ return { options: inject(ChatOptionsSymbol) };
28
+ }
29
+ function useI18n() {
30
+ let { options: e } = useOptions(), t = e?.defaultLanguage ?? "en";
31
+ function n(n) {
32
+ let i = e?.i18n?.[t]?.[n];
33
+ return isRef(i) ? i.value : i ?? n;
34
+ }
35
+ function i(n) {
36
+ return !!e?.i18n?.[t]?.[n];
37
+ }
38
+ return {
39
+ t: n,
40
+ te: i
41
+ };
42
+ }
43
+ var Button_default$1 = /* @__PURE__ */ defineComponent({
23
44
  inheritAttrs: !1,
24
45
  __name: "Button",
25
46
  props: {
@@ -8555,15 +8576,22 @@ var require_markdown_it_link_attributes = /* @__PURE__ */ __commonJSMin(((e, t)
8555
8576
  buttons: {}
8556
8577
  },
8557
8578
  setup(e) {
8558
- let t = ref(null), i = async (e, n) => {
8559
- t.value === null && (await fetch(e)).ok && (t.value = n);
8579
+ let t = useOptions(), i = ref(null), o = (e, n) => {
8580
+ try {
8581
+ let o = new URL(t.options.webhookUrl).origin;
8582
+ return new URL(e, window.location.href).origin === o ? i.value === null || n === i.value : !1;
8583
+ } catch {
8584
+ return !1;
8585
+ }
8586
+ }, s = async (e, t) => {
8587
+ i.value === null && (await fetch(e)).ok && (i.value = t);
8560
8588
  };
8561
- return (o, s) => (openBlock(), createElementBlock("div", null, [createVNode(MarkdownRenderer_default, { text: e.text }, null, 8, ["text"]), createElementVNode("div", { class: normalizeClass(o.$style.buttons) }, [(openBlock(!0), createElementBlock(Fragment, null, renderList(e.buttons, (e, o) => (openBlock(), createElementBlock(Fragment, { key: e.text }, [t.value === null || o === t.value ? (openBlock(), createBlock(Button_default$1, {
8589
+ return (t, l) => (openBlock(), createElementBlock("div", null, [createVNode(MarkdownRenderer_default, { text: e.text }, null, 8, ["text"]), createElementVNode("div", { class: normalizeClass(t.$style.buttons) }, [(openBlock(!0), createElementBlock(Fragment, null, renderList(e.buttons, (e, t) => (openBlock(), createElementBlock(Fragment, { key: e.text }, [o(e.link, t) ? (openBlock(), createBlock(Button_default$1, {
8562
8590
  key: 0,
8563
8591
  element: "button",
8564
8592
  type: e.type,
8565
- disabled: o === t.value,
8566
- onClick: (t) => i(e.link, o)
8593
+ disabled: t === i.value,
8594
+ onClick: (n) => s(e.link, t)
8567
8595
  }, {
8568
8596
  default: withCtx(() => [createTextVNode(toDisplayString(e.text), 1)]),
8569
8597
  _: 2
@@ -9120,28 +9148,7 @@ function render$219(e, t) {
9120
9148
  var close_default = {
9121
9149
  name: "mdi-close",
9122
9150
  render: render$219
9123
- };
9124
- function useChat() {
9125
- return inject(ChatSymbol);
9126
- }
9127
- function useOptions() {
9128
- return { options: inject(ChatOptionsSymbol) };
9129
- }
9130
- function useI18n() {
9131
- let { options: e } = useOptions(), t = e?.defaultLanguage ?? "en";
9132
- function n(n) {
9133
- let i = e?.i18n?.[t]?.[n];
9134
- return isRef(i) ? i.value : i ?? n;
9135
- }
9136
- function i(n) {
9137
- return !!e?.i18n?.[t]?.[n];
9138
- }
9139
- return {
9140
- t: n,
9141
- te: i
9142
- };
9143
- }
9144
- var _hoisted_1$245 = { class: "chat-get-started" }, GetStarted_default = /* @__PURE__ */ defineComponent({
9151
+ }, _hoisted_1$245 = { class: "chat-get-started" }, GetStarted_default = /* @__PURE__ */ defineComponent({
9145
9152
  __name: "GetStarted",
9146
9153
  setup(e) {
9147
9154
  let { t } = useI18n();
@@ -14309,24 +14316,25 @@ var N8nIcon_default = /* @__PURE__ */ __plugin_vue_export_helper_default(/* @__P
14309
14316
  ]));
14310
14317
  }
14311
14318
  }), [["__cssModules", { $style: {
14312
- button: "_button_4mp8u_3",
14313
- xsmall: "_xsmall_4mp8u_56",
14314
- small: "_small_4mp8u_62",
14315
- medium: "_medium_4mp8u_68",
14316
- large: "_large_4mp8u_74",
14317
- xlarge: "_xlarge_4mp8u_80",
14318
- solid: "_solid_4mp8u_86",
14319
- subtle: "_subtle_4mp8u_104",
14320
- outline: "_outline_4mp8u_139",
14321
- ghost: "_ghost_4mp8u_165",
14322
- destructive: "_destructive_4mp8u_180",
14323
- disabled: "_disabled_4mp8u_204",
14324
- loading: "_loading_4mp8u_208",
14325
- iconOnly: "_iconOnly_4mp8u_211",
14326
- "loading-container": "_loading-container_4mp8u_219",
14327
- "button-inner": "_button-inner_4mp8u_226",
14328
- "loading-spinner": "_loading-spinner_4mp8u_243",
14329
- spin: "_spin_4mp8u_1"
14319
+ button: "_button_7el1t_3",
14320
+ xsmall: "_xsmall_7el1t_56",
14321
+ small: "_small_7el1t_62",
14322
+ medium: "_medium_7el1t_68",
14323
+ large: "_large_7el1t_74",
14324
+ xlarge: "_xlarge_7el1t_80",
14325
+ solid: "_solid_7el1t_86",
14326
+ subtle: "_subtle_7el1t_104",
14327
+ outline: "_outline_7el1t_139",
14328
+ ghost: "_ghost_7el1t_165",
14329
+ destructive: "_destructive_7el1t_180",
14330
+ success: "_success_7el1t_204",
14331
+ disabled: "_disabled_7el1t_231",
14332
+ loading: "_loading_7el1t_235",
14333
+ iconOnly: "_iconOnly_7el1t_238",
14334
+ "loading-container": "_loading-container_7el1t_246",
14335
+ "button-inner": "_button-inner_7el1t_253",
14336
+ "loading-spinner": "_loading-spinner_7el1t_270",
14337
+ spin: "_spin_7el1t_1"
14330
14338
  } }]]), N8nText_default = /* @__PURE__ */ __plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
14331
14339
  name: "N8nText",
14332
14340
  __name: "Text",