@ai-ecoverse/slicc-spectrum 1.17.0 → 1.19.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 +11 -0
- package/dist/slicc-dummy.js +4 -4
- package/dist/slicc-dummy.js.map +1 -1
- package/dist/slicc-ui.js +2361 -1902
- package/dist/slicc-ui.js.map +4 -4
- package/dist/types/app/confirm.d.ts +32 -0
- package/dist/types/app/sprinkle-tokens.d.ts +5 -0
- package/dist/types/app/sprinkle.d.ts +5 -4
- package/dist/types/ui.d.ts +4 -1
- package/package.json +2 -1
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import '@adobe/spectrum-wc/components/button/swc-button.js';
|
|
2
|
+
import '@spectrum-web-components/alert-dialog/sp-alert-dialog.js';
|
|
3
|
+
import { LitElement, type TemplateResult } from 'lit';
|
|
4
|
+
export type ConfirmVariant = 'destructive' | 'confirmation';
|
|
5
|
+
export interface ConfirmOptions {
|
|
6
|
+
title: string;
|
|
7
|
+
body: string;
|
|
8
|
+
action: string;
|
|
9
|
+
variant?: ConfirmVariant;
|
|
10
|
+
trigger?: HTMLElement | null;
|
|
11
|
+
}
|
|
12
|
+
export declare class SliccConfirm extends LitElement {
|
|
13
|
+
#private;
|
|
14
|
+
static properties: {
|
|
15
|
+
heading: {};
|
|
16
|
+
body: {};
|
|
17
|
+
action: {};
|
|
18
|
+
variant: {};
|
|
19
|
+
};
|
|
20
|
+
heading: string;
|
|
21
|
+
body: string;
|
|
22
|
+
action: string;
|
|
23
|
+
variant: ConfirmVariant;
|
|
24
|
+
trigger: HTMLElement | null;
|
|
25
|
+
constructor();
|
|
26
|
+
static styles: import("lit").CSSResult;
|
|
27
|
+
get result(): Promise<boolean>;
|
|
28
|
+
protected firstUpdated(): Promise<void>;
|
|
29
|
+
disconnectedCallback(): void;
|
|
30
|
+
render(): TemplateResult;
|
|
31
|
+
}
|
|
32
|
+
export declare function confirm(options: ConfirmOptions): Promise<boolean>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare function declarations(...sheets: string[]): Map<string, string>;
|
|
2
|
+
export declare function closure(found: Map<string, string>, source: string): Map<string, string>;
|
|
3
|
+
export declare function branch(value: string, side: 0 | 1): string;
|
|
4
|
+
export declare function frameTokens(found: Map<string, string>): string;
|
|
5
|
+
export declare const sprinkleTokens: string;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { type TemplateResult } from 'lit';
|
|
1
|
+
import { type PropertyValues, type TemplateResult } from 'lit';
|
|
2
2
|
import type { SliccModel } from '../model/types.js';
|
|
3
|
-
import { ThemedElement } from './base.js';
|
|
3
|
+
import { type Color, ThemedElement } from './base.js';
|
|
4
4
|
import { type FontFile } from './fonts.js';
|
|
5
|
-
export declare const bridge = "(() => {\n const post = (message) => parent.postMessage(message, '*');\n window.slicc = {\n name: document.currentScript.dataset.name,\n lick(event) {\n const value = typeof event === 'string' ? { action: event } : event || {};\n post({ type: 'slicc-lick', action: String(value.action || ''), data: value.data ?? null, target: value.target ?? null });\n },\n };\n const wanted = new Set();\n let timer = 0;\n window.LucideIcons = {\n render() {\n for (const node of document.querySelectorAll('i[data-lucide]')) wanted.add(node.dataset.lucide);\n clearTimeout(timer);\n timer = setTimeout(() => post({ type: 'slicc-icons', names: [...wanted] }));\n },\n };\n const swap = (found) => {\n for (const node of document.querySelectorAll('i[data-lucide]')) {\n const markup = found[node.dataset.lucide];\n if (!markup) continue;\n const template = document.createElement('template');\n template.innerHTML = markup;\n const svg = template.content.firstElementChild;\n for (const { name, value } of node.attributes) {\n if (name === 'class') svg.setAttribute('class', svg.getAttribute('class') + ' ' + value);\n else if (name !== 'data-lucide') svg.setAttribute(name, value);\n }\n node.replaceWith(svg);\n }\n };\n const fonts = (list) => {\n for (const font of list) {\n const face = new FontFace(font.family, font.data, { weight: String(font.weight) });\n document.fonts.add(face);\n face.load().catch(() => {});\n }\n };\n addEventListener('message', (event) => {\n if (event.source !== parent) return;\n const message = event.data || {};\n if (message.type === 'slicc-icons') swap(message.icons);\n if (message.type === 'slicc-fonts') fonts(message.fonts);\n });\n const size = () => {\n const style = getComputedStyle(document.body);\n post({ type: 'slicc-size', height: Math.ceil(document.body.offsetHeight + parseFloat(style.marginTop) + parseFloat(style.marginBottom)) });\n };\n document.addEventListener('DOMContentLoaded', () => {\n window.LucideIcons.render();\n new ResizeObserver(size).observe(document.body);\n });\n post({ type: 'slicc-ready' });\n})();";
|
|
6
|
-
export declare function frameDocument(source: string, color:
|
|
5
|
+
export declare const bridge = "(() => {\n const post = (message) => parent.postMessage(message, '*');\n window.slicc = {\n name: document.currentScript.dataset.name,\n lick(event) {\n const value = typeof event === 'string' ? { action: event } : event || {};\n post({ type: 'slicc-lick', action: String(value.action || ''), data: value.data ?? null, target: value.target ?? null });\n },\n };\n const wanted = new Set();\n let timer = 0;\n window.LucideIcons = {\n render() {\n for (const node of document.querySelectorAll('i[data-lucide]')) wanted.add(node.dataset.lucide);\n clearTimeout(timer);\n timer = setTimeout(() => post({ type: 'slicc-icons', names: [...wanted] }));\n },\n };\n const swap = (found) => {\n for (const node of document.querySelectorAll('i[data-lucide]')) {\n const markup = found[node.dataset.lucide];\n if (!markup) continue;\n const template = document.createElement('template');\n template.innerHTML = markup;\n const svg = template.content.firstElementChild;\n for (const { name, value } of node.attributes) {\n if (name === 'class') svg.setAttribute('class', svg.getAttribute('class') + ' ' + value);\n else if (name !== 'data-lucide') svg.setAttribute(name, value);\n }\n node.replaceWith(svg);\n }\n };\n const fonts = (list) => {\n for (const font of list) {\n const face = new FontFace(font.family, font.data, { weight: String(font.weight) });\n document.fonts.add(face);\n face.load().catch(() => {});\n }\n };\n addEventListener('message', (event) => {\n if (event.source !== parent) return;\n const message = event.data || {};\n if (message.type === 'slicc-icons') swap(message.icons);\n if (message.type === 'slicc-fonts') fonts(message.fonts);\n if (message.type === 'slicc-theme') document.documentElement.classList.toggle('theme-light', message.color === 'light');\n });\n const size = () => {\n const style = getComputedStyle(document.body);\n post({ type: 'slicc-size', height: Math.ceil(document.body.offsetHeight + parseFloat(style.marginTop) + parseFloat(style.marginBottom)) });\n };\n document.addEventListener('DOMContentLoaded', () => {\n window.LucideIcons.render();\n new ResizeObserver(size).observe(document.body);\n });\n post({ type: 'slicc-ready' });\n})();";
|
|
6
|
+
export declare function frameDocument(source: string, color: Color, name: string): string;
|
|
7
7
|
export declare function fontData(url: string): Promise<ArrayBuffer | null>;
|
|
8
8
|
export declare function frameFonts(files: readonly FontFile[], base: string): Promise<Array<{
|
|
9
9
|
family: string;
|
|
@@ -31,5 +31,6 @@ export declare class SliccSprinkle extends ThemedElement {
|
|
|
31
31
|
constructor();
|
|
32
32
|
static styles: import("lit").CSSResult;
|
|
33
33
|
protected subscribe(model: SliccModel): Array<() => void>;
|
|
34
|
+
protected updated(changed: PropertyValues): void;
|
|
34
35
|
render(): TemplateResult;
|
|
35
36
|
}
|
package/dist/types/ui.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { SliccBrowser } from './app/browser.js';
|
|
|
5
5
|
import { SliccChanges, SliccDiffPanel } from './app/changes.js';
|
|
6
6
|
import { SliccChat } from './app/chat.js';
|
|
7
7
|
import { SliccComposer } from './app/composer.js';
|
|
8
|
+
import { SliccConfirm } from './app/confirm.js';
|
|
8
9
|
import { SliccFiles, SliccFileView } from './app/files.js';
|
|
9
10
|
import { SliccUpdates } from './app/updates.js';
|
|
10
11
|
import { SliccCodeView, SliccDiffView } from './components/code-view.js';
|
|
@@ -12,6 +13,8 @@ import { SliccDock } from './components/dock.js';
|
|
|
12
13
|
import { SliccFileTree } from './components/file-tree.js';
|
|
13
14
|
export type { Color } from './app/base.js';
|
|
14
15
|
export { resolveColor } from './app/base.js';
|
|
16
|
+
export type { ConfirmOptions, ConfirmVariant } from './app/confirm.js';
|
|
17
|
+
export { confirm } from './app/confirm.js';
|
|
15
18
|
export type { GrammarKind } from './app/grammars.js';
|
|
16
19
|
export { grammarBase, setGrammarBase } from './app/grammars.js';
|
|
17
20
|
export type { Placement, Surface } from './app/panels.js';
|
|
@@ -22,5 +25,5 @@ export type { GitStatusEntry } from './components/file-tree.js';
|
|
|
22
25
|
export type { Listener, Subscribable } from './model/emitter.js';
|
|
23
26
|
export { Emitter } from './model/emitter.js';
|
|
24
27
|
export type * from './model/types.js';
|
|
25
|
-
export { SliccAgents, SliccApp, SliccBrowser, SliccChanges, SliccChat, SliccCodeView, SliccComposer, SliccDiffPanel, SliccDiffView, SliccDock, SliccFiles, SliccFileTree, SliccFileView, SliccUpdates, };
|
|
28
|
+
export { SliccAgents, SliccApp, SliccBrowser, SliccChanges, SliccChat, SliccCodeView, SliccComposer, SliccConfirm, SliccDiffPanel, SliccDiffView, SliccDock, SliccFiles, SliccFileTree, SliccFileView, SliccUpdates, };
|
|
26
29
|
export declare function define(): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-ecoverse/slicc-spectrum",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.19.0",
|
|
4
4
|
"description": "Web components for SLICC on Spectrum Web Components: the terminal, the app shell and its surfaces",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -84,6 +84,7 @@
|
|
|
84
84
|
"@spectrum-web-components/action-button": "1.12.4",
|
|
85
85
|
"@spectrum-web-components/action-group": "1.12.4",
|
|
86
86
|
"@spectrum-web-components/action-menu": "1.12.4",
|
|
87
|
+
"@spectrum-web-components/alert-dialog": "1.12.4",
|
|
87
88
|
"@spectrum-web-components/badge": "1.12.4",
|
|
88
89
|
"@spectrum-web-components/button": "1.12.4",
|
|
89
90
|
"@spectrum-web-components/menu": "1.12.4",
|