@squadico/chatbot 1.2.1 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +109 -19
- package/dist/answer-CDGrP8YE.js +1193 -0
- package/dist/answer-CDGrP8YE.js.map +1 -0
- package/dist/answer-DRaV2dVt.cjs +8 -0
- package/dist/answer-DRaV2dVt.cjs.map +1 -0
- package/dist/chatbot-widgets.global.js +4 -0
- package/dist/chatbot-widgets.global.js.map +1 -0
- package/dist/chatbot.global.js +12 -7
- package/dist/chatbot.global.js.map +1 -1
- package/dist/components/ChatbotWidget.d.ts.map +1 -1
- package/dist/components/MessageList.d.ts +4 -1
- package/dist/components/MessageList.d.ts.map +1 -1
- package/dist/components/RichText.d.ts +6 -4
- package/dist/components/RichText.d.ts.map +1 -1
- package/dist/element.d.ts.map +1 -1
- package/dist/extras-ClIRRLqo.js +604 -0
- package/dist/extras-ClIRRLqo.js.map +1 -0
- package/dist/extras-lsCe4xgN.cjs +4 -0
- package/dist/extras-lsCe4xgN.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/jsx.d.ts +43 -0
- package/dist/jsx.d.ts.map +1 -1
- package/dist/lib/client.d.ts +8 -4
- package/dist/lib/client.d.ts.map +1 -1
- package/dist/lib/i18n.d.ts +20 -0
- package/dist/lib/i18n.d.ts.map +1 -1
- package/dist/lib/useChat.d.ts.map +1 -1
- package/dist/react.cjs +1 -1
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.ts.map +1 -1
- package/dist/react.js +2 -2
- package/dist/react.js.map +1 -1
- package/dist/src-BjqOavOO.js +1984 -0
- package/dist/src-BjqOavOO.js.map +1 -0
- package/dist/src-DS8P9HdZ.cjs +7 -0
- package/dist/src-DS8P9HdZ.cjs.map +1 -0
- package/dist/types.d.ts +14 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/widgets/approval/SqcApproval.d.ts +17 -0
- package/dist/widgets/approval/SqcApproval.d.ts.map +1 -0
- package/dist/widgets/approval/name.d.ts +3 -0
- package/dist/widgets/approval/name.d.ts.map +1 -0
- package/dist/widgets/chart/SqcChart.d.ts +19 -0
- package/dist/widgets/chart/SqcChart.d.ts.map +1 -0
- package/dist/widgets/chart/draw.d.ts +31 -0
- package/dist/widgets/chart/draw.d.ts.map +1 -0
- package/dist/widgets/chart/png.d.ts +10 -0
- package/dist/widgets/chart/png.d.ts.map +1 -0
- package/dist/widgets/chart/read.d.ts +11 -0
- package/dist/widgets/chart/read.d.ts.map +1 -0
- package/dist/widgets/chart/strings.d.ts +32 -0
- package/dist/widgets/chart/strings.d.ts.map +1 -0
- package/dist/widgets/choices/SqcChoices.d.ts +17 -0
- package/dist/widgets/choices/SqcChoices.d.ts.map +1 -0
- package/dist/widgets/confirm/SqcConfirm.d.ts +12 -0
- package/dist/widgets/confirm/SqcConfirm.d.ts.map +1 -0
- package/dist/widgets/define.d.ts +8 -0
- package/dist/widgets/define.d.ts.map +1 -0
- package/dist/widgets/element.d.ts +26 -0
- package/dist/widgets/element.d.ts.map +1 -0
- package/dist/widgets/extras-loader.d.ts +21 -0
- package/dist/widgets/extras-loader.d.ts.map +1 -0
- package/dist/widgets/extras.d.ts +3 -0
- package/dist/widgets/extras.d.ts.map +1 -0
- package/dist/widgets/extras.global.d.ts +2 -0
- package/dist/widgets/extras.global.d.ts.map +1 -0
- package/dist/widgets/form/SqcForm.d.ts +14 -0
- package/dist/widgets/form/SqcForm.d.ts.map +1 -0
- package/dist/widgets/form/reply.d.ts +7 -0
- package/dist/widgets/form/reply.d.ts.map +1 -0
- package/dist/widgets/i18n.d.ts +4 -0
- package/dist/widgets/i18n.d.ts.map +1 -0
- package/dist/widgets/index.d.ts +10 -0
- package/dist/widgets/index.d.ts.map +1 -0
- package/dist/widgets/inline.d.ts +11 -0
- package/dist/widgets/inline.d.ts.map +1 -0
- package/dist/widgets/live.d.ts +12 -0
- package/dist/widgets/live.d.ts.map +1 -0
- package/dist/widgets/names.d.ts +10 -0
- package/dist/widgets/names.d.ts.map +1 -0
- package/dist/widgets/parse/answer.d.ts +11 -0
- package/dist/widgets/parse/answer.d.ts.map +1 -0
- package/dist/widgets/parse/confirm.d.ts +19 -0
- package/dist/widgets/parse/confirm.d.ts.map +1 -0
- package/dist/widgets/parse/form.d.ts +6 -0
- package/dist/widgets/parse/form.d.ts.map +1 -0
- package/dist/widgets/styles.d.ts +3 -0
- package/dist/widgets/styles.d.ts.map +1 -0
- package/dist/widgets/table/SqcTable.d.ts +16 -0
- package/dist/widgets/table/SqcTable.d.ts.map +1 -0
- package/dist/widgets/types.d.ts +68 -0
- package/dist/widgets/types.d.ts.map +1 -0
- package/dist/widgets.cjs +1 -0
- package/dist/widgets.js +3 -0
- package/package.json +7 -2
- package/dist/components/Approval.d.ts +0 -37
- package/dist/components/Approval.d.ts.map +0 -1
- package/dist/components/Choices.d.ts +0 -27
- package/dist/components/Choices.d.ts.map +0 -1
- package/dist/components/Confirm.d.ts +0 -16
- package/dist/components/Confirm.d.ts.map +0 -1
- package/dist/lib/confirm.d.ts +0 -17
- package/dist/lib/confirm.d.ts.map +0 -1
- package/dist/src-2GKPJcbZ.js +0 -2708
- package/dist/src-2GKPJcbZ.js.map +0 -1
- package/dist/src-CcILETWB.cjs +0 -8
- package/dist/src-CcILETWB.cjs.map +0 -1
package/dist/react.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react.cjs","names":[],"sources":["../src/react.tsx"],"sourcesContent":["/**\n * React wrapper around `<squadico-chatbot>`.\n *\n * import { SquadicoChatbot } from '@squadico/chatbot/react'\n * <SquadicoChatbot context={{ order: { id: 'ORD-1', name: 'Order #1042' } }} onMessage={…} />\n *\n * This is not a second widget: it is a thin adapter (it renders nothing of its\n * own) around the custom element. It gives typed props, React callbacks instead\n * of `addEventListener`, and a `ref` on the imperative API.\n *\n * `react` is an **optional** peer dependency: this subpath is the only one\n * importing it, so a Vue or HTML host never has to install it.\n */\n'use client'\n\nimport { createElement, forwardRef, useEffect, useRef } from 'react'\nimport type { CSSProperties, ReactNode, Ref } from 'react'\nimport { defineChatbot, TAG_NAME } from './index'\nimport { initialOpen } from './lib/openState'\nimport type { ChatbotEventMap, ChatbotOptions, SquadicoChatbotElement } from './types'\n\nexport interface SquadicoChatbotProps extends ChatbotOptions {\n /**\n * Icon of the floating button, in place of the default spark — any React node\n * (`<BotIcon />`, an `<img>`, a font ligature).\n *\n * It is the only option that does not go through an attribute: the panel\n * renders inside a shadow root, where React cannot mount anything. The node is\n * therefore rendered as a child of the custom element, in the host's own tree\n * (where its CSS applies normally), then projected into the button by\n * `slot=\"launcher-icon\"`. It inherits the button's colour, so a\n * `stroke=\"currentColor\"` is enough; the frame is 26 px, and an icon sizing\n * itself in `1em` or `100%` fits it.\n */\n launcherIcon?: ReactNode\n onOpen?: (detail: ChatbotEventMap['chatbot-open']) => void\n onClose?: (detail: ChatbotEventMap['chatbot-close']) => void\n onMessage?: (detail: ChatbotEventMap['chatbot-message']) => void\n onError?: (detail: ChatbotEventMap['chatbot-error']) => void\n onReset?: (detail: ChatbotEventMap['chatbot-reset']) => void\n /** Set on the custom element — useful to override the `--sqc-*` variables. */\n className?: string\n style?: CSSProperties\n id?: string\n}\n\n/** Options driven by a plain string attribute. */\nconst STRING_ATTRS = {\n embedKey: 'embed-key',\n agent: 'agent',\n heading: 'heading',\n subheading: 'subheading',\n assistantName: 'assistant-name',\n placeholder: 'placeholder',\n greeting: 'greeting',\n width: 'width',\n accent: 'accent',\n theme: 'theme',\n position: 'position',\n layout: 'layout',\n locale: 'locale',\n} as const satisfies Partial<Record<keyof ChatbotOptions, string>>\n\nfunction assignRef(\n target: Ref<SquadicoChatbotElement | null> | undefined,\n node: SquadicoChatbotElement | null,\n): void {\n if (typeof target === 'function') target(node)\n else if (target) (target as { current: SquadicoChatbotElement | null }).current = node\n}\n\nexport const SquadicoChatbot = forwardRef<\n SquadicoChatbotElement | null,\n SquadicoChatbotProps\n>(function SquadicoChatbot(props, forwarded) {\n const host = useRef<SquadicoChatbotElement | null>(null)\n const mounted = useRef(false)\n\n /*\n * Nothing is passed to `createElement` besides `ref` / `class` / `style`:\n * depending on the React version, an unknown prop on a custom element is set\n * either as an attribute or as a property. Everything is therefore written\n * here, for identical behaviour from React 17 to 19.\n */\n useEffect(() => {\n const element = host.current\n if (!element) return\n\n // `defineChatbot()` already ran when `./index` was imported, but it is\n // called again for safety (it is idempotent), then the upgrade is forced: an\n // element created during hydration may not be upgraded yet, and a property\n // assignment would then shadow the class accessor.\n defineChatbot()\n customElements.upgrade(element)\n\n for (const [prop, attribute] of Object.entries(STRING_ATTRS)) {\n const value = props[prop as keyof typeof STRING_ATTRS]\n if (typeof value === 'string' && value) element.setAttribute(attribute, value)\n else element.removeAttribute(attribute)\n }\n\n if (props.suggestions?.length) {\n element.setAttribute('suggestions', JSON.stringify(props.suggestions))\n } else {\n element.removeAttribute('suggestions')\n }\n\n if (props.persistOpen === false) element.setAttribute('persist-open', 'false')\n else element.removeAttribute('persist-open')\n\n // Objects have no attribute representation: properties.\n element.context = props.context\n element.user = props.user\n element.getSubjectToken = props.getSubjectToken\n\n // `defaultOpen` is only honoured at mount: afterwards opening is driven\n // through the `ref` (`openChat()` / `closeChat()`), not by a render. It goes\n // through the same arbitration as the custom element — the element has\n // already restored the remembered panel when this effect runs, and an\n // `openChat()` on top would reopen what the user had just closed.\n if (!mounted.current) {\n mounted.current = true\n if (initialOpen(props.defaultOpen, props.persistOpen)) element.openChat()\n }\n })\n\n const { onOpen, onClose, onMessage, onError, onReset } = props\n useEffect(() => {\n const element = host.current\n if (!element) return\n\n const handlers: Partial<Record<keyof ChatbotEventMap, (detail: unknown) => void>> = {\n 'chatbot-open': onOpen as ((detail: unknown) => void) | undefined,\n 'chatbot-close': onClose as ((detail: unknown) => void) | undefined,\n 'chatbot-message': onMessage as ((detail: unknown) => void) | undefined,\n 'chatbot-error': onError as ((detail: unknown) => void) | undefined,\n 'chatbot-reset': onReset as ((detail: unknown) => void) | undefined,\n }\n\n const detachers = Object.entries(handlers)\n .filter(([, handler]) => typeof handler === 'function')\n .map(([name, handler]) => {\n const listener = (event: Event): void => {\n handler?.((event as CustomEvent<unknown>).detail)\n }\n element.addEventListener(name, listener)\n return () => element.removeEventListener(name, listener)\n })\n\n return () => detachers.forEach((detach) => detach())\n }, [onOpen, onClose, onMessage, onError, onReset])\n\n return createElement(\n TAG_NAME,\n {\n ref: (node: SquadicoChatbotElement | null) => {\n host.current = node\n assignRef(forwarded, node)\n },\n class: props.className,\n style: props.style,\n id: props.id,\n },\n // Wrapped rather than cloned with a `slot`: an icon component that does not\n // forward unknown props to its root element would never be projected, and a\n // child assigned to no slot is not rendered at all — the icon would vanish\n // without a word.\n props.launcherIcon == null\n ? null\n : createElement('span', { slot: 'launcher-icon' }, props.launcherIcon),\n )\n})\n\nexport { defineChatbot, TAG_NAME } from './index'\nexport type {\n AgentHandle,\n ApprovalDecision,\n ChatbotContext,\n ChatbotEvent,\n ChatbotEventMap,\n ChatbotEventName,\n ChatbotLayout,\n ChatbotOptions,\n ChatbotTheme,\n ChatMessage,\n ChatRole,\n ContextObject,\n ContextValue,\n HostUser,\n LauncherPosition,\n PendingApproval,\n SquadicoChatbotElement,\n} from './types'\n"],"mappings":"6IA+CA,IAAM,EAAe,CACnB,SAAU,YACV,MAAO,QACP,QAAS,UACT,WAAY,aACZ,cAAe,iBACf,YAAa,cACb,SAAU,WACV,MAAO,QACP,OAAQ,SACR,MAAO,QACP,SAAU,WACV,OAAQ,SACR,OAAQ,QACV,EAEA,SAAS,EACP,EACA,EACM,CACF,OAAO,GAAW,WAAY,EAAO,CAAI,EACpC,IAAQ,EAAuD,QAAU,EACpF,CAEA,IAAa,GAAA,EAAkB,EAAA,WAAA,CAG7B,SAAyB,EAAO,EAAW,CAC3C,IAAM,GAAA,EAAO,EAAA,OAAA,CAAsC,IAAI,EACjD,GAAA,EAAU,EAAA,OAAA,CAAO,EAAK,GAQ5B,EAAA,EAAA,UAAA,KAAgB,CACd,IAAM,EAAU,EAAK,QAChB,KAOL,CADA,EAAA,EAAc,EACd,eAAe,QAAQ,CAAO,EAE9B,IAAK,GAAM,CAAC,EAAM,KAAc,OAAO,QAAQ,CAAY,EAAG,CAC5D,IAAM,EAAQ,EAAM,GAChB,OAAO,GAAU,UAAY,EAAO,EAAQ,aAAa,EAAW,CAAK,EACxE,EAAQ,gBAAgB,CAAS,CACxC,CAEI,EAAM,aAAa,OACrB,EAAQ,aAAa,cAAe,KAAK,UAAU,EAAM,WAAW,CAAC,EAErE,EAAQ,gBAAgB,aAAa,EAGnC,EAAM,cAAgB,GAAO,EAAQ,aAAa,eAAgB,OAAO,EACxE,EAAQ,gBAAgB,cAAc,EAG3C,EAAQ,QAAU,EAAM,QACxB,EAAQ,KAAO,EAAM,KACrB,EAAQ,gBAAkB,EAAM,gBAO3B,EAAQ,UACX,EAAQ,QAAU,GACd,EAAA,EAAY,EAAM,YAAa,EAAM,WAAW,GAAG,EAAQ,SAAS,
|
|
1
|
+
{"version":3,"file":"react.cjs","names":[],"sources":["../src/react.tsx"],"sourcesContent":["/**\n * React wrapper around `<squadico-chatbot>`.\n *\n * import { SquadicoChatbot } from '@squadico/chatbot/react'\n * <SquadicoChatbot context={{ order: { id: 'ORD-1', name: 'Order #1042' } }} onMessage={…} />\n *\n * This is not a second widget: it is a thin adapter (it renders nothing of its\n * own) around the custom element. It gives typed props, React callbacks instead\n * of `addEventListener`, and a `ref` on the imperative API.\n *\n * `react` is an **optional** peer dependency: this subpath is the only one\n * importing it, so a Vue or HTML host never has to install it.\n */\n'use client'\n\nimport { createElement, forwardRef, useEffect, useRef } from 'react'\nimport type { CSSProperties, ReactNode, Ref } from 'react'\nimport { defineChatbot, TAG_NAME } from './index'\nimport { initialOpen } from './lib/openState'\nimport type { ChatbotEventMap, ChatbotOptions, SquadicoChatbotElement } from './types'\n\nexport interface SquadicoChatbotProps extends ChatbotOptions {\n /**\n * Icon of the floating button, in place of the default spark — any React node\n * (`<BotIcon />`, an `<img>`, a font ligature).\n *\n * It is the only option that does not go through an attribute: the panel\n * renders inside a shadow root, where React cannot mount anything. The node is\n * therefore rendered as a child of the custom element, in the host's own tree\n * (where its CSS applies normally), then projected into the button by\n * `slot=\"launcher-icon\"`. It inherits the button's colour, so a\n * `stroke=\"currentColor\"` is enough; the frame is 26 px, and an icon sizing\n * itself in `1em` or `100%` fits it.\n */\n launcherIcon?: ReactNode\n onOpen?: (detail: ChatbotEventMap['chatbot-open']) => void\n onClose?: (detail: ChatbotEventMap['chatbot-close']) => void\n onMessage?: (detail: ChatbotEventMap['chatbot-message']) => void\n onError?: (detail: ChatbotEventMap['chatbot-error']) => void\n onReset?: (detail: ChatbotEventMap['chatbot-reset']) => void\n /** Set on the custom element — useful to override the `--sqc-*` variables. */\n className?: string\n style?: CSSProperties\n id?: string\n}\n\n/** Options driven by a plain string attribute. */\nconst STRING_ATTRS = {\n embedKey: 'embed-key',\n agent: 'agent',\n heading: 'heading',\n subheading: 'subheading',\n assistantName: 'assistant-name',\n placeholder: 'placeholder',\n greeting: 'greeting',\n width: 'width',\n accent: 'accent',\n theme: 'theme',\n position: 'position',\n layout: 'layout',\n locale: 'locale',\n} as const satisfies Partial<Record<keyof ChatbotOptions, string>>\n\nfunction assignRef(\n target: Ref<SquadicoChatbotElement | null> | undefined,\n node: SquadicoChatbotElement | null,\n): void {\n if (typeof target === 'function') target(node)\n else if (target) (target as { current: SquadicoChatbotElement | null }).current = node\n}\n\nexport const SquadicoChatbot = forwardRef<\n SquadicoChatbotElement | null,\n SquadicoChatbotProps\n>(function SquadicoChatbot(props, forwarded) {\n const host = useRef<SquadicoChatbotElement | null>(null)\n const mounted = useRef(false)\n\n /*\n * Nothing is passed to `createElement` besides `ref` / `class` / `style`:\n * depending on the React version, an unknown prop on a custom element is set\n * either as an attribute or as a property. Everything is therefore written\n * here, for identical behaviour from React 17 to 19.\n */\n useEffect(() => {\n const element = host.current\n if (!element) return\n\n // `defineChatbot()` already ran when `./index` was imported, but it is\n // called again for safety (it is idempotent), then the upgrade is forced: an\n // element created during hydration may not be upgraded yet, and a property\n // assignment would then shadow the class accessor.\n defineChatbot()\n customElements.upgrade(element)\n\n for (const [prop, attribute] of Object.entries(STRING_ATTRS)) {\n const value = props[prop as keyof typeof STRING_ATTRS]\n if (typeof value === 'string' && value) element.setAttribute(attribute, value)\n else element.removeAttribute(attribute)\n }\n\n if (props.suggestions?.length) {\n element.setAttribute('suggestions', JSON.stringify(props.suggestions))\n } else {\n element.removeAttribute('suggestions')\n }\n\n if (props.persistOpen === false) element.setAttribute('persist-open', 'false')\n else element.removeAttribute('persist-open')\n\n if (props.showContext === false) element.setAttribute('show-context', 'false')\n else element.removeAttribute('show-context')\n\n // Objects have no attribute representation: properties.\n element.context = props.context\n element.user = props.user\n element.getSubjectToken = props.getSubjectToken\n\n // `defaultOpen` is only honoured at mount: afterwards opening is driven\n // through the `ref` (`openChat()` / `closeChat()`), not by a render. It goes\n // through the same arbitration as the custom element — the element has\n // already restored the remembered panel when this effect runs, and an\n // `openChat()` on top would reopen what the user had just closed.\n if (!mounted.current) {\n mounted.current = true\n if (initialOpen(props.defaultOpen, props.persistOpen)) element.openChat()\n }\n })\n\n const { onOpen, onClose, onMessage, onError, onReset } = props\n useEffect(() => {\n const element = host.current\n if (!element) return\n\n const handlers: Partial<Record<keyof ChatbotEventMap, (detail: unknown) => void>> = {\n 'chatbot-open': onOpen as ((detail: unknown) => void) | undefined,\n 'chatbot-close': onClose as ((detail: unknown) => void) | undefined,\n 'chatbot-message': onMessage as ((detail: unknown) => void) | undefined,\n 'chatbot-error': onError as ((detail: unknown) => void) | undefined,\n 'chatbot-reset': onReset as ((detail: unknown) => void) | undefined,\n }\n\n const detachers = Object.entries(handlers)\n .filter(([, handler]) => typeof handler === 'function')\n .map(([name, handler]) => {\n const listener = (event: Event): void => {\n handler?.((event as CustomEvent<unknown>).detail)\n }\n element.addEventListener(name, listener)\n return () => element.removeEventListener(name, listener)\n })\n\n return () => detachers.forEach((detach) => detach())\n }, [onOpen, onClose, onMessage, onError, onReset])\n\n return createElement(\n TAG_NAME,\n {\n ref: (node: SquadicoChatbotElement | null) => {\n host.current = node\n assignRef(forwarded, node)\n },\n class: props.className,\n style: props.style,\n id: props.id,\n },\n // Wrapped rather than cloned with a `slot`: an icon component that does not\n // forward unknown props to its root element would never be projected, and a\n // child assigned to no slot is not rendered at all — the icon would vanish\n // without a word.\n props.launcherIcon == null\n ? null\n : createElement('span', { slot: 'launcher-icon' }, props.launcherIcon),\n )\n})\n\nexport { defineChatbot, TAG_NAME } from './index'\nexport type {\n AgentHandle,\n ApprovalDecision,\n ChatbotContext,\n ChatbotEvent,\n ChatbotEventMap,\n ChatbotEventName,\n ChatbotLayout,\n ChatbotOptions,\n ChatbotTheme,\n ChatMessage,\n ChatRole,\n ContextObject,\n ContextValue,\n HostUser,\n LauncherPosition,\n PendingApproval,\n SquadicoChatbotElement,\n} from './types'\n"],"mappings":"6IA+CA,IAAM,EAAe,CACnB,SAAU,YACV,MAAO,QACP,QAAS,UACT,WAAY,aACZ,cAAe,iBACf,YAAa,cACb,SAAU,WACV,MAAO,QACP,OAAQ,SACR,MAAO,QACP,SAAU,WACV,OAAQ,SACR,OAAQ,QACV,EAEA,SAAS,EACP,EACA,EACM,CACF,OAAO,GAAW,WAAY,EAAO,CAAI,EACpC,IAAQ,EAAuD,QAAU,EACpF,CAEA,IAAa,GAAA,EAAkB,EAAA,WAAA,CAG7B,SAAyB,EAAO,EAAW,CAC3C,IAAM,GAAA,EAAO,EAAA,OAAA,CAAsC,IAAI,EACjD,GAAA,EAAU,EAAA,OAAA,CAAO,EAAK,GAQ5B,EAAA,EAAA,UAAA,KAAgB,CACd,IAAM,EAAU,EAAK,QAChB,KAOL,CADA,EAAA,EAAc,EACd,eAAe,QAAQ,CAAO,EAE9B,IAAK,GAAM,CAAC,EAAM,KAAc,OAAO,QAAQ,CAA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,QAAU,EACf,EAAU,EAAW,CAAI,CAC3B,EACA,MAAO,EAAM,UACb,MAAO,EAAM,MACb,GAAI,EAAM,EACZ,EAKA,EAAM,cAAgB,KAClB,MAAA,EACA,EAAA,cAAA,CAAc,OAAQ,CAAE,KAAM,eAAgB,EAAG,EAAM,YAAY,CACzE,CACF,CAAC"}
|
package/dist/react.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../src/react.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAO,MAAM,OAAO,CAAA;AAG1D,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAA;AAEtF,MAAM,WAAW,oBAAqB,SAAQ,cAAc;IAC1D;;;;;;;;;;;OAWG;IACH,YAAY,CAAC,EAAE,SAAS,CAAA;IACxB,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,eAAe,CAAC,cAAc,CAAC,KAAK,IAAI,CAAA;IAC1D,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,eAAe,CAAC,eAAe,CAAC,KAAK,IAAI,CAAA;IAC5D,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,eAAe,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAA;IAChE,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,eAAe,CAAC,eAAe,CAAC,KAAK,IAAI,CAAA;IAC5D,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,eAAe,CAAC,eAAe,CAAC,KAAK,IAAI,CAAA;IAC5D,8EAA8E;IAC9E,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE,aAAa,CAAA;IACrB,EAAE,CAAC,EAAE,MAAM,CAAA;CACZ;AA2BD,eAAO,MAAM,eAAe,
|
|
1
|
+
{"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../src/react.tsx"],"names":[],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-
import { n as e, o as t, t as n } from "./src-
|
|
2
|
+
import { n as e, o as t, t as n } from "./src-BjqOavOO.js";
|
|
3
3
|
import { createElement as r, forwardRef as i, useEffect as a, useRef as o } from "react";
|
|
4
4
|
//#region src/react.tsx
|
|
5
5
|
var s = {
|
|
@@ -30,7 +30,7 @@ var l = i(function(i, l) {
|
|
|
30
30
|
let r = i[e];
|
|
31
31
|
typeof r == "string" && r ? n.setAttribute(t, r) : n.removeAttribute(t);
|
|
32
32
|
}
|
|
33
|
-
i.suggestions?.length ? n.setAttribute("suggestions", JSON.stringify(i.suggestions)) : n.removeAttribute("suggestions"), i.persistOpen === !1 ? n.setAttribute("persist-open", "false") : n.removeAttribute("persist-open"), n.context = i.context, n.user = i.user, n.getSubjectToken = i.getSubjectToken, d.current || (d.current = !0, t(i.defaultOpen, i.persistOpen) && n.openChat());
|
|
33
|
+
i.suggestions?.length ? n.setAttribute("suggestions", JSON.stringify(i.suggestions)) : n.removeAttribute("suggestions"), i.persistOpen === !1 ? n.setAttribute("persist-open", "false") : n.removeAttribute("persist-open"), i.showContext === !1 ? n.setAttribute("show-context", "false") : n.removeAttribute("show-context"), n.context = i.context, n.user = i.user, n.getSubjectToken = i.getSubjectToken, d.current || (d.current = !0, t(i.defaultOpen, i.persistOpen) && n.openChat());
|
|
34
34
|
}
|
|
35
35
|
});
|
|
36
36
|
let { onOpen: f, onClose: p, onMessage: m, onError: h, onReset: g } = i;
|
package/dist/react.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react.js","names":[],"sources":["../src/react.tsx"],"sourcesContent":["/**\n * React wrapper around `<squadico-chatbot>`.\n *\n * import { SquadicoChatbot } from '@squadico/chatbot/react'\n * <SquadicoChatbot context={{ order: { id: 'ORD-1', name: 'Order #1042' } }} onMessage={…} />\n *\n * This is not a second widget: it is a thin adapter (it renders nothing of its\n * own) around the custom element. It gives typed props, React callbacks instead\n * of `addEventListener`, and a `ref` on the imperative API.\n *\n * `react` is an **optional** peer dependency: this subpath is the only one\n * importing it, so a Vue or HTML host never has to install it.\n */\n'use client'\n\nimport { createElement, forwardRef, useEffect, useRef } from 'react'\nimport type { CSSProperties, ReactNode, Ref } from 'react'\nimport { defineChatbot, TAG_NAME } from './index'\nimport { initialOpen } from './lib/openState'\nimport type { ChatbotEventMap, ChatbotOptions, SquadicoChatbotElement } from './types'\n\nexport interface SquadicoChatbotProps extends ChatbotOptions {\n /**\n * Icon of the floating button, in place of the default spark — any React node\n * (`<BotIcon />`, an `<img>`, a font ligature).\n *\n * It is the only option that does not go through an attribute: the panel\n * renders inside a shadow root, where React cannot mount anything. The node is\n * therefore rendered as a child of the custom element, in the host's own tree\n * (where its CSS applies normally), then projected into the button by\n * `slot=\"launcher-icon\"`. It inherits the button's colour, so a\n * `stroke=\"currentColor\"` is enough; the frame is 26 px, and an icon sizing\n * itself in `1em` or `100%` fits it.\n */\n launcherIcon?: ReactNode\n onOpen?: (detail: ChatbotEventMap['chatbot-open']) => void\n onClose?: (detail: ChatbotEventMap['chatbot-close']) => void\n onMessage?: (detail: ChatbotEventMap['chatbot-message']) => void\n onError?: (detail: ChatbotEventMap['chatbot-error']) => void\n onReset?: (detail: ChatbotEventMap['chatbot-reset']) => void\n /** Set on the custom element — useful to override the `--sqc-*` variables. */\n className?: string\n style?: CSSProperties\n id?: string\n}\n\n/** Options driven by a plain string attribute. */\nconst STRING_ATTRS = {\n embedKey: 'embed-key',\n agent: 'agent',\n heading: 'heading',\n subheading: 'subheading',\n assistantName: 'assistant-name',\n placeholder: 'placeholder',\n greeting: 'greeting',\n width: 'width',\n accent: 'accent',\n theme: 'theme',\n position: 'position',\n layout: 'layout',\n locale: 'locale',\n} as const satisfies Partial<Record<keyof ChatbotOptions, string>>\n\nfunction assignRef(\n target: Ref<SquadicoChatbotElement | null> | undefined,\n node: SquadicoChatbotElement | null,\n): void {\n if (typeof target === 'function') target(node)\n else if (target) (target as { current: SquadicoChatbotElement | null }).current = node\n}\n\nexport const SquadicoChatbot = forwardRef<\n SquadicoChatbotElement | null,\n SquadicoChatbotProps\n>(function SquadicoChatbot(props, forwarded) {\n const host = useRef<SquadicoChatbotElement | null>(null)\n const mounted = useRef(false)\n\n /*\n * Nothing is passed to `createElement` besides `ref` / `class` / `style`:\n * depending on the React version, an unknown prop on a custom element is set\n * either as an attribute or as a property. Everything is therefore written\n * here, for identical behaviour from React 17 to 19.\n */\n useEffect(() => {\n const element = host.current\n if (!element) return\n\n // `defineChatbot()` already ran when `./index` was imported, but it is\n // called again for safety (it is idempotent), then the upgrade is forced: an\n // element created during hydration may not be upgraded yet, and a property\n // assignment would then shadow the class accessor.\n defineChatbot()\n customElements.upgrade(element)\n\n for (const [prop, attribute] of Object.entries(STRING_ATTRS)) {\n const value = props[prop as keyof typeof STRING_ATTRS]\n if (typeof value === 'string' && value) element.setAttribute(attribute, value)\n else element.removeAttribute(attribute)\n }\n\n if (props.suggestions?.length) {\n element.setAttribute('suggestions', JSON.stringify(props.suggestions))\n } else {\n element.removeAttribute('suggestions')\n }\n\n if (props.persistOpen === false) element.setAttribute('persist-open', 'false')\n else element.removeAttribute('persist-open')\n\n // Objects have no attribute representation: properties.\n element.context = props.context\n element.user = props.user\n element.getSubjectToken = props.getSubjectToken\n\n // `defaultOpen` is only honoured at mount: afterwards opening is driven\n // through the `ref` (`openChat()` / `closeChat()`), not by a render. It goes\n // through the same arbitration as the custom element — the element has\n // already restored the remembered panel when this effect runs, and an\n // `openChat()` on top would reopen what the user had just closed.\n if (!mounted.current) {\n mounted.current = true\n if (initialOpen(props.defaultOpen, props.persistOpen)) element.openChat()\n }\n })\n\n const { onOpen, onClose, onMessage, onError, onReset } = props\n useEffect(() => {\n const element = host.current\n if (!element) return\n\n const handlers: Partial<Record<keyof ChatbotEventMap, (detail: unknown) => void>> = {\n 'chatbot-open': onOpen as ((detail: unknown) => void) | undefined,\n 'chatbot-close': onClose as ((detail: unknown) => void) | undefined,\n 'chatbot-message': onMessage as ((detail: unknown) => void) | undefined,\n 'chatbot-error': onError as ((detail: unknown) => void) | undefined,\n 'chatbot-reset': onReset as ((detail: unknown) => void) | undefined,\n }\n\n const detachers = Object.entries(handlers)\n .filter(([, handler]) => typeof handler === 'function')\n .map(([name, handler]) => {\n const listener = (event: Event): void => {\n handler?.((event as CustomEvent<unknown>).detail)\n }\n element.addEventListener(name, listener)\n return () => element.removeEventListener(name, listener)\n })\n\n return () => detachers.forEach((detach) => detach())\n }, [onOpen, onClose, onMessage, onError, onReset])\n\n return createElement(\n TAG_NAME,\n {\n ref: (node: SquadicoChatbotElement | null) => {\n host.current = node\n assignRef(forwarded, node)\n },\n class: props.className,\n style: props.style,\n id: props.id,\n },\n // Wrapped rather than cloned with a `slot`: an icon component that does not\n // forward unknown props to its root element would never be projected, and a\n // child assigned to no slot is not rendered at all — the icon would vanish\n // without a word.\n props.launcherIcon == null\n ? null\n : createElement('span', { slot: 'launcher-icon' }, props.launcherIcon),\n )\n})\n\nexport { defineChatbot, TAG_NAME } from './index'\nexport type {\n AgentHandle,\n ApprovalDecision,\n ChatbotContext,\n ChatbotEvent,\n ChatbotEventMap,\n ChatbotEventName,\n ChatbotLayout,\n ChatbotOptions,\n ChatbotTheme,\n ChatMessage,\n ChatRole,\n ContextObject,\n ContextValue,\n HostUser,\n LauncherPosition,\n PendingApproval,\n SquadicoChatbotElement,\n} from './types'\n"],"mappings":";;;;AA+CA,IAAM,IAAe;CACnB,UAAU;CACV,OAAO;CACP,SAAS;CACT,YAAY;CACZ,eAAe;CACf,aAAa;CACb,UAAU;CACV,OAAO;CACP,QAAQ;CACR,OAAO;CACP,UAAU;CACV,QAAQ;CACR,QAAQ;AACV;AAEA,SAAS,EACP,GACA,GACM;CACN,AAAI,OAAO,KAAW,aAAY,EAAO,CAAI,IACpC,MAAQ,EAAuD,UAAU;AACpF;AAEA,IAAa,IAAkB,EAG7B,SAAyB,GAAO,GAAW;CAC3C,IAAM,IAAO,EAAsC,IAAI,GACjD,IAAU,EAAO,EAAK;CAQ5B,QAAgB;EACd,IAAM,IAAU,EAAK;EAChB,OAOL;GADA,EAAc,GACd,eAAe,QAAQ,CAAO;GAE9B,KAAK,IAAM,CAAC,GAAM,MAAc,OAAO,QAAQ,CAAY,GAAG;IAC5D,IAAM,IAAQ,EAAM;IACpB,AAAI,OAAO,KAAU,YAAY,IAAO,EAAQ,aAAa,GAAW,CAAK,IACxE,EAAQ,gBAAgB,CAAS;GACxC;
|
|
1
|
+
{"version":3,"file":"react.js","names":[],"sources":["../src/react.tsx"],"sourcesContent":["/**\n * React wrapper around `<squadico-chatbot>`.\n *\n * import { SquadicoChatbot } from '@squadico/chatbot/react'\n * <SquadicoChatbot context={{ order: { id: 'ORD-1', name: 'Order #1042' } }} onMessage={…} />\n *\n * This is not a second widget: it is a thin adapter (it renders nothing of its\n * own) around the custom element. It gives typed props, React callbacks instead\n * of `addEventListener`, and a `ref` on the imperative API.\n *\n * `react` is an **optional** peer dependency: this subpath is the only one\n * importing it, so a Vue or HTML host never has to install it.\n */\n'use client'\n\nimport { createElement, forwardRef, useEffect, useRef } from 'react'\nimport type { CSSProperties, ReactNode, Ref } from 'react'\nimport { defineChatbot, TAG_NAME } from './index'\nimport { initialOpen } from './lib/openState'\nimport type { ChatbotEventMap, ChatbotOptions, SquadicoChatbotElement } from './types'\n\nexport interface SquadicoChatbotProps extends ChatbotOptions {\n /**\n * Icon of the floating button, in place of the default spark — any React node\n * (`<BotIcon />`, an `<img>`, a font ligature).\n *\n * It is the only option that does not go through an attribute: the panel\n * renders inside a shadow root, where React cannot mount anything. The node is\n * therefore rendered as a child of the custom element, in the host's own tree\n * (where its CSS applies normally), then projected into the button by\n * `slot=\"launcher-icon\"`. It inherits the button's colour, so a\n * `stroke=\"currentColor\"` is enough; the frame is 26 px, and an icon sizing\n * itself in `1em` or `100%` fits it.\n */\n launcherIcon?: ReactNode\n onOpen?: (detail: ChatbotEventMap['chatbot-open']) => void\n onClose?: (detail: ChatbotEventMap['chatbot-close']) => void\n onMessage?: (detail: ChatbotEventMap['chatbot-message']) => void\n onError?: (detail: ChatbotEventMap['chatbot-error']) => void\n onReset?: (detail: ChatbotEventMap['chatbot-reset']) => void\n /** Set on the custom element — useful to override the `--sqc-*` variables. */\n className?: string\n style?: CSSProperties\n id?: string\n}\n\n/** Options driven by a plain string attribute. */\nconst STRING_ATTRS = {\n embedKey: 'embed-key',\n agent: 'agent',\n heading: 'heading',\n subheading: 'subheading',\n assistantName: 'assistant-name',\n placeholder: 'placeholder',\n greeting: 'greeting',\n width: 'width',\n accent: 'accent',\n theme: 'theme',\n position: 'position',\n layout: 'layout',\n locale: 'locale',\n} as const satisfies Partial<Record<keyof ChatbotOptions, string>>\n\nfunction assignRef(\n target: Ref<SquadicoChatbotElement | null> | undefined,\n node: SquadicoChatbotElement | null,\n): void {\n if (typeof target === 'function') target(node)\n else if (target) (target as { current: SquadicoChatbotElement | null }).current = node\n}\n\nexport const SquadicoChatbot = forwardRef<\n SquadicoChatbotElement | null,\n SquadicoChatbotProps\n>(function SquadicoChatbot(props, forwarded) {\n const host = useRef<SquadicoChatbotElement | null>(null)\n const mounted = useRef(false)\n\n /*\n * Nothing is passed to `createElement` besides `ref` / `class` / `style`:\n * depending on the React version, an unknown prop on a custom element is set\n * either as an attribute or as a property. Everything is therefore written\n * here, for identical behaviour from React 17 to 19.\n */\n useEffect(() => {\n const element = host.current\n if (!element) return\n\n // `defineChatbot()` already ran when `./index` was imported, but it is\n // called again for safety (it is idempotent), then the upgrade is forced: an\n // element created during hydration may not be upgraded yet, and a property\n // assignment would then shadow the class accessor.\n defineChatbot()\n customElements.upgrade(element)\n\n for (const [prop, attribute] of Object.entries(STRING_ATTRS)) {\n const value = props[prop as keyof typeof STRING_ATTRS]\n if (typeof value === 'string' && value) element.setAttribute(attribute, value)\n else element.removeAttribute(attribute)\n }\n\n if (props.suggestions?.length) {\n element.setAttribute('suggestions', JSON.stringify(props.suggestions))\n } else {\n element.removeAttribute('suggestions')\n }\n\n if (props.persistOpen === false) element.setAttribute('persist-open', 'false')\n else element.removeAttribute('persist-open')\n\n if (props.showContext === false) element.setAttribute('show-context', 'false')\n else element.removeAttribute('show-context')\n\n // Objects have no attribute representation: properties.\n element.context = props.context\n element.user = props.user\n element.getSubjectToken = props.getSubjectToken\n\n // `defaultOpen` is only honoured at mount: afterwards opening is driven\n // through the `ref` (`openChat()` / `closeChat()`), not by a render. It goes\n // through the same arbitration as the custom element — the element has\n // already restored the remembered panel when this effect runs, and an\n // `openChat()` on top would reopen what the user had just closed.\n if (!mounted.current) {\n mounted.current = true\n if (initialOpen(props.defaultOpen, props.persistOpen)) element.openChat()\n }\n })\n\n const { onOpen, onClose, onMessage, onError, onReset } = props\n useEffect(() => {\n const element = host.current\n if (!element) return\n\n const handlers: Partial<Record<keyof ChatbotEventMap, (detail: unknown) => void>> = {\n 'chatbot-open': onOpen as ((detail: unknown) => void) | undefined,\n 'chatbot-close': onClose as ((detail: unknown) => void) | undefined,\n 'chatbot-message': onMessage as ((detail: unknown) => void) | undefined,\n 'chatbot-error': onError as ((detail: unknown) => void) | undefined,\n 'chatbot-reset': onReset as ((detail: unknown) => void) | undefined,\n }\n\n const detachers = Object.entries(handlers)\n .filter(([, handler]) => typeof handler === 'function')\n .map(([name, handler]) => {\n const listener = (event: Event): void => {\n handler?.((event as CustomEvent<unknown>).detail)\n }\n element.addEventListener(name, listener)\n return () => element.removeEventListener(name, listener)\n })\n\n return () => detachers.forEach((detach) => detach())\n }, [onOpen, onClose, onMessage, onError, onReset])\n\n return createElement(\n TAG_NAME,\n {\n ref: (node: SquadicoChatbotElement | null) => {\n host.current = node\n assignRef(forwarded, node)\n },\n class: props.className,\n style: props.style,\n id: props.id,\n },\n // Wrapped rather than cloned with a `slot`: an icon component that does not\n // forward unknown props to its root element would never be projected, and a\n // child assigned to no slot is not rendered at all — the icon would vanish\n // without a word.\n props.launcherIcon == null\n ? null\n : createElement('span', { slot: 'launcher-icon' }, props.launcherIcon),\n )\n})\n\nexport { defineChatbot, TAG_NAME } from './index'\nexport type {\n AgentHandle,\n ApprovalDecision,\n ChatbotContext,\n ChatbotEvent,\n ChatbotEventMap,\n ChatbotEventName,\n ChatbotLayout,\n ChatbotOptions,\n ChatbotTheme,\n ChatMessage,\n ChatRole,\n ContextObject,\n ContextValue,\n HostUser,\n LauncherPosition,\n PendingApproval,\n SquadicoChatbotElement,\n} from './types'\n"],"mappings":";;;;AA+CA,IAAM,IAAe;CACnB,UAAU;CACV,OAAO;CACP,SAAS;CACT,YAAY;CACZ,eAAe;CACf,aAAa;CACb,UAAU;CACV,OAAO;CACP,QAAQ;CACR,OAAO;CACP,UAAU;CACV,QAAQ;CACR,QAAQ;AACV;AAEA,SAAS,EACP,GACA,GACM;CACN,AAAI,OAAO,KAAW,aAAY,EAAO,CAAI,IACpC,MAAQ,EAAuD,UAAU;AACpF;AAEA,IAAa,IAAkB,EAG7B,SAAyB,GAAO,GAAW;CAC3C,IAAM,IAAO,EAAsC,IAAI,GACjD,IAAU,EAAO,EAAK;CAQ5B,QAAgB;EACd,IAAM,IAAU,EAAK;EAChB,OAOL;GADA,EAAc,GACd,eAAe,QAAQ,CAAO;GAE9B,KAAK,IAAM,CAAC,GAAM,MAAc,OAAO,QAAQ,CAAY,GAAG;IAC5D,IAAM,IAAQ,EAAM;IACpB,AAAI,OAAO,KAAU,YAAY,IAAO,EAAQ,aAAa,GAAW,CAAK,IACxE,EAAQ,gBAAgB,CAAS;GACxC;GAwBA,AAtBI,EAAM,aAAa,SACrB,EAAQ,aAAa,eAAe,KAAK,UAAU,EAAM,WAAW,CAAC,IAErE,EAAQ,gBAAgB,aAAa,GAGnC,EAAM,gBAAgB,KAAO,EAAQ,aAAa,gBAAgB,OAAO,IACxE,EAAQ,gBAAgB,cAAc,GAEvC,EAAM,gBAAgB,KAAO,EAAQ,aAAa,gBAAgB,OAAO,IACxE,EAAQ,gBAAgB,cAAc,GAG3C,EAAQ,UAAU,EAAM,SACxB,EAAQ,OAAO,EAAM,MACrB,EAAQ,kBAAkB,EAAM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