@w100n/documents 0.16.2 → 0.16.3

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.
Files changed (39) hide show
  1. package/dist/{SheetView-S5AFXKPA.js → SheetView-KXFUAILH.js} +7 -5
  2. package/dist/SheetView-KXFUAILH.js.map +1 -0
  3. package/dist/{TextEditor-7WQJFUUU.js → TextEditor-RNHXPYJX.js} +4 -4
  4. package/dist/{chunk-KGAQT5M3.js → chunk-E2FVJNDT.js} +3 -3
  5. package/dist/{chunk-KGAQT5M3.js.map → chunk-E2FVJNDT.js.map} +1 -1
  6. package/dist/{chunk-LZYITB56.js → chunk-VNXZVOPN.js} +37 -1
  7. package/dist/chunk-VNXZVOPN.js.map +1 -0
  8. package/dist/{chunk-JC4DLTMI.js → chunk-XFLYD3JS.js} +2 -2
  9. package/dist/collab.cjs +37 -1
  10. package/dist/collab.cjs.map +1 -1
  11. package/dist/collab.d.cts +1 -1
  12. package/dist/collab.d.ts +1 -1
  13. package/dist/collab.js +2 -2
  14. package/dist/{grid-AZLMNS7K.js → grid-IR5YFFSF.js} +20 -2
  15. package/dist/grid-IR5YFFSF.js.map +1 -0
  16. package/dist/index.cjs +279 -16
  17. package/dist/index.cjs.map +1 -1
  18. package/dist/index.css +64 -0
  19. package/dist/index.css.map +1 -1
  20. package/dist/index.d.cts +2 -2
  21. package/dist/index.d.ts +2 -2
  22. package/dist/index.js +232 -18
  23. package/dist/index.js.map +1 -1
  24. package/dist/kinds.d.cts +1 -1
  25. package/dist/kinds.d.ts +1 -1
  26. package/dist/memory.cjs +6 -0
  27. package/dist/memory.cjs.map +1 -1
  28. package/dist/memory.d.cts +1 -1
  29. package/dist/memory.d.ts +1 -1
  30. package/dist/memory.js +6 -0
  31. package/dist/memory.js.map +1 -1
  32. package/dist/{types-DNcaU6SK.d.cts → types-BUO0OzOl.d.cts} +5 -0
  33. package/dist/{types-DNcaU6SK.d.ts → types-BUO0OzOl.d.ts} +5 -0
  34. package/package.json +1 -1
  35. package/dist/SheetView-S5AFXKPA.js.map +0 -1
  36. package/dist/chunk-LZYITB56.js.map +0 -1
  37. package/dist/grid-AZLMNS7K.js.map +0 -1
  38. /package/dist/{TextEditor-7WQJFUUU.js.map → TextEditor-RNHXPYJX.js.map} +0 -0
  39. /package/dist/{chunk-JC4DLTMI.js.map → chunk-XFLYD3JS.js.map} +0 -0
package/dist/collab.d.cts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { JSONContent } from '@tiptap/core';
2
2
  import * as Y from 'yjs';
3
3
  import { I as Img } from './write-BCI8yool.cjs';
4
- import { L as Language } from './types-DNcaU6SK.cjs';
4
+ import { L as Language } from './types-BUO0OzOl.cjs';
5
5
 
