@uxland/primary-shell 7.47.6 → 8.0.0-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.
- package/dist/{component-CQxI1o5p.js → component-BY2raxSF.js} +2 -2
- package/dist/{component-CQxI1o5p.js.map → component-BY2raxSF.js.map} +1 -1
- package/dist/index-BZNo-mYO.js +43465 -0
- package/dist/index-BZNo-mYO.js.map +1 -0
- package/dist/index.js +16 -20
- package/dist/index.umd.cjs +6023 -7710
- package/dist/index.umd.cjs.map +1 -1
- package/dist/{plugin-DohFiwSH.js → plugin-IG9tBP6I.js} +1125 -1138
- package/dist/plugin-IG9tBP6I.js.map +1 -0
- package/dist/primary/shell/src/api/api.d.ts +0 -2
- package/dist/primary/shell/src/api/interaction-service/interaction-service-impl.d.ts +1 -1
- package/dist/primary/shell/src/api/region-manager/regions.d.ts +0 -1
- package/dist/primary/shell/src/features/exit/handler.d.ts +0 -1
- package/dist/primary/shell/src/index.d.ts +0 -1
- package/dist/primary/shell/src/locales.d.ts +0 -4
- package/dist/styles.css +1 -1
- package/package.json +13 -13
- package/src/UI/components/bootstrapper.ts +0 -2
- package/src/UI/components/primaria-shell/shell-header/template.ts +6 -14
- package/src/UI/components/primaria-shell/template.ts +5 -5
- package/src/UI/shared-components/primaria-character-limit-badge/primaria-character-limit-badge.ts +2 -2
- package/src/UI/shared-components/primaria-nav-tree-menu/template.ts +1 -1
- package/src/api/api.ts +2 -6
- package/src/api/interaction-service/interaction-service-impl.tsx +1 -1
- package/src/api/pdf-viewer-manager/pdf-visor/pdf-selector/template.ts +6 -8
- package/src/api/region-manager/regions.ts +1 -6
- package/src/features/exit/handler.test.ts +0 -60
- package/src/features/exit/handler.ts +0 -23
- package/src/index.ts +2 -1
- package/src/locales.ts +0 -4
- package/dist/index-DSO8ViDu.js +0 -45602
- package/dist/index-DSO8ViDu.js.map +0 -1
- package/dist/plugin-DohFiwSH.js.map +0 -1
- package/dist/primary/shell/src/UI/components/quick-actions-menu/quick-actions-menu.d.ts +0 -8
- package/dist/primary/shell/src/UI/components/quick-actions-menu/template.d.ts +0 -2
- package/dist/primary/shell/src/api/plugin-busy-manager/plugin-busy-list/component.d.ts +0 -9
- package/dist/primary/shell/src/api/plugin-busy-manager/plugin-busy-list/template.d.ts +0 -2
- package/dist/primary/shell/src/api/plugin-busy-manager/plugin-busy-manager.d.ts +0 -26
- package/dist/primary/shell/src/api/plugin-busy-manager/plugin-busy-manager.test.d.ts +0 -1
- package/src/UI/components/quick-actions-menu/quick-actions-menu.ts +0 -54
- package/src/UI/components/quick-actions-menu/template.ts +0 -10
- package/src/api/plugin-busy-manager/plugin-busy-list/component.ts +0 -16
- package/src/api/plugin-busy-manager/plugin-busy-list/styles.css +0 -27
- package/src/api/plugin-busy-manager/plugin-busy-list/template.ts +0 -20
- package/src/api/plugin-busy-manager/plugin-busy-manager.test.ts +0 -72
- package/src/api/plugin-busy-manager/plugin-busy-manager.ts +0 -57
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { LitElement } from 'lit';
|
|
2
|
-
export declare class QuickActionsMenu extends LitElement {
|
|
3
|
-
render(): import('lit').TemplateResult<1>;
|
|
4
|
-
firstUpdated(p: any): void;
|
|
5
|
-
handleSlotChange(event: any): void;
|
|
6
|
-
_handleOpenMenu(e: any): void;
|
|
7
|
-
_addMenuCustomStyle(contentSlot: HTMLElement, actionMenu: HTMLElement): void;
|
|
8
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { LitElement } from 'lit';
|
|
2
|
-
import { PluginTask } from '../plugin-busy-manager';
|
|
3
|
-
export declare class PluginBusyList extends LitElement {
|
|
4
|
-
static styles: import('lit').CSSResult;
|
|
5
|
-
render(): import('lit').TemplateResult<1>;
|
|
6
|
-
data: {
|
|
7
|
-
busyTasks: PluginTask[];
|
|
8
|
-
};
|
|
9
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
export interface PluginTask {
|
|
2
|
-
taskId: string;
|
|
3
|
-
taskDescription: string;
|
|
4
|
-
}
|
|
5
|
-
/**
|
|
6
|
-
* @deprecated Use the `canDispose(api)` plugin lifecycle hook instead. Plugins should
|
|
7
|
-
* decide whether they can be disposed (e.g. show their own confirmation modal) rather
|
|
8
|
-
* than relying on shell-level busy tasks. This API is kept for backwards compatibility.
|
|
9
|
-
*/
|
|
10
|
-
export declare abstract class PluginBusyManager {
|
|
11
|
-
abstract addTask(task: PluginTask): void;
|
|
12
|
-
abstract removeTask(taskId: string): void;
|
|
13
|
-
abstract clearAll(): void;
|
|
14
|
-
abstract isBusy(): boolean;
|
|
15
|
-
abstract getTasks(): PluginTask[];
|
|
16
|
-
}
|
|
17
|
-
/** @deprecated See {@link PluginBusyManager}. */
|
|
18
|
-
export declare class PluginBusyManagerImpl implements PluginBusyManager {
|
|
19
|
-
private tasks;
|
|
20
|
-
constructor();
|
|
21
|
-
addTask(task: PluginTask): void;
|
|
22
|
-
removeTask(taskId: string): void;
|
|
23
|
-
isBusy(): boolean;
|
|
24
|
-
clearAll(): void;
|
|
25
|
-
getTasks(): PluginTask[];
|
|
26
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { LitElement, html } from "lit";
|
|
2
|
-
import { template } from "./template";
|
|
3
|
-
|
|
4
|
-
export class QuickActionsMenu extends LitElement {
|
|
5
|
-
render() {
|
|
6
|
-
return html`${template(this)}`;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
firstUpdated(p) {
|
|
10
|
-
super.firstUpdated(p);
|
|
11
|
-
// Escuchar por cambios en el contenido del slot
|
|
12
|
-
const slot = this.shadowRoot?.querySelector('slot[name="anchor"]');
|
|
13
|
-
slot?.addEventListener("slotchange", this.handleSlotChange.bind(this));
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
handleSlotChange(event) {
|
|
17
|
-
const slot = event.target;
|
|
18
|
-
const assignedElements = slot.assignedElements();
|
|
19
|
-
|
|
20
|
-
// Si hay algún elemento asignado al slot
|
|
21
|
-
if (assignedElements.length > 0) {
|
|
22
|
-
const element = assignedElements[0]; // Asumimos que el primer elemento es el botón
|
|
23
|
-
if (element.id === "usage-anchor") {
|
|
24
|
-
// Añadir el listener de evento
|
|
25
|
-
element.addEventListener("click", this._handleOpenMenu.bind(this));
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
_handleOpenMenu(e) {
|
|
31
|
-
// Obtener el otro slot (target-slot)
|
|
32
|
-
const contentSlot = this.shadowRoot?.querySelector('slot[name="content"]') as HTMLSlotElement;
|
|
33
|
-
|
|
34
|
-
const actionMenu = this.querySelector("dss-action-menu");
|
|
35
|
-
|
|
36
|
-
// Obtener los elementos asignados al otro slot
|
|
37
|
-
const assignedElements = contentSlot?.assignedElements();
|
|
38
|
-
if (assignedElements[0]) this._addMenuCustomStyle(contentSlot as HTMLElement, actionMenu as HTMLElement);
|
|
39
|
-
|
|
40
|
-
// Hacer target al elemento que deseas (por ejemplo, un <p>)
|
|
41
|
-
// Els components del DSS exposen `show()`, que no és a la interfície `Element`.
|
|
42
|
-
const targetElement = assignedElements.find((el): el is Element & { show(): void } => el.id === "content");
|
|
43
|
-
if (targetElement) {
|
|
44
|
-
// Modificar el contenido o estilo del elemento
|
|
45
|
-
targetElement.show();
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
_addMenuCustomStyle(contentSlot: HTMLElement, actionMenu: HTMLElement) {
|
|
50
|
-
contentSlot.style.borderRadius = "var(--dss-radius-sm)";
|
|
51
|
-
const list = actionMenu.shadowRoot?.querySelector("ul");
|
|
52
|
-
if (list) list.style.overflow = "hidden";
|
|
53
|
-
}
|
|
54
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { LitElement, css, html, unsafeCSS } from "lit";
|
|
2
|
-
import { PluginTask } from "../plugin-busy-manager";
|
|
3
|
-
import styles from "./styles.css?inline";
|
|
4
|
-
import { template } from "./template";
|
|
5
|
-
|
|
6
|
-
export class PluginBusyList extends LitElement {
|
|
7
|
-
static styles = css`
|
|
8
|
-
${unsafeCSS(styles)}
|
|
9
|
-
`;
|
|
10
|
-
|
|
11
|
-
render() {
|
|
12
|
-
return html`${template(this)}`;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
data: { busyTasks: PluginTask[] };
|
|
16
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
.container{
|
|
2
|
-
display: flex;
|
|
3
|
-
flex-direction: column;
|
|
4
|
-
gap: 4px;
|
|
5
|
-
align-items: center;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
.title{
|
|
9
|
-
font-size: 15px;
|
|
10
|
-
line-height: 24px;
|
|
11
|
-
font-weight: 600;
|
|
12
|
-
color: var(--color-red-600);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
.list{
|
|
17
|
-
display: flex;
|
|
18
|
-
flex-direction: column;
|
|
19
|
-
gap: 8px;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.plugin-busy-item{
|
|
23
|
-
text-align: center;
|
|
24
|
-
border: var(--dss-border-width-sm) solid var(--color-neutral-100);
|
|
25
|
-
border-radius: var(--dss-radius-lg);
|
|
26
|
-
padding: var(--dss-spacing-md);
|
|
27
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { html } from "lit";
|
|
2
|
-
import { translate } from "../../../locales";
|
|
3
|
-
import { PluginTask } from "../plugin-busy-manager";
|
|
4
|
-
import { PluginBusyList } from "./component";
|
|
5
|
-
|
|
6
|
-
export const template = (props: PluginBusyList) => html`
|
|
7
|
-
<div class="container">
|
|
8
|
-
<div class="title">${translate("busyManager.title")}</div>
|
|
9
|
-
<div class="list">
|
|
10
|
-
${props.data?.busyTasks?.map(
|
|
11
|
-
(item: PluginTask) => html`
|
|
12
|
-
<div class="plugin-busy-item">
|
|
13
|
-
<dss-typography tag="div" variant="body-3" fontweight="regular">
|
|
14
|
-
${item.taskDescription}
|
|
15
|
-
</dss-typography>
|
|
16
|
-
</div>`,
|
|
17
|
-
)}
|
|
18
|
-
</div>
|
|
19
|
-
</div>
|
|
20
|
-
`;
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect, beforeEach } from "vitest";
|
|
2
|
-
import { PluginBusyManagerImpl } from "./plugin-busy-manager";
|
|
3
|
-
|
|
4
|
-
describe("PluginBusyManagerImpl", () => {
|
|
5
|
-
let manager: PluginBusyManagerImpl;
|
|
6
|
-
|
|
7
|
-
beforeEach(() => {
|
|
8
|
-
manager = new PluginBusyManagerImpl();
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
describe("addTask", () => {
|
|
12
|
-
it("should add a task", () => {
|
|
13
|
-
const task = { taskId: "1", taskDescription: "Loading plugin" };
|
|
14
|
-
manager.addTask(task);
|
|
15
|
-
expect(manager.getTasks()).toContain(task);
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
it("should not add a task if taskId already exists", () => {
|
|
19
|
-
const task1 = { taskId: "1", taskDescription: "First task" };
|
|
20
|
-
const task2 = { taskId: "1", taskDescription: "Duplicate task" };
|
|
21
|
-
manager.addTask(task1);
|
|
22
|
-
manager.addTask(task2);
|
|
23
|
-
const tasks = manager.getTasks();
|
|
24
|
-
|
|
25
|
-
expect(tasks.length).toBe(1);
|
|
26
|
-
expect(tasks[0]).toEqual(task1);
|
|
27
|
-
});
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
describe("removeTask", () => {
|
|
31
|
-
it("should remove a task if it exists", () => {
|
|
32
|
-
const task = { taskId: "1", taskDescription: "Loading plugin" };
|
|
33
|
-
manager.addTask(task);
|
|
34
|
-
manager.removeTask("1");
|
|
35
|
-
expect(manager.getTasks()).not.toContain(task);
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
it("should do nothing if task does not exist", () => {
|
|
39
|
-
const task = { taskId: "1", taskDescription: "Loading plugin" };
|
|
40
|
-
manager.addTask(task);
|
|
41
|
-
manager.removeTask("non-existent");
|
|
42
|
-
expect(manager.getTasks()).toContain(task);
|
|
43
|
-
});
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
describe("isBusy", () => {
|
|
47
|
-
it("should return false when no tasks exist", () => {
|
|
48
|
-
expect(manager.isBusy()).toBe(false);
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
it("should return true when tasks exist", () => {
|
|
52
|
-
manager.addTask({ taskId: "1", taskDescription: "Busy" });
|
|
53
|
-
expect(manager.isBusy()).toBe(true);
|
|
54
|
-
});
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
describe("clearAll", () => {
|
|
58
|
-
it("should clear all tasks", () => {
|
|
59
|
-
manager.addTask({ taskId: "1", taskDescription: "Busy" });
|
|
60
|
-
manager.clearAll();
|
|
61
|
-
expect(manager.getTasks()).toHaveLength(0);
|
|
62
|
-
});
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
describe("getTasks", () => {
|
|
66
|
-
it("should return current tasks", () => {
|
|
67
|
-
const task = { taskId: "1", taskDescription: "Loading plugin" };
|
|
68
|
-
manager.addTask(task);
|
|
69
|
-
expect(manager.getTasks()).toEqual([task]);
|
|
70
|
-
});
|
|
71
|
-
});
|
|
72
|
-
});
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { customElement } from "lit/decorators.js";
|
|
2
|
-
import { PluginBusyList } from "./plugin-busy-list/component";
|
|
3
|
-
|
|
4
|
-
export interface PluginTask {
|
|
5
|
-
taskId: string;
|
|
6
|
-
taskDescription: string;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* @deprecated Use the `canDispose(api)` plugin lifecycle hook instead. Plugins should
|
|
11
|
-
* decide whether they can be disposed (e.g. show their own confirmation modal) rather
|
|
12
|
-
* than relying on shell-level busy tasks. This API is kept for backwards compatibility.
|
|
13
|
-
*/
|
|
14
|
-
export abstract class PluginBusyManager {
|
|
15
|
-
abstract addTask(task: PluginTask): void;
|
|
16
|
-
abstract removeTask(taskId: string): void;
|
|
17
|
-
abstract clearAll(): void;
|
|
18
|
-
abstract isBusy(): boolean;
|
|
19
|
-
abstract getTasks(): PluginTask[];
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
/** @deprecated See {@link PluginBusyManager}. */
|
|
23
|
-
export class PluginBusyManagerImpl implements PluginBusyManager {
|
|
24
|
-
private tasks: PluginTask[] = [];
|
|
25
|
-
|
|
26
|
-
constructor() {
|
|
27
|
-
if (!customElements.get("plugin-busy-list")) {
|
|
28
|
-
customElement("plugin-busy-list")(PluginBusyList);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
public addTask(task: PluginTask): void {
|
|
33
|
-
const exists = this.tasks.some((t) => t.taskId === task.taskId);
|
|
34
|
-
if (!exists) {
|
|
35
|
-
this.tasks.push(task);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
public removeTask(taskId: string): void {
|
|
40
|
-
const index = this.tasks.findIndex((item) => item.taskId === taskId);
|
|
41
|
-
if (index > -1) {
|
|
42
|
-
this.tasks.splice(index, 1);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
public isBusy(): boolean {
|
|
47
|
-
return this.tasks.length > 0;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
public clearAll(): void {
|
|
51
|
-
this.tasks = [];
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
public getTasks(): PluginTask[] {
|
|
55
|
-
return this.tasks;
|
|
56
|
-
}
|
|
57
|
-
}
|