@stigmer/embed 0.1.0-dev.20261017064309.g94d062a29f89 → 0.1.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/element.d.ts +4 -8
- package/element.d.ts.map +1 -1
- package/element.js +5 -11
- package/element.js.map +1 -1
- package/embed.global.js +1 -1
- package/jsx.d.ts +2 -8
- package/jsx.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/element.ts +5 -11
- package/src/jsx.ts +2 -8
package/element.d.ts
CHANGED
|
@@ -7,14 +7,10 @@
|
|
|
7
7
|
* <stigmer-agent channel="chn_01j9z3k8f2q4m6n7p8r9s0t1v2"></stigmer-agent>
|
|
8
8
|
* ```
|
|
9
9
|
*
|
|
10
|
-
* `channel` is the web channel's id
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* The attribute was once called `share`. Pages already carrying
|
|
16
|
-
* `share="…"` keep working: the element reads it when `channel` is absent,
|
|
17
|
-
* and `channel` wins when both are present.
|
|
10
|
+
* `channel` is the web channel's id: the hosted chat link
|
|
11
|
+
* `/chat/<channel id>` names nothing else, so no rename of the channel's
|
|
12
|
+
* organization can break an embed and no later holder of that
|
|
13
|
+
* organization's name can take it over.
|
|
18
14
|
*
|
|
19
15
|
* The element renders a cross-origin iframe onto the hosted chat page — the
|
|
20
16
|
* iframe is the isolation boundary; no Stigmer UI code runs in the host page.
|
package/element.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"element.d.ts","sourceRoot":"","sources":["src/element.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"element.d.ts","sourceRoot":"","sources":["src/element.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAyBH,mFAAmF;AACnF,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAExD;AAED;;;;;;;;GAQG;AACH,QAAA,MAAM,WAAW,EAEZ,OAAO,WAAW,CAAC;AAExB,qBAAa,mBAAoB,SAAQ,WAAW;IAClD,MAAM,KAAK,kBAAkB,IAAI,SAAS,MAAM,EAAE,CAEjD;IAED,OAAO,CAAC,MAAM,CAAkC;IAChD,OAAO,CAAC,IAAI,CAA0B;IAEtC,iBAAiB,IAAI,IAAI;IAIzB,oBAAoB,IAAI,IAAI;IAI5B,wBAAwB,IAAI,IAAI;IAQhC,OAAO,CAAC,MAAM;IAqDd,OAAO,CAAC,MAAM;CAMf;AA4CD,gEAAgE;AAChE,wBAAgB,kBAAkB,IAAI,IAAI,CAKzC"}
|
package/element.js
CHANGED
|
@@ -7,14 +7,10 @@
|
|
|
7
7
|
* <stigmer-agent channel="chn_01j9z3k8f2q4m6n7p8r9s0t1v2"></stigmer-agent>
|
|
8
8
|
* ```
|
|
9
9
|
*
|
|
10
|
-
* `channel` is the web channel's id
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* The attribute was once called `share`. Pages already carrying
|
|
16
|
-
* `share="…"` keep working: the element reads it when `channel` is absent,
|
|
17
|
-
* and `channel` wins when both are present.
|
|
10
|
+
* `channel` is the web channel's id: the hosted chat link
|
|
11
|
+
* `/chat/<channel id>` names nothing else, so no rename of the channel's
|
|
12
|
+
* organization can break an embed and no later holder of that
|
|
13
|
+
* organization's name can take it over.
|
|
18
14
|
*
|
|
19
15
|
* The element renders a cross-origin iframe onto the hosted chat page — the
|
|
20
16
|
* iframe is the isolation boundary; no Stigmer UI code runs in the host page.
|
|
@@ -26,7 +22,6 @@ import { createEmbedHost } from "./host.js";
|
|
|
26
22
|
/** Attribute-driven configuration of `<stigmer-agent>`. */
|
|
27
23
|
const OBSERVED_ATTRIBUTES = [
|
|
28
24
|
"channel",
|
|
29
|
-
"share",
|
|
30
25
|
"token",
|
|
31
26
|
"theme",
|
|
32
27
|
"width",
|
|
@@ -78,8 +73,7 @@ export class StigmerAgentElement extends BaseElement {
|
|
|
78
73
|
}
|
|
79
74
|
attach() {
|
|
80
75
|
this.detach();
|
|
81
|
-
|
|
82
|
-
const channel = this.getAttribute("channel") || this.getAttribute("share");
|
|
76
|
+
const channel = this.getAttribute("channel");
|
|
83
77
|
const appOrigin = this.getAttribute("app-origin") ?? defaultAppOrigin;
|
|
84
78
|
if (!channel) {
|
|
85
79
|
console.error("[stigmer-agent] the channel attribute is required");
|
package/element.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"element.js","sourceRoot":"","sources":["src/element.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"element.js","sourceRoot":"","sources":["src/element.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,eAAe,EAAkB,MAAM,WAAW,CAAC;AAE5D,2DAA2D;AAC3D,MAAM,mBAAmB,GAAG;IAC1B,SAAS;IACT,OAAO;IACP,OAAO;IACP,OAAO;IACP,QAAQ;IACR,YAAY;CACJ,CAAC;AAEX,4DAA4D;AAC5D,MAAM,aAAa,GAAG,OAAO,CAAC;AAC9B,MAAM,cAAc,GAAG,OAAO,CAAC;AAE/B;;;;GAIG;AACH,IAAI,gBAAgB,GAAkB,IAAI,CAAC;AAE3C,mFAAmF;AACnF,MAAM,UAAU,mBAAmB,CAAC,MAAc;IAChD,gBAAgB,GAAG,MAAM,CAAC;AAC5B,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,GAAG,CAClB,OAAO,WAAW,KAAK,WAAW,CAAC,CAAC,CAAC;CAAQ,CAAC,CAAC,CAAC,WAAW,CACtC,CAAC;AAExB,MAAM,OAAO,mBAAoB,SAAQ,WAAW;IAClD,MAAM,KAAK,kBAAkB;QAC3B,OAAO,mBAAmB,CAAC;IAC7B,CAAC;IAEO,MAAM,GAA6B,IAAI,CAAC;IACxC,IAAI,GAAqB,IAAI,CAAC;IAEtC,iBAAiB;QACf,IAAI,C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C,GAAG,EAAE,KAAK,CAAC,CAAC;IACnC,CAAC;IACD,MAAM,QAAQ,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;IACrC,IAAI,QAAQ,EAAE,CAAC;QACb,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IAC1C,CAAC;IACD,OAAO,GAAG,CAAC,QAAQ,EAAE,CAAC;AACxB,CAAC;AAED;;;;GAIG;AACH,SAAS,YAAY,CAAC,KAAoB;IACxC,IAAI,KAAK,KAAK,OAAO,IAAI,KAAK,KAAK,MAAM;QAAE,OAAO,KAAK,CAAC;IACxD,IAAI,KAAK,KAAK,MAAM,EAAE,CAAC;QACrB,OAAO,MAAM,CAAC,UAAU,EAAE,CAAC,8BAA8B,CAAC,CAAC,OAAO;YAChE,CAAC,CAAC,MAAM;YACR,CAAC,CAAC,OAAO,CAAC;IACd,CAAC;IACD,yDAAyD;IACzD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAS,SAAS,CAAC,KAAoB,EAAE,QAAgB;IACvD,IAAI,CAAC,KAAK;QAAE,OAAO,QAAQ,CAAC;IAC5B,OAAO,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC;AACpD,CAAC;AAED,gEAAgE;AAChE,MAAM,UAAU,kBAAkB;IAChC,IAAI,OAAO,cAAc,KAAK,WAAW;QAAE,OAAO;IAClD,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,eAAe,CAAC,EAAE,CAAC;QACzC,cAAc,CAAC,MAAM,CAAC,eAAe,EAAE,mBAAmB,CAAC,CAAC;IAC9D,CAAC;AACH,CAAC"}
|
package/embed.global.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var StigmerEmbed=(function(s){"use strict";var k=Object.defineProperty;var M=(s,o,
|
|
1
|
+
var StigmerEmbed=(function(s){"use strict";var k=Object.defineProperty;var M=(s,o,a)=>o in s?k(s,o,{enumerable:!0,configurable:!0,writable:!0,value:a}):s[o]=a;var l=(s,o,a)=>M(s,typeof o!="symbol"?o+"":o,a);const o="stigmer-embed";function y(t){return{source:o,v:1,...t}}function w(t){if(typeof t!="object"||t===null)return null;const e=t;return e.source!==o||e.v!==1||typeof e.type!="string"?null:e}function A(t){const e=w(t);if(!e)return null;switch(e.type){case"hello":case"ready":case"refused":return{type:e.type};default:return null}}function O(t,e,n={}){const r=()=>{var c;(c=t.contentWindow)==null||c.postMessage(y({type:"init"}),e)},i=c=>{var E,b;if(c.source!==t.contentWindow||c.origin!==e)return;const p=A(c.data);if(p)switch(p.type){case"hello":r();break;case"ready":(E=n.onReady)==null||E.call(n);break;case"refused":(b=n.onRefused)==null||b.call(n);break}};return window.addEventListener("message",i),t.addEventListener("load",r),{destroy(){window.removeEventListener("message",i),t.removeEventListener("load",r)}}}const S=["channel","token","theme","width","height","app-origin"],R="400px",T="600px";let d=null;function h(t){d=t}const v=typeof HTMLElement>"u"?class{}:HTMLElement;class g extends v{constructor(){super(...arguments);l(this,"iframe",null);l(this,"host",null)}static get observedAttributes(){return S}connectedCallback(){this.attach()}disconnectedCallback(){this.detach()}attributeChangedCallback(){this.isConnected&&this.attach()}attach(){this.detach();const n=this.getAttribute("channel"),r=this.getAttribute("app-origin")??d;if(!n){console.error("[stigmer-agent] the channel attribute is required");return}if(!r){console.error('[stigmer-agent] no app origin: load embed.js from your Stigmer app origin, or set the app-origin attribute (e.g. app-origin="https://app.stigmer.ai")');return}this.style.display="inline-block",this.style.width=f(this.getAttribute("width"),R),this.style.height=f(this.getAttribute("height"),T);const i=document.createElement("iframe");i.src=C(r,n,this.getAttribute("token"),this.getAttribute("theme")),i.title=this.getAttribute("title")||"Chat with an agent",i.setAttribute("loading","lazy"),i.style.cssText="width:100%;height:100%;border:0;border-radius:12px",this.appendChild(i),this.iframe=i,this.host=O(i,r,{onReady:()=>{this.dispatchEvent(new CustomEvent("stigmer:ready"))},onRefused:()=>{this.style.display="none",this.dispatchEvent(new CustomEvent("stigmer:refused"))}})}detach(){var n,r;(n=this.host)==null||n.destroy(),this.host=null,(r=this.iframe)==null||r.remove(),this.iframe=null}}function C(t,e,n,r){const i=new URL(`/chat/${encodeURIComponent(e)}`,t);n&&i.searchParams.set("k",n);const c=L(r);return c&&i.searchParams.set("theme",c),i.toString()}function L(t){var e;return t==="light"||t==="dark"?t:t==="auto"?(e=window.matchMedia)!=null&&e.call(window,"(prefers-color-scheme: dark)").matches?"dark":"light":null}function f(t,e){return t?/^\d+$/.test(t)?`${t}px`:t:e}function m(){typeof customElements>"u"||customElements.get("stigmer-agent")||customElements.define("stigmer-agent",g)}const u=document.currentScript;return u instanceof HTMLScriptElement&&u.src&&h(new URL(u.src).origin),m(),s.StigmerAgentElement=g,s.defineStigmerAgent=m,s.setDefaultAppOrigin=h,Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}),s})({});
|
package/jsx.d.ts
CHANGED
|
@@ -41,17 +41,11 @@ import type { StigmerAgentElement } from "./element.js";
|
|
|
41
41
|
*/
|
|
42
42
|
interface StigmerAgentAttributes extends ClassAttributes<StigmerAgentElement>, Omit<HTMLAttributes<StigmerAgentElement>, "children"> {
|
|
43
43
|
/**
|
|
44
|
-
* The web channel's id (`
|
|
44
|
+
* The web channel's id (`chn_…`), the one path segment of the hosted
|
|
45
45
|
* chat link. Required at runtime (see above for why the type cannot
|
|
46
|
-
* enforce it)
|
|
46
|
+
* enforce it).
|
|
47
47
|
*/
|
|
48
48
|
channel?: string;
|
|
49
|
-
/**
|
|
50
|
-
* The former name of `channel`.
|
|
51
|
-
*
|
|
52
|
-
* @deprecated use `channel`; pages that carry `share` keep working.
|
|
53
|
-
*/
|
|
54
|
-
share?: string;
|
|
55
49
|
/** Link token for a locked chat link; forwarded as the `?k=` parameter. */
|
|
56
50
|
token?: string;
|
|
57
51
|
/**
|
package/jsx.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":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AAQ,OAAO,CAAC;IACrB,UAAU,GAAG,CAAC;QACZ,UAAU,iBAAiB;YACzB,eAAe,EAAE,sBAAsB,CAAC;SACzC;KACF;CACF;AAGD,OAAO,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stigmer/embed",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "One-line script embed for a Stigmer agent's chat link — a framework-free <stigmer-agent> web component that bootstraps the hosted chat page in an iframe",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
package/src/element.ts
CHANGED
|
@@ -7,14 +7,10 @@
|
|
|
7
7
|
* <stigmer-agent channel="chn_01j9z3k8f2q4m6n7p8r9s0t1v2"></stigmer-agent>
|
|
8
8
|
* ```
|
|
9
9
|
*
|
|
10
|
-
* `channel` is the web channel's id
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* The attribute was once called `share`. Pages already carrying
|
|
16
|
-
* `share="…"` keep working: the element reads it when `channel` is absent,
|
|
17
|
-
* and `channel` wins when both are present.
|
|
10
|
+
* `channel` is the web channel's id: the hosted chat link
|
|
11
|
+
* `/chat/<channel id>` names nothing else, so no rename of the channel's
|
|
12
|
+
* organization can break an embed and no later holder of that
|
|
13
|
+
* organization's name can take it over.
|
|
18
14
|
*
|
|
19
15
|
* The element renders a cross-origin iframe onto the hosted chat page — the
|
|
20
16
|
* iframe is the isolation boundary; no Stigmer UI code runs in the host page.
|
|
@@ -28,7 +24,6 @@ import { createEmbedHost, type EmbedHost } from "./host.js";
|
|
|
28
24
|
/** Attribute-driven configuration of `<stigmer-agent>`. */
|
|
29
25
|
const OBSERVED_ATTRIBUTES = [
|
|
30
26
|
"channel",
|
|
31
|
-
"share",
|
|
32
27
|
"token",
|
|
33
28
|
"theme",
|
|
34
29
|
"width",
|
|
@@ -92,8 +87,7 @@ export class StigmerAgentElement extends BaseElement {
|
|
|
92
87
|
private attach(): void {
|
|
93
88
|
this.detach();
|
|
94
89
|
|
|
95
|
-
|
|
96
|
-
const channel = this.getAttribute("channel") || this.getAttribute("share");
|
|
90
|
+
const channel = this.getAttribute("channel");
|
|
97
91
|
const appOrigin = this.getAttribute("app-origin") ?? defaultAppOrigin;
|
|
98
92
|
if (!channel) {
|
|
99
93
|
console.error("[stigmer-agent] the channel attribute is required");
|
package/src/jsx.ts
CHANGED
|
@@ -49,17 +49,11 @@ interface StigmerAgentAttributes
|
|
|
49
49
|
extends ClassAttributes<StigmerAgentElement>,
|
|
50
50
|
Omit<HTMLAttributes<StigmerAgentElement>, "children"> {
|
|
51
51
|
/**
|
|
52
|
-
* The web channel's id (`
|
|
52
|
+
* The web channel's id (`chn_…`), the one path segment of the hosted
|
|
53
53
|
* chat link. Required at runtime (see above for why the type cannot
|
|
54
|
-
* enforce it)
|
|
54
|
+
* enforce it).
|
|
55
55
|
*/
|
|
56
56
|
channel?: string;
|
|
57
|
-
/**
|
|
58
|
-
* The former name of `channel`.
|
|
59
|
-
*
|
|
60
|
-
* @deprecated use `channel`; pages that carry `share` keep working.
|
|
61
|
-
*/
|
|
62
|
-
share?: string;
|
|
63
57
|
/** Link token for a locked chat link; forwarded as the `?k=` parameter. */
|
|
64
58
|
token?: string;
|
|
65
59
|
/**
|