6
6
  declare function applyCells(doc: Y.Doc, list: {
7
7
  sheet: string;
package/dist/collab.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { JSONContent } from '@tiptap/core';
2
2
  import * as Y from 'yjs';
3
3
  import { I as Img } from './write-BCI8yool.js';
4
- import { L as Language } from './types-DNcaU6SK.js';
4
+ import { L as Language } from './types-BUO0OzOl.js';
5
5
 
6
6
  declare function applyCells(doc: Y.Doc, list: {
7
7
  sheet: string;
package/dist/collab.js CHANGED
@@ -11,9 +11,9 @@ import {
11
11
  pending,
12
12
  save,
13
13
  seed
14
- } from "./chunk-KGAQT5M3.js";
14
+ } from "./chunk-E2FVJNDT.js";
15
15
  import "./chunk-EQLBYW42.js";
16
- import "./chunk-LZYITB56.js";
16
+ import "./chunk-VNXZVOPN.js";
17
17
  import "./chunk-ZAVXCH7V.js";
18
18
  import "./chunk-ISOOUYLI.js";
19
19
  export {
@@ -31,7 +31,24 @@ import sortEn from "@univerjs/preset-sheets-sort/locales/en-US";
31
31
  import sortPl from "@univerjs/preset-sheets-sort/locales/pl-PL";
32
32
 
33
33
  // src/sheets/calm.ts
34
- var calm = (selection) => selection.style?.widgets && Object.values(selection.style.widgets).some(Boolean) ? { ...selection, style: { ...selection.style, widgets: {}, strokeWidth: 2 } } : selection;
34
+ import { ICommandService, ThemeService } from "@univerjs/core";
35
+ var pale = (color) => /^#[0-9a-f]{6}$/i.test(color) ? `${color}24` : color.replace(/^rgb\(([^)]+)\)$/i, "rgba($1, 0.14)");
36
+ var calm = (selection) => {
37
+ const style = selection.style;
38
+ if (!style?.widgets || !Object.values(style.widgets).some(Boolean)) return selection;
39
+ return { ...selection, style: { ...style, widgets: {}, strokeWidth: 3, fill: style.stroke ? pale(style.stroke) : style.fill } };
40
+ };
41
+ function bolder(injector) {
42
+ const theme = injector.get(ThemeService);
43
+ const tone = (color) => theme.isValidThemeColor(color) ? theme.getColorFromTheme(color) : color;
44
+ const refs = new Set(Array.from({ length: 12 }, (_, i) => tone(theme.getColorFromTheme(`loop-color.${i + 1}`))));
45
+ return injector.get(ICommandService).beforeCommandExecuted(({ id, params }) => {
46
+ if (id !== "doc.command.replace-text-runs") return;
47
+ params?.body?.textRuns?.forEach((run) => {
48
+ if (run.ts?.cl?.rgb && refs.has(run.ts.cl.rgb)) run.ts.bl = 1;
49
+ });
50
+ });
51
+ }
35
52
 
36
53
  // src/sheets/grid.ts
37
54
  var draw = SelectionControl.prototype.updateRangeBySelectionWithCoord;
@@ -91,7 +108,8 @@ function marks({ univer, univerAPI: api }) {
91
108
  };
92
109
  }
93
110
  export {
111
+ bolder,
94
112
  grid,
95
113
  marks
96
114
  };
97
- //# sourceMappingURL=grid-AZLMNS7K.js.map
115
+ //# sourceMappingURL=grid-IR5YFFSF.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/sheets/grid.ts","../src/sheets/calm.ts"],"sourcesContent":["import '@univerjs/preset-sheets-core/lib/index.css';\nimport '@univerjs/preset-sheets-sort/lib/index.css';\nimport '@univerjs/preset-sheets-filter/lib/index.css';\nimport '@univerjs/preset-sheets-find-replace/lib/index.css';\nimport '@univerjs/preset-sheets-data-validation/lib/index.css';\nimport '@univerjs/preset-sheets-note/lib/index.css';\nimport { createUniver, LocaleType, mergeLocales, purpleTheme } from '@univerjs/presets';\nimport { CalculationMode, IMarkSelectionService, SelectionControl, UniverSheetsCorePreset } from '@univerjs/preset-sheets-core';\nimport { UniverSheetsDataValidationPreset } from '@univerjs/preset-sheets-data-validation';\nimport { UniverSheetsFilterPreset } from '@univerjs/preset-sheets-filter';\nimport { UniverSheetsFindReplacePreset } from '@univerjs/preset-sheets-find-replace';\nimport { UniverSheetsNotePreset } from '@univerjs/preset-sheets-note';\nimport { UniverSheetsSortPreset } from '@univerjs/preset-sheets-sort';\nimport coreEn from '@univerjs/preset-sheets-core/locales/en-US';\nimport corePl from '@univerjs/preset-sheets-core/locales/pl-PL';\nimport checkEn from '@univerjs/preset-sheets-data-validation/locales/en-US';\nimport checkPl from '@univerjs/preset-sheets-data-validation/locales/pl-PL';\nimport filterEn from '@univerjs/preset-sheets-filter/locales/en-US';\nimport filterPl from '@univerjs/preset-sheets-filter/locales/pl-PL';\nimport findEn from '@univerjs/preset-sheets-find-replace/locales/en-US';\nimport findPl from '@univerjs/preset-sheets-find-replace/locales/pl-PL';\nimport noteEn from '@univerjs/preset-sheets-note/locales/en-US';\nimport notePl from '@univerjs/preset-sheets-note/locales/pl-PL';\nimport sortEn from '@univerjs/preset-sheets-sort/locales/en-US';\nimport sortPl from '@univerjs/preset-sheets-sort/locales/pl-PL';\nimport type { Language } from '../types';\nimport { bolder, calm } from './calm';\nimport { box } from './refs';\n\nexport type Mark = { sheet: string; range: string; color: string };\n\nconst draw = SelectionControl.prototype.updateRangeBySelectionWithCoord;\n// Univer draws eight resize handles on every formula reference and offers no option to turn them off.\nSelectionControl.prototype.updateRangeBySelectionWithCoord = function (selection, ...rest) { draw.call(this, calm(selection), ...rest); };\n\nexport function grid(container: HTMLElement, language: Language, edit: boolean) {\n return createUniver({\n locale: language === 'pl' ? LocaleType.PL_PL : LocaleType.EN_US,\n locales: {\n [LocaleType.EN_US]: mergeLocales(coreEn, checkEn, filterEn, findEn, noteEn, sortEn),\n [LocaleType.PL_PL]: mergeLocales(corePl, checkPl, filterPl, findPl, notePl, sortPl),\n },\n theme: { ...purpleTheme, 'loop-color': { 1: 'blue.500', 2: 'red.500', 3: 'green.600', 4: 'orange.500', 5: 'purple.500', 6: 'jiqing.600', 7: 'pink.500', 8: 'yellow.700', 9: 'indigo.600', 10: 'red.700', 11: 'green.800', 12: 'blue.800' } },\n darkMode: false,\n presets: [\n UniverSheetsCorePreset({\n container, toolbar: false, formulaBar: true, contextMenu: true, disableAutoFocus: true,\n footer: { sheetBar: true, statisticBar: true, menus: edit, zoomSlider: true, addSheetButtonConfig: { show: edit } },\n formula: { initialFormulaComputing: CalculationMode.WHEN_EMPTY },\n }),\n UniverSheetsSortPreset(),\n UniverSheetsFilterPreset(),\n UniverSheetsFindReplacePreset(),\n UniverSheetsDataValidationPreset(),\n UniverSheetsNotePreset(),\n ],\n });\n}\n\nexport { bolder };\n\nexport function marks({ univer, univerAPI: api }: ReturnType<typeof grid>) {\n const service = univer.__getInjector().get(IMarkSelectionService);\n let list: Mark[] = [];\n let ids: string[] = [];\n const draw = () => {\n ids.forEach(id => service.removeShape(id));\n const sid = api.getActiveWorkbook()?.getActiveSheet().getSheetId();\n ids = list.filter(m => m.sheet === sid).flatMap(m => {\n const b = box(m.range);\n const id = b && service.addShape({ range: b, primary: null, style: { stroke: m.color, fill: `${m.color}1f`, strokeWidth: 2, widgets: {} } }, [], 1000);\n return id ? [id] : [];\n });\n };\n const turn = api.addEvent(api.Event.ActiveSheetChanged, draw);\n return {\n show: (next: Mark[]) => { list = next; draw(); },\n dispose: () => { turn.dispose(); ids.forEach(id => service.removeShape(id)); },\n };\n}\n","import { ICommandService, ThemeService, type Injector } from '@univerjs/core';\n\ntype Style = { widgets?: object; strokeWidth?: number; stroke?: string; fill?: string };\ntype Run = { ts?: { cl?: { rgb?: string | null } | null; bl?: number } };\n\nconst pale = (color: string) => /^#[0-9a-f]{6}$/i.test(color) ? `${color}24` : color.replace(/^rgb\\(([^)]+)\\)$/i, 'rgba($1, 0.14)');\n\nexport const calm = <T extends { style?: Style | null | void }>(selection: T): T => {\n const style = selection.style;\n if (!style?.widgets || !Object.values(style.widgets).some(Boolean)) return selection;\n return { ...selection, style: { ...style, widgets: {}, strokeWidth: 3, fill: style.stroke ? pale(style.stroke) : style.fill } };\n};\n\nexport function bolder(injector: Injector) {\n const theme = injector.get(ThemeService);\n const tone = (color: string) => theme.isValidThemeColor(color) ? theme.getColorFromTheme(color) : color;\n const refs = new Set(Array.from({ length: 12 }, (_, i) => tone(theme.getColorFromTheme(`loop-color.${i + 1}`))));\n return injector.get(ICommandService).beforeCommandExecuted(({ id, params }) => {\n if (id !== 'doc.command.replace-text-runs') return;\n (params as { body?: { textRuns?: Run[] } } | undefined)?.body?.textRuns?.forEach(run => {\n if (run.ts?.cl?.rgb && refs.has(run.ts.cl.rgb)) run.ts.bl = 1;\n });\n });\n}\n"],"mappings":"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","names":["draw"]}
package/dist/index.cjs CHANGED
@@ -98,6 +98,18 @@ var init_text = __esm({
98
98
  retry: "Try again",
99
99
  loading: "Loading",
100
100
  unsupported: "This file cannot be shown yet",
101
+ sendChat: "Send to chat",
102
+ openFile: "Open",
103
+ openTab: "Open in a new tab",
104
+ copyLink: "Copy link",
105
+ linkCopied: "Link copied",
106
+ trash: "Move to trash",
107
+ trashAsk: "Move {name} to trash?",
108
+ trashed: "Moved to trash",
109
+ createdOn: "Created {when}",
110
+ updatedOn: "Updated {when}",
111
+ actionFailed: "Could not do that",
112
+ fileActions: "File actions",
101
113
  teamTemplates: "Team templates",
102
114
  saveTemplate: "Save as template",
103
115
  templateSaved: "Saved to Templates",
@@ -439,6 +451,18 @@ var init_text = __esm({
439
451
  retry: "Spr\xF3buj ponownie",
440
452
  loading: "Wczytywanie",
441
453
  unsupported: "Tego pliku nie da si\u0119 jeszcze pokaza\u0107",
454
+ sendChat: "Wy\u015Blij na czat",
455
+ openFile: "Otw\xF3rz",
456
+ openTab: "Otw\xF3rz w nowej karcie",
457
+ copyLink: "Kopiuj link",
458
+ linkCopied: "Skopiowano link",
459
+ trash: "Przenie\u015B do kosza",
460
+ trashAsk: "Przenie\u015B\u0107 {name} do kosza?",
461
+ trashed: "Przeniesiono do kosza",
462
+ createdOn: "Utworzono {when}",
463
+ updatedOn: "Zmieniono {when}",
464
+ actionFailed: "Nie uda\u0142o si\u0119",
465
+ fileActions: "Dzia\u0142ania na pliku",
442
466
  teamTemplates: "Szablony zespo\u0142u",
443
467
  saveTemplate: "Zapisz jako szablon",
444
468
  templateSaved: "Zapisano w Szablonach",
@@ -780,6 +804,18 @@ var init_text = __esm({
780
804
  retry: "\u0421\u043F\u0440\u043E\u0431\u0443\u0432\u0430\u0442\u0438 \u0449\u0435",
781
805
  loading: "\u0417\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0435\u043D\u043D\u044F",
782
806
  unsupported: "\u0426\u0435\u0439 \u0444\u0430\u0439\u043B \u043F\u043E\u043A\u0438 \u043D\u0435 \u043C\u043E\u0436\u043D\u0430 \u043F\u043E\u043A\u0430\u0437\u0430\u0442\u0438",
807
+ sendChat: "\u041D\u0430\u0434\u0456\u0441\u043B\u0430\u0442\u0438 \u0432 \u0447\u0430\u0442",
808
+ openFile: "\u0412\u0456\u0434\u043A\u0440\u0438\u0442\u0438",
809
+ openTab: "\u0412\u0456\u0434\u043A\u0440\u0438\u0442\u0438 \u0432 \u043D\u043E\u0432\u0456\u0439 \u0432\u043A\u043B\u0430\u0434\u0446\u0456",
810
+ copyLink: "\u041A\u043E\u043F\u0456\u044E\u0432\u0430\u0442\u0438 \u043F\u043E\u0441\u0438\u043B\u0430\u043D\u043D\u044F",
811
+ linkCopied: "\u041F\u043E\u0441\u0438\u043B\u0430\u043D\u043D\u044F \u0441\u043A\u043E\u043F\u0456\u0439\u043E\u0432\u0430\u043D\u043E",
812
+ trash: "\u0423 \u043A\u043E\u0448\u0438\u043A",
813
+ trashAsk: "\u041F\u0435\u0440\u0435\u043C\u0456\u0441\u0442\u0438\u0442\u0438 {name} \u0443 \u043A\u043E\u0448\u0438\u043A?",
814
+ trashed: "\u041F\u0435\u0440\u0435\u043C\u0456\u0449\u0435\u043D\u043E \u0432 \u043A\u043E\u0448\u0438\u043A",
815
+ createdOn: "\u0421\u0442\u0432\u043E\u0440\u0435\u043D\u043E {when}",
816
+ updatedOn: "\u0417\u043C\u0456\u043D\u0435\u043D\u043E {when}",
817
+ actionFailed: "\u041D\u0435 \u0432\u0434\u0430\u043B\u043E\u0441\u044F",
818
+ fileActions: "\u0414\u0456\u0457 \u0437 \u0444\u0430\u0439\u043B\u043E\u043C",
783
819
  teamTemplates: "\u0428\u0430\u0431\u043B\u043E\u043D\u0438 \u043A\u043E\u043C\u0430\u043D\u0434\u0438",
784
820
  saveTemplate: "\u0417\u0431\u0435\u0440\u0435\u0433\u0442\u0438 \u044F\u043A \u0448\u0430\u0431\u043B\u043E\u043D",
785
821
  templateSaved: "\u0417\u0431\u0435\u0440\u0435\u0436\u0435\u043D\u043E \u0432 Templates",
@@ -4735,7 +4771,7 @@ var init_extensions = __esm({
4735
4771
  var version;
4736
4772
  var init_package = __esm({
4737
4773
  "package.json"() {
4738
- version = "0.16.2";
4774
+ version = "0.16.3";
4739
4775
  }
4740
4776
  });
4741
4777
 
@@ -10080,17 +10116,35 @@ var init_sheets = __esm({
10080
10116
  });
10081
10117
 
10082
10118
  // src/sheets/calm.ts
10083
- var calm;
10119
+ function bolder(injector) {
10120
+ const theme = injector.get(import_core5.ThemeService);
10121
+ const tone = (color2) => theme.isValidThemeColor(color2) ? theme.getColorFromTheme(color2) : color2;
10122
+ const refs3 = new Set(Array.from({ length: 12 }, (_, i) => tone(theme.getColorFromTheme(`loop-color.${i + 1}`))));
10123
+ return injector.get(import_core5.ICommandService).beforeCommandExecuted(({ id, params }) => {
10124
+ if (id !== "doc.command.replace-text-runs") return;
10125
+ params?.body?.textRuns?.forEach((run3) => {
10126
+ if (run3.ts?.cl?.rgb && refs3.has(run3.ts.cl.rgb)) run3.ts.bl = 1;
10127
+ });
10128
+ });
10129
+ }
10130
+ var import_core5, pale, calm;
10084
10131
  var init_calm = __esm({
10085
10132
  "src/sheets/calm.ts"() {
10086
10133
  "use strict";
10087
- calm = (selection) => selection.style?.widgets && Object.values(selection.style.widgets).some(Boolean) ? { ...selection, style: { ...selection.style, widgets: {}, strokeWidth: 2 } } : selection;
10134
+ import_core5 = require("@univerjs/core");
10135
+ pale = (color2) => /^#[0-9a-f]{6}$/i.test(color2) ? `${color2}24` : color2.replace(/^rgb\(([^)]+)\)$/i, "rgba($1, 0.14)");
10136
+ calm = (selection) => {
10137
+ const style = selection.style;
10138
+ if (!style?.widgets || !Object.values(style.widgets).some(Boolean)) return selection;
10139
+ return { ...selection, style: { ...style, widgets: {}, strokeWidth: 3, fill: style.stroke ? pale(style.stroke) : style.fill } };
10140
+ };
10088
10141
  }
10089
10142
  });
10090
10143
 
10091
10144
  // src/sheets/grid.ts
10092
10145
  var grid_exports = {};
10093
10146
  __export(grid_exports, {
10147
+ bolder: () => bolder,
10094
10148
  grid: () => grid2,
10095
10149
  marks: () => marks
10096
10150
  });
@@ -10245,7 +10299,7 @@ function SheetView({ bytes, name, kind, rights, language, theme, onChange, onSav
10245
10299
  setDirty(false);
10246
10300
  const families = new Set([model.book.defaultStyle, ...Object.values(model.book.styles)].map((s) => typeof s === "object" ? s?.ff : null).filter(Boolean));
10247
10301
  const fonts = Promise.race([Promise.all([...families].flatMap((f) => ["", "bold ", "italic "].map((w) => document.fonts.load(`${w}11pt "${f}"`).catch(() => [])))), new Promise((r) => setTimeout(r, 800))]);
10248
- Promise.all([Promise.resolve().then(() => (init_grid(), grid_exports)), fonts]).then(([{ grid: grid3, marks: marks2 }]) => {
10302
+ Promise.all([Promise.resolve().then(() => (init_grid(), grid_exports)), fonts]).then(([{ bolder: bolder2, grid: grid3, marks: marks2 }]) => {
10249
10303
  if (gone) return;
10250
10304
  shared?.doc.off("update", change);
10251
10305
  if (shared && moved) model = extras(shared.doc, build(shared.doc));
@@ -10255,6 +10309,7 @@ function SheetView({ bytes, name, kind, rights, language, theme, onChange, onSav
10255
10309
  const view = grid3(host2, language, edit);
10256
10310
  const { univer, univerAPI: api2 } = view;
10257
10311
  const wb = api2.createWorkbook(model.book);
10312
+ const unbold = bolder2(univer.__getInjector());
10258
10313
  if (model.active) wb.setActiveSheet(model.active);
10259
10314
  if (!edit) wb.setEditable(false);
10260
10315
  const state = { api: api2, model, original: bytes, changes: 0 };
@@ -10294,6 +10349,7 @@ function SheetView({ bytes, name, kind, rights, language, theme, onChange, onSav
10294
10349
  live.current = state;
10295
10350
  stop = () => {
10296
10351
  unbind();
10352
+ unbold.dispose();
10297
10353
  state.marks?.dispose();
10298
10354
  untrack();
10299
10355
  selection.dispose();
@@ -10417,7 +10473,7 @@ function SheetView({ bytes, name, kind, rights, language, theme, onChange, onSav
10417
10473
  const sum = () => {
10418
10474
  const r = range()?.getRange();
10419
10475
  const ws = sheet2();
10420
- const numeric2 = (row2, c) => ws?.getRange(row2, c).getCellData()?.t === import_core5.CellValueType.NUMBER;
10476
+ const numeric2 = (row2, c) => ws?.getRange(row2, c).getCellData()?.t === import_core6.CellValueType.NUMBER;
10421
10477
  if (r && ws) for (const x of autoSum(r, numeric2)) ws.getRange(x.row, x.col).setValue({ f: x.f });
10422
10478
  };
10423
10479
  const shown = formats.find(([, p]) => p === look?.n)?.[0] ?? (look && look.n !== "General" ? look.n : t.general);
@@ -10584,13 +10640,13 @@ function SheetView({ bytes, name, kind, rights, language, theme, onChange, onSav
10584
10640
  ] })
10585
10641
  ] });
10586
10642
  }
10587
- var import_react12, import_lucide_react6, import_core5, import_jsx_runtime8, decimals, letters2, SheetView_default;
10643
+ var import_react12, import_lucide_react6, import_core6, import_jsx_runtime8, decimals, letters2, SheetView_default;
10588
10644
  var init_SheetView = __esm({
10589
10645
  "src/sheets/SheetView.tsx"() {
10590
10646
  "use strict";
10591
10647
  import_react12 = require("react");
10592
10648
  import_lucide_react6 = require("lucide-react");
10593
- import_core5 = require("@univerjs/core");
10649
+ import_core6 = require("@univerjs/core");
10594
10650
  init_live();
10595
10651
  init_focus();
10596
10652
  init_bind();
@@ -13906,6 +13962,27 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
13906
13962
  document.addEventListener("pointerdown", close);
13907
13963
  return () => document.removeEventListener("pointerdown", close);
13908
13964
  }, [picking]);
13965
+ const [menu, setMenu] = (0, import_react17.useState)(null);
13966
+ const [naming, setNaming] = (0, import_react17.useState)(null);
13967
+ const [notice, setNotice] = (0, import_react17.useState)(null);
13968
+ const early = (0, import_react17.useRef)(/* @__PURE__ */ new Map());
13969
+ const hover = (0, import_react17.useRef)(0);
13970
+ (0, import_react17.useEffect)(() => {
13971
+ if (!menu) return;
13972
+ const close = (e) => {
13973
+ if (e.type === "pointerdown" && e.target.closest(".w100n-docs-context")) return;
13974
+ if (e.type === "keydown" && e.key !== "Escape") return;
13975
+ setMenu(null);
13976
+ };
13977
+ document.addEventListener("pointerdown", close);
13978
+ window.addEventListener("keydown", close);
13979
+ window.addEventListener("scroll", close, true);
13980
+ return () => {
13981
+ document.removeEventListener("pointerdown", close);
13982
+ window.removeEventListener("keydown", close);
13983
+ window.removeEventListener("scroll", close, true);
13984
+ };
13985
+ }, [menu]);
13909
13986
  const [tab, setTab] = (0, import_react17.useState)("outline");
13910
13987
  const [outline2, setOutline] = (0, import_react17.useState)([]);
13911
13988
  const [reading, setReading] = (0, import_react17.useState)(null);
@@ -13947,9 +14024,15 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
13947
14024
  document.removeEventListener("visibilitychange", sync);
13948
14025
  };
13949
14026
  }, []);
13950
- const doc = useLoad((signal) => here.documentId ? host.document(here.documentId, { signal }) : Promise.resolve(null), [host, here.documentId]);
14027
+ const take = (id, key2) => {
14028
+ const kept2 = early.current.get(id);
14029
+ const found = kept2 && Date.now() - kept2.at < 15e3 ? kept2[key2] : void 0;
14030
+ if (kept2) delete kept2[key2];
14031
+ return found;
14032
+ };
14033
+ const doc = useLoad((signal) => here.documentId ? take(here.documentId, "doc") ?? host.document(here.documentId, { signal }) : Promise.resolve(null), [host, here.documentId]);
13951
14034
  const versions = useLoad((signal) => here.documentId ? host.versions(here.documentId, { signal }) : Promise.resolve([]), [host, here.documentId]);
13952
- const content = useLoad((signal) => here.documentId ? host.content(here.documentId, versionId, { signal }) : Promise.resolve(null), [host, here.documentId, versionId]);
14035
+ const content = useLoad((signal) => here.documentId ? !versionId && take(here.documentId, "bytes") || host.content(here.documentId, versionId, { signal }) : Promise.resolve(null), [host, here.documentId, versionId]);
13953
14036
  const pdf = doc.data?.kind === "pdf";
13954
14037
  const text = doc.data?.kind === "markdown" || doc.data?.kind === "docx";
13955
14038
  const docbar = text && !versionId && !narrow;
@@ -14081,6 +14164,52 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
14081
14164
  setKept({ id: file.id, state: "failed" });
14082
14165
  }
14083
14166
  };
14167
+ const warm = (item) => {
14168
+ clearTimeout(hover.current);
14169
+ hover.current = window.setTimeout(() => {
14170
+ if (item.id === here.documentId) return;
14171
+ if (item.kind === "docx" || item.kind === "markdown") void Promise.resolve().then(() => (init_TextEditor(), TextEditor_exports));
14172
+ if (item.kind === "sheet") void Promise.resolve().then(() => (init_SheetView(), SheetView_exports));
14173
+ const kept2 = early.current.get(item.id);
14174
+ if (kept2 && Date.now() - kept2.at < 15e3 || item.size > 5e6) return;
14175
+ const next = { at: Date.now(), doc: host.document(item.id), bytes: host.content(item.id, null) };
14176
+ next.doc.catch(() => {
14177
+ });
14178
+ next.bytes.catch(() => {
14179
+ });
14180
+ early.current.set(item.id, next);
14181
+ }, 150);
14182
+ };
14183
+ const act = async (run3, done) => {
14184
+ setMenu(null);
14185
+ setNotice(null);
14186
+ try {
14187
+ await run3();
14188
+ if (done) setNotice(done);
14189
+ } catch {
14190
+ setNotice(t.actionFailed);
14191
+ }
14192
+ };
14193
+ const fetchFile = async (item) => {
14194
+ const url = URL.createObjectURL(new Blob([await host.content(item.id)]));
14195
+ const link = Object.assign(document.createElement("a"), { href: url, download: item.name });
14196
+ link.click();
14197
+ setTimeout(() => URL.revokeObjectURL(url), 1e3);
14198
+ };
14199
+ const retitle = async (item, draft) => {
14200
+ setNaming(null);
14201
+ const ext = /\.[^.]+$/.exec(item.name)?.[0] ?? "";
14202
+ const name = draft.trim() && (/\.[^.\s]+$/.test(draft.trim()) ? draft.trim() : draft.trim() + ext);
14203
+ if (!name || name === item.name) return;
14204
+ await act(() => host.rename(item.id, name));
14205
+ list.retry();
14206
+ if (item.id === here.documentId) doc.retry();
14207
+ };
14208
+ const drop2 = async (item) => {
14209
+ await act(() => host.remove(item.id), t.trashed);
14210
+ list.retry();
14211
+ if (item.id === here.documentId) go({ spaceId: here.spaceId, documentId: null });
14212
+ };
14084
14213
  const rename = async (file, draft) => {
14085
14214
  setRenaming(null);
14086
14215
  const ext = /\.[^.]+$/.exec(file.name)?.[0] ?? "";
@@ -14327,6 +14456,21 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
14327
14456
  kept?.id === here.documentId && kept.state === "failed" && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "w100n-docs-muted", role: "alert", children: t.templateFailed }),
14328
14457
  renamed2 === "failed" && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "w100n-docs-muted", children: t.renameFailed }),
14329
14458
  docbar && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { ref: setStatusAt, className: "w100n-docs-status" }),
14459
+ host.send && doc.data && !versionId && !doc.data.id.includes(":") && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
14460
+ "button",
14461
+ {
14462
+ type: "button",
14463
+ className: "w100n-docs-action",
14464
+ "data-tone": "blue",
14465
+ "aria-label": t.sendChat,
14466
+ title: t.sendChat,
14467
+ onClick: () => host.send(doc.data.id),
14468
+ children: [
14469
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react10.Send, { "aria-hidden": true }),
14470
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: t.sendChat })
14471
+ ]
14472
+ }
14473
+ ),
14330
14474
  sharing && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", className: "w100n-docs-action", "aria-label": t.share, title: t.share, onClick: () => {
14331
14475
  setTab("sharing");
14332
14476
  side2("panel", true);
@@ -14455,17 +14599,56 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
14455
14599
  sending === "failed" && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "w100n-docs-muted", role: "alert", children: t.uploadFailed }),
14456
14600
  list.error && failed(list.retry),
14457
14601
  list.loading && !list.data && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "w100n-docs-muted", children: t.loading }),
14602
+ notice && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "w100n-docs-muted", role: "status", children: notice }),
14458
14603
  list.data && !shown.length && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "w100n-docs-muted", children: all.length ? t.nothing : t.empty }),
