@helpai/elements 0.12.0 → 0.12.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/configurator.mjs +7 -18
- package/elements-web-component.esm.js +15 -15
- package/elements-web-component.esm.js.map +3 -3
- package/elements.cjs.js +2 -2
- package/elements.cjs.js.map +3 -3
- package/elements.esm.js +2 -2
- package/elements.esm.js.map +3 -3
- package/elements.js +23 -23
- package/elements.js.map +3 -3
- package/index.d.ts +18 -22
- package/index.mjs +9 -31
- package/package.json +1 -1
- package/schema.d.ts +22 -47
- package/schema.json +84 -234
- package/schema.mjs +7 -18
- package/web-component.mjs +11 -42
package/web-component.mjs
CHANGED
|
@@ -307,30 +307,12 @@ var DEFAULT_LAUNCHER = {
|
|
|
307
307
|
hidden: false
|
|
308
308
|
};
|
|
309
309
|
var DEFAULT_ACTIONS_BY_MODE = {
|
|
310
|
-
floating:
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
overflow: ["clear", "fullscreen", "popOut", "sound", "language"]
|
|
317
|
-
},
|
|
318
|
-
standalone: {
|
|
319
|
-
main: ["theme", "history"],
|
|
320
|
-
overflow: ["clear", "sound", "language"]
|
|
321
|
-
},
|
|
322
|
-
page: {
|
|
323
|
-
main: ["theme", "history"],
|
|
324
|
-
overflow: ["clear", "sound", "language"]
|
|
325
|
-
},
|
|
326
|
-
modal: {
|
|
327
|
-
main: ["theme", "history", "close"],
|
|
328
|
-
overflow: ["clear", "fullscreen", "popOut", "sound", "language"]
|
|
329
|
-
},
|
|
330
|
-
drawer: {
|
|
331
|
-
main: ["theme", "history", "close"],
|
|
332
|
-
overflow: ["clear", "fullscreen", "popOut", "sound", "language"]
|
|
333
|
-
}
|
|
310
|
+
floating: ["theme", "history", "close", "clear", "expand", "fullscreen", "popOut", "sound", "language"],
|
|
311
|
+
inline: ["theme", "history", "close", "clear", "fullscreen", "popOut", "sound", "language"],
|
|
312
|
+
standalone: ["theme", "history", "clear", "sound", "language"],
|
|
313
|
+
page: ["theme", "history", "clear", "sound", "language"],
|
|
314
|
+
modal: ["theme", "history", "close", "clear", "fullscreen", "popOut", "sound", "language"],
|
|
315
|
+
drawer: ["theme", "history", "close", "clear", "fullscreen", "popOut", "sound", "language"]
|
|
334
316
|
};
|
|
335
317
|
var DEFAULT_SOUND = {
|
|
336
318
|
enabled: true,
|
|
@@ -419,11 +401,7 @@ function resolveDefaultLocale(input) {
|
|
|
419
401
|
return typeof navigator !== "undefined" && navigator.language ? navigator.language : "en";
|
|
420
402
|
}
|
|
421
403
|
function resolveActions(mode, overrides) {
|
|
422
|
-
|
|
423
|
-
return {
|
|
424
|
-
main: overrides?.main ?? defaults.main,
|
|
425
|
-
overflow: overrides?.overflow ?? defaults.overflow
|
|
426
|
-
};
|
|
404
|
+
return overrides ?? DEFAULT_ACTIONS_BY_MODE[mode];
|
|
427
405
|
}
|
|
428
406
|
function resolveSound(overrides) {
|
|
429
407
|
return {
|
|
@@ -708,19 +686,10 @@ function parseAttributes(get) {
|
|
|
708
686
|
if (userContext) opts.userContext = userContext;
|
|
709
687
|
const pageContext = collectContext(str, PAGE_CONTEXT_ATTRS, "page-context");
|
|
710
688
|
if (pageContext) opts.pageContext = pageContext;
|
|
711
|
-
const
|
|
712
|
-
if (
|
|
689
|
+
const actionsRaw = str("actions");
|
|
690
|
+
if (actionsRaw !== void 0) opts.header = { actions: onlyValidActions(actionsRaw) };
|
|
713
691
|
return opts;
|
|
714
692
|
}
|
|
715
|
-
function parseActions(str) {
|
|
716
|
-
const mainRaw = str("actions-main");
|
|
717
|
-
const overflowRaw = str("actions-overflow");
|
|
718
|
-
if (mainRaw === void 0 && overflowRaw === void 0) return null;
|
|
719
|
-
const out = {};
|
|
720
|
-
if (mainRaw !== void 0) out.main = onlyValidActions(mainRaw);
|
|
721
|
-
if (overflowRaw !== void 0) out.overflow = onlyValidActions(overflowRaw);
|
|
722
|
-
return out;
|
|
723
|
-
}
|
|
724
693
|
function collectSubset(str, table) {
|
|
725
694
|
const out = {};
|
|
726
695
|
for (const [attr, key, cast] of table) {
|
|
@@ -2823,7 +2792,7 @@ function isActionVisible(name, mode, panelSize, ctx) {
|
|
|
2823
2792
|
}
|
|
2824
2793
|
function canShowClose(mode, panelSize, actions) {
|
|
2825
2794
|
if (!isActionVisible("close", mode, panelSize)) return false;
|
|
2826
|
-
return actions.
|
|
2795
|
+
return actions.includes("close");
|
|
2827
2796
|
}
|
|
2828
2797
|
function resolveCloseAction(mode, panelSize) {
|
|
2829
2798
|
if (mode === "inline" && panelSize === "fullscreen") return "exit-fullscreen";
|
|
@@ -3523,7 +3492,7 @@ function HeaderActions({ panelProps, variant }) {
|
|
|
3523
3492
|
const mode = options.mode;
|
|
3524
3493
|
const isChat = variant === "chat";
|
|
3525
3494
|
const muted = useComputed(() => feedback.mutedSig.value).value;
|
|
3526
|
-
const enabled =
|
|
3495
|
+
const enabled = new Set(options.actions);
|
|
3527
3496
|
const has = (name) => enabled.has(name);
|
|
3528
3497
|
const visible = (name) => isActionVisible(name, mode, panelSize, { popOutUrl: options.popOutUrl });
|
|
3529
3498
|
const themeMode = options.themeMode;
|