@rtc-agent/component 0.2.7-rc.0 → 0.2.7-rc.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.
@@ -1,4 +1,4 @@
1
- import { s as e } from "./index-Dt_DFLw-.js";
1
+ import { s as e } from "./index-D2-aTNVT.js";
2
2
  const s = {
3
3
  s0016a70887124d70: "Session",
4
4
  s01366f0961abde4c: "Link",
@@ -1,4 +1,4 @@
1
- import { g as En } from "./index-Dt_DFLw-.js";
1
+ import { g as En } from "./index-D2-aTNVT.js";
2
2
  function De(e) {
3
3
  return e instanceof Map ? e.clear = e.delete = e.set = function() {
4
4
  throw new Error("map is read-only");
@@ -747,7 +747,7 @@ function mr({ context: t, subscribe: e }) {
747
747
  });
748
748
  };
749
749
  }
750
- const WI = "0.2.6", KI = _r`
750
+ const WI = "0.2.7-rc.1", KI = _r`
751
751
  :host {
752
752
  display: block;
753
753
  /* Position controlled by JS (left/top) for interact.js compatibility */
@@ -825,6 +825,30 @@ const WI = "0.2.6", KI = _r`
825
825
  right: 0;
826
826
  }
827
827
 
828
+ /* ── Embedded mode overrides ──
829
+ *
830
+ * When embedded, the component fills its parent container instead of the viewport.
831
+ * This uses position:relative so it participates in the parent's flex/grid layout,
832
+ * unlike the default position:fixed which fills the viewport.
833
+ */
834
+ :host([data-embedded]) {
835
+ position: relative !important;
836
+ width: 100% !important;
837
+ height: 100% !important;
838
+ min-width: 0 !important;
839
+ min-height: 0 !important;
840
+ max-width: 100% !important;
841
+ max-height: 100% !important;
842
+ inset: auto !important;
843
+ left: auto !important;
844
+ top: auto !important;
845
+ right: auto !important;
846
+ bottom: auto !important;
847
+ border-radius: 0 !important;
848
+ box-shadow: none !important;
849
+ z-index: 0 !important;
850
+ }
851
+
828
852
  /* ── Minimized ── */
829
853
  :host([data-mode='minimized']) {
830
854
  /* 与 logo 同构的圆角方形:圆角比例 = 290/1250 = 23.2% */
@@ -4719,6 +4743,7 @@ class C3 {
4719
4743
  /**
4720
4744
  * Handle viewport resize (e.g. DevTools open/close/resize).
4721
4745
  *
4746
+ * - embedded: no action (fills parent container via CSS)
4722
4747
  * - minimized: recalculate bubble position from bubblePosition config + new viewport size
4723
4748
  * - normal: clamp position to keep window visible; auto-minimize if viewport too small
4724
4749
  * - maximized: no action needed (CSS inset:0 handles it)
@@ -4726,7 +4751,7 @@ class C3 {
4726
4751
  _handleViewportResize() {
4727
4752
  var f;
4728
4753
  const { mode: e } = this._state;
4729
- if (e === "maximized") return;
4754
+ if (this._config.embedded || e === "maximized") return;
4730
4755
  if (e === "minimized") {
4731
4756
  this.host.requestUpdate();
4732
4757
  return;
@@ -4822,10 +4847,17 @@ class C3 {
4822
4847
  * Inline styles override CSS rules (including :host([data-mode=...])),
4823
4848
  * so we clear them when leaving 'normal' mode to let CSS take over.
4824
4849
  *
4850
+ * When the host has `data-embedded` attribute, skip all inline geometry —
4851
+ * the component fills its parent container via CSS (position: relative).
4852
+ *
4825
4853
  * @param el - The host element to apply geometry to (typically the root component).
4826
4854
  */
4827
4855
  applyGeometry(e) {
4828
4856
  var s, o, l;
4857
+ if (e.hasAttribute("data-embedded")) {
4858
+ e.style.width = "", e.style.height = "", e.style.left = "", e.style.top = "", e.style.bottom = "", e.style.right = "";
4859
+ return;
4860
+ }
4829
4861
  const { position: r, size: n, mode: i } = this._state;
4830
4862
  if (i === "normal") {
4831
4863
  e.style.left = `${r.x}px`, e.style.top = `${r.y}px`, e.style.width = `${n.width}px`, e.style.height = `${n.height}px`, e.style.bottom = "", e.style.right = "";
@@ -66190,7 +66222,7 @@ class FL {
66190
66222
  }
66191
66223
  function nE(t) {
66192
66224
  return new SharedWorker(
66193
- "" + new URL("assets/shared-worker-BEaT-a-g.js", import.meta.url).href,
66225
+ "" + new URL("assets/shared-worker-DNuUtKfr.js", import.meta.url).href,
66194
66226
  {
66195
66227
  name: t == null ? void 0 : t.name
66196
66228
  }
@@ -68052,7 +68084,7 @@ class b9 {
68052
68084
  }
68053
68085
  }
68054
68086
  const wk = tr("I18n"), Gt = "zh-CN", Rr = ["en-US"], pE = {
68055
- "en-US": async () => (await import("./en-US-CZGit-aT.js")).default
68087
+ "en-US": async () => (await import("./en-US-BGk4hy6U.js")).default
68056
68088
  }, { getLocale: jb, setLocale: Tk } = a9({
68057
68089
  sourceLocale: Gt,
68058
68090
  targetLocales: Rr,
@@ -77027,7 +77059,7 @@ let _s = class extends vr {
77027
77059
  return this._modulesPromise || (this._modulesPromise = Promise.all([
77028
77060
  import("./marked.esm-Dch69AxC.js"),
77029
77061
  import("./purify.es-C-6FFqDW.js"),
77030
- import("./highlight-languages-DRPkpsxS.js")
77062
+ import("./highlight-languages-CXfOsoHk.js")
77031
77063
  ]).then(([t, e, r]) => ({
77032
77064
  marked: t.marked,
77033
77065
  DOMPurify: e.default,
@@ -80371,7 +80403,7 @@ let rl = class extends vr {
80371
80403
  this._lastParsedContent = r, this._modulesPromise || (this._modulesPromise = Promise.all([
80372
80404
  import("./marked.esm-Dch69AxC.js"),
80373
80405
  import("./purify.es-C-6FFqDW.js"),
80374
- import("./highlight-languages-DRPkpsxS.js")
80406
+ import("./highlight-languages-CXfOsoHk.js")
80375
80407
  ]).then(([c, p, f]) => ({
80376
80408
  marked: c.marked,
80377
80409
  DOMPurify: p.default,
@@ -89789,18 +89821,18 @@ let mn = class extends vr {
89789
89821
  setLocale: yd,
89790
89822
  locales: [Gt, ...Rr]
89791
89823
  });
89792
- }).catch((r) => {
89793
- Kr.error("Context provider sync failed:", r);
89824
+ }).catch((n) => {
89825
+ Kr.error("Context provider sync failed:", n);
89794
89826
  }), this._sessionTab.value.state.tabs.length === 0 && !this._creatingUnsavedTab && this._initialSessionLoadDone && (Kr.debug("No tabs left, auto-creating unsaved tab"), this._creatingUnsavedTab = !0, queueMicrotask(() => {
89795
89827
  try {
89796
- const r = this._session.actions.createSession();
89797
- this._session.actions.switchSession(r), this._sessionTab.actions.openOrActivate(r, He("未命名"), { isUnsaved: !0 });
89828
+ const n = this._session.actions.createSession();
89829
+ this._session.actions.switchSession(n), this._sessionTab.actions.openOrActivate(n, He("未命名"), { isUnsaved: !0 });
89798
89830
  } finally {
89799
89831
  this._creatingUnsavedTab = !1;
89800
89832
  }
89801
89833
  })), this._rtcProcessor && this._rtcProcessor.setMode(this._mode.value.state.currentMode);
89802
89834
  const e = this._windowState.value.state.mode;
89803
- e !== this._appliedMode && (this._appliedMode = e, this.setAttribute("data-mode", e), this._handleModeTransition(e)), e !== "normal" ? this._interaction.value.actions.disable() : this._interaction.value.actions.enable(), this._windowState.applyGeometry(this);
89835
+ e !== this._appliedMode && (this._appliedMode = e, this.setAttribute("data-mode", e), this._handleModeTransition(e)), this._resolvedWindowConfig.embedded ? this.setAttribute("data-embedded", "") : this.removeAttribute("data-embedded"), e !== "normal" ? this._interaction.value.actions.disable() : this._interaction.value.actions.enable(), this._windowState.applyGeometry(this);
89804
89836
  }
89805
89837
  firstUpdated() {
89806
89838
  var e;
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { C as s, D as t, E as o, F as n, a as r, R as i, S as l, b as c, c as d, d as g, e as m, f as L, h, i as u, j as T, k as S, l as p, m as E, n as F, o as A, p as R, q as f, r as v, t as w, u as x, v as C, w as y, x as B, y as I, z as M, A as V, B as k, G as z, H as b, I as D, J as G, K, L as P, M as U, N as _, O as j } from "./index-Dt_DFLw-.js";
1
+ import { C as s, D as t, E as o, F as n, a as r, R as i, S as l, b as c, c as d, d as g, e as m, f as L, h, i as u, j as T, k as S, l as p, m as E, n as F, o as A, p as R, q as f, r as v, t as w, u as x, v as C, w as y, x as B, y as I, z as M, A as V, B as k, G as z, H as b, I as D, J as G, K, L as P, M as U, N as _, O as j } from "./index-D2-aTNVT.js";
2
2
  export {
3
3
  s as CancelledError,
4
4
  t as DEFAULT_SKILL_STATE,