14459
14604
  folders.map((folder2) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "w100n-docs-folder", role: "group", "aria-label": folder2 || t.loose, children: [
14460
14605
  folders.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "w100n-docs-group", children: folder2 || t.loose }),
14461
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "w100n-docs-grid", children: shown.filter((item) => !spaceId || (item.folder ?? "") === folder2).map((item) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", className: "w100n-docs-card", "aria-current": item.id === here.documentId, onClick: () => open(item), title: item.name, children: [
14606
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "w100n-docs-grid", children: shown.filter((item) => !spaceId || (item.folder ?? "") === folder2).map((item) => naming?.id === item.id ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "w100n-docs-card", children: [
14462
14607
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Thumb, { host, item, label: t.kinds[item.kind] }),
14463
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { className: "w100n-docs-card-text", children: [
14464
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("b", { children: item.name }),
14465
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: [!spaceId && names2.get(item.spaceId), ago(item.updatedAt)].filter(Boolean).join(" \xB7 ") }),
14466
- inside2.get(item.id) && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { className: "w100n-docs-hit", children: inside2.get(item.id).split(/[«»]/).map((part, i) => i % 2 ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("mark", { children: part }, i) : part) })
14467
- ] })
14468
- ] }, item.id)) })
14608
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "w100n-docs-card-text", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
14609
+ "input",
14610
+ {
14611
+ className: "w100n-docs-field",
14612
+ autoFocus: true,
14613
+ value: naming.text,
14614
+ "aria-label": t.rename,
14615
+ onFocus: (e) => e.currentTarget.select(),
14616
+ onChange: (e) => setNaming({ ...naming, text: e.target.value }),
14617
+ onBlur: () => void retitle(item, naming.text),
14618
+ onKeyDown: (e) => {
14619
+ if (e.key === "Enter") e.currentTarget.blur();
14620
+ if (e.key === "Escape") {
14621
+ e.stopPropagation();
14622
+ setNaming(null);
14623
+ }
14624
+ }
14625
+ }
14626
+ ) })
14627
+ ] }, item.id) : /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
14628
+ "button",
14629
+ {
14630
+ type: "button",
14631
+ className: "w100n-docs-card",
14632
+ "aria-current": item.id === here.documentId,
14633
+ onClick: () => open(item),
14634
+ title: item.name,
14635
+ onPointerEnter: () => warm(item),
14636
+ onPointerLeave: () => clearTimeout(hover.current),
14637
+ onContextMenu: (e) => {
14638
+ e.preventDefault();
14639
+ setMenu({ item, x: Math.min(e.clientX, innerWidth - 290), y: Math.min(e.clientY, innerHeight - 440), sure: false });
14640
+ },
14641
+ children: [
14642
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Thumb, { host, item, label: t.kinds[item.kind] }),
14643
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { className: "w100n-docs-card-text", children: [
14644
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("b", { children: item.name }),
14645
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: [!spaceId && names2.get(item.spaceId), ago(item.updatedAt)].filter(Boolean).join(" \xB7 ") }),
14646
+ inside2.get(item.id) && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { className: "w100n-docs-hit", children: inside2.get(item.id).split(/[«»]/).map((part, i) => i % 2 ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("mark", { children: part }, i) : part) })
14647
+ ] })
14648
+ ]
14649
+ },
14650
+ item.id
14651
+ )) })
14469
14652
  ] }, folder2))
