@n8n/chat 1.10.0 → 1.11.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.
@@ -0,0 +1 @@
1
+ export {};
@@ -1,4 +1,4 @@
1
- /*! Package version @n8n/chat@1.10.0 */
1
+ /*! Package version @n8n/chat@1.11.0 */
2
2
  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, n) => {
3
3
  let i = {};
4
4
  for (var o in e) __defProp$1(i, o, {
@@ -4672,7 +4672,28 @@ var ssrDirectiveInitialized = !1, initDirectivesForSSR = () => {
4672
4672
  withMemo: () => withMemo,
4673
4673
  withModifiers: () => withModifiers,
4674
4674
  withScopeId: () => withScopeId
4675
- }, 1), compile$1 = () => {}, Button_default$1 = /* @__PURE__ */ defineComponent({
4675
+ }, 1), compile$1 = () => {};
4676
+ function useChat() {
4677
+ return inject(ChatSymbol);
4678
+ }
4679
+ function useOptions() {
4680
+ return { options: inject(ChatOptionsSymbol) };
4681
+ }
4682
+ function useI18n() {
4683
+ let { options: e } = useOptions(), t = e?.defaultLanguage ?? "en";
4684
+ function n(n) {
4685
+ let i = e?.i18n?.[t]?.[n];
4686
+ return isRef(i) ? i.value : i ?? n;
4687
+ }
4688
+ function i(n) {
4689
+ return !!e?.i18n?.[t]?.[n];
4690
+ }
4691
+ return {
4692
+ t: n,
4693
+ te: i
4694
+ };
4695
+ }
4696
+ var Button_default$1 = /* @__PURE__ */ defineComponent({
4676
4697
  inheritAttrs: !1,
4677
4698
  __name: "Button",
4678
4699
  props: {
@@ -13208,15 +13229,22 @@ var require_markdown_it_link_attributes = /* @__PURE__ */ __commonJSMin(((e, t)
13208
13229
  buttons: {}
13209
13230
  },
13210
13231
  setup(e) {
13211
- let t = ref(null), n = async (e, n) => {
13212
- t.value === null && (await fetch(e)).ok && (t.value = n);
13232
+ let t = useOptions(), n = ref(null), i = (e, i) => {
13233
+ try {
13234
+ let o = new URL(t.options.webhookUrl).origin;
13235
+ return new URL(e, window.location.href).origin === o ? n.value === null || i === n.value : !1;
13236
+ } catch {
13237
+ return !1;
13238
+ }
13239
+ }, o = async (e, t) => {
13240
+ n.value === null && (await fetch(e)).ok && (n.value = t);
13213
13241
  };
13214
- return (i, o) => (openBlock(), createElementBlock("div", null, [createVNode(MarkdownRenderer_default, { text: e.text }, null, 8, ["text"]), createBaseVNode("div", { class: normalizeClass(i.$style.buttons) }, [(openBlock(!0), createElementBlock(Fragment, null, renderList(e.buttons, (e, i) => (openBlock(), createElementBlock(Fragment, { key: e.text }, [t.value === null || i === t.value ? (openBlock(), createBlock(Button_default$1, {
13242
+ return (t, s) => (openBlock(), createElementBlock("div", null, [createVNode(MarkdownRenderer_default, { text: e.text }, null, 8, ["text"]), createBaseVNode("div", { class: normalizeClass(t.$style.buttons) }, [(openBlock(!0), createElementBlock(Fragment, null, renderList(e.buttons, (e, t) => (openBlock(), createElementBlock(Fragment, { key: e.text }, [i(e.link, t) ? (openBlock(), createBlock(Button_default$1, {
13215
13243
  key: 0,
13216
13244
  element: "button",
13217
13245
  type: e.type,
13218
- disabled: i === t.value,
13219
- onClick: (t) => n(e.link, i)
13246
+ disabled: t === n.value,
13247
+ onClick: (n) => o(e.link, t)
13220
13248
  }, {
13221
13249
  default: withCtx(() => [createTextVNode(toDisplayString(e.text), 1)]),
13222
13250
  _: 2
@@ -13773,28 +13801,7 @@ function render$219(e, t) {
13773
13801
  var close_default = {
13774
13802
  name: "mdi-close",
13775
13803
  render: render$219
13776
- };
13777
- function useChat() {
13778
- return inject(ChatSymbol);
13779
- }
13780
- function useOptions() {
13781
- return { options: inject(ChatOptionsSymbol) };
13782
- }
13783
- function useI18n() {
13784
- let { options: e } = useOptions(), t = e?.defaultLanguage ?? "en";
13785
- function n(n) {
13786
- let i = e?.i18n?.[t]?.[n];
13787
- return isRef(i) ? i.value : i ?? n;
13788
- }
13789
- function i(n) {
13790
- return !!e?.i18n?.[t]?.[n];
13791
- }
13792
- return {
13793
- t: n,
13794
- te: i
13795
- };
13796
- }
13797
- var _hoisted_1$245 = { class: "chat-get-started" }, GetStarted_default = /* @__PURE__ */ defineComponent({
13804
+ }, _hoisted_1$245 = { class: "chat-get-started" }, GetStarted_default = /* @__PURE__ */ defineComponent({
13798
13805
  __name: "GetStarted",
13799
13806
  setup(e) {
13800
13807
  let { t } = useI18n();
@@ -18941,24 +18948,25 @@ var N8nIcon_default = /* @__PURE__ */ __plugin_vue_export_helper_default(/* @__P
18941
18948
  ]));
18942
18949
  }
18943
18950
  }), [["__cssModules", { $style: {
18944
- button: "_button_wudly_3",
18945
- xsmall: "_xsmall_wudly_55",
18946
- small: "_small_wudly_61",
18947
- medium: "_medium_wudly_67",
18948
- large: "_large_wudly_73",
18949
- xlarge: "_xlarge_wudly_79",
18950
- solid: "_solid_wudly_85",
18951
- subtle: "_subtle_wudly_103",
18952
- outline: "_outline_wudly_138",
18953
- ghost: "_ghost_wudly_164",
18954
- destructive: "_destructive_wudly_179",
18955
- disabled: "_disabled_wudly_203",
18956
- loading: "_loading_wudly_207",
18957
- iconOnly: "_iconOnly_wudly_210",
18958
- "loading-container": "_loading-container_wudly_218",
18959
- "button-inner": "_button-inner_wudly_225",
18960
- "loading-spinner": "_loading-spinner_wudly_242",
18961
- spin: "_spin_wudly_1"
18951
+ button: "_button_7el1t_3",
18952
+ xsmall: "_xsmall_7el1t_56",
18953
+ small: "_small_7el1t_62",
18954
+ medium: "_medium_7el1t_68",
18955
+ large: "_large_7el1t_74",
18956
+ xlarge: "_xlarge_7el1t_80",
18957
+ solid: "_solid_7el1t_86",
18958
+ subtle: "_subtle_7el1t_104",
18959
+ outline: "_outline_7el1t_139",
18960
+ ghost: "_ghost_7el1t_165",
18961
+ destructive: "_destructive_7el1t_180",
18962
+ success: "_success_7el1t_204",
18963
+ disabled: "_disabled_7el1t_231",
18964
+ loading: "_loading_7el1t_235",
18965
+ iconOnly: "_iconOnly_7el1t_238",
18966
+ "loading-container": "_loading-container_7el1t_246",
18967
+ "button-inner": "_button-inner_7el1t_253",
18968
+ "loading-spinner": "_loading-spinner_7el1t_270",
18969
+ spin: "_spin_7el1t_1"
18962
18970
  } }]]), N8nText_default = /* @__PURE__ */ __plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
18963
18971
  name: "N8nText",
18964
18972
  __name: "Text",