@8wave/ai-elements 0.125.0-beta.21 → 0.125.0-beta.23
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/_chunks/{PkFilePreview-BzNLupQS.js → PkFilePreview-CyWTOCZC.js} +504 -462
- package/dist/_chunks/PkFilePreview-CyWTOCZC.js.map +1 -0
- package/dist/_chunks/{PkFilePreviewDialog-BfZFgdOi.js → PkFilePreviewDialog-CUHwFDmH.js} +5 -2
- package/dist/_chunks/PkFilePreviewDialog-CUHwFDmH.js.map +1 -0
- package/dist/_chunks/{PkSelectionActions-CUymhwsG.js → PkSelectionActions-DDyt_ksY.js} +99 -26
- package/dist/_chunks/PkSelectionActions-DDyt_ksY.js.map +1 -0
- package/dist/ai-elements.es.js +2643 -2631
- package/dist/ai-elements.es.js.map +1 -1
- package/dist-vue/PkChatbot.js +1 -1
- package/dist-vue/PkChatbotViewChat.js +1 -1
- package/dist-vue/_chunks/{PkChatbot-BVZgvanv.js → PkChatbot-D0uPiMhj.js} +2 -2
- package/dist-vue/_chunks/{PkChatbot-BVZgvanv.js.map → PkChatbot-D0uPiMhj.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewChat-C1uzFQCJ.js → PkChatbotViewChat-Ckl03UkZ.js} +526 -443
- package/dist-vue/_chunks/PkChatbotViewChat-Ckl03UkZ.js.map +1 -0
- package/dist-vue/_chunks/{PkFilePreview-C2VOU99H.js → PkFilePreview-B26pY-C2.js} +522 -479
- package/dist-vue/_chunks/PkFilePreview-B26pY-C2.js.map +1 -0
- package/dist-vue/_chunks/{PkFilePreviewDialog-C6QQMntW.js → PkFilePreviewDialog-Dy5jmAom.js} +5 -2
- package/dist-vue/_chunks/PkFilePreviewDialog-Dy5jmAom.js.map +1 -0
- package/dist-vue/index.js +4 -4
- package/dist-vue/index.js.map +1 -1
- package/dist-vue/packages/components/src/chat/PkFilePreview.d.ts +6 -0
- package/dist-vue/packages/components/src/chat/PkFilePreviewDialog.d.ts +3 -0
- package/dist-vue/packages/components/src/chat/PkSpreadsheetPreview.d.ts +5 -0
- package/dist-vue/packages/components/src/chat/PkWordPreview.d.ts +5 -0
- package/dist-vue/packages/components/src/chat/PkWordPreviewBlock.d.ts +3 -1
- package/dist-vue/packages/components/src/chat/previewChanges.d.ts +33 -0
- package/dist-vue/packages/components/src/chat/useChatFilePreview.d.ts +8 -2
- package/dist-vue/style.css +1 -1
- package/package.json +1 -1
- package/dist/_chunks/PkFilePreview-BzNLupQS.js.map +0 -1
- package/dist/_chunks/PkFilePreviewDialog-BfZFgdOi.js.map +0 -1
- package/dist/_chunks/PkSelectionActions-CUymhwsG.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotViewChat-C1uzFQCJ.js.map +0 -1
- package/dist-vue/_chunks/PkFilePreview-C2VOU99H.js.map +0 -1
- package/dist-vue/_chunks/PkFilePreviewDialog-C6QQMntW.js.map +0 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ChatFilePreview, SelectionGroupCapability } from '../../../models/src';
|
|
2
|
+
import { ChatFilePreviewChanges } from './previewChanges';
|
|
2
3
|
import { WordPreviewMode } from './utils';
|
|
3
4
|
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
4
5
|
/**
|
|
@@ -19,6 +20,11 @@ type __VLS_Props = {
|
|
|
19
20
|
/** The authenticated download URL of the shown version. */
|
|
20
21
|
downloadUrl: string;
|
|
21
22
|
preview?: ChatFilePreview;
|
|
23
|
+
/**
|
|
24
|
+
* What the version changed from the one shown before it, while the
|
|
25
|
+
* viewer marks it: set when the viewer follows an edit.
|
|
26
|
+
*/
|
|
27
|
+
changes?: ChatFilePreviewChanges;
|
|
22
28
|
loading?: boolean;
|
|
23
29
|
error?: boolean;
|
|
24
30
|
/** The shown version can be written again as the newest one. */
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ChatFilePreview, SelectionGroupCapability } from '../../../models/src';
|
|
2
|
+
import { ChatFilePreviewChanges } from './previewChanges';
|
|
2
3
|
import { ChatFilePreviewTarget, WordPreviewMode } from './utils';
|
|
3
4
|
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
4
5
|
/**
|
|
@@ -13,6 +14,8 @@ type __VLS_Props = {
|
|
|
13
14
|
/** The authenticated download URL of the same version. */
|
|
14
15
|
downloadUrl: string;
|
|
15
16
|
preview?: ChatFilePreview;
|
|
17
|
+
/** What the version changed from the one shown before, for a moment. */
|
|
18
|
+
changes?: ChatFilePreviewChanges;
|
|
16
19
|
loading?: boolean;
|
|
17
20
|
error?: boolean;
|
|
18
21
|
/** Covers the screen, for a phone. */
|
|
@@ -14,6 +14,11 @@ import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOp
|
|
|
14
14
|
*/
|
|
15
15
|
type __VLS_Props = {
|
|
16
16
|
preview: SpreadsheetPreview;
|
|
17
|
+
/**
|
|
18
|
+
* The cells the version changed from the one shown before it, as
|
|
19
|
+
* `row:col` by sheet name, marked while the viewer follows an edit.
|
|
20
|
+
*/
|
|
21
|
+
marked?: ReadonlyMap<string, ReadonlySet<string>>;
|
|
17
22
|
};
|
|
18
23
|
type __VLS_ModelProps = {
|
|
19
24
|
'sheet'?: number;
|
|
@@ -20,6 +20,11 @@ import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOp
|
|
|
20
20
|
type __VLS_Props = {
|
|
21
21
|
preview: WordPreview;
|
|
22
22
|
mode: WordPreviewMode;
|
|
23
|
+
/**
|
|
24
|
+
* The paragraphs the version changed from the one shown before it,
|
|
25
|
+
* by id, marked while the viewer follows an edit.
|
|
26
|
+
*/
|
|
27
|
+
marked?: ReadonlySet<string>;
|
|
23
28
|
};
|
|
24
29
|
type __VLS_ModelProps = {
|
|
25
30
|
'fit'?: boolean;
|
|
@@ -8,7 +8,7 @@ import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOp
|
|
|
8
8
|
* a table, so a table can break between pages as Word breaks it. A
|
|
9
9
|
* paragraph with a tracked change carries Word's bar in the margin. The
|
|
10
10
|
* images of a paragraph are positioned on `page`; those of a cell sit in
|
|
11
|
-
* its text.
|
|
11
|
+
* its text. What the version changed is marked for a moment.
|
|
12
12
|
*/
|
|
13
13
|
type __VLS_Props = {
|
|
14
14
|
block: WordPreviewBlock;
|
|
@@ -19,6 +19,8 @@ type __VLS_Props = {
|
|
|
19
19
|
page?: WordPreviewPage;
|
|
20
20
|
/** The numbers of the page, for its page number fields. */
|
|
21
21
|
numbers?: WordPageNumbers;
|
|
22
|
+
/** The paragraphs the version changed, by id. */
|
|
23
|
+
marked?: ReadonlySet<string>;
|
|
22
24
|
};
|
|
23
25
|
declare const __VLS_export: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
24
26
|
declare const _default: typeof __VLS_export;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ChatFilePreview } from '../../../models/src';
|
|
2
|
+
/**
|
|
3
|
+
* What a version of a file changed from the one the viewer showed before it
|
|
4
|
+
* (spec `chat-file-selection-edit.md`): the paragraphs of a Word document by
|
|
5
|
+
* their ids in the new version, or the cells of each sheet, by its name, as
|
|
6
|
+
* `row:col`. The viewer marks them for a moment when it follows an edit.
|
|
7
|
+
*/
|
|
8
|
+
export type ChatFilePreviewChanges = {
|
|
9
|
+
kind: 'word';
|
|
10
|
+
paragraphs: ReadonlySet<string>;
|
|
11
|
+
} | {
|
|
12
|
+
kind: 'spreadsheet';
|
|
13
|
+
cells: ReadonlyMap<string, ReadonlySet<string>>;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* The items of `after` that `before` does not hold in the same order, each
|
|
17
|
+
* with the item of `before` it took the place of, if any: the one at the
|
|
18
|
+
* same distance from the start of the stretch both lists differ in. The
|
|
19
|
+
* common start and end are skipped, the middle is aligned by its longest
|
|
20
|
+
* common subsequence.
|
|
21
|
+
*/
|
|
22
|
+
export declare const unmatchedItems: (before: readonly string[], after: readonly string[]) => Map<number, number | undefined>;
|
|
23
|
+
/**
|
|
24
|
+
* What `after` changed from `before`, two versions of the same file: none
|
|
25
|
+
* when nothing the viewer draws differs, or the two are not of one format.
|
|
26
|
+
*/
|
|
27
|
+
export declare const chatFilePreviewChanges: (before: ChatFilePreview, after: ChatFilePreview) => ChatFilePreviewChanges | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* Brings the first marked change into the middle of the viewer's own scroll
|
|
30
|
+
* box, when it is not in sight already. Not `scrollIntoView`: it would scroll
|
|
31
|
+
* the page around the viewer too. False while there is none drawn yet.
|
|
32
|
+
*/
|
|
33
|
+
export declare const revealFirstChange: (scroller: HTMLElement | null | undefined, selector: string) => boolean;
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import { ChatFilePreview } from '../../../models/src';
|
|
2
|
+
import { ChatFilePreviewChanges } from './previewChanges';
|
|
2
3
|
import { ChatFilePreviewTarget } from './utils';
|
|
4
|
+
/** How long the viewer marks what a version changed. */
|
|
5
|
+
export declare const CHAT_FILE_CHANGES_MS = 4000;
|
|
3
6
|
/**
|
|
4
7
|
* The preview of a Word document or a spreadsheet stored in a chat (spec
|
|
5
8
|
* `chat-office-files.md`, F6, items 3 and 4): the file it shows, its content
|
|
6
9
|
* once read, and the read. `read` asks the server for one stored file of the
|
|
7
10
|
* chat on screen. A version never changes, so each one is read once until
|
|
8
|
-
* `reset`, which a view calls when it shows another chat.
|
|
11
|
+
* `reset`, which a view calls when it shows another chat. Opened `since` the
|
|
12
|
+
* version on screen, as the viewer that follows an edit does, it also tells
|
|
13
|
+
* what changed, for a few seconds (spec `chat-file-selection-edit.md`).
|
|
9
14
|
*/
|
|
10
15
|
export declare function useChatFilePreview(read: (storedFileName: string) => Promise<ChatFilePreview>): {
|
|
11
16
|
target: globalThis.Ref<ChatFilePreviewTarget | undefined, ChatFilePreviewTarget | undefined>;
|
|
@@ -844,7 +849,8 @@ export declare function useChatFilePreview(read: (storedFileName: string) => Pro
|
|
|
844
849
|
} | undefined>;
|
|
845
850
|
loading: globalThis.Ref<boolean, boolean>;
|
|
846
851
|
error: globalThis.Ref<boolean, boolean>;
|
|
847
|
-
|
|
852
|
+
changes: globalThis.ShallowRef<ChatFilePreviewChanges | undefined>;
|
|
853
|
+
open: (next: ChatFilePreviewTarget, since?: string) => Promise<void>;
|
|
848
854
|
close: () => void;
|
|
849
855
|
reset: () => void;
|
|
850
856
|
};
|