14470
14653
  ] })
14471
14654
  ] }),
@@ -14634,6 +14817,86 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
14634
14817
  setMaking(false);
14635
14818
  opened2(made2);
14636
14819
  } }),
14820
+ menu && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "w100n-docs-menu w100n-docs-context", role: "menu", "aria-label": t.fileActions, style: { left: menu.x, top: menu.y }, children: [
14821
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "w100n-docs-context-head", children: [
14822
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("b", { children: menu.item.name }),
14823
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: [t.kinds[menu.item.kind], size2(menu.item.size), names2.get(menu.item.spaceId), menu.item.folder].filter(Boolean).join(" \xB7 ") }),
14824
+ menu.item.createdAt && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: [t.createdOn.replace("{when}", date(menu.item.createdAt)), menu.item.createdBy?.name].filter(Boolean).join(" \xB7 ") }),
14825
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: [t.updatedOn.replace("{when}", ago(menu.item.updatedAt)), menu.item.updatedBy?.name].filter(Boolean).join(" \xB7 ") })
14826
+ ] }),
14827
+ menu.sure ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "w100n-docs-context-ask", children: [
14828
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { children: t.trashAsk.replace("{name}", menu.item.name) }),
14829
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { className: "w100n-pdf-dialog-end", children: [
14830
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", className: "w100n-pdf-link", onClick: () => setMenu({ ...menu, sure: false }), children: t.cancel }),
14831
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", className: "w100n-docs-action", "data-tone": "red", onClick: () => void drop2(menu.item), children: [
14832
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react10.Trash2, { "aria-hidden": true }),
14833
+ t.trash
14834
+ ] })
14835
+ ] })
14836
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
14837
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", role: "menuitem", onClick: () => {
14838
+ setMenu(null);
14839
+ open(menu.item);
14840
+ }, children: [
14841
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react10.FileText, { "aria-hidden": true }),
14842
+ t.openFile
14843
+ ] }),
14844
+ host.href && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", role: "menuitem", onClick: () => {
14845
+ setMenu(null);
14846
+ window.open(host.href(menu.item.id), "_blank", "noopener");
14847
+ }, children: [
14848
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react10.ExternalLink, { "aria-hidden": true }),
14849
+ t.openTab
14850
+ ] }),
14851
+ host.href && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", role: "menuitem", onClick: () => void act(() => navigator.clipboard.writeText(host.href(menu.item.id)), t.linkCopied), children: [
14852
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react10.Link, { "aria-hidden": true }),
14853
+ t.copyLink
14854
+ ] }),
14855
+ host.send && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", role: "menuitem", onClick: () => {
14856
+ setMenu(null);
14857
+ host.send(menu.item.id);
14858
+ }, children: [
14859
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react10.Send, { "aria-hidden": true }),
14860
+ t.sendChat
14861
+ ] }),
14862
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("hr", {}),
14863
+ host.rename && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", role: "menuitem", onClick: () => {
14864
+ setMenu(null);
14865
+ setNaming({ id: menu.item.id, text: menu.item.name.replace(/\.[^.]+$/, "") });
14866
+ }, children: [
14867
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react10.Pencil, { "aria-hidden": true }),
14868
+ t.rename
14869
+ ] }),
14870
+ host.create && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", role: "menuitem", onClick: () => void act(async () => copy2(await host.document(menu.item.id))), children: [
14871
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react10.Copy, { "aria-hidden": true }),
14872
+ t.makeCopy
14873
+ ] }),
14874
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", role: "menuitem", onClick: () => void act(() => fetchFile(menu.item)), children: [
14875
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react10.Download, { "aria-hidden": true }),
14876
+ t.download
14877
+ ] }),
14878
+ host.saveTemplate && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", role: "menuitem", onClick: () => void act(() => host.saveTemplate(menu.item.id), t.templateSaved), children: [
14879
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react10.Bookmark, { "aria-hidden": true }),
14880
+ t.saveTemplate
14881
+ ] }),
14882
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", role: "menuitem", onClick: () => {
14883
+ setMenu(null);
14884
+ open(menu.item);
14885
+ setTab("details");
14886
+ side2("panel", true);
14887
+ }, children: [
14888
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react10.Info, { "aria-hidden": true }),
14889
+ t.details
14890
+ ] }),
14891
+ host.remove && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
14892
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("hr", {}),
14893
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", role: "menuitem", "data-tone": "red", onClick: () => setMenu({ ...menu, sure: true }), children: [
14894
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react10.Trash2, { "aria-hidden": true }),
14895
+ t.trash
14896
+ ] })
14897
+ ] })
14898
+ ] })
14899
+ ] }),
14637
14900
  dialog
14638
14901
  ] });
14639
14902